Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp910781pxb; Fri, 22 Apr 2022 14:05:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgcma4K0xbhvfrdYQNilPTL2n+rUMONjsLbd85kD7OEA7sQP4gwXVDwgWox2/ZyBqYauB+ X-Received: by 2002:a65:5b4b:0:b0:3a3:d8fb:6926 with SMTP id y11-20020a655b4b000000b003a3d8fb6926mr5428013pgr.76.1650661541349; Fri, 22 Apr 2022 14:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650661541; cv=none; d=google.com; s=arc-20160816; b=zaikq1QFmOzPXoW8Zk3L/iARxVHesxh7/pHcMAxvQM7FP3L+aTHKhJ5S9yfzYAofKo xTS8OEQZOr6wI/eNcjHmRxGmQj9TDBEOPGFqlCbBHK4mEp+fJvjoA2ggoaV0O5vBZ6Lo on+ZcJ6V1iv3Xm92uZ/LCRIni9whQKDQSsftcofa9ceyGSYBg+HFNPugg4uC+Jy1siYT YraO2px3q0gJUMyssF+wNbUypNebWd9iYNGHPMdBxCX+L7P3+OIJcgbFONDszmX8gOOx jJe5B0L6RFfJy8+o27fXX3J9LfXqA5WgV8FECi5o1WZqnhvXAJSRTMafFcBK96SW/ake 1z3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=eBz1+A1mUCktA8fJn3U8qKyZYJYx+qKBAYzEV97UGbY=; b=urSaG+0Zvp13waGc4tJiL1LIYz0a36yDCZT9hh7vbrN6c1c77U2qbJKpwo2Fiii9O4 Igi80OD6+Td6EYcRZ9xt7oGIzzHg04XXvKfJ9nX2FjfvtRC+RtK8T3/HwHrPniK65CBf 8r5JJANDIHOLaqn3ijwSj0BDmHV2qbuXZMKIny9ikDV84Lkqeth0PXfpoMfbDpdEUXgJ EnDIYYETtd12V02alUpl51tHSP1GzcN4x3X7axzLHKYMPYsXYKEJCFbVO/FyGApysj07 k/kNVbkZiPMWtYhSVDajbZ2rJTfpam6zY9dCFyh1uPJF170J+kx4ozp3+JwyK2pbQMuF yZNg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id t29-20020a056a00139d00b004fe4e23e4f9si2856203pfg.262.2022.04.22.14.05.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 14:05:41 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DA5A232937B; Fri, 22 Apr 2022 13:02:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1392056AbiDUTrr (ORCPT + 99 others); Thu, 21 Apr 2022 15:47:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1392057AbiDUTrd (ORCPT ); Thu, 21 Apr 2022 15:47:33 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9746E4CD6E for ; Thu, 21 Apr 2022 12:44:42 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 11ACF153B; Thu, 21 Apr 2022 12:44:42 -0700 (PDT) Received: from [10.57.80.98] (unknown [10.57.80.98]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4A64E3F5A1; Thu, 21 Apr 2022 12:44:39 -0700 (PDT) Message-ID: <9c6819ec-9189-c6dd-b9ba-3687beebc538@arm.com> Date: Thu, 21 Apr 2022 20:44:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH 12/13] iommu/virtio: Clean up bus_set_iommu() Content-Language: en-GB To: Jean-Philippe Brucker Cc: joro@8bytes.org, will@kernel.org, iommu@lists.linux-foundation.org, sven@svenpeter.dev, robdclark@gmail.com, m.szyprowski@samsung.com, baolu.lu@linux.intel.com, yong.wu@mediatek.com, mjrosato@linux.ibm.com, gerald.schaefer@linux.ibm.com, zhang.lyra@gmail.com, thierry.reding@gmail.com, vdumpa@nvidia.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <4db34a35e07f3741a658465045b78c96a569c591.1649935679.git.robin.murphy@arm.com> From: Robin Murphy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-04-21 18:12, Jean-Philippe Brucker wrote: > On Thu, Apr 14, 2022 at 01:42:41PM +0100, Robin Murphy wrote: >> Stop calling bus_set_iommu() since it's now unnecessary, and simplify >> the probe failure path accordingly. >> >> Signed-off-by: Robin Murphy >> --- >> drivers/iommu/virtio-iommu.c | 24 ------------------------ >> 1 file changed, 24 deletions(-) >> >> diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c >> index 25be4b822aa0..371f8657c0ce 100644 >> --- a/drivers/iommu/virtio-iommu.c >> +++ b/drivers/iommu/virtio-iommu.c >> @@ -7,7 +7,6 @@ >> >> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt >> >> -#include >> #include >> #include >> #include > > isn't needed anymore either. In any case it > looks great, thanks Ha, it totally passed me by that this one *isn't* a platform driver, derp :) > Reviewed-by: Jean-Philippe Brucker > > and tested on QEMU (so only PCI for now) Thanks! Robin. >> @@ -1146,26 +1145,6 @@ static int viommu_probe(struct virtio_device *vdev) >> >> iommu_device_register(&viommu->iommu, &viommu_ops, parent_dev); >> >> -#ifdef CONFIG_PCI >> - if (pci_bus_type.iommu_ops != &viommu_ops) { >> - ret = bus_set_iommu(&pci_bus_type, &viommu_ops); >> - if (ret) >> - goto err_unregister; >> - } >> -#endif >> -#ifdef CONFIG_ARM_AMBA >> - if (amba_bustype.iommu_ops != &viommu_ops) { >> - ret = bus_set_iommu(&amba_bustype, &viommu_ops); >> - if (ret) >> - goto err_unregister; >> - } >> -#endif >> - if (platform_bus_type.iommu_ops != &viommu_ops) { >> - ret = bus_set_iommu(&platform_bus_type, &viommu_ops); >> - if (ret) >> - goto err_unregister; >> - } >> - >> vdev->priv = viommu; >> >> dev_info(dev, "input address: %u bits\n", >> @@ -1174,9 +1153,6 @@ static int viommu_probe(struct virtio_device *vdev) >> >> return 0; >> >> -err_unregister: >> - iommu_device_sysfs_remove(&viommu->iommu); >> - iommu_device_unregister(&viommu->iommu); >> err_free_vqs: >> vdev->config->del_vqs(vdev); >> >> -- >> 2.28.0.dirty >>