From patchwork Thu Dec 20 13:35:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Ramana X-Patchwork-Id: 10738895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3323B161F for ; Thu, 20 Dec 2018 13:36:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D1BC288AE for ; Thu, 20 Dec 2018 13:36:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11418288B9; Thu, 20 Dec 2018 13:36:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1F8B288AE for ; Thu, 20 Dec 2018 13:36:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732176AbeLTNgN (ORCPT ); Thu, 20 Dec 2018 08:36:13 -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= 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-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);