Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1324583imi; Sat, 23 Jul 2022 02:17:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sSsGZ8UEZ3X4vVN3WA3PBKgc4E92yUTqzUpH4ke7JsUIpVEvNb71QTWiRHOd+ThM4euoij X-Received: by 2002:a17:903:2344:b0:16d:2dbe:fb4e with SMTP id c4-20020a170903234400b0016d2dbefb4emr3404658plh.89.1658567857691; Sat, 23 Jul 2022 02:17:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658567857; cv=none; d=google.com; s=arc-20160816; b=uQ+ftqMZmC7vevtyQtDg42/j631GOlA1XM3bcJmSaBIkcs4lP1ivPfFEtfvPt6eRpA QdiJp+GC6EV4NzaQ6VmvB+Ir9t3Im/Kkbox9ZOMLwuuGGaHp9YSSSTM3GwipAtpuO4Qr rtQrxGmHnWuTtreBaVQrnRb9i+3jul4s9/19BVLRt85jwgRezSVJYUdCrshfYr3VEsqm wipm33NE+K1NUgZFvKzpUvWoBfMYQpoCWkQ1FI33jP3yoWJrlHFF972OVhfZNROVqB38 fbCf0FiVUi2rLbbBs4EzbFzO4y08ogEHqJ+deItaTqbgRTJIJoDIB1dnbd7M+JNXQviJ aUqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=l9kmvxu6W5d9+1zU6SG8Lvic1vIkIt/jDj4ORNY6pUo=; b=OJk29jjZpyu7mD3DPYB4n2ue1manNfqwMLW9i+dtS+4+BxX3Tc/wmBI6UjTAws1e6R vTuDGqkIWtIMPnKm3VBZ2AQBzzpL2WkHhDxvL4RiRzcAlGxfhnkQZPNCLJ3+nmvi/niO g98V/QOxgOt/mbtaRMSLbQ3PjESL/3IqN5yzKMhdBb5oZRBPW+Bq8NdOCUxWuHQ2E2Aj u3wnk73IX5uBN9NvDVw5KvHaCA+6opwhHfCGJJ3k/4P4mXbEGrIhShGDjPrmIRMhMOGZ IQBbifVy4PDpO5+wGkZQGlHa53LpZiTbQOf7e/pUJ35T24xHem2v5T1TtI6QfGyEj19s 5kCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fk4w3UlW; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e15-20020a17090a9a8f00b001ef8f853cafsi10190728pjp.176.2022.07.23.02.17.22; Sat, 23 Jul 2022 02:17:37 -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=@kernel.org header.s=k20201202 header.b=Fk4w3UlW; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235615AbiGWJK1 (ORCPT + 99 others); Sat, 23 Jul 2022 05:10:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231272AbiGWJK0 (ORCPT ); Sat, 23 Jul 2022 05:10:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C59B7663; Sat, 23 Jul 2022 02:10:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E1790B82C18; Sat, 23 Jul 2022 09:10:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94BB2C341C0; Sat, 23 Jul 2022 09:10:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658567422; bh=vFrd/H8zW4hCO4fFUiAu/WJ/KqGbXHTrFQ20cwdiKCE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Fk4w3UlWVXeaErCqbjt+L1lf3ygfMwvG4KgK/LGA1nccvWXfeAYTCxsnkLbsJSBm7 koBfAYJLeVULaFz4ZBUCpy+xq5P0rzmYnbQmsEXctvI7uWvzD7/b160oSo2z8Sw3mo hywOITj6Ws8+O6TthsGnXi4B2xMVYqoM0d8FyatefkUpgU/CSwiXJLIgh99vnLq+yk RFWgvbC6TxwBO1Hkw3PLt4VdyqSv3+zpUd92OuZhQtkYN5rTzgRmMcLXfzNTVIGbUr xLAhAK9DtYSECYHix1ylbx1jxHqUjrpQDXjNT02h1taJYmDsI3IAd9pifW9tfHfOKC IqUR7MJpHlJWA== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oFB9Q-009Vj4-2V; Sat, 23 Jul 2022 10:10:20 +0100 Date: Sat, 23 Jul 2022 10:10:19 +0100 Message-ID: <87h738xkhw.wl-maz@kernel.org> From: Marc Zyngier To: William Dean Cc: williamsukatube@163.com, tglx@linutronix.de, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, fancer.lancer@gmail.com, Hacash Robot Subject: Re: [PATCH] irqchip: mips-gic: check the return value of ioremap() in gic_of_init() In-Reply-To: References: <20220722091008.2937238-1-williamsukatube@163.com> <87mtd1y02y.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: williamsukatube@gmail.com, williamsukatube@163.com, tglx@linutronix.de, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, fancer.lancer@gmail.com, hacashRobot@santino.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Sat, 23 Jul 2022 03:57:18 +0100, William Dean wrote: > > Thans for your advice. > > > Erm... No. The issue was definitely there before (just look at the > > patch you quote here). > > Do you mean that I wrote the fixes-tag wrong? I just checked it, it was > introduced by the earlier commit fbea754123ae5d9678295398c98e91f1b2159e5b, > if you mean that, I will send patch v2 Not even that. Here's what this patch has: - mips_gic_base = ioremap_nocache(gic_base_addr, gic_addrspace_size); + if (mips_cm_present()) { + write_gcr_gic_base(gic_base | CM_GCR_GIC_BASE_GICEN); + /* Ensure GIC region is enabled before trying to access it */ + __sync(); + } + + mips_gic_base = ioremap_nocache(gic_base, gic_len); gicconfig = read_gic_config(); gic_shared_intrs = gicconfig & GIC_CONFIG_NUMINTERRUPTS; Still no check for the ioremap result. You can actually trace it all the way down to 39b8d5254246a ("[MIPS] Add support for MIPS CMP platform."), which introduced that code initially. But is it worth referencing such an old commit? No. To be honest, given how early this code executes, failing to ioremap something is utterly unlikely, and adding the check is mostly about being pedantic. It is also worth noting that most of the use of this variable are guarded by mips_gic_present(), which actually checks for mips_gic_base being NULL and that the driver actually *ignores* such mapping. Given that, I'm not sure this deserves an actual Fixes: tag. This is completely harmless. Just resend the patch with a correct SoB, and I'll queue it. Thanks, M. -- Without deviation from the norm, progress is not possible.