diff mbox series

ahci: Add Intel Emmitsburg PCH RAID PCI IDs

Message ID 20201119104318.79297-1-mika.westerberg@linux.intel.com
State New
Headers show
Series ahci: Add Intel Emmitsburg PCH RAID PCI IDs | expand

Commit Message

Mika Westerberg Nov. 19, 2020, 10:43 a.m. UTC
Add Intel Emmitsburg PCH RAID PCI IDs to the list of supported
controllers.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/ata/ahci.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Christoph Hellwig Nov. 19, 2020, 4:50 p.m. UTC | #1
On Thu, Nov 19, 2020 at 01:43:18PM +0300, Mika Westerberg wrote:
> Add Intel Emmitsburg PCH RAID PCI IDs to the list of supported
> controllers.

Stupid question: what would it to get Intel to finally report the
correct classcode after all the time?  The amount of IDs we need to list
is getting ridiculous.
Mika Westerberg Nov. 20, 2020, 10:53 a.m. UTC | #2
On Thu, Nov 19, 2020 at 04:50:22PM +0000, Christoph Hellwig wrote:
> On Thu, Nov 19, 2020 at 01:43:18PM +0300, Mika Westerberg wrote:
> > Add Intel Emmitsburg PCH RAID PCI IDs to the list of supported
> > controllers.
> 
> Stupid question: what would it to get Intel to finally report the
> correct classcode after all the time?  The amount of IDs we need to list
> is getting ridiculous.

What is the correct class code in this case that it works with the AHCI
driver?

I think (not 100% sure) it reports standard AHCI class code when it is
not in RAID mode but these PCI IDs are for the RAID mode.
Christoph Hellwig Nov. 23, 2020, 10:09 a.m. UTC | #3
On Fri, Nov 20, 2020 at 12:53:09PM +0200, Mika Westerberg wrote:
> On Thu, Nov 19, 2020 at 04:50:22PM +0000, Christoph Hellwig wrote:
> > On Thu, Nov 19, 2020 at 01:43:18PM +0300, Mika Westerberg wrote:
> > > Add Intel Emmitsburg PCH RAID PCI IDs to the list of supported
> > > controllers.
> > 
> > Stupid question: what would it to get Intel to finally report the
> > correct classcode after all the time?  The amount of IDs we need to list
> > is getting ridiculous.
> 
> What is the correct class code in this case that it works with the AHCI
> driver?
> 
> I think (not 100% sure) it reports standard AHCI class code when it is
> not in RAID mode but these PCI IDs are for the RAID mode.

The right class code is the AHCI one.  The so called RAID mode doesn't
change the operation of the device at all (except for sometimes hiding
NVMe devices that are a different PCIe function to start with).
Mika Westerberg Nov. 23, 2020, 11:26 a.m. UTC | #4
On Mon, Nov 23, 2020 at 10:09:17AM +0000, Christoph Hellwig wrote:
> On Fri, Nov 20, 2020 at 12:53:09PM +0200, Mika Westerberg wrote:
> > On Thu, Nov 19, 2020 at 04:50:22PM +0000, Christoph Hellwig wrote:
> > > On Thu, Nov 19, 2020 at 01:43:18PM +0300, Mika Westerberg wrote:
> > > > Add Intel Emmitsburg PCH RAID PCI IDs to the list of supported
> > > > controllers.
> > > 
> > > Stupid question: what would it to get Intel to finally report the
> > > correct classcode after all the time?  The amount of IDs we need to list
> > > is getting ridiculous.
> > 
> > What is the correct class code in this case that it works with the AHCI
> > driver?
> > 
> > I think (not 100% sure) it reports standard AHCI class code when it is
> > not in RAID mode but these PCI IDs are for the RAID mode.
> 
> The right class code is the AHCI one.  The so called RAID mode doesn't
> change the operation of the device at all (except for sometimes hiding
> NVMe devices that are a different PCIe function to start with).

Thanks. I looked at the AHCI spec (1.3.1) and it says this regarding the
class code (CC) field:

  Informative Note: For HBAs that support RAID, the Sub Class Code reset
  value should be 04h and the Programming Interface reset value should be
  00h.

I think this is what the controller is doing when in "RAID mode".
Christoph Hellwig Nov. 23, 2020, 11:38 a.m. UTC | #5
On Mon, Nov 23, 2020 at 01:26:22PM +0200, Mika Westerberg wrote:
> On Mon, Nov 23, 2020 at 10:09:17AM +0000, Christoph Hellwig wrote:
> > On Fri, Nov 20, 2020 at 12:53:09PM +0200, Mika Westerberg wrote:
> > > On Thu, Nov 19, 2020 at 04:50:22PM +0000, Christoph Hellwig wrote:
> > > > On Thu, Nov 19, 2020 at 01:43:18PM +0300, Mika Westerberg wrote:
> > > > > Add Intel Emmitsburg PCH RAID PCI IDs to the list of supported
> > > > > controllers.
> > > > 
> > > > Stupid question: what would it to get Intel to finally report the
> > > > correct classcode after all the time?  The amount of IDs we need to list
> > > > is getting ridiculous.
> > > 
> > > What is the correct class code in this case that it works with the AHCI
> > > driver?
> > > 
> > > I think (not 100% sure) it reports standard AHCI class code when it is
> > > not in RAID mode but these PCI IDs are for the RAID mode.
> > 
> > The right class code is the AHCI one.  The so called RAID mode doesn't
> > change the operation of the device at all (except for sometimes hiding
> > NVMe devices that are a different PCIe function to start with).
> 
> Thanks. I looked at the AHCI spec (1.3.1) and it says this regarding the
> class code (CC) field:
> 
>   Informative Note: For HBAs that support RAID, the Sub Class Code reset
>   value should be 04h and the Programming Interface reset value should be
>   00h.
> 
> I think this is what the controller is doing when in "RAID mode".

The point is: these AHCI controllers do not support RAID in form
despite the confusing naming.
Mika Westerberg Nov. 23, 2020, 12:28 p.m. UTC | #6
On Mon, Nov 23, 2020 at 11:38:01AM +0000, Christoph Hellwig wrote:
> The point is: these AHCI controllers do not support RAID in form
> despite the confusing naming.

Are you sure?

I looked at the Emmitsburg data sheet and it actually seems to support
some sort of RAID but it requires some special Rapid Storage Technology
[1] drivers from Intel. Probably the idea is that when in "RAID mode"
the thing, as AHCI spec says, does not announce itself to be AHCI
compliant which makes Windows inbox AHCI driver to not to load, and this
allows the Intel propriatery driver to load that then takes advantage of
this somehow.

I'm not too familiar with these technologies here so I may be missing
something.

[1] https://www.intel.com/content/www/us/en/architecture-and-technology/rapid-storage-technology.html
Christoph Hellwig Nov. 23, 2020, 12:51 p.m. UTC | #7
On Mon, Nov 23, 2020 at 02:28:20PM +0200, Mika Westerberg wrote:
> On Mon, Nov 23, 2020 at 11:38:01AM +0000, Christoph Hellwig wrote:
> > The point is: these AHCI controllers do not support RAID in form
> > despite the confusing naming.
> 
> Are you sure?
> 
> I looked at the Emmitsburg data sheet and it actually seems to support
> some sort of RAID but it requires some special Rapid Storage Technology
> [1] drivers from Intel. Probably the idea is that when in "RAID mode"
> the thing, as AHCI spec says, does not announce itself to be AHCI
> compliant which makes Windows inbox AHCI driver to not to load, and this
> allows the Intel propriatery driver to load that then takes advantage of
> this somehow.

Yes, and that is purely (badly implemented) software RAID.
diff mbox series

Patch

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 00ba8e5a1ccc..0b39f0e7fd8f 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -398,6 +398,8 @@  static const struct pci_device_id ahci_pci_tbl[] = {
 	{ PCI_VDEVICE(INTEL, 0x2823), board_ahci }, /* Lewisburg AHCI*/
 	{ PCI_VDEVICE(INTEL, 0x2826), board_ahci }, /* Lewisburg RAID*/
 	{ PCI_VDEVICE(INTEL, 0x2827), board_ahci }, /* Lewisburg RAID*/
+	{ PCI_VDEVICE(INTEL, 0x282b), board_ahci }, /* Emmitsburg RAID */
+	{ PCI_VDEVICE(INTEL, 0x282f), board_ahci }, /* Emmitsburg RAID */
 	{ PCI_VDEVICE(INTEL, 0xa182), board_ahci }, /* Lewisburg AHCI*/
 	{ PCI_VDEVICE(INTEL, 0xa186), board_ahci }, /* Lewisburg RAID*/
 	{ PCI_VDEVICE(INTEL, 0xa1d2), board_ahci }, /* Lewisburg RAID*/