All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: u-boot@lists.denx.de
Subject: [PATCH 5/6] drivers: ata: ahci: update max id if it is more than available ports
Date: Thu, 25 Mar 2021 17:07:36 -0700	[thread overview]
Message-ID: <20210326000737.9764-6-tharvey@gateworks.com> (raw)
In-Reply-To: <20210326000737.9764-1-tharvey@gateworks.com>

From: Suneel Garapati <sgarapati@marvell.com>

After check for maximum between max id and available ports, also check
if available port count is less than max id and update.

In the case of the CN8030 OcteonTX SoC max_id needs to be reduced to
the number of ports found otherwise the following occurs on a scan:

GW6404-B> scsi scan
scanning bus for devices...
Target spinup took 0 ms.
AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
flags: 64bit ncq ilck stag pm led clo only pmp fbss pio slum part ccc
apst
  Device 0: (0:0) Vendor: ATA Prod.: SanDisk SD8SFAT0 Rev: Z233
            Type: Hard Disk
            Capacity: 61057.3 MB = 59.6 GB (125045424 x 512)
"Synchronous Abort" handler, esr 0x96000006
elr: 000000000052f824 lr : 000000000052fa10 (reloc)
elr: 000000007fee9824 lr : 000000007fee9a10
x0 : 0000000000000001 x1 : 0000000000000001
x2 : 000000007bea3528 x3 : 000000007bea3580
x4 : 0000000000000200 x5 : 0000000000000000
x6 : 0000000000000002 x7 : 000000007bea3540
x8 : 00000000fffffff8 x9 : 0000000000000008
x10: 00000000000186a0 x11: 000000000000000d
x12: 0000000000000006 x13: 000000000001869f
x14: 0000000000000007 x15: 00000000ffffffff
x16: 000000007ff439a5 x17: 000000007ff5730c
x18: 000000007bea9de0 x19: 000000007ff7a580
x20: 000000007bec79f8 x21: 0000000000000000
x22: 000000007bea3580 x23: 0000000000000000
x24: 0000000000000000 x25: 000000007bec7a00
x26: 00000000ffffffc0 x27: 000000007bec79d0
x28: 000000007beb51c0 x29: 000000007bea3480

Code: 91246800 940130c2 12800000 1400004f (b9402ae0)
Resetting CPU ...

Signed-off-by: Suneel Garapati <sgarapati@marvell.com>
---
 drivers/ata/ahci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 2ef21ec508..98b288254b 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1190,6 +1190,9 @@ int ahci_probe_scsi(struct udevice *ahci_dev, ulong base)
 	 */
 	uc_plat->max_id = max_t(unsigned long, uc_priv->n_ports,
 				uc_plat->max_id);
+	/* If port count is less than max_id, update max_id */
+	if (uc_priv->n_ports < uc_plat->max_id)
+		uc_plat->max_id = uc_priv->n_ports;
 
 	return 0;
 }
-- 
2.17.1

  parent reply	other threads:[~2021-03-26  0:07 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26  0:07 [PATCH 0/6] octeontx cleanup and fixes Tim Harvey
2021-03-26  0:07 ` [PATCH 1/6] arm: octeontx: move CONFIG_SUPPORT_RAW_INITRD to configs Tim Harvey
2021-03-26  6:38   ` Stefan Roese
2021-04-20 14:20   ` Tom Rini
2021-03-26  0:07 ` [PATCH 2/6] arm: octeontx: support generic distro config Tim Harvey
2021-03-26  6:44   ` Stefan Roese
2021-04-20 14:20   ` Tom Rini
2021-03-26  0:07 ` [PATCH 3/6] arm: octeontx: enable WDT_SBSA Tim Harvey
2021-03-26  6:44   ` Stefan Roese
2021-04-20 14:20   ` Tom Rini
2021-03-26  0:07 ` [PATCH 4/6] drivers: net: octeontx: fix QSGMII Tim Harvey
2021-03-26  6:46   ` Stefan Roese
2021-03-26 16:08     ` Suneel Garapati
2021-03-26 16:37       ` Tim Harvey
2021-03-26 16:39         ` Suneel Garapati
2021-04-08 19:55           ` Tim Harvey
2021-04-20 14:20   ` Tom Rini
2021-03-26  0:07 ` Tim Harvey [this message]
2021-03-26  6:47   ` [PATCH 5/6] drivers: ata: ahci: update max id if it is more than available ports Stefan Roese
2021-04-20 14:20   ` Tom Rini
2021-03-26  0:07 ` [PATCH 6/6] net: octeontx: smi: fix mii probe Tim Harvey
2021-03-26  6:48   ` Stefan Roese
2021-03-26 15:55     ` Tim Harvey
2021-03-26 16:03       ` Suneel Garapati
2021-04-27  5:19       ` Stefan Roese
2021-04-28 15:11         ` Tim Harvey
2021-04-29  5:21           ` Stefan Roese
2021-04-29 14:27             ` Tim Harvey
2021-04-20 14:20   ` Tom Rini
2021-03-26  6:49 ` [PATCH 0/6] octeontx cleanup and fixes Stefan Roese
2021-03-26 15:51   ` Tim Harvey

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=20210326000737.9764-6-tharvey@gateworks.com \
    --to=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    /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.