Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1913114pxb; Mon, 22 Feb 2021 14:33:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlNuWTbAQWLwoOJ6y2ltqN/LMSLnA/9cC6A5xbxxQlWAdzPWVl/fvoYidfIc6sfb5MZYXx X-Received: by 2002:aa7:c58a:: with SMTP id g10mr22311399edq.243.1614033224922; Mon, 22 Feb 2021 14:33:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614033224; cv=none; d=google.com; s=arc-20160816; b=C2xX+4PGOYsUjXtkPWPPI9yCs3r9+edScnGWuOxavVnDPCuUs+ZQ4KKfSDH0ACd3sI tARZdv5Pjc6ufQHA/XZhIYEMxnn73dlHoubQbau4XpCG56lWTtk8FFtu0NpTUNEoXIvh pwdATLkgn/NsuW+NTtjAVOPr3GjH0A2NxR/5Xu3oXYgW9b2AdHvV6z5HHlpa+/Wk4IV7 XgTjtYTCCqpMbT6iYFHthx8mRBkLx0z6rFyFkJ01PzuSuQ215NwIW4V0mlpjGM5e289Z y8gz7MwBq+VsIJi2sFxJOOjRFlKN7szgo76dYL3eVdnoKk1U9AvcsDxQ14Z5AFJGvJ+V f9dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=N1THKtV2zIVCWufgt+M4ifL17ZkPeASTyRAQBJ1PEQ0=; b=h5HnvhUI+iZ44SLADLbDYOlFl1USjCcVgLf5Ywv+mhu3zZY4XBPLwlTd6XJ1mSSmP1 +MYF11+1gGbxhouL4gyHsIt4YEHfjNmrW5tvWvQjuEqtn12q5hyXCNptzsXxLYcyzBGq yBAlNB5CCRXsk6yDrlYXwsho4zhyIJeToVeUpPemNtICQw3TA4ax0F+bDjU0Pgc4pWs4 t898z1rHYpBQSbXNznXaUNGB1pgxzmYlGZzpkeMzPZIKQs1e4Q5UvSMACv86R4TZkv78 1MsvIHU9/CleLrKye+GvlttnaRDGnl8Tf6VQvr6IX9jDgBrPFoUhKvpMnmbwMDbhk63B Nkvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FX7g0fWo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du19si11725391ejc.206.2021.02.22.14.33.21; Mon, 22 Feb 2021 14:33:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FX7g0fWo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231215AbhBVUOe (ORCPT + 99 others); Mon, 22 Feb 2021 15:14:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230194AbhBVUOV (ORCPT ); Mon, 22 Feb 2021 15:14:21 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD3E2C06174A; Mon, 22 Feb 2021 12:13:40 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id o82so423927wme.1; Mon, 22 Feb 2021 12:13:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=N1THKtV2zIVCWufgt+M4ifL17ZkPeASTyRAQBJ1PEQ0=; b=FX7g0fWoAMMAkmGyFCW1xGtTYun5JQPB38Y+u9Sd6XsJfdWoDykhWWYVYjYZXffG27 j3o2IGFqg01a4BgRnLAd+jZCQ+liCm/2K7RgCJus7nvTXmUmNZkXz5EM6JhJoqVnz7oY FJTsK2/dtz6Md9M50HoC6I1Tz3AwEJNuWCja1CtsCfm2hiMe8Z6wTTzJXzC89AlJq3OB smdQwvXqc8tsqgU5iSQku9AF5ROZMWhOaEnFOf33jd80F+kdSXlTZIeEcZFgIesQrqDf gHXZYKjLopM9hC+RliHPnyiShxY0KyNkXgZIL/5Xl3R40fmJGKbb0dfr+tjXjBia5CVa vn8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=N1THKtV2zIVCWufgt+M4ifL17ZkPeASTyRAQBJ1PEQ0=; b=sYlViScmRk+kkb3DyRf0rMPJFSjlPZvCu6u7SqidbmvygND41PmecLV0B71RSFzmRs 2epsEWuey5l3qqaN1qLwggZyJRF4SVsPwPn3VEi26u9MftNk7DyLrrsJtOLGl9d3TFXP X74CdV31gGIchk/ylh2B2Fu9oCRXslyzy7nd3cm9RXcFPHFrv/A6pQsGyzaRBk6qnTqp nYOgX1cKTccgFbmfDWfKaXE4u/QcfGwnzPFPO0vGt+7z9lwMRz5yhOBRdUdsXlYjjtll qVFZXE7TyayaEsn7o7X7OiwT9qHq+feugNtJpu+wg7Z6Knvm1R5zPpF7afOv3fc4i2+E qRvA== X-Gm-Message-State: AOAM532/dghCguPSpO6/4odmg2ULdYF7d3zkZUK+mWV0D08z6mm6nRrb 6S2w1KIlAclxUGq/Yc3MzCo= X-Received: by 2002:a05:600c:4fd5:: with SMTP id o21mr21217669wmq.20.1614024818782; Mon, 22 Feb 2021 12:13:38 -0800 (PST) Received: from skynet.lan (170.red-88-1-105.dynamicip.rima-tde.net. [88.1.105.170]) by smtp.gmail.com with ESMTPSA id h17sm21619818wrw.74.2021.02.22.12.13.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Feb 2021 12:13:38 -0800 (PST) From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= To: jonas.gorski@gmail.com, Florian Fainelli , Thomas Gleixner , Marc Zyngier , bcm-kernel-feedback-list@broadcom.com, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Subject: [PATCH] irqchip/bcm-6345-l1: fix SMP support Date: Mon, 22 Feb 2021 21:13:32 +0100 Message-Id: <20210222201332.30253-1-noltari@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some BCM6358 devices start with Core #1 instead of Core #0. Apart from that, SMP is restricted to 1 CPU since BCM6358 has a shared TLB, which makes it impossible for the current SMP support to start both CPUs. The problem is that smp_processor_id() returns 0 and then cpu_logical_map() converts that to 1, which accesses an uninitialized position of intc->cpus[], resulting in a kernel panic. Signed-off-by: Álvaro Fernández Rojas --- drivers/irqchip/irq-bcm6345-l1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-bcm6345-l1.c b/drivers/irqchip/irq-bcm6345-l1.c index e3483789f4df..b2173ce4743d 100644 --- a/drivers/irqchip/irq-bcm6345-l1.c +++ b/drivers/irqchip/irq-bcm6345-l1.c @@ -121,7 +121,7 @@ static void bcm6345_l1_irq_handle(struct irq_desc *desc) unsigned int idx; #ifdef CONFIG_SMP - cpu = intc->cpus[cpu_logical_map(smp_processor_id())]; + cpu = intc->cpus[smp_processor_id()]; #else cpu = intc->cpus[0]; #endif -- 2.20.1