Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp4672889rwb; Wed, 17 Aug 2022 04:20:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR7HPBtlMmY8U6oDLUSTuIiq1A71Le7kYaNuO06NfLAS9USnU1kWlB5hOWlXV6AflWqbyOU+ X-Received: by 2002:a05:6402:369a:b0:43d:75c5:f16c with SMTP id ej26-20020a056402369a00b0043d75c5f16cmr22450813edb.57.1660735234198; Wed, 17 Aug 2022 04:20:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660735234; cv=none; d=google.com; s=arc-20160816; b=bLJVLOs6tbL8nPTGp7VUV4RBZsHphi+K28XXS3PglQtACwtFCG3DMomtGPXyHgGe9V P9j2PHCMWAp1LY1BDzDxXUiUgW6zqJLCTlKNASMhtHiJC89Y6LkQ8dAztvTDJHpDbdtd M1iuWa0Xect2Y4pDHrny8nTt+nu8o3Xt5TKg31V7EpG1caoN4KijQpYQmhlSnSyvsP6f Fxmr8TZ/P9ij1uqbJfxjvpQYj+h/g73qtMjE+DzoPx8sGZ54UzsNWAmtmwWbpghnwSHB eka8mFNGOrEKYYumHMET4JzTKjf8h4mPhVAOjHw05rQOOH0sMSK5RvCCONp5isJTh0Or zBzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=jYInTDZFpSYhheu4regzjUykHkV3raleoz+MNya4ZCE=; b=oc0i4UdPW18C7+0YwOBR/YxtQpcwKTugg/D+ETs5MUTIAWdfmTKBVetav7McR5zMca yBOVoaAyz634RSNlLjfGiTOc47K58OUJapAnCDzMNIjFfkepqi4aspUiiz/pqnPcKGu+ Qkb7r+EBGgyS17LxnvWnl9t1abVUEcHoWMa9H4axdrAhiKTOaukQem2lXhVbojBSYiTy xWcbMu0XsgzR7U8nk94saW8inOx8PSBP6OWTdANOckVaBfnQ2xjvwJTSkgux8AACk39x 3XX6j2SZQBq8++PkjFORDTFrKA11Xr1TwL20fx79aNbEEBPqtxwapj/5zz3nLa0j0In2 gGAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UOF0AJLY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hu8-20020a170907a08800b006feb18c72bfsi11957343ejc.126.2022.08.17.04.20.07; Wed, 17 Aug 2022 04:20:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UOF0AJLY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230366AbiHQKfA (ORCPT + 99 others); Wed, 17 Aug 2022 06:35:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229705AbiHQKe7 (ORCPT ); Wed, 17 Aug 2022 06:34:59 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80A9B51A33 for ; Wed, 17 Aug 2022 03:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660732498; x=1692268498; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=WDCWwFNC4pSlrtLv+pJZJTESXKf8+WkfSayMR/BUY90=; b=UOF0AJLY8nKVPWwGTa4lqcn7In75T5+ois0MvvvB78fcMH7BY8D4JgqH FvAHG2xpJHlgIIQ/vamo03wDHb/157Y90skInzujQyeFRFrrMEeBwsKgQ dm1FNHgIYrSKWqDoxb86aaS5ATkEqZbBwLcUhcr2TAU+CtIXEgxMt4BQN aZO6GxoTi6tazOg4E0DuLrcbRgEjZUQFobnTAPaKq5O7v3dG0kWbT4Gez 9o6Lq51BN6Ens+PiCx5CrRnWYoiyI8ub5mL7hLnZzU91do6Vv2aYqrKKc UCBDInsC9DkJ5Uu1i28+Yvuz9V3FQIheat9CUXQxMTTbhOQWxFD69DH4c w==; X-IronPort-AV: E=McAfee;i="6400,9594,10441"; a="356456887" X-IronPort-AV: E=Sophos;i="5.93,242,1654585200"; d="scan'208";a="356456887" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2022 03:34:57 -0700 X-IronPort-AV: E=Sophos;i="5.93,242,1654585200"; d="scan'208";a="667559585" Received: from jzhan60-mobl1.ccr.corp.intel.com (HELO [10.254.209.228]) ([10.254.209.228]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2022 03:34:56 -0700 Message-ID: <50b8489c-bd93-c8ae-cd92-af429ae762b0@linux.intel.com> Date: Wed, 17 Aug 2022 18:34:54 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Cc: baolu.lu@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] iommu: return early when devices in a group require different domain type Content-Language: en-US To: Yuan Can , joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, iommu@lists.linux.dev References: <20220816020701.90533-1-yuancan@huawei.com> From: Baolu Lu In-Reply-To: <20220816020701.90533-1-yuancan@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/8/16 10:07, Yuan Can wrote: > When alloc default domain for an iommu_group in > probe_alloc_default_domain, the expected domain > type of each device in the iommu_group is checked > in a loop, if two devices require different types, > the loop can be breaked since the default domain > will be set to iommu_def_domain_type. > Return 1 when this happened to break the loop in > __iommu_group_for_each_dev. > > Signed-off-by: Yuan Can Nit: Try to use up the allowed number of characters per line before wrapping and use "./scripts/checkpatch.pl --strict --codespell _your_patch_file" to check the patch. For the change: Reviewed-by: Lu Baolu Best regards, baolu > --- > drivers/iommu/iommu.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c > index 74bc9111c7be..0d4d78946d31 100644 > --- a/drivers/iommu/iommu.c > +++ b/drivers/iommu/iommu.c > @@ -1653,6 +1653,7 @@ static int probe_get_default_domain_type(struct device *dev, void *data) > dev_name(gtype->dev), > iommu_domain_type_str(gtype->type)); > gtype->type = 0; > + return 1; /* end the outer loop */ > } > > if (!gtype->dev) {