From: Niklas Cassel <cassel@kernel.org>
To: Conrad Kostecki <conikost@gentoo.org>
Cc: Damien Le Moal <dlemoal@kernel.org>,
linux-ide@vger.kernel.org, Szuying Chen <chensiying21@gmail.com>,
Jesse1_Chang@asmedia.com.tw, Richard_Hsu@asmedia.com.tw,
Chloe_Chen@asmedia.com.tw
Subject: Re: [PATCH v2] ata: ahci: Add mask_port_map module parameter
Date: Wed, 17 Apr 2024 19:21:21 +0200 [thread overview]
Message-ID: <ZiAFEbDnwuqYWaAU@ryzen> (raw)
In-Reply-To: <em6045942b-7739-40b7-8c9d-ad047918cdb8@a351f4b0.com>
[-- Attachment #1: Type: text/plain, Size: 3952 bytes --]
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@kernel.org> 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
[-- Attachment #2: 0001-mask_port_map-debug-prints.patch --]
[-- Type: text/plain, Size: 1866 bytes --]
From 6b5f6be5ade9bfed6765724877ea72524d965fbb Mon Sep 17 00:00:00 2001
From: Niklas Cassel <cassel@kernel.org>
Date: Wed, 17 Apr 2024 15:41:24 +0200
Subject: [PATCH] mask_port_map debug prints
Signed-off-by: Niklas Cassel <cassel@kernel.org>
---
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
next prev parent reply other threads:[~2024-04-17 17:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 12:51 [PATCH v2] ata: ahci: Add mask_port_map module parameter Damien Le Moal
2024-04-05 13:10 ` Niklas Cassel
2024-04-05 13:14 ` Niklas Cassel
2024-04-05 22:53 ` Conrad Kostecki
2024-04-08 0:47 ` Damien Le Moal
2024-04-08 2:26 ` Damien Le Moal
2024-04-14 13:14 ` Re[2]: " Conrad Kostecki
2024-04-16 23:13 ` Damien Le Moal
2024-04-16 23:29 ` Re[2]: " Conrad Kostecki
2024-04-17 17:21 ` Niklas Cassel [this message]
2024-05-05 19:42 ` Conrad Kostecki
2024-05-06 16:46 ` Niklas Cassel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZiAFEbDnwuqYWaAU@ryzen \
--to=cassel@kernel.org \
--cc=Chloe_Chen@asmedia.com.tw \
--cc=Jesse1_Chang@asmedia.com.tw \
--cc=Richard_Hsu@asmedia.com.tw \
--cc=chensiying21@gmail.com \
--cc=conikost@gentoo.org \
--cc=dlemoal@kernel.org \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox