Received: by 10.223.185.116 with SMTP id b49csp1085305wrg; Sat, 3 Mar 2018 15:08:18 -0800 (PST) X-Google-Smtp-Source: AG47ELv3kakebTGWSrs8Coh/bQwqMmLnmW07FlXQ18MgwFcL0xUoE2/L2xUBJo5Xaban0W9Bn5Y3 X-Received: by 10.98.237.12 with SMTP id u12mr10307152pfh.72.1520118498427; Sat, 03 Mar 2018 15:08:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520118498; cv=none; d=google.com; s=arc-20160816; b=J2bSBSajdZkvP6jNZ9L9xncsnCl+9O0PLFaybsRMh3m4C9acqKP4HP9oqK8dGtGh+v Ft1qwFXhW2mSZUvJ6j8OYY9m5g2RAdtpTzSvPXfI7vxX0OqS1GEPS8L676n9ttqvkCTX P47fJ1zXnN0K1Z0uRKx7d7R8er3wIyhddaMClSHimoflDiutDLH/pIasksGCAz9JoeuI AEQmduEFjftrF00DWQ9RU7bvpptNJjAg/SvFQH+QDzgrnGt6wbfP64FmPn+0+UOw3U1z S3f8CGjmAHMdrVAAlmVxTNTH3Tyn7VgXOzbbgnViIIpxLivRUJzd0rRMejirgjOvkHdy liVw== 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=mbpM3bTu/E1T2SDyZlVur64ZGk5CAplt/nA+w10opyo=; b=TKwsUc9BRswodNUz1iXMs/ju8wlixKpZyYTwHMeTZ03bZr/nZA6fqHuCHuhQnnNxRv EekUzkFdVbguNjEyb178WpP760reNdo6kDczFYzi5C+Jlj1KWAnPXT1JR4nmLmT0ov/P TW67cc5rV36IUNaef5fxRaGDU3a7n0KfzUJtzAFmMzYfjrIdsHZ1yIn2H0WDXrwaO4LU AHuWRkWSaMB62m4Ri0ZSr0TWct/27+jQG+wnCEnCiqaX3e0VAo0vGlH+0x66K/M+o31g o251OJJw2pGi9xjrDQS1eGY0Ods5ToRR6RgP/EFMuGZ75Lpsd1VOEfrVdRSrsJWpgt1u JGYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=ov6kT6/h; 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 g12-v6si6847750pla.564.2018.03.03.15.08.03; Sat, 03 Mar 2018 15:08:18 -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=ov6kT6/h; 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 S935227AbeCCXHJ (ORCPT + 99 others); Sat, 3 Mar 2018 18:07:09 -0500 Received: from mail-bl2nam02on0129.outbound.protection.outlook.com ([104.47.38.129]:62880 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935171AbeCCWkI (ORCPT ); Sat, 3 Mar 2018 17:40:08 -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=mbpM3bTu/E1T2SDyZlVur64ZGk5CAplt/nA+w10opyo=; b=ov6kT6/huyrjMlShRbYPZTQXD5w1uD2eWzIGd9enNcEzvhi2Du/mNalt7R7WZRyLzvygdLQPRB0bR5RiaWH4xygh6kFUl8agiuQTUlh95F6CjeS+vntEYBxbq8tz8iA5YKoQsRE8PVA9Qnfja8SKbO88rrt65uNR7M6JOe26TIg= Received: from MW2PR2101MB1034.namprd21.prod.outlook.com (52.132.149.10) by MW2PR2101MB1033.namprd21.prod.outlook.com (52.132.146.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.3; Sat, 3 Mar 2018 22:40:00 +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:40:00 +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.4 075/115] drivers/perf: arm_pmu: handle no platform_device Thread-Topic: [PATCH AUTOSEL for 4.4 075/115] drivers/perf: arm_pmu: handle no platform_device Thread-Index: AQHTsz9hgv7Lsv/P206Nc0Mv9bUwRg== Date: Sat, 3 Mar 2018 22:31:33 +0000 Message-ID: <20180303223010.27106-75-alexander.levin@microsoft.com> References: <20180303223010.27106-1-alexander.levin@microsoft.com> In-Reply-To: <20180303223010.27106-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;MW2PR2101MB1033;7:2hdoKSsTalwLebkookNV8B3oaViKcj3eA76d+ydOlJQO2OxQSpOxmWpz0b6v7b1gca3NGhv6VPZL64AoK3AmTUiNuZ8lIIG6XGVee8wlRczFD9C3OS32jB/kiMvzPHJa2vK1Nt6uu/kOS5z1B7PVcrvg69tog4owWlP9ByOSZJALyw+g3CftW7uY5lhmtA+HbrFHFYEYu6L9XL/e6DpnWYqG7USdWt6HKzA+lzGREMD4GfcAc1EEjfRl+gxb9mtV x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: d0d1d12e-61d4-4e00-4ab9-08d58157b2c6 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:MW2PR2101MB1033; x-ms-traffictypediagnostic: MW2PR2101MB1033: 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)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231220)(944501244)(52105095)(6055026)(61426038)(61427038)(6041288)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:MW2PR2101MB1033;BCL:0;PCL:0;RULEID:;SRVR:MW2PR2101MB1033; x-forefront-prvs: 0600F93FE1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(39380400002)(376002)(366004)(346002)(396003)(189003)(199004)(3280700002)(3846002)(316002)(6666003)(99286004)(110136005)(2900100001)(54906003)(2501003)(10090500001)(53936002)(5250100002)(106356001)(76176011)(36756003)(107886003)(2950100002)(6486002)(22452003)(6512007)(6436002)(86362001)(6116002)(1076002)(6506007)(2906002)(68736007)(102836004)(4326008)(59450400001)(97736004)(186003)(478600001)(72206003)(26005)(3660700001)(8676002)(25786009)(66066001)(14454004)(5660300001)(305945005)(86612001)(81166006)(8936002)(10290500003)(105586002)(7736002)(81156014)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:MW2PR2101MB1033;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) x-microsoft-antispam-message-info: WcirbWLeXrqDNbpdIXM50WZMQJ1oWaLpnpS3Y+D0ni7kAz4Pog75axDa/9t5yZHeI7ksSITxi6Z8Q3ugxduzOZok7DFky8GRnreHylIyAttEAIKmW2UKeWx2jl7H/kAvXindx+aJ7Zl/VpRJ8e5OPcDjVk0m7sNV+jOyprqRCwY= 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: d0d1d12e-61d4-4e00-4ab9-08d58157b2c6 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2018 22:31:33.2759 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB1033 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 8af1f900ea65..1ba58fb6f796 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -321,10 +321,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; @@ -336,8 +342,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