[RFC v2 2/3] pinctrl: Implementation of the generic scmi-pinctrl driver

Cristian Marussi cristian.marussi at arm.com
Fri May 12 02:04:41 PDT 2023


On Thu, May 11, 2023 at 01:15:46PM +0000, Oleksii Moisieiev wrote:
> Hello Andy,
> 
> On 05.05.23 23:35, andy.shevchenko at gmail.com wrote:
> > Wed, Apr 26, 2023 at 01:26:37PM +0000, Oleksii Moisieiev kirjoitti:
> >> scmi-pinctrl driver implements pinctrl driver interface and using
> >> SCMI protocol to redirect messages from pinctrl subsystem SDK to
> >> SCP firmware, which does the changes in HW.
> >>
> >> This setup expects SCP firmware (or similar system, such as ATF)
> >> to be installed on the platform, which implements pinctrl driver
> >> for the specific platform.
> >>
> >> SCMI-Pinctrl driver should be configured from the device-tree and uses
> >> generic device-tree mappings for the configuration.
> > 
> > ...
> > 
> >> +#include <linux/device.h>
> >> +#include <linux/err.h>
> > 
> >> +#include <linux/of.h>
> > 
> > I do not see any user of this header. Do you?
> > 
> Yes, thanks. Removing
> 
> >> +#include <linux/module.h>
> >> +#include <linux/seq_file.h>
> >> +
> >> +#include <linux/pinctrl/machine.h>
> >> +#include <linux/pinctrl/pinconf.h>
> >> +#include <linux/pinctrl/pinconf-generic.h>
> >> +#include <linux/pinctrl/pinctrl.h>
> >> +#include <linux/pinctrl/pinmux.h>
> > 
> >> +#include <linux/scmi_protocol.h>
> >> +#include <linux/slab.h>
> > 
> > Please, move these two to the upper group of the generic headers.
> > 
> Thanks, fixed.
> 
> >> +struct scmi_pinctrl_funcs {
> >> +	unsigned int num_groups;
> >> +	const char **groups;
> >> +};
> > 
> > Please, use struct pinfunction.
> >
> I can't use pincfunction here because it has the following groups 
> definition:
> const char * const *groups;
> 
> Which is meant to be constantly allocated.
> So I when I try to gather list of groups in 
> pinctrl_scmi_get_function_groups I will receive compilation error.
> 

Maybe this is a further signal that we should re-evaluate the benefits of
the lazy allocations you now perform during protocol initialization
instead of querying and allocating statically all the info structs about
existing resources.

Not saying that is necessarily bad, I understood your points about reducing
the number of SCMI queries during boot and let pinctrl subsystem trigger only
the strictly needed one, just saying maybe good to reason a bit more about this
once V3 is posted. (i.e. I could bother you more :P ..)

Thanks,
Cristian

P.S. [off-topic]: remember to use get_maintainer.pl as advised elsewhere
to include proper maintainers (and their bots)



More information about the linux-arm-kernel mailing list