mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Andrey Melnikov <temnota.am@gmail.com>,
	Serge Semin <fancer.lancer@gmail.com>
Cc: Sergei Shtylyov <sergei.shtylyov@gmail.com>,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
	dlemoal@kernel.org, hdegoede@redhat.com
Subject: Re: [PATCH] ahci: asm1064: correct count of reported ports
Date: Thu, 8 Feb 2024 09:37:32 +0100	[thread overview]
Message-ID: <ZcSSzDI2qL3LSQvr@x1-carbon> (raw)
In-Reply-To: <CA+PODjpOE=LGPi1G1ebvEwGeXAfpuZ+s_k4uMUwu3i6st9y--g@mail.gmail.com>

Hello Serge, Andrey,

On Thu, Feb 08, 2024 at 10:27:11AM +0300, Andrey Melnikov wrote:
> > On 2/7/24 12:58 PM, 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
> > > ahci 0000:04:00.0: flags: 64bit ncq sntf stag pm led only pio sxs deso sadm sds apst
> > >
> > >
> > > Signed-off-by: Andrey Jr. Melnikov <temnota.am@gmail.com>
> > >
> > > diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> > > index da2e74fce2d9..ec30d8330d16 100644
> > > --- a/drivers/ata/ahci.c
> > > +++ b/drivers/ata/ahci.c
> > > @@ -671,9 +671,14 @@ MODULE_PARM_DESC(mobile_lpm_policy, "Default LPM policy for mobile chipsets");
> > >  static void ahci_pci_save_initial_config(struct pci_dev *pdev,
> > >                                        struct ahci_host_priv *hpriv)
> > >  {
> > > -     if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && pdev->device == 0x1166) {
> > > -             dev_info(&pdev->dev, "ASM1166 has only six ports\n");
> > > -             hpriv->saved_port_map = 0x3f;
> > > +     if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA) {
> > > +             if (pdev->device == 0x1166) {
> >
> >    Maybe *switch* instead?
> 
> Ok.
> Can someone explain to me - which method I should use here - override
> portmap via hpriv->saved_port_map or mask it via hpriv->mask_port_map
> ?

Serge, you seem to be the last person to touch this in
commit 88589772e80c ("ata: libahci: Discard redundant force_port_map
parameter"), where you removed force_port_map, so you are already
familiar with this code.

From my quick look, it looks like mask_port_map is used to disable one or
more ports from the port_map.

But do you know if there is a reason why platforms that need to do that
can't just change saved_port map directly?


Kind regards,
Niklas

  reply	other threads:[~2024-02-08  8:37 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
2024-02-07 11:28 ` Sergei Shtylyov
2024-02-08  7:27   ` Andrey Melnikov
2024-02-08  8:37     ` Niklas Cassel [this message]
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=ZcSSzDI2qL3LSQvr@x1-carbon \
    --to=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=fancer.lancer@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sergei.shtylyov@gmail.com \
    --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®