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 DE6FC487BE; Mon, 1 Apr 2024 17:03:30 +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=1711991011; cv=none; b=CRxepR4wmeCXPoEqkurxr0zEOXbM3GeQ7KHuy0qqphwCCffTzSt8HbU6shFDZTmO+ZirqMSWa8IalRrgHfX+DM2iytb0Q9j2oqlJFyLCiPsK1KP1JtnfVm7HKg7svFFeKB47pH4AswjWgtYPRurATP8PnSJ8rYAA++RRQK/aqhk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711991011; c=relaxed/simple; bh=ps8zLzPZdbWf2Ggg30RMPT1mrPWIM4B15C3lEKWJ5rc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qz64Vv2a6x9A+DVQ0DyCJ82TUttGWefF+Pq71Vi0fc3k4sJuTclCEjBi3kUc3yL8KIqzeR8cor2NR4VAH/dEpEoYwyCRqKDBZvlNFS5dqfSFJ0PQ4Krme2dbUN93hbbMQYrc+eoTnX/FanOd2HK7PQOos1bauydSGPVSIw/Km8U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=U4Cl3aeA; 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="U4Cl3aeA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D8DAC433F1; Mon, 1 Apr 2024 17:03:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1711991010; bh=ps8zLzPZdbWf2Ggg30RMPT1mrPWIM4B15C3lEKWJ5rc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U4Cl3aeAkrkzKJcYXrDkK3w+WR9m9GdtHOo/15gW8VJNDttecDDMPXiXvP9PE+KsS +W15QUbrS/QS3MMB0YV7BbkbJR0J1Y85WH5CmCsO5C1JuS1Pz2BrjQS2s0pxn+lNLv jqSTlmB123KgqoQ20xeGkwezAwqepl+DNx9oFg1k= 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.1 135/272] ahci: asm1064: correct count of reported ports Date: Mon, 1 Apr 2024 17:45:25 +0200 Message-ID: <20240401152534.904433220@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240401152530.237785232@linuxfoundation.org> References: <20240401152530.237785232@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.1-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 1790a2ecb9fac..9de1731b6b444 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -671,9 +671,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