On 01/17/2017 10:42 AM, Sergei Shtylyov wrote: > Hello! > > On 1/13/2017 5:58 PM, 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. > > I believe it's a step in the right direction but not sure I > understand this patchset... > >> Signed-off-by: Alexandre Bailon <abailon@xxxxxxxxxxxx> >> --- >> drivers/dma/cppi41.c | 28 +++++------------ >> drivers/usb/musb/musb_dsps.c | 73 >> ++++++++++++++++++++++++++++++++++++++++++-- >> 2 files changed, 78 insertions(+), 23 deletions(-) >> >> diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c >> index d5ba43a..4999e7d 100644 >> --- a/drivers/dma/cppi41.c >> +++ b/drivers/dma/cppi41.c >> @@ -79,14 +79,6 @@ >> #define QMGR_QUEUE_C(n) (0x2008 + (n) * 0x10) >> #define QMGR_QUEUE_D(n) (0x200c + (n) * 0x10) >> >> -/* Glue layer specific */ >> -/* USBSS / USB AM335x */ >> -#define USBSS_IRQ_STATUS 0x28 >> -#define USBSS_IRQ_ENABLER 0x2c >> -#define USBSS_IRQ_CLEARR 0x30 >> - >> -#define USBSS_IRQ_PD_COMP (1 << 2) >> - >> /* Packet Descriptor */ >> #define PD2_ZERO_LENGTH (1 << 19) >> >> @@ -288,14 +280,8 @@ static irqreturn_t cppi41_irq(int irq, void *data) >> { >> struct cppi41_dd *cdd = data; >> struct cppi41_channel *c; >> - u32 status; >> int i; >> >> - status = cppi_readl(cdd->usbss_mem + USBSS_IRQ_STATUS); >> - if (!(status & USBSS_IRQ_PD_COMP)) >> - return IRQ_NONE; >> - cppi_writel(status, cdd->usbss_mem + USBSS_IRQ_STATUS); >> - > > You are removing this IRQ code completely, without a callback here? I'm using dmaengine_desc_get_callback_invoke() to call that IRQ code. I have updated cppi41_dma_callback() to invoked a platform callback, which contain the IRQ code. So far, the only issue I had with that approach is when dmaengine_desc_get_callback_invoke() is not called whereas the completion queue is empty, what should only happen during a teardown. That's why I have updated the teardown to use dmaengine_desc_get_callback_invoke(). > >> for (i = QMGR_PENDING_SLOT_Q(FIST_COMPLETION_QUEUE); i < >> QMGR_NUM_PEND; >> i++) { >> u32 val; > [...] >> diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c >> index 9f125e1..2adfe35 100644 >> --- a/drivers/usb/musb/musb_dsps.c >> +++ b/drivers/usb/musb/musb_dsps.c > [...] >> @@ -145,6 +146,13 @@ static const struct debugfs_reg32 >> dsps_musb_regs[] = { >> { "mode", 0xe8 }, >> }; >> >> +/* USBSS / USB AM335x */ >> +#define USBSS_IRQ_STATUS 0x28 >> +#define USBSS_IRQ_ENABLER 0x2c >> +#define USBSS_IRQ_CLEARR 0x30 > > Please indent the values with tabs only, like it was done originally > above... I will fixt it. > > [...] > > MBR, Sergei > Best Regards, Alexandre -- To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html