From: Damien Le Moal <dlemoal@kernel.org>
To: Andrey Melnikov <temnota.am@gmail.com>,
Hans de Goede <hdegoede@redhat.com>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ahci: asm1064: correct count of reported ports
Date: Thu, 8 Feb 2024 16:44:51 +0900 [thread overview]
Message-ID: <d10350d1-11e6-497f-9e81-d484bc0aece1@kernel.org> (raw)
In-Reply-To: <CA+PODjozWG6iXcR01KE4N1DyTKeKXtravwanWS3Gtq8mEqutuA@mail.gmail.com>
On 2/8/24 16:21, Andrey Melnikov wrote:
>>
>> Hi Andrey
>>
>> On 2/7/24 10:58, Andrey Jr. Melnikov wrote:
>>> The ASM1064 SATA host controller always reports wrongly,
>>> that it has 24 ports. But in reality, it only has four ports.
>>>
>>> before:
>>> ahci 0000:04:00.0: SSS flag set, parallel bus scan disabled
>>> ahci 0000:04:00.0: AHCI 0001.0301 32 slots 24 ports 6 Gbps 0xffff0f impl SATA mode
>>> ahci 0000:04:00.0: flags: 64bit ncq sntf stag pm led only pio sxs deso sadm sds apst
>>>
>>> after:
>>> ahci 0000:04:00.0: ASM1064 has only four ports
>>> ahci 0000:04:00.0: forcing port_map 0xffff0f -> 0xf
>>> ahci 0000:04:00.0: SSS flag set, parallel bus scan disabled
>>> ahci 0000:04:00.0: AHCI 0001.0301 32 slots 24 ports 6 Gbps 0xf impl SATA mode
>>
>> This still says 24 ports, is that a copy & paste error in the commit msg ?
>
> This is the raw value of the read-only Host Capability register, how
> should it be changed here? If silicon lies about its configuration -
> kerel prints what it sees from silicon.
This should print the actual number of ports that you forced with the port map
change:
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 1a63200ea437..7cb3f137bc1b 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -2637,7 +2637,7 @@ void ahci_print_info(struct ata_host *host, const char *scc_s)
vers & 0xff,
((cap >> 8) & 0x1f) + 1,
- (cap & 0x1f) + 1,
+ (cap & hpriv->saved_port_map) + 1,
speed_s,
impl,
scc_s);
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2024-02-08 7:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-07 9:58 Andrey Jr. Melnikov
2024-02-07 11:15 ` Hans de Goede
2024-02-08 7:21 ` Andrey Melnikov
2024-02-08 7:44 ` Damien Le Moal [this message]
2024-02-07 11:28 ` Sergei Shtylyov
2024-02-08 7:27 ` Andrey Melnikov
2024-02-08 8:37 ` Niklas Cassel
2024-02-08 12:04 ` Andrey Melnikov
2024-02-13 17:19 ` Niklas Cassel
2024-02-13 18:05 ` Niklas Cassel
2024-02-14 0:09 ` Damien Le Moal
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=d10350d1-11e6-497f-9e81-d484bc0aece1@kernel.org \
--to=dlemoal@kernel.org \
--cc=hdegoede@redhat.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=temnota.am@gmail.com \
/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
all inboxes | Powered by JetHome®