lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 23 Jun 2017 17:14:20 +0100
From:   Mark Brown <broonie@...nel.org>
To:     Sean Wang <sean.wang@...iatek.com>
Cc:     robh+dt@...nel.org, matthias.bgg@...il.com, mark.rutland@....com,
        lgirdwood@...il.com, jamesjj.liao@...iatek.com,
        henryc.chen@...iatek.com, devicetree@...r.kernel.org,
        linux-mediatek@...ts.infradead.org, chen.zhong@...iatek.com,
        chenglin.xu@...iatek.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/9] regulator: mt6380: Add support for MT6380

On Fri, Jun 23, 2017 at 11:56:05PM +0800, Sean Wang wrote:
> On Tue, 2017-06-06 at 19:22 +0100, Mark Brown wrote:

> > > +	return (regval & info->desc.enable_mask) ?
> > > +		REGULATOR_STATUS_ON : REGULATOR_STATUS_OFF;

> > This isn't really a get_status() operation - it's just showing the
> > status of the enable we set.  The get_status() operation is for hardware
> > that has a mechanism for reading back the current physical status of the
> > regulator, usually including things like if it's in regulation or not.

> > Also please write normal conditional statements, it helps people read
> > the code.

> for the hardware, the way for reflect the current physical physical 
> has to depend on the bit reading as the bit we enable. It indeed tends
> to confuse other users and developers, we maybe can add some comments
> for this to avoid.

It's OK to just not have a get_status() operation - a lot of regulators
just can't do this and that's fine, the subsystem will cope.

> > > +static const struct of_device_id mt6380_of_match[] = {
> > > +	{ .compatible = "mediatek,mt6380-regulator", },
> > > +	{ /* sentinel */ },
> > > +};
> > > +MODULE_DEVICE_TABLE(of, mt6380_of_match);

> > Given that this driver is entirely specific to the parent PMIC there
> > should be no need for a separate compatible string, it's redundant.

> the parent of pmic is MediaTek pwrap which is possibly being used with
> various pmics such as MT6323, MT6797, MT6380 and so on. So extra
> matching we thought is required to identify which pmic is actually being
> connected. 

> For those opinions, maybe we didn't get your exact point. If something
> is wrong, please kindly guide us to the right place.

It sounds like pwrap should be a bus rather than using a platform device
here?  But I guess that's how things are for now so OK.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ