Received: by 10.213.65.68 with SMTP id h4csp2117417imn; Sun, 8 Apr 2018 20:08:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+8iUpwiIUXM3BUboXIM84Tjyf406LhAty3LwTfaA854rXsFOxqPUbDtt+TLDq6Ru+AaLdi X-Received: by 10.101.99.26 with SMTP id g26mr24249319pgv.442.1523243307447; Sun, 08 Apr 2018 20:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243307; cv=none; d=google.com; s=arc-20160816; b=xNkMPQ/4NLahpjg7X7kmsJlPACJFLUsrDPNYFEiCn7D8iF2gZQcW99/QdRUAlnr3LK 3uuVBzOfdxLwHWk5V17exmhjpT6rNGiqj2cNt88K+KcJ6/39R+XgFkJw10hPBc/VY6sy J3A4+0Grq5O7o0oEko7Wf6FQA2fH+UVW4I6eLa6EtLDHXKAr0HT1EzL74FQThmrwJzw/ cfTIILPulhdTpLtzjPs3nLpi0ydqfRtt2Xwu/IlgPrtUAdCUtLWJeYOQ2HDk/Mpe8jbl WgPZ4ng8Y7njFwpq9thgLRB+wJG0yHFrEm3v2g2D4dItkxN4ylYG9PCoCZ2m/sxydj9Q ekCw== 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=qMETmlQbSO4VqYDmmqF5X3HvrcKUYIEB13mocydvmjI=; b=LqV0XC2hdWXByGwoJyTYOoL6FMcPKQoi9mCCQH+ztVhc0g71lDFuTYlhx+RcbEzAaX hVf91ejvf8BHOoqmbIrPPrKAcQZeGQh2z/tIVmW5zPekV3rAHyceGQubutKcu33qEO2l iFzr33Yn63ulrY+h+aNT6Z/Y9dk8kyuDHU/xMq4NjZNOZ65prQxzO2n45eoGwz6Dy+Lc ty9CSz51A6plfDMIQTvI5ZS7W/tSnzLGvfEHg868aMVZEVXuaVrZwARilOPqS9XHCRiy y9aLN5Awxf0+L+DH+ZItua4ovLK6gtQWJSw8pkrOe+nlG6frM940gssWjdXD0rf17gQ0 RjhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=B+H53UJ4; 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 i3-v6si13382813pli.274.2018.04.08.20.07.50; Sun, 08 Apr 2018 20:08:27 -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=B+H53UJ4; 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 S1757568AbeDICAF (ORCPT + 99 others); Sun, 8 Apr 2018 22:00:05 -0400 Received: from mail-sn1nam01on0091.outbound.protection.outlook.com ([104.47.32.91]:51937 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756476AbeDIAcQ (ORCPT ); Sun, 8 Apr 2018 20:32:16 -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=qMETmlQbSO4VqYDmmqF5X3HvrcKUYIEB13mocydvmjI=; b=B+H53UJ4KZ0vtomVo2nV85Rdwri4JO1+ZEvHSmX96yW0dpPckx03eYPU2nwHNLFpKOat78Abkct3cmPKYBzzNEP6fE5uJRX6gW4pBs3+lojueEZMmm+8xkO6O73d1YgcdvX/i9Wx1k9+QQWbhuWskhOqG0hBnkOeWlPXT3Mmr3s= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0870.namprd21.prod.outlook.com (10.167.110.165) 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:32:10 +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:32:10 +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.9 206/293] irqchip/gic-v3: Honor forced affinity setting Thread-Topic: [PATCH AUTOSEL for 4.9 206/293] irqchip/gic-v3: Honor forced affinity setting Thread-Index: AQHTz5lG8Xs9oAKgdEyEQ8Dbwiht4Q== Date: Mon, 9 Apr 2018 00:25:34 +0000 Message-ID: <20180409002239.163177-206-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-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;DM5PR2101MB0870;7:HNj/h0hmgBXWQdckqxi+uROKXtxNjBSjKcXpjbGoVqGc8OMvdrkdpYFxgKXBLKyfrlHwKJMkK1aFTnkLKTOZwGFuTPzhWF5r/vBayjy0kRj3SApUT+5Gunaua/9iiNLJ8UJvkzobmd7tFY5ut0yVn5yCR6ves3kB9Goi5M85GtxqjSLxFRJ9EQKvl7DlYg8tkggdbDxZNrGoFfRH8ZvPMyZyiLcgZDxYvdc/8+7LKnf/fM3932lX0R8G5ipyTrfi;20:k6aXD+e1WDzHRwWVamiPF3X610wioSmHAVFNDPY5+qx5aQ61DqnCdQOqJNioTT/Or2WijCceezsPXrEZsbyeU3hl5eSlcnFYUDe2REz6EQ3hXapd7Rl6FU2tDiZ3TW87+cJ3DSTDV3PabWI5SU7FnVnkHSqKgJMmcxUTfMSmdBE= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 6a46fdf6-ffbe-40bf-2de7-08d59db1551d x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0870; x-ms-traffictypediagnostic: DM5PR2101MB0870: 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)(8121501046)(5005006)(3002001)(10201501046)(3231221)(944501327)(52105095)(93006095)(93001095)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB0870;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0870; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39860400002)(366004)(396003)(39380400002)(376002)(199004)(189003)(53936002)(2906002)(6512007)(102836004)(2616005)(76176011)(14454004)(446003)(10090500001)(11346002)(476003)(486006)(107886003)(59450400001)(2900100001)(97736004)(66066001)(6506007)(6436002)(106356001)(99286004)(105586002)(3660700001)(6116002)(86612001)(3280700002)(6666003)(2501003)(10290500003)(26005)(8676002)(8936002)(478600001)(68736007)(5250100002)(5660300001)(316002)(4326008)(72206003)(186003)(110136005)(6486002)(7736002)(25786009)(3846002)(86362001)(36756003)(22452003)(81156014)(81166006)(305945005)(54906003)(1076002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0870;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: LhTpJRVhNcNRpP5l+IeqgbVKOsCz6o58buM7zxOCnq1b/12jghTuBbl8aGn52cOoo+whaD/IMQSkwmgVciVCIjQzuLaEC/HqXFdD0rqujIlY2I77lk/0H8cRgOhGbWqZoLA+cKzwD/CPV22wCAScEuvm7KTJCSDPHxmhwk6agIw2uzMONh1p5j0WlQgiHNRp0tR3XEDEMNtXINrSbYJ/SBtEJ1F9PRJElvHRbuGGB/iAuZLLBRZiOyONmcxp1Lh2ZfOH6s/NFrenmFKQoeDrdcIH1qSEF5NtRPwbGrvgDM+borK6zOFJPKDOY8kwmYQdJnqPKEPCHEys/136FNEg4ow8jQima/dy/91IC+P4aKZKKeAtlcuQMVqfeJ7lakItbX++ym2jMyvdAHQwCoFz/rHmtpR7mms5MLqhG+68HTg= 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: 6a46fdf6-ffbe-40bf-2de7-08d59db1551d X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:25:34.6440 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0870 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 8c7f02318a6b..0ef240c64c65 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -641,11 +641,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