From nobody Mon Nov 25 12:41:36 2024 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E84921DF98E; Mon, 28 Oct 2024 17:59:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730138387; cv=none; b=Q6VtZu8n/PRX+lHbnDZLfeq/vSro9CWkexrD7D4MbZKmRGqpDQ2SXye2soWgnzV0iYK3pMvqykCwHF8f/b4JRoEO2C8aHGdDbpeG7fyRxP77vCb93HFW+9KFhn4PtRjolI0PIZY4e73rnm8PQyOie1Vs+OKDmugXhbJfaVSSGMQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730138387; c=relaxed/simple; bh=u6vvKO6ochcmouGVbVlP93MlD8ggXFRsMmANCvVfLCc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Q99O6C9bonWTLs4VILaUdIhvqeuxe3igt1U0P8ZUA6edA/cGHLEwF6SPtHQN35w+LnJGwZWVL5y+izfwINCPnmkxICI+zMJKSgaQyoe6c7mEzovpPZ6ztpv0Z2s3PmFm7ZJpUKp/1hQHgcGKZUeOwrIS1hivYUOWJbERkXrLlaA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PRtgT8iq; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PRtgT8iq" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a99ebb390a5so1039887066b.1; Mon, 28 Oct 2024 10:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730138383; x=1730743183; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZRX466fP4uw99H0/bcfPFf3v++c0P8v6HBEx3du66O8=; b=PRtgT8iqh9XWULEojznF7jDKWeDUylGLNus55NxD2tzTDCqtrNTvL83v4NPiNUBkL8 V0Q989QFPd2YF47GdH/w7aqHnZ8/Z0aehu1iOMOK12rAs8aKBdW857HiWU9+gld5GSjW QoczYjvZwcrtumpB3mULiEv885YcxqFTpJjHgdyvUqf3ngsJdC1qdlp+c6YEVEmh/fXc dsHpunjNVXRIWg9gCbjIYau01+HkI6OG6oe1nqbcz2Okccs1x/3xapSao98qJPZql5tb IajFuyIDsiBm/xt/zIzUi/DVueN7eAJ85JzPNECkW4S8VK9UvtCekV+DWmVUhw1DYXf4 WRWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730138383; x=1730743183; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZRX466fP4uw99H0/bcfPFf3v++c0P8v6HBEx3du66O8=; b=vjn+jMBgAgpkqEWAcERMXBPyWxatrxbaFv7hqinWQwHVhKwuYSD1YF5laQhmonhwuL JRhUbfanNSvBs2pG4IOzss8HPJgdMPH1ureEQU0PBmQ6TeUmpJZItc7+TGGBKziwVsTZ JJIQK8OEantSDLRsyvtSSllRuomTmkDsNCGr+RQqdIp6MiHtBe1q8zAklVTy8Riry7CZ GXUgP58Tu6fBDZD3TGsCtYB29+sTL55+bteoHWbH6ovDGFCWdM0zdJIgHmld5zwXo0Ww cPboG+ig2E7MmU0kPhBunKopuctV6+J5agJPEXKK/OIEZhQbwwXFbt7+IPzjlfAf3Kh+ fkBQ== X-Forwarded-Encrypted: i=1; AJvYcCUlK0JqfgLtAOGppqpA6nP19qIzyo8A2kMgXrcS/giEoQ/qPrxvbvI30INFlUjvA/hX7teYBeflgo+5HbSx@vger.kernel.org, AJvYcCWf0Uv9VToDsbiNA1msWYCV2l2QTvqKIxfyjx5UJqpNMUdr144KtU/T8cLLxr/orQSjwAeNAb3fvCCmPg==@vger.kernel.org, AJvYcCXAAq8K6MDzwspZ/ARR5vPa6c4uTxN2Zems4/gBFQaQ2jhciP56A3Zr4mUBC3XSPLaF/5gPIcE9SXs6@vger.kernel.org X-Gm-Message-State: AOJu0Yxd3VQF5fbIY/Za0SkP70KesrN2hUlYe0oXpBYnj63IMt7sPGTX 3tR+WxAokDYffHKQaHq9ITxLDGmDvYHbzanwYINwt2Ut75EM2AcL X-Google-Smtp-Source: AGHT+IEOK7cSDa5E6xpn6lKVUU6dFZoleezY5QuGa3zJzk33nx+xsdhMG009sH1i/o6gzfQwQ3WZOA== X-Received: by 2002:a17:907:3d91:b0:a91:1699:f8eb with SMTP id a640c23a62f3a-a9e22ae20f7mr39162966b.28.1730138383015; Mon, 28 Oct 2024 10:59:43 -0700 (PDT) Received: from localhost.localdomain ([79.175.114.8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9b1dfbdfe2sm396990766b.36.2024.10.28.10.59.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 10:59:42 -0700 (PDT) From: Aleksandar Rikalo To: Thomas Bogendoerfer Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vladimir Kondratiev , Gregory CLEMENT , Theo Lebrun , Arnd Bergmann , devicetree@vger.kernel.org, Djordje Todorovic , 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, Marc Zyngier , Paul Burton , Peter Zijlstra , Serge Semin , Tiezhu Yang , Aleksandar Rikalo Subject: [PATCH v8 02/13] irqchip/mips-gic: Support multi-cluster in for_each_online_cpu_gic() Date: Mon, 28 Oct 2024 18:59:24 +0100 Message-Id: <20241028175935.51250-3-arikalo@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241028175935.51250-1-arikalo@gmail.com> References: <20241028175935.51250-1-arikalo@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Paul Burton Use CM's GCR_CL_REDIRECT register to access registers in remote clusters, so 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 Signed-off-by: Aleksandar Rikalo Tested-by: Serge Semin Tested-by: Gregory CLEMENT --- drivers/irqchip/irq-mips-gic.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c index 6c7a7d2f0438..29bdfdce2123 100644 --- a/drivers/irqchip/irq-mips-gic.c +++ b/drivers/irqchip/irq-mips-gic.c @@ -88,6 +88,12 @@ static int __gic_with_next_online_cpu(int prev) return cpu; } =20 +static inline void gic_unlock_cluster(void) +{ + if (mips_cps_multicluster_cpus()) + mips_cm_unlock_other(); +} + /** * for_each_online_cpu_gic() - Iterate over online CPUs, access local regi= sters * @cpu: An integer variable to hold the current CPU number @@ -102,6 +108,7 @@ static int __gic_with_next_online_cpu(int prev) guard(raw_spinlock_irqsave)(gic_lock); \ for ((cpu) =3D __gic_with_next_online_cpu(-1); \ (cpu) < nr_cpu_ids; \ + gic_unlock_cluster(), \ (cpu) =3D __gic_with_next_online_cpu(cpu)) =20 static void gic_clear_pcpu_masks(unsigned int intr) --=20 2.25.1