Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4160359pxk; Tue, 8 Sep 2020 12:13:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSA6Iw5CaUsu/RbSKBZe/IvO6SGX2Ae6v4vT5T8WI5kwAYNeSHNJ/aZ6uZpxFua0pIzs9j X-Received: by 2002:a50:cc9a:: with SMTP id q26mr551387edi.64.1599592397958; Tue, 08 Sep 2020 12:13:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599592397; cv=none; d=google.com; s=arc-20160816; b=szeYLpD5SJh0LAa2eBkCpyKOvsNXLYeNbQhfVKFTAOVdWETNWJf2mpGxfPqtJKiBhd llv+jQWz22RCZ/fN4BrMryVGeO5fSy9Onu1fG/6amMj8eDDjYvgJMcb1Sb7R28/rSan0 P067z99+mqUgaaJwI5AdfzmnNmRewjaUgwNHCPLbIarHbHl2q9IrcojG7/BJRfbaeY79 FupI3kwmoSCb7k9Dnc947DpHibh7iyUQRK+DmxgtT5pRhq0+4p9XwPl4wgcNfDDVdBT2 pdHMUrowS4xNTOXHHGkzItu9/U4C1uq7dfVbLguW/PDHFRL6RjzMkAQ6l+J6++n9++AH iDcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5WMmpkGbeu8llD2L95SPJNtagpZR9HgmgQg/oXM4Z04=; b=pa1xQuj0qGAwr+72qGmSs7LozrIpBM3pksYpWWcH639+NK7ZriS8u49ppQha7KodMg xODEqqDBLG+ZT4w3qbTTZITahTEAjsBDTRCZTqN9QEJuoEBQcK9cN5CHdhhBjqJfHGHM 7qxa4ak957BVCFgFM+Re6WGl87F3FQo144yNesf8v9a/fXJR2bDCb4cnZ+T3vls/T1bQ wshu0CcSTe1QalHCAsEXu5Lcf1scA9SxQmbNyxQw98J0xYI3ADXdgr6bCnnfEafxrOx5 xdEtOlbTYbYDlbsqQdcU8IPbmKFUsH993A8i8uo/WaDDFNNe2lgH4qJRb8qpm5hxulDc V7+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eX2PVjQ9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b19si12194776eds.387.2020.09.08.12.12.55; Tue, 08 Sep 2020 12:13:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eX2PVjQ9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731804AbgIHTKV (ORCPT + 99 others); Tue, 8 Sep 2020 15:10:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:52114 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731205AbgIHQFh (ORCPT ); Tue, 8 Sep 2020 12:05:37 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ADF5E23D3B; Tue, 8 Sep 2020 15:46:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599579976; bh=/CmNhgqxZ+7MyzWgmRTnoJ1IsBiQQimdXO1C8uYuIbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eX2PVjQ9p8Y/lqZaxqZWtBlolqOTm/ySNtV+ZOUnBmSLnw9QLpg68odJwgIDAFFZ+ 7Yz3jg6ONjIeQWCKdSexh+qirPuETdWBVnPxnjYB/95+kb80Ixdub+xPU7M+HhduQG aL/fBCKCxCu/6EvAldK3wojRiEIUBNJzXYEj887A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vineet Gupta Subject: [PATCH 5.4 080/129] ARC: perf: dont bail setup if pct irq missing in device-tree Date: Tue, 8 Sep 2020 17:25:21 +0200 Message-Id: <20200908152233.689473504@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908152229.689878733@linuxfoundation.org> References: <20200908152229.689878733@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vineet Gupta commit feb92d7d3813456c11dce215b3421801a78a8986 upstream. Current code inadventely bails if hardware supports sampling/overflow interrupts, but the irq is missing from device tree. | | # perf stat -e cycles,instructions,major-faults,minor-faults ../hackbench | Running with 10 groups 400 process | Time: 0.921 | | Performance counter stats for '../hackbench': | | cycles | instructions | 0 major-faults | 8679 minor-faults This need not be as we can still do simple counting based perf stat. This unborks perf on HSDK-4xD Cc: Signed-off-by: Vineet Gupta Signed-off-by: Greg Kroah-Hartman --- arch/arc/kernel/perf_event.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) --- a/arch/arc/kernel/perf_event.c +++ b/arch/arc/kernel/perf_event.c @@ -562,7 +562,7 @@ static int arc_pmu_device_probe(struct p { struct arc_reg_pct_build pct_bcr; struct arc_reg_cc_build cc_bcr; - int i, has_interrupts; + int i, has_interrupts, irq; int counter_size; /* in bits */ union cc_name { @@ -637,13 +637,7 @@ static int arc_pmu_device_probe(struct p .attr_groups = arc_pmu->attr_groups, }; - if (has_interrupts) { - int irq = platform_get_irq(pdev, 0); - - if (irq < 0) { - pr_err("Cannot get IRQ number for the platform\n"); - return -ENODEV; - } + if (has_interrupts && (irq = platform_get_irq(pdev, 0) >= 0)) { arc_pmu->irq = irq; @@ -652,9 +646,9 @@ static int arc_pmu_device_probe(struct p this_cpu_ptr(&arc_pmu_cpu)); on_each_cpu(arc_cpu_pmu_irq_init, &irq, 1); - - } else + } else { arc_pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT; + } /* * perf parser doesn't really like '-' symbol in events name, so let's