Re: [PATCH v1 2/3] usb: musb: core: added babble recovery func-ptr to musb-ops
Hi, On Wed, May 29, 2013 at 06:37:03PM +0530, Ravi Babu wrote: Adding babble_recovery operation as part of musb-ops, used to recover from babble condition during babble interrupt. Signed-off-by: Ravi Babu ravib...@ti.com --- drivers/usb/musb/musb_core.c |6 ++ drivers/usb/musb/musb_core.h |7 +++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index ab6fa39..411c29d 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -857,6 +857,12 @@ b_host: } } + /* handle babble condition */ + if (int_usb MUSB_INTR_BABBLE) { + pr_info(babble: restarting the musb controller..); + musb_babble_recovery(musb); + } + #if 0 /* REVISIT ... this would be for multiplexing periodic endpoints, or * supporting transfer phasing to prevent exceeding ISO bandwidth diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index f96e899..bf37dc9 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -213,6 +213,8 @@ struct musb_platform_ops { int (*adjust_channel_params)(struct dma_channel *channel, u16 packet_sz, u8 *mode, dma_addr_t *dma_addr, u32 *len); + + void(*babble_recovery)(struct musb *musb); I don't get why can't 'babble_recovery' be generic. Why do we need each glue layer to implement it ? -- balbi signature.asc Description: Digital signature
RE: [PATCH v1 2/3] usb: musb: core: added babble recovery func-ptr to musb-ops
Felipe On Wed, May 29, 2013 at 06:37:03PM +0530, Ravi Babu wrote: Adding babble_recovery operation as part of musb-ops, used to recover from babble condition during babble interrupt. Signed-off-by: Ravi Babu ravib...@ti.com --- drivers/usb/musb/musb_core.c |6 ++ drivers/usb/musb/musb_core.h |7 +++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index ab6fa39..411c29d 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -857,6 +857,12 @@ b_host: } } + /* handle babble condition */ + if (int_usb MUSB_INTR_BABBLE) { + pr_info(babble: restarting the musb controller..); + musb_babble_recovery(musb); + } + #if 0 /* REVISIT ... this would be for multiplexing periodic endpoints, or * supporting transfer phasing to prevent exceeding ISO bandwidth diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index f96e899..bf37dc9 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -213,6 +213,8 @@ struct musb_platform_ops { int (*adjust_channel_params)(struct dma_channel *channel, u16 packet_sz, u8 *mode, dma_addr_t *dma_addr, u32 *len); + + void(*babble_recovery)(struct musb *musb); I don't get why can't 'babble_recovery' be generic. Why do we need each glue layer to implement it ? Babble is generic, but recovery mechanism is nothing but reset of usbss which is SoC dependent and followed by generic restart of the musb controller. That is why musb_restart() API is exported used by all glue in babble recovery. -- Ravi B -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v1 2/3] usb: musb: core: added babble recovery func-ptr to musb-ops
On Wed, Jun 26, 2013 at 10:37:39AM +0200, B, Ravi wrote: Felipe On Wed, May 29, 2013 at 06:37:03PM +0530, Ravi Babu wrote: Adding babble_recovery operation as part of musb-ops, used to recover from babble condition during babble interrupt. Signed-off-by: Ravi Babu ravib...@ti.com --- drivers/usb/musb/musb_core.c |6 ++ drivers/usb/musb/musb_core.h |7 +++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index ab6fa39..411c29d 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -857,6 +857,12 @@ b_host: } } + /* handle babble condition */ + if (int_usb MUSB_INTR_BABBLE) { + pr_info(babble: restarting the musb controller..); + musb_babble_recovery(musb); + } + #if 0 /* REVISIT ... this would be for multiplexing periodic endpoints, or * supporting transfer phasing to prevent exceeding ISO bandwidth diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index f96e899..bf37dc9 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -213,6 +213,8 @@ struct musb_platform_ops { int (*adjust_channel_params)(struct dma_channel *channel, u16 packet_sz, u8 *mode, dma_addr_t *dma_addr, u32 *len); + + void(*babble_recovery)(struct musb *musb); I don't get why can't 'babble_recovery' be generic. Why do we need each glue layer to implement it ? Babble is generic, but recovery mechanism is nothing but reset of usbss which is SoC dependent and followed by generic restart of the musb controller. and that's what I don't get. Why do you need to reset usbss ? -- balbi signature.asc Description: Digital signature
RE: [PATCH v1 2/3] usb: musb: core: added babble recovery func-ptr to musb-ops
Hi Felipe @@ -213,6 +213,8 @@ struct musb_platform_ops { int (*adjust_channel_params)(struct dma_channel *channel, u16 packet_sz, u8 *mode, dma_addr_t *dma_addr, u32 *len); + + void(*babble_recovery)(struct musb *musb); I don't get why can't 'babble_recovery' be generic. Why do we need each glue layer to implement it ? Babble is generic, but recovery mechanism is nothing but reset of usbss which is SoC dependent and followed by generic restart of the musb controller. and that's what I don't get. Why do you need to reset usbss ? On babble condition, the session bit is removed by mentor, hence to make musb work 1) setting the session alone will not help. 2) restart the usbss and setting session also not helped. 3) musb works only after usbss reset followed by epfifo table init and re-enable all interrupts, then set the session. The mentor IP guys (synopsis) confirmed that during babble condition, controller is stopped. Only recover is to restart completely, usbss reset, reinit epfifo table, set the session. -- balbi -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html