* [char-misc-next 1/5] mei: cancel driver workers only after client devices were removed
@ 2015-10-13 12:02 Tomas Winkler
2015-10-13 12:02 ` [char-misc-next 2/5] mei: keep the device awake during reads in chunks Tomas Winkler
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Tomas Winkler @ 2015-10-13 12:02 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Alexander Usyskin, linux-kernel, Tomas Winkler
In process of client devices removal from the bus there still
might be communication between a driver and the mei device
hence we need to cancel supporting workers only after all
the client devices were removed.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
drivers/misc/mei/init.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c
index e374661652cd..3edafc8d3ad4 100644
--- a/drivers/misc/mei/init.c
+++ b/drivers/misc/mei/init.c
@@ -329,10 +329,10 @@ void mei_stop(struct mei_device *dev)
{
dev_dbg(dev->dev, "stopping the device.\n");
- mei_cancel_work(dev);
-
mei_cl_bus_remove_devices(dev);
+ mei_cancel_work(dev);
+
mutex_lock(&dev->device_lock);
mei_wd_stop(dev);
--
2.4.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [char-misc-next 2/5] mei: keep the device awake during reads in chunks
2015-10-13 12:02 [char-misc-next 1/5] mei: cancel driver workers only after client devices were removed Tomas Winkler
@ 2015-10-13 12:02 ` Tomas Winkler
2015-10-13 12:02 ` [char-misc-next 3/5] mei: fix the KDoc formating Tomas Winkler
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Tomas Winkler @ 2015-10-13 12:02 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Alexander Usyskin, linux-kernel, Tomas Winkler
From: Alexander Usyskin <alexander.usyskin@intel.com>
Long messages are read in chunks, to prevent trashing runtime pm between
the reading of the chunks we call pm_runtime_mark_last_busy() on
non-final chunk message as the next chunk of the same message will be
received immediately in the next interrupt with high probablity.
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
drivers/misc/mei/interrupt.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c
index c418d7888994..64b568a0268d 100644
--- a/drivers/misc/mei/interrupt.c
+++ b/drivers/misc/mei/interrupt.c
@@ -21,6 +21,7 @@
#include <linux/fs.h>
#include <linux/jiffies.h>
#include <linux/slab.h>
+#include <linux/pm_runtime.h>
#include <linux/mei.h>
@@ -147,6 +148,9 @@ int mei_cl_irq_read_msg(struct mei_cl *cl,
cb->read_time = jiffies;
cl_dbg(dev, cl, "completed read length = %lu\n", cb->buf_idx);
list_move_tail(&cb->list, &complete_list->list);
+ } else {
+ pm_runtime_mark_last_busy(dev->dev);
+ pm_request_autosuspend(dev->dev);
}
out:
--
2.4.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [char-misc-next 3/5] mei: fix the KDoc formating
2015-10-13 12:02 [char-misc-next 1/5] mei: cancel driver workers only after client devices were removed Tomas Winkler
2015-10-13 12:02 ` [char-misc-next 2/5] mei: keep the device awake during reads in chunks Tomas Winkler
@ 2015-10-13 12:02 ` Tomas Winkler
2015-10-13 12:02 ` [char-misc-next 4/5] mei: bus: fix c&p issue in the kdoc Tomas Winkler
2015-10-13 12:02 ` [char-misc-next 5/5] mei: amthif: Do not compare bool to 0/1 Tomas Winkler
3 siblings, 0 replies; 5+ messages in thread
From: Tomas Winkler @ 2015-10-13 12:02 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Alexander Usyskin, linux-kernel, Tomas Winkler
From: Alexander Usyskin <alexander.usyskin@intel.com>
KDoc function section start with double start: /** instead of /*
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
drivers/misc/mei/hbm.c | 6 +++---
drivers/misc/mei/mei_dev.h | 17 +++++++++--------
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c
index 6d7c188fb65c..e7b7aad0999b 100644
--- a/drivers/misc/mei/hbm.c
+++ b/drivers/misc/mei/hbm.c
@@ -281,7 +281,7 @@ int mei_hbm_start_req(struct mei_device *dev)
return 0;
}
-/*
+/**
* mei_hbm_enum_clients_req - sends enumeration client request message.
*
* @dev: the device structure
@@ -314,7 +314,7 @@ static int mei_hbm_enum_clients_req(struct mei_device *dev)
return 0;
}
-/*
+/**
* mei_hbm_me_cl_add - add new me client to the list
*
* @dev: the device structure
@@ -569,7 +569,7 @@ static int mei_hbm_prop_req(struct mei_device *dev)
return 0;
}
-/*
+/**
* mei_hbm_pg - sends pg command
*
* @dev: the device structure
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
index 0f87dffa6be1..fc7728bb84b1 100644
--- a/drivers/misc/mei/mei_dev.h
+++ b/drivers/misc/mei/mei_dev.h
@@ -275,32 +275,33 @@ struct mei_cl {
struct mei_cl_device *cldev;
};
-/** struct mei_hw_ops
+/**
+ * struct mei_hw_ops - hw specific ops
*
* @host_is_ready : query for host readiness
-
+ *
* @hw_is_ready : query if hw is ready
* @hw_reset : reset hw
* @hw_start : start hw after reset
* @hw_config : configure hw
-
+ *
* @fw_status : get fw status registers
* @pg_state : power gating state of the device
* @pg_in_transition : is device now in pg transition
* @pg_is_enabled : is power gating enabled
-
+ *
* @intr_clear : clear pending interrupts
* @intr_enable : enable interrupts
* @intr_disable : disable interrupts
-
+ *
* @hbuf_free_slots : query for write buffer empty slots
* @hbuf_is_ready : query if write buffer is empty
* @hbuf_max_len : query for write buffer max len
-
+ *
* @write : write a message to FW
-
+ *
* @rdbuf_full_slots : query how many slots are filled
-
+ *
* @read_hdr : get first 4 bytes (header)
* @read : read a buffer from the FW
*/
--
2.4.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [char-misc-next 4/5] mei: bus: fix c&p issue in the kdoc
2015-10-13 12:02 [char-misc-next 1/5] mei: cancel driver workers only after client devices were removed Tomas Winkler
2015-10-13 12:02 ` [char-misc-next 2/5] mei: keep the device awake during reads in chunks Tomas Winkler
2015-10-13 12:02 ` [char-misc-next 3/5] mei: fix the KDoc formating Tomas Winkler
@ 2015-10-13 12:02 ` Tomas Winkler
2015-10-13 12:02 ` [char-misc-next 5/5] mei: amthif: Do not compare bool to 0/1 Tomas Winkler
3 siblings, 0 replies; 5+ messages in thread
From: Tomas Winkler @ 2015-10-13 12:02 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Alexander Usyskin, linux-kernel, Tomas Winkler
s/send/receive/
The buffer in the receive function is
not used for sending
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
drivers/misc/mei/bus.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 832085207a7f..160e084ae800 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -91,7 +91,7 @@ out:
* __mei_cl_recv - internal client receive (read)
*
* @cl: host client
- * @buf: buffer to send
+ * @buf: buffer to receive
* @length: buffer length
*
* Return: read size in bytes of < 0 on error
@@ -188,7 +188,7 @@ EXPORT_SYMBOL_GPL(mei_cldev_send);
* mei_cldev_recv - client receive (read)
*
* @cldev: me client device
- * @buf: buffer to send
+ * @buf: buffer to receive
* @length: buffer length
*
* Return: read size in bytes of < 0 on error
--
2.4.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [char-misc-next 5/5] mei: amthif: Do not compare bool to 0/1
2015-10-13 12:02 [char-misc-next 1/5] mei: cancel driver workers only after client devices were removed Tomas Winkler
` (2 preceding siblings ...)
2015-10-13 12:02 ` [char-misc-next 4/5] mei: bus: fix c&p issue in the kdoc Tomas Winkler
@ 2015-10-13 12:02 ` Tomas Winkler
3 siblings, 0 replies; 5+ messages in thread
From: Tomas Winkler @ 2015-10-13 12:02 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Alexander Usyskin, linux-kernel, Tomas Winkler
From: Alexander Usyskin <alexander.usyskin@intel.com>
Spotted by coccicheck:
drivers/misc/mei/amthif.c:479:5-26: WARNING: Comparison of bool to 0/1
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
drivers/misc/mei/amthif.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c
index 1e42781592d8..cd0403f09267 100644
--- a/drivers/misc/mei/amthif.c
+++ b/drivers/misc/mei/amthif.c
@@ -458,7 +458,7 @@ void mei_amthif_complete(struct mei_device *dev, struct mei_cl_cb *cb)
return;
}
- if (dev->iamthif_canceled != 1) {
+ if (!dev->iamthif_canceled) {
dev->iamthif_state = MEI_IAMTHIF_READ_COMPLETE;
dev->iamthif_stall_timer = 0;
list_add_tail(&cb->list, &dev->amthif_rd_complete_list.list);
--
2.4.3
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-10-13 12:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-13 12:02 [char-misc-next 1/5] mei: cancel driver workers only after client devices were removed Tomas Winkler
2015-10-13 12:02 ` [char-misc-next 2/5] mei: keep the device awake during reads in chunks Tomas Winkler
2015-10-13 12:02 ` [char-misc-next 3/5] mei: fix the KDoc formating Tomas Winkler
2015-10-13 12:02 ` [char-misc-next 4/5] mei: bus: fix c&p issue in the kdoc Tomas Winkler
2015-10-13 12:02 ` [char-misc-next 5/5] mei: amthif: Do not compare bool to 0/1 Tomas Winkler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®