RE: [PATCH] EHCI: maintain the ehci->command value properly

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

 



On Tue, 17 Apr 2012, Paul Zimmerman wrote:

> Hi Alan,
> 
> > The ehci-hcd driver is a little haphazard about keeping track of the
> > state of the USBCMD register.  The ehci->command field is supposed to
> > hold the register's value (apart from a few special bits) at all
> > times, but it isn't maintained properly.
> > 
> > This patch (as1543) cleans up the situation.  It keeps ehci->command
> > up-to-date, and uses that value rather than reading the register from
> > the hardware whenever possible.

> > @@ -347,6 +352,7 @@ static int ehci_reset (struct ehci_hcd *
> >  	if (ehci->debug)
> >  		dbgp_external_startup();
> > 
> > +	ehci->command = ehci_readl(ehci, &ehci->regs->command);
> 
> Wouldn't it be a good idea to mask off bits that cannot be cleared
> by software (like CMD_IAAD) whenever ehci->command is read from the
> register? Otherwise, if a bit has been set but not cleared by the
> hardware yet, that bit would get set again the next time you use
> the contents of ehci->command.

Maybe, but it doesn't seem very necessary.  After all, the controller
has just completed a software reset, so none of those exotic bits
should be turned on.

Alan Stern

--
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