[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160520105801.GB12663@kuha.fi.intel.com>
Date: Fri, 20 May 2016 13:58:01 +0300
From: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To: Greg KH <gregkh@...uxfoundation.org>,
Oliver Neukum <oneukum@...e.com>
Cc: Guenter Roeck <linux@...ck-us.net>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Rajaram R <rajaram.officemail@...il.com>,
Felipe Balbi <felipe.balbi@...ux.intel.com>,
Mathias Nyman <mathias.nyman@...ux.intel.com>,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [RFC PATCHv2] usb: USB Type-C Connector Class
On Thu, May 19, 2016 at 08:43:27AM -0700, Greg KH wrote:
> On Thu, May 19, 2016 at 04:48:46PM +0200, Oliver Neukum wrote:
> > On Thu, 2016-05-19 at 15:44 +0300, Heikki Krogerus wrote:
> > > + ret = typec_register_altmodes(dev, partner->alt_modes);
> > > + if (ret) {
> > > + device_unregister(dev);
> > > + return ret;
> > > + }
> > > +
> > > + /* REVISIT: Creating symlink for the port device for now. */
> > > + ret = sysfs_create_link(&port->dev.kobj, &dev->kobj, "partner");
> > > + if (ret)
> > > + dev_WARN(&port->dev, "failed to create link to %s (%d)\n",
> > > + dev_name(dev), ret);
> >
> > The attributes should be present as soon as the device is announced.
>
> Yes, this is wrong and racy (hint, if you have to drop down to a sysfs
> call within a driver, almost always something is wrong...)
I'll remove those links.
I'm hoping to get comments about the attributes in general. Do we
have everything needed to describe the state and capabilities of USB
Type-C ports with them, and are they in reasonable places. I'm playing
with these links in couple of places in the code, and I've put
questions in the comments on some of them. I'm really not planning on
leaving them as they are.
So if you guys could provide your opinions on those questions, I would
much appreciate.
Thanks a lot,
--
heikki
Powered by blists - more mailing lists