[v5,0/6] usb: musb: cppi41: Add a way to manage DMA irq

Message ID 20170125101709.15696-1-abailon@baylibre.com
Headers show
Series
  • usb: musb: cppi41: Add a way to manage DMA irq
Related show

Message

Alexandre Bailon Jan. 25, 2017, 10:17 a.m.
This series was "dmaengine: cppi41: Make the driver more generic".
I have tried to separate as munch I could CPPI 4.1 MUSB driver changes.

Currently, the DMA interrupt is managed by the CPPI 4.1 driver.
The issue here is the CPPI 4.1 driver must access to MUSB glue registers
to manage its interrupt.
In order to move the interrupts management from CPPI 4.1 driver to MUSB
(and then make it more generic), update the MUSB CPPI 4.1 driver with
changes that will help to manage DMA interrupt from MUSB driver.

Changes in v5:
- Clean up patch 4 and 5

Changes in v4:
- Remove musb pointer from struct cppi, cppi41_dma_controller and
  tusb_omap_dma.

Changes in v3:
- Move a patch from another series to this one to avoid build error report
  from kbuild test robot
- Instead of adding and exporting function, add one callback and a pointer
  to musb in struct dma_controller
- Surround the DMA function introduced in musb_dsps with #ifdef / #endif.

Changes in v2:
- Fix some typo in commit messages
- Add more explanation about some changes made by patch 2 in commit message

Alexandre Bailon (6):
  usb: musb: dma: Add a DMA completion platform callback
  usb: musb: cppi41: Detect aborted transfers in cppi41_dma_callback()
  usb: musb: cppi_dma: Clean up cppi structure
  usb: musb: cppi_dma: Clean up cppi41_dma_controller structure
  usb: musb: cppi_dma: Clean up tusb_omap_dma structure
  usb: musb: dsps: Manage CPPI 4.1 DMA interrupt in DSPS

 drivers/dma/cppi41.c             | 28 ++++----------
 drivers/usb/musb/cppi_dma.c      | 26 ++++++-------
 drivers/usb/musb/cppi_dma.h      |  1 -
 drivers/usb/musb/musb_cppi41.c   | 49 +++++++++++++-----------
 drivers/usb/musb/musb_dma.h      |  5 +++
 drivers/usb/musb/musb_dsps.c     | 81 +++++++++++++++++++++++++++++++++++++++-
 drivers/usb/musb/tusb6010_omap.c |  7 ++--
 7 files changed, 134 insertions(+), 63 deletions(-)

-- 
2.10.2

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Vinod Koul Feb. 6, 2017, 3:57 a.m. | #1
On Wed, Jan 25, 2017 at 11:17:09AM +0100, Alexandre Bailon wrote:
> Despite the CPPI 4.1 is a generic DMA, it is tied to USB.

> On the DSPS, CPPI 4.1 interrupt's registers are in USBSS (the MUSB glue).

> Currently, to enable / disable and clear interrupts, the CPPI 4.1 driver

> maps and accesses to USBSS's register, which making CPPI 4.1 driver not

> really generic.

> Move the interrupt management to DSPS driver.

> 

> Signed-off-by: Alexandre Bailon <abailon@baylibre.com>

> ---

>  drivers/dma/cppi41.c         | 28 ++++-----------


Acked-by: Vinod Koul <vinod.koul@intel.com>


-- 
~Vinod
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Peter Ujfalusi Feb. 6, 2017, 8:13 a.m. | #2
On 01/25/2017 12:17 PM, Alexandre Bailon wrote:
> A pointer to musb is now present in the dma_controller structure.

> Remove the one present in tusb_omap_dma structure.


the subject line should be: usb: musb: tusb6010_omap: ...

> Signed-off-by: Alexandre Bailon <abailon@baylibre.com>

> ---

>  drivers/usb/musb/tusb6010_omap.c | 7 +++----

>  1 file changed, 3 insertions(+), 4 deletions(-)

> 

> diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c

> index e6959cc..8b43c4b 100644

> --- a/drivers/usb/musb/tusb6010_omap.c

> +++ b/drivers/usb/musb/tusb6010_omap.c

> @@ -56,7 +56,6 @@ struct tusb_omap_dma_ch {

>  

>  struct tusb_omap_dma {

>  	struct dma_controller		controller;

> -	struct musb			*musb;

>  	void __iomem			*tbase;

>  

>  	int				ch;

> @@ -497,7 +496,7 @@ tusb_omap_dma_allocate(struct dma_controller *c,

>  	u32			reg;

>  

>  	tusb_dma = container_of(c, struct tusb_omap_dma, controller);

> -	musb = tusb_dma->musb;

> +	musb = tusb_dma->controller.musb;

>  	tbase = musb->ctrl_base;

>  

>  	reg = musb_readl(tbase, TUSB_DMA_INT_MASK);

> @@ -534,7 +533,7 @@ tusb_omap_dma_allocate(struct dma_controller *c,

>  		dev_name = "TUSB receive";

>  	}

>  

> -	chdat->musb = tusb_dma->musb;

> +	chdat->musb = tusb_dma->controller.musb;

>  	chdat->tbase = tusb_dma->tbase;

>  	chdat->hw_ep = hw_ep;

>  	chdat->epnum = hw_ep->epnum;

> @@ -667,7 +666,7 @@ tusb_dma_controller_create(struct musb *musb, void __iomem *base)

>  	if (!tusb_dma)

>  		goto out;

>  

> -	tusb_dma->musb = musb;

> +	tusb_dma->controller.musb = musb;

>  	tusb_dma->tbase = musb->ctrl_base;

>  

>  	tusb_dma->ch = -1;

> 


- P├ęter
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bin Liu Feb. 6, 2017, 1:56 p.m. | #3
On Mon, Feb 06, 2017 at 10:13:47AM +0200, Peter Ujfalusi wrote:
> 

> 

> On 01/25/2017 12:17 PM, Alexandre Bailon wrote:

> > A pointer to musb is now present in the dma_controller structure.

> > Remove the one present in tusb_omap_dma structure.

> 

> the subject line should be: usb: musb: tusb6010_omap: ...


Revised it to 'usb: musb: tusb6010: ...'.

Thanks,
-Bin.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html