summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0049-Suppress-excessive-HID-gadget-error-logs.patch
blob: 4a87f2d76baa799be254bbbd032cb898553e4f41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From 5b9ec5081492b461710cb82e7ecc93fd3af8ad34 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Mon, 18 Mar 2019 14:06:36 -0700
Subject: [PATCH] Suppress excessive HID gadget error logs

HID events can be sent even when the host disconnects the HID
device according to the current graphic mode. For an example, if
KVM mouse events are sent when the host is in text mode, queueing
of end point messages will be dropped with this message:

configfs-gadget gadget: usb_ep_queue error on int endpoint -108

This case is very usual case in BMC since BMC can control power
status of the host, so this commit suppress the error printing outs
with making HID gadget driver drop events quietly in the case.

This should be a downstream only customization. Do not upstream it.

Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
---
 drivers/usb/gadget/function/f_hid.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c
index f3816a5c861e..c96c0f6f1df0 100644
--- a/drivers/usb/gadget/function/f_hid.c
+++ b/drivers/usb/gadget/function/f_hid.c
@@ -320,7 +320,7 @@ static void f_hidg_req_complete(struct usb_ep *ep, struct usb_request *req)
 	struct f_hidg *hidg = (struct f_hidg *)ep->driver_data;
 	unsigned long flags;
 
-	if (req->status != 0) {
+	if (req->status != 0 && req->status != -ESHUTDOWN) {
 		ERROR(hidg->func.config->cdev,
 			"End Point Request ERROR: %d\n", req->status);
 	}
@@ -395,8 +395,10 @@ static ssize_t f_hidg_write(struct file *file, const char __user *buffer,
 
 	status = usb_ep_queue(hidg->in_ep, req, GFP_ATOMIC);
 	if (status < 0) {
-		ERROR(hidg->func.config->cdev,
-			"usb_ep_queue error on int endpoint %zd\n", status);
+		if (status != -ESHUTDOWN)
+			ERROR(hidg->func.config->cdev,
+			      "usb_ep_queue error on int endpoint %zd\n",
+			      status);
 		goto release_write_pending;
 	} else {
 		status = count;
-- 
2.7.4