lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1478168250-30858-1-git-send-email-jay.xu@rock-chips.com>
Date:   Thu,  3 Nov 2016 18:17:30 +0800
From:   Jianqun Xu <jay.xu@...k-chips.com>
To:     airlied@...ux.ie, seanpaul@...omium.org, wzz@...k-chips.com,
        tomeu.vizoso@...labora.com
Cc:     heiko@...ech.de, huangtao@...k-chips.com,
        yamada.masahiro@...ionext.com, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org, linux-rockchip@...ts.infradead.org,
        Jianqun Xu <jay.xu@...k-chips.com>
Subject: [PATCH] drm/bridge: analogix_dp: return error if transfer none byte

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@...k-chips.com>
Cc: Sean Paul <seanpaul@...omium.org>
Signed-off-by: Jianqun Xu <jay.xu@...k-chips.com>
---
 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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ