03 Sep, 2014

1 commit

  • Some gadget drivers will call usb_ep_queue() more than once before
    the first queue doesn't finish. However, this driver didn't handle
    it correctly. So, this patch fixes the behavior of some
    usbhs_pkt_handle using the "running" flag. Otherwise, the oops below
    happens if we use g_ncm driver and when the "iperf -u -c host -b 200M"
    is running.

    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    pgd = c0004000
    [00000000] *pgd=00000000
    Internal error: Oops: 80000007 [#1] SMP ARM
    Modules linked in: usb_f_ncm g_ncm libcomposite u_ether
    CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 3.17.0-rc1-00008-g8b2be8a-dirty #20
    task: c051c7e0 ti: c0512000 task.ti: c0512000
    PC is at 0x0
    LR is at usbhsf_pkt_handler+0xa8/0x114
    pc : [] lr : [] psr: 60000193
    sp : c0513ce8 ip : c0513c58 fp : c0513d24
    r10: 00000001 r9 : 00000193 r8 : eebec4a0
    r7 : eebec410 r6 : eebe0c6c r5 : 00000000 r4 : ee4a2774
    r3 : 00000000 r2 : ee251e00 r1 : c0513cf4 r0 : ee4a2774

    Signed-off-by: Yoshihiro Shimoda
    Signed-off-by: Felipe Balbi

    Yoshihiro Shimoda
     

10 Jul, 2014

2 commits

  • This patch fixes an issue that the renesas_usbhs driver in gadget mode
    cannot work correctly even if I disabled DMAC of the driver when I used
    the g_zero driver and the testusb tool.

    When a usb cable is re-connected, the renesas_usbhs driver calls the
    usbhsp_flags_init() (via usbhs_hotplug() --> usbhs_mod_call(start) -->
    usbhsg_try_start() --> usbhs_pipe_init()). However, the driver doesn't
    call the usbhsp_flags_init() when usbhsg_ep_disable() is called.
    So, if a gadget driver calls usb_ep_enable() and usb_ep_disable() again
    and again, the renesas_usbhs driver will output the following log:

    renesas_usbhs renesas_usbhs: can't get pipe (BULK)
    renesas_usbhs renesas_usbhs: wrong recip request

    Acked-by: Kuninori Morimoto
    Signed-off-by: Yoshihiro Shimoda
    Signed-off-by: Felipe Balbi

    Yoshihiro Shimoda
     
  • This patch fixes an issue that the driver cannot push a new data when
    a pipe is re-enabled after the pipe is queued.

    Acked-by: Kuninori Morimoto
    Signed-off-by: Yoshihiro Shimoda
    Signed-off-by: Felipe Balbi

    Yoshihiro Shimoda
     

08 Nov, 2012

1 commit

  • received data will break if it was bulk pipe and large data size,
    because pipe kept BUF PID even though it doesn't have enough buffer.
    To avoid this issue, renesas_usbhs can use transfer counter.
    Pipe PID will be NAK if it didn't have enough buffer by this patch.

    renesas_usbhs has strange address mapping.
    Thus, it is difficult to calculate transfer counter setting address.
    This patch use fixed table for it.

    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Felipe Balbi

    Kuninori Morimoto
     

05 Jun, 2012

1 commit


21 Dec, 2011

1 commit


13 Dec, 2011

1 commit

  • driver has to re-use the limited pipe for each device/endpoint
    when it is USB host hub mode, since number of pipe has limitation.

    Then, each pipe should care own pipe sequence for next packet.
    This patch adds sequence control.

    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Felipe Balbi

    Kuninori Morimoto
     

12 Dec, 2011

1 commit


14 Oct, 2011

12 commits


23 Aug, 2011

1 commit


15 Jun, 2011

1 commit


08 Jun, 2011

7 commits

  • USB DMA was installed on "normal DMAC" when SH7724 or older SuperH,
    but the "USB-DMAC" was prepared on recent SuperH.
    These 2 DMAC have a little bit different behavior.

    This patch add DMAEngine code for "normal DMAC",
    but it is still using PIO fifo.
    The DMA fifo will be formally supported in the future.

    You can enable DMA fifo by local fixup
    usbhs_fifo_pio_push_handler -> usbhs_fifo_dma_push_handler
    usbhs_fifo_pio_pop_handler -> usbhs_fifo_dma_pop_handler
    on usbhsg_ep_enable.

    This DMAEngine was tested by g_file_storage on SH7724 Ecovec board

    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Greg Kroah-Hartman

    Kuninori Morimoto
     
  • renesas_usbhs has CFIFO which is for PIO transfer,
    and D0FIFO/D1FIFO which are for DMA transfer.
    The pipe selects one of these fifo when it send/recv data.
    But fifo must not be selected to different pipe in same time.
    This patch add pipe/fifo link for each other,
    and fifo is not selected by another pipe until it is unselected.

    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Greg Kroah-Hartman

    Kuninori Morimoto
     
  • On current driver, overall data transfer method was implemented in fifo.c,
    but its interrupt which is member of packet queue control
    was still in mod_gadget.c.
    This patch move it into fifo.c.
    By this patch, the packet/fifo control is independent from mod_gadget.

    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Greg Kroah-Hartman

    Kuninori Morimoto
     
  • Current renesas_usbhs driver is controlling packet queue on mod_gadget.c.
    But it has relationship with pipe/fifo, not host/gadget.
    So, controlling USB packet queue in pipe.c/fifo.c is
    more convenient than in mod_gadget.c.
    This patch modify it.

    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Greg Kroah-Hartman

    Kuninori Morimoto
     
  • DMAEngine will be supported to this driver in the future.
    Then, both PIO and DMA data transfer method should be supported.
    But, the transfer function can returns the result immediately
    in PIO version, but it can't in DMA version.
    This patch divides data transfer functions into top/bottom half
    in preparation for DMAEngine support.

    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Greg Kroah-Hartman

    Kuninori Morimoto
     
  • Current renesas_usbhs has PIO data transfer mode which controls CFIFO.
    And it was implemented in pipe.c.
    But, fifo control method needs more flexible implementation
    to support DMAEngine.
    This patch create fifo.c, and it became independent from pipe.c.

    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Greg Kroah-Hartman

    Kuninori Morimoto
     
  • Current driver had pipe direction flag
    which came from usb_endpoint_dir_in().
    It means "input direction" for HOST,
    and "out direction" for Gadget.
    But driver needs "input direction for pipe".
    This patch adds IS_DIR_HOST flags and care
    both "input direction for HOST" and "input direction for pipe"

    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Greg Kroah-Hartman

    Kuninori Morimoto
     

12 May, 2011

1 commit


30 Apr, 2011

2 commits


14 Apr, 2011

1 commit