* [PATCH] jmicron: make ide jmicron driver play nice with libata ones
@ 2007-03-16 6:06 Tejun Heo
2007-03-17 20:36 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 4+ messages in thread
From: Tejun Heo @ 2007-03-16 6:06 UTC (permalink / raw)
To: Jeff Garzik, bzolnier, linux-ide, justin
When libata is configured, the device is configured such that SATA and
PATA ports live in separate functions with different programming
interfaces. pata_jmicron and ide jmicron drivers can drive only the
PATA part.
This patch makes jmicron match PCI class code such that it doesn't
attach itself to the SATA part preventing the proper ahci driver from
attaching.
This change is suggested by Bartlomiej.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c
index 53f2550..be4fc96 100644
--- a/drivers/ide/pci/jmicron.c
+++ b/drivers/ide/pci/jmicron.c
@@ -240,12 +240,31 @@ static int __devinit jmicron_init_one(struct pci_dev *dev, const struct pci_devi
return 0;
}
+/* If libata is configured, jmicron PCI quirk will configure it such
+ * that the SATA ports are in AHCI function while the PATA ports are
+ * in a separate IDE function. In such cases, match device class and
+ * attach only to IDE. If libata isn't configured, keep the old
+ * behavior for backward compatibility.
+ */
+#if defined(CONFIG_ATA) || defined(CONFIG_ATA_MODULE)
+#define JMB_CLASS PCI_CLASS_STORAGE_IDE << 8
+#define JMB_CLASS_MASK 0xffff00
+#else
+#define JMB_CLASS 0
+#define JMB_CLASS_MASK 0
+#endif
+
static struct pci_device_id jmicron_pci_tbl[] = {
- { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
- { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
- { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
- { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
- { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
+ { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361,
+ PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 0},
+ { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363,
+ PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 1},
+ { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365,
+ PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 2},
+ { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366,
+ PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 3},
+ { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368,
+ PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 4},
{ 0, },
};
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] jmicron: make ide jmicron driver play nice with libata ones
2007-03-16 6:06 [PATCH] jmicron: make ide jmicron driver play nice with libata ones Tejun Heo
@ 2007-03-17 20:36 ` Bartlomiej Zolnierkiewicz
2007-03-17 22:13 ` Alan Cox
0 siblings, 1 reply; 4+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-03-17 20:36 UTC (permalink / raw)
To: Tejun Heo; +Cc: Jeff Garzik, linux-ide, justin
On Friday 16 March 2007, Tejun Heo wrote:
> When libata is configured, the device is configured such that SATA and
> PATA ports live in separate functions with different programming
> interfaces. pata_jmicron and ide jmicron drivers can drive only the
> PATA part.
>
> This patch makes jmicron match PCI class code such that it doesn't
> attach itself to the SATA part preventing the proper ahci driver from
> attaching.
>
> This change is suggested by Bartlomiej.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
applied, thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] jmicron: make ide jmicron driver play nice with libata ones
2007-03-17 20:36 ` Bartlomiej Zolnierkiewicz
@ 2007-03-17 22:13 ` Alan Cox
2007-03-17 21:53 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2007-03-17 22:13 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: Tejun Heo, Jeff Garzik, linux-ide, justin
> > PATA ports live in separate functions with different programming
> > interfaces. pata_jmicron and ide jmicron drivers can drive only the
> > PATA part.
This isn't actually true. The IDE jmicron driver can drive both the PATA
and the SATA parts in legacy mode. It cannot drive the SATA part in AHCI
mode.
Alan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] jmicron: make ide jmicron driver play nice with libata ones
2007-03-17 22:13 ` Alan Cox
@ 2007-03-17 21:53 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 4+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-03-17 21:53 UTC (permalink / raw)
To: Alan Cox; +Cc: Tejun Heo, Jeff Garzik, linux-ide, justin
On Saturday 17 March 2007, Alan Cox wrote:
> > > PATA ports live in separate functions with different programming
> > > interfaces. pata_jmicron and ide jmicron drivers can drive only the
> > > PATA part.
>
> This isn't actually true. The IDE jmicron driver can drive both the PATA
> and the SATA parts in legacy mode. It cannot drive the SATA part in AHCI
> mode.
Yes but the quoted sentence is missing the full context:
> When libata is configured, the device is configured such that SATA and
> PATA ports live in separate functions with different programming
> interfaces. pata_jmicron and ide jmicron drivers can drive only the
> PATA part.
when libata is configured jmicron is _always_ programmed for native mode
Bart
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-03-17 21:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-16 6:06 [PATCH] jmicron: make ide jmicron driver play nice with libata ones Tejun Heo
2007-03-17 20:36 ` Bartlomiej Zolnierkiewicz
2007-03-17 22:13 ` Alan Cox
2007-03-17 21:53 ` Bartlomiej Zolnierkiewicz
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).