Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp883001pxb; Wed, 27 Oct 2021 14:24:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLfJ4FiydqmTWTgv0syD+SoWslttvhibsz0KrZodeZHp11DtGXRsPR9cpa16pWzIMnX5GA X-Received: by 2002:a17:90b:180e:: with SMTP id lw14mr8488415pjb.138.1635369896371; Wed, 27 Oct 2021 14:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635369896; cv=none; d=google.com; s=arc-20160816; b=FgCxcYwjB/bFIYy0OMuiTdPjmk0BfhtwCZ1DT7oo/EAl8dve0uN5VPIBZxOUUd818F xdWG6HkGz8o5ZWMVPF+Z+1FcBH5B9a+pusuOUekpKYvFp7abyCBZjP6SZgJKN1/Ay+oc quXdsfBE+Qugsqma54HYwD3WRNjkJBvIO0h1qGWUOsfXqo6Hd8KakC4XyCdHSZuLTJcu kGtYgQ3ZayJbgbP7qjiFgSiMzQHg5szHksLX89tXLTyviRWfFQiyCcFJnojV4tX2fRx7 2luvtyynuYoSmuX1WQUFJ73rAx4hNP/UFT2pbB0gi3E0gk2BNbGpgst8ORVAVv9FQmN7 n6bQ== 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=CgFp2NcTGIDWY7vad9dhXVpDAS5nrFW7iWo2zEFReXA=; b=VAp3yT8igipjAy0m7CJ47bohd15AV98MNWL5X6TcnHnCxldNGJNZ471UKYqejBI5Gg V+T9PZGJhAt1EweOe/Nf6vPmB7UU7COi9hnWrBePNo4KqzFf4D6pCf67e5RmmqB5CqUy Qk2WcWwp6AMOZYoVaNeM/k99llu/6dpDY/s8Se/H4FF7hjytZdug7WJtI/WGuTHoJI0i Sh9RksGvUFtaRu2FmCHxGMa7VZ+iBAVyQkESMTrgDQmtSGKfyEr1l7bN8d+HlLKf5CRK 852ycDNDwqvAMguuseGtjhXEgsgogOh8VFzEzRYbOiyE+cr/IB7hbLEhd5G5904n4OlE Lvpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yBnpX7YI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pc8si1449123pjb.18.2021.10.27.14.24.44; Wed, 27 Oct 2021 14:24:56 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yBnpX7YI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241976AbhJ0M4Z (ORCPT + 97 others); Wed, 27 Oct 2021 08:56:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:47442 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231407AbhJ0M4Y (ORCPT ); Wed, 27 Oct 2021 08:56:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D53CF60F56; Wed, 27 Oct 2021 12:53:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635339239; bh=kT5wF0QcJsM63TXyH9HZCOLNY7CrfeWre62eaoLrvCE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=yBnpX7YIUEC7D5Eejk7AP89qTeypRr5RSpeKODTACONPYeMGc0IyRUG9VDA4C2kyZ brMaHSu2QWRyt2boeSSFwTZtU39nLkMW2CYDPA8APLpDwXxYwKFW3fzVQeOlMK6/pr BFR7IZtdqzGktmflqhZMK3OeQh0hm1y67qsVwCYs= Date: Wed, 27 Oct 2021 14:53:57 +0200 From: Greg KH To: Heikki Krogerus 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: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. thanks, greg k-h