All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Kaiser <martin@kaiser.cx>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	Phillip Potter <phil@philpotter.co.uk>,
	Michael Straube <straube.linux@gmail.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH v2 7/8] staging: r8188eu: remove the bInSuspend loop
Date: Wed, 13 Apr 2022 21:36:53 +0200	[thread overview]
Message-ID: <20220413193654.258507-8-martin@kaiser.cx> (raw)
In-Reply-To: <20220413193654.258507-1-martin@kaiser.cx>

Remove the loop in rtw_pwr_wakeup that waits while the system is
suspended.

pwrpriv->bInSuspend is set in rtw_suspend and cleared in rtw_resume. These
functions are the .suspend and .resume functions of the struct usb_driver
for r8188eu.

A usb_driver's suspend and resume functions are called when the entire
system goes into suspend or runtime suspend.

All of the code paths for rtw_pwr_wakeup start at ioctl handlers.

We can remove the loop that checks bInSuspend. It's not possible to call
an ioctl while the entire system is suspended.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---

I tried to track down who calls suspend and resume of an usb_driver. My
understanding is that all of these calls come from the pm layer and that
the suspend and resume affect the whole system, not just the usb device.

 drivers/staging/r8188eu/core/rtw_pwrctrl.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_pwrctrl.c b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
index 605210d89f32..6990808ef353 100644
--- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c
+++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
@@ -379,10 +379,6 @@ int rtw_pwr_wakeup(struct adapter *padapter)
 	while (pwrpriv->ps_processing && time_before(jiffies, timeout))
 		msleep(10);
 
-	/* System suspend is not allowed to wakeup */
-	while (pwrpriv->bInSuspend && time_before(jiffies, timeout))
-		msleep(10);
-
 	/* I think this should be check in IPS, LPS, autosuspend functions... */
 	if (check_fwstate(pmlmepriv, _FW_LINKED)) {
 		ret = _SUCCESS;
-- 
2.30.2


  parent reply	other threads:[~2022-04-13 19:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-09 15:15 [PATCH 0/8] staging: r8188eu: clean up rtw_pwr_wakeup Martin Kaiser
2022-04-09 15:15 ` [PATCH 1/8] staging: r8188eu: simplify delay conditions in rtw_pwr_wakeup Martin Kaiser
2022-04-09 15:15 ` [PATCH 2/8] staging: r8188eu: don't set _SUCCESS again Martin Kaiser
2022-04-11 10:18   ` Dan Carpenter
2022-04-11 18:39     ` Martin Kaiser
2022-04-12  5:12       ` Dan Carpenter
2022-04-12 13:38       ` Greg Kroah-Hartman
2022-04-09 15:15 ` [PATCH 3/8] staging: r8188eu: make return values consistent Martin Kaiser
2022-04-09 15:15 ` [PATCH 4/8] staging: r8188eu: simplify the ps_processing check Martin Kaiser
2022-04-09 15:15 ` [PATCH 5/8] staging: r8188eu: summarize two if statements Martin Kaiser
2022-04-09 15:15 ` [PATCH 6/8] staging: r8188eu: use kernel functions for timeout handling Martin Kaiser
2022-04-09 15:15 ` [PATCH 7/8] staging: r8188eu: clean up the code to set ips_deny_time Martin Kaiser
2022-04-09 15:15 ` [PATCH 8/8] staging: r8188eu: remove the bInSuspend loop Martin Kaiser
2022-04-13 19:36 ` [PATCH v2 0/8] staging: r8188eu: clean up rtw_pwr_wakeup Martin Kaiser
2022-04-13 19:36   ` [PATCH v2 1/8] staging: r8188eu: simplify delay conditions in rtw_pwr_wakeup Martin Kaiser
2022-04-13 19:36   ` [PATCH v2 2/8] staging: r8188eu: make return values consistent Martin Kaiser
2022-04-13 19:36   ` [PATCH v2 3/8] staging: r8188eu: simplify the ps_processing check Martin Kaiser
2022-04-13 19:36   ` [PATCH v2 4/8] staging: r8188eu: summarize two if statements Martin Kaiser
2022-04-13 19:36   ` [PATCH v2 5/8] staging: r8188eu: use kernel functions for timeout handling Martin Kaiser
2022-04-13 19:36   ` [PATCH v2 6/8] staging: r8188eu: clean up the code to set ips_deny_time Martin Kaiser
2022-04-13 19:36   ` Martin Kaiser [this message]
2022-04-13 19:36   ` [PATCH v2 8/8] staging: r8188eu: remove unused timer functions Martin Kaiser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220413193654.258507-8-martin@kaiser.cx \
    --to=martin@kaiser.cx \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=phil@philpotter.co.uk \
    --cc=straube.linux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.