This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


RE: [Xen-devel] bug in usbback

To: "Noboru Iwamatsu" <n_iwamatsu@xxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] bug in usbback
From: "James Harper" <james.harper@xxxxxxxxxxxxxxxx>
Date: Mon, 27 Jul 2009 19:16:29 +1000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 27 Jul 2009 02:16:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4A6D376D.6000808@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <AEC6C66638C05B468B556EA548C1A77D016DDE59@trantor> <C690992F.106D3%keir.fraser@xxxxxxxxxxxxx> <AEC6C66638C05B468B556EA548C1A77D016DDE5B@trantor> <4A6D376D.6000808@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcoOeQ6KKgtvARWZTQKUszYVDr6Z8gAH+YcQ
Thread-topic: [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
> > 'num-ports' and scan through each of the port-n values in xenstore.
> > there any guarantee that a device hasn't been unplugged and
> > 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
> > 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

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?



Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>