Skip to contentSkip to conversation

USB: chipidea: fix & vs | bug

PATCH In review Dan Carpenter 3 participants 7 messages Sep 14, 2012 – Feb 15, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: chipidea: fix & vs | bug

There is a '&' vs '|' typo in the original code so the condition is never true and we don't queue the work.

---

drivers/usb/chipidea/udc.c +1 -1
index 2f45bba..5294f81 100644
@@ -1680,7 +1680,7 @@ static irqreturn_t udc_irq(struct ci13xxx *ci)
 	intr = hw_read(ci, OP_OTGSC, ~0);
 	hw_write(ci, OP_OTGSC, ~0, intr);
 
-	if (intr & (OTGSC_AVVIE & OTGSC_AVVIS))
+	if (intr & (OTGSC_AVVIE | OTGSC_AVVIS))
 		queue_work(ci->wq, &ci->vbus_work);
 
 	spin_unlock(&ci->lock);
#1 lore raw
Quoted 11 lines · Dan Carpenter

There is a '&' vs '|' typo in the original code so the condition is never true and we don't queue the work.

---

drivers/usb/chipidea/udc.c +0 -0
index 2f45bba..5294f81 100644

drivers/usb/chipidea/udc.c static irqreturn_t udc_irq(struct ci13xxx *ci) · line 1683

Quoted 5 lines
drivers/usb/chipidea/udc.c +1 -1
@@ -1680,7 +1680,7 @@ static irqreturn_t udc_irq(struct ci13xxx *ci)
 	intr = hw_read(ci, OP_OTGSC, ~0);
 	hw_write(ci, OP_OTGSC, ~0, intr);
 
-	if (intr & (OTGSC_AVVIE & OTGSC_AVVIS))
+	if (intr & (OTGSC_AVVIE | OTGSC_AVVIS))

It's not what I meant. Should be
if ((intr & OTGSC_AVVIE) && (intr & OTGSC_AVVIS))
I'm still testing it.

Thanks
Richard

Quoted 4 lines
drivers/usb/chipidea/udc.c +0 -0
 		queue_work(ci->wq, &ci->vbus_work);
 
 	spin_unlock(&ci->lock);
#2 lore raw
In reply to Dan Carpenter
Quoted 15 lines · Richard Zhao
Quoted 14 lines · Dan Carpenter

There is a '&' vs '|' typo in the original code so the condition is never true and we don't queue the work.

---

drivers/usb/chipidea/udc.c +0 -0
index 2f45bba..5294f81 100644
@@ -1680,7 +1680,7 @@ static irqreturn_t udc_irq(struct ci13xxx *ci)
 	intr = hw_read(ci, OP_OTGSC, ~0);
 	hw_write(ci, OP_OTGSC, ~0, intr);
 
Quoted 5 lines

drivers/usb/chipidea/udc.c static irqreturn_t udc_irq(struct ci13xxx *ci) · line 1683

Quoted 2 lines
drivers/usb/chipidea/udc.c +1 -1
-	if (intr & (OTGSC_AVVIE & OTGSC_AVVIS))
+	if (intr & (OTGSC_AVVIE | OTGSC_AVVIS))

It's not what I meant. Should be
if ((intr & OTGSC_AVVIE) && (intr & OTGSC_AVVIS))
I'm still testing it.

How did the testing go?

regards,
dan carpenter

#3 lore raw
In reply to Dan Carpenter
Quoted 16 lines · Dan Carpenter
Quoted 15 lines · Richard Zhao
Quoted 14 lines · Dan Carpenter

There is a '&' vs '|' typo in the original code so the condition is never true and we don't queue the work.

---

drivers/usb/chipidea/udc.c +0 -0
index 2f45bba..5294f81 100644
@@ -1680,7 +1680,7 @@ static irqreturn_t udc_irq(struct ci13xxx *ci)
 	intr = hw_read(ci, OP_OTGSC, ~0);
 	hw_write(ci, OP_OTGSC, ~0, intr);
 
Quoted 8 lines
Quoted 5 lines

drivers/usb/chipidea/udc.c static irqreturn_t udc_irq(struct ci13xxx *ci) · line 1683

Quoted 2 lines
drivers/usb/chipidea/udc.c +1 -1
-	if (intr & (OTGSC_AVVIE & OTGSC_AVVIS))
+	if (intr & (OTGSC_AVVIE | OTGSC_AVVIS))

It's not what I meant. Should be
if ((intr & OTGSC_AVVIE) && (intr & OTGSC_AVVIS))
I'm still testing it.

How did the testing go?

Richard's email is bouncing. Probably I should just send this myself.

regards,
dan carpenter

#4 lore raw
In reply to Dan Carpenter
Quoted 23 lines · Dan Carpenter
Quoted 22 lines · Dan Carpenter
Quoted 20 lines · Richard Zhao
Quoted 11 lines · Dan Carpenter

There is a '&' vs '|' typo in the original code so the condition is never true and we don't queue the work.

---

drivers/usb/chipidea/udc.c +0 -0
index 2f45bba..5294f81 100644

drivers/usb/chipidea/udc.c static irqreturn_t udc_irq(struct ci13xxx *ci) · line 1683

Quoted 5 lines
drivers/usb/chipidea/udc.c +1 -1
@@ -1680,7 +1680,7 @@ static irqreturn_t udc_irq(struct ci13xxx *ci)
 	intr = hw_read(ci, OP_OTGSC, ~0);
 	hw_write(ci, OP_OTGSC, ~0, intr);
 
-	if (intr & (OTGSC_AVVIE & OTGSC_AVVIS))
+	if (intr & (OTGSC_AVVIE | OTGSC_AVVIS))

It's not what I meant. Should be
if ((intr & OTGSC_AVVIE) && (intr & OTGSC_AVVIS))
I'm still testing it.

Quoted 5 lines
Quoted 2 lines

How did the testing go?

Richard's email is bouncing. Probably I should just send this myself.

We're reverting this commit for 3.10 as part of Peter's vbus detection patchset. If it seems more urgent, I guess we can revert it earlier as a bugfix. Otherwise, I'd just leave it till 3.10.

Regards,
--
Alex

#5 lore raw
In reply to Dan Carpenter
Quoted 28 lines · Alexander Shishkin
Quoted 26 lines · Dan Carpenter
Quoted 24 lines · Dan Carpenter
Quoted 15 lines · Richard Zhao
Quoted 14 lines · Dan Carpenter

There is a '&' vs '|' typo in the original code so the condition is never true and we don't queue the work.

---

drivers/usb/chipidea/udc.c +0 -0
index 2f45bba..5294f81 100644
@@ -1680,7 +1680,7 @@ static irqreturn_t udc_irq(struct ci13xxx *ci)
 	intr = hw_read(ci, OP_OTGSC, ~0);
 	hw_write(ci, OP_OTGSC, ~0, intr);
 
Quoted 5 lines

drivers/usb/chipidea/udc.c static irqreturn_t udc_irq(struct ci13xxx *ci) · line 1683

Quoted 2 lines
drivers/usb/chipidea/udc.c +1 -1
-	if (intr & (OTGSC_AVVIE & OTGSC_AVVIS))
+	if (intr & (OTGSC_AVVIE | OTGSC_AVVIS))

It's not what I meant. Should be
if ((intr & OTGSC_AVVIE) && (intr & OTGSC_AVVIS))
I'm still testing it.

How did the testing go?

Quoted 6 lines
Quoted 2 lines

Richard's email is bouncing. Probably I should just send this myself.

We're reverting this commit for 3.10 as part of Peter's vbus detection patchset. If it seems more urgent, I guess we can revert it earlier as a bugfix. Otherwise, I'd just leave it till 3.10.

No rush. It's just a static checker thing.

regards,
dan carpenter

#6 lore raw
In reply to Dan Carpenter
Quoted 29 lines · Dan Carpenter
Quoted 28 lines · Alexander Shishkin
Quoted 26 lines · Dan Carpenter
Quoted 24 lines · Dan Carpenter
Quoted 15 lines · Richard Zhao
Quoted 14 lines · Dan Carpenter

There is a '&' vs '|' typo in the original code so the condition is never true and we don't queue the work.

---

drivers/usb/chipidea/udc.c +0 -0
index 2f45bba..5294f81 100644
@@ -1680,7 +1680,7 @@ static irqreturn_t udc_irq(struct ci13xxx *ci)
 	intr = hw_read(ci, OP_OTGSC, ~0);
 	hw_write(ci, OP_OTGSC, ~0, intr);
 
Quoted 5 lines

drivers/usb/chipidea/udc.c static irqreturn_t udc_irq(struct ci13xxx *ci) · line 1683

Quoted 2 lines
drivers/usb/chipidea/udc.c +1 -1
-	if (intr & (OTGSC_AVVIE & OTGSC_AVVIS))
+	if (intr & (OTGSC_AVVIE | OTGSC_AVVIS))

It's not what I meant. Should be
if ((intr & OTGSC_AVVIE) && (intr & OTGSC_AVVIS))
I'm still testing it.

How did the testing go?

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Richard's email is bouncing. Probably I should just send this myself.

We're reverting this commit for 3.10 as part of Peter's vbus detection patchset. If it seems more urgent, I guess we can revert it earlier as a bugfix. Otherwise, I'd just leave it till 3.10.

No rush. It's just a static checker thing.

Ok, thanks.

Regards,
--
Alex