Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp782626ybg; Sun, 26 Jul 2020 22:17:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxufsHsSLPB45VODVFb0fdsmO3R9ebNSlwT6HpL4uCJMYNt1cpW5eRIgS7fhqnyvVRQhGAS X-Received: by 2002:aa7:ca05:: with SMTP id y5mr20129797eds.204.1595827022223; Sun, 26 Jul 2020 22:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595827022; cv=none; d=google.com; s=arc-20160816; b=GXuS4qaHstMN9ONgLld31b9TfGLNSU9ryiXqWTvfH0olc/Eq4nx4c61pcLrklQJLxN oBHk8W8UybXhNbSzSDVl1dtDyzpCjfBzrn4+8thEzi6o3RCBQpF38YLdl0ioh0mOo7Ke OfzRS8Bw0An8RXTNH7/pCN23B5azteC+Ht0PXnUqWPheXZ3Uplaoc8Phk3Yxm2a0nW/x rXLYbUD19Cy1Ydo8xkkuziCIXhw5m2eGGJfFIEXf9lLJH/5NgMLkFMR7JGFadA5w1bUc MfaEVIyA02w4SJsiR4gaMSRNXkEs/GaPNnzFjD15R0MWFhXYvq7zh71UxmZmcIxBUUxe aNRg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=cLsFmwqDAGQ0R0oDeXaWkXbZ4l+1J+n/2BVCdsY3tDM=; b=tscFiRAjWrO1pv9Opy4TiC4QMtqzbZFkwhUpLMq1c9Ao7wgRcQ+LBKIgxk6aCI7Jep uWeosllFiJRpPg3ouKsh9LlUW/Ifb6TxLQx2mEVnSEqFJQS/vFG4EneMOOoAk6gMEyBQ rC2t7jhYMYKLyhx8Ish1RQZofVMD/Vq3JfHXgNVUkPzHPom78BuE1G7uB+y8BNkzONOc ZXCgbHDkd8g/nhXfjKhoxuueTyKMzbs2a/souz7Kkn5LexLSGG99ygAOg8OLQyc7wGv0 YNgew7/tHnXDpZq0px5agdGOXEemczhpXyFuqSD2dIav3XE1ANnIdw2H36U65rEr0n+1 UM/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=YZlE7wpK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j15si2777299edy.1.2020.07.26.22.16.23; Sun, 26 Jul 2020 22:17:02 -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=@synopsys.com header.s=mail header.b=YZlE7wpK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726185AbgG0FN5 (ORCPT + 99 others); Mon, 27 Jul 2020 01:13:57 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.87.133]:50178 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbgG0FN5 (ORCPT ); Mon, 27 Jul 2020 01:13:57 -0400 Received: from mailhost.synopsys.com (sv2-mailhost2.synopsys.com [10.205.2.134]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 2436EC0641; Mon, 27 Jul 2020 05:13:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1595826836; bh=eul44+C62DTDvDmmS3zMwGRsSJ3B5+hYF5hZSdNPdx8=; h=From:To:Cc:Subject:Date:From; b=YZlE7wpKcVSwyi8bkmwbLc0lqtJM8vmgs1XgeUj4/2EWDSbzoW7OtlFn3Rdf+mZBk jPWD0WUkCtO9D1ms27FWkl8AJGUlqpw+glKlj5JIZjMAzWEZQTkgiiobusbsmJtKAz GEuUwBKhRhQzc5upBNHt4gDTTKUfnFHAv8YWFBVTbvzhkaKguWefuxD57/uDKkSU7w ifJmPOb9iz7tBou+1ivkMHfnDKr3WgMqu588ajxCoHEIVDPiDSL74GmVrh35Ia8fUt j3V6WmOneMbSRy4z7PyxT0nfZ3+GUsmynK/ml3f1k+kJYC8X86r9FlMu30EyOktwkF KOYY3e+mmwTMw== Received: from vineetg-Latitude-7400.internal.synopsys.com (unknown [10.13.183.89]) by mailhost.synopsys.com (Postfix) with ESMTP id 40187A0096; Mon, 27 Jul 2020 05:13:52 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Vineet Gupta To: linux-snps-arc@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Eugeniy Paltsev , Vineet Gupta Subject: [PATCH] ARC: perf: don't bail setup if pct irq missing in device-tree Date: Sun, 26 Jul 2020 22:13:45 -0700 Message-Id: <20200727051345.13382-1-vgupta@synopsys.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Current code inadventely bails if hardware supports sampling/overflow interrupts, but the irq is missing from device tree. This need not be as we can still do simple counting based perf stat. This unborks perf on HSDK-4xD Signed-off-by: Vineet Gupta --- arch/arc/kernel/perf_event.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/arch/arc/kernel/perf_event.c b/arch/arc/kernel/perf_event.c index 661fd842ea97..79849f37e782 100644 --- 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 platform_device *pdev) { 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 platform_device *pdev) .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 platform_device *pdev) 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 -- 2.20.1