Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3211116pxb; Fri, 4 Feb 2022 03:58:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwczGMd4irhqNVNDR5VaEJEc/G+2hbcgrmWpKa+kmcr7UDuDJ4YII4ihnQ/OkXqG1Os/HM5 X-Received: by 2002:a17:907:3e9c:: with SMTP id hs28mr2150234ejc.735.1643975911326; Fri, 04 Feb 2022 03:58:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643975911; cv=none; d=google.com; s=arc-20160816; b=eRYd2JYe1nvtVQq+oAjoWENlm1J2XT7Zzp4pXRd9VxtZn/dLwwnNz7AAIlxZTY+BV1 ydIWaw9M8ZY9jcaiRe/+1DEgGopOCS5E+1owEOQfX4Uwbh1ETBBEEOv+KlEBRsE3oPfy 3S1naxhrZ3oFR6MzMsqrvdSg3pZd0YGb41g7I6ofA+mZC6Z9LRC4bRWhUfbtn5pKbWvO w4loq+60a/0QNf14zNvn9+HfqE2sj8gzLjQUpO9alRPjs2f01fvNd4Qg1JwxP+dX6y+g ltt0CpPALFEmIDg//4wlo54Hp9h5fduFl7ZJQ/WVOpr8NbySBuvRobJu2Md1HeGr+n4X dusw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Y99QgO005FqFGlERysNgLWk7UrMWWVrz+xI+ajjJkxg=; b=xPxcNSwu756czn02e4Pl3OO999QveB5fE4zV6xVkQx+ql0/oPA2tOKZm3dZojVH5ff JkqUuXGjZqVRAMnSI4Z0Thtc6Ipmb8HpK/hWZXFeLzIPzef7JW48sl8Ewoj96GOm0R9b HSz/JMBxd06VWCUH6uAUdpXAmBfRrws76INTWV4m+pOcsEccZekO+dKZXeJk+NymaoWI APBpEAPHqZCKpw6Jrl8SeENBYSCN/y07XyuC3v29NV5MD6L5LW9VWDWBzQugHwxnUtW2 OqyArefJZJedOzmyeIF08xt01KXzarnCqa9/zD/yiaSU6ZDbAf40sjwmDvQABGQek5Mz Mtlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QclL9Ljz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i3si1125946ejw.731.2022.02.04.03.58.05; Fri, 04 Feb 2022 03:58:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QclL9Ljz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358145AbiBDKEs (ORCPT + 99 others); Fri, 4 Feb 2022 05:04:48 -0500 Received: from mga01.intel.com ([192.55.52.88]:18260 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358127AbiBDKEp (ORCPT ); Fri, 4 Feb 2022 05:04:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643969085; x=1675505085; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=3mxheKqTYV1TJi2fulCX3aSIhQo5eTdbQ5+4Zi+6mZw=; b=QclL9LjzFnl7dAKfpSpu/oPt0W32TdjnBaMqgORC7spry2aicDOE6tb6 kF1mjXSZWYoepX7loolyVrI4w5l+z17mK4N6Hf8aBTKFvkuKhFuhCrsiM 0iAXpq9Ogd84jISDyOip493CsierI8k1w4GALElQjsbxDw1UMsP4IGN7r uxl8+XEuEP4enEv6A0TnaHzdIy4Y798oRlRD2sgNqPZ6QnsPmQf2u5nld bdv83vY19h9L9D2TyaKhlUbX69F37gyL2msnF1uzg2vi3ruXn8qozlCRZ 1iWD4I22345y+Y/uRc8XxMmO5Lm1CLkbtPmP/GRV4EjCY7pPSTKbp/of2 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10247"; a="272843676" X-IronPort-AV: E=Sophos;i="5.88,342,1635231600"; d="scan'208";a="272843676" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2022 02:04:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,342,1635231600"; d="scan'208";a="677061944" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 04 Feb 2022 02:04:42 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Fri, 04 Feb 2022 12:04:41 +0200 Date: Fri, 4 Feb 2022 12:04:41 +0200 From: Heikki Krogerus To: Greg Kroah-Hartman Cc: Guenter Roeck , Benson Leung , Prashant Malani , Jameson Thies , "Regupathy, Rajaram" , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/3] usb: typec: Separate USB Power Delivery from USB Type-C Message-ID: References: <20220203144657.16527-1-heikki.krogerus@linux.intel.com> <20220203144657.16527-2-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, On Thu, Feb 03, 2022 at 03:55:19PM +0100, Greg Kroah-Hartman wrote: > On Thu, Feb 03, 2022 at 05:46:55PM +0300, Heikki Krogerus wrote: > > +/* These additional details are only available with vSafe5V supplies */ > > +static struct kobj_attribute dual_role_power_attr = __ATTR_RO(dual_role_power); > > +static struct kobj_attribute usb_suspend_supported_attr = __ATTR_RO(usb_suspend_supported); > > +static struct kobj_attribute unconstrained_power_attr = __ATTR_RO(unconstrained_power); > > +static struct kobj_attribute usb_communication_capable_attr = __ATTR_RO(usb_communication_capable); > > +static struct kobj_attribute dual_role_data_attr = __ATTR_RO(dual_role_data); > > +static struct kobj_attribute > > +unchunked_extended_messages_supported_attr = __ATTR_RO(unchunked_extended_messages_supported); > > Note, no 'struct device' should ever have a "raw" kobject hanging off of > it. If so, something went wrong. > > If you do this, userspace will never be notified of the attributes and > any userspace representation of the tree will be messed up. > > Please, use an attribute directory with a name, or if you really need to > go another level deep, use a real 'struct device'. As-is here, I can't > take it. OK, got it. I don't think we can avoid the deeper levels, not without making this really cryptic, and not really usable in all cases. These objects are trying to represent (parts) of the protocol - the messages, the objects in those messages, and later the responses to those messages. But I'm also trying to avoid having to claim that these objects are "devices", because honestly, claiming that the packages used in communication are devices is confusing, and just wrong. If we take that road, then we really should redefine what struct device is supposed to represent, and rename it also. So would it be OK that, instead of registering these objects as devices, we just introduce a kset where we can group them (/sys/kernel/usb_power_delivery)? thanks, -- heikki