Bug 190471 - musb_otg doesn't respond after booting if the USB peripheral isn't attached at boot time.
Summary: musb_otg doesn't respond after booting if the USB peripheral isn't attached a...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Hans Petter Selasky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-02 00:03 UTC by toshi
Modified: 2015-02-25 12:27 UTC (History)
1 user (show)

See Also:


Attachments
path for musb_otg.c (638 bytes, patch)
2015-02-15 08:10 UTC, toshi
no flags Details | Diff
MUSB OTG (921 bytes, patch)
2015-02-15 18:36 UTC, Hans Petter Selasky
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description toshi 2014-06-02 00:03:16 UTC
BeagleBone Black musb_otg doesn't respond after booting if the USB peripheral isn't attached at boot time.
At this time, MUSB2_MASK_IVBUSERR is detected then it doesn't respond.

Environment:
FreeBSD bbb 11.0-CURRENT FreeBSD 11.0-CURRENT #74 r266644M: Thu May 29 08:53:09 JST 2014     toshi@fbsd:/usr/obj/arm.armv6/usr/src/sys/BEAGLEBONE  arm

How-To-Repeat:
Boot without any USB periphel, after booting, connect USB peripheral.

Fix:
I don't know the correct way to fix this problem, but the patch below solve this problem.

2241,2248d2240
< 	if (usb_status & MUSB2_MASK_IVBUSERR &&
< 	    sc->sc_mode == MUSB2_HOST_MODE) {
< 			temp = MUSB2_READ_1(sc, MUSB2_REG_DEVCTL);
< 			temp |= MUSB2_MASK_SESS;
< 			MUSB2_WRITE_1(sc, MUSB2_REG_DEVCTL, temp);
< 			goto done;
< 	}
< 
2347d2338
< done:
Comment 1 toshi 2015-02-15 08:10:36 UTC
Created attachment 152996 [details]
path for musb_otg.c

It still need for some usb devices.
Without this patch and attach the usb device, musb_otg does not respond any more.

I don't know the correct way to fix.
Comment 2 Hans Petter Selasky freebsd_committer freebsd_triage 2015-02-15 09:17:49 UTC
Hi,

Patch look good. Can you explain why you need to the "goto"?

--HPS
Comment 3 Hans Petter Selasky freebsd_committer freebsd_triage 2015-02-15 18:36:50 UTC
Created attachment 153010 [details]
MUSB OTG
Comment 4 Hans Petter Selasky freebsd_committer freebsd_triage 2015-02-15 18:37:09 UTC
Hi,

Can you test my patch instead of yours and see if it works?

--HPS
Comment 5 toshi 2015-02-16 13:45:12 UTC
(In reply to Hans Petter Selasky from comment #4)
Your patch worked.
Thank you for your continuous support.
Comment 6 commit-hook freebsd_committer freebsd_triage 2015-02-16 15:34:37 UTC
A commit references this bug:

Author: hselasky
Date: Mon Feb 16 15:34:11 UTC 2015
New revision: 278850
URL: https://svnweb.freebsd.org/changeset/base/278850

Log:
  Handle VBUS error interrupts.

  Submitted by:	SAITOU Toshihide <toshi@ruby.ocn.ne.jp>
  PR:		190471
  MFC after:	1 week

Changes:
  head/sys/dev/usb/controller/musb_otg.c
Comment 7 Hans Petter Selasky freebsd_committer freebsd_triage 2015-02-16 15:35:53 UTC
MFC to 10- and 9-stable in a weeks time or so.

Thanks for your patch!

--HPS
Comment 8 commit-hook freebsd_committer freebsd_triage 2015-02-25 12:25:15 UTC
A commit references this bug:

Author: hselasky
Date: Wed Feb 25 12:24:25 UTC 2015
New revision: 279279
URL: https://svnweb.freebsd.org/changeset/base/279279

Log:
  MFC r278850:
  Handle VBUS error interrupts.

  PR:		190471

Changes:
_U  stable/10/
  stable/10/sys/dev/usb/controller/musb_otg.c
Comment 9 commit-hook freebsd_committer freebsd_triage 2015-02-25 12:27:16 UTC
A commit references this bug:

Author: hselasky
Date: Wed Feb 25 12:26:45 UTC 2015
New revision: 279280
URL: https://svnweb.freebsd.org/changeset/base/279280

Log:
  MFC r278850:
  Handle VBUS error interrupts.

  PR:		190471

Changes:
_U  stable/9/sys/
_U  stable/9/sys/dev/
  stable/9/sys/dev/usb/controller/musb_otg.c