Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2491143imw; Wed, 6 Jul 2022 06:53:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1teLVgpjr2XniXkwpXGRQ+q7M9uOaTayjK3q/vKTQYw3GZhVzyK+QCf6ltzyexw91Qq/jtt X-Received: by 2002:a05:6402:2cd:b0:43a:70f7:1af2 with SMTP id b13-20020a05640202cd00b0043a70f71af2mr16826949edx.357.1657115615691; Wed, 06 Jul 2022 06:53:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657115615; cv=none; d=google.com; s=arc-20160816; b=OsfyTG1dg1gz5wVlZynD47XhedveFB97XaB3BhLHJgalVcNSTvW9VMhROZI8v+sanx F/hztujVT0nnLPC2mY9arFf9XzuDOFV2+4hvtez7BVtsCMdoV/TPeUKko87ZK5dNnxGJ cLBU+uGiESKW85qQDq4Ad/RHZpDtNnJbP7LsRek+Pi5zlS2ZZP2ukWRZJJIs4wnOHd8F 7DLk1B3eU1Xtl+CbsLpvQrSGFwx3YRrHe6AshOt2EiYpoTYht1gViY++XOwTwPokVXmi 6w00wzbHHM5OaI97OM9FP0RlmGVyWsnRiLpEPfvOknrhREevfF/NcAVRem31Hdc4szHY EV2g== 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:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=KPQl6iSvasPLor6gz9/KoDosDcFEonNM3cv56VchlrA=; b=chH1lOkkcZXN+6PJxfMiolS3PSjNAZm1RonPGRQtsHJz2N2Lm6Tndd+9zKEveLsDUc b7FA8+NwqsIXy10GtuLKOytuipib/dQfFTHVrkSQb5FaoX9+YOoPaQyHay5w1yWdbGZu R+tuqCxt4T1V//vHOIWPRHTBOps6G6J2vD3QIX2k5JJ+li2UB8YCLa7kt2uhOLREyfPK prKFy8LUKYVQTVAnV8IPF0VY5w987J/HT3UG3doqgt9svMItiVHRykcNrGFT5c7NOI4F szXm4EWkKbzYA5ZGZ6o3+GUY9FAgV9OsA3YGXvHon1xFzryYktIKEMM/zf2U6Hskhkb2 td2w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l15-20020a056402254f00b004357a6c5e3bsi16939772edb.151.2022.07.06.06.53.08; Wed, 06 Jul 2022 06:53:35 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233604AbiGFNnu (ORCPT + 99 others); Wed, 6 Jul 2022 09:43:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbiGFNnt (ORCPT ); Wed, 6 Jul 2022 09:43:49 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 143FE5FF1; Wed, 6 Jul 2022 06:43:48 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 25437106F; Wed, 6 Jul 2022 06:43:48 -0700 (PDT) Received: from [10.57.86.2] (unknown [10.57.86.2]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C7F813F792; Wed, 6 Jul 2022 06:43:45 -0700 (PDT) Message-ID: <3d613192-f673-852e-9c52-b8a913d25616@arm.com> Date: Wed, 6 Jul 2022 14:43:40 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v3 03/15] iommu: Always register bus notifiers Content-Language: en-GB To: Baolu Lu , joro@8bytes.org Cc: will@kernel.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, suravee.suthikulpanit@amd.com, vasant.hegde@amd.com, mjrosato@linux.ibm.com, gerald.schaefer@linux.ibm.com, schnelle@linux.ibm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org References: <8c380309f264cd0dfc73ba2ec060adc9515af2f2.1657034828.git.robin.murphy@arm.com> <1fab4c8a-7bc5-9a50-d48a-0dc590cac7a6@linux.intel.com> From: Robin Murphy In-Reply-To: <1fab4c8a-7bc5-9a50-d48a-0dc590cac7a6@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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-07-06 02:53, Baolu Lu wrote: > On 2022/7/6 01:08, Robin Murphy wrote: >>   /* >>    * Use a function instead of an array here because the domain-type is a >>    * bit-field, so an array would waste memory. >> @@ -152,6 +172,10 @@ static int __init iommu_subsys_init(void) >>               (iommu_cmd_line & IOMMU_CMD_LINE_STRICT) ? >>                   "(set via kernel command line)" : ""); >> +    /* If the system is so broken that this fails, it will WARN >> anyway */ > > Can you please elaborate a bit on this? iommu_bus_init() still return > errors. Indeed, it's commenting on the fact that we don't try to clean up or propagate an error value further even if it did ever manage to return one. I feared that if I strip the error handling out of iommu_bus_init() itself on the same reasoning, we'll just get constant patches from the static checker brigade trying to add it back, so it seemed like the neatest compromise to keep that decision where it's obviously in an early initcall, rather than in the helper function which can be viewed out of context. However, I'm happy to either expand this comment or go the whole way and make iommu_bus_init() return void if you think it's worthwhile. Cheers, Robin. > >> +    for (int i = 0; i < ARRAY_SIZE(iommu_buses); i++) >> +        iommu_bus_init(iommu_buses[i]); >> + >>       return 0; > > Best regards, > baolu