Re: JMicron JMB363 SATA hard disk appears twice (sda + hdg)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Giuseppe Bilotta <bilotta78@...>
Cc: <linux-kernel@...>, Alan Cox <alan@...>, Jeff Garzik <jgarzik@...>
Date: Saturday, January 6, 2007 - 2:24 pm

(I'm CCing the author and libata guru)

Giuseppe Bilotta <bilotta78@hotpop.com> ha scritto:

Hi,
Do you have anything attached to the PATA ports of JM controller?


This may be a bug in the driver. As a workaround you can disable
CONFIG_BLK_DEV_JMICRON (the legacy PATA driver) and enable
CONFIG_PATA_JMICRON (libata based, look for "JMicron PATA support" under
"ATA Device"). Of course if you don't need PATA driver from JMicron (I
see VIA controller here) just turn it off.

Or, you can try the following untested patch. The drawback is that users
who don't want to use libata are cut off; but they can still use the
controller in IDE mode, no? Alan, Jeff what do you think?

jmicron: don't touch the controller when it's AHCI mode. As help text
suggests ("For full support use the libata drivers") the new libata AHCI
driver will take care of it.

Signed-Off-By: Luca Tettamanti <kronos.it@gmail.com>
---

 drivers/ide/pci/jmicron.c |    3 +++
 include/linux/pci_ids.h   |    1 +
 2 files changed, 4 insertions(+)

diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c
index c1cec23..29bf00f 100644
--- a/drivers/ide/pci/jmicron.c
+++ b/drivers/ide/pci/jmicron.c
@@ -235,6 +235,9 @@ static ide_pci_device_t jmicron_chipsets[] __devinitdata = {
 
 static int __devinit jmicron_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 {
+	/* Ignore this controller when in AHCI mode */
+	if (dev->class == PCI_CLASS_STORAGE_AHCI)
+		return -ENODEV;
 	ide_setup_pci_device(dev, &jmicron_chipsets[id->driver_data]);
 	return 0;
 }
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index f7a416c..b43369a 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -15,6 +15,7 @@
 #define PCI_CLASS_STORAGE_FLOPPY	0x0102
 #define PCI_CLASS_STORAGE_IPI		0x0103
 #define PCI_CLASS_STORAGE_RAID		0x0104
+#define PCI_CLASS_STORAGE_AHCI		0x010601
 #define PCI_CLASS_STORAGE_SAS		0x0107
 #define PCI_CLASS_STORAGE_OTHER		0x0180
 


Luca
-- 
"screwed" -- Alexander Viro
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
JMicron JMB363 SATA hard disk appears twice (sda + hdg), Giuseppe Bilotta, (Sat Jan 6, 12:25 pm)
Re: JMicron JMB363 SATA hard disk appears twice (sda + hdg), Luca Tettamanti, (Sat Jan 6, 2:24 pm)