From: Sean Anderson <sean.anderson@seco.com>
To: u-boot@lists.denx.de, Lukasz Majewski <lukma@denx.de>
Cc: Maxime Ripard <maxime@cerno.tech>, Jun Li <jun.li@nxp.com>,
Andre Przywara <andre.przywara@arm.com>,
Jagan Teki <jagan@amarulasolutions.com>,
Marek Vasut <marex@denx.de>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Ye Li <ye.li@nxp.com>, Peng Fan <peng.fan@nxp.com>,
Bryan O'Donoghue <pure.logic@nexus-software.ie>,
Sean Anderson <sean.anderson@seco.com>
Subject: [PATCH 3/4] usb: f_mass_storage: Drop wakeup_needed
Date: Thu, 8 Jul 2021 13:14:22 -0400 [thread overview]
Message-ID: <20210708171424.970928-3-sean.anderson@seco.com> (raw)
In-Reply-To: <20210708171424.970928-1-sean.anderson@seco.com>
Now that we check bh->state in sleep_thread, there is no need to have a
separate wakeup_needed flag. Drop it.
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---
drivers/usb/gadget/f_mass_storage.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 99935fe9a3..190053590f 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -328,7 +328,6 @@ struct fsg_common {
unsigned int bad_lun_okay:1;
unsigned int running:1;
- int thread_wakeup_needed;
struct completion thread_notifier;
struct task_struct *thread_task;
@@ -455,12 +454,6 @@ static int fsg_set_halt(struct fsg_dev *fsg, struct usb_ep *ep)
/* These routines may be called in process context or in_irq */
-/* Caller must hold fsg->lock */
-static void wakeup_thread(struct fsg_common *common)
-{
- common->thread_wakeup_needed = 1;
-}
-
static void raise_exception(struct fsg_common *common, enum fsg_state new_state)
{
/* Do nothing if a higher-priority exception is already in progress.
@@ -469,7 +462,6 @@ static void raise_exception(struct fsg_common *common, enum fsg_state new_state)
if (common->state <= new_state) {
common->exception_req_tag = common->ep0_req_tag;
common->state = new_state;
- common->thread_wakeup_needed = 1;
}
}
@@ -508,7 +500,6 @@ static void bulk_in_complete(struct usb_ep *ep, struct usb_request *req)
/* Hold the lock while we update the request and buffer states */
bh->inreq_busy = 0;
bh->state = BUF_STATE_EMPTY;
- wakeup_thread(common);
}
static void bulk_out_complete(struct usb_ep *ep, struct usb_request *req)
@@ -527,7 +518,6 @@ static void bulk_out_complete(struct usb_ep *ep, struct usb_request *req)
/* Hold the lock while we update the request and buffer states */
bh->outreq_busy = 0;
bh->state = BUF_STATE_FULL;
- wakeup_thread(common);
}
/*-------------------------------------------------------------------------*/
@@ -2271,7 +2261,6 @@ static void handle_exception(struct fsg_common *common)
struct fsg_lun *curlun;
unsigned int exception_req_tag;
- common->thread_wakeup_needed = 0;
/* Cancel all the pending transfers */
if (common->fsg) {
for (i = 0; i < FSG_NUM_BUFFERS; ++i) {
--
2.25.1
next prev parent reply other threads:[~2021-07-08 17:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-08 17:14 [PATCH 1/4] cmd: usb_mass_storage: Use part_get_info_by_dev_and_name_or_num Sean Anderson
2021-07-08 17:14 ` [PATCH 2/4] usb: f_mass_storage: Check bh->state in sleep_thread Sean Anderson
2021-07-08 17:14 ` Sean Anderson [this message]
2021-07-08 17:14 ` [PATCH 4/4] usb: f_mass_storage: Stop after the host deconfigures us Sean Anderson
2021-07-08 17:23 ` [PATCH 1/4] cmd: usb_mass_storage: Use part_get_info_by_dev_and_name_or_num Marek Vasut
2021-07-08 17:26 ` Sean Anderson
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=20210708171424.970928-3-sean.anderson@seco.com \
--to=sean.anderson@seco.com \
--cc=andre.przywara@arm.com \
--cc=jagan@amarulasolutions.com \
--cc=jun.li@nxp.com \
--cc=lukma@denx.de \
--cc=m.szyprowski@samsung.com \
--cc=marex@denx.de \
--cc=maxime@cerno.tech \
--cc=peng.fan@nxp.com \
--cc=pure.logic@nexus-software.ie \
--cc=u-boot@lists.denx.de \
--cc=ye.li@nxp.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.