From patchwork Sat Aug 29 13:07:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 7095171 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 13EE39F358 for ; Sat, 29 Aug 2015 13:10:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 37CC4208D2 for ; Sat, 29 Aug 2015 13:10:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5AFE620798 for ; Sat, 29 Aug 2015 13:10:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZVfsN-00034J-5J; Sat, 29 Aug 2015 13:08:55 +0000 Received: from szxga01-in.huawei.com ([58.251.152.64]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZVfsJ-00030f-7Y for linux-arm-kernel@lists.infradead.org; Sat, 29 Aug 2015 13:08:53 +0000 Received: from 172.24.1.51 (EHLO lggeml426-hub.china.huawei.com) ([172.24.1.51]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CUA19095; Sat, 29 Aug 2015 21:07:24 +0800 (CST) Received: from [127.0.0.1] (10.177.19.219) by lggeml426-hub.china.huawei.com (10.72.61.36) with Microsoft SMTP Server id 14.3.235.1; Sat, 29 Aug 2015 21:07:18 +0800 To: From: Yang Yingliang Subject: [PATCH] ARM: fix a migrating irq bug when hotplug cpu Message-ID: <55E1AE85.20500@huawei.com> Date: Sat, 29 Aug 2015 21:07:17 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 X-Originating-IP: [10.177.19.219] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150829_060852_280707_3A43BA91 X-CRM114-Status: GOOD ( 11.48 ) X-Spam-Score: -5.2 (-----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Russell King - ARM Linux , Marc Zyngier , Will Deacon , linux-kernel@vger.kernel.org, Thomas Gleixner , Jiang Liu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yang Yingliang When cpu is disabled, all irqs will be migratged to another cpu. In some cases, a new affinity is different, it needed to be coppied to irq's affinity. But if the type of irq is LPI, it's affinity will not be coppied because of irq_set_affinity's return value. So copy the affinity, when the return value is IRQ_SET_MASK_OK_DONE. Cc: Jiang Liu Cc: Thomas Gleixner Cc: Marc Zyngier Cc: Mark Rutland Cc: Will Deacon Cc: Russell King - ARM Linux --- arch/arm/kernel/irq.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) } diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index 350f188..32f2140 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c @@ -157,10 +157,13 @@ static bool migrate_one_irq(struct irq_desc *desc) } c = irq_data_get_irq_chip(d); - if (!c->irq_set_affinity) + if (!c->irq_set_affinity) { pr_debug("IRQ%u: unable to set affinity\n", d->irq); - else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret) - cpumask_copy(d->affinity, affinity); + } else { + int r = c->irq_set_affinity(d, affinity, false); + if ((r == IRQ_SET_MASK_OK || r == IRQ_SET_MASK_OK_DONE) && ret) + cpumask_copy(d->affinity, affinity); + } return ret;