Received: by 10.213.65.68 with SMTP id h4csp2115087imn; Sun, 8 Apr 2018 20:05:35 -0700 (PDT) X-Google-Smtp-Source: AIpwx49veptc8f65DP3Ybedwi8SAQ70lTMf/Xw3CjgB5kxJHSxvOWIvcpL1EVsplpbcKYHvkDHTd X-Received: by 10.101.101.206 with SMTP id y14mr8819473pgv.220.1523243135906; Sun, 08 Apr 2018 20:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243135; cv=none; d=google.com; s=arc-20160816; b=g+TwfpiufIm0dvsv/Sf4aySxOzlyraNJ1JkoqUTigmFvi9I+piPgdDnQSYKrAL2OXB A95giw8pTex8Knz9H4sK9jLQloFhNujs6I2EM8md5WOtvLVLi7ao8D7CeFsgnQAdAIcx id3goJaO85AdI61TC0DR2zOcqn/qDMSZ7uuDd4N6Ub+lCfu4PbXDKEwdkF+gX+q0zfXw eRNUOnnRUEMPPrPD8R+SI4w44SMNL24Dl6+pXaPSmmacqM+ytL4NQMcXjs1fk9jODqqA GZEKVRJZkAbCOGiaMSEBVL6cDkPjFsmdohHkXn9BZgSmFQVnu3h3FQiK7Yf23DmQz2uY kOpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=qUpMHNywz8RaLuMAWoHnlxhiotQ1CqpEwNiBJCpHjlc=; b=AEP5UZnX0akQUmPhL6WmqNIxHHLfMgNsDvL1mcYW8X1mQ6Hks9GVH/4HZwtGFIS73H 1uJFP8+FxUYbRTbGupgntVpurlTnpxmz4BGj4miGGC7o1WdemsvofnX4wO7DJAUlYqaK NBSs0DwKmlTmcJZmy0Z14lIpV4POw3uzD/Rk8SYox7RFxyTl5YeTjh4ZYDa4wmb6GoPS Rd43EIkopuwikhvNX6NC9HgwerxgsFeMMtJ5GVkjEo8ci+YT9cj9vTgU7IctEUdbyXpw TCPqbHMLRX2TL6Pm1L2Bzn85eCbSwyo3LeZjJ+sjfOZfU5aKCR/HnpPXRkh3mse7g7Er WiqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=RIKbWkGT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7-v6si14620437plk.380.2018.04.08.20.04.59; Sun, 08 Apr 2018 20:05:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=RIKbWkGT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932895AbeDIAh4 (ORCPT + 99 others); Sun, 8 Apr 2018 20:37:56 -0400 Received: from mail-bl2nam02on0103.outbound.protection.outlook.com ([104.47.38.103]:27456 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932844AbeDIAht (ORCPT ); Sun, 8 Apr 2018 20:37:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=qUpMHNywz8RaLuMAWoHnlxhiotQ1CqpEwNiBJCpHjlc=; b=RIKbWkGTgkezmqX2flfeVqaSyWStlQUAXx0tggzV3dlCslveoBgckseOWyr9Z59u1+3YGsyukG6XzIbtfVG8hVRGJSBBeP8GXhrkRrbDO/+cJRNDN66arPIOUyrwd7b4lAPg/674D7OADiTCmFMKXoKkxmoBT2BgpxRk7+BaN2U= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1110.namprd21.prod.outlook.com (52.132.131.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:37:46 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:37:46 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Suzuki K Poulose , Marc Zyngier , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 103/162] irqchip/gic-v3: Honor forced affinity setting Thread-Topic: [PATCH AUTOSEL for 4.4 103/162] irqchip/gic-v3: Honor forced affinity setting Thread-Index: AQHTz5nCSQNxv+AP20eRO/ouWTnrmw== Date: Mon, 9 Apr 2018 00:29:02 +0000 Message-ID: <20180409002738.163941-103-alexander.levin@microsoft.com> References: <20180409002738.163941-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002738.163941-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1110;7:PvRhHCUNerFoQrBZr71TMpHAED3z4fmJRLqJl/wVb4XhEHZozIiklECqQEzasm47sjGJLNhWShGwMpuYm6HXhNYVU0j54elwvhoK2NT4gh8Uqma2z/QSToEwpH6QS4p/fmULPEMz7I/9N5qkjpZERxAY6gZpMndYHaCLRX8UoVcsmqfHYlXXzt15qepD04W/++xPRcLPBn1cO13k8OtTW0DZTSaQ0bn2/UM7EK9S22AswoRvTFSDDssXqNnyyUd1;20:acXkpPWUl1pyZ1lPns0rOcjN7sCUWR6CauF2YqOONbXRwKoBXiCKHthjZfrPi7DO/kbNbSn0OQL/HKyVQdQLhL1raiFNR19nMFUfOoXGp7Di7v++Sc4+VuxLLre2cOsYl4j99Sq4NEBx+nzH5zoJsxxPY6SMF/rR7iAHHHYfoRY= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 703f14cc-fbe2-4868-2bad-08d59db21d13 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1110; x-ms-traffictypediagnostic: DM5PR2101MB1110: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(180628864354917)(89211679590171)(209352067349851); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB1110;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1110; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(39380400002)(346002)(396003)(376002)(366004)(199004)(189003)(53936002)(186003)(5250100002)(105586002)(11346002)(99286004)(476003)(66066001)(6512007)(86362001)(3660700001)(1076002)(54906003)(68736007)(110136005)(3280700002)(316002)(305945005)(4326008)(107886003)(22452003)(14454004)(7736002)(446003)(6666003)(2501003)(10290500003)(3846002)(6116002)(72206003)(106356001)(25786009)(6486002)(6436002)(8936002)(478600001)(5660300001)(86612001)(8676002)(81156014)(59450400001)(2906002)(102836004)(81166006)(6506007)(2900100001)(76176011)(2616005)(486006)(26005)(36756003)(10090500001)(97736004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1110;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: NRINCUIZ6yUJPlizFDe6zIOY3obNj0jqCbF8l+aXFJa3CYITU5jdhDz5jeuMziMcF71krar2BYnVwPS57e0rUisSTKHSm4E1vbfwIdOHeZuZiTbTviDkQ4gSDYNwyV4ZM5Q5rjkJP/X+tqz1YsacKbVxYqFpY+XxZlustyJsXfhtfRABufGihcRmK+VrvNpF7z/GxA5l1ADEX98ZKHFH1vvrVvRDt6pTDaEpr+icCw3goSasgKKDkij5YwblTszvdE6Wvx4tZtSBzEoDtRoKiaBS9+AQFvcvwNGchLl4rPcnXLzulozPBHFfGDrerjlpwlLxU3i/frJXfrQujH75ME+rItxYcuM1WF1rE9DKxuYTOvJs+UGtNQpUW43dg3IxrCGl/hlLbfiMQkhnnEZy2ts0Wc31wZ3TML6YIqY7OVU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 703f14cc-fbe2-4868-2bad-08d59db21d13 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:29:02.7554 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1110 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Suzuki K Poulose [ Upstream commit 65a30f8b300107266f316d550f060ccc186201a3 ] Honor the 'force' flag for set_affinity, by selecting a CPU from the given mask (which may not be reported "online" by the cpu_online_mask). Some drivers, like ARM PMU, rely on it. Cc: Marc Zyngier Reported-by: Mark Rutland Signed-off-by: Suzuki K Poulose Signed-off-by: Marc Zyngier Signed-off-by: Sasha Levin --- drivers/irqchip/irq-gic-v3.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 5d93e0254d70..eed31f9bee05 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -627,11 +627,16 @@ static void gic_smp_init(void) static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask= _val, bool force) { - unsigned int cpu =3D cpumask_any_and(mask_val, cpu_online_mask); + unsigned int cpu; void __iomem *reg; int enabled; u64 val; =20 + if (force) + cpu =3D cpumask_first(mask_val); + else + cpu =3D cpumask_any_and(mask_val, cpu_online_mask); + if (cpu >=3D nr_cpu_ids) return -EINVAL; =20 --=20 2.15.1