aboutsummaryrefslogtreecommitdiff
path: root/drivers/net
AgeCommit message (Collapse)AuthorFilesLines
2021-04-22netdevsim: Only use sampling truncation length when validIdo Schimmel1-3/+4
When the sampling truncation length is invalid (zero), pass the length of the packet. Without the fix, no payload is reported to user space when the truncation length is zero. Fixes: a8700c3dd0a4 ("netdevsim: Add dummy psample implementation") Signed-off-by: Ido Schimmel <[email protected]> Acked-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-22net: enetc: fix link error againArnd Bergmann1-3/+1
A link time bug that I had fixed before has come back now that another sub-module was added to the enetc driver: ERROR: modpost: "enetc_ierb_register_pf" [drivers/net/ethernet/freescale/enetc/fsl-enetc.ko] undefined! The problem is that the enetc Makefile is not actually used for the ierb module if that is the only built-in driver in there and everything else is a loadable module. Fix it by always entering the directory this time, regardless of which symbols are configured. This should reliably fix the problem and prevent it from coming back another time. Fixes: 112463ddbe82 ("net: dsa: felix: fix link error") Fixes: e7d48e5fbf30 ("net: enetc: add a mini driver for the Integrated Endpoint Register Block") Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Vladimir Oltean <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-22net: mana: fix PCI_HYPERV dependencyArnd Bergmann1-1/+1
The MANA driver causes a build failure in some configurations when it selects an unavailable symbol: WARNING: unmet direct dependencies detected for PCI_HYPERV Depends on [n]: PCI [=y] && X86_64 [=y] && HYPERV [=n] && PCI_MSI [=y] && PCI_MSI_IRQ_DOMAIN [=y] && SYSFS [=y] Selected by [y]: - MICROSOFT_MANA [=y] && NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_MICROSOFT [=y] && PCI_MSI [=y] && X86_64 [=y] drivers/pci/controller/pci-hyperv.c: In function 'hv_irq_unmask': drivers/pci/controller/pci-hyperv.c:1217:9: error: implicit declaration of function 'hv_set_msi_entry_from_desc' [-Werror=implicit-function-declaration] 1217 | hv_set_msi_entry_from_desc(&params->int_entry.msi_entry, msi_desc); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ A PCI driver should never depend on a particular host bridge implementation in the first place, but if we have this dependency it's better to express it as a 'depends on' rather than 'select'. Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Dexuan Cui <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-22net: phy: marvell: fix m88e1111_set_downshiftMaxim Kochetkov1-10/+16
Changing downshift params without software reset has no effect, so call genphy_soft_reset() after change downshift params. As the datasheet says: Changes to these bits are disruptive to the normal operation therefore, any changes to these registers must be followed by software reset to take effect. Fixes: 5c6bc5199b5d ("net: phy: marvell: add downshift support for M88E1111") Signed-off-by: Maxim Kochetkov <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-22net: phy: marvell: fix m88e1011_set_downshiftMaxim Kochetkov1-10/+16
Changing downshift params without software reset has no effect, so call genphy_soft_reset() after change downshift params. As the datasheet says: Changes to these bits are disruptive to the normal operation therefore, any changes to these registers must be followed by software reset to take effect. Fixes: 911af5e149bb ("net: phy: marvell: fix downshift function naming") Signed-off-by: Maxim Kochetkov <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-22iavf: Support for modifying SCTP RSS flow hashingHaiyue Wang3-5/+56
Provide the ability to enable SCTP RSS hashing by ethtool. It gives users option of generating RSS hash based on the SCTP source and destination ports numbers, IPv4 or IPv6 source and destination addresses. Signed-off-by: Haiyue Wang <[email protected]> Tested-by: Konrad Jankowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2021-04-22iavf: Support for modifying UDP RSS flow hashingHaiyue Wang3-5/+56
Provides the ability to enable UDP RSS hashing by ethtool. It gives users option of generating RSS hash based on the UDP source and destination ports numbers, IPv4 or IPv6 source and destination addresses. Signed-off-by: Haiyue Wang <[email protected]> Tested-by: Konrad Jankowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2021-04-22iavf: Support for modifying TCP RSS flow hashingHaiyue Wang5-4/+450
Provides the ability to enable TCP RSS hashing by ethtool. It gives users option of generating RSS hash based on the TCP source and destination ports numbers, IPv4 or IPv6 source and destination addresses. Signed-off-by: Haiyue Wang <[email protected]> Tested-by: Konrad Jankowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2021-04-22iavf: Add framework to enable ethtool RSS configHaiyue Wang4-0/+214
Add the virtchnl message interface to VF, so that VF can request RSS input set(s) based on PF's capability. This framework allows ethtool RSS config support on the VF driver. Signed-off-by: Haiyue Wang <[email protected]> Tested-by: Konrad Jankowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2021-04-22ice: Support RSS configure removal for AVFQi Zhang3-2/+105
Add the handler for virtchnl message VIRTCHNL_OP_DEL_RSS_CFG to remove an existing RSS configuration with matching hashed fields. Signed-off-by: Vignesh Sridhar <[email protected]> Co-developed-by: Jia Guo <[email protected]> Signed-off-by: Jia Guo <[email protected]> Signed-off-by: Qi Zhang <[email protected]> Signed-off-by: Haiyue Wang <[email protected]> Tested-by: Bo Chen <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2021-04-22ice: Enable RSS configure for AVFQi Zhang3-0/+462
Currently, RSS hash input is not available to AVF by ethtool, it is set by the PF directly. Add the RSS configure support for AVF through new virtchnl message, and define the capability flag VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF to query this new RSS offload support. Signed-off-by: Jia Guo <[email protected]> Signed-off-by: Qi Zhang <[email protected]> Signed-off-by: Haiyue Wang <[email protected]> Tested-by: Bo Chen <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2021-04-22ice: Add helper function to get the VF's VSIBrett Creeley1-43/+39
Currently, the driver gets the VF's VSI by using a long string of dereferences (i.e. vf->pf->vsi[vf->lan_vsi_idx]). If the method to get the VF's VSI were to change the driver would have to change it in every location. Fix this by adding the helper ice_get_vf_vsi(). Signed-off-by: Brett Creeley <[email protected]> Tested-by: Konrad Jankowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2021-04-22ice: remove redundant assignment to pointer vsiColin Ian King1-1/+0
Pointer vsi is being re-assigned a value that is never read, the assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2021-04-22iavf: add support for UDP Segmentation OffloadBrett Creeley3-4/+14
Add code to support UDP segmentation offload (USO) for hardware that supports it. Suggested-by: Jesse Brandeburg <[email protected]> Signed-off-by: Brett Creeley <[email protected]> Tested-by: Konrad Jankowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2021-04-22ice: Advertise virtchnl UDP segmentation offload capabilityBrett Creeley1-0/+3
As the hardware is capable of supporting UDP segmentation offload, add a capability bit to virtchnl.h to communicate this and have the driver advertise its support. Suggested-by: Jesse Brandeburg <[email protected]> Signed-off-by: Brett Creeley <[email protected]> Tested-by: Konrad Jankowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2021-04-22ice: Allow ignoring opcodes on specific VFMichal Swiatkowski5-0/+198
Declare bitmap of allowed commands on VF. Initialize default opcodes list that should be always supported. Declare array of supported opcodes for each caps used in virtchnl code. Change allowed bitmap by setting or clearing corresponding bit to allowlist (bit set) or denylist (bit clear). Signed-off-by: Michal Swiatkowski <[email protected]> Tested-by: Konrad Jankowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2021-04-22ice: warn about potentially malicious VFsVignesh Sridhar7-4/+605
Attempt to detect malicious VFs and, if suspected, log the information but keep going to allow the user to take any desired actions. Potentially malicious VFs are identified by checking if the VFs are transmitting too many messages via the PF-VF mailbox which could cause an overflow of this channel resulting in denial of service. This is done by creating a snapshot or static capture of the mailbox buffer which can be traversed and in which the messages sent by VFs are tracked. Co-developed-by: Yashaswini Raghuram Prathivadi Bhayankaram <[email protected]> Signed-off-by: Yashaswini Raghuram Prathivadi Bhayankaram <[email protected]> Co-developed-by: Paul M Stillwell Jr <[email protected]> Signed-off-by: Paul M Stillwell Jr <[email protected]> Co-developed-by: Brett Creeley <[email protected]> Signed-off-by: Brett Creeley <[email protected]> Signed-off-by: Vignesh Sridhar <[email protected]> Tested-by: Konrad Jankowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
2021-04-22Merge tag 'mt76-for-kvalo-2021-04-21' of https://github.com/nbd168/wirelessKalle Valo54-946/+2117
mt76 patches for 5.13 * testmode improvements * bugfixes * device tree power limits support for 7615 and newer * hardware recovery fixes * mt7663 reset/init fixes * mt7915 flash pre-calibration support * mt7921/mt7663 runtime power management fixes # gpg: Signature made Wed 21 Apr 2021 09:58:49 PM EEST using DSA key ID 02A76EF5 # gpg: Good signature from "Felix Fietkau <[email protected]>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 75D1 1A7D 91A7 710F 4900 42EF D77D 141D 02A7 6EF5
2021-04-22brcmfmac: Avoid GFP_ATOMIC when GFP_KERNEL is enoughChristophe JAILLET1-1/+1
A workqueue is not atomic, so constraints can be relaxed here. GFP_KERNEL can be used instead of GFP_ATOMIC. Signed-off-by: Christophe JAILLET <[email protected]> Acked-by: Arend van Spriel <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/b6e619415db4ee5de95389280d7195bb56e45f77.1618860716.git.christophe.jaillet@wanadoo.fr
2021-04-22qtnfmac: Fix possible buffer overflow in qtnf_event_handle_external_authLee Gibson1-2/+4
Function qtnf_event_handle_external_auth calls memcpy without checking the length. A user could control that length and trigger a buffer overflow. Fix by checking the length is within the maximum allowed size. Signed-off-by: Lee Gibson <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-22wlcore: Fix buffer overrun by snprintf due to incorrect buffer sizeColin Ian King1-1/+1
The size of the buffer than can be written to is currently incorrect, it is always the size of the entire buffer even though the snprintf is writing as position pos into the buffer. Fix this by setting the buffer size to be the number of bytes left in the buffer, namely sizeof(buf) - pos. Addresses-Coverity: ("Out-of-bounds access") Fixes: 7b0e2c4f6be3 ("wlcore: fix overlapping snprintf arguments in debugfs") Signed-off-by: Colin Ian King <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-22wl3501_cs: Fix out-of-bounds warnings in wl3501_mgmt_joinGustavo A. R. Silva2-41/+38
Fix the following out-of-bounds warnings by adding a new structure wl3501_req instead of duplicating the same members in structure wl3501_join_req and wl3501_scan_confirm: arch/x86/include/asm/string_32.h:182:25: warning: '__builtin_memcpy' offset [39, 108] from the object at 'sig' is out of the bounds of referenced subobject 'beacon_period' with type 'short unsigned int' at offset 36 [-Warray-bounds] arch/x86/include/asm/string_32.h:182:25: warning: '__builtin_memcpy' offset [25, 95] from the object at 'sig' is out of the bounds of referenced subobject 'beacon_period' with type 'short unsigned int' at offset 22 [-Warray-bounds] Refactor the code, accordingly: $ pahole -C wl3501_req drivers/net/wireless/wl3501_cs.o struct wl3501_req { u16 beacon_period; /* 0 2 */ u16 dtim_period; /* 2 2 */ u16 cap_info; /* 4 2 */ u8 bss_type; /* 6 1 */ u8 bssid[6]; /* 7 6 */ struct iw_mgmt_essid_pset ssid; /* 13 34 */ struct iw_mgmt_ds_pset ds_pset; /* 47 3 */ struct iw_mgmt_cf_pset cf_pset; /* 50 8 */ struct iw_mgmt_ibss_pset ibss_pset; /* 58 4 */ struct iw_mgmt_data_rset bss_basic_rset; /* 62 10 */ /* size: 72, cachelines: 2, members: 10 */ /* last cacheline: 8 bytes */ }; $ pahole -C wl3501_join_req drivers/net/wireless/wl3501_cs.o struct wl3501_join_req { u16 next_blk; /* 0 2 */ u8 sig_id; /* 2 1 */ u8 reserved; /* 3 1 */ struct iw_mgmt_data_rset operational_rset; /* 4 10 */ u16 reserved2; /* 14 2 */ u16 timeout; /* 16 2 */ u16 probe_delay; /* 18 2 */ u8 timestamp[8]; /* 20 8 */ u8 local_time[8]; /* 28 8 */ struct wl3501_req req; /* 36 72 */ /* size: 108, cachelines: 2, members: 10 */ /* last cacheline: 44 bytes */ }; $ pahole -C wl3501_scan_confirm drivers/net/wireless/wl3501_cs.o struct wl3501_scan_confirm { u16 next_blk; /* 0 2 */ u8 sig_id; /* 2 1 */ u8 reserved; /* 3 1 */ u16 status; /* 4 2 */ char timestamp[8]; /* 6 8 */ char localtime[8]; /* 14 8 */ struct wl3501_req req; /* 22 72 */ /* --- cacheline 1 boundary (64 bytes) was 30 bytes ago --- */ u8 rssi; /* 94 1 */ /* size: 96, cachelines: 2, members: 8 */ /* padding: 1 */ /* last cacheline: 32 bytes */ }; The problem is that the original code is trying to copy data into a bunch of struct members adjacent to each other in a single call to memcpy(). Now that a new struct wl3501_req enclosing all those adjacent members is introduced, memcpy() doesn't overrun the length of &sig.beacon_period and &this->bss_set[i].beacon_period, because the address of the new struct object _req_ is used as the destination, instead. This helps with the ongoing efforts to globally enable -Warray-bounds and get us closer to being able to tighten the FORTIFY_SOURCE routines on memcpy(). Link: https://github.com/KSPP/linux/issues/109 Reported-by: kernel test robot <[email protected]> Signed-off-by: Gustavo A. R. Silva <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/1fbaf516da763b50edac47d792a9145aa4482e29.1618442265.git.gustavoars@kernel.org
2021-04-22wl3501_cs: Fix out-of-bounds warnings in wl3501_send_pktGustavo A. R. Silva2-8/+14
Fix the following out-of-bounds warnings by enclosing structure members daddr and saddr into new struct addr, in structures wl3501_md_req and wl3501_md_ind: arch/x86/include/asm/string_32.h:182:25: warning: '__builtin_memcpy' offset [18, 23] from the object at 'sig' is out of the bounds of referenced subobject 'daddr' with type 'u8[6]' {aka 'unsigned char[6]'} at offset 11 [-Warray-bounds] arch/x86/include/asm/string_32.h:182:25: warning: '__builtin_memcpy' offset [18, 23] from the object at 'sig' is out of the bounds of referenced subobject 'daddr' with type 'u8[6]' {aka 'unsigned char[6]'} at offset 11 [-Warray-bounds] Refactor the code, accordingly: $ pahole -C wl3501_md_req drivers/net/wireless/wl3501_cs.o struct wl3501_md_req { u16 next_blk; /* 0 2 */ u8 sig_id; /* 2 1 */ u8 routing; /* 3 1 */ u16 data; /* 4 2 */ u16 size; /* 6 2 */ u8 pri; /* 8 1 */ u8 service_class; /* 9 1 */ struct { u8 daddr[6]; /* 10 6 */ u8 saddr[6]; /* 16 6 */ } addr; /* 10 12 */ /* size: 22, cachelines: 1, members: 8 */ /* last cacheline: 22 bytes */ }; $ pahole -C wl3501_md_ind drivers/net/wireless/wl3501_cs.o struct wl3501_md_ind { u16 next_blk; /* 0 2 */ u8 sig_id; /* 2 1 */ u8 routing; /* 3 1 */ u16 data; /* 4 2 */ u16 size; /* 6 2 */ u8 reception; /* 8 1 */ u8 pri; /* 9 1 */ u8 service_class; /* 10 1 */ struct { u8 daddr[6]; /* 11 6 */ u8 saddr[6]; /* 17 6 */ } addr; /* 11 12 */ /* size: 24, cachelines: 1, members: 9 */ /* padding: 1 */ /* last cacheline: 24 bytes */ }; The problem is that the original code is trying to copy data into a couple of arrays adjacent to each other in a single call to memcpy(). Now that a new struct _addr_ enclosing those two adjacent arrays is introduced, memcpy() doesn't overrun the length of &sig.daddr[0] and &sig.daddr, because the address of the new struct object _addr_ is used, instead. This helps with the ongoing efforts to globally enable -Warray-bounds and get us closer to being able to tighten the FORTIFY_SOURCE routines on memcpy(). Link: https://github.com/KSPP/linux/issues/109 Reported-by: kernel test robot <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/d260fe56aed7112bff2be5b4d152d03ad7b78e78.1618442265.git.gustavoars@kernel.org
2021-04-22ath11k: fix warning in ath11k_mhi_configAnilkumar Kolli1-3/+12
Initialize static variable ath11k_mhi_config for all hw_rev, return error for unknown hw_rev. This patch fixes below Smatch warning: drivers/net/wireless/ath/ath11k/mhi.c:357 ath11k_mhi_register() error: uninitialized symbol 'ath11k_mhi_config'. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1 Fixes: a233811ef600 ("ath11k: Add qcn9074 mhi controller config") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Anilkumar Kolli <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-22ath11k: qmi: Fix spelling mistake "requeqst" -> "request"Colin Ian King1-1/+1
There is a spelling mistake in an ath11k_warn message. Fix it. Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-22ath10k: Fix ath10k_wmi_tlv_op_pull_peer_stats_info() unlock without lockShuah Khan1-0/+3
ath10k_wmi_tlv_op_pull_peer_stats_info() could try to unlock RCU lock winthout locking it first when peer reason doesn't match the valid cases for this function. Add a default case to return without unlocking. Fixes: 09078368d516 ("ath10k: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()") Reported-by: Pavel Machek <[email protected]> Signed-off-by: Shuah Khan <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-22ath10k: Fix a use after free in ath10k_htc_send_bundleLv Yunlong1-1/+1
In ath10k_htc_send_bundle, the bundle_skb could be freed by dev_kfree_skb_any(bundle_skb). But the bundle_skb is used later by bundle_skb->len. As skb_len = bundle_skb->len, my patch replaces bundle_skb->len to skb_len after the bundle_skb was freed. Fixes: c8334512f3dd1 ("ath10k: add htt TX bundle for sdio") Signed-off-by: Lv Yunlong <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-22ath9k: Fix error check in ath9k_hw_read_revisions() for PCI devicesToke Høiland-Jørgensen2-2/+2
When the error check in ath9k_hw_read_revisions() was added, it checked for -EIO which is what ath9k_regread() in the ath9k_htc driver uses. However, for plain ath9k, the register read function uses ioread32(), which just returns -1 on error. So if such a read fails, it still gets passed through and ends up as a weird mac revision in the log output. Fix this by changing ath9k_regread() to return -1 on error like ioread32() does, and fix the error check to look for that instead of -EIO. Fixes: 2f90c7e5d094 ("ath9k: Check for errors when reading SREV register") Signed-off-by: Toke Høiland-Jørgensen <[email protected]> Reviewed-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-22iwlwifi: mvm: tt: Replace thermal_notify_frameworkThara Gopinath1-2/+2
thermal_notify_framework just updates for a single trip point where as thermal_zone_device_update does other bookkeeping like updating the temperature of the thermal zone and setting the next trip point etc. Replace thermal_notify_framework with thermal_zone_device_update as the later is more thorough. Acked-by: Kalle Valo <[email protected]> Signed-off-by: Thara Gopinath <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-04-21net: phy: marvell: don't use empty switch default caseMarek Behún1-2/+0
This causes error reported by kernel test robot. Signed-off-by: Marek Behún <[email protected]> Fixes: 41d26bf4aba0 ("net: phy: marvell: refactor HWMON OOP style") Reported-by: kernel test robot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-21bonding: 3ad: Fix the conflict between bond_update_slave_arr and the state ↵jinyiting1-3/+4
machine The bond works in mode 4, and performs down/up operations on the bond that is normally negotiated. The probability of bond-> slave_arr is NULL Test commands: ifconfig bond1 down ifconfig bond1 up The conflict occurs in the following process: __dev_open (CPU A) --bond_open --queue_delayed_work(bond->wq,&bond->ad_work,0); --bond_update_slave_arr --bond_3ad_get_active_agg_info ad_work(CPU B) --bond_3ad_state_machine_handler --ad_agg_selection_logic ad_work runs on cpu B. In the function ad_agg_selection_logic, all agg->is_active will be cleared. Before the new active aggregator is selected on CPU B, bond_3ad_get_active_agg_info failed on CPU A, bond->slave_arr will be set to NULL. The best aggregator in ad_agg_selection_logic has not changed, no need to update slave arr. The conflict occurred in that ad_agg_selection_logic clears agg->is_active under mode_lock, but bond_open -> bond_update_slave_arr is inspecting agg->is_active outside the lock. Also, bond_update_slave_arr is normal for potential sleep when allocating memory, so replace the WARN_ON with a call to might_sleep. Signed-off-by: jinyiting <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-04-21mt76: mt7921: reinit wpdma during drv_own if necessaryLorenzo Bianconi1-0/+2
Check dummy reg to reinitialized WPDMA during driver_own operation Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: move mt76_token_init in mt76_alloc_deviceLorenzo Bianconi6-13/+3
In order to remove duplicated code, move mt76_token_init in mt76_alloc_device routine Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: fix a precision vs width bug in printkDan Carpenter1-1/+1
Precision %.*s was intended instead of width %*s. The original code is potentially an information leak. Fixes: c7cc5ec57303 ("mt76: mt7921: rework mt7921_mcu_debug_msg_event routine") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7915: fix a precision vs width bug in printkDan Carpenter1-1/+1
Precision %.*s was intended instead of width %*s. The original code will still print unintended data from beyond the end of skb->data. Fixes: 665b2c780d63 ("mt76: mt7915: limit firmware log message printk to buffer length") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7615: fix a precision vs width bug in printkDan Carpenter1-1/+1
Precision "%.*s" was intended instead of width "%*s". The original code will print garbage from beyond the end of the skb->data. Fixes: d76d6c3ba2b0 ("mt76: mt7615: limit firmware log message printk to buffer length") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: debugfs: introduce napi_threaded nodeLorenzo Bianconi1-0/+28
Introduce napi_threaded debugfs knob in order to enable/disable NAPI threaded support Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: introduce mt7921_mcu_sta_add routineLorenzo Bianconi3-19/+27
mt7921_mcu_sta_add will be used to add and remove wtbl entries. Create broadcast wtbl entry after AP association Co-developed-by: Deren Wu <[email protected]> Signed-off-by: Deren Wu <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: mt7921_stop should put device in fw_own stateSean Wang1-1/+1
mt7921_stop should put device in fw_own state to reduce power consumption. Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: connac: unschedule mac_work before going to sleepLorenzo Bianconi3-1/+7
In order to wake the device less frequently and so reduce power consumpation, unschedule mac_work before going to sleep Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7663: add awake and doze time accountingLorenzo Bianconi3-6/+52
Similar to mt7921, introduce awake and doze time accounting for runtime pm. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: improve doze opportunityLorenzo Bianconi2-3/+3
Increase mt7921 mac work timeout in oder to have move sleep opportunities Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: get rid of mcu_reset function pointerLorenzo Bianconi3-6/+2
since mcu_reset it used only by mt7921, move the reset callback to mt7921_mcu_parse_response routine and get rid of the function pointer. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7915: do not read rf value from efuse in flash modeShayne Chen1-1/+1
Do not read rf value from efuse when driver is configured to use flash mode. Tested-by: Bruce Chuang <[email protected]> Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: move token utilities in mt76 common moduleLorenzo Bianconi14-113/+132
Move token management in mt76 common module since it is shared between mt7615, mt7915 and mt7921 drivers Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: move token_lock, token and token_count in mt76_devLorenzo Bianconi11-73/+66
Move token_lock, token and token_count data structures in mt76_dev. This is a preliminary patch to move token management in mt76 common module since it is shared by mt7615, mt7915 and mt7921 drivers. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: fix possible invalid register accessSean Wang1-1/+3
Disable the interrupt and synchronze for the pending irq handlers to ensure the irq tasklet is not being scheduled after the suspend to avoid the possible invalid register access acts when the host pcie controller is suspended. [17932.910534] mt7921e 0000:01:00.0: pci_pm_suspend+0x0/0x22c returned 0 after 21375 usecs [17932.910590] pcieport 0000:00:00.0: calling pci_pm_suspend+0x0/0x22c @ 18565, parent: pci0000:00 [17932.910602] pcieport 0000:00:00.0: pci_pm_suspend+0x0/0x22c returned 0 after 8 usecs [17932.910671] mtk-pcie 11230000.pcie: calling platform_pm_suspend+0x0/0x60 @ 22783, parent: soc [17932.910674] mtk-pcie 11230000.pcie: platform_pm_suspend+0x0/0x60 returned 0 after 0 usecs ... 17933.615352] x1 : 00000000000d4200 x0 : ffffff8269ca2300 [17933.620666] Call trace: [17933.623127] mt76_mmio_rr+0x28/0xf0 [mt76] [17933.627234] mt7921_rr+0x38/0x44 [mt7921e] [17933.631339] mt7921_irq_tasklet+0x54/0x1d8 [mt7921e] [17933.636309] tasklet_action_common+0x12c/0x16c [17933.640754] tasklet_action+0x24/0x2c [17933.644418] __do_softirq+0x16c/0x344 [17933.648082] irq_exit+0xa8/0xac [17933.651224] scheduler_ipi+0xd4/0x148 [17933.654890] handle_IPI+0x164/0x2d4 [17933.658379] gic_handle_irq+0x140/0x178 [17933.662216] el1_irq+0xb8/0x180 [17933.665361] cpuidle_enter_state+0xf8/0x204 [17933.669544] cpuidle_enter+0x38/0x4c [17933.673122] do_idle+0x1a4/0x2a8 [17933.676352] cpu_startup_entry+0x24/0x28 [17933.680276] rest_init+0xd4/0xe0 [17933.683508] arch_call_rest_init+0x10/0x18 [17933.687606] start_kernel+0x340/0x3b4 [17933.691279] Code: aa0003f5 d503201f f953eaa8 8b344108 (b9400113) [17933.697373] ---[ end trace a24b8e26ffbda3c5 ]--- [17933.767846] Kernel panic - not syncing: Fatal exception in interrupt Fixes: ffa1bf97425b ("mt76: mt7921: introduce PM support") Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: enable deep sleep when the device suspendsSean Wang1-0/+12
Enable the deep sleep mode in suspend handler to reduce the power consumption further. Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: connac: introduce mt76_connac_mcu_set_deep_sleep utilitySean Wang2-8/+24
Introduce mt76_connac_mcu_set_deep_sleep to enable deep sleep mode and will be activated immediately when the host returns the ownership to the device. Co-developed-by: Leon Yen <[email protected]> Signed-off-by: Leon Yen <[email protected]> Co-developed-by: YN Chen <[email protected]> Signed-off-by: YN Chen <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2021-04-21mt76: mt7921: introduce mt7921_wpdma_reinit_cond utility routineLorenzo Bianconi4-0/+36
Add mt7921_wpdma_reinit_cond to check dummy reg if driver needs to reinitialized WPDMA after driver_own operation Co-developed-by: Sean Wang <[email protected]> Signed-off-by: Sean Wang <[email protected]> Co-developed-by: Leon Yen <[email protected]> Signed-off-by: Leon Yen <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>