From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0EFFC433DF for ; Wed, 17 Jun 2020 20:23:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8468A2088E for ; Wed, 17 Jun 2020 20:23:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nBilVCDD"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="KUwEnnVu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8468A2088E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-ID:Date:To:From:Subject: References:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yHHpLFGisMMf0/INnfCjaUGha73i7ST6MlkEKLyxiOU=; b=nBilVCDDkRCjNz WkXyVCFiqd3EmhizqrnDIiuJU4shx57o2OilmY8uZ+Qpu+prX+jMWVaeAJIBLD5wz17uqnoMaaV7n OX96KrEcGcHxa5iYd6OOtj4B5OOkiZe2hC38k7HKk1NeaxFTJC5q3PgrCU26VjyRfQZL/6mjphYeB rGmGMqym54F2hnPUv/bF0mmecxPUE9xYipaHkSdLmME1lqg+Y/1i0ve3/bEQC9TLCuw9hOPkJ3EzS noe3IGebXUCaNWS+36IuQBZUzNWhwjB1UnoclrrcxwbrygdkLC2xY1FKJiRZce4JefuHMknijKOJa 7Oeuw8Ni71CeBkPIAhrg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jleab-0005EG-My; Wed, 17 Jun 2020 20:23:17 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jleaY-0005Dr-PV for linux-arm-kernel@lists.infradead.org; Wed, 17 Jun 2020 20:23:16 +0000 Received: by mail-pg1-x544.google.com with SMTP id b5so1824742pgm.8 for ; Wed, 17 Jun 2020 13:23:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:in-reply-to:references :subject:from:cc:to:date:message-id:user-agent; bh=eps4Ei5p4v0C3v2/fz1NIeuMiErn9v1jAL+UTG1cAZ4=; b=KUwEnnVuoDexMEaNIhuG4RLuBUPsEa0c8mx/p66yeGTJknY5jo5chKwZr87y1L3H+5 FLevFJUpgH8KfcLzKSALX5DDxCB7+s9Mqo++j4RM5/MFcO9wC+IcBRKXSPpo8C7wyHud dj86nf9Qb1XbOuSKdsBKTtZI7uk0dkGUjuwmM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding :in-reply-to:references:subject:from:cc:to:date:message-id :user-agent; bh=eps4Ei5p4v0C3v2/fz1NIeuMiErn9v1jAL+UTG1cAZ4=; b=d6U8CNn0DAtY/3umjhVsoXFFtta+X1b+GAlvzOHdnmkK+nlW0yfmF04Kb2pRHG5CEx 7xYJkEh/841dUyfO4/gfcI4I4lSNJIKPSGEkeLuRF0EgBJeoOOLqkCwawHKpXCvixKi7 digvsOOegerQnqjCZLpewXwhsfWi2h4U7Y2DAgliLaCQN15A6eRS030bFs4IuDA5a131 3fIeGg3yDbdNebB/Y/TLLRoQoUnwNZDLUWfEJvA9dttYlK/0srROxaO7703dOBWmvsIV h8biRy/0nV/nZxGUb0YSYXJEyuOGMQ8uWhiBxSWPHgxutri69r3W5fkdDP/myYK7iuoI 8vYw== X-Gm-Message-State: AOAM533Su3aOAWoYFdtSSXSNECJSmb4+FsLA2sSEDo6yGgBOlgOmhjzi FfN6SnqsIf2DisN7CWpUUpZEiw== X-Google-Smtp-Source: ABdhPJwWQgEdOfbFG7zAFOTYs510ibb89tg4xrESspvF0suYJlxtlkHG0lqpc/fh7RGBgnoPvxH+kg== X-Received: by 2002:a65:6550:: with SMTP id a16mr452402pgw.183.1592425393877; Wed, 17 Jun 2020 13:23:13 -0700 (PDT) Received: from chromium.org ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id s21sm615275pgg.8.2020.06.17.13.23.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 13:23:13 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20200617113851.607706-7-alexandru.elisei@arm.com> References: <20200617113851.607706-1-alexandru.elisei@arm.com> <20200617113851.607706-7-alexandru.elisei@arm.com> Subject: Re: [PATCH v5 6/7] arm_pmu: Introduce pmu_irq_ops From: Stephen Boyd To: Alexandru Elisei , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Wed, 17 Jun 2020 13:23:12 -0700 Message-ID: <159242539231.62212.11549121838391298623@swboyd.mtv.corp.google.com> User-Agent: alot/0.9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200617_132314_850310_1D646990 X-CRM114-Status: UNSURE ( 9.63 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, Julien Thierry , maz@kernel.org, Will Deacon , catalin.marinas@arm.com, will@kernel.org, Julien Thierry Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Quoting Alexandru Elisei (2020-06-17 04:38:50) > diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c > index df352b334ea7..17e5952d21e4 100644 > --- a/drivers/perf/arm_pmu.c > +++ b/drivers/perf/arm_pmu.c > @@ -26,8 +26,46 @@ > > #include > > +static int armpmu_count_irq_users(const int irq); > + > +struct pmu_irq_ops { > + void (*enable_pmuirq)(unsigned int irq); > + void (*disable_pmuirq)(unsigned int irq); > + void (*free_pmuirq)(unsigned int irq, int cpu, void __percpu *devid); Does 'cpu' need to be signed? > +}; > + > +static void armpmu_free_pmuirq(unsigned int irq, int cpu, void __percpu *devid) > +{ > + free_irq(irq, per_cpu_ptr(devid, cpu)); > +} > + > +static const struct pmu_irq_ops pmuirq_ops = { > + .enable_pmuirq = enable_irq, > + .disable_pmuirq = disable_irq_nosync, > + .free_pmuirq = armpmu_free_pmuirq > +}; > + > +static void armpmu_enable_percpu_pmuirq(unsigned int irq) > +{ > + enable_percpu_irq(irq, IRQ_TYPE_NONE); > +} > + > +static void armpmu_free_percpu_pmuirq(unsigned int irq, int cpu, > + void __percpu *devid) > +{ > + if (armpmu_count_irq_users(irq) == 1) > + free_percpu_irq(irq, devid); > +} > + > +static const struct pmu_irq_ops percpu_pmuirq_ops = { > + .enable_pmuirq = armpmu_enable_percpu_pmuirq, > + .disable_pmuirq = disable_percpu_irq, > + .free_pmuirq = armpmu_free_percpu_pmuirq > +}; > + > static DEFINE_PER_CPU(struct arm_pmu *, cpu_armpmu); > static DEFINE_PER_CPU(int, cpu_irq); Same question as above. > +static DEFINE_PER_CPU(const struct pmu_irq_ops *, cpu_irq_ops); > > static inline u64 arm_pmu_event_max_period(struct perf_event *event) > { _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel