Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1284113pxb; Thu, 28 Oct 2021 00:24:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQFJM4MVdwdAvO9PiNUsWcLsQzEeDpmc24FmNZ1F4I7pDkCpQXYHYxHdCHz8gsbk1OOwWt X-Received: by 2002:a17:907:3e14:: with SMTP id hp20mr3317613ejc.507.1635405856207; Thu, 28 Oct 2021 00:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635405856; cv=none; d=google.com; s=arc-20160816; b=oSffIFaQpIYzYYQ453++OJubTR5A53nZ/JPfo26/+duLF8xOPxWvnUG9r0hbPENY/h yvrP3LfXun9Djt5g4BAaSLrlNFEJM2di4BY0KVT8ot/YGRNm6qJ5zpiw60sbpz3DyoTS gf6cbwXT9KLEmh2vuGrgkGO4fUOhtDOIAgm4UC4OqTOTpSSK1X6Ct+AwZ8fC/5XnSuFt rWMT1S6msceTuYJ1eYfeWMGd+mti61hmxEcTvRJsn4GM35qIiMHVu8ZxB8Rb8FB0HcmM RUQcLXZOUnPbxtP8FHoyy/xkK6XxrDusEsaCCXv0BYyl0dGCLUPMtyogZTGRR5U1n2sC kj5A== 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; bh=eis57qnP2h7jb7QHx0LSQ5kQcVoS2QqQZjaWz9ysyYw=; b=StcpLRt1hylTtn0yCtHBdP7qWUqGuGpAN99UQfK9nH7Ue949oLSj1NeOpl20J6US29 6df219HO6zsDcnTeQWvdMBzGXMkY+WwE60qhG1n2Li7XP/oNG6UFaSAEvET8W5h6Pq0D 5JQpMCaz3NJ37vN4rrM98QsKDXxVIbzjHlI+ESlumMDB+ng+BEQtuYSN4TZnHSz8OZ2E JB7KSB1lIHoxkvjal5xA3vJ24HlN3bP+zaGhSQeHj6gysbfujA1aUrJ5HtJ0zjtCqICp PiS/swdLl1pk401Es0lJUaaPkJD8iKrj7D/SLsvWLN5/shl6QRhpGSpyKhaahfiPE8uM Ea2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i16si3560119ejw.584.2021.10.28.00.23.52; Thu, 28 Oct 2021 00:24:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229925AbhJ1HT6 (ORCPT + 99 others); Thu, 28 Oct 2021 03:19:58 -0400 Received: from mga01.intel.com ([192.55.52.88]:50581 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229768AbhJ1HT5 (ORCPT ); Thu, 28 Oct 2021 03:19:57 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10150"; a="253900828" X-IronPort-AV: E=Sophos;i="5.87,189,1631602800"; d="scan'208";a="253900828" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2021 00:17:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,189,1631602800"; d="scan'208";a="636111472" Received: from kuha.fi.intel.com ([10.237.72.166]) by fmsmga001.fm.intel.com with SMTP; 28 Oct 2021 00:17:12 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Thu, 28 Oct 2021 10:17:11 +0300 Date: Thu, 28 Oct 2021 10:17:11 +0300 From: Heikki Krogerus To: Greg KH Cc: Prashant Malani , Benson Leung , Adam Thomson , Guenter Roeck , Badhri Jagan Sridharan , Jack Pham , "Gopal, Saranya" , "Regupathy, Rajaram" , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/4] USB Power Delivery character device interface Message-ID: References: <20211026143352.78387-1-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 On Wed, Oct 27, 2021 at 02:53:57PM +0200, Greg KH wrote: > On Wed, Oct 27, 2021 at 02:02:42PM +0300, Heikki Krogerus wrote: > > Hi Greg, > > > > On Tue, Oct 26, 2021 at 05:06:28PM +0200, Greg KH wrote: > > > So, why not sysfs? :) > > > > This is about allowing the user space to take over the USB Power > > Delivery communication and policy decisions in some cases. The user > > space needs to be able to send and receive raw USB Power Delivery > > messages one way or the other. I don't care about what's the interface > > that we use. > > > > Here we are talking about the PDOs, so basically the power contract. > > Even if we figured out a way how to expose all the information from > > the Capability, Status, Alert and what ever messages you need to the > > user space via sysfs, and then allow the user to separately send the > > Request Message, we would have only covered the power contract. That > > does not cover everything, but it would also be unnecessarily > > complicated to handle with separate sysfs files IMO. > > > > Even with the power contract it would make more sense to me to just > > allow the user space to simply read and write the raw messages, but > > when we go the other things like Vendor Specific Messages, I don't > > think there is any other way. > > > > So we really do need to be able to tap into the USB Power Delivery > > protocol layer directly from user space. I don't care about how we do > > that - character device is just a suggestion, although, it does still > > feel correct to me. Is there some other way we could do this? > > Ok, a char device sounds fine, but _what_ userspace code is going to be > using this interface? We need to have a working version of that as well > before we could take this new interface, otherwise it wouldn't make much > sense. > > And why does userspace have to do this, what is wrong with the kernel > doing it as it does today? I.e. what is broken that adding a new api to > the kernel is going to fix? > > That needs to be documented really really well. Sure. thanks, -- heikki