Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp664388pxb; Thu, 26 Aug 2021 11:27:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHDOAOpHW8H1WqAOJUg+bkBCh2yXkDviuhJ43TsyiGhh59g62ievr4V1b5cW7f0PQzkMLb X-Received: by 2002:a02:c055:: with SMTP id u21mr4509805jam.113.1630002475336; Thu, 26 Aug 2021 11:27:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630002475; cv=none; d=google.com; s=arc-20160816; b=E0bnUlF3122ghCUKa0pX3YzVfY8fqTwImyEHA4zFCLgdst/fq3lqG+SolWX6Be+cHE RwNZxt1IDAWWj04N7B8xBnxL8ww2ffsdfJJjYdMcz2m39SqlI2LNg89+O+y4HKGLVosL q2PN18cxomtYEt2dwWtEBMe/ByjXzT0/iz+EX1zjdEH4A8ofUhUNjjR4unOfQc/FUEln weRAwHJW2u7nvBtpkp05TYCkfHx1oJ3xLs3FVnntpNo/qNc+iZum5jI6WTJ7Qc9mDibp 3uHuLWs0cyjc7YIJgvsXq+p7NN9lojbmuqpofO3TkeAlUAk7Jnm7VUN+AKSVCAJIN4kQ bNWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=5m6L4ptoy8tK4kEMlULABhRdOvLfJMFmaemMV5H6rXE=; b=i3KwGTiIMnUbsTIvn8lNUmwUE9vj8luxWRd2XpA6a4jA5oMbJ54guTraHJmNDVQyN4 1tuUfbv0ijdJfZiiVw3Ar3XyIR4migaRg6fhu8a7sU6KhTDOr5Pc6+jcdyFLld2W/z8H d5owQUU/+S22jrgDAAqPApPDBajyQ38wmdAlRs1eBbwAqCD0JZqCbIh0KtXdIUVRZJSV +6Qmpj290mDipMBea9TH1ARelkokvmFu5lSs2p9dQcCvDnAnf7mGujJ+ij+cnXFAUaJQ X3C4l8ikOrzNzumYXjPZ36FVgf3RuCnH17se/0ZY+m+405XYxs0i2SR8fJkbXu2qSjbx 4D0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=buwDYdn5; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r11si4825966ill.21.2021.08.26.11.27.19; Thu, 26 Aug 2021 11:27:55 -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=@kernel.org header.s=k20201202 header.b=buwDYdn5; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240906AbhHZS1O (ORCPT + 99 others); Thu, 26 Aug 2021 14:27:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:48630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235411AbhHZS1N (ORCPT ); Thu, 26 Aug 2021 14:27:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CFB3160E8B; Thu, 26 Aug 2021 18:26:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630002386; bh=EZpMOg5uZ1atXvNVcFF6zwuiJW5v8+/QZHYkgJs2j6U=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=buwDYdn5zc5hloF3bxX0SYWf2fzfQ7RzdOt11hfvqxj17/h0aMMpG8EdJZscQ6Jjh Y4qp9zx8oFP4d92shWmbTOshfgKQdyH1rqeNba9uUTZJOB35GwehS28Gsaq5vNfvRo zhWT+s6kXwO7uL2Eh5o59zQZVNV3FKw/ApFGxMVLC5Qcd4cnFNlQz2aVUA21o6T5Y7 6BGau5kyHzeh88+J60uI2R7gYOZD8oVLWyHAHBHtIYXgPCcvaDN732uczKR1h1sT0Z rVxFELzRLj8MwUA8j5+raFYiFH7t+tr3K8oOQ7qsxGNbo10FnlYuFk7x9/nCDHk/Ag MSss7+zGpmGOQ== Date: Thu, 26 Aug 2021 13:26:24 -0500 From: Bjorn Helgaas To: Zhangfei Gao Cc: Bjorn Helgaas , Greg Kroah-Hartman , Arnd Bergmann , jean-philippe , kenneth-lee-2012@foxmail.com, Wangzhou , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Will Deacon , Robin Murphy , Joerg Roedel Subject: Re: [PATCH v5 3/3] PCI: Set dma-can-stall for HiSilicon chips Message-ID: <20210826182624.GA3694827@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1626144876-11352-4-git-send-email-zhangfei.gao@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+cc Will, Robin, Joerg, hoping for an ack] On Tue, Jul 13, 2021 at 10:54:36AM +0800, Zhangfei Gao wrote: > HiSilicon KunPeng920 and KunPeng930 have devices appear as PCI but are > actually on the AMBA bus. These fake PCI devices can support SVA via > SMMU stall feature, by setting dma-can-stall for ACPI platforms. > > Signed-off-by: Zhangfei Gao > Signed-off-by: Jean-Philippe Brucker > Signed-off-by: Zhou Wang > --- > drivers/pci/quirks.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c > index 5d46ac6..03b0f98 100644 > --- a/drivers/pci/quirks.c > +++ b/drivers/pci/quirks.c > @@ -1823,10 +1823,23 @@ DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_HUAWEI, 0x1610, PCI_CLASS_BRIDGE_PCI > > static void quirk_huawei_pcie_sva(struct pci_dev *pdev) > { > + struct property_entry properties[] = { > + PROPERTY_ENTRY_BOOL("dma-can-stall"), "dma-can-stall" is used in arm_smmu_probe_device() to help set master->stall_enabled. I don't know the implications, so it'd be nice to get an ack from a maintainer of that code. > + {}, > + }; > + > if (pdev->revision != 0x21 && pdev->revision != 0x30) > return; > > pdev->pasid_no_tlp = 1; > + > + /* > + * Set the dma-can-stall property on ACPI platforms. Device tree > + * can set it directly. > + */ > + if (!pdev->dev.of_node && > + device_add_properties(&pdev->dev, properties)) > + pci_warn(pdev, "could not add stall property"); > } > DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_HUAWEI, 0xa250, quirk_huawei_pcie_sva); > DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_HUAWEI, 0xa251, quirk_huawei_pcie_sva); > -- > 2.7.4 >