Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp486562pxb; Mon, 8 Nov 2021 17:10:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUd9zr+4GJC3zIAJTS+uGL4l8tVj7Pdd5egbeEK9XrpRHKWwmnuZCoR+WnxkiovKKJTIj6 X-Received: by 2002:a17:906:9b8d:: with SMTP id dd13mr4441101ejc.531.1636420226629; Mon, 08 Nov 2021 17:10:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636420226; cv=none; d=google.com; s=arc-20160816; b=XavAleRXvZ13uOGm/KeIjue3Rfa6tWn4aSq0bzNETqiSj6LwK+Cm1+wmXY/9y7i1Nd JnKyfqyF1W65YmxG+W3lmIFeRXc33mifA3u7JGAQUCLIRQBlYriGDYzC+NUyaNmFoY+0 JDOLn9tXOp6IZYrxgQArfayELcWHSm6PI1Yr5MR+8l1kbuhWAwUMfqQSyvVy/kKsPGcF 8vl13FV9SavTGJJwkeA4+VsoH35sEyMrkjmxNNGMETG7FsWvM7oW09uonEQSUC4eNJw/ 5sEpZCfOdzfyQGHROiMrF9Tqt0xj7fwimiJUxXb0wf9X3sMZFhKAxtP1mKGhiyGFsE5f fC4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=PIhh11j64GJB5tkkAYeEUi1he5/a0olDT6t9pDlGgAg=; b=kVXX4UZrukowr6JCbjLBs7LWBiBvmeI89ppGNWhMFmUs1fSDAIbdessBYgTRn7fB6N B7vsXUG7HjEdZqeAb0fkRXXyiuHHb6fHdjimGV8+z5LthSttVkPS9U5eHjM7yWkgTNLu yvQEgir0Q8fUY4RAXEphvvgr3Wd/TT44o5lOF1ynBOvLUtp1FnuiF7D7RuwYFvHta5mX B71NvxIlfF9EfZLXSkkkObxi4w+XKwNAsi6lkIDM07CWHLhiRZFcI9C+mppLCYTo8cfj jtppiouAUIeccp6RZzJlNd2ZOuEyuXKG6t1rL4cJvmlH3eF3QNMGalimolYeyQCS5qiP vqpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SrewlxLX; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id js5si14489415ejc.656.2021.11.08.17.10.01; Mon, 08 Nov 2021 17:10:26 -0800 (PST) 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=@chromium.org header.s=google header.b=SrewlxLX; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240799AbhKIAaz (ORCPT + 99 others); Mon, 8 Nov 2021 19:30:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233602AbhKIAay (ORCPT ); Mon, 8 Nov 2021 19:30:54 -0500 Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49CDAC061570 for ; Mon, 8 Nov 2021 16:28:09 -0800 (PST) Received: by mail-qv1-xf33.google.com with SMTP id i13so13098607qvm.1 for ; Mon, 08 Nov 2021 16:28:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PIhh11j64GJB5tkkAYeEUi1he5/a0olDT6t9pDlGgAg=; b=SrewlxLXy5A5oOJK7Vp265kIB4JFYhK/xcDmhcxns65Y6VpUudY8geHbQmEX53jxSn QncDcE/y/hkJNipELIVJZjhy2bcTGXZ0s+akt5WukPtKDQwhVRdNp2eLF9ydsjxKCIng /xX0vFqSrLKtA+aRRZkz/EWCkRw/1TKr54qJg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PIhh11j64GJB5tkkAYeEUi1he5/a0olDT6t9pDlGgAg=; b=aPaH3A/NNqyLSS6BSF65VGCHdSyn6DWRBapzu6+x7Z+RCFygFrlIE1FJsUBLwahP8v 4nPVfz205DqTqLWjTRpCJ/hiAWWVndmf7SJNzzgo1Ep9+xlfwsTUvYRR5HVA8PYp/UUX sqoTOUFO5sIXsEDOh0LOxodvg3parQwx1klnCJ6sTOd3QMxvUkPFNOYACTH1crWIP5AE SVqKSb/RacZKLZbOxs/4lQYcaGH+aBuHpEp/YUIZ/GqRuaPxvYbT4+rm3Gl/4O2kPD67 AJBJYv/5vwxVR0rjcZoDsoeLACDpXY/8/Q4N74I57DR+I6wc8xVsi4EPasYde4B3lFVH U94w== X-Gm-Message-State: AOAM532q9lOfCZ9+yvF1MJ2RWhKxG8KjcyPMnYSQ1QIfZSbAcL1z5UiN p2u6tq72e0JHxibR8LnHBnVottuz+cpM4ioAKNYjJA== X-Received: by 2002:a05:6214:21ea:: with SMTP id p10mr2981168qvj.67.1636417688528; Mon, 08 Nov 2021 16:28:08 -0800 (PST) MIME-Version: 1.0 References: <20211026143352.78387-1-heikki.krogerus@linux.intel.com> <20211026143352.78387-3-heikki.krogerus@linux.intel.com> In-Reply-To: From: Prashant Malani Date: Mon, 8 Nov 2021 16:27:56 -0800 Message-ID: Subject: Re: [RFC PATCH 2/4] usb: typec: Character device for USB Power Delivery devices To: Heikki Krogerus Cc: 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Heikki, On Thu, Oct 28, 2021 at 12:36 AM Heikki Krogerus wrote: > > Hi, > > On Wed, Oct 27, 2021 at 06:03:08PM -0700, Prashant Malani wrote: > > Why is USBPDDEV_SUBMIT_MESSAGE different from USBPDDEV_SET_MESSAGE? > > Shouldn't "setting" a PDO or property automatically "submit" it (using TCPM > > or whatever interface is actually performing the PD messaging) if > > appropriate (e.g Source Caps?). Is there a situation where one would > > want to "set" a property but not "send" it? > > > > It seems to me that the two can be combined into 1 rather than having > > a separate command just for ports. > > USBPDDEV_SUBMIT_MESSAGE you use to send message directly to the partner. > > USBPDDEV_SET_MESSAGE is meant to be used to store the values to a > cached message that the port manager should use next time there is > communication, but it does not send the message to the partner. So you > can use it even when there is no connection with a port, for example, > to store the values like the initial USB mode that should be used by > setting the EUDO message. Maybe the ioctl should be named > USBPDDEV_STORE_MESSAGE... I used "set" because it is sort of a > counterpart to USBPDDEV_GET_MESSAGE. > > There is an explanation in include/uapi/linux/usb/pd_dev.h, please > check it. Thanks for the further clarification. I guess I still don't see enough need to differentiate SET/STORE from SUBMIT; is there a situation where one would want to store the source/sink caps for a port, but not send/submit them immediately? When a partner is not connected to a port, a set would automatically just update the cached values and not perform a "submit" (since there is nothing to submit to). Perhaps there are (situations which require separate store and submit), but I'm unable to come up with one on the spot. I'm curious also what you think about the idea with > USBPDDEV_CONFIGURE. It is indeed interesting. It seems like the specific interface for this needs to be fleshed out more (will we define a standard set of features which can be represented by the |flags| and made configurable?). At present I can't think of TCPM features which we'd want to toggle at runtime, but I'm looking at it from a Chrome OS perspective, so could be missing a bunch of use cases. BTW, does poll work with this character device? Best regards,