Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp394782ybc; Tue, 19 Nov 2019 03:11:29 -0800 (PST) X-Google-Smtp-Source: APXvYqwEd+1GsEhjCeeOCpZpBCScljccG6pBEmjgmLXNIN8aSQGWcdm7AGKGJ7kwoUgkMKjD3e9q X-Received: by 2002:a17:906:7f8a:: with SMTP id f10mr35281395ejr.209.1574161889610; Tue, 19 Nov 2019 03:11:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574161889; cv=none; d=google.com; s=arc-20160816; b=SoFug4wUguVuB+S7wpyCFDztP2ihYykakB13YvvGhWNv2htIp8HvycPAb7cNw1kpr5 LIxJJaBKnauR7kl3KXmOBrkCUM0CbgVeIEBKUBdWYo/Ola0XD4R+dUbLo7D9FhAzyeyS lZ4Bcr53YzBI94wLht0vcAbV11v2s6KCBzmRrWEWLyMEDOIOcxex9O4tQfapJSuidU8a +uSAVyZJy+m0sempQBIvEJLxKvqa42Hrf88qa/9zG88dau7ynWnzCALzW30qlwHdPWPn C3BmrRkfgslrS4YZxq0lxdT6lCibo42bfS28wfIoyZVREYkhMOeDnKc/CzPqE9W8Vm8m wXDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from; bh=yk6nv4fA/o2OzQrd5pLPmIgnknXby5Y6+TumqwUSmTk=; b=NxMgrNUvl4UBorp1PWOqDn1+xPxE2je4Mk00D2GF8J0klYYg38+jLBcMYGOp7iYFgn 4QKCb6EyYmf+FDfJnCWZzrobv7vtGFAl/LgbxsVavQa8omXmxMXcSDqUu5R2Ap+/HOdR BQ693Yk/WSkrOxN09T4IUuB/il7hxZDWO4Xo1b3N4oBVCws8nBpziypXM9QWtg1qXyXh Su5r7ciqdw5TRxVFKrOiDVjoYTI9HqpwjTZn+0ZQi6JxAhuHh/C/68V1uWXdmpmlXq6D qYx3XYuPP5fCwTP74ZCno2tUIPGoOpxKN3IoL7NfC65cqEJulhJe2+5RZbIpZZBhT96P LZMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q44si15683510eda.242.2019.11.19.03.11.04; Tue, 19 Nov 2019 03:11:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727504AbfKSLJG (ORCPT + 99 others); Tue, 19 Nov 2019 06:09:06 -0500 Received: from mx2.suse.de ([195.135.220.15]:53464 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725798AbfKSLJG (ORCPT ); Tue, 19 Nov 2019 06:09:06 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6B7A7B487; Tue, 19 Nov 2019 11:09:04 +0000 (UTC) From: Thomas Bogendoerfer To: Ralf Baechle , Paul Burton , James Hogan , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] MIPS: SGI-IP27: Fix crash, when CPUs are disabled via nr_cpus parameter Date: Tue, 19 Nov 2019 12:08:56 +0100 Message-Id: <20191119110857.28540-1-tbogendoerfer@suse.de> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If number of CPUs are limited by the kernel commandline parameter nr_cpus assignment of interrupts accourding to numa rules might not be possibe. As a fallback use one of the online CPUs as interrupt destination. Fixes: 69a07a41d908 ("MIPS: SGI-IP27: rework HUB interrupts") Signed-off-by: Thomas Bogendoerfer --- arch/mips/sgi-ip27/ip27-irq.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c index 5aef06e28a5b..c72ae330ea93 100644 --- a/arch/mips/sgi-ip27/ip27-irq.c +++ b/arch/mips/sgi-ip27/ip27-irq.c @@ -73,6 +73,9 @@ static void setup_hub_mask(struct hub_irq_data *hd, const struct cpumask *mask) int cpu; cpu = cpumask_first_and(mask, cpu_online_mask); + if (cpu >= nr_cpu_ids) + cpu = cpumask_any(cpu_online_mask); + nasid = cpu_to_node(cpu); hd->cpu = cpu; if (!cputoslice(cpu)) { @@ -139,6 +142,7 @@ static int hub_domain_alloc(struct irq_domain *domain, unsigned int virq, /* use CPU connected to nearest hub */ hub = hub_data(info->nasid); setup_hub_mask(hd, &hub->h_cpus); + info->nasid = cpu_to_node(hd->cpu); /* Make sure it's not already pending when we connect it. */ REMOTE_HUB_CLR_INTR(info->nasid, swlevel); -- 2.16.4