From patchwork Mon Oct 13 13:49:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 38653 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C321A20CC8 for ; Mon, 13 Oct 2014 13:51:47 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id q1sf4230834lam.0 for ; Mon, 13 Oct 2014 06:51:46 -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=9rN3tFqXFgi7Jog9KJij1frC5lq3jGnosAHyau+9KwI=; b=g6XcEHSw7xzFmWlywW2lnfO5M/XffCI+C1SLvJcB4ERx3wO9Jyim2pOENcFHcyU+ST +U6VvEsRyRj9fMVYATx7Ncgz6oUmjUvwu+dfypxJvvy4uHQnqEESbXYkszoB5imVCTP2 1tgzcR194nxxaQxPq89+jhTUWZs24yRef2RvChYdVszDeoAiAXKTCB0UVNvok+T4soBX PaTfQoFZN5BrylUQj6Pt5Zo/1qq2myEg+KjrkR/pqvwfnODIOsufKlnrOEnZvyjG9SHN lBPhSpMC5VfU3tEk3y06+kHeRel3cwgyfD3E8Qm+a4cnHT0Ugs7cJ9SHwlrJTkvAxPsa 3PEg== X-Gm-Message-State: ALoCoQkWfXWmu1mqp1E3LKkydmYKXX7hAa92cV96FoGMqSjjeLt7vOtPz/T8OC98ujb/zn67rVPz X-Received: by 10.112.189.69 with SMTP id gg5mr53145lbc.14.1413208306568; Mon, 13 Oct 2014 06:51:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.230 with SMTP id kt6ls36101lac.36.gmail; Mon, 13 Oct 2014 06:51:46 -0700 (PDT) X-Received: by 10.112.54.196 with SMTP id l4mr3543821lbp.85.1413208306498; Mon, 13 Oct 2014 06:51:46 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) by mx.google.com with ESMTPS id lj3si14984644lab.112.2014.10.13.06.51.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Oct 2014 06:51:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by mail-lb0-f172.google.com with SMTP id b6so6484485lbj.31 for ; Mon, 13 Oct 2014 06:51:46 -0700 (PDT) X-Received: by 10.112.14.34 with SMTP id m2mr23702257lbc.74.1413208306424; Mon, 13 Oct 2014 06:51:46 -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.112.84.229 with SMTP id c5csp217769lbz; Mon, 13 Oct 2014 06:51:45 -0700 (PDT) X-Received: by 10.68.216.102 with SMTP id op6mr24048624pbc.1.1413208263154; Mon, 13 Oct 2014 06:51:03 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si10368565pat.185.2014.10.13.06.51.02 for ; Mon, 13 Oct 2014 06:51:03 -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 S1754844AbaJMNu7 (ORCPT + 1 other); Mon, 13 Oct 2014 09:50:59 -0400 Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:57355 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754846AbaJMNuM (ORCPT ); Mon, 13 Oct 2014 09:50:12 -0400 Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.83) (envelope-from ) id 1Xdg0g-0003uB-EJ; Mon, 13 Oct 2014 15:50:02 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: Sudeep Holla , Russell King , Jiri Slaby Subject: [patch added to the 3.12 stable tree] ARM: 8133/1: use irq_set_affinity with force=false when migrating irqs Date: Mon, 13 Oct 2014 15:49:35 +0200 Message-Id: <1413208201-14602-64-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1413208201-14602-1-git-send-email-jslaby@suse.cz> References: <1413208201-14602-1-git-send-email-jslaby@suse.cz> 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: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.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 This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== commit a040803a9d6b8c1876d3487a5cb69602ebcbb82c upstream. 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 Acked-by: Mark Rutland Signed-off-by: Russell King Signed-off-by: Jiri Slaby --- arch/arm/kernel/irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index 9723d17b8f38..1e782bdeee49 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c @@ -163,7 +163,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;