platform/kernel/linux-rpi.git
6 years agostaging: wilc1000: refactor wilc_set_multicast_list() function
Ajay Singh [Tue, 25 Sep 2018 06:23:43 +0000 (11:53 +0530)]
staging: wilc1000: refactor wilc_set_multicast_list() function

Refactor wilc_set_multicast_list() by making below changes:
o use kmalloc_array
o remove unnecessary res
o add u8 *cur_mc
o use i as index
o use '%pM' extension in netdev_dbg()

The below checkpatch issue is also resolved after code refactor.
'spaces preferred around that '/' (ctx:VxV)'

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: use usleep_range() in place of udelay()
Ajay Singh [Tue, 25 Sep 2018 06:23:42 +0000 (11:53 +0530)]
staging: wilc1000: use usleep_range() in place of udelay()

Changes to avoid the below checkpatch warning:

'usleep_range is preferred over udelay; see
Documentation/timers/timers-howto.txt;'

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove unnecessary option used with ccflags-y in Makefile
Ajay Singh [Tue, 25 Sep 2018 06:23:41 +0000 (11:53 +0530)]
staging: wilc1000: remove unnecessary option used with ccflags-y in Makefile

Cleanup patch to remove -I(src) and -DWILC_ASIC_A0 option used in
ccflag-y in Makefile.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove wilc_debugfs.c file as its not used
Ajay Singh [Tue, 25 Sep 2018 06:23:40 +0000 (11:53 +0530)]
staging: wilc1000: remove wilc_debugfs.c file as its not used

Deleted wilc_debugfs.c file as it's not used.

Earlier discussion link:
[1]. https://www.spinics.net/lists/linux-wireless/msg176076.html

Suggested-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove p2p related static variables to wilc_vif struct
Ajay Singh [Tue, 25 Sep 2018 06:23:39 +0000 (11:53 +0530)]
staging: wilc1000: remove p2p related static variables to wilc_vif struct

Avoid use of static variable and move them as part of private
data(wilc_priv) struct.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove unnecessary memset in sdio_init() & wilc_spi_init()
Ajay Singh [Tue, 25 Sep 2018 06:23:38 +0000 (11:53 +0530)]
staging: wilc1000: remove unnecessary memset in sdio_init() & wilc_spi_init()

Cleanup changes to avoid unnecessary setting 'wilc->bus_data' value to
zero as the buffer was allocated using kzalloc().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: avoid use of 'g_spi' static variable
Ajay Singh [Tue, 25 Sep 2018 06:23:37 +0000 (11:53 +0530)]
staging: wilc1000: avoid use of 'g_spi' static variable

Instead of using static variable 'g_spi' move it as part of 'wilc'
struct. Also allocating the memory in the probe function and
free is taken care in wilc_netdev_cleanup().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: avoid use of 'g_sdio' static variable
Ajay Singh [Tue, 25 Sep 2018 06:23:36 +0000 (11:53 +0530)]
staging: wilc1000: avoid use of 'g_sdio' static variable

Instead of using static variable 'g_sdio' move it as part of 'wilc'
struct. Also allocating the memory in the probe function and free during
deinitialization.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove use of unnecessary 'wilc_connected_ssid' variable
Ajay Singh [Tue, 25 Sep 2018 06:23:35 +0000 (11:53 +0530)]
staging: wilc1000: remove use of unnecessary 'wilc_connected_ssid' variable

'wilc_connected_ssid' actually used to store the BSSID information for
connected BSSID. 'wilc_vif' already has 'bssid' variable to store the
same information. So refactor code to remove 'wilc_connected_ssid' and
instead used 'wilc_vif' struct 'bssid' element.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: avoid the use of 'hif_driver_comp' completion variable
Ajay Singh [Tue, 25 Sep 2018 06:23:34 +0000 (11:53 +0530)]
staging: wilc1000: avoid the use of 'hif_driver_comp' completion variable

Instead of using extra completion variable to handle the sync call now
using msg->is_sync flag to handle the sync call.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: rename 'wilc_mac_cfg' struct to 'wilc_cfg_str_vals'
Ajay Singh [Tue, 25 Sep 2018 06:23:33 +0000 (11:53 +0530)]
staging: wilc1000: rename 'wilc_mac_cfg' struct to 'wilc_cfg_str_vals'

Rename 'wilc_mac_cfg' struct to 'wilc_cfg_str_vals' as its more
appropriate for structure to store the values of string configuration.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: refactor code to avoid static variables for config parameters
Ajay Singh [Tue, 25 Sep 2018 06:23:32 +0000 (11:53 +0530)]
staging: wilc1000: refactor code to avoid static variables for config parameters

Refactor the code in wilc_wlan_cfg.c file to avoid the use of static
variables. Move the static variables as part of wilc struct and also
dynamically allocating memory for keeping those variables.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: refactor code to remove 'mac_status' from 'wilc_mac_cfg' struct
Ajay Singh [Tue, 25 Sep 2018 06:23:31 +0000 (11:53 +0530)]
staging: wilc1000: refactor code to remove 'mac_status' from 'wilc_mac_cfg' struct

Refactor the code by removing use of 'mac_status' from 'wilc_mac_cfg'
and only have the string type configuration values in 'wilc_mac_cfg'
struct. Now fetch the value 'WID_STATUS' configuration from 'g_cfg_byte'
array.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove unused wid from cfg struct
Ajay Singh [Tue, 25 Sep 2018 06:23:30 +0000 (11:53 +0530)]
staging: wilc1000: remove unused wid from cfg struct

Cleanup patch to remove the unused element stored in cfg struct.
Removed those wid from the cfg variables whose value is not
fetched(GET_CFG) from the code. In case the wid is only set to the
firmware then there is need to store them as part of cfg variables, so
removed the unused code.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: remove unused wid type values
Ajay Singh [Tue, 25 Sep 2018 06:23:29 +0000 (11:53 +0530)]
staging: wilc1000: remove unused wid type values

Cleanup patch to remove the wid type not used in the code.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: changes 'val' type to u8 in wilc_cfg_byte struct
Ajay Singh [Tue, 25 Sep 2018 06:23:28 +0000 (11:53 +0530)]
staging: wilc1000: changes 'val' type to u8 in wilc_cfg_byte struct

Use the correct datatype for storing the byte value in 'wilc_cfg_byte'
struct.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: set default value of cfg response type in wilc_wlan_cfg_indicate_rx()
Ajay Singh [Tue, 25 Sep 2018 06:23:27 +0000 (11:53 +0530)]
staging: wilc1000: set default value of cfg response type in wilc_wlan_cfg_indicate_rx()

Handle the setting of default value for 'wilc_cfg_rsp' type for all
cases in wilc_wlan_cfg_indicate_rx() as the caller make use of this
value to know the type of the received message.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: refactor wilc_wlan_parse_info_frame() function
Ajay Singh [Tue, 25 Sep 2018 06:23:26 +0000 (11:53 +0530)]
staging: wilc1000: refactor wilc_wlan_parse_info_frame() function

Return 'void' from wilc_wlan_parse_info_frame() as same constant value
is returned always. Also removed the 'size' from input parameter as its
not used in the function.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: change return type to 'void' for wilc_wlan_cfg_indicate_rx()
Ajay Singh [Tue, 25 Sep 2018 06:23:25 +0000 (11:53 +0530)]
staging: wilc1000: change return type to 'void' for wilc_wlan_cfg_indicate_rx()

Cleanup patch to use 'void' return type for wilc_wlan_cfg_indicate_rx(),
as its return value is not used in caller. The value set in
'rsp' argument is used to get the success status.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: use 'void' return for wilc_wlan_txq_filter_dup_tcp_ack()
Ajay Singh [Tue, 25 Sep 2018 06:23:24 +0000 (11:53 +0530)]
staging: wilc1000: use 'void' return for wilc_wlan_txq_filter_dup_tcp_ack()

Use 'void' return for wilc_wlan_txq_filter_dup_tcp_ack() as it always
return value '1' and its not used by the caller.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: change return type to 'void' tcp ack filter functions
Ajay Singh [Tue, 25 Sep 2018 06:23:23 +0000 (11:53 +0530)]
staging: wilc1000: change return type to 'void' tcp ack filter functions

Use 'void' return type for below functions as they always return '0' and
their return value is not used by caller.
add_tcp_pending_ack()
update_tcp_session()
add_tcp_pending_ack()

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: use 'void' return for wilc_wlan_txq_add_to_head()
Ajay Singh [Tue, 25 Sep 2018 06:23:22 +0000 (11:53 +0530)]
staging: wilc1000: use 'void' return for wilc_wlan_txq_add_to_head()

Use 'void' return for wilc_wlan_txq_add_to_head() as its always
return '0' value.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: use 'void' return type for host_int_get_assoc_res_info()
Ajay Singh [Tue, 25 Sep 2018 06:23:21 +0000 (11:53 +0530)]
staging: wilc1000: use 'void' return type for host_int_get_assoc_res_info()

Change return type to 'void' for host_int_get_assoc_res_info() as its
return value is not used. 'rcvd_assoc_resp_info_len' parameter value is
used to know the status.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: change return type to 'void' for wilc_wfi_deinit_mon_interface()
Ajay Singh [Tue, 25 Sep 2018 06:23:20 +0000 (11:53 +0530)]
staging: wilc1000: change return type to 'void' for wilc_wfi_deinit_mon_interface()

Use 'void' return type for wilc_wfi_deinit_mon_interface(), as same
value always return.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: change return type to 'void' for wilc_deinit_host_int()
Ajay Singh [Tue, 25 Sep 2018 06:23:19 +0000 (11:53 +0530)]
staging: wilc1000: change return type to 'void' for wilc_deinit_host_int()

Cleanup patch to use 'void' return type for wilc_deinit_host_int(),
as its return value is not used in caller.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: change return type to 'void' for lock init & deinit functions
Ajay Singh [Tue, 25 Sep 2018 06:23:18 +0000 (11:53 +0530)]
staging: wilc1000: change return type to 'void' for lock init & deinit functions

Cleanup patch to use 'void' return type for wlan_deinit_locks() &
wlan_init_locks(), as same value is return.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: change return type to 'void' for wilc_wlan_set_bssid()
Ajay Singh [Tue, 25 Sep 2018 06:23:17 +0000 (11:53 +0530)]
staging: wilc1000: change return type to 'void' for wilc_wlan_set_bssid()

Cleanup patch to use 'void' return type for wilc_wlan_set_bssid(),
as its always returns the same value.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: change return type to 'void' for wilc_frame_register()
Ajay Singh [Tue, 25 Sep 2018 06:23:16 +0000 (11:53 +0530)]
staging: wilc1000: change return type to 'void' for wilc_frame_register()

Cleanup patch to use 'void' return type for wilc_frame_register(), as
its return value is not used.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: wilc1000: Remove unnecessary pointer check
Nathan Chancellor [Thu, 20 Sep 2018 21:26:49 +0000 (14:26 -0700)]
staging: wilc1000: Remove unnecessary pointer check

Clang warns that the address of a pointer will always evaluated as true
in a boolean context:

drivers/staging/wilc1000/linux_wlan.c:267:20: warning: address of
'vif->ndev->dev' will always evaluate to 'true'
[-Wpointer-bool-conversion]
        if (!(&vif->ndev->dev))
            ~  ~~~~~~~~~~~^~~
1 warning generated.

Since this statement always evaluates to false due to the logical not,
remove it.

Link: https://github.com/ClangBuiltLinux/linux/issues/121
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: Use proper enumerated types for Wi-Fi only interface
Nathan Chancellor [Sun, 23 Sep 2018 06:33:01 +0000 (23:33 -0700)]
staging: rtlwifi: Use proper enumerated types for Wi-Fi only interface

Clang warns when one enumerated type is implicitly converted to another.

drivers/staging/rtlwifi/btcoexist/halbtcoutsrc.c:1264:34: warning:
implicit conversion from enumeration type 'enum btc_chip_interface' to
different enumeration type 'enum wifionly_chip_interface'
[-Wenum-conversion]
                wifionly_cfg->chip_interface = BTC_INTF_PCI;
                                             ~ ^~~~~~~~~~~~
drivers/staging/rtlwifi/btcoexist/halbtcoutsrc.c:1267:34: warning:
implicit conversion from enumeration type 'enum btc_chip_interface' to
different enumeration type 'enum wifionly_chip_interface'
[-Wenum-conversion]
                wifionly_cfg->chip_interface = BTC_INTF_USB;
                                             ~ ^~~~~~~~~~~~
drivers/staging/rtlwifi/btcoexist/halbtcoutsrc.c:1270:34: warning:
implicit conversion from enumeration type 'enum btc_chip_interface' to
different enumeration type 'enum wifionly_chip_interface'
[-Wenum-conversion]
                wifionly_cfg->chip_interface = BTC_INTF_UNKNOWN;
                                             ~ ^~~~~~~~~~~~~~~~
3 warnings generated.

Use the values from the correct enumerated type, wifionly_chip_interface.

BTC_INTF_UNKNOWN = WIFIONLY_INTF_UNKNOWN = 0
BTC_INTF_PCI = WIFIONLY_INTF_PCI = 1
BTC_INTF_USB = WIFIONLY_INTF_USB = 2

Link: https://github.com/ClangBuiltLinux/linux/issues/171
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoStaging: rtlwifi: remove unnecessary NULL check
Karthik Nishanth [Sat, 22 Sep 2018 14:23:54 +0000 (14:23 +0000)]
Staging: rtlwifi: remove unnecessary NULL check

The member regd of the struct rtl_priv is true in a boolean context.

drivers/staging/rtlwifi/regd.c:413:27: warning: address of 'rtlpriv->regd' will always
      evaluate to 'true' [-Wpointer-bool-conversion]
        if (!wiphy || !&rtlpriv->regd)
                      ~ ~~~~~~~~~^~~~
1 warning generated.

Link: https://github.com/ClangBuiltLinux/linux/issues/170
Signed-off-by: Karthik Nishanth <nishanthkarthik@live.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vc04_services: Remove spaces after '*'
Aymen Qader [Mon, 24 Sep 2018 17:35:47 +0000 (18:35 +0100)]
staging: vc04_services: Remove spaces after '*'

This patch fixes the checkpatch.pl error:

ERROR: "foo * bar" should be "foo *bar"

in the interface/vchi directory

Signed-off-by: Aymen Qader <qader.aymen@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vc04_services: Remove unused macros
Aymen Qader [Mon, 24 Sep 2018 17:35:46 +0000 (18:35 +0100)]
staging: vc04_services: Remove unused macros

This patch removes the macros and structs associated with the
"vchi_msg_queuev_ex" function, which was previously removed in 49bec49.
Also fixes the checkpatch.pl errors:

ERROR: Macros with complex values should be enclosed in parentheses
ERROR: space required after that ','

Signed-off-by: Aymen Qader <qader.aymen@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vc04_services: Use tabs instead of spaces
Aymen Qader [Mon, 24 Sep 2018 17:35:45 +0000 (18:35 +0100)]
staging: vc04_services: Use tabs instead of spaces

This patch fixes the checkpatch.pl error:

ERROR: code indent should use tabs where possible

in the interface/vchi directory

Signed-off-by: Aymen Qader <qader.aymen@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vc04_services: Fix "space prohibited"
Aymen Qader [Mon, 24 Sep 2018 17:35:44 +0000 (18:35 +0100)]
staging: vc04_services: Fix "space prohibited"

This patch fixes the checkpatch.pl error:

ERROR: space prohibited after/before that open/closed parenthesis

in the interface/vchi directory.

Signed-off-by: Aymen Qader <qader.aymen@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vc04_services: Remove unused vchiq_genversion script
Tuomas Tynkkynen [Fri, 21 Sep 2018 19:56:01 +0000 (22:56 +0300)]
staging: vc04_services: Remove unused vchiq_genversion script

As far as I can tell, this has never been used.

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging/vc04_services: Use correct cache line size
Phil Elwell [Mon, 17 Sep 2018 08:22:21 +0000 (09:22 +0100)]
staging/vc04_services: Use correct cache line size

Use the compatible string in the DTB to select the correct cache line
size for the SoC - 32 for BCM2835, and 64 for BCM2836 and BCM2837.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoDocumentation: filesystems: remove reminiscences of POHMELFS
Vladimir Zapolskiy [Wed, 12 Sep 2018 12:44:19 +0000 (15:44 +0300)]
Documentation: filesystems: remove reminiscences of POHMELFS

The POHMELFS filesystem was removed in 2012 by commit 67435319866f8
("staging: pohmelfs: remove drivers/staging/pohmelfs") promising that
a newer version will be included to the kernel, but unfortunately
it didn't happen.

Since likely any delopment of the filesystem is halted, the change removes
the abandoned POHMELFS documentation from the kernel tree.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: clean function definitions - style
Michael Straube [Wed, 19 Sep 2018 20:40:01 +0000 (22:40 +0200)]
staging: rtl8188eu: clean function definitions - style

Do not line break function definitions where not needed and
move the return type to the same line.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: rename parameter of Hal_GetChnlGroup88E()
Michael Straube [Wed, 19 Sep 2018 20:40:00 +0000 (22:40 +0200)]
staging: rtl8188eu: rename parameter of Hal_GetChnlGroup88E()

Rename function parameter of Hal_GetChnlGroup88E() to avoid CamelCase.
pGroup -> group

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: change return type of Hal_GetChnlGroup88E()
Michael Straube [Wed, 19 Sep 2018 20:39:59 +0000 (22:39 +0200)]
staging: rtl8188eu: change return type of Hal_GetChnlGroup88E()

After the removal of code valid only for 5 GHz the function
Hal_GetChnlGroup88E returns always true.

Change the return type to void and remove the variable bIn24G.

Remove the tests for the return value and the variable bIn24G
from the only user Hal_ReadTxPowerInfo88E().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: remove 5 GHz code from Hal_GetChnlGroup88E()
Michael Straube [Wed, 19 Sep 2018 20:39:58 +0000 (22:39 +0200)]
staging: rtl8188eu: remove 5 GHz code from Hal_GetChnlGroup88E()

Remove code valid only for 5 GHz from Hal_GetChnlGroup88E().
This addresses the below TODO item.

- find and remove remaining code valid only for 5 GHz. Most of the obvious
  ones have been removed, but things like channel > 14 still exist.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Add vbox_bo_k[un]map helper functions
Hans de Goede [Tue, 18 Sep 2018 17:44:38 +0000 (19:44 +0200)]
staging: vboxvideo: Add vbox_bo_k[un]map helper functions

Add vbox_bo_k[un]map helper functions instead of having code directly
poking struct vbox_bo internals.

While touch neighboring code anyways also fix a return -PTR_ERR(info),
which should be return PTR_ERR(info).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Move bo_[un]resere calls into vbox_bo_[un]pin
Hans de Goede [Tue, 18 Sep 2018 17:44:37 +0000 (19:44 +0200)]
staging: vboxvideo: Move bo_[un]resere calls into vbox_bo_[un]pin

We always need to reserve the bo around a pin / unpin, so move the
reservation there.

This allows removing the vbox_fb_[un]pin helpers.

Note this means that we now no longer hold the bo reserved while
k[un]mapping it in vbox_fb.c this is fine as it is not necessary
to hold it reserved for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Fix NULL ptr deref in vbox_set_up_input_mapping()
Hans de Goede [Tue, 18 Sep 2018 17:44:36 +0000 (19:44 +0200)]
staging: vboxvideo: Fix NULL ptr deref in vbox_set_up_input_mapping()

When vbox_set_up_input_mapping() gets called the first crtc might be
disable and not have a fb at all, triggering a NUL ptr deref at:

vbox->input_mapping_width = CRTC_FB(crtci)->width;

Instead of using the fb from the crtc with id 0, just use the fb from
the first crtc with a fb. This is in the single_framebuffer = true path,
so all crtc-s point to the same fb anyways.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Move pin / unpin of fb out of vbox_crtc_set_base_and_mode
Hans de Goede [Tue, 18 Sep 2018 17:44:35 +0000 (19:44 +0200)]
staging: vboxvideo: Move pin / unpin of fb out of vbox_crtc_set_base_and_mode

Move pin / unpin of fb out of vbox_crtc_set_base_and_mode() so that it can
be used to implement the atomic_update drm_plane_helper_func for the primary
plane.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Init fb_info.fix.smem once from fbdev_create
Hans de Goede [Tue, 18 Sep 2018 17:44:34 +0000 (19:44 +0200)]
staging: vboxvideo: Init fb_info.fix.smem once from fbdev_create

The fbdev compat fb gets pinned into VRAM at creation and then gets pinned
a second time when set as scanout buffer and unpinned when replaced, this
means its pin count never becomes less then 1, so it is always at the same
address and there is no need for the vbox_fbdev_set_base() call.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Expose creation of universal primary plane
Hans de Goede [Tue, 18 Sep 2018 17:44:33 +0000 (19:44 +0200)]
staging: vboxvideo: Expose creation of universal primary plane

Let's expose the primary plane initialization inside the vboxvideo driver
in preparation for universal planes and atomic.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Add fl_flag argument to vbox_fb_pin() helper
Hans de Goede [Tue, 18 Sep 2018 17:44:32 +0000 (19:44 +0200)]
staging: vboxvideo: Add fl_flag argument to vbox_fb_pin() helper

Allow specifying where to pin the framebuffer bo, so that this helper can
be used from the cursor code too.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Fold vbox_drm_resume() into vbox_pm_resume()
Hans de Goede [Tue, 18 Sep 2018 17:44:31 +0000 (19:44 +0200)]
staging: vboxvideo: Fold vbox_drm_resume() into vbox_pm_resume()

vbox_pm_resume() is the only caller of vbox_drm_resume(), so squash the
2 functions into 1.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Embed drm_device into driver structure
Hans de Goede [Tue, 18 Sep 2018 17:44:30 +0000 (19:44 +0200)]
staging: vboxvideo: Embed drm_device into driver structure

This is the recommended way to create the drm_device structure,
according to DRM documentation.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Fold driver_load/unload into probe/remove functions
Hans de Goede [Tue, 18 Sep 2018 17:44:29 +0000 (19:44 +0200)]
staging: vboxvideo: Fold driver_load/unload into probe/remove functions

Fold the driver_load / unload functions into the probe / remove functions
now that we are no longer using the deprecated drm_get_pci_dev() mechanism.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Move setup of modesetting from driver_load to mode_init
Hans de Goede [Tue, 18 Sep 2018 17:44:28 +0000 (19:44 +0200)]
staging: vboxvideo: Move setup of modesetting from driver_load to mode_init

Move the setup of drm modesetting config from vbox_driver_load() to
vbox_mode_init().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8712: replace licence header with SPDX licence id
André Lehmann [Wed, 19 Sep 2018 20:40:09 +0000 (22:40 +0200)]
staging: rtl8712: replace licence header with SPDX licence id

fixed warning found by checkpatch

Signed-off-by: André Lehmann <lenneman@web.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Let DRM core handle connector registering
Hans de Goede [Tue, 18 Sep 2018 17:44:27 +0000 (19:44 +0200)]
staging: vboxvideo: Let DRM core handle connector registering

Registering the connector explicitly right after creation is not necessary
for modesetting drivers, because drm_dev_register already takes care of
this on the core side, by calling drm_modeset_register_all.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: olpc_dcon: add a missing dependency
Lubomir Rintel [Tue, 18 Sep 2018 12:36:20 +0000 (14:36 +0200)]
staging: olpc_dcon: add a missing dependency

  WARNING: unmet direct dependencies detected for BACKLIGHT_CLASS_DEVICE
    Depends on [n]: HAS_IOMEM [=y] && BACKLIGHT_LCD_SUPPORT [=n]
    Selected by [y]:
    - FB_OLPC_DCON [=y] && STAGING [=y] && X86 [=y] && OLPC [=y] && FB [=y]
                        && I2C [=y] && (GPIO_CS5535 [=n] || GPIO_CS5535 [=n]=n)

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-mmc: Delete IRQ_MSG() and its users
Nishad Kamdar [Wed, 19 Sep 2018 17:17:19 +0000 (22:47 +0530)]
staging: mt7621-mmc: Delete IRQ_MSG() and its users

This patch removes IRQ_MSG() and its users as currently it is a no-op.

Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: option validation in remount
Chengguang Xu [Wed, 19 Sep 2018 14:53:46 +0000 (22:53 +0800)]
staging: erofs: option validation in remount

Add option validation in remount. After this patch, remount
can change recognized options, and for unknown options remount
will fail and report error.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: code cleanup for erofs_show_options()
Chengguang Xu [Wed, 19 Sep 2018 14:53:45 +0000 (22:53 +0800)]
staging: erofs: code cleanup for erofs_show_options()

Add new helper erofs_get_fault_rate() to get fault rate instead of
directly getting it from sbi, so we can remove the macro check
surrounding it.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: code cleanup for option parsing of fault_injection
Chengguang Xu [Wed, 19 Sep 2018 14:53:44 +0000 (22:53 +0800)]
staging: erofs: code cleanup for option parsing of fault_injection

Define a dummpy function of erofs_build_fault_attr() when macro
CONFIG_EROFS_FAULT_INJECTION is disabled, so that we don't have to
check the macro in calling place. Based on above adjustment,
do proper code cleanup for option parsing of fault_injection.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: simplify return value of `xattr_foreach'
Gao Xiang [Wed, 19 Sep 2018 05:49:10 +0000 (13:49 +0800)]
staging: erofs: simplify return value of `xattr_foreach'

As Dan Carpenter pointed out, there is no need to propagate positive
return values back to its callers.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: add some comments for xattr subsystem
Gao Xiang [Wed, 19 Sep 2018 05:49:09 +0000 (13:49 +0800)]
staging: erofs: add some comments for xattr subsystem

As Dan Carpenter pointed out, it is better to document what
return values of these callbacks in `struct xattr_iter_handlers'
mean and why it->ofs is increased regardless of success or
failure in `xattr_foreach'.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: cleanup `z_erofs_vle_normalaccess_readpages'
Gao Xiang [Wed, 19 Sep 2018 16:06:56 +0000 (00:06 +0800)]
staging: erofs: cleanup `z_erofs_vle_normalaccess_readpages'

This patch introduces `__should_decompress_synchronously' to
cleanup `z_erofs_vle_normalaccess_readpages'.

Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: drop multiref support temporarily
Gao Xiang [Wed, 19 Sep 2018 05:49:07 +0000 (13:49 +0800)]
staging: erofs: drop multiref support temporarily

Multiref support means that a compressed page could have
more than one reference, which is designed for on-disk data
deduplication. However, mkfs doesn't support this mode
at this moment, and the kernel implementation is also broken.

Let's drop multiref support. If it is fully implemented
in the future, it can be reverted later.

Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: fold in `__update_workgrp_llen'
Gao Xiang [Wed, 19 Sep 2018 05:49:06 +0000 (13:49 +0800)]
staging: erofs: fold in `__update_workgrp_llen'

There is the only one user to use `__update_workgrp_llen'.
Fold it in `z_erofs_vle_work_iter_begin' and cleanup related code.

Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: remove redundant CONFIG_EROFS_FS_XATTRs
Gao Xiang [Wed, 19 Sep 2018 05:49:05 +0000 (13:49 +0800)]
staging: erofs: remove redundant CONFIG_EROFS_FS_XATTRs

some CONFIG_EROFS_FS_XATTR conditions were added because of
the historial Linux kernel compatibility, which are unneeded now.

Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: replace BUG_ON with DBG_BUGON in data.c
Chen Gong [Tue, 18 Sep 2018 14:27:28 +0000 (22:27 +0800)]
staging: erofs: replace BUG_ON with DBG_BUGON in data.c

This patch replace BUG_ON with DBG_BUGON in data.c, and add necessary
error handler.

Signed-off-by: Chen Gong <gongchen4@huawei.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: add trace points for reading zipped data
Chen Gong [Tue, 18 Sep 2018 14:27:27 +0000 (22:27 +0800)]
staging: erofs: add trace points for reading zipped data

This patch adds trace points for reading zipped data.

Signed-off-by: Chen Gong <gongchen4@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: avoid magic constants when initializing clusterbits
Gao Xiang [Tue, 18 Sep 2018 14:27:26 +0000 (22:27 +0800)]
staging: erofs: avoid magic constants when initializing clusterbits

Currently erofs only supports clustersize == blocksize.
and clustersize == 2^n * blocksize will be supported in the future.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: complete error handing of z_erofs_do_read_page
Gao Xiang [Tue, 18 Sep 2018 14:27:25 +0000 (22:27 +0800)]
staging: erofs: complete error handing of z_erofs_do_read_page

This patch completes error handing code of z_erofs_do_read_page.
PG_error will be set when some read error happens, therefore
z_erofs_onlinepage_endio will unlock this page without setting
PG_uptodate.

Reviewed-by: Chao Yu <yucxhao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: fix a bug when appling cache strategy
Gao Xiang [Tue, 18 Sep 2018 14:25:36 +0000 (22:25 +0800)]
staging: erofs: fix a bug when appling cache strategy

As described in Kconfig, the last compressed pack should be cached
for further reading for either `EROFS_FS_ZIP_CACHE_UNIPOLAR' or
`EROFS_FS_ZIP_CACHE_BIPOLAR' by design.

However, there is a bug in z_erofs_do_read_page, it will
switch `initial' to `false' at the very beginning before it decides
to cache the last compressed pack.

caching strategy should work properly after appling this patch.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: complete error handing of z_erofs_map_blocks_iter
Gao Xiang [Tue, 18 Sep 2018 14:25:35 +0000 (22:25 +0800)]
staging: erofs: complete error handing of z_erofs_map_blocks_iter

This patch completes error handing of z_erofs_map_blocks_iter
and vle_get_logical_extent_head, including no memory and
io error cases.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: clean up z_erofs_map_blocks_iter
Gao Xiang [Tue, 18 Sep 2018 14:25:34 +0000 (22:25 +0800)]
staging: erofs: clean up z_erofs_map_blocks_iter

This patch mainly introduces `vle_map_blocks_iter_ctx' to clean up
z_erofs_map_blocks_iter and vle_get_logical_extent_head.

It changes the return value of `vle_get_logical_extent_head' to int
for the later error handing. In addition, it also renames `pcn' to
`pblk' since only `pblk' exists in erofs compression ondisk format.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: erofs: fix a missing endian conversion
Gao Xiang [Tue, 18 Sep 2018 14:25:33 +0000 (22:25 +0800)]
staging: erofs: fix a missing endian conversion

This patch fixes a missing endian conversion in
vle_get_logical_extent_head.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: simplify function comments
Michael Straube [Tue, 18 Sep 2018 08:07:11 +0000 (10:07 +0200)]
staging: rtl8188eu: simplify function comments

Simplify function comments to a single line.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: fix lines over 80 characters
Michael Straube [Tue, 18 Sep 2018 08:07:10 +0000 (10:07 +0200)]
staging: rtl8188eu: fix lines over 80 characters

Wrap lines over 80 characters where appropriate to
clear checkpatch warnings.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: add missing spaces around operators
Michael Straube [Tue, 18 Sep 2018 08:07:09 +0000 (10:07 +0200)]
staging: rtl8188eu: add missing spaces around operators

Add missing spaces around '|', '-', and '&' to follow kernel coding
style. Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: fix comparsions to false
Michael Straube [Tue, 18 Sep 2018 08:07:08 +0000 (10:07 +0200)]
staging: rtl8188eu: fix comparsions to false

Use if(!x) instead of if(x == false).

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: fix comparsions to true
Michael Straube [Tue, 18 Sep 2018 08:07:07 +0000 (10:07 +0200)]
staging: rtl8188eu: fix comparsions to true

Use if(x) instead of if(x == true).

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: remove whitespace
Michael Straube [Tue, 18 Sep 2018 08:07:06 +0000 (10:07 +0200)]
staging: rtl8188eu: remove whitespace

Replace tabs with spaces or just remove spaces in declarations.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: remove unnecessary parentheses
Michael Straube [Tue, 18 Sep 2018 08:07:05 +0000 (10:07 +0200)]
staging: rtl8188eu: remove unnecessary parentheses

Remove unnecessary parentheses as reported by checkpatch
and from conditionals.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: simplify calculation
Michael Straube [Tue, 18 Sep 2018 08:07:04 +0000 (10:07 +0200)]
staging: rtl8188eu: simplify calculation

Simplify calcualation:  * 10 / 2  can be reduced to  * 5
Also cleans missing spaces checkpatch issues.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: Fix two sleep-in-atomic-context bugs in _rtw_pwr_wakeup()
Jia-Ju Bai [Sat, 15 Sep 2018 02:49:44 +0000 (10:49 +0800)]
staging: rtl8723bs: Fix two sleep-in-atomic-context bugs in _rtw_pwr_wakeup()

The driver may sleep with holding a spinlock.
The function call paths (from bottom to top) in Linux-4.17 are:

[FUNC] msleep
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c, 1243:
msleep in _rtw_pwr_wakeup
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c, 510:
_rtw_pwr_wakeup in rtw_set_802_11_disassociate
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c, 501:
spin_lock_bh in rtw_set_802_11_disassociate

[FUNC] msleep
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c, 1255:
msleep in _rtw_pwr_wakeup
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c, 510:
_rtw_pwr_wakeup in rtw_set_802_11_disassociate
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c, 501:
spin_lock_bh in rtw_set_802_11_disassociate

To fix these bugs, msleep() is replaced with mdelay().

These bugs are found by my static analysis tool DSAC.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: Fix a sleep-in-atomic-context bug in issue_deauth_ex()
Jia-Ju Bai [Sat, 15 Sep 2018 02:49:28 +0000 (10:49 +0800)]
staging: rtl8723bs: Fix a sleep-in-atomic-context bug in issue_deauth_ex()

The driver may sleep with holding a spinlock.
The function call paths (from bottom to top) in Linux-4.17 are:

[FUNC] msleep
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c, 3805:
msleep in issue_deauth_ex
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c, 6336:
issue_deauth_ex in disconnect_hdl
drivers/staging/rtl8723bs/core/rtw_cmd.c, 963:
disconnect_hdl in rtw_disassoc_cmd
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c, 506:
rtw_disassoc_cmd in rtw_set_802_11_disassociate
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c, 501:
spin_lock_bh in rtw_set_802_11_disassociate

[FUNC] msleep
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c, 3805:
msleep in issue_deauth_ex
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c, 6336:
issue_deauth_ex in disconnect_hdl
drivers/staging/rtl8723bs/core/rtw_cmd.c, 963:
disconnect_hdl in rtw_disassoc_cmd
drivers/staging/rtl8723bs/core/rtw_mlme.c, 2256:
rtw_disassoc_cmd in rtw_select_and_join_from_scanned_queue
drivers/staging/rtl8723bs/core/rtw_mlme.c, 2204:
spin_lock_bh in rtw_select_and_join_from_scanned_queue

To fix this bug, msleep() is replaced with mdelay().

This bug is found by my static analysis tool DSAC.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: greybus: fix spelling mistake "entires" -> "entries"
Colin Ian King [Fri, 14 Sep 2018 11:24:51 +0000 (12:24 +0100)]
staging: greybus: fix spelling mistake "entires" -> "entries"

Trivial fix to spelling mistake

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: dgnc: Fix a sleep-in-atomic-context bug in cls_assert_modem_signals()
Jia-Ju Bai [Sat, 15 Sep 2018 03:13:03 +0000 (11:13 +0800)]
staging: dgnc: Fix a sleep-in-atomic-context bug in cls_assert_modem_signals()

The driver may sleep with holding a spinlock.
The function call path (from bottom to top) in Linux-4.17 is:

[FUNC] usleep_range
drivers/staging/dgnc/dgnc_cls.c, 391:
usleep_range in cls_assert_modem_signals
drivers/staging/dgnc/dgnc_cls.c, 449:
cls_assert_modem_signals in cls_copy_data_from_queue_to_uart
drivers/staging/dgnc/dgnc_cls.c, 406:
_raw_spin_lock_irqsave in cls_copy_data_from_queue_to_uart

To fix this bug, usleep_range() is replaced with udelay().

This bug is found by my static analysis tool DSAC.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: Fix a sleep-in-atomic-context bug in issue_deauth_ex()
Jia-Ju Bai [Sat, 15 Sep 2018 02:57:11 +0000 (10:57 +0800)]
staging: rtl8188eu: Fix a sleep-in-atomic-context bug in issue_deauth_ex()

The driver may sleep with holding a spinlock.
The function call path (from bottom to top) in Linux-4.17 is:

[FUNC] msleep
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c, 1536:
msleep in issue_deauth_ex
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c, 5110:
issue_deauth_ex in disconnect_hdl
drivers/staging/rtl8188eu/core/rtw_cmd.c, 521:
disconnect_hdl in rtw_disassoc_cmd
drivers/staging/rtl8188eu/core/rtw_ioctl_set.c, 352:
rtw_disassoc_cmd in rtw_set_802_11_infrastructure_mode
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c, 1002:
rtw_set_802_11_infrastructure_mode in rtw_wx_set_wap
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c, 988:
spin_lock_bh in rtw_wx_set_wap

To fix this bug, msleep() is replaced with mdelay().

This bug is found by my static analysis tool DSAC.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8188eu: remove code that is valid only for 5 GHz
Robert Węcławski [Fri, 14 Sep 2018 20:04:05 +0000 (22:04 +0200)]
staging: rtl8188eu: remove code that is valid only for 5 GHz

Remove code that is used only for 5 GHz.
This addresses the below TODO item:

- find and remove remaining code valid only for 5 GHz. Most of the obvious
  ones have been removed, but things like channel > 14 still exist.

Signed-off-by: Robert Węcławski <r.weclawski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Drop vbox_bo_unref() helper
Hans de Goede [Tue, 11 Sep 2018 07:15:44 +0000 (09:15 +0200)]
staging: vboxvideo: Drop vbox_bo_unref() helper

Drop the unnecessary vbox_bo_unref() helper and directly call ttm_bo_put()
at the single call site.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Remove vboxfb_create_object() wrapper
Hans de Goede [Tue, 11 Sep 2018 07:15:43 +0000 (09:15 +0200)]
staging: vboxvideo: Remove vboxfb_create_object() wrapper

The vboxfb_create_object() wrapper really does nothing more then just
call vbox_gem_create(), so this commit drops it, replacing it with
a direct call to vbox_gem_create().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Skip currrent crtc when updating crtcs
Hans de Goede [Tue, 11 Sep 2018 07:15:42 +0000 (09:15 +0200)]
staging: vboxvideo: Skip currrent crtc when updating crtcs

In vbox_crtc_set_base_and_mode() we update all the crtcs when the
single_framebuffer setting changes, including the one on which
vbox_crtc_set_base_and_mode() was called, so we end up doing
vbox_do_modeset() on it twice. This commit skips the crtc on which
we are updating in the loop to update the other crtcs.

This commit also removes the vbox_set_view() call from the loop,
vbox_set_view() does not depend on the single_framebuffer setting and it
was being called on the passed in crtc parameter and not on the crtci
local iterator value (typo), so it was a no-op already.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: vboxvideo: Fix modeset / page_flip error handling
Hans de Goede [Tue, 11 Sep 2018 07:15:41 +0000 (09:15 +0200)]
staging: vboxvideo: Fix modeset / page_flip error handling

The default settings for Linux vms created in VirtualBox allocate only
16M of videomem. When running fullscreen on a 1920x1080 (or bigger) monitor
this is not a lot.

When using GNOME3 on Wayland we have already been seeing out of video
memory errors for a while now. After commit 2408898e3b6c ("staging:
vboxvideo: Add page-flip support") this has become much worse as now
multiple buffers are used.

There is nothing we can do about there not being enough video-mem, but
we should handle running out of video-mem properly, currently there are
2 problems with this:

1) vbox_crtc_mode_set() does not check if vbox_crtc_mode_set_base() fails
at all and does not properly propagate the oom error.

2) vbox_crtc_do_set_base() unpins the old fb too soon:

2.1) It unpins it before pinning the new fb, so if the pinning of the new
fb fails (which it will when we run out of video-mem), then we also cannot
fall back to the old-fb as it has been already unpinned. We could try to
re-pin it but there is no guarantee that will succeed.

2.2) It unpins it before reprogramming the hardware to scan out from the
new-fb, which could lead to some ugliness where the hw is scanning out the
oldfb while it is being replaced with something else.

Fixing this requires to do things in this order:
1) Pin the new fb
2) Program the hw
3) Unpin the oldfb

This needs to be done for both a mode_set and for a page_flip so this
commit re-writes vbox_crtc_do_set_base() into vbox_crtc_set_base_and_mode()
which does this in the correct order, putting the hardware programming
which was duplicated between the mode_set and page_flip code inside the
new function.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: page_table: handle failed dma_map_page
Nick Ewalt [Mon, 17 Sep 2018 12:39:05 +0000 (05:39 -0700)]
staging: gasket: page_table: handle failed dma_map_page

Handle dma_map_page failing in gasket_alloc_extended_subtable: free
memory, don't add invalid page table entry.

Signed-off-by: Nick Ewalt <nicholasewalt@google.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: page_table: use total_entries for max ext lvl0 page idx
Nick Ewalt [Mon, 17 Sep 2018 12:39:04 +0000 (05:39 -0700)]
staging: gasket: page_table: use total_entries for max ext lvl0 page idx

The maximum number of entries in the page table is configurable at
initialization time and should be used in gasket_extended_lvl0_page_idx.

Signed-off-by: Nick Ewalt <nicholasewalt@google.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: cleanup if dma_map_page fails in gasket_perform_mapping
Nick Ewalt [Mon, 17 Sep 2018 12:39:03 +0000 (05:39 -0700)]
staging: gasket: cleanup if dma_map_page fails in gasket_perform_mapping

Previously pages would have never been unmapped in this case.

Signed-off-by: Nick Ewalt <nicholasewalt@google.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: fix gasket_free_coherent_memory metadata frees
Nick Ewalt [Mon, 17 Sep 2018 12:39:02 +0000 (05:39 -0700)]
staging: gasket: fix gasket_free_coherent_memory metadata frees

Free gasket_coherent_page_entries metadata memory, update data
structures accordingly.

Signed-off-by: Nick Ewalt <nicholasewalt@google.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: page_table: don't unmap coherent pages
Nick Ewalt [Mon, 17 Sep 2018 12:39:01 +0000 (05:39 -0700)]
staging: gasket: page_table: don't unmap coherent pages

Only call dma_unmap_page if there was an associated dma_map_page call.

Signed-off-by: Nick Ewalt <nicholasewalt@google.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: fix data page unmap DMA direction
Nick Ewalt [Mon, 17 Sep 2018 12:39:00 +0000 (05:39 -0700)]
staging: gasket: fix data page unmap DMA direction

The DMA direction supplied to dma_unmap_page should match the
corresponding dma_map_page call, which is mapped bi-directional.

Signed-off-by: Nick Ewalt <nicholasewalt@google.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: fix DMA direction for extended page tables
Nick Ewalt [Mon, 17 Sep 2018 12:38:59 +0000 (05:38 -0700)]
staging: gasket: fix DMA direction for extended page tables

Extended page tables should be mapped as DMA_TO_DEVICE, not
bi-directional.

Signed-off-by: Nick Ewalt <nicholasewalt@google.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: gasket: page table: use GFP_KERNEL for dma_alloc_coherent
Todd Poynor [Mon, 17 Sep 2018 12:38:58 +0000 (05:38 -0700)]
staging: gasket: page table: use GFP_KERNEL for dma_alloc_coherent

Flags should be specified for dma_alloc_coherent() call.  Use
GFP_KERNEL, it's fine to sleep here.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>