linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ata_piix.c: check PCI sub-class code before AHCI disabling
@ 2005-03-05  0:04 Greg Felix
  2005-07-28 19:56 ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Felix @ 2005-03-05  0:04 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-kernel, linux-ide@vger.kernel.org

This patch adds functionality to check the PCI sub-class code of an
AHCI capable device before disabling AHCI.  It fixes a bug where an
ICH7 sata controller is being setup by the BIOS as sub-class 1 (ide)
and the AHCI control registers weren't being initialized, thus causing
an IO error in piix_disable_ahci().

Thanks,
Greg Felix


Signed-off-by: Gregory Felix <greg.felix@gmail.com>

--- drivers/scsi/ata_piix.c.orig        2005-03-04 15:25:48.966846795 -0700
+++ drivers/scsi/ata_piix.c     2005-03-04 15:27:55.942404850 -0700
@@ -38,6 +38,7 @@ enum {
        PIIX_IOCFG              = 0x54, /* IDE I/O configuration register */
        ICH5_PMR                = 0x90, /* port mapping register */
        ICH5_PCS                = 0x92, /* port control and status */
+       PIIX_SCC                = 0x0A, /* sub-class code register */

        PIIX_FLAG_AHCI          = (1 << 28), /* AHCI possible */
        PIIX_FLAG_CHECKINTR     = (1 << 29), /* make sure PCI INTx enabled */
@@ -61,6 +62,8 @@ enum {
        ich6_sata               = 3,
        ich6_sata_rm            = 4,
        ich7_sata               = 5,
+
+       PIIX_AHCI_DEVICE        = 6,
 };

 static int piix_init_one (struct pci_dev *pdev,
@@ -609,9 +612,13 @@ static int piix_init_one (struct pci_dev
        port_info[1] = NULL;

        if (port_info[0]->host_flags & PIIX_FLAG_AHCI) {
-               int rc = piix_disable_ahci(pdev);
-               if (rc)
-                       return rc;
+               u8 tmp;
+               pci_read_config_byte(pdev, PIIX_SCC, &tmp);
+               if (tmp == PIIX_AHCI_DEVICE) {
+                       int rc = piix_disable_ahci(pdev);
+                       if (rc)
+                           return rc;
+               }
        }

        if (port_info[0]->host_flags & PIIX_FLAG_COMBINED) {

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

* Re: [PATCH] ata_piix.c: check PCI sub-class code before AHCI disabling
@ 2005-05-16 21:31 Christopher Allen Wing
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Allen Wing @ 2005-05-16 21:31 UTC (permalink / raw)
  To: greg.felix, jgarzik; +Cc: linux-ide

Greg:

I think I have the same hardware that you have (Intel ICH7 SATA, PCI ID
8086:27c0). I can confirm that the ata_piix driver fails for me without
your patch. I get the same error message:

	ata_piix: probe of 0000:00:1f.2 failed with error -5


With your patch things work properly. I have the ATA controller set to
"separate controller mode" in the BIOS.



Jeff, should this patch be a candidate for inclusion in libata?


Thanks,

Chris Wing
wingc@engin.umich.edu

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

* Re: [PATCH] ata_piix.c: check PCI sub-class code before AHCI disabling
  2005-03-05  0:04 [PATCH] ata_piix.c: check PCI sub-class code before AHCI disabling Greg Felix
@ 2005-07-28 19:56 ` Jeff Garzik
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2005-07-28 19:56 UTC (permalink / raw)
  To: Greg Felix; +Cc: linux-kernel, linux-ide@vger.kernel.org

Greg Felix wrote:
> This patch adds functionality to check the PCI sub-class code of an
> AHCI capable device before disabling AHCI.  It fixes a bug where an
> ICH7 sata controller is being setup by the BIOS as sub-class 1 (ide)
> and the AHCI control registers weren't being initialized, thus causing
> an IO error in piix_disable_ahci().
> 
> Thanks,
> Greg Felix
> 
> 
> Signed-off-by: Gregory Felix <greg.felix@gmail.com>

Applied to 2.6.x, and uploads to 'upstream' branch of libata-dev.git.

Will apply to 2.4.x as soon as Marcelo pulls what I just submitted.

	Jeff

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

end of thread, other threads:[~2005-07-28 19:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-05  0:04 [PATCH] ata_piix.c: check PCI sub-class code before AHCI disabling Greg Felix
2005-07-28 19:56 ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2005-05-16 21:31 Christopher Allen Wing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).