Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2483962pxj; Mon, 10 May 2021 04:12:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1NK1OoVHFuupMvWWLMsd+PiWOS3bXAoZNJ68OFrdS11dcZikLKHOqYLSlZKVBoN+8cHEi X-Received: by 2002:a92:d1c4:: with SMTP id u4mr11477040ilg.286.1620645130915; Mon, 10 May 2021 04:12:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645130; cv=none; d=google.com; s=arc-20160816; b=Rt7oQgF6U+8ZoCbK1Eq6MR8E1E762pc6hjPdvoOKRzPl6PFb7GAZ4Fj3thUqSXHA6G /3YYgvRUxT8QKPfsimoxhefT46omvvgIRnRa0nn035hCD0iAv0Hh9TDmSuqDdKvPZ0Yw 9ylteC1KeLkNqpHjBqv5rjw+/4ASjD6qrDRrZlZImA9+E2wXOaoZB9OyuJcXc2LGf3Ps NXVuddPt9dqSjezqUhaiwMntgtJOIa9aA1FxpZJ5kYruSWE/G1piKD1AFkrwAO2dXZip IWq7TxI42VxWgdTZgS2wjYANdkOjOBnDhjg9Cvg4Ry4cLJzxuCionJi6lKpwTPEjFfGN mnWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6Kyjt22ID0fiWA8RM6h2GLIuui06Qcr86KOQjzX5mvM=; b=nhvyGDQLPmiMTpdaD07WyR0YyAlkpzsEMB1n5fdc4q8ZE0rk0xCSQPKnnlyeOCCrtH XPaBTQbmo65qODjsxKlIBSde+6K4RTBSyO2Jgyejfv+xqswcQMBS6pE7r8jDOK/6anYu IIfTXoU3BMu5MiYbzDYDWoQQG1NgK3maJ4gM4NhaEBVinddi17w8Q1mVjFyiKfF2qqlb RQcc+/QhptDEe5YX0L6KTJo0iqIY2N3Y8haahz6GaVMMw9Fa7OlkAu7LhAhGOszGlAYz bdEDAZj0qme+RTuZQemrh66reThEfKempEWIpQYedVc0nIIpO/nJ7SjvgFkQhAWkelW4 TRRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UNkSFQ52; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t12si907397jaj.66.2021.05.10.04.11.57; Mon, 10 May 2021 04:12:10 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UNkSFQ52; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236196AbhEJLHl (ORCPT + 99 others); Mon, 10 May 2021 07:07:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:59360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232822AbhEJKrO (ORCPT ); Mon, 10 May 2021 06:47:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3D3AB619B6; Mon, 10 May 2021 10:37:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643045; bh=2NP5te+jZbVJI9Ngj88cWMuWA5RVvd7pvJ2s2BY2Bss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UNkSFQ524v1tZI7kStSJJlK32BCVyytndeo/I2Ra3MNRgZR8ZJkUOOUeKHFU/JZqb 47RI5IsBZee/S7CqvF4e/x59QjHz++7uhy1DSSdiwXvEb0KyIGgXDldTABQ/z/5gQw tIbwTLFvGIkUM4xDYhIiHOY79JMhM+VJmNuTDAJc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xingui Yang , Luo Jiaxing , John Garry , Jens Axboe , Sasha Levin Subject: [PATCH 5.10 154/299] ata: ahci: Disable SXS for Hisilicon Kunpeng920 Date: Mon, 10 May 2021 12:19:11 +0200 Message-Id: <20210510102010.046429853@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xingui Yang [ Upstream commit 234e6d2c18f5b080cde874483c4c361f3ae7cffe ] 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 Link: https://lore.kernel.org/r/1615544676-61926-1-git-send-email-luojiaxing@huawei.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- 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 00ba8e5a1ccc..33192a8f687d 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 98b8baa47dc5..d1f284f0c83d 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 ea5bf5f4cbed..fec2e9754aed 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.30.2