w1_therm: fix reset_select_slave during discovery
commit bd42add5b80b11b65e0e136d99bfa06c75da705d from https://github.com/raspberrypi/linux.git rpi-5.4.y commit c8ad65f6 upstream. Fix reset_select_slave issue during devices discovery by the master on bus. The w1_reset_select_slave() from w1_io.c, which was previously used, assume that if the slave count is 1 there is only one slave attached on the bus. This is not always true. For example when discovering devices, when the first device is discover by the bus master, its slave count is 1, but some other slaves may be on the bus. In that case instead of adressing command to the attached slave the master throw a SKIP ROM command so that all slaves attached on the bus will answer simultenaously causing data collision. A dedicated reset_select_slave() function is implemented here, it always perform an adressing to each slave using the MATCH ROM command. Signed-off-by: Akira Shimahara <akira215corp@gmail.com> Link: https://lore.kernel.org/r/20200511203610.409975-1-akira215corp@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Meng Li <Meng.Li@windriver.com>
parent
18129547
Please register or sign in to comment