From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH] drivers/perf: arm-pmu: Handle per-interrupt affinity mask Date: Wed, 6 Jul 2016 11:39:52 +0100 Message-ID: <20160706103951.GC17925@arm.com> References: <1467379291-18413-1-git-send-email-marc.zyngier@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1467379291-18413-1-git-send-email-marc.zyngier-5wv7dgnIgG8@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Marc Zyngier Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Heiko Stuebner , cf-TNX95d0MmH7DzftRWevZcw@public.gmane.org, huangtao-TNX95d0MmH7DzftRWevZcw@public.gmane.org, jay.xu-TNX95d0MmH7DzftRWevZcw@public.gmane.org, Caesar Wang , David Wu , Brian Norris , Mark Rutland , Rob Herring List-Id: linux-rockchip.vger.kernel.org On Fri, Jul 01, 2016 at 02:21:31PM +0100, Marc Zyngier wrote: > On a big-little system, PMUs can be wired to CPUs using per CPU > interrups (PPI). In this case, it is important to make sure that > the enable/disable do happen on the right set of CPUs. > > So instead of relying on the interrupt-affinity property, we can > use the actual percpu affinity that DT exposes as part of the > interrupt specifier. The DT binding is also updated to reflect > the fact that the interrupt-affinity property shouldn't be used > in that case. [...] > - /* If we didn't manage to parse anything, claim to support all CPUs */ > - if (cpumask_weight(&pmu->supported_cpus) == 0) > - cpumask_setall(&pmu->supported_cpus); > + /* If we didn't manage to parse anything, try the interrupt affinity */ > + if (cpumask_weight(&pmu->supported_cpus) == 0) { > + if (!using_spi) { > + /* If using PPIs, check the affinity of the partition */ > + int irq = platform_get_irq(pdev, 0); > + irq_get_percpu_devid_partition(irq, > + &pmu->supported_cpus); Should we not at least propagate the failure if this returns -EINVAL? Will -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: will.deacon@arm.com (Will Deacon) Date: Wed, 6 Jul 2016 11:39:52 +0100 Subject: [PATCH] drivers/perf: arm-pmu: Handle per-interrupt affinity mask In-Reply-To: <1467379291-18413-1-git-send-email-marc.zyngier@arm.com> References: <1467379291-18413-1-git-send-email-marc.zyngier@arm.com> Message-ID: <20160706103951.GC17925@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, Jul 01, 2016 at 02:21:31PM +0100, Marc Zyngier wrote: > On a big-little system, PMUs can be wired to CPUs using per CPU > interrups (PPI). In this case, it is important to make sure that > the enable/disable do happen on the right set of CPUs. > > So instead of relying on the interrupt-affinity property, we can > use the actual percpu affinity that DT exposes as part of the > interrupt specifier. The DT binding is also updated to reflect > the fact that the interrupt-affinity property shouldn't be used > in that case. [...] > - /* If we didn't manage to parse anything, claim to support all CPUs */ > - if (cpumask_weight(&pmu->supported_cpus) == 0) > - cpumask_setall(&pmu->supported_cpus); > + /* If we didn't manage to parse anything, try the interrupt affinity */ > + if (cpumask_weight(&pmu->supported_cpus) == 0) { > + if (!using_spi) { > + /* If using PPIs, check the affinity of the partition */ > + int irq = platform_get_irq(pdev, 0); > + irq_get_percpu_devid_partition(irq, > + &pmu->supported_cpus); Should we not at least propagate the failure if this returns -EINVAL? Will From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752947AbcGFKjy (ORCPT ); Wed, 6 Jul 2016 06:39:54 -0400 Received: from foss.arm.com ([217.140.101.70]:57294 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751383AbcGFKjx (ORCPT ); Wed, 6 Jul 2016 06:39:53 -0400 Date: Wed, 6 Jul 2016 11:39:52 +0100 From: Will Deacon To: Marc Zyngier Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org, Heiko Stuebner , cf@rock-chips.com, huangtao@rock-chips.com, jay.xu@rock-chips.com, Caesar Wang , David Wu , Brian Norris , Mark Rutland , Rob Herring Subject: Re: [PATCH] drivers/perf: arm-pmu: Handle per-interrupt affinity mask Message-ID: <20160706103951.GC17925@arm.com> References: <1467379291-18413-1-git-send-email-marc.zyngier@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1467379291-18413-1-git-send-email-marc.zyngier@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 01, 2016 at 02:21:31PM +0100, Marc Zyngier wrote: > On a big-little system, PMUs can be wired to CPUs using per CPU > interrups (PPI). In this case, it is important to make sure that > the enable/disable do happen on the right set of CPUs. > > So instead of relying on the interrupt-affinity property, we can > use the actual percpu affinity that DT exposes as part of the > interrupt specifier. The DT binding is also updated to reflect > the fact that the interrupt-affinity property shouldn't be used > in that case. [...] > - /* If we didn't manage to parse anything, claim to support all CPUs */ > - if (cpumask_weight(&pmu->supported_cpus) == 0) > - cpumask_setall(&pmu->supported_cpus); > + /* If we didn't manage to parse anything, try the interrupt affinity */ > + if (cpumask_weight(&pmu->supported_cpus) == 0) { > + if (!using_spi) { > + /* If using PPIs, check the affinity of the partition */ > + int irq = platform_get_irq(pdev, 0); > + irq_get_percpu_devid_partition(irq, > + &pmu->supported_cpus); Should we not at least propagate the failure if this returns -EINVAL? Will