From patchwork Mon Sep 1 14:21:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 36366 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f200.google.com (mail-ig0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 26F3B2032B for ; Mon, 1 Sep 2014 14:22:06 +0000 (UTC) Received: by mail-ig0-f200.google.com with SMTP id uq10sf30347348igb.7 for ; Mon, 01 Sep 2014 07:22:05 -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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=t18iB82Gei63bmwOWxLfxdzmdVD8kWgGXyH5ycYMOsA=; b=Tm3i1zPY8j4s8/5Q7RNUtWNYKA1PWJ9ZXVBw+eu4QAljLSdH/lf8oTTE9nEZP5hf9n b9Fql5zVekbHd5C8IEzEyeVv0GWF0Sh1zk+g35FmNU7azX3uUxS5hwMLZHhZCjO7ih5c 8ghwHUVpHx7u1g9f84k659iXhS2nthQhF2hwwFNg+3NNEpmOifAc4f2lvOeD1LgX+Ctd YHfJ090U6Cr73+zurS2pkNlAfyQb+z572mdqmmd8xCjmEsPs2qbG5vATJFuUFhq1y8G1 Am+eYM31OlQixb+NmbTLA2nEQBT/wDF6V3hyb+NzZUZGM4WHevBv4zsoqSIRa9Upe5XA e5mw== X-Gm-Message-State: ALoCoQlp5pWUkXq6Sr+BFpLNucXO/Ep6SukXRsam+QjqjTCuwv8X1/lOeYsByjgVWHL8Y4e1O6vp X-Received: by 10.182.123.232 with SMTP id md8mr15157236obb.41.1409581325752; Mon, 01 Sep 2014 07:22:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.83.230 with SMTP id j93ls2025090qgd.40.gmail; Mon, 01 Sep 2014 07:22:05 -0700 (PDT) X-Received: by 10.52.238.227 with SMTP id vn3mr529513vdc.47.1409581325647; Mon, 01 Sep 2014 07:22:05 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id u2si490874vdx.36.2014.09.01.07.22.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Sep 2014 07:22:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id ij19so5655828vcb.3 for ; Mon, 01 Sep 2014 07:22:05 -0700 (PDT) X-Received: by 10.220.182.1 with SMTP id ca1mr25437742vcb.21.1409581325561; Mon, 01 Sep 2014 07:22:05 -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 uj3csp394844vcb; Mon, 1 Sep 2014 07:22:05 -0700 (PDT) X-Received: by 10.70.65.34 with SMTP id u2mr40344263pds.58.1409581324511; Mon, 01 Sep 2014 07:22:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ny4si1322349pdb.198.2014.09.01.07.21.53 for ; Mon, 01 Sep 2014 07:21:53 -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 S1752282AbaIAOVw (ORCPT + 1 other); Mon, 1 Sep 2014 10:21:52 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:50326 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751665AbaIAOVw (ORCPT ); Mon, 1 Sep 2014 10:21:52 -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 s81EL2VI016654; Mon, 1 Sep 2014 15:21:02 +0100 From: Sudeep Holla To: ALKML Cc: Sudeep Holla , Thomas Gleixner , Russell King , Mark Rutland , Subject: [PATCH v2] arm: use irq_set_affinity with force=false when migrating irqs Date: Mon, 1 Sep 2014 15:21:37 +0100 Message-Id: <1409581297-29216-1-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1409571966-18343-1-git-send-email-sudeep.holla@arm.com> References: <1409571966-18343-1-git-send-email-sudeep.holla@arm.com> 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.172 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 Since commit 1dbfa187dad ("ARM: irq migration: force migration off CPU going down") the ARM interrupt migration code on cpu offline calls irqchip.irq_set_affinity() with the argument force=true. At the point of this change the argument had no effect because it was not used by any interrupt chip driver and there was no semantics defined. This changed with commit 01f8fa4f01d8 ("genirq: Allow forcing cpu affinity of interrupts") which made the force argument useful to route interrupts to not yet online cpus without checking the target cpu against the cpu online mask. The following commit ffde1de64012 ("irqchip: gic: Support forced affinity setting") implemented this for the GIC interrupt controller. As a consequence the ARM cpu offline irq migration fails if CPU0 is offlined, because CPU0 is still set in the affinity mask and the validataion against cpu online mask is skipped to the force argument being true. The following first_cpu(mask) selection always selects CPU0 as the target. Solve the issue by calling irq_set_affinity() with force=false from the CPU offline irq migration code so the GIC driver validates the affinity mask against CPU online mask and therefore removes CPU0 from the possible target candidates. 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 Acked-by: Thomas Gleixner Cc: Russell King Cc: Mark Rutland Cc: # 3.10.x Acked-by: Mark Rutland --- arch/arm/kernel/irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Change v1->v2: - Updated the changelog to reflect the actual history behind this change as suggested by tglx and added his ack 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;