]> git.ipfire.org Git - people/ms/linux.git/log
people/ms/linux.git
3 years agoMerge tag 'v5.19-next-dts32' of git://git.kernel.org/pub/scm/linux/kernel/git/matthia...
Arnd Bergmann [Mon, 11 Jul 2022 12:02:14 +0000 (14:02 +0200)] 
Merge tag 'v5.19-next-dts32' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/dt

Airoha EN7523:
- Add clock and PCIe support

Several style fixes to comply with DT spec.

* tag 'v5.19-next-dts32' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux:
  ARM: dts: mediatek: align gpio-key node names with dtschema
  ARM: dts: mediatek: adjust whitespace around '='
  ARM: dts: Add PCIe support for Airoha EN7523
  ARM: dts: add clock support for Airoha EN7523

Link: https://lore.kernel.org/r/63536da6-fbe4-2d96-ab91-ae756cd580c4@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agomt76: mt7921: Let PCI core handle power state and use pm_sleep_ptr()
Kai-Heng Feng [Tue, 5 Jul 2022 14:23:04 +0000 (22:23 +0800)] 
mt76: mt7921: Let PCI core handle power state and use pm_sleep_ptr()

PCI power state and wakeup are already handled by PCI core, so it's not
necessary to handle them in the driver.

Also switch to use pm_sleep_ptr() to remove #ifdef guard.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomediatek: mt76: eeprom: fix missing of_node_put() in mt76_find_power_limits_node()
Liang He [Mon, 4 Jul 2022 08:34:21 +0000 (16:34 +0800)] 
mediatek: mt76: eeprom: fix missing of_node_put() in mt76_find_power_limits_node()

We should use of_node_put() for the reference 'np' returned by
of_get_child_by_name() which will increase the refcount.

Fixes: 22b980badc0f ("mt76: add functions for parsing rate power limits from DT")
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomediatek: mt76: mac80211: Fix missing of_node_put() in mt76_led_init()
Liang He [Mon, 4 Jul 2022 08:34:20 +0000 (16:34 +0800)] 
mediatek: mt76: mac80211: Fix missing of_node_put() in mt76_led_init()

We should use of_node_put() for the reference 'np' returned by
of_get_child_by_name() which will increase the refcount.

Fixes: 17f1de56df05 ("mt76: add common code shared between multiple chipsets")
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: get rid of mt76_wcid_hw routine
Lorenzo Bianconi [Mon, 4 Jul 2022 07:02:23 +0000 (09:02 +0200)] 
mt76: get rid of mt76_wcid_hw routine

mt76_wcid_hw() is no longer used.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: convert MT_TX_HW_QUEUE_EXT_PHY to MT_TX_HW_QUEUE_PHY
Lorenzo Bianconi [Mon, 4 Jul 2022 07:02:22 +0000 (09:02 +0200)] 
mt76: convert MT_TX_HW_QUEUE_EXT_PHY to MT_TX_HW_QUEUE_PHY

Report phy_indx in tx_info->hw_queue. This is a preliminary patch to add
newer chipset support

Co-developed-by: Bo Jiao <bo.jiao@mediatek.com>
Signed-off-by: Bo Jiao <bo.jiao@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: add phy_idx to mt76_wcid
Lorenzo Bianconi [Mon, 4 Jul 2022 07:02:21 +0000 (09:02 +0200)] 
mt76: add phy_idx to mt76_wcid

Introduce phy_idx to mt76_wcid structure instead of ext_phy.
This is a preliminary patch to add newer chipset support.

Co-developed-by: Bo Jiao <bo.jiao@mediatek.com>
Signed-off-by: Bo Jiao <bo.jiao@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: introduce phys array in mt76_dev structure
Lorenzo Bianconi [Mon, 4 Jul 2022 07:02:20 +0000 (09:02 +0200)] 
mt76: introduce phys array in mt76_dev structure

Introduce phys array in mt76_dev structure to reference mt76_phy
supported by the chipset. This is a preliminary patch to introduce
newer chipset support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: add phy_idx in mt76_rx_status
Lorenzo Bianconi [Mon, 4 Jul 2022 07:02:19 +0000 (09:02 +0200)] 
mt76: add phy_idx in mt76_rx_status

Introduce phy_idx mt76_rx_status instead of ext_idx. This is a
preliminary patch to add newer chipset support

Co-developed-by: Bo Jiao <bo.jiao@mediatek.com>
Signed-off-by: Bo Jiao <bo.jiao@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: introduce MT_RXQ_BAND2 and MT_RXQ_BAND2_WA in mt76_rxq_id
Lorenzo Bianconi [Thu, 30 Jun 2022 13:56:13 +0000 (15:56 +0200)] 
mt76: introduce MT_RXQ_BAND2 and MT_RXQ_BAND2_WA in mt76_rxq_id

Rename MT_RXQ_EXT in MT_RXQ_BAND1.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: add len parameter to __mt76_mcu_msg_alloc signature
Lorenzo Bianconi [Thu, 30 Jun 2022 12:55:18 +0000 (14:55 +0200)] 
mt76: add len parameter to __mt76_mcu_msg_alloc signature

Introduce len to __mt76_mcu_msg_alloc signature in order to add the
capability to specify two different value for allocation and copy length.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915 add ht mpdu density
MeiChia Chiu [Tue, 28 Jun 2022 05:55:28 +0000 (13:55 +0800)] 
mt76: mt7915 add ht mpdu density

set ht mpdu density to 4 usec.

Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: reduce the mutex lock scope during reset
Sean Wang [Sun, 26 Jun 2022 23:27:06 +0000 (07:27 +0800)] 
mt76: mt7921: reduce the mutex lock scope during reset

Reduce the mutex lock scope for reset to get rid of possible task hung
e.g wpa_supplicant and to allow the user-space process to keep running
during we need more retries to complete the reset.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Suggested-by: YN Chen <YN.Chen@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: reduce log severity levels for informative messages
Sean Wang [Sun, 26 Jun 2022 23:27:05 +0000 (07:27 +0800)] 
mt76: mt7921: reduce log severity levels for informative messages

Use dev_dbg instead for the diagnostic messages.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: move tx initialization/cleanup in mt76_connac module
Lorenzo Bianconi [Fri, 24 Jun 2022 10:08:29 +0000 (12:08 +0200)] 
mt76: connac: move tx initialization/cleanup in mt76_connac module

Move mt76_connac_init_tx_queues and mt76_connac_tx_cleanup routines
in mt76_connac module. This is a preliminary patch to add mt7990
chipset support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: make mt7921_pci_driver static
Lorenzo Bianconi [Fri, 24 Jun 2022 10:06:29 +0000 (12:06 +0200)] 
mt76: mt7921: make mt7921_pci_driver static

mt7921_pci_driver struct is only referenced in mt7921/pci.c so make it
static.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: enable HW beacon filter in the initialization stage
Sean Wang [Tue, 21 Jun 2022 21:17:39 +0000 (05:17 +0800)] 
mt76: mt7921: enable HW beacon filter in the initialization stage

The current driver has worked with HW beacon filter and connection
monitor all the way, here we move the enablement into the initialization
stage like other HW features being done to get rid of others are
confused why these configurations would be changed at runtime.

We still leave a way to turn off these offload features in debugfs knobs
but that is just for debugging purposes.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: enable HW beacon filter not depending on PM flag
Sean Wang [Tue, 21 Jun 2022 21:17:38 +0000 (05:17 +0800)] 
mt76: mt7921: enable HW beacon filter not depending on PM flag

The hardware beacon filter works whether or not the PM flag is set, so we
drop redundant dependency checks on PM flags.

Additionally, the patch implicitly allow the MT7921[E, S, U] to have a
consistent configuration of the hardware beacon filter.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: remove q->qid
Felix Fietkau [Sun, 3 Jul 2022 18:59:05 +0000 (20:59 +0200)] 
mt76: remove q->qid

It is no longer used

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: do not use skb_set_queue_mapping for internal purposes
Felix Fietkau [Sat, 2 Jul 2022 13:56:23 +0000 (15:56 +0200)] 
mt76: do not use skb_set_queue_mapping for internal purposes

Previously the code used skb_set_queue_mapping for management or non-bufferable
powersave frames that need to be sent to a different hardware queue.
This can confuse AQL, which expects the value to remain the same until the tx
status report.
The only place that currently uses the altered skb queue mapping is the txwi
write function. Change the code to pass the hardware queue id as a function
parameter instead.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: pass original queue id from __mt76_tx_queue_skb to the driver
Felix Fietkau [Sun, 3 Jul 2022 15:52:24 +0000 (17:52 +0200)] 
mt76: pass original queue id from __mt76_tx_queue_skb to the driver

MT7615 and newer map multiple software tx queues to the hardware id

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7615: fix throughput regression on DFS channels
Felix Fietkau [Fri, 24 Jun 2022 18:57:47 +0000 (20:57 +0200)] 
mt76: mt7615: fix throughput regression on DFS channels

For some reason, mt7615 reacts badly to repeatedly enabling/disabling the radar
detector without also switching the channel.
This results in very bad throughput on DFS channels, because
hw->conf.radar_enabled can get toggled a few times after CAC ends.
Fix this by always leaving the DFS detector enabled on DFS channels and instead
suppress unwanted detection events.

Fixes: 2c86f6752046 ("mt76: mt7615: fix/rewrite the dfs state handling logic")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: allow receiving frames with invalid CCMP PN via monitor interfaces
Felix Fietkau [Thu, 23 Jun 2022 12:21:18 +0000 (14:21 +0200)] 
mt76: allow receiving frames with invalid CCMP PN via monitor interfaces

This can be useful for debugging

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt76x02: improve reliability of the beacon hang check
Felix Fietkau [Thu, 23 Jun 2022 09:39:58 +0000 (11:39 +0200)] 
mt76: mt76x02: improve reliability of the beacon hang check

Increment the counter only when writing beacons to the hardware in order
to avoid triggering restarts if beacons are disabled.
Additionally, avoid resetting the MAC if stopping it failed

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7615: add sta_rec with EXTRA_INFO_NEW for the first time only
Felix Fietkau [Wed, 22 Jun 2022 12:11:06 +0000 (14:11 +0200)] 
mt76: mt7615: add sta_rec with EXTRA_INFO_NEW for the first time only

Set EXTRA_INFO_NEW for the first time only to prevent adding the same
starec entry, otherwise the entry might be removed in fw.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: update the maximum size of beacon offload
MeiChia Chiu [Wed, 22 Jun 2022 09:46:55 +0000 (17:46 +0800)] 
mt76: mt7915: update the maximum size of beacon offload

Since an in-band discovery frame is offloaded by MCU,
here we enlarge the command size to accommodate the additional content.

Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Money Wang <Money.Wang@mediatek.com>
Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: do not check the ccmp pn for ONLY_MONITOR frame
MeiChia Chiu [Wed, 22 Jun 2022 08:30:34 +0000 (16:30 +0800)] 
mt76: do not check the ccmp pn for ONLY_MONITOR frame

if the received frame enables RX_FLAG_ONLY_MONITOR,
driver doesn't need to check the ccmp pn of this frame.

Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: add sta_rec with EXTRA_INFO_NEW for the first time only
Shayne Chen [Wed, 22 Jun 2022 01:24:49 +0000 (09:24 +0800)] 
mt76: mt7915: add sta_rec with EXTRA_INFO_NEW for the first time only

Set EXTRA_INFO_NEW for the first time only to prevent adding the same
starec entry, otherwise the entry might be removed in fw.

Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: update mpdu density in 6g capability
Peter Chiu [Wed, 22 Jun 2022 01:24:48 +0000 (09:24 +0800)] 
mt76: mt7915: update mpdu density in 6g capability

Set mpdu density to 2 usec in 6g capability to meet hardware
capability and also enhance throughput.

Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: do not copy ieee80211_ops pointer in mt7915_mmio_probe
Lorenzo Bianconi [Tue, 21 Jun 2022 22:51:24 +0000 (00:51 +0200)] 
mt76: mt7915: do not copy ieee80211_ops pointer in mt7915_mmio_probe

We do not modify ieee80211_ops pointers so we do not need to copy them.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: fix incorrect testmode ipg on band 1 caused by wmm_idx
Shayne Chen [Mon, 20 Jun 2022 06:17:17 +0000 (14:17 +0800)] 
mt76: mt7915: fix incorrect testmode ipg on band 1 caused by wmm_idx

Fix the issue that the measured inter packet gap didn't fit its
setting value.

Fixes: c2d3b1926f30 ("mt76: mt7915: add support for ipg in testmode")
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: disable UL MU-MIMO for mt7915
Felix Fietkau [Tue, 21 Jun 2022 18:34:44 +0000 (20:34 +0200)] 
mt76: mt7915: disable UL MU-MIMO for mt7915

After initially establishing a connection, it can produce multi-second latency
spikes and tx hangs when pushing traffic.
It should work better for MT7916 and MT7986, so leave it enabled there

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: move mt76_connac2_mcu_fill_message in mt76_connac module
Lorenzo Bianconi [Mon, 20 Jun 2022 12:59:18 +0000 (14:59 +0200)] 
mt76: move mt76_connac2_mcu_fill_message in mt76_connac module

Move mt76_connac2_mcu_fill_message routine in shared module in order to
reuse it for mt7921 and mt7915e drivers. This is a preliminary patch to
add mt7990 driver support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: move mcu_txd/mcu_rxd structures in shared code
Lorenzo Bianconi [Mon, 20 Jun 2022 12:59:17 +0000 (14:59 +0200)] 
mt76: move mcu_txd/mcu_rxd structures in shared code

This is a preliminary patch to add mt7990 chipset support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: rely on mt76_connac_tx_free
Lorenzo Bianconi [Mon, 20 Jun 2022 12:37:34 +0000 (14:37 +0200)] 
mt76: mt7915: rely on mt76_connac_tx_free

As for mt7921 and mt7615 drivers, rely on mt76_connac_tx_free data
structure in mt7915e driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: move mt7615_txp_skb_unmap in common code
Lorenzo Bianconi [Sun, 19 Jun 2022 20:42:41 +0000 (22:42 +0200)] 
mt76: connac: move mt7615_txp_skb_unmap in common code

Move mt7615_txp_skb_unmap in shared code and reuse it in mt7915e and
mt7921e driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: move mt76_connac_write_hw_txp in shared code
Lorenzo Bianconi [Sun, 19 Jun 2022 20:42:40 +0000 (22:42 +0200)] 
mt76: connac: move mt76_connac_write_hw_txp in shared code

Now we can move mt76_connac_write_hw_txp routine in mt76-connac module
and reuse it in mt7921e and mt7615e driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: move mt76_connac_tx_complete_skb in shared code
Lorenzo Bianconi [Sun, 19 Jun 2022 20:42:39 +0000 (22:42 +0200)] 
mt76: connac: move mt76_connac_tx_complete_skb in shared code

Since now txp structures are in common code we can reuse
mt76_connac_tx_complete_skb routine in mt7921e, mt7915e and mt7615e
drivers.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: move mt76_connac_tx_free in shared code
Lorenzo Bianconi [Sun, 19 Jun 2022 20:42:38 +0000 (22:42 +0200)] 
mt76: connac: move mt76_connac_tx_free in shared code

Move mt76_connac_tx_free structure in mt76_connac module since it is
shared by mt7615 and mt7921 drivers.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: move mt7615_txp_ptr in mt76_connac module
Lorenzo Bianconi [Sun, 19 Jun 2022 20:42:37 +0000 (22:42 +0200)] 
mt76: move mt7615_txp_ptr in mt76_connac module

Since mt7615_txp_ptr is shared between mt7615 and mt7921 move it in
mt76_connac module.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: move mt76_connac_fw_txp in common module
Lorenzo Bianconi [Sun, 19 Jun 2022 20:42:36 +0000 (22:42 +0200)] 
mt76: connac: move mt76_connac_fw_txp in common module

Since mt76_connac_fw_txp struct is shared between mt7615e, mt7915e and
mt7921e, move it in mt76_connac module.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: get rid of unnecessary new line in mt7915_mac_write_txwi
Lorenzo Bianconi [Sun, 19 Jun 2022 13:05:51 +0000 (15:05 +0200)] 
mt76: mt7915: get rid of unnecessary new line in mt7915_mac_write_txwi

Remove unnecessary new line in mt7915_mac_write_txwi routine.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: enlarge maximum VHT MPDU length to 11454
Deren Wu [Sat, 18 Jun 2022 10:56:44 +0000 (18:56 +0800)] 
mt76: mt7921: enlarge maximum VHT MPDU length to 11454

Enlarge maximum MPDU length to 11454 that both mt7921/mt7922 can support.
After this fixing, we can get better performance.

Fixes: 5c14a5f944b9 ("mt76: mt7921: introduce mt7921e support")
Tested-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: fix aggregation subframes setting to HE max
Deren Wu [Thu, 16 Jun 2022 15:57:43 +0000 (23:57 +0800)] 
mt76: mt7921: fix aggregation subframes setting to HE max

mt7921/mt7922 support HE max aggregation subframes 256 for both tx/rx.
Get better throughput then before.

Fixes: 94bb18b03d43 ("mt76: mt7921: fix max aggregation subframes setting")
Tested-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Reviewed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921s: fix possible sdio deadlock in command fail
Deren Wu [Tue, 14 Jun 2022 07:50:24 +0000 (15:50 +0800)] 
mt76: mt7921s: fix possible sdio deadlock in command fail

Move sdio_release_host() to final resource handing

Fixes: b12deb5e86fa ("mt76: mt7921s: fix mt7921s_mcu_[fw|drv]_pmctrl")
Reported-by: YN Chen <YN.Chen@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: do not update pm states in case of error
Lorenzo Bianconi [Mon, 13 Jun 2022 12:07:08 +0000 (14:07 +0200)] 
mt76: mt7921: do not update pm states in case of error

Do not update pm stats if mt7921e_mcu_fw_pmctrl routine returns an
error.

Fixes: 36873246f78a2 ("mt76: mt7921: add awake and doze time accounting")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7615: do not update pm stats in case of error
Lorenzo Bianconi [Mon, 13 Jun 2022 12:03:28 +0000 (14:03 +0200)] 
mt76: mt7615: do not update pm stats in case of error

Do not update pm stats if mt7615_mcu_fw_pmctrl returns an error.

Fixes: abe912ae3cd42 ("mt76: mt7663: add awake and doze time accounting")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921s: remove unnecessary goto in mt7921s_mcu_drv_pmctrl
Lorenzo Bianconi [Mon, 13 Jun 2022 12:00:44 +0000 (14:00 +0200)] 
mt76: mt7921s: remove unnecessary goto in mt7921s_mcu_drv_pmctrl

Get rid of unnecessary goto in mt7921s_mcu_drv_pmctrl routine.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: move mt76_connac2_mac_fill_rx_rate in connac module
Lorenzo Bianconi [Wed, 8 Jun 2022 17:30:31 +0000 (19:30 +0200)] 
mt76: connac: move mt76_connac2_mac_fill_rx_rate in connac module

Rely on mt76_connac2_mac_fill_rx_rate routine in mt7921 driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: move mt76_connac2_reverse_frag0_hdr_trans in mt76-connac module
Lorenzo Bianconi [Wed, 8 Jun 2022 17:30:30 +0000 (19:30 +0200)] 
mt76: connac: move mt76_connac2_reverse_frag0_hdr_trans in mt76-connac module

mt76_connac2_reverse_frag0_hdr_trans routine is shared between mt7921
and mt7915e drivers.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: move HE radiotap parsing in connac module
Lorenzo Bianconi [Wed, 8 Jun 2022 17:30:29 +0000 (19:30 +0200)] 
mt76: connac: move HE radiotap parsing in connac module

HE radiotap parsing code is shared between connac2 devices.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: fix command timeout in AP stop period
Deren Wu [Wed, 8 Jun 2022 12:53:26 +0000 (20:53 +0800)] 
mt76: mt7921: fix command timeout in AP stop period

Due to AP stop improperly, mt7921 driver would face random command timeout
by chip fw problem. Migrate AP start/stop process to .start_ap/.stop_ap and
congiure BSS network settings in both hooks.

The new flow is shown below.
* AP start
    .start_ap()
      configure BSS network resource
      set BSS to connected state
    .bss_info_changed()
      enable fw beacon offload

* AP stop
    .bss_info_changed()
      disable fw beacon offload (skip this command)
    .stop_ap()
      set BSS to disconnected state (beacon offload disabled automatically)
      destroy BSS network resource

Fixes: 116c69603b01 ("mt76: mt7921: Add AP mode support")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: not support beacon offload disable command
Deren Wu [Wed, 8 Jun 2022 12:53:25 +0000 (20:53 +0800)] 
mt76: mt7921: not support beacon offload disable command

Beacon disable flow would be handled in bss stop handler automatically.
Force return -EOPNOTSUPP in disable case.

Fixes: 116c69603b01 ("mt76: mt7921: Add AP mode support")
Reviewed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: move mt76_connac2_mac_add_txs_skb in connac module
Lorenzo Bianconi [Tue, 7 Jun 2022 09:28:41 +0000 (11:28 +0200)] 
mt76: connac: move mt76_connac2_mac_add_txs_skb in connac module

Move mt76_connac2_mac_add_txs_skb in mt76-connac module since it is
shared between connac2 devices (mt7921 and mt7915)

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: move connac2_mac_write_txwi in mt76_connac module
Lorenzo Bianconi [Tue, 7 Jun 2022 09:28:40 +0000 (11:28 +0200)] 
mt76: connac: move connac2_mac_write_txwi in mt76_connac module

mac_write_txwi code is shared between connac2 devices (mt7915 and
mt7921). Move it in connac module.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: move mac connac2 defs in mt76_connac2_mac.h
Lorenzo Bianconi [Tue, 7 Jun 2022 09:28:39 +0000 (11:28 +0200)] 
mt76: connac: move mac connac2 defs in mt76_connac2_mac.h

This is a preliminary patch to share connac2 mac txwi code.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: rely on mt76_dev in mt7915_mac_write_txwi signature
Lorenzo Bianconi [Tue, 7 Jun 2022 09:28:38 +0000 (11:28 +0200)] 
mt76: mt7915: rely on mt76_dev in mt7915_mac_write_txwi signature

This is a preliminary patch to share txwi configuration code.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: rely on mt76_dev in mt7921_mac_write_txwi signature
Lorenzo Bianconi [Tue, 7 Jun 2022 09:28:37 +0000 (11:28 +0200)] 
mt76: mt7921: rely on mt76_dev in mt7921_mac_write_txwi signature

This is a preliminary patch to share txwi configuration code.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: enable the VHT extended NSS BW feature
Deren Wu [Tue, 7 Jun 2022 05:00:46 +0000 (13:00 +0800)] 
mt76: enable the VHT extended NSS BW feature

According IEEE Std 802.11-2020, its definition is:
Indicates whether the STA is capable of interpreting the Extended NSS BW
Support subfield of the VHT Capabilities Information field.

Some APs, such as Xiaomi AX6000, would check this one for BW settings.
mt76 driver can get max BW capability only if the this field is confgured
properly.

Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7663: rely on mt76_connac2_fw_trailer
Lorenzo Bianconi [Fri, 3 Jun 2022 09:36:46 +0000 (11:36 +0200)] 
mt76: mt7663: rely on mt76_connac2_fw_trailer

Remove duplicated code

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: move mt76_connac2_load_patch in connac module
Lorenzo Bianconi [Fri, 3 Jun 2022 09:36:45 +0000 (11:36 +0200)] 
mt76: connac: move mt76_connac2_load_patch in connac module

Move mt76_connac2_load_patch utility routine in mt76_connac module since
it is shared between mt7921 and mt7915. This is a preliminary patch to
support mt7902e driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: move mt76_connac2_load_ram in connac module
Lorenzo Bianconi [Fri, 3 Jun 2022 09:36:44 +0000 (11:36 +0200)] 
mt76: connac: move mt76_connac2_load_ram in connac module

Move mt76_connac2_load_ram utility routine in mt76_connac module since
it is shared between mt7921 and mt7915. This is a preliminary patch to
support mt7902e driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: move fw toggle in mt7921_load_firmware
Lorenzo Bianconi [Fri, 3 Jun 2022 09:36:43 +0000 (11:36 +0200)] 
mt76: mt7921: move fw toggle in mt7921_load_firmware

Move drv_own/fw_own toggle in mt7921_load_firmware. This change allow to
reuse connac code to load patch for mt7921 driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Tested-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: connac: move shared fw structures in connac module
Lorenzo Bianconi [Fri, 3 Jun 2022 09:36:42 +0000 (11:36 +0200)] 
mt76: connac: move shared fw structures in connac module

Move mt76_connac2 fw structures in connac module since they are shared
between mt7921 and mt7915 drivers. This is a preliminary patch to add
mt7902e support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: get rid of mt7921_mcu_exit
Lorenzo Bianconi [Fri, 3 Jun 2022 08:21:37 +0000 (10:21 +0200)] 
mt76: mt7921: get rid of mt7921_mcu_exit

Run skb_queue_purge when needed.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: add missing bh-disable around rx napi schedule
Lorenzo Bianconi [Fri, 3 Jun 2022 07:35:00 +0000 (09:35 +0200)] 
mt76: mt7921: add missing bh-disable around rx napi schedule

napi_schedule() can call __raise_softirq_irqoff(), which can perform
softirq handling, so it must not be called in a pure process context
with BH enabled.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7615: add missing bh-disable around rx napi schedule
Felix Fietkau [Thu, 2 Jun 2022 19:44:21 +0000 (21:44 +0200)] 
mt76: mt7615: add missing bh-disable around rx napi schedule

napi_schedule() can call __raise_softirq_irqoff(), which can perform softirq
handling, so it must not be called in a pure process context with BH enabled.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: add missing bh-disable around tx napi enable/schedule
Felix Fietkau [Thu, 2 Jun 2022 19:43:04 +0000 (21:43 +0200)] 
mt76: mt7915: add missing bh-disable around tx napi enable/schedule

napi_schedule() can call __raise_softirq_irqoff(), which can perform softirq
handling, so it must not be called in a pure process context with BH enabled.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agodt-bindings: net: wireless: mt76: add clock description for MT7986.
Peter Chiu [Thu, 12 May 2022 04:38:59 +0000 (12:38 +0800)] 
dt-bindings: net: wireless: mt76: add clock description for MT7986.

Add clocks and clock-names for MT7986.

Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921s: fix firmware download random fail
YN Chen [Sat, 28 May 2022 01:28:54 +0000 (09:28 +0800)] 
mt76: mt7921s: fix firmware download random fail

To avoid racing problems in chip, mt7921s should reacquire drv-own after
firmware semaphore is released.

Fixes: 78b217580c509 ("mt76: mt7921s: fix bus hang with wrong privilege")
Signed-off-by: YN Chen <yn.chen@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: add PATCH_FINISH_REQ cmd response handling
YN Chen [Sat, 28 May 2022 01:28:53 +0000 (09:28 +0800)] 
mt76: mt7921: add PATCH_FINISH_REQ cmd response handling

add new case to fetch the return value of PATCH_FINISH_REQ

Signed-off-by: YN Chen <yn.chen@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: add DBDC rxq handlings into mac_reset_work
Ryder Lee [Thu, 26 May 2022 09:08:55 +0000 (17:08 +0800)] 
mt76: add DBDC rxq handlings into mac_reset_work

Enable/disable rx napi for DBDC.

Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: add more ethtool stats
Ryder Lee [Thu, 26 May 2022 09:08:54 +0000 (17:08 +0800)] 
mt76: mt7915: add more ethtool stats

Add channel time and MAC ready stats.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: introduce ACPI SAR config in tx power
Deren Wu [Fri, 20 May 2022 09:03:39 +0000 (17:03 +0800)] 
mt76: mt7921: introduce ACPI SAR config in tx power

Add new function mt7921_set_tx_sar_pwr() to update SAR power from
.set_sar_specs and ACPI setting. Both settings would be merged into
mt76_freq_range_power for final tx power value.

Reviewed-by: Sean Wang <sean.wang@mediatek.com>
Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7921: introduce ACPI SAR support
Deren Wu [Fri, 20 May 2022 09:03:38 +0000 (17:03 +0800)] 
mt76: mt7921: introduce ACPI SAR support

In ACPI SAR enabled device, mt7921 should read power limit in ACPI config.
The limit value would be applied to regular tx power settings in mt76.

Two major functionalities added:
1. Get SAR power table through ACPI.
2. Read power in Dynamic/Geo SAR table for tx power limit.

Table note
MTDS: Dynamic SAR table
MTGS: Geo SAR table
MTCL: Country List table (for 6GHz support)

Reviewed-by: Sean Wang <sean.wang@mediatek.com>
Co-developed-by: Quan Zhou <quan.zhou@mediatek.com>
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: add 6 GHz band support in mt76_sar_freq_ranges
Deren Wu [Fri, 20 May 2022 09:03:37 +0000 (17:03 +0800)] 
mt76: add 6 GHz band support in mt76_sar_freq_ranges

Add new frequencies support in mt76_sar_freq_ranges[]
* 5945 - 6165
* 6165 - 6405
* 6405 - 6525
* 6525 - 6705
* 6705 - 6865
* 6865 - 7125

Reviewed-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: fix endian bug in mt7915_rf_regval_set()
Dan Carpenter [Thu, 19 May 2022 13:57:22 +0000 (16:57 +0300)] 
mt76: mt7915: fix endian bug in mt7915_rf_regval_set()

This code is supposed to set a u32 value, but casting will not work on
big endian systems.

Fixes: 0a17329ae9c1 ("mt76: mt7915: add debugfs knob for RF registers read/write")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt76x02u: fix possible memory leak in __mt76x02u_mcu_send_msg
Lorenzo Bianconi [Tue, 17 May 2022 16:37:07 +0000 (18:37 +0200)] 
mt76: mt76x02u: fix possible memory leak in __mt76x02u_mcu_send_msg

Free the skb if mt76u_bulk_msg fails in __mt76x02u_mcu_send_msg routine.

Fixes: 4c89ff2c74e39 ("mt76: split __mt76u_mcu_send_msg and mt76u_mcu_send_msg routines")
Co-developed-by: Gergo Koteles <soyer@irl.hu>
Signed-off-by: Gergo Koteles <soyer@irl.hu>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomt76: mt7915: fix endianness in mt7915_rf_regval_get
Lorenzo Bianconi [Tue, 17 May 2022 16:05:59 +0000 (18:05 +0200)] 
mt76: mt7915: fix endianness in mt7915_rf_regval_get

Fix the following sparse warning in mt7915_rf_regval_get routine:
drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c:979:16: warning: cast to restricted __le32

Fixes: 0a17329ae9c1f ("mt76: mt7915: add debugfs knob for RF registers read/write")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agoMerge tag 'imx-fixes-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawngu...
Arnd Bergmann [Mon, 11 Jul 2022 11:17:23 +0000 (13:17 +0200)] 
Merge tag 'imx-fixes-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes

i.MX fixes for 5.19, round 3:

- Fix GPIO property for imx6qdl-ts7970 board.
- Fix touchscreen pinctrl for imx6ull-colibri board by moving iomuxc-snvs
  pin to the correct controller device.
- Fix SFP node of fsl-ls1028a to have a required clock property.

* tag 'imx-fixes-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  ARM: dts: colibri-imx6ull: fix snvs pinmux group
  ARM: dts: imx6qdl-ts7970: Fix ngpio typo and count
  arm64: dts: ls1028a: Update SFP node to include clock

Link: https://lore.kernel.org/r/20220709032716.GA9868@dragon
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agowifi: mac80211_hwsim: add back erroneously removed cast
Johannes Berg [Mon, 11 Jul 2022 11:14:24 +0000 (13:14 +0200)] 
wifi: mac80211_hwsim: add back erroneously removed cast

The robots report that we're now casting to a differently
sized integer, which is correct, and the previous patch
had erroneously removed it.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 4ee186fa7e40 ("wifi: mac80211_hwsim: fix race condition in pending packet")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agospi: remove duplicate parameters check in acpi_spi_add_resource()
Andy Shevchenko [Sat, 9 Jul 2022 00:07:09 +0000 (03:07 +0300)] 
spi: remove duplicate parameters check in acpi_spi_add_resource()

The acpi_spi_add_resource() is never called with ctrl == NULL and
index == -1. The only caller already performs the check. Hence
remove the duplication from the acpi_spi_add_resource().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220709000709.35622-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agospi: propagate error code to the caller of acpi_spi_device_alloc()
Andy Shevchenko [Sat, 9 Jul 2022 00:07:08 +0000 (03:07 +0300)] 
spi: propagate error code to the caller of acpi_spi_device_alloc()

Since acpi_spi_device_alloc() has been designed to return an error
pointer we may now properly propagate error codes to the caller of
it. It helps debugging a lot.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220709000709.35622-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agospi: Return deferred probe error when controller isn't yet available
Andy Shevchenko [Sat, 9 Jul 2022 21:29:56 +0000 (00:29 +0300)] 
spi: Return deferred probe error when controller isn't yet available

If the controller is not available, it might be in the future and
we would like to re-probe the peripheral again. For that purpose
return deferred probe.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215993
Fixes: 87e59b36e5e2 ("spi: Support selection of the index of the ACPI Spi Resource before alloc")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220709212956.25530-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoregulator: qcom,spmi-regulator: add PMP8074 PMIC
Robert Marko [Mon, 4 Jul 2022 21:23:56 +0000 (23:23 +0200)] 
regulator: qcom,spmi-regulator: add PMP8074 PMIC

Document the PMP8074 PMIC compatible.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220704212402.1715182-6-robimarko@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoregulator: qcom,spmi-regulator: Convert to dtschema
Robert Marko [Mon, 4 Jul 2022 21:23:53 +0000 (23:23 +0200)] 
regulator: qcom,spmi-regulator: Convert to dtschema

Convert the bindings of Qualcomm SPMI regulators to DT schema.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220704212402.1715182-3-robimarko@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoregulator: qcom_spmi: add support for PMP8074 regulators
Robert Marko [Mon, 4 Jul 2022 21:23:57 +0000 (23:23 +0200)] 
regulator: qcom_spmi: add support for PMP8074 regulators

PMP8074 is a companion PMIC for the Qualcomm IPQ8074 WiSoC-s.

It features 5 HF-SMPS and 13 LDO regulators.

HF-SMPS regulators are Buck HFS430 regulators.
L1, L2 and L3 are HT_N1200_ST subtype LDO regulators.
L4 is HT_N300_ST subtype LDO regulator.
L5 and L6 are HT_P600 subtype LDO regulators.
L7, L11, L12 and L13 are HT_P150 subtype LDO regulators.
L10 is HT_P50 subtype LDO regulator.

This commit adds support for all of the buck regulators and LDO-s except
for L10 as I dont have documentation on its output voltage range.

S3 is the CPU cluster voltage supply, S4 supplies the UBI32 NPU cores
and L11 is the SDIO/eMMC I/O voltage regulator required for high speeds.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Link: https://lore.kernel.org/r/20220704212402.1715182-7-robimarko@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoregulator: qcom_spmi: add support for HT_P600
Robert Marko [Mon, 4 Jul 2022 21:23:55 +0000 (23:23 +0200)] 
regulator: qcom_spmi: add support for HT_P600

HT_P600 is a LDO PMOS regulator based on LV P600 using HFS430 layout
found in PMP8074 and PMS405 PMIC-s.

Both PMP8074 and PMS405 define the programmable range as 1.704 to 1.896V
but the actual MAX output voltage depends on the exact LDO in each of
the PMIC-s.
Their usual voltage that they are used is 1.8V.

It has a max current of 600mA, voltage step of 8mV.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Link: https://lore.kernel.org/r/20220704212402.1715182-5-robimarko@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoregulator: qcom_spmi: add support for HT_P150
Robert Marko [Mon, 4 Jul 2022 21:23:54 +0000 (23:23 +0200)] 
regulator: qcom_spmi: add support for HT_P150

HT_P150 is a LDO PMOS regulator based on LV P150 using HFS430 layout
found in PMP8074 and PMS405 PMIC-s.

Both PMP8074 and PMS405 define the programmable range as 1.616V to 3.304V
but the actual MAX output voltage depends on the exact LDO in each of
the PMIC-s.

It has a max current of 150mA, voltage step of 8mV.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Link: https://lore.kernel.org/r/20220704212402.1715182-4-robimarko@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoregulator: max597x: Remove unused including <linux/version.h>
Jiapeng Chong [Mon, 11 Jul 2022 03:40:11 +0000 (11:40 +0800)] 
regulator: max597x: Remove unused including <linux/version.h>

The patch makes sense but these are not compile warnings.
They come from scripts/checkversion.pl, which can be called
by 'make versioncheck', so I suppose that something in your
build system is running 'make versioncheck'.

Eliminate the follow versioncheck warning:

./drivers/regulator/max597x-regulator.c: 21 linux/version.h not needed.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Link: https://lore.kernel.org/r/20220711034011.46096-1-jiapeng.chong@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: fsl_utils: Drop usage of __clk_get_name()
Shengjiu Wang [Mon, 11 Jul 2022 02:39:50 +0000 (10:39 +0800)] 
ASoC: fsl_utils: Drop usage of __clk_get_name()

Avoid build errors when CONFIG_COMMON_CLK is not set/enabled.

ERROR: modpost: "__clk_get_name" [sound/soc/fsl/snd-soc-fsl-utils.ko] undefined!

Fixes: 7bad8125549c ("ASoC: fsl_utils: Add function to handle PLL clock source")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1657507190-14546-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8186: Remove condition with no effect
Zhongjun Tan [Fri, 8 Jul 2022 02:46:51 +0000 (10:46 +0800)] 
ASoC: mediatek: mt8186: Remove condition with no effect

Remove condition with no effect

Signed-off-by: Zhongjun Tan <tanzhongjun@coolpad.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220708024651.42999-1-hbut_tan@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: mediatek: fix mt8195 StatvectorSel wrong setting
YC Hung [Fri, 8 Jul 2022 20:39:04 +0000 (15:39 -0500)] 
ASoC: SOF: mediatek: fix mt8195 StatvectorSel wrong setting

Fix StatVectorSel wrong setting.

Fixes: b7f6503830 ("ASoC: SOF: mediatek: Add fw loader and mt8195 dsp ops to load firmware")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Li-Yu Yu <afg984@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: KuanHsun Cheng <Allen-KH.Cheng@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220708203904.29214-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: mediatek: Revise mt8195 boot flow
YC Hung [Fri, 8 Jul 2022 20:39:03 +0000 (15:39 -0500)] 
ASoC: SOF: mediatek: Revise mt8195 boot flow

1. Revise hifixdsp shutdown flow to pull runstall high then reset high.
2. Add 1 us delay between D/BRESET high and low for 10 DSP cycles(26M)
   based on IP vendor's suggestion.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Li-Yu Yu <afg984@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: KuanHsun Cheng <Allen-KH.Cheng@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220708203904.29214-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf
David S. Miller [Mon, 11 Jul 2022 10:58:38 +0000 (11:58 +0100)] 
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf

Pablo Neira Ayuso says:

====================
Netfilter fixes for net

The following patchset contains Netfilter fixes for net:

1) refcount_inc_not_zero() is not semantically equivalent to
   atomic_int_not_zero(), from Florian Westphal. My understanding was
   that refcount_*() API provides a wrapper to easier debugging of
   reference count leaks, however, there are semantic differences
   between these two APIs, where refcount_inc_not_zero() needs a barrier.
   Reason for this subtle difference to me is unknown.

2) packet logging is not correct for ARP and IP packets, from the
   ARP family and netdev/egress respectively. Use skb_network_offset()
   to reach the headers accordingly.

3) set element extension length have been growing over time, replace
   a BUG_ON by EINVAL which might be triggerable from userspace.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'mptcp-fixes'
David S. Miller [Mon, 11 Jul 2022 10:31:38 +0000 (11:31 +0100)] 
Merge branch 'mptcp-fixes'

Mat Martineau says:

====================
mptcp: Disconnect and selftest fixes

Patch 1 switches to a safe list iterator in the MPTCP disconnect code.

Patch 2 adds the userspace_pm.sh selftest script to the MPTCP selftest
Makefile, resolving the netdev/check_selftest CI failure.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoselftests: mptcp: validate userspace PM tests by default
Matthieu Baerts [Fri, 8 Jul 2022 23:36:10 +0000 (16:36 -0700)] 
selftests: mptcp: validate userspace PM tests by default

The new script was not listed in the programs to test.

By consequence, some CIs running MPTCP selftests were not validating
these new tests. Note that MPTCP CI was validating it as it executes all
.sh scripts from 'tools/testing/selftests/net/mptcp' directory.

Fixes: 259a834fadda ("selftests: mptcp: functional tests for the userspace PM type")
Reported-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomptcp: fix subflow traversal at disconnect time
Paolo Abeni [Fri, 8 Jul 2022 23:36:09 +0000 (16:36 -0700)] 
mptcp: fix subflow traversal at disconnect time

At disconnect time the MPTCP protocol traverse the subflows
list closing each of them. In some circumstances - MPJ subflow,
passive MPTCP socket, the latter operation can remove the
subflow from the list, invalidating the current iterator.

Address the issue using the safe list traversing helper
variant.

Reported-by: van fantasy <g1042620637@gmail.com>
Fixes: b29fcfb54cd7 ("mptcp: full disconnect implementation")
Tested-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge tag 'fpga-late-for-5.20-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel...
Greg Kroah-Hartman [Mon, 11 Jul 2022 10:30:24 +0000 (12:30 +0200)] 
Merge tag 'fpga-late-for-5.20-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga into char-misc-next

Xu writes:

Here is the second set of FPGA changes for 5.20-rc1

FPGA Manager core:
- Ivan's change to support image offset and data size setting for
reprograming. A parse_header() callback is introduced for drivers to
specify these info.
- Colin's immediate spelling fix for Ivan's patch.

Microchip:
- Ivan's change to add Microchip MPF FPGA manager driver. And MAINTAINERS
entry added for the driver.

All patches have been reviewed on the mailing list, and have been in the
last linux-next releases (as part of our for-next branch).

Signed-off-by: Xu Yilun <yilun.xu@intel.com>
* tag 'fpga-late-for-5.20-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga:
  fpga: fpga-mgr: Fix spelling mistake "bitsream" -> "bitstream"
  MAINTAINERS: add Microchip PolarFire FPGA drivers entry
  dt-bindings: fpga: add binding doc for microchip-spi fpga mgr
  fpga: microchip-spi: add Microchip MPF FPGA manager
  docs: fpga: mgr: document parse_header() callback
  fpga: fpga-mgr: support bitstream offset in image buffer

3 years agoMerge tag 'mhi-for-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi...
Greg Kroah-Hartman [Mon, 11 Jul 2022 10:28:46 +0000 (12:28 +0200)] 
Merge tag 'mhi-for-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi into char-misc-next

Manivannan writes:

MHI Host
--------

Support for new modems:

 - Quectel EM120 FCCL based on SDX24. This product MHI configuration is same
   as EM120R-GL modem.
 - Foxconn Cinterion MV31-W. This product is same as the existing MV31-W
   modem but sold as a separate product as it uses a different firmware
   baseline.
 - Foxconn T99W175 based on SDX55.

Core changes:

 - Moved the IRQ allocation to MHI controller registration phase. Since the
   MHI endpoint may be powered up/down several times during runtime, it
   makes sense to move the IRQ allocation to registration phase and just
   enable/disable IRQs during endpoint power up/down.

MHI endpoint
------------

Core changes:

 - Added error check for dev_set_name()

* tag 'mhi-for-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi:
  bus: mhi: ep: Check dev_set_name() return value
  bus: mhi: host: pci_generic: Add another Foxconn T99W175
  bus: mhi: host: Move IRQ allocation to controller registration phase
  bus: mhi: host: pci_generic: Add Cinterion MV31-W with new baseline
  bus: mhi: host: pci_generic: Add support for Quectel EM120 FCCL modem