Felipe, > -----Original Message----- > From: Liu, Bin > Sent: Thursday, April 02, 2015 11:45 AM > To: linux-usb@xxxxxxxxxxxxxxx > Cc: Balbi, Felipe > Subject: RE: [PATCH v2] usb: musb: only set test mode once > > Felipe, > > > -----Original Message----- > > From: Liu, Bin > > Sent: Tuesday, March 24, 2015 3:09 PM > > To: linux-usb@xxxxxxxxxxxxxxx > > Cc: Balbi, Felipe; Liu, Bin > > Subject: [PATCH v2] usb: musb: only set test mode once > > > > The MUSB test mode register can only be set once, otherwise the result > > is undefined. > > > > This prevents the debugfs testmode entry to set the register more than > > once which causes test failure. > > > > Signed-off-by: Bin Liu <b-liu@xxxxxx> > > I see you have not picked up this patch yet. Can you please hold on it? > > I noticed only the USB2.0 Specs mentioned about USB reset to exit test mode, > but not in the MUSB data manual. > > I am guessing running multiple 'test packet' command causing incorrect test > packets is due to the driver loading the test packets into EP0 FIFO multiple times. > I simply masked this then the analyzer trace shows the test packets are correct > even after ran 'test packet' command multiple times. > > I will have to hook up a scope to measure the signal to ensure the DP/DM signals > are still correct after run each test mode command multiple times for MUSB. If so, > then the patch we need is to ensure not loading the test packet to FIFO multiple > times. Sorry for the noise. This patch is still valid. Switching test mode without reset fails on MUSB. Regards, -Bin. > > Regards, > -Bin. > > > --- > > v2: revise the dev_err message. > > > > drivers/usb/musb/musb_debugfs.c | 9 ++++++++- > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/usb/musb/musb_debugfs.c > > b/drivers/usb/musb/musb_debugfs.c index 78a283e..04382ec 100644 > > --- a/drivers/usb/musb/musb_debugfs.c > > +++ b/drivers/usb/musb/musb_debugfs.c > > @@ -191,9 +191,16 @@ static ssize_t musb_test_mode_write(struct file *file, { > > struct seq_file *s = file->private_data; > > struct musb *musb = s->private; > > - u8 test = 0; > > + u8 test; > > char buf[18]; > > > > + test = musb_readb(musb->mregs, MUSB_TESTMODE); > > + if (test) { > > + dev_err(musb->controller, "Error: test mode is already set. " > > + "Please do USB Bus Reset to start a new test.\n"); > > + return count; > > + } > > + > > memset(buf, 0x00, sizeof(buf)); > > > > if (copy_from_user(buf, ubuf, min_t(size_t, sizeof(buf) - 1, > > count))) > > -- > > 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html