diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2012-06-25 20:46:27 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-26 22:59:44 (GMT) |
commit | 24aadc809f270857743e62d0882865fb3ba195d9 (patch) | |
tree | 5df3ea0a48d63ccee9ad702deb35b7c1aaa52ba4 /drivers/misc/mei/iorw.c | |
parent | 21c66d1be7c586b56c2902ada4ba030a12b00063 (diff) | |
download | linux-fsl-qoriq-24aadc809f270857743e62d0882865fb3ba195d9.tar.xz |
mei: don't query HCSR for host buffer depth
1. We record host (write) buffer depth during reset
so we don't need to query HCSR register later on.
The host buffer depth doesn't change after the reset
2. Use mei_hbuf_max_data function to compute payload size in bytes
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/iorw.c')
-rw-r--r-- | drivers/misc/mei/iorw.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/misc/mei/iorw.c b/drivers/misc/mei/iorw.c index f9cced6..50f52e2 100644 --- a/drivers/misc/mei/iorw.c +++ b/drivers/misc/mei/iorw.c @@ -481,12 +481,8 @@ int amthi_write(struct mei_device *dev, struct mei_cl_cb *cb) if (ret && dev->mei_host_buffer_is_empty) { ret = 0; dev->mei_host_buffer_is_empty = false; - if (cb->request_buffer.size > - (((dev->host_hw_state & H_CBD) >> 24) * sizeof(u32)) - -sizeof(struct mei_msg_hdr)) { - mei_hdr.length = - (((dev->host_hw_state & H_CBD) >> 24) * - sizeof(u32)) - sizeof(struct mei_msg_hdr); + if (cb->request_buffer.size > mei_hbuf_max_data(dev)) { + mei_hdr.length = mei_hbuf_max_data(dev); mei_hdr.msg_complete = 0; } else { mei_hdr.length = cb->request_buffer.size; |