mbox series

[v2,0/3] usb: cdns3: three bug fixes for v5.10

Message ID 20201022005505.24167-1-peter.chen@nxp.com
Headers show
Series usb: cdns3: three bug fixes for v5.10 | expand

Message

Peter Chen Oct. 22, 2020, 12:55 a.m. UTC
Changes for v2:
- Move position of explicit cast to unsigned int before ((p) << 24) [Patch 1/3]
- No changes for other patches.

Pawel Laszczak (1):
  usb: cdns3: Fix on-chip memory overflow issue

Peter Chen (2):
  usb: cdns3: gadget: suspicious implicit sign extension
  usb: cdns3: gadget: own the lock wrongly at the suspend routine

 drivers/usb/cdns3/ep0.c    |  65 ++++++++++++----------
 drivers/usb/cdns3/gadget.c | 111 +++++++++++++++++++++----------------
 drivers/usb/cdns3/gadget.h |   5 +-
 3 files changed, 100 insertions(+), 81 deletions(-)

Comments

Felipe Balbi Oct. 27, 2020, 9:27 a.m. UTC | #1
Hi,

Peter Chen <peter.chen@nxp.com> writes:
> From: Pawel Laszczak <pawell@cadence.com>
>
> Patch fixes issue caused setting On-chip memory overflow bit in usb_sts
> register. The issue occurred because EP_CFG register was set twice
> before USB_STS.CFGSTS was set. Every write operation on EP_CFG.BUFFERING
> causes that controller increases internal counter holding the number
> of reserved on-chip buffers. First time this register was updated in
> function cdns3_ep_config before delegating SET_CONFIGURATION request
> to class driver and again it was updated when class wanted to enable
> endpoint.  This patch fixes this issue by configuring endpoints
> enabled by class driver in cdns3_gadget_ep_enable and others just
> before status stage.
>
> Cc: <stable@vger.kernel.org> #v5.8+
> Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
> Reported-and-tested-by: Peter Chen <peter.chen@nxp.com>
> Signed-off-by: Pawel Laszczak <pawell@cadence.com>
> Signed-off-by: Peter Chen <peter.chen@nxp.com>

comment from previous thread is still valid. Far too extensive change to
qualify for stable or -rc. Sure there isn't a minimal patch possible?
Pawel Laszczak Oct. 27, 2020, 11:21 a.m. UTC | #2
Hi,

>
>Peter Chen <peter.chen@nxp.com> writes:
>> From: Pawel Laszczak <pawell@cadence.com>
>>
>> Patch fixes issue caused setting On-chip memory overflow bit in usb_sts
>> register. The issue occurred because EP_CFG register was set twice
>> before USB_STS.CFGSTS was set. Every write operation on EP_CFG.BUFFERING
>> causes that controller increases internal counter holding the number
>> of reserved on-chip buffers. First time this register was updated in
>> function cdns3_ep_config before delegating SET_CONFIGURATION request
>> to class driver and again it was updated when class wanted to enable
>> endpoint.  This patch fixes this issue by configuring endpoints
>> enabled by class driver in cdns3_gadget_ep_enable and others just
>> before status stage.
>>
>> Cc: <stable@vger.kernel.org> #v5.8+
>> Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
>> Reported-and-tested-by: Peter Chen <peter.chen@nxp.com>
>> Signed-off-by: Pawel Laszczak <pawell@cadence.com>
>> Signed-off-by: Peter Chen <peter.chen@nxp.com>
>
>comment from previous thread is still valid. Far too extensive change to
>qualify for stable or -rc. Sure there isn't a minimal patch possible?
>

I think that it's the only way to fix this issue. This fix require to displacement 
of code fragments and it's the reason why this patch is such extensive.

Regards,
Pawel
Greg Kroah-Hartman Oct. 28, 2020, 9:07 a.m. UTC | #3
On Thu, Oct 22, 2020 at 08:55:02AM +0800, Peter Chen wrote:
> Changes for v2:
> - Move position of explicit cast to unsigned int before ((p) << 24) [Patch 1/3]
> - No changes for other patches.
> 
> Pawel Laszczak (1):
>   usb: cdns3: Fix on-chip memory overflow issue
> 
> Peter Chen (2):
>   usb: cdns3: gadget: suspicious implicit sign extension
>   usb: cdns3: gadget: own the lock wrongly at the suspend routine

Are you going to send me patches to queue up for this driver any time
soon?  I've seen lots of different ones fly by, but no "please take
this" type of hint to me, so I have no idea what to do at all...

thanks,

greg k-h
Peter Chen Oct. 28, 2020, 9:33 a.m. UTC | #4
> On Thu, Oct 22, 2020 at 08:55:02AM +0800, Peter Chen wrote:
> > Changes for v2:
> > - Move position of explicit cast to unsigned int before ((p) << 24)
> > [Patch 1/3]
> > - No changes for other patches.
> >
> > Pawel Laszczak (1):
> >   usb: cdns3: Fix on-chip memory overflow issue
> >
> > Peter Chen (2):
> >   usb: cdns3: gadget: suspicious implicit sign extension
> >   usb: cdns3: gadget: own the lock wrongly at the suspend routine
> 
> Are you going to send me patches to queue up for this driver any time soon?
> I've seen lots of different ones fly by, but no "please take this" type of hint to
> me, so I have no idea what to do at all...
> 

I will queue them up after reviewing, thanks.

Peter