From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422692AbcKPLNd (ORCPT ); Wed, 16 Nov 2016 06:13:33 -0500 Received: from mga07.intel.com ([134.134.136.100]:48381 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750979AbcKPLNa (ORCPT ); Wed, 16 Nov 2016 06:13:30 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,647,1473145200"; d="scan'208";a="4967245" Date: Wed, 16 Nov 2016 13:09:10 +0200 From: Heikki Krogerus To: Greg KH , Badhri Jagan Sridharan , Guenter Roeck , Oliver Neukum Cc: Felipe Balbi , Bin Gao , LKML , USB Subject: Re: [PATHCv10 1/2] usb: USB Type-C connector class Message-ID: <20161116110910.GB30235@kuha.fi.intel.com> References: <20160919111657.22127-1-heikki.krogerus@linux.intel.com> <20160919111657.22127-2-heikki.krogerus@linux.intel.com> <20161114095148.GA10306@kroah.com> <20161114123235.GD22706@kuha.fi.intel.com> <20161114204650.GB17677@roeck-us.net> <20161115070754.GA26240@kroah.com> <74c10d95-47b6-cc5d-eda0-056439db4ec7@roeck-us.net> <20161116093035.GA30235@kuha.fi.intel.com> <20161116094949.GB3067@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161116094949.GB3067@kroah.com> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 16, 2016 at 10:49:49AM +0100, Greg KH wrote: > On Wed, Nov 16, 2016 at 11:30:35AM +0200, Heikki Krogerus wrote: > > On Tue, Nov 15, 2016 at 04:19:10PM -0800, Badhri Jagan Sridharan wrote: > > > Hi, > > > > > > At present I am using the uevent in the userspace to infer > > > the Presence of a port on the remote end through the > > > appearance of usbc*-partner. > > > > > > Userspace uses this info to decide on when to show a USB > > > notification on the screen and what should be the options > > > provided in the dialog. > > > > > > I was assuming that this is not something that would be dropped. > > > > > > Coding using events was relatively easier to program from userspace .. > > > > > > Is it possible to use POLL for identifying the appearance of port partner ? > > > I did not notice sysfs_notify call in typec_connect/typec_disconnect. > > > > > > It would also be nice to have uevent notifications when the contents > > > of current_data_role or current_power_role changes. > > > > > > Is that too costly to have ? > > > > Greg, could you give your opinion. In this case we do have attribute > > files that the user space can poll. Data role is the USB data role, so > > host or device, and it can change for example if the partner executes > > a swap. The same can happen with the power role. > > So the same 'struct device' switches roles and attribute files are > updated that need to be re-read? If so, yes KOBJ_CHANGE is correct, if > a struct device is added/removed for this, then no, it doesn't make > sense. OK, I'll add KOBJ_CHANGE for those. So is it OK to everybody if I remove the KOBJ_CHANGE in typec_connect()? We will see uevent KOBJ_ADD since the partner (or cable) is added in any case. Badhri, Oliver? Thanks, -- heikki