Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp99951rdb; Wed, 7 Feb 2024 23:27:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVfsdWL8h4UWogo22qC0AoQ1FLk6tuMzsVRWjP8UOkTyf21CTsU9O9JaNmaz4zlmXko6zjqk8+erwdLJmvWLNm3bHOm4NJIUAJ300HfYg== X-Google-Smtp-Source: AGHT+IGvJcp9Z1O9ghemRQLCWlsS6pm8U5SHA6BdoHxRLmVqkMuXlUV4ayq6b7DkT0o6KegTSmXV X-Received: by 2002:a05:6402:1b0e:b0:55f:d880:b15b with SMTP id by14-20020a0564021b0e00b0055fd880b15bmr5421045edb.36.1707377254809; Wed, 07 Feb 2024 23:27:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707377254; cv=pass; d=google.com; s=arc-20160816; b=Iw8xX/fnt9bk2eeAAWN+QswSO0mHWbPmjB8CVKeVGawdZIIYZF4NQ1s585/FhYYswg fuCYCK4fcTln+/TeQlLdRX5wAwSCkB7kaERjIz7xSSViJvGBweC1DclgHPJXsB2TffdW +WaH0i8J14K0Bk2qB5aWdQp9NrEQLba0AKxrwICY9AeTn9zOCChVrZYvbIek03gcXouh KJ++8h5wQ318BORZQWSVVmsqW1pQ/1erEkflkItygLsqSrAsDeqkKgKR55H86SXsrRq/ gle2HMXVbAoqAO8zgoK4+ruArVNIRzov+Eu6qHHxslhr91TcC08eQXPsOlw+76z7M1iq aBog== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=e/dz85B0nMFX0Scf/g5jiTejJQE4PEr9XcCOai7UJic=; fh=R/IhRqy8wcNoB0iDam7Nqs3xEhRjq+uylc5bYSW+p0U=; b=gdMV4VSApGKb6X1p8wn7+NwTslx0SXhceJ+nnS+L5ZszVWEXKHYV2EycuPOVVRSTc5 TFOJhPp/9fHQA9fSJE4xe2JYxPS/pHNEti1uudBx9IumULzAggJvd88L0fTLmem8mfSP kJTHW7mFlqAqDSYdRKZ7BI16NcuzshlU5BNxB4AAUUTZL41cJzqlKacskHL0Tqbm7jlG hUVMI7p7WJtyGB4OJUhY83A/22RefOeDWFqDfGoMs7uTb8wGM5/LMimPdvKLwDlqCRZO iiDo1fQQt8D6RGZVwe+APw8hmfeDpaFd3knR9r914gC873+xF6UFcilxKTaJNUcHQe4Q ahnw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=X071AJi6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-57556-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57556-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCWJLvk3X/iQtNEYcu7gD6UuX5nh6u8Nw8bts+n+WSDUBxlzSITXsSpzaUS2URfwPrYcJ1G7TinVKunjsp+0lNkNiHTLs+K592zEaZI4ZQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v11-20020a056402348b00b005600a5e1fc4si177908edc.358.2024.02.07.23.27.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 23:27:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57556-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=X071AJi6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-57556-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57556-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8DEF41F2194F for ; Thu, 8 Feb 2024 07:27:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2AE3B69318; Thu, 8 Feb 2024 07:27:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X071AJi6" Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) (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 DED3D692EB; Thu, 8 Feb 2024 07:27:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707377245; cv=none; b=buKvon12U9lz9RzXmuxvKj1Cg86OgpyVEQCeiEYCsDx9cS83TijBqIIhXI4+rzpshZyT1RcQPmJFVwLzELVaF94h1cNfzrhiiankXzO0ahyKgqXPhDRxI0jvwiNREGs5NFjtBRXMQkUgvgYDW7Yb1RQtfcabhx3P13yjodLhMNo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707377245; c=relaxed/simple; bh=u31cVU7vA1tnHuIzBIyG6VOgMkY/co8xvbVMDp2qiCw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=I9/VHNAGx1wiAX4yru6TAiGgbLujQ3bXpuhbWUsA3Nm5mwWdBknG8nlCPY9vHtxBdGG3hMSmrdn1lszcjS/lrw86uwkZ/vYfjGoyHN/p9oDDrgKkgNkIlp/vxSbWFKEeeBBMqn2AAu4nmIxPq8+htY1uDSKMvtiOjA4jp090Kbs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=X071AJi6; arc=none smtp.client-ip=209.85.128.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-6002317a427so14177937b3.2; Wed, 07 Feb 2024 23:27:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707377243; x=1707982043; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=e/dz85B0nMFX0Scf/g5jiTejJQE4PEr9XcCOai7UJic=; b=X071AJi6/WzIH9kpP5kt3yFTnSkE3IXtXe0Wmbr4rb4rkpjopAhn98lmNxgoHWdcM4 Sw+jzk3dLnEU28UAFTTCT5GtavUO1nWgKbzAX7qHSCbAQGIYRf3aweEhJQ8Yaz4GtH3Z GZUK+cUm3SwEQR1kXZoEJwPPk47Eg/vYh46k92DPGaH8lTCko1HP2Ieji3w8L5DERRf+ cv/yH5Hu+utigpsTzEMNjifDq/cctnbKbqJ8E0jiwiiDS1AVaIYJECkyGwcP2k4hO/9a nYKiwssE4FXzIJ7EeYmsHzs6Xx4KgLMZIMwr0EXVGb77O6h0ZjEGpnZUQZ40ANVIPR1X PaFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707377243; x=1707982043; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=e/dz85B0nMFX0Scf/g5jiTejJQE4PEr9XcCOai7UJic=; b=MQqwl1epkjja4I6l7qkhy1ezIfPdKhAkuBYhzlGW73XAeOONiwBDZCRkk8WuKoSwyT 8PryeiE8NWhhIUfxqu9PanfkrY4AY24LDmb9MB+GOZIhZJw85Wd6/nTEx6/N2ONZqTvS HPZrcjwUkyOgB7Cd98wDrSIKeQS4p/6M2KtaoqEFke9xepA2QdtHIT6Hz1U3S3THok1B 2IPoHsTGzs/mZ6WLFEkqdlvbhT2YqtoCQEHKojBn8U+1ZR6gQ6AFxh1VLtICkhWFdbw2 UuTbGlZWT6CWY0CtWIic2aHeWbg1mH8cmImAMLb0gvDRg+U+Wn39I9oZaL/S9K6B3p7r aYQA== X-Forwarded-Encrypted: i=1; AJvYcCWwrWwXPdOusfKawCiBz4WCE4BWlfx946xDZkljqb12BLoaGQMIwB4OEO1m3HKpeEXA7iVEVkdqazTHAAF2F84O+9/gnijhpSUKIy2A X-Gm-Message-State: AOJu0Yyz+W/6GtXa+etN3OY/7CEaGyi0JzIRpzHSOqWQod5FFhNnnFSH 9HkqbAYPoTJDY0srt5dj0tWT6BtqGUym8fOgR2Mrw3+ROCCUr0RuPHjqxBSqbhnHdhfMX3tzJD+ 52/vWEoernFi8WlckhvmFOX4E2t4= X-Received: by 2002:a81:ef04:0:b0:602:d01a:ea9a with SMTP id o4-20020a81ef04000000b00602d01aea9amr7603581ywm.15.1707377242715; Wed, 07 Feb 2024 23:27:22 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <7559d940-f191-4fe0-e147-17ffa6c1dfc4@gmail.com> In-Reply-To: <7559d940-f191-4fe0-e147-17ffa6c1dfc4@gmail.com> From: Andrey Melnikov Date: Thu, 8 Feb 2024 10:27:11 +0300 Message-ID: Subject: Re: [PATCH] ahci: asm1064: correct count of reported ports To: Sergei Shtylyov Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, dlemoal@kernel.org, hdegoede@redhat.com Content-Type: text/plain; charset="UTF-8" > On 2/7/24 12:58 PM, 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 > > 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 > > > > diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c > > index da2e74fce2d9..ec30d8330d16 100644 > > --- a/drivers/ata/ahci.c > > +++ b/drivers/ata/ahci.c > > @@ -671,9 +671,14 @@ 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) { > > + if (pdev->device == 0x1166) { > > Maybe *switch* instead? Ok. Can someone explain to me - which method I should use here - override portmap via hpriv->saved_port_map or mask it via hpriv->mask_port_map ? > > + dev_info(&pdev->dev, "ASM1166 has only six ports\n"); > > + hpriv->saved_port_map = 0x3f; > > + } else if (pdev->device == 0x1064) { > > + dev_info(&pdev->dev, "ASM1064 has only four ports\n"); > > + hpriv->saved_port_map = 0xf; > > + } > > } > > > > if (pdev->vendor == PCI_VENDOR_ID_JMICRON && pdev->device == 0x2361) {