From patchwork Thu Mar 8 04:58:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 130949 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp6103320lja; Wed, 7 Mar 2018 22:34:07 -0800 (PST) X-Google-Smtp-Source: AG47ELstfTMx3VE6j5S6Sq/89HkMX0oDcDQreRH4dvRXDnHF5V6Zk/hSBtQak+x4xgKK6mLxiQFc X-Received: by 2002:a17:902:7d94:: with SMTP id a20-v6mr23122310plm.184.1520490847379; Wed, 07 Mar 2018 22:34:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520490847; cv=none; d=google.com; s=arc-20160816; b=07Ppq0n9Q/emojOsjfnM69O10TwhSBnyQSXduxmRP3YBtdGTrbjvNiJWZdGz5nLIjt nSLiMVLq/a1tOg42xF8Jh/wg+4420v1nqYJGslmZQGaVq0CbaP5STNqR0ks8T/kbjtLm 9ZZNTMFOwB4cRyMQviYJrw2T8/7Pv85oJ/CqVxfipVXWX7c3JvzcxjJwoRLfq7FKtbbG iiEqPPV64e2znMgHoiFMSxkZxTHwB70/QhNCZXu8zmfP2pW9+8jYXJRax6EglgDIe7NH MMj6NDRaLwW16nPyDsd0s2zmJozVdtPCsByb4ZYTGMidQfj9WxD/mpMwhSjojZZNV9Qq 0Ekg== 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=x9L7R/lzN+FtipQqr7oc2INxk/F9ikPjMGNXDR0U6hc=; b=QWbDyXJACV7gJpVvsAQsO4oGXHXWTswBHC6ULujKPG1tx71vaZ0mYk4P17nXDilC6x 9evWe/2jYkHU9X2D1CcG+sJj3sQzPLvL7rRkOe4JCgg+S8trYAC4nmBlMxvJ5587cgJc eGWashII2EhkaRm0UdMxH1PK7kkhnohU96BC1yJRNuFGVX88FVKMm0Hz9nW2HxYwDrdG ftCqqjbV51iOhYowsfTDTk0Z2Z5yGtlE5b2mZXeV27W2XsiPTRvjGgW1+HK99BKeACoK z+2GGDCE8S/LVjBi9T0t5WBB8mOkvpd77mYXnVtltfGNdPtXk24HAaNJpK0AXBvmUn/A +5Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=crKMFcRj; 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 g8-v6si8556792plp.615.2018.03.07.22.34.07; Wed, 07 Mar 2018 22:34:07 -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=crKMFcRj; 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 S1755471AbeCHGdv (ORCPT + 28 others); Thu, 8 Mar 2018 01:33:51 -0500 Received: from mail-bl2nam02on0092.outbound.protection.outlook.com ([104.47.38.92]:59552 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965532AbeCHE77 (ORCPT ); Wed, 7 Mar 2018 23:59:59 -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=crKMFcRjDbC1X+xt9ko0SX0jTvxsKMf9c4acmk8ke2GJPHeHjBn2VPDusY12eiwSwpeWIDlu8Xj3ouHcghBJOndH9tUo1FaZiMK2tZek0dy0MrlcvTiOXSaiEvYhWD/+ArxCwHPa6HnIXauwghVYeZRCLHbuCDYwzdjU6ZboZ18= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0920.namprd21.prod.outlook.com (52.132.132.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.3; Thu, 8 Mar 2018 04:59:53 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0588.008; Thu, 8 Mar 2018 04:59:53 +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 006/190] drivers/perf: arm_pmu: handle no platform_device Thread-Topic: [PATCH AUTOSEL for 4.9 006/190] drivers/perf: arm_pmu: handle no platform_device Thread-Index: AQHTtpolizEVqqXCsUOq/0VMan29vg== Date: Thu, 8 Mar 2018 04:58:49 +0000 Message-ID: <20180308045810.8041-6-alexander.levin@microsoft.com> References: <20180308045810.8041-1-alexander.levin@microsoft.com> In-Reply-To: <20180308045810.8041-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; DM5PR2101MB0920; 7:zTHHoAj3skFySz7Qk5E+UDzZPfYTlqZSIOVaLlfUh+lvBPex25E+qTPJ7FLY6zgLcS4oJ7jZpBitJSJcWgbIMkYQamtEoKyDy8GXoFDPCFELs5iGNjpEmpDpz7Xwa7mF3NTsan6mS2SQ71CIvBza/h8Zdg3P71r4EfNWPccsfEsK/NCEnXiIeoK0/X68aj6QC22Af2yOx7RDAsaPnyn+bHzGqWB9G1nvdIuzRlPqV7NKBdFV/NgSkgIaqGLy0XL9; 20:La9uqmvfrnK1hP2HA0TjhSzsZ8FIsNnjbQisCH41wT79Jgg5ltTu7YT2YwI/vK7YrJawMY1LPV1kFbZrtXFWWZYzotbhV5NloBHBJwvRjNdnYvsJEerT0IJmGYRas2NTcOaAFSKjgLbMdpm66fCY9k9t5zlx92lF99/xjymU5z0= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 8097ca71-b256-47e4-1b0c-08d584b16e32 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB0920; x-ms-traffictypediagnostic: DM5PR2101MB0920: 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)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:DM5PR2101MB0920; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0920; x-forefront-prvs: 060503E79B x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(396003)(39380400002)(346002)(366004)(376002)(189003)(199004)(81156014)(81166006)(5250100002)(8936002)(54906003)(2501003)(305945005)(8676002)(107886003)(110136005)(97736004)(99286004)(6436002)(36756003)(316002)(72206003)(76176011)(14454004)(6486002)(7736002)(478600001)(10290500003)(186003)(22452003)(59450400001)(68736007)(105586002)(2950100002)(106356001)(102836004)(26005)(6506007)(86362001)(3660700001)(5660300001)(2906002)(10090500001)(1076002)(25786009)(2900100001)(53936002)(4326008)(66066001)(6512007)(6666003)(6116002)(3280700002)(3846002)(86612001)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0920; H:DM5PR2101MB1032.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: efnI4R5n9LYy5nC8KrTjlW7TDvO+7R2L6HQsYtBy78dkF3wcQd1Gk7MbC6VIuYowLX6d0RGuZHW8Fzu4QTFvVle7rCIKWKc990FlO8LLBunw1wXrxPoNgEVrsTEpfoXDylo2YR5nGggW4PgnQqzX1+RT7LRENUqH/HDF4IrCui+qkw4B/kRLlkcxcFYMqMrody3vLzaMCiIxoZA54bGH9YDngN1q0xbnD+q0i05ARcgIh4VJiRWpG4OWNwkJt9LP8hX/CW6eO5HSJZOfy4OdZTKKfmXmTTh2cvYlBBH7Hi1+Jduv/uz7U24wm1AtGRphGLg2EiNGCdE9HXoFFJ17ug== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8097ca71-b256-47e4-1b0c-08d584b16e32 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2018 04:58:49.0732 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0920 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(-) -- 2.14.1 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; } +static struct arm_pmu_platdata *armpmu_get_platdata(struct arm_pmu *armpmu) +{ + struct platform_device *pdev = 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 *dev) * dereference. */ armpmu = *(void **)dev; - plat_device = armpmu->plat_device; - plat = dev_get_platdata(&plat_device->dev); + + plat = armpmu_get_platdata(armpmu); start_clock = sched_clock(); if (plat && plat->handle_irq)