Received: by 10.223.185.116 with SMTP id b49csp1102593wrg; Sat, 3 Mar 2018 15:37:53 -0800 (PST) X-Google-Smtp-Source: AG47ELvqHCOP9gy6DNZytaRwt4clFpzYnHHbALPpYPEybpB2ybLdP2th5YKORnK/1J58dLG0CiYy X-Received: by 10.99.123.74 with SMTP id k10mr8391004pgn.217.1520120273700; Sat, 03 Mar 2018 15:37:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520120273; cv=none; d=google.com; s=arc-20160816; b=TqqYbDz5F0ePin+wIsmFDjvzCJcRGNH4wz/31N2L79YATLPA71FsTOhCbvZ1M4gLxY VVx+njgH+lsR4bOhMOYna4pYDu9RePnvEfc/GFVP/iv+ng4TMmnFuoAykE4Z7B+xdQC+ QetS2wpw2e+vfdMFatYZLJBJDuFm8hl0egB2+lxlDpK9pgHf6NhE90eInRSbg12HzSHX BVqtAX7Tosn5qlKAHMTuUI88bB5uC8gw1rVQ85KZbWT/yId+nsSRq/dZPLpmtqBtdVnM X+IK4VaQk3B9pOcyAvJ8Rqlm4X0C9JXYbu/lgmTFrAHQPh2iWraINMXK3oQz2sLMENfp H36w== 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 :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=x9L7R/lzN+FtipQqr7oc2INxk/F9ikPjMGNXDR0U6hc=; b=sykvO0EcGfWynFfsJczEBMzHsT7L8bCyjat9C2t8jyeQshruy2ulqIVj8JNjE2rfUT hwPtpGEr6MLwnA8xXF8DP/NJCfi4gGge6ngIHpJ9bGLkZYeIZVmmJImYVF884gckw7Dl k5ifNCKNWF6vT4JBcA31hVCZOrkXPI25SsZ3hN7f/F0CRwPE5si9FtRdA4X1cvU07yPt wM85M7sa7G3AUBfaygEE59wRQeYLroP1npBaxO+kWytODHjjnPzXhW4cfQEa9vWhhRPh uUcy66Ij86pOq5D7V8sX9BRm9/u9SwNMUG5gt9dxk1vUIvJL1LJdhYtUxPZPVcNSpfxu Gmyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=JPlohJJj; 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 g15si7378368pfi.330.2018.03.03.15.37.39; Sat, 03 Mar 2018 15:37:53 -0800 (PST) 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=JPlohJJj; 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 S934404AbeCCXhE (ORCPT + 99 others); Sat, 3 Mar 2018 18:37:04 -0500 Received: from mail-sn1nam01on0132.outbound.protection.outlook.com ([104.47.32.132]:20800 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934372AbeCCWfP (ORCPT ); Sat, 3 Mar 2018 17:35:15 -0500 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=x9L7R/lzN+FtipQqr7oc2INxk/F9ikPjMGNXDR0U6hc=; b=JPlohJJjMS9/FZRvoV3QeHWPXmIrKRkGZ/kYkV9KQWcEW6mlSLwXdRjRoiyjnB/lK12Qulzl1upjIHWFDnXpbV56J2ntkI8sBKNhLjUb4Z7xASsb5eoI2YAxCXqD3P+WXY8fCaS3ZgRcHF9U4S50JOOwxNDYpFn5wP8pFN83nAA= Received: from MW2PR2101MB1034.namprd21.prod.outlook.com (52.132.149.10) by MW2PR2101MB0924.namprd21.prod.outlook.com (52.132.152.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.3; Sat, 3 Mar 2018 22:35:05 +0000 Received: from MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0]) by MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0%3]) with mapi id 15.20.0567.006; Sat, 3 Mar 2018 22:35:05 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Mark Rutland , Will Deacon , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 150/219] drivers/perf: arm_pmu: handle no platform_device Thread-Topic: [PATCH AUTOSEL for 4.9 150/219] drivers/perf: arm_pmu: handle no platform_device Thread-Index: AQHTsz8U0bwTP+t26EiRpRvQbdIClw== Date: Sat, 3 Mar 2018 22:29:23 +0000 Message-ID: <20180303222716.26640-150-alexander.levin@microsoft.com> References: <20180303222716.26640-1-alexander.levin@microsoft.com> In-Reply-To: <20180303222716.26640-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;MW2PR2101MB0924;6:eJB65wa738BH3s9QrQp9zyRUaSrP8myLT6st8HBv7Fp32pHOlB5zXam2aXyYPqMkdDwEArDjwqcya1SwJSiB/+zhI3EqII8pFXjAr3MCkyjiXodDJn/2WXEE0jJC+onIa3HDVy6HNetFzp5+miMf4LEsJEnwyb6WMJP7JBApIc5xZeVBRienWTeDNRuo2k5G/clNeV3ls0VwcuQf4hSuiw7f+FrcXB6zas1VuRikkoy1naiKjotSYHU2kmAaF2g/bHKnQ+tkur5c0NvS76eawaoPjPeWJNQKHndkT4UY2CeSzNYLWVvZizbC0HYbBHlPb0U7OTI/1hqa8vAIOUrKyMsCnXaquCNOxGsW6gGZKAY=;5:ONpOM6GUuYtxa+8DL8pWvFKCu/rY66tUdEn/ivTptOwkojinSfXhJoD/DCEogI6B3A8SFfGNbBwm+BYxlYsZXCIsRkwmVqSM7pBMUWRjITcIH5h+YZtPPRr9a6iLMbOM/xCUQJ2IroB0SdDxNsjNdasUhNYaPs59ZwvV6PzwGWs=;24:/N6qeRZ5Liv0zZO1pMGsfUXn7B4en13Y54uWMIFa1Xqy3bZQxZnJe0a4qHDQHsqN3q7csyVbTdybVaKu2PeqcKnpQ4F/5g8isQm8En2lcSA=;7:0IjWoURpNTEw1OBlCFbkJWW+RPoE/6Yv0Wl4dRECdml9lPBgSXHFzReztL5sE8eFhF3gJWEBE2IIyF6vfhV2O0l0KTQJo1zYelID8KT/61KM8uRvUlkaF56MrROjYuTsVRizXcthww2q7aGzDOtEgnKTWkijklidGXGFTE9CAqCD3Hc9zHixwZYGgK71IDMKMlZXkkkMhOUvux7LQJOcg7AXXSW5ZsjTc+KIVYMemgMH/IIap/d4wLWZNLUht9Uc x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ad33ae7d-b78f-457f-d29d-08d58157033e x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7193020);SRVR:MW2PR2101MB0924; x-ms-traffictypediagnostic: MW2PR2101MB0924: 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); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231220)(944501244)(52105095)(3002001)(6055026)(61426038)(61427038)(6041288)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:MW2PR2101MB0924;BCL:0;PCL:0;RULEID:;SRVR:MW2PR2101MB0924; x-forefront-prvs: 0600F93FE1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(376002)(39860400002)(396003)(366004)(39380400002)(189003)(199004)(102836004)(2950100002)(10090500001)(6666003)(316002)(26005)(186003)(25786009)(2900100001)(2906002)(54906003)(22452003)(110136005)(97736004)(6506007)(59450400001)(7736002)(4326008)(305945005)(5250100002)(86362001)(2501003)(99286004)(68736007)(72206003)(53936002)(6436002)(6116002)(3846002)(5660300001)(66066001)(1076002)(76176011)(14454004)(36756003)(3660700001)(6486002)(86612001)(81156014)(8676002)(81166006)(10290500003)(6512007)(8936002)(3280700002)(478600001)(107886003)(106356001)(105586002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:MW2PR2101MB0924;H:MW2PR2101MB1034.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) 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: ad33ae7d-b78f-457f-d29d-08d58157033e X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2018 22:29:23.6663 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB0924 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Rutland [ Upstream commit 7654137071fa706e5c91f4f27bc2a5cd7e435a9b ] In armpmu_dispatch_irq() we look at arm_pmu::plat_device to acquire platdata, so that we can defer to platform-specific IRQ handling, required on some 32-bit parts. With the advent of ACPI we won't always have a platform_device, and so we must avoid trying to dereference fields from it. This patch fixes up armpmu_dispatch_irq() to avoid doing so, introducing a new armpmu_get_platdata() helper. Signed-off-by: Mark Rutland Tested-by: Jeremy Linton Cc: Will Deacon Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- drivers/perf/arm_pmu.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index b37b57294566..af82edc7fa5c 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -322,10 +322,16 @@ validate_group(struct perf_event *event) return 0; } =20 +static struct arm_pmu_platdata *armpmu_get_platdata(struct arm_pmu *armpmu= ) +{ + struct platform_device *pdev =3D armpmu->plat_device; + + return pdev ? dev_get_platdata(&pdev->dev) : NULL; +} + static irqreturn_t armpmu_dispatch_irq(int irq, void *dev) { struct arm_pmu *armpmu; - struct platform_device *plat_device; struct arm_pmu_platdata *plat; int ret; u64 start_clock, finish_clock; @@ -337,8 +343,8 @@ static irqreturn_t armpmu_dispatch_irq(int irq, void *d= ev) * dereference. */ armpmu =3D *(void **)dev; - plat_device =3D armpmu->plat_device; - plat =3D dev_get_platdata(&plat_device->dev); + + plat =3D armpmu_get_platdata(armpmu); =20 start_clock =3D sched_clock(); if (plat && plat->handle_irq) --=20 2.14.1