Project

General

Profile

Actions

Bug #13599

closed

ahci(7d) requires alias for HP AHCI SATA controller

Added by John Groenveld 9 months ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Category:
driver - device drivers
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

Per Gary Mills,
https://openindiana.org/pipermail/openindiana-discuss/2021-March/024088.html

/etc/driver_aliases requires
ahci "pci8086,2822.103c.1309.0"

Actions #1

Updated by Robert Mustacchi 9 months ago

Generally speaking Intel has two device IDs for their SATA controllers based on whether the BIOS has it in ahci mode or in RAID mode. In this case, the controller is not advertising that it supports the AHCI class code so I'm not really sure that it's correct that we should be adding this alias.

Actions #2

Updated by Toomas Soome 9 months ago

Robert Mustacchi wrote in #note-1:

Generally speaking Intel has two device IDs for their SATA controllers based on whether the BIOS has it in ahci mode or in RAID mode. In this case, the controller is not advertising that it supports the AHCI class code so I'm not really sure that it's correct that we should be adding this alias.

FreeBSD seems to have it in https://grok.dragonflybsd.org/xref/freebsd/sys/dev/ahci/ahci_pci.c?r=4bc1e136#108
Linux seems to have it in https://github.com/torvalds/linux/blob/master/drivers/ata/ahci.c#L261

Actions #3

Updated by Gary Mills 9 months ago

This particular disk controller does not have separate AHCI and RAID modes. Instead, it has an AHCI+RAID mode. I've been using it for several years with the ahci driver, with no problems. Here's how it looks with scanpci -v:

pci bus 0x0000 cardnum 0x1f function 0x02: vendor 0x8086 device 0x2822
 Intel Corporation SATA Controller [RAID mode]
 CardVendor 0x103c card 0x1309 (Hewlett-Packard Company, Card unknown)
  STATUS    0x02b0  COMMAND 0x0047
  CLASS     0x01 0x04 0x00  REVISION 0x00
  BIST      0x00  HEADER 0x00  LATENCY 0x00  CACHE 0x00
  BASE0     0x0000d100 SIZE 8  I/O
  BASE1     0x0000d110 SIZE 4  I/O
  BASE2     0x0000d108 SIZE 8  I/O
  BASE3     0x0000d114 SIZE 4  I/O
  BASE4     0x0000d0c0 SIZE 32  I/O
  BASE5     0xf6004000 SIZE 2048  MEM
  MAX_LAT   0x00  MIN_GNT 0x00  INT_PIN 0x02  INT_LINE 0x07
Actions #4

Updated by Robert Mustacchi 9 months ago

Yes, it was the different class code that concerned me in this case. In general, when a device doesn't use the class code it's not safe to assume that, which is why I was uncertain here. Looking at the ICH8 datasheet, it does appear that it'll still end up with an ahci based device and we're probably fine because there is no Intel Matrix Storage Manager RAID Option ROM. I guess there'll have to be a different device that the Intel driver would attach to if it were present, so we can probably add 8086,2822 in general here and perhaps the mobile variant 282a as indicated by the spec update which is in a similar boat. I guess I'll put something together.

Actions #5

Updated by Robert Mustacchi 9 months ago

  • Category set to driver - device drivers
  • Assignee set to Robert Mustacchi
  • % Done changed from 0 to 50
  • Difficulty changed from Medium to Bite-size
Actions #6

Updated by Electric Monk 9 months ago

  • Gerrit CR set to 1306
Actions #7

Updated by Robert Mustacchi 9 months ago

Gary, John, does one of you want to test this and make sure that I've gotten this right upstream?

Actions #8

Updated by Gary Mills 9 months ago

Yes, I'd be happy to test this fix. How do I do this when I've already made the change manually?

Actions #9

Updated by Robert Mustacchi 9 months ago

There are a couple of different ways. One is to create a new boot environment and just edit the /etc/aliases to include the new entries as opposed to your old one. Another would be to build illumos-gate with the assosciated change and use onu.

Actions #10

Updated by Gary Mills 9 months ago

The first way sounds easy to me.

Where do I find your new entries?

Actions #11

Updated by Robert Mustacchi 9 months ago

You can find them in the review linked from here (https://code.illumos.org/c/illumos-gate/+/1306/1/usr/src/pkg/manifests/driver-storage-ahci.mf). Effectively they are:

  • pci8086,2822,p
  • pci8086,282a,p
Actions #12

Updated by Gary Mills 9 months ago

Thanks for the link. Putting those two entries in /etc/driver_aliases does work. I got a normal boot of the new BE after I did that.

Actions #13

Updated by Robert Mustacchi 9 months ago

Great, thanks for testing that Gary!

Actions #14

Updated by Electric Monk 9 months ago

  • Status changed from New to Closed
  • % Done changed from 50 to 100

git commit b2761fb273089c452ca34297d7ab4a1d1c1f1012

commit  b2761fb273089c452ca34297d7ab4a1d1c1f1012
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2021-03-17T14:22:21.000Z

    13599 ahci(7d) requires alias for HP AHCI SATA controller
    Reviewed by: Dan McDonald <danmcd@joyent.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Gordon Ross <gordon.w.ross@gmail.com>

Actions

Also available in: Atom PDF