All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amitkumar Karwar <akarwar@marvell.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Brian Norris <briannorris@chromium.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	Cathy Luo <cluo@marvell.com>,
	"Nishant Sarmukadam" <nishants@marvell.com>
Subject: RE: [PATCH 2/5] mwifiex: use spinlock for 'mwifiex_processing' in shutdown_drv
Date: Wed, 26 Oct 2016 16:59:17 +0000	[thread overview]
Message-ID: <206625aa34dc499a9e6769287571127f@SC-EXCH04.marvell.com> (raw)
In-Reply-To: <20161026163607.GA3989@dtor-ws>

Hi Dmitry,

> From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
> Sent: Wednesday, October 26, 2016 10:06 PM
> To: Amitkumar Karwar
> Cc: Brian Norris; linux-wireless@vger.kernel.org; Cathy Luo; Nishant
> Sarmukadam
> Subject: Re: [PATCH 2/5] mwifiex: use spinlock for 'mwifiex_processing'
> in shutdown_drv
> 
> Hi Amit,
> 
> On Wed, Oct 26, 2016 at 03:23:08PM +0000, Amitkumar Karwar wrote:
> >
> > This race won't occur. At this point of time(i.e while calling
> mwifiex_shutdown_drv() in deinit), following things are completed. We
> don't expect mwifiex_main_process() to be scheduled.
> > 1) Connection to peer device is terminated at the beginning of
> teardown thread. So we don't receive any Tx data from kernel.
> > 2) Last command SHUTDOWN is exchanged with firmware. So there won't be
> any activity/interrupt from firmware.
> > 3) Interrupts are disabled.
> > 4) "adapter->surprise_removed" flag is set. It will skip
> mwifiex_main_process() calls.
> >
> > -----------
> > static void mwifiex_main_work_queue(struct work_struct *work) {
> >         struct mwifiex_adapter *adapter =
> >                 container_of(work, struct mwifiex_adapter, main_work);
> >
> >         if (adapter->surprise_removed)
> >                 return;
> >         mwifiex_main_process(adapter); }
> > ----------
> > 5) We have "mwifiex_terminate_workqueue(adapter)" call to flush and
> destroy workqueue.
> 
> OK, but if interrupts are disabled and you ensure that work is flushed
> or completed before you call mwifiex_shutdown_drv() then I do not
> understand why you need all of this at all? Why do you need to check
> status in mwifiex_shutdown_drv() and why do you want
> mwifiex_main_process() to call mwifiex_shutdown_drv() in certain cases?
> Can you simply remove all this stuff?
> 

I agree. This code is there for long time. I will prepare a patch for this cleanup work.

Regards,
Amitkumar

  reply	other threads:[~2016-10-26 16:59 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24 14:21 [PATCH 1/5] mwifiex: remove redundant condition in main process Amitkumar Karwar
2016-10-24 14:21 ` [PATCH 2/5] mwifiex: use spinlock for 'mwifiex_processing' in shutdown_drv Amitkumar Karwar
2016-10-24 19:19   ` Brian Norris
2016-10-24 23:57     ` Dmitry Torokhov
2016-10-25 16:11       ` Amitkumar Karwar
2016-10-25 16:35         ` Dmitry Torokhov
2016-10-26 15:23           ` Amitkumar Karwar
2016-10-26 16:36             ` Dmitry Torokhov
2016-10-26 16:59               ` Amitkumar Karwar [this message]
2016-10-24 23:47   ` Dmitry Torokhov
2016-10-24 23:55     ` Brian Norris
2016-10-25 16:00       ` Amitkumar Karwar
2016-10-24 14:21 ` [PATCH 3/5] mwifiex: do not free firmware dump memory " Amitkumar Karwar
2016-10-24 19:41   ` Brian Norris
2016-10-25  0:17   ` Dmitry Torokhov
2016-10-25 16:23     ` Amitkumar Karwar
2016-10-24 14:21 ` [PATCH 4/5] mwifiex: firmware dump code rearrangement in pcie.c Amitkumar Karwar
2016-10-24 14:21 ` [PATCH 5/5] mwifiex: wait for firmware dump completion in remove_card Amitkumar Karwar
2016-10-24 20:23   ` Brian Norris
2016-10-25 16:30     ` Amitkumar Karwar
2016-10-25  0:14   ` Dmitry Torokhov
2016-10-25 16:20     ` Amitkumar Karwar
2016-10-27 13:20     ` Kalle Valo
2016-11-02 20:45       ` Brian Norris
2016-11-09 12:35         ` Amitkumar Karwar
2016-11-09 20:37           ` Brian Norris
2016-11-10 10:01             ` Amitkumar Karwar
2016-11-16 13:07             ` Amitkumar Karwar
2016-11-16 18:58               ` Brian Norris
2016-10-24 17:43 ` [PATCH 1/5] mwifiex: remove redundant condition in main process Brian Norris

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=206625aa34dc499a9e6769287571127f@SC-EXCH04.marvell.com \
    --to=akarwar@marvell.com \
    --cc=briannorris@chromium.org \
    --cc=cluo@marvell.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nishants@marvell.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.