Re: [PATCH v3] davinci: fix resources passed to MUSB driver for DM6467

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 24, 2013 at 12:50:12AM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 09/24/2013 12:42 AM, Felipe Balbi wrote:
> 
> >>After commit 09fc7d22b024692b2fe8a943b246de1af307132b (usb: musb: fix incorrect
> >>usage of  resource pointer), CPPI DMA driver on DaVinci DM6467 can't detect its
> >>dedicated IRQ and so the MUSB IRQ  is erroneously used instead. This is because
> >>only 2 resources are passed to the MUSB driver from the DaVinci glue layer,  so
> >>fix  this by always copying 3 resources (it's  safe since a placeholder for the
> >>3rd resource is always  there) and passing 'pdev->num_resources' instead of the
> >>size of musb_resources[] to platform_device_add_resources().
> 
> >>Signed-off-by: Sergei Shtylyov <sergei.shtylyov@xxxxxxxxxxxxxxxxxx>
> >>Cc: stable@xxxxxxxxxxxxxxx # 3.11+
> 
> >>---
> >>The patch is against the 'fixes' branch of Felipe Balbi's 'usb.git' repo.
> 
> >>Changes in version 3:
> >>- fixed the size of musb_resources[] in davinci_probe().
> 
> >>Changes in version 2:
> >>- resolved reject.
> 
> >>  drivers/usb/musb/davinci.c |   13 +++++++++++--
> >>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> >>Index: usb/drivers/usb/musb/davinci.c
> >>===================================================================
> >>--- usb.orig/drivers/usb/musb/davinci.c
> >>+++ usb/drivers/usb/musb/davinci.c
> >>@@ -509,7 +509,7 @@ static u64 davinci_dmamask = DMA_BIT_MAS
> >>
> >>  static int davinci_probe(struct platform_device *pdev)
> >>  {
> >>-	struct resource musb_resources[2];
> >>+	struct resource			musb_resources[3];
> 
> >why don't you kcalloc this array based on pdev->num_resources ?
> 
>    I just followed your approach. And I don't see why abusing the
> heap is any better (the resources will be kmemdup()ed anyway upon
> adding them to device) when I know there's no more than 3
> resources...

well, fair enough... at least on OMAP-based devices we could have 2 or 3
resources, so it makes more sense there, I guess.

cheers

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux