Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2952659lqo; Tue, 21 May 2024 02:14:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWwWCqOSa87IDk7SreHKbX/mBtWAoc4TTKM3PwVCGr7DLvncrN9ulV1oxmf0hqx9fX/lqzEj6x9TvidpdkibxPOMNhMJVlkXcq63qmMvA== X-Google-Smtp-Source: AGHT+IFb0nlpqlR1Z9y5jkHjucvNP25XK4uZgqxOIHgW6fstSc+PtM7pEF1FWxiUZ3ZL6vR1QX7F X-Received: by 2002:a05:620a:12e1:b0:792:8c59:f56d with SMTP id af79cd13be357-79470efc950mr1400470985a.30.1716282852714; Tue, 21 May 2024 02:14:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716282852; cv=pass; d=google.com; s=arc-20160816; b=Rqmyj6bZSGx6+j7jpPiIEWAt76YncSWNh5uRYnIBe3muYzkAUYBBLYiwxIDMsg/UX8 9vJnhu1QGBKt4H2TakPqp/W5cxG5POl0Fsr1Ebmo6hG0tErdCdpPLnnyJokx2rosXZrI yLGJWd3PljK+4VdOfhtpMDC/NBwaf+NGxCwrCOcb9ZdFRl8I5rCLVzp/II9XF+RQyLVI xtuILCnFHu5Dcan3vkWsHhDHRl58kex1FOC4htVGiOaIfoUljxtwBVJnrrGb75K5sMSm HOxKWAWZingJ+xTCjYcAP+S+ZcBfIuMaAssKhmFEaiG/dMWCkZUd1INzSSa/VXkFc/0Q wq+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=L7aR29FtSZuZ+y/bx0KTKzczdY+Rsy7yZ58GK0tgM4Q=; fh=9wKVl6+4m5NYgitT9tMuBn1a2aiGu2hYlBWGYpCKDdc=; b=PLg+gIIAINwxUPXcygtXxyAa6+bUK7sdjQQ1rm/90/c341k+FtsO9nc7WM7ook0CWZ +uJDI/Jkot0AYP9X+723fWMKCHaQmCrCKK0UI+tdJ7IjQqK85M8wYUnq+vivdS7CS391 anoKgHNtnSvVoBhxMydciwVhf70zNrtUllYw0drZYtVLorjOBB3qVUxwlINskWPvmynP 2JM5qoUGaTL9PsvoBUvUIDIoua+XZbtc0+ruIimTM2f8mn5i7FOBvQZuS1AGh5qRqngg GAsuzrCcy7j4JfYjOrpiwIk9SQmzqb4yJamOObU2+InD82fDLobwBM3v5b9L/PrGDSjT jgGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Lfw34S9I; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-184685-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184685-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-792bf30b5f0si126121285a.350.2024.05.21.02.14.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 02:14:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184685-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Lfw34S9I; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-184685-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184685-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 64ACC1C2172E for ; Tue, 21 May 2024 09:14:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 22BCE5B69E; Tue, 21 May 2024 09:14:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Lfw34S9I" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 27E7956B7B for ; Tue, 21 May 2024 09:13:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716282839; cv=none; b=IHCdQbSj/vO5xkxaMQ1VSFN0xEY7wra+JXqY+FPU96ZkczcOJ9SztLw2OLd52+N49vVDN4a0jHIJj8Zznq2MrHOb7keJNe7ZHkDbp/RYDXoDjlFMY59+eEZjPJym6qFqeQ0pOhLFrOMbxRwBVegYbXh90rmHIfHJMYqdSKN9Xc8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716282839; c=relaxed/simple; bh=L7aR29FtSZuZ+y/bx0KTKzczdY+Rsy7yZ58GK0tgM4Q=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=fouDmWdOmSTBkcF86WVIE5TAt/MVHZf15Ovx9bqnFU8mYMrksjOgr1EcvKIkXvS+TZcXOAKuaMaXYSCG/oFb2KeFYBszf6helXf+2H3FG7tHJ9PZMi/wyOsMA/cqvBZJlxYG5B3XAPIVCEHQYwnLlV2QR/g49mQHmbzpTMD9vkQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Lfw34S9I; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716282836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=L7aR29FtSZuZ+y/bx0KTKzczdY+Rsy7yZ58GK0tgM4Q=; b=Lfw34S9I1URscSqLpS/pCFW/ZK7MJlHh5eJITHXBzrWPGesNFAmSWfanvgobHUr3nxQZvr 3sz7T5aQsoKa0J8adC2Z7fHFky8VAdstCOWnZcyT02w7OtVbFI3UABem8I4YTFcdXW5AUU QRVIqQzCLRdUDS1QTA2jEmT2ZTXYVBE= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-439-69X2aNXZN_WtJdhTcC3E6g-1; Tue, 21 May 2024 05:13:54 -0400 X-MC-Unique: 69X2aNXZN_WtJdhTcC3E6g-1 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5732ff67d23so777896a12.1 for ; Tue, 21 May 2024 02:13:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716282833; x=1716887633; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=L7aR29FtSZuZ+y/bx0KTKzczdY+Rsy7yZ58GK0tgM4Q=; b=ccuND4DqROGbWzV8cOgzPY4rZ2IhSNVRitdDa+0kyAPw2PAy7NQXedYJenjci4SUNA L/FM/2OM8hYplQH4HGPNC4+MBNozKxCK6Wff/9kHCHgZISk5ZEF1eKwKdYMVxtvRnx8U jVO+E6z3VZn3jcGPMyzoFV4iSF0IaVqFC/WdG+rLZ+rFg2uDuwmxB/gYf5r8vJS0HGe+ 35OnH48vymQg00k7pjL3zOyTFUXY3qI1ALaE7oCZ8wUdrJhFEBgQPJqA8rQSVALgKVwB vI2GHnp5K8Xkis4b6/5kTDqt8sTF7gJQjinCFWAU4PCybCLfNZDg4PXOgL8qICp/bqE/ mqCQ== X-Forwarded-Encrypted: i=1; AJvYcCXEWIQmQMJ9f4nGgydCda6DcBODEzoa9H5yhXUlkfZKKwT9mBp3iKbBOFgg8NwPgEKWIJebimt1P5qpMolDvuekG4oZeqR/qNxdenCr X-Gm-Message-State: AOJu0YzK4POPbnIV4f3LHAxEYANc/z7rlyskV4PoOtUnq2c3RGYuwoDH p963zSkW07t011YLC5F3t/QQ2cxDHeqgBLs6pJgeaXYq7sOI9HXXdAQuZGIpq67q6STA3aYUvSg 3nFi03H1GMcDJnbDREGZXkJtsj6GP2OFLgDtrp2emI2YXfZnAqhDPO0p20N6avw== X-Received: by 2002:a17:906:5a53:b0:a59:cb29:3f9e with SMTP id a640c23a62f3a-a5a2d508447mr1997675666b.1.1716282833482; Tue, 21 May 2024 02:13:53 -0700 (PDT) X-Received: by 2002:a17:906:5a53:b0:a59:cb29:3f9e with SMTP id a640c23a62f3a-a5a2d508447mr1997672566b.1.1716282833005; Tue, 21 May 2024 02:13:53 -0700 (PDT) Received: from gerbillo.redhat.com ([2a0d:3341:b094:ab10:29ae:cdc:4db4:a22a]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a61c18561casm217908366b.91.2024.05.21.02.13.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 02:13:52 -0700 (PDT) Message-ID: <75651199a933427a7fc3980ef8a2139f5f1f1695.camel@redhat.com> Subject: Re: [PATCH net-next 1/2] r8152: If inaccessible at resume time, issue a reset From: Paolo Abeni To: Douglas Anderson , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Hayes Wang Cc: danielgeorgem@google.com, Andrew Lunn , Grant Grundler , Heiner Kallweit , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org Date: Tue, 21 May 2024 11:13:50 +0200 In-Reply-To: <20240520134108.net-next.1.Ibeda5c0772812ce18953150da5a0888d2d875150@changeid> References: <20240520134108.net-next.1.Ibeda5c0772812ce18953150da5a0888d2d875150@changeid> Autocrypt: addr=pabeni@redhat.com; prefer-encrypt=mutual; keydata=mQINBGISiDUBEAC5uMdJicjm3ZlWQJG4u2EU1EhWUSx8IZLUTmEE8zmjPJFSYDcjtfGcbzLPb63BvX7FADmTOkO7gwtDgm501XnQaZgBUnCOUT8qv5MkKsFH20h1XJyqjPeGM55YFAXc+a4WD0YyO5M0+KhDeRLoildeRna1ey944VlZ6Inf67zMYw9vfE5XozBtytFIrRyGEWkQwkjaYhr1cGM8ia24QQVQid3P7SPkR78kJmrT32sGk+TdR4YnZzBvVaojX4AroZrrAQVdOLQWR+w4w1mONfJvahNdjq73tKv51nIpu4SAC1Zmnm3x4u9r22mbMDr0uWqDqwhsvkanYmn4umDKc1ZkBnDIbbumd40x9CKgG6ogVlLYeJa9WyfVMOHDF6f0wRjFjxVoPO6p/ZDkuEa67KCpJnXNYipLJ3MYhdKWBZw0xc3LKiKc+nMfQlo76T/qHMDfRMaMhk+L8gW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53PIQvAP0EAakWsqHoKZ5WdpeOcH9iVlUQhRgemQSkhfNaP9LqR1XKujlTuUTpoyT3xwAzkmSxN1nABoutHEO/N87fpIbpbZaIdinF7b9srwUvDOKsywfs5HMiUZhLKoZzCcU/AEFjQsPTATACGsWf3JYPnWxL9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Mon, 2024-05-20 at 13:41 -0700, Douglas Anderson wrote: > If we happened to get a USB transfer error during the transition to > suspend then the usb_queue_reset_device() that r8152_control_msg() > calls will get dropped on the floor. This is because > usb_lock_device_for_reset() (which usb_queue_reset_device() uses) > silently fails if it's called when a device is suspended or if too > much time passes. >=20 > Let's resolve this by resetting the device ourselves in r8152's > resume() function. >=20 > NOTE: due to timing, it's _possible_ that we could end up with two USB > resets: the one queued previously and the one called from the resume() > patch. This didn't happen in test cases I ran, though it's conceivably > possible. We can't easily know if this happened since > usb_queue_reset_device() can just silently drop the reset request. In > any case, it's not expected that this is a problem since the two > resets can't run at the same time (because of the device lock) and it > should be OK to reset the device twice. If somehow the double-reset > causes problems we could prevent resets from being queued up while > suspend is running. >=20 > Signed-off-by: Douglas Anderson ## Form letter - net-next-closed The merge window for v6.10 has begun and we have already posted our pull request. Therefore net-next is closed for new drivers, features, code refactoring and optimizations. We are currently accepting bug fixes only. Please repost when net-next reopens after May 26th. RFC patches sent for review only are obviously welcome at any time. See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#develop= ment-cycle