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 X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29009C4338F for ; Thu, 22 Jul 2021 23:33:12 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C994F60E9B for ; Thu, 22 Jul 2021 23:33:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C994F60E9B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.159888.294032 (Exim 4.92) (envelope-from ) id 1m6iBU-00087L-Of; Thu, 22 Jul 2021 23:32:56 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 159888.294032; Thu, 22 Jul 2021 23:32:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1m6iBU-00087E-LS; Thu, 22 Jul 2021 23:32:56 +0000 Received: by outflank-mailman (input) for mailman id 159888; Thu, 22 Jul 2021 23:32:55 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1m6iBT-000878-O9 for xen-devel@lists.xenproject.org; Thu, 22 Jul 2021 23:32:55 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 232d7166-eb45-11eb-915b-12813bfff9fa; Thu, 22 Jul 2021 23:32:54 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 672F560EB2; Thu, 22 Jul 2021 23:32:53 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 232d7166-eb45-11eb-915b-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626996773; bh=HbH3bLjCo5cGJISokqxaORxnMxdNJO6b51G1CARPNks=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=gR7cEN3IXG/ovwHxhW4/hdT+BBMaxtI/n5CE+Yh1WfX7dvXOK0RUY1dCR1a+4lbcc cuRi0mk2rZLvqyXeIHmReSZc7FrsI1DRDnrASrCSL29YoV/2LZ0tXh9/l4wOHZTvcy zRFxQY0t+EeM8/ysm/IOkxtAZ0WVdS0wsykEpJmCZXYK2oA+5GmCwDmctf0el96XIG IqvnsJczD3XsAprvP43YvT9Ulkz7BlmdDREWKuIWrCrFxPW+Vjvc8OQ1oOmOWhiLzb N+47MAFd0+QllRDu8MAqr9p+OG/lVw5mbuxrBkVfNMyV1B2T2TKOrARYEKdKySLdbu i/J5jtDoHt/wA== Date: Thu, 22 Jul 2021 16:32:52 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: Julien Grall cc: Stefano Stabellini , xen-devel@lists.xenproject.org, Bertrand.Marquis@arm.com, Volodymyr_Babchuk@epam.com, rahul.singh@arm.com, brian.woods@xilinx.com, Stefano Stabellini Subject: Re: [PATCH v4 1/3] arm,smmu: switch to using iommu_fwspec functions In-Reply-To: <267ed58b-a63c-3ef4-b244-bab9e2e7f95e@xen.org> Message-ID: References: <20210716235939.9585-1-sstabellini@kernel.org> <267ed58b-a63c-3ef4-b244-bab9e2e7f95e@xen.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Thu, 22 Jul 2021, Julien Grall wrote: > Hi Stefano, > > On 17/07/2021 00:59, Stefano Stabellini wrote: > > diff --git a/xen/drivers/passthrough/device_tree.c > > b/xen/drivers/passthrough/device_tree.c > > index 999b831d90..911f82a561 100644 > > --- a/xen/drivers/passthrough/device_tree.c > > +++ b/xen/drivers/passthrough/device_tree.c > > @@ -140,8 +140,12 @@ int iommu_add_dt_device(struct dt_device_node *np) > > if ( !ops ) > > return -EINVAL; > > + /* > > + * Device already added. It can happen when both iommus and > > + * mmu-masters are present. > > + */ > > This is common code. So I would suggest to write a generic comment to avoid > any misunderstanding. The one added just after the call in iommu_do_domctl() > would seem more suitable. OK, I went with this: * Some Device Trees may expose both legacy SMMU and generic * IOMMU bindings together. If both are present, the device * can be already added. > > if ( dev_iommu_fwspec_get(dev) ) > > - return -EEXIST; > > + return 0; > There are a few things to mention here: > > 1) The change is not explained in the commit message I will add > 2) One of the caller was checking -EEXIST. As you dropped the only place > where -EEXIST should be returned, can you drop the check in the caller? Good point, yes I think it can be dropped. > Ideally this should be in a separate patch because this change is not entirely > related to this patch. I can do that, I'll send out v5 shortly.