|
|
|
|
|
|
|
|
|
|
xen-devel
RE: [Xen-devel] bug in usbback
> James Harper wrote:
> > Also, a question on behaviour:
> >
> > When we receive a reconfigure event, I assume that we should then
read
> > 'num-ports' and scan through each of the port-n values in xenstore.
Is
> > there any guarantee that a device hasn't been unplugged and
replugged
> > from the same port during the reconfiguration window? How should I
> > detect such a thing if the value of port-n hasn't changed? Should I
then
> > probe each device? I'm doing this under Windows which is a bit more
> > picky and much less flexible...
>
> "num-ports" is only read in creating the hcd. This value is unchanged
> during reconfiguring state.
>
> Reconfiguring is called from usb probe and disconnect callbacks.
> So, reconfiguring is called every time unplugging and plugging are
> detected.
>
> However, connecting and disconnecting the devices at the same time
> or frequent operations were not tested enough.
>
> Do you think it's good idea that the method for the notification
> of hotplug is switched from xenbus to RING (like pv network's
rx_ring)?
>
I like the idea of having the port states in the xenstore. It is a low
speed and (mostly) relatively infrequently changing thing so I think
keeping it in xenstore is appropriate.
I think the problem could be solved by simply including a port change
counter for each port, either as part of the existing port-N value or as
an additional 'port-N-generation' field. The backend would just
increment that every time there is a plug or unplug event, and the
frontend could compare the value to what it was last time to see if the
port had changed.
So maybe "port-N=S" would become "port-N=GGS", where S is the current
'speed' value, and "GG" is a change counter. As an example:
1. port-1=000
2. <hot plug>
3. port-1=013
4. <hot unplug>
5. port-1=020
6. <hot plug>
7. port-1=033
It would unfortunately break backwards compatibility, but it's still in
the staging area, for exactly this reason right?
Thanks
James
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|