All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Copeland <me@bobcopeland.com>
To: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCHv2 08/21] cw1200: wsm.*, implementation of device high-level interface.
Date: Thu, 26 Apr 2012 09:29:00 -0400	[thread overview]
Message-ID: <20120426132900.GA23011@localhost> (raw)
In-Reply-To: <1330720003-15866-9-git-send-email-dmitry.tarnyagin@stericsson.com>

On Fri, Mar 02, 2012 at 09:26:30PM +0100, Dmitry Tarnyagin wrote:
> WSM is a message interface between the host and the device.
> The patch defines and implements WSM abstraction layer.

Hi!

I just started reading through this driver and had a few comments/
questions; apologies in advance if they've been changed in more
recent versions.

> +void wsm_lock_tx(struct cw1200_common *priv)
> +{
> +	wsm_cmd_lock(priv);
> +	if (atomic_add_return(1, &priv->tx_lock) == 1) {
> +		if (wsm_flush_tx(priv))
> +			wsm_printk(KERN_DEBUG "[WSM] TX is locked.\n");
> +	}
> +	wsm_cmd_unlock(priv);
> +}

Can you explain how tx_lock works and how it's different from existing
locking primitives?  As a newcomer I find it surprising that two different
callers could call wsm_lock_tx{_async}() and neither of them would wait,
but maybe that's just a naming thing.

> +void wsm_buf_init(struct wsm_buf *buf)
> +{
> +	BUG_ON(buf->begin);
> +	buf->begin = kmalloc(SDIO_BLOCK_SIZE, GFP_KERNEL | GFP_DMA);

Does your platform really need GFP_DMA?  It's a no-op on many platforms
and on x86 it will restrict this to low 16 MB of physical memory.

> +	if (size & (SDIO_BLOCK_SIZE - 1)) {
> +		size &= SDIO_BLOCK_SIZE;
> +		size += SDIO_BLOCK_SIZE;
> +	}

This looks odd, should you use round_up(size, SDIO_BLOCK_SIZE) instead?
For example, if size = 2 * SDIO_BLOCK_SIZE + 1, it'll silently truncate
to SDIO_BLOCK_SIZE.  This code is in a couple of places.

-- 
Bob Copeland %% www.bobcopeland.com

  reply	other threads:[~2012-04-26 13:30 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <983b0e2d75af161b8e4dec02fc3497926a0080df-submit>
2012-03-02 20:26 ` [PATCHv2 00/21] cw1200: ST-Ericsson cw1200 wlan device driver Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 01/21] cw1200: cw1200.h, private driver data Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 02/21] cw1200: cw1200_plat.h, definition of the driver'ss platform data Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 03/21] cw1200: sbus.h, common device interface abstraction Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 04/21] cw1200: cw1200_sdio.c, implementation of SDIO wrapper for the driver Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 05/21] cw1200: hwio.*, device reg/mem map and low-level i/o primitives Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 06/21] cw1200: fwio.*, firmware downloading code for the cw1200 driver Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 07/21] cw1200: queue.*, implementation of TX queues of " Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 08/21] cw1200: wsm.*, implementation of device high-level interface Dmitry Tarnyagin
2012-04-26 13:29     ` Bob Copeland [this message]
2012-03-02 20:26   ` [PATCHv2 09/21] cw1200: txrx.*, implementation of datapath Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 10/21] cw1200: ht.h, small helper header with HT definitions Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 11/21] cw1200: bh.*, device serving thread Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 12/21] cw1200: sta.*, mac80211 STA callbacks Dmitry Tarnyagin
2012-04-29  3:49     ` Bob Copeland
2012-05-03  9:59       ` Dmitry Tarnyagin
2012-05-03 12:42         ` Bob Copeland
2012-03-02 20:26   ` [PATCHv2 13/21] cw1200: ap.*, mac80211 AP callbacks Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 14/21] cw1200: scan.*, mac80211 hw_scan callback Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 15/21] cw1200: debug.*, implementation of the driver's debugfs Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 16/21] cw1200: itp.*, internal device test and calibration code Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 17/21] cw1200: pm.*, power management code Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 18/21] cw1200: main.c, core initialization code Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 19/21] cw1200: TODO list Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 20/21] cw1200: Credits Dmitry Tarnyagin
2012-03-02 20:26   ` [PATCHv2 21/21] cw1200: Kconfig + Makefile for the driver Dmitry Tarnyagin
2012-05-09  6:58   ` [PATCHv2 00/21] cw1200: ST-Ericsson cw1200 wlan device driver Dmitry Tarnyagin
2012-05-31  5:45     ` Janusz Dziedzic
2012-07-05 18:16       ` Steev Klimaszewski
2012-07-06 20:18         ` John W. Linville
2012-12-11 23:23           ` Solomon Peachy
2012-12-12 14:40             ` Kalle Valo
2012-12-12 15:13             ` Christian Lamparter
2012-12-12 16:18               ` Solomon Peachy
2012-12-12 16:20                 ` Johannes Berg
2012-12-13 14:53                   ` Solomon Peachy
2012-12-12 18:19             ` John W. Linville

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=20120426132900.GA23011@localhost \
    --to=me@bobcopeland.com \
    --cc=dmitry.tarnyagin@stericsson.com \
    --cc=linux-wireless@vger.kernel.org \
    /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.