Re: [PATCH v2] reset: Exclusive resets must be dedicated to a single hardware block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2018-10-05 at 14:31 +0200, Geert Uytterhoeven wrote:
[...]
> > > > +                     eq = (args2.np == args.np &&
> > > > +                           args2.args_count == args.args_count &&
> > > > +                           !memcmp(args2.args, args.args,
> > > > +                                   args.args_count * sizeof(args.args[0])));
> > 
> > As there's at least one other function in -next that compares of_phandle_args,
> > I will add a helper of_phandle_args_eq().
> > 
> > > > +                     of_node_put(args2.np);
> > > > +                     if (eq)
> > > 
> > > Emitting a loud warning here could be very helpful if it contains
> > > both the reset controller node and the reset index, as well as the
> 
> Actually on DT-based systems, the index is a driver-specific
> implementation detail, and may differ from the actual reset specifier in DT.
> E.g. on R-Car systems, DT uses a human-readable representation matching
> the datasheet, while internally, the driver uses a packed representation.
> Hence printing the index may confuse the user.
> 
> For lookup-based systems, this is different.

Correct. I'm so used to #reset-cells = <1>, it's hard to remember the
exceptions. So let's not try to print indices or args.

> > > consumer nodes: node and node2.
> > 
> > Indeed, will do, also for lookup resets.
> > 
> > We already have of_print_phandle_args(), but that is a bit inflexible.
> > Adding support for "%pOFa" looks like the modern thing to do.
> 
> Scrap that: of_phandle_args is not derived from a device_node, so %pOFa
> is not appropriate (and would crash instead of fall back to a pointer before
> %pOFa support is implemented). And without more users, it doesn't make much
> sense to go for a new type (e.g. "%pOA")...
> 
> Actually, printing the full reset specifier is not needed. A message like
> 
>     /soc/pwm@e6e31000 and /soc/pwm@e6e30000 share a reset on
> /soc/clock-controller@e6150000
> 
> should give sufficient clue to the user.

Yes. You could also pass con_id into __of_reset_is_exclusive and print
that. It would be nice to indicate which consumer requested exclusive
access.

regards
Philipp



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux