From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2589A7F7CC; Mon, 8 Apr 2024 13:14:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712582078; cv=none; b=lPj91uWeTbm1dpa2zZzawcBb0n868vIRo7A8WEMbAwCcr7kWm/jzfVk3xqAIPjvlCi5NELy4xtBlxaYpmQpvRlMRLIQfaYnLXQF+mwLIDHo2myfeBdlWSqSgHFhrBLQeBAp0OtPG06wWeMAuRPiFTM9UhoTWjeIgtAP2TYpKuzA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712582078; c=relaxed/simple; bh=/zogEVECydoI924RoDQ2mVqCChhTrsPAg/5opJbp+H4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VnKyRuvXdL1vTlFdjTIBQIm2YmPhvAs3lOTcD3GnBjb5PXtnT/QmwlbxYFwic7EjM3F9cCU0CN0nH0x5ud5vphf7ADBGuZlZ6rgZx7GIVr67Agugl2Uywf/w0h4k2+qi8KgrJ89gwrmLDv3/pQwwYGrEaadFhzPhjQKawO5Qq8M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KJk6OCYW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="KJk6OCYW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A28D1C433C7; Mon, 8 Apr 2024 13:14:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712582078; bh=/zogEVECydoI924RoDQ2mVqCChhTrsPAg/5opJbp+H4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KJk6OCYWlr1VjSI/VoC1SAI5yB85RrF+JegfRLnOsVf1MC6ZDPR+mtj2UHdojDZAR kW/+pJS63JsR85GEVxtNUXF3bMzqM2o7HYBsTFd2Gs5zcxvhp1LQWFGrZEoiYv2K5I NleY66Vj+QhtNOM3pgtNDQhmBUfKvUVB8g7JJGWc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Andrey Jr. Melnikov" , Niklas Cassel , Sasha Levin Subject: [PATCH 5.15 109/690] ahci: asm1064: correct count of reported ports Date: Mon, 8 Apr 2024 14:49:35 +0200 Message-ID: <20240408125403.471855534@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240408125359.506372836@linuxfoundation.org> References: <20240408125359.506372836@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andrey Jr. Melnikov [ Upstream commit 9815e39617541ef52d0dfac4be274ad378c6dc09 ] 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" Signed-off-by: Niklas Cassel Stable-dep-of: 6cd8adc3e189 ("ahci: asm1064: asm1166: don't limit reported ports") Signed-off-by: Sasha Levin --- drivers/ata/ahci.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index b0a8aac008bae..2d1f5cede60b2 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -666,9 +666,17 @@ 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) { + switch (pdev->device) { + case 0x1166: + dev_info(&pdev->dev, "ASM1166 has only six ports\n"); + hpriv->saved_port_map = 0x3f; + break; + case 0x1064: + dev_info(&pdev->dev, "ASM1064 has only four ports\n"); + hpriv->saved_port_map = 0xf; + break; + } } if (pdev->vendor == PCI_VENDOR_ID_JMICRON && pdev->device == 0x2361) { -- 2.43.0