From patchwork Mon Sep 1 11:46:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 36348 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A1CF220792 for ; Mon, 1 Sep 2014 11:46:12 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id s7sf17288461qap.2 for ; Mon, 01 Sep 2014 04:46:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=t7ZXW0F6vjnADg4CJC+gsFAwCEOt0P7wdtTk0klHTes=; b=XdvAGnOG/OzNGBSq32XSZhnOSa0FMyCVo+grsflfIsuUVid/4tsyWsYFs1EnSIRZFS xXGaAwC7BTTVqPyYy7guH757NgazUpjzME/5zXt95w8jaChHP/HJar1XFIYuWtZnUZZd 9/ml+N70jSSd2hHTxRSXs2kNUm+OKp46B8nT46f2Mtx+Y+9k90ssPA2U4FkZha18pnMh 9CVeZmdVBNCGyf9KEkbZJY5vvPyoe8uXEImz9Jf9qa7/qXNmqTXUM/eRoeCB42zUhCVN xIvABXGG6ZGWSxhJqWiUWui7mMsnMnCo8dH8fWbrunYoyMSOFKF6l1FTlgrMe9ZQtUBt vtAw== X-Gm-Message-State: ALoCoQkEr0gb5Ve3Uy/XIASrAoVfWppBgrfZWB4rSWHNjok8Nexeo38yOmA6wbweuNuYM3oF5DFA X-Received: by 10.236.191.37 with SMTP id f25mr15244547yhn.44.1409571972502; Mon, 01 Sep 2014 04:46:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.40 with SMTP id y37ls1987519qgd.2.gmail; Mon, 01 Sep 2014 04:46:12 -0700 (PDT) X-Received: by 10.220.118.136 with SMTP id v8mr83842vcq.50.1409571972426; Mon, 01 Sep 2014 04:46:12 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id e14si199750vcv.56.2014.09.01.04.46.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Sep 2014 04:46:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id hq11so5360567vcb.36 for ; Mon, 01 Sep 2014 04:46:12 -0700 (PDT) X-Received: by 10.52.138.210 with SMTP id qs18mr1115145vdb.18.1409571972337; Mon, 01 Sep 2014 04:46:12 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp375156vcb; Mon, 1 Sep 2014 04:46:11 -0700 (PDT) X-Received: by 10.66.251.195 with SMTP id zm3mr8774773pac.78.1409571971472; Mon, 01 Sep 2014 04:46:11 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ot5si801685pbc.165.2014.09.01.04.46.10 for ; Mon, 01 Sep 2014 04:46:11 -0700 (PDT) Received-SPF: none (google.com: stable-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752311AbaIALqK (ORCPT + 1 other); Mon, 1 Sep 2014 07:46:10 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:52829 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751500AbaIALqJ (ORCPT ); Mon, 1 Sep 2014 07:46:09 -0400 Received: from e103737-lin.cambridge.arm.com (e103737-lin.cambridge.arm.com [10.1.207.61]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id s81BjRjU025951; Mon, 1 Sep 2014 12:45:27 +0100 From: Sudeep Holla To: ALKML Cc: Sudeep Holla , Russell King , Thomas Gleixner , Mark Rutland , Subject: [PATCH] arm: use irq_set_affinity with force=false when migrating irqs Date: Mon, 1 Sep 2014 12:46:06 +0100 Message-Id: <1409571966-18343-1-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 1.8.3.2 Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sudeep.holla@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Sudeep Holla Commit 01f8fa4f01d8("genirq: Allow forcing cpu affinity of interrupts") enabled the forced irq_set_affinity which previously refused to route an interrupt to an offline cpu. Commit ffde1de64012("irqchip: Gic: Support forced affinity setting") implements this force logic and disables the cpu online check for GIC interrupt controller. When __cpu_disable calls migrate_irqs, it disables the current cpu in cpu_online_mask and uses forced irq_set_affinity to migrate the IRQs away from the cpu but passes affinity mask with the cpu being offlined also included in it. If irq_set_affinity is called with force=true in a cpu hotplug path, the caller must ensure that the cpu being offlined is not present in the affinity mask or it may be selected as the target CPU, leading to the interrupt not being migrated. This patch fixes the issue by calling irq_set_affinity with force=false so that cpu_online_mask is checked while setting the affinity in the cpu hotplug path. Tested on TC2 hotpluging CPU0 in and out. Without this patch the system locks up as the IRQs are not migrated away from CPU0. Signed-off-by: Sudeep Holla Cc: Russell King Cc: Thomas Gleixner Cc: Mark Rutland Cc: # 3.10.x Acked-by: Thomas Gleixner --- arch/arm/kernel/irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Hi Russell, If you or tglx has no objections to this patch, I will put it in your patch tracker. Regards, Sudeep diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index 2c4257604513..5c4d38e32a51 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c @@ -175,7 +175,7 @@ static bool migrate_one_irq(struct irq_desc *desc) c = irq_data_get_irq_chip(d); if (!c->irq_set_affinity) pr_debug("IRQ%u: unable to set affinity\n", d->irq); - else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && ret) + else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret) cpumask_copy(d->affinity, affinity); return ret;