From patchwork Fri Oct 17 08:09:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 38844 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 67E5A20C5D for ; Fri, 17 Oct 2014 08:14:27 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id w7sf181243lbi.2 for ; Fri, 17 Oct 2014 01:14:26 -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: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=x8ccXiRIgT68tAUjxR9oynGT6JV7MtxaDn1lWPJlzkE=; b=ct3QJa7siBFF/LygCz0QHO+wwxYplmXzAeXrR+q4EWb6e/4xalx6Qt64A8rLv1XCvD 39J+KfdS5U42auGnYfg9pNM0w3Zra5C8w6hRowjrRzysbUSFf4Ny/pXuujJoAQ6TYcIP nt84Mw1syn1DQEv7nn5bUTbgBJquE129UrtsiXxUxK7FnxRyWVcuvRkPd3tmYKWXS+mO BKW2aO2ir3I9vCTKBZNoxgQm1VWNiYfnnbE7KhUhrRWpssRtsEA1MY/JLBaQh0HtR+6l iOa54tp3dncL8RgJy8V3s47/93SDgRv1lBbCKpx7EzrO9++hnffSzgmTBtdLLc5VlkUn A7vw== X-Gm-Message-State: ALoCoQkogcDotcH/yxzoqk4AqdWREEmWDBb8Ay6iTPxYkBuwF5YQipTgvLGCBw2za7fZ4geV/ZEz X-Received: by 10.194.206.10 with SMTP id lk10mr1095517wjc.3.1413533666265; Fri, 17 Oct 2014 01:14:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.39 with SMTP id y7ls238099lag.0.gmail; Fri, 17 Oct 2014 01:14:26 -0700 (PDT) X-Received: by 10.152.120.73 with SMTP id la9mr7001284lab.23.1413533666027; Fri, 17 Oct 2014 01:14:26 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id tn9si880856lbb.72.2014.10.17.01.14.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 01:14:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id pv20so256734lab.34 for ; Fri, 17 Oct 2014 01:14:25 -0700 (PDT) X-Received: by 10.152.6.228 with SMTP id e4mr6932727laa.71.1413533665948; Fri, 17 Oct 2014 01:14:25 -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 c5csp184351lbz; Fri, 17 Oct 2014 01:14:25 -0700 (PDT) X-Received: by 10.68.228.33 with SMTP id sf1mr7031022pbc.14.1413533623811; Fri, 17 Oct 2014 01:13:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si482018pdp.169.2014.10.17.01.13.43 for ; Fri, 17 Oct 2014 01:13:43 -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 S1753631AbaJQIN3 (ORCPT + 1 other); Fri, 17 Oct 2014 04:13:29 -0400 Received: from cantor2.suse.de ([195.135.220.15]:36334 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753583AbaJQIMe (ORCPT ); Fri, 17 Oct 2014 04:12:34 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0405CADB7; Fri, 17 Oct 2014 08:11:56 +0000 (UTC) Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.83) (envelope-from ) id 1Xf2df-0000D6-AS; Fri, 17 Oct 2014 10:11:55 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: Sudeep Holla , Russell King , Jiri Slaby Subject: [PATCH 3.12 073/197] ARM: 8133/1: use irq_set_affinity with force=false when migrating irqs Date: Fri, 17 Oct 2014 10:09:49 +0200 Message-Id: <132f8be98a83c38b1c63a8962ce63c31e28fd763.1413533329.git.jslaby@suse.cz> X-Mailer: git-send-email 2.1.1 In-Reply-To: <7d97f39bc813aa9f11fe03d602885f81de07007c.1413533329.git.jslaby@suse.cz> References: <7d97f39bc813aa9f11fe03d602885f81de07007c.1413533329.git.jslaby@suse.cz> In-Reply-To: References: 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.215.47 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 3.12-stable review patch. If anyone has any objections, please let me 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;