linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: David Lin <dlin@marvell.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	Chor Teck Law <ctlaw@marvell.com>, Pete Hsieh <peteh@marvell.com>
Subject: Re: [PATCH v4] Add new mac80211 driver mwlwifi.
Date: Tue, 30 Jun 2015 10:21:31 +0200	[thread overview]
Message-ID: <1435652491.2082.5.camel@sipsolutions.net> (raw)
In-Reply-To: <cf8d3fa226704acea770a987100f4d4e@SC-EXCH02.marvell.com>

On Tue, 2015-06-30 at 01:49 +0000, David Lin wrote:
> +++ b/drivers/net/wireless/mwlwifi/Kconfig
> @@ -0,0 +1,17 @@
> +config MWLWIFI
> +	tristate "Marvell Wireless WiFi driver (mwlwifi)"
> +	depends on PCI && MAC80211 && MWIFIEX_PCIE=n

I still think you need to get rid of this so we can build-test this
driver properly.

> +	select FW_LOADER
> +	select OF

This looks OK, though I get a very strange dependency loop warning from
Kconfig here.

Looks like the driver now builds almost cleanly with sparse/smatch on
64-bit.

Two warnings remain, both are bugs:

> writew(0x00, (void __iomem *)&priv->pcmd_buf[1]);

cannot be right. This memory isn't __iomem, it's dma_alloc_coherent, so
a simple write should be done.

in mwl_rx_ring_init:

>                         rx_hndl->psk_buff =
>                                 dev_alloc_skb(desc->rx_buf_size);
> 
>                         if (skb_linearize(rx_hndl->psk_buff)) {

*crash*. You also later check rx_hndl->psk_buff, but well after it
already crashed.

Also, this code sequence is utterly bogus. Please try to understand why
and then remove it.

You should also use paged RX since you're allocating *very large* buffe
rs. We found that even alloc_pages(1) will fail eventually, you're
doing an order-2 allocation here for every RX skb. At least used paged
RX to get it down to order-1.

johannes

  parent reply	other threads:[~2015-06-30  8:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30  1:49 [PATCH v4] Add new mac80211 driver mwlwifi David Lin
2015-06-30  3:16 ` Joe Perches
2015-06-30  3:49   ` David Lin
2015-06-30  8:21 ` Johannes Berg [this message]
2015-06-30 14:18   ` Dan Williams
2015-06-30 22:26     ` James Cameron
2015-07-01 14:42       ` David Lin
2015-07-01 14:57         ` Johannes Berg
2015-07-01 23:23           ` David Lin

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=1435652491.2082.5.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=ctlaw@marvell.com \
    --cc=dlin@marvell.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=peteh@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).