Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp973921imu; Thu, 20 Dec 2018 08:10:10 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wl6XIA1HE/oRJdwXaxVERNXFa2gCPVKDju+Arn8xI6Be9mcilijZYumeI94CF2zqj3GqRu X-Received: by 2002:a17:902:7c05:: with SMTP id x5mr24077941pll.273.1545322210231; Thu, 20 Dec 2018 08:10:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545322210; cv=none; d=google.com; s=arc-20160816; b=H85cDKcKci0gcBTP/0fFnW6xps7pNqd5f516ppVej20oAOi+h6j0ubysFmYcNVmwVX ytRpKCqdCJOy2A9SzMvUGHBJkPHWX0IMHjbarl5L+BHSVcWL/OlssYRGtmdob+oQ9BXK qeuUxtc2wJRynru3UVWJeHBm2KNWLJrJftH2eZLoCIWIH84PFx76BGkhJwQXHwZTIZvu aV3TZlwU3nGZRkYCA+1F05emJ6sLw0orTpb1q3HdGFJ0AjWArfLqyhGMtDiwCyeh6JfC djhdKY0UZ7soc2pHnQWPRUZDzRzTKApE67arUv9UP9jPgpFdXHo+zzmDzk2d0C9ruFgb r+5A== 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:cc:to:from :dmarc-filter:dkim-signature:dkim-signature; bh=5pi59woJEo21fapKkCaiZjqC3tCqiYRu/c4SINvkIUM=; b=QTj/hJKJSkKKMVsRff0N9WsUCfJMYgL4729bnypouNjBH1fnhj2u8EN8KUxoY4fRkn HJRE0cRmsQBXZYfaVIfpDTVty5R2SaAz8yYLQddyqe572P5khM7bbliUngSP1at38JjV +E2jBysEEtTExyGTwMPOcnpuxrV4/Fdj30c8nfCai8Gu//xRGNH+CfLQrIWh/MUixa0q DFQaXxg6LdLhNJGAXfjFCCMU3cGpSEXxUS3bxL+xJHhEev2xE+hKK7sDjMWbWtDOV0bS UcgDDmCYi+sIiZ4USed92CelUD4iPez35ADyfSxABfoKDVMkc7i19p4SD3ljzYtILrvY 6cTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=E08oEc4m; dkim=pass header.i=@codeaurora.org header.s=default header.b=kwNCDsah; 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 a16si18437892pls.146.2018.12.20.08.09.54; Thu, 20 Dec 2018 08:10:10 -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=@codeaurora.org header.s=default header.b=E08oEc4m; dkim=pass header.i=@codeaurora.org header.s=default header.b=kwNCDsah; 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 S1732620AbeLTNgO (ORCPT + 99 others); Thu, 20 Dec 2018 08:36:14 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:52732 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729096AbeLTNgN (ORCPT ); Thu, 20 Dec 2018 08:36:13 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 1D8F3601D7; Thu, 20 Dec 2018 13:36:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1545312973; bh=B0BoM2TW28FpQb4RXeKe07i8DAl6yuNefbtxdPYNu6A=; h=From:To:Cc:Subject:Date:From; b=E08oEc4mkgShzzLrs2uRsUrRCVXlxiliq7mMTvACoj1VF1HkVmR9VlI/tVle6rrDo prgL13T8HB4iWA5Qo/XSfAmm/R1JrH+Kx90grNoLPGklMx+4WOSQw27WVn1q8Ir7O0 EUiTouWsxMOSYjszaUlZNF8VrK9Bqb6CiUNYjVsE= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from sramana-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sramana@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 34D1F601D7; Thu, 20 Dec 2018 13:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1545312972; bh=B0BoM2TW28FpQb4RXeKe07i8DAl6yuNefbtxdPYNu6A=; h=From:To:Cc:Subject:Date:From; b=kwNCDsahrYffRWvB49sY6c9Yh+6yTGc+KpdUhf5vIdwP74FLUHoEhn481ta+f/SVz Gg1Xv40Untz9jjP2mAE9yKMn2+f6hSs6pXNmGVSgxOObhbrIo4sCTq2gPwrQOwBQH6 AiynJASZtcNNw5JlOxZvgU6STQ5GOuVjacw5L/iY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 34D1F601D7 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sramana@codeaurora.org From: Srinivas Ramana To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Srinivas Ramana Subject: [PATCH] genirq: Make sure the affinity to be set is not empty Date: Thu, 20 Dec 2018 19:05:57 +0530 Message-Id: <1545312957-8504-1-git-send-email-sramana@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the default_affinity is managed/initialized by a system and all the cpus present in irq_default_affinity are hotplugged out we may end up passing a cpumask of 0 to irq_do_set_affinity(). Fix this by falling back to cpu_online_mask in case the calculated affinity becomes zero. Signed-off-by: Srinivas Ramana --- 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); -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.