drivers: w1-gpio: add flag to force read-polling while delaying
authorJonathan Bell <jonathan@raspberrypi.com>
Thu, 11 Jan 2024 16:33:22 +0000 (16:33 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:35:31 +0000 (11:35 +0000)
commitab79d44bd49f9596db86eb3d7dcfb53e55534313
treeec34bc79b370adac428a3ec43cbe749473140138
parent18ba6e3f394d53fc1fafc7487390899edc8f1b83
drivers: w1-gpio: add flag to force read-polling while delaying

On Pi 5, the link to RP1 will bounce in and out of L1 depending on
inactivity timers at both the RC and EP end. Unfortunately for
bitbashing 1-wire, this means that on an otherwise idle Pi 5 many of the
reads/writes to GPIO registers are delayed by up to 8us which causes
mis-sampling of read data and trashes write bits.

By issuing dummy reads at a rate greater than the link inactivity
timeout while spinning on a delay, PCIe stays in L0 which does not incur
additional latency.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
drivers/w1/masters/w1-gpio.c
drivers/w1/w1_io.c
include/linux/w1.h