Commit Graph

1014064 Commits

Author SHA1 Message Date
Marco Cesati
5429b11fa0 Staging: rtl8723bs: remove named enums in rtw_xmit.h
Remove the following unnecessary enum definition in
include/rtw_xmit.h:

	enum txdesc_sc

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-21-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:02 +01:00
Marco Cesati
65724245ce Staging: rtl8723bs: remove named enums in rtw_mlme_ext.h
Remove the following unnecessary enum names or definitions in
include/rtw_mlme_ext.h:

	enum rt_channel_domain		[name]
	enum rt_channel_domain_2g	[name]
	enum rt_channel_domain_5g	[name]
	enum Associated_AP		[definition]
	enum ht_iot_peer_e		[name]
	enum scan_state			[name]
	enum rtw_c2h_event		[name]

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-20-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:02 +01:00
Marco Cesati
ecebe41e51 Staging: rtl8723bs: remove named enums in hal_phy.h
Remove the following unnecessary enum names or definitions in
include/hal_phy.h:

	enum rf_type			[name]
	enum antenna_path		[definition]
	enum rf_content			[definition]
	enum BaseBand_Config_Type	[definition]
	enum hw_block			[definition]

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-19-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:02 +01:00
Marco Cesati
9c2c652f06 Staging: rtl8723bs: remove named enums in rtl8723b_hal.h
Remove the following unnecessary enum names in
include/rtl8723b_hal.h:

	enum c2h_evt
	enum package_type_e

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-18-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:01 +01:00
Marco Cesati
9666bfa568 Staging: rtl8723bs: remove named enums in wifi.h
Remove the following unnecessary enum names or definitions in
include/wifi.h:

	enum wifi_frame_type		[name]
	enum wifi_frame_subtype		[name]
	enum wifi_reg_domain		[definition]
	enum p2p_proto_wk_id		[definition]

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-17-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:01 +01:00
Marco Cesati
38936ed5d1 Staging: rtl8723bs: remove named enums in rtw_wifi_regd.h
Remove the following unnecessary enum definition in
include/rtw_wifi_regd.h:

	enum country_code_type_t

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-16-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:01 +01:00
Marco Cesati
c0c79e9f6d Staging: rtl8723bs: remove named enums in hal_com_h2c.h
Remove the following unnecessary enum definition in
include/hal_com_h2c.h:

	enum h2c_cmd

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-15-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:01 +01:00
Marco Cesati
dd210c1dd3 Staging: rtl8723bs: remove named enums in rtl8723b_cmd.h
Remove the following unnecessary enum name in
include/rtl8723b_cmd.h:

	enum h2c_cmd_8723B

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-14-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:01 +01:00
Marco Cesati
2148216174 Staging: rtl8723bs: remove named enums in rtw_pwrctrl.h
Remove the following unnecessary enum names in
include/rtw_pwrctrl.h:

	enum Power_Mgnt
	enum _PS_BBRegBackup_

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-13-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:01 +01:00
Marco Cesati
67a1a97d64 Staging: rtl8723bs: remove named enums in hal_intf.h
Remove the following unnecessary enum names or definitions in
include/hal_intf.h:

	enum rtl871x_hci_type		[name]
	enum hw_variables		[name]
	enum rt_eeprom_type		[definition]
	enum wowlan_subcode		[definition]

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-12-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:01 +01:00
Marco Cesati
0cf217a447 Staging: rtl8723bs: remove named enums in osdep_service.h
Remove the following unnecessary enum definitions in
include/osdep_service.h:

	enum mstat_f
	enum mstat_status

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-11-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:01 +01:00
Marco Cesati
348516fa39 Staging: rtl8723bs: remove named enums in rtw_mp.h
Remove the following unnecessary enum definitions in
include/rtw_mp.h:

	enum mp_mode
	enum mpt_rate_index
	enum power_mode
	enum ofdm_tx_mode
	enum encry_ctrl_state
	enum mpt_txpwr_def

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-10-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:01 +01:00
Marco Cesati
7e9f6dcc03 Staging: rtl8723bs: remove named enums in wlan_bssdef.h
Remove the following unnecessary enum names or definitions in
include/wlan_bssdef.h:

	enum ndis_802_11_wep_status		[name]
	enum ndis_802_11_reload_defaults	[definition]
	enum vrtl_carrier_sense			[name]
	enum vcs_type				[name]
	enum uapsd_max_sp			[name]

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-9-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:01 +01:00
Marco Cesati
56b89735f3 Staging: rtl8723bs: remove named enums in rtw_ht.h
Remove the following unnecessary enum names in
include/rtw_ht.h:

	enum aggre_size_e
	enum rt_ht_inf0_capbility
	enum rt_ht_inf1_capbility

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-8-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:01 +01:00
Marco Cesati
145d91b778 Staging: rtl8723bs: remove named enums in drv_types.h
Remove the following unnecessary enum names or definitions in
include/drv_types.h:

	enum _nic_version	[definition]
	enum _iface_type	[name]
	enum adapter_type	[definition]
	enum driver_state	[name]

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-7-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:01 +01:00
Marco Cesati
555665d98e Staging: rtl8723bs: remove named enums in rtw_recv.h
Remove the following unnecessary enum name in
include/rtw_recv.h:

	enum rx_packet_type

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-6-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:01 +01:00
Marco Cesati
fc3e6754b1 Staging: rtl8723bs: remove named enums in hal_com.h
Remove the following unnecessary enum definition in
include/hal_com.h:

	enum firmware_source

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-5-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:00 +01:00
Marco Cesati
463cc86e1c Staging: rtl8723bs: remove named enums in rtw_eeprom.h
Remove the following unnecessary enum name
include/rtw_eeprom.h:

	enum rt_customer_id

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-4-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:00 +01:00
Marco Cesati
d5e7c6b387 Staging: rtl8723bs: remove named enums in rtw_cmd.h
Remove the following unnecessary enum names in
include/rtw_cmd.h:

	enum rtw_drvextra_cmd_id
	enum lps_ctrl_type
	enum rfintfs
	enum rtw_h2c_cmd

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-3-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:00 +01:00
Marco Cesati
cc8c7cca30 Staging: rtl8723bs: remove named enums in rtw_mlme.h
Remove the following unnecessary enum names or definitions in
include/rtw_mlme.h:

	enum dot11AuthAlgrthmNum	[name]
	enum  _band			[name]
	enum DriverInterface		[definition]
	enum scan_result_type		[definition]

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-2-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:03:00 +01:00
Bruno Raoult
5005ac4d2f r8192U_wx.c: style: avoid multiple blank lines
fix checkpatch.pl check:

CHECK: Please don't use multiple blank lines
in drivers/staging/rtl8192u/r8192U_wx.c

Signed-off-by: Bruno Raoult <braoult@gmail.com>
Link: https://lore.kernel.org/r/2c1f2c668d299ce1895ce97dc7fb9a67d3723e63.1616748922.git.braoult@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:01:16 +01:00
Bruno Raoult
8d8b93ee35 r8192U_wx.c: style: Unnecessary parentheses
fix checkpatch.pl check:

CHECK: Unnecessary parentheses around expr
in drivers/staging/rtl8192u/r8192U_wx.c

Signed-off-by: Bruno Raoult <braoult@gmail.com>
Link: https://lore.kernel.org/r/f42993e183e1127dcc9fce3f0ed42dd6d795c647.1616748922.git.braoult@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:01:15 +01:00
Bruno Raoult
b95dd839d7 r8192U_wx.c: style: braces all arms of statement
fix checkpatch.pl check:

CHECK: braces {} should be used on all arms of this statement
in drivers/staging/rtl8192u/r8192U_wx.c

Signed-off-by: Bruno Raoult <braoult@gmail.com>
Link: https://lore.kernel.org/r/adbbb5243dca7998a31a786eef277bd85068c63a.1616748922.git.braoult@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:01:15 +01:00
Bruno Raoult
0c98c5e93b r8192U_wx.c: style: spaces preferred around operators
fix checkpatch.pl check:

CHECK: spaces required around that <op>
in drivers/staging/rtl8192u/r8192U_wx.c

Signed-off-by: Bruno Raoult <braoult@gmail.com>
Link: https://lore.kernel.org/r/e7298c14538ad7a58720585d019a70f637e0cdb1.1616748922.git.braoult@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:01:15 +01:00
Bruno Raoult
619ee818fa r8192U_wx.c: style: alignment with open parenthesis
fix checkpatch.pl check:

CHECK: Alignment should match open parenthesis
in drivers/staging/rtl8192u/r8192U_wx.c

Signed-off-by: Bruno Raoult <braoult@gmail.com>
Link: https://lore.kernel.org/r/34f4134241f49d1694cbfb9c2185e3ef54284680.1616748922.git.braoult@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:01:15 +01:00
Swen Kalski
d70fb89711 Staging: comedi: remove unnecessary else statement
Removal of an unnecessary else in statging/comedi/comedi_buf.c
Add an early Return and removed the unleashed the else condition
for better readability int staging/comedi drivers.

Signed-off-by: Swen Kalski <kalski.swen@gmail.com>
Link: https://lore.kernel.org/r/20210325133520.GA594125@m17r3en
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 15:00:16 +01:00
Wan Jiabing
6f08cc6c2f drivers: staging: rtl8712: _adapter is declared twice
struct _adapter has been declared at 23rd line.
Remove the duplicate.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Link: https://lore.kernel.org/r/20210325080050.861273-1-wanjiabing@vivo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 14:59:33 +01:00
Colin Ian King
0933e51a0b staging: rtl8188eu: Fix null pointer dereference on free_netdev call
An unregister_netdev call checks if pnetdev is null, hence a later
call to free_netdev can potentially be passing a null pointer, causing
a null pointer dereference. Avoid this by adding a null pointer check
on pnetdev before calling free_netdev.

Fixes: 1665c8fdff ("staging: rtl8188eu: use netdev routines for private data")
Reviewed-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210324152135.254152-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 14:58:57 +01:00
Coiby Xu
d8827ae8e2 staging: qlge: deal with the case that devlink_health_reporter_create fails
devlink_health_reporter_create may fail. In that case, do the cleanup
work.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Coiby Xu <coxu@redhat.com>
Link: https://lore.kernel.org/r/20210324010002.109846-1-coxu@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 14:58:13 +01:00
Randy Dunlap
2d93018fe6 gpiolib: some edits of kernel docs for clarity
Fix a few typos and some punctuation. Also, change CONFIG_OF to
CONFIG_OF_GPIO in one comment.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: linux-gpio@vger.kernel.org
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
[Bartosz: tweaked the commit message]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-03-26 14:56:19 +01:00
Randy Dunlap
b0922c0732 tools: gpio-utils: fix various kernel-doc warnings
Fix several problems in kernel-doc notation in gpio-utils.c.

gpio-utils.c:37: warning: Incorrect use of kernel-doc format:  * gpiotools_request_line() - request gpio lines in a gpiochip
gpio-utils.c:61: warning: expecting prototype for doc(). Prototype was for gpiotools_request_line() instead
gpio-utils.c:265: warning: Excess function parameter 'value' description in 'gpiotools_sets'
gpio-utils.c:1: warning: 'gpiotools_request_lines' not found

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-03-26 14:56:19 +01:00
Linus Walleij
4a5c9da4ec gpio: Mention GPIO MUX in docs
There is now a GPIO multiplexer, so mention this in the document
about drivers using GPIO as backend.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-03-26 14:56:19 +01:00
Andy Shevchenko
81dd500b1c gpio: mockup: Adjust documentation to the code
First of all one of the parameter missed 'mockup' in its name,
Second, the semantics of the integer pairs depends on the sign
of the base (the first value in the pair).

Update documentation to reflect the real code behaviour.

Fixes: 2fd1abe99e ("Documentation: gpio: add documentation for gpio-mockup")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-03-26 14:56:19 +01:00
Andy Shevchenko
e5391a02bc gpio: mockup: Drop duplicate NULL check in gpio_mockup_unregister_pdevs()
Since platform_device_unregister() is NULL-aware, we don't need to duplicate
this check. Remove it and fold the rest of the code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-03-26 14:56:19 +01:00
Andy Shevchenko
266315fb7c gpiolib: Fold conditionals into a simple ternary operator
It's quite spread code to initialize IRQ domain options.
Let's fold it into a simple oneliner.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-03-26 14:56:19 +01:00
Andy Shevchenko
5c63a9dbab gpiolib: Reuse device's fwnode to create IRQ domain
When IRQ domain is created for an ACPI case, the name of it becomes unknown-%d
since for now it utilizes of_node member only and doesn't consider fwnode case.
Convert IRQ domain creation code to utilize fwnode instead.

Before/After the change on Intel Galileo Gen 2 with two GPIO (IRQ) controllers:

  unknown-1	==>	\_SB.PCI0.GIP0.GPO
  unknown-2	==>	\_SB.NIO3

Due to the nature of this change we may also deduplicate the WARN():s
because in either case (DT or ACPI) the fwnode will be set correctly
and %pfw is an equivalent to what the current code prints as a prefix.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-03-26 14:56:18 +01:00
Andy Shevchenko
515321acb5 gpiolib: Introduce acpi_gpio_dev_init() and call it from core
In the ACPI case we may use the firmware node in the similar way
as it's done for OF case. We may use that fwnode for other purposes
in the future.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-03-26 14:56:18 +01:00
Andy Shevchenko
1df62542e0 gpiolib: Move of_node operations to gpiolib-of and correct fwnode use
The initial value of the OF node based on presence of parent, but
at the same time this operation somehow appeared separately from others
that handle the OF case. On the other hand there is no need to assign
dev->fwnode in the OF case if code properly retrieves fwnode, i.e.
via dev_fwnode() helper.

Amend gpiolib.c and gpiolib-of.c code in order to group OF operations.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-03-26 14:56:18 +01:00
Andy Shevchenko
944f4b0af9 gpiolib: Unify the checks on fwnode type
We have (historically) different approaches how we identify the type
of a given fwnode. Let's standardize them across the library code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-03-26 14:56:18 +01:00
Andy Shevchenko
67196fea0f irqdomain: Introduce irq_domain_create_simple() API
Linus Walleij pointed out that ird_domain_add_simple() gained
additional functionality and can't be anymore replaced with
a simple conditional. In preparation to upgrade GPIO library
to use fwnode, introduce irq_domain_create_simple() API which is
functional equivalent to the existing irq_domain_add_simple(),
but takes a pointer to the struct fwnode_handle as a parameter.

While at it, amend documentation to mention irq_domain_create_*()
functions where it makes sense.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-03-26 14:56:18 +01:00
Jonathan Neuschäfer
3fd19d4b56 docs: driver-api: gpio: consumer: Mark another line of code as such
Make it so that this #include line is rendered in monospace, like other
code blocks.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2021-03-26 14:56:18 +01:00
Artur Petrosyan
93f672804b usb: dwc2: Prevent core suspend when port connection flag is 0
In host mode port connection status flag is "0" when loading
the driver. After loading the driver system asserts suspend
which is handled by "_dwc2_hcd_suspend()" function. Before
the system suspend the port connection status is "0". As
result need to check the "port_connect_status" if it is "0",
then skipping entering to suspend.

Cc: <stable@vger.kernel.org> # 5.2
Fixes: 6f6d70597c ("usb: dwc2: bus suspend/resume for hosts with DWC2_POWER_DOWN_PARAM_NONE")
Signed-off-by: Artur Petrosyan <Arthur.Petrosyan@synopsys.com>
Link: https://lore.kernel.org/r/20210326102510.BDEDEA005D@mailhost.synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 14:51:34 +01:00
Artur Petrosyan
5e3bbae8ee usb: dwc2: Fix HPRT0.PrtSusp bit setting for HiKey 960 board.
Increased the waiting timeout for HPRT0.PrtSusp register field
to be set, because on HiKey 960 board HPRT0.PrtSusp wasn't
generated with the existing timeout.

Cc: <stable@vger.kernel.org> # 4.18
Fixes: 22bb5cfdf1 ("usb: dwc2: Fix host exit from hibernation flow.")
Signed-off-by: Artur Petrosyan <Arthur.Petrosyan@synopsys.com>
Acked-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Link: https://lore.kernel.org/r/20210326102447.8F7FEA005D@mailhost.synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 14:51:22 +01:00
Tony Lindgren
92af4fc6ec usb: musb: Fix suspend with devices connected for a64
Pinephone running on Allwinner A64 fails to suspend with USB devices
connected as reported by Bhushan Shah <bshah@kde.org>. Reverting
commit 5fbf7a2534 ("usb: musb: fix idling for suspend after
disconnect interrupt") fixes the issue.

Let's add suspend checks also for suspend after disconnect interrupt
quirk handling like we already do elsewhere.

Fixes: 5fbf7a2534 ("usb: musb: fix idling for suspend after disconnect interrupt")
Reported-by: Bhushan Shah <bshah@kde.org>
Tested-by: Bhushan Shah <bshah@kde.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20210324071142.42264-1-tony@atomide.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 14:50:59 +01:00
Chunfeng Yun
6f978a30c9 usb: xhci-mtk: fix broken streams issue on 0.96 xHCI
The MediaTek 0.96 xHCI controller on some platforms does not
support bulk stream even HCCPARAMS says supporting, due to MaxPSASize
is set a default value 1 by mistake, here use XHCI_BROKEN_STREAMS
quirk to fix it.

Fixes: 94a631d91a ("usb: xhci-mtk: check hcc_params after adding primary hcd")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1616482975-17841-4-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 14:50:44 +01:00
Wesley Cheng
5aef629704 usb: dwc3: gadget: Clear DEP flags after stop transfers in ep disable
Ensure that dep->flags are cleared until after stop active transfers
is completed.  Otherwise, the ENDXFER command will not be executed
during ep disable.

Fixes: f09ddcfcb8 ("usb: dwc3: gadget: Prevent EP queuing while stopping transfers")
Cc: stable <stable@vger.kernel.org>
Reported-and-tested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Link: https://lore.kernel.org/r/1616610664-16495-1-git-send-email-wcheng@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 14:50:00 +01:00
Shuah Khan
1cc5ed25bd usbip: vhci_hcd fix shift out-of-bounds in vhci_hub_control()
Fix shift out-of-bounds in vhci_hub_control() SetPortFeature handling.

UBSAN: shift-out-of-bounds in drivers/usb/usbip/vhci_hcd.c:605:42
shift exponent 768 is too large for 32-bit type 'int'

Reported-by: syzbot+3dea30b047f41084de66@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20210324230654.34798-1-skhan@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 14:49:03 +01:00
Chunfeng Yun
24327c478b usb: mtu3: drop CONFIG_OF
The driver can match only the devices created by the OF core
via the DT table, so the table should be always used.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1616482975-17841-12-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 14:47:19 +01:00
Chunfeng Yun
a099d36884 usb: mtu3: add support ip-sleep wakeup for MT8192
Add add support ip-sleep wakeup for MT8192, it's a specific
revision, not following IPM rule.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1616482975-17841-11-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 14:46:39 +01:00
Chunfeng Yun
b1a344589e usb: mtu3: support ip-sleep wakeup for MT8183
Add support ip-sleep wakeup for MT8183, it's similar to MT8173,
and it's also a specific one, but not following IPM rule.
Due to the index 2 already used by many DTS, it's better to keep
it unchanged for backward compatibility, treat specific ones without
following IPM rule as revision 1.x, meanwhile reserve 3~10 for later
revision that follows the IPM rule.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1616482975-17841-10-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-26 14:46:14 +01:00