Index | Thread | Search

From:
Jan Klemkow <jan@openbsd.org>
Subject:
Re: ahci(4): Disable PMP for AMD AHCI controler
To:
Mike Larkin <mlarkin@nested.page>
Cc:
Jonathan Matthew <jonathan@d14n.org>, tech@openbsd.org
Date:
Tue, 21 Jul 2026 14:32:46 +0200

Download raw body.

Thread
On Tue, Jul 21, 2026 at 05:02:04AM -0700, Mike Larkin wrote:
> On Tue, Jul 21, 2026 at 09:39:22AM +0200, Jan Klemkow wrote:
> > On Tue, Jul 21, 2026 at 09:55:50AM +1000, Jonathan Matthew wrote:
> > > On Mon, Jul 20, 2026 at 08:17:33PM +0200, Jan Klemkow wrote:
> > > > The AMD AHCI controller advertises port multiplier support but probing
> > > > for a PMP on each port costs 10 seconds of timeouts per disk at attach
> > > > time.  We should disable it, like we do it for Intel.
> > >
> > > What systems does this controller appear in?
> >
> > ASRock Rack TURIND8-2L2T mainboard with an AMD EPYC 9115 processor.
> > I'm not sure in which component contains the SATA controller.
> >
> > > Do you know if port multipliers actually work with it?
> >
> > No, I don't have hardware to test the SATA port multiplier function.
> > Do you know what I would need to test it?
> >
> 
> I think I have one of these on my EPYC 7773X ASUS machine. Please hold off
> until I have a chance to test cos that's got all my storage attached to it :)

Could you also check on your machine, if it hangs for 10s for every port
at this attach stage?

ahci2 at pci15 dev 0 function 0 "AMD FCH AHCI" rev 0x93: msi, AHCI 1.3.1
ahci2: port 0: 6.0Gb/s
ahci2: port 1: 6.0Gb/s
ahci2: port 2: 6.0Gb/s
ahci2: port 3: 6.0Gb/s

> > > > Index: dev/pci/ahci_pci.c
> > > > ===================================================================
> > > > RCS file: /cvs/src/sys/dev/pci/ahci_pci.c,v
> > > > diff -u -p -r1.18 ahci_pci.c
> > > > --- dev/pci/ahci_pci.c	16 Jun 2024 18:00:08 -0000	1.18
> > > > +++ dev/pci/ahci_pci.c	20 Jul 2026 15:00:21 -0000
> > > > @@ -67,6 +67,8 @@ int			ahci_ati_sb700_attach(struct ahci_
> > > >  			    struct pci_attach_args *);
> > > >  int			ahci_amd_hudson2_attach(struct ahci_softc *,
> > > >  			    struct pci_attach_args *);
> > > > +int			ahci_amd_kerncz_attach(struct ahci_softc *,
> > > > +			    struct pci_attach_args *);
> > > >  int			ahci_intel_attach(struct ahci_softc *,
> > > >  			    struct pci_attach_args *);
> > > >  int			ahci_samsung_attach(struct ahci_softc *,
> > > > @@ -88,6 +90,11 @@ static const struct ahci_device ahci_dev
> > > >  	{ PCI_VENDOR_AMD,	PCI_PRODUCT_AMD_HUDSON2_SATA_6,
> > > >  	    NULL,		ahci_amd_hudson2_attach },
> > > >
> > > > +	{ PCI_VENDOR_AMD,	PCI_PRODUCT_AMD_KERNCZ_AHCI_1,
> > > > +	    NULL,		ahci_amd_kerncz_attach },
> > > > +	{ PCI_VENDOR_AMD,	PCI_PRODUCT_AMD_KERNCZ_AHCI_2,
> > > > +	    NULL,		ahci_amd_kerncz_attach },
> > > > +
> > > >  	{ PCI_VENDOR_ATI,	PCI_PRODUCT_ATI_SB600_SATA,
> > > >  	    NULL,		ahci_ati_sb600_attach },
> > > >  	{ PCI_VENDOR_ATI,	PCI_PRODUCT_ATI_SBX00_SATA_1,
> > > > @@ -263,6 +270,14 @@ ahci_amd_hudson2_attach(struct ahci_soft
> > > >  	ahci_ati_sb_idetoahci(sc, pa);
> > > >
> > > >  	sc->sc_flags |= AHCI_F_IPMS_PROBE;
> > > > +
> > > > +	return (0);
> > > > +}
> > > > +
> > > > +int
> > > > +ahci_amd_kerncz_attach(struct ahci_softc *sc, struct pci_attach_args *pa)
> > > > +{
> > > > +	sc->sc_flags |= AHCI_F_NO_PMP;
> > > >
> > > >  	return (0);
> > > >  }
> >
>