Skip to contentSkip to conversation

aic79xx - wrong max memory at driver init

PATCH Frederic TEMPORELLI 3 participants 3 messages Nov 30, 2006 – Dec 15, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello Hannes,

Aic79xx driver for Adaptec 39320 supports 64-bit addressing, but the initialization code of the driver is wrong: it tests the available memory size instead of testing the maximum available memory address. This is necessary to support servers that provides 1 Terabyte of physical memory space addressing.

Attached is the suggested patch (made against 2.6.17, but 2.6.19 is still using the available memory size instead of using the max memory address) to solve this issue.

regards

--
Fred

Signed-off-by [email protected]
Signed-off-by [email protected]
drivers/scsi/aic7xxx/aic79xx_osm.c 2006-09-14 16:44:24.000000000 +0200 renamed from drivers/scsi/aic7xxx/aic79xx_osm.c 2006-08-23 23:16:33.000000000 +0200 +4 -4
@@ -62,6 +62,7 @@
 
 #include <linux/mm.h>          /* For fetching system memory size */
 
+extern unsigned long blk_max_pfn;
 static struct scsi_transport_template *ahd_linux_transport_template = NULL;
 
 #include <linux/init.h>                /* __setup */
@@ -1175,10 +1176,9 @@ ahd_linux_register_host(struct ahd_softc
 uint64_t
 ahd_linux_get_memsize(void)
 {
-       struct sysinfo si;
-
-       si_meminfo(&si);
-       return ((uint64_t)si.totalram << PAGE_SHIFT);
+       /* Need to take in account the max physical address in case
+        * of discontiguous memory. */
+       return ((uint64_t)blk_max_pfn << PAGE_SHIFT);
 }
 
 /*
#1 lore raw
Quoted 8 lines · Frederic TEMPORELLI

Hello Hannes,

Aic79xx driver for Adaptec 39320 supports 64-bit addressing, but the initialization code of the driver is wrong: it tests the available memory size instead of testing the maximum available memory address. This is necessary to support servers that provides 1 Terabyte of physical memory space addressing.

Quoted 10 lines

Attached is the suggested patch (made against 2.6.17, but 2.6.19 is still using the available memory size instead of using the max memory address) to solve this issue.

regards

--
Fred

Yes, this sound reasonable.

Quoted 5 lines

------------------------------------------------------------------------

Signed-off-by [email protected]
Signed-off-by [email protected]
Signature · 8 lines
Dr. Hannes Reinecke			[email protected]
SuSE Linux Products GmbH		S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 9 lines · Hannes Reinecke
Quoted 8 lines · Frederic TEMPORELLI

Hello Hannes,

Aic79xx driver for Adaptec 39320 supports 64-bit addressing, but the initialization code of the driver is wrong: it tests the available memory size instead of testing the maximum available memory address. This is necessary to support servers that provides 1 Terabyte of physical memory space addressing.

Quoted 3 lines
Quoted 3 lines

Attached is the suggested patch (made against 2.6.17, but 2.6.19 is still using the available memory size instead of using the max memory address) to solve this issue.

Actually, this driver shouldn't be hacking around at all with either the memory functions or blk_max_pfn, it should be using the provided api, which is dma_get_required_mask()

James

Quoted 5 lines
Quoted 3 lines
Signed-off-by [email protected]
Signed-off-by [email protected]