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]
Message-ID: <1415782511.4820.2.camel@mm-sol.com>
Date:	Wed, 12 Nov 2014 10:55:11 +0200
From:	"Ivan T. Ivanov" <iivanov@...sol.com>
To:	Hartmut Knaack <knaack.h@....de>
Cc:	Jonathan Cameron <jic23@...nel.org>,
	Lars-Peter Clausen <lars@...afoo.de>,
	Peter Meerwald <pmeerw@...erw.net>,
	Stanimir Varbanov <svarbanov@...sol.com>,
	Angelo Compagnucci <angelo.compagnucci@...il.com>,
	Grant Likely <grant.likely@...aro.org>,
	linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
	devicetree@...r.kernel.org, linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH v4 2/2] iio: vadc: Qualcomm SPMI PMIC voltage ADC driver


On Tue, 2014-11-11 at 23:39 +0100, Hartmut Knaack wrote:
> Ivan T. Ivanov schrieb am 11.11.2014 09:21:
> > Hi Hartmut,
> > 
> > On Mon, 2014-11-10 at 22:11 +0100, Hartmut Knaack wrote:
> > > Ivan T. Ivanov schrieb am 03.11.2014 16:24:
> > > > From: Stanimir Varbanov <svarbanov@...sol.com>
> > > > 
> > > > The voltage ADC is peripheral of Qualcomm SPMI PMIC chips. It has
> > > > 15 bits resolution and register space inside PMIC accessible across
> > > > SPMI bus.
> > > > 
> > > > The vadc driver registers itself through IIO interface.
> > > Reviewing again, I got the feeling that due to the complexity of adc reads (writing to 
> > > register
> > > to start conversion, waiting a decent time for the conversion to complete, reading the 
> > > result),
> > > it would be beneficial to use a mutex in vadc_read_raw or its depending functions.
> > 
> > Hm, yes, but there is such a nice info_exist_lock :-) in core functions,
> > which in practice serve the same purpose.
> I seem to miss that. Please point me in the right direction.

I am referring to info_exist_lock mutex part of struct iio_dev. 
It protects all operations inkern.c, no?

> > > 
> > > > +
> > > > +       ret = of_property_read_u32(node, "reg", &res);
> > > For u16, there would be of_property_read_u16().
> > > > +       if (ret < 0)
> > > > +       return -ENODEV;
> > > Just return ret here?
> > 
> > I am usually trying to follow these recommendations[1]. In practice driver
> > core cares only for EPROBE_DEFER, ENODEV and ENXIO, while of_property_read_u32()
> > can return ENODATA and EOVERFLOW, which did't not make sense for the core.
> Please point me in the right direction on this one, too. It is pretty common to pass error codes 
> up, as it is also mentioned in [1].

Yes, I know that is common to just pass error codes up, but in this case it did't 
make too much sense, I think. Also take a look at realy_probe() and line 343.

> Yet, this thread in [1] seems more like a draft to me, as Greg K-H wrote in the end: "Fair 
> enough, care to respin this and send it out to me for review?"



Yes, but it make sense to me.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ