Message ID | 20230922-iommu-type-regression-v2-1-689b2ba9b673@marcan.st |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5815499vqi; Fri, 22 Sep 2023 12:22:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEKpl7TpLVIZNVNMbt9muOD2dmof0g5kPHS9PXKmOyovoHJkhinWjKG3yMORnpKfThIfFM9 X-Received: by 2002:a17:902:8ec2:b0:1bf:728:745b with SMTP id x2-20020a1709028ec200b001bf0728745bmr337345plo.49.1695410549291; Fri, 22 Sep 2023 12:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695410549; cv=none; d=google.com; s=arc-20160816; b=CwpXjT7Yg/xpjITnXOfMGwNfon5skDKyGL0AuvkfHgR4/iGL8tdOCKT74Wy3g3+1RB dzw4AZEPMNzdIKyTihhruy+hvgYiPH5vvzv1Ff+nPUsxnpcq4qNmAN5RGjfTOk1k5sYV 3o36tWcD/dI6uKECp3O2N9KHgIUVVao3iUjCdGRcdyg4jQPPVKtm7BsbBwGZri8P1HuI I3BrivmlXxWwNaU3nlSz4CfDFC85dxKAAprEEz8a/I4NT+uWXFmje5HBZF7GmRfGd+zJ y3ER6R21xcInrvK7/uB+S9B6/265Pb4ngATHX3bIM7SWxoXuaD3gd3gt94nko92qA/xn MYoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=yKKD3DKkA31jJehvo5wTLysv3+3TfAYrCS3TtTQn9hc=; fh=KuXNZ1l7eHdfBxEBKH05eMMA7pDfwEFyOMwOaNmX6rc=; b=j3GPE+qCGSUt19TioPvlbaowvrdb8X/UVIkyMm9SDa0rS6E+ONdbilRjjzCg9l56lb Nz6rRVSA5lyQdhseiBnMIbrVqFIK0KSKoGT2k48E2Rc5XKbHaEmY1T8sZebWIS6XK0T1 E6PfiGQDavzoiJN+G0PusRutno09jGy5yoHpLtj65hm91IhxK95LDkjk0jmDcJf6O5Pt SYky60NwCwA+lCPsi+GlG0HG/rSGzMKVW2bwOLULml/Si4u7sKdjSEcsRnh+s8++eCz/ Zc7VA+wsGgol0RaV3dOBPY0DUXQmgr2vdFoapJmgG1OiD8hiy0WEz5YgwFuAeP9iq9Tf NVSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=JDUrN5GZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id ld6-20020a170902fac600b001c4312719a2si4069299plb.63.2023.09.22.12.22.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 12:22:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=JDUrN5GZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id E86EE8725CE5; Fri, 22 Sep 2023 07:55:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232049AbjIVOzv (ORCPT <rfc822;chrisfriedt@gmail.com> + 29 others); Fri, 22 Sep 2023 10:55:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231833AbjIVOzu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 22 Sep 2023 10:55:50 -0400 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 796C4C6; Fri, 22 Sep 2023 07:55:43 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sendonly@marcansoft.com) by mail.marcansoft.com (Postfix) with ESMTPSA id 58FD83FA0B; Fri, 22 Sep 2023 14:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1695394541; bh=JC8yv+fNB5FiwOtZSD3GUGqW+YmVjy5b00Y4p97vKL8=; h=From:Date:Subject:To:Cc; b=JDUrN5GZzfN7QRRqw3OCK6PfL1j62nZYru/sYrDEuW7xLEduVTG9OfIn4T3caU8Fu I/EUTB1RuHPQNNbc/WrygHwkefF9ES735utJRbBLPPBw4PZxHNAJuzNTOLqfam5ely Emd0DSV7Vtikl6K6m3rRgDm37H4681WqNNpMalM5fznq1d/FgG3NtDzT6S1OoH8YMe keDDZ3FKBAUy7vlSBjyqpeuun5lTQWXthhxqxRFzHGEBPo892T8QQbpDurZHO3Z3dQ naSP+V3QRqJdSnZsostSD5OedWAt4g6QIQS7KN/aXiByU7aE3/gXXVoByFHPUS/H2J hxUc9NIeOW75A== From: Hector Martin <marcan@marcan.st> Date: Fri, 22 Sep 2023 23:55:23 +0900 Subject: [PATCH REGRESSION v2] iommu/apple-dart: Handle DMA_FQ domains in attach_dev() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230922-iommu-type-regression-v2-1-689b2ba9b673@marcan.st> X-B4-Tracking: v=1; b=H4sIANqqDWUC/4WNQQ6CMBBFr0JmbQ1MMaAr72FYYBlgFi1kWhsJ6 d0tXMD81fvJf38HT8Lk4VHsIBTZ8+Iy4KUAM/duIsVDZsASdXlHVLxY+1FhW0kJTUL+WCi8veu x1sPYNCXk7So08vf0vrrMM/uwyHbexOpo/xljpXJo0G12o9Ht0/Zienf1AbqU0g9xazpTugAAA A== To: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>, Robin Murphy <robin.murphy@arm.com>, Jason Gunthorpe <jgg@ziepe.ca>, Jerry Snitselaar <jsnitsel@redhat.com> Cc: Joerg Roedel <jroedel@suse.de>, Neal Gompa <neal@gompa.dev>, "Justin M. Forbes" <jforbes@fedoraproject.org>, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, stable@vger.kernel.org, regressions@lists.linux.dev, Hector Martin <marcan@marcan.st> X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1701; i=marcan@marcan.st; h=from:subject:message-id; bh=JC8yv+fNB5FiwOtZSD3GUGqW+YmVjy5b00Y4p97vKL8=; b=owGbwMvMwCUm+yP4NEe/cRLjabUkhlTeVS93Trj9L0JplduMZSwXqx/5/ztYtWfSY8bgq27d/ 9c0NZcHd5SyMIhxMciKKbI0nug91e05/Zy6asp0mDmsTCBDGLg4BWAi/O4M/91/HBGsdnI9PldN fbHjg7fHI5e3PN+b3pD3IelHnTlPKRvDf+/I5YI5Ov5yn+QFJ2kohG2Wz5vyVi57Peup+1nuN0q UeAA= X-Developer-Key: i=marcan@marcan.st; a=openpgp; fpr=FC18F00317968B7BE86201CBE22A629A4C515DD5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 22 Sep 2023 07:55:52 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777756997155686122 X-GMAIL-MSGID: 1777766812393647957 |
Series |
[REGRESSION,v2] iommu/apple-dart: Handle DMA_FQ domains in attach_dev()
|
|
Commit Message
Hector Martin
Sept. 22, 2023, 2:55 p.m. UTC
Commit a4fdd9762272 ("iommu: Use flush queue capability") hid the
IOMMU_DOMAIN_DMA_FQ domain type from domain allocation. A check was
introduced in iommu_dma_init_domain() to fall back if not supported, but
this check runs too late: by that point, devices have been attached to
the IOMMU, and apple-dart's attach_dev() callback does not expect
IOMMU_DOMAIN_DMA_FQ domains.
Change the logic so the IOMMU_DOMAIN_DMA codepath is the default,
instead of explicitly enumerating all types.
Fixes an apple-dart regression in v6.5.
Cc: regressions@lists.linux.dev
Cc: stable@vger.kernel.org
Suggested-by: Robin Murphy <robin.murphy@arm.com>
Fixes: a4fdd9762272 ("iommu: Use flush queue capability")
Signed-off-by: Hector Martin <marcan@marcan.st>
---
Changes in v2:
- Fixed the issue in apple-dart instead of the iommu core, per Robin's
suggestion.
- Link to v1: https://lore.kernel.org/r/20230922-iommu-type-regression-v1-1-1ed3825b2c38@marcan.st
---
drivers/iommu/apple-dart.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
---
base-commit: ce9ecca0238b140b88f43859b211c9fdfd8e5b70
change-id: 20230922-iommu-type-regression-25b4f43df770
Best regards,
Comments
On Fri, Sep 22, 2023 at 11:55:23PM +0900, Hector Martin wrote: > --- > Changes in v2: > - Fixed the issue in apple-dart instead of the iommu core, per Robin's > suggestion. > - Link to v1: https://lore.kernel.org/r/20230922-iommu-type-regression-v1-1-1ed3825b2c38@marcan.st > --- > drivers/iommu/apple-dart.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Applied for v6.6, thanks.
diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c index 2082081402d3..0b8927508427 100644 --- a/drivers/iommu/apple-dart.c +++ b/drivers/iommu/apple-dart.c @@ -671,8 +671,7 @@ static int apple_dart_attach_dev(struct iommu_domain *domain, return ret; switch (domain->type) { - case IOMMU_DOMAIN_DMA: - case IOMMU_DOMAIN_UNMANAGED: + default: ret = apple_dart_domain_add_streams(dart_domain, cfg); if (ret) return ret;