Some HTC phones first present a Umass descriptor when they're attached
to a machine then disconnect them self and reattach with an Imaging
(MTP) descriptor.

In between they stop answering to umass(4) which vomit some of its best
prose:

        umass0: BBB reset failed, IOERROR
        umass0: BBB bulk-in clear stall failed, IOERROR
        umass0: BBB bulk-out clear stall failed, IOERROR
        umass0: BBB reset failed, IOERROR
        umass0: BBB bulk-in clear stall failed, IOERROR
        umass0: BBB bulk-out clear stall failed, IOERROR
        ...

I don't see the point of printing such stuff in GENERIC.  These messages
alone are useless, so just print them in DEBUG mode.

Ok?

Index: umass.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/usb/umass.c,v
retrieving revision 1.68
diff -u -p -r1.68 umass.c
--- umass.c     18 Jan 2015 14:40:05 -0000      1.68
+++ umass.c     26 Jan 2015 13:09:15 -0000
@@ -1182,10 +1182,10 @@ umass_bbb_state(struct usbd_xfer *xfer, 
                 * err == 0 and the following if block is passed.
                 */
                if (err) {      /* should not occur */
-                       printf("%s: BBB bulk-%s stall clear failed, %s\n",
-                           sc->sc_dev.dv_xname,
+                       DPRINTF(UDMASS_BBB, ("%s: BBB bulk-%s stall clear"
+                           " failed, %s\n", sc->sc_dev.dv_xname,
                            (sc->transfer_dir == DIR_IN? "in":"out"),
-                           usbd_errstr(err));
+                           usbd_errstr(err)));
                        umass_bbb_reset(sc, STATUS_WIRE_FAILED);
                        return;
                }
@@ -1327,8 +1327,8 @@ umass_bbb_state(struct usbd_xfer *xfer, 
        /***** Bulk Reset *****/
        case TSTATE_BBB_RESET1:
                if (err)
-                       printf("%s: BBB reset failed, %s\n",
-                               sc->sc_dev.dv_xname, usbd_errstr(err));
+                       DPRINTF(UDMASS_BBB, ("%s: BBB reset failed, %s\n",
+                               sc->sc_dev.dv_xname, usbd_errstr(err)));
 
                sc->transfer_state = TSTATE_BBB_RESET2;
                umass_clear_endpoint_stall(sc, UMASS_BULKIN,
@@ -1337,8 +1337,9 @@ umass_bbb_state(struct usbd_xfer *xfer, 
                return;
        case TSTATE_BBB_RESET2:
                if (err)        /* should not occur */
-                       printf("%s: BBB bulk-in clear stall failed, %s\n",
-                              sc->sc_dev.dv_xname, usbd_errstr(err));
+                       DPRINTF(UDMASS_BBB, ("%s: BBB bulk-in clear stall"
+                               " failed, %s\n", sc->sc_dev.dv_xname,
+                               usbd_errstr(err)));
                        /* no error recovery, otherwise we end up in a loop */
 
                sc->transfer_state = TSTATE_BBB_RESET3;
@@ -1348,8 +1349,9 @@ umass_bbb_state(struct usbd_xfer *xfer, 
                return;
        case TSTATE_BBB_RESET3:
                if (err)        /* should not occur */
-                       printf("%s: BBB bulk-out clear stall failed, %s\n",
-                              sc->sc_dev.dv_xname, usbd_errstr(err));
+                       DPRINTF(UDMASS_BBB,("%s: BBB bulk-out clear stall"
+                               " failed, %s\n", sc->sc_dev.dv_xname,
+                               usbd_errstr(err)));
                        /* no error recovery, otherwise we end up in a loop */
 
                sc->transfer_state = TSTATE_IDLE;

Reply via email to