05 Aug, 2015

1 commit


31 Jul, 2015

1 commit

  • Since maxpacket_limit was introduced all UDC drivers should use
    usb_ep_set_maxpacket_limit() function instead of setting maxpacket value
    manually. ep.maxpacket_limit contains actual maximum maxpacket value
    supported by hardware which is needed by epautoconf.

    Signed-off-by: Robert Baldyga
    Acked-by: Michal Nazarewicz
    Signed-off-by: Felipe Balbi

    Robert Baldyga
     

09 Jun, 2015

1 commit

  • isp1760_ep_alloc_request allocates a structure with kzalloc without checking
    for NULL and then returns a pointer to one of the structure fields. As the
    field happens to be the first in the structure the caller can properly check
    for NULL, but this is risky if the structure layout is changed later. Add an
    explicit NULL check for the kzalloc return value

    Detected with smatch static analysis:

    drivers/usb/isp1760/isp1760-udc.c:816 isp1760_ep_alloc_request()
    error: potential null dereference 'req'. (kzalloc returns null)

    [ thanks to Laurent Pinchart for improved commit message ]

    Signed-off-by: Colin Ian King
    Acked-by: Laurent Pinchart
    Signed-off-by: Greg Kroah-Hartman

    Colin Ian King
     

10 Apr, 2015

1 commit


08 Apr, 2015

1 commit


07 Apr, 2015

1 commit


04 Apr, 2015

1 commit


25 Mar, 2015

1 commit

  • Commit a124820de5fd ("usb: isp1760: fix possible deadlock in
    isp1760_udc_irq") replaced spin_{un,}lock with spin_{un,}lock_irq{save,restore}.
    However it missed an error path resulting in the smatch warning as below:

    drivers/usb/isp1760/isp1760-udc.c:1230 isp1760_udc_start() warn: inconsistent returns 'irqsave:flags'.
    Locked on: line 1207
    Unlocked on: line 1199

    This patch fixes the spin unlock in the error path in isp1760_udc_start
    thereby removing the smatch warning mentioned above.

    Reported-by: Dan Carpenter
    Cc: Laurent Pinchart
    Cc: Felipe Balbi
    Signed-off-by: Sudeep Holla
    Signed-off-by: Felipe Balbi

    Sudeep Holla
     

11 Mar, 2015

1 commit

  • As per the SAF1761 data sheet[0], the DcChipID register represents
    the hardware version number (0001h) and the chip ID (1582h) for the
    Peripheral Controller.

    However as per the ISP1761 data sheet[1], the DcChipID register
    represents the hardware version number (0015h) and the chip ID (8210h)
    for the Peripheral Controller.

    This patch adds support for both the chip ID values.

    [0] http://www.nxp.com/documents/data_sheet/SAF1761.pdf
    [1] http://pdf.datasheetcatalog.com/datasheets2/74/742102_1.pdf

    Cc: Felipe Balbi
    Cc: Laurent Pinchart
    Signed-off-by: Sudeep Holla
    Acked-by: Laurent Pinchart
    Signed-off-by: Felipe Balbi

    Sudeep Holla
     

09 Mar, 2015

3 commits

  • As per the SAF1761 data sheet[0], the DcChipID register represents
    the hardware version number (0001h) and the chip ID (1582h) for the
    Peripheral Controller.

    However as per the ISP1761 data sheet[1], the DcChipID register
    represents the hardware version number (0015h) and the chip ID (8210h)
    for the Peripheral Controller.

    This patch adds support for both the chip ID values.

    [0] http://www.nxp.com/documents/data_sheet/SAF1761.pdf
    [1] http://pdf.datasheetcatalog.com/datasheets2/74/742102_1.pdf

    Acked-by: Laurent Pinchart
    Signed-off-by: Sudeep Holla
    Signed-off-by: Felipe Balbi

    Sudeep Holla
     
  • The IRQF_DISABLED is a NOOP and scheduled to be removed. According to
    commit e58aa3d2d0cc ("genirq: Run irq handlers with interrupts
    disabled") running IRQ handlers with interrupts enabled can cause stack
    overflows when the interrupt line of the issuing device is still active.

    This patch removes using this deprecated flag and additionally removes
    redundantly setting IRQF_SHARED for isp1760_udc_register().

    Signed-off-by: Valentin Rothberg
    Acked-by: Laurent Pinchart
    Signed-off-by: Felipe Balbi

    Valentin Rothberg
     
  • Use spin_{un,}lock_irq{save,restore} in isp1760_udc_{start,stop} to
    prevent following potentially deadlock scenario between
    isp1760_udc_{start,stop} and isp1760_udc_irq :

    =================================
    [ INFO: inconsistent lock state ]
    4.0.0-rc2-00004-gf7bb2ef60173 #51 Not tainted
    ---------------------------------
    inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
    in:imklog/2118 [HC1[1]:SC0[0]:HE0:SE1] takes:
    (&(&udc->lock)->rlock){?.+...}, at: [] isp1760_udc_irq+0x367/0x9dc
    {HARDIRQ-ON-W} state was registered at:
    [] _raw_spin_lock+0x23/0x30
    [] isp1760_udc_start+0x23/0xf8
    [] udc_bind_to_driver+0x71/0xb0
    [] usb_gadget_probe_driver+0x53/0x9c
    [] usb_composite_probe+0x8a/0xa4 [libcomposite]
    [] 0xbf8311a7
    [] do_one_initcall+0x8d/0x17c
    [] do_init_module+0x49/0x148
    [] load_module+0xb7f/0xbc4
    [] SyS_finit_module+0x51/0x74
    [] ret_fast_syscall+0x1/0x68
    irq event stamp: 4966
    hardirqs last enabled at (4965): [] _raw_spin_unlock_irq+0x1f/0x24
    hardirqs last disabled at (4966): [] __irq_svc+0x33/0x64
    softirqs last enabled at (4458): [] __do_softirq+0x23d/0x2d0
    softirqs last disabled at (4389): [] irq_exit+0xef/0x15c

    other info that might help us debug this:
    Possible unsafe locking scenario:

    CPU0
    ----
    lock(&(&udc->lock)->rlock);

    lock(&(&udc->lock)->rlock);

    *** DEADLOCK ***

    1 lock held by in:imklog/2118:
    #0: (&f->f_pos_lock){+.+.+.}, at: [] __fdget_pos+0x31/0x34

    Signed-off-by: Sudeep Holla
    Cc: Greg Kroah-Hartman
    Acked-by: Laurent Pinchart
    Signed-off-by: Felipe Balbi

    Sudeep Holla
     

23 Feb, 2015

1 commit


05 Feb, 2015

1 commit

  • Felipe writes:

    usb: patches for v3.20 merge window

    Here's the big pull request for Gadgets and PHYs. It's
    a total of 217 non-merge commits with pretty much everything
    being touched.

    The most important bits are a ton of new documentation for
    almost all usb gadget functions, a new isp1760 UDC driver,
    several improvements to the old net2280 UDC driver, and
    some minor tracepoint improvements to dwc3.

    Other than that, a big list of minor cleanups, smaller bugfixes
    and new features all over the place.

    Signed-off-by: Felipe Balbi

    Greg Kroah-Hartman
     

27 Jan, 2015

4 commits