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 8CB471E525; Mon, 1 Apr 2024 16:45:00 +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=1711989900; cv=none; b=CkYM3jK2KP5ij4LinNJqEYI9N3bjEmH5ketMWsg+hU7oEbMw5KPUzSZ7nzYXIlHHybFuIxX2vTJUCGsUb2UtUtpmTc6sVOkf8Pcafg8urU4cR/1rU1l2VFV0/sfEWXLAMtyD18xM60FfHNTf7YvsN/l5a+EpdHqg30fEpI5TZPY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711989900; c=relaxed/simple; bh=VjmP1DQSwWEkhgEsfzQrhIsjznf3Pibimw0pLVQ9JoQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q8aSD9Dck10XVxLPWGjA/pMfce3fT5wK+n8Mtjo8FCotkfpCD2s8nkSyswBqpVdig4A0Ynx6iTfoe7iQc7oZDSmGnegzosAwzgGAMDOhgs02bVgH21ivmXf9rWyVt1GPZGz8YQjHOgMsAwSNITxcZK7V0bnrxlA9c2L72Mk6iSs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1BpkGwkr; 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="1BpkGwkr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEB8FC433F1; Mon, 1 Apr 2024 16:44:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1711989900; bh=VjmP1DQSwWEkhgEsfzQrhIsjznf3Pibimw0pLVQ9JoQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1BpkGwkrLqlIAiBi4fFYV5wC8eZEToNT4oQnKtWAjydgt8CQ2qA3I+nFCuWiRMGj8 QrMQi1OMhyy7C/4sEZypVvQXBw+Zn0CiP38fEjoyoHDpdlOzfspxMSVAbMmC5ok10F YIKNLuoqvc0+DJe/jmxprDbWktHqro6rlKoYz8E4= 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 6.6 179/396] ahci: asm1064: correct count of reported ports Date: Mon, 1 Apr 2024 17:43:48 +0200 Message-ID: <20240401152553.280060657@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240401152547.867452742@linuxfoundation.org> References: <20240401152547.867452742@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 6.6-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 90d33c519f4c6..9933ad9737bb2 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -670,9 +670,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