linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Steven Syu <stevensyu7@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] usb: typec: clear usb_pd flag if change to typec only mode
Date: Thu, 9 Dec 2021 12:11:18 +0200	[thread overview]
Message-ID: <YbHWRgrddFh8IM40@kuha.fi.intel.com> (raw)
In-Reply-To: <1638947905-2502-1-git-send-email-steven_syu7@gmail.com>

Hi,

On Wed, Dec 08, 2021 at 03:18:25PM +0800, Steven Syu wrote:
> From: Steven Syu <stevensyu7@gmail.com>
> 
> Set usb_pd to 0 when power operation mode
> leaving power delivery. That can avoid user-sepace
> read "yes" form the supports_usb_power_delivery_show() attribute
> but power operation mode already change form power delivery to
> others mode.

I think you need to add a short explanation about the situation where
this can happen - where we loose the USB PD contract.

> Signed-off-by: Steven Syu <stevensyu7@gmail.com>
> ---
> changes for v3:
> resubmit and add the changes comment of v1->v2
> 
> v1->v2:
> 1.remove sysfs_notify(&partner_dev->kobj, NULL, "supports_usb_power_delivery"); when operation mode is not PD.
> 2.resubmitted patch by private email for remove footbar in the mail.
> 
>  drivers/usb/typec/class.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
> index aeef453..2043e07 100644
> --- a/drivers/usb/typec/class.c
> +++ b/drivers/usb/typec/class.c
> @@ -1718,6 +1718,8 @@ void typec_set_pwr_opmode(struct typec_port *port,
>  			partner->usb_pd = 1;
>  			sysfs_notify(&partner_dev->kobj, NULL,
>  				     "supports_usb_power_delivery");
> +		} else if (opmode != TYPEC_PWR_MODE_PD && partner->usb_pd) {
> +			partner->usb_pd = 0;
>  		}
>  		put_device(partner_dev);
>  	}
> -- 
> 2.7.4

thanks,

-- 
heikki

      reply	other threads:[~2021-12-09 10:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08  7:18 [PATCH v3] usb: typec: clear usb_pd flag if change to typec only mode Steven Syu
2021-12-09 10:11 ` Heikki Krogerus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YbHWRgrddFh8IM40@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stevensyu7@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).