QLogic qla2xxx driver update available (v8.00.00b2).
All,
A new version of the 8.x series driver for Linux 2.5.x kernels has been uploaded to SourceForge:
http://sourceforge.net/projects/linux-qla2xxx/
In addition to the standard kernel-tree and external build tar-balls, a patch file is provided to update v8.00.00b1 sources to v8.00.00b2.
Changes include:
* - Add support for new 'Hotplug initialization' model.
* - Simplify host template by removing unused callbacks.
* - Use scsicam facilities to determine geometry.
* - Fix compilation issues for non-ISP23xx builds:
* - Correct register references in qla_dbg.c.
* - Correct Makefile build process.
* - Simplify dma_addr_t handling during command queuing given
* new block-layer defined restrictions:
* - Physical addresses not spanning 4GB boundaries.
* - Resync with 2.5.69-bk8.
Regards,
Andrew Vasquez
QLogic Corporation
All,
If anyone is having problems with the 8.x driver and memory-mapped I/O, attached is a small patch that should fix the problem. The patch is already rolled into my pre-beta3.
pci_config_fix-v8.00.00b2.diff
Thanks go to Patrick Mansfield for reporting this.
Regards,
Andrew Vasquez
qla_def.h +1 -3
@@ -109,10 +109,8 @@/* * I/O register */ -/* #define MEMORY_MAPPED_IO */ /* Enable memory mapped I/O */ -#undef MEMORY_MAPPED_IO/* Disable memory mapped I/O */ -#if defined(MEMORY_MAPPED_IO ) +#if MEMORY_MAPPED_IO #define RD_REG_BYTE (addr) readb(addr)#define RD_REG_WORD (addr) readw(addr)#define RD_REG_DWORD (addr) readl(addr)
qla_init.c +20 -23
63 lines not on this page · raw message
Hi,
qla_init.c line 524
Quoted 3 lines
qla_init.c +3
-0+#if MEMORY_MAPPED_IO +/* Get memory mapped I/O address */ +pci_read_config_dword (ha->pdev,PCI_BASE_ADDRESS_1 , &mmapbase);
You really want to be using pci_resource_start(ha->pdev, 1) so it will work on architectures like ppc64 and sparc64.
qla_init.c line 529
Quoted 5 lines
qla_init.c +5
-0+ mmapbase &=PCI_BASE_ADDRESS_MEM_MASK ; + +/* Find proper memory chunk for memory map I/O reg */ + base = mmapbase &PAGE_MASK ; + page_offset = mmapbase - base;
Is that correct?
qla_init.c line 532
Quoted 2 lines
qla_init.c +2
-0+/* Get virtual address for I/O registers */ + ha->mmpbase =ioremap (base, page_offset +256 );
Anton
Quoted 7 lines · Anton Blanchard
qla_init.c line 524
Quoted 3 lines
qla_init.c +3
-0+#if MEMORY_MAPPED_IO +/* Get memory mapped I/O address */ +pci_read_config_dword (ha->pdev,PCI_BASE_ADDRESS_1 , &mmapbase);You really want to be using
pci_resource_start(ha->pdev, 1)so it will work on architectures like ppc64 and sparc64.
You're correct -- code updated in my tree.
Quoted 8 lines
qla_init.c line 529
Quoted 5 lines
qla_init.c +5
-0+ mmapbase &=PCI_BASE_ADDRESS_MEM_MASK ; + +/* Find proper memory chunk for memory map I/O reg */ + base = mmapbase &PAGE_MASK ; + page_offset = mmapbase - base;Is that correct?
The 'mmapbase &= PCI_BASE_ADDRESS_MEM_MASK' does appear to be incorrect, yet, I just have one question. it seems several drivers (i.e. sym53c8xx_2, aic7xxx) ensure the memory-mapped resource begins on a page boundary before passing it onto ioremap(). Yet, in the code for __ioremap(), (arch/i386/mm/ioremap.c) there is this small comment:
/*
* NOTE! We need to allow non-page-aligned mappings too: we
* will obviously have to convert them into an offset in a
* page-aligned mapping, but the caller shouldn't need to know
* that small detail.
*
*/
Is it safe to assume *all* platforms will handle this case internally, or should drivers perform the pre-process?
BTW: appearantly none of my emails sent via my QLogic account have made it to linux-[kernel|scsi] in the past week -- I'm working with IT to solve the problem - please be patient with the response time lags.
Thanks,
Andrew Vasquez
Quoted 25 lines · Andrew Vasquez
Quoted 7 lines · Anton Blanchard
qla_init.c line 524
Quoted 3 lines
qla_init.c +3
-0+#if MEMORY_MAPPED_IO +/* Get memory mapped I/O address */ +pci_read_config_dword (ha->pdev,PCI_BASE_ADDRESS_1 , &mmapbase);You really want to be using
pci_resource_start(ha->pdev, 1)so it will work on architectures like ppc64 and sparc64.You're correct -- code updated in my tree.
Quoted 8 lines
qla_init.c line 529
Quoted 5 lines
qla_init.c +5
-0+ mmapbase &=PCI_BASE_ADDRESS_MEM_MASK ; + +/* Find proper memory chunk for memory map I/O reg */ + base = mmapbase &PAGE_MASK ; + page_offset = mmapbase - base;Is that correct?
Quoted 2 lines
The 'mmapbase &=
PCI_BASE_ADDRESS_MEM_MASK' does appear to be incorrect, yet, I just have one question.
s/incorrect/obsolete/
This masking is a harmless remnant of ancient 2.2.x days, when we read the PCI information straight out of the PCI config registers. This masking is no longer needed when a driver is converted to using pci_resource_start (as it should be :))
it seems several drivers
Quoted 12 lines
(i.e.
sym53c8xx_2, aic7xxx) ensure the memory-mapped resource begins on a page boundary before passing it ontoioremap(). Yet, in the code for__ioremap(), (arch/i386/mm/ioremap.c) there is this small comment:/*
* NOTE! We need to allow non-page-aligned mappings too: we
* will obviously have to convert them into an offset in a
* page-aligned mapping, but the caller shouldn't need to know
* that small detail.
*
*/
Quoted 2 lines
Is it safe to assume *all* platforms will handle this case internally, or should drivers perform the pre-process?
They better. It is expected that you can pass the bus address returned from pci_resource_start directly to ioremap (after ensuring availability by calling pci_request_regions).
Jeff
Quoted 13 lines · Jeff Garzik
Quoted 13 lines
it seems several drivers
(i.e.sym53c8xx_2, aic7xxx) ensure the memory-mapped resource begins on a page boundary before passing it ontoioremap(). Yet, in the code for__ioremap(), (arch/i386/mm/ioremap.c) there is this small comment:/*
* NOTE! We need to allow non-page-aligned mappings too: we
* will obviously have to convert them into an offset in a
* page-aligned mapping, but the caller shouldn't need to know
* that small detail.
*
*/
Quoted 7 lines
Quoted 2 lines
Is it safe to assume *all* platforms will handle this case internally, or should drivers perform the pre-process?
They better. It is expected that you can pass the bus address returned from
pci_resource_startdirectly to ioremap (after ensuring availability by callingpci_request_regions).
Thanks for the clarification.
--
Andrew Vasquez
Quoted 9 lines
Quoted 9 lines
qla_init.c line 529
Quoted 6 lines
qla_init.c +5
-0+ mmapbase &=PCI_BASE_ADDRESS_MEM_MASK ; + +/* Find proper memory chunk for memory map I/O reg */ + base = mmapbase &PAGE_MASK ; + page_offset = mmapbase - base;Is that correct?
I was more interested in the next bit, shouldnt base be mmapbase & ~PAGE_MASK? Based on your next question it can go away anyway.
Quoted 2 lines
Is it safe to assume *all* platforms will handle this case internally, or should drivers perform the pre-process?
Yes, ioremap should handle non page aligned addresses.
Anton