Re: [PATCH] usb: gadget: mv_udc: fix potential register access when clock off

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

 



Hello.

On 03-05-2012 10:04, Neil Zhang wrote:

The Android gadget has sysfs interface to configure usb gadget.
And it may access udc driver when there is no cable attached.
That is too say,

   s/too/to/

> the udc controller may in clock off status.

   May be?

It will cause system hang when access udc controller's register at this
time.

Change-Id: Ib8783b725f5f57323499d23bc891c6f9a07b5e8d

   Remove this please -- it has no place in an upstream commit.

Signed-off-by: Neil Zhang<zhangwm@xxxxxxxxxxx>
---
  drivers/usb/gadget/mv_udc_core.c |   12 +++++++++++-
  1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c
index 771ef45..067cf65 100644
--- a/drivers/usb/gadget/mv_udc_core.c
+++ b/drivers/usb/gadget/mv_udc_core.c
@@ -2333,6 +2339,11 @@ usb_reg_show(struct device *dev, struct device_attribute *attr, char *buf)
  		return -1;
  	}

+	if (!udc->active) {
+		ret = sprintf(buf, "The controller is clock off now.\n");

   Clocked?

WBR, Sergei
--
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