Commit 41c8a48a authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'fixes-for-v3.4-rc5' of...

Merge tag 'fixes-for-v3.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus

usb: fixes for v3.4-rc cycle

A few more fixes for v3.4-rc cycle.

It includes a couple of fixes to the ordering of the methods in udc-core.c.
Without these two patches, we will have issues when either unregistering a
gadget driver (triggered with dummy_hcd only) or issuing a device-initiated
disconnect through sysfs.

There's also a fix on dummy_hcd to not call ->pullup() from udc_stop() because
udc-core.c already handles that.

A fix to MUSB as promised, to kill the compile warnings regarding deprecated
interfaces. We are essentially dropping the __deprecated flag because it
doesn't look like we will ever be able to live without it when we consider the
amount of silicon issues we find on different MUSB instantiations.

A couple of other fixes are also available, one adding the missing transceiver
events to gpio_vbus and another adding a missing unregister call to MUSB's
davinci glue layer.
parents 5c22837a 320cd1e7
...@@ -927,7 +927,6 @@ static int dummy_udc_stop(struct usb_gadget *g, ...@@ -927,7 +927,6 @@ static int dummy_udc_stop(struct usb_gadget *g,
dum->driver = NULL; dum->driver = NULL;
dummy_pullup(&dum->gadget, 0);
return 0; return 0;
} }
......
...@@ -2189,7 +2189,7 @@ static int do_scsi_command(struct fsg_common *common) ...@@ -2189,7 +2189,7 @@ static int do_scsi_command(struct fsg_common *common)
common->data_size_from_cmnd = 0; common->data_size_from_cmnd = 0;
sprintf(unknown, "Unknown x%02x", common->cmnd[0]); sprintf(unknown, "Unknown x%02x", common->cmnd[0]);
reply = check_command(common, common->cmnd_size, reply = check_command(common, common->cmnd_size,
DATA_DIR_UNKNOWN, 0xff, 0, unknown); DATA_DIR_UNKNOWN, ~0, 0, unknown);
if (reply == 0) { if (reply == 0) {
common->curlun->sense_data = SS_INVALID_COMMAND; common->curlun->sense_data = SS_INVALID_COMMAND;
reply = -EINVAL; reply = -EINVAL;
......
...@@ -2579,7 +2579,7 @@ static int do_scsi_command(struct fsg_dev *fsg) ...@@ -2579,7 +2579,7 @@ static int do_scsi_command(struct fsg_dev *fsg)
fsg->data_size_from_cmnd = 0; fsg->data_size_from_cmnd = 0;
sprintf(unknown, "Unknown x%02x", fsg->cmnd[0]); sprintf(unknown, "Unknown x%02x", fsg->cmnd[0]);
if ((reply = check_command(fsg, fsg->cmnd_size, if ((reply = check_command(fsg, fsg->cmnd_size,
DATA_DIR_UNKNOWN, 0xff, 0, unknown)) == 0) { DATA_DIR_UNKNOWN, ~0, 0, unknown)) == 0) {
fsg->curlun->sense_data = SS_INVALID_COMMAND; fsg->curlun->sense_data = SS_INVALID_COMMAND;
reply = -EINVAL; reply = -EINVAL;
} }
......
...@@ -263,8 +263,8 @@ static void usb_gadget_remove_driver(struct usb_udc *udc) ...@@ -263,8 +263,8 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)
if (udc_is_newstyle(udc)) { if (udc_is_newstyle(udc)) {
udc->driver->disconnect(udc->gadget); udc->driver->disconnect(udc->gadget);
udc->driver->unbind(udc->gadget);
usb_gadget_disconnect(udc->gadget); usb_gadget_disconnect(udc->gadget);
udc->driver->unbind(udc->gadget);
usb_gadget_udc_stop(udc->gadget, udc->driver); usb_gadget_udc_stop(udc->gadget, udc->driver);
} else { } else {
usb_gadget_stop(udc->gadget, udc->driver); usb_gadget_stop(udc->gadget, udc->driver);
...@@ -415,9 +415,9 @@ static ssize_t usb_udc_softconn_store(struct device *dev, ...@@ -415,9 +415,9 @@ static ssize_t usb_udc_softconn_store(struct device *dev,
usb_gadget_udc_start(udc->gadget, udc->driver); usb_gadget_udc_start(udc->gadget, udc->driver);
usb_gadget_connect(udc->gadget); usb_gadget_connect(udc->gadget);
} else if (sysfs_streq(buf, "disconnect")) { } else if (sysfs_streq(buf, "disconnect")) {
usb_gadget_disconnect(udc->gadget);
if (udc_is_newstyle(udc)) if (udc_is_newstyle(udc))
usb_gadget_udc_stop(udc->gadget, udc->driver); usb_gadget_udc_stop(udc->gadget, udc->driver);
usb_gadget_disconnect(udc->gadget);
} else { } else {
dev_err(dev, "unsupported command '%s'\n", buf); dev_err(dev, "unsupported command '%s'\n", buf);
return -EINVAL; return -EINVAL;
......
...@@ -386,7 +386,7 @@ static int davinci_musb_init(struct musb *musb) ...@@ -386,7 +386,7 @@ static int davinci_musb_init(struct musb *musb)
usb_nop_xceiv_register(); usb_nop_xceiv_register();
musb->xceiv = usb_get_transceiver(); musb->xceiv = usb_get_transceiver();
if (!musb->xceiv) if (!musb->xceiv)
return -ENODEV; goto unregister;
musb->mregs += DAVINCI_BASE_OFFSET; musb->mregs += DAVINCI_BASE_OFFSET;
...@@ -444,6 +444,7 @@ static int davinci_musb_init(struct musb *musb) ...@@ -444,6 +444,7 @@ static int davinci_musb_init(struct musb *musb)
fail: fail:
usb_put_transceiver(musb->xceiv); usb_put_transceiver(musb->xceiv);
unregister:
usb_nop_xceiv_unregister(); usb_nop_xceiv_unregister();
return -ENODEV; return -ENODEV;
} }
......
...@@ -449,7 +449,7 @@ struct musb { ...@@ -449,7 +449,7 @@ struct musb {
* We added this flag to forcefully disable double * We added this flag to forcefully disable double
* buffering until we get it working. * buffering until we get it working.
*/ */
unsigned double_buffer_not_ok:1 __deprecated; unsigned double_buffer_not_ok:1;
struct musb_hdrc_config *config; struct musb_hdrc_config *config;
......
...@@ -96,7 +96,7 @@ static void gpio_vbus_work(struct work_struct *work) ...@@ -96,7 +96,7 @@ static void gpio_vbus_work(struct work_struct *work)
struct gpio_vbus_data *gpio_vbus = struct gpio_vbus_data *gpio_vbus =
container_of(work, struct gpio_vbus_data, work); container_of(work, struct gpio_vbus_data, work);
struct gpio_vbus_mach_info *pdata = gpio_vbus->dev->platform_data; struct gpio_vbus_mach_info *pdata = gpio_vbus->dev->platform_data;
int gpio; int gpio, status;
if (!gpio_vbus->phy.otg->gadget) if (!gpio_vbus->phy.otg->gadget)
return; return;
...@@ -108,7 +108,9 @@ static void gpio_vbus_work(struct work_struct *work) ...@@ -108,7 +108,9 @@ static void gpio_vbus_work(struct work_struct *work)
*/ */
gpio = pdata->gpio_pullup; gpio = pdata->gpio_pullup;
if (is_vbus_powered(pdata)) { if (is_vbus_powered(pdata)) {
status = USB_EVENT_VBUS;
gpio_vbus->phy.state = OTG_STATE_B_PERIPHERAL; gpio_vbus->phy.state = OTG_STATE_B_PERIPHERAL;
gpio_vbus->phy.last_event = status;
usb_gadget_vbus_connect(gpio_vbus->phy.otg->gadget); usb_gadget_vbus_connect(gpio_vbus->phy.otg->gadget);
/* drawing a "unit load" is *always* OK, except for OTG */ /* drawing a "unit load" is *always* OK, except for OTG */
...@@ -117,6 +119,9 @@ static void gpio_vbus_work(struct work_struct *work) ...@@ -117,6 +119,9 @@ static void gpio_vbus_work(struct work_struct *work)
/* optionally enable D+ pullup */ /* optionally enable D+ pullup */
if (gpio_is_valid(gpio)) if (gpio_is_valid(gpio))
gpio_set_value(gpio, !pdata->gpio_pullup_inverted); gpio_set_value(gpio, !pdata->gpio_pullup_inverted);
atomic_notifier_call_chain(&gpio_vbus->phy.notifier,
status, gpio_vbus->phy.otg->gadget);
} else { } else {
/* optionally disable D+ pullup */ /* optionally disable D+ pullup */
if (gpio_is_valid(gpio)) if (gpio_is_valid(gpio))
...@@ -125,7 +130,12 @@ static void gpio_vbus_work(struct work_struct *work) ...@@ -125,7 +130,12 @@ static void gpio_vbus_work(struct work_struct *work)
set_vbus_draw(gpio_vbus, 0); set_vbus_draw(gpio_vbus, 0);
usb_gadget_vbus_disconnect(gpio_vbus->phy.otg->gadget); usb_gadget_vbus_disconnect(gpio_vbus->phy.otg->gadget);
status = USB_EVENT_NONE;
gpio_vbus->phy.state = OTG_STATE_B_IDLE; gpio_vbus->phy.state = OTG_STATE_B_IDLE;
gpio_vbus->phy.last_event = status;
atomic_notifier_call_chain(&gpio_vbus->phy.notifier,
status, gpio_vbus->phy.otg->gadget);
} }
} }
...@@ -287,6 +297,9 @@ static int __init gpio_vbus_probe(struct platform_device *pdev) ...@@ -287,6 +297,9 @@ static int __init gpio_vbus_probe(struct platform_device *pdev)
irq, err); irq, err);
goto err_irq; goto err_irq;
} }
ATOMIC_INIT_NOTIFIER_HEAD(&gpio_vbus->phy.notifier);
INIT_WORK(&gpio_vbus->work, gpio_vbus_work); INIT_WORK(&gpio_vbus->work, gpio_vbus_work);
gpio_vbus->vbus_draw = regulator_get(&pdev->dev, "vbus_draw"); gpio_vbus->vbus_draw = regulator_get(&pdev->dev, "vbus_draw");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment