Linux wireless drivers development
 help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: tehuang@realtek.com, yhchuang@realtek.com,
	linux-wireless@vger.kernel.org,
	clang-built-linux@googlegroups.com, arnd@arndb.de
Subject: Re: [PATCH 3/5] rtw88: add dump firmware fifo support
Date: Fri, 2 Oct 2020 01:43:26 -0700	[thread overview]
Message-ID: <20201002084326.GA2013042@ubuntu-m3-large-x86> (raw)
In-Reply-To: <87d021cae2.fsf@codeaurora.org>

On Fri, Oct 02, 2020 at 11:14:29AM +0300, Kalle Valo wrote:
> + arnd
> 
> Nathan Chancellor <natechancellor@gmail.com> writes:
> 
> >> +int rtw_fw_dump_fifo(struct rtw_dev *rtwdev, u8 fifo_sel, u32 addr, u32 size,
> >> +		     u32 *buffer)
> >> +{
> >> +	if (!rtwdev->chip->fw_fifo_addr) {
> >
> > This causes a clang warning, which points out it is probably not doing
> > what you think it is:
> >
> > drivers/net/wireless/realtek/rtw88/fw.c:1485:21: warning: address of
> > array 'rtwdev->chip->fw_fifo_addr' will always evaluate to 'true'
> > [-Wpointer-bool-conversion]
> >         if (!rtwdev->chip->fw_fifo_addr) {
> >             ~~~~~~~~~~~~~~~^~~~~~~~~~~~
> > 1 warning generated.
> >
> > Was fw_fifo_addr[0] intended or should the check just be deleted?
> 
> BTW what is the easiest way to install clang for build testing the
> kernel? For GCC I use crosstool[1] which is awesome as it makes the
> installation so simple, do we have something similar for clang?
> 
> Just supporting x86 would be fine, as my use case would be just to
> reproduce build warnings.
> 
> [1] https://mirrors.edge.kernel.org/pub/tools/crosstool/
> 
> -- 
> https://patchwork.kernel.org/project/linux-wireless/list/
> 
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

Unfortunately, we do not have anything for clang right now. It is on my
TODO list but being a hobbyist, I have less time than I would like...

If you do not mind building it from source, I maintain a Python script
that tries to optimize building LLVM as much as possible by turning off
things that the kernel does not care about so that the build is quick
and it does not intrude or interfere with the host environment.

Something like this should work to give you a stable clang toolchain
that should work well for compiling the kernel:

$ git clone https://github.com/ClangBuiltLinux/tc-build
$ tc-build/build-llvm.py \
--branch llvmorg-11.0.0-rc5 \
--projects "clang;lld"
$ tc-build/install/bin/clang --version | head -1
ClangBuiltLinux clang version 11.0.0 (https://github.com/llvm/llvm-project 60a25202a7dd1e00067fcfce512086ebf3788537)

The script by default does a 2-stage build for optimization purposes; if
you cannot spare many cycles, feel free to add

--build-stage1-only --install-stage1-only

to the build-llvm.py invocation. The toolchain is installed to "install"
within the tc-build repo and it only requires a few external
dependencies (outlined in the README) that it lets you know about before
doing anything. Feel free to give it a shot and let me know if anything
is broken. Otherwise, as long as your distribution has clang 10.0.1 or
newer, it should be fine for compiling the kernel.

Cheers,
Nathan

  reply	other threads:[~2020-10-02  8:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25  6:12 [PATCH 0/5] rtw88: add firmware crash recovery and some fixes tehuang
2020-09-25  6:12 ` [PATCH 1/5] rtw88: increse the size of rx buffer size tehuang
2020-09-29  8:23   ` Kalle Valo
2020-09-25  6:12 ` [PATCH 2/5] rtw88: handle and recover when firmware crash tehuang
2020-09-29  8:20   ` Kalle Valo
2020-09-25  6:12 ` [PATCH 3/5] rtw88: add dump firmware fifo support tehuang
2020-10-01 19:06   ` Nathan Chancellor
2020-10-02  8:14     ` Kalle Valo
2020-10-02  8:43       ` Nathan Chancellor [this message]
2020-10-06  5:53         ` Kalle Valo
2020-09-25  6:12 ` [PATCH 4/5] rtw88: add dump fw crash log tehuang
2020-09-25  6:12 ` [PATCH 5/5] rtw88: show current regulatory in tx power table tehuang
2020-09-25 16:29   ` Kalle Valo

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=20201002084326.GA2013042@ubuntu-m3-large-x86 \
    --to=natechancellor@gmail.com \
    --cc=arnd@arndb.de \
    --cc=clang-built-linux@googlegroups.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --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