* [PATCH 1/9] i2c: xiic: Do not continue in case of errors in Rx
@ 2015-06-15 15:17 Shubhrajyoti Datta
[not found] ` <1434381480-3042-1-git-send-email-shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Shubhrajyoti Datta @ 2015-06-15 15:17 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA; +Cc: Shubhrajyoti Datta
Handle error cases in the Rx path
Signed-off-by: Shubhrajyoti Datta <shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
---
drivers/i2c/busses/i2c-xiic.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 4dda23f..cea842e 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -402,6 +402,8 @@ static void xiic_process(struct xiic_i2c *i2c)
*/
xiic_reinit(i2c);
+ if (i2c->rx_msg)
+ xiic_wakeup(i2c, STATE_ERROR);
if (i2c->tx_msg)
xiic_wakeup(i2c, STATE_ERROR);
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/9] i2c: xiic: Remove the disabling of interrupts
[not found] ` <1434381480-3042-1-git-send-email-shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
@ 2015-06-15 15:17 ` Shubhrajyoti Datta
2015-06-15 15:17 ` [PATCH 3/9] i2c: xiic: move the xiic_process to thread context Shubhrajyoti Datta
` (7 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Shubhrajyoti Datta @ 2015-06-15 15:17 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA; +Cc: Shubhrajyoti Datta
Currently the interrupts are disabled at the start of the
isr and enabled at the end of the isr. Remove the same.
Signed-off-by: Shubhrajyoti Datta <shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
---
drivers/i2c/busses/i2c-xiic.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index cea842e..ce6b856 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -606,14 +606,11 @@ static irqreturn_t xiic_isr(int irq, void *dev_id)
struct xiic_i2c *i2c = dev_id;
spin_lock(&i2c->lock);
- /* disable interrupts globally */
- xiic_setreg32(i2c, XIIC_DGIER_OFFSET, 0);
dev_dbg(i2c->adap.dev.parent, "%s entry\n", __func__);
xiic_process(i2c);
- xiic_setreg32(i2c, XIIC_DGIER_OFFSET, XIIC_GINTR_ENABLE_MASK);
spin_unlock(&i2c->lock);
return IRQ_HANDLED;
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/9] i2c: xiic: move the xiic_process to thread context
[not found] ` <1434381480-3042-1-git-send-email-shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2015-06-15 15:17 ` [PATCH 2/9] i2c: xiic: Remove the disabling of interrupts Shubhrajyoti Datta
@ 2015-06-15 15:17 ` Shubhrajyoti Datta
2015-06-15 15:17 ` [PATCH 4/9] i2c: xiic: Do not reset controller before every transfer Shubhrajyoti Datta
` (6 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Shubhrajyoti Datta @ 2015-06-15 15:17 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA; +Cc: Shubhrajyoti Datta
The xiic_process is a 154 line code that runs in isr context currently
move it to thread context.
Signed-off-by: Shubhrajyoti Datta <shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
---
drivers/i2c/busses/i2c-xiic.c | 33 ++++++++++++++++++++-------------
1 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index ce6b856..e7df7c2 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -358,8 +358,9 @@ static void xiic_wakeup(struct xiic_i2c *i2c, int code)
wake_up(&i2c->wait);
}
-static void xiic_process(struct xiic_i2c *i2c)
+static irqreturn_t xiic_process(int irq, void *dev_id)
{
+ struct xiic_i2c *i2c = dev_id;
u32 pend, isr, ier;
u32 clr = 0;
@@ -368,6 +369,7 @@ static void xiic_process(struct xiic_i2c *i2c)
* To find which interrupts are pending; AND interrupts pending with
* interrupts masked.
*/
+ spin_lock(&i2c->lock);
isr = xiic_getreg32(i2c, XIIC_IISR_OFFSET);
ier = xiic_getreg32(i2c, XIIC_IIER_OFFSET);
pend = isr & ier;
@@ -378,11 +380,6 @@ static void xiic_process(struct xiic_i2c *i2c)
__func__, xiic_getreg8(i2c, XIIC_SR_REG_OFFSET),
i2c->tx_msg, i2c->nmsgs);
- /* Do not processes a devices interrupts if the device has no
- * interrupts pending
- */
- if (!pend)
- return;
/* Service requesting interrupt */
if ((pend & XIIC_INTR_ARB_LOST_MASK) ||
@@ -504,6 +501,8 @@ out:
dev_dbg(i2c->adap.dev.parent, "%s clr: 0x%x\n", __func__, clr);
xiic_setreg32(i2c, XIIC_IISR_OFFSET, clr);
+ spin_unlock(&i2c->lock);
+ return IRQ_HANDLED;
}
static int xiic_bus_busy(struct xiic_i2c *i2c)
@@ -604,16 +603,21 @@ static void xiic_start_send(struct xiic_i2c *i2c)
static irqreturn_t xiic_isr(int irq, void *dev_id)
{
struct xiic_i2c *i2c = dev_id;
-
- spin_lock(&i2c->lock);
+ u32 pend, isr, ier;
+ irqreturn_t ret = IRQ_HANDLED;
+ /* Do not processes a devices interrupts if the device has no
+ * interrupts pending
+ */
dev_dbg(i2c->adap.dev.parent, "%s entry\n", __func__);
- xiic_process(i2c);
-
- spin_unlock(&i2c->lock);
+ isr = xiic_getreg32(i2c, XIIC_IISR_OFFSET);
+ ier = xiic_getreg32(i2c, XIIC_IIER_OFFSET);
+ pend = isr & ier;
+ if (pend)
+ ret = IRQ_WAKE_THREAD;
- return IRQ_HANDLED;
+ return ret;
}
static void __xiic_start_xfer(struct xiic_i2c *i2c)
@@ -754,7 +758,10 @@ static int xiic_i2c_probe(struct platform_device *pdev)
spin_lock_init(&i2c->lock);
init_waitqueue_head(&i2c->wait);
- ret = devm_request_irq(&pdev->dev, irq, xiic_isr, 0, pdev->name, i2c);
+ ret = devm_request_threaded_irq(&pdev->dev, irq, xiic_isr,
+ xiic_process, IRQF_ONESHOT,
+ pdev->name, i2c);
+
if (ret < 0) {
dev_err(&pdev->dev, "Cannot claim IRQ\n");
return ret;
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 4/9] i2c: xiic: Do not reset controller before every transfer
[not found] ` <1434381480-3042-1-git-send-email-shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2015-06-15 15:17 ` [PATCH 2/9] i2c: xiic: Remove the disabling of interrupts Shubhrajyoti Datta
2015-06-15 15:17 ` [PATCH 3/9] i2c: xiic: move the xiic_process to thread context Shubhrajyoti Datta
@ 2015-06-15 15:17 ` Shubhrajyoti Datta
2015-06-15 15:17 ` [PATCH 5/9] i2c: xiic: Remove the disabling of interrupts Shubhrajyoti Datta
` (5 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Shubhrajyoti Datta @ 2015-06-15 15:17 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA; +Cc: Shubhrajyoti Datta
Currently before every transfer the controller is reinitialised.
Remove the same.
Signed-off-by: Shubhrajyoti Datta <shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
---
drivers/i2c/busses/i2c-xiic.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index e7df7c2..66040d3 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -669,7 +669,6 @@ static void xiic_start_xfer(struct xiic_i2c *i2c)
unsigned long flags;
spin_lock_irqsave(&i2c->lock, flags);
- xiic_reinit(i2c);
/* disable interrupts globally */
xiic_setreg32(i2c, XIIC_DGIER_OFFSET, 0);
spin_unlock_irqrestore(&i2c->lock, flags);
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 5/9] i2c: xiic: Remove the disabling of interrupts
[not found] ` <1434381480-3042-1-git-send-email-shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
` (2 preceding siblings ...)
2015-06-15 15:17 ` [PATCH 4/9] i2c: xiic: Do not reset controller before every transfer Shubhrajyoti Datta
@ 2015-06-15 15:17 ` Shubhrajyoti Datta
2015-06-15 15:17 ` [PATCH 6/9] i2c: xiic: Remove busy loop while waiting for bus busy Shubhrajyoti Datta
` (4 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Shubhrajyoti Datta @ 2015-06-15 15:17 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA; +Cc: Shubhrajyoti Datta
Currently before every transfer the interrupts are disabled.
Remove the same.
Signed-off-by: Shubhrajyoti Datta <shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
---
drivers/i2c/busses/i2c-xiic.c | 7 -------
1 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 66040d3..7b81aac 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -666,15 +666,8 @@ static void __xiic_start_xfer(struct xiic_i2c *i2c)
static void xiic_start_xfer(struct xiic_i2c *i2c)
{
- unsigned long flags;
-
- spin_lock_irqsave(&i2c->lock, flags);
- /* disable interrupts globally */
- xiic_setreg32(i2c, XIIC_DGIER_OFFSET, 0);
- spin_unlock_irqrestore(&i2c->lock, flags);
__xiic_start_xfer(i2c);
- xiic_setreg32(i2c, XIIC_DGIER_OFFSET, XIIC_GINTR_ENABLE_MASK);
}
static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 6/9] i2c: xiic: Remove busy loop while waiting for bus busy
[not found] ` <1434381480-3042-1-git-send-email-shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
` (3 preceding siblings ...)
2015-06-15 15:17 ` [PATCH 5/9] i2c: xiic: Remove the disabling of interrupts Shubhrajyoti Datta
@ 2015-06-15 15:17 ` Shubhrajyoti Datta
2015-06-15 15:17 ` [PATCH 7/9] i2c: xiic: Add a msg in case of timeout Shubhrajyoti Datta
` (3 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Shubhrajyoti Datta @ 2015-06-15 15:17 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA; +Cc: Shubhrajyoti Datta
Remove the busy loop while waiting for bus busy.
Signed-off-by: Shubhrajyoti Datta <shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
---
drivers/i2c/busses/i2c-xiic.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 7b81aac..8142c2e 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -526,7 +526,7 @@ static int xiic_busy(struct xiic_i2c *i2c)
*/
err = xiic_bus_busy(i2c);
while (err && tries--) {
- mdelay(1);
+ msleep(1);
err = xiic_bus_busy(i2c);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 7/9] i2c: xiic: Add a msg in case of timeout
[not found] ` <1434381480-3042-1-git-send-email-shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
` (4 preceding siblings ...)
2015-06-15 15:17 ` [PATCH 6/9] i2c: xiic: Remove busy loop while waiting for bus busy Shubhrajyoti Datta
@ 2015-06-15 15:17 ` Shubhrajyoti Datta
2015-06-15 15:17 ` [PATCH 8/9] i2c: xiic: Remove the Addressed as slave interrupt Shubhrajyoti Datta
` (2 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Shubhrajyoti Datta @ 2015-06-15 15:17 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA; +Cc: Shubhrajyoti Datta
Timing out is one of the serious errors.
Currently we return silently upon a timeout.
Adding an error message.
Signed-off-by: Shubhrajyoti Datta <shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
---
drivers/i2c/busses/i2c-xiic.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 8142c2e..62f7138 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -694,6 +694,7 @@ static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
i2c->tx_msg = NULL;
i2c->rx_msg = NULL;
i2c->nmsgs = 0;
+ dev_err(adap->dev.parent, "Controller timed out\n");
return -ETIMEDOUT;
}
}
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 8/9] i2c: xiic: Remove the Addressed as slave interrupt
[not found] ` <1434381480-3042-1-git-send-email-shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
` (5 preceding siblings ...)
2015-06-15 15:17 ` [PATCH 7/9] i2c: xiic: Add a msg in case of timeout Shubhrajyoti Datta
@ 2015-06-15 15:17 ` Shubhrajyoti Datta
2015-06-15 15:18 ` [PATCH 9/9] i2c: xiic: Service all interrupts in isr Shubhrajyoti Datta
2015-06-17 11:42 ` [PATCH 1/9] i2c: xiic: Do not continue in case of errors in Rx Wolfram Sang
8 siblings, 0 replies; 12+ messages in thread
From: Shubhrajyoti Datta @ 2015-06-15 15:17 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA; +Cc: Shubhrajyoti Datta
Currently there is no slave mode. Do not enable the AAS interrupt.
Signed-off-by: Shubhrajyoti Datta <shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
---
drivers/i2c/busses/i2c-xiic.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 62f7138..69d937e 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -283,7 +283,7 @@ static void xiic_reinit(struct xiic_i2c *i2c)
/* Enable interrupts */
xiic_setreg32(i2c, XIIC_DGIER_OFFSET, XIIC_GINTR_ENABLE_MASK);
- xiic_irq_clr_en(i2c, XIIC_INTR_AAS_MASK | XIIC_INTR_ARB_LOST_MASK);
+ xiic_irq_clr_en(i2c, XIIC_INTR_ARB_LOST_MASK);
}
static void xiic_deinit(struct xiic_i2c *i2c)
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 9/9] i2c: xiic: Service all interrupts in isr
[not found] ` <1434381480-3042-1-git-send-email-shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
` (6 preceding siblings ...)
2015-06-15 15:17 ` [PATCH 8/9] i2c: xiic: Remove the Addressed as slave interrupt Shubhrajyoti Datta
@ 2015-06-15 15:18 ` Shubhrajyoti Datta
2015-06-17 11:42 ` [PATCH 1/9] i2c: xiic: Do not continue in case of errors in Rx Wolfram Sang
8 siblings, 0 replies; 12+ messages in thread
From: Shubhrajyoti Datta @ 2015-06-15 15:18 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA; +Cc: Shubhrajyoti Datta
If 2 interrupts happen then service both of them.
Currently only one interrupt can be serviced.
Signed-off-by: Shubhrajyoti Datta <shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
---
drivers/i2c/busses/i2c-xiic.c | 24 ++++++++++--------------
1 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 69d937e..c071897 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -403,11 +403,11 @@ static irqreturn_t xiic_process(int irq, void *dev_id)
xiic_wakeup(i2c, STATE_ERROR);
if (i2c->tx_msg)
xiic_wakeup(i2c, STATE_ERROR);
-
- } else if (pend & XIIC_INTR_RX_FULL_MASK) {
+ }
+ if (pend & XIIC_INTR_RX_FULL_MASK) {
/* Receive register/FIFO is full */
- clr = XIIC_INTR_RX_FULL_MASK;
+ clr |= XIIC_INTR_RX_FULL_MASK;
if (!i2c->rx_msg) {
dev_dbg(i2c->adap.dev.parent,
"%s unexpexted RX IRQ\n", __func__);
@@ -440,9 +440,10 @@ static irqreturn_t xiic_process(int irq, void *dev_id)
__xiic_start_xfer(i2c);
}
}
- } else if (pend & XIIC_INTR_BNB_MASK) {
+ }
+ if (pend & XIIC_INTR_BNB_MASK) {
/* IIC bus has transitioned to not busy */
- clr = XIIC_INTR_BNB_MASK;
+ clr |= XIIC_INTR_BNB_MASK;
/* The bus is not busy, disable BusNotBusy interrupt */
xiic_irq_dis(i2c, XIIC_INTR_BNB_MASK);
@@ -455,12 +456,12 @@ static irqreturn_t xiic_process(int irq, void *dev_id)
xiic_wakeup(i2c, STATE_DONE);
else
xiic_wakeup(i2c, STATE_ERROR);
-
- } else if (pend & (XIIC_INTR_TX_EMPTY_MASK | XIIC_INTR_TX_HALF_MASK)) {
+ }
+ if (pend & (XIIC_INTR_TX_EMPTY_MASK | XIIC_INTR_TX_HALF_MASK)) {
/* Transmit register/FIFO is empty or ½ empty */
- clr = pend &
- (XIIC_INTR_TX_EMPTY_MASK | XIIC_INTR_TX_HALF_MASK);
+ clr |= (pend &
+ (XIIC_INTR_TX_EMPTY_MASK | XIIC_INTR_TX_HALF_MASK));
if (!i2c->tx_msg) {
dev_dbg(i2c->adap.dev.parent,
@@ -491,11 +492,6 @@ static irqreturn_t xiic_process(int irq, void *dev_id)
* make sure to disable tx half
*/
xiic_irq_dis(i2c, XIIC_INTR_TX_HALF_MASK);
- } else {
- /* got IRQ which is not acked */
- dev_err(i2c->adap.dev.parent, "%s Got unexpected IRQ\n",
- __func__);
- clr = pend;
}
out:
dev_dbg(i2c->adap.dev.parent, "%s clr: 0x%x\n", __func__, clr);
--
1.7.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 1/9] i2c: xiic: Do not continue in case of errors in Rx
[not found] ` <1434381480-3042-1-git-send-email-shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
` (7 preceding siblings ...)
2015-06-15 15:18 ` [PATCH 9/9] i2c: xiic: Service all interrupts in isr Shubhrajyoti Datta
@ 2015-06-17 11:42 ` Wolfram Sang
[not found] ` <20150617114159.GA4604-oo5tB6JMkjKRinMKxDlMNPwbnWRJjS81@public.gmane.org>
8 siblings, 1 reply; 12+ messages in thread
From: Wolfram Sang @ 2015-06-17 11:42 UTC (permalink / raw)
To: Shubhrajyoti Datta; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Shubhrajyoti Datta
[-- Attachment #1: Type: text/plain, Size: 586 bytes --]
Hi,
On Mon, Jun 15, 2015 at 08:47:52PM +0530, Shubhrajyoti Datta wrote:
> Handle error cases in the Rx path
>
> Signed-off-by: Shubhrajyoti Datta <shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
Your patch descriptions need improvement. They describe what you do,
but this can be seen in the patch as well. What you need to describe is
WHY you need this change. What was wrong before, what is better now.
Because this driver is long in use, we must be very careful about
regressions and every change needs a good reason.
So, please rework your patch descriptions.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH 1/9] i2c: xiic: Do not continue in case of errors in Rx
[not found] ` <20150617114159.GA4604-oo5tB6JMkjKRinMKxDlMNPwbnWRJjS81@public.gmane.org>
@ 2015-06-17 12:38 ` Shubhrajyoti Datta
[not found] ` <4EED9C67BE3EF440A606099F8E34C52862BB72-4lKfpRxZ5enZMOc0yg5rMog+Gb3gawCHQz34XiSyOiE@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Shubhrajyoti Datta @ 2015-06-17 12:38 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> -----Original Message-----
> From: Wolfram Sang [mailto:wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org]
> Sent: Wednesday, June 17, 2015 5:12 PM
> To: Shubhrajyoti Datta
> Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Shubhrajyoti Datta
> Subject: Re: [PATCH 1/9] i2c: xiic: Do not continue in case of errors in Rx
>
> Hi,
>
> On Mon, Jun 15, 2015 at 08:47:52PM +0530, Shubhrajyoti Datta wrote:
> > Handle error cases in the Rx path
> >
> > Signed-off-by: Shubhrajyoti Datta <shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
>
> Your patch descriptions need improvement. They describe what you do, but
> this can be seen in the patch as well. What you need to describe is WHY you
> need this change.
In case the slave nacks the transaction in the middle of the transfer The driver continues.
> What was wrong before,
The usual expectation is that in case of error / nack the transaction is halted.
>what is better now.
There are 2 things my series does
1 . The interrupts were disabled in the start of the transfer and re-enabled again.
So if there are any error interrupts this will not be handled.
2. Secondly during the isr also the interrupts were disabled.
So if there is any nack in between that may not be respected.
3. I felt in case of all errors we should
Call xiic_wakeup(i2c, STATE_ERROR); -> wake_up(&i2c->wait)
And come out of wait.
I made the patches speculatively after reading a bug report that says nacks are not
Respected in the middle of a transfer.
However do not have a peripheral that will nack in the middle of a transfer.
Could not test it in that sense.
> Because this driver is long in use, we must be very careful about regressions
> and every change needs a good reason.
I agree.
>
> So, please rework your patch descriptions.
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/9] i2c: xiic: Do not continue in case of errors in Rx
[not found] ` <4EED9C67BE3EF440A606099F8E34C52862BB72-4lKfpRxZ5enZMOc0yg5rMog+Gb3gawCHQz34XiSyOiE@public.gmane.org>
@ 2015-06-17 12:44 ` Wolfram Sang
0 siblings, 0 replies; 12+ messages in thread
From: Wolfram Sang @ 2015-06-17 12:44 UTC (permalink / raw)
To: Shubhrajyoti Datta; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
[-- Attachment #1: Type: text/plain, Size: 803 bytes --]
> > Your patch descriptions need improvement. They describe what you do, but
> > this can be seen in the patch as well. What you need to describe is WHY you
> > need this change.
>
> In case the slave nacks the transaction in the middle of the transfer The driver continues.
>
> > What was wrong before,
>
> The usual expectation is that in case of error / nack the transaction is halted.
Yeah, this is going into the right direction. Please note, that I meant
that all 9 patch descriptions need rework. I know this is extra work,
but really needed to keep drivers maintainable. Please resend the series
when you are done.
> > Because this driver is long in use, we must be very careful about regressions
> > and every change needs a good reason.
>
> I agree.
Great! :)
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-06-17 12:44 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-15 15:17 [PATCH 1/9] i2c: xiic: Do not continue in case of errors in Rx Shubhrajyoti Datta
[not found] ` <1434381480-3042-1-git-send-email-shubhraj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2015-06-15 15:17 ` [PATCH 2/9] i2c: xiic: Remove the disabling of interrupts Shubhrajyoti Datta
2015-06-15 15:17 ` [PATCH 3/9] i2c: xiic: move the xiic_process to thread context Shubhrajyoti Datta
2015-06-15 15:17 ` [PATCH 4/9] i2c: xiic: Do not reset controller before every transfer Shubhrajyoti Datta
2015-06-15 15:17 ` [PATCH 5/9] i2c: xiic: Remove the disabling of interrupts Shubhrajyoti Datta
2015-06-15 15:17 ` [PATCH 6/9] i2c: xiic: Remove busy loop while waiting for bus busy Shubhrajyoti Datta
2015-06-15 15:17 ` [PATCH 7/9] i2c: xiic: Add a msg in case of timeout Shubhrajyoti Datta
2015-06-15 15:17 ` [PATCH 8/9] i2c: xiic: Remove the Addressed as slave interrupt Shubhrajyoti Datta
2015-06-15 15:18 ` [PATCH 9/9] i2c: xiic: Service all interrupts in isr Shubhrajyoti Datta
2015-06-17 11:42 ` [PATCH 1/9] i2c: xiic: Do not continue in case of errors in Rx Wolfram Sang
[not found] ` <20150617114159.GA4604-oo5tB6JMkjKRinMKxDlMNPwbnWRJjS81@public.gmane.org>
2015-06-17 12:38 ` Shubhrajyoti Datta
[not found] ` <4EED9C67BE3EF440A606099F8E34C52862BB72-4lKfpRxZ5enZMOc0yg5rMog+Gb3gawCHQz34XiSyOiE@public.gmane.org>
2015-06-17 12:44 ` Wolfram Sang
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).