[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN][PATCH v9 09/19] xen/iommu: Move spin_lock from iommu_dt_device_is_assigned to caller


  • To: Vikram Garhwal <vikram.garhwal@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 21 Aug 2023 08:53:38 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Fa3FFB2fxkJ8H/dRpscRsqwJrWv1X8/QKjQcXgE4Ues=; b=K5A6dHGmxttic9yMFFFCfTpwt/TgpaRAzIIETK10sUUM5fsGgpWWU/UlEHxkzs9/qRVV8qyHL+52hEG++T0qnGPkn+p+cJ0n4N9nJi6LHg0xdX/kcO4OPpkJXYiGdYU3XaV3l8bpDc6bzutS35T+WP9fEpcmWcSAM6UAywfmR3XLAA5lR4YdiqZSdMT2YJd7wjrH+GsjsKI+YWLVzteLOzezUbivRdFmUbkbA+wfrEjJbKYeUjDNPMg6KYEF4UvhBpYoEoKQD4Xs+dcC1EtecLgrR/psYY/cVOgKzg3B0/6FwpsPOj1QBub3TgNZtjCCu+Offh2i48tUpRLKDpEbgA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j5RiF6LWgsiiK9M7ECvxVWRsXHcTa2s19F0sr8o+cdKWSf5cVzcA7N9eJcohdlZ+eHiZgTxyFwiPDHkN+937mklA4sVPNCJde6CZn7U9xpL15tFuY8dm3OCtX04udTF2sBtEg695O3hqYjczUhC8oo0RkenOVCyRsQkOxnLfxiA7Zs4fBMz7VfFVrU/CaeweD8HTr3hegvF+VUE1rJD47hecEd7qkSOURbW9EA1800rD4I7F1csiwMWsjSLnD5ogAynqIqW9Ge4b2ve+Mxks5/ojwWjCks/kB2Iy123+Xb/x8xWm8I6X7kFIlI0kcKHV0uqjvSDdH482PMJ2oHgeZA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: michal.orzel@xxxxxxx, sstabellini@xxxxxxxxxx, Julien Grall <julien@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 21 Aug 2023 06:53:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19.08.2023 02:28, Vikram Garhwal wrote:
> Rename iommu_dt_device_is_assigned() to iommu_dt_device_is_assigned_locked().
> Remove static type so this can also be used by SMMU drivers to check if the
> device is being used before removing.
> 
> Moving spin_lock to caller was done to prevent the concurrent access to
> iommu_dt_device_is_assigned while doing add/remove/assign/deassign. Follow-up
> patches in this series introduces node add/remove feature.
> 
> Also, caller is required hold the correct lock so moved the function prototype
> to a private header.
> 
> Signed-off-by: Vikram Garhwal <vikram.garhwal@xxxxxxx>
> 
> ---
> Changes from v7:
>     Update commit message.
>     Add ASSERT().
> ---
> ---
>  xen/drivers/passthrough/device_tree.c | 26 +++++++++++++++++++++----
>  xen/include/xen/iommu-private.h       | 28 +++++++++++++++++++++++++++
>  2 files changed, 50 insertions(+), 4 deletions(-)
>  create mode 100644 xen/include/xen/iommu-private.h

I find it odd for new versions to be sent when discussion on the prior
version hasn't settled yet, and when you then also don't incorporate
the feedback given. I also find it odd to now be Cc-ed on the entire
series. Imo instead of that patches which aren't self-explanatory /
self-consistent simply need their descriptions improved (in the case
here to mention what further use of a function is intended). Yet
better would be to add declarations (and remove static) only at the
point that's actually needed. This then eliminates the risk of
subsequent changes in response to feedback (like Julien's here)
resulting in the declaration no longer being needed, thus leading to
a Misra violation (besides the general tidiness aspect).

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.