Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1225762lql; Tue, 12 Mar 2024 10:38:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW79idn600lWWNo3ObnULik1FX3nZamHQikNe2wsvJRv+wd1RUc4GopgOkGNWyaZAjgx25dbviEuuAPsbcXJbjOcas6UsfviGSOkI7mRQ== X-Google-Smtp-Source: AGHT+IHU9d2iV3VH/W/MwNzTJ6CEtYGwsOUh/ZHnGbiX1tIuJTaNcdoDzp7RgFxty8nZEr61vAqW X-Received: by 2002:a17:903:2302:b0:1dd:93f3:d575 with SMTP id d2-20020a170903230200b001dd93f3d575mr9212841plh.30.1710265110343; Tue, 12 Mar 2024 10:38:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710265110; cv=pass; d=google.com; s=arc-20160816; b=avoKduEu7RW7ADEy+0GhuSYBAK/+S83vXM39VOqMoMe4kRRJYVWb73MlfLsZ2I8s5f ihLiasdFTRzImMyryW6Ji61vSglbL8E30e9tsYfF25PzJg7QA4ZpKMg+5djCJRhEbv8F UJmVVnAuhJZmeqXq140eSbA0m659+kz9+MBRGdzIAfKecMPMjIHtfThFL3p7E13KA67f H7+7+cS/GzfHyG0ojuzmu47l9srgryObDqPEaWEu0Etf0rE+Qgo+Jd6jg5uFpBEcMKTi 70BWPeYLIJGhV9cbcJbimWy07YJNJ4mULOjXrXQeSPReR/YPztArq70Nnv8vz9Bammw6 /mGQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=W8b/eaC+VobZDvt/GfWq6iKkfI2fN2+8P12ifKip6pE=; fh=Pf3asWsPjYDpmPgxOablmWY1LfJVsv501FeL0rhvikM=; b=F7p7KIohlpk3J27UDrRWaPeM63xwO8js85P4L75WiTzrALGhfDQ//y+ttxmTam5Mit GIAXUsC/Wq3FUdrcChIkRfXsHFCvtThHW7y1+PnIZViC830e3YBWV1z0nwi3A3wvK4Ew 0cLjQM17bvQmXP/J3hETBmiOo9rJ96VuHqqZJLSHqQdKgK3TK5peE+xHkZ0NDqZOtCM5 Q0+rSlpP0g6RI2GVP+/s9xzFgmMoxyaLM/jvrdMhGglo6JiyVQaoDSryinRj43zPkLGn 1X6PG65GPNN/f54ZDfdQMGPR4EQVRoig9R1U7SAC/JfVXOLC/IwqVQ8DVMxs52DVwqf3 x8uQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-100603-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100603-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id s15-20020a17090302cf00b001dc6cd28614si7690237plk.231.2024.03.12.10.38.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 10:38:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100603-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-100603-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100603-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5A53CB23B47 for ; Tue, 12 Mar 2024 17:34:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D2FFE139564; Tue, 12 Mar 2024 17:34:29 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E00E11386AF; Tue, 12 Mar 2024 17:34:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710264869; cv=none; b=V5/kP7L4hMTNOzVx0wThXTu5BN9/YYVO0FwKbezHMoN4YKcB5NgF1t9o98SQzuKAi26IHYl3Vr356A6HMvFQ1aUEi3wTIyTqgMWuRfJ2Ixdfq49tS6errxbrXYjOVgWabU9pqKI5mnyaN3pS+lLGjUMR15OF9JU0aCRJZT/aLPw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710264869; c=relaxed/simple; bh=cRphM6Rk/wa3iqAPnSFQ/7D1dzvpZzzX3sHdjvVeTZ4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZsL2Bwf25uybWfOid2885meSu9jjg4fRY9XSnHqzf5itDmJa7ljVgWA5HxpRzJr9ryvrfFbuRyZyaNdGW3OmPwZy1Vu3BHUf9WKGkwsUrZdMKrWjxxs/iJCT57P09CmqHOd+JJk2A113MYn5JYtgIHmx/nC0TaJbs/L/wWLGaKE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 571A315BF; Tue, 12 Mar 2024 10:35:04 -0700 (PDT) Received: from e121345-lin.cambridge.arm.com (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0740E3F762; Tue, 12 Mar 2024 10:34:24 -0700 (PDT) From: Robin Murphy To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Will Deacon Cc: Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org, linux-perf-users@vger.kernel.org, jialong.yang@shingroup.cn, Shuai Xue Subject: [PATCH 01/10] perf/alibaba_uncore_drw: Use correct CPU affinity Date: Tue, 12 Mar 2024 17:34:03 +0000 Message-Id: X-Mailer: git-send-email 2.39.2.101.g768bb238c484.dirty In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Although this driver is trying to use the IRQ-multiplexing mechanism to handle context migration correctly, it's failing to make events follow the IRQ instance, instead forcing them onto a per-PMU CPU which is set once at probe time then never maintained. Fix this by using the correct CPU from the IRQ instance, and remove the erroneous per-PMU data plus the redundant check which does not mean what it thinks it means. CC: Shuai Xue Fixes: cf7b61073e45 ("drivers/perf: add DDR Sub-System Driveway PMU driver for Yitian 710 SoC") Signed-off-by: Robin Murphy --- drivers/perf/alibaba_uncore_drw_pmu.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/perf/alibaba_uncore_drw_pmu.c b/drivers/perf/alibaba_uncore_drw_pmu.c index 19d459a36be5..b37e9794823a 100644 --- a/drivers/perf/alibaba_uncore_drw_pmu.c +++ b/drivers/perf/alibaba_uncore_drw_pmu.c @@ -96,8 +96,6 @@ struct ali_drw_pmu { struct list_head pmus_node; struct ali_drw_pmu_irq *irq; - int irq_num; - int cpu; DECLARE_BITMAP(used_mask, ALI_DRW_PMU_COMMON_MAX_COUNTERS); struct perf_event *events[ALI_DRW_PMU_COMMON_MAX_COUNTERS]; int evtids[ALI_DRW_PMU_COMMON_MAX_COUNTERS]; @@ -221,7 +219,7 @@ static ssize_t ali_drw_pmu_cpumask_show(struct device *dev, { struct ali_drw_pmu *drw_pmu = to_ali_drw_pmu(dev_get_drvdata(dev)); - return cpumap_print_to_pagebuf(true, buf, cpumask_of(drw_pmu->cpu)); + return cpumap_print_to_pagebuf(true, buf, cpumask_of(drw_pmu->irq->cpu)); } static struct device_attribute ali_drw_pmu_cpumask_attr = @@ -550,11 +548,7 @@ static int ali_drw_pmu_event_init(struct perf_event *event) return -EOPNOTSUPP; } - event->cpu = drw_pmu->cpu; - if (event->cpu < 0) { - dev_err(dev, "Per-task mode not supported!\n"); - return -EOPNOTSUPP; - } + event->cpu = drw_pmu->irq->cpu; if (event->group_leader != event && !is_software_event(event->group_leader)) { @@ -701,8 +695,6 @@ static int ali_drw_pmu_probe(struct platform_device *pdev) /* clearing interrupt status */ writel(0xffffff, drw_pmu->cfg_base + ALI_DRW_PMU_OV_INTR_CLR); - drw_pmu->cpu = smp_processor_id(); - ret = ali_drw_pmu_init_irq(drw_pmu, pdev); if (ret) return ret; -- 2.39.2.101.g768bb238c484.dirty