Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp436279iof; Mon, 6 Jun 2022 06:23:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvjHiBoecjo1D6Gx8MqwJFRRT/ST5zQeJUj53QDBRCeI5T7k1Dfrab9GvVbs7jD+H+CqlL X-Received: by 2002:a17:902:c2c1:b0:162:3a9:2819 with SMTP id c1-20020a170902c2c100b0016203a92819mr24423128pla.38.1654521824065; Mon, 06 Jun 2022 06:23:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654521824; cv=none; d=google.com; s=arc-20160816; b=GMhS5C0zFX7kNhh25iK1swElG4hIRwzUdlp/YKjAHBHOZ3itM5qGwYJOU5512WwroY yZpGkxw+r+ZUI+51RrLy1CJu8FNOtFkCccjU6O/JIeR57MTiPYhvpxb0ctCzERJRBaTZ FJ+PzkIbJhopeKCEPZv/GYeJvaxA+rMDLJdAFN8m45/J5RKw/orYIWUUymK54HoG8cRy Nw9I3UL60JEblJanl7l2Ho3kXpRSmnwq87a57hTJj8k0BUD8OkEUKbKIBAVI75x5HxzC +3Yg7fuv0GY0IzDTE1tfNU9XfWsykDRa8spu2EMTXhNLdSBFKnu99liElE2HGkkHX1UB BVew== 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=OfnFJaTmWreJWN6boyYHpT/aRfN5jSTeykvOftuV5Zc=; b=xUcPQ6X0/cPbH0tadbGGhCxzFWQM2Vrow1wk6WSFQXvlHHRfCQ1YJPqxufPrBvB0Cg 2SzTsaM9b2HDWvQziet15zVqVBbclBcsG+K7MRlYZAZ7SKDUpXmQC/bJU6XyMAdpffvx +9w2gy/lllggSN1SQmidewCiopq8LxqNpgcXepnfttH0roSzERWFTwiDt3Y++M8onMcv O7WlyT6uIi4dnJ2FANGiEonVrtLanxjCNsEQyFD1QZj8A7N/QOifTqF5e/MJ9jPgSc2t GQQkIG6uQiQ5t4LEZHzZr7odi9Sv+KSYII9Ilml2i4PQ7XxQ3lX8NJnby8saQx/ocQNr /YwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mlzLz+kO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id nl3-20020a17090b384300b001e4dd12a09esi25065021pjb.39.2022.06.06.06.23.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 06:23:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mlzLz+kO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A3BE0192BF; Mon, 6 Jun 2022 06:13:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238547AbiFFNNZ (ORCPT + 99 others); Mon, 6 Jun 2022 09:13:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238540AbiFFNNW (ORCPT ); Mon, 6 Jun 2022 09:13:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B719718B0F; Mon, 6 Jun 2022 06:13:21 -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 6AE3AB81812; Mon, 6 Jun 2022 13:13:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2862DC3411C; Mon, 6 Jun 2022 13:13:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654521199; bh=qbO7lBbtmW3Eet7P0hr1OYo1n6g40lpKLJ1V7MD0vxY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mlzLz+kOsMx/FW6FW7BiEQ7laxoGg0DZj1Std7P3Y3JNYkG0AyRfekSyye8MKjMOs Z3kFBnj4guzB0y+7cYNglF/MvvatjrXIqtljIPTt88RxEdbD5zfh2H+fsgWNTb771I i9s7n138ZFWLn7hDjtDWGCFyZ/fxpXiTodeICQqmIHJQahRQdC6gP5tseboA7LWWs6 HvWqHCoixjs5Fyte09ar+iCmKtvfa+lqskuYj0w8kayv+wKPUahzj2EXzEQUX4hxTD VL1bMev2+bgs0oWpDmEWXHNzmSFiKxreMHxQ3a7zM0HnF4IXXQiTrDPNBRi2L2wgM/ qsFaUxdChEDcQ== 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.94.2) (envelope-from ) id 1nyCXk-00FuJV-Pw; Mon, 06 Jun 2022 14:13:16 +0100 Date: Mon, 06 Jun 2022 14:13:16 +0100 Message-ID: <87tu8y3pg3.wl-maz@kernel.org> From: Marc Zyngier To: Dragan Mladjenovic Cc: Thomas Bogendoerfer , Chao-ying Fu , Daniel Lezcano , Geert Uytterhoeven , Greg Ungerer , Hauke Mehrtens , Ilya Lipnitskiy , Jiaxun Yang , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Paul Burton , Peter Zijlstra , Serge Semin , Thomas Gleixner , Tiezhu Yang , Dragan Mladjenovic Subject: Re: [PATCH v2 04/12] irqchip: mips-gic: Support multi-cluster in gic_with_each_online_cpu() In-Reply-To: <20220525121030.16054-5-Dragan.Mladjenovic@syrmia.com> References: <20220525121030.16054-1-Dragan.Mladjenovic@syrmia.com> <20220525121030.16054-5-Dragan.Mladjenovic@syrmia.com> 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: Dragan.Mladjenovic@syrmia.com, tsbogend@alpha.franken.de, cfu@wavecomp.com, daniel.lezcano@linaro.org, geert@linux-m68k.org, gerg@kernel.org, hauke@hauke-m.de, ilya.lipnitskiy@gmail.com, jiaxun.yang@flygoat.com, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, paulburton@kernel.org, peterz@infradead.org, fancer.lancer@gmail.com, tglx@linutronix.de, yangtiezhu@loongson.cn, dragan.mladjenovic@syrmia.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=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Wed, 25 May 2022 13:10:22 +0100, Dragan Mladjenovic wrote: > > From: Paul Burton > > Introduce support for multi-cluster GIC register access in > __gic_with_next_online_cpu(), and therefore in its user > gic_with_each_online_cpu(). We access registers in remote clusters using > the CM's GCR_CL_REDIRECT register, and so here we delegate to > mips_cm_lock_other() in order to configure this access. > > With this done, users of gic_with_each_online_cpu() gain support for > multi-cluster with no further changes. > > Signed-off-by: Paul Burton > Signed-off-by: Chao-ying Fu > Signed-off-by: Dragan Mladjenovic > > diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c > index 4872bebe24cf..89a3c6d04e09 100644 > --- a/drivers/irqchip/irq-mips-gic.c > +++ b/drivers/irqchip/irq-mips-gic.c > @@ -69,6 +69,20 @@ static int __gic_with_next_online_cpu(int prev) > { > unsigned int cpu; > > + /* > + * Unlock access to the previous CPU's GIC local register block. > + * > + * Delegate to the CM locking code in the multi-cluster case, since > + * other clusters can only be accessed using GCR_CL_REDIRECT. > + * > + * In the single cluster case we don't need to do anything; the caller > + * is responsible for maintaining gic_lock & nothing should be > + * expecting any particular value of GIC_VL_OTHER so we can leave it > + * as-is. > + */ > + if ((prev != -1) && mips_cps_multicluster_cpus()) > + mips_cm_unlock_other(); Huh. It now strikes me that if you exit the gic_with_next_online_cpu() early (with a 'break;', for example), the state machine breaks as you won't have performed the unlock... This definitely needs some documenting, at the very least. M. -- Without deviation from the norm, progress is not possible.