Marvell 6145 PATA controller

Previous thread: Re: [PATCH 2/4] libata: Implement disk shock protection support by Elias Oltmanns on Saturday, August 30, 2008 - 4:38 pm. (11 messages)

Next thread: Re: Linux 2.6.27-rc5: System boot regression caused by commit a2bd7274b47124d2fc4dfdb8c0591f545ba749dd by David Witbrodt on Saturday, August 30, 2008 - 6:25 pm. (2 messages)
From: Peter Ambroz
Date: Saturday, August 30, 2008 - 4:50 pm

Hello!

Will talk about 2.6.25 kernel.
I had recently a problem with marvell pata controllers. Exactly speaking 
of "IDE interface: Marvell Technology Group Ltd. 88SE6145 SATA II PCI-E 
controller", pci-id 11ab:6145.
There is a (pseudo) driver in the kernel for handling that controller, 
called pata_marvell, but it doesn't claim the device.
Instead, ahci driver claims that device, and then just does nothing. 
Devices connected to the marvell are not seen by kernel.

After looking into the source code I found out that both ahci.c and 
pata_marvell.c list that device in their pci_device_id structure (which 
wouldn't be problem, if both drivers worked with the controller, but 
ahci.c just doesn't)

The first solution to this was found very quickly by using google: just 
add kernel parameter all-generic-ide, and the marvell controller will be 
recognized by ide-generic driver, and HDD's, CDROM's on that marvell 
controller are also found (as hda, hdb).

The second solution is to remove few lines from ahci.c which lists the 
marvell 6145 device (and probably also marvell 6121).
Short patch included below.
After that, kernel finally uses the pata_marvell driver, and my pata 
devices are registered with kernel (as sda, sdb).

The third solution is to not use ahci driver when using pata_marvell. 
But this is not possible with lots of motherboards which have Intel 
corp. SATA controller + marvell sata / pata controller.

AFAIK, the second idea (patch the source) would solve problems for lots 
of people asking for the solution. (the first idea with the 
all-generic-ide doesn't work for everybody)

I would suggest patching the ahci.c, and I appreciate any 
suggestions/comments.

For the sake of completness, here are relevant parts of dmesg:
(0000:03:00.0 is the mentioned marvell 6145 sata/pata controller)
scenario 1: ahci takes the controller, no devices are detected

----------CUT-----------
ACPI: PCI Interrupt 0000:03:00.0[A] -> GSI 16 (level, low) -> IRQ 16
ahci ...
From: Alan Cox
Date: Sunday, August 31, 2008 - 2:36 am

Yes. I know or to teach the AHCI driver how to drive the PATA part of the
device. Unfortunately I've been trying - privately and now publically to
get Jeff Garzik to fix that one for *months*.

I also don't have the docs for it and requests to Jeff for the relevant

And you can have my ack for it, but don't expect anything to happen

(and yes I *am* cross about this)

Alan
--

From: Ville
Date: Sunday, August 31, 2008 - 4:04 am

I don't think this issue is on the regression list. Maybe getting it
there would get some results.

BTW would it be possible for the ahci driver to determine if the PATA
ports are used and fail the probe in case they are?

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/
--

Previous thread: Re: [PATCH 2/4] libata: Implement disk shock protection support by Elias Oltmanns on Saturday, August 30, 2008 - 4:38 pm. (11 messages)

Next thread: Re: Linux 2.6.27-rc5: System boot regression caused by commit a2bd7274b47124d2fc4dfdb8c0591f545ba749dd by David Witbrodt on Saturday, August 30, 2008 - 6:25 pm. (2 messages)