From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05104C433EF for ; Wed, 22 Jun 2022 07:17:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352606AbiFVHRk (ORCPT ); Wed, 22 Jun 2022 03:17:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349995AbiFVHRj (ORCPT ); Wed, 22 Jun 2022 03:17:39 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1491636E32 for ; Wed, 22 Jun 2022 00:17:37 -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 0413913D5; Wed, 22 Jun 2022 00:17:37 -0700 (PDT) Received: from [10.57.85.1] (unknown [10.57.85.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AC4353F66F; Wed, 22 Jun 2022 00:17:35 -0700 (PDT) Message-ID: Date: Wed, 22 Jun 2022 08:17:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 3/3] iommu: Clean up release_device checks Content-Language: en-GB To: Baolu Lu , joro@8bytes.org, will@kernel.org Cc: iommu@lists.linux-foundation.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <02671dbfad7a3343fc25a44222350efcb455fe3c.1655822151.git.robin.murphy@arm.com> <59002dbd-d72a-4f9c-7ad8-808ee8d2ff05@linux.intel.com> From: Robin Murphy In-Reply-To: <59002dbd-d72a-4f9c-7ad8-808ee8d2ff05@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-06-22 02:36, Baolu Lu wrote: > On 2022/6/21 23:14, Robin Murphy wrote: >> Since .release_device is now called through per-device ops, any call >> which gets as far as a driver definitely*is*  for that driver, for a >> device which has successfully passed .probe_device, so all the checks to >> that effect are now redundant and can be removed. In the same vein we >> can also skip freeing fwspecs which are now managed by core code. > > Does this depend on any other series? I didn't see iommu_fwspec_free() > called in the core code. Or I missed anything? dev_iommu_free() cleans up param->fwspec directly (see b54240ad4943). FWIW the plan is that iommu_fwspec_free() should eventually go away - of the remaining uses after this, two are in fact similarly redundant already, since there's also a dev_iommu_free() in the probe failure path, and the other two should disappear in part 2 of fixing the bus probing mess (wherein the of_xlate step gets pulled into iommu_probe_device as well, and finally works correctly again). Cheers, Robin. > >> >> Signed-off-by: Robin Murphy >> --- >>   drivers/iommu/apple-dart.c                  |  3 --- >>   drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c |  8 +------- >>   drivers/iommu/arm/arm-smmu/arm-smmu.c       | 14 +++----------- >>   drivers/iommu/arm/arm-smmu/qcom_iommu.c     | 11 ----------- >>   drivers/iommu/exynos-iommu.c                |  3 --- >>   drivers/iommu/mtk_iommu.c                   |  5 ----- >>   drivers/iommu/mtk_iommu_v1.c                |  5 ----- >>   drivers/iommu/sprd-iommu.c                  | 11 ----------- >>   drivers/iommu/virtio-iommu.c                |  8 +------- >>   9 files changed, 5 insertions(+), 63 deletions(-) > > Best regards, > baolu