Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp207747imj; Thu, 14 Feb 2019 18:42:55 -0800 (PST) X-Google-Smtp-Source: AHgI3IbRU5Ft/nplGeQaCXkXp9GCsNXcA87h22bat6YgP9weqOPuazHwOn22Ls0TA1sEF7w8aqdz X-Received: by 2002:a17:902:a404:: with SMTP id p4mr7584942plq.148.1550198574970; Thu, 14 Feb 2019 18:42:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550198574; cv=none; d=google.com; s=arc-20160816; b=khTokcraoCGZFOadv1El7RZVdGSJQJP1kdlpfp1e1bsDOklxzSr3ZxzpmYN6auK+rW EjgMUmUXrsEbDaBAGN5dM/TPlpDDL91/hMvzhB5LO61noEK4Vn5flvzUKCraFuf4TTf6 /eOvl38ThGphg00I88qvGsmWQK/PCFL1IzRCTwoSd1oUg72LZOikdYq8x29k0ai0q0Bc NwIHjTDSeBurHzF3jnV/x+OtLcSQsrulZTy4a4v+7/FhxpWbDqGTNdhkZMk4uWXguycL WTT7X0tZuZG8hAZky1Mm4tUHJCm1ZsBF9z8q5Qqr3cJxtr1dBTnFL+VEgnAJF6duraM5 AolA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XOo9VIYx2n9EDlhAM0lmBJXZdRZj2F8dpg76VZ+HF9c=; b=IKaWBR6TSTUuVD9NW6BMPWuG72/ajEoEaW5teHMwUkG0sbnT+68yJTJkIPAonHiHAZ RGxegiQDZKGEZ8HjnBW/dLoOfMpsHcMru3+1Ttjk2WQbPfijDO6kTv+BEW2X+70a3W8y RYXIjckl9V8ycL+4U/ZBYxetEm4KUpX0B/vc9PJKDdBnEy3EtxPp2f2Np2wSTVsvHvQJ 5zFrRS+fHYwdifakLpwfOe5LEghfEP6zU76f/MzroqfvACK0UaVNnemJcTEacBXMD7BR B8Xa6pmYOby33oyhrSH2hHlbeyc7amHm/r4KYNVNJz6JXOp6vUW9jRffnjGXOhVqEoLi v/yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MJpQRtED; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6si3856792pgc.509.2019.02.14.18.42.38; Thu, 14 Feb 2019 18:42:54 -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; dkim=pass header.i=@kernel.org header.s=default header.b=MJpQRtED; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388239AbfBOCJf (ORCPT + 99 others); Thu, 14 Feb 2019 21:09:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:49708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387940AbfBOCJd (ORCPT ); Thu, 14 Feb 2019 21:09:33 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1F504222D4; Fri, 15 Feb 2019 02:09:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550196572; bh=FnN2b7tTqbakzSmyWd5wQwV4ibN1ySbrBIAZcvY/YHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MJpQRtEDP6/2EWZhDM/xtF4c+DrWcAYuTrbsTK6CrggQFBXUzkx5TN0A8JfcaIHpC uQVWZVuDSiQm/V7EQEV2Rp5Zbr3ossjDPVW2vkPtobrMQhiiwqII8rJ+sidN42ibZ/ t4PCwtrIXounoLF5mP9zhl7cgKE5+vbVfqCH2WgA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Srinivas Ramana , Thomas Gleixner , linux-arm-msm@vger.kernel.org, Sasha Levin Subject: [PATCH AUTOSEL 4.20 20/77] genirq: Make sure the initial affinity is not empty Date: Thu, 14 Feb 2019 21:07:58 -0500 Message-Id: <20190215020855.176727-20-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215020855.176727-1-sashal@kernel.org> References: <20190215020855.176727-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Ramana [ Upstream commit bddda606ec76550dd63592e32a6e87e7d32583f7 ] If all CPUs in the irq_default_affinity mask are offline when an interrupt is initialized then irq_setup_affinity() can set an empty affinity mask for a newly allocated interrupt. Fix this by falling back to cpu_online_mask in case the resulting affinity mask is zero. Signed-off-by: Srinivas Ramana Signed-off-by: Thomas Gleixner Cc: linux-arm-msm@vger.kernel.org Link: https://lkml.kernel.org/r/1545312957-8504-1-git-send-email-sramana@codeaurora.org Signed-off-by: Sasha Levin --- kernel/irq/manage.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 9dbdccab3b6a..5c0ba5ca5930 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -393,6 +393,9 @@ int irq_setup_affinity(struct irq_desc *desc) } cpumask_and(&mask, cpu_online_mask, set); + if (cpumask_empty(&mask)) + cpumask_copy(&mask, cpu_online_mask); + if (node != NUMA_NO_NODE) { const struct cpumask *nodemask = cpumask_of_node(node); -- 2.19.1