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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJ3iQcp0pOd6wMfkjWsBuj+EhCO0ig5xsyb8O3+qtKdUbnvOzQ@mail.gmail.com>
Date:	Mon, 15 Jun 2015 10:07:23 +0800
From:	Gergely Imreh <imrehg@...il.com>
To:	Jonathan Cameron <jic23@...nel.org>
Cc:	Lars-Peter Clausen <lars@...afoo.de>, michal.simek@...inx.com,
	linux-iio@...r.kernel.org,
	Linux ARM Kernel <linux-arm-kernel@...ts.infradead.org>,
	linux-kernel@...r.kernel.org, ola@...pteva.com
Subject: Re: [PATCH 1/1] iio:adc: XADC: Set offset explicitly to zero on
 voltage channels

On 14 June 2015 at 23:55, Jonathan Cameron <jic23@...nel.org> wrote:
> On 14/06/15 16:45, Lars-Peter Clausen wrote:
>> On 06/14/2015 05:15 AM, Gergely Imreh wrote:
>>> On 14 June 2015 at 02:30, Jonathan Cameron <jic23@...nel.org> wrote:
>>>> On 11/06/15 09:22, Gergely Imreh wrote:
>>>>> The Xilinx XADC driver has both a temperature channel and 8 voltage
>>>>> channels. The voltage channels have no offset, but actually were still
>>>>> set the same offset as the temperature channel. This did not cause
>>>>> problems in /sys/bus/iio/ but can cause problems with other drivers
>>>>> using iio data. For example iio-hwmon did return wrong voltage values
>>>>> because of the offset.
>>>>>
>>>>> Change tested with the Parallella board.
>>>>>
>>>>> Signed-off-by: Gergely Imreh <imrehg@...il.com>
>>>> Well spotted on the bug, but I think we are better off fixing this at the
>>>> true source of the problem which is in drivers/iio/inkern.c
>>>> iio_convert_raw_to_processed_unlocked which does a call to
>>>> iio_channel_read(chan, &offset, NULL, IIO_CHAN_INFO_OFFSET) then uses
>>>> the error return to check if the offset parameter is available. It should
>>>> be checking that before making this call with a call to iio_channel_has_info.
>>>>
>>>> I don't suppose you could prepare a patch fixing that as you found the problem?
>>>
>>> I'll check it out, and send an updated patch! Thanks for the pointers
>>> to the core of the issue.
>>
>> The issue was already fixed a while ago, see this patch:
>> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=65de7654d39c70c2b942f801cea01590cf7e3458
>>
>>  Starting with that commit iio_channel_read() returns an error when
>> the attribute is not available, which causes
>> iio_convert_raw_to_processed_unlocked() to skip the offset if it is
>> not available.
>>
> oops.  Good spot. I'd completely forgotten about that and failed to spot
> the check when looking at the code yesterday.
>
> Glad you were keeping an eagle eye on things ;)

Okay, thanks, then it's all good, scrub this patch!
That linked change was not backported to the Parallella yet, and
missed it. Looks like it's going to be included now.

Thanks for the feedback!
   Greg

>
> J
>> - Lars
--
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