All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] allow SGI IOC4 chipset support
@ 2004-01-06  1:09 Jesse Barnes
  2004-01-06 10:25 ` Christoph Hellwig
  0 siblings, 1 reply; 10+ messages in thread
From: Jesse Barnes @ 2004-01-06  1:09 UTC (permalink / raw)
  To: akpm, linux-kernel

The 'depends' directive for SGI IOC4 support is too restrictive.  Just
kill it altogether.

Jesse


===== drivers/ide/Kconfig 1.33 vs edited =====
--- 1.33/drivers/ide/Kconfig	Mon Dec 29 13:37:48 2003
+++ edited/drivers/ide/Kconfig	Mon Jan  5 17:07:25 2004
@@ -747,7 +747,6 @@
 
 config BLK_DEV_SGIIOC4
 	tristate "Silicon Graphics IOC4 chipset support"
-	depends on IA64_SGI_SN2
 	help
 	  This driver adds PIO & MultiMode DMA-2 support for the SGI IOC4
 	  chipset, which has one channel and can support two devices.

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

* Re: [PATCH] allow SGI IOC4 chipset support
  2004-01-06  1:09 [PATCH] allow SGI IOC4 chipset support Jesse Barnes
@ 2004-01-06 10:25 ` Christoph Hellwig
  2004-01-06 17:24   ` [PATCH] allow SGI IOC4 chipset support in ia64 generic kernels Jesse Barnes
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Christoph Hellwig @ 2004-01-06 10:25 UTC (permalink / raw)
  To: akpm, linux-kernel

On Mon, Jan 05, 2004 at 05:09:24PM -0800, Jesse Barnes wrote:
> The 'depends' directive for SGI IOC4 support is too restrictive.  Just
> kill it altogether.

Umm, it won't work for anything but a kernel with SN2 support compile in
due to the bridge-level dma byteswapping it needs (through a week symbol,
that's why you don't see compile failures for other architectures, eek!).

So at least make it depend on CONFIG_IA64


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

* Re: [PATCH] allow SGI IOC4 chipset support in ia64 generic kernels
  2004-01-06 10:25 ` Christoph Hellwig
@ 2004-01-06 17:24   ` Jesse Barnes
  2004-01-07 11:18   ` [PATCH] allow SGI IOC4 chipset support Jes Sorensen
  2004-01-12 15:22   ` Jes Sorensen
  2 siblings, 0 replies; 10+ messages in thread
From: Jesse Barnes @ 2004-01-06 17:24 UTC (permalink / raw)
  To: Christoph Hellwig, akpm, linux-kernel

On Tue, Jan 06, 2004 at 10:25:38AM +0000, Christoph Hellwig wrote:
> On Mon, Jan 05, 2004 at 05:09:24PM -0800, Jesse Barnes wrote:
> > The 'depends' directive for SGI IOC4 support is too restrictive.  Just
> > kill it altogether.
> 
> Umm, it won't work for anything but a kernel with SN2 support compile in
> due to the bridge-level dma byteswapping it needs (through a week symbol,
> that's why you don't see compile failures for other architectures, eek!).

Good point.  They'll need either CONFIG_IA64_SGI_SN2 or
CONFIG_IA64_GENERIC to get the right stuff.

> So at least make it depend on CONFIG_IA64

Here's a more correct fix that should prevent people from seeing build
failures at all.

Jesse

===== drivers/ide/Kconfig 1.33 vs edited =====
--- 1.33/drivers/ide/Kconfig	Mon Dec 29 13:37:48 2003
+++ edited/drivers/ide/Kconfig	Tue Jan  6 09:23:30 2004
@@ -747,7 +747,7 @@
 
 config BLK_DEV_SGIIOC4
 	tristate "Silicon Graphics IOC4 chipset support"
-	depends on IA64_SGI_SN2
+	depends on IA64_SGI_SN2 || IA64_GENERIC
 	help
 	  This driver adds PIO & MultiMode DMA-2 support for the SGI IOC4
 	  chipset, which has one channel and can support two devices.

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

* Re: [PATCH] allow SGI IOC4 chipset support
  2004-01-06 10:25 ` Christoph Hellwig
  2004-01-06 17:24   ` [PATCH] allow SGI IOC4 chipset support in ia64 generic kernels Jesse Barnes
@ 2004-01-07 11:18   ` Jes Sorensen
  2004-01-07 11:26     ` Christoph Hellwig
  2004-01-12 15:22   ` Jes Sorensen
  2 siblings, 1 reply; 10+ messages in thread
From: Jes Sorensen @ 2004-01-07 11:18 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: akpm, linux-kernel

>>>>> "Christoph" == Christoph Hellwig <hch@infradead.org> writes:

Christoph> On Mon, Jan 05, 2004 at 05:09:24PM -0800, Jesse Barnes
Christoph> wrote:
>> The 'depends' directive for SGI IOC4 support is too restrictive.
>> Just kill it altogether.

Christoph> Umm, it won't work for anything but a kernel with SN2
Christoph> support compile in due to the bridge-level dma byteswapping
Christoph> it needs (through a week symbol, that's why you don't see
Christoph> compile failures for other architectures, eek!).

Christoph> So at least make it depend on CONFIG_IA64

What about adding this?

Though shall not use weak symbols in though kernel ....

Jes

--- drivers/ide/pci/sgiioc4.c~	Tue Jan  6 01:43:41 2004
+++ drivers/ide/pci/sgiioc4.c	Wed Jan  7 03:13:13 2004
@@ -719,6 +719,7 @@
 	return 0;
 }
 
+#if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_SGI_SN2)
 /* This ensures that we can build this for generic kernels without
  * having all the SN2 code sync'd and merged.
  */
@@ -726,9 +727,10 @@
 	PCIDMA_ENDIAN_BIG,
 	PCIDMA_ENDIAN_LITTLE
 } pciio_endian_t;
-pciio_endian_t __attribute__ ((weak)) snia_pciio_endian_set(struct pci_dev
-					    *pci_dev, pciio_endian_t device_end,
-					    pciio_endian_t desired_end);
+pciio_endian_t snia_pciio_endian_set(struct pci_dev
+				     *pci_dev, pciio_endian_t device_end,
+				     pciio_endian_t desired_end);
+#endif
 
 static unsigned int __init
 pci_init_sgiioc4(struct pci_dev *dev, ide_pci_device_t * d)
@@ -754,6 +756,7 @@
 		return 1;
 	}
 
+#if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_SGI_SN2)
 	/* Enable Byte Swapping in the PIC... */
 	if (snia_pciio_endian_set) {
 		snia_pciio_endian_set(dev, PCIDMA_ENDIAN_LITTLE,
@@ -764,7 +767,7 @@
 		       d->name, dev->slot_name);
 		return 1;
 	}
-
+#endif
 	return sgiioc4_ide_setup_pci_device(dev, d);
 }
 

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

* Re: [PATCH] allow SGI IOC4 chipset support
  2004-01-07 11:18   ` [PATCH] allow SGI IOC4 chipset support Jes Sorensen
@ 2004-01-07 11:26     ` Christoph Hellwig
  2004-01-07 14:05       ` Jes Sorensen
  0 siblings, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2004-01-07 11:26 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: Christoph Hellwig, akpm, linux-kernel

On Wed, Jan 07, 2004 at 06:18:30AM -0500, Jes Sorensen wrote:
> What about adding this?
> 
> Though shall not use weak symbols in though kernel ....

That's stupid.  You should just not be allowed to compile the driver
if it can work anywork.


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

* Re: [PATCH] allow SGI IOC4 chipset support
  2004-01-07 11:26     ` Christoph Hellwig
@ 2004-01-07 14:05       ` Jes Sorensen
  2004-01-07 14:26         ` Christoph Hellwig
  0 siblings, 1 reply; 10+ messages in thread
From: Jes Sorensen @ 2004-01-07 14:05 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: akpm, linux-kernel

>>>>> "Christoph" == Christoph Hellwig <hch@infradead.org> writes:

Christoph> On Wed, Jan 07, 2004 at 06:18:30AM -0500, Jes Sorensen
Christoph> wrote:
>> What about adding this?
>> 
>> Though shall not use weak symbols in though kernel ....

Christoph> That's stupid.  You should just not be allowed to compile
Christoph> the driver if it can work anywork.

I don't know if it's actually possible to use the card in a non-SN2,
not that I think anyone would want to. But if you prefer, just make
the equivalent change to the Kconfig file and remove the weak
reference.

Jes

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

* Re: [PATCH] allow SGI IOC4 chipset support
  2004-01-07 14:05       ` Jes Sorensen
@ 2004-01-07 14:26         ` Christoph Hellwig
  0 siblings, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2004-01-07 14:26 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: akpm, linux-kernel

On Wed, Jan 07, 2004 at 09:05:10AM -0500, Jes Sorensen wrote:
> Christoph> That's stupid.  You should just not be allowed to compile
> Christoph> the driver if it can work anywork.
> 
> I don't know if it's actually possible to use the card in a non-SN2,
> not that I think anyone would want to. But if you prefer, just make
> the equivalent change to the Kconfig file and remove the weak
> reference.

It might be possible to use an IOC4 card in other hardware, but not
with this driver, as it relies on Xbridge/PIC to do byteswapping for
it - a functionality common PCI bridges don't provide and that Linux
doesn't have a generic API for.


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

* Re: [PATCH] allow SGI IOC4 chipset support
  2004-01-06 10:25 ` Christoph Hellwig
  2004-01-06 17:24   ` [PATCH] allow SGI IOC4 chipset support in ia64 generic kernels Jesse Barnes
  2004-01-07 11:18   ` [PATCH] allow SGI IOC4 chipset support Jes Sorensen
@ 2004-01-12 15:22   ` Jes Sorensen
  2004-01-12 19:38     ` Christoph Hellwig
  2 siblings, 1 reply; 10+ messages in thread
From: Jes Sorensen @ 2004-01-12 15:22 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: akpm, linux-kernel

>>>>> "Christoph" == Christoph Hellwig <hch@infradead.org> writes:

Christoph> On Mon, Jan 05, 2004 at 05:09:24PM -0800, Jesse Barnes
Christoph> wrote:
>> The 'depends' directive for SGI IOC4 support is too restrictive.
>> Just kill it altogether.

Christoph> Umm, it won't work for anything but a kernel with SN2
Christoph> support compile in due to the bridge-level dma byteswapping
Christoph> it needs (through a week symbol, that's why you don't see
Christoph> compile failures for other architectures, eek!).

Christoph> So at least make it depend on CONFIG_IA64

Lets try this then, relative to 2.6.1.

Jes

--- orig/linux-2.6.1-jb-boot/drivers/ide/pci/sgiioc4.c	Sun Jan 11 07:00:35 2004
+++ linux-2.6.1/drivers/ide/pci/sgiioc4.c	Mon Jan 12 06:17:19 2004
@@ -726,7 +726,7 @@
 	PCIDMA_ENDIAN_BIG,
 	PCIDMA_ENDIAN_LITTLE
 } pciio_endian_t;
-pciio_endian_t __attribute__ ((weak)) snia_pciio_endian_set(struct pci_dev
+extern pciio_endian_t snia_pciio_endian_set(struct pci_dev
 					    *pci_dev, pciio_endian_t device_end,
 					    pciio_endian_t desired_end);
 
@@ -755,15 +755,7 @@
 	}
 
 	/* Enable Byte Swapping in the PIC... */
-	if (snia_pciio_endian_set) {
-		snia_pciio_endian_set(dev, PCIDMA_ENDIAN_LITTLE,
-				      PCIDMA_ENDIAN_BIG);
-	} else {
-		printk(KERN_ERR
-		       "Failed to set endianness for device %s at slot %s\n",
-		       d->name, dev->slot_name);
-		return 1;
-	}
+	snia_pciio_endian_set(dev, PCIDMA_ENDIAN_LITTLE, PCIDMA_ENDIAN_BIG);
 
 	return sgiioc4_ide_setup_pci_device(dev, d);
 }
--- orig/linux-2.6.1-jb-boot/drivers/ide/Kconfig	Sun Jan 11 07:00:35 2004
+++ linux-2.6.1/drivers/ide/Kconfig	Mon Jan 12 06:18:19 2004
@@ -747,7 +747,7 @@
 
 config BLK_DEV_SGIIOC4
 	tristate "Silicon Graphics IOC4 chipset support"
-	depends on IA64_SGI_SN2
+	depends on IA64_GENERIC || IA64_SGI_SN2
 	help
 	  This driver adds PIO & MultiMode DMA-2 support for the SGI IOC4
 	  chipset, which has one channel and can support two devices.

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

* Re: [PATCH] allow SGI IOC4 chipset support
  2004-01-12 15:22   ` Jes Sorensen
@ 2004-01-12 19:38     ` Christoph Hellwig
  2004-01-13  8:09       ` Jes Sorensen
  0 siblings, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2004-01-12 19:38 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: akpm, linux-kernel

On Mon, Jan 12, 2004 at 10:22:35AM -0500, Jes Sorensen wrote:
> +	snia_pciio_endian_set(dev, PCIDMA_ENDIAN_LITTLE, PCIDMA_ENDIAN_BIG);

Shouldn't we check for a failure here?


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

* Re: [PATCH] allow SGI IOC4 chipset support
  2004-01-12 19:38     ` Christoph Hellwig
@ 2004-01-13  8:09       ` Jes Sorensen
  0 siblings, 0 replies; 10+ messages in thread
From: Jes Sorensen @ 2004-01-13  8:09 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: akpm, linux-kernel

>>>>> "Christoph" == Christoph Hellwig <hch@infradead.org> writes:

Christoph> On Mon, Jan 12, 2004 at 10:22:35AM -0500, Jes Sorensen
Christoph> wrote:
>> + snia_pciio_endian_set(dev, PCIDMA_ENDIAN_LITTLE,
>> PCIDMA_ENDIAN_BIG);

Christoph> Shouldn't we check for a failure here?

We could, but I don't believe it can actually fail.

Jes

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

end of thread, other threads:[~2004-01-13  8:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-06  1:09 [PATCH] allow SGI IOC4 chipset support Jesse Barnes
2004-01-06 10:25 ` Christoph Hellwig
2004-01-06 17:24   ` [PATCH] allow SGI IOC4 chipset support in ia64 generic kernels Jesse Barnes
2004-01-07 11:18   ` [PATCH] allow SGI IOC4 chipset support Jes Sorensen
2004-01-07 11:26     ` Christoph Hellwig
2004-01-07 14:05       ` Jes Sorensen
2004-01-07 14:26         ` Christoph Hellwig
2004-01-12 15:22   ` Jes Sorensen
2004-01-12 19:38     ` Christoph Hellwig
2004-01-13  8:09       ` Jes Sorensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.