All of lore.kernel.org
 help / color / mirror / Atom feed
From: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
To: Christian Ehrhardt <lk@c--e.de>
Cc: heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org,
	 neil.armstrong@linaro.org, quic_prashk@quicinc.com,
	dmitry.baryshkov@linaro.org,  fabrice.gasnier@foss.st.com,
	saranya.gopal@intel.com, linux-usb@vger.kernel.org,
	 diogo.ivo@tecnico.ulisboa.pt
Subject: Re: [RFC PATCH] usb: typec: ucsi: ack connector change after all tasks finish
Date: Thu, 28 Mar 2024 16:04:43 +0000	[thread overview]
Message-ID: <nbvsbechvtakxdtsmabtcb4zf2sojmcucv3lhyxe32dgg3z5cy@ljru526jospx> (raw)
In-Reply-To: <ZgRMhB96pVgxnMq4@cae.in-ulm.de>

On Wed, Mar 27, 2024 at 05:42:44PM +0100, Christian Ehrhardt wrote:
> 
> Hi,
> 
> On Wed, Mar 27, 2024 at 12:39:04PM +0000, Diogo Ivo wrote:
> > 				...
> > +static void ucsi_handle_ack_connector_change(struct ucsi_connector *con)
> > +{
> > +	struct ucsi *ucsi = con->ucsi;
> > +	int ret;
> > +
> > +	if (list_empty(&con->partner_tasks)) {
> > +		mutex_lock(&ucsi->ppm_lock);
> > +		ret = ucsi_acknowledge_connector_change(ucsi);
> > +		mutex_unlock(&ucsi->ppm_lock);
> > +
> > +		if (ret)
> > +			dev_err(ucsi->dev, "%s: ACK failed (%d)", __func__, ret);
> 
> What if a real async connector change event happens here? It can because
> you just cleared the connector change condition. But it will be ignored
> because EVENT_PENDING is still set. In practive the new event might even
> be reported in the CCI along with the completion of the ACK command
> above (without an additional async event).

This patch was more to see how this idea would be received so I didn't
think too much about problems with timings, this would come after but
yes, you are correct in pointing this out.

> What UCSI backend (ACPI, CCG, ...) is this?

It is ACPI.

Best regards,

Diogo

      reply	other threads:[~2024-03-28 16:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 12:39 [RFC PATCH] usb: typec: ucsi: ack connector change after all tasks finish Diogo Ivo
2024-03-27 13:06 ` Dmitry Baryshkov
2024-03-27 14:37   ` Diogo Ivo
2024-03-27 16:06 ` Christian Ehrhardt
2024-03-28 15:42   ` Diogo Ivo
2024-03-28 22:40     ` Christian Ehrhardt
2024-04-24 11:23       ` Diogo Ivo
2024-04-25 18:05         ` Christian Ehrhardt
2024-03-27 16:42 ` Christian Ehrhardt
2024-03-28 16:04   ` Diogo Ivo [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=nbvsbechvtakxdtsmabtcb4zf2sojmcucv3lhyxe32dgg3z5cy@ljru526jospx \
    --to=diogo.ivo@tecnico.ulisboa.pt \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=fabrice.gasnier@foss.st.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=lk@c--e.de \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_prashk@quicinc.com \
    --cc=saranya.gopal@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.