Skip to content

Commit

Permalink
Merge tag 'fixes-for-v4.0-rc2' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/balbi/usb into usb-linus

Felipe writes:

usb: fixes for v4.0-rc2

Not that many fixes this time. They have all been tested on
platforms I have around and also passed my randconfig builds.

Here's a quick summary of the changes:

Phonet function learned to not disable a disabled endpoint.

musb received a pm_runtime_irq_safe() call to fix a bug when
calling musb_pullup() (via usb_gadget_{connect,disconnect}())
with irqs disabled.

musb also got a really old fix for throughput with isochronous
endpoints by pushing URB completion to a tasklet (by means of
HCD_BH flag).

musb now can properly get its phys on musb-dsps platforms (am335x
as of now).

musb learned how to read boolean OF properties.

Old bug on how to disable dwc3-omap's IRQs got fixed finally.

A few sparse warnings here and there.

Renesas got a linkage fix.

Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Greg Kroah-Hartman committed Feb 24, 2015
2 parents c517d83 + a045639 commit 17495bd
Show file tree
Hide file tree
Showing 15 changed files with 103 additions and 40 deletions.
30 changes: 28 additions & 2 deletions drivers/usb/dwc3/dwc3-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,18 @@ static void dwc3_omap_write_irq0_set(struct dwc3_omap *omap, u32 value)
omap->irq0_offset, value);
}

static void dwc3_omap_write_irqmisc_clr(struct dwc3_omap *omap, u32 value)
{
dwc3_omap_writel(omap->base, USBOTGSS_IRQENABLE_CLR_MISC +
omap->irqmisc_offset, value);
}

static void dwc3_omap_write_irq0_clr(struct dwc3_omap *omap, u32 value)
{
dwc3_omap_writel(omap->base, USBOTGSS_IRQENABLE_CLR_0 -
omap->irq0_offset, value);
}

static void dwc3_omap_set_mailbox(struct dwc3_omap *omap,
enum omap_dwc3_vbus_id_status status)
{
Expand Down Expand Up @@ -345,9 +357,23 @@ static void dwc3_omap_enable_irqs(struct dwc3_omap *omap)

static void dwc3_omap_disable_irqs(struct dwc3_omap *omap)
{
u32 reg;

/* disable all IRQs */
dwc3_omap_write_irqmisc_set(omap, 0x00);
dwc3_omap_write_irq0_set(omap, 0x00);
reg = USBOTGSS_IRQO_COREIRQ_ST;
dwc3_omap_write_irq0_clr(omap, reg);

reg = (USBOTGSS_IRQMISC_OEVT |
USBOTGSS_IRQMISC_DRVVBUS_RISE |
USBOTGSS_IRQMISC_CHRGVBUS_RISE |
USBOTGSS_IRQMISC_DISCHRGVBUS_RISE |
USBOTGSS_IRQMISC_IDPULLUP_RISE |
USBOTGSS_IRQMISC_DRVVBUS_FALL |
USBOTGSS_IRQMISC_CHRGVBUS_FALL |
USBOTGSS_IRQMISC_DISCHRGVBUS_FALL |
USBOTGSS_IRQMISC_IDPULLUP_FALL);

dwc3_omap_write_irqmisc_clr(omap, reg);
}

static u64 dwc3_omap_dma_mask = DMA_BIT_MASK(32);
Expand Down
2 changes: 0 additions & 2 deletions drivers/usb/gadget/configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,6 @@ static ssize_t interf_grp_compatible_id_store(struct usb_os_desc *desc,
if (desc->opts_mutex)
mutex_lock(desc->opts_mutex);
memcpy(desc->ext_compat_id, page, l);
desc->ext_compat_id[l] = '\0';

if (desc->opts_mutex)
mutex_unlock(desc->opts_mutex);
Expand Down Expand Up @@ -1192,7 +1191,6 @@ static ssize_t interf_grp_sub_compatible_id_store(struct usb_os_desc *desc,
if (desc->opts_mutex)
mutex_lock(desc->opts_mutex);
memcpy(desc->ext_compat_id + 8, page, l);
desc->ext_compat_id[l + 8] = '\0';

if (desc->opts_mutex)
mutex_unlock(desc->opts_mutex);
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/function/f_hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ static int hidg_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
return status;
}

const struct file_operations f_hidg_fops = {
static const struct file_operations f_hidg_fops = {
.owner = THIS_MODULE,
.open = f_hidg_open,
.release = f_hidg_release,
Expand Down
5 changes: 4 additions & 1 deletion drivers/usb/gadget/function/f_phonet.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,10 @@ static int pn_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
return -EINVAL;

spin_lock(&port->lock);
__pn_reset(f);

if (fp->in_ep->driver_data)
__pn_reset(f);

if (alt == 1) {
int i;

Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/function/f_sourcesink.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ static struct usb_endpoint_descriptor ss_int_source_desc = {
.bInterval = USB_MS_TO_SS_INTERVAL(GZERO_INT_INTERVAL),
};

struct usb_ss_ep_comp_descriptor ss_int_source_comp_desc = {
static struct usb_ss_ep_comp_descriptor ss_int_source_comp_desc = {
.bLength = USB_DT_SS_EP_COMP_SIZE,
.bDescriptorType = USB_DT_SS_ENDPOINT_COMP,

Expand All @@ -362,7 +362,7 @@ static struct usb_endpoint_descriptor ss_int_sink_desc = {
.bInterval = USB_MS_TO_SS_INTERVAL(GZERO_INT_INTERVAL),
};

struct usb_ss_ep_comp_descriptor ss_int_sink_comp_desc = {
static struct usb_ss_ep_comp_descriptor ss_int_sink_comp_desc = {
.bLength = USB_DT_SS_EP_COMP_SIZE,
.bDescriptorType = USB_DT_SS_ENDPOINT_COMP,

Expand Down
34 changes: 17 additions & 17 deletions drivers/usb/gadget/function/f_uac2.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#define UNFLW_CTRL 8
#define OVFLW_CTRL 10

const char *uac2_name = "snd_uac2";
static const char *uac2_name = "snd_uac2";

struct uac2_req {
struct uac2_rtd_params *pp; /* parent param */
Expand Down Expand Up @@ -634,7 +634,7 @@ static struct usb_interface_descriptor std_ac_if_desc = {
};

/* Clock source for IN traffic */
struct uac_clock_source_descriptor in_clk_src_desc = {
static struct uac_clock_source_descriptor in_clk_src_desc = {
.bLength = sizeof in_clk_src_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand All @@ -646,7 +646,7 @@ struct uac_clock_source_descriptor in_clk_src_desc = {
};

/* Clock source for OUT traffic */
struct uac_clock_source_descriptor out_clk_src_desc = {
static struct uac_clock_source_descriptor out_clk_src_desc = {
.bLength = sizeof out_clk_src_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand All @@ -658,7 +658,7 @@ struct uac_clock_source_descriptor out_clk_src_desc = {
};

/* Input Terminal for USB_OUT */
struct uac2_input_terminal_descriptor usb_out_it_desc = {
static struct uac2_input_terminal_descriptor usb_out_it_desc = {
.bLength = sizeof usb_out_it_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand All @@ -672,7 +672,7 @@ struct uac2_input_terminal_descriptor usb_out_it_desc = {
};

/* Input Terminal for I/O-In */
struct uac2_input_terminal_descriptor io_in_it_desc = {
static struct uac2_input_terminal_descriptor io_in_it_desc = {
.bLength = sizeof io_in_it_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand All @@ -686,7 +686,7 @@ struct uac2_input_terminal_descriptor io_in_it_desc = {
};

/* Ouput Terminal for USB_IN */
struct uac2_output_terminal_descriptor usb_in_ot_desc = {
static struct uac2_output_terminal_descriptor usb_in_ot_desc = {
.bLength = sizeof usb_in_ot_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand All @@ -700,7 +700,7 @@ struct uac2_output_terminal_descriptor usb_in_ot_desc = {
};

/* Ouput Terminal for I/O-Out */
struct uac2_output_terminal_descriptor io_out_ot_desc = {
static struct uac2_output_terminal_descriptor io_out_ot_desc = {
.bLength = sizeof io_out_ot_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand All @@ -713,7 +713,7 @@ struct uac2_output_terminal_descriptor io_out_ot_desc = {
.bmControls = (CONTROL_RDWR << COPY_CTRL),
};

struct uac2_ac_header_descriptor ac_hdr_desc = {
static struct uac2_ac_header_descriptor ac_hdr_desc = {
.bLength = sizeof ac_hdr_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand Down Expand Up @@ -751,7 +751,7 @@ static struct usb_interface_descriptor std_as_out_if1_desc = {
};

/* Audio Stream OUT Intface Desc */
struct uac2_as_header_descriptor as_out_hdr_desc = {
static struct uac2_as_header_descriptor as_out_hdr_desc = {
.bLength = sizeof as_out_hdr_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand All @@ -764,15 +764,15 @@ struct uac2_as_header_descriptor as_out_hdr_desc = {
};

/* Audio USB_OUT Format */
struct uac2_format_type_i_descriptor as_out_fmt1_desc = {
static struct uac2_format_type_i_descriptor as_out_fmt1_desc = {
.bLength = sizeof as_out_fmt1_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,
.bDescriptorSubtype = UAC_FORMAT_TYPE,
.bFormatType = UAC_FORMAT_TYPE_I,
};

/* STD AS ISO OUT Endpoint */
struct usb_endpoint_descriptor fs_epout_desc = {
static struct usb_endpoint_descriptor fs_epout_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,

Expand All @@ -782,7 +782,7 @@ struct usb_endpoint_descriptor fs_epout_desc = {
.bInterval = 1,
};

struct usb_endpoint_descriptor hs_epout_desc = {
static struct usb_endpoint_descriptor hs_epout_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,

Expand Down Expand Up @@ -828,7 +828,7 @@ static struct usb_interface_descriptor std_as_in_if1_desc = {
};

/* Audio Stream IN Intface Desc */
struct uac2_as_header_descriptor as_in_hdr_desc = {
static struct uac2_as_header_descriptor as_in_hdr_desc = {
.bLength = sizeof as_in_hdr_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand All @@ -841,15 +841,15 @@ struct uac2_as_header_descriptor as_in_hdr_desc = {
};

/* Audio USB_IN Format */
struct uac2_format_type_i_descriptor as_in_fmt1_desc = {
static struct uac2_format_type_i_descriptor as_in_fmt1_desc = {
.bLength = sizeof as_in_fmt1_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,
.bDescriptorSubtype = UAC_FORMAT_TYPE,
.bFormatType = UAC_FORMAT_TYPE_I,
};

/* STD AS ISO IN Endpoint */
struct usb_endpoint_descriptor fs_epin_desc = {
static struct usb_endpoint_descriptor fs_epin_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,

Expand All @@ -859,7 +859,7 @@ struct usb_endpoint_descriptor fs_epin_desc = {
.bInterval = 1,
};

struct usb_endpoint_descriptor hs_epin_desc = {
static struct usb_endpoint_descriptor hs_epin_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,

Expand Down Expand Up @@ -1563,7 +1563,7 @@ static void afunc_unbind(struct usb_configuration *c, struct usb_function *f)
agdev->out_ep->driver_data = NULL;
}

struct usb_function *afunc_alloc(struct usb_function_instance *fi)
static struct usb_function *afunc_alloc(struct usb_function_instance *fi)
{
struct audio_dev *agdev;
struct f_uac2_opts *opts;
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/gadget/function/uvc_v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "uvc.h"
#include "uvc_queue.h"
#include "uvc_video.h"
#include "uvc_v4l2.h"

/* --------------------------------------------------------------------------
* Requests handling
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/gadget/function/uvc_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "uvc.h"
#include "uvc_queue.h"
#include "uvc_video.h"

/* --------------------------------------------------------------------------
* Video codecs
Expand Down
6 changes: 4 additions & 2 deletions drivers/usb/gadget/legacy/g_ffs.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ struct gfs_configuration {
struct usb_configuration c;
int (*eth)(struct usb_configuration *c);
int num;
} gfs_configurations[] = {
};

static struct gfs_configuration gfs_configurations[] = {
#ifdef CONFIG_USB_FUNCTIONFS_RNDIS
{
.eth = bind_rndis_config,
Expand Down Expand Up @@ -278,7 +280,7 @@ static void *functionfs_acquire_dev(struct ffs_dev *dev)
if (!try_module_get(THIS_MODULE))
return ERR_PTR(-ENOENT);

return 0;
return NULL;
}

static void functionfs_release_dev(struct ffs_dev *dev)
Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/isp1760/isp1760-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ static void errata2_function(unsigned long data)
for (slot = 0; slot < 32; slot++)
if (priv->atl_slots[slot].qh && time_after(jiffies,
priv->atl_slots[slot].timestamp +
SLOT_TIMEOUT * HZ / 1000)) {
msecs_to_jiffies(SLOT_TIMEOUT))) {
ptd_read(hcd->regs, ATL_PTD_OFFSET, slot, &ptd);
if (!FROM_DW0_VALID(ptd.dw0) &&
!FROM_DW3_ACTIVE(ptd.dw3))
Expand All @@ -1286,7 +1286,7 @@ static void errata2_function(unsigned long data)

spin_unlock_irqrestore(&priv->lock, spinflags);

errata2_timer.expires = jiffies + SLOT_CHECK_PERIOD * HZ / 1000;
errata2_timer.expires = jiffies + msecs_to_jiffies(SLOT_CHECK_PERIOD);
add_timer(&errata2_timer);
}

Expand Down Expand Up @@ -1336,7 +1336,7 @@ static int isp1760_run(struct usb_hcd *hcd)
return retval;

setup_timer(&errata2_timer, errata2_function, (unsigned long)hcd);
errata2_timer.expires = jiffies + SLOT_CHECK_PERIOD * HZ / 1000;
errata2_timer.expires = jiffies + msecs_to_jiffies(SLOT_CHECK_PERIOD);
add_timer(&errata2_timer);

chipid = reg_read32(hcd->regs, HC_CHIP_ID_REG);
Expand Down
10 changes: 6 additions & 4 deletions drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1969,10 +1969,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
goto fail0;
}

pm_runtime_use_autosuspend(musb->controller);
pm_runtime_set_autosuspend_delay(musb->controller, 200);
pm_runtime_enable(musb->controller);

spin_lock_init(&musb->lock);
musb->board_set_power = plat->set_power;
musb->min_power = plat->min_power;
Expand All @@ -1991,6 +1987,12 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
musb_readl = musb_default_readl;
musb_writel = musb_default_writel;

/* We need musb_read/write functions initialized for PM */
pm_runtime_use_autosuspend(musb->controller);
pm_runtime_set_autosuspend_delay(musb->controller, 200);
pm_runtime_irq_safe(musb->controller);
pm_runtime_enable(musb->controller);

/* The musb_platform_init() call:
* - adjusts musb->mregs
* - sets the musb->isr
Expand Down
Loading

0 comments on commit 17495bd

Please sign in to comment.