Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp555389imu; Mon, 5 Nov 2018 05:22:06 -0800 (PST) X-Google-Smtp-Source: AJdET5csyj9DDbd9qvxroSF43LGiP2Pix4E1QTEubf9e+2FCMfvA/MsJpqFP5AYzkcxPzB06XV4N X-Received: by 2002:a17:902:8504:: with SMTP id bj4-v6mr18098160plb.99.1541424126614; Mon, 05 Nov 2018 05:22:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541424126; cv=none; d=google.com; s=arc-20160816; b=IP5cTfz+Uy7gW8iRo08JaXjUHGu4AHHHa1K0gU7AGsxUuq+Kugj1BnSzhLqKFW9Ey0 nZ3t3l6FshoPtx+Es8gv7cWJ21afoGjXg01LMJ2LB6YbagNP7uMQWQ74nH47+0x2mh+O is7FiEuUnZ6h8xXlx/oyl3W2q1jf1+9gYaXnUmYXOmsALszI9T4Sxun1KDHXHzUV2gRJ V0wmA3xJcOMi716qlldrE2SoBnu7qOPbZtrtf4R6jFlKVkSPW32jA6DqZVZqlpCXJicd ke1L/A1op0cZw58zMJ432MaExOf1l3AajwnUltEG8PJQyy5+3BNstNuD3t02yaimhmoT q9Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=FKmxvG8PKqBQZFPDIj3TZFyh3driP7AaN+B9YoCetgQ=; b=Ad6q322Okyaq9ahOb1keXxF75Dk9V4rboEkFHCyQQbYhgnPXlU6qrp9PXkxbmq1QvZ ceRd7/Oc9Np7Vne/bY6QZMWy7TV3kb+S8f/WRZHI+rbhJLPJPOYcQ8/qgvPe/xGtDOmg Q1oWyOOcHu4rigWAm7aGX3GqzRU7xyQ5crP2btxjui1gPP4TzskZ4jhcbFe1eHVrxRKS u/gbmo1dtnipWtS1cAEp4ZlRn7MBMdVZSv+MyQFiEskwGA1oVh9SBCIukTxSwjHa2foZ f00DnqnpMOGxM8Ip1IOl1LLwtv7UCgLdU9JzTmHrvLqGqbagarmXmZQzd/C3wbKafD13 hKeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wLqtWgRM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w18-v6si44876481pfg.70.2018.11.05.05.21.50; Mon, 05 Nov 2018 05:22:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wLqtWgRM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729733AbeKEWlO (ORCPT + 99 others); Mon, 5 Nov 2018 17:41:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:50406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729498AbeKEWlN (ORCPT ); Mon, 5 Nov 2018 17:41:13 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 435B72081D; Mon, 5 Nov 2018 13:21:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541424089; bh=EIrcgQsplAskFxhkpWPm/HY2blagq4cwC21Pe7Vdp44=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wLqtWgRMVKqCNAhA9g1jNbxpujJ+4uv3gH4HvAEASgf4LiXnnuXF43u90FRpqCToB IgzudrIlCsm6g45w06UW707NbwiHUd5g1bJaSDfUT8R/IR9h/tvQ6IJAWdlPfsbcp/ PluZdEKj3dhrGTxovzt9xx0QGj6qO3/TfgNkA7jI= Date: Mon, 5 Nov 2018 14:21:06 +0100 From: Greg KH To: Jonas Bonn Cc: linux-kernel@vger.kernel.org, rafael@kernel.org Subject: Re: KOBJ_BIND uevent Message-ID: <20181105132106.GB20797@kroah.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 05, 2018 at 11:35:57AM +0100, Jonas Bonn wrote: > Hi, > > I have a question about the ordering of uevents, specifically concerning > complex USB devices that present multiple interfaces/functions. > > Before KOBJ_BIND, a USB device would typically present itself as: > > add usb_device > add usb_interface-1 > add subsystem-device-1.0 > add subsystem-device-1.1 > add usb_interface-2 > add subsystem-device-2.0 > > I have noted that the recently added "bind" actions, however, present in the > reverse order. > > bind subsystem-device-1.0 > bind subsystem-device-1.1 > bind usb-interface-1 > bind subsystem-device-2.0 > bind usb_interface-2 > bind usb_device > > This secondary ordering could be useful in the sense that the final "bind" > action on the usb_device is an indication that the kernel has finished > enumeration of all endpoints and has bound all drivers that it could to the > available interfaces... i.e. no further events for this device are expected. Maybe. Maybe not, as userspace might still be in the process of loading new kernel drivers based on the add uevents that got sent out. Then binding would happen later after the usb_device was "bound". > The question, then, is: is the above ordering of "bind" events stable, or > is it just a consequence of the current implementation and may change in the > future? Not stable at all, sorry, you can not depend on it. Nor should you even try to, what problem are you wanting to solve here? thanks, greg k-h