RE: [PATCH v2 4/4] usb: refine phy notify operation during connection and disconnection

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

 



 
> 
> Simply reading this patch shows that it contains at least two errors.
Thanks for review.

> 
> > @@ -4187,6 +4190,10 @@ static void hub_port_connect_change(struct
> usb_hub *hub, int port1,
> >  		}
> >  	}
> >
> > +	if (hcd->phy && !hdev->parent &&
> > +		!(portstatus & USB_PORT_STAT_CONNECTION))
> > +			usb_phy_notify_disconnect(hcd->phy, udev->speed);
> 
> What happens if udev is NULL (see the test in the next statement)?
> 

I will add the condition of (udev), the thing I want to do is: 
when the device is disconnected, the pcd interrupt will occur, and
the code will be there, I need to tell the phy driver, the disconnection
occurs, and the speed of the disconnected usb device.

> > +
> >  	/* Disconnect any existing devices under this port */
> >  	if (udev)
> >  		usb_disconnect(&hub->ports[port1 - 1]->child);
> > @@ -4212,13 +4219,6 @@ static void hub_port_connect_change(struct
> usb_hub *hub, int port1,
> >  		}
> >  	}
> >
> > -	if (hcd->phy && !hdev->parent) {
> > -		if (portstatus & USB_PORT_STAT_CONNECTION)
> > -			usb_phy_notify_connect(hcd->phy, port1);
> > -		else
> > -			usb_phy_notify_disconnect(hcd->phy, port1);
> 
> Is the second argument supposed to be a port number, like here, or a
> speed value, like above?  Clearly something is wrong, either in the old
> code or in the new code.
> 
The first patch at this patchset changes the API of usb_phy_notify_disconnect:

-       /* notify phy connect status change */
-       int     (*notify_connect)(struct usb_phy *x, int port);
-       int     (*notify_disconnect)(struct usb_phy *x, int port);
+       /*
+        * Notify phy that
+        * - The controller's connect status change.
+        * - The controller's suspend/resume occurs, and the device
+        * is on the port.
+        */
+       int     (*notify_connect)(struct usb_phy *x,
+                       enum usb_device_speed speed);
+       int     (*notify_disconnect)(struct usb_phy *x,
+                       enum usb_device_speed speed);

> 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