All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josua Mayer <josua@solid-run.com>
To: Damien Le Moal <dlemoal@kernel.org>,
	"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
	Niklas Cassel <cassel@kernel.org>
Cc: Klaus Kudielka <klaus.kudielka@gmail.com>
Subject: Re: [PATCH v2] ata: libahci_platform: Do not set mask_port_map when not needed
Date: Sat, 8 Feb 2025 13:42:34 +0000	[thread overview]
Message-ID: <e0c77e98-3ab2-4381-809d-261a3386ff03@solid-run.com> (raw)
In-Reply-To: <20250207232915.1439174-1-dlemoal@kernel.org>

Am 08.02.25 um 00:29 schrieb Damien Le Moal:
> Commit 8c87215dd3a2 ("ata: libahci_platform: support non-consecutive
> port numbers") modified ahci_platform_get_resources() to allow
> identifying the ports of a controller that are defined as child nodes of
> the controller node in order to support non-consecutive port numbers (as
> defined by the platform device tree).
>
> However, this commit also erroneously sets bit 0 of
> hpriv->mask_port_map when the platform devices tree does not define port
> child nodes, to match the fact that the temporary default number of
> ports used in that case is 1 (which is also consistent with the fact
> that only index 0 of hpriv->phys[] is initialized with the call to
> ahci_platform_get_phy(). But doing so causes ahci_platform_init_host()
> to initialize and probe only the first port, even if this function
> determines that the controller has in fact multiple ports using the
> capability register of the controller (through a call to
> ahci_nr_ports()). This can be seen with the ahci_mvebu driver (Armada
> 385 SoC) with the second port declared as "dummy":
>
> ahci-mvebu f10a8000.sata: masking port_map 0x3 -> 0x1
> ahci-mvebu f10a8000.sata: AHCI vers 0001.0000, 32 command slots, 6 Gbps, platform mode
> ahci-mvebu f10a8000.sata: 1/2 ports implemented (port mask 0x1)
> ahci-mvebu f10a8000.sata: flags: 64bit ncq sntf led only pmp fbs pio slum part sxs
> scsi host0: ahci-mvebu
> scsi host1: ahci-mvebu
> ata1: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x100 irq 40 lpm-pol 0
> ata2: DUMMY
>
> Fix this issue by removing setting bit 0 of hpriv->mask_port_map when
> the platform device tree does not define port child nodes.
>
> Reported-by: Klaus Kudielka <klaus.kudielka@gmail.com>
> Fixes: 8c87215dd3a2 ("ata: libahci_platform: support non-consecutive port numbers")
> Tested-by: Klaus Kudielka <klaus.kudielka@gmail.com>
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
> ---
> Changes from v1:
>  - Improved commit message (fixed typos, added example and removed
>    cc-stable tag).
>
>  drivers/ata/libahci_platform.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
> index 53b2c7719dc5..91d44302eac9 100644
> --- a/drivers/ata/libahci_platform.c
> +++ b/drivers/ata/libahci_platform.c
> @@ -651,8 +651,6 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev,
>  		 * If no sub-node was found, keep this for device tree
>  		 * compatibility
>  		 */
> -		hpriv->mask_port_map |= BIT(0);
> -
>  		rc = ahci_platform_get_phy(hpriv, 0, dev, dev->of_node);
>  		if (rc)
>  			goto err_out;

After testing on Armada 388 Helios-4 board with and without port subnodes,
I can confirm that before my patch and without port subnodes
both controller ports were fully operational.

Therefore I believe restoring the original behaviour here is correct.

Acked-by: Josua Mayer <josua@solid-run.com>


  reply	other threads:[~2025-02-08 13:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20250225093429eucas1p2ea23b1831e33fcae6e58a7c6ba574232@eucas1p2.samsung.com>
2025-02-07 23:29 ` [PATCH v2] ata: libahci_platform: Do not set mask_port_map when not needed Damien Le Moal
2025-02-08 13:42   ` Josua Mayer [this message]
2025-02-10 10:55   ` Niklas Cassel
2025-02-25  9:34   ` Marek Szyprowski
2025-02-25 14:24     ` 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=e0c77e98-3ab2-4381-809d-261a3386ff03@solid-run.com \
    --to=josua@solid-run.com \
    --cc=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=klaus.kudielka@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.