Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp106113rdb; Wed, 7 Feb 2024 23:46:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV8asE/giJdL6++iMNc/ZEIEaWR1n69Mdntu8r6rfx5+xVkiRWPnWBwMTUyagdZPRYEvXaPzmNKGbbggGnFu2ZufFNzQa/PjAXA7BKB1A== X-Google-Smtp-Source: AGHT+IF5ptkF1cZc3fP3zpR6f7ICKz6ZQeNK1W3Ppdv3Yizh07rB+4WQ9x6fFT8Nc8bP4KIAkJ9E X-Received: by 2002:a62:8145:0:b0:6e0:4659:f21a with SMTP id t66-20020a628145000000b006e04659f21amr4809477pfd.33.1707378386385; Wed, 07 Feb 2024 23:46:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707378386; cv=pass; d=google.com; s=arc-20160816; b=u4WHLRUrSHoHoZEwCF822IzS5S6U7FeN81xaeGJOdnLI+KwZUwGteIFEHAFM5Fom7y cU65cRk38QvP8tkU31KxYy1jN1YlWtQco06Fx6WC5vnkv4UWCi5BVLARt7wZsfjYaF/7 2ECAnIP2tMC5vf1RsO2upJ+akFOs1iWM5CxIK2iLsxi0VgHOLkzd/9FVWfle+NmMC3/y RyipJl4luD7jH28vYUY5WBCAQ9tLHZDszE+JdR8dsiPgFEj9O7gz7guqfzrgNU0rOXER mBKpW3OEV5UqgeSy+d0KGUM4k38vt9qTCLyZSOgON7bC86Tbyu0okpK43v4xcf7geJmA fguQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=IQjLBnoobpiHaSfOzUkd2mf2NJbrLycx+j8xpurK+xA=; fh=4OJ1Rlnzoo+GMesTw93oJ3myQqhTGDEbKj2JAmfxRT0=; b=VvSo0UELCWvrKAvsZsiEDcQUMbo4PL/rC4DQ4VJtM/mffQqVMQIFOw6ntjLrUgYKgB 0xapn8O5n8A12QjZ2NZbqLzzqY93G59RV5yM5NdwuEbTkwewmU2sODObahRi0NqyhnR5 eaVFR5ssyKtUpR8p5dUS099068CVZf+5ocTx0BfHiRd7/Kikd/b2Z+/+SISVq6/yKSQe GuoFawd/0UDClOiqWGo352NaQHDdpvnRc5iP0M9wmDKfcy6o3WuOm9ThU9LbG1qCjKtN jseysDolpV2bZrs/DIm+4hIA946V3mgMpF35CNopWwZvVXQzUEP8Mhk0bVyx8mbyKp9+ au/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GhmnxkKq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-57566-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57566-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXpBPPSXP9eExGdvO/MnLU4F/H4Vwk9bDCqjKV3aQdUaefiLG8m9cPXQfhaKqryqHS029i0PtBHZhs2zjzMeZeUSKGfqPTFENYPyTnsgQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r6-20020aa79886000000b006e05089200fsi3457822pfl.61.2024.02.07.23.46.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 23:46:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57566-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GhmnxkKq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-57566-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57566-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 58C0F287560 for ; Thu, 8 Feb 2024 07:45:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D48A169D11; Thu, 8 Feb 2024 07:44:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GhmnxkKq" 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 F0CFE69312; Thu, 8 Feb 2024 07:44:54 +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=1707378295; cv=none; b=j0xf3vozDToM7Tt1hrUVanA0uNfhJEkkkbwEgw5DDh6vsYH1ozW4rW9F+OMPEXUOQFu1qfyMz5JCXQ3sZreY87c6mfVWlZCYTp2O7D7pqeE63z9eUKKeb01yO5pC/iJzoPzny7Nkx2sJHw0BvZAuxFlptIiGZd5PUi20Cj+aUkQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707378295; c=relaxed/simple; bh=w0JYTTbDylhH/2WBOTyAoRBXLxPATEaGQ6QDR/k3++A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Yqz9V89t7yIINWeU0o6iCE8mIeTuTXQWY0SaZJa0raOd0eLToGpSufm4nL29J8Sgf5JQrKDfT4utviYRcjBelgdWAhK+PAfYpwFY0CkxCcS40MCLydaWrGxbRb03JmSXFdPTBrSIIEXFRfVnNwBtJWcgfT9YtI7EeFks9FjJRAs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GhmnxkKq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84CADC433F1; Thu, 8 Feb 2024 07:44:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707378294; bh=w0JYTTbDylhH/2WBOTyAoRBXLxPATEaGQ6QDR/k3++A=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=GhmnxkKqQ94zEoh0hLGsKyGG6s4MP7qMAcF/Tlz5ok1tg5gE4xLZlFpB5CWLoq4Cr p/rMvudaqPULSzRiOXW592ZJRs0c7L/DRu563zCvTgYmwJWFtRZ1yYWenno1VpmFty fznb2+zWC66vimbWjYKrhu7W8C06RmIZcQpZnvrG+FxKauEkK/X4LytC5V3KU/3afJ vIXfUJzrD4e68+8FI4rhyWPi6ncqlFG2qMdUdI23O1PVSc7pT8cljs+M1KQzqFdcJx pi34b0+qfjl0A+0vOYbmxlT9cAykyex9zVks4z7suydtsznh8pGAHQSJ5hvsH+3nZD x3xlt8yXWQNUg== Message-ID: Date: Thu, 8 Feb 2024 16:44:51 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] ahci: asm1064: correct count of reported ports Content-Language: en-US To: Andrey Melnikov , Hans de Goede Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org References: <31d9b48d-320b-44b6-9ab5-d53f741dcc72@redhat.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/8/24 16:21, Andrey Melnikov wrote: >> >> Hi Andrey >> >> On 2/7/24 10:58, Andrey Jr. Melnikov wrote: >>> 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 >> >> This still says 24 ports, is that a copy & paste error in the commit msg ? > > This is the raw value of the read-only Host Capability register, how > should it be changed here? If silicon lies about its configuration - > kerel prints what it sees from silicon. This should print the actual number of ports that you forced with the port map change: diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 1a63200ea437..7cb3f137bc1b 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -2637,7 +2637,7 @@ void ahci_print_info(struct ata_host *host, const char *scc_s) vers & 0xff, ((cap >> 8) & 0x1f) + 1, - (cap & 0x1f) + 1, + (cap & hpriv->saved_port_map) + 1, speed_s, impl, scc_s); -- Damien Le Moal Western Digital Research