]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
w1: mxc_w1: Fix timeout resolution problem leading to bus error
authorMartin Fuzzey <martin.fuzzey@flowbird.group>
Wed, 30 Sep 2020 08:36:46 +0000 (10:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:08:47 +0000 (11:08 +0100)
commit0bfca7315796f332dd2b441eb38e0355c109177c
tree7f7f155bd4937087d88a374343f51038a6741a09
parent57cbc85d3503daa5da52138ba1bc72443df1a207
w1: mxc_w1: Fix timeout resolution problem leading to bus error

commit c9723750a699c3bd465493ac2be8992b72ccb105 upstream.

On my platform (i.MX53) bus access sometimes fails with
w1_search: max_slave_count 64 reached, will continue next search.

The reason is the use of jiffies to implement a 200us timeout in
mxc_w1_ds2_touch_bit().
On some platforms the jiffies timer resolution is insufficient for this.

Fix by replacing jiffies by ktime_get().

For consistency apply the same change to the other use of jiffies in
mxc_w1_ds2_reset_bus().

Fixes: f80b2581a706 ("w1: mxc_w1: Optimize mxc_w1_ds2_touch_bit()")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group>
Link: https://lore.kernel.org/r/1601455030-6607-1-git-send-email-martin.fuzzey@flowbird.group
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/w1/masters/mxc_w1.c