* Patch "NFC: st21nfcb: Retry i2c_master_send if it returns a negative value" has been added to the 4.0-stable tree
@ 2015-05-02 14:33 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-05-02 14:33 UTC (permalink / raw)
To: christophe.ricard, christophe-h.ricard, gregkh, sameo
Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
NFC: st21nfcb: Retry i2c_master_send if it returns a negative value
to the 4.0-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
nfc-st21nfcb-retry-i2c_master_send-if-it-returns-a-negative-value.patch
and it can be found in the queue-4.0 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From d4a41d10b2cb5890aeda6b2912973b2a754b05b1 Mon Sep 17 00:00:00 2001
From: Christophe Ricard <christophe.ricard@gmail.com>
Date: Tue, 31 Mar 2015 08:02:15 +0200
Subject: NFC: st21nfcb: Retry i2c_master_send if it returns a negative value
From: Christophe Ricard <christophe.ricard@gmail.com>
commit d4a41d10b2cb5890aeda6b2912973b2a754b05b1 upstream.
i2c_master_send may return many negative values different than
-EREMOTEIO.
In case an i2c transaction is NACK'ed, on raspberry pi B+
kernel 3.18, -EIO is generated instead.
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/nfc/st21nfcb/i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/nfc/st21nfcb/i2c.c
+++ b/drivers/nfc/st21nfcb/i2c.c
@@ -109,7 +109,7 @@ static int st21nfcb_nci_i2c_write(void *
return phy->ndlc->hard_fault;
r = i2c_master_send(client, skb->data, skb->len);
- if (r == -EREMOTEIO) { /* Retry, chip was in standby */
+ if (r < 0) { /* Retry, chip was in standby */
usleep_range(1000, 4000);
r = i2c_master_send(client, skb->data, skb->len);
}
@@ -148,7 +148,7 @@ static int st21nfcb_nci_i2c_read(struct
struct i2c_client *client = phy->i2c_dev;
r = i2c_master_recv(client, buf, ST21NFCB_NCI_I2C_MIN_SIZE);
- if (r == -EREMOTEIO) { /* Retry, chip was in standby */
+ if (r < 0) { /* Retry, chip was in standby */
usleep_range(1000, 4000);
r = i2c_master_recv(client, buf, ST21NFCB_NCI_I2C_MIN_SIZE);
}
Patches currently in stable-queue which might be from christophe.ricard@gmail.com are
queue-4.0/nfc-st21nfcb-retry-i2c_master_send-if-it-returns-a-negative-value.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-05-02 14:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-02 14:33 Patch "NFC: st21nfcb: Retry i2c_master_send if it returns a negative value" has been added to the 4.0-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).