Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3495632imw; Thu, 7 Jul 2022 02:47:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uHzvocLpeLyKK6Y9y1WSd2fQ6UpLDElueUUBuxSBDsQWVZzNeFUklXoWcmL/rO5Fb4NSb2 X-Received: by 2002:a17:906:72cf:b0:722:e1a4:25 with SMTP id m15-20020a17090672cf00b00722e1a40025mr44861984ejl.205.1657187249551; Thu, 07 Jul 2022 02:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657187249; cv=none; d=google.com; s=arc-20160816; b=ZI0t2X8SFg2wUm/yauTNbra25F6nBSZf+XFEp3PmZo+gfJHb1OP6JfxKDo7UAroO2W d8rt2d5EN6Ll6BRoNDVIPw57JUfyVDyW4bXOhrwI1WFMwYU91bhBpJaIBpAFmDya2fKe svJfKccRlotmwWVETO5wV0mhTAEZljBwxU5zri/n2vQsLIlUW9pvwVg/RfdJfriK+BvK pFEoghC49Wy2WpLseAxhChiA1VCzb1d9OjhyKxMni6lSTPeSfTORDyJCBTJSnqqNLxvu qS9UwZjVBToQ7+7L2JaVW5vAuv4Qa30RdqBTkXyURdywudwz5ZTjv6EFw7MfKjK75Nou RXlA== 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=sEfd8JQ+PVsNGT5attOL84bqwqS85l8vAn/WF2Fj2Kw=; b=Am4e/II4I8VGmPsrcete/5chmpqT38N964VJMh00EHeeY9Tw3BIsIs4Mk6S0K4tu4Y yj7mD/pl+TcxuyWDz7lJrnyWjVURS8WmCi8Bm+/c/ITPPCRHvW5XHvK9vwcJACBPPktu Ex2TFwxKu3tFALC7+6MMBzPy9B1b0/wu8tsGNqPbojHBHDPwo9G3ojKg+zEyM1UsF7oq ErEwgSUVo9DP6J/D7gzYrG0jzIgMqVPtQfAYwnZ5sCTR/5IWrR+pCWW1c9ygAdqf+AeS AW/zHDaJfFi3Ktibr6WrdxHx8q7cYVlu6xvXGWcXWnrK0J5fTPJl8+PbF2KrXdgja4cX s2Pg== 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 z10-20020a170906240a00b00722668dbcacsi1506858eja.575.2022.07.07.02.47.04; Thu, 07 Jul 2022 02:47:29 -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 S235217AbiGGJiY (ORCPT + 99 others); Thu, 7 Jul 2022 05:38:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235117AbiGGJiX (ORCPT ); Thu, 7 Jul 2022 05:38:23 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D771D45054; Thu, 7 Jul 2022 02:38:19 -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 CBFCA1063; Thu, 7 Jul 2022 02:38:19 -0700 (PDT) Received: from [10.57.85.108] (unknown [10.57.85.108]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 507723F792; Thu, 7 Jul 2022 02:38:17 -0700 (PDT) Message-ID: Date: Thu, 7 Jul 2022 10:38:12 +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: "Tian, Kevin" , 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> <3d613192-f673-852e-9c52-b8a913d25616@arm.com> <28a58a21-a866-b49c-9977-c8d05b320fbd@linux.intel.com> From: Robin Murphy In-Reply-To: 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-07 07:34, Tian, Kevin wrote: >> From: Baolu Lu >> Sent: Thursday, July 7, 2022 8:21 AM >> >> On 2022/7/6 21:43, Robin Murphy wrote: >>> 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. >> >> Thanks for the explanation. It would be helpful if the comment could be >> expanded. In this case, after a long time, people will not consider it >> an oversight. :-) >> > > I'd prefer to making iommu_bus_init() return void plus expanding > the comment otherwise the question arises that if the only caller > is not interested in the return value then why bother returning it > in the first place. ???? OK, that's fair enough, will do. Thanks, Robin.