Commit 313e1a0a authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'fixes-for-v4.0-rc3' of...

Merge tag 'fixes-for-v4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus

Felipe writes:

usb: fixes for v4.0-rc3

Revert interrupt endpoint support from g_zero as it regresses
musb.
A possible deadlock in isp1760 udc irq has been fixed.
A fix to dwc2 for disconnect IRQ handling.
We also have a new device ID for isp1760.
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parents d0167ad2 2c247804
...@@ -377,6 +377,9 @@ static void dwc2_handle_disconnect_intr(struct dwc2_hsotg *hsotg) ...@@ -377,6 +377,9 @@ static void dwc2_handle_disconnect_intr(struct dwc2_hsotg *hsotg)
dwc2_is_host_mode(hsotg) ? "Host" : "Device", dwc2_is_host_mode(hsotg) ? "Host" : "Device",
dwc2_op_state_str(hsotg)); dwc2_op_state_str(hsotg));
if (hsotg->op_state == OTG_STATE_A_HOST)
dwc2_hcd_disconnect(hsotg);
/* Change to L3 (OFF) state */ /* Change to L3 (OFF) state */
hsotg->lx_state = DWC2_L3; hsotg->lx_state = DWC2_L3;
......
...@@ -289,8 +289,7 @@ static void disable_loopback(struct f_loopback *loop) ...@@ -289,8 +289,7 @@ static void disable_loopback(struct f_loopback *loop)
struct usb_composite_dev *cdev; struct usb_composite_dev *cdev;
cdev = loop->function.config->cdev; cdev = loop->function.config->cdev;
disable_endpoints(cdev, loop->in_ep, loop->out_ep, NULL, NULL, NULL, disable_endpoints(cdev, loop->in_ep, loop->out_ep, NULL, NULL);
NULL);
VDBG(cdev, "%s disabled\n", loop->function.name); VDBG(cdev, "%s disabled\n", loop->function.name);
} }
......
This diff is collapsed.
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
#define GZERO_QLEN 32 #define GZERO_QLEN 32
#define GZERO_ISOC_INTERVAL 4 #define GZERO_ISOC_INTERVAL 4
#define GZERO_ISOC_MAXPACKET 1024 #define GZERO_ISOC_MAXPACKET 1024
#define GZERO_INT_INTERVAL 1 /* Default interrupt interval = 1 ms */
#define GZERO_INT_MAXPACKET 1024
struct usb_zero_options { struct usb_zero_options {
unsigned pattern; unsigned pattern;
...@@ -19,10 +17,6 @@ struct usb_zero_options { ...@@ -19,10 +17,6 @@ struct usb_zero_options {
unsigned isoc_maxpacket; unsigned isoc_maxpacket;
unsigned isoc_mult; unsigned isoc_mult;
unsigned isoc_maxburst; unsigned isoc_maxburst;
unsigned int_interval; /* In ms */
unsigned int_maxpacket;
unsigned int_mult;
unsigned int_maxburst;
unsigned bulk_buflen; unsigned bulk_buflen;
unsigned qlen; unsigned qlen;
}; };
...@@ -34,10 +28,6 @@ struct f_ss_opts { ...@@ -34,10 +28,6 @@ struct f_ss_opts {
unsigned isoc_maxpacket; unsigned isoc_maxpacket;
unsigned isoc_mult; unsigned isoc_mult;
unsigned isoc_maxburst; unsigned isoc_maxburst;
unsigned int_interval; /* In ms */
unsigned int_maxpacket;
unsigned int_mult;
unsigned int_maxburst;
unsigned bulk_buflen; unsigned bulk_buflen;
/* /*
...@@ -72,7 +62,6 @@ int lb_modinit(void); ...@@ -72,7 +62,6 @@ int lb_modinit(void);
void free_ep_req(struct usb_ep *ep, struct usb_request *req); void free_ep_req(struct usb_ep *ep, struct usb_request *req);
void disable_endpoints(struct usb_composite_dev *cdev, void disable_endpoints(struct usb_composite_dev *cdev,
struct usb_ep *in, struct usb_ep *out, struct usb_ep *in, struct usb_ep *out,
struct usb_ep *iso_in, struct usb_ep *iso_out, struct usb_ep *iso_in, struct usb_ep *iso_out);
struct usb_ep *int_in, struct usb_ep *int_out);
#endif /* __G_ZERO_H */ #endif /* __G_ZERO_H */
...@@ -68,8 +68,6 @@ static struct usb_zero_options gzero_options = { ...@@ -68,8 +68,6 @@ static struct usb_zero_options gzero_options = {
.isoc_maxpacket = GZERO_ISOC_MAXPACKET, .isoc_maxpacket = GZERO_ISOC_MAXPACKET,
.bulk_buflen = GZERO_BULK_BUFLEN, .bulk_buflen = GZERO_BULK_BUFLEN,
.qlen = GZERO_QLEN, .qlen = GZERO_QLEN,
.int_interval = GZERO_INT_INTERVAL,
.int_maxpacket = GZERO_INT_MAXPACKET,
}; };
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -268,21 +266,6 @@ module_param_named(isoc_maxburst, gzero_options.isoc_maxburst, uint, ...@@ -268,21 +266,6 @@ module_param_named(isoc_maxburst, gzero_options.isoc_maxburst, uint,
S_IRUGO|S_IWUSR); S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(isoc_maxburst, "0 - 15 (ss only)"); MODULE_PARM_DESC(isoc_maxburst, "0 - 15 (ss only)");
module_param_named(int_interval, gzero_options.int_interval, uint,
S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(int_interval, "1 - 16");
module_param_named(int_maxpacket, gzero_options.int_maxpacket, uint,
S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(int_maxpacket, "0 - 1023 (fs), 0 - 1024 (hs/ss)");
module_param_named(int_mult, gzero_options.int_mult, uint, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(int_mult, "0 - 2 (hs/ss only)");
module_param_named(int_maxburst, gzero_options.int_maxburst, uint,
S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(int_maxburst, "0 - 15 (ss only)");
static struct usb_function *func_lb; static struct usb_function *func_lb;
static struct usb_function_instance *func_inst_lb; static struct usb_function_instance *func_inst_lb;
...@@ -318,10 +301,6 @@ static int __init zero_bind(struct usb_composite_dev *cdev) ...@@ -318,10 +301,6 @@ static int __init zero_bind(struct usb_composite_dev *cdev)
ss_opts->isoc_maxpacket = gzero_options.isoc_maxpacket; ss_opts->isoc_maxpacket = gzero_options.isoc_maxpacket;
ss_opts->isoc_mult = gzero_options.isoc_mult; ss_opts->isoc_mult = gzero_options.isoc_mult;
ss_opts->isoc_maxburst = gzero_options.isoc_maxburst; ss_opts->isoc_maxburst = gzero_options.isoc_maxburst;
ss_opts->int_interval = gzero_options.int_interval;
ss_opts->int_maxpacket = gzero_options.int_maxpacket;
ss_opts->int_mult = gzero_options.int_mult;
ss_opts->int_maxburst = gzero_options.int_maxburst;
ss_opts->bulk_buflen = gzero_options.bulk_buflen; ss_opts->bulk_buflen = gzero_options.bulk_buflen;
func_ss = usb_get_function(func_inst_ss); func_ss = usb_get_function(func_inst_ss);
......
...@@ -151,8 +151,7 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags, ...@@ -151,8 +151,7 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
} }
if (IS_ENABLED(CONFIG_USB_ISP1761_UDC) && !udc_disabled) { if (IS_ENABLED(CONFIG_USB_ISP1761_UDC) && !udc_disabled) {
ret = isp1760_udc_register(isp, irq, irqflags | IRQF_SHARED | ret = isp1760_udc_register(isp, irq, irqflags);
IRQF_DISABLED);
if (ret < 0) { if (ret < 0) {
isp1760_hcd_unregister(&isp->hcd); isp1760_hcd_unregister(&isp->hcd);
return ret; return ret;
......
...@@ -1191,6 +1191,7 @@ static int isp1760_udc_start(struct usb_gadget *gadget, ...@@ -1191,6 +1191,7 @@ static int isp1760_udc_start(struct usb_gadget *gadget,
struct usb_gadget_driver *driver) struct usb_gadget_driver *driver)
{ {
struct isp1760_udc *udc = gadget_to_udc(gadget); struct isp1760_udc *udc = gadget_to_udc(gadget);
unsigned long flags;
/* The hardware doesn't support low speed. */ /* The hardware doesn't support low speed. */
if (driver->max_speed < USB_SPEED_FULL) { if (driver->max_speed < USB_SPEED_FULL) {
...@@ -1198,7 +1199,7 @@ static int isp1760_udc_start(struct usb_gadget *gadget, ...@@ -1198,7 +1199,7 @@ static int isp1760_udc_start(struct usb_gadget *gadget,
return -EINVAL; return -EINVAL;
} }
spin_lock(&udc->lock); spin_lock_irqsave(&udc->lock, flags);
if (udc->driver) { if (udc->driver) {
dev_err(udc->isp->dev, "UDC already has a gadget driver\n"); dev_err(udc->isp->dev, "UDC already has a gadget driver\n");
...@@ -1208,7 +1209,7 @@ static int isp1760_udc_start(struct usb_gadget *gadget, ...@@ -1208,7 +1209,7 @@ static int isp1760_udc_start(struct usb_gadget *gadget,
udc->driver = driver; udc->driver = driver;
spin_unlock(&udc->lock); spin_unlock_irqrestore(&udc->lock, flags);
dev_dbg(udc->isp->dev, "starting UDC with driver %s\n", dev_dbg(udc->isp->dev, "starting UDC with driver %s\n",
driver->function); driver->function);
...@@ -1232,6 +1233,7 @@ static int isp1760_udc_start(struct usb_gadget *gadget, ...@@ -1232,6 +1233,7 @@ static int isp1760_udc_start(struct usb_gadget *gadget,
static int isp1760_udc_stop(struct usb_gadget *gadget) static int isp1760_udc_stop(struct usb_gadget *gadget)
{ {
struct isp1760_udc *udc = gadget_to_udc(gadget); struct isp1760_udc *udc = gadget_to_udc(gadget);
unsigned long flags;
dev_dbg(udc->isp->dev, "%s\n", __func__); dev_dbg(udc->isp->dev, "%s\n", __func__);
...@@ -1239,9 +1241,9 @@ static int isp1760_udc_stop(struct usb_gadget *gadget) ...@@ -1239,9 +1241,9 @@ static int isp1760_udc_stop(struct usb_gadget *gadget)
isp1760_udc_write(udc, DC_MODE, 0); isp1760_udc_write(udc, DC_MODE, 0);
spin_lock(&udc->lock); spin_lock_irqsave(&udc->lock, flags);
udc->driver = NULL; udc->driver = NULL;
spin_unlock(&udc->lock); spin_unlock_irqrestore(&udc->lock, flags);
return 0; return 0;
} }
...@@ -1411,7 +1413,7 @@ static int isp1760_udc_init(struct isp1760_udc *udc) ...@@ -1411,7 +1413,7 @@ static int isp1760_udc_init(struct isp1760_udc *udc)
return -ENODEV; return -ENODEV;
} }
if (chipid != 0x00011582) { if (chipid != 0x00011582 && chipid != 0x00158210) {
dev_err(udc->isp->dev, "udc: invalid chip ID 0x%08x\n", chipid); dev_err(udc->isp->dev, "udc: invalid chip ID 0x%08x\n", chipid);
return -ENODEV; return -ENODEV;
} }
...@@ -1451,8 +1453,8 @@ int isp1760_udc_register(struct isp1760_device *isp, int irq, ...@@ -1451,8 +1453,8 @@ int isp1760_udc_register(struct isp1760_device *isp, int irq,
sprintf(udc->irqname, "%s (udc)", devname); sprintf(udc->irqname, "%s (udc)", devname);
ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | IRQF_DISABLED | ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | irqflags,
irqflags, udc->irqname, udc); udc->irqname, udc);
if (ret < 0) if (ret < 0)
goto error; goto error;
......
...@@ -79,7 +79,8 @@ config USB_MUSB_TUSB6010 ...@@ -79,7 +79,8 @@ config USB_MUSB_TUSB6010
config USB_MUSB_OMAP2PLUS config USB_MUSB_OMAP2PLUS
tristate "OMAP2430 and onwards" tristate "OMAP2430 and onwards"
depends on ARCH_OMAP2PLUS && USB && OMAP_CONTROL_PHY depends on ARCH_OMAP2PLUS && USB
depends on OMAP_CONTROL_PHY || !OMAP_CONTROL_PHY
select GENERIC_PHY select GENERIC_PHY
config USB_MUSB_AM35X config USB_MUSB_AM35X
......
...@@ -126,6 +126,9 @@ struct phy_control *am335x_get_phy_control(struct device *dev) ...@@ -126,6 +126,9 @@ struct phy_control *am335x_get_phy_control(struct device *dev)
return NULL; return NULL;
dev = bus_find_device(&platform_bus_type, NULL, node, match); dev = bus_find_device(&platform_bus_type, NULL, node, match);
if (!dev)
return NULL;
ctrl_usb = dev_get_drvdata(dev); ctrl_usb = dev_get_drvdata(dev);
if (!ctrl_usb) if (!ctrl_usb)
return NULL; return NULL;
......
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