]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mei: prepare read cb for fixed address clients on the receive path only.
authorAlexander Usyskin <alexander.usyskin@intel.com>
Mon, 25 Jul 2016 22:06:02 +0000 (01:06 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Aug 2016 12:39:42 +0000 (14:39 +0200)
The read callbacks for the fixed address clients, that don't have flow
control are built now on the receive path. In order to have a single
allocation place we remove the allocation from the read request.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/client.c

index 2a09db86e50ece9c4ef974bc1bacad12704bb18f..05cacc3e718f888395054b686875cf40e7c93a61 100644 (file)
@@ -1459,17 +1459,15 @@ int mei_cl_read_start(struct mei_cl *cl, size_t length, const struct file *fp)
                return  -ENOTTY;
        }
 
+       if (mei_cl_is_fixed_address(cl))
+               return 0;
+
        /* always allocate at least client max message */
        length = max_t(size_t, length, mei_cl_mtu(cl));
        cb = mei_cl_alloc_cb(cl, length, MEI_FOP_READ, fp);
        if (!cb)
                return -ENOMEM;
 
-       if (mei_cl_is_fixed_address(cl)) {
-               list_add_tail(&cb->list, &cl->rd_pending);
-               return 0;
-       }
-
        rets = pm_runtime_get(dev->dev);
        if (rets < 0 && rets != -EINPROGRESS) {
                pm_runtime_put_noidle(dev->dev);