All of lore.kernel.org
 help / color / mirror / Atom feed
* Intel SATA combined mode quirk broken for SCSI_SATA=m
@ 2005-10-17  2:13 Jesse Barnes
  2005-10-17  2:33 ` Jeff Garzik
  2005-10-17  2:45 ` [PATCH] " Jeff Garzik
  0 siblings, 2 replies; 5+ messages in thread
From: Jesse Barnes @ 2005-10-17  2:13 UTC (permalink / raw)
  To: linux-kernel, jgarzik, akpm

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

Back in July, Adrian Bunk sent in a patch to make SCSI_SATA tristate.  This 
prevents the intel_ide_combined quirk in drivers/pci/quirks.c from working if 
SCSI_SATA=m, which is the case for Fedora kernels (my motivation for tracking 
this down).

In my configuration, not running the quirk causes the ata_piix driver (the 
libata driver for my IDE controller) to fail to attach to the device, since 
the legacy IDE driver has already claimed the ports.  Unfortunately, the AHCI 
driver also tries to mess with the device, and ends up disabling its 
interrupts before aborting its load, causing the IDE layer to complain loudly 
that hda is losing interrupts.

So what should be done?  Ideally, libata would fully support ATAPI and then I 
wouldn't need the legacy IDE drivers at all on this box, making the quirk 
moot, but that won't happen for 2.6.14, so we'll need something else.  
Unconditionally enabling the quirk will cause at least one of the ports to be 
reserved for the SATA driver, which may never load.  And obviously not 
running the quirk leads to the situation described above.

A hack that might be suitable for 2.6.14 is to make the quirk depend on either 
CONFIG_SCSI_SATA or CONFIG_SCSI_SATA_MODULE.  Then the quirk could be removed 
entirely when ATAPI support for libata is merged.

Thoughts?

Thanks,
Jesse

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

[-- Attachment #2: intel-combined-mode-quirk-hack.patch --]
[-- Type: text/x-diff, Size: 499 bytes --]

--- linux-2.6.14-rc4/drivers/pci/quirks.c.orig	2005-10-16 19:12:05.000000000 -0700
+++ linux-2.6.14-rc4/drivers/pci/quirks.c	2005-10-16 19:12:33.000000000 -0700
@@ -1233,8 +1233,7 @@
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_EESSC,	quirk_alder_ioapic );
 #endif
 
-#ifdef CONFIG_SCSI_SATA
-#error building quirk
+#if defined(CONFIG_SCSI_SATA) || defined(CONFIG_SCSI_SATA_MODULE)
 static void __devinit quirk_intel_ide_combined(struct pci_dev *pdev)
 {
 	u8 prog, comb, tmp;

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

* Re: Intel SATA combined mode quirk broken for SCSI_SATA=m
  2005-10-17  2:13 Intel SATA combined mode quirk broken for SCSI_SATA=m Jesse Barnes
@ 2005-10-17  2:33 ` Jeff Garzik
  2005-10-17  2:48   ` Jesse Barnes
  2005-10-17  2:45 ` [PATCH] " Jeff Garzik
  1 sibling, 1 reply; 5+ messages in thread
From: Jeff Garzik @ 2005-10-17  2:33 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: linux-kernel, akpm, linux-ide@vger.kernel.org

Jesse Barnes wrote:
> Back in July, Adrian Bunk sent in a patch to make SCSI_SATA tristate.  This 
> prevents the intel_ide_combined quirk in drivers/pci/quirks.c from working if 
> SCSI_SATA=m, which is the case for Fedora kernels (my motivation for tracking 
> this down).
> 
> In my configuration, not running the quirk causes the ata_piix driver (the 
> libata driver for my IDE controller) to fail to attach to the device, since 
> the legacy IDE driver has already claimed the ports.  Unfortunately, the AHCI 
> driver also tries to mess with the device, and ends up disabling its 
> interrupts before aborting its load, causing the IDE layer to complain loudly 
> that hda is losing interrupts.

Thanks a ton for figuring this out!


> So what should be done?  Ideally, libata would fully support ATAPI and then I 
> wouldn't need the legacy IDE drivers at all on this box, making the quirk 
> moot, but that won't happen for 2.6.14, so we'll need something else.  
> Unconditionally enabling the quirk will cause at least one of the ports to be 
> reserved for the SATA driver, which may never load.  And obviously not 
> running the quirk leads to the situation described above.
> 
> A hack that might be suitable for 2.6.14 is to make the quirk depend on either 
> CONFIG_SCSI_SATA or CONFIG_SCSI_SATA_MODULE.  Then the quirk could be removed 
> entirely when ATAPI support for libata is merged.

Overall the quirk is a hack until ATAPI is supported -- but even after 
ATAPI is supported, we need to figure out some way to keep IDE driver 
from stealing the legacy IDE ports before libata can touch them :(

However, when ATAPI is supported, that at least means that both PATA and 
SATA can run at full speed.

Your patch is correct, and should go into 2.6.14-rc post-haste.

I continue to grumble at the Kconfig annoyance:  CONFIG_SCSI_SATA is 
fundamentally a yes/no question.  CONFIG_SCSI_SATA=m makes no sense at 
all -- and causes problems, as we see -- but is required in order to do 
Kconfig dependencies correctly AFAIK.

Maybe 'if SCSI_SATA' is needed instead?  A lame way to implement 
dependencies, but if there is no other way...

	Jeff



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

* [PATCH] Re: Intel SATA combined mode quirk broken for SCSI_SATA=m
  2005-10-17  2:13 Intel SATA combined mode quirk broken for SCSI_SATA=m Jesse Barnes
  2005-10-17  2:33 ` Jeff Garzik
@ 2005-10-17  2:45 ` Jeff Garzik
  2005-10-17  2:55   ` Jesse Barnes
  1 sibling, 1 reply; 5+ messages in thread
From: Jeff Garzik @ 2005-10-17  2:45 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: linux-kernel, akpm, linux-ide@vger.kernel.org

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

Actually... does the attached patch fix things for you?

	Jeff




[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 3877 bytes --]

diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -437,7 +437,7 @@ config SCSI_IN2000
 source "drivers/scsi/megaraid/Kconfig.megaraid"
 
 config SCSI_SATA
-	tristate "Serial ATA (SATA) support"
+	bool "Serial ATA (SATA) support"
 	depends on SCSI
 	help
 	  This driver family supports Serial ATA host controllers
@@ -445,9 +445,11 @@ config SCSI_SATA
 
 	  If unsure, say N.
 
+if SCSI_SATA
+
 config SCSI_SATA_AHCI
 	tristate "AHCI SATA support"
-	depends on SCSI_SATA && PCI
+	depends on SCSI && PCI
 	help
 	  This option enables support for AHCI Serial ATA.
 
@@ -455,7 +457,7 @@ config SCSI_SATA_AHCI
 
 config SCSI_SATA_SVW
 	tristate "ServerWorks Frodo / Apple K2 SATA support"
-	depends on SCSI_SATA && PCI
+	depends on SCSI && PCI
 	help
 	  This option enables support for Broadcom/Serverworks/Apple K2
 	  SATA support.
@@ -464,7 +466,7 @@ config SCSI_SATA_SVW
 
 config SCSI_ATA_PIIX
 	tristate "Intel PIIX/ICH SATA support"
-	depends on SCSI_SATA && PCI
+	depends on SCSI && PCI
 	help
 	  This option enables support for ICH5 Serial ATA.
 	  If PATA support was enabled previously, this enables
@@ -474,7 +476,7 @@ config SCSI_ATA_PIIX
 
 config SCSI_SATA_MV
 	tristate "Marvell SATA support"
-	depends on SCSI_SATA && PCI && EXPERIMENTAL
+	depends on SCSI && PCI && EXPERIMENTAL
 	help
 	  This option enables support for the Marvell Serial ATA family.
 	  Currently supports 88SX[56]0[48][01] chips.
@@ -483,7 +485,7 @@ config SCSI_SATA_MV
 
 config SCSI_SATA_NV
 	tristate "NVIDIA SATA support"
-	depends on SCSI_SATA && PCI && EXPERIMENTAL
+	depends on SCSI && PCI && EXPERIMENTAL
 	help
 	  This option enables support for NVIDIA Serial ATA.
 
@@ -491,7 +493,7 @@ config SCSI_SATA_NV
 
 config SCSI_SATA_PROMISE
 	tristate "Promise SATA TX2/TX4 support"
-	depends on SCSI_SATA && PCI
+	depends on SCSI && PCI
 	help
 	  This option enables support for Promise Serial ATA TX2/TX4.
 
@@ -499,7 +501,7 @@ config SCSI_SATA_PROMISE
 
 config SCSI_SATA_QSTOR
 	tristate "Pacific Digital SATA QStor support"
-	depends on SCSI_SATA && PCI
+	depends on SCSI && PCI
 	help
 	  This option enables support for Pacific Digital Serial ATA QStor.
 
@@ -507,7 +509,7 @@ config SCSI_SATA_QSTOR
 
 config SCSI_SATA_SX4
 	tristate "Promise SATA SX4 support"
-	depends on SCSI_SATA && PCI && EXPERIMENTAL
+	depends on SCSI && PCI && EXPERIMENTAL
 	help
 	  This option enables support for Promise Serial ATA SX4.
 
@@ -515,7 +517,7 @@ config SCSI_SATA_SX4
 
 config SCSI_SATA_SIL
 	tristate "Silicon Image SATA support"
-	depends on SCSI_SATA && PCI && EXPERIMENTAL
+	depends on SCSI && PCI && EXPERIMENTAL
 	help
 	  This option enables support for Silicon Image Serial ATA.
 
@@ -523,7 +525,7 @@ config SCSI_SATA_SIL
 
 config SCSI_SATA_SIS
 	tristate "SiS 964/180 SATA support"
-	depends on SCSI_SATA && PCI && EXPERIMENTAL
+	depends on SCSI && PCI && EXPERIMENTAL
 	help
 	  This option enables support for SiS Serial ATA 964/180.
 
@@ -531,7 +533,7 @@ config SCSI_SATA_SIS
 
 config SCSI_SATA_ULI
 	tristate "ULi Electronics SATA support"
-	depends on SCSI_SATA && PCI && EXPERIMENTAL
+	depends on SCSI && PCI && EXPERIMENTAL
 	help
 	  This option enables support for ULi Electronics SATA.
 
@@ -539,7 +541,7 @@ config SCSI_SATA_ULI
 
 config SCSI_SATA_VIA
 	tristate "VIA SATA support"
-	depends on SCSI_SATA && PCI
+	depends on SCSI && PCI
 	help
 	  This option enables support for VIA Serial ATA.
 
@@ -547,12 +549,14 @@ config SCSI_SATA_VIA
 
 config SCSI_SATA_VITESSE
 	tristate "VITESSE VSC-7174 SATA support"
-	depends on SCSI_SATA && PCI
+	depends on SCSI && PCI
 	help
 	  This option enables support for Vitesse VSC7174 Serial ATA.
 
 	  If unsure, say N.
 
+endif	# if SCSI_SATA
+
 config SCSI_BUSLOGIC
 	tristate "BusLogic SCSI support"
 	depends on (PCI || ISA || MCA) && SCSI && ISA_DMA_API

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

* Re: Intel SATA combined mode quirk broken for SCSI_SATA=m
  2005-10-17  2:33 ` Jeff Garzik
@ 2005-10-17  2:48   ` Jesse Barnes
  0 siblings, 0 replies; 5+ messages in thread
From: Jesse Barnes @ 2005-10-17  2:48 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-kernel, akpm, linux-ide@vger.kernel.org

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

On Sunday, October 16, 2005 7:33 pm, Jeff Garzik wrote:
> Overall the quirk is a hack until ATAPI is supported -- but even after
> ATAPI is supported, we need to figure out some way to keep IDE driver
> from stealing the legacy IDE ports before libata can touch them :(
>
> However, when ATAPI is supported, that at least means that both PATA and
> SATA can run at full speed.

But then can't we remove the quirk and just declare them incompatible (i.e. 
who loads first, wins)?

> Your patch is correct, and should go into 2.6.14-rc post-haste.

Well, almost. :)  I diffed against a bad version.  This one should actually 
apply.

Jesse

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>


[-- Attachment #2: intel-combined-mode-quirk-hack.patch --]
[-- Type: text/x-diff, Size: 476 bytes --]

--- linux-2.6.14-rc4/drivers/pci/quirks.c.orig	2005-10-16 19:46:43.000000000 -0700
+++ linux-2.6.14-rc4/drivers/pci/quirks.c	2005-10-16 19:12:33.000000000 -0700
@@ -1233,7 +1233,7 @@
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_EESSC,	quirk_alder_ioapic );
 #endif
 
-#ifdef CONFIG_SCSI_SATA
+#if defined(CONFIG_SCSI_SATA) || defined(CONFIG_SCSI_SATA_MODULE)
 static void __devinit quirk_intel_ide_combined(struct pci_dev *pdev)
 {
 	u8 prog, comb, tmp;

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

* Re: [PATCH] Re: Intel SATA combined mode quirk broken for SCSI_SATA=m
  2005-10-17  2:45 ` [PATCH] " Jeff Garzik
@ 2005-10-17  2:55   ` Jesse Barnes
  0 siblings, 0 replies; 5+ messages in thread
From: Jesse Barnes @ 2005-10-17  2:55 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-kernel, akpm, linux-ide@vger.kernel.org

On Sunday, October 16, 2005 7:45 pm, Jeff Garzik wrote:
> Actually... does the attached patch fix things for you?

Yeah, this one causes the quirk to be built in as well.  I guess we get to 
choose between Kconfig ugliness (if vs. depends) and #if defined(..._MODULE) 
ugliness.  Yuck.

Jesse

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

end of thread, other threads:[~2005-10-17  2:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-17  2:13 Intel SATA combined mode quirk broken for SCSI_SATA=m Jesse Barnes
2005-10-17  2:33 ` Jeff Garzik
2005-10-17  2:48   ` Jesse Barnes
2005-10-17  2:45 ` [PATCH] " Jeff Garzik
2005-10-17  2:55   ` Jesse Barnes

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.