linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Amitkumar Karwar <akarwar@marvell.com>
Cc: Kalle Valo <kvalo@codeaurora.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	Cathy Luo <cluo@marvell.com>,
	Nishant Sarmukadam <nishants@marvell.com>,
	Xinming Hu <huxm@marvell.com>
Subject: Re: [PATCH 5/5] mwifiex: wait for firmware dump completion in remove_card
Date: Wed, 9 Nov 2016 12:37:11 -0800	[thread overview]
Message-ID: <20161109203710.GA118631@google.com> (raw)
In-Reply-To: <271acd7f41694b09be6f4ad82846782a@SC-EXCH04.marvell.com>

On Wed, Nov 09, 2016 at 12:35:22PM +0000, Amitkumar Karwar wrote:
> Hi Brian,

Hi,

> > From: Brian Norris [mailto:briannorris@chromium.org]
> > Sent: Thursday, November 03, 2016 2:16 AM
> > To: Kalle Valo
> > Cc: Dmitry Torokhov; Amitkumar Karwar; linux-wireless@vger.kernel.org;
> > Cathy Luo; Nishant Sarmukadam; Xinming Hu
> > Subject: Re: [PATCH 5/5] mwifiex: wait for firmware dump completion in
> > remove_card
> > 
> > On Thu, Oct 27, 2016 at 04:20:25PM +0300, Kalle Valo wrote:
> > > Dmitry Torokhov <dmitry.torokhov@gmail.com> writes:
> > >
> > > >> +/* reset_trigger variable is used to identify if
> > > >> +mwifiex_sdio_remove()
> > > >> + * is called by sdio_work during reset or the call is from sdio
> > subsystem.
> > > >> + * We will cancel sdio_work only if the call is from sdio
> > subsystem.
> > > >> + */
> > > >> +static u8 reset_triggered;
> > > >
> > > > It would be really great if the driver supported multiple devices.
> > > > IOW please avoid module-globals.
> > >
> > > Good catch, it's a hard requirement to support multiple devices at the
> > > same time.
> > 
> > BTW, this problem is repeated in several places throughout this driver.
> > For instance, look for 'user_rmmod' (why? you shouldn't need to treat
> > module unload differently...)
> 
> We have 2 kinds of teardown cases.
> 1) Chip is going to be powered off.
> 	a) System reboot
> 	b) Someone manually removed wifi card from system
> 2) User unloaded the driver.
> 
> In case 1. b), we can't have logic to terminate WIFI connection and
> download SHUTDOWN command to firmware, as hardware itself is not
> present.

That seems like a poor way of determining the difference between hot
unplug and clean shutdown. What if unplug happens concurrently with
rmmod? Seems like it'd be better to identify hardware failures as such,
and just skip talking to HW. Also, for interfaces that support unplug
well (like USB), shouldn't you be able to get hotplug info from the
driver core, instead of having to guess the inverse of that ("this was
not a hotplug") from static variables like that?

> This logic is useful when user just unloads and loads the driver.
> Firmware download will be skipped in this case, as it's already
> running. SHUTDOWN command sent during unload has cleared firmware's
> state. 

Why is that useful?

> 'user_rmmod' flag doesn't create problem for supporting multiple
> devices. The flag is true during module unload OR reboot. It's
> applicable for all devices.
> 
> > and the work structs (and corresponding
> > 'saved_adapter' and 'iface_flags') used for PCIe function-level reset
> > and SDIO reset.
> 
> We are working on the v3 of this patch series. We will try to get rid
> of these variables along with global "work_struct" as you suggested.

Good, thanks.

Brian

  reply	other threads:[~2016-11-09 20:37 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
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 [this message]
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=20161109203710.GA118631@google.com \
    --to=briannorris@chromium.org \
    --cc=akarwar@marvell.com \
    --cc=cluo@marvell.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=huxm@marvell.com \
    --cc=kvalo@codeaurora.org \
    --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 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).