Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1174210pxf; Fri, 12 Mar 2021 03:51:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJznf4eQX0v7GHxV/L2g5DGTU7EPIdJAGDhAO39dGr6JREzHyYoSV9Y7TQ2vzVnEqr2YEzIu X-Received: by 2002:a05:6402:100c:: with SMTP id c12mr13852806edu.200.1615549881893; Fri, 12 Mar 2021 03:51:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615549881; cv=none; d=google.com; s=arc-20160816; b=aQRj86417PaW+k5CWaBEclvlHtWFm7A05nRrJf99+ViT0JIioWK8TI9eVquDGdW3Or d+TWYyx4CHRdWSXlg6kpxpacct7cUtzJ2LQVK//XHehC1Y6Hw8L8UKY3zRIgNTOmFEYT vGl0Qm2K0UK1sjVlR8+CXuhqe/y/hc6dj/ErqyMIdvx8x+vK4PFPSAF/L5jvGP0d8Mai eVnfW4hKg7qsO67FkJReiqtwGy2NAgKolqA9dbbznid//Bvl/d9S4b02xBT0ULhZnZnC n9arI8zI+gGncmTkJCqIUeQyPhdMTvNFPNtgOdewCMWRag9driYbaesUrfujGdSq7rw9 iXjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=br18aWX0JsbloMj6NUtAwZDhuqAw9VK82ztLErYRa4g=; b=DnxuJeNiyT9Yy17wQdlRpf2u8EcTNtOsc7NFNJ3ajHE+by7oNDJYH1k/eF0dhCjk4H JwnA1C8o6dUF72s4tnpWy1gv+UsDs0aeNIxVzCrLkAT1STTE7rKoRV5AJvfoZFlShzLJ 6SKwCzGn9wgbciB+pmF1mcHxBVr93+iZ/zXQiQfTbC0UTmNoAq/KMWVs1kVnaYqA1E6c 2n708JoS3b3LHx1/7oqk4pCHQ58sYkbeNlczfuhfwgV8eZYB2En/V0n9KrO3/jKES9Eg 7GnkIDfjhDVskZ3Ojlua4DB72nh60kDoCrVNc8GfND6jNfU/VuMYTFoztH2NGroQosHG Dokg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx8si4219074edb.517.2021.03.12.03.50.59; Fri, 12 Mar 2021 03:51:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232985AbhCLKYX (ORCPT + 99 others); Fri, 12 Mar 2021 05:24:23 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:13596 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233093AbhCLKYG (ORCPT ); Fri, 12 Mar 2021 05:24:06 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Dxhh519C9z17JnC; Fri, 12 Mar 2021 18:22:13 +0800 (CST) Received: from huawei.com (10.69.192.56) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.498.0; Fri, 12 Mar 2021 18:23:52 +0800 From: Luo Jiaxing To: CC: , , , , , Subject: [PATCH v1] ata: ahci: Disable SXS for Hisilicon Kunpeng920 Date: Fri, 12 Mar 2021 18:24:36 +0800 Message-ID: <1615544676-61926-1-git-send-email-luojiaxing@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xingui Yang On Hisilicon Kunpeng920, ESP is set to 1 by default for all ports of SATA controller. In some scenarios, some ports are not external SATA ports, and it cause disks connected to these ports to be identified as removable disks. So disable the SXS capability on the software side to prevent users from mistakenly considering non-removable disks as removable disks and performing related operations. Signed-off-by: Xingui Yang Signed-off-by: Luo Jiaxing Reviewed-by: John Garry --- drivers/ata/ahci.c | 5 +++++ drivers/ata/ahci.h | 1 + drivers/ata/libahci.c | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 00ba8e5..33192a8 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1772,6 +1772,11 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) hpriv->flags |= AHCI_HFLAG_NO_DEVSLP; #ifdef CONFIG_ARM64 + if (pdev->vendor == PCI_VENDOR_ID_HUAWEI && + pdev->device == 0xa235 && + pdev->revision < 0x30) + hpriv->flags |= AHCI_HFLAG_NO_SXS; + if (pdev->vendor == 0x177d && pdev->device == 0xa01c) hpriv->irq_handler = ahci_thunderx_irq_handler; #endif diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 98b8baa..d1f284f 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h @@ -242,6 +242,7 @@ enum { suspend/resume */ AHCI_HFLAG_IGN_NOTSUPP_POWER_ON = (1 << 27), /* ignore -EOPNOTSUPP from phy_power_on() */ + AHCI_HFLAG_NO_SXS = (1 << 28), /* SXS not supported */ /* ap->flags bits */ diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index ea5bf5f..fec2e97 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -493,6 +493,11 @@ void ahci_save_initial_config(struct device *dev, struct ahci_host_priv *hpriv) cap |= HOST_CAP_ALPM; } + if ((cap & HOST_CAP_SXS) && (hpriv->flags & AHCI_HFLAG_NO_SXS)) { + dev_info(dev, "controller does not support SXS, disabling CAP_SXS\n"); + cap &= ~HOST_CAP_SXS; + } + if (hpriv->force_port_map && port_map != hpriv->force_port_map) { dev_info(dev, "forcing port_map 0x%x -> 0x%x\n", port_map, hpriv->force_port_map); -- 2.7.4