public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 3/3] usb: typec: ucsi_glink: drop special handling for CCI_BUSY
Date: Tue, 9 Apr 2024 09:30:04 +0300	[thread overview]
Message-ID: <ZhTgbOYigUBucwNY@kuha.fi.intel.com> (raw)
In-Reply-To: <20240408-qcom-ucsi-fixes-bis-v1-3-716c145ca4b1@linaro.org>

On Mon, Apr 08, 2024 at 04:04:17AM +0300, Dmitry Baryshkov wrote:
> Newer Qualcomm platforms (sm8450+) successfully handle busy state and
> send the Command Completion after sending the Busy state. Older devices
> have firmware bug and can not continue after sending the CCI_BUSY state,
> but the command that leads to CCI_BUSY is already forbidden by the
> NO_PARTNER_PDOS quirk.
> 
> Follow other UCSI glue drivers and drop special handling for CCI_BUSY
> event. Let the UCSI core properly handle this state.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

One minor nitpick below, but feel free to ignore that one.

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/ucsi/ucsi_glink.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c
> index 9ffea20020e7..b91d2d15d7d9 100644
> --- a/drivers/usb/typec/ucsi/ucsi_glink.c
> +++ b/drivers/usb/typec/ucsi/ucsi_glink.c
> @@ -176,7 +176,8 @@ static int pmic_glink_ucsi_sync_write(struct ucsi *__ucsi, unsigned int offset,
>  	left = wait_for_completion_timeout(&ucsi->sync_ack, 5 * HZ);
>  	if (!left) {
>  		dev_err(ucsi->dev, "timeout waiting for UCSI sync write response\n");
> -		ret = -ETIMEDOUT;
> +		/* return 0 here and let core UCSI code handle the CCI_BUSY */
> +		ret = 0;
>  	} else if (ucsi->sync_val) {
>  		dev_err(ucsi->dev, "sync write returned: %d\n", ucsi->sync_val);
>  	}
> @@ -243,10 +244,7 @@ static void pmic_glink_ucsi_notify(struct work_struct *work)
>  		ucsi_connector_change(ucsi->ucsi, con_num);
>  	}
>  
> -	if (ucsi->sync_pending && cci & UCSI_CCI_BUSY) {
> -		ucsi->sync_val = -EBUSY;
> -		complete(&ucsi->sync_ack);
> -	} else if (ucsi->sync_pending &&
> +	if (ucsi->sync_pending &&
>  		   (cci & (UCSI_CCI_ACK_COMPLETE | UCSI_CCI_COMMAND_COMPLETE))) {

Looks like you forgot to fix the alignment.

>  		complete(&ucsi->sync_ack);
>  	}
> 
> -- 
> 2.39.2

-- 
heikki

      reply	other threads:[~2024-04-09  6:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08  1:04 [PATCH 0/3] usb: typec: ucsi: additional fixes for Qualcomm platforms Dmitry Baryshkov
2024-04-08  1:04 ` [PATCH 1/3] usb: typec: ucsi_glink: enable the UCSI_DELAY_DEVICE_PDOS quirk on qcm6490 Dmitry Baryshkov
2024-04-09  6:21   ` Heikki Krogerus
2024-04-08  1:04 ` [PATCH 2/3] usb: typec: ucsi_glink: drop NO_PARTNER_PDOS quirk for sm8550 / sm8650 Dmitry Baryshkov
2024-04-09  6:22   ` Heikki Krogerus
2024-04-08  1:04 ` [PATCH 3/3] usb: typec: ucsi_glink: drop special handling for CCI_BUSY Dmitry Baryshkov
2024-04-09  6:30   ` 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=ZhTgbOYigUBucwNY@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=neil.armstrong@linaro.org \
    /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