Skip to content

Commit

Permalink
mei: don't wait for os version message reply
Browse files Browse the repository at this point in the history
The driver still struggles with firmwares that do not replay to the OS
version request. It is safe not waiting for the replay. First, the driver
doesn't do anything with the replay second the connection is closed
immediately, hence the packet will be just safely discarded in case it
is received and last the driver won't get stuck if the firmware won't
reply.

Cc: <[email protected]> #4.10+
Signed-off-by: Alexander Usyskin <[email protected]>
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
ausyskin authored and gregkh committed Mar 16, 2017
1 parent a733ded commit c6240ca
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions drivers/misc/mei/bus-fixup.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,9 @@ struct mkhi_msg {

static int mei_osver(struct mei_cl_device *cldev)
{
int ret;
const size_t size = sizeof(struct mkhi_msg_hdr) +
sizeof(struct mkhi_fwcaps) +
sizeof(struct mei_os_ver);
size_t length = 8;
char buf[size];
struct mkhi_msg *req;
struct mkhi_fwcaps *fwcaps;
Expand All @@ -137,15 +135,7 @@ static int mei_osver(struct mei_cl_device *cldev)
os_ver = (struct mei_os_ver *)fwcaps->data;
os_ver->os_type = OSTYPE_LINUX;

ret = __mei_cl_send(cldev->cl, buf, size, mode);
if (ret < 0)
return ret;

ret = __mei_cl_recv(cldev->cl, buf, length, 0);
if (ret < 0)
return ret;

return 0;
return __mei_cl_send(cldev->cl, buf, size, mode);
}

static void mei_mkhi_fix(struct mei_cl_device *cldev)
Expand All @@ -160,7 +150,7 @@ static void mei_mkhi_fix(struct mei_cl_device *cldev)
return;

ret = mei_osver(cldev);
if (ret)
if (ret < 0)
dev_err(&cldev->dev, "OS version command failed %d\n", ret);

mei_cldev_disable(cldev);
Expand Down

0 comments on commit c6240ca

Please sign in to comment.