From: Brian Norris <briannorris@chromium.org>
To: yhchuang@realtek.com
Cc: kvalo@codeaurora.org, johannes@sipsolutions.net,
Larry.Finger@lwfinger.net, pkshih@realtek.com,
tehuang@realtek.com, sgruszka@redhat.com,
linux-wireless@vger.kernel.org
Subject: Re: [PATCH v4 09/13] rtw88: chip files
Date: Wed, 30 Jan 2019 11:44:55 -0800 [thread overview]
Message-ID: <20190130194453.GA156750@google.com> (raw)
In-Reply-To: <1548820940-15237-10-git-send-email-yhchuang@realtek.com>
Hi,
On Wed, Jan 30, 2019 at 12:02:16PM +0800, yhchuang@realtek.com wrote:
> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
>
> chip files Realtek 802.11ac wireless network chips
> 8822B & 8822C series files
>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
> ---
> drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1590 ++++++++++++++++++++
> drivers/net/wireless/realtek/rtw88/rtw8822b.h | 155 ++
> .../net/wireless/realtek/rtw88/rtw8822b_table.h | 18 +
> drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1169 ++++++++++++++
> drivers/net/wireless/realtek/rtw88/rtw8822c.h | 171 +++
> .../net/wireless/realtek/rtw88/rtw8822c_table.h | 16 +
> 6 files changed, 3119 insertions(+)
> create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8822b.c
> create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8822b.h
> create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8822b_table.h
> create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8822c.c
> create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8822c.h
> create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8822c_table.h
>
> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822b.c b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
> new file mode 100644
> index 0000000..0339041
> --- /dev/null
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
> @@ -0,0 +1,1590 @@
...
> +static inline void
> +rtw_write32s_mask(struct rtw_dev *rtwdev, u32 addr, u32 mask, u32 data)
> +{
> + BUILD_BUG_ON(addr < 0xC00 || addr >= 0xD00);
This seems to be a non-traditional use of BUILD_BUG_ON(). Normally, I
see this used for stuff that's guaranteed to be known at compile time --
structure offsets, constants, etc. This is usually (always?) a constant,
but it passes through a function parameter, so I'm not sure if that's
really guaranteed.
Anyway...this is failing confusingly for me when I try to build:
drivers/net/wireless/realtek/rtw88/rtw8822b.c: In function ‘rtw_write32s_mask’:
drivers/net/wireless/realtek/rtw88/rtw8822b.c:230:176: error: call to ‘__compiletime_assert_230’ declared with attribute error: BUILD_BUG_ON failed: addr < 0xC00 || addr >= 0xD00
BUILD_BUG_ON(addr < 0xC00 || addr >= 0xD00);
^
I tried to pinpoint which call yielded this, and I think once I deleted
enough calls to rtw_write32s_mask() it came down to this one:
rtw_write32s_mask(rtwdev, REG_RFEINV, BIT(11) | BIT(10) | 0x3f, 0x0);
which doesn't really make sense, as that's a value of 0xcbc.
What I really think it comes down to is that you can't guarantee
rtw_write32s_mask() will get inlined, and so BUILD_BUG_ON() may not know
what to do with it.
I think you should either drop the BUILD_BUG_ON(), or else turn
rtw_write32s_mask() into a macro.
BTW, I'm using a variant of gcc version 4.9.2. I normally use clang for
kernel builds (as that's the current Chromium OS toolchain), but clang
still regularly has breakage upstream, so I'm still building with an old
GCC toolchain. It's technically still supported in
Documentation/process/changes.rst though!
Brian
> +
> + rtw_write32_mask(rtwdev, addr, mask, data);
> + /* 0xC00-0xCFF and 0xE00-0xEFF have the same layout */
> + rtw_write32_mask(rtwdev, addr + 0x200, mask, data);
> +}
> +
next prev parent reply other threads:[~2019-01-30 19:45 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-30 4:02 [PATCH v4 00/13] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips yhchuang
2019-01-30 4:02 ` [PATCH v4 01/13] rtw88: main files yhchuang
2019-01-30 16:21 ` Larry Finger
2019-01-31 2:54 ` Tony Chuang
2019-01-30 4:02 ` [PATCH v4 02/13] rtw88: core files yhchuang
2019-01-30 4:02 ` [PATCH v4 03/13] rtw88: hci files yhchuang
2019-01-31 22:36 ` Brian Norris
2019-02-12 6:18 ` Tony Chuang
2019-02-12 22:04 ` Brian Norris
2019-02-13 8:08 ` Tony Chuang
2019-02-13 11:08 ` Tony Chuang
2019-02-13 19:21 ` Brian Norris
2019-02-14 23:05 ` Grant Grundler
2019-02-20 11:19 ` Tony Chuang
2019-03-22 14:36 ` Brian Norris
2019-02-08 22:28 ` Brian Norris
2019-02-11 6:15 ` Tony Chuang
2019-02-09 2:14 ` Brian Norris
2019-02-11 5:48 ` Tony Chuang
2019-02-11 17:56 ` Brian Norris
2019-01-30 4:02 ` [PATCH v4 04/13] rtw88: trx files yhchuang
2019-01-30 4:02 ` [PATCH v4 05/13] rtw88: mac files yhchuang
2019-01-30 4:02 ` [PATCH v4 06/13] rtw88: fw and efuse files yhchuang
2019-01-31 22:58 ` Brian Norris
2019-02-12 9:14 ` Tony Chuang
2019-01-30 4:02 ` [PATCH v4 07/13] rtw88: phy files yhchuang
2019-01-30 4:02 ` [PATCH v4 08/13] rtw88: debug files yhchuang
2019-02-01 19:49 ` Brian Norris
2019-02-11 5:41 ` Tony Chuang
2019-01-30 4:02 ` [PATCH v4 09/13] rtw88: chip files yhchuang
2019-01-30 19:44 ` Brian Norris [this message]
2019-01-31 11:36 ` Tony Chuang
2019-01-31 11:52 ` Kalle Valo
2019-01-31 11:55 ` Johannes Berg
2019-01-31 13:40 ` Kalle Valo
2019-01-30 4:02 ` [PATCH v4 10/13] rtw88: 8822B init table yhchuang
2019-01-30 4:02 ` [PATCH v4 11/13] rtw88: 8822C " yhchuang
2019-01-30 4:02 ` [PATCH v4 12/13] rtw88: Kconfig & Makefile yhchuang
2019-01-30 4:02 ` [PATCH v4 13/13] rtw88: add MAINTAINERS entry yhchuang
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=20190130194453.GA156750@google.com \
--to=briannorris@chromium.org \
--cc=Larry.Finger@lwfinger.net \
--cc=johannes@sipsolutions.net \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=pkshih@realtek.com \
--cc=sgruszka@redhat.com \
--cc=tehuang@realtek.com \
--cc=yhchuang@realtek.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).