From f70386b91689853ae9f7ac31c8cd6ca9da3417cc Mon Sep 17 00:00:00 2001 From: Jack Pham Date: Sun, 28 Nov 2021 20:39:33 -0800 Subject: [PATCH] coresight-tmc: Ignore USB write errors during disconnection When USB sink path is disabled or disconnected, it is expected that the outstanding write requests will return with an error code. Ignore -ECONNRESET and -ESHUTDOWN for those respective cases to avoid printing an error message to the kernel log. Change-Id: Ia9a886b082e3152cfd1ccf315a678c1b48347b05 Signed-off-by: Jack Pham --- drivers/hwtracing/coresight/coresight-tmc-usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-usb.c b/drivers/hwtracing/coresight/coresight-tmc-usb.c index f0bf16d1d17b..c92e23257323 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-usb.c +++ b/drivers/hwtracing/coresight/coresight-tmc-usb.c @@ -318,7 +318,8 @@ static void usb_write_done(struct byte_cntr *drvdata, struct qdss_request *d_req) { atomic_inc(&drvdata->usb_free_buf); - if (d_req->status) + if (d_req->status && d_req->status != -ECONNRESET + && d_req->status != -ESHUTDOWN) pr_err_ratelimited("USB write failed err:%d\n", d_req->status); kfree(d_req->sg); kfree(d_req);