Hello Conrad, On Fri, Apr 05, 2024 at 10:53:55PM +0000, Conrad Kostecki wrote: > Hi Damien, > > Am 05.04.2024 14:51:43, "Damien Le Moal" <dlemoal@xxxxxxxxxx> schrieb: > > > <PATCH v2> > i did run a test on my hardware. > It seems to work and adjusting the port_map. But I noticed a difference, > that those virtual hostXY ports are not marked as DUMMY. > With the previous patch, only six ports reported "ahci" and rest "DUMMY". > I am not sure, if that should also not happen with your patch? > Conrad > [ 13.365573] ahci 0000:09:00.0: masking port_map 0xffffff3f -> 0x3f > [ 13.376511] ahci 0000:09:00.0: SSS flag set, parallel bus scan disabled > [ 13.395670] ahci 0000:09:00.0: AHCI 0001.0301 32 slots 32 ports 6 Gbps > 0x3f impl SATA mode This print above suggests that you are testing on a v6.8 based kernel. (The print has been improved in v6.9) I do not understand why things are not working for you. Could you please test with v6.9-rc4 + the attached debug patch. Please make sure that you don't have any other changes on top of v6.9-rc4 other than the debug patch. (mask_port_map is already included in v6.9-rc4.) Here is a how v6.9-rc4 + the attached debug patch looks for me with ahci.mask_port_map=0000:00:03.0=0xf added to the kernel command line. (If you use a /etc/modprobe.d/ahci.conf file instead, I assume that should look something like: options ahci mask_port_map=0000:00:03.0=0xf ) [ 0.538102] ahci 0000:00:03.0: masking port_map 0x3f -> 0xf [ 0.539063] ahci 0000:00:03.0: port 1/6 is implemented (port_map 0xf) [ 0.539933] ahci 0000:00:03.0: port 2/6 is implemented (port_map 0xf) [ 0.540750] ahci 0000:00:03.0: port 3/6 is implemented (port_map 0xf) [ 0.541663] ahci 0000:00:03.0: port 4/6 is implemented (port_map 0xf) [ 0.542990] ahci 0000:00:03.0: port 5/6 not implemented, mark as dummy (port_map 0xf) [ 0.544121] ahci 0000:00:03.0: port 6/6 not implemented, mark as dummy (port_map 0xf) [ 0.545766] ahci 0000:00:03.0: port 1/6 is implemented, calling init (port_map 0xf) [ 0.546718] ahci 0000:00:03.0: port 2/6 is implemented, calling init (port_map 0xf) [ 0.547642] ahci 0000:00:03.0: port 3/6 is implemented, calling init (port_map 0xf) [ 0.548399] ahci 0000:00:03.0: port 4/6 is implemented, calling init (port_map 0xf) [ 0.549418] ahci 0000:00:03.0: port 5/6 is not implemented, skipping init (port_map 0xf) [ 0.550650] ahci 0000:00:03.0: port 6/6 is not implemented, skipping init (port_map 0xf) [ 0.551306] ahci 0000:00:03.0: AHCI vers 0001.0000, 32 command slots, 1.5 Gbps, SATA mode [ 0.551947] ahci 0000:00:03.0: 4/6 ports implemented (port mask 0xf) [ 0.552444] ahci 0000:00:03.0: flags: 64bit ncq only [ 0.553652] scsi host0: ahci [ 0.554138] scsi host1: ahci [ 0.554535] scsi host2: ahci [ 0.555332] scsi host3: ahci [ 0.555806] scsi host4: ahci [ 0.556212] scsi host5: ahci [ 0.556502] ata1: SATA max UDMA/133 abar m4096@0xfebd1000 port 0xfebd1100 irq 43 lpm-pol 3 [ 0.557146] ata2: SATA max UDMA/133 abar m4096@0xfebd1000 port 0xfebd1180 irq 43 lpm-pol 3 [ 0.557791] ata3: SATA max UDMA/133 abar m4096@0xfebd1000 port 0xfebd1200 irq 43 lpm-pol 3 [ 0.558429] ata4: SATA max UDMA/133 abar m4096@0xfebd1000 port 0xfebd1280 irq 43 lpm-pol 3 [ 0.559064] ata5: DUMMY [ 0.559260] ata6: DUMMY Please post your whole log, including both lines prefixed with "scsi" and "ata". As you can see, you should see, with your configuration, 32 "scsi: hostX: ahci" prints, 6 "ataX: SATA max ..." prints, 26 "ataX: DUMMY" prints. If your operating system is using systemd (considering your gentoo address, this is not a given), you could run: $ systemd-analyze both with and without the kernel module option. You should be able to see a difference. Or if you don't have systemd, please just upload the full dmesg with and without the kernel module option, so that we can look at the timestamps. Kind regards, Niklas
>From 6b5f6be5ade9bfed6765724877ea72524d965fbb Mon Sep 17 00:00:00 2001 From: Niklas Cassel <cassel@xxxxxxxxxx> Date: Wed, 17 Apr 2024 15:41:24 +0200 Subject: [PATCH] mask_port_map debug prints Signed-off-by: Niklas Cassel <cassel@xxxxxxxxxx> --- drivers/ata/ahci.c | 8 +++++++- drivers/ata/libahci.c | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 6548f10e61d9..6b54b128ac93 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -2011,8 +2011,14 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ahci_update_initial_lpm_policy(ap); /* disabled/not-implemented port */ - if (!(hpriv->port_map & (1 << i))) + if (!(hpriv->port_map & (1 << i))) { ap->ops = &ata_dummy_port_ops; + dev_info(host->dev, "port %d/%d not implemented, mark as dummy (port_map %#x)\n", + i+1, host->n_ports, hpriv->port_map); + } else { + dev_info(host->dev, "port %d/%d is implemented (port_map %#x)\n", + i+1, host->n_ports, hpriv->port_map); + } } /* apply workaround for ASUS P5W DH Deluxe mainboard */ diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 83431aae74d8..11d97d4f44ad 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -1303,8 +1303,14 @@ void ahci_init_controller(struct ata_host *host) struct ata_port *ap = host->ports[i]; port_mmio = ahci_port_base(ap); - if (ata_port_is_dummy(ap)) + if (ata_port_is_dummy(ap)) { + dev_info(host->dev, "port %d/%d is not implemented, skipping init (port_map %#x)\n", + i+1, host->n_ports, hpriv->port_map); continue; + } else { + dev_info(host->dev, "port %d/%d is implemented, calling init (port_map %#x)\n", + i+1, host->n_ports, hpriv->port_map); + } ahci_port_init(host->dev, ap, i, mmio, port_mmio); } -- 2.44.0