platform/kernel/linux-starfive.git
5 years agostaging: octeon: Fix incorrect type in assignment
Wambui Karuga [Thu, 10 Oct 2019 04:38:15 +0000 (07:38 +0300)]
staging: octeon: Fix incorrect type in assignment

Fix the following warning generated by sparse in
drivers/staging/octeon/ethernet-tx.c:

drivers/staging/octeon/ethernet-tx.c:563:50: warning: incorrect type in assignment (different base types)
drivers/staging/octeon/ethernet-tx.c:563:50:    expected unsigned short [usertype] hw_chksum
drivers/staging/octeon/ethernet-tx.c:563:50:    got restricted __wsum [usertype] csum

Warning generated by running:
make C=2 CF="-D__CHECK_ENDIAN__" drivers/staging/octeon/

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/20191010043815.14027-1-wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: Align function arguments with opening paranthesis
Wambui Karuga [Tue, 8 Oct 2019 19:53:50 +0000 (22:53 +0300)]
staging: rtl8712: Align function arguments with opening paranthesis

Fixes checkpatch.pl "CHECK Alignment should match open parenthesis"
on drivers/staging/rtl8712/rtl8712_recv.c:122

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/20191008195350.20544-1-wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Fix style in definitions
Javier F. Arias [Thu, 10 Oct 2019 02:16:49 +0000 (21:16 -0500)]
staging: rtl8723bs: Fix style in definitions

Fix the style in definitions where commented code was previously
removed for an improved code readability.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/fc488562c0ddf3fa8a59e86be9b33506496ccd0c.1570672544.git.jarias.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove space before tabs
Javier F. Arias [Thu, 10 Oct 2019 02:16:29 +0000 (21:16 -0500)]
staging: rtl8723bs: Remove space before tabs

Remove space before tabs to fix checkpatch warning.
Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/120800f884986092ca757235781d9ddc740ec832.1570672544.git.jarias.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove duplicate blank lines
Javier F. Arias [Thu, 10 Oct 2019 02:16:07 +0000 (21:16 -0500)]
staging: rtl8723bs: Remove duplicate blank lines

Remove duplicate blank lines.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/cdc1899acadc436c2f0247ded9ec2a8b3423350e.1570672544.git.jarias.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove commented code
Javier F. Arias [Thu, 10 Oct 2019 02:14:47 +0000 (21:14 -0500)]
staging: rtl8723bs: Remove commented code

Remove commented code for a cleaner file.
Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/132126f0d04d5ca1129e9d682dfe9a535ec7bb39.1570672544.git.jarias.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Fix incorrect type in declaration
Javier F. Arias [Wed, 9 Oct 2019 23:19:56 +0000 (18:19 -0500)]
staging: rtl8723bs: Fix incorrect type in declaration

Fix incorrect type in declaration to solve the warnings 'incorrect
type in argument 2' in the rtw_get_wpa_ie and rtw_get_wpa_ie function
calls, as both expect the same variable in argument 2 with the
type int *.
Issue found by Sparse.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/20191009231953.GA8774@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Add space between elements
Javier F. Arias [Wed, 9 Oct 2019 00:25:45 +0000 (19:25 -0500)]
staging: rtl8723bs: Add space between elements

Concatenated strings should use spaces between elements.
Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/a2387d4c10c2ed0cbca9d5c7ded424892452178f.1570577926.git.jarias.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Fix function call wrapping style
Javier F. Arias [Wed, 9 Oct 2019 00:25:05 +0000 (19:25 -0500)]
staging: rtl8723bs: Fix function call wrapping style

Fix the wrapping style used for the function call.
Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/f43f9295d7412d610e278be608fba6f2cc14cac9.1570577926.git.jarias.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Fix line over 80 characters
Javier F. Arias [Wed, 9 Oct 2019 00:24:36 +0000 (19:24 -0500)]
staging: rtl8723bs: Fix line over 80 characters

Break last two function call arguments into two separate lines.
Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/9a8f7b026780b3a7387c29f1d67a7c23d4b159eb.1570577926.git.jarias.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove File operation APIs
Hans de Goede [Wed, 9 Oct 2019 12:32:23 +0000 (14:32 +0200)]
staging: rtl8723bs: Remove File operation APIs

rtl8723bs had 2 private file operation helpers:

rtw_is_file_readable()
rtw_retrive_from_file()

These were only used by the removed phy_Config*WithParaFile() functions,
so they can be removed now.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20191009123223.163241-5-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove rtw_merge_string() function
Hans de Goede [Wed, 9 Oct 2019 12:32:22 +0000 (14:32 +0200)]
staging: rtl8723bs: Remove rtw_merge_string() function

The phy_Config*WithParaFile() functions were the only user of this
function.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20191009123223.163241-4-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove phy_Config*WithParaFile() configuration leftovers
Hans de Goede [Wed, 9 Oct 2019 12:32:21 +0000 (14:32 +0200)]
staging: rtl8723bs: Remove phy_Config*WithParaFile() configuration leftovers

Now that the phy_Config*WithParaFile() functions have been removed nothing
is using these module-parameters and defines anymore.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20191009123223.163241-3-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove phy_Config*WithParaFile() functions
Hans de Goede [Wed, 9 Oct 2019 12:32:20 +0000 (14:32 +0200)]
staging: rtl8723bs: Remove phy_Config*WithParaFile() functions

These are no longer used, so remove them and also remove various
struct definitions only used by these functions.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20191009123223.163241-2-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove phy_Config*With*ParaFile() calls
Hans de Goede [Wed, 9 Oct 2019 12:32:19 +0000 (14:32 +0200)]
staging: rtl8723bs: Remove phy_Config*With*ParaFile() calls

The rtl8723bs driver tries to load various parameters from disk,
circumventing the standard firmware loader mechanism and using DIY
code for this.

No devices which run the mainline kernel ship with these files and even
if these files were present then they still would not be loaded without
additional module parameters. To be precise the following 3 conditions
must all 3 be true for on disk parameters to be used:

1) The rtw_load_phy_file modparam must contain the mask for the type, this
   defaults to(LOAD_BB_PG_PARA_FILE | LOAD_RF_TXPWR_LMT_PARA_FILE) so with
   the default settings this condition is only true for:
   phy_ConfigBBWithPgParaFile()
   PHY_ConfigRFWithPowerLimitTableParaFile(); and
2) rtw_phy_file_path modparam must be set to say "/lib/firmware/"; and
3) Store a /lib/firmware/rtl8723b/XXX file in the expected format.

In practice all 3 being true never happens, so the
phy_Config*With*ParaFile() calls are nops, remove them.

The actual code implementing them will be removed in a separate patch.

Note the ODM_ConfigRFWithHeaderFile() and ODM_ConfigBBWithHeaderFile()
functions always return HAL_STATUS_SUCCESS, this patch makes use of this
to simplify the new code without the phy_Config*With*ParaFile() calls.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20191009123223.163241-1-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove set but not used variable 'i'
zhengbin [Tue, 8 Oct 2019 23:55:05 +0000 (07:55 +0800)]
staging: rtl8723bs: Remove set but not used variable 'i'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/rtl8723bs/core/rtw_xmit.c: In function update_attrib:
drivers/staging/rtl8723bs/core/rtw_xmit.c:680:7: warning: variable i set but not used [-Wunused-but-set-variable]

It is not used since commit 554c0a3abf21 ("staging:
Add rtl8723bs sdio wifi driver")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/1570578905-95675-1-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove space before tab
Javier F. Arias [Tue, 8 Oct 2019 21:16:00 +0000 (16:16 -0500)]
staging: rtl8723bs: Remove space before tab

Fix warning by removing space before tab.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/20191008211557.iv3hdpbklgaddlt3@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Replace string with identifier
Javier F. Arias [Tue, 8 Oct 2019 21:48:53 +0000 (16:48 -0500)]
staging: rtl8723bs: Replace string with identifier

Replace the hardcoded function name with its predefined identifier.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/20191008214851.p4w7cbpuldnwkne4@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: core: Remove typecast in call to kfree
Nachammai Karuppiah [Tue, 8 Oct 2019 20:17:38 +0000 (13:17 -0700)]
staging: rtl8723bs: core: Remove typecast in call to kfree

Remove typecast in the call to kfree as it is not needed.
Issue found using the below coccinelle script with options -I and
--recursive-includes,

@@
type t1;
expression *e;
@@

-kfree((t1 *)e);
+kfree(e);

Signed-off-by: Nachammai Karuppiah <nachukannan@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/1570565858-91737-1-git-send-email-nachukannan@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: Make some functions static in sta.c
zhengbin [Wed, 9 Oct 2019 13:50:30 +0000 (21:50 +0800)]
staging: wfx: Make some functions static in sta.c

Fix sparse warnings:

drivers/staging/wfx/sta.c:269:6: warning: symbol 'wfx_update_filtering_work' was not declared. Should it be static?
drivers/staging/wfx/sta.c:475:6: warning: symbol 'wfx_event_handler_work' was not declared. Should it be static?
drivers/staging/wfx/sta.c:521:6: warning: symbol 'wfx_bss_loss_work' was not declared. Should it be static?
drivers/staging/wfx/sta.c:528:6: warning: symbol 'wfx_bss_params_work' was not declared. Should it be static?
drivers/staging/wfx/sta.c:539:6: warning: symbol 'wfx_set_beacon_wakeup_period_work' was not declared. Should it be static?
drivers/staging/wfx/sta.c:732:6: warning: symbol 'wfx_unjoin_work' was not declared. Should it be static?
drivers/staging/wfx/sta.c:794:6: warning: symbol 'wfx_set_cts_work' was not declared. Should it be static?
drivers/staging/wfx/sta.c:1234:6: warning: symbol 'wfx_set_tim_work' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/1570629030-29888-4-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: Make function 'wfx_tx_queue_get' static
zhengbin [Wed, 9 Oct 2019 13:50:29 +0000 (21:50 +0800)]
staging: wfx: Make function 'wfx_tx_queue_get' static

Fix sparse warnings:

drivers/staging/wfx/queue.c:218:16: warning: symbol 'wfx_tx_queue_get' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/1570629030-29888-3-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: Make function 'sram_write_dma_safe', 'load_firmware_secure' static
zhengbin [Wed, 9 Oct 2019 13:50:28 +0000 (21:50 +0800)]
staging: wfx: Make function 'sram_write_dma_safe', 'load_firmware_secure' static

Fix sparse warnings:

drivers/staging/wfx/fwio.c:83:5: warning: symbol 'sram_write_dma_safe' was not declared. Should it be static?
drivers/staging/wfx/fwio.c:229:5: warning: symbol 'load_firmware_secure' was not declared. Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/1570629030-29888-2-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: fix swapped arguments in memset call
Colin Ian King [Wed, 9 Oct 2019 09:46:02 +0000 (10:46 +0100)]
staging: wfx: fix swapped arguments in memset call

The memset appears to have the 2nd and 3rd arguments in the wrong
order, fix this by swapping these around into the correct order.

Addresses-Coverity: ("Memset fill truncated")
Fixes: 4f8b7fabb15d ("staging: wfx: allow to send commands to chip")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191009094602.19663-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: kpc2000: Remove unnecessary return variable
Wambui Karuga [Wed, 9 Oct 2019 17:07:03 +0000 (20:07 +0300)]
staging: kpc2000: Remove unnecessary return variable

Remove unnecessary variable `val` in kp_spi_read_reg() that only holds
the return value from readq().
Issue found by coccinelle using the script:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/20191009170703.GA2869@wambui
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: comedi: Remove set but not used variable 'aref'
zhengbin [Tue, 8 Oct 2019 07:41:55 +0000 (15:41 +0800)]
staging: comedi: Remove set but not used variable 'aref'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/comedi/drivers/dt3000.c: In function dt3k_ai_insn_read:
drivers/staging/comedi/drivers/dt3000.c:511:27: warning: variable aref set but not used [-Wunused-but-set-variable]

It is not used since commit 2e310235ca8f ("staging:
comedi: dt3000: rename dt3k_ai_insn()")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/1570520515-2186-7-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vchiq: don't print pointless kernel address
Matteo Croce [Tue, 8 Oct 2019 12:33:46 +0000 (14:33 +0200)]
staging: vchiq: don't print pointless kernel address

Since commit ad67b74d2469d9b8 ("printk: hash addresses printed with %p"),
an obfuscated kernel pointer is printed at boot:

    vchiq: vchiq_init_state: slot_zero = (____ptrval____)

Remove the the print completely, as it's useless without the address.

Signed-off-by: Matteo Croce <mcroce@redhat.com>
Link: https://lore.kernel.org/r/20191008123346.3931-1-mcroce@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: sm750fb: Remove set but not used variable 'actual_mx_clk'
zhengbin [Tue, 8 Oct 2019 07:41:52 +0000 (15:41 +0800)]
staging: sm750fb: Remove set but not used variable 'actual_mx_clk'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/sm750fb/ddk750_chip.c: In function set_chip_clock:
drivers/staging/sm750fb/ddk750_chip.c:59:15: warning: variable actual_mx_clk set but not used [-Wunused-but-set-variable]

It is not used since commit f0977109a577 ("staging:
sm750fb: lower case to fix camelcase checkpatch warning")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/1570520515-2186-4-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: sm750fb: Remove set but not used variable 'uiActualPixelClk'
zhengbin [Tue, 8 Oct 2019 07:41:51 +0000 (15:41 +0800)]
staging: sm750fb: Remove set but not used variable 'uiActualPixelClk'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/sm750fb/ddk750_mode.c: In function ddk750_setModeTiming:
drivers/staging/sm750fb/ddk750_mode.c:212:15: warning: variable uiActualPixelClk set but not used [-Wunused-but-set-variable]

It is not used since commit 81dee67e215b ("staging:
sm750fb: add sm750 to staging")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/1570520515-2186-3-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: bcm2835-audio: Need to judge the return value of vchi_msg_dequeue in audio_v...
zhengbin [Tue, 8 Oct 2019 07:41:50 +0000 (15:41 +0800)]
staging: bcm2835-audio: Need to judge the return value of vchi_msg_dequeue in audio_vchi_callback

If vchi_msg_dequeue return -1, variable m is not assigined,
need to return.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/1570520515-2186-2-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging/octeon: Use stubs for MIPS && !CAVIUM_OCTEON_SOC
Paul Burton [Mon, 7 Oct 2019 23:18:06 +0000 (23:18 +0000)]
staging/octeon: Use stubs for MIPS && !CAVIUM_OCTEON_SOC

When building for a non-Cavium MIPS system with COMPILE_TEST=y, the
Octeon ethernet driver hits a number of issues due to use of macros
provided only for CONFIG_CAVIUM_OCTEON_SOC=y configurations. For
example:

  drivers/staging/octeon/ethernet-rx.c:190:6: error:
    'CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE' undeclared (first use in this function)
  drivers/staging/octeon/ethernet-rx.c:472:25: error:
    'OCTEON_IRQ_WORKQ0' undeclared (first use in this function)

These come from various asm/ headers that a non-Octeon build will be
using a non-Octeon version of.

Fix this by using the octeon-stubs.h header for non-Cavium MIPS builds,
and only using the real asm/octeon/ headers when building a Cavium
Octeon kernel configuration.

This requires that octeon-stubs.h doesn't redefine XKPHYS_TO_PHYS, which
is defined for MIPS by asm/addrspace.h which is pulled in by many other
common asm/ headers.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
URL: https://lore.kernel.org/linux-mips/CAMuHMdXvu+BppwzsU9imNWVKea_hoLcRt9N+a29Q-QsjW=ip2g@mail.gmail.com/
Fixes: 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS")
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: David S. Miller <davem@davemloft.net>
Link: https://lore.kernel.org/r/20191007231741.2012860-1-paul.burton@mips.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: os_dep: Remove typecast in kfree
Nachammai Karuppiah [Tue, 8 Oct 2019 05:09:13 +0000 (22:09 -0700)]
staging: rtl8723bs: os_dep: Remove typecast in kfree

Remove typecast in the call to kfree as it is not needed.
Issue found using the below coccinelle script,

@@
type t1;
expression e;
@@

-kfree((t1 *)e);
+kfree(e);

Signed-off-by: Nachammai Karuppiah <nachukannan@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/1570511353-64646-1-git-send-email-nachukannan@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove commented code
Javier F. Arias [Tue, 8 Oct 2019 02:52:23 +0000 (21:52 -0500)]
staging: rtl8723bs: Remove commented code

Remove commented code for a cleaner file. Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/20191008025221.q4j4igctqjowur2s@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: fix typo of "mechanism" in comment
Antonio Borneo [Mon, 7 Oct 2019 15:43:03 +0000 (17:43 +0200)]
staging: rtl8723bs: fix typo of "mechanism" in comment

Fix typo s/mechansim/mechanism/

Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
Link: https://lore.kernel.org/r/20191007154306.95827-2-antonio.borneo@st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: octeon: Remove typedef declaration
Wambui Karuga [Tue, 8 Oct 2019 04:09:43 +0000 (07:09 +0300)]
staging: octeon: Remove typedef declaration

Fixes checkpatch.pl warning: do not add new typedefs in
drivers/staging/octeon/octeon-stubs.h:41

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Link: https://lore.kernel.org/r/20191008040943.9283-1-wambui.karugax@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: fix spelling mistake "hexdecimal" -> "hexadecimal"
Colin Ian King [Tue, 8 Oct 2019 08:22:05 +0000 (09:22 +0100)]
staging: wfx: fix spelling mistake "hexdecimal" -> "hexadecimal"

There is a spelling mistake in the documentation and a module parameter
description. Fix these.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20191008082205.19740-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: avoid namespace contamination
Jérôme Pouiller [Tue, 8 Oct 2019 09:43:01 +0000 (09:43 +0000)]
staging: wfx: avoid namespace contamination

tx_policy_init() was already defined in driver cw1200. So, compilation
failed when wfx and cw1200 were both built-in.

In order to keep a coherent naming scheme, this patch prefixes all
"tx_policy_*" functions with "wfx_".

Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191008094232.10014-8-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: drop calls to BUG_ON()
Jérôme Pouiller [Tue, 8 Oct 2019 09:43:01 +0000 (09:43 +0000)]
staging: wfx: drop calls to BUG_ON()

Most of calls to BUG_ON() could replaced by WARN().

By the way, this patch also try to favor WARN() (that include a comment
about the problem) instead of WARN_ON().

Reported-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191008094232.10014-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: fix copy_{to,from}_user() usage
Jérôme Pouiller [Tue, 8 Oct 2019 09:43:00 +0000 (09:43 +0000)]
staging: wfx: fix copy_{to,from}_user() usage

On error, copy_to_user() returns number of bytes remaining. Driver
should return -EFAULT.

Fixes: 4f8b7fabb15d ("staging: wfx: allow to send commands to chip")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191008094232.10014-6-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: correctly cast data on big-endian targets
Jérôme Pouiller [Tue, 8 Oct 2019 09:43:00 +0000 (09:43 +0000)]
staging: wfx: correctly cast data on big-endian targets

When built for a big-endian target, original code caused error:

    include/uapi/linux/swab.h:242:29: note: expected '__u32 * {aka unsigned int *}' but argument is of type 'struct hif_mib_protected_mgmt_policy *'

Fixes: f95a29d40782 ("staging: wfx: add HIF commands helpers")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191008094232.10014-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: le16_to_cpus() takes a reference as parameter
Jérôme Pouiller [Tue, 8 Oct 2019 09:42:59 +0000 (09:42 +0000)]
staging: wfx: le16_to_cpus() takes a reference as parameter

Original code caused an (100% reproducible) invalid memory access on
big-endian targets.

Fixes: b0998f0c040d "staging: wfx: add IRQ handling"
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191008094232.10014-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: remove misused call to cpu_to_le16()
Jérôme Pouiller [Tue, 8 Oct 2019 09:42:59 +0000 (09:42 +0000)]
staging: wfx: remove misused call to cpu_to_le16()

Indeed, hif_msg->id is a uint8_t, so use of cpu_to_le16() is a madness.

Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191008094232.10014-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: simplify memory allocation in wfx_update_filtering()
Jérôme Pouiller [Tue, 8 Oct 2019 09:42:58 +0000 (09:42 +0000)]
staging: wfx: simplify memory allocation in wfx_update_filtering()

Original code did not handle case where kmalloc failed. By the way, it
is more convenient to allocate and build HIF message in
hif_set_beacon_filter_table() instead of to ask to caller function to
build it.

Fixes: 40115bbc40e2 ("staging: wfx: implement the rest of mac80211 API")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191008094232.10014-2-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wlan-ng: p80211wep.c: use lib/crc32
Thomas Meyer [Sun, 6 Oct 2019 14:07:45 +0000 (16:07 +0200)]
staging: wlan-ng: p80211wep.c: use lib/crc32

Use lib/crc32 instead of another implementation.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Link: https://lore.kernel.org/r/20191006140745.9952-1-thomas@m3y3r.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vc04_services: make use of devm_platform_ioremap_resource
Hariprasad Kelam [Sun, 6 Oct 2019 09:16:21 +0000 (14:46 +0530)]
staging: vc04_services: make use of devm_platform_ioremap_resource

fix below issue reported by coccicheck
drivers/staging//vc04_services/interface/vchiq_arm/vchiq_2835_arm.c:139
WARNING: Use devm_platform_ioremap_resource for g_regs

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Link: https://lore.kernel.org/r/1570353394-9991-1-git-send-email-hariprasad.kelam@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove set but not used variable 'adapter'
zhengbin [Sun, 6 Oct 2019 09:09:59 +0000 (17:09 +0800)]
staging: rtl8723bs: Remove set but not used variable 'adapter'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/rtl8723bs/core/rtw_mlme.c: In function rtw_select_roaming_candidate:
drivers/staging/rtl8723bs/core/rtw_mlme.c:2007:18: warning: variable adapter set but not used [-Wunused-but-set-variable]

It is not used since commit 554c0a3abf21 ("staging:
Add rtl8723bs sdio wifi driver")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/1570352999-45790-6-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove set but not used variables 'ppp', 'type', 'data'
zhengbin [Sun, 6 Oct 2019 09:09:58 +0000 (17:09 +0800)]
staging: rtl8723bs: Remove set but not used variables 'ppp', 'type', 'data'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/rtl8723bs/core/rtw_recv.c: In function validate_80211w_mgmt:
drivers/staging/rtl8723bs/core/rtw_recv.c:1415:8: warning: variable ppp set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_recv.c: In function validate_80211w_mgmt:
drivers/staging/rtl8723bs/core/rtw_recv.c:1403:5: warning: variable type set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_recv.c: In function recvframe_defrag:
drivers/staging/rtl8723bs/core/rtw_recv.c:1713:6: warning: variable data set but not used [-Wunused-but-set-variable]

They are not used since commit 554c0a3abf21 ("staging:
Add rtl8723bs sdio wifi driver")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/1570352999-45790-5-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove set but not used variable 'prwskeylen'
zhengbin [Sun, 6 Oct 2019 09:09:57 +0000 (17:09 +0800)]
staging: rtl8723bs: Remove set but not used variable 'prwskeylen'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/rtl8723bs/core/rtw_security.c: In function rtw_tkip_encrypt:
drivers/staging/rtl8723bs/core/rtw_security.c:660:6: warning: variable prwskeylen set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_security.c: In function rtw_tkip_decrypt:
drivers/staging/rtl8723bs/core/rtw_security.c:768:6: warning: variable prwskeylen set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/core/rtw_security.c: In function rtw_aes_encrypt:
drivers/staging/rtl8723bs/core/rtw_security.c:1528:6: warning: variable prwskeylen set but not used [-Wunused-but-set-variable]

It is not used since commit 554c0a3abf21 ("staging:
Add rtl8723bs sdio wifi driver")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/1570352999-45790-4-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove set but not used variable 'tmp_aid'
zhengbin [Sun, 6 Oct 2019 09:09:56 +0000 (17:09 +0800)]
staging: rtl8723bs: Remove set but not used variable 'tmp_aid'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/rtl8723bs/core/rtw_sta_mgt.c: In function rtw_alloc_stainfo:
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c:190:7: warning: variable tmp_aid set but not used [-Wunused-but-set-variable]

It is not used since commit 554c0a3abf21 ("staging:
Add rtl8723bs sdio wifi driver")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/1570352999-45790-3-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: align arguments with open parenthesis in file rtl8712_led.c
Gabriela Bittencourt [Mon, 7 Oct 2019 00:39:02 +0000 (21:39 -0300)]
staging: rtl8712: align arguments with open parenthesis in file rtl8712_led.c

Cleans up checks of "Alignment should match open parenthesis"

Signed-off-by: Gabriela Bittencourt <gabrielabittencourt00@gmail.com>
Link: https://lore.kernel.org/r/20191007003902.21911-1-gabrielabittencourt00@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Switch constant place in test
Javier F. Arias [Mon, 7 Oct 2019 03:32:05 +0000 (22:32 -0500)]
staging: rtl8723bs: Switch constant place in test

Switch constant place as it should be on the right side of the test.
Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/20191007033202.45czxuochtylkddf@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vt6656: reorganize characters so the lines are under 80 ch
Gabriela Bittencourt [Sun, 6 Oct 2019 19:40:30 +0000 (16:40 -0300)]
staging: vt6656: reorganize characters so the lines are under 80 ch

Cleans up warnings of "line over 80 characters"

Signed-off-by: Gabriela Bittencourt <gabrielabittencourt00@gmail.com>
Link: https://lore.kernel.org/r/20191006194030.8854-1-gabrielabittencourt00@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove unnecessary braces
Javier F. Arias [Sun, 6 Oct 2019 23:03:30 +0000 (18:03 -0500)]
staging: rtl8723bs: Remove unnecessary braces

Remove braces that are not necessary for any arm of this statement.
Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Link: https://lore.kernel.org/r/20191006230327.GA4168@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vt6656: remove duplicated blank line
Gabriela Bittencourt [Sun, 6 Oct 2019 19:58:54 +0000 (16:58 -0300)]
staging: vt6656: remove duplicated blank line

Cleans up checks of "don't use multiple blank line"

Signed-off-by: Gabriela Bittencourt <gabrielabittencourt00@gmail.com>
Reviewed-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk>
Link: https://lore.kernel.org/r/20191006195854.9843-1-gabrielabittencourt00@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-pci: add quirks for 'E2' revision using 'soc_device_attribute'
Sergio Paracuellos [Sun, 6 Oct 2019 18:10:32 +0000 (20:10 +0200)]
staging: mt7621-pci: add quirks for 'E2' revision using 'soc_device_attribute'

Depending on revision of the chip, reset lines are inverted. Make code
more readable making use of 'soc_device_match' in driver probe function.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20191006181032.19112-1-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8192u: Fix indentation for cleaner code
Sumera Priyadarsini [Sun, 6 Oct 2019 10:53:00 +0000 (16:23 +0530)]
staging: rtl8192u: Fix indentation for cleaner code

Fixes indentation for if condition in the file r8190_rtl8256.c for
better readability as suggested by Dan Carpenter.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com>
Link: https://lore.kernel.org/r/20191006105300.10181-1-sylphrenadin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove set but not used variable 'oldcnt'
zhengbin [Sun, 6 Oct 2019 09:33:02 +0000 (17:33 +0800)]
staging: rtl8723bs: Remove set but not used variable 'oldcnt'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/rtl8723bs/hal/sdio_ops.c: In function sdio_read_port:
drivers/staging/rtl8723bs/hal/sdio_ops.c:430:6: warning: variable oldcnt set but not used [-Wunused-but-set-variable]

It is not used since commit dedf215bd1c7 ("staging:
rtl8723bs: remove unused code")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/1570354382-86879-1-git-send-email-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: remove unnecessary asignment and initialization
Michael Straube [Sat, 5 Oct 2019 14:18:52 +0000 (16:18 +0200)]
staging: rtl8188eu: remove unnecessary asignment and initialization

Variable badworden is asigned in two subsequent lines. So the first
asignment is useless and not needed. Also the initialization to zero
is not needed. Remove the first asignment and the initialization.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191005141852.88712-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wilc1000: don't use wdev while setting tx power
Adham Abozaeid [Fri, 4 Oct 2019 21:40:22 +0000 (21:40 +0000)]
staging: wilc1000: don't use wdev while setting tx power

WILC doesn't support per-vif tx power, and hence, wdev will always be
null in calls to set_tx_power.
Instead, wiphy should be used to execute the operation

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20191004214011.7623-1-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove unnecessary braces
Javier F. Arias [Sun, 6 Oct 2019 13:30:19 +0000 (08:30 -0500)]
staging: rtl8723bs: Remove unnecessary braces

Remove unnecessary braces for single statement block.
Issue found by checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Link: https://lore.kernel.org/r/20191006133016.GA22297@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Refill empty buffer queues from wq
Benjamin Poirier [Fri, 27 Sep 2019 10:12:11 +0000 (19:12 +0900)]
staging: qlge: Refill empty buffer queues from wq

When operating at mtu 9000, qlge does order-1 allocations for rx buffers in
atomic context. This is especially unreliable when free memory is low or
fragmented. Add an approach similar to commit 3161e453e496 ("virtio: net
refill on out-of-memory") to qlge so that the device doesn't lock up if
there are allocation failures.

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Link: https://lore.kernel.org/r/20190927101210.23856-18-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Refill rx buffers up to multiple of 16
Benjamin Poirier [Fri, 27 Sep 2019 10:12:10 +0000 (19:12 +0900)]
staging: qlge: Refill rx buffers up to multiple of 16

Reading the {s,l}bq_prod_idx registers on a running device, it appears that
the adapter will only use buffers up to prod_idx & 0xfff0. The driver
currently uses fixed-size guard zones (16 for sbq, 32 for lbq - don't know
why this difference). After the previous patch, this approach no longer
guarantees prod_idx values aligned on multiples of 16. While it appears
that we can write unaligned values to prod_idx without ill effects on
device operation, it makes more sense to change qlge_refill_bq() to refill
up to a limit that corresponds with the device's behavior.

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Link: https://lore.kernel.org/r/20190927101210.23856-17-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Update buffer queue prod index despite oom
Benjamin Poirier [Fri, 27 Sep 2019 10:12:09 +0000 (19:12 +0900)]
staging: qlge: Update buffer queue prod index despite oom

Currently, if we repeatedly fail to allocate all of the buffers from the
desired batching budget, we will never update the prod_idx register.
Restructure code to always update prod_idx if new buffers could be
allocated. This eliminates the current two stage process (clean_idx ->
prod_idx) and some associated bookkeeping variables.

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Link: https://lore.kernel.org/r/20190927101210.23856-16-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Replace memset with assignment
Benjamin Poirier [Fri, 27 Sep 2019 10:12:08 +0000 (19:12 +0900)]
staging: qlge: Replace memset with assignment

Instead of clearing the structure wholesale, it is sufficient to initialize
the skb member which is used to manage sbq instances. lbq instances are
managed according to curr_idx and clean_idx.

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Link: https://lore.kernel.org/r/20190927101210.23856-15-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Remove useless memset
Benjamin Poirier [Fri, 27 Sep 2019 10:12:07 +0000 (19:12 +0900)]
staging: qlge: Remove useless memset

This just repeats what the other memset a few lines above did.

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Link: https://lore.kernel.org/r/20190927101210.23856-14-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Remove qlge_bq.len & size
Benjamin Poirier [Fri, 27 Sep 2019 10:12:06 +0000 (19:12 +0900)]
staging: qlge: Remove qlge_bq.len & size

Given the way the driver currently works, these values are always known
at compile time.

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Link: https://lore.kernel.org/r/20190927101210.23856-13-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Factor out duplicated expression
Benjamin Poirier [Fri, 27 Sep 2019 10:12:05 +0000 (19:12 +0900)]
staging: qlge: Factor out duplicated expression

Given that (u16) 65536 == 0, that expression can be replaced by a simple
cast.

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Link: https://lore.kernel.org/r/20190927101210.23856-12-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Remove rx_ring.type
Benjamin Poirier [Fri, 27 Sep 2019 10:12:04 +0000 (19:12 +0900)]
staging: qlge: Remove rx_ring.type

This field is redundant, the type can be determined from the index, cq_id.

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Link: https://lore.kernel.org/r/20190927101210.23856-11-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Fix dma_sync_single calls
Benjamin Poirier [Fri, 27 Sep 2019 10:12:03 +0000 (19:12 +0900)]
staging: qlge: Fix dma_sync_single calls

Using the unmap addr elsewhere than unmap calls is a misuse of the dma api.
In prevision of this fix, qlge kept two copies of the dma address around ;)

Fixes: c4e84bde1d59 ("qlge: New Qlogic 10Gb Ethernet Driver.")
Fixes: 7c734359d350 ("qlge: Size RX buffers based on MTU.")
Fixes: 2c9a266afefe ("qlge: Fix receive packets drop.")
Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Link: https://lore.kernel.org/r/20190927101210.23856-10-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Deduplicate rx buffer queue management
Benjamin Poirier [Fri, 27 Sep 2019 10:12:02 +0000 (19:12 +0900)]
staging: qlge: Deduplicate rx buffer queue management

The qlge driver (and device) uses two kinds of buffers for reception,
so-called "small buffers" and "large buffers". The two are arranged in
rings, the sbq and lbq. These two share similar data structures and code.

Factor out data structures into a common struct qlge_bq, make required
adjustments to code and dedup the most obvious cases of copy/paste.

This patch should not introduce any functional change other than to some of
the printk format strings.

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Link: https://lore.kernel.org/r/20190927101210.23856-9-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Remove useless dma synchronization calls
Benjamin Poirier [Fri, 27 Sep 2019 10:12:01 +0000 (19:12 +0900)]
staging: qlge: Remove useless dma synchronization calls

This is unneeded for two reasons:
1) the cpu does not write data for the device in the mapping
2) calls like ..._sync_..._for_device(..., ..._FROMDEVICE) are
   nonsensical, see commit 3f0fb4e85b38 ("Documentation/DMA-API-HOWTO.txt:
   fix misleading example")

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Link: https://lore.kernel.org/r/20190927101210.23856-8-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Remove rx_ring.sbq_buf_size
Benjamin Poirier [Fri, 27 Sep 2019 10:12:00 +0000 (19:12 +0900)]
staging: qlge: Remove rx_ring.sbq_buf_size

Tx completion rings have sbq_buf_size = 0 but there's no case where the
code actually tests on that value. We can remove sbq_buf_size and use a
constant instead.

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20190927101210.23856-7-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Remove bq_desc.maplen
Benjamin Poirier [Fri, 27 Sep 2019 10:11:59 +0000 (19:11 +0900)]
staging: qlge: Remove bq_desc.maplen

The size of the mapping is known statically in all cases, there's no need
to save it at runtime. Remove this member.

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Acked-by: Manish Chopra <manishc@marvell.com>
Link: https://lore.kernel.org/r/20190927101210.23856-6-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Deduplicate lbq_buf_size
Benjamin Poirier [Fri, 27 Sep 2019 10:11:58 +0000 (19:11 +0900)]
staging: qlge: Deduplicate lbq_buf_size

lbq_buf_size is duplicated to every rx_ring structure whereas lbq_buf_order
is present once in the ql_adapter structure. All rings use the same buf
size, keep only one copy of it. Also factor out the calculation of
lbq_buf_size instead of having two copies.

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20190927101210.23856-5-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Remove page_chunk.last_flag
Benjamin Poirier [Fri, 27 Sep 2019 10:11:57 +0000 (19:11 +0900)]
staging: qlge: Remove page_chunk.last_flag

As already done in ql_get_curr_lchunk(), this member can be replaced by a
simple test.

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Acked-by: Manish Chopra <manishc@marvell.com>
Link: https://lore.kernel.org/r/20190927101210.23856-4-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Remove irq_cnt
Benjamin Poirier [Fri, 27 Sep 2019 10:11:56 +0000 (19:11 +0900)]
staging: qlge: Remove irq_cnt

qlge uses an irq enable/disable refcounting scheme that is:
* poorly implemented
Uses a spin_lock to protect accesses to the irq_cnt atomic
variable.
* buggy
Breaks when there is not a 1:1 sequence of irq - napi_poll, such as
when using SO_BUSY_POLL.
* unnecessary
The purpose or irq_cnt is to reduce irq control writes when
multiple work items result from one irq: the irq is re-enabled
after all work is done.
Analysis of the irq handler shows that there is only one case where
there might be two workers scheduled at once, and those have
separate irq masking bits.

Therefore, remove irq_cnt.

Additionally, we get a performance improvement:
perf stat -e cycles -a -r5 super_netperf 100 -H 192.168.33.1 -t TCP_RR

Before:
628560
628056
622103
622744
627202
[...]
   268,803,947,669      cycles                 ( +-  0.09% )

After:
636300
634106
634984
638555
634188
[...]
   259,237,291,449      cycles                 ( +-  0.19% )

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Link: https://lore.kernel.org/r/20190927101210.23856-3-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: qlge: Fix irq masking in INTx mode
Benjamin Poirier [Fri, 27 Sep 2019 10:11:55 +0000 (19:11 +0900)]
staging: qlge: Fix irq masking in INTx mode

Tracing the driver operation reveals that the INTR_EN_EN bit (per-queue
interrupt control) does not immediately prevent rx completion interrupts
when the device is operating in INTx mode. This leads to interrupts being
raised while napi is scheduled/running. Those interrupts are ignored by
qlge_isr() and falsely reported as IRQ_NONE thanks to the irq_cnt scheme.
This in turn can cause frames to loiter in the receive queue until a later
frame leads to another rx interrupt that will schedule napi.

Use the INTR_EN_EI bit (master interrupt control) instead.

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Link: https://lore.kernel.org/r/20190927101210.23856-2-bpoirier@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: implement the rest of mac80211 API
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:48 +0000 (14:25 +0000)]
staging: wfx: implement the rest of mac80211 API

Finish to fill struct ieee80211_ops with necessary callbacks. Driver is
now ready to be registered to mac80211.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-21-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: implement 802.11 key handling
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:47 +0000 (14:25 +0000)]
staging: wfx: implement 802.11 key handling

wfx_set_key() mostly copy bytes on correct offsets. A big piece of code
for a simple work. Unfortunately, I did not found any way to factorize
it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-20-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: allow to scan networks
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:47 +0000 (14:25 +0000)]
staging: wfx: allow to scan networks

Chip can make foreground scan or background, but both can't be mixed in
same request. So, we need to split each mac80211 requests into multiple
HIF requests.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-19-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: allow to receive 802.11 frames
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:46 +0000 (14:25 +0000)]
staging: wfx: allow to receive 802.11 frames

Again, this task is more complex than it should since driver try to
handle itself power saving of stations.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-18-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: allow to send 802.11 frames
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:45 +0000 (14:25 +0000)]
staging: wfx: allow to send 802.11 frames

Three things make this task more complex than it should:
  - Chip necessitate to associate a link-id to each station. It is same
    thing than association ID but, using 8 bits only.
  - Rate policy is sent separately from Tx frames
  - Driver try to handle itself power saving of stations and multicast
    data

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-17-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: add debug files and trace debug events
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:44 +0000 (14:25 +0000)]
staging: wfx: add debug files and trace debug events

Add traces when debug events happen and allow to ask internal
information to chip.

These features work independently from mac80211.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-16-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: setup initial chip configuration
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:44 +0000 (14:25 +0000)]
staging: wfx: setup initial chip configuration

A few tasks remain to be done in order to finish chip initial
configuration:
   - configure chip to use multi-tx confirmation (speed up data
     transfer)
   - configure chip to use wake-up feature (save power consumption
     during runtime)
   - set hardware configuration (clocks, RF, pinout, etc...) using a
     Platform Data Set (PDS) file

On release, driver completely shutdown the chip to save power
consumption.

Documentation about PDS and PDS data for sample boards are available
here[1]. One day, PDS data may find a place in device tree but,
currently, PDS is too much linked with firmware to allowing that.

This patch also add "send_pds" file in debugfs to be able to dynamically
change PDS (only for debug, of course).

[1]: https://github.com/SiliconLabs/wfx-firmware/tree/master/PDS

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-15-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: introduce "secure link"
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:43 +0000 (14:25 +0000)]
staging: wfx: introduce "secure link"

Chip support encryption of the link between host and chip. This feature
is called "secure link". Driver code on github[1] support it. However,
it relies on mbedtls for cryptographic functions. So, I decided to not
import this feature in current patch. However, in order to keep code
synchronized between github and kernel, I imported all code related to
this feature, even if most of it is just no-op.

[1]: https://github.com/SiliconLabs/wfx-linux-driver/

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-14-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: add HIF commands helpers
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:43 +0000 (14:25 +0000)]
staging: wfx: add HIF commands helpers

Provide an abstraction for HIF commands.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-13-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: allow to send commands to chip
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:42 +0000 (14:25 +0000)]
staging: wfx: allow to send commands to chip

Chip has multiple input buffers and can handle multiple 802.11 frames
in parallel. However, other HIF command must be sent sequentially.
wsm_send_cmd() handles these requests.

This commit also add send_hif_cmd in debugfs. This file allows to send
arbitrary commands to chip. It can be used for debug and testing.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-12-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: instantiate mac80211 data
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:41 +0000 (14:25 +0000)]
staging: wfx: instantiate mac80211 data

Allocate a struct ieee80211_hw but do not yet register it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-11-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: add support for start-up indication
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:41 +0000 (14:25 +0000)]
staging: wfx: add support for start-up indication

Once firmware is loaded, it send a first indication to host. This
indication signalize that host can start to communicate with firmware.
In add, it contains information about chip and firmware (MAC addresses,
firmware version, etc...).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-10-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: add tracepoints for HIF
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:40 +0000 (14:25 +0000)]
staging: wfx: add tracepoints for HIF

These tracepoints decode HIF headers and provide more human readable
results.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-9-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: add IRQ handling
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:40 +0000 (14:25 +0000)]
staging: wfx: add IRQ handling

bh_work() is in charge to schedule all HIF message from/to chip.

On normal operation, when an IRQ is received, driver can get size of
next message in control register. In order to save control register
access, when chip send a message, it also appends a copy of control
register after the message (this register is not accounted in message
length declared in message header, but must accounted in bus request).
This copy of control register is called "piggyback".

It also handles a power saving mechanism specific to WFxxx series. This
mechanism is based on a GPIO called "wakeup" GPIO. Obviously, this gpio
is not part of SPI/SDIO standard buses and must be declared
independently (this is the main reason for why SDIO mode try to get
parameters from DT).

When wakeup is enabled, host can communicate with chip only if it is
awake. To wake up chip, there are two cases:
    - host receive an IRQ from chip (chip initiate communication): host
      just have to set wakeup GPIO before reading data
    - host want to send data to chip: host set wakeup GPIO, then wait
      for an IRQ (in fact, wait for an empty message) and finally send data

bh_work() is also in charge to track usage of chip buffers. Normally
each request expect a confirmation. However, you can notice that special
"multi tx" confirmation can acknowledge multiple requests at time.

Finally, note that wfx_bh_request_rx() is not atomic (because of
control_reg_read()). So, in SPI mode, hard-irq handler only postpone all
processing to wfx_spi_request_rx().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-8-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: import HIF API headers
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:39 +0000 (14:25 +0000)]
staging: wfx: import HIF API headers

These files are shared with firmware sources. Only a subset of these
definitions are used by driver but, for now, it is easier to import all.

API defines 3 kinds of messages:
   - Requests (req) are sent from host to chip
   - Confirmations (cnf) are sent by chip and are always in reply to a
     request
   - Indications (ind) are spontaneous message from chip to host

One request normally generate one confirmation. There are a few
exceptions to this rule:
   - "shutdown" request is not acknowledged
   - multiple tx request can be acknowledged a unique "multi-tx"
     confirmation

In add, API defines MIB. They are sub-structures for write_mib and
read_mib API.

Note that all numbers in API have to be little endian when sent/received
from/to chip (I didn't declared them with __le32 because driver also use
them internally).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: load firmware
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:38 +0000 (14:25 +0000)]
staging: wfx: load firmware

A firmware is necessary to run the chip. wfx_init_device() is in charge
of loading firmware on chip and doing low level initialization.

Firmwares for WF200 are available here:

  https://github.com/SiliconLabs/wfx-firmware/

Note that firmware are encrypted. Driver checks that key used to encrypt
firmware match with key burned into chip.

Currently, "C0" key is used for production chips.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-6-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: add tracepoints for I/O access
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:38 +0000 (14:25 +0000)]
staging: wfx: add tracepoints for I/O access

Some tracepoints are useful for debugging.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: add I/O API
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:37 +0000 (14:25 +0000)]
staging: wfx: add I/O API

hwio.c provides an abstraction to access different types of register of
the chip.

Note that only data register (aka FRAME_OUT) and control register are
used normal communication. Other registers are only used during chip
start up.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: add support for I/O access
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:37 +0000 (14:25 +0000)]
staging: wfx: add support for I/O access

Introduce bus level communication layer. At this level, 7 registers can
be addressed.

Notice that SPI driver is able to manage chip reset. SDIO mode relies
on an external driver (`mmc-pwrseq`) to reset chip.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wfx: add infrastructure for new driver
Jérôme Pouiller [Thu, 19 Sep 2019 14:25:36 +0000 (14:25 +0000)]
staging: wfx: add infrastructure for new driver

Instantiate build infrastructure WFx driver. This driver provides support
for Wifi chipset Silicon Labs WF200 and further:

   https://www.silabs.com/documents/public/data-sheets/wf200-datasheet.pdf

This chip support SPI and SDIO bus.

SDIO interface has two particularities:
    1. Some parameters may be useful for end user (I will talk about
       gpio_wakeup later).
    2. The SDIO VID and PID of WF200 are 0000:0001 which are too much
       generic to rely on.

So, current code checks VID/PID and looks for a node in DT (since WF200
targets embedded platforms, I don't think it is a problem to rely on
DT). DT can also be used to define to parameters for driver. Currently,
if no node is found, a warning is emitted, but it could be changed in
error.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-2-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: exfat: explain the fs_sync() issue in TODO
Valdis Klētnieks [Wed, 2 Oct 2019 19:01:35 +0000 (15:01 -0400)]
staging: exfat: explain the fs_sync() issue in TODO

We've seen several incorrect patches for fs_sync() calls in the exfat driver.
Add code to the TODO that explains this isn't just a delete code and refactor,
but that actual analysis of when the filesystem should be flushed to disk
needs to be done.

Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Link: https://lore.kernel.org/r/9837.1570042895@turing-police
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: exfat: fix fs_sync() calls.
Valdis Klētnieks [Wed, 2 Oct 2019 19:16:24 +0000 (15:16 -0400)]
staging: exfat: fix fs_sync() calls.

The majority of them were totally backwards.  Change the logic
so that if DELAYED_SYNC *isn't* in the config, we actually flush to disk
before flagging the file system as clean.

That leaves two calls in the DELAYED_SYNC case.  More detailed
analysis is needed to make sure that's what's really needed, or if other
call sites also need a fs_sync() call.  This patch is at least "less wrong"
than the code was, but further changes should be another patch.

Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Link: https://lore.kernel.org/r/11092.1570043784@turing-police
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: cleanup comments in update_hw_ht_param
Michael Straube [Thu, 3 Oct 2019 12:25:14 +0000 (14:25 +0200)]
staging: rtl8188eu: cleanup comments in update_hw_ht_param

Cleanup comments in update_hw_ht_param to follow kernel coding style
and avoid line length over 80 characters.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191003122514.1760-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: cleanup whitespace in update_hw_ht_param
Michael Straube [Thu, 3 Oct 2019 12:25:13 +0000 (14:25 +0200)]
staging: rtl8188eu: cleanup whitespace in update_hw_ht_param

Replace tabs with spaces in declarations and reomve two blank lines in
update_hw_ht_param to cleanup whitespace and improve readability.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191003122514.1760-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>