Linux 6.6.91
Greg Kroah-Hartman
maintainerI'm announcing the release of the 6.6.91 kernel.
All users of the 6.6 kernel series must upgrade.
The updated 6.6.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.6.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/ABI/testing/sysfs-devices-system-cpu | 1 Documentation/admin-guide/hw-vuln/index.rst | 1 Documentation/admin-guide/hw-vuln/indirect-target-selection.rst | 168 +++++++ Documentation/admin-guide/kernel-parameters.txt | 18 Makefile | 2 arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi | 25 - arch/arm64/include/asm/cputype.h | 2 arch/arm64/include/asm/insn.h | 1 arch/arm64/include/asm/spectre.h | 3 arch/arm64/kernel/proton-pack.c | 13 arch/arm64/lib/insn.c | 60 +- arch/arm64/net/bpf_jit_comp.c | 57 ++ arch/mips/include/asm/ptrace.h | 3 arch/x86/Kconfig | 11 arch/x86/entry/entry_64.S | 20 arch/x86/include/asm/alternative.h | 32 + arch/x86/include/asm/cpufeatures.h | 3 arch/x86/include/asm/microcode.h | 2 arch/x86/include/asm/msr-index.h | 8 arch/x86/include/asm/nospec-branch.h | 44 +- arch/x86/kernel/alternative.c | 215 +++++++++- arch/x86/kernel/cpu/bugs.c | 178 ++++++++ arch/x86/kernel/cpu/common.c | 72 ++- arch/x86/kernel/cpu/microcode/amd.c | 6 arch/x86/kernel/cpu/microcode/core.c | 58 +- arch/x86/kernel/cpu/microcode/intel.c | 2 arch/x86/kernel/cpu/microcode/internal.h | 1 arch/x86/kernel/ftrace.c | 2 arch/x86/kernel/head32.c | 4 arch/x86/kernel/module.c | 7 arch/x86/kernel/static_call.c | 4 arch/x86/kernel/vmlinux.lds.S | 10 arch/x86/kvm/x86.c | 4 arch/x86/lib/retpoline.S | 39 + arch/x86/mm/tlb.c | 23 - arch/x86/net/bpf_jit_comp.c | 61 ++ drivers/base/cpu.c | 3 drivers/clocksource/i8253.c | 4 drivers/gpu/drm/amd/amdgpu/hdp_v4_0.c | 7 drivers/gpu/drm/amd/amdgpu/hdp_v5_0.c | 7 drivers/gpu/drm/amd/amdgpu/hdp_v5_2.c | 12 drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c | 7 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 36 - drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 28 + drivers/gpu/drm/panel/panel-simple.c | 25 - drivers/gpu/drm/v3d/v3d_sched.c | 28 - drivers/iio/accel/adis16201.c | 4 drivers/iio/accel/adxl355_core.c | 2 drivers/iio/accel/adxl367.c | 10 drivers/iio/adc/ad7606_spi.c | 2 drivers/iio/adc/dln2-adc.c | 2 drivers/iio/adc/rockchip_saradc.c | 17 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 6 drivers/iio/temperature/maxim_thermocouple.c | 2 drivers/input/joystick/xpad.c | 40 + drivers/input/keyboard/mtk-pmic-keys.c | 4 drivers/input/mouse/synaptics.c | 5 drivers/input/touchscreen/cyttsp5.c | 7 drivers/md/dm-table.c | 3 drivers/net/can/m_can/m_can.c | 2 drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 42 + drivers/net/dsa/b53/b53_common.c | 36 + drivers/net/ethernet/mediatek/mtk_eth_soc.c | 16 drivers/nvme/host/core.c | 3 drivers/staging/axis-fifo/axis-fifo.c | 14 drivers/staging/iio/adc/ad7816.c | 2 drivers/usb/cdns3/cdnsp-gadget.c | 31 + drivers/usb/cdns3/cdnsp-gadget.h | 6 drivers/usb/cdns3/cdnsp-pci.c | 12 drivers/usb/cdns3/cdnsp-ring.c | 3 drivers/usb/cdns3/core.h | 3 drivers/usb/class/usbtmc.c | 59 +- drivers/usb/gadget/composite.c | 12 drivers/usb/gadget/function/f_ecm.c | 7 drivers/usb/gadget/udc/tegra-xudc.c | 4 drivers/usb/host/uhci-platform.c | 2 drivers/usb/host/xhci-tegra.c | 3 drivers/usb/typec/tcpm/tcpm.c | 2 drivers/usb/typec/ucsi/displayport.c | 2 drivers/xen/swiotlb-xen.c | 1 drivers/xen/xenbus/xenbus.h | 2 drivers/xen/xenbus/xenbus_comms.c | 9 drivers/xen/xenbus/xenbus_dev_frontend.c | 2 drivers/xen/xenbus/xenbus_xs.c | 18 fs/namespace.c | 3 fs/ocfs2/journal.c | 80 ++- fs/ocfs2/journal.h | 1 fs/ocfs2/ocfs2.h | 17 fs/ocfs2/quota_local.c | 9 fs/ocfs2/super.c | 3 fs/smb/client/cached_dir.c | 10 fs/smb/server/oplock.c | 7 fs/smb/server/smb2pdu.c | 5 fs/smb/server/vfs.c | 7 fs/smb/server/vfs_cache.c | 33 + include/linux/cpu.h | 2 include/linux/module.h | 5 include/linux/netdevice.h | 13 include/linux/types.h | 3 include/uapi/linux/types.h | 1 io_uring/io_uring.c | 61 +- kernel/params.c | 4 net/can/gw.c | 149 ++++-- net/core/filter.c | 1 net/ipv6/addrconf.c | 15 net/netfilter/ipset/ip_set_hash_gen.h | 2 net/netfilter/ipvs/ip_vs_xmit.c | 27 - net/openvswitch/actions.c | 3 net/sched/sch_htb.c | 15 net/wireless/scan.c | 2 110 files changed, 1709 insertions(+), 483 deletions(-)
Aditya Garg (3):
Input: synaptics - enable InterTouch on Dynabook Portege X30L-G
Input: synaptics - enable InterTouch on Dell Precision M3800
Input: synaptics - enable InterTouch on TUXEDO InfinityBook Pro 14 v5
Al Viro (1):
do_umount(): add missing barrier before refcount checks in sync case
Alex Deucher (4):
drm/amdgpu/hdp4: use memcfg register to post the write for HDP flush drm/amdgpu/hdp5.2: use memcfg register to post the write for HDP flush drm/amdgpu/hdp5: use memcfg register to post the write for HDP flush drm/amdgpu/hdp6: use memcfg register to post the write for HDP flush
Alexander Lobakin (1):
netdevice: add netdev_tx_reset_subqueue() shorthand
Alexey Charkov (1):
usb: uhci-platform: Make the clock really optional
Andrei Kuchynski (1):
usb: typec: ucsi: displayport: Fix NULL pointer access
Andy Shevchenko (1):
types: Complement the aligned types with signed 64-bit one
Angelo Dureghello (1):
iio: adc: ad7606: fix serial register access
Aurabindo Pillai (1):
drm/amd/display: more liberal vmin/vmax update for freesync
Borislav Petkov (AMD) (1):
x86/microcode: Consolidate the loader enablement checking
Cong Wang (1):
sch_htb: make htb_deactivate() idempotent
Dan Carpenter (1):
dm: add missing unlock on in dm_keyslot_evict()
Daniel Golle (1):
net: ethernet: mtk_eth_soc: reset all TX queues on DMA free
Daniel Sneddon (2):
x86/bpf: Call branch history clearing sequence on exit x86/bpf: Add IBHF call at end of classic BPF
Daniel Wagner (1):
nvme: unblock ctrl state transition for firmware update
Dave Hansen (1):
x86/mm: Eliminate window where TLB flushes may be inadvertently skipped
Dave Penkler (3):
usb: usbtmc: Fix erroneous get_stb ioctl error returns
usb: usbtmc: Fix erroneous wait_srq ioctl return
usb: usbtmc: Fix erroneous generic_read ioctl return
Dmitry Antipov (1):
module: ensure that kobject_put() is safe for module type kobjects
Dmitry Torokhov (1):
Input: synaptics - enable SMBus for HP Elitebook 850 G1
Eelco Chaudron (1):
openvswitch: Fix unsafe attribute parsing in output_userspace()
Eric Biggers (1):
x86/its: Fix build errors when CONFIG_MODULES=n
Gabriel Shahrouzi (4):
staging: iio: adc: ad7816: Correct conditional logic for store mode
staging: axis-fifo: Remove hardware resets for user errors
staging: axis-fifo: Correct handling of tx_fifo_depth for size validation
iio: adis16201: Correct inclinometer channel resolution
Gary Bisson (1):
Input: mtk-pmic-keys - fix possible null pointer dereference
Greg Kroah-Hartman (1):
Linux 6.6.91
Guillaume Nault (1):
gre: Fix again IPv6 link-local address generation.
Hugo Villeneuve (1):
Input: cyttsp5 - ensure minimum reset pulse width
James Morse (6):
arm64: insn: Add support for encoding DSB
arm64: proton-pack: Expose whether the platform is mitigated by firmware
arm64: proton-pack: Expose whether the branchy loop k value
arm64: bpf: Add BHB mitigation to the epilogue for cBPF programs
arm64: bpf: Only mitigate cBPF programs loaded by unprivileged users
arm64: proton-pack: Add new CPUs 'k' values for branch mitigation
Jan Kara (3):
ocfs2: switch osb->disable_recovery to enum
ocfs2: implement handshaking with ocfs2 recovery thread
ocfs2: stop quota recovery before disabling quotas
Jason Andryuk (1):
xenbus: Use kref to track req lifetime
Jens Axboe (2):
io_uring: always arm linked timeouts prior to issue
io_uring: ensure deferred completions are posted for multishot
Jim Lin (1):
usb: host: tegra: Prevent host controller crash when OTG port is used
John Ernberg (1):
xen: swiotlb: Use swiotlb bouncing if kmalloc allocation demands it
Jonas Gorski (6):
net: dsa: b53: allow leaky reserved multicast
net: dsa: b53: fix clearing PVID of a port
net: dsa: b53: fix flushing old pvid VLAN on pvid change
net: dsa: b53: fix VLAN ID for untagged vlan on bridge leave
net: dsa: b53: always rejoin default untagged VLAN on bridge leave
net: dsa: b53: fix learning on VLAN unaware bridges
Jonathan Cameron (3):
iio: temp: maxim-thermocouple: Fix potential lack of DMA safe buffer.
iio: accel: adxl355: Make timestamp 64-bit aligned using aligned_s64
iio: adc: dln2: Use aligned_s64 for timestamp
Jozsef Kadlecsik (1):
netfilter: ipset: fix region locking in hash types
Julian Anastasov (1):
ipvs: fix uninit-value for saddr in do_output_route4
Kelsey Maes (1):
can: mcp251xfd: fix TDC setting for low data bit rates
Kevin Baker (1):
drm/panel: simple: Update timings for AUO G101EVN010
Lode Willems (1):
Input: xpad - add support for 8BitDo Ultimate 2 Wireless Controller
Lothar Rubusch (1):
iio: accel: adxl367: fix setting odr for activity time update
Manuel Fombuena (1):
Input: synaptics - enable InterTouch on Dynabook Portege X30-D
Marc Kleine-Budde (2):
can: mcan: m_can_class_unregister(): fix order of unregistration calls
can: mcp251xfd: mcp251xfd_remove(): fix order of unregistration calls
Maíra Canal (1):
drm/v3d: Add job to pending list if the reset was skipped
Mikael Gonella-Bolduc (1):
Input: cyttsp5 - fix power control issue on wakeup
Namjae Jeon (1):
ksmbd: prevent rename with empty string
Norbert Szetei (1):
ksmbd: prevent out-of-bounds stream writes by validating *pos
Oliver Hartkopp (1):
can: gw: fix RCU/BH usage in cgw_create_job()
Oliver Neukum (1):
USB: usbtmc: use interruptible sleep in usbtmc_read
Paul Aurich (1):
smb: client: Avoid race in open_cached_dir with lease breaks
Paul Chaignon (1):
bpf: Scrub packet on bpf_redirect_peer
Pawan Gupta (13):
x86/bhi: Do not set BHI_DIS_S in 32-bit mode x86/speculation: Simplify and make CALL_NOSPEC consistent x86/speculation: Add a conditional CS prefix to CALL_NOSPEC x86/speculation: Remove the extra #ifdef around CALL_NOSPEC
Documentation: x86/bugs/its: Add ITS documentation x86/its: Enumerate Indirect Target Selection (ITS) bug x86/its: Add support for ITS-safe indirect thunk x86/its: Add support for ITS-safe return thunk x86/its: Enable Indirect Target Selection mitigation x86/its: Add "vmexit" option to skip mitigation on some CPUs x86/its: Add support for RSB stuffing mitigation x86/its: Align RETs in BHB clear sequence to avoid thunking x86/ibt: Keep IBT disabled during alternative patching
Pawel Laszczak (2):
usb: cdnsp: Fix issue with resuming from L1
usb: cdnsp: fix L1 resume issue for RTL_REVISION_NEW_LPM version
Peter Zijlstra (2):
x86/its: Use dynamic thunks for indirect branches x86/its: FineIBT-paranoid vs ITS
Prashanth K (2):
usb: gadget: f_ecm: Add get_status callback
usb: gadget: Use get_status callback to set remote wakeup capability
RD Babiera (1):
usb: typec: tcpm: delay SNK_TRY_WAIT_DEBOUNCE to SRC_TRYWAIT transition
Sean Heelan (1):
ksmbd: Fix UAF in __close_file_table_ids
Sebastian Andrzej Siewior (1):
clocksource/i8253: Use raw_spinlock_irqsave() in clockevent_i8253_disable()
Silvano Seva (2):
iio: imu: st_lsm6dsx: fix possible lockup in st_lsm6dsx_read_fifo
iio: imu: st_lsm6dsx: fix possible lockup in st_lsm6dsx_read_tagged_fifo
Simon Xue (1):
iio: adc: rockchip: Fix clock initialization sequence
Thorsten Blum (1):
MIPS: Fix MAX_REG_OFFSET
Veerendranath Jakkam (1):
wifi: cfg80211: fix out-of-bounds access during multi-link element defragmentation
Vicki Pfau (2):
Input: xpad - fix Share button on Xbox One controllers
Input: xpad - fix two controller table values
Wang Zhaolong (1):
ksmbd: fix memory leak in parse_lease_state()
Wayne Chang (1):
usb: gadget: tegra-xudc: ACK ST_RC after clearing CTRL_RUN
Wayne Lin (5):
drm/amd/display: Shift DMUB AUX reply command if necessary drm/amd/display: Fix the checking condition in dmub aux handling drm/amd/display: Remove incorrect checking in dmub aux handler drm/amd/display: Fix wrong handling for AUX_DEFER case drm/amd/display: Copy AUX read reply data whenever length > 0
Wojciech Dubowik (1):
arm64: dts: imx8mm-verdin: Link reg_usdhc2_vqmmc to usdhc2
Greg Kroah-Hartman
maintainerDocumentation/ABI/testing/sysfs-devices-system-cpu +1 -0
@@ -514,6 +514,7 @@ Description: information about CPUs heterogeneity. What: /sys/devices/system/cpu/vulnerabilities /sys/devices/system/cpu/vulnerabilities/gather_data_sampling + /sys/devices/system/cpu/vulnerabilities/indirect_target_selection /sys/devices/system/cpu/vulnerabilities/itlb_multihit /sys/devices/system/cpu/vulnerabilities/l1tf /sys/devices/system/cpu/vulnerabilities/mds
Documentation/admin-guide/hw-vuln/index.rst +1 -0
@@ -22,3 +22,4 @@ are configurable at compile, boot or run time. srso gather_data_sampling reg-file-data-sampling + indirect-target-selection
Documentation/admin-guide/hw-vuln/indirect-target-selection.rst new file +168 -0
168 lines not on this page · raw message
Documentation/admin-guide/kernel-parameters.txt +18 -0
@@ -2060,6 +2060,23 @@ different crypto accelerators. This option can be used to achieve best performance for particular HW. + indirect_target_selection= [X86,Intel] Mitigation control for Indirect + Target Selection(ITS) bug in Intel CPUs. Updated + microcode is also required for a fix in IBPB. + + on: Enable mitigation (default). + off: Disable mitigation. + force: Force the ITS bug and deploy default + mitigation. + vmexit: Only deploy mitigation if CPU is affected by + guest/host isolation part of ITS. + stuff: Deploy RSB-fill mitigation when retpoline is + also deployed. Otherwise, deploy the default + mitigation. + + For details see: + Documentation/admin-guide/hw-vuln/indirect-target-selection.rst + init= [KNL] Format: <full_path> Run specified binary instead of /sbin/init as init
@@ -3331,6 +3348,7 @@ expose users to several CPU vulnerabilities. Equivalent to: if nokaslr then kpti=0 [ARM64] gather_data_sampling=off [X86] + indirect_target_selection=off [X86] kvm.nx_huge_pages=off [X86] l1tf=off [X86] mds=off [X86]
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 PATCHLEVEL = 6 -SUBLEVEL = 90 +SUBLEVEL = 91 EXTRAVERSION = NAME = Pinguïn Aangedreven
arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi +20 -5
@@ -148,6 +148,19 @@ reg_usdhc2_vmmc: regulator-usdhc2 { startup-delay-us = <20000>; }; + reg_usdhc2_vqmmc: regulator-usdhc2-vqmmc { + compatible = "regulator-gpio"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usdhc2_vsel>; + gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; + regulator-max-microvolt = <3300000>; + regulator-min-microvolt = <1800000>; + states = <1800000 0x1>, + <3300000 0x0>; + regulator-name = "PMIC_USDHC_VSELECT"; + vin-supply = <®_nvcc_sd>; + }; + reserved-memory { #address-cells = <2>; #size-cells = <2>;
@@ -266,7 +279,7 @@ &gpio1 { "SODIMM_19", "", "", - "", + "PMIC_USDHC_VSELECT", "", "", "",
@@ -787,6 +800,7 @@ &usdhc2 { pinctrl-2 = <&pinctrl_usdhc2_200mhz>, <&pinctrl_usdhc2_cd>; pinctrl-3 = <&pinctrl_usdhc2_sleep>, <&pinctrl_usdhc2_cd_sleep>; vmmc-supply = <®_usdhc2_vmmc>; + vqmmc-supply = <®_usdhc2_vqmmc>; }; &wdog1 {
@@ -1209,13 +1223,17 @@ pinctrl_usdhc2_pwr_en: usdhc2pwrengrp { <MX8MM_IOMUXC_NAND_CLE_GPIO3_IO5 0x6>; /* SODIMM 76 */ }; + pinctrl_usdhc2_vsel: usdhc2vselgrp { + fsl,pins = + <MX8MM_IOMUXC_GPIO1_IO04_GPIO1_IO4 0x10>; /* PMIC_USDHC_VSELECT */ + }; + /* * Note: Due to ERR050080 we use discrete external on-module resistors pulling-up to the * on-module +V3.3_1.8_SD (LDO5) rail and explicitly disable the internal pull-ups here. */ pinctrl_usdhc2: usdhc2grp { fsl,pins = - <MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x10>, <MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x90>, /* SODIMM 78 */ <MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x90>, /* SODIMM 74 */ <MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x90>, /* SODIMM 80 */
@@ -1226,7 +1244,6 @@ pinctrl_usdhc2: usdhc2grp { pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp { fsl,pins = - <MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x10>, <MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x94>, <MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x94>, <MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x94>,
@@ -1237,7 +1254,6 @@ pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp { pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp { fsl,pins = - <MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x10>, <MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x96>, <MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x96>, <MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x96>,
@@ -1249,7 +1265,6 @@ pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp { /* Avoid backfeeding with removed card power */ pinctrl_usdhc2_sleep: usdhc2slpgrp { fsl,pins = - <MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x0>, <MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x0>, <MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x0>, <MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x0>,
arch/arm64/include/asm/cputype.h +2 -0
@@ -81,6 +81,7 @@#define ARM_CPU_PART_CORTEX_A78AE 0xD42#define ARM_CPU_PART_CORTEX_X1 0xD44#define ARM_CPU_PART_CORTEX_A510 0xD46 +#define ARM_CPU_PART_CORTEX_X1C 0xD4C#define ARM_CPU_PART_CORTEX_A520 0xD80#define ARM_CPU_PART_CORTEX_A710 0xD47#define ARM_CPU_PART_CORTEX_A715 0xD4D
@@ -166,6 +167,7 @@#define MIDR_CORTEX_A78AE MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A78AE)#define MIDR_CORTEX_X1 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X1)#define MIDR_CORTEX_A510 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A510) +#define MIDR_CORTEX_X1C MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X1C)#define MIDR_CORTEX_A520 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A520)#define MIDR_CORTEX_A710 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A710)#define MIDR_CORTEX_A715 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A715)
arch/arm64/include/asm/insn.h +1 -0
@@ -687,6 +687,7 @@ u32 aarch64_insn_gen_cas(enum aarch64_insn_register result, }#endif u32 aarch64_insn_gen_dmb (enum aarch64_insn_mb_type type); +u32 aarch64_insn_gen_dsb (enum aarch64_insn_mb_type type);s32 aarch64_get_branch_offset (u32 insn);u32 aarch64_set_branch_offset (u32 insn,s32 offset);
arch/arm64/include/asm/spectre.h +3 -0
@@ -97,6 +97,9 @@ enum mitigation_state arm64_get_meltdown_state(void);enum mitigation_state arm64_get_spectre_bhb_state (void );bool is_spectre_bhb_affected (const struct arm64_cpu_capabilities *entry,int scope); +extern bool __nospectre_bhb; +u8 get_spectre_bhb_loop_value (void ); +bool is_spectre_bhb_fw_mitigated (void );void spectre_bhb_enable_mitigation (const struct arm64_cpu_capabilities *__unused);bool try_emulate_el1_ssbs (struct pt_regs *regs,u32 instr);
arch/arm64/kernel/proton-pack.c +12 -1
@@ -891,6 +891,7 @@ static u8 spectre_bhb_loop_affected(void)MIDR_ALL_VERSIONS (MIDR_CORTEX_A78AE ),MIDR_ALL_VERSIONS (MIDR_CORTEX_A78C ),MIDR_ALL_VERSIONS (MIDR_CORTEX_X1 ), +MIDR_ALL_VERSIONS (MIDR_CORTEX_X1C ),MIDR_ALL_VERSIONS (MIDR_CORTEX_A710 ),MIDR_ALL_VERSIONS (MIDR_CORTEX_X2 ), MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2),
@@ -998,6 +999,11 @@ bool is_spectre_bhb_affected(const struct arm64_cpu_capabilities *entry,return true; } +u8 get_spectre_bhb_loop_value (void ) +{ +return max_bhb_k; +} +static void this_cpu_set_vectors (enum arm64_bp_harden_el1_vectors slot) {const char *v =arm64_get_bp_hardening_vector (slot);
@@ -1015,7 +1021,7 @@ static void this_cpu_set_vectors(enum arm64_bp_harden_el1_vectors slot)isb (); } -static bool __read_mostly __nospectre_bhb; +bool __read_mostly __nospectre_bhb;static int __init parse_spectre_bhb_param (char *str) { __nospectre_bhb = true;
@@ -1093,6 +1099,11 @@ void spectre_bhb_enable_mitigation(const struct arm64_cpu_capabilities *entry)update_mitigation_state (&spectre_bhb_state, state); } +bool is_spectre_bhb_fw_mitigated (void ) +{ +return test_bit (BHB_FW , &system_bhb_mitigations); +} +/* Patched to NOP when enabled */ void noinstr spectre_bhb_patch_loop_mitigation_enable(struct alt_instr *alt, __le32 *origptr,
arch/arm64/lib/insn.c +37 -23
89 lines not on this page · raw message
arch/arm64/net/bpf_jit_comp.c +53 -4
96 lines not on this page · raw message
arch/mips/include/asm/ptrace.h +2 -1
@@ -65,7 +65,8 @@ static inline void instruction_pointer_set(struct pt_regs *regs,/* Query offset/name of register from its name/offset */ extern int regs_query_register_offset (const char *name); -#define MAX_REG_OFFSET (offsetof(struct pt_regs, __last)) +#define MAX_REG_OFFSET \ + (offsetof(struct pt_regs, __last) - sizeof(unsigned long))/** * regs_get_register() - get register value from its offset
arch/x86/Kconfig +11 -0
@@ -2610,6 +2610,17 @@ config MITIGATION_SPECTRE_BHI indirect branches. See <file:Documentation/admin-guide/hw-vuln/spectre.rst> +config MITIGATION_ITS + bool "Enable Indirect Target Selection mitigation" + depends on CPU_SUP_INTEL && X86_64 + depends on RETPOLINE && RETHUNK + default y + help + Enable Indirect Target Selection (ITS) mitigation. ITS is a bug in + BPU on some Intel CPUs that may allow Spectre V2 style attacks. If + disabled, mitigation cannot be enabled via cmdline. + See <file:Documentation/admin-guide/hw-vuln/indirect-target-selection.rst> + endif config ARCH_HAS_ADD_PAGES
arch/x86/entry/entry_64.S +17 -3
@@ -1569,7 +1569,9 @@ SYM_CODE_END(rewind_stack_and_make_dead) * ORC to unwind properly. * * The alignment is for performance and not for safety, and may be safely - * refactored in the future if needed. + * refactored in the future if needed. The .skips are for safety, to ensure + * that all RETs are in the second half of a cacheline to mitigate Indirect + * Target Selection, rather than taking the slowpath via its_return_thunk. */ SYM_FUNC_START(clear_bhb_loop) push %rbp
@@ -1579,10 +1581,22 @@ SYM_FUNC_START(clear_bhb_loop) call 1f jmp 5f .align 64, 0xcc + /* + * Shift instructions so that the RET is in the upper half of the + * cacheline and don't take the slowpath to its_return_thunk. + */ + .skip 32 - (.Lret1 - 1f), 0xcc ANNOTATE_INTRA_FUNCTION_CALL 1: call 2f - RET +.Lret1: RET .align 64, 0xcc + /* + * As above shift instructions for RET at .Lret2 as well. + * + * This should be ideally be: .skip 32 - (.Lret2 - 2f), 0xcc + * but some Clang versions (e.g. 18) don't like this. + */ + .skip 32 - 18, 0xcc 2: movl $5, %eax 3: jmp 4f nop
@@ -1590,7 +1604,7 @@ SYM_FUNC_START(clear_bhb_loop) jnz 3b sub $1, %ecx jnz 1b - RET +.Lret2: RET 5: lfence pop %rbp RET
arch/x86/include/asm/alternative.h +32 -0
@@ -5,6 +5,7 @@#include <linux/types.h> #include <linux/stringify.h> #include <asm/asm.h> +#include <asm/bug.h> #define ALT_FLAGS_SHIFT 16
@@ -130,6 +131,37 @@ static __always_inline int x86_call_depth_emit_accounting(u8 **pprog, }#endif +#ifdef CONFIG_MITIGATION_ITS +extern void its_init_mod (struct module *mod); +extern void its_fini_mod (struct module *mod); +extern void its_free_mod (struct module *mod); +extern u8 *its_static_thunk (int reg); +#else /* CONFIG_MITIGATION_ITS */ +static inline void its_init_mod (struct module *mod) { } +static inline void its_fini_mod (struct module *mod) { } +static inline void its_free_mod (struct module *mod) { } +static inline u8 *its_static_thunk (int reg) +{ +WARN_ONCE (1 ,"ITS not compiled in" ); + +return NULL ; +} +#endif + +#if defined(CONFIG_RETHUNK ) && defined(CONFIG_OBJTOOL ) +extern bool cpu_wants_rethunk (void ); +extern bool cpu_wants_rethunk_at (void *addr); +#else +static __always_inline bool cpu_wants_rethunk(void) +{ +return false; +} +static __always_inline bool cpu_wants_rethunk_at(void *addr) +{ +return false; +} +#endif +#ifdef CONFIG_SMP extern void alternatives_smp_module_add(struct module *mod, char *name, void *locks, void *locks_end,
arch/x86/include/asm/cpufeatures.h +3 -0
@@ -468,6 +468,7 @@#define X86_FEATURE_BHI_CTRL (21*32+ 2)/* "" BHI_DIS_S HW control available */ #define X86_FEATURE_CLEAR_BHB_HW (21*32+ 3)/* "" BHI_DIS_S HW control enabled */ #define X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT (21*32+ 4)/* "" Clear branch history at vmexit using SW loop */ +#define X86_FEATURE_INDIRECT_THUNK_ITS (21*32 + 5)/* "" Use thunk for indirect branches in lower half of cacheline */ /* * BUG word(s)
@@ -518,4 +519,6 @@#define X86_BUG_RFDS X86_BUG(1*32 + 2)/* CPU is vulnerable to Register File Data Sampling */ #define X86_BUG_BHI X86_BUG(1*32 + 3)/* CPU is affected by Branch History Injection */ #define X86_BUG_IBPB_NO_RET X86_BUG(1*32 + 4)/* "ibpb_no_ret" IBPB omits return target predictions */ +#define X86_BUG_ITS X86_BUG(1*32 + 5)/* CPU is affected by Indirect Target Selection */ +#define X86_BUG_ITS_NATIVE_ONLY X86_BUG(1*32 + 6)/* CPU is affected by ITS, VMX is not affected */ #endif /* _ASM_X86_CPUFEATURES_H */
arch/x86/include/asm/microcode.h +2 -0
@@ -17,10 +17,12 @@ struct ucode_cpu_info {void load_ucode_bsp (void );void load_ucode_ap (void );void microcode_bsp_resume (void ); +bool __init microcode_loader_disabled (void );#else static inline void load_ucode_bsp (void ) { }static inline void load_ucode_ap (void ) { }static inline void microcode_bsp_resume (void ) { } +static inline bool __init microcode_loader_disabled (void ) {return false; }#endif extern unsigned long initrd_start_early;
arch/x86/include/asm/msr-index.h +8 -0
@@ -180,6 +180,14 @@* VERW clears CPU Register * File. */ +#define ARCH_CAP_ITS_NO BIT_ULL(62)/* +* Not susceptible to +* Indirect Target Selection. +* This bit is not set by +* HW, but is synthesized by +* VMMs for guests to know +* their affected status. +*/ #define ARCH_CAP_XAPIC_DISABLE BIT(21)/* * IA32_XAPIC_DISABLE_STATUS MSR
arch/x86/include/asm/nospec-branch.h +25 -19
88 lines not on this page · raw message
arch/x86/kernel/alternative.c +210 -5
305 lines not on this page · raw message
arch/x86/kernel/cpu/bugs.c +172 -6
246 lines not on this page · raw message
arch/x86/kernel/cpu/common.c +57 -15
106 lines not on this page · raw message
arch/x86/kernel/cpu/microcode/amd.c +4 -2
@@ -1102,15 +1102,17 @@ static enum ucode_state load_microcode_amd(u8 family, const u8 *data, size_t sizstatic int __init save_microcode_in_initrd (void ) { -unsigned int cpuid_1_eax =native_cpuid_eax (1 );struct cpuinfo_x86 *c = &boot_cpu_data;struct cont_desc desc = {0 }; +unsigned int cpuid_1_eax;enum ucode_state ret;struct cpio_data cp; -if (dis_ucode_ldr || c->x86_vendor !=X86_VENDOR_AMD || c->x86 <0x10 ) +if (microcode_loader_disabled () || c->x86_vendor !=X86_VENDOR_AMD || c->x86 <0x10 )return 0 ; + cpuid_1_eax =native_cpuid_eax (1 ); +if (!find_blobs_in_containers (&cp))return -EINVAL ;
arch/x86/kernel/cpu/microcode/core.c +34 -24
104 lines not on this page · raw message
arch/x86/kernel/cpu/microcode/intel.c +1 -1
@@ -389,7 +389,7 @@ static int __init save_builtin_microcode(void)if (xchg (&ucode_patch_va,NULL ) !=UCODE_BSP_LOADED )return 0 ; -if (dis_ucode_ldr || boot_cpu_data.x86_vendor !=X86_VENDOR_INTEL ) +if (microcode_loader_disabled () || boot_cpu_data.x86_vendor !=X86_VENDOR_INTEL )return 0 ; uci.mc =get_microcode_blob (&uci, true);
arch/x86/kernel/cpu/microcode/internal.h +0 -1
@@ -94,7 +94,6 @@ static inline unsigned int x86_cpuid_family(void)return x86_family (eax); } -extern bool dis_ucode_ldr;extern bool force_minrev;#ifdef CONFIG_CPU_SUP_AMD
arch/x86/kernel/ftrace.c +1 -1
@@ -363,7 +363,7 @@ create_trampoline(struct ftrace_ops *ops, unsigned int *tramp_size) goto fail; ip = trampoline + size; -if (cpu_feature_enabled (X86_FEATURE_RETHUNK )) +if (cpu_wants_rethunk_at (ip))__text_gen_insn (ip,JMP32_INSN_OPCODE , ip, x86_return_thunk,JMP32_INSN_SIZE );else memcpy (ip, retq,sizeof (retq));
arch/x86/kernel/head32.c +0 -4
@@ -145,10 +145,6 @@ void __init __no_stack_protector mk_early_pgtbl_32(void) *ptr = (unsigned long )ptep +PAGE_OFFSET ;#ifdef CONFIG_MICROCODE_INITRD32 -/* Running on a hypervisor? */ -if (native_cpuid_ecx (1 ) &BIT (31 )) -return ; - params = (struct boot_params *)__pa_nodebug (&boot_params);if (!params->hdr.ramdisk_size || !params->hdr.ramdisk_image)return ;
arch/x86/kernel/module.c +7 -0
@@ -312,6 +312,9 @@ int module_finalize(const Elf_Ehdr *hdr,void *pseg = (void *)para->sh_addr;apply_paravirt (pseg, pseg + para->sh_size); } + +its_init_mod (me); +if (retpolines || cfi) {void *rseg =NULL , *cseg =NULL ;unsigned int rsize =0 , csize =0 ;
@@ -332,6 +335,9 @@ int module_finalize(const Elf_Ehdr *hdr,void *rseg = (void *)retpolines->sh_addr;apply_retpolines (rseg, rseg + retpolines->sh_size); } + +its_fini_mod (me); +if (returns) {void *rseg = (void *)returns->sh_addr;apply_returns (rseg, rseg + returns->sh_size);
@@ -379,4 +385,5 @@ int module_finalize(const Elf_Ehdr *hdr,void module_arch_cleanup (struct module *mod) {alternatives_smp_module_del (mod); +its_free_mod (mod); }
arch/x86/kernel/static_call.c +2 -2
@@ -81,7 +81,7 @@ static void __ref __static_call_transform(void *insn, enum insn_type type,break ;case RET : -if (cpu_feature_enabled (X86_FEATURE_RETHUNK )) +if (cpu_wants_rethunk_at (insn)) code =text_gen_insn (JMP32_INSN_OPCODE , insn, x86_return_thunk);else code = &retinsn;
@@ -90,7 +90,7 @@ static void __ref __static_call_transform(void *insn, enum insn_type type,case JCC :if (!func) { func = __static_call_return; -if (cpu_feature_enabled (X86_FEATURE_RETHUNK )) +if (cpu_wants_rethunk ()) func = x86_return_thunk; }
arch/x86/kernel/vmlinux.lds.S +10 -0
@@ -541,4 +541,14 @@ INIT_PER_CPU(irq_stack_backing_store); "SRSO function pair won't alias"); #endif +#if defined(CONFIG_MITIGATION_ITS) && !defined(CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B) +. = ASSERT(__x86_indirect_its_thunk_rax & 0x20, "__x86_indirect_thunk_rax not in second half of cacheline"); +. = ASSERT(((__x86_indirect_its_thunk_rcx - __x86_indirect_its_thunk_rax) % 64) == 0, "Indirect thunks are not cacheline apart"); +. = ASSERT(__x86_indirect_its_thunk_array == __x86_indirect_its_thunk_rax, "Gap in ITS thunk array"); +#endif + +#if defined(CONFIG_MITIGATION_ITS) && !defined(CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B) +. = ASSERT(its_return_thunk & 0x20, "its_return_thunk not in second half of cacheline"); +#endif + #endif /* CONFIG_X86_64 */
arch/x86/kvm/x86.c +3 -1
@@ -1621,7 +1621,7 @@ static bool kvm_is_immutable_feature_msr(u32 msr) ARCH_CAP_PSCHANGE_MC_NO | ARCH_CAP_TSX_CTRL_MSR | ARCH_CAP_TAA_NO | \ ARCH_CAP_SBDR_SSDP_NO | ARCH_CAP_FBSDP_NO | ARCH_CAP_PSDP_NO | \ ARCH_CAP_FB_CLEAR | ARCH_CAP_RRSBA | ARCH_CAP_PBRSB_NO | ARCH_CAP_GDS_NO | \ - ARCH_CAP_RFDS_NO | ARCH_CAP_RFDS_CLEAR | ARCH_CAP_BHI_NO) + ARCH_CAP_RFDS_NO | ARCH_CAP_RFDS_CLEAR | ARCH_CAP_BHI_NO | ARCH_CAP_ITS_NO)static u64 kvm_get_arch_capabilities (void ) {
@@ -1655,6 +1655,8 @@ static u64 kvm_get_arch_capabilities(void) data |=ARCH_CAP_MDS_NO ;if (!boot_cpu_has_bug (X86_BUG_RFDS )) data |=ARCH_CAP_RFDS_NO ; +if (!boot_cpu_has_bug (X86_BUG_ITS )) + data |=ARCH_CAP_ITS_NO ;if (!boot_cpu_has (X86_FEATURE_RTM )) {/*
arch/x86/lib/retpoline.S +39 -0
@@ -360,6 +360,45 @@ SYM_FUNC_END(__x86_return_skl) #endif /* CONFIG_CALL_DEPTH_TRACKING */ +#ifdef CONFIG_MITIGATION_ITS + +.macro ITS_THUNK reg + +SYM_INNER_LABEL(__x86_indirect_its_thunk_\reg, SYM_L_GLOBAL) + UNWIND_HINT_UNDEFINED + ANNOTATE_NOENDBR + ANNOTATE_RETPOLINE_SAFE + jmp *%\reg + int3 + .align 32, 0xcc /* fill to the end of the line */ + .skip 32, 0xcc /* skip to the next upper half */ +.endm + +/* ITS mitigation requires thunks be aligned to upper half of cacheline */ +.align 64, 0xcc +.skip 32, 0xcc +SYM_CODE_START(__x86_indirect_its_thunk_array) + +#define GEN(reg) ITS_THUNK reg +#include <asm/GEN-for-each-reg.h> +#undef GEN + + .align 64, 0xcc +SYM_CODE_END(__x86_indirect_its_thunk_array) + +.align 64, 0xcc +.skip 32, 0xcc +SYM_CODE_START(its_return_thunk) + UNWIND_HINT_FUNC + ANNOTATE_NOENDBR + ANNOTATE_UNRET_SAFE + ret + int3 +SYM_CODE_END(its_return_thunk) +EXPORT_SYMBOL(its_return_thunk) + +#endif /* CONFIG_MITIGATION_ITS */ + /* * This function name is magical and is used by -mfunction-return=thunk-extern * for the compiler to generate JMPs to it.
arch/x86/mm/tlb.c +21 -2
@@ -630,7 +630,11 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,choose_new_asid (next, next_tlb_gen, &new_asid, &need_flush); -/* Let nmi_uaccess_okay() know that we're changing CR3. */ +/* +* Indicate that CR3 is about to change. nmi_uaccess_okay() +* and others are sensitive to the window where mm_cpumask(), +* CR3 and cpu_tlbstate.loaded_mm are not all in sync. +*/ this_cpu_write (cpu_tlbstate.loaded_mm,LOADED_MM_SWITCHING );barrier (); }
@@ -900,8 +904,16 @@ static void flush_tlb_func(void *info)static bool should_flush_tlb (int cpu,void *data) { +struct mm_struct *loaded_mm =per_cpu (cpu_tlbstate.loaded_mm, cpu);struct flush_tlb_info *info = data; +/* +* Order the 'loaded_mm' and 'is_lazy' against their +* write ordering in switch_mm_irqs_off(). Ensure +* 'is_lazy' is at least as new as 'loaded_mm'. +*/ +smp_rmb (); +/* Lazy TLB will get flushed at the next context switch. */ if (per_cpu (cpu_tlbstate_shared.is_lazy, cpu))return false;
@@ -910,8 +922,15 @@ static bool should_flush_tlb(int cpu, void *data)if (!info->mm)return true; +/* +* While switching, the remote CPU could have state from +* either the prev or next mm. Assume the worst and flush. +*/ +if (loaded_mm ==LOADED_MM_SWITCHING ) +return true; +/* The target mm is loaded, and the CPU is not lazy. */ -if (per_cpu (cpu_tlbstate.loaded_mm, cpu) == info->mm) +if (loaded_mm == info->mm)return true;/* In cpumask, but not the loaded mm? Periodically remove by flushing. */
arch/x86/net/bpf_jit_comp.c +59 -2
91 lines not on this page · raw message
drivers/base/cpu.c +3 -0
@@ -566,6 +566,7 @@ CPU_SHOW_VULN_FALLBACK(retbleed);CPU_SHOW_VULN_FALLBACK (spec_rstack_overflow);CPU_SHOW_VULN_FALLBACK (gds);CPU_SHOW_VULN_FALLBACK (reg_file_data_sampling); +CPU_SHOW_VULN_FALLBACK (indirect_target_selection); static DEVICE_ATTR(meltdown, 0444, cpu_show_meltdown, NULL); static DEVICE_ATTR(spectre_v1, 0444, cpu_show_spectre_v1, NULL);
@@ -581,6 +582,7 @@ static DEVICE_ATTR(retbleed, 0444, cpu_show_retbleed, NULL); static DEVICE_ATTR(spec_rstack_overflow, 0444, cpu_show_spec_rstack_overflow, NULL); static DEVICE_ATTR(gather_data_sampling, 0444, cpu_show_gds, NULL); static DEVICE_ATTR(reg_file_data_sampling, 0444, cpu_show_reg_file_data_sampling, NULL); +static DEVICE_ATTR(indirect_target_selection, 0444, cpu_show_indirect_target_selection, NULL);static struct attribute *cpu_root_vulnerabilities_attrs[] = { &dev_attr_meltdown.attr,
@@ -597,6 +599,7 @@ static struct attribute *cpu_root_vulnerabilities_attrs[] = { &dev_attr_spec_rstack_overflow.attr, &dev_attr_gather_data_sampling.attr, &dev_attr_reg_file_data_sampling.attr, + &dev_attr_indirect_target_selection.attr, NULL };
drivers/clocksource/i8253.c +1 -3
@@ -103,7 +103,7 @@ int __init clocksource_i8253_init(void)#ifdef CONFIG_CLKEVT_I8253 void clockevent_i8253_disable (void ) { -raw_spin_lock (&i8253_lock); +guard (raw_spinlock_irqsave)(&i8253_lock);/* * Writing the MODE register should stop the counter, according to
@@ -132,8 +132,6 @@ void clockevent_i8253_disable(void)outb_p (0 ,PIT_CH0 );outb_p (0x30 ,PIT_MODE ); - -raw_spin_unlock (&i8253_lock); }static int pit_shutdown (struct clock_event_device *evt)
drivers/gpu/drm/amd/amdgpu/hdp_v4_0.c +6 -1
@@ -42,7 +42,12 @@ static void hdp_v4_0_flush_hdp(struct amdgpu_device *adev, {if (!ring || !ring->funcs->emit_wreg) {WREG32 ((adev->rmmio_remap.reg_offset +KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL ) >>2 ,0 ); -RREG32 ((adev->rmmio_remap.reg_offset +KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL ) >>2 ); +/* We just need to read back a register to post the write. +* Reading back the remapped register causes problems on +* some platforms so just read back the memory size register. +*/ +if (adev->nbio.funcs->get_memsize) + adev->nbio.funcs->get_memsize (adev); }else {amdgpu_ring_emit_wreg (ring, (adev->rmmio_remap.reg_offset +KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL ) >>2 ,0 ); }
drivers/gpu/drm/amd/amdgpu/hdp_v5_0.c +6 -1
@@ -33,7 +33,12 @@ static void hdp_v5_0_flush_hdp(struct amdgpu_device *adev, {if (!ring || !ring->funcs->emit_wreg) {WREG32 ((adev->rmmio_remap.reg_offset +KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL ) >>2 ,0 ); -RREG32 ((adev->rmmio_remap.reg_offset +KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL ) >>2 ); +/* We just need to read back a register to post the write. +* Reading back the remapped register causes problems on +* some platforms so just read back the memory size register. +*/ +if (adev->nbio.funcs->get_memsize) + adev->nbio.funcs->get_memsize (adev); }else {amdgpu_ring_emit_wreg (ring, (adev->rmmio_remap.reg_offset +KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL ) >>2 ,0 ); }
drivers/gpu/drm/amd/amdgpu/hdp_v5_2.c +11 -1
@@ -34,7 +34,17 @@ static void hdp_v5_2_flush_hdp(struct amdgpu_device *adev,if (!ring || !ring->funcs->emit_wreg) {WREG32_NO_KIQ ((adev->rmmio_remap.reg_offset +KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL ) >>2 ,0 ); -RREG32_NO_KIQ ((adev->rmmio_remap.reg_offset +KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL ) >>2 ); +if (amdgpu_sriov_vf (adev)) { +/* this is fine because SR_IOV doesn't remap the register */ +RREG32_NO_KIQ ((adev->rmmio_remap.reg_offset +KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL ) >>2 ); + }else { +/* We just need to read back a register to post the write. +* Reading back the remapped register causes problems on +* some platforms so just read back the memory size register. +*/ +if (adev->nbio.funcs->get_memsize) + adev->nbio.funcs->get_memsize (adev); + } }else { amdgpu_ring_emit_wreg(ring, (adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL) >> 2,
drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c +6 -1
@@ -33,7 +33,12 @@ static void hdp_v6_0_flush_hdp(struct amdgpu_device *adev, {if (!ring || !ring->funcs->emit_wreg) {WREG32 ((adev->rmmio_remap.reg_offset +KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL ) >>2 ,0 ); -RREG32 ((adev->rmmio_remap.reg_offset +KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL ) >>2 ); +/* We just need to read back a register to post the write. +* Reading back the remapped register causes problems on +* some platforms so just read back the memory size register. +*/ +if (adev->nbio.funcs->get_memsize) + adev->nbio.funcs->get_memsize (adev); }else {amdgpu_ring_emit_wreg (ring, (adev->rmmio_remap.reg_offset +KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL ) >>2 ,0 ); }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +17 -19
@@ -610,15 +610,21 @@ static void dm_crtc_high_irq(void *interrupt_params)spin_lock_irqsave (&adev_to_drm (adev)->event_lock, flags);if (acrtc->dm_irq_params.stream && - acrtc->dm_irq_params.vrr_params.supported && - acrtc->dm_irq_params.freesync_config.state == -VRR_STATE_ACTIVE_VARIABLE ) { + acrtc->dm_irq_params.vrr_params.supported) { +bool replay_en = acrtc->dm_irq_params.stream->link->replay_settings.replay_feature_enabled; +bool psr_en = acrtc->dm_irq_params.stream->link->psr_settings.psr_feature_enabled; +bool fs_active_var_en = acrtc->dm_irq_params.freesync_config.state ==VRR_STATE_ACTIVE_VARIABLE ; +mod_freesync_handle_v_update (adev->dm.freesync_module, acrtc->dm_irq_params.stream, &acrtc->dm_irq_params.vrr_params); -dc_stream_adjust_vmin_vmax (adev->dm.dc, acrtc->dm_irq_params.stream, - &acrtc->dm_irq_params.vrr_params.adjust); +/* update vmin_vmax only if freesync is enabled, or only if PSR and REPLAY are disabled */ +if (fs_active_var_en || (!fs_active_var_en && !replay_en && !psr_en)) { +dc_stream_adjust_vmin_vmax (adev->dm.dc, + acrtc->dm_irq_params.stream, + &acrtc->dm_irq_params.vrr_params.adjust); + } }/*
@@ -11049,7 +11055,7 @@ int amdgpu_dm_process_dmub_aux_transfer_sync(* Transient states before tunneling is enabled could * lead to this error. We can ignore this for now. */ -if (p_notify->result !=AUX_RET_ERROR_PROTOCOL_ERROR ) { +if (p_notify->result ==AUX_RET_ERROR_PROTOCOL_ERROR ) {DRM_WARN ("DPIA AUX failed on 0x%x(%d), error %d\n" , payload->address, payload->length, p_notify->result);
@@ -11058,22 +11064,14 @@ int amdgpu_dm_process_dmub_aux_transfer_sync( goto out; } + payload->reply[0 ] = adev->dm.dmub_notify->aux_reply.command &0xF ; +if (adev->dm.dmub_notify->aux_reply.command &0xF0 ) +/* The reply is stored in the top nibble of the command. */ + payload->reply[0 ] = (adev->dm.dmub_notify->aux_reply.command >>4 ) &0xF ; - payload->reply[0 ] = adev->dm.dmub_notify->aux_reply.command; -if (!payload->write && p_notify->aux_reply.length && - (payload->reply[0 ] ==AUX_TRANSACTION_REPLY_AUX_ACK )) { - -if (payload->length != p_notify->aux_reply.length) { -DRM_WARN ("invalid read length %d from DPIA AUX 0x%x(%d)!\n" , - p_notify->aux_reply.length, - payload->address, payload->length); - *operation_result =AUX_RET_ERROR_INVALID_REPLY ; - goto out; - } - +if (!payload->write && p_notify->aux_reply.length)memcpy (payload->data, p_notify->aux_reply.data, p_notify->aux_reply.length); - }/* success */ ret = p_notify->aux_reply.length;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +24 -4
@@ -48,6 +48,9 @@#define PEAK_FACTOR_X1000 1006 +/* +* This function handles both native AUX and I2C-Over-AUX transactions. +*/ static ssize_t dm_dp_aux_transfer (struct drm_dp_aux *aux,struct drm_dp_aux_msg *msg) {
@@ -84,15 +87,25 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,if (adev->dm.aux_hpd_discon_quirk) {if (msg->address ==DP_SIDEBAND_MSG_DOWN_REQ_BASE && operation_result ==AUX_RET_ERROR_HPD_DISCON ) { - result =0 ; + result = msg->size; operation_result =AUX_RET_SUCCESS ; } } -if (payload.write && result >=0 ) - result = msg->size; +/* +* result equals to 0 includes the cases of AUX_DEFER/I2C_DEFER +*/ +if (payload.write && result >=0 ) { +if (result) { +/*one byte indicating partially written bytes. Force 0 to retry*/ +drm_info (adev_to_drm (adev),"amdgpu: AUX partially written\n" ); + result =0 ; + }else if (!payload.reply[0 ]) +/*I2C_ACK|AUX_ACK*/ + result = msg->size; + } -if (result <0 ) +if (result <0 ) {switch (operation_result) {case AUX_RET_SUCCESS :break ;
@@ -111,6 +124,13 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,break ; } +drm_info (adev_to_drm (adev),"amdgpu: DP AUX transfer fail:%d\n" , operation_result); + } + +if (payload.reply[0 ]) +drm_info (adev_to_drm (adev),"amdgpu: AUX reply command not ACK: 0x%02x." , + payload.reply[0 ]); +return result; }
drivers/gpu/drm/panel/panel-simple.c +13 -12
@@ -979,27 +979,28 @@ static const struct panel_desc auo_g070vvn01 = { }, }; -static const struct drm_display_mode auo_g101evn010_mode = { - .clock =68930 , - .hdisplay =1280 , - .hsync_start =1280 +82 , - .hsync_end =1280 +82 +2 , - .htotal =1280 +82 +2 +84 , - .vdisplay =800 , - .vsync_start =800 +8 , - .vsync_end =800 +8 +2 , - .vtotal =800 +8 +2 +6 , +static const struct display_timing auo_g101evn010_timing = { + .pixelclock = {64000000 ,68930000 ,85000000 }, + .hactive = {1280 ,1280 ,1280 }, + .hfront_porch = {8 ,64 ,256 }, + .hback_porch = {8 ,64 ,256 }, + .hsync_len = {40 ,168 ,767 }, + .vactive = {800 ,800 ,800 }, + .vfront_porch = {4 ,8 ,100 }, + .vback_porch = {4 ,8 ,100 }, + .vsync_len = {8 ,16 ,223 }, };static const struct panel_desc auo_g101evn010 = { - .modes = &auo_g101evn010_mode, - .num_modes =1 , + .timings = &auo_g101evn010_timing, + .num_timings =1 , .bpc =6 , .size = { .width =216 , .height =135 , }, .bus_format =MEDIA_BUS_FMT_RGB666_1X7X3_SPWG , + .bus_flags =DRM_BUS_FLAG_DE_HIGH , .connector_type =DRM_MODE_CONNECTOR_LVDS , };
drivers/gpu/drm/v3d/v3d_sched.c +21 -7
@@ -289,11 +289,16 @@ v3d_gpu_reset_for_timeout(struct v3d_dev *v3d, struct drm_sched_job *sched_job)return DRM_GPU_SCHED_STAT_NOMINAL ; } -/* If the current address or return address have changed, then the GPU -* has probably made progress and we should delay the reset. This -* could fail if the GPU got in an infinite loop in the CL, but that -* is pretty unlikely outside of an i-g-t testcase. -*/ +static void +v3d_sched_skip_reset (struct drm_sched_job *sched_job) +{ +struct drm_gpu_scheduler *sched = sched_job->sched; + +spin_lock (&sched->job_list_lock); +list_add (&sched_job->list, &sched->pending_list); +spin_unlock (&sched->job_list_lock); +} +static enum drm_gpu_sched_stat v3d_cl_job_timedout (struct drm_sched_job *sched_job,enum v3d_queue q,u32 *timedout_ctca,u32 *timedout_ctra)
@@ -303,9 +308,16 @@ v3d_cl_job_timedout(struct drm_sched_job *sched_job, enum v3d_queue q,u32 ctca =V3D_CORE_READ (0 ,V3D_CLE_CTNCA (q));u32 ctra =V3D_CORE_READ (0 ,V3D_CLE_CTNRA (q)); +/* If the current address or return address have changed, then the GPU +* has probably made progress and we should delay the reset. This +* could fail if the GPU got in an infinite loop in the CL, but that +* is pretty unlikely outside of an i-g-t testcase. +*/ if (*timedout_ctca != ctca || *timedout_ctra != ctra) { *timedout_ctca = ctca; *timedout_ctra = ctra; + +v3d_sched_skip_reset (sched_job);return DRM_GPU_SCHED_STAT_NOMINAL ; }
@@ -345,11 +357,13 @@ v3d_csd_job_timedout(struct drm_sched_job *sched_job)struct v3d_dev *v3d = job->base.v3d;u32 batches =V3D_CORE_READ (0 ,V3D_CSD_CURRENT_CFG4 ); -/* If we've made progress, skip reset and let the timer get -* rearmed. +/* If we've made progress, skip reset, add the job to the pending +* list, and let the timer get rearmed. */ if (job->timedout_batches != batches) { job->timedout_batches = batches; + +v3d_sched_skip_reset (sched_job);return DRM_GPU_SCHED_STAT_NOMINAL ; }
drivers/iio/accel/adis16201.c +2 -2
@@ -211,9 +211,9 @@ static const struct iio_chan_spec adis16201_channels[] = { BIT(IIO_CHAN_INFO_CALIBBIAS), 0, 14),ADIS_AUX_ADC_CHAN (ADIS16201_AUX_ADC_REG ,ADIS16201_SCAN_AUX_ADC ,0 ,12 ),ADIS_INCLI_CHAN (X ,ADIS16201_XINCL_OUT_REG ,ADIS16201_SCAN_INCLI_X , -BIT (IIO_CHAN_INFO_CALIBBIAS ),0 ,14 ), +BIT (IIO_CHAN_INFO_CALIBBIAS ),0 ,12 ),ADIS_INCLI_CHAN (Y ,ADIS16201_YINCL_OUT_REG ,ADIS16201_SCAN_INCLI_Y , -BIT (IIO_CHAN_INFO_CALIBBIAS ),0 ,14 ), +BIT (IIO_CHAN_INFO_CALIBBIAS ),0 ,12 ), IIO_CHAN_SOFT_TIMESTAMP(7) };
drivers/iio/accel/adxl355_core.c +1 -1
@@ -231,7 +231,7 @@ struct adxl355_data {u8 transf_buf[3 ];struct {u8 buf[14 ]; -s64 ts; +aligned_s64 ts; } buffer; }__aligned(IIO_DMA_MINALIGN) ; };
drivers/iio/accel/adxl367.c +3 -7
@@ -620,18 +620,14 @@ static int _adxl367_set_odr(struct adxl367_state *st, enum adxl367_odr odr)if (ret)return ret; + st->odr = odr; +/* Activity timers depend on ODR */ ret =_adxl367_set_act_time_ms (st, st->act_time_ms);if (ret)return ret; - ret =_adxl367_set_inact_time_ms (st, st->inact_time_ms); -if (ret) -return ret; - - st->odr = odr; - -return 0 ; +return _adxl367_set_inact_time_ms (st, st->inact_time_ms); }static int adxl367_set_odr (struct iio_dev *indio_dev,enum adxl367_odr odr)
drivers/iio/adc/ad7606_spi.c +1 -1
@@ -127,7 +127,7 @@ static int ad7606_spi_reg_read(struct ad7606_state *st, unsigned int addr) { .tx_buf = &st->d16[0], .len = 2, - .cs_change = 0, + .cs_change = 1, }, { .rx_buf = &st->d16[1], .len = 2,
drivers/iio/adc/dln2-adc.c +1 -1
@@ -483,7 +483,7 @@ static irqreturn_t dln2_adc_trigger_h(int irq, void *p)struct iio_dev *indio_dev = pf->indio_dev;struct {__le16 values[DLN2_ADC_MAX_CHANNELS ]; -int64_t timestamp_space; +aligned_s64 timestamp_space; } data;struct dln2_adc_get_all_vals dev_data;struct dln2_adc *dln2 =iio_priv (indio_dev);
drivers/iio/adc/rockchip_saradc.c +8 -9
@@ -485,15 +485,6 @@ static int rockchip_saradc_probe(struct platform_device *pdev)if (info->reset)rockchip_saradc_reset_controller (info->reset); -/* -* Use a default value for the converter clock. -* This may become user-configurable in the future. -*/ - ret =clk_set_rate (info->clk, info->data->clk_rate); -if (ret <0 ) -return dev_err_probe (&pdev->dev, ret, -"failed to set adc clk rate\n" ); - ret =regulator_enable (info->vref);if (ret <0 ) return dev_err_probe(&pdev->dev, ret,
@@ -520,6 +511,14 @@ static int rockchip_saradc_probe(struct platform_device *pdev)if (IS_ERR (info->clk))return dev_err_probe (&pdev->dev,PTR_ERR (info->clk),"failed to get adc clock\n" ); +/* +* Use a default value for the converter clock. +* This may become user-configurable in the future. +*/ + ret =clk_set_rate (info->clk, info->data->clk_rate); +if (ret <0 ) +return dev_err_probe (&pdev->dev, ret, +"failed to set adc clk rate\n" );platform_set_drvdata (pdev, indio_dev);
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +6 -0
@@ -370,6 +370,9 @@ int st_lsm6dsx_read_fifo(struct st_lsm6dsx_hw *hw)if (fifo_status &cpu_to_le16 (ST_LSM6DSX_FIFO_EMPTY_MASK ))return 0 ; +if (!pattern_len) + pattern_len =ST_LSM6DSX_SAMPLE_SIZE ; + fifo_len = (le16_to_cpu (fifo_status) & fifo_diff_mask) *ST_LSM6DSX_CHAN_SIZE ; fifo_len = (fifo_len / pattern_len) * pattern_len;
@@ -601,6 +604,9 @@ int st_lsm6dsx_read_tagged_fifo(struct st_lsm6dsx_hw *hw)if (!fifo_len)return 0 ; +if (!pattern_len) + pattern_len =ST_LSM6DSX_TAGGED_SAMPLE_SIZE ; +for (read_len =0 ; read_len < fifo_len; read_len += pattern_len) { err = st_lsm6dsx_read_block(hw, ST_LSM6DSX_REG_FIFO_OUT_TAG_ADDR,
drivers/iio/temperature/maxim_thermocouple.c +1 -1
@@ -121,9 +121,9 @@ static const struct maxim_thermocouple_chip maxim_thermocouple_chips[] = {struct maxim_thermocouple_data {struct spi_device *spi;const struct maxim_thermocouple_chip *chip; +char tc_type;u8 buffer[16 ]__aligned(IIO_DMA_MINALIGN) ; -char tc_type; }; static int maxim_thermocouple_read(struct maxim_thermocouple_data *data,
drivers/input/joystick/xpad.c +23 -17
@@ -77,12 +77,13 @@* xbox d-pads should map to buttons, as is required for DDR pads * but we map them to axes when possible to simplify things */ -#define MAP_DPAD_TO_BUTTONS (1 << 0) -#define MAP_TRIGGERS_TO_BUTTONS (1 << 1) -#define MAP_STICKS_TO_NULL (1 << 2) -#define MAP_SELECT_BUTTON (1 << 3) -#define MAP_PADDLES (1 << 4) -#define MAP_PROFILE_BUTTON (1 << 5) +#define MAP_DPAD_TO_BUTTONS BIT(0) +#define MAP_TRIGGERS_TO_BUTTONS BIT(1) +#define MAP_STICKS_TO_NULL BIT(2) +#define MAP_SHARE_BUTTON BIT(3) +#define MAP_PADDLES BIT(4) +#define MAP_PROFILE_BUTTON BIT(5) +#define MAP_SHARE_OFFSET BIT(6)#define DANCEPAD_MAP_CONFIG (MAP_DPAD_TO_BUTTONS | \ MAP_TRIGGERS_TO_BUTTONS | MAP_STICKS_TO_NULL)
@@ -135,7 +136,7 @@ static const struct xpad_device { { 0x03f0, 0x048D, "HyperX Clutch", 0, XTYPE_XBOX360 }, /* wireless */ { 0x03f0, 0x0495, "HyperX Clutch Gladiate", 0, XTYPE_XBOXONE }, { 0x03f0, 0x07A0, "HyperX Clutch Gladiate RGB", 0, XTYPE_XBOXONE }, - { 0x03f0, 0x08B6, "HyperX Clutch Gladiate", 0, XTYPE_XBOXONE }, /* v2 */ + { 0x03f0, 0x08B6, "HyperX Clutch Gladiate", MAP_SHARE_BUTTON, XTYPE_XBOXONE }, /* v2 */ { 0x03f0, 0x09B4, "HyperX Clutch Tanto", 0, XTYPE_XBOXONE }, { 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX }, { 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX },
@@ -159,7 +160,7 @@ static const struct xpad_device { { 0x045e, 0x0719, "Xbox 360 Wireless Receiver", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W }, { 0x045e, 0x0b00, "Microsoft X-Box One Elite 2 pad", MAP_PADDLES, XTYPE_XBOXONE }, { 0x045e, 0x0b0a, "Microsoft X-Box Adaptive Controller", MAP_PROFILE_BUTTON, XTYPE_XBOXONE }, - { 0x045e, 0x0b12, "Microsoft Xbox Series S|X Controller", MAP_SELECT_BUTTON, XTYPE_XBOXONE }, + { 0x045e, 0x0b12, "Microsoft Xbox Series S|X Controller", MAP_SHARE_BUTTON | MAP_SHARE_OFFSET, XTYPE_XBOXONE }, { 0x046d, 0xc21d, "Logitech Gamepad F310", 0, XTYPE_XBOX360 }, { 0x046d, 0xc21e, "Logitech Gamepad F510", 0, XTYPE_XBOX360 }, { 0x046d, 0xc21f, "Logitech Gamepad F710", 0, XTYPE_XBOX360 },
@@ -205,13 +206,13 @@ static const struct xpad_device { { 0x0738, 0x9871, "Mad Catz Portable Drum", 0, XTYPE_XBOX360 }, { 0x0738, 0xb726, "Mad Catz Xbox controller - MW2", 0, XTYPE_XBOX360 }, { 0x0738, 0xb738, "Mad Catz MVC2TE Stick 2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, - { 0x0738, 0xbeef, "Mad Catz JOYTECH NEO SE Advanced GamePad", XTYPE_XBOX360 }, + { 0x0738, 0xbeef, "Mad Catz JOYTECH NEO SE Advanced GamePad", 0, XTYPE_XBOX360 }, { 0x0738, 0xcb02, "Saitek Cyborg Rumble Pad - PC/Xbox 360", 0, XTYPE_XBOX360 }, { 0x0738, 0xcb03, "Saitek P3200 Rumble Pad - PC/Xbox 360", 0, XTYPE_XBOX360 }, { 0x0738, 0xcb29, "Saitek Aviator Stick AV8R02", 0, XTYPE_XBOX360 }, { 0x0738, 0xf738, "Super SFIV FightStick TE S", 0, XTYPE_XBOX360 }, { 0x07ff, 0xffff, "Mad Catz GamePad", 0, XTYPE_XBOX360 }, - { 0x0b05, 0x1a38, "ASUS ROG RAIKIRI", 0, XTYPE_XBOXONE }, + { 0x0b05, 0x1a38, "ASUS ROG RAIKIRI", MAP_SHARE_BUTTON, XTYPE_XBOXONE }, { 0x0b05, 0x1abb, "ASUS ROG RAIKIRI PRO", 0, XTYPE_XBOXONE }, { 0x0c12, 0x0005, "Intec wireless", 0, XTYPE_XBOX }, { 0x0c12, 0x8801, "Nyko Xbox Controller", 0, XTYPE_XBOX },
@@ -240,7 +241,7 @@ static const struct xpad_device { { 0x0e6f, 0x0146, "Rock Candy Wired Controller for Xbox One", 0, XTYPE_XBOXONE }, { 0x0e6f, 0x0147, "PDP Marvel Xbox One Controller", 0, XTYPE_XBOXONE }, { 0x0e6f, 0x015c, "PDP Xbox One Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE }, - { 0x0e6f, 0x015d, "PDP Mirror's Edge Official Wired Controller for Xbox One", XTYPE_XBOXONE }, + { 0x0e6f, 0x015d, "PDP Mirror's Edge Official Wired Controller for Xbox One", 0, XTYPE_XBOXONE }, { 0x0e6f, 0x0161, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, { 0x0e6f, 0x0162, "PDP Xbox One Controller", 0, XTYPE_XBOXONE }, { 0x0e6f, 0x0163, "PDP Xbox One Controller", 0, XTYPE_XBOXONE },
@@ -386,10 +387,11 @@ static const struct xpad_device { { 0x2dc8, 0x3106, "8BitDo Ultimate Wireless / Pro 2 Wired Controller", 0, XTYPE_XBOX360 }, { 0x2dc8, 0x3109, "8BitDo Ultimate Wireless Bluetooth", 0, XTYPE_XBOX360 }, { 0x2dc8, 0x310a, "8BitDo Ultimate 2C Wireless Controller", 0, XTYPE_XBOX360 }, + { 0x2dc8, 0x310b, "8BitDo Ultimate 2 Wireless Controller", 0, XTYPE_XBOX360 }, { 0x2dc8, 0x6001, "8BitDo SN30 Pro", 0, XTYPE_XBOX360 }, { 0x2e24, 0x0652, "Hyperkin Duke X-Box One pad", 0, XTYPE_XBOXONE }, { 0x2e24, 0x1688, "Hyperkin X91 X-Box One pad", 0, XTYPE_XBOXONE }, - { 0x2e95, 0x0504, "SCUF Gaming Controller", MAP_SELECT_BUTTON, XTYPE_XBOXONE }, + { 0x2e95, 0x0504, "SCUF Gaming Controller", MAP_SHARE_BUTTON, XTYPE_XBOXONE }, { 0x31e3, 0x1100, "Wooting One", 0, XTYPE_XBOX360 }, { 0x31e3, 0x1200, "Wooting Two", 0, XTYPE_XBOX360 }, { 0x31e3, 0x1210, "Wooting Lekker", 0, XTYPE_XBOX360 },
@@ -1025,7 +1027,7 @@ static void xpad360w_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned cha* The report format was gleaned from * https://github.com/kylelemons/xbox/blob/master/xbox.go */ -static void xpadone_process_packet (struct usb_xpad *xpad,u16 cmd,unsigned char *data) +static void xpadone_process_packet (struct usb_xpad *xpad,u16 cmd,unsigned char *data,u32 len) {struct input_dev *dev = xpad->dev;bool do_sync = false;
@@ -1066,8 +1068,12 @@ static void xpadone_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char/* menu/view buttons */ input_report_key (dev,BTN_START , data[4 ] &BIT (2 ));input_report_key (dev,BTN_SELECT , data[4 ] &BIT (3 )); -if (xpad->mapping &MAP_SELECT_BUTTON ) -input_report_key (dev,KEY_RECORD , data[22 ] &BIT (0 )); +if (xpad->mapping &MAP_SHARE_BUTTON ) { +if (xpad->mapping &MAP_SHARE_OFFSET ) +input_report_key (dev,KEY_RECORD , data[len -26 ] &BIT (0 )); +else +input_report_key (dev,KEY_RECORD , data[len -18 ] &BIT (0 )); + }/* buttons A,B,X,Y */ input_report_key (dev,BTN_A , data[4 ] &BIT (4 ));
@@ -1215,7 +1221,7 @@ static void xpad_irq_in(struct urb *urb)xpad360w_process_packet (xpad,0 , xpad->idata);break ;case XTYPE_XBOXONE : -xpadone_process_packet (xpad,0 , xpad->idata); +xpadone_process_packet (xpad,0 , xpad->idata, urb->actual_length);break ;default :xpad_process_packet (xpad,0 , xpad->idata);
@@ -1972,7 +1978,7 @@ static int xpad_init_input(struct usb_xpad *xpad) xpad->xtype == XTYPE_XBOXONE) { for (i = 0; xpad360_btn[i] >= 0; i++) input_set_capability(input_dev, EV_KEY, xpad360_btn[i]); - if (xpad->mapping & MAP_SELECT_BUTTON) + if (xpad->mapping & MAP_SHARE_BUTTON) input_set_capability(input_dev, EV_KEY, KEY_RECORD); } else {for (i =0 ; xpad_btn[i] >=0 ; i++)
drivers/input/keyboard/mtk-pmic-keys.c +2 -2
@@ -147,8 +147,8 @@ static void mtk_pmic_keys_lp_reset_setup(struct mtk_pmic_keys *keys,u32 value, mask;int error; - kregs_home = keys->keys[MTK_PMIC_HOMEKEY_INDEX ].regs; - kregs_pwr = keys->keys[MTK_PMIC_PWRKEY_INDEX ].regs; + kregs_home = ®s->keys_regs[MTK_PMIC_HOMEKEY_INDEX ]; + kregs_pwr = ®s->keys_regs[MTK_PMIC_PWRKEY_INDEX ]; error =of_property_read_u32 (keys->dev->of_node,"power-off-time-sec" , &long_press_debounce);
drivers/input/mouse/synaptics.c +5 -0
@@ -163,6 +163,7 @@ static const char * const topbuttonpad_pnp_ids[] = {static const char *const smbus_pnp_ids[] = {/* all of the topbuttonpad_pnp_ids are valid, we just add some extras */ +"DLL060d" ,/* Dell Precision M3800 */ "LEN0048" ,/* X1 Carbon 3 */ "LEN0046" ,/* X250 */ "LEN0049" ,/* Yoga 11e */
@@ -189,11 +190,15 @@ static const char * const smbus_pnp_ids[] = {"LEN2054" ,/* E480 */ "LEN2055" ,/* E580 */ "LEN2068" ,/* T14 Gen 1 */ +"SYN1221" ,/* TUXEDO InfinityBook Pro 14 v5 */ +"SYN3003" ,/* HP EliteBook 850 G1 */ "SYN3015" ,/* HP EliteBook 840 G2 */ "SYN3052" ,/* HP EliteBook 840 G4 */ "SYN3221" ,/* HP 15-ay000 */ "SYN323d" ,/* HP Spectre X360 13-w013dx */ "SYN3257" ,/* HP Envy 13-ad105ng */ +"TOS01f6" ,/* Dynabook Portege X30L-G */ +"TOS0213" ,/* Dynabook Portege X30-D */ NULL };
drivers/input/touchscreen/cyttsp5.c +5 -2
@@ -580,7 +580,7 @@ static int cyttsp5_power_control(struct cyttsp5 *ts, bool on)int rc;SET_CMD_REPORT_TYPE (cmd[0 ],0 ); -SET_CMD_REPORT_ID (cmd[0 ],HID_POWER_SLEEP ); +SET_CMD_REPORT_ID (cmd[0 ], state);SET_CMD_OPCODE (cmd[1 ],HID_CMD_SET_POWER ); rc =cyttsp5_write (ts,HID_COMMAND_REG , cmd,sizeof (cmd));
@@ -865,13 +865,16 @@ static int cyttsp5_probe(struct device *dev, struct regmap *regmap, int irq, ts->input->phys = ts->phys;input_set_drvdata (ts->input, ts); -/* Reset the gpio to be in a reset state */ +/* Assert gpio to be in a reset state */ ts->reset_gpio =devm_gpiod_get_optional (dev,"reset" ,GPIOD_OUT_HIGH );if (IS_ERR (ts->reset_gpio)) { error =PTR_ERR (ts->reset_gpio);dev_err (dev,"Failed to request reset gpio, error %d\n" , error);return error; } + +fsleep (10 );/* Ensure long-enough reset pulse (minimum 10us). */ +gpiod_set_value_cansleep (ts->reset_gpio,0 );/* Need a delay to have device up */
drivers/md/dm-table.c +2 -1
@@ -1242,7 +1242,7 @@ static int dm_keyslot_evict(struct blk_crypto_profile *profile, t =dm_get_live_table (md, &srcu_idx);if (!t) -return 0 ; + goto put_live_table;for (unsigned int i =0 ; i < t->num_targets; i++) {struct dm_target *ti =dm_table_get_target (t, i);
@@ -1253,6 +1253,7 @@ static int dm_keyslot_evict(struct blk_crypto_profile *profile, (void *)key); } +put_live_table:dm_put_live_table (md, srcu_idx);return 0 ; }
drivers/net/can/m_can/m_can.c +1 -1
@@ -2125,9 +2125,9 @@ EXPORT_SYMBOL_GPL(m_can_class_register);void m_can_class_unregister (struct m_can_classdev *cdev) { +unregister_candev (cdev->net);if (cdev->is_peripheral)can_rx_offload_del (&cdev->offload); -unregister_candev (cdev->net); }EXPORT_SYMBOL_GPL (m_can_class_unregister);
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +33 -9
76 lines not on this page · raw message
drivers/net/dsa/b53/b53_common.c +24 -12
@@ -373,15 +373,17 @@ static void b53_enable_vlan(struct b53_device *dev, int port, bool enable,b53_read8 (dev,B53_VLAN_PAGE ,B53_VLAN_CTRL5 , &vc5); } + vc1 &= ~VC1_RX_MCST_FWD_EN ; +if (enable) { vc0 |=VC0_VLAN_EN |VC0_VID_CHK_EN |VC0_VID_HASH_VID ; - vc1 |=VC1_RX_MCST_UNTAG_EN |VC1_RX_MCST_FWD_EN ; + vc1 |=VC1_RX_MCST_UNTAG_EN ; vc4 &= ~VC4_ING_VID_CHECK_MASK ;if (enable_filtering) { vc4 |=VC4_ING_VID_VIO_DROP <<VC4_ING_VID_CHECK_S ; vc5 |=VC5_DROP_VTABLE_MISS ; }else { - vc4 |=VC4_ING_VID_VIO_FWD <<VC4_ING_VID_CHECK_S ; + vc4 |=VC4_NO_ING_VID_CHK <<VC4_ING_VID_CHECK_S ; vc5 &= ~VC5_DROP_VTABLE_MISS ; }
@@ -393,7 +395,7 @@ static void b53_enable_vlan(struct b53_device *dev, int port, bool enable, }else { vc0 &= ~(VC0_VLAN_EN |VC0_VID_CHK_EN |VC0_VID_HASH_VID ); - vc1 &= ~(VC1_RX_MCST_UNTAG_EN |VC1_RX_MCST_FWD_EN ); + vc1 &= ~VC1_RX_MCST_UNTAG_EN ; vc4 &= ~VC4_ING_VID_CHECK_MASK ; vc5 &= ~VC5_DROP_VTABLE_MISS ;
@@ -1519,12 +1521,21 @@ int b53_vlan_add(struct dsa_switch *ds, int port,bool untagged = vlan->flags &BRIDGE_VLAN_INFO_UNTAGGED ;bool pvid = vlan->flags &BRIDGE_VLAN_INFO_PVID ;struct b53_vlan *vl; +u16 old_pvid, new_pvid;int err; err =b53_vlan_prepare (ds, port, vlan);if (err)return err; +b53_read16 (dev,B53_VLAN_PAGE ,B53_VLAN_PORT_DEF_TAG (port), &old_pvid); +if (pvid) + new_pvid = vlan->vid; +else if (!pvid && vlan->vid == old_pvid) + new_pvid =b53_default_pvid (dev); +else + new_pvid = old_pvid; + vl = &dev->vlans[vlan->vid];b53_get_vlan_entry (dev, vlan->vid, vl);
@@ -1541,10 +1552,10 @@ int b53_vlan_add(struct dsa_switch *ds, int port,b53_set_vlan_entry (dev, vlan->vid, vl);b53_fast_age_vlan (dev, vlan->vid); -if (pvid && !dsa_is_cpu_port (ds, port)) { +if (!dsa_is_cpu_port (ds, port) && new_pvid != old_pvid) {b53_write16 (dev,B53_VLAN_PAGE ,B53_VLAN_PORT_DEF_TAG (port), - vlan->vid); -b53_fast_age_vlan (dev, vlan->vid); + new_pvid); +b53_fast_age_vlan (dev, old_pvid); }return 0 ;
@@ -1956,7 +1967,7 @@ EXPORT_SYMBOL(b53_br_join);void b53_br_leave (struct dsa_switch *ds,int port,struct dsa_bridge bridge) {struct b53_device *dev = ds->priv; -struct b53_vlan *vl = &dev->vlans[0 ]; +struct b53_vlan *vl;s8 cpu_port =dsa_to_port (ds, port)->cpu_dp->index;unsigned int i;u16 pvlan, reg, pvid;
@@ -1982,6 +1993,7 @@ void b53_br_leave(struct dsa_switch *ds, int port, struct dsa_bridge bridge) dev->ports[port].vlan_ctl_mask = pvlan; pvid =b53_default_pvid (dev); + vl = &dev->vlans[pvid];/* Make this port join all VLANs without VLAN entries */ if (is58xx (dev)) {
@@ -1990,12 +2002,12 @@ void b53_br_leave(struct dsa_switch *ds, int port, struct dsa_bridge bridge)if (!(reg &BIT (cpu_port))) reg |=BIT (cpu_port);b53_write16 (dev,B53_VLAN_PAGE ,B53_JOIN_ALL_VLAN_EN , reg); - }else { -b53_get_vlan_entry (dev, pvid, vl); - vl->members |=BIT (port) |BIT (cpu_port); - vl->untag |=BIT (port) |BIT (cpu_port); -b53_set_vlan_entry (dev, pvid, vl); } + +b53_get_vlan_entry (dev, pvid, vl); + vl->members |=BIT (port) |BIT (cpu_port); + vl->untag |=BIT (port) |BIT (cpu_port); +b53_set_vlan_entry (dev, pvid, vl); }EXPORT_SYMBOL (b53_br_leave);
drivers/net/ethernet/mediatek/mtk_eth_soc.c +12 -4
@@ -3117,11 +3117,19 @@ static int mtk_dma_init(struct mtk_eth *eth)static void mtk_dma_free (struct mtk_eth *eth) {const struct mtk_soc_data *soc = eth->soc; -int i; +int i, j, txqs =1 ; + +if (MTK_HAS_CAPS (eth->soc->caps,MTK_QDMA )) + txqs =MTK_QDMA_NUM_QUEUES ; + +for (i =0 ; i <MTK_MAX_DEVS ; i++) { +if (!eth->netdev[i]) +continue ; + +for (j =0 ; j < txqs; j++) +netdev_tx_reset_subqueue (eth->netdev[i], j); + } -for (i =0 ; i <MTK_MAX_DEVS ; i++) -if (eth->netdev[i]) -netdev_reset_queue (eth->netdev[i]);if (!MTK_HAS_CAPS (soc->caps,MTK_SRAM ) && eth->scratch_ring) { dma_free_coherent(eth->dma_dev, MTK_QDMA_RING_SIZE * soc->txrx.txd_size,
drivers/nvme/host/core.c +2 -1
@@ -4156,7 +4156,8 @@ static void nvme_fw_act_work(struct work_struct *work)msleep (100 ); } -if (!nvme_change_ctrl_state (ctrl,NVME_CTRL_LIVE )) +if (!nvme_change_ctrl_state (ctrl,NVME_CTRL_CONNECTING ) || + !nvme_change_ctrl_state (ctrl,NVME_CTRL_LIVE ))return ;nvme_unquiesce_io_queues (ctrl);
drivers/staging/axis-fifo/axis-fifo.c +3 -11
@@ -398,16 +398,14 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf, bytes_available =ioread32 (fifo->base_addr +XLLF_RLR_OFFSET );if (!bytes_available) { -dev_err (fifo->dt_device,"received a packet of length 0 - fifo core will be reset\n" ); -reset_ip_core (fifo); +dev_err (fifo->dt_device,"received a packet of length 0\n" ); ret = -EIO ; goto end_unlock; }if (bytes_available > len) { -dev_err (fifo->dt_device,"user read buffer too small (available bytes=%zu user buffer bytes=%zu) - fifo core will be reset\n" , +dev_err (fifo->dt_device,"user read buffer too small (available bytes=%zu user buffer bytes=%zu)\n" , bytes_available, len); -reset_ip_core (fifo); ret = -EINVAL ; goto end_unlock; }
@@ -416,8 +414,7 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,/* this probably can't happen unless IP * registers were previously mishandled */ -dev_err (fifo->dt_device,"received a packet that isn't word-aligned - fifo core will be reset\n" ); -reset_ip_core (fifo); +dev_err (fifo->dt_device,"received a packet that isn't word-aligned\n" ); ret = -EIO ; goto end_unlock; }
@@ -438,7 +435,6 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,if (copy_to_user (buf + copied *sizeof (u32), tmp_buf, copy *sizeof (u32))) { -reset_ip_core (fifo); ret = -EFAULT ; goto end_unlock; }
@@ -547,7 +543,6 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf,if (copy_from_user (tmp_buf, buf + copied *sizeof (u32), copy *sizeof (u32))) { -reset_ip_core (fifo); ret = -EFAULT ; goto end_unlock; }
@@ -780,9 +775,6 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo) goto end; } -/* IP sets TDFV to fifo depth - 4 so we will do the same */ - fifo->tx_fifo_depth -=4 ; - ret =get_dts_property (fifo,"xlnx,use-rx-data" , &fifo->has_rx_fifo);if (ret) {dev_err (fifo->dt_device,"missing xlnx,use-rx-data property\n" );
drivers/staging/iio/adc/ad7816.c +1 -1
@@ -136,7 +136,7 @@ static ssize_t ad7816_store_mode(struct device *dev,struct iio_dev *indio_dev =dev_to_iio_dev (dev);struct ad7816_chip_info *chip =iio_priv (indio_dev); -if (strcmp (buf,"full" )) { +if (strcmp (buf,"full" ) ==0 ) {gpiod_set_value (chip->rdwr_pin,1 ); chip->mode =AD7816_FULL ; }else {
drivers/usb/cdns3/cdnsp-gadget.c +31 -0
@@ -138,6 +138,26 @@ static void cdnsp_clear_port_change_bit(struct cdnsp_device *pdev, (portsc & PORT_CHANGE_BITS), port_regs); } +static void cdnsp_set_apb_timeout_value (struct cdnsp_device *pdev) +{ +struct cdns *cdns =dev_get_drvdata (pdev->dev); +__le32 __iomem *reg; +void __iomem *base; +u32 offset =0 ; +u32 val; + +if (!cdns->override_apb_timeout) +return ; + + base = &pdev->cap_regs->hc_capbase; + offset =cdnsp_find_next_ext_cap (base, offset,D_XEC_PRE_REGS_CAP ); + reg = base + offset +REG_CHICKEN_BITS_3_OFFSET ; + + val =le32_to_cpu (readl (reg)); + val =CHICKEN_APB_TIMEOUT_SET (val, cdns->override_apb_timeout); +writel (cpu_to_le32 (val), reg); +} +static void cdnsp_set_chicken_bits_2 (struct cdnsp_device *pdev,u32 bit) {__le32 __iomem *reg;
@@ -1776,6 +1796,8 @@ static void cdnsp_get_rev_cap(struct cdnsp_device *pdev) reg +=cdnsp_find_next_ext_cap (reg,0 ,RTL_REV_CAP ); pdev->rev_cap = reg; + pdev->rtl_revision =readl (&pdev->rev_cap->rtl_revision); + dev_info(pdev->dev, "Rev: %08x/%08x, eps: %08x, buff: %08x/%08x\n", readl(&pdev->rev_cap->ctrl_revision), readl(&pdev->rev_cap->rtl_revision),
@@ -1801,6 +1823,15 @@ static int cdnsp_gen_setup(struct cdnsp_device *pdev) pdev->hci_version =HC_VERSION (pdev->hcc_params); pdev->hcc_params =readl (&pdev->cap_regs->hcc_params); +/* +* Override the APB timeout value to give the controller more time for +* enabling UTMI clock and synchronizing APB and UTMI clock domains. +* This fix is platform specific and is required to fixes issue with +* reading incorrect value from PORTSC register after resuming +* from L1 state. +*/ +cdnsp_set_apb_timeout_value (pdev); +cdnsp_get_rev_cap (pdev);/* Make sure the Device Controller is halted. */
drivers/usb/cdns3/cdnsp-gadget.h +6 -0
@@ -520,6 +520,9 @@ struct cdnsp_rev_cap {#define REG_CHICKEN_BITS_2_OFFSET 0x48#define CHICKEN_XDMA_2_TP_CACHE_DIS BIT(28) +#define REG_CHICKEN_BITS_3_OFFSET 0x4C +#define CHICKEN_APB_TIMEOUT_SET (p, val) (((p) & ~GENMASK(21, 0)) | (val)) +/* XBUF Extended Capability ID. */ #define XBUF_CAP_ID 0xCB#define XBUF_RX_TAG_MASK_0_OFFSET 0x1C
@@ -1359,6 +1362,7 @@ struct cdnsp_port {* @rev_cap: Controller Capabilities Registers. * @hcs_params1: Cached register copies of read-only HCSPARAMS1 * @hcc_params: Cached register copies of read-only HCCPARAMS1 +* @rtl_revision: Cached controller rtl revision. * @setup: Temporary buffer for setup packet. * @ep0_preq: Internal allocated request used during enumeration. * @ep0_stage: ep0 stage during enumeration process.
@@ -1413,6 +1417,8 @@ struct cdnsp_device {__u32 hcs_params1;__u32 hcs_params3;__u32 hcc_params; +#define RTL_REVISION_NEW_LPM 0x2700 +__u32 rtl_revision;/* Lock used in interrupt thread context. */ spinlock_t lock;struct usb_ctrlrequest setup;
drivers/usb/cdns3/cdnsp-pci.c +10 -2
@@ -33,6 +33,8 @@#define CDNS_DRD_ID 0x0100#define CDNS_DRD_IF (PCI_CLASS_SERIAL_USB << 8 | 0x80) +#define CHICKEN_APB_TIMEOUT_VALUE 0x1C20 +static struct pci_dev *cdnsp_get_second_fun (struct pci_dev *pdev) {/*
@@ -144,6 +146,14 @@ static int cdnsp_pci_probe(struct pci_dev *pdev, cdnsp->otg_irq = pdev->irq; } +/* +* Cadence PCI based platform require some longer timeout for APB +* to fixes domain clock synchronization issue after resuming +* controller from L1 state. +*/ + cdnsp->override_apb_timeout =CHICKEN_APB_TIMEOUT_VALUE ; +pci_set_drvdata (pdev, cdnsp); +if (pci_is_enabled (func)) { cdnsp->dev = dev; cdnsp->gadget_init = cdnsp_gadget_init;
@@ -153,8 +163,6 @@ static int cdnsp_pci_probe(struct pci_dev *pdev, goto free_cdnsp; } -pci_set_drvdata (pdev, cdnsp); -device_wakeup_enable (&pdev->dev);if (pci_dev_run_wake (pdev))pm_runtime_put_noidle (&pdev->dev);
drivers/usb/cdns3/cdnsp-ring.c +2 -1
@@ -308,7 +308,8 @@ static bool cdnsp_ring_ep_doorbell(struct cdnsp_device *pdev,writel (db_value, reg_addr); -cdnsp_force_l0_go (pdev); +if (pdev->rtl_revision <RTL_REVISION_NEW_LPM ) +cdnsp_force_l0_go (pdev);/* Doorbell was set. */ return true;
drivers/usb/cdns3/core.h +3 -0
@@ -79,6 +79,8 @@ struct cdns3_platform_data {* @pdata: platform data from glue layer * @lock: spinlock structure * @xhci_plat_data: xhci private data structure pointer +* @override_apb_timeout: hold value of APB timeout. For value 0 the default +* value in CHICKEN_BITS_3 will be preserved. * @gadget_init: pointer to gadget initialization function */ struct cdns {
@@ -117,6 +119,7 @@ struct cdns {struct cdns3_platform_data *pdata;spinlock_t lock;struct xhci_plat_priv *xhci_plat_data; +u32 override_apb_timeout;int (*gadget_init)(struct cdns *cdns); };
drivers/usb/class/usbtmc.c +36 -23
136 lines not on this page · raw message
drivers/usb/gadget/composite.c +5 -7
@@ -2011,15 +2011,13 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)if (f->get_status) { status = f->get_status (f); +if (status <0 )break ; - }else { -/* Set D0 and D1 bits based on func wakeup capability */ -if (f->config->bmAttributes &USB_CONFIG_ATT_WAKEUP ) { - status |=USB_INTRF_STAT_FUNC_RW_CAP ; -if (f->func_wakeup_armed) - status |=USB_INTRF_STAT_FUNC_RW ; - } + +/* if D5 is not set, then device is not wakeup capable */ +if (!(f->config->bmAttributes &USB_CONFIG_ATT_WAKEUP )) + status &= ~(USB_INTRF_STAT_FUNC_RW_CAP |USB_INTRF_STAT_FUNC_RW ); }put_unaligned_le16 (status &0x0000ffff , req->buf);
drivers/usb/gadget/function/f_ecm.c +7 -0
@@ -892,6 +892,12 @@ static void ecm_resume(struct usb_function *f)gether_resume (&ecm->port); } +static int ecm_get_status (struct usb_function *f) +{ +return (f->func_wakeup_armed ?USB_INTRF_STAT_FUNC_RW :0 ) | +USB_INTRF_STAT_FUNC_RW_CAP ; +} +static void ecm_free (struct usb_function *f) {struct f_ecm *ecm;
@@ -960,6 +966,7 @@ static struct usb_function *ecm_alloc(struct usb_function_instance *fi) ecm->port.func.disable = ecm_disable; ecm->port.func.free_func = ecm_free; ecm->port.func.suspend = ecm_suspend;
Lines of this file are not shown. View the raw message.
drivers/xen/xenbus/xenbus_dev_frontend.c +1 -1
Lines of this file are not shown. View the raw message.
fs/ocfs2/journal.c +58 -22
80 lines not on this page · raw message
io_uring/io_uring.c +24 -37
61 lines not on this page · raw message
net/can/gw.c +90 -59
149 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.