lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon,  6 Dec 2010 18:24:29 -0500
From:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To:	airlied@...ux.ie, tglx@...utronix.de, hpa@...or.com,
	airlied@...hat.com, linux-kernel@...r.kernel.org, konrad@...nel.org
Cc:	Jeremy Fitzhardinge <jeremy@...p.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Subject: [PATCH 17/23] agp: Make agp_generic_[create|free]_gatt_table be aware of PCI API.

In case the platform does not use the PCI API, we want to
still use the old mechanism of saving the gatt_bus_addr.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
---
 drivers/char/agp/generic.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
index b21eebb..534dccb 100644
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -911,6 +911,7 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
 	temp = bridge->current_size;
 	size = page_order = num_entries = 0;
 
+	bridge->gatt_bus_addr = DMA_ERROR_CODE;
 	if (bridge->driver->size_type != FIXED_APER_SIZE) {
 		do {
 			switch (bridge->driver->size_type) {
@@ -999,10 +1000,12 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
 			ClearPageReserved(page);
 
 		free_gatt_pages(bridge, page_order);
-
+		bridge->gatt_bus_addr = DMA_ERROR_CODE;
 		return -ENOMEM;
 	}
-	bridge->gatt_bus_addr = virt_to_phys(bridge->gatt_table_real);
+	/* If using PCI API, alloc_gatt_pages would fill in gatt_bus_addr. */
+	if (bridge->gatt_bus_addr == DMA_ERROR_CODE)
+		bridge->gatt_bus_addr = virt_to_phys(bridge->gatt_table_real);
 
 	/* AK: bogus, should encode addresses > 4GB */
 	for (i = 0; i < num_entries; i++) {
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ