Skip to contentSkip to conversation

mei: bus: block send with vtag on non-conformat FW

PATCH New Tomas Winkler 1 participant 2 messages Feb 8, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mei: bus: block send with vtag on non-conformat FW

From: Alexander Usyskin <[email protected]>

Block data send with vtag if either transport layer or FW client are not supporting vtags.

---
 drivers/misc/mei/bus.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/misc/mei/bus.c +7 -0
index 34fb5e541fe5..be99bb0a16cf 100644
@@ -61,6 +61,13 @@ ssize_t __mei_cl_send(struct mei_cl *cl, u8 *buf, size_t length, u8 vtag,
 		goto out;
 	}
 
+	if (vtag) {
+		/* Check if vtag is supported by client */
+		rets = mei_cl_vt_support_check(cl);
+		if (rets)
+			goto out;
+	}
+
 	if (length > mei_cl_mtu(cl)) {
 		rets = -EFBIG;
 		goto out;
Signature · 1 line
2.26.2
#1 lore raw

PATCH 2/2 mei: use sysfs_emit() in tx_queue_limit_show sysfs

Using of snprintf is discouraged in sysfs use the new sysfs_emit() API.

---
 drivers/misc/mei/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/mei/main.c +1 -1
index 9f6682033ed7..28937b6e7e0c 100644
@@ -1026,7 +1026,7 @@ static ssize_t tx_queue_limit_show(struct device *device,
 	size = dev->tx_queue_limit;
 	mutex_unlock(&dev->device_lock);
 
-	return snprintf(buf, PAGE_SIZE, "%u\n", size);
+	return sysfs_emit(buf, "%u\n", size);
 }
 
 static ssize_t tx_queue_limit_store(struct device *device,
Signature · 1 line
2.26.2