linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: IgorMitsyanko <igor.mitsyanko.os@quantenna.com>,
	linux-wireless@vger.kernel.org
Cc: btherthala@quantenna.com, hwang@quantenna.com,
	smaksimenko@quantenna.com, dlebed@quantenna.com,
	Sergey Matyukevich <smatyukevich@quantenna.com>,
	Kamlesh Rath <krath@quantenna.com>,
	Avinash Patil <avinashp@quantenna.com>
Subject: Re: [PATCH V3] qtnfmac: announcement of new FullMAC driver for Quantenna chipsets
Date: Thu, 17 Nov 2016 08:54:46 +0100	[thread overview]
Message-ID: <1479369286.1463.3.camel@sipsolutions.net> (raw)
In-Reply-To: <301c5abc-d28d-41dd-c7d6-4a7d7ec3681c@quantenna.com>


> > > +static int qtnf_pcie_init_shm_ipc(struct qtnf_pcie_bus_priv
> > > *priv)
> > > +{
> > > +	struct qtnf_shm_ipc_region __iomem *ipc_tx_reg;
> > > +	struct qtnf_shm_ipc_region __iomem *ipc_rx_reg;
> > > +	const struct qtnf_shm_ipc_int ipc_int = {
> > qtnf_ipc_gen_ep_int, priv };
> > > 
> > > +	const struct qtnf_shm_ipc_rx_callback rx_callback = {
> > > +					qtnf_pcie_control_rx_cal
> > > lbac
> > k, priv };
> > 
> > If those are const, why not also static? In fact, it seems they
> > really
> > should be, since they're registered below?
> 
> Later qtnf_shm_ipc_init() will make a full copy of rx_callback (which
> actually only contains two pointers), it does not expect it to have 
> static time of live, so no point in statically allocating it.

Ok. Nevertheless, marking it static might reduce binary size - as right
now there are two options for the compiler
 1) emit a static variable anyway since it's const - no changes then
 2) actually put it on the stack
    a) from a static variable - extra memcpy()
    b) initialised by code - extra initialisation code

Anyway, it doesn't really matter, just seemed strange to me :)

> The idea we used for flow synchronization is that all commands/events
> processing is serialized with RTNL mutex. Not very smart approach,
> but simple and in fact can be enough (there are not too much 
> commands/notifications going on anyway). In the future it is possible
> to move to a more fine-grained locking.

Using the rtnl is probably fine, you've offloaded most things so can't
really expect much to happen on the host. You still might have problems
though - if you get a notification that the device disconnected, while
cfg80211 is already holding the RTNL to disconnect itself, the firmware
would think it's disconnected, the driver wouldn't have processed that
notification yet, and would try to disconnect.

That's just one possible race that we found in the past, and it needs
to be handled in the firmware anyway (basically: don't do anything bad
if asked to disconnect while not connected). :)

johannes

  reply	other threads:[~2016-11-17  7:54 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1478700000-11624-1-git-send-email-igor.mitsyanko.os@quantenna.com>
2016-11-09 14:00 ` [PATCH V3] qtnfmac: announcement of new FullMAC driver for Quantenna chipsets igor.mitsyanko.os
2016-11-14  9:52   ` Johannes Berg
     [not found]     ` <62102ba6-cae0-f00d-f989-3f2e9ea43d9b@quantenna.com>
2016-11-16 16:50       ` IgorMitsyanko
2016-11-17  8:51         ` Johannes Berg
2016-11-15  9:06   ` Johannes Berg
2016-11-16 16:47     ` IgorMitsyanko
2016-11-17  7:54       ` Johannes Berg [this message]
2016-11-09 15:56 ` [RFC] qtn: add FullMAC firmware for Quantenna QSR10G wifi device Johannes Berg
     [not found]   ` <2fcb5f28-808e-f296-7e91-e5185e7577c9@quantenna.com>
2016-11-09 21:05     ` Johannes Berg
2016-11-10 14:02       ` IgorMitsyanko
2016-11-11 11:35         ` Johannes Berg
2016-11-14  8:26           ` IgorMitsyanko
2016-11-14  9:40             ` Johannes Berg
2016-11-23 15:25             ` Kalle Valo
2016-11-23 16:45               ` igor.mitsyanko.os
2016-11-23 17:09               ` IgorMitsyanko
2016-11-24 11:59                 ` Kalle Valo
2016-11-25 10:16                   ` IgorMitsyanko
2016-12-23 15:12               ` igor.mitsyanko.os
2016-12-23 17:47                 ` Christian Lamparter
2016-11-22 14:44           ` IgorMitsyanko
2016-11-28 16:34             ` Kyle McMartin
2016-11-28 17:10               ` Oleksij Rempel
2016-11-28 17:33                 ` Oleksij Rempel
2016-11-28 19:01                   ` IgorMitsyanko
2016-11-29  3:49                     ` Oleksij Rempel
2016-11-29  9:10                       ` IgorMitsyanko
2016-11-29  9:34                         ` Arend Van Spriel
2016-11-29 10:22                           ` IgorMitsyanko
2016-11-28 22:07               ` IgorMitsyanko

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=1479369286.1463.3.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=avinashp@quantenna.com \
    --cc=btherthala@quantenna.com \
    --cc=dlebed@quantenna.com \
    --cc=hwang@quantenna.com \
    --cc=igor.mitsyanko.os@quantenna.com \
    --cc=krath@quantenna.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=smaksimenko@quantenna.com \
    --cc=smatyukevich@quantenna.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).