Skip to contentSkip to conversation

musb_hdrc: Fix musb_hnp_stop() to return to device mode

PATCH In review Tony Lindgren 2 participants 6 messages Aug 21, 2007 – Aug 22, 2007

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

PATCH 1/1 musb_hdrc: Fix musb_hnp_stop() to return to device mode

This one fixes some USB HS OPT test unreliability.

Tony

From: Tony Lindgren <[email protected]>
Subject: musb_hdrc: Fix musb_hnp_stop() to return to device mode

Without this patch HNP does not return to device mode, which can confuse OPT tests. Also change to b_host if SUSPEND and CONNECT simultaneously as b_peripheral, and fix a comment.

drivers/usb/musb/musb_core.c +11 -1
@@ -331,6 +331,7 @@ void musb_hnp_stop(struct musb *musb)
 		DBG(1, "HNP: Disabling HR\n");
 		hcd->self.is_b_host = 0;
 		musb->xceiv.state = OTG_STATE_B_PERIPHERAL;
+		MUSB_DEV_MODE(musb);
 		reg = musb_readb(mbase, MUSB_POWER);
 		reg |= MUSB_POWER_SUSPENDM;
 		musb_writeb(mbase, MUSB_POWER, reg);
@@ -579,6 +580,15 @@ static irqreturn_t musb_stage0_irq(struct musb * musb, u8 int_usb,
 
 		/* indicate new connection to OTG machine */
 		switch (musb->xceiv.state) {
+		case OTG_STATE_B_PERIPHERAL:
+			if (int_usb & MUSB_INTR_SUSPEND) {
+				DBG(1, "HNP: SUSPEND and CONNECT, now b_host\n");
+				musb->xceiv.state = OTG_STATE_B_HOST;
+				hcd->self.is_b_host = 1;
+				int_usb &= ~MUSB_INTR_SUSPEND;
+			} else
+				DBG(1, "CONNECT as b_peripheral???\n");
+			break;
 		case OTG_STATE_B_WAIT_ACON:
 			DBG(1, "HNP: Waiting to switch to b_host state\n");
 			musb->xceiv.state = OTG_STATE_B_HOST;
@@ -707,11 +717,11 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 int_usb,
 		case OTG_STATE_B_HOST:
 			musb_hnp_stop(musb);
 			break;
-			/* FALLTHROUGH */
 		case OTG_STATE_A_PERIPHERAL:
 			musb_root_disconnect(musb);
 			/* FALLTHROUGH */
 		case OTG_STATE_B_WAIT_ACON:
+			/* FALLTHROUGH */
 #endif	/* OTG */
 #ifdef CONFIG_USB_GADGET_MUSB_HDRC
 		case OTG_STATE_B_PERIPHERAL:
#1 lore raw

How do we update mach-types on OMAPGIT?

Hi Tony,

To be in sync with 2430 naming convention we requested RMK to rename the Machine ID for 3430

Old one:
omap_sdp3430 MACH_OMAP_SDP3430 OMAP_SDP3430 1138

New one:
omap_3430sdp MACH_OMAP_3430SDP OMAP_3430SDP 1138

Do I need to send a Patch for arch/arm/tools/mach-types?

Regards,
Khasim

#2 lore raw

Re: How do we update mach-types on OMAPGIT?

Quoted 11 lines · Syed Mohammed, Khasim

Hi Tony,

To be in sync with 2430 naming convention we requested RMK to rename the Machine ID for 3430

Old one:
omap_sdp3430 MACH_OMAP_SDP3430 OMAP_SDP3430 1138

New one:
omap_3430sdp MACH_OMAP_3430SDP OMAP_3430SDP 1138

Do I need to send a Patch for arch/arm/tools/mach-types?

I believe you just need to send email to RMK on that.

Tony

#3 lore raw

RE: How do we update mach-types on OMAPGIT?

Tony,

Quoted 6 lines
Quoted 1 line

To be in sync with 2430 naming convention we requested RMK to rename the

Machine ID for 3430

Quoted 4 lines

Old one:
omap_sdp3430 MACH_OMAP_SDP3430 OMAP_SDP3430 1138

Quoted 7 lines
Quoted 4 lines

New one:
omap_3430sdp MACH_OMAP_3430SDP OMAP_3430SDP 1138

Do I need to send a Patch for arch/arm/tools/mach-types?

I believe you just need to send email to RMK on that.

RMK has already re-named this today. I would like to know how do we update this on OMAP GIT?

Regards,
Khasim

#4 lore raw

Re: How do we update mach-types on OMAPGIT?

Quoted 9 lines · Syed Mohammed, Khasim

Tony,

Quoted 6 lines
Quoted 1 line

To be in sync with 2430 naming convention we requested RMK to rename the

Machine ID for 3430

Quoted 4 lines

Old one:
omap_sdp3430 MACH_OMAP_SDP3430 OMAP_SDP3430 1138

Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

New one:
omap_3430sdp MACH_OMAP_3430SDP OMAP_3430SDP 1138

Do I need to send a Patch for arch/arm/tools/mach-types?

I believe you just need to send email to RMK on that.

RMK has already re-named this today. I would like to know how do we update this on OMAP GIT?

Patch?

Tony

#5 lore raw
In reply to Tony Lindgren
Quoted 42 lines · Tony Lindgren

This one fixes some USB HS OPT test unreliability.

Tony

From: Tony Lindgren <[email protected]>
Subject: musb_hdrc: Fix musb_hnp_stop() to return to device mode

Without this patch HNP does not return to device mode, which can confuse OPT tests. Also change to b_host if SUSPEND and CONNECT simultaneously as b_peripheral, and fix a comment.

drivers/usb/musb/musb_core.c +10 -0
@@ -331,6 +331,7 @@ void musb_hnp_stop(struct musb *musb)
 		DBG(1, "HNP: Disabling HR\n");
 		hcd->self.is_b_host = 0;
 		musb->xceiv.state = OTG_STATE_B_PERIPHERAL;
+		MUSB_DEV_MODE(musb);
 		reg = musb_readb(mbase, MUSB_POWER);
 		reg |= MUSB_POWER_SUSPENDM;
 		musb_writeb(mbase, MUSB_POWER, reg);
@@ -579,6 +580,15 @@ static irqreturn_t musb_stage0_irq(struct musb * musb, u8 int_usb,
 
 		/* indicate new connection to OTG machine */
 		switch (musb->xceiv.state) {
+		case OTG_STATE_B_PERIPHERAL:
+			if (int_usb & MUSB_INTR_SUSPEND) {
+				DBG(1, "HNP: SUSPEND and CONNECT, now b_host\n");
+				musb->xceiv.state = OTG_STATE_B_HOST;
+				hcd->self.is_b_host = 1;
+				int_usb &= ~MUSB_INTR_SUSPEND;
+			} else
+				DBG(1, "CONNECT as b_peripheral???\n");
+			break;
 		case OTG_STATE_B_WAIT_ACON:
 			DBG(1, "HNP: Waiting to switch to b_host state\n");
 			musb->xceiv.state = OTG_STATE_B_HOST;
@@ -707,11 +717,11 @@ static irqreturn_t musb_stage2_irq(struct musb * musb, u8 int_usb,
 		case OTG_STATE_B_HOST:
 			musb_hnp_stop(musb);

drivers/usb/musb/musb_core.c static irqreturn_t musb_stage2_irq(struct musb * musb, u8 int_usb, · line 727

Quoted 10 lines
drivers/usb/musb/musb_core.c +1 -1
 			break;
-			/* FALLTHROUGH */
 		case OTG_STATE_A_PERIPHERAL:
 			musb_root_disconnect(musb);
 			/* FALLTHROUGH */
 		case OTG_STATE_B_WAIT_ACON:
+			/* FALLTHROUGH */
 #endif	/* OTG */
 #ifdef CONFIG_USB_GADGET_MUSB_HDRC
 		case OTG_STATE_B_PERIPHERAL:

Pushing this today.

Tony