From patchwork Mon Mar 20 16:36:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasad Sodagudi X-Patchwork-Id: 9634517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0CBD060132 for ; Mon, 20 Mar 2017 16:37:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0AFD23B23 for ; Mon, 20 Mar 2017 16:37:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1EA726E4C; Mon, 20 Mar 2017 16:37: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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 66C8723B23 for ; Mon, 20 Mar 2017 16:37:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=9MCOECY0Gp62yJ1URWDU9oubEpfvVaoQy295a1IQ6xA=; b=JaSgPoWpSmk0MfbMH/H8Q7jQ3k MohuE/IVh8Ja8Vla3NdXK7lIjtnMVQOsRdpNQ4z6mJ34NM0teCO7MUeiQpABMzhS5pZsddA8ex+Bv ChQ8pL3sgdvrZoDn/89sPOg1rk1MvFoY9k5nw8b57yXO964xM/VvaOfoPl75PgFd4teWi+GYq7R5B Vx6W1/sl4RKefKvY3uuj1He2y8xUDF0lSnQRhy0wzP32oJSzIt0UMRcdBqyticzSv0Ti3k7af9enJ gI4hDfcnJhEqF3ubxxpUIXxM47L2zDMEHU1rKb1isEurnZtZpC2kuVQUnnb94Ce/B0oRkR5krW5Ui eRGiWwAw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cq0Iy-0002dB-Qp; Mon, 20 Mar 2017 16:37:12 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cq0Ig-0002K5-F9 for linux-arm-kernel@lists.infradead.org; Mon, 20 Mar 2017 16:36:57 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4656A602B8; Mon, 20 Mar 2017 16:36:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1490027795; bh=hACzlzRfd/4jqI0O3EoL2Vgnw8uA0YCdx9vVa23rt84=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=npRAXBRE2Y4RrHWO8ciFPHy/Mq6nc8UtTXMmP3dhVJBvj+AA97NmTdm6ATmSW27N5 6sr5mAyAFzV9ercfCWGVnBTiL0QV2t6uBq6Cjd4SASwH6m6ZNLrQ4rFnMQ7QHh1FfS EzR1ZEbRA6kMl33PLRAohPLZgCaUDkkyRsT5Kqn4= Received: from psodagud-linux1.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: psodagud@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2D0BF602B8; Mon, 20 Mar 2017 16:36:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1490027794; bh=hACzlzRfd/4jqI0O3EoL2Vgnw8uA0YCdx9vVa23rt84=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CGrgXR0f7ghla+3/UftCJVIzZ56AKKqWq2Ln11DxYPXuCXTuK/nc47CWcxzB0eoDW U2fxYp+AxMvUp4e15htRGgwn+XDv/rcCtRgds6IofUnwXd/nxVmjsvJosRDONjkl4O a6BIcvOZQ1BqT2vqPe10W6fY6jjKzlM5eX+eeWLU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2D0BF602B8 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=psodagud@codeaurora.org From: Prasad Sodagudi To: tglx@linutronix.de Subject: [PATCH] genirq: Notify clients whenever there is change in affinity Date: Mon, 20 Mar 2017 09:36:17 -0700 Message-Id: <1490027777-29130-2-git-send-email-psodagud@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1490027777-29130-1-git-send-email-psodagud@codeaurora.org> References: <1490027777-29130-1-git-send-email-psodagud@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170320_093654_702522_4CE27AEA X-CRM114-Status: GOOD ( 14.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, james.morse@arm.com, Prasad Sodagudi , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP During the cpu hotplug, irq are getting migrated from hotplugging core but not getting notitfied to client drivers. So add parameter to irq_do_set_affinity(), to check and notify client drivers during the cpu hotplug. Signed-off-by: Prasad Sodagudi --- kernel/irq/cpuhotplug.c | 2 +- kernel/irq/internals.h | 2 +- kernel/irq/manage.c | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c index 011f8c4..e293d9b 100644 --- a/kernel/irq/cpuhotplug.c +++ b/kernel/irq/cpuhotplug.c @@ -38,7 +38,7 @@ static bool migrate_one_irq(struct irq_desc *desc) if (!c->irq_set_affinity) { pr_debug("IRQ%u: unable to set affinity\n", d->irq); } else { - int r = irq_do_set_affinity(d, affinity, false); + int r = irq_do_set_affinity(d, affinity, false, true); if (r) pr_warn_ratelimited("IRQ%u: set affinity failed(%d).\n", d->irq, r); diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h index bc226e7..6abde48 100644 --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h @@ -114,7 +114,7 @@ static inline void unregister_handler_proc(unsigned int irq, extern void irq_set_thread_affinity(struct irq_desc *desc); extern int irq_do_set_affinity(struct irq_data *data, - const struct cpumask *dest, bool force); + const struct cpumask *dest, bool force, bool notify); /* Inline functions for support of irq chips on slow busses */ static inline void chip_bus_lock(struct irq_desc *desc) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index a4afe5c..fea8c8e 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -197,7 +197,7 @@ static inline bool irq_move_pending(struct irq_data *data) #endif int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask, - bool force) + bool force, bool notify) { struct irq_desc *desc = irq_data_to_desc(data); struct irq_chip *chip = irq_data_get_irq_chip(data); @@ -209,6 +209,9 @@ int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask, case IRQ_SET_MASK_OK_DONE: cpumask_copy(desc->irq_common_data.affinity, mask); case IRQ_SET_MASK_OK_NOCOPY: + if (notify && desc->affinity_notify) + schedule_work(&desc->affinity_notify->work); + irq_set_thread_affinity(desc); ret = 0; } @@ -227,7 +230,7 @@ int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask, return -EINVAL; if (irq_can_move_pcntxt(data)) { - ret = irq_do_set_affinity(data, mask, force); + ret = irq_do_set_affinity(data, mask, force, false); } else { irqd_set_move_pending(data); irq_copy_pending(desc, mask); @@ -375,7 +378,7 @@ static int setup_affinity(struct irq_desc *desc, struct cpumask *mask) if (cpumask_intersects(mask, nodemask)) cpumask_and(mask, mask, nodemask); } - irq_do_set_affinity(&desc->irq_data, mask, false); + irq_do_set_affinity(&desc->irq_data, mask, false, true); return 0; } #else