RE: [PATCH 1/2] usb: musb: kill global and static for multi instance

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

 



Hi,

> -----Original Message-----
> From: Balbi, Felipe
> Sent: Monday, July 02, 2012 12:49 PM
> To: Gupta, Ajay Kumar
> Cc: linux-usb@xxxxxxxxxxxxxxx; Balbi, Felipe
> Subject: Re: [PATCH 1/2] usb: musb: kill global and static for multi
> instance
> 
> On Mon, Jun 25, 2012 at 05:51:46PM +0530, Ajay Kumar Gupta wrote:
> > Moved global variable "orig_dma_mask" and static variables "first"
> > and "old_state" to 'struct musb' to help support multi instance of
> > musb controller as present on AM335x platform.
> >
> > Signed-off-by: Ajay Kumar Gupta <ajay.gupta@xxxxxx>
> > ---
> >  drivers/usb/musb/musb_core.c |   28 ++++++++++++----------------
> >  drivers/usb/musb/musb_core.h |    5 +++++
> >  2 files changed, 17 insertions(+), 16 deletions(-)
> >
> > diff --git a/drivers/usb/musb/musb_core.c
> > b/drivers/usb/musb/musb_core.c index db3dff8..e89b232 100644
> > --- a/drivers/usb/musb/musb_core.c
> > +++ b/drivers/usb/musb/musb_core.c
> > @@ -1785,10 +1785,9 @@ static const struct attribute_group
> > musb_attr_group = {  static void musb_irq_work(struct work_struct
> > *data)  {
> >  	struct musb *musb = container_of(data, struct musb, irq_work);
> > -	static int old_state;
> >
> > -	if (musb->xceiv->state != old_state) {
> > -		old_state = musb->xceiv->state;
> > +	if (musb->xceiv->state != musb->xceiv_old_state) {
> > +		musb->xceiv_old_state = musb->xceiv->state;
> >  		sysfs_notify(&musb->controller->kobj, NULL, "mode");
> >  	}
> >  }
> > @@ -1906,6 +1905,12 @@ musb_init_controller(struct device *dev, int
> nIrq, void __iomem *ctrl)
> >  	musb->min_power = plat->min_power;
> >  	musb->ops = plat->platform_ops;
> >
> > +	musb->first = 1;
> 
> this needs to go away and it should be very simple to do so. The problem
> which Hema was trying to fix is just a misplaced platform_set_drvdata()
> in relation to pm_runtime_enable().

Ok, I will drop this.
> 
> > +#ifndef CONFIG_MUSB_PIO_ONLY
> > +	musb->orig_dma_mask = dev->dma_mask; #endif
> 
> this I can't accept, you can just point to the parent device's dma_mask.
Each glue layer initialize it to "DMA_BIT_MASK(32)" and same is set for
Parent device in usb-musb.c so I think it should be safe to point to
Parent device's dma_mask during musb_remove.

Additionally I have to remove "musb_debugfs_root" from musb_debugfs.c to
musb structure.

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


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

  Powered by Linux