@@ -868,6 +868,9 @@ enum ath10k_dev_flags {/* Indicates that ath10k device is during recovery process and not complete */ATH10K_FLAG_RESTARTING,++/* protected by conf_mutex */+ATH10K_FLAG_NAPI_ENABLED,};enumath10k_cal_mode{
@@ -2075,8 +2075,9 @@ static void ath10k_pci_hif_stop(struct ath10k *ar)ath10k_pci_irq_disable(ar);ath10k_pci_irq_sync(ar);-napi_synchronize(&ar->napi);-napi_disable(&ar->napi);++ath10k_core_napi_sync_disable(ar);+cancel_work_sync(&ar_pci->dump_work);/* Most likely the device has HTT Rx ring configured. The only way to
@@ -1859,7 +1859,7 @@ static int ath10k_sdio_hif_start(struct ath10k *ar)structath10k_sdio*ar_sdio=ath10k_sdio_priv(ar);intret;-napi_enable(&ar->napi);+ath10k_core_napi_enable(ar);/* Sleep 20 ms before HIF interrupts are disabled.*ThiswillgivetargetplentyoftimetoprocesstheBMIdone
From: Joakim Zhang <redacted>
[ Upstream commit 812f0116c66a3ebaf0b6062226aa85574dd79f67 ]
The System Controller Firmware (SCFW) is a low-level system function
which runs on a dedicated Cortex-M core to provide power, clock, and
resource management. It exists on some i.MX8 processors. e.g. i.MX8QM
(QM, QP), and i.MX8QX (QXP, DX). SCU driver manages the IPC interface
between host CPU and the SCU firmware running on M4.
For i.MX8QM, stop mode request is controlled by System Controller Unit(SCU)
firmware, this patch introduces FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW quirk
for this function.
Signed-off-by: Joakim Zhang <redacted>
Link: https://lore.kernel.org/r/20201106105627.31061-6-qiangqing.zhang@nxp.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/can/flexcan.c | 123 ++++++++++++++++++++++++++++++++------
1 file changed, 106 insertions(+), 17 deletions(-)
@@ -9,6 +9,7 @@//// Based on code originally by Andrey Volkov <avolkov@varma-el.com>+#include<dt-bindings/firmware/imx/rsrc.h>#include<linux/bitfield.h>#include<linux/can.h>#include<linux/can/dev.h>
@@ -242,6 +244,8 @@#define FLEXCAN_QUIRK_SUPPORT_FD BIT(9)/* support memory detection and correction */#define FLEXCAN_QUIRK_SUPPORT_ECC BIT(10)+/* Setup stop mode with SCU firmware to support wakeup */+#define FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW BIT(11)/* Structure of the message buffer */structflexcan_mb{
@@ -347,6 +351,7 @@ struct flexcan_priv {u8mb_count;u8mb_size;u8clk_src;/* clock source of CAN Protocol Engine */+u8scu_idx;u64rx_mask;u64tx_mask;
@@ -358,6 +363,9 @@ struct flexcan_priv {structregulator*reg_xceiver;structflexcan_stop_modestm;+/* IPC handle when setup stop mode by System Controller firmware(scfw) */+structimx_sc_ipc*sc_ipc_handle;+/* Read and Write APIs */u32(*read)(void__iomem*addr);void(*write)(u32val,void__iomem*addr);
@@ -1924,6 +1958,58 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev)returnret;}+staticintflexcan_setup_stop_mode_scfw(structplatform_device*pdev)+{+structnet_device*dev=platform_get_drvdata(pdev);+structflexcan_priv*priv;+u8scu_idx;+intret;++ret=of_property_read_u8(pdev->dev.of_node,"fsl,scu-index",&scu_idx);+if(ret<0){+dev_dbg(&pdev->dev,"failed to get scu index\n");+returnret;+}++priv=netdev_priv(dev);+priv->scu_idx=scu_idx;++/* this function could be defered probe, return -EPROBE_DEFER */+returnimx_scu_get_handle(&priv->sc_ipc_handle);+}++/* flexcan_setup_stop_mode - Setup stop mode for wakeup+*+*Return:=0setupstopmodesuccessfullyordoesn'tsupportthisfeature+*<0failtosetupstopmode(couldbedeferedprobe)+*/+staticintflexcan_setup_stop_mode(structplatform_device*pdev)+{+structnet_device*dev=platform_get_drvdata(pdev);+structflexcan_priv*priv;+intret;++priv=netdev_priv(dev);++if(priv->devtype_data->quirks&FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW)+ret=flexcan_setup_stop_mode_scfw(pdev);+elseif(priv->devtype_data->quirks&FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR)+ret=flexcan_setup_stop_mode_gpr(pdev);+else+/* return 0 directly if doesn't support stop mode feature */+return0;++if(ret)+returnret;++device_set_wakeup_capable(&pdev->dev,true);++if(of_property_read_bool(pdev->dev.of_node,"wakeup-source"))+device_set_wakeup_enable(&pdev->dev,true);++return0;+}+staticconststructof_device_idflexcan_of_match[]={{.compatible="fsl,imx8qm-flexcan",.data=&fsl_imx8qm_devtype_data,},{.compatible="fsl,imx8mp-flexcan",.data=&fsl_imx8mp_devtype_data,},
@@ -2054,17 +2140,20 @@ static int flexcan_probe(struct platform_device *pdev)gotofailed_register;}+err=flexcan_setup_stop_mode(pdev);+if(err<0){+if(err!=-EPROBE_DEFER)+dev_err(&pdev->dev,"setup stop mode failed\n");+gotofailed_setup_stop_mode;+}+of_can_transceiver(dev);devm_can_led_init(dev);-if(priv->devtype_data->quirks&FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR){-err=flexcan_setup_stop_mode(pdev);-if(err)-dev_dbg(&pdev->dev,"failed to setup stop-mode\n");-}-return0;+failed_setup_stop_mode:+unregister_flexcandev(dev);failed_register:pm_runtime_put_noidle(&pdev->dev);pm_runtime_disable(&pdev->dev);
From: Tony Lindgren <tony@atomide.com>
[ Upstream commit cb88d01b67383a095e3f7caeb4cdade5a6cf0417 ]
We can currently get a "command execute failure 19" error on beacon loss
if the signal is weak:
wlcore: Beacon loss detected. roles:0xff
wlcore: Connection loss work (role_id: 0).
...
wlcore: ERROR command execute failure 19
...
WARNING: CPU: 0 PID: 1552 at drivers/net/wireless/ti/wlcore/main.c:803
...
(wl12xx_queue_recovery_work.part.0 [wlcore])
(wl12xx_cmd_role_start_sta [wlcore])
(wl1271_op_bss_info_changed [wlcore])
(ieee80211_prep_connection [mac80211])
Error 19 is defined as CMD_STATUS_WRONG_NESTING from the wlcore firmware,
and seems to mean that the firmware no longer wants to see the quirk
handling for WLCORE_QUIRK_START_STA_FAILS done.
This quirk got added with commit 18eab430700d ("wlcore: workaround
start_sta problem in wl12xx fw"), and it seems that this already got fixed
in the firmware long time ago back in 2012 as wl18xx never had this quirk
in place to start with.
As we no longer even support firmware that early, to me it seems that it's
safe to just drop WLCORE_QUIRK_START_STA_FAILS to fix the error. Looks
like earlier firmware got disabled back in 2013 with commit 0e284c074ef9
("wl12xx: increase minimum singlerole firmware version required").
If it turns out we still need WLCORE_QUIRK_START_STA_FAILS with any
firmware that the driver works with, we can simply revert this patch and
add extra checks for firmware version used.
With this fix wlcore reconnects properly after a beacon loss.
Cc: Raz Bouganim <redacted>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kalle Valo <redacted>
Link: https://lore.kernel.org/r/20210115065613.7731-1-tony@atomide.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ti/wl12xx/main.c | 3 ---
drivers/net/wireless/ti/wlcore/main.c | 15 +--------------
drivers/net/wireless/ti/wlcore/wlcore.h | 3 ---
3 files changed, 1 insertion(+), 20 deletions(-)
@@ -547,9 +547,6 @@ wlcore_set_min_fw_ver(struct wl1271 *wl, unsigned int chip,/* Each RX/TX transaction requires an end-of-transaction transfer */#define WLCORE_QUIRK_END_OF_TRANSACTION BIT(0)-/* the first start_role(sta) sometimes doesn't work on wl12xx */-#define WLCORE_QUIRK_START_STA_FAILS BIT(1)-/* wl127x and SPI don't support SDIO block size alignment */#define WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN BIT(2)
@@ -3566,7 +3566,8 @@ static int hci_suspend_notifier(struct notifier_block *nb, unsigned long action,}/* Suspend notifier should only act on events when powered. */-if(!hdev_is_powered(hdev))+if(!hdev_is_powered(hdev)||+hci_dev_test_flag(hdev,HCI_UNREGISTER))gotodone;if(action==PM_SUSPEND_PREPARE){
From: Di Zhu <redacted>
[ Upstream commit 275b1e88cabb34dbcbe99756b67e9939d34a99b6 ]
pktgen create threads for all online cpus and bond these threads to
relevant cpu repecivtily. when this thread firstly be woken up, it
will compare cpu currently running with the cpu specified at the time
of creation and if the two cpus are not equal, BUG_ON() will take effect
causing panic on the system.
Notice that these threads could be migrated to other cpus before start
running because of the cpu hotplug after these threads have created. so the
BUG_ON() used here seems unreasonable and we can replace it with WARN_ON()
to just printf a warning other than panic the system.
Signed-off-by: Di Zhu <redacted>
Link: https://lore.kernel.org/r/20210125124229.19334-1-zhudi21@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/pktgen.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Miaoqing Pan <redacted>
[ Upstream commit b55379e343a3472c35f4a1245906db5158cab453 ]
Failed to transmit wmi management frames:
[84977.840894] ath10k_snoc a000000.wifi: wmi mgmt tx queue is full
[84977.840913] ath10k_snoc a000000.wifi: failed to transmit packet, dropping: -28
[84977.840924] ath10k_snoc a000000.wifi: failed to submit frame: -28
[84977.840932] ath10k_snoc a000000.wifi: failed to transmit frame: -28
This issue is caused by race condition between skb_dequeue and
__skb_queue_tail. The queue of ‘wmi_mgmt_tx_queue’ is protected by a
different lock: ar->data_lock vs list->lock, the result is no protection.
So when ath10k_mgmt_over_wmi_tx_work() and ath10k_mac_tx_wmi_mgmt()
running concurrently on different CPUs, there appear to be a rare corner
cases when the queue length is 1,
CPUx (skb_deuque) CPUy (__skb_queue_tail)
next=list
prev=list
struct sk_buff *skb = skb_peek(list); WRITE_ONCE(newsk->next, next);
WRITE_ONCE(list->qlen, list->qlen - 1);WRITE_ONCE(newsk->prev, prev);
next = skb->next; WRITE_ONCE(next->prev, newsk);
prev = skb->prev; WRITE_ONCE(prev->next, newsk);
skb->next = skb->prev = NULL; list->qlen++;
WRITE_ONCE(next->prev, prev);
WRITE_ONCE(prev->next, next);
If the instruction ‘next = skb->next’ is executed before
‘WRITE_ONCE(prev->next, newsk)’, newsk will be lost, as CPUx get the
old ‘next’ pointer, but the length is still added by one. The final
result is the length of the queue will reach the maximum value but
the queue is empty.
So remove ar->data_lock, and use 'skb_queue_tail' instead of
'__skb_queue_tail' to prevent the potential race condition. Also switch
to use skb_queue_len_lockless, in case we queue a few SKBs simultaneously.
Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.1.c2-00033-QCAHLSWMTPLZ-1
Signed-off-by: Miaoqing Pan <redacted>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <redacted>
Link: https://lore.kernel.org/r/1608618887-8857-1-git-send-email-miaoqing@codeaurora.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ath/ath10k/mac.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
From: Hans de Goede <redacted>
[ Upstream commit 219991e6be7f4a31d471611e265b72f75b2d0538 ]
Some devices, e.g. the RTL8723BS bluetooth part, some USB attached devices,
completely drop from the bus on a system-suspend. These devices will
have their driver unbound and rebound on resume (when the dropping of
the bus gets detected) and will show up as a new HCI after resume.
These devices do not benefit from the suspend / resume handling work done
by the hci_suspend_notifier. At best this unnecessarily adds some time to
the suspend/resume time. But this may also actually cause problems, if the
code doing the driver unbinding runs after the pm-notifier then the
hci_suspend_notifier code will try to talk to a device which is now in
an uninitialized state.
This commit adds a new HCI_QUIRK_NO_SUSPEND_NOTIFIER quirk which allows
drivers to opt-out of the hci_suspend_notifier when they know beforehand
that their device will be fully re-initialized / reprobed on resume.
Signed-off-by: Hans de Goede <redacted>
Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/bluetooth/hci.h | 8 ++++++++
net/bluetooth/hci_core.c | 18 +++++++++++-------
2 files changed, 19 insertions(+), 7 deletions(-)
From: Vsevolod Kozlov <redacted>
[ Upstream commit 6fe91b69ceceea832a73d35185df04b3e877f399 ]
ac_classify() expects a struct sk_buff* as its second argument, which is
a member of struct tx_complete_data. priv happens to be a pointer to
struct tx_complete_data, so passing it directly to ac_classify() leads
to wrong behaviour and occasional panics.
Since there is only one caller of wilc_wlan_txq_add_net_pkt and it
already knows the type behind this pointer, and the structure is already
in the header file, change the function signature to use the real type
instead of void* in order to prevent confusion.
Signed-off-by: Vsevolod Kozlov <redacted>
Signed-off-by: Kalle Valo <redacted>
Link: https://lore.kernel.org/r/YCQomJ1mO5BLxYOT@Vsevolods-Mini.lan
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/microchip/wilc1000/netdev.c | 2 +-
drivers/net/wireless/microchip/wilc1000/wlan.c | 15 ++++++++-------
drivers/net/wireless/microchip/wilc1000/wlan.h | 3 ++-
3 files changed, 11 insertions(+), 9 deletions(-)
From: Hans de Goede <redacted>
[ Upstream commit af4b3a6f36d6c2fc5fca026bccf45e0fdcabddd9 ]
The Predia Basic tablet contains quite generic names in the sys_vendor and
product_name DMI strings, without this patch brcmfmac will try to load:
brcmfmac43340-sdio.Insyde-CherryTrail.txt as nvram file which is a bit
too generic.
Add a DMI quirk so that a unique and clearly identifiable nvram file name
is used on the Predia Basic tablet.
Signed-off-by: Hans de Goede <redacted>
Signed-off-by: Kalle Valo <redacted>
Link: https://lore.kernel.org/r/20210129171413.139880-1-hdegoede@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/wireless/broadcom/brcm80211/brcmfmac/dmi.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
From: Pali Rohár <pali@kernel.org>
[ Upstream commit f0b4f847673299577c29b71d3f3acd3c313d81b7 ]
The Ubiquiti U-Fiber Instant SFP GPON module has nonsensical information
stored in its EEPROM. It claims to support all transceiver types including
10G Ethernet. Clear all claimed modes and set only 1000baseX_Full, which is
the only one supported.
This module has also phys_id set to SFF, and the SFP subsystem currently
does not allow to use SFP modules detected as SFFs. Add exception for this
module so it can be detected as supported.
This change finally allows to detect and use SFP GPON module Ubiquiti
U-Fiber Instant on Linux system.
EEPROM content of this SFP module is (where XX is serial number):
00: 02 04 0b ff ff ff ff ff ff ff ff 03 0c 00 14 c8 ???........??.??
10: 00 00 00 00 55 42 4e 54 20 20 20 20 20 20 20 20 ....UBNT
20: 20 20 20 20 00 18 e8 29 55 46 2d 49 4e 53 54 41 .??)UF-INSTA
30: 4e 54 20 20 20 20 20 20 34 20 20 20 05 1e 00 36 NT 4 ??.6
40: 00 06 00 00 55 42 4e 54 XX XX XX XX XX XX XX XX .?..UBNTXXXXXXXX
50: 20 20 20 20 31 34 30 31 32 33 20 20 60 80 02 41 140123 `??A
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/phy/sfp-bus.c | 15 +++++++++++++++
drivers/net/phy/sfp.c | 17 +++++++++++++++--
2 files changed, 30 insertions(+), 2 deletions(-)
@@ -44,6 +44,17 @@ static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id,phylink_set(modes,2500baseX_Full);}+staticvoidsfp_quirk_ubnt_uf_instant(conststructsfp_eeprom_id*id,+unsignedlong*modes)+{+/* Ubiquiti U-Fiber Instant module claims that support all transceiver+*typesincluding10GEthernetwhichisnottruth.Soclearallclaimed+*modesandsetonlyonemodewhichmodulesupports:1000baseX_Full.+*/+phylink_zero(modes);+phylink_set(modes,1000baseX_Full);+}+staticconststructsfp_quirksfp_quirks[]={{// Alcatel Lucent G-010S-P can operate at 2500base-X, but
From: Alex Elder <redacted>
[ Upstream commit cd1150098f2cc7bd05740c105488c293f6761f5a ]
It's possible that the length passed to ipa_header_size_encoded()
is larger than what can be represented by the HDR_LEN field alone
(starting with IPA v4.5). If we attempted that, u32_encode_bits()
would trigger a build-time error.
Avoid this problem by masking off high-order bits of the value
encoded as the lower portion of the header length.
The same sort of problem exists in ipa_metadata_offset_encoded(),
so implement the same fix there.
Signed-off-by: Alex Elder <redacted>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ipa/ipa_reg.h | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
From: Hans de Goede <redacted>
[ Upstream commit a338c874d3d9d2463f031e89ae14942929b93db6 ]
The Voyo winpad A15 tablet contains quite generic names in the sys_vendor
and product_name DMI strings, without this patch brcmfmac will try to load:
rcmfmac4330-sdio.To be filled by O.E.M.-To be filled by O.E.M..txt
as nvram file which is a bit too generic.
Add a DMI quirk so that a unique and clearly identifiable nvram file name
is used on the Voyo winpad A15 tablet.
While preparing a matching linux-firmware update I noticed that the nvram
is identical to the nvram used on the Prowise-PT301 tablet, so the new DMI
quirk entry simply points to the already existing Prowise-PT301 nvram file.
Signed-off-by: Hans de Goede <redacted>
Signed-off-by: Kalle Valo <redacted>
Link: https://lore.kernel.org/r/20210129171413.139880-2-hdegoede@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../wireless/broadcom/brcm80211/brcmfmac/dmi.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
@@ -44,6 +44,14 @@ static const struct brcmf_dmi_data predia_basic_data = {BRCM_CC_43341_CHIP_ID,2,"predia-basic"};+/* Note the Voyo winpad A15 tablet uses the same Ampak AP6330 module, with the+*exactsamenvramfileastheProwise-PT301tablet.Sincethenvramforthe+*Prowise-PT301isalreadyinlinux-firmwarewejustpointtothathere.+*/+staticconststructbrcmf_dmi_datavoyo_winpad_a15_data={+BRCM_CC_4330_CHIP_ID,4,"Prowise-PT301"+};+staticconststructdmi_system_iddmi_platform_data[]={{/* ACEPC T8 Cherry Trail Z8350 mini PC */
@@ -125,6 +133,16 @@ static const struct dmi_system_id dmi_platform_data[] = {},.driver_data=(void*)&predia_basic_data,},+{+/* Voyo winpad A15 tablet */+.matches={+DMI_MATCH(DMI_BOARD_VENDOR,"AMI Corporation"),+DMI_MATCH(DMI_BOARD_NAME,"Aptio CRB"),+/* Above strings are too generic, also match on BIOS date */+DMI_MATCH(DMI_BIOS_DATE,"11/20/2014"),+},+.driver_data=(void*)&voyo_winpad_a15_data,+},{}};
Hi Sasha,
On Wed, Feb 24, 2021 at 10:35 PM Sasha Levin [off-list ref] wrote:
From: Joakim Zhang <redacted>
[ Upstream commit 812f0116c66a3ebaf0b6062226aa85574dd79f67 ]
The System Controller Firmware (SCFW) is a low-level system function
which runs on a dedicated Cortex-M core to provide power, clock, and
resource management. It exists on some i.MX8 processors. e.g. i.MX8QM
(QM, QP), and i.MX8QX (QXP, DX). SCU driver manages the IPC interface
between host CPU and the SCU firmware running on M4.
For i.MX8QM, stop mode request is controlled by System Controller Unit(SCU)
firmware, this patch introduces FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW quirk
for this function.
Signed-off-by: Joakim Zhang <redacted>
Link: https://lore.kernel.org/r/20201106105627.31061-6-qiangqing.zhang@nxp.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This is adding a new feature and not fixing a bug.
Why does it qualify for stable inclusion?