RE: [PATCH] usb: musb: only set test mode once

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sorry, please ignore this one. Forgot to rebase.

Regards,
-Bin.

> -----Original Message-----
> From: Liu, Bin
> Sent: Friday, March 20, 2015 4:45 PM
> To: linux-usb@xxxxxxxxxxxxxxx
> Cc: Balbi, Felipe; Liu, Bin
> Subject: [PATCH] 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>
> ---
>  drivers/usb/musb/musb_debugfs.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/usb/musb/musb_debugfs.c
> b/drivers/usb/musb/musb_debugfs.c index 179d885..7119639 100644
> --- a/drivers/usb/musb/musb_debugfs.c
> +++ b/drivers/usb/musb/musb_debugfs.c
> @@ -189,6 +189,12 @@ static ssize_t musb_test_mode_write(struct file *file,
>  	u8			test = 0;
>  	char			buf[18];
> 
> +	test = musb_readb(musb->mregs, MUSB_TESTMODE);
> +	if (test) {
> +		dev_err(musb->controller, "Error: test mode is running\n");
> +		return -EINVAL;
> +	}
> +
>  	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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux