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 C541FC77B73 for ; Mon, 22 May 2023 01:44:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231426AbjEVBot (ORCPT ); Sun, 21 May 2023 21:44:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231449AbjEVBoq (ORCPT ); Sun, 21 May 2023 21:44:46 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82404D2 for ; Sun, 21 May 2023 18:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684719879; x=1716255879; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=6SOQe/1i7ESxVfMLC7Q050UYtfAJ+dtZJDKbqpBo6mk=; b=Mt/CE904DLIwrKkYJe0SHc+0EORRx5Cn8rYWfwgxJLO1NOBpqMzJvr37 prHy+KHhyAi7UdqRZAfjsdhouRfd+RW7DEYqDACd2+xpb18vU9uk170qh 2JQdq+d8w3dS/cM6eN7vAUqksGu4NUniczRkkoUMZQ2F4sWRyHWqVuRH6 /Ljq/M15r0pglt1oIk6OWrDc70ZaahghRFAv/18j0+FUYZGYdItAYCnbF 68Ozt5myY66g1vvS46XkJw3DyPFXI7OIihSRfFTgwnnXp355aeQBB0IhF GRHxGqHkZZ6YTQP5f5g5Y0vot0KgfTKYze/xcCFy1jz7CvSpMTvxnCGki g==; X-IronPort-AV: E=McAfee;i="6600,9927,10717"; a="355149109" X-IronPort-AV: E=Sophos;i="6.00,183,1681196400"; d="scan'208";a="355149109" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2023 18:44:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10717"; a="736237888" X-IronPort-AV: E=Sophos;i="6.00,183,1681196400"; d="scan'208";a="736237888" Received: from allen-box.sh.intel.com (HELO [10.239.159.127]) ([10.239.159.127]) by orsmga001.jf.intel.com with ESMTP; 21 May 2023 18:44:37 -0700 Message-ID: Date: Mon, 22 May 2023 09:43:57 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cc: baolu.lu@linux.intel.com, Kevin Tian , Nicolin Chen Subject: Re: [PATCH v2 08/10] iommu: Always destroy the iommu_group during iommu_release_device() Content-Language: en-US To: Jason Gunthorpe , David Woodhouse , iommu@lists.linux.dev, Joerg Roedel , Len Brown , linux-acpi@vger.kernel.org, "Rafael J. Wysocki" , Robin Murphy , Will Deacon References: <8-v2-3c3bb7aa6e48+1916b-iommu_probe_jgg@nvidia.com> From: Baolu Lu In-Reply-To: <8-v2-3c3bb7aa6e48+1916b-iommu_probe_jgg@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On 5/20/23 2:42 AM, Jason Gunthorpe wrote: > Have release fully clean up the iommu related parts of the struct device, > no matter what state they are in. > > Split the logic so that the three things owned by the iommu core are > always cleaned up: > - Any attached iommu_group > - Any allocated dev->iommu and its contents including a fwsepc > - Any attached driver via a struct group_device > > This fixes a minor bug where a fwspec created without an iommu_group being > probed would not be freed. > > Reviewed-by: Kevin Tian > Signed-off-by: Jason Gunthorpe Reviewed-by: Lu Baolu Best regards, baolu