Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2697846lqo; Mon, 20 May 2024 13:43:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVlQQ17UgIaGD4rdkVdEopR18/P2RvEI9aw9gDWeyQH2RxtqMyetCnThbAhX6svrqjK43oSRrrOsXpX6/Zolx3VoWebOTI+TyAg/kX/1w== X-Google-Smtp-Source: AGHT+IGfCg6hhjk1E7WYGLYG0W9wKY0ZFV9MWVB4nhmpXaSwL4XVphkcPWY1yYUi15CRIwoarpCs X-Received: by 2002:ac8:5a56:0:b0:435:f8f0:2940 with SMTP id d75a77b69052e-43dfdae2197mr324679711cf.22.1716237795449; Mon, 20 May 2024 13:43:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716237795; cv=pass; d=google.com; s=arc-20160816; b=M9sRLaWW15yhFqmEVWK/I4UKMl0Y48ARUNU5G6+cALZMeJihzviXWmeVBnXLSOhspE Lfmpo4SMhVhgSOULtou5Rq62jQdlT2vwWORyhFbCme32LIxH7sAloF9ZAI2yejn/yTGL yjbqB3gryxqumsPkn/nA3g5r1++U2AD/VHO9k/yzFHMdoo3KMg9/KQL8ihDysOyezHhN yuL2iRjNlEjWRY0qLj0+1/2h7m89APq4shRSY90FHbDN7eQr009iBor++d5CHzrViDmR FubGptEwDNmZo9pZlCKTtJ8wjZ4rx1rDDGGzFQiNi+d/56rHR7S/hTU9ZqYUGSdRBzTm k9oQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=EAPtcTBq5rQklg7My1+KHMw3K3I6I7ZSFTklmvsLyz8=; fh=FU8WkChza5s/td5AHGmG62QyTHDEl66d9fKRqMd13Wo=; b=T3VR6rEJ2NOj3HuvrUsi3kQu5ylZh8PdbIBodMTaa/kdgcJ8O/dqSSD+NQkOSzf2Wt +fz0UwEscAiPZbALRR1hcaDtXfoAB0Q/HUAnK1GELvhmmSMUogMsy5opW59FEFgZkbDh mZtREMRAqmCFFp9ZsZkXZEYarcqak9chBG9ox0+YO8M1XOkkcUSy6Om3Y0Ba4ltntchZ te67qVUG3P2Z1LjaEDKSwb8drtXQ3dYluGF7LaGtATbhESfYuj0huUVTLDpxKW/SVACj +0I2SpgnbTHvRwvlfiNistaI8/MQVychQaoNC4m1QDtf0pSe4B9fKTNzqwy9n33yk/2Q k6GA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IM2hdUYB; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-184170-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184170-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43df56d45e7si49761181cf.675.2024.05.20.13.43.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 13:43:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184170-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=@chromium.org header.s=google header.b=IM2hdUYB; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-184170-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184170-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org 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 7E4ED1C20F32 for ; Mon, 20 May 2024 20:43:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 643FE13A89B; Mon, 20 May 2024 20:42:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="IM2hdUYB" Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 441C813A405 for ; Mon, 20 May 2024 20:42:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716237721; cv=none; b=r/rPxMnTtC/cR+ajsZfzN6fmP1NFE7rRnieS4SZFRiCxeLP8zeaIGyAOZOQx8MFySFOAv4WwUGDVmsR9RTLaail4lCM5YTe/PZw4nVlI7Spm9lCU3oYhwzMew6qaP0FnWWgNqHpKEHGa8LjkgMTv59s+Zlr2DeTv6hCiG+1vVt0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716237721; c=relaxed/simple; bh=KH7KLt1vLHj8lAyyx8nEvtd9Ch2hZ4E0zERhgbKhEpo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rZpqxKf8ELIDJpOr0vB6e0Hk4We+dW3vQavvqTr5UY0P/WTlaNPGd+7m8VGu5wavyuQOp/UlYA/ZT7Au7aVmLHBIy0Linu/oL7izSDhSYlrHNj0xjSLQ2C9F2TYjgKi2Vp4iINTEHQ3xRHAXnMpflw0dv4wVqEFqWacJRLVNNqU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=IM2hdUYB; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1ee954e0aa6so57424545ad.3 for ; Mon, 20 May 2024 13:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716237719; x=1716842519; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EAPtcTBq5rQklg7My1+KHMw3K3I6I7ZSFTklmvsLyz8=; b=IM2hdUYB3iWRPBR7kgABs1XQxgueTzVDUdNmzbFAYE7m7OZAFVOcUSoDbrAA7yTqM7 zc+c5geP7Q/Cj6TKfe9YOtcrYCsOq7d2oOLKxxnvp6yA7q3WPjdeEKAJGsKVKiGcsRmk Waoz7RNRxB/ZWK654A1OXFr8jYXHTxHLnmiNE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716237719; x=1716842519; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EAPtcTBq5rQklg7My1+KHMw3K3I6I7ZSFTklmvsLyz8=; b=tFR8gPZcJjgbdyKAf9OYubrSs4t7tHNrnBLmuGRpoZ98WHVDVug6/m72zpw0xNUEpC hB6frkevD+GUxkHMjqmurbXCcazYaTz+hwdbO9NtSfAQEKKVWZYvZVMJYhzhUz45DRSR JKS04gTvfIs0vN9MbxZSemeqkGSFL1G0pUZGl+TYcKageURTwH1wL4v+OdsDKAzuidu3 M1RLqQs894fO785H1cTGkpzrWLFD5xVd6n9oEmMk8c1XWmiUDwy273UuxZuUZg8WoOyO FPxnLCVD8FUVQSYJxAwKxgEupS94+YbKaVbhljSxNHnup2fDFoahEJEXNINb9IEhgZwY n/mQ== X-Forwarded-Encrypted: i=1; AJvYcCWWPjPNvevAbtyPwrgQiNlxWGwn2MkxMw3/wsS08vsWmQ8S5ZFelFD//L3dbOcagC32rMntc7PdingXZCiwSvcEP2dwWN8mGbh5hWpD X-Gm-Message-State: AOJu0Yxx02H5Ok1G4fid0CRHEOg+Cion9i7kaTOdJF1SWSAK08PREoqU 9B3F+NYeau/iLBhGsb8LlW4/tynWPkFgNc2ZGa5SfF5zPMTshY0ai8Ky1CXeYQ== X-Received: by 2002:a17:902:64d6:b0:1e4:5b89:dbfa with SMTP id d9443c01a7336-1f065fde55bmr228544205ad.41.1716237719595; Mon, 20 May 2024 13:41:59 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:cd20:112a:72ca:4425]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0bbde9d7sm213068255ad.106.2024.05.20.13.41.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 13:41:58 -0700 (PDT) From: Douglas Anderson To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Hayes Wang Cc: danielgeorgem@google.com, Douglas Anderson , Andrew Lunn , Grant Grundler , Heiner Kallweit , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH net-next 2/2] r8152: Wake up the system if the we need a reset Date: Mon, 20 May 2024 13:41:12 -0700 Message-ID: <20240520134108.net-next.2.Ic039534f7590752a2c403de4ac452e3cb72072f4@changeid> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog In-Reply-To: <20240520134108.net-next.1.Ibeda5c0772812ce18953150da5a0888d2d875150@changeid> References: <20240520134108.net-next.1.Ibeda5c0772812ce18953150da5a0888d2d875150@changeid> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit If we get to the end of the r8152's suspend() routine and we find that the USB device is INACCESSIBLE then it means that some of our preparation for suspend didn't take place. We need a USB reset to get ourselves back in a consistent state so we can try again and that can't happen during system suspend. Call pm_wakeup_event() to wake the system up in this case. Signed-off-by: Douglas Anderson --- drivers/net/usb/r8152.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 6a3f4b2114ee..09fe70bc45d4 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -8647,6 +8647,13 @@ static int rtl8152_system_suspend(struct r8152 *tp) tasklet_enable(&tp->tx_tl); } + /* If we're inaccessible here then some of the work that we did to + * get the adapter ready for suspend didn't work. Queue up a wakeup + * event so we can try again. + */ + if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + pm_wakeup_event(&tp->udev->dev, 0); + return 0; } -- 2.45.0.rc1.225.g2a3ae87e7f-goog