Re: [PATCH v6 5/5] regulator: add SCMI driver

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

 



Hi Mark

On Mon, Nov 23, 2020 at 05:49:41PM +0000, Mark Brown wrote:
> On Thu, Nov 19, 2020 at 07:10:51PM +0000, Cristian Marussi wrote:
> 
> > +	ret = handle->voltage_ops->config_get(handle, sreg->id,
> > +					      &config);
> > +	if (ret) {
> > +		dev_err(&sreg->sdev->dev,
> > +			"Error %d reading regulator %s status.\n",
> > +			ret, sreg->desc.name);
> > +		return 0;
> > +	}
> 
> If we failed to read the status we should return an error rather than
> claim the regulator is off, other functions return errors so I'm not
> sure why this one would be different.
> 

Yes this seems a bug, I'll fix.

> > +	vinfo = handle->voltage_ops->info_get(handle, sreg->id);
> > +	if (!vinfo) {
> > +		dev_warn(dev, "Skipping invalid voltage domain %d\n",
> > +			 sreg->id);
> > +		return -ENODEV;
> 
> I'm not sure that this error message is the most informative - the issue
> is that we failed to read information, we don't know if that information
> would have been valid or not.  Same for some of the other enumeration,
> it's a failure to read not a lack of validity isn't it?
> 

In fact not reading information here could be due to a failure to
communicate with fw or to the fact that the underlying Voltage Domain
protocol during its initialization failed to validate the domain for
some reason (like getting garbage reads of implauusible out of spec
levels from the FW) and so VD decided not to expose the domain entry
identified by id.

I'll report a generic "Failure to get voltage domain" here at this
point if it's fine.

> > +	/* Allocate pointers' array for all possible domains */
> 
> No '
> 

Ok

> > +	rinfo->num_doms = num_doms;
> > +	/*
> 
> Several places like this with missing blank lines.

What do you mean ? a blank before the comment ?
Sorry but checkpatch --strict does not complain, I was not aware of
this styling. I'll do (if you confirm that's what you want)

How do you prefer these changes (and the DT one) ? 
All as followup patches in a V7 series on top of
sudeep/for-next/scmi-voltage ?

Thanks

Cristian





[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