public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [ANNOUNCE] QLogic qla2xxx driver update available (v8.00.00b2).
@ 2003-05-19 22:57 Andrew Vasquez
  2003-05-21 17:32 ` Andrew Vasquez
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Vasquez @ 2003-05-19 22:57 UTC (permalink / raw)
  To: linux-scsi, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ANNOUNCE] QLogic qla2xxx driver update available (v8.00.00b2).
  2003-05-19 22:57 [ANNOUNCE] QLogic qla2xxx driver update available (v8.00.00b2) Andrew Vasquez
@ 2003-05-21 17:32 ` Andrew Vasquez
  2003-05-21 22:26   ` Anton Blanchard
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Vasquez @ 2003-05-21 17:32 UTC (permalink / raw)
  To: linux-scsi; +Cc: Andrew Vasquez

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

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

[-- Attachment #2: pci_config_fix-v8.00.00b2.diff --]
[-- Type: text/plain, Size: 2349 bytes --]

diff -X dontdiff -Nurd 80000b2/qla_def.h 80000b2-iobase_fix/qla_def.h
--- 80000b2/qla_def.h	2003-05-19 15:19:46.000000000 -0700
+++ 80000b2-iobase_fix/qla_def.h	2003-05-21 08:28:05.174690128 -0700
@@ -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)
diff -X dontdiff -Nurd 80000b2/qla_init.c 80000b2-iobase_fix/qla_init.c
--- 80000b2/qla_init.c	2003-05-19 15:19:46.000000000 -0700
+++ 80000b2-iobase_fix/qla_init.c	2003-05-21 08:32:19.771985456 -0700
@@ -496,7 +496,6 @@
 static uint8_t
 qla2x00_pci_config(scsi_qla_host_t *ha)
 {
-	uint8_t		status;
 	uint16_t	w;
 #if defined(ISP2300)
 	uint32_t	cnt;
@@ -520,8 +519,25 @@
 	pci_set_master(ha->pdev);
 	pci_read_config_word(ha->pdev, PCI_REVISION_ID, &ha->revision);
 
-	if (ha->iobase)
-		return 0;
+#if MEMORY_MAPPED_IO
+	/* Get memory mapped I/O address */
+	pci_read_config_dword(ha->pdev, PCI_BASE_ADDRESS_1, &mmapbase);
+	mmapbase &= PCI_BASE_ADDRESS_MEM_MASK;
+
+	/* Find proper memory chunk for memory map I/O reg */
+	base = mmapbase & PAGE_MASK;
+	page_offset = mmapbase - base;
+
+	/* Get virtual address for I/O registers  */
+	ha->mmpbase = ioremap(base, page_offset + 256);
+	if (ha->mmpbase) {
+		ha->mmpbase += page_offset;
+		ha->iobase = (device_reg_t *)ha->mmpbase;
+	}
+#endif
+
+	if (!ha->iobase)
+		return 1;
 
 	/*
 	 * We want to respect framework's setting of PCI configuration space
@@ -599,28 +615,9 @@
 	w &= ~PCI_ROM_ADDRESS_ENABLE;
 	pci_write_config_word(ha->pdev, PCI_ROM_ADDRESS, w);
 
-	status = 0;
-#if MEMORY_MAPPED_IO
-	/* Get memory mapped I/O address */
-	pci_read_config_dword(ha->pdev, PCI_BASE_ADDRESS_1, &mmapbase);
-	mmapbase &= PCI_BASE_ADDRESS_MEM_MASK;
-
-	/* Find proper memory chunk for memory map I/O reg */
-	base = mmapbase & PAGE_MASK;
-	page_offset = mmapbase - base;
-
-	/* Get virtual address for I/O registers  */
-	ha->mmpbase = ioremap(base, page_offset + 256);
-	if (ha->mmpbase) {
-		ha->mmpbase += page_offset;
-		ha->iobase = ha->mmpbase;
-		status = 0;
-	}
-#endif
-
 	LEAVE(__func__);
 
-	return (status);
+	return (0);
 }
 
 /**

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ANNOUNCE] QLogic qla2xxx driver update available (v8.00.00b2).
  2003-05-21 17:32 ` Andrew Vasquez
@ 2003-05-21 22:26   ` Anton Blanchard
  2003-05-29  6:19     ` Andrew Vasquez
  0 siblings, 1 reply; 7+ messages in thread
From: Anton Blanchard @ 2003-05-21 22:26 UTC (permalink / raw)
  To: Andrew Vasquez, linux-scsi


Hi,

> +#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.

> +	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?

> +	/* Get virtual address for I/O registers  */
> +	ha->mmpbase = ioremap(base, page_offset + 256);

Anton

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ANNOUNCE] QLogic qla2xxx driver update available (v8.00.00b2).
  2003-05-21 22:26   ` Anton Blanchard
@ 2003-05-29  6:19     ` Andrew Vasquez
  2003-05-29 14:26       ` Jeff Garzik
  2003-05-29 15:33       ` Anton Blanchard
  0 siblings, 2 replies; 7+ messages in thread
From: Andrew Vasquez @ 2003-05-29  6:19 UTC (permalink / raw)
  To: linux-scsi

On Thu, 22 May 2003, Anton Blanchard wrote:

> > +#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.

> > +	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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ANNOUNCE] QLogic qla2xxx driver update available (v8.00.00b2).
  2003-05-29  6:19     ` Andrew Vasquez
@ 2003-05-29 14:26       ` Jeff Garzik
  2003-05-29 15:17         ` Andrew Vasquez
  2003-05-29 15:33       ` Anton Blanchard
  1 sibling, 1 reply; 7+ messages in thread
From: Jeff Garzik @ 2003-05-29 14:26 UTC (permalink / raw)
  To: Andrew Vasquez; +Cc: linux-scsi

Andrew Vasquez wrote:
> On Thu, 22 May 2003, Anton Blanchard wrote:
> 
> 
>>>+#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.
> 
> 
>>>+	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.

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
> (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?

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




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ANNOUNCE] QLogic qla2xxx driver update available (v8.00.00b2).
  2003-05-29 14:26       ` Jeff Garzik
@ 2003-05-29 15:17         ` Andrew Vasquez
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Vasquez @ 2003-05-29 15:17 UTC (permalink / raw)
  To: linux-scsi

On Thu, 29 May 2003, Jeff Garzik wrote:

> >  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?
> 
> 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).
> 

Thanks for the clarification.

--
Andrew Vasquez

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ANNOUNCE] QLogic qla2xxx driver update available (v8.00.00b2).
  2003-05-29  6:19     ` Andrew Vasquez
  2003-05-29 14:26       ` Jeff Garzik
@ 2003-05-29 15:33       ` Anton Blanchard
  1 sibling, 0 replies; 7+ messages in thread
From: Anton Blanchard @ 2003-05-29 15:33 UTC (permalink / raw)
  To: Andrew Vasquez, linux-scsi

 
> > > +	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.

> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-05-29 15:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-19 22:57 [ANNOUNCE] QLogic qla2xxx driver update available (v8.00.00b2) Andrew Vasquez
2003-05-21 17:32 ` Andrew Vasquez
2003-05-21 22:26   ` Anton Blanchard
2003-05-29  6:19     ` Andrew Vasquez
2003-05-29 14:26       ` Jeff Garzik
2003-05-29 15:17         ` Andrew Vasquez
2003-05-29 15:33       ` Anton Blanchard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox