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

Re: [XEN][RFC PATCH v3 09/14] xen/iommu: Introduce iommu_remove_dt_device()


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>, Vikram Garhwal <fnu.vikram@xxxxxxxxxx>
  • From: Vikram Garhwal <vikram.garhwal@xxxxxxx>
  • Date: Tue, 6 Dec 2022 21:21:00 -0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.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=rryMa14I1C131iXC0ZAtvzKPFOl6B0v4Uugv0BHQAKo=; b=hsiWTo1CCQhPDlzf+kglHwuy5ZB/4nKMGbSt8a9eSpI6zf5xNjY9oaJRjmKiBev7PUychnf1tR97zeEviK6Pofx2mvvW7/w3iZ9jR/ks9kcCeGk4SXLpF/JOsBAAt9U0L5veZ7+mDO4XK4AoGpOcYTNTYncgR9LWVWrEgV8rGMtALkTHQoKYTbmJBDzdr+zYkdK3wWA4O1DhON6ZBAh75Nuo3Bp6SQmefr3PhHUXC+9LB3nsau7+WLp82Ou52p/z5Rdae9bPSlCEF5eRh9Toh595akmGiF5XkSLS3eTEwVkVfAlTiZaevrPPhCokU/YpV19MK5LJKatYO6cLtYhXVg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LvOVchZ/k9oKpzB/SMGo3pjsQovbPCKr3Hk10g8WRGa6rNoywZHvYXW2F4LFdzh3UGrBRD4W4Xlsbd9AGUjvyl3kFdWkw5HEBd77Y3RvAbCSG9p2DJhtTO0+OZaX2Ow59sXpqoDELDCdnOHwBeXRg7yy6mhFyNDkpckTkyPMv5FWT3WHVmYltQAAbh5Ucttg8t4UorBcF1eEIZnLzHlX3XPwu7VmPFV3HOkQ0nTRzI43HYv2jlzVC8+A7dADufQYtm+6YaIv4s3xA+eUoPknhxow5D0UzoPOHg2hSEBWEgQBdbnVeHfAgiKLDBf++iV2GeaNvdPvcTtNeel1cflHtw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, "volodymyr_babchuk@xxxxxxxx" <volodymyr_babchuk@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Wed, 07 Dec 2022 05:21:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Luca,

On 3/14/22 10:50 AM, Luca Fancellu wrote:
+int iommu_remove_dt_device(struct dt_device_node *np)
+{
+    const struct iommu_ops *ops = iommu_get_ops();
+    struct device *dev = dt_to_dev(np);
+    int rc;
+
+    if ( !ops )
+        return -EOPNOTSUPP;
Here we have that the counterpart iommu_add_dt_device returns EINVAL here and...
I add EINVAL here in v1 but Julien suggested to change it ot EOPNOTSUPP.
+
+    spin_lock(&dtdevs_lock);
+
+    if ( iommu_dt_device_is_assigned_lock(np) ) {
+        rc = -EBUSY;
+        goto fail;
+    }
+
+    /*
+     * The driver which supports generic IOMMU DT bindings must have
+     * these callback implemented.
+     */
+    if ( !ops->remove_device ) {
+        rc = -EOPNOTSUPP;
… here (for !ops->add_device), so I’m wondering if there is a mistake.

+        goto fail;
+    }
+



 


Rackspace

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