linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Paul <seanpaul@chromium.org>
To: Jianqun Xu <jay.xu@rock-chips.com>
Cc: "Dave Airlie" <airlied@linux.ie>, 王征增 <wzz@rock-chips.com>,
	"Tomeu Vizoso" <tomeu.vizoso@collabora.com>,
	"Heiko Stuebner" <heiko@sntech.de>,
	huangtao@rock-chips.com,
	"Masahiro Yamada" <yamada.masahiro@socionext.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	linux-rockchip@lists.infradead.org,
	Archit <architt@codeaurora.org>
Subject: Re: [PATCH] drm/bridge: analogix_dp: return error if transfer none byte
Date: Tue, 15 Nov 2016 09:09:44 -0800	[thread overview]
Message-ID: <CAOw6vb+4RDNBq6bizCK51cAN56j8EZyszL9j_XkjNKqZ4UG-Ug@mail.gmail.com> (raw)
In-Reply-To: <1478168250-30858-1-git-send-email-jay.xu@rock-chips.com>

On Thu, Nov 3, 2016 at 3:17 AM, Jianqun Xu <jay.xu@rock-chips.com> wrote:
> Reference from drm_dp_aux description (about transfer):
> Upon success, the implementation should return the number of payload bytes
> that were transferred, or a negative error-code on failure. Helpers
> propagate errors from the .transfer() function, with the exception of
> the -EBUSY error, which causes a transaction to be retried. On a short,
> helpers will return -EPROTO to make it simpler to check for failure.
>
> The analogix_dp_transfer will return num_transferred, but if there is none
> byte been transferred, the return value will be 0, which means success, we
> should return error-code if transfer none byte.
>
> for (retry = 0; retry < 32; retry++) {
>         err = aux->transfer(aux, &msg);
>         if (err < 0) {
>                 if (err == -EBUSY)
>                         continue;
>
>                 goto unlock;
>         }
> }
>
> Cc: zain wang <wzz@rock-chips.com>
> Cc: Sean Paul <seanpaul@chromium.org>
> Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

Reviewed-by: Sean Paul <seanpaul@chromium.org>

> ---
>  drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> index cd37ac0..303083a 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> @@ -1162,5 +1162,5 @@ ssize_t analogix_dp_transfer(struct analogix_dp_device *dp,
>                  (msg->request & ~DP_AUX_I2C_MOT) == DP_AUX_NATIVE_READ)
>                 msg->reply = DP_AUX_NATIVE_REPLY_ACK;
>
> -       return num_transferred;
> +       return num_transferred > 0 ? num_transferred : -EBUSY;
>  }
> --
> 1.9.1
>
>

  reply	other threads:[~2016-11-15 17:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-03 10:17 [PATCH] drm/bridge: analogix_dp: return error if transfer none byte Jianqun Xu
2016-11-15 17:09 ` Sean Paul [this message]
2016-11-16  6:08   ` Archit Taneja
2016-11-16  0:13 Jianqun Xu

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=CAOw6vb+4RDNBq6bizCK51cAN56j8EZyszL9j_XkjNKqZ4UG-Ug@mail.gmail.com \
    --to=seanpaul@chromium.org \
    --cc=airlied@linux.ie \
    --cc=architt@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=huangtao@rock-chips.com \
    --cc=jay.xu@rock-chips.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=tomeu.vizoso@collabora.com \
    --cc=wzz@rock-chips.com \
    --cc=yamada.masahiro@socionext.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).