RE: [PATCH 1/3] usb: cdns3: ep0: fix the test mode set incorrectly

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

 



 
> >diff --git a/drivers/usb/cdns3/ep0.c b/drivers/usb/cdns3/ep0.c index
> >2465a84e8fee..74a1ff5000ba 100644
> >--- a/drivers/usb/cdns3/ep0.c
> >+++ b/drivers/usb/cdns3/ep0.c
> >@@ -327,7 +327,8 @@ static int cdns3_ep0_feature_handle_device(struct
> cdns3_device *priv_dev,
> > 		if (!set || (tmode & 0xff) != 0)
> > 			return -EINVAL;
> >
> >-		switch (tmode >> 8) {
> >+		tmode >>= 8;
> >+		switch (tmode) {
> 
> For me it's looks the same, but it's ok.
> 

Pawel, please check the coming code, it uses tmode to set the register which
is incorrect before shift. (line 336)

328                 tmode >>= 8;
329                 switch (tmode) {
330                 case TEST_J:
331                 case TEST_K:
332                 case TEST_SE0_NAK:
333                 case TEST_PACKET:
334                         cdns3_set_register_bit(&priv_dev->regs->usb_cmd,
335                                                USB_CMD_STMODE |
336                                                USB_STS_TMODE_SEL(tmode - 1));
337                         break;

Peter





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux