From nobody Thu Feb 10 15:16:53 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4AA6819C2FE3; Thu, 10 Feb 2022 15:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JvgMT1g4Vz3jl2; Thu, 10 Feb 2022 15:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644506213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JCas3Gxnn/XO5+SSTwxq9eogKfP2Ik0oMpZ27trtX/Y=; b=Z5/1TGnOqsVH5wsBclYUk0G58cm2ZBHok1h9IF4cF5H0Trqh8AP2MZyezYSgOJFmb90ct/ x8Xq1b3NsokzUfUZ9dp1aciOdRELj3z0+/mMKNjR6YLC0NNM4ryTwndI0tjKDN4LIJNu7V hrQQabXV0uvLYJClhxtADlW6dZ0F78VdO8x78QoGExsWZ+o0iFP/s0mKoKpCprH/Rln3ZI FneobcEVfkIO8XjY/2NQsxHS7D/LX3IH0I/UyIhdvczKhGkHSQqbokB9kPZhW9sUK1nJRD KfBmvWPQD6o2m5vu/Ze04Yt6EzjM/gBFAZSnogzkwE+vYP8RbPyBr1U19PU1dQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1945022B34; Thu, 10 Feb 2022 15:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21AFGrig071281; Thu, 10 Feb 2022 15:16:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21AFGrbK071280; Thu, 10 Feb 2022 15:16:53 GMT (envelope-from git) Date: Thu, 10 Feb 2022 15:16:53 GMT Message-Id: <202202101516.21AFGrbK071280@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 966c36c1b65e - stable/13 - usb(4): Ignore port resume failures. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 966c36c1b65e0dcc6fbd09469b511adae881486e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644506213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JCas3Gxnn/XO5+SSTwxq9eogKfP2Ik0oMpZ27trtX/Y=; b=vH0hjkoncAvjMnY1v8K8WmS5xg8eiQaDtrMkSQTvVzni/gQJjIYnZAN2V04nV9jaYGSRNj aJAmLbJnZrdrq6TsVzjz2Ci7Oxh1ha27bJyxjClc5t7tYS5JwagYwCPG4UiEt63qVAppWo 7U3Pv6SqsT9GNxUag+vFpwYSeltNhHDf68IKc3js8Q4XJVByPPXr9Ognjcv/A2MKuv9DSz fKwsssCHAb0wMDLNU2b+Ccs7R8xDYlQ+C8cqDp6f4hDugKvjAPh2Fdm/s8HhvdqdMrRBsn 9B+AmAXoS/S4xw8aWNPreQtEFHGo3MXw0UcRlnYmHCfrX6n+LwOvg2CWS0O0Jg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644506213; a=rsa-sha256; cv=none; b=PMFn3qMn0aEg5+8HESeiXzTjCc/6Gg6/VnEjaOYZAMaFmgwI6yhly/De0jav+D3mNmOA1H tsLShUgHvzUh5jONtwk2yv2ibRohf6j7jAV8l0gctxdS76TE7uA4HMuRaxSQBpX/E3vwmF OCiQOG+K8fNDTwAgi45Clc9x6Us2ndszb0Ti20Q9TyTc5osZdYHeZpFjbeEDzG7GQO4iwH zNRhmWEfK4bvYTNtWnq7iLYntxFfS+iESU48hP24NWE49GgJeYLSotLgGQ4Fzoq0CFpaNA S8sU6qUuSd8/j205jrVmkQi9Pylgp/NznGiqW0VE4iCCvRwdCCktV+f4ynJQzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=966c36c1b65e0dcc6fbd09469b511adae881486e commit 966c36c1b65e0dcc6fbd09469b511adae881486e Author: Hans Petter Selasky AuthorDate: 2022-02-02 11:59:00 +0000 Commit: Hans Petter Selasky CommitDate: 2022-02-10 15:10:53 +0000 usb(4): Ignore port resume failures. If port resume fails, likely the USB device is detached. Ignore such errors, because else the USB stack might try forever trying to resume the device, before it will proceed detaching it. Sponsored by: NVIDIA Networking (cherry picked from commit a88e1a04df8bf192da607cfb068020c357a4c3ce) --- sys/dev/usb/usb_hub.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sys/dev/usb/usb_hub.c b/sys/dev/usb/usb_hub.c index 52ac0a8a7ff7..17bdac68c465 100644 --- a/sys/dev/usb/usb_hub.c +++ b/sys/dev/usb/usb_hub.c @@ -4,7 +4,7 @@ * * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. * Copyright (c) 1998 Lennart Augustsson. All rights reserved. - * Copyright (c) 2008-2010 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2008-2022 Hans Petter Selasky. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -2669,18 +2669,15 @@ usb_dev_resume_peer(struct usb_device *udev) /* resume current port (Valid in Host and Device Mode) */ err = usbd_req_clear_port_feature(udev->parent_hub, NULL, udev->port_no, UHF_PORT_SUSPEND); - if (err) { - DPRINTFN(0, "Resuming port failed\n"); - return; - } } else { /* resume current port (Valid in Host and Device Mode) */ err = usbd_req_set_port_link_state(udev->parent_hub, NULL, udev->port_no, UPS_PORT_LS_U0); - if (err) { - DPRINTFN(0, "Resuming port failed\n"); - return; - } + } + + if (err != 0) { + DPRINTFN(0, "Resuming port failed: %s (ignored)\n", + usbd_errstr(err)); } /* resume settle time */