iwlwifi: pnvm: accept multiple HW-type TLVs
Subsystems (8)
Sasha Levin
maintainerPATCH 1/26 iwlwifi: pnvm: accept multiple HW-type TLVs
From: Johannes Berg <[email protected]>
[ Upstream commit 0f673c16c850250db386537a422c11d248fb123c ]
Some products (So) may have two different types of products with different mac-type that are otherwise equivalent, and have the same PNVM data, so the PNVM file will contain two (or perhaps later more) HW-type TLVs. Accept the file and use the data section that contains any matching entry.
--- drivers/net/wireless/intel/iwlwifi/fw/pnvm.c | 25 +++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/pnvm.c +16 -9
@@ -37,6 +37,7 @@ static int iwl_pnvm_handle_section(struct iwl_trans *trans, const u8 *data,u32 sha1 =0 ;u16 mac_type =0 , rf_id =0 ;u8 *pnvm_data =NULL , *tmp; +bool hw_match = false;u32 size =0 ;int ret;
@@ -83,6 +84,9 @@ static int iwl_pnvm_handle_section(struct iwl_trans *trans, const u8 *data,break ; } +if (hw_match) +break ; + mac_type =le16_to_cpup ((__le16 *)data); rf_id =le16_to_cpup ((__le16 *)(data +sizeof (__le16)));
@@ -90,15 +94,9 @@ static int iwl_pnvm_handle_section(struct iwl_trans *trans, const u8 *data,"Got IWL_UCODE_TLV_HW_TYPE mac_type 0x%0x rf_id 0x%0x\n" , mac_type, rf_id); -if (mac_type !=CSR_HW_REV_TYPE (trans->hw_rev) || - rf_id !=CSR_HW_RFID_TYPE (trans->hw_rf_id)) { -IWL_DEBUG_FW (trans, -"HW mismatch, skipping PNVM section, mac_type 0x%0x, rf_id 0x%0x.\n" , -CSR_HW_REV_TYPE (trans->hw_rev), trans->hw_rf_id); - ret = -ENOENT ; - goto out; - } - +if (mac_type ==CSR_HW_REV_TYPE (trans->hw_rev) && + rf_id ==CSR_HW_RFID_TYPE (trans->hw_rf_id)) + hw_match = true;break ;case IWL_UCODE_TLV_SEC_RT : {struct iwl_pnvm_section *section = (void *)data;
@@ -149,6 +147,15 @@ static int iwl_pnvm_handle_section(struct iwl_trans *trans, const u8 *data, } done: +if (!hw_match) { +IWL_DEBUG_FW (trans, +"HW mismatch, skipping PNVM section (need mac_type 0x%x rf_id 0x%x)\n" , +CSR_HW_REV_TYPE (trans->hw_rev), +CSR_HW_RFID_TYPE (trans->hw_rf_id)); + ret = -ENOENT ; + goto out; + } +if (!size) {IWL_DEBUG_FW (trans,"Empty PNVM, skipping.\n" ); ret = -ENOENT ;
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 2/26 iwlwifi: add new SoF with JF devices
From: Yaara Baruch <[email protected]>
[ Upstream commit a5bf1d4434b93394fa37494d78fe9f3513557185 ]
Add new SoF JF devices to the driver.
--- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+)
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +34 -0
@@ -1103,6 +1103,40 @@ static const struct iwl_dev_info iwl_dev_info_table[] = { IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_NO_CDB, iwl_cfg_bz_a0_mr_a0, iwl_ax211_name), +/* SoF with JF2 */ +_IWL_DEV_INFO (IWL_CFG_ANY ,IWL_CFG_ANY , +IWL_CFG_MAC_TYPE_SOF ,IWL_CFG_ANY , +IWL_CFG_RF_TYPE_JF2 ,IWL_CFG_RF_ID_JF , +IWL_CFG_160 ,IWL_CFG_CORES_BT ,IWL_CFG_NO_CDB , + iwlax210_2ax_cfg_so_jf_b0, iwl9560_160_name), +_IWL_DEV_INFO (IWL_CFG_ANY ,IWL_CFG_ANY , +IWL_CFG_MAC_TYPE_SOF ,IWL_CFG_ANY , +IWL_CFG_RF_TYPE_JF2 ,IWL_CFG_RF_ID_JF , +IWL_CFG_NO_160 ,IWL_CFG_CORES_BT ,IWL_CFG_NO_CDB , + iwlax210_2ax_cfg_so_jf_b0, iwl9560_name), + +/* SoF with JF */ +_IWL_DEV_INFO (IWL_CFG_ANY ,IWL_CFG_ANY , +IWL_CFG_MAC_TYPE_SOF ,IWL_CFG_ANY , +IWL_CFG_RF_TYPE_JF1 ,IWL_CFG_RF_ID_JF1 , +IWL_CFG_160 ,IWL_CFG_CORES_BT ,IWL_CFG_NO_CDB , + iwlax210_2ax_cfg_so_jf_b0, iwl9461_160_name), +_IWL_DEV_INFO (IWL_CFG_ANY ,IWL_CFG_ANY , +IWL_CFG_MAC_TYPE_SOF ,IWL_CFG_ANY , +IWL_CFG_RF_TYPE_JF1 ,IWL_CFG_RF_ID_JF1_DIV , +IWL_CFG_160 ,IWL_CFG_CORES_BT ,IWL_CFG_NO_CDB , + iwlax210_2ax_cfg_so_jf_b0, iwl9462_160_name), +_IWL_DEV_INFO (IWL_CFG_ANY ,IWL_CFG_ANY , +IWL_CFG_MAC_TYPE_SOF ,IWL_CFG_ANY , +IWL_CFG_RF_TYPE_JF1 ,IWL_CFG_RF_ID_JF1 , +IWL_CFG_NO_160 ,IWL_CFG_CORES_BT ,IWL_CFG_NO_CDB , + iwlax210_2ax_cfg_so_jf_b0, iwl9461_name), +_IWL_DEV_INFO (IWL_CFG_ANY ,IWL_CFG_ANY , +IWL_CFG_MAC_TYPE_SOF ,IWL_CFG_ANY , +IWL_CFG_RF_TYPE_JF1 ,IWL_CFG_RF_ID_JF1_DIV , +IWL_CFG_NO_160 ,IWL_CFG_CORES_BT ,IWL_CFG_NO_CDB , + iwlax210_2ax_cfg_so_jf_b0, iwl9462_name), +/* So with GF */ _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_MAC_TYPE_SO, IWL_CFG_ANY,
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 3/26 iwlwifi: add new so-jf devices
In reply to Sasha LevinFrom: Yaara Baruch <[email protected]>
[ Upstream commit 891332f697e14bfb2002f56e21d9bbd4800a7098 ]
Add new so-jf devices to the driver.
--- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +35 -1
@@ -1142,7 +1142,41 @@ static const struct iwl_dev_info iwl_dev_info_table[] = { IWL_CFG_MAC_TYPE_SO, IWL_CFG_ANY, IWL_CFG_RF_TYPE_GF, IWL_CFG_ANY, IWL_CFG_160, IWL_CFG_ANY, IWL_CFG_NO_CDB, - iwlax211_2ax_cfg_so_gf_a0, iwl_ax211_name) + iwlax211_2ax_cfg_so_gf_a0, iwl_ax211_name), + +/* So with JF2 */ +_IWL_DEV_INFO (IWL_CFG_ANY ,IWL_CFG_ANY , +IWL_CFG_MAC_TYPE_SO ,IWL_CFG_ANY , +IWL_CFG_RF_TYPE_JF2 ,IWL_CFG_RF_ID_JF , +IWL_CFG_160 ,IWL_CFG_CORES_BT ,IWL_CFG_NO_CDB , + iwlax210_2ax_cfg_so_jf_b0, iwl9560_160_name), +_IWL_DEV_INFO (IWL_CFG_ANY ,IWL_CFG_ANY , +IWL_CFG_MAC_TYPE_SO ,IWL_CFG_ANY , +IWL_CFG_RF_TYPE_JF2 ,IWL_CFG_RF_ID_JF , +IWL_CFG_NO_160 ,IWL_CFG_CORES_BT ,IWL_CFG_NO_CDB , + iwlax210_2ax_cfg_so_jf_b0, iwl9560_name), + +/* So with JF */ +_IWL_DEV_INFO (IWL_CFG_ANY ,IWL_CFG_ANY , +IWL_CFG_MAC_TYPE_SO ,IWL_CFG_ANY , +IWL_CFG_RF_TYPE_JF1 ,IWL_CFG_RF_ID_JF1 , +IWL_CFG_160 ,IWL_CFG_CORES_BT ,IWL_CFG_NO_CDB , + iwlax210_2ax_cfg_so_jf_b0, iwl9461_160_name), +_IWL_DEV_INFO (IWL_CFG_ANY ,IWL_CFG_ANY , +IWL_CFG_MAC_TYPE_SO ,IWL_CFG_ANY , +IWL_CFG_RF_TYPE_JF1 ,IWL_CFG_RF_ID_JF1_DIV , +IWL_CFG_160 ,IWL_CFG_CORES_BT ,IWL_CFG_NO_CDB , + iwlax210_2ax_cfg_so_jf_b0, iwl9462_160_name), +_IWL_DEV_INFO (IWL_CFG_ANY ,IWL_CFG_ANY , +IWL_CFG_MAC_TYPE_SO ,IWL_CFG_ANY , +IWL_CFG_RF_TYPE_JF1 ,IWL_CFG_RF_ID_JF1 , +IWL_CFG_NO_160 ,IWL_CFG_CORES_BT ,IWL_CFG_NO_CDB , + iwlax210_2ax_cfg_so_jf_b0, iwl9461_name), +_IWL_DEV_INFO (IWL_CFG_ANY ,IWL_CFG_ANY , +IWL_CFG_MAC_TYPE_SO ,IWL_CFG_ANY , +IWL_CFG_RF_TYPE_JF1 ,IWL_CFG_RF_ID_JF1_DIV , +IWL_CFG_NO_160 ,IWL_CFG_CORES_BT ,IWL_CFG_NO_CDB , + iwlax210_2ax_cfg_so_jf_b0, iwl9462_name)#endif /* CONFIG_IWLMVM */ };
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 4/26 opp: remove WARN when no valid OPPs remain
In reply to Sasha LevinFrom: Michał Mirosław <[email protected]>
[ Upstream commit 335ffab3ef864539e814b9a2903b0ae420c1c067 ]
This WARN can be triggered per-core and the stack trace is not useful. Replace it with plain dev_err(). Fix a comment while at it.
--- drivers/opp/of.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/opp/of.c +3 -2
@@ -985,8 +985,9 @@ static int _of_add_opp_table_v2(struct device *dev, struct opp_table *opp_table) } } -/* There should be one of more OPP defined */ -if (WARN_ON (!count)) { +/* There should be one or more OPPs defined */ +if (!count) { +dev_err (dev,"%s: no supported OPPs" , __func__); ret = -ENOENT ; goto remove_static_opp; }
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 5/26 cpufreq: blocklist Qualcomm sm8150 in cpufreq-dt-platdev
In reply to Sasha LevinFrom: Thara Gopinath <[email protected]>
[ Upstream commit 5d79e5ce5489b489cbc4c327305be9dfca0fc9ce ]
The Qualcomm sm8150 platform uses the qcom-cpufreq-hw driver, so add it to the cpufreq-dt-platdev driver's blocklist.
--- drivers/cpufreq/cpufreq-dt-platdev.c | 1 + 1 file changed, 1 insertion(+)
drivers/cpufreq/cpufreq-dt-platdev.c +1 -0
@@ -138,6 +138,7 @@ static const struct of_device_id blacklist[] __initconst = { { .compatible = "qcom,qcs404", }, { .compatible = "qcom,sc7180", }, { .compatible = "qcom,sdm845", }, + { .compatible = "qcom,sm8150", }, { .compatible = "st,stih407", }, { .compatible = "st,stih410", },
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 6/26 virtio: Improve vq->broken access to avoid any compiler optimization
In reply to Sasha LevinFrom: Parav Pandit <[email protected]>
[ Upstream commit 60f0779862e4ab943810187752c462e85f5fa371 ]
Currently vq->broken field is read by virtqueue_is_broken() in busy loop in one context by virtnet_send_command().
vq->broken is set to true in other process context by virtio_break_device(). Reader and writer are accessing it without any synchronization. This may lead to a compiler optimization which may result to optimize reading vq->broken only once.
Hence, force reading vq->broken on each invocation of virtqueue_is_broken() and also force writing it so that such update is visible to the readers.
It is a theoretical fix that isn't yet encountered in the field.
--- drivers/virtio/virtio_ring.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/virtio/virtio_ring.c +4 -2
@@ -2262,7 +2262,7 @@ bool virtqueue_is_broken(struct virtqueue *_vq) {struct vring_virtqueue *vq =to_vvq (_vq); -return vq->broken; +return READ_ONCE (vq->broken); }EXPORT_SYMBOL_GPL (virtqueue_is_broken);
@@ -2276,7 +2276,9 @@ void virtio_break_device(struct virtio_device *dev)list_for_each_entry (_vq, &dev->vqs, list) {struct vring_virtqueue *vq =to_vvq (_vq); - vq->broken = true; + +/* Pairs with READ_ONCE() in virtqueue_is_broken(). */ +WRITE_ONCE (vq->broken, true); } }EXPORT_SYMBOL_GPL (virtio_break_device);
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 7/26 virtio_pci: Support surprise removal of virtio pci device
In reply to Sasha LevinFrom: Parav Pandit <[email protected]>
[ Upstream commit 43bb40c5b92659966bdf4bfe584fde0a3575a049 ]
When a virtio pci device undergo surprise removal (aka async removal in PCIe spec), mark the device as broken so that any upper layer drivers can abort any outstanding operation.
When a virtio net pci device undergo surprise removal which is used by a NetworkManager, a below call trace was observed.
kernel:watchdog: BUG: soft lockup - CPU#1 stuck for 26s! [kworker/1:1:27059]
watchdog: BUG: soft lockup - CPU#1 stuck for 52s! [kworker/1:1:27059] CPU: 1 PID: 27059 Comm: kworker/1:1 Tainted: G S W I L 5.13.0-hotplug+ #8 Hardware name: Dell Inc. PowerEdge R640/0H28RR, BIOS 2.9.4 11/06/2020 Workqueue: events linkwatch_event RIP: 0010:virtnet_send_command+0xfc/0x150 [virtio_net] Call Trace: virtnet_set_rx_mode+0xcf/0x2a7 [virtio_net] ? __hw_addr_create_ex+0x85/0xc0 __dev_mc_add+0x72/0x80 igmp6_group_added+0xa7/0xd0 ipv6_mc_up+0x3c/0x60 ipv6_find_idev+0x36/0x80 addrconf_add_dev+0x1e/0xa0 addrconf_dev_config+0x71/0x130 addrconf_notify+0x1f5/0xb40 ? rtnl_is_locked+0x11/0x20 ? __switch_to_asm+0x42/0x70 ? finish_task_switch+0xaf/0x2c0 ? raw_notifier_call_chain+0x3e/0x50 raw_notifier_call_chain+0x3e/0x50 netdev_state_change+0x67/0x90 linkwatch_do_dev+0x3c/0x50 __linkwatch_run_queue+0xd2/0x220 linkwatch_event+0x21/0x30 process_one_work+0x1c8/0x370 worker_thread+0x30/0x380 ? process_one_work+0x370/0x370 kthread+0x118/0x140 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x1f/0x30
Hence, add the ability to abort the command on surprise removal which prevents infinite loop and system lockup.
--- drivers/virtio/virtio_pci_common.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/virtio/virtio_pci_common.c +7 -0
@@ -576,6 +576,13 @@ static void virtio_pci_remove(struct pci_dev *pci_dev)struct virtio_pci_device *vp_dev =pci_get_drvdata (pci_dev);struct device *dev =get_device (&vp_dev->vdev.dev); +/* +* Device is marked broken on surprise removal so that virtio upper +* layers can abort any ongoing operation. +*/ +if (!pci_device_is_present (pci_dev)) +virtio_break_device (&vp_dev->vdev); +pci_disable_sriov (pci_dev);unregister_virtio_device (&vp_dev->vdev);
Signature · 6 lines
2.30.2 _______________________________________________ Virtualization mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Sasha Levin
maintainerPATCH 8/26 virtio_vdpa: reject invalid vq indices
In reply to Sasha LevinFrom: Vincent Whitchurch <[email protected]>
[ Upstream commit cb5d2c1f6cc0e5769099a7d44b9d08cf58cae206 ]
Do not call vDPA drivers' callbacks with vq indicies larger than what the drivers indicate that they support. vDPA drivers do not bounds check the indices.
--- drivers/virtio/virtio_vdpa.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/virtio/virtio_vdpa.c +3 -0
@@ -149,6 +149,9 @@ virtio_vdpa_setup_vq(struct virtio_device *vdev, unsigned int index,if (!name)return NULL ; +if (index >= vdpa->nvqs) +return ERR_PTR (-ENOENT ); +/* Queue shouldn't already be set up. */ if (ops->get_vq_ready (vdpa, index))return ERR_PTR (-ENOENT );
Signature · 6 lines
2.30.2 _______________________________________________ Virtualization mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Sasha Levin
maintainerPATCH 9/26 vringh: Use wiov->used to check for read/write desc order
In reply to Sasha LevinFrom: Neeraj Upadhyay <[email protected]>
[ Upstream commit e74cfa91f42c50f7f649b0eca46aa049754ccdbd ]
As __vringh_iov() traverses a descriptor chain, it populates each descriptor entry into either read or write vring iov and increments that iov's ->used member. So, as we iterate over a descriptor chain, at any point, (riov/wriov)->used value gives the number of descriptor enteries available, which are to be read or written by the device. As all read iovs must precede the write iovs, wiov->used should be zero when we are traversing a read descriptor. Current code checks for wiov->i, to figure out whether any previous entry in the current descriptor chain was a write descriptor. However, iov->i is only incremented, when these vring iovs are consumed, at a later point, and remain 0 in __vringh_iov(). So, correct the check for read and write descriptor order, to use wiov->used.
--- drivers/vhost/vringh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vhost/vringh.c +1 -1
@@ -359,7 +359,7 @@ __vringh_iov(struct vringh *vrh, u16 i, iov = wiov; else { iov = riov; -if (unlikely (wiov && wiov->i)) { +if (unlikely (wiov && wiov->used)) {vringh_bad ("Readable desc %p after writable" , &descs[i]); err = -EINVAL ;
Signature · 6 lines
2.30.2 _______________________________________________ Virtualization mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Sasha Levin
maintainerPATCH 10/26 tools/virtio: fix build
In reply to Sasha LevinFrom: "Michael S. Tsirkin" <[email protected]>
[ Upstream commit a24ce06c70fe7df795a846ad713ccaa9b56a7666 ]
We use a spinlock now so add a stub.
Ignore bogus uninitialized variable warnings.
--- tools/virtio/Makefile | 3 +- tools/virtio/linux/spinlock.h | 56 +++++++++++++++++++++++++++++++++++ tools/virtio/linux/virtio.h | 2 ++ 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 tools/virtio/linux/spinlock.h
tools/virtio/Makefile +2 -1
@@ -4,7 +4,8 @@ test: virtio_test vringh_test virtio_test: virtio_ring.o virtio_test.o vringh_test: vringh_test.o vringh.o virtio_ring.o -CFLAGS += -g -O2 -Werror -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE -include ../../include/linux/kconfig.h +CFLAGS += -g -O2 -Werror -Wno-maybe-uninitialized -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE -include ../../include/linux/kconfig.h +LDFLAGS += -lpthread vpath %.c ../../drivers/virtio ../../drivers/vhost mod: ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test V=${V}
tools/virtio/linux/spinlock.h new file +56 -0
56 lines not on this page · raw message
tools/virtio/linux/virtio.h +2 -0
@@ -3,6 +3,7 @@#define LINUX_VIRTIO_H #include <linux/scatterlist.h> #include <linux/kernel.h> +#include <linux/spinlock.h> struct device {void *parent;
@@ -12,6 +13,7 @@ struct virtio_device {struct device dev;u64 features;struct list_head vqs; +spinlock_t vqs_list_lock; };struct virtqueue {
Signature · 6 lines
2.30.2 _______________________________________________ Virtualization mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Sasha Levin
maintainerPATCH 11/26 platform/x86: asus-nb-wmi: Allow configuring SW_TABLET_MODE method with a module option
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit 7f45621c14a209b986cd636447bb53b7f6f881c3 ]
Unfortunately we have been unable to find a reliable way to detect if and how SW_TABLET_MODE reporting is supported, so we are relying on DMI quirks for this.
Add a module-option to specify the SW_TABLET_MODE method so that this can be easily tested without needing to rebuild the kernel.
--- drivers/platform/x86/asus-nb-wmi.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/platform/x86/asus-nb-wmi.c +19 -0
@@ -41,6 +41,10 @@ static int wapf = -1;module_param (wapf, uint,0444 );MODULE_PARM_DESC (wapf,"WAPF value" ); +static int tablet_mode_sw =-1 ; +module_param (tablet_mode_sw, uint,0444 ); +MODULE_PARM_DESC (tablet_mode_sw,"Tablet mode detect: -1:auto 0:disable 1:kbd-dock 2:lid-flip" ); +static struct quirk_entry *quirks; static bool asus_q500a_i8042_filter(unsigned char data, unsigned char str,
@@ -477,6 +481,21 @@ static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)else wapf = quirks->wapf; +switch (tablet_mode_sw) { +case 0 : + quirks->use_kbd_dock_devid = false; + quirks->use_lid_flip_devid = false; +break ; +case 1 : + quirks->use_kbd_dock_devid = true; + quirks->use_lid_flip_devid = false; +break ; +case 2 : + quirks->use_kbd_dock_devid = false; + quirks->use_lid_flip_devid = true; +break ; + } +if (quirks->i8042_filter) { ret =i8042_install_filter (quirks->i8042_filter);if (ret) {
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 12/26 platform/x86: asus-nb-wmi: Add tablet_mode_sw=lid-flip quirk for the TP200s
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit 73fcbad691110ece47a487c9e584822070e3626f ]
The Asus TP200s / E205SA 360 degree hinges 2-in-1 supports reporting SW_TABLET_MODE info through the ASUS_WMI_DEVID_LID_FLIP WMI device-id. Add a quirk to enable this.
--- drivers/platform/x86/asus-nb-wmi.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/platform/x86/asus-nb-wmi.c +9 -0
@@ -462,6 +462,15 @@ static const struct dmi_system_id asus_quirks[] = { }, .driver_data = &quirk_asus_use_lid_flip_devid, }, + { + .callback = dmi_matched, + .ident = "ASUS TP200s / E205SA", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "E205SA"), + }, + .driver_data = &quirk_asus_use_lid_flip_devid, + }, {}, };
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 13/26 qed: qed ll2 race condition fixes
In reply to Sasha LevinFrom: Shai Malin <[email protected]>
[ Upstream commit 37110237f31105d679fc0aa7b11cdec867750ea7 ]
Avoiding qed ll2 race condition and NULL pointer dereference as part of the remove and recovery flows.
Changes form V1:
- Change (!p_rx->set_prod_addr).
- qed_ll2.c checkpatch fixes.
Change from V2:
- Revert "qed_ll2.c checkpatch fixes".
--- drivers/net/ethernet/qlogic/qed/qed_ll2.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/net/ethernet/qlogic/qed/qed_ll2.c +20 -0
@@ -327,6 +327,9 @@ static int qed_ll2_txq_completion(struct qed_hwfn *p_hwfn, void *p_cookie)unsigned long flags;int rc = -EINVAL ; +if (!p_ll2_conn) +return rc; +spin_lock_irqsave (&p_tx->lock, flags);if (p_tx->b_completing_packet) { rc = -EBUSY ;
@@ -500,7 +503,16 @@ static int qed_ll2_rxq_completion(struct qed_hwfn *p_hwfn, void *cookie)unsigned long flags =0 ;int rc =0 ; +if (!p_ll2_conn) +return rc; +spin_lock_irqsave (&p_rx->lock, flags); + +if (!QED_LL2_RX_REGISTERED (p_ll2_conn)) { +spin_unlock_irqrestore (&p_rx->lock, flags); +return 0 ; + } + cq_new_idx =le16_to_cpu (*p_rx->p_fw_cons); cq_old_idx =qed_chain_get_cons_idx (&p_rx->rcq_chain);
@@ -821,6 +833,9 @@ static int qed_ll2_lb_rxq_completion(struct qed_hwfn *p_hwfn, void *p_cookie)struct qed_ll2_info *p_ll2_conn = (struct qed_ll2_info *)p_cookie;int rc; +if (!p_ll2_conn) +return 0 ; +if (!QED_LL2_RX_REGISTERED (p_ll2_conn))return 0 ;
@@ -844,6 +859,9 @@ static int qed_ll2_lb_txq_completion(struct qed_hwfn *p_hwfn, void *p_cookie)u16 new_idx =0 , num_bds =0 ;int rc; +if (!p_ll2_conn) +return 0 ; +if (!QED_LL2_TX_REGISTERED (p_ll2_conn))return 0 ;
@@ -1725,6 +1743,8 @@ int qed_ll2_post_rx_buffer(void *cxt,if (!p_ll2_conn)return -EINVAL ; p_rx = &p_ll2_conn->rx_queue; +if (!p_rx->set_prod_addr) +return -EIO ;spin_lock_irqsave (&p_rx->lock, flags);if (!list_empty (&p_rx->free_descq))
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 14/26 qed: Fix null-pointer dereference in qed_rdma_create_qp()
In reply to Sasha LevinFrom: Shai Malin <[email protected]>
[ Upstream commit d33d19d313d3466abdf8b0428be7837aff767802 ]
Fix a possible null-pointer dereference in qed_rdma_create_qp().
Changes from V2:
- Revert checkpatch fixes.
--- drivers/net/ethernet/qlogic/qed/qed_rdma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/qlogic/qed/qed_rdma.c +1 -2
@@ -1285,8 +1285,7 @@ qed_rdma_create_qp(void *rdma_cxt,if (!rdma_cxt || !in_params || !out_params || !p_hwfn->p_rdma_info->active) { -DP_ERR (p_hwfn->cdev, -"qed roce create qp failed due to NULL entry (rdma_cxt=%p, in=%p, out=%p, roce_info=?\n" , +pr_err ("qed roce create qp failed due to NULL entry (rdma_cxt=%p, in=%p, out=%p, roce_info=?\n" , rdma_cxt, in_params, out_params);return NULL ; }
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 15/26 Revert "drm/amd/pm: fix workload mismatch on vega10"
In reply to Sasha LevinFrom: Kenneth Feng <[email protected]>
[ Upstream commit 2fd31689f9e44af949f60ff4f8aca013e628ab81 ]
This reverts commit 0979d43259e13846d86ba17e451e17fec185d240. Revert this because it does not apply to all the cards.
--- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +1 -1
@@ -5160,7 +5160,7 @@ static int vega10_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, ui out:smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_SetWorkloadMask, - (!power_profile_mode) ?0 :1 << (power_profile_mode -1 ), +1 << power_profile_mode,NULL ); hwmgr->power_profile_mode = power_profile_mode;
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 16/26 drm/amd/pm: change the workload type for some cards
In reply to Sasha LevinFrom: Kenneth Feng <[email protected]>
[ Upstream commit 93c5701b00d50d192ce2247cb10d6c0b3fe25cd8 ]
change the workload type for some cards as it is needed.
--- .../gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +14 -1
@@ -5123,6 +5123,13 @@ static int vega10_get_power_profile_mode(struct pp_hwmgr *hwmgr, char *buf)return size; } +static bool vega10_get_power_profile_mode_quirks (struct pp_hwmgr *hwmgr) +{ +struct amdgpu_device *adev = hwmgr->adev; + +return (adev->pdev->device ==0x6860 ); +} +static int vega10_set_power_profile_mode (struct pp_hwmgr *hwmgr,long *input,uint32_t size) {struct vega10_hwmgr *data = hwmgr->backend;
@@ -5159,9 +5166,15 @@ static int vega10_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, ui } out: -smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_SetWorkloadMask, +if (vega10_get_power_profile_mode_quirks (hwmgr)) +smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_SetWorkloadMask,1 << power_profile_mode,NULL ); +else +smum_send_msg_to_smc_with_parameter (hwmgr, PPSMC_MSG_SetWorkloadMask, + (!power_profile_mode) ?0 :1 << (power_profile_mode -1 ), +NULL ); + hwmgr->power_profile_mode = power_profile_mode;return 0 ;
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 17/26 blk-mq: don't grab rq's refcount in blk_mq_check_expired()
In reply to Sasha LevinFrom: Ming Lei <[email protected]>
[ Upstream commit c797b40ccc340b8a66f7a7842aecc90bf749f087 ]
Inside blk_mq_queue_tag_busy_iter() we already grabbed request's refcount before calling ->fn(), so needn't to grab it one more time in blk_mq_check_expired().
Meantime remove extra request expire check in blk_mq_check_expired().
--- block/blk-mq.c | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-)
block/blk-mq.c +5 -25
@@ -923,34 +923,14 @@ static bool blk_mq_check_expired(struct blk_mq_hw_ctx *hctx,unsigned long *next = priv;/* -* Just do a quick check if it is expired before locking the request in -* so we're not unnecessarilly synchronizing across CPUs. -*/ -if (!blk_mq_req_expired (rq, next)) -return true; - -/* -* We have reason to believe the request may be expired. Take a -* reference on the request to lock this request lifetime into its -* currently allocated context to prevent it from being reallocated in -* the event the completion by-passes this timeout handler. -* -* If the reference was already released, then the driver beat the -* timeout handler to posting a natural completion. -*/ -if (!refcount_inc_not_zero (&rq->ref)) -return true; - -/* -* The request is now locked and cannot be reallocated underneath the -* timeout handler's processing. Re-verify this exact request is truly -* expired; if it is not expired, then the request was completed and -* reallocated as a new request. +* blk_mq_queue_tag_busy_iter() has locked the request, so it cannot +* be reallocated underneath the timeout handler's processing, then +* the expire check is reliable. If the request is not expired, then +* it was completed and reallocated as a new request after returning +* from blk_mq_check_expired(). */ if (blk_mq_req_expired (rq, next))blk_mq_rq_timed_out (rq, reserved); - -blk_mq_put_rq_ref (rq);return true; }
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 18/26 drm: Copy drm_wait_vblank to user before returning
In reply to Sasha LevinFrom: Mark Yacoub <[email protected]>
[ Upstream commit fa0b1ef5f7a694f48e00804a391245f3471aa155 ]
[Why]
Userspace should get back a copy of drm_wait_vblank that's been modified even when drm_wait_vblank_ioctl returns a failure.
Rationale:drm_wait_vblank_ioctl modifies the request and expects the user to read it back. When the type is RELATIVE, it modifies it to ABSOLUTE and updates the sequence to become current_vblank_count + sequence (which was RELATIVE), but now it became ABSOLUTE.
drmWaitVBlank (in libdrm) expects this to be the case as it modifies the request to be Absolute so it expects the sequence to would have been updated.
The change is in compat_drm_wait_vblank, which is called by drm_compat_ioctl. This change of copying the data back regardless of the return number makes it en par with drm_ioctl, which always copies the data before returning.
[How]
Return from the function after everything has been copied to user.
Fixes IGT:kms_flip::modeset-vs-vblank-race-interruptible Tested on ChromeOS Trogdor(msm)
--- drivers/gpu/drm/drm_ioc32.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/drm_ioc32.c +1 -3
@@ -856,8 +856,6 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd, req.request.sequence = req32.request.sequence; req.request.signal = req32.request.signal; err =drm_ioctl_kernel (file, drm_wait_vblank_ioctl, &req,DRM_UNLOCKED ); -if (err) -return err; req32.reply.type = req.reply.type; req32.reply.sequence = req.reply.sequence;
@@ -866,7 +864,7 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd,if (copy_to_user (argp, &req32,sizeof (req32)))return -EFAULT ; -return 0 ; +return err; }#if defined(CONFIG_X86 )
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 19/26 platform/x86: gigabyte-wmi: add support for X570 GAMING X
In reply to Sasha LevinFrom: Thomas Weißschuh <[email protected]>
[ Upstream commit b9570f5c9240cadf87fb5f9313e8f425aa9e788f ]
Reported as working here:
https://github.com/t-8ch/linux-gigabyte-wmi-driver/issues/1#issuecomment-900263115
--- drivers/platform/x86/gigabyte-wmi.c | 1 + 1 file changed, 1 insertion(+)
drivers/platform/x86/gigabyte-wmi.c +1 -0
@@ -147,6 +147,7 @@ static const struct dmi_system_id gigabyte_wmi_known_working_platforms[] = {DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME ("B550M DS3H" ),DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME ("Z390 I AORUS PRO WIFI-CF" ),DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME ("X570 AORUS ELITE" ), +DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME ("X570 GAMING X" ),DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME ("X570 I AORUS PRO WIFI" ), DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("X570 UD"), { }
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 20/26 drm/nouveau: recognise GA107
In reply to Sasha LevinFrom: Ben Skeggs <[email protected]>
[ Upstream commit fa25f28ef2cef19bc9ffeb827b8ecbf48af7f892 ]
Still no GA106 as I don't have HW to verif.
--- .../gpu/drm/nouveau/nvkm/engine/device/base.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +21 -0
@@ -2624,6 +2624,26 @@ nv174_chipset = { .dma = { 0x00000001, gv100_dma_new }, }; +static const struct nvkm_device_chip +nv177_chipset = { + .name ="GA107" , + .bar = {0x00000001 , tu102_bar_new }, + .bios = {0x00000001 , nvkm_bios_new }, + .devinit = {0x00000001 , ga100_devinit_new }, + .fb = {0x00000001 , ga102_fb_new }, + .gpio = {0x00000001 , ga102_gpio_new }, + .i2c = {0x00000001 , gm200_i2c_new }, + .imem = {0x00000001 , nv50_instmem_new }, + .mc = {0x00000001 , ga100_mc_new }, + .mmu = {0x00000001 , tu102_mmu_new }, + .pci = {0x00000001 , gp100_pci_new }, + .privring = {0x00000001 , gm200_privring_new }, + .timer = {0x00000001 , gk20a_timer_new }, + .top = {0x00000001 , ga100_top_new }, + .disp = {0x00000001 , ga102_disp_new }, + .dma = {0x00000001 , gv100_dma_new }, +}; +static int nvkm_device_event_ctor (struct nvkm_object *object,void *data,u32 size,struct nvkm_notify *notify)
@@ -3049,6 +3069,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,case 0x168 : device->chip = &nv168_chipset;break ;case 0x172 : device->chip = &nv172_chipset;break ;case 0x174 : device->chip = &nv174_chipset;break ; +case 0x177 : device->chip = &nv177_chipset;break ;default :if (nvkm_boolopt (device->cfgopt,"NvEnableUnsupportedChipsets" , false)) {switch (device->chipset) {
Signature · 1 line
2.30.2
Re: [PATCH AUTOSEL 5.13 20/26] drm/nouveau: recognise GA107
This is more hardware enablement, I'm not sure this should be going into stable either. Ben?
Quoted 54 lines · Sasha Levin
From: Ben Skeggs <[email protected]>
[ Upstream commit
fa25f28ef2cef19bc9ffeb827b8ecbf48af7f892]Still no GA106 as I don't have HW to verif.
Signed-off-by Ben Skeggs <[email protected]>Reviewed-by Lyude Paul <[email protected]>Signed-off-by Sasha Levin <[email protected]>---
.../gpu/drm/nouveau/nvkm/engine/device/base.c | 21 +++++++++++++++++++1 file changed, 21 insertions(+)drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +0
-0@@ -2624,6 +2624,26 @@ nv174_chipset = { .dma = { 0x00000001, gv100_dma_new }, };drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +20
-0+static const struct nvkm_device_chip +nv177_chipset = { + .name = "GA107", + .bar = { 0x00000001, tu102_bar_new }, + .bios = { 0x00000001, nvkm_bios_new }, + .devinit = { 0x00000001, ga100_devinit_new }, + .fb = { 0x00000001, ga102_fb_new }, + .gpio = { 0x00000001, ga102_gpio_new }, + .i2c = { 0x00000001, gm200_i2c_new }, + .imem = { 0x00000001, nv50_instmem_new }, + .mc = { 0x00000001, ga100_mc_new }, + .mmu = { 0x00000001, tu102_mmu_new }, + .pci = { 0x00000001, gp100_pci_new }, + .privring = { 0x00000001, gm200_privring_new }, + .timer = { 0x00000001, gk20a_timer_new }, + .top = { 0x00000001, ga100_top_new }, + .disp = { 0x00000001, ga102_disp_new }, + .dma = { 0x00000001, gv100_dma_new }, +}; +static int
nvkm_device_event_ctor(structnvkm_object*object, void *data, u32 size, structnvkm_notify*notify)drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +1
-0@@ -3049,6 +3069,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func, case 0x168: device->chip = &nv168_chipset; break; case 0x172: device->chip = &nv172_chipset; break; case 0x174: device->chip = &nv174_chipset; break; + case 0x177: device->chip = &nv177_chipset; break;default:
if (nvkm_boolopt(device->cfgopt, "NvEnableUnsupportedChipsets", false)) {
switch (device->chipset) {
Signature · 3 lines
Cheers, Lyude Paul (she/her) Software Engineer at Red Hat
Sasha Levin
maintainerRe: [PATCH AUTOSEL 5.13 20/26] drm/nouveau: recognise GA107
Quoted 2 lines · Lyude Paul
This is more hardware enablement, I'm not sure this should be going into stable either. Ben?
We take this sort of hardware enablement patches (where the platform code is already there, and we just add quirks/ids/etc.
Signature · 2 lines
Thanks, Sasha
Re: [PATCH AUTOSEL 5.13 20/26] drm/nouveau: recognise GA107
ahhh-ok, that makes these patchs make a bit more sense then. If Ben doesn't have any objections I'd say these are fine to backport then
Quoted 7 lines · Sasha Levin
Quoted 2 lines · Lyude Paul
This is more hardware enablement, I'm not sure this should be going into stable either. Ben?
We take this sort of hardware enablement patches (where the platform code is already there, and we just add quirks/ids/etc.
Signature · 3 lines
Cheers, Lyude Paul (she/her) Software Engineer at Red Hat
Re: [PATCH AUTOSEL 5.13 20/26] drm/nouveau: recognise GA107
oops-except for "drm/nouveau: block a bunch of classes from userspace" of course. the rest are fine though
Quoted 12 lines · Lyude Paul
ahhh-ok, that makes these patchs make a bit more sense then. If Ben doesn't have any objections I'd say these are fine to backport then
Quoted 7 lines · Sasha Levin
Quoted 2 lines · Lyude Paul
This is more hardware enablement, I'm not sure this should be going into stable either. Ben?
We take this sort of hardware enablement patches (where the platform code is already there, and we just add quirks/ids/etc.
Signature · 3 lines
Cheers, Lyude Paul (she/her) Software Engineer at Red Hat
Sasha Levin
maintainerRe: [PATCH AUTOSEL 5.13 20/26] drm/nouveau: recognise GA107
Quoted 2 lines · Lyude Paul
oops-except for "drm/nouveau: block a bunch of classes from userspace" of course. the rest are fine though
Yup, that one is gone :)
Signature · 2 lines
Thanks, Sasha
Sasha Levin
maintainerPATCH 21/26 drm/nouveau/disp: power down unused DP links during init
In reply to Sasha LevinFrom: Ben Skeggs <[email protected]>
[ Upstream commit 6eaa1f3c59a707332e921e32782ffcad49915c5e ]
When booted with multiple displays attached, the EFI GOP driver on (at least) Ampere, can leave DP links powered up that aren't being used to display anything. This confuses our tracking of SOR routing, with the likely result being a failed modeset and display engine hang.
Fix this by (ab?)using the DisableLT IED script to power-down the link, restoring HW to a state the driver expects.
--- drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h | 1 + drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c +1 -1
@@ -440,7 +440,7 @@ nvkm_dp_train(struct nvkm_dp *dp, u32 dataKBps)return ret; } -static void +void nvkm_dp_disable (struct nvkm_outp *outp,struct nvkm_ior *ior) {struct nvkm_dp *dp =nvkm_dp (outp);
drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h +1 -0
@@ -32,6 +32,7 @@ struct nvkm_dp {int nvkm_dp_new (struct nvkm_disp *,int index,struct dcb_output *,struct nvkm_outp **); +void nvkm_dp_disable (struct nvkm_outp *,struct nvkm_ior *);/* DPCD Receiver Capabilities */ #define DPCD_RC00_DPCD_REV 0x00000
drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c +9 -0
@@ -22,6 +22,7 @@* Authors: Ben Skeggs */ #include "outp.h" +#include "dp.h" #include "ior.h" #include <subdev/bios.h>
@@ -257,6 +258,14 @@ nvkm_outp_init_route(struct nvkm_outp *outp)if (!ior->arm.head || ior->arm.proto != proto) {OUTP_DBG (outp,"no heads (%x %d %d)" , ior->arm.head, ior->arm.proto, proto); + +/* The EFI GOP driver on Ampere can leave unused DP links routed, +* which we don't expect. The DisableLT IED script *should* get +* us back to where we need to be. +*/ +if (ior->func->route.get && !ior->arm.head && outp->info.type ==DCB_OUTPUT_DP ) +nvkm_dp_disable (outp, ior); +return ; }
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 22/26 drm/nouveau/kms/nv50: workaround EFI GOP window channel format differences
In reply to Sasha LevinFrom: Ben Skeggs <[email protected]>
[ Upstream commit e78b1b545c6cfe9f87fc577128e00026fff230ba ]
Should fix some initial modeset failures on (at least) Ampere boards.
--- drivers/gpu/drm/nouveau/dispnv50/disp.c | 27 +++++++++++++++++++++++++ drivers/gpu/drm/nouveau/dispnv50/head.c | 13 ++++++++---- drivers/gpu/drm/nouveau/dispnv50/head.h | 1 + 3 files changed, 37 insertions(+), 4 deletions(-)
drivers/gpu/drm/nouveau/dispnv50/disp.c +27 -0
@@ -2235,6 +2235,33 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state) interlock[NV50_DISP_INTERLOCK_CORE ] =0 ; } +/* Finish updating head(s)... +* +* NVD is rather picky about both where window assignments can change, +* *and* about certain core and window channel states matching. +* +* The EFI GOP driver on newer GPUs configures window channels with a +* different output format to what we do, and the core channel update +* in the assign_windows case above would result in a state mismatch. +* +* Delay some of the head update until after that point to workaround +* the issue. This only affects the initial modeset. +* +* TODO: handle this better when adding flexible window mapping +*/ +for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { +struct nv50_head_atom *asyh =nv50_head_atom (new_crtc_state); +struct nv50_head *head =nv50_head (crtc); + +NV_ATOMIC (drm,"%s: set %04x (clr %04x)\n" , crtc->name, + asyh->set.mask, asyh->clr.mask); + +if (asyh->set.mask) { +nv50_head_flush_set_wndw (head, asyh); + interlock[NV50_DISP_INTERLOCK_CORE ] =1 ; + } + } +/* Update plane(s). */ for_each_new_plane_in_state (state, plane, new_plane_state, i) {struct nv50_wndw_atom *asyw =nv50_wndw_atom (new_plane_state);
drivers/gpu/drm/nouveau/dispnv50/head.c +9 -4
@@ -50,11 +50,8 @@ nv50_head_flush_clr(struct nv50_head *head, }void -nv50_head_flush_set (struct nv50_head *head,struct nv50_head_atom *asyh) +nv50_head_flush_set_wndw (struct nv50_head *head,struct nv50_head_atom *asyh) { -if (asyh->set.view ) head->func->view (head, asyh); -if (asyh->set.mode ) head->func->mode (head, asyh); -if (asyh->set.core ) head->func->core_set (head, asyh);if (asyh->set.olut ) { asyh->olut.offset = nv50_lut_load(&head->olut, asyh->olut.buffer,
@@ -62,6 +59,14 @@ nv50_head_flush_set(struct nv50_head *head, struct nv50_head_atom *asyh) asyh->olut.load); head->func->olut_set (head, asyh); } +} + +void +nv50_head_flush_set (struct nv50_head *head,struct nv50_head_atom *asyh) +{ +if (asyh->set.view ) head->func->view (head, asyh); +if (asyh->set.mode ) head->func->mode (head, asyh); +if (asyh->set.core ) head->func->core_set (head, asyh);if (asyh->set.curs ) head->func->curs_set (head, asyh);if (asyh->set.base ) head->func->base (head, asyh);if (asyh->set.ovly ) head->func->ovly (head, asyh);
drivers/gpu/drm/nouveau/dispnv50/head.h +1 -0
@@ -21,6 +21,7 @@ struct nv50_head {struct nv50_head *nv50_head_create (struct drm_device *,int index);void nv50_head_flush_set (struct nv50_head *head,struct nv50_head_atom *asyh); +void nv50_head_flush_set_wndw (struct nv50_head *head,struct nv50_head_atom *asyh);void nv50_head_flush_clr (struct nv50_head *head,struct nv50_head_atom *asyh,bool flush);
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 23/26 drm/nouveau: block a bunch of classes from userspace
In reply to Sasha LevinFrom: Ben Skeggs <[email protected]>
[ Upstream commit 148a8653789c01f159764ffcc3f370008966b42f ]
Long ago, there had been plans for making use of a bunch of these APIs from userspace and there's various checks in place to stop misbehaving.
Countless other projects have occurred in the meantime, and the pieces didn't finish falling into place for that to happen.
They will (hopefully) in the not-too-distant future, but it won't look quite as insane. The super checks are causing problems right now, and are going to be removed.
--- drivers/gpu/drm/nouveau/include/nvif/cl0080.h | 3 +- drivers/gpu/drm/nouveau/nouveau_drm.c | 1 + drivers/gpu/drm/nouveau/nouveau_usif.c | 57 ++++++++++++++----- .../gpu/drm/nouveau/nvkm/engine/device/user.c | 2 +- 4 files changed, 48 insertions(+), 15 deletions(-)
drivers/gpu/drm/nouveau/include/nvif/cl0080.h +2 -1
@@ -4,7 +4,8 @@struct nv_device_v0 {__u8 version; -__u8 pad01[7 ]; +__u8 priv; +__u8 pad02[6 ];__u64 device;/* device identifier, ~0 for client default */ };
drivers/gpu/drm/nouveau/nouveau_drm.c +1 -0
@@ -242,6 +242,7 @@ nouveau_cli_init(struct nouveau_drm *drm, const char *sname, ret =nvif_device_ctor (&cli->base.object,"drmDevice" ,0 ,NV_DEVICE , &(struct nv_device_v0 ) { .device = ~0 , + .priv = true, },sizeof (struct nv_device_v0 ), &cli->device);if (ret) {
drivers/gpu/drm/nouveau/nouveau_usif.c +44 -13
97 lines not on this page · raw message
drivers/gpu/drm/nouveau/nvkm/engine/device/user.c +1 -1
@@ -397,7 +397,7 @@ nvkm_udevice_new(const struct nvkm_oclass *oclass, void *data, u32 size,return ret;/* give priviledged clients register access */ -if (client->super) +if (args->v0.priv) func = &nvkm_udevice_super;else func = &nvkm_udevice;
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 24/26 platform/x86: gigabyte-wmi: add support for B450M S2H V2
In reply to Sasha LevinFrom: Thomas Weißschuh <[email protected]>
[ Upstream commit 1e35b8a7780a0c043cc5389420f069b69343f5d9 ]
Reported as working here:
https://github.com/t-8ch/linux-gigabyte-wmi-driver/issues/1#issuecomment-901207693
--- drivers/platform/x86/gigabyte-wmi.c | 1 + 1 file changed, 1 insertion(+)
drivers/platform/x86/gigabyte-wmi.c +1 -0
@@ -140,6 +140,7 @@ static u8 gigabyte_wmi_detect_sensor_usability(struct wmi_device *wdev) }}static const struct dmi_system_id gigabyte_wmi_known_working_platforms[] = { +DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME ("B450M S2H V2" ),DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME ("B550 AORUS ELITE" ),DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME ("B550 AORUS ELITE V2" ),DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME ("B550 GAMING X V2" ),
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 25/26 net/rds: dma_map_sg is entitled to merge entries
In reply to Sasha LevinFrom: Gerd Rausch <[email protected]>
[ Upstream commit fb4b1373dcab086d0619c29310f0466a0b2ceb8a ]
Function "dma_map_sg" is entitled to merge adjacent entries and return a value smaller than what was passed as "nents".
Subsequently "ib_map_mr_sg" needs to work with this value ("sg_dma_len") rather than the original "nents" parameter ("sg_len").
This old RDS bug was exposed and reliably causes kernel panics (using RDMA operations "rds-stress -D") on x86_64 starting with:
commit c588072bba6b ("iommu/vt-d: Convert intel iommu driver to the iommu ops")
Simply put: Linux 5.11 and later.
--- net/rds/ib_frmr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/rds/ib_frmr.c +2 -2
@@ -131,9 +131,9 @@ static int rds_ib_post_reg_frmr(struct rds_ib_mr *ibmr)cpu_relax (); } - ret =ib_map_mr_sg_zbva (frmr->mr, ibmr->sg, ibmr->sg_len, + ret =ib_map_mr_sg_zbva (frmr->mr, ibmr->sg, ibmr->sg_dma_len, &off,PAGE_SIZE ); -if (unlikely (ret != ibmr->sg_len)) +if (unlikely (ret != ibmr->sg_dma_len))return ret <0 ? ret : -EINVAL ; if (cmpxchg(&frmr->fr_state,
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 26/26 arm64: initialize all of CNTHCTL_EL2
In reply to Sasha LevinFrom: Mark Rutland <[email protected]>
[ Upstream commit bde8fff82e4a4b0f000dbf4d5eadab2079be0b56 ]
In __init_el2_timers we initialize CNTHCTL_EL2.{EL1PCEN,EL1PCTEN} with a RMW sequence, leaving all other bits UNKNOWN.
In general, we should initialize all bits in a register rather than using an RMW sequence, since most bits are UNKNOWN out of reset, and as new bits are added to the reigster their reset value might not result in expected behaviour.
In the case of CNTHCTL_EL2, FEAT_ECV added a number of new control bits in previously RES0 bits, which reset to UNKNOWN values, and may cause issues for EL1 and EL0:
* CNTHCTL_EL2.ECV enables the CNTPOFF_EL2 offset (which itself resets to an UNKNOWN value) at EL0 and EL1. Since the offset could reset to distinct values across CPUs, when the control bit resets to 1 this could break timekeeping generally.
* CNTHCTL_EL2.{EL1TVT,EL1TVCT} trap EL0 and EL1 accesses to the EL1 virtual timer/counter registers to EL2. When reset to 1, this could cause unexpected traps to EL2.
Initializing these bits to zero avoids these problems, and all other bits in CNTHCTL_EL2 other than EL1PCEN and EL1PCTEN can safely be reset to zero.
This patch ensures we initialize CNTHCTL_EL2 accordingly, only setting EL1PCEN and EL1PCTEN, and setting all other bits to zero.
--- arch/arm64/include/asm/el2_setup.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm64/include/asm/el2_setup.h +1 -2
@@ -33,8 +33,7 @@* EL2. */ .macro __init_el2_timers -mrs x0, cnthctl_el2 - orr x0, x0, #3 // Enable EL1 physical timers + mov x0, #3 // Enable EL1 physical timersmsr cnthctl_el2, x0 msr cntvoff_el2, xzr // Clear virtual offset .endm
Signature · 1 line
2.30.2