Skip to contentSkip to conversation

MUSB: fix wrongly created sysfs entry

PATCH New Pandita, Vikram 3 participants 7 messages Dec 15, 2008 14 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 1229354799.22285.234.camel@violet

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 1229356837.22285.239.camel@violet

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#13 lore raw

PATCH 1/1 MUSB: fix wrongly created sysfs entry

From: Vikram Pandita <[email protected]>

attr_srp is created wrongly for GADGET only mode of MUSB The attribute is related to OTG mode only

For Gadget mode, this attribute gets created on insmod but does not get deleted. Fixing this bug.

---
 drivers/usb/musb/musb_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/musb/musb_core.c +1 -1
index 5280dba..e7a5759 100644
@@ -2058,7 +2058,7 @@ bad_config:
 #ifdef CONFIG_SYSFS
 	status = device_create_file(dev, &dev_attr_mode);
 	status = device_create_file(dev, &dev_attr_vbus);
-#ifdef CONFIG_USB_GADGET_MUSB_HDRC
+#ifdef CONFIG_USB_MUSB_OTG
 	status = device_create_file(dev, &dev_attr_srp);
 #endif /* CONFIG_USB_GADGET_MUSB_HDRC */
 	status = 0;
Signature · 1 line
1.6.0.3.613.g9f8f13

A message that is not in the archive (sent off-list or not yet received): FCCFB4CDC6E5564B9182F639FC356087025127B95B-/tLxBxkBPtCIQmiDNMet8wC/[email protected]

#15 lore raw

PATCH v2 1/1 MUSB: fix wrongly created sysfs entry

From: Vikram Pandita <[email protected]>

attr_srp is created wrongly for GADGET only mode of MUSB The attribute is related to OTG mode only

For Gadget mode, this attribute gets created on insmod but does not get deleted. Fixing the bug.

---

Fixing the comment-line in v2 of this patch

 drivers/usb/musb/musb_core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/usb/musb/musb_core.c +2 -2
index 5280dba..6b42667 100644
@@ -2058,9 +2058,9 @@ bad_config:
 #ifdef CONFIG_SYSFS
 	status = device_create_file(dev, &dev_attr_mode);
 	status = device_create_file(dev, &dev_attr_vbus);
-#ifdef CONFIG_USB_GADGET_MUSB_HDRC
+#ifdef CONFIG_USB_MUSB_OTG
 	status = device_create_file(dev, &dev_attr_srp);
-#endif /* CONFIG_USB_GADGET_MUSB_HDRC */
+#endif /* CONFIG_USB_MUSB_OTG */
 	status = 0;
 #endif
 	if (status)
Signature · 6 lines
1.6.0.3.613.g9f8f13

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#16 lore raw
Quoted 9 lines · Vikram

From: Vikram Pandita <[email protected]>

attr_srp is created wrongly for GADGET only mode of MUSB The attribute is related to OTG mode only

For Gadget mode, this attribute gets created on insmod but does not get deleted. Fixing the bug.

NAK, any gadget is allowed to initiate SRP.
See otg rev1.3 page 20:

"Any B-device, including a standard USB peripheral, is allowed to initiate SRP"

Signature · 1 line
balbi
#17 lore raw
Quoted 13 lines

-----Original Message-----
From: Felipe Balbi [mailto:me-uiRdBs8odbtmTBlB0Cgj/[email protected]]

Quoted 8 lines · Vikram

From: Vikram Pandita <[email protected]>

attr_srp is created wrongly for GADGET only mode of MUSB The attribute is related to OTG mode only

For Gadget mode, this attribute gets created on insmod but does not get deleted. Fixing the bug.

Quoted 7 lines
Quoted 1 line

NAK, any gadget is allowed to initiate SRP.
See otg rev1.3 page 20:

"Any B-device, including a standard USB peripheral, is allowed to initiate SRP"

Agreed. In that case, we still need the following patch:
Otherwise the srp entry does not get deleted on rmmod.

drivers/usb/musb/musb_core.c +3 -3
index 5280dba..824ea57 100644
@@ -1829,7 +1829,7 @@ static void musb_free(struct musb *musb)
 #ifdef CONFIG_SYSFS
 	device_remove_file(musb->controller, &dev_attr_mode);
 	device_remove_file(musb->controller, &dev_attr_vbus);
-#ifdef CONFIG_USB_MUSB_OTG
+#ifdef CONFIG_USB_GADGET_MUSB_HDRC
 	device_remove_file(musb->controller, &dev_attr_srp);
 #endif
 #endif
@@ -2060,7 +2060,7 @@ bad_config:
 	status = device_create_file(dev, &dev_attr_vbus);
 #ifdef CONFIG_USB_GADGET_MUSB_HDRC
 	status = device_create_file(dev, &dev_attr_srp);
-#endif /* CONFIG_USB_GADGET_MUSB_HDRC */
+#endif
 	status = 0;
 #endif
 	if (status)
@@ -2072,7 +2072,7 @@ fail2:
 #ifdef CONFIG_SYSFS
 	device_remove_file(musb->controller, &dev_attr_mode);
 	device_remove_file(musb->controller, &dev_attr_vbus);
-#ifdef CONFIG_USB_MUSB_OTG
+#ifdef CONFIG_USB_GADGET_MUSB_HDRC
 	device_remove_file(musb->controller, &dev_attr_srp);
 #endif
 #endif

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#18 lore raw

Hi,

Quoted 2 lines · Vikram

Agreed. In that case, we still need the following patch:
Otherwise the srp entry does not get deleted on rmmod.

makes sense, can you just update one thing:

Quoted 15 lines
drivers/usb/musb/musb_core.c +1 -1
index 5280dba..824ea57 100644
@@ -1829,7 +1829,7 @@ static void musb_free(struct musb *musb)
 #ifdef CONFIG_SYSFS
 	device_remove_file(musb->controller, &dev_attr_mode);
 	device_remove_file(musb->controller, &dev_attr_vbus);
-#ifdef CONFIG_USB_MUSB_OTG
+#ifdef CONFIG_USB_GADGET_MUSB_HDRC
 	device_remove_file(musb->controller, &dev_attr_srp);
 #endif
 #endif

drivers/usb/musb/musb_core.c bad_config: · line 2063

Quoted 5 lines
drivers/usb/musb/musb_core.c +1 -1
@@ -2060,7 +2060,7 @@ bad_config:
 	status = device_create_file(dev, &dev_attr_vbus);
 #ifdef CONFIG_USB_GADGET_MUSB_HDRC
 	status = device_create_file(dev, &dev_attr_srp);
-#endif /* CONFIG_USB_GADGET_MUSB_HDRC */
+#endif

leave the comment there :-)

Signature · 1 line
balbi
#19 lore raw

PATCH v3 1/1 MUSB: fix srp sysfs entry deletion

From: Vikram Pandita <[email protected]>

srp sysfs attribute is dependent on gadget mode

the entry was not getting deleted in rmmod case,
fixing the bug

---
 drivers/usb/musb/musb_core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/usb/musb/musb_core.c +2 -2
index 5280dba..4cc2638 100644
@@ -1829,7 +1829,7 @@ static void musb_free(struct musb *musb)
 #ifdef CONFIG_SYSFS
 	device_remove_file(musb->controller, &dev_attr_mode);
 	device_remove_file(musb->controller, &dev_attr_vbus);
-#ifdef CONFIG_USB_MUSB_OTG
+#ifdef CONFIG_USB_GADGET_MUSB_HDRC
 	device_remove_file(musb->controller, &dev_attr_srp);
 #endif
 #endif
@@ -2072,7 +2072,7 @@ fail2:
 #ifdef CONFIG_SYSFS
 	device_remove_file(musb->controller, &dev_attr_mode);
 	device_remove_file(musb->controller, &dev_attr_vbus);
-#ifdef CONFIG_USB_MUSB_OTG
+#ifdef CONFIG_USB_GADGET_MUSB_HDRC
 	device_remove_file(musb->controller, &dev_attr_srp);
 #endif
 #endif
Signature · 1 line
1.6.0.3.613.g9f8f13