Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-23 Thread Mike Leach
Also agree with Suzuki's excellent summary. A couple of notes on using EDPRCR The logic for this assuming a correctly implemented system should be something like. if (prsr() == powered_down) { // if we are powered down request power up. sw_unlock() // ensure that the sw lock

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-23 Thread Mike Leach
Also agree with Suzuki's excellent summary. A couple of notes on using EDPRCR The logic for this assuming a correctly implemented system should be something like. if (prsr() == powered_down) { // if we are powered down request power up. sw_unlock() // ensure that the sw lock

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-23 Thread Leo Yan
On Wed, Mar 22, 2017 at 05:25:50PM +, Sudeep Holla wrote: > > > On 22/03/17 17:09, Suzuki K Poulose wrote: > > On 22/03/17 16:17, Sudeep Holla wrote: > > [...] > > >> > >> Point taken. So we could just specify that all necessary power > >> domains need to be on for proper functionality

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-23 Thread Leo Yan
On Wed, Mar 22, 2017 at 05:25:50PM +, Sudeep Holla wrote: > > > On 22/03/17 17:09, Suzuki K Poulose wrote: > > On 22/03/17 16:17, Sudeep Holla wrote: > > [...] > > >> > >> Point taken. So we could just specify that all necessary power > >> domains need to be on for proper functionality

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-22 Thread Sudeep Holla
On 22/03/17 17:09, Suzuki K Poulose wrote: > On 22/03/17 16:17, Sudeep Holla wrote: [...] >> >> Point taken. So we could just specify that all necessary power >> domains need to be on for proper functionality for this feature and >> that it's highly platform specific instead of mixing

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-22 Thread Sudeep Holla
On 22/03/17 17:09, Suzuki K Poulose wrote: > On 22/03/17 16:17, Sudeep Holla wrote: [...] >> >> Point taken. So we could just specify that all necessary power >> domains need to be on for proper functionality for this feature and >> that it's highly platform specific instead of mixing

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-22 Thread Suzuki K Poulose
On 22/03/17 16:17, Sudeep Holla wrote: On 22/03/17 15:45, Mike Leach wrote: On 22 March 2017 at 14:07, Sudeep Holla wrote: On 22/03/17 12:54, Mike Leach wrote: On 21 March 2017 at 15:39, Sudeep Holla > wrote:

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-22 Thread Suzuki K Poulose
On 22/03/17 16:17, Sudeep Holla wrote: On 22/03/17 15:45, Mike Leach wrote: On 22 March 2017 at 14:07, Sudeep Holla wrote: On 22/03/17 12:54, Mike Leach wrote: On 21 March 2017 at 15:39, Sudeep Holla mailto:sudeep.ho...@arm.com>> wrote: [...] I disagree with this approach. One of

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-22 Thread Sudeep Holla
On 22/03/17 16:01, Leo Yan wrote: > On Wed, Mar 22, 2017 at 02:07:47PM +, Sudeep Holla wrote: [...] >> >> We can always do that unconditionally. If implementations don't honor >> those bits, it's different. If they hang on accessing something which is >> on debug power domain and not on

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-22 Thread Sudeep Holla
On 22/03/17 16:01, Leo Yan wrote: > On Wed, Mar 22, 2017 at 02:07:47PM +, Sudeep Holla wrote: [...] >> >> We can always do that unconditionally. If implementations don't honor >> those bits, it's different. If they hang on accessing something which is >> on debug power domain and not on

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-22 Thread Sudeep Holla
On 22/03/17 15:45, Mike Leach wrote: > On 22 March 2017 at 14:07, Sudeep Holla wrote: >> >> >> On 22/03/17 12:54, Mike Leach wrote: >>> >>> >>> On 21 March 2017 at 15:39, Sudeep Holla >> > wrote: >>> >> [...] >> >>> I

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-22 Thread Sudeep Holla
On 22/03/17 15:45, Mike Leach wrote: > On 22 March 2017 at 14:07, Sudeep Holla wrote: >> >> >> On 22/03/17 12:54, Mike Leach wrote: >>> >>> >>> On 21 March 2017 at 15:39, Sudeep Holla >> > wrote: >>> >> [...] >> >>> I disagree with this approach. One of the main

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-22 Thread Leo Yan
On Wed, Mar 22, 2017 at 02:07:47PM +, Sudeep Holla wrote: > On 22/03/17 12:54, Mike Leach wrote: > > On 21 March 2017 at 15:39, Sudeep Holla > > wrote: > > > [...] > > > I disagree with this approach. One of the main usefulness of such >

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-22 Thread Leo Yan
On Wed, Mar 22, 2017 at 02:07:47PM +, Sudeep Holla wrote: > On 22/03/17 12:54, Mike Leach wrote: > > On 21 March 2017 at 15:39, Sudeep Holla > > wrote: > > > [...] > > > I disagree with this approach. One of the main usefulness of such > > self hosted debug

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-22 Thread Mike Leach
On 22 March 2017 at 14:07, Sudeep Holla wrote: > > > On 22/03/17 12:54, Mike Leach wrote: >> >> >> On 21 March 2017 at 15:39, Sudeep Holla > > wrote: >> > [...] > >> I disagree with this approach. One of the main usefulness

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-22 Thread Mike Leach
On 22 March 2017 at 14:07, Sudeep Holla wrote: > > > On 22/03/17 12:54, Mike Leach wrote: >> >> >> On 21 March 2017 at 15:39, Sudeep Holla > > wrote: >> > [...] > >> I disagree with this approach. One of the main usefulness of such >> self hosted debug feature is to

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-22 Thread Sudeep Holla
On 22/03/17 12:54, Mike Leach wrote: > > > On 21 March 2017 at 15:39, Sudeep Holla > wrote: > [...] > I disagree with this approach. One of the main usefulness of such > self hosted debug feature is to debug issues around features like >

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-22 Thread Sudeep Holla
On 22/03/17 12:54, Mike Leach wrote: > > > On 21 March 2017 at 15:39, Sudeep Holla > wrote: > [...] > I disagree with this approach. One of the main usefulness of such > self hosted debug feature is to debug issues around features like > cpuidle. Adding

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-21 Thread Sudeep Holla
On 03/03/17 06:00, Leo Yan wrote: > Coresight includes debug module and usually the module connects with CPU > debug logic. ARMv8 architecture reference manual (ARM DDI 0487A.k) has > description for related info in "Part H: External Debug". > > Chapter H7 "The Sample-based Profiling Extension"

Re: [PATCH v3 3/5] coresight: add support for debug module

2017-03-21 Thread Sudeep Holla
On 03/03/17 06:00, Leo Yan wrote: > Coresight includes debug module and usually the module connects with CPU > debug logic. ARMv8 architecture reference manual (ARM DDI 0487A.k) has > description for related info in "Part H: External Debug". > > Chapter H7 "The Sample-based Profiling Extension"

Re: [v3 3/5] coresight: add support for debug module

2017-03-21 Thread Mathieu Poirier
On Tue, Mar 21, 2017 at 07:47:11PM +0800, Leo Yan wrote: > On Tue, Mar 21, 2017 at 10:16:45AM +, Suzuki K Poulose wrote: > > [...] > > > >>In my opinion booting with "nohlt" on the cmd line is sufficient to > > >>determine if we should use the driver or not. That way we also avoid > >

Re: [v3 3/5] coresight: add support for debug module

2017-03-21 Thread Mathieu Poirier
On Tue, Mar 21, 2017 at 07:47:11PM +0800, Leo Yan wrote: > On Tue, Mar 21, 2017 at 10:16:45AM +, Suzuki K Poulose wrote: > > [...] > > > >>In my opinion booting with "nohlt" on the cmd line is sufficient to > > >>determine if we should use the driver or not. That way we also avoid > >

Re: [v3 3/5] coresight: add support for debug module

2017-03-21 Thread Leo Yan
On Tue, Mar 21, 2017 at 10:16:45AM +, Suzuki K Poulose wrote: [...] > >>In my opinion booting with "nohlt" on the cmd line is sufficient to > >>determine if we should use the driver or not. That way we also avoid > >>declaring yet another sysfs flag, something I really want to avoid. > > >

Re: [v3 3/5] coresight: add support for debug module

2017-03-21 Thread Leo Yan
On Tue, Mar 21, 2017 at 10:16:45AM +, Suzuki K Poulose wrote: [...] > >>In my opinion booting with "nohlt" on the cmd line is sufficient to > >>determine if we should use the driver or not. That way we also avoid > >>declaring yet another sysfs flag, something I really want to avoid. > > >

Re: [v3 3/5] coresight: add support for debug module

2017-03-21 Thread Suzuki K Poulose
On 21/03/17 02:59, Leo Yan wrote: On Mon, Mar 20, 2017 at 10:40:00AM -0600, Mathieu Poirier wrote: [...] If we don't check for "nohlt" some platform may freeze, others may work. If we mandate that "nohlt" be present on the kernel cmd line it works in all cases. As such mandating that "nohlt"

Re: [v3 3/5] coresight: add support for debug module

2017-03-21 Thread Suzuki K Poulose
On 21/03/17 02:59, Leo Yan wrote: On Mon, Mar 20, 2017 at 10:40:00AM -0600, Mathieu Poirier wrote: [...] If we don't check for "nohlt" some platform may freeze, others may work. If we mandate that "nohlt" be present on the kernel cmd line it works in all cases. As such mandating that "nohlt"

Re: [v3 3/5] coresight: add support for debug module

2017-03-20 Thread Leo Yan
On Mon, Mar 20, 2017 at 10:40:00AM -0600, Mathieu Poirier wrote: [...] > >>> If we don't check for "nohlt" some platform may freeze, others may work. > >>> If we > >>> mandate that "nohlt" be present on the kernel cmd line it works in all > >>> cases. > >>> As such mandating that "nohlt" be

Re: [v3 3/5] coresight: add support for debug module

2017-03-20 Thread Leo Yan
On Mon, Mar 20, 2017 at 10:40:00AM -0600, Mathieu Poirier wrote: [...] > >>> If we don't check for "nohlt" some platform may freeze, others may work. > >>> If we > >>> mandate that "nohlt" be present on the kernel cmd line it works in all > >>> cases. > >>> As such mandating that "nohlt" be

Re: [v3 3/5] coresight: add support for debug module

2017-03-20 Thread Mathieu Poirier
On 17 March 2017 at 10:47, Suzuki K Poulose wrote: > On 17/03/17 16:28, Leo Yan wrote: >> >> On Fri, Mar 17, 2017 at 09:50:07AM -0600, Mathieu Poirier wrote: >> >> [...] >> >>> If we don't check for "nohlt" some platform may freeze, others may work. >>> If we >>> mandate

Re: [v3 3/5] coresight: add support for debug module

2017-03-20 Thread Mathieu Poirier
On 17 March 2017 at 10:47, Suzuki K Poulose wrote: > On 17/03/17 16:28, Leo Yan wrote: >> >> On Fri, Mar 17, 2017 at 09:50:07AM -0600, Mathieu Poirier wrote: >> >> [...] >> >>> If we don't check for "nohlt" some platform may freeze, others may work. >>> If we >>> mandate that "nohlt" be present

Re: [v3 3/5] coresight: add support for debug module

2017-03-20 Thread Leo Yan
On Fri, Mar 17, 2017 at 04:47:54PM +, Suzuki K Poulose wrote: > On 17/03/17 16:28, Leo Yan wrote: > >On Fri, Mar 17, 2017 at 09:50:07AM -0600, Mathieu Poirier wrote: > > > >[...] > > > >>If we don't check for "nohlt" some platform may freeze, others may work. > >>If we > >>mandate that

Re: [v3 3/5] coresight: add support for debug module

2017-03-20 Thread Leo Yan
On Fri, Mar 17, 2017 at 04:47:54PM +, Suzuki K Poulose wrote: > On 17/03/17 16:28, Leo Yan wrote: > >On Fri, Mar 17, 2017 at 09:50:07AM -0600, Mathieu Poirier wrote: > > > >[...] > > > >>If we don't check for "nohlt" some platform may freeze, others may work. > >>If we > >>mandate that

Re: [v3 3/5] coresight: add support for debug module

2017-03-17 Thread Suzuki K Poulose
On 17/03/17 16:28, Leo Yan wrote: On Fri, Mar 17, 2017 at 09:50:07AM -0600, Mathieu Poirier wrote: [...] If we don't check for "nohlt" some platform may freeze, others may work. If we mandate that "nohlt" be present on the kernel cmd line it works in all cases. As such mandating that "nohlt"

Re: [v3 3/5] coresight: add support for debug module

2017-03-17 Thread Suzuki K Poulose
On 17/03/17 16:28, Leo Yan wrote: On Fri, Mar 17, 2017 at 09:50:07AM -0600, Mathieu Poirier wrote: [...] If we don't check for "nohlt" some platform may freeze, others may work. If we mandate that "nohlt" be present on the kernel cmd line it works in all cases. As such mandating that "nohlt"

Re: [v3 3/5] coresight: add support for debug module

2017-03-17 Thread Leo Yan
On Fri, Mar 17, 2017 at 09:50:07AM -0600, Mathieu Poirier wrote: [...] > If we don't check for "nohlt" some platform may freeze, others may work. If > we > mandate that "nohlt" be present on the kernel cmd line it works in all cases. > As such mandating that "nohlt" be present is a better way

Re: [v3 3/5] coresight: add support for debug module

2017-03-17 Thread Leo Yan
On Fri, Mar 17, 2017 at 09:50:07AM -0600, Mathieu Poirier wrote: [...] > If we don't check for "nohlt" some platform may freeze, others may work. If > we > mandate that "nohlt" be present on the kernel cmd line it works in all cases. > As such mandating that "nohlt" be present is a better way

Re: [v3 3/5] coresight: add support for debug module

2017-03-17 Thread Mathieu Poirier
On Fri, Mar 17, 2017 at 06:13:28PM +0800, Leo Yan wrote: > On Wed, Mar 15, 2017 at 02:41:59PM -0600, Mathieu Poirier wrote: > > On 15 March 2017 at 10:44, Suzuki K Poulose wrote: > > > On 13/03/17 16:56, Mathieu Poirier wrote: > > >> On Fri, Mar 10, 2017 at 02:29:53PM

Re: [v3 3/5] coresight: add support for debug module

2017-03-17 Thread Mathieu Poirier
On Fri, Mar 17, 2017 at 06:13:28PM +0800, Leo Yan wrote: > On Wed, Mar 15, 2017 at 02:41:59PM -0600, Mathieu Poirier wrote: > > On 15 March 2017 at 10:44, Suzuki K Poulose wrote: > > > On 13/03/17 16:56, Mathieu Poirier wrote: > > >> On Fri, Mar 10, 2017 at 02:29:53PM +, Suzuki K Poulose

Re: [v3 3/5] coresight: add support for debug module

2017-03-17 Thread Leo Yan
On Wed, Mar 15, 2017 at 02:41:59PM -0600, Mathieu Poirier wrote: > On 15 March 2017 at 10:44, Suzuki K Poulose wrote: > > On 13/03/17 16:56, Mathieu Poirier wrote: > >> On Fri, Mar 10, 2017 at 02:29:53PM +, Suzuki K Poulose wrote: [...] > >>> Btw, I don't see any PM

Re: [v3 3/5] coresight: add support for debug module

2017-03-17 Thread Leo Yan
On Wed, Mar 15, 2017 at 02:41:59PM -0600, Mathieu Poirier wrote: > On 15 March 2017 at 10:44, Suzuki K Poulose wrote: > > On 13/03/17 16:56, Mathieu Poirier wrote: > >> On Fri, Mar 10, 2017 at 02:29:53PM +, Suzuki K Poulose wrote: [...] > >>> Btw, I don't see any PM calls to make sure the

Re: [v3 3/5] coresight: add support for debug module

2017-03-15 Thread Mathieu Poirier
On 15 March 2017 at 10:44, Suzuki K Poulose wrote: > On 13/03/17 16:56, Mathieu Poirier wrote: >> >> On Fri, Mar 10, 2017 at 02:29:53PM +, Suzuki K Poulose wrote: >> >> + >> + put_online_cpus(); >> + >> + if (!debug_count++) >> +

Re: [v3 3/5] coresight: add support for debug module

2017-03-15 Thread Mathieu Poirier
On 15 March 2017 at 10:44, Suzuki K Poulose wrote: > On 13/03/17 16:56, Mathieu Poirier wrote: >> >> On Fri, Mar 10, 2017 at 02:29:53PM +, Suzuki K Poulose wrote: >> >> + >> + put_online_cpus(); >> + >> + if (!debug_count++) >> +

Re: [v3 3/5] coresight: add support for debug module

2017-03-15 Thread Suzuki K Poulose
On 13/03/17 16:56, Mathieu Poirier wrote: On Fri, Mar 10, 2017 at 02:29:53PM +, Suzuki K Poulose wrote: + + put_online_cpus(); + + if (!debug_count++) + atomic_notifier_chain_register(_notifier_list, + _notifier); + +

Re: [v3 3/5] coresight: add support for debug module

2017-03-15 Thread Suzuki K Poulose
On 13/03/17 16:56, Mathieu Poirier wrote: On Fri, Mar 10, 2017 at 02:29:53PM +, Suzuki K Poulose wrote: + + put_online_cpus(); + + if (!debug_count++) + atomic_notifier_chain_register(_notifier_list, + _notifier); + +

Re: [v3 3/5] coresight: add support for debug module

2017-03-13 Thread Mathieu Poirier
On Fri, Mar 10, 2017 at 02:29:53PM +, Suzuki K Poulose wrote: > On 09/03/17 17:59, Leo Yan wrote: > >Hi Suziku, > >>The problem is, it is not guaranteed that the EDPCSR_Hi, EDCIDSR & EDVIDSR > >>are > >>updated as a side effect of a memory mapped access (which is what we do > >>here) to the

Re: [v3 3/5] coresight: add support for debug module

2017-03-13 Thread Mathieu Poirier
On Fri, Mar 10, 2017 at 02:29:53PM +, Suzuki K Poulose wrote: > On 09/03/17 17:59, Leo Yan wrote: > >Hi Suziku, > >>The problem is, it is not guaranteed that the EDPCSR_Hi, EDCIDSR & EDVIDSR > >>are > >>updated as a side effect of a memory mapped access (which is what we do > >>here) to the

Re: [v3 3/5] coresight: add support for debug module

2017-03-13 Thread Mathieu Poirier
On Fri, Mar 10, 2017 at 01:59:15AM +0800, Leo Yan wrote: > Hi Suziku, > > Thanks for reviewing, please see some replying. > > On Thu, Mar 09, 2017 at 04:53:05PM +, Suzuki K Poulose wrote: > > On 03/03/17 06:00, Leo Yan wrote: > > >Coresight includes debug module and usually the module

Re: [v3 3/5] coresight: add support for debug module

2017-03-13 Thread Mathieu Poirier
On Fri, Mar 10, 2017 at 01:59:15AM +0800, Leo Yan wrote: > Hi Suziku, > > Thanks for reviewing, please see some replying. > > On Thu, Mar 09, 2017 at 04:53:05PM +, Suzuki K Poulose wrote: > > On 03/03/17 06:00, Leo Yan wrote: > > >Coresight includes debug module and usually the module

Re: [v3 3/5] coresight: add support for debug module

2017-03-13 Thread Leo Yan
Hi Suzuki, On Fri, Mar 10, 2017 at 02:29:53PM +, Suzuki K Poulose wrote: [...] > >>So we cannot really rely on the values in EDVIDSR which we use to make > >>further decisions. So I > >>am wondering if this is really guranteed to be useful. > > > >So this is caused by Software lock is

Re: [v3 3/5] coresight: add support for debug module

2017-03-13 Thread Leo Yan
Hi Suzuki, On Fri, Mar 10, 2017 at 02:29:53PM +, Suzuki K Poulose wrote: [...] > >>So we cannot really rely on the values in EDVIDSR which we use to make > >>further decisions. So I > >>am wondering if this is really guranteed to be useful. > > > >So this is caused by Software lock is

Re: [v3 3/5] coresight: add support for debug module

2017-03-10 Thread Suzuki K Poulose
On 09/03/17 17:59, Leo Yan wrote: Hi Suziku, The problem is, it is not guaranteed that the EDPCSR_Hi, EDCIDSR & EDVIDSR are updated as a side effect of a memory mapped access (which is what we do here) to the EDPCSR_Lo. Section H.7.1.2 : Reads of EDPCSRs (in ARM DDI 0487A.k) : "The

Re: [v3 3/5] coresight: add support for debug module

2017-03-10 Thread Suzuki K Poulose
On 09/03/17 17:59, Leo Yan wrote: Hi Suziku, The problem is, it is not guaranteed that the EDPCSR_Hi, EDCIDSR & EDVIDSR are updated as a side effect of a memory mapped access (which is what we do here) to the EDPCSR_Lo. Section H.7.1.2 : Reads of EDPCSRs (in ARM DDI 0487A.k) : "The

Re: [v3 3/5] coresight: add support for debug module

2017-03-09 Thread Leo Yan
Hi Suziku, Thanks for reviewing, please see some replying. On Thu, Mar 09, 2017 at 04:53:05PM +, Suzuki K Poulose wrote: > On 03/03/17 06:00, Leo Yan wrote: > >Coresight includes debug module and usually the module connects with CPU > >debug logic. ARMv8 architecture reference manual (ARM

Re: [v3 3/5] coresight: add support for debug module

2017-03-09 Thread Leo Yan
Hi Suziku, Thanks for reviewing, please see some replying. On Thu, Mar 09, 2017 at 04:53:05PM +, Suzuki K Poulose wrote: > On 03/03/17 06:00, Leo Yan wrote: > >Coresight includes debug module and usually the module connects with CPU > >debug logic. ARMv8 architecture reference manual (ARM

Re: [v3 3/5] coresight: add support for debug module

2017-03-09 Thread Suzuki K Poulose
On 03/03/17 06:00, Leo Yan wrote: Coresight includes debug module and usually the module connects with CPU debug logic. ARMv8 architecture reference manual (ARM DDI 0487A.k) has description for related info in "Part H: External Debug". Chapter H7 "The Sample-based Profiling Extension"

Re: [v3 3/5] coresight: add support for debug module

2017-03-09 Thread Suzuki K Poulose
On 03/03/17 06:00, Leo Yan wrote: Coresight includes debug module and usually the module connects with CPU debug logic. ARMv8 architecture reference manual (ARM DDI 0487A.k) has description for related info in "Part H: External Debug". Chapter H7 "The Sample-based Profiling Extension"

[PATCH v3 3/5] coresight: add support for debug module

2017-03-03 Thread Leo Yan
Coresight includes debug module and usually the module connects with CPU debug logic. ARMv8 architecture reference manual (ARM DDI 0487A.k) has description for related info in "Part H: External Debug". Chapter H7 "The Sample-based Profiling Extension" introduces several sampling registers, e.g.

[PATCH v3 3/5] coresight: add support for debug module

2017-03-03 Thread Leo Yan
Coresight includes debug module and usually the module connects with CPU debug logic. ARMv8 architecture reference manual (ARM DDI 0487A.k) has description for related info in "Part H: External Debug". Chapter H7 "The Sample-based Profiling Extension" introduces several sampling registers, e.g.