Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp657456rdb; Tue, 23 Jan 2024 10:31:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHh1r/mhnn7sb8+6kDlTIPdDl2dY3YkfbgOSeTk3YpHAYy+0Ds8ck1nQSZbuefURrjKpclO X-Received: by 2002:a05:6358:704:b0:176:4f23:ba50 with SMTP id e4-20020a056358070400b001764f23ba50mr3523345rwj.38.1706034694858; Tue, 23 Jan 2024 10:31:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706034694; cv=pass; d=google.com; s=arc-20160816; b=JUE1ibPsTyFrrBYldGly+9PgE/xLUAcK19i3UodaUS6+XBAY9Riq7H6fwkmdOwrnOK 52B++5WpjWCdH42Fx0VcYSTMuGOKHNsZ1iX8e+BwA+B4ekgoFnS3729gKRFc99W+UcO/ 3jQClfJgP+ijC8pEstU/cKtRNZdtY7zBiFaDTEoiTzJOFmOURWevL7rIJmHSqg3SGtuw fGV7VrGquu2umf0bl9PLnQ1WRppCO5lmMRhLaqPpDnq04gI4AtO6ZZW4ve8ARTKg50R/ gSg2uFpXkTgBd5m5ips10LflJtw06hg6JU8za6W5hUlmyfEdNwaROSzLsBGrijGii6bh h+7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:reply-to:message-id:date:subject :cc:to:from; bh=AE1eTBGQRaHBFHo70oj10MpiHIaoBz3ACneaQjf2bT4=; fh=c/OxFv/4fWB3gZXNHPMXjJdR7PxL8OZ3FKpj2QTSvYw=; b=QCTKf318/9KYdxe+7p1pXh80/CiRZkNM2sSbKHd07t5rK6299iAVY3rB0jieQ7W6n+ F/a+GQq7rPyyjMT4qVQ/d3CxU8v2kTKO/wlJdRHyczmF/qG3dUGUmzVg1hygBYPDXnJN bEZySZXt9R8w+QUm9EovE0eRuz3xcK2ZjDlFH4G/5N9897Mb+1O5dMMc2N506LHhr0Qh rC8xEmeyToLGVBSSeDgKH5OvpCiBMjoRn4vIboTUxIwKZmQGQkiq7bI2qCLrthi5Vr/D NufdlL4HjOUEqiHGVTZ8ZS/rqhBe2MFJi0E3J1zqLTnhR1789yJpKTu7VSTvVrsIZJVT +ltg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gentoo.org dmarc=pass fromdomain=gentoo.org); spf=pass (google.com: domain of linux-kernel+bounces-35868-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35868-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gentoo.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v18-20020a67ff12000000b00467f5e89524si848603vsp.24.2024.01.23.10.31.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 10:31:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35868-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gentoo.org dmarc=pass fromdomain=gentoo.org); spf=pass (google.com: domain of linux-kernel+bounces-35868-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35868-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gentoo.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 143FC1C280A9 for ; Tue, 23 Jan 2024 18:30:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6835C823DA; Tue, 23 Jan 2024 18:30:11 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3634823D5; Tue, 23 Jan 2024 18:30:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.211.166.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706034610; cv=none; b=FjiIDX+SYnoGDZ7I1kAmKDFSbSpwEByndTi3VIZ3cQCqf1YNOSGvCo6l6cOU9qkBxn11EjsmNRUc29e9iWqW+vsskGmUK5qH4EdAkRRoM4KzIRUuv6WSQqRwgGdDrN73LbMwp5OSHjA0eype/NHr5pYr9rqi6Lmk3k+rEXniSFU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706034610; c=relaxed/simple; bh=8i78LrYAny+ucwGZHvYyL/nhtG4lVxGC0FsadYuuP2Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WYhdsD3WX95lxpdDUyDtm2A2VOLEPM3AJEHRpdHJOZ/wmx9Yz+mAo06vCPsJoOhS5AO6p1PrtkTywmptw8s71esQDqlHJ4b5n6Bo8Qd542H5iyUKBbNQmnNdpfg4ZCxf38ISypZFlJj7iLTe1TBXE169/F5Pdi4a6Ia26M5E/cY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gentoo.org; spf=pass smtp.mailfrom=gentoo.org; arc=none smtp.client-ip=140.211.166.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gentoo.org From: Conrad Kostecki To: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dlemoal@kernel.org, hdegoede@redhat.com Subject: [PATCH] ahci: asm1166: correct count of reported ports Date: Tue, 23 Jan 2024 19:30:02 +0100 Message-ID: <20240123183002.15499-1-conikost@gentoo.org> X-Mailer: git-send-email 2.43.0 Reply-To: linux-ide@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The ASM1166 SATA host controller always reports wrongly, that it has 32 ports. But in reality, it only has six ports. This seems to be a hardware issue, as all tested ASM1166 SATA host controllers reports such high count of ports. Example output: ahci 0000:09:00.0: AHCI 0001.0301 32 slots 32 ports 6 Gbps 0xffffff3f impl SATA mode. By adjusting the port_map, the count is limited to six ports. New output: ahci 0000:09:00.0: AHCI 0001.0301 32 slots 32 ports 6 Gbps 0x3f impl SATA mode. Closes: https://bugzilla.kernel.org/show_bug.cgi?id=211873 Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218346 Signed-off-by: Conrad Kostecki --- drivers/ata/ahci.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 3a5f3255f51b..762c5d8b7c1a 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -663,6 +663,11 @@ 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_JMICRON && pdev->device == 0x2361) { dev_info(&pdev->dev, "JMB361 has only one port\n"); hpriv->saved_port_map = 1; -- 2.43.0