From 87fdd4b6c8a8a0cc22e53cdb239b56dc95ee6f74 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Sat, 5 Jul 2014 00:59:16 +0200 Subject: xmm626: HSIC ACKs are not reliable Signed-off-by: Paul Kocialkowski --- samsung-ipc/devices/xmm626/xmm626_hsic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samsung-ipc/devices/xmm626/xmm626_hsic.c b/samsung-ipc/devices/xmm626/xmm626_hsic.c index d7a5d4f..07154bd 100644 --- a/samsung-ipc/devices/xmm626/xmm626_hsic.c +++ b/samsung-ipc/devices/xmm626/xmm626_hsic.c @@ -120,13 +120,13 @@ int xmm626_hsic_psi_send(struct ipc_client *client, int device_fd, rc = select(device_fd + 1, &fds, NULL, NULL, &timeout); if (rc <= 0) { - ipc_client_log(client, "Reading chip id failed"); + ipc_client_log(client, "Reading boot ACK failed"); goto error; } psi_ack = 0; rc = read(device_fd, &psi_ack, sizeof(psi_ack)); - if (rc <= 0 || psi_ack != XMM626_HSIC_BOOT0_ACK) { + if (rc < (int) sizeof(psi_ack)) { ipc_client_log(client, "Reading boot ACK failed"); goto error; } @@ -139,7 +139,7 @@ int xmm626_hsic_psi_send(struct ipc_client *client, int device_fd, chip_id = 0; rc = read(device_fd, &chip_id, sizeof(chip_id)); - if (rc <= 0) { + if (rc < (int) sizeof(chip_id)) { ipc_client_log(client, "Reading chip id failed"); goto error; } @@ -206,7 +206,7 @@ int xmm626_hsic_psi_send(struct ipc_client *client, int device_fd, } rc = read(device_fd, &psi_ack, sizeof(psi_ack)); - if (rc < (int) sizeof(psi_ack) || psi_ack != XMM626_HSIC_PSI_CRC_ACK) { + if (rc < (int) sizeof(psi_ack)) { ipc_client_log(client, "Reading PSI CRC ACK failed"); goto error; } -- cgit v1.1