aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-4.19/950-0590-w1-ds2413-when-the-slave-is-not-responding-during-re.patch
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-02-08 21:58:55 +0100
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-02-14 14:10:51 +0100
commit7d7aa2fd924c27829ec25f825481554dd81bce97 (patch)
tree658b87b89331670266163e522ea5fb52535633cb /target/linux/bcm27xx/patches-4.19/950-0590-w1-ds2413-when-the-slave-is-not-responding-during-re.patch
parente7bfda2c243e66a75ff966ba04c28b1590b5d24c (diff)
downloadupstream-7d7aa2fd924c27829ec25f825481554dd81bce97.tar.gz
upstream-7d7aa2fd924c27829ec25f825481554dd81bce97.tar.bz2
upstream-7d7aa2fd924c27829ec25f825481554dd81bce97.zip
brcm2708: rename target to bcm27xx
This change makes the names of Broadcom targets consistent by using the common notation based on SoC/CPU ID (which is used internally anyway), bcmXXXX instead of brcmXXXX. This is even used for target TITLE in make menuconfig already, only the short target name used brcm so far. Despite, since subtargets range from bcm2708 to bcm2711, it seems appropriate to use bcm27xx instead of bcm2708 (again, as already done for BOARDNAME). This also renames the packages brcm2708-userland and brcm2708-gpu-fw. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Acked-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-4.19/950-0590-w1-ds2413-when-the-slave-is-not-responding-during-re.patch')
-rw-r--r--target/linux/bcm27xx/patches-4.19/950-0590-w1-ds2413-when-the-slave-is-not-responding-during-re.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-4.19/950-0590-w1-ds2413-when-the-slave-is-not-responding-during-re.patch b/target/linux/bcm27xx/patches-4.19/950-0590-w1-ds2413-when-the-slave-is-not-responding-during-re.patch
new file mode 100644
index 0000000000..9d7a94159e
--- /dev/null
+++ b/target/linux/bcm27xx/patches-4.19/950-0590-w1-ds2413-when-the-slave-is-not-responding-during-re.patch
@@ -0,0 +1,56 @@
+From c84676e57896fedb47a69739fb82bb9941f624c4 Mon Sep 17 00:00:00 2001
+From: Mariusz Bialonczyk <manio@skyboo.net>
+Date: Wed, 22 May 2019 12:40:53 +0200
+Subject: [PATCH] w1: ds2413: when the slave is not responding during
+ read, select it again
+
+commit 3856032a0628e6b94badb9131a706dda185e071d upstream.
+
+The protocol is not allowing to obtain a byte of 0xff for PIO_ACCESS_READ
+call. It is very likely that the slave was not addressed properly and
+it is just not respoding (leaving the bus in logic high state) during
+the read of sampled PIO value.
+We cannot just call w1_reset_resume_command() because the problem will
+persist, instead try selecting (addressing) the slave again.
+
+Signed-off-by: Mariusz Bialonczyk <manio@skyboo.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/w1/slaves/w1_ds2413.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/drivers/w1/slaves/w1_ds2413.c
++++ b/drivers/w1/slaves/w1_ds2413.c
+@@ -24,6 +24,7 @@
+ #define W1_F3A_FUNC_PIO_ACCESS_READ 0xF5
+ #define W1_F3A_FUNC_PIO_ACCESS_WRITE 0x5A
+ #define W1_F3A_SUCCESS_CONFIRM_BYTE 0xAA
++#define W1_F3A_INVALID_PIO_STATE 0xFF
+
+ static ssize_t state_read(struct file *filp, struct kobject *kobj,
+ struct bin_attribute *bin_attr, char *buf, loff_t off,
+@@ -45,6 +46,7 @@ static ssize_t state_read(struct file *f
+ mutex_lock(&sl->master->bus_mutex);
+ dev_dbg(&sl->dev, "mutex locked");
+
++next:
+ if (w1_reset_select_slave(sl))
+ goto out;
+
+@@ -52,10 +54,15 @@ static ssize_t state_read(struct file *f
+ w1_write_8(sl->master, W1_F3A_FUNC_PIO_ACCESS_READ);
+
+ *buf = w1_read_8(sl->master);
+- /* check for correct complement */
+ if ((*buf & 0x0F) == ((~*buf >> 4) & 0x0F)) {
++ /* complement is correct */
+ bytes_read = 1;
+ goto out;
++ } else if (*buf == W1_F3A_INVALID_PIO_STATE) {
++ /* slave didn't respond, try to select it again */
++ dev_warn(&sl->dev, "slave device did not respond to PIO_ACCESS_READ, " \
++ "reselecting, retries left: %d\n", retries);
++ goto next;
+ }
+
+ if (w1_reset_resume_command(sl->master))