Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3510132pxv; Mon, 12 Jul 2021 19:57:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTdznEfaxNp2CUnu1/ch/MFSbd/XlKHpK9ezlAtdPCBTP/kFiUfj2ANtvtBN3vjRqj1sVU X-Received: by 2002:a92:a013:: with SMTP id e19mr1306933ili.206.1626145052386; Mon, 12 Jul 2021 19:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626145052; cv=none; d=google.com; s=arc-20160816; b=PRgpM4Xta+mntkT+HhW1+keMAvRUehHDd5gWVsgxIpy4G7HvKjVOqUlvjS9FQUKFrt f+aGgFvkMnKoI8zLvPzTSd1aYUPJBGoiaKScWVL01xVObWPxHCx2QHYWPVmDFntMqCMh TOf0lyGZ0EKEpQ2mp8bTv2G7F8EA9fG1iPeIN7m7fEExWUynbPDtxQceJcoAuZ4h54s0 vTt5GMBwDKIuaLI7MxVCr7QOOswO4VwCWPKSCYPGG0sSgVR9BGzlk30U1kvXLMz895yF FtFxufbGvt4jLQinj4wbf+BEdweu+tr/zMdMiFVkdzhpd2kcphSL34Q2sCyhaMKqGb9O n1FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=NV7/yF1O74iLBNvfkEg1IJxU/cGFxdoh71Qlx0oT7BE=; b=EVdcbhBkpcy04h90N5ro9wWKxSCg05gGpZmoj2ub+s/O/83OPvX/ISCNKSxOWJPHUM 1ceXWnGGujhN3jQAFqhJbgF9F77iEjDqpTYhExrXxl2UzvxIzoIWxCINqTbEaVbGEO8J JRQ48eByvKUaKNBp/OJNkpzYEkMWk0XT8lB/0aSI3VnK5wduKBQ+u8AAjB9u9HMi0Zpp m0FkUGCNpfnLcayUgsxKkz6ZlLguAGTAogxBFfrKx2wL73U5hUx9v6CbQaj0HANn/kpA 2ZZwyBwPpW7Sn00EL+l80la8pQ42ZcKnDcmMXUSwESfjWPTSURWjgai7jqtm/Yx1vk2M sxzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X1tpyci5; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d1si18951450ila.19.2021.07.12.19.57.20; Mon, 12 Jul 2021 19:57:32 -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=@linaro.org header.s=google header.b=X1tpyci5; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234100AbhGMC6H (ORCPT + 99 others); Mon, 12 Jul 2021 22:58:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234085AbhGMC6H (ORCPT ); Mon, 12 Jul 2021 22:58:07 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14804C0613EE for ; Mon, 12 Jul 2021 19:55:17 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id o3-20020a17090a6783b0290173ce472b8aso518773pjj.2 for ; Mon, 12 Jul 2021 19:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NV7/yF1O74iLBNvfkEg1IJxU/cGFxdoh71Qlx0oT7BE=; b=X1tpyci5/JZOAmQTWbvBRYGBKEjFQa32Z1GqbGitkfjZeFm876Exs6I6EzAKr71u3w 7A9W7fEISdzeCnFUA7EXPX2f2ZINeOySZDLRvaKm+msueXuac1pcHE0yCEYkHdn/Q+u9 XPQOuuCK/mXYFAMLbRThjEglWjjjn/veXffM1hAeQ7Myg4JAp8DQ8yGuAFvUe/8zRnwC cgWFn9DCscrhh6W9gvvTsOsqomEWb9cp5z2xGkleXXCdCcmjpGUJbr0x1Hcs2bLscaEu rkfTxxtxIen4is6h0zUIsi07BI76kwtYf5+slg8lhXo3r8Ddal7PC18bVHKezcHFkf0G HIwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NV7/yF1O74iLBNvfkEg1IJxU/cGFxdoh71Qlx0oT7BE=; b=r8JsLFh9NFDluC+l1c0dSEw28k+O/SeRMNsmcy6ivmU/YZKiKL9ddlpWd5Ps5getu2 ZoGCqrH3ppNkemADOE/7TWLTvt4GR3EO/vcEfgM6Nb53H6vrgndIuMpQ7WnCCv/Bg46I LNzmLJ5FSRPqMYk7ME7FeO5aKTM1ZdMc6R3E+2Kcyh1sd7r6GhnR1+oNQ41LxAtgFygf +eBK7vFr1K8Yqj6g0PqHD4An6MzKvUQ8J189skMtJaUkJ8fEs/iQmcL8w2iSuJaWHLL/ l/AvBAQf/6SCAz3PPdKlvjfU0qlSA8xLmYAIhO0klXjMcE49FMb1+2D6atNLKMK8qIZa 3pvw== X-Gm-Message-State: AOAM530u93PbQtdHhgojYlWUtHiwTZjcWYdONSu3oN5XGqaM/qlIDi/O QUw8lu99UgC3uA2jvWTzhHSWJw== X-Received: by 2002:a17:902:d213:b029:127:9520:7649 with SMTP id t19-20020a170902d213b029012795207649mr1741094ply.10.1626144916660; Mon, 12 Jul 2021 19:55:16 -0700 (PDT) Received: from localhost.localdomain ([45.135.186.134]) by smtp.gmail.com with ESMTPSA id r14sm19303344pgm.28.2021.07.12.19.55.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jul 2021 19:55:16 -0700 (PDT) From: Zhangfei Gao To: Bjorn Helgaas , Greg Kroah-Hartman , Arnd Bergmann , jean-philippe , kenneth-lee-2012@foxmail.com, Wangzhou Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Zhangfei Gao Subject: [PATCH v5 3/3] PCI: Set dma-can-stall for HiSilicon chips Date: Tue, 13 Jul 2021 10:54:36 +0800 Message-Id: <1626144876-11352-4-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1626144876-11352-1-git-send-email-zhangfei.gao@linaro.org> References: <1626144876-11352-1-git-send-email-zhangfei.gao@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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"), + {}, + }; + 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