Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp123783lqh; Thu, 30 May 2024 16:44:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVO0jo/KtcAgAKcJIIXepLHZLHuu0nZMl1k9jCZJWV7qgKEYAcJlz4XJtMn+GuFLMyZtsWXv81FLTuzwTWVCMmqSRG7NIyjlATIGDkiVA== X-Google-Smtp-Source: AGHT+IHtkGTePbrlAU395AwD+ImoP2LUK4Lkad9zVuK4IMOOskI2IxqLL9HbdXzIqu1Zw3tuIZBg X-Received: by 2002:a05:620a:1473:b0:794:ad5e:c02a with SMTP id af79cd13be357-794f5ccc8bfmr18751385a.47.1717112648034; Thu, 30 May 2024 16:44:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717112648; cv=pass; d=google.com; s=arc-20160816; b=bPiT7CshPddK7E3FL52G0+E6Iy16IvfAcJErPpkkXiYaQB0RxZOUcruYlLLIBSyXMf rkfMhJpdcjI/r7QlVnCKoXs4eKt1FxjRQGthVaHeCVKucVlmLkfsXorv+z8veFA/CPwh AMRHfR5LZr+E8MzS7z5+icgbsrw1TIy0x9L205JKf5FsIHoE5srd7YwIK6cdMir5qNCE 00OrDg5VhShlYDFuvGWnepHVB0NtTe71P7BUcm0gs6O0bztR9csNYvkG8IXFRdkXXkie 8dBFa+Hh7xgkrpE93FqaKxjggNSQWTtz6/Q9OqhDeCJIkamDXXA6VMdmh1aOQRx12slO A+4A== 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:date :subject:cc:to:from:message-id:dkim-signature; bh=o9pq2FYeJqKIzHZBODKgIJ4xCnulDhV4vBp41eJFOEo=; fh=vfh+EvvmZjnpqWixcD+V+bMPYGgW7+WGGHQTHu3slYw=; b=RGcQ67VTTpUtJKYPwdHSCanqEEkNzyDopct3E/L2sPDtByldK7DLk/ms2wM6I0DVAK gONIdtardPEeZFm1KiX+US/u0GF+6Jt8bvJhQUg4qaLBBeh7jTtruqGIGckWC5j3nTii e2YZPGHYKHippyWAIn1i/rPB/G1PkI+QIls2AZGhZ80Qyd3GM9QGBRPixKu4aopsWW23 Ce/o8qYMpJ1RLlxjOSk/hfDCif8AO1VlL8nMvga7CZQF0WJvUuQAWfqMVIBv5IW0HXPI BTQx6y22kQAV78owCnp59BfVpDEmguRPM7IdLObMyIdsoFXRusMEXQmN1Srwk0VnXzYK o0dQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HgqsFLjB; 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-196041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196041-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 af79cd13be357-794f318435asi71116385a.467.2024.05.30.16.44.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 16:44:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196041-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=HgqsFLjB; 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-196041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196041-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 BBBF31C21859 for ; Thu, 30 May 2024 23:44:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0AA6186E2F; Thu, 30 May 2024 23:43:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="HgqsFLjB" Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 B3CD4183A75 for ; Thu, 30 May 2024 23:43:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717112616; cv=none; b=LHxME+0Zvu9g0tX2Ezevzd/wv7AXl+RKbRP8huXu5bu7ScojHjkkyfi6y5QkucIvw0oW/sYyqLk2w7S6lTt08IAsLpqw55EfWYrKzm6otMSfkiYv8csbnNkXlvvn8VMUerEWzLJv9dNp4gyCshwbyUsTthW/TFS024rXdEfZ4lg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717112616; c=relaxed/simple; bh=ltzXXLPD/ETo7voCPkE9iyg3r3LgEMh7nkLmfXKk4pY=; h=Message-ID:From:To:Cc:Subject:Date:In-Reply-To:References: MIME-Version; b=kvc66TKIjDrE/ee0ezR0U6OCI3J4Mxq7lT/lwxonpI87flKoRmvFxO9ilf/tIy3WWfv+rlcdHHUs32fDQGux2toTITBamfBJlCVamPpFqmzPMj0ycs2TKlSJ7uuIUYaLpEnwcxTgiRi4lDkJUOb0HAU0x5ez9LZbV0+zza9ddFY= 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=HgqsFLjB; arc=none smtp.client-ip=209.85.214.176 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-f176.google.com with SMTP id d9443c01a7336-1f48bd643a0so10892955ad.3 for ; Thu, 30 May 2024 16:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1717112614; x=1717717414; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to:date :subject:cc:to:from:message-id:from:to:cc:subject:date:message-id :reply-to; bh=o9pq2FYeJqKIzHZBODKgIJ4xCnulDhV4vBp41eJFOEo=; b=HgqsFLjBLfpvUEnQTNUmKyaS7rN6Vmhuc+ZPw92tpXqE016O/4K4zX/BggFkLPT3v7 Wk1iVPK+KrdsfE8DlfOmdILIeBpjPCj9fjoxExvAJ0O4GjKEWhCxuYn9rEWZ8Iz5l+lK aHZFqWPTYjgkSSV6i9kH8TH8L9gcvGSMg4+ZE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717112614; x=1717717414; h=content-transfer-encoding:mime-version:references:in-reply-to:date :subject:cc:to:from:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=o9pq2FYeJqKIzHZBODKgIJ4xCnulDhV4vBp41eJFOEo=; b=WEzHeluOg2xHc43pZoCqHDa8ejZ/OeXtpxour76lLCgThgVeKIhhyiV6h0iOryGi7X yiZWij4DSr8wwPbVk0emNlVV0ZDrBftr2KxESs8OJDsmtuIXdaD58y7fK0FWbvRfZFyD QcfRRZbgzXBFKpjOA6Rv2u4KzRXcn9pcz3jjhd+FdLLCl/Q1vdZo6BVeHEOwSu3y6qfZ O6qh8lRiDQ38Q315kAHd4pyJwOvE8WHnhlwtKZ2EtG1Zo/3PmYXmoc9STC0tzMZ9WJHn sm9VO7bsnSkQeovXtEERQGV01oBDkJYOmyS0ALCBmerN9VewtcZ+eFBiBK/wv8eOmQES jxKA== X-Forwarded-Encrypted: i=1; AJvYcCX8n7xBBk6ZaW9ecyftOGhFDwb1zvNT/N/3brJfl0b9DcNZoJ9Fl5a5F33lSk1IT+xx/4Q7unr8b30Ozq3V9eRUwM+h6TmC8P+92bvE X-Gm-Message-State: AOJu0Yy8ldsOwV4cXsf7XGxeXNKjX04DHjphIWIUEYsL6LzYuO+IKgux IqZcnJGO6DKf45C0/pIOrEqP1Z65+Jpw0bJD8G5IpZn8c5qIgF8EvRS50AcTcw== X-Received: by 2002:a17:902:e5d0:b0:1f6:d4b:350c with SMTP id d9443c01a7336-1f6370ba643mr3254985ad.56.1717112613789; Thu, 30 May 2024 16:43:33 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:564b:72b6:4827:cf6a]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f632416d90sm3459275ad.285.2024.05.30.16.43.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 16:43:33 -0700 (PDT) Message-ID: <66590f25.170a0220.8b5ad.1752@mx.google.com> X-Google-Original-Message-ID: <20240530164304.REPOST net-next.2.Ic039534f7590752a2c403de4ac452e3cb72072f4@changeid> 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 REPOST net-next 2/2] r8152: Wake up the system if the we need a reset Date: Thu, 30 May 2024 16:43:09 -0700 X-Mailer: git-send-email 2.45.1.288.g0e0cd299f1-goog In-Reply-To: <20240530164304.REPOST net-next.1.Ibeda5c0772812ce18953150da5a0888d2d875150@changeid> References: <20240530164304.REPOST 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.1.288.g0e0cd299f1-goog