Re: [PATCH v2] regmap: introduce regmap_name to fix syscon regmap trace events

2015-03-19 Thread Mark Brown
On Thu, Mar 19, 2015 at 03:58:45PM -0400, Steven Rostedt wrote:

> I pulled your regmap tree:

>  git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git

> And looked at each of the branches, and I don't see this applied. Is
> there another tree I should look at?

Huh, my push script seems to have missed pushing it (there's some issue
with spotty connectivity been causing problems).  Anyway, it's there now
after a kick.


signature.asc
Description: Digital signature


Re: [PATCH v2] regmap: introduce regmap_name to fix syscon regmap trace events

2015-03-19 Thread Steven Rostedt
On Thu, 19 Mar 2015 19:26:12 +
Mark Brown  wrote:

> On Thu, Mar 19, 2015 at 03:22:27PM -0400, Steven Rostedt wrote:
> > Mark Brown  wrote:
> 
> > > > The regmap trace events expect it to point to a valid struct device and 
> > > > feed
> > > > it to dev_name():
> 
> > > Applied, thanks.
> 
> > Would you mind me sending you a patch that moves the trace file?
> 
> No, please go ahead!

OK.

I pulled your regmap tree:

 git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git

And looked at each of the branches, and I don't see this applied. Is
there another tree I should look at?

-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] regmap: introduce regmap_name to fix syscon regmap trace events

2015-03-19 Thread Mark Brown
On Thu, Mar 19, 2015 at 03:22:27PM -0400, Steven Rostedt wrote:
> Mark Brown  wrote:

> > > The regmap trace events expect it to point to a valid struct device and 
> > > feed
> > > it to dev_name():

> > Applied, thanks.

> Would you mind me sending you a patch that moves the trace file?

No, please go ahead!


signature.asc
Description: Digital signature


Re: [PATCH v2] regmap: introduce regmap_name to fix syscon regmap trace events

2015-03-19 Thread Steven Rostedt
On Mon, 9 Mar 2015 18:13:54 +
Mark Brown  wrote:

> On Mon, Mar 09, 2015 at 12:20:13PM +0100, Philipp Zabel wrote:
> > This patch fixes a NULL pointer dereference when enabling regmap event
> > tracing in the presence of a syscon regmap, introduced by commit 
> > bdb0066df96e
> > ("mfd: syscon: Decouple syscon interface from platform devices").
> > That patch introduced syscon regmaps that have their dev field set to NULL.
> > The regmap trace events expect it to point to a valid struct device and feed
> > it to dev_name():
> 
> Applied, thanks.

Would you mind me sending you a patch that moves the trace file?

-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] regmap: introduce regmap_name to fix syscon regmap trace events

2015-03-19 Thread Steven Rostedt
On Mon,  9 Mar 2015 12:20:13 +0100
Philipp Zabel  wrote:

Sorry for the late repy, I just noticed this email.

> diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h
> index 23d5615..22317d2 100644
> --- a/include/trace/events/regmap.h
> +++ b/include/trace/events/regmap.h
> @@ -7,27 +7,26 @@
>  #include 
>  #include 
>  
> -struct device;
> -struct regmap;
> +#include "../../../drivers/base/regmap/internal.h"

Ouch, that is nasty!

Can we move this regmap.h file into drivers/base/regmap/ directory.
The trace_event sample code in samples/trace_events/ explains how to do
that, but for those that are too lazy to read that, I'll explain it here
too ;-)

In drivers/base/regmap/Makefile, add:

CFLAGS_regmap.o = -I$(src)

Then in this header file add at the bottom just before the include of
trace/define_trace.h:

#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .

Note, if you want to rename this file to something like regmap_trace.h,
then you also need to add:

#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE regmap_trace

And it should all work out. Then you don't need that ugly include and
you can just add:

#include "internal.h"

-- Steve



>  
>  /*
>   * Log register events
>   */
>  DECLARE_EVENT_CLASS(regmap_reg,
>  
> - TP_PROTO(struct device *dev, unsigned int reg,
> + TP_PROTO(struct regmap *map, unsigned int reg,
>unsigned int val),
>  
> - TP_ARGS(dev, reg, val),
> + TP_ARGS(map, reg, val),
>  
>   TP_STRUCT__entry(
> - __string(   name,   dev_name(dev)   )
> - __field(unsigned int,   reg )
> - __field(unsigned int,   val )
> + __string(   name,   regmap_name(map))
> + __field(unsigned int,   reg )
> + __field(unsigned int,   val )
>   ),
>  
>   TP_fast_assign(
> - __assign_str(name, dev_name(dev));
> + __assign_str(name, regmap_name(map));
>   __entry->reg = reg;
>   __entry->val = val;
>   ),
> @@ -39,45 +38,45 @@ DECLARE_EVENT_CLASS(regmap_reg,
>  
>  DEFINE_EVENT(regmap_reg, regmap_reg_write,
>  
> - TP_PROTO(struct device *dev, unsigned int reg,
> + TP_PROTO(struct regmap *map, unsigned int reg,
>unsigned int val),
>  
> - TP_ARGS(dev, reg, val)
> + TP_ARGS(map, reg, val)
>  
>  );
>  
>  DEFINE_EVENT(regmap_reg, regmap_reg_read,
>  
> - TP_PROTO(struct device *dev, unsigned int reg,
> + TP_PROTO(struct regmap *map, unsigned int reg,
>unsigned int val),
>  
> - TP_ARGS(dev, reg, val)
> + TP_ARGS(map, reg, val)
>  
>  );
>  
>  DEFINE_EVENT(regmap_reg, regmap_reg_read_cache,
>  
> - TP_PROTO(struct device *dev, unsigned int reg,
> + TP_PROTO(struct regmap *map, unsigned int reg,
>unsigned int val),
>  
> - TP_ARGS(dev, reg, val)
> + TP_ARGS(map, reg, val)
>  
>  );
>  
>  DECLARE_EVENT_CLASS(regmap_block,
>  
> - TP_PROTO(struct device *dev, unsigned int reg, int count),
> + TP_PROTO(struct regmap *map, unsigned int reg, int count),
>  
> - TP_ARGS(dev, reg, count),
> + TP_ARGS(map, reg, count),
>  
>   TP_STRUCT__entry(
> - __string(   name,   dev_name(dev)   )
> - __field(unsigned int,   reg )
> - __field(int,count   )
> + __string(   name,   regmap_name(map))
> + __field(unsigned int,   reg )
> + __field(int,count   )
>   ),
>  
>   TP_fast_assign(
> - __assign_str(name, dev_name(dev));
> + __assign_str(name, regmap_name(map));
>   __entry->reg = reg;
>   __entry->count = count;
>   ),
> @@ -89,48 +88,48 @@ DECLARE_EVENT_CLASS(regmap_block,
>  
>  DEFINE_EVENT(regmap_block, regmap_hw_read_start,
>  
> - TP_PROTO(struct device *dev, unsigned int reg, int count),
> + TP_PROTO(struct regmap *map, unsigned int reg, int count),
>  
> - TP_ARGS(dev, reg, count)
> + TP_ARGS(map, reg, count)
>  );
>  
>  DEFINE_EVENT(regmap_block, regmap_hw_read_done,
>  
> - TP_PROTO(struct device *dev, unsigned int reg, int count),
> + TP_PROTO(struct regmap *map, unsigned int reg, int count),
>  
> - TP_ARGS(dev, reg, count)
> + TP_ARGS(map, reg, count)
>  );
>  
>  DEFINE_EVENT(regmap_block, regmap_hw_write_start,
>  
> - TP_PROTO(struct device *dev, unsigned int reg, int count),
> + TP_PROTO(struct regmap *map, unsigned int reg, int count),
>  
> - TP_ARGS(dev, reg, count)
> + TP_ARGS(map, reg, count)
>  );
>  
>  DEFINE_EVENT(regmap_block, regmap_hw_write_done,
>  
> - TP_PROTO(struct device *dev, unsigned int reg, int count),
> + TP_PROTO(struct reg

Re: [PATCH v2] regmap: introduce regmap_name to fix syscon regmap trace events

2015-03-09 Thread Mark Brown
On Mon, Mar 09, 2015 at 12:20:13PM +0100, Philipp Zabel wrote:
> This patch fixes a NULL pointer dereference when enabling regmap event
> tracing in the presence of a syscon regmap, introduced by commit bdb0066df96e
> ("mfd: syscon: Decouple syscon interface from platform devices").
> That patch introduced syscon regmaps that have their dev field set to NULL.
> The regmap trace events expect it to point to a valid struct device and feed
> it to dev_name():

Applied, thanks.


signature.asc
Description: Digital signature