From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Xinming Hu <huxm@marvell.com>
Cc: Amitkumar Karwar <akarwar@marvell.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
Cathy Luo <cluo@marvell.com>,
Nishant Sarmukadam <nishants@marvell.com>,
"rajatja@google.com" <rajatja@google.com>,
"briannorris@google.com" <briannorris@google.com>
Subject: Re: [PATCH v2 2/5] mwifiex: use spinlock for 'mwifiex_processing' in shutdown_drv
Date: Thu, 3 Nov 2016 09:15:04 -0700 [thread overview]
Message-ID: <20161103161504.GA15366@dtor-ws> (raw)
In-Reply-To: <b9fed0716cfb46818b0a93a925e5d37a@SC-EXCH02.marvell.com>
On Thu, Nov 03, 2016 at 08:34:06AM +0000, Xinming Hu wrote:
> Hi Dmitry,
>
> > -----Original Message-----
> > From: linux-wireless-owner@vger.kernel.org
> > [mailto:linux-wireless-owner@vger.kernel.org] On Behalf Of Dmitry Torokhov
> > Sent: 2016年10月28日 1:44
> > To: Amitkumar Karwar
> > Cc: linux-wireless@vger.kernel.org; Cathy Luo; Nishant Sarmukadam;
> > rajatja@google.com; briannorris@google.com
> > Subject: Re: [PATCH v2 2/5] mwifiex: use spinlock for 'mwifiex_processing' in
> > shutdown_drv
> >
> > Hi Amit,
> >
> > On Thu, Oct 27, 2016 at 02:42:40PM +0530, Amitkumar Karwar wrote:
> > > This variable is guarded by spinlock at all other places. This patch
> > > takes care of missing spinlock usage in mwifiex_shutdown_drv().
> >
> > Since in the previous discussion you stated that we inhibit interrupts and flush
> > the workqueue so that mwifiex_shutdown_drv() can't run simultaneously with
> > the main processing routine, why do we need this?
> >
> > Instead please remove call to mwifiex_shutdown_drv() in the main routine
> > and "if (adapter->mwifiex_processing)" check here.
> >
>
> mwifiex_main_process will be used from interrupt or workqueue.
> Now we have disabled interrupt and flush workqueue, so mwifiex_main_process won't be scheduled in the future.
> But mwifiex_main_process might just running in context of last interrupt, so we need wait current main_process complete in mwifiex_shutdown_drv.
synchronize_irq() is your friend then.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2016-11-03 16:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-27 9:12 [PATCH v2 1/5] mwifiex: remove redundant condition in main process Amitkumar Karwar
2016-10-27 9:12 ` [PATCH v2 2/5] mwifiex: use spinlock for 'mwifiex_processing' in shutdown_drv Amitkumar Karwar
2016-10-27 17:44 ` Dmitry Torokhov
2016-11-03 8:34 ` Xinming Hu
2016-11-03 16:15 ` Dmitry Torokhov [this message]
2016-11-03 18:27 ` Brian Norris
2016-11-03 18:48 ` Dmitry Torokhov
2016-11-04 3:02 ` Xinming Hu
2016-10-27 9:12 ` [PATCH v2 3/5] mwifiex: do not free firmware dump memory " Amitkumar Karwar
2016-10-27 9:12 ` [PATCH v2 4/5] mwifiex: get rid of drv_info* adapter variables Amitkumar Karwar
2016-10-27 9:12 ` [PATCH v2 5/5] mwifiex: wait firmware dump complete during card remove process Amitkumar Karwar
2016-10-27 18:48 ` Brian Norris
2016-11-16 15:27 ` Amitkumar Karwar
2016-10-27 18:35 ` [PATCH v2 1/5] mwifiex: remove redundant condition in main process Brian Norris
2016-11-03 8:04 ` Xinming Hu
2016-11-07 18:46 ` Kalle Valo
2016-11-10 19:46 ` Brian Norris
2016-11-16 13:08 ` Amitkumar Karwar
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=20161103161504.GA15366@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=akarwar@marvell.com \
--cc=briannorris@google.com \
--cc=cluo@marvell.com \
--cc=huxm@marvell.com \
--cc=linux-wireless@vger.kernel.org \
--cc=nishants@marvell.com \
--cc=rajatja@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).