aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rw-r--r--arch/arc/kernel/signal.c4
-rw-r--r--arch/arm/boot/dts/omap3.dtsi3
-rw-r--r--arch/arm/boot/dts/omap4.dtsi5
-rw-r--r--arch/arm/boot/dts/omap5.dtsi5
-rw-r--r--arch/arm/mach-footbridge/cats-pci.c4
-rw-r--r--arch/arm/mach-footbridge/ebsa285-pci.c4
-rw-r--r--arch/arm/mach-footbridge/netwinder-pci.c2
-rw-r--r--arch/arm/mach-footbridge/personal-pci.c5
-rw-r--r--arch/arm/mach-keystone/keystone.c4
-rw-r--r--arch/arm/probes/uprobes/core.c4
-rw-r--r--arch/arm64/boot/dts/qcom/sdmmagpie.dtsi4
-rw-r--r--arch/arm64/configs/davinci_defconfig1
-rw-r--r--arch/arm64/configs/phoenix_defconfig1
-rw-r--r--arch/arm64/configs/toco_defconfig1
-rw-r--r--arch/arm64/configs/tucana_defconfig1
-rw-r--r--arch/arm64/include/asm/word-at-a-time.h10
-rw-r--r--arch/ia64/mm/discontig.c6
-rw-r--r--arch/s390/kernel/entry.S1
-rw-r--r--arch/x86/kernel/crash.c3
-rw-r--r--block/Makefile3
-rw-r--r--drivers/android/binder.c212
-rw-r--r--drivers/android/binder_alloc.c106
-rw-r--r--drivers/android/binder_alloc.h9
-rw-r--r--drivers/android/binder_alloc_selftest.c2
-rw-r--r--drivers/base/cpu.c14
-rw-r--r--drivers/char/adsprpc.c12
-rw-r--r--drivers/devfreq/devfreq.c3
-rw-r--r--drivers/dma-buf/sync_file.c99
-rw-r--r--drivers/dma/dw/Kconfig2
-rw-r--r--drivers/gpu/drm/msm/dsi-staging/dsi_ctrl.c94
-rw-r--r--drivers/gpu/drm/msm/msm_atomic.c40
-rw-r--r--drivers/gpu/drm/msm/sde/sde_core_irq.c9
-rw-r--r--drivers/gpu/drm/msm/sde/sde_crtc.c10
-rw-r--r--drivers/gpu/drm/msm/sde/sde_encoder_phys_cmd.c22
-rw-r--r--drivers/gpu/drm/msm/sde/sde_hw_interrupts.c70
-rw-r--r--drivers/gpu/drm/msm/sde/sde_hw_interrupts.h10
-rw-r--r--drivers/gpu/drm/msm/sde/sde_hw_intf.c14
-rw-r--r--drivers/gpu/drm/msm/sde/sde_hw_intf.h2
-rw-r--r--drivers/gpu/drm/msm/sde/sde_hw_pingpong.c14
-rw-r--r--drivers/gpu/drm/msm/sde/sde_hw_pingpong.h2
-rw-r--r--drivers/gpu/msm/Makefile8
-rw-r--r--drivers/gpu/msm/adreno-gpulist.h2
-rw-r--r--drivers/gpu/msm/adreno.c7
-rw-r--r--drivers/gpu/msm/adreno_cp_parser.h23
-rw-r--r--drivers/gpu/msm/kgsl.c2
-rw-r--r--drivers/hid/hid-alps.c1
-rw-r--r--drivers/hid/wacom_wac.c8
-rw-r--r--drivers/input/keyboard/nspire-keypad.c56
-rw-r--r--drivers/input/serio/i8042-x86ia64io.h1
-rw-r--r--drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_fe_ver1.c10
-rw-r--r--drivers/media/platform/msm/camera/cam_sensor_module/cam_csiphy/include/cam_csiphy_1_2_hwreg.h253
-rw-r--r--drivers/media/platform/msm/camera/cam_sensor_module/cam_res_mgr/cam_res_mgr.c3
-rw-r--r--drivers/media/platform/msm/camera/cam_smmu/cam_smmu_api.c7
-rw-r--r--drivers/net/ethernet/amd/pcnet32.c5
-rw-r--r--drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h2
-rw-r--r--drivers/net/ethernet/davicom/dm9000.c6
-rw-r--r--drivers/net/ethernet/ibm/ibmvnic.c14
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c6
-rw-r--r--drivers/net/geneve.c6
-rw-r--r--drivers/net/usb/hso.c35
-rw-r--r--drivers/net/wireless/virt_wifi.c5
-rw-r--r--drivers/net/xen-netback/xenbus.c12
-rw-r--r--drivers/pinctrl/intel/pinctrl-lewisburg.c6
-rw-r--r--drivers/platform/msm/ipa/ipa_v3/ipa.c9
-rw-r--r--drivers/platform/msm/ipa/ipa_v3/ipa_i.h2
-rw-r--r--drivers/platform/msm/ipa/ipa_v3/ipa_pm.c17
-rw-r--r--drivers/platform/msm/ipa/ipa_v3/ipa_utils.c29
-rw-r--r--drivers/scsi/libsas/sas_ata.c9
-rw-r--r--drivers/scsi/scsi_transport_srp.c2
-rw-r--r--drivers/soc/qcom/pil-q6v5-mss.c8
-rw-r--r--drivers/staging/fw-api/fw/htt.h483
-rwxr-xr-xdrivers/staging/fw-api/fw/wlan_defs.h22
-rw-r--r--drivers/staging/fw-api/fw/wlan_module_ids.h1
-rw-r--r--drivers/staging/fw-api/fw/wmi_services.h2
-rw-r--r--drivers/staging/fw-api/fw/wmi_tlv_defs.h56
-rw-r--r--drivers/staging/fw-api/fw/wmi_unified.h212
-rw-r--r--drivers/staging/fw-api/fw/wmi_version.h2
-rw-r--r--drivers/staging/qca-wifi-host-cmn/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c6
-rw-r--r--drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h11
-rw-r--r--drivers/staging/qcacld-3.0/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c10
-rw-r--r--drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c9
-rw-r--r--drivers/staging/qcacld-3.0/core/mac/inc/ani_system_defs.h2
-rw-r--r--drivers/staging/qcacld-3.0/core/mac/inc/qwlan_version.h4
-rw-r--r--drivers/staging/qcacld-3.0/core/mac/inc/sir_api.h1
-rw-r--r--drivers/staging/qcacld-3.0/core/mac/src/include/parser_api.h14
-rw-r--r--drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_message_queue.c6
-rw-r--r--drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_send_management_frames.c2
-rw-r--r--drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_utils.c4
-rw-r--r--drivers/staging/qcacld-3.0/core/mac/src/sys/legacy/src/utils/src/parser_api.c25
-rw-r--r--drivers/staging/qcacld-3.0/core/sme/src/csr/csr_api_roam.c7
-rw-r--r--drivers/staging/qcacld-3.0/core/wma/src/wma_scan_roam.c9
-rw-r--r--drivers/usb/class/cdc-acm.c3
-rw-r--r--drivers/usb/gadget/function/u_bam_dmux.c5
-rw-r--r--drivers/usb/usbip/vudc_sysfs.c2
-rw-r--r--fs/dcache.c2
-rw-r--r--fs/f2fs/segment.h2
-rw-r--r--fs/namespace.c6
-rw-r--r--fs/readdir.c6
-rw-r--r--include/linux/blkdev.h5
-rw-r--r--include/linux/cgroup_subsys.h2
-rw-r--r--include/linux/cpufreq.h11
-rw-r--r--include/linux/cpuhotplug.h1
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/sched.h6
-rw-r--r--include/linux/sched/cpufreq.h3
-rw-r--r--include/linux/sched/rt.h4
-rw-r--r--include/linux/sync_file.h9
-rw-r--r--include/uapi/linux/android/binder.h21
-rw-r--r--init/Kconfig7
-rw-r--r--kernel/cgroup/cpuset.c53
-rw-r--r--kernel/fork.c2
-rw-r--r--kernel/locking/mutex.c25
-rw-r--r--kernel/locking/rwsem-xadd.c26
-rw-r--r--kernel/sched/Makefile1
-rw-r--r--kernel/sched/core.c59
-rw-r--r--kernel/sched/cpufreq.c17
-rw-r--r--kernel/sched/cpufreq_schedutil.c8
-rw-r--r--kernel/sched/fair.c7
-rw-r--r--kernel/sched/idle.c3
-rw-r--r--kernel/sched/tune_dummy.c122
-rw-r--r--kernel/time/tick-sched.c2
-rw-r--r--mm/gup.c44
-rw-r--r--mm/huge_memory.c7
-rw-r--r--net/core/neighbour.c2
-rw-r--r--net/ieee802154/nl802154.c29
-rw-r--r--net/ipv6/sit.c4
-rw-r--r--net/mac80211/cfg.c4
-rw-r--r--net/netfilter/nf_conntrack_standalone.c1
-rw-r--r--net/netfilter/nft_limit.c4
-rw-r--r--net/qrtr/qrtr.c9
-rw-r--r--net/sctp/socket.c13
-rw-r--r--sound/soc/fsl/fsl_esai.c8
-rw-r--r--techpack/audio/4.0/dsp/q6afe.c6
-rw-r--r--techpack/audio/asoc/msm-pcm-routing-v2.c15
-rw-r--r--techpack/audio/dsp/q6afe.c6
-rw-r--r--tools/arch/ia64/include/asm/barrier.h3
137 files changed, 1937 insertions, 904 deletions
diff --git a/Makefile b/Makefile
index 5c98f4ee5572..be7749d3fadc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 14
-SUBLEVEL = 231
+SUBLEVEL = 232
EXTRAVERSION =
NAME = Petit Gorille
@@ -1018,8 +1018,7 @@ KBUILD_AFLAGS += $(ARCH_AFLAGS) $(KAFLAGS)
KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS)
# Use --build-id when available.
-LDFLAGS_BUILD_ID := $(patsubst -Wl$(comma)%,%,\
- $(call cc-ldoption, -Wl$(comma)--build-id,))
+LDFLAGS_BUILD_ID := $(call ld-option, --build-id)
KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
diff --git a/arch/arc/kernel/signal.c b/arch/arc/kernel/signal.c
index 48685445002e..da243420bcb5 100644
--- a/arch/arc/kernel/signal.c
+++ b/arch/arc/kernel/signal.c
@@ -99,7 +99,7 @@ stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs,
sizeof(sf->uc.uc_mcontext.regs.scratch));
err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(sigset_t));
- return err;
+ return err ? -EFAULT : 0;
}
static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf)
@@ -113,7 +113,7 @@ static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf)
&(sf->uc.uc_mcontext.regs.scratch),
sizeof(sf->uc.uc_mcontext.regs.scratch));
if (err)
- return err;
+ return -EFAULT;
set_current_blocked(&set);
regs->bta = uregs.scratch.bta;
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index bdaf30c8c405..21eef1679d08 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -23,6 +23,9 @@
i2c0 = &i2c1;
i2c1 = &i2c2;
i2c2 = &i2c3;
+ mmc0 = &mmc1;
+ mmc1 = &mmc2;
+ mmc2 = &mmc3;
serial0 = &uart1;
serial1 = &uart2;
serial2 = &uart3;
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 28d10abd8b04..09129365c0e1 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -22,6 +22,11 @@
i2c1 = &i2c2;
i2c2 = &i2c3;
i2c3 = &i2c4;
+ mmc0 = &mmc1;
+ mmc1 = &mmc2;
+ mmc2 = &mmc3;
+ mmc3 = &mmc4;
+ mmc4 = &mmc5;
serial0 = &uart1;
serial1 = &uart2;
serial2 = &uart3;
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index bc3f53c79e9d..9786baf7f9c4 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -25,6 +25,11 @@
i2c2 = &i2c3;
i2c3 = &i2c4;
i2c4 = &i2c5;
+ mmc0 = &mmc1;
+ mmc1 = &mmc2;
+ mmc2 = &mmc3;
+ mmc3 = &mmc4;
+ mmc4 = &mmc5;
serial0 = &uart1;
serial1 = &uart2;
serial2 = &uart3;
diff --git a/arch/arm/mach-footbridge/cats-pci.c b/arch/arm/mach-footbridge/cats-pci.c
index 0b2fd7e2e9b4..90b1e9be430e 100644
--- a/arch/arm/mach-footbridge/cats-pci.c
+++ b/arch/arm/mach-footbridge/cats-pci.c
@@ -15,14 +15,14 @@
#include <asm/mach-types.h>
/* cats host-specific stuff */
-static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 };
+static int irqmap_cats[] = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 };
static u8 cats_no_swizzle(struct pci_dev *dev, u8 *pin)
{
return 0;
}
-static int __init cats_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
+static int cats_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
if (dev->irq >= 255)
return -1; /* not a valid interrupt. */
diff --git a/arch/arm/mach-footbridge/ebsa285-pci.c b/arch/arm/mach-footbridge/ebsa285-pci.c
index 6f28aaa9ca79..c3f280d08fa7 100644
--- a/arch/arm/mach-footbridge/ebsa285-pci.c
+++ b/arch/arm/mach-footbridge/ebsa285-pci.c
@@ -14,9 +14,9 @@
#include <asm/mach/pci.h>
#include <asm/mach-types.h>
-static int irqmap_ebsa285[] __initdata = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI };
+static int irqmap_ebsa285[] = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI };
-static int __init ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
+static int ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
if (dev->vendor == PCI_VENDOR_ID_CONTAQ &&
dev->device == PCI_DEVICE_ID_CONTAQ_82C693)
diff --git a/arch/arm/mach-footbridge/netwinder-pci.c b/arch/arm/mach-footbridge/netwinder-pci.c
index 9473aa0305e5..e8304392074b 100644
--- a/arch/arm/mach-footbridge/netwinder-pci.c
+++ b/arch/arm/mach-footbridge/netwinder-pci.c
@@ -18,7 +18,7 @@
* We now use the slot ID instead of the device identifiers to select
* which interrupt is routed where.
*/
-static int __init netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
+static int netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
switch (slot) {
case 0: /* host bridge */
diff --git a/arch/arm/mach-footbridge/personal-pci.c b/arch/arm/mach-footbridge/personal-pci.c
index 4391e433a4b2..9d19aa98a663 100644
--- a/arch/arm/mach-footbridge/personal-pci.c
+++ b/arch/arm/mach-footbridge/personal-pci.c
@@ -14,13 +14,12 @@
#include <asm/mach/pci.h>
#include <asm/mach-types.h>
-static int irqmap_personal_server[] __initdata = {
+static int irqmap_personal_server[] = {
IRQ_IN0, IRQ_IN1, IRQ_IN2, IRQ_IN3, 0, 0, 0,
IRQ_DOORBELLHOST, IRQ_DMA1, IRQ_DMA2, IRQ_PCI
};
-static int __init personal_server_map_irq(const struct pci_dev *dev, u8 slot,
- u8 pin)
+static int personal_server_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
unsigned char line;
diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c
index 84613abf35a3..79ff5b953431 100644
--- a/arch/arm/mach-keystone/keystone.c
+++ b/arch/arm/mach-keystone/keystone.c
@@ -65,7 +65,7 @@ static void __init keystone_init(void)
static long long __init keystone_pv_fixup(void)
{
long long offset;
- phys_addr_t mem_start, mem_end;
+ u64 mem_start, mem_end;
mem_start = memblock_start_of_DRAM();
mem_end = memblock_end_of_DRAM();
@@ -78,7 +78,7 @@ static long long __init keystone_pv_fixup(void)
if (mem_start < KEYSTONE_HIGH_PHYS_START ||
mem_end > KEYSTONE_HIGH_PHYS_END) {
pr_crit("Invalid address space for memory (%08llx-%08llx)\n",
- (u64)mem_start, (u64)mem_end);
+ mem_start, mem_end);
return 0;
}
diff --git a/arch/arm/probes/uprobes/core.c b/arch/arm/probes/uprobes/core.c
index d1329f1ba4e4..b97230704b74 100644
--- a/arch/arm/probes/uprobes/core.c
+++ b/arch/arm/probes/uprobes/core.c
@@ -207,7 +207,7 @@ unsigned long uprobe_get_swbp_addr(struct pt_regs *regs)
static struct undef_hook uprobes_arm_break_hook = {
.instr_mask = 0x0fffffff,
.instr_val = (UPROBE_SWBP_ARM_INSN & 0x0fffffff),
- .cpsr_mask = MODE_MASK,
+ .cpsr_mask = (PSR_T_BIT | MODE_MASK),
.cpsr_val = USR_MODE,
.fn = uprobe_trap_handler,
};
@@ -215,7 +215,7 @@ static struct undef_hook uprobes_arm_break_hook = {
static struct undef_hook uprobes_arm_ss_hook = {
.instr_mask = 0x0fffffff,
.instr_val = (UPROBE_SS_ARM_INSN & 0x0fffffff),
- .cpsr_mask = MODE_MASK,
+ .cpsr_mask = (PSR_T_BIT | MODE_MASK),
.cpsr_val = USR_MODE,
.fn = uprobe_trap_handler,
};
diff --git a/arch/arm64/boot/dts/qcom/sdmmagpie.dtsi b/arch/arm64/boot/dts/qcom/sdmmagpie.dtsi
index 0ed90a2e57dc..c352013b416d 100644
--- a/arch/arm64/boot/dts/qcom/sdmmagpie.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdmmagpie.dtsi
@@ -460,7 +460,7 @@
};
chosen {
- bootargs = "rcupdate.rcu_expedited=1 rcu_nocbs=0-7";
+ bootargs = "rcu_nocbs=0-7";
};
soc: soc { };
@@ -1760,7 +1760,7 @@
msm_cdsp_rm: qcom,msm_cdsp_rm {
compatible = "qcom,msm-cdsp-rm";
- qcom,qos-latency-us = <44>;
+ qcom,qos-latency-us = <67>;
qcom,qos-maxhold-ms = <20>;
qcom,compute-cx-limit-en;
qcom,compute-priority-mode = <2>;
diff --git a/arch/arm64/configs/davinci_defconfig b/arch/arm64/configs/davinci_defconfig
index 6f056f8ae290..eef7b743b596 100644
--- a/arch/arm64/configs/davinci_defconfig
+++ b/arch/arm64/configs/davinci_defconfig
@@ -33,6 +33,7 @@ CONFIG_CGROUP_BPF=y
CONFIG_NAMESPACES=y
# CONFIG_PID_NS is not set
# CONFIG_SCHED_TUNE is not set
+CONFIG_SCHED_TUNE_DUMMY=y
CONFIG_DEFAULT_USE_ENERGY_AWARE=y
CONFIG_BLK_DEV_INITRD=y
# CONFIG_RD_XZ is not set
diff --git a/arch/arm64/configs/phoenix_defconfig b/arch/arm64/configs/phoenix_defconfig
index 7f47e439675e..3b72dd890b71 100644
--- a/arch/arm64/configs/phoenix_defconfig
+++ b/arch/arm64/configs/phoenix_defconfig
@@ -33,6 +33,7 @@ CONFIG_CGROUP_BPF=y
CONFIG_NAMESPACES=y
# CONFIG_PID_NS is not set
# CONFIG_SCHED_TUNE is not set
+CONFIG_SCHED_TUNE_DUMMY=y
CONFIG_DEFAULT_USE_ENERGY_AWARE=y
CONFIG_BLK_DEV_INITRD=y
# CONFIG_RD_XZ is not set
diff --git a/arch/arm64/configs/toco_defconfig b/arch/arm64/configs/toco_defconfig
index c9b396fbea07..4b3883de0eae 100644
--- a/arch/arm64/configs/toco_defconfig
+++ b/arch/arm64/configs/toco_defconfig
@@ -33,6 +33,7 @@ CONFIG_CGROUP_BPF=y
CONFIG_NAMESPACES=y
# CONFIG_PID_NS is not set
# CONFIG_SCHED_TUNE is not set
+CONFIG_SCHED_TUNE_DUMMY=y
CONFIG_DEFAULT_USE_ENERGY_AWARE=y
CONFIG_BLK_DEV_INITRD=y
# CONFIG_RD_XZ is not set
diff --git a/arch/arm64/configs/tucana_defconfig b/arch/arm64/configs/tucana_defconfig
index a19ca407502a..396a013f7f75 100644
--- a/arch/arm64/configs/tucana_defconfig
+++ b/arch/arm64/configs/tucana_defconfig
@@ -33,6 +33,7 @@ CONFIG_CGROUP_BPF=y
CONFIG_NAMESPACES=y
# CONFIG_PID_NS is not set
# CONFIG_SCHED_TUNE is not set
+CONFIG_SCHED_TUNE_DUMMY=y
CONFIG_DEFAULT_USE_ENERGY_AWARE=y
CONFIG_BLK_DEV_INITRD=y
# CONFIG_RD_XZ is not set
diff --git a/arch/arm64/include/asm/word-at-a-time.h b/arch/arm64/include/asm/word-at-a-time.h
index b0d708ff7f4e..a2601c1ccf43 100644
--- a/arch/arm64/include/asm/word-at-a-time.h
+++ b/arch/arm64/include/asm/word-at-a-time.h
@@ -64,7 +64,7 @@ static inline unsigned long find_zero(unsigned long mask)
*/
static inline unsigned long load_unaligned_zeropad(const void *addr)
{
- unsigned long ret, offset;
+ unsigned long ret, tmp;
/* Load word from unaligned pointer addr */
asm(
@@ -72,9 +72,9 @@ static inline unsigned long load_unaligned_zeropad(const void *addr)
"2:\n"
" .pushsection .fixup,\"ax\"\n"
" .align 2\n"
- "3: and %1, %2, #0x7\n"
- " bic %2, %2, #0x7\n"
- " ldr %0, [%2]\n"
+ "3: bic %1, %2, #0x7\n"
+ " ldr %0, [%1]\n"
+ " and %1, %2, #0x7\n"
" lsl %1, %1, #0x3\n"
#ifndef __AARCH64EB__
" lsr %0, %0, %1\n"
@@ -84,7 +84,7 @@ static inline unsigned long load_unaligned_zeropad(const void *addr)
" b 2b\n"
" .popsection\n"
_ASM_EXTABLE(1b, 3b)
- : "=&r" (ret), "=&r" (offset)
+ : "=&r" (ret), "=&r" (tmp)
: "r" (addr), "Q" (*(unsigned long *)addr));
return ret;
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index 9b2d994cddf6..99b59a7ec187 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -100,7 +100,7 @@ static int __init build_node_maps(unsigned long start, unsigned long len,
* acpi_boot_init() (which builds the node_to_cpu_mask array) hasn't been
* called yet. Note that node 0 will also count all non-existent cpus.
*/
-static int __meminit early_nr_cpus_node(int node)
+static int early_nr_cpus_node(int node)
{
int cpu, n = 0;
@@ -115,7 +115,7 @@ static int __meminit early_nr_cpus_node(int node)
* compute_pernodesize - compute size of pernode data
* @node: the node id.
*/
-static unsigned long __meminit compute_pernodesize(int node)
+static unsigned long compute_pernodesize(int node)
{
unsigned long pernodesize = 0, cpus;
@@ -412,7 +412,7 @@ static void __init reserve_pernode_space(void)
}
}
-static void __meminit scatter_node_data(void)
+static void scatter_node_data(void)
{
pg_data_t **dst;
int node;
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index e928c2af6a10..dd470f45c4b9 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -967,6 +967,7 @@ ENTRY(ext_int_handler)
* Load idle PSW. The second "half" of this function is in .Lcleanup_idle.
*/
ENTRY(psw_idle)
+ stg %r14,(__SF_GPRS+8*8)(%r15)
stg %r3,__SF_EMPTY(%r15)
larl %r1,.Lpsw_idle_lpsw+4
stg %r1,__SF_EMPTY+8(%r15)
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index 44404e2307bb..ce5f8e25f70d 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -23,6 +23,7 @@
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
+#include <linux/overflow.h>
#include <asm/processor.h>
#include <asm/hardirq.h>
@@ -565,7 +566,7 @@ int crash_setup_memmap_entries(struct kimage *image, struct boot_params *params)
struct crash_memmap_data cmd;
struct crash_mem *cmem;
- cmem = vzalloc(sizeof(struct crash_mem));
+ cmem = vzalloc(struct_size(cmem, ranges, 1));
if (!cmem)
return -ENOMEM;
diff --git a/block/Makefile b/block/Makefile
index ab14055d8222..5da7f6e5e5f4 100644
--- a/block/Makefile
+++ b/block/Makefile
@@ -10,6 +10,7 @@ obj-$(CONFIG_BLOCK) := bio.o elevator.o blk-core.o blk-tag.o blk-sysfs.o \
blk-mq-sysfs.o blk-mq-cpumap.o blk-mq-sched.o ioctl.o \
genhd.o partition-generic.o ioprio.o \
badblocks.o partitions/
+CFLAGS_blk-mq.o := $(call cc-disable-warning, align-mismatch)
obj-$(CONFIG_BOUNCE) += bounce.o
obj-$(CONFIG_BLK_SCSI_REQUEST) += scsi_ioctl.o
@@ -37,4 +38,4 @@ obj-$(CONFIG_BLK_DEBUG_FS) += blk-mq-debugfs.o
obj-$(CONFIG_BLK_SED_OPAL) += sed-opal.o
obj-$(CONFIG_BLK_INLINE_ENCRYPTION) += keyslot-manager.o bio-crypt-ctx.o \
blk-crypto.o
-obj-$(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) += blk-crypto-fallback.o \ No newline at end of file
+obj-$(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) += blk-crypto-fallback.o
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index afb4675d65f3..632308c48bf7 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -459,9 +459,19 @@ struct binder_priority {
* (protected by binder_deferred_lock)
* @deferred_work: bitmap of deferred work to perform
* (protected by binder_deferred_lock)
+ * @outstanding_txns: number of transactions to be transmitted before
+ * processes in freeze_wait are woken up
+ * (protected by @inner_lock)
* @is_dead: process is dead and awaiting free
* when outstanding transactions are cleaned up
* (protected by @inner_lock)
+ * @sync_recv: process received sync transactions since last frozen
+ * (protected by @inner_lock)
+ * @async_recv: process received async transactions since last frozen
+ * (protected by @inner_lock)
+ * @freeze_wait: waitqueue of processes waiting for all outstanding
+ * transactions to be processed
+ * (protected by @inner_lock)
* @todo: list of work for this process
* (protected by @inner_lock)
* @stats: per-process binder statistics
@@ -505,7 +515,12 @@ struct binder_proc {
struct mutex files_lock;
struct hlist_node deferred_work_node;
int deferred_work;
+ int outstanding_txns;
bool is_dead;
+ bool is_frozen;
+ bool sync_recv;
+ bool async_recv;
+ wait_queue_head_t freeze_wait;
struct list_head todo;
struct binder_stats stats;
@@ -2076,6 +2091,10 @@ static void binder_free_transaction(struct binder_transaction *t)
spin_unlock(&t->lock);
binder_inner_proc_lock(target_proc);
+ target_proc->outstanding_txns--;
+ BUG_ON(target_proc->outstanding_txns < 0);
+ if (!target_proc->outstanding_txns && target_proc->is_frozen)
+ wake_up_interruptible_all(&target_proc->freeze_wait);
if (t->buffer)
t->buffer->transaction = NULL;
binder_inner_proc_unlock(target_proc);
@@ -2829,10 +2848,11 @@ static int binder_fixup_parent(struct binder_transaction *t,
* If the @thread parameter is not NULL, the transaction is always queued
* to the waitlist of that specific thread.
*
- * Return: true if the transactions was successfully queued
- * false if the target process or thread is dead
+ * Return: 0 if the transaction was successfully queued
+ * BR_DEAD_REPLY if the target process or thread is dead
+ * BR_FROZEN_REPLY if the target process or thread is frozen
*/
-static bool binder_proc_transaction(struct binder_transaction *t,
+static int binder_proc_transaction(struct binder_transaction *t,
struct binder_proc *proc,
struct binder_thread *thread)
{
@@ -2856,11 +2876,18 @@ static bool binder_proc_transaction(struct binder_transaction *t,
}
binder_inner_proc_lock(proc);
+ if (proc->is_frozen) {
+ proc->sync_recv |= !oneway;
+ proc->async_recv |= oneway;
+ }
- if (proc->is_dead || (thread && thread->is_dead)) {
+ if ((proc->is_frozen && !oneway) || proc->is_dead ||
+ (thread && thread->is_dead)) {
+ bool proc_is_dead = proc->is_dead
+ || (thread && thread->is_dead);
binder_inner_proc_unlock(proc);
binder_node_unlock(node);
- return false;
+ return proc_is_dead ? BR_DEAD_REPLY : BR_FROZEN_REPLY;
}
if (!thread && !pending_async)
@@ -2879,10 +2906,11 @@ static bool binder_proc_transaction(struct binder_transaction *t,
if (!pending_async)
binder_wakeup_thread_ilocked(proc, thread, !oneway /* sync */);
+ proc->outstanding_txns++;
binder_inner_proc_unlock(proc);
binder_node_unlock(node);
- return true;
+ return 0;
}
/**
@@ -3203,7 +3231,7 @@ static void binder_transaction(struct binder_proc *proc,
t->buffer = binder_alloc_new_buf(&target_proc->alloc, tr->data_size,
tr->offsets_size, extra_buffers_size,
- !reply && (t->flags & TF_ONE_WAY));
+ !reply && (t->flags & TF_ONE_WAY), current->tgid);
if (IS_ERR(t->buffer)) {
/*
* -ESRCH indicates VMA cleared. The target is dying.
@@ -3231,6 +3259,7 @@ static void binder_transaction(struct binder_proc *proc,
t->buffer->debug_id = t->debug_id;
t->buffer->transaction = t;
t->buffer->target_node = target_node;
+ t->buffer->clear_on_free = !!(t->flags & TF_CLEAR_BUF);
trace_binder_transaction_alloc_buf(t->buffer);
if (binder_alloc_copy_user_to_buffer(
@@ -3476,13 +3505,16 @@ static void binder_transaction(struct binder_proc *proc,
if (reply) {
binder_enqueue_thread_work(thread, tcomplete);
binder_inner_proc_lock(target_proc);
- if (target_thread->is_dead) {
+ if (target_thread->is_dead || target_proc->is_frozen) {
+ return_error = target_thread->is_dead ?
+ BR_DEAD_REPLY : BR_FROZEN_REPLY;
binder_inner_proc_unlock(target_proc);
goto err_dead_proc_or_thread;
}
BUG_ON(t->buffer->async_transaction != 0);
binder_pop_transaction_ilocked(target_thread, in_reply_to);
binder_enqueue_thread_work_ilocked(target_thread, &t->work);
+ target_proc->outstanding_txns++;
binder_inner_proc_unlock(target_proc);
wake_up_interruptible_sync(&target_thread->wait);
binder_restore_priority(current, in_reply_to->saved_priority);
@@ -3502,7 +3534,9 @@ static void binder_transaction(struct binder_proc *proc,
t->from_parent = thread->transaction_stack;
thread->transaction_stack = t;
binder_inner_proc_unlock(proc);
- if (!binder_proc_transaction(t, target_proc, target_thread)) {
+ return_error = binder_proc_transaction(t,
+ target_proc, target_thread);
+ if (return_error) {
binder_inner_proc_lock(proc);
binder_pop_transaction_ilocked(thread, t);
binder_inner_proc_unlock(proc);
@@ -3512,7 +3546,8 @@ static void binder_transaction(struct binder_proc *proc,
BUG_ON(target_node == NULL);
BUG_ON(t->buffer->async_transaction != 1);
binder_enqueue_thread_work(thread, tcomplete);
- if (!binder_proc_transaction(t, target_proc, NULL))
+ return_error = binder_proc_transaction(t, target_proc, NULL);
+ if (return_error)
goto err_dead_proc_or_thread;
}
if (target_thread)
@@ -3529,7 +3564,6 @@ static void binder_transaction(struct binder_proc *proc,
return;
err_dead_proc_or_thread:
- return_error = BR_DEAD_REPLY;
return_error_line = __LINE__;
binder_dequeue_work(proc, tcomplete);
err_translate_failed:
@@ -4134,7 +4168,7 @@ static int binder_wait_for_work(struct binder_thread *thread,
binder_inner_proc_lock(proc);
list_del_init(&thread->waiting_thread_node);
if (signal_pending(current)) {
- ret = -ERESTARTSYS;
+ ret = -EINTR;
break;
}
}
@@ -4638,6 +4672,7 @@ static void binder_free_proc(struct binder_proc *proc)
BUG_ON(!list_empty(&proc->todo));
BUG_ON(!list_empty(&proc->delivered_death));
+ WARN_ON(proc->outstanding_txns);
device = container_of(proc->context, struct binder_device, context);
if (refcount_dec_and_test(&device->ref)) {
kfree(proc->context->name);
@@ -4698,6 +4733,7 @@ static int binder_thread_release(struct binder_proc *proc,
(t->to_thread == thread) ? "in" : "out");
if (t->to_thread == thread) {
+ t->to_proc->outstanding_txns--;
t->to_proc = NULL;
t->to_thread = NULL;
if (t->buffer) {
@@ -4944,6 +4980,76 @@ static int binder_ioctl_get_node_debug_info(struct binder_proc *proc,
return 0;
}
+static int binder_ioctl_freeze(struct binder_freeze_info *info,
+ struct binder_proc *target_proc)
+{
+ int ret = 0;
+
+ if (!info->enable) {
+ binder_inner_proc_lock(target_proc);
+ target_proc->sync_recv = false;
+ target_proc->async_recv = false;
+ target_proc->is_frozen = false;
+ binder_inner_proc_unlock(target_proc);
+ return 0;
+ }
+
+ /*
+ * Freezing the target. Prevent new transactions by
+ * setting frozen state. If timeout specified, wait
+ * for transactions to drain.
+ */
+ binder_inner_proc_lock(target_proc);
+ target_proc->sync_recv = false;
+ target_proc->async_recv = false;
+ target_proc->is_frozen = true;
+ binder_inner_proc_unlock(target_proc);
+
+ if (info->timeout_ms > 0)
+ ret = wait_event_interruptible_timeout(
+ target_proc->freeze_wait,
+ (!target_proc->outstanding_txns),
+ msecs_to_jiffies(info->timeout_ms));
+
+ if (!ret && target_proc->outstanding_txns)
+ ret = -EAGAIN;
+
+ if (ret < 0) {
+ binder_inner_proc_lock(target_proc);
+ target_proc->is_frozen = false;
+ binder_inner_proc_unlock(target_proc);
+ }
+
+ return ret;
+}
+
+static int binder_ioctl_get_freezer_info(
+ struct binder_frozen_status_info *info)
+{
+ struct binder_proc *target_proc;
+ bool found = false;
+
+ info->sync_recv = 0;
+ info->async_recv = 0;
+
+ mutex_lock(&binder_procs_lock);
+ hlist_for_each_entry(target_proc, &binder_procs, proc_node) {
+ if (target_proc->pid == info->pid) {
+ found = true;
+ binder_inner_proc_lock(target_proc);
+ info->sync_recv |= target_proc->sync_recv;
+ info->async_recv |= target_proc->async_recv;
+ binder_inner_proc_unlock(target_proc);
+ }
+ }
+ mutex_unlock(&binder_procs_lock);
+
+ if (!found)
+ return -EINVAL;
+
+ return 0;
+}
+
static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
int ret;
@@ -5062,6 +5168,84 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
}
break;
}
+ case BINDER_FREEZE: {
+ struct binder_freeze_info info;
+ struct binder_proc **target_procs = NULL, *target_proc;
+ int target_procs_count = 0, i = 0;
+
+ ret = 0;
+
+ if (copy_from_user(&info, ubuf, sizeof(info))) {
+ ret = -EFAULT;
+ goto err;
+ }
+
+ mutex_lock(&binder_procs_lock);
+ hlist_for_each_entry(target_proc, &binder_procs, proc_node) {
+ if (target_proc->pid == info.pid)
+ target_procs_count++;
+ }
+
+ if (target_procs_count == 0) {
+ mutex_unlock(&binder_procs_lock);
+ ret = -EINVAL;
+ goto err;
+ }
+
+ target_procs = kmalloc(sizeof(struct binder_proc *) *
+ target_procs_count,
+ GFP_KERNEL);
+
+ if (!target_procs) {
+ mutex_unlock(&binder_procs_lock);
+ ret = -ENOMEM;
+ goto err;
+ }
+
+ hlist_for_each_entry(target_proc, &binder_procs, proc_node) {
+ if (target_proc->pid != info.pid)
+ continue;
+
+ binder_inner_proc_lock(target_proc);
+ atomic_inc(&target_proc->tmp_ref);
+ binder_inner_proc_unlock(target_proc);
+
+ target_procs[i++] = target_proc;
+ }
+ mutex_unlock(&binder_procs_lock);
+
+ for (i = 0; i < target_procs_count; i++) {
+ if (ret >= 0)
+ ret = binder_ioctl_freeze(&info,
+ target_procs[i]);
+
+ binder_proc_dec_tmpref(target_procs[i]);
+ }
+
+ kfree(target_procs);
+
+ if (ret < 0)
+ goto err;
+ break;
+ }
+ case BINDER_GET_FROZEN_INFO: {
+ struct binder_frozen_status_info info;
+
+ if (copy_from_user(&info, ubuf, sizeof(info))) {
+ ret = -EFAULT;
+ goto err;
+ }
+
+ ret = binder_ioctl_get_freezer_info(&info);
+ if (ret < 0)
+ goto err;
+
+ if (copy_to_user(ubuf, &info, sizeof(info))) {
+ ret = -EFAULT;
+ goto err;
+ }
+ break;
+ }
default:
ret = -EINVAL;
goto err;
@@ -5176,6 +5360,7 @@ static int binder_open(struct inode *nodp, struct file *filp)
proc->tsk = current->group_leader;
mutex_init(&proc->files_lock);
INIT_LIST_HEAD(&proc->todo);
+ init_waitqueue_head(&proc->freeze_wait);
if (binder_supported_policy(current->policy)) {
proc->default_priority.sched_policy = current->policy;
proc->default_priority.prio = current->normal_prio;
@@ -5397,6 +5582,9 @@ static void binder_deferred_release(struct binder_proc *proc)
atomic_inc(&proc->tmp_ref);
proc->is_dead = true;
+ proc->is_frozen = false;
+ proc->sync_recv = false;
+ proc->async_recv = false;
threads = 0;
active_transactions = 0;
while ((n = rb_first(&proc->threads))) {
diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
index 1b5a131278bc..a0856e920b2b 100644
--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
@@ -38,11 +38,12 @@ struct list_lru binder_alloc_lru;
static DEFINE_MUTEX(binder_alloc_mmap_lock);
enum {
+ BINDER_DEBUG_USER_ERROR = 1U << 0,
BINDER_DEBUG_OPEN_CLOSE = 1U << 1,
BINDER_DEBUG_BUFFER_ALLOC = 1U << 2,
BINDER_DEBUG_BUFFER_ALLOC_ASYNC = 1U << 3,
};
-static uint32_t binder_alloc_debug_mask;
+static uint32_t binder_alloc_debug_mask = 0;
module_param_named(debug_mask, binder_alloc_debug_mask,
uint, 0644);
@@ -343,12 +344,50 @@ static inline struct vm_area_struct *binder_alloc_get_vma(
return vma;
}
+static void debug_low_async_space_locked(struct binder_alloc *alloc, int pid)
+{
+ /*
+ * Find the amount and size of buffers allocated by the current caller;
+ * The idea is that once we cross the threshold, whoever is responsible
+ * for the low async space is likely to try to send another async txn,
+ * and at some point we'll catch them in the act. This is more efficient
+ * than keeping a map per pid.
+ */
+ struct rb_node *n = alloc->free_buffers.rb_node;
+ struct binder_buffer *buffer;
+ size_t total_alloc_size = 0;
+ size_t num_buffers = 0;
+
+ for (n = rb_first(&alloc->allocated_buffers); n != NULL;
+ n = rb_next(n)) {
+ buffer = rb_entry(n, struct binder_buffer, rb_node);
+ if (buffer->pid != pid)
+ continue;
+ if (!buffer->async_transaction)
+ continue;
+ total_alloc_size += binder_alloc_buffer_size(alloc, buffer)
+ + sizeof(struct binder_buffer);
+ num_buffers++;
+ }
+
+ /*
+ * Warn if this pid has more than 50 transactions, or more than 50% of
+ * async space (which is 25% of total buffer size).
+ */
+ if (num_buffers > 50 || total_alloc_size > alloc->buffer_size / 4) {
+ binder_alloc_debug(BINDER_DEBUG_USER_ERROR,
+ "%d: pid %d spamming oneway? %zd buffers allocated for a total size of %zd\n",
+ alloc->pid, pid, num_buffers, total_alloc_size);
+ }
+}
+
static struct binder_buffer *binder_alloc_new_buf_locked(
struct binder_alloc *alloc,
size_t data_size,
size_t offsets_size,
size_t extra_buffers_size,
- int is_async)
+ int is_async,
+ int pid)
{
struct rb_node *n = alloc->free_buffers.rb_node;
struct binder_buffer *buffer;
@@ -487,11 +526,20 @@ static struct binder_buffer *binder_alloc_new_buf_locked(
buffer->offsets_size = offsets_size;
buffer->async_transaction = is_async;
buffer->extra_buffers_size = extra_buffers_size;
+ buffer->pid = pid;
if (is_async) {
alloc->free_async_space -= size + sizeof(struct binder_buffer);
binder_alloc_debug(BINDER_DEBUG_BUFFER_ALLOC_ASYNC,
"%d: binder_alloc_buf size %zd async free %zd\n",
alloc->pid, size, alloc->free_async_space);
+ if (alloc->free_async_space < alloc->buffer_size / 10) {
+ /*
+ * Start detecting spammers once we have less than 20%
+ * of async space left (which is less than 10% of total
+ * buffer size).
+ */
+ debug_low_async_space_locked(alloc, pid);
+ }
}
return buffer;
@@ -509,6 +557,7 @@ err_alloc_buf_struct_failed:
* @offsets_size: user specified buffer offset
* @extra_buffers_size: size of extra space for meta-data (eg, security context)
* @is_async: buffer for async transaction
+ * @pid: pid to attribute allocation to (used for debugging)
*
* Allocate a new buffer given the requested sizes. Returns
* the kernel version of the buffer pointer. The size allocated
@@ -521,13 +570,14 @@ struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc,
size_t data_size,
size_t offsets_size,
size_t extra_buffers_size,
- int is_async)
+ int is_async,
+ int pid)
{
struct binder_buffer *buffer;
mutex_lock(&alloc->mutex);
buffer = binder_alloc_new_buf_locked(alloc, data_size, offsets_size,
- extra_buffers_size, is_async);
+ extra_buffers_size, is_async, pid);
mutex_unlock(&alloc->mutex);
return buffer;
}
@@ -647,6 +697,8 @@ static void binder_free_buf_locked(struct binder_alloc *alloc,
binder_insert_free_buffer(alloc, buffer);
}
+static void binder_alloc_clear_buf(struct binder_alloc *alloc,
+ struct binder_buffer *buffer);
/**
* binder_alloc_free_buf() - free a binder buffer
* @alloc: binder_alloc for this proc
@@ -657,6 +709,18 @@ static void binder_free_buf_locked(struct binder_alloc *alloc,
void binder_alloc_free_buf(struct binder_alloc *alloc,
struct binder_buffer *buffer)
{
+ /*
+ * We could eliminate the call to binder_alloc_clear_buf()
+ * from binder_alloc_deferred_release() by moving this to
+ * binder_alloc_free_buf_locked(). However, that could
+ * increase contention for the alloc mutex if clear_on_free
+ * is used frequently for large buffers. The mutex is not
+ * needed for correctness here.
+ */
+ if (buffer->clear_on_free) {
+ binder_alloc_clear_buf(alloc, buffer);
+ buffer->clear_on_free = false;
+ }
mutex_lock(&alloc->mutex);
binder_free_buf_locked(alloc, buffer);
mutex_unlock(&alloc->mutex);
@@ -749,6 +813,10 @@ void binder_alloc_deferred_release(struct binder_alloc *alloc)
/* Transaction should already have been freed */
BUG_ON(buffer->transaction);
+ if (buffer->clear_on_free) {
+ binder_alloc_clear_buf(alloc, buffer);
+ buffer->clear_on_free = false;
+ }
binder_free_buf_locked(alloc, buffer);
buffers++;
}
@@ -1076,6 +1144,36 @@ static struct page *binder_alloc_get_page(struct binder_alloc *alloc,
}
/**
+ * binder_alloc_clear_buf() - zero out buffer
+ * @alloc: binder_alloc for this proc
+ * @buffer: binder buffer to be cleared
+ *
+ * memset the given buffer to 0
+ */
+static void binder_alloc_clear_buf(struct binder_alloc *alloc,
+ struct binder_buffer *buffer)
+{
+ size_t bytes = binder_alloc_buffer_size(alloc, buffer);
+ binder_size_t buffer_offset = 0;
+
+ while (bytes) {
+ unsigned long size;
+ struct page *page;
+ pgoff_t pgoff;
+ void *kptr;
+
+ page = binder_alloc_get_page(alloc, buffer,
+ buffer_offset, &pgoff);
+ size = min_t(size_t, bytes, PAGE_SIZE - pgoff);
+ kptr = kmap(page) + pgoff;
+ memset(kptr, 0, size);
+ kunmap(page);
+ bytes -= size;
+ buffer_offset += size;
+ }
+}
+
+/**
* binder_alloc_copy_user_to_buffer() - copy src user to tgt user
* @alloc: binder_alloc for this proc
* @buffer: binder buffer to be accessed
diff --git a/drivers/android/binder_alloc.h b/drivers/android/binder_alloc.h
index b60d161b7a7a..fdb220eb55d1 100644
--- a/drivers/android/binder_alloc.h
+++ b/drivers/android/binder_alloc.h
@@ -32,6 +32,7 @@ struct binder_transaction;
* @entry: entry alloc->buffers
* @rb_node: node for allocated_buffers/free_buffers rb trees
* @free: %true if buffer is free
+ * @clear_on_free: %true if buffer must be zeroed after use
* @allow_user_free: %true if user is allowed to free buffer
* @async_transaction: %true if buffer is in use for an async txn
* @debug_id: unique ID for debugging
@@ -41,6 +42,7 @@ struct binder_transaction;
* @offsets_size: size of array of offsets
* @extra_buffers_size: size of space for other objects (like sg lists)
* @user_data: user pointer to base of buffer space
+ * @pid: pid to attribute the buffer to (caller)
*
* Bookkeeping structure for binder transaction buffers
*/
@@ -49,9 +51,10 @@ struct binder_buffer {
struct rb_node rb_node; /* free entry by size or allocated entry */
/* by address */
unsigned free:1;
+ unsigned clear_on_free:1;
unsigned allow_user_free:1;
unsigned async_transaction:1;
- unsigned debug_id:29;
+ unsigned debug_id:28;
struct binder_transaction *transaction;
@@ -60,6 +63,7 @@ struct binder_buffer {
size_t offsets_size;
size_t extra_buffers_size;
void __user *user_data;
+ int pid;
};
/**
@@ -126,7 +130,8 @@ extern struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc,
size_t data_size,
size_t offsets_size,
size_t extra_buffers_size,
- int is_async);
+ int is_async,
+ int pid);
extern void binder_alloc_init(struct binder_alloc *alloc);
extern int binder_alloc_shrinker_init(void);
extern void binder_alloc_vma_close(struct binder_alloc *alloc);
diff --git a/drivers/android/binder_alloc_selftest.c b/drivers/android/binder_alloc_selftest.c
index b72708918b06..c839c490fde3 100644
--- a/drivers/android/binder_alloc_selftest.c
+++ b/drivers/android/binder_alloc_selftest.c
@@ -128,7 +128,7 @@ static void binder_selftest_alloc_buf(struct binder_alloc *alloc,
int i;
for (i = 0; i < BUFFER_NUM; i++) {
- buffers[i] = binder_alloc_new_buf(alloc, sizes[i], 0, 0, 0);
+ buffers[i] = binder_alloc_new_buf(alloc, sizes[i], 0, 0, 0, 0);
if (IS_ERR(buffers[i]) ||
!check_buffer_pages_allocated(alloc, buffers[i],
sizes[i])) {
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 11027b2146bc..5a537093b9a6 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -435,6 +435,16 @@ static int cpu_uevent(struct device *dev, struct kobj_uevent_env *env)
}
#endif
+static int cpu_dev_pm_unset_is_prepared(unsigned int cpu)
+{
+ struct device *cpu_dev = get_cpu_device(cpu);
+
+ if (cpu_dev)
+ cpu_dev->power.is_prepared = false;
+
+ return 0;
+}
+
/*
* register_cpu - Setup a sysfs device for a CPU.
* @cpu - cpu->hotpluggable field set to 1 will generate a control file in
@@ -469,7 +479,9 @@ int register_cpu(struct cpu *cpu, int num)
register_cpu_under_node(num, cpu_to_node(num));
dev_pm_qos_expose_latency_limit(&cpu->dev, 0);
- return 0;
+ return cpuhp_setup_state_nocalls(CPUHP_CPUDEV_PM_PREPARE,
+ "base/cpu/dev_pm:prepare",
+ cpu_dev_pm_unset_is_prepared, NULL);
}
struct device *get_cpu_device(unsigned cpu)
diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c
index 0ce6ea7f2a0f..267cef6eda27 100644
--- a/drivers/char/adsprpc.c
+++ b/drivers/char/adsprpc.c
@@ -3393,11 +3393,15 @@ static int fastrpc_set_process_info(struct fastrpc_file *fl)
{
int err = 0, buf_size = 0;
char strpid[PID_SIZE];
+ char cur_comm[TASK_COMM_LEN];
+
+ memcpy(cur_comm, current->comm, TASK_COMM_LEN);
+ cur_comm[TASK_COMM_LEN-1] = '\0';
fl->tgid = current->tgid;
snprintf(strpid, PID_SIZE, "%d", current->pid);
if (debugfs_root) {
- buf_size = strlen(current->comm) + strlen("_")
+ buf_size = strlen(cur_comm) + strlen("_")
+ strlen(strpid) + 1;
spin_lock(&fl->hlock);
if (fl->debug_buf_alloced_attempted) {
@@ -3411,13 +3415,13 @@ static int fastrpc_set_process_info(struct fastrpc_file *fl)
err = -ENOMEM;
return err;
}
- snprintf(fl->debug_buf, UL_SIZE, "%.10s%s%d",
- current->comm, "_", current->pid);
+ snprintf(fl->debug_buf, buf_size, "%.10s%s%d",
+ cur_comm, "_", current->pid);
fl->debugfs_file = debugfs_create_file(fl->debug_buf, 0644,
debugfs_root, fl, &debugfs_fops);
if (IS_ERR_OR_NULL(fl->debugfs_file)) {
pr_warn("Error: %s: %s: failed to create debugfs file %s\n",
- current->comm, __func__, fl->debug_buf);
+ cur_comm, __func__, fl->debug_buf);
fl->debugfs_file = NULL;
kfree(fl->debug_buf);
fl->debug_buf = NULL;
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index e66ea8953792..b1ffb96bbe52 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -1302,7 +1302,8 @@ static int __init devfreq_init(void)
return PTR_ERR(devfreq_class);
}
- devfreq_wq = create_freezable_workqueue("devfreq_wq");
+ devfreq_wq = alloc_workqueue("devfreq_wq", WQ_HIGHPRI | WQ_FREEZABLE |
+ WQ_UNBOUND | WQ_MEM_RECLAIM, 1);
if (!devfreq_wq) {
class_destroy(devfreq_class);
pr_err("%s: couldn't create workqueue\n", __FILE__);
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
index bf65e634590b..3bbce058bd4b 100644
--- a/drivers/dma-buf/sync_file.c
+++ b/drivers/dma-buf/sync_file.c
@@ -124,36 +124,6 @@ struct dma_fence *sync_file_get_fence(int fd)
}
EXPORT_SYMBOL(sync_file_get_fence);
-/**
- * sync_file_get_name - get the name of the sync_file
- * @sync_file: sync_file to get the fence from
- * @buf: destination buffer to copy sync_file name into
- * @len: available size of destination buffer.
- *
- * Each sync_file may have a name assigned either by the user (when merging
- * sync_files together) or created from the fence it contains. In the latter
- * case construction of the name is deferred until use, and so requires
- * sync_file_get_name().
- *
- * Returns: a string representing the name.
- */
-char *sync_file_get_name(struct sync_file *sync_file, char *buf, int len)
-{
- if (sync_file->user_name[0]) {
- strlcpy(buf, sync_file->user_name, len);
- } else {
- struct dma_fence *fence = sync_file->fence;
-
- snprintf(buf, len, "%s-%s%llu-%d",
- fence->ops->get_driver_name(fence),
- fence->ops->get_timeline_name(fence),
- fence->context,
- fence->seqno);
- }
-
- return buf;
-}
-
static int sync_file_set_fence(struct sync_file *sync_file,
struct dma_fence **fences, int num_fences)
{
@@ -216,7 +186,7 @@ static void add_fence(struct dma_fence **fences,
* @a and @b. @a and @b remain valid, independent sync_file. Returns the
* new merged sync_file or NULL in case of error.
*/
-static struct sync_file *sync_file_merge(const char *name, struct sync_file *a,
+static struct sync_file *sync_file_merge(struct sync_file *a,
struct sync_file *b)
{
struct sync_file *sync_file;
@@ -291,7 +261,6 @@ static struct sync_file *sync_file_merge(const char *name, struct sync_file *a,
goto err;
}
- strlcpy(sync_file->user_name, name, sizeof(sync_file->user_name));
return sync_file;
err:
@@ -335,11 +304,14 @@ static long sync_file_ioctl_merge(struct sync_file *sync_file,
int err;
struct sync_file *fence2, *fence3;
struct sync_merge_data data;
+ size_t len;
if (fd < 0)
return fd;
- if (copy_from_user(&data, (void __user *)arg, sizeof(data))) {
+ arg += offsetof(typeof(data), fd2);
+ len = sizeof(data) - offsetof(typeof(data), fd2);
+ if (copy_from_user(&data.fd2, (void __user *)arg, len)) {
err = -EFAULT;
goto err_put_fd;
}
@@ -355,15 +327,14 @@ static long sync_file_ioctl_merge(struct sync_file *sync_file,
goto err_put_fd;
}
- data.name[sizeof(data.name) - 1] = '\0';
- fence3 = sync_file_merge(data.name, sync_file, fence2);
+ fence3 = sync_file_merge(sync_file, fence2);
if (!fence3) {
err = -ENOMEM;
goto err_put_fence2;
}
data.fence = fd;
- if (copy_to_user((void __user *)arg, &data, sizeof(data))) {
+ if (copy_to_user((void __user *)arg, &data.fd2, len)) {
err = -EFAULT;
goto err_put_fence3;
}
@@ -386,11 +357,6 @@ err_put_fd:
static int sync_fill_fence_info(struct dma_fence *fence,
struct sync_fence_info *info)
{
- strlcpy(info->obj_name, fence->ops->get_timeline_name(fence),
- sizeof(info->obj_name));
- strlcpy(info->driver_name, fence->ops->get_driver_name(fence),
- sizeof(info->driver_name));
-
info->status = dma_fence_get_status(fence);
while (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags) &&
!test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags))
@@ -407,12 +373,13 @@ static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
unsigned long arg)
{
struct sync_file_info info;
- struct sync_fence_info *fence_info = NULL;
struct dma_fence **fences;
- __u32 size;
- int num_fences, ret, i;
+ size_t len, offset;
+ int num_fences, i;
- if (copy_from_user(&info, (void __user *)arg, sizeof(info)))
+ arg += offsetof(typeof(info), status);
+ len = sizeof(info) - offsetof(typeof(info), status);
+ if (copy_from_user(&info.status, (void __user *)arg, len))
return -EFAULT;
if (info.flags || info.pad)
@@ -436,35 +403,31 @@ static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
if (info.num_fences < num_fences)
return -EINVAL;
- size = num_fences * sizeof(*fence_info);
- fence_info = kzalloc(size, GFP_KERNEL);
- if (!fence_info)
- return -ENOMEM;
-
+ offset = offsetof(struct sync_fence_info, status);
for (i = 0; i < num_fences; i++) {
- int status = sync_fill_fence_info(fences[i], &fence_info[i]);
+ struct {
+ __s32 status;
+ __u32 flags;
+ __u64 timestamp_ns;
+ } fence_info;
+ struct sync_fence_info *finfo = (void *)&fence_info - offset;
+ int status = sync_fill_fence_info(fences[i], finfo);
+ u64 dest;
+
+ /* Don't leak kernel memory to userspace via finfo->flags */
+ finfo->flags = 0;
info.status = info.status <= 0 ? info.status : status;
- }
-
- if (copy_to_user(u64_to_user_ptr(info.sync_fence_info), fence_info,
- size)) {
- ret = -EFAULT;
- goto out;
+ dest = info.sync_fence_info + i * sizeof(*finfo) + offset;
+ if (copy_to_user(u64_to_user_ptr(dest), &fence_info,
+ sizeof(fence_info)))
+ return -EFAULT;
}
no_fences:
- sync_file_get_name(sync_file, info.name, sizeof(info.name));
info.num_fences = num_fences;
-
- if (copy_to_user((void __user *)arg, &info, sizeof(info)))
- ret = -EFAULT;
- else
- ret = 0;
-
-out:
- kfree(fence_info);
-
- return ret;
+ if (copy_to_user((void __user *)arg, &info.status, len))
+ return -EFAULT;
+ return 0;
}
static long sync_file_ioctl(struct file *file, unsigned int cmd,
diff --git a/drivers/dma/dw/Kconfig b/drivers/dma/dw/Kconfig
index 04b9728c1d26..070860ec0ef1 100644
--- a/drivers/dma/dw/Kconfig
+++ b/drivers/dma/dw/Kconfig
@@ -8,6 +8,7 @@ config DW_DMAC_CORE
config DW_DMAC
tristate "Synopsys DesignWare AHB DMA platform driver"
+ depends on HAS_IOMEM
select DW_DMAC_CORE
help
Support the Synopsys DesignWare AHB DMA controller. This
@@ -16,6 +17,7 @@ config DW_DMAC
config DW_DMAC_PCI
tristate "Synopsys DesignWare AHB DMA PCI driver"
depends on PCI
+ depends on HAS_IOMEM
select DW_DMAC_CORE
help
Support the Synopsys DesignWare AHB DMA controller on the
diff --git a/drivers/gpu/drm/msm/dsi-staging/dsi_ctrl.c b/drivers/gpu/drm/msm/dsi-staging/dsi_ctrl.c
index 243c213e89e6..b1d1432b1acd 100644
--- a/drivers/gpu/drm/msm/dsi-staging/dsi_ctrl.c
+++ b/drivers/gpu/drm/msm/dsi-staging/dsi_ctrl.c
@@ -980,36 +980,25 @@ error:
return rc;
}
-static int dsi_ctrl_copy_and_pad_cmd(struct dsi_ctrl *dsi_ctrl,
- const struct mipi_dsi_packet *packet,
- u8 **buffer,
- u32 *size)
+static int dsi_ctrl_copy_and_pad_cmd(const struct mipi_dsi_packet *packet,
+ u8 *buf, size_t len)
{
int rc = 0;
- u8 *buf = NULL;
- u32 len, i;
u8 cmd_type = 0;
- len = packet->size;
- len += 0x3; len &= ~0x03; /* Align to 32 bits */
-
- buf = devm_kzalloc(&dsi_ctrl->pdev->dev, len * sizeof(u8), GFP_KERNEL);
- if (!buf)
- return -ENOMEM;
+ if (unlikely(len < packet->size))
+ return -EINVAL;
- for (i = 0; i < len; i++) {
- if (i >= packet->size)
- buf[i] = 0xFF;
- else if (i < sizeof(packet->header))
- buf[i] = packet->header[i];
- else
- buf[i] = packet->payload[i - sizeof(packet->header)];
- }
+ memcpy(buf, packet->header, sizeof(packet->header));
+ if (packet->payload_length)
+ memcpy(buf + sizeof(packet->header), packet->payload,
+ packet->payload_length);
+ if (packet->size < len)
+ memset(buf + packet->size, 0xFF, len - packet->size);
if (packet->payload_length > 0)
buf[3] |= BIT(6);
-
/* send embedded BTA for read commands */
cmd_type = buf[2] & 0x3f;
if ((cmd_type == MIPI_DSI_DCS_READ) ||
@@ -1018,9 +1007,6 @@ static int dsi_ctrl_copy_and_pad_cmd(struct dsi_ctrl *dsi_ctrl,
(cmd_type == MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM))
buf[3] |= BIT(5);
- *buffer = buf;
- *size = len;
-
return rc;
}
@@ -1141,11 +1127,13 @@ int dsi_message_validate_tx_mode(struct dsi_ctrl *dsi_ctrl,
pr_err("Cannot transfer,size is greater than 4096\n");
return -ENOTSUPP;
}
- }
+ } else if (*flags & DSI_CTRL_CMD_FETCH_MEMORY) {
+ const size_t transfer_size = dsi_ctrl->cmd_len + cmd_len + 4;
- if (*flags & DSI_CTRL_CMD_FETCH_MEMORY) {
- if ((dsi_ctrl->cmd_len + cmd_len + 4) > SZ_4K) {
- pr_err("Cannot transfer,size is greater than 4096\n");
+ if (transfer_size > DSI_EMBEDDED_MODE_DMA_MAX_SIZE_BYTES) {
+ pr_err("Cannot transfer, size: %zu is greater than %d\n",
+ transfer_size,
+ DSI_EMBEDDED_MODE_DMA_MAX_SIZE_BYTES);
return -ENOTSUPP;
}
}
@@ -1162,9 +1150,9 @@ static int dsi_message_tx(struct dsi_ctrl *dsi_ctrl,
struct dsi_ctrl_cmd_dma_fifo_info cmd;
struct dsi_ctrl_cmd_dma_info cmd_mem;
u32 hw_flags = 0;
- u32 length = 0;
+ u32 length;
u8 *buffer = NULL;
- u32 cnt = 0, line_no = 0x1;
+ u32 line_no = 0x1;
u8 *cmdbuf;
struct dsi_mode_info *timing;
struct dsi_ctrl_hw_ops dsi_hw_ops = dsi_ctrl->hw.ops;
@@ -1180,6 +1168,10 @@ static int dsi_message_tx(struct dsi_ctrl *dsi_ctrl,
goto error;
}
+ pr_debug("cmd tx type=%02x cmd=%02x len=%d last=%d\n", msg->type,
+ msg->tx_len ? *((u8 *)msg->tx_buf) : 0, msg->tx_len,
+ (msg->flags & MIPI_DSI_MSG_LASTCOMMAND) != 0);
+
if (flags & DSI_CTRL_CMD_NON_EMBEDDED_MODE) {
cmd_mem.offset = dsi_ctrl->cmd_buffer_iova;
cmd_mem.en_broadcast = (flags & DSI_CTRL_CMD_BROADCAST) ?
@@ -1205,20 +1197,22 @@ static int dsi_message_tx(struct dsi_ctrl *dsi_ctrl,
goto error;
}
- rc = dsi_ctrl_copy_and_pad_cmd(dsi_ctrl,
- &packet,
- &buffer,
- &length);
- if (rc) {
- pr_err("[%s] failed to copy message, rc=%d\n",
- dsi_ctrl->name, rc);
- goto error;
- }
+ length = ALIGN(packet.size, 4);
if ((msg->flags & MIPI_DSI_MSG_LASTCOMMAND))
- buffer[3] |= BIT(7);//set the last cmd bit in header.
+ packet.header[3] |= BIT(7);//set the last cmd bit in header.
if (flags & DSI_CTRL_CMD_FETCH_MEMORY) {
+ msm_gem_sync(dsi_ctrl->tx_cmd_buf);
+ cmdbuf = dsi_ctrl->vaddr + dsi_ctrl->cmd_len;
+
+ rc = dsi_ctrl_copy_and_pad_cmd(&packet, cmdbuf, length);
+ if (rc) {
+ pr_err("[%s] failed to copy message, rc=%d\n",
+ dsi_ctrl->name, rc);
+ goto error;
+ }
+
/* Embedded mode config is selected */
cmd_mem.offset = dsi_ctrl->cmd_buffer_iova;
cmd_mem.en_broadcast = (flags & DSI_CTRL_CMD_BROADCAST) ?
@@ -1228,12 +1222,6 @@ static int dsi_message_tx(struct dsi_ctrl *dsi_ctrl,
cmd_mem.use_lpm = (msg->flags & MIPI_DSI_MSG_USE_LPM) ?
true : false;
- cmdbuf = (u8 *)(dsi_ctrl->vaddr);
-
- msm_gem_sync(dsi_ctrl->tx_cmd_buf);
- for (cnt = 0; cnt < length; cnt++)
- cmdbuf[dsi_ctrl->cmd_len + cnt] = buffer[cnt];
-
dsi_ctrl->cmd_len += length;
if (!(msg->flags & MIPI_DSI_MSG_LASTCOMMAND)) {
@@ -1244,6 +1232,20 @@ static int dsi_message_tx(struct dsi_ctrl *dsi_ctrl,
}
} else if (flags & DSI_CTRL_CMD_FIFO_STORE) {
+ buffer = devm_kzalloc(&dsi_ctrl->pdev->dev, length,
+ GFP_KERNEL);
+ if (!buffer) {
+ rc = -ENOMEM;
+ goto error;
+ }
+
+ rc = dsi_ctrl_copy_and_pad_cmd(&packet, buffer, length);
+ if (rc) {
+ pr_err("[%s] failed to copy message, rc=%d\n",
+ dsi_ctrl->name, rc);
+ goto error;
+ }
+
cmd.command = (u32 *)buffer;
cmd.size = length;
cmd.en_broadcast = (flags & DSI_CTRL_CMD_BROADCAST) ?
diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c
index c1e6cb5b4718..c19f9e22e75d 100644
--- a/drivers/gpu/drm/msm/msm_atomic.c
+++ b/drivers/gpu/drm/msm/msm_atomic.c
@@ -33,7 +33,10 @@ struct msm_commit {
uint32_t crtc_mask;
uint32_t plane_mask;
bool nonblock;
- struct kthread_work commit_work;
+ union {
+ struct kthread_work commit_work;
+ struct work_struct clean_work;
+ };
};
static BLOCKING_NOTIFIER_HEAD(msm_drm_notifier_list);
@@ -117,7 +120,6 @@ static void end_atomic(struct msm_drm_private *priv, uint32_t crtc_mask,
static void commit_destroy(struct msm_commit *c)
{
- end_atomic(c->dev->dev_private, c->crtc_mask, c->plane_mask);
if (c->nonblock)
kfree(c);
}
@@ -528,6 +530,16 @@ static void msm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
SDE_ATRACE_END("msm_enable");
}
+static void complete_commit_cleanup(struct work_struct *work)
+{
+ struct msm_commit *c = container_of(work, typeof(*c), clean_work);
+ struct drm_atomic_state *state = c->state;
+
+ drm_atomic_state_put(state);
+
+ commit_destroy(c);
+}
+
/* The (potentially) asynchronous part of the commit. At this point
* nothing can fail short of armageddon.
*/
@@ -567,25 +579,24 @@ static void complete_commit(struct msm_commit *c)
kms->funcs->complete_commit(kms, state);
- drm_atomic_state_put(state);
-
- commit_destroy(c);
+ end_atomic(priv, c->crtc_mask, c->plane_mask);
}
static void _msm_drm_commit_work_cb(struct kthread_work *work)
{
- struct msm_commit *commit = NULL;
-
- if (!work) {
- DRM_ERROR("%s: Invalid commit work data!\n", __func__);
- return;
- }
-
- commit = container_of(work, struct msm_commit, commit_work);
+ struct msm_commit *c = container_of(work, typeof(*c), commit_work);
SDE_ATRACE_BEGIN("complete_commit");
- complete_commit(commit);
+ complete_commit(c);
SDE_ATRACE_END("complete_commit");
+
+ if (c->nonblock) {
+ /* Offload the cleanup onto little CPUs (an unbound wq) */
+ INIT_WORK(&c->clean_work, complete_commit_cleanup);
+ queue_work(system_unbound_wq, &c->clean_work);
+ } else {
+ complete_commit_cleanup(&c->clean_work);
+ }
}
static struct msm_commit *commit_init(struct drm_atomic_state *state,
@@ -656,6 +667,7 @@ static void msm_atomic_commit_dispatch(struct drm_device *dev,
*/
DRM_ERROR("failed to dispatch commit to any CRTC\n");
complete_commit(commit);
+ complete_commit_cleanup(&commit->clean_work);
} else if (!nonblock) {
kthread_flush_work(&commit->commit_work);
}
diff --git a/drivers/gpu/drm/msm/sde/sde_core_irq.c b/drivers/gpu/drm/msm/sde/sde_core_irq.c
index b082778a4590..c250fbb6d402 100644
--- a/drivers/gpu/drm/msm/sde/sde_core_irq.c
+++ b/drivers/gpu/drm/msm/sde/sde_core_irq.c
@@ -662,15 +662,6 @@ int sde_core_irq_domain_fini(struct sde_kms *sde_kms)
irqreturn_t sde_core_irq(struct sde_kms *sde_kms)
{
/*
- * Read interrupt status from all sources. Interrupt status are
- * stored within hw_intr.
- * Function will also clear the interrupt status after reading.
- * Individual interrupt status bit will only get stored if it
- * is enabled.
- */
- sde_kms->hw_intr->ops.get_interrupt_statuses(sde_kms->hw_intr);
-
- /*
* Dispatch to HW driver to handle interrupt lookup that is being
* fired. When matching interrupt is located, HW driver will call to
* sde_core_irq_callback_handler with the irq_idx from the lookup table.
diff --git a/drivers/gpu/drm/msm/sde/sde_crtc.c b/drivers/gpu/drm/msm/sde/sde_crtc.c
index 77dd68db9b4b..b5e41c826351 100644
--- a/drivers/gpu/drm/msm/sde/sde_crtc.c
+++ b/drivers/gpu/drm/msm/sde/sde_crtc.c
@@ -2251,9 +2251,11 @@ static void _sde_crtc_blend_setup(struct drm_crtc *crtc,
mixer[i].hw_ctl);
/* clear dim_layer settings */
- lm = mixer[i].hw_lm;
- if (lm->ops.clear_dim_layer)
- lm->ops.clear_dim_layer(lm);
+ if (sde_crtc_state->num_dim_layers > 0) {
+ lm = mixer[i].hw_lm;
+ if (lm->ops.clear_dim_layer)
+ lm->ops.clear_dim_layer(lm);
+ }
}
_sde_crtc_swap_mixers_for_right_partial_update(crtc);
@@ -4395,8 +4397,6 @@ void sde_crtc_commit_kickoff(struct drm_crtc *crtc,
if (_sde_crtc_commit_kickoff_rot(crtc, cstate))
is_error = true;
- sde_vbif_clear_errors(sde_kms);
-
if (is_error) {
_sde_crtc_remove_pipe_flush(crtc);
_sde_crtc_blend_setup(crtc, old_state, false);
diff --git a/drivers/gpu/drm/msm/sde/sde_encoder_phys_cmd.c b/drivers/gpu/drm/msm/sde/sde_encoder_phys_cmd.c
index 1e50e8ff76ee..655a48a225eb 100644
--- a/drivers/gpu/drm/msm/sde/sde_encoder_phys_cmd.c
+++ b/drivers/gpu/drm/msm/sde/sde_encoder_phys_cmd.c
@@ -663,9 +663,9 @@ static int _sde_encoder_phys_cmd_poll_write_pointer_started(
}
if (phys_enc->has_intf_te)
- ret = hw_intf->ops.get_vsync_info(hw_intf, &info);
+ ret = hw_intf->ops.get_vsync_info(hw_intf, &info, false);
else
- ret = hw_pp->ops.get_vsync_info(hw_pp, &info);
+ ret = hw_pp->ops.get_vsync_info(hw_pp, &info, false);
if (ret)
return ret;
@@ -714,13 +714,13 @@ static bool _sde_encoder_phys_cmd_is_ongoing_pptx(
if (!hw_intf || !hw_intf->ops.get_vsync_info)
return false;
- hw_intf->ops.get_vsync_info(hw_intf, &info);
+ hw_intf->ops.get_vsync_info(hw_intf, &info, true);
} else {
hw_pp = phys_enc->hw_pp;
if (!hw_pp || !hw_pp->ops.get_vsync_info)
return false;
- hw_pp->ops.get_vsync_info(hw_pp, &info);
+ hw_pp->ops.get_vsync_info(hw_pp, &info, true);
}
SDE_EVT32(DRMID(phys_enc->parent),
@@ -1173,12 +1173,20 @@ static void sde_encoder_phys_cmd_enable(struct sde_encoder_phys *phys_enc)
static bool sde_encoder_phys_cmd_is_autorefresh_enabled(
struct sde_encoder_phys *phys_enc)
{
+ struct sde_encoder_phys_cmd *cmd_enc;
struct sde_hw_pingpong *hw_pp;
struct sde_hw_intf *hw_intf;
struct sde_hw_autorefresh cfg;
int ret;
- if (!phys_enc || !phys_enc->hw_pp || !phys_enc->hw_intf)
+ if (!phys_enc)
+ return 0;
+
+ cmd_enc = to_sde_encoder_phys_cmd(phys_enc);
+ if (!cmd_enc->autorefresh.cfg.enable)
+ return 0;
+
+ if (!phys_enc->hw_pp || !phys_enc->hw_intf)
return 0;
if (!sde_encoder_phys_cmd_is_master(phys_enc))
@@ -1271,14 +1279,14 @@ static int sde_encoder_phys_cmd_get_write_line_count(
if (!hw_intf->ops.get_vsync_info)
return -EINVAL;
- if (hw_intf->ops.get_vsync_info(hw_intf, &info))
+ if (hw_intf->ops.get_vsync_info(hw_intf, &info, true))
return -EINVAL;
} else {
hw_pp = phys_enc->hw_pp;
if (!hw_pp->ops.get_vsync_info)
return -EINVAL;
- if (hw_pp->ops.get_vsync_info(hw_pp, &info))
+ if (hw_pp->ops.get_vsync_info(hw_pp, &info, true))
return -EINVAL;
}
diff --git a/drivers/gpu/drm/msm/sde/sde_hw_interrupts.c b/drivers/gpu/drm/msm/sde/sde_hw_interrupts.c
index 0fc778e35f88..038b1fc53907 100644
--- a/drivers/gpu/drm/msm/sde/sde_hw_interrupts.c
+++ b/drivers/gpu/drm/msm/sde/sde_hw_interrupts.c
@@ -886,8 +886,6 @@ static void sde_hw_intr_dispatch_irq(struct sde_hw_intr *intr,
*/
spin_lock_irqsave(&intr->irq_lock, irq_flags);
for (reg_idx = 0; reg_idx < intr->sde_irq_size; reg_idx++) {
- irq_status = intr->save_irq_status[reg_idx];
-
/* get the global offset in 'sde_irq_map' */
sde_irq_idx = intr->sde_irq_tbl[reg_idx].sde_irq_idx;
if (sde_irq_idx < 0)
@@ -904,6 +902,9 @@ static void sde_hw_intr_dispatch_irq(struct sde_hw_intr *intr,
end_idx > ARRAY_SIZE(sde_irq_map))
continue;
+ irq_status = SDE_REG_READ(&intr->hw,
+ intr->sde_irq_tbl[reg_idx].status_off);
+
/*
* Search through matching intr status from irq map.
* start_idx and end_idx defined the search range in
@@ -924,8 +925,9 @@ static void sde_hw_intr_dispatch_irq(struct sde_hw_intr *intr,
if (cbfunc)
cbfunc(arg, irq_idx);
else
- intr->ops.clear_intr_status_nolock(
- intr, irq_idx);
+ SDE_REG_WRITE(&intr->hw,
+ intr->sde_irq_tbl[reg_idx].clr_off,
+ sde_irq_map[irq_idx].irq_mask);
/*
* When callback finish, clear the irq_status
@@ -977,9 +979,6 @@ static int sde_hw_intr_enable_irq(struct sde_hw_intr *intr, int irq_idx)
/* Enabling interrupts with the new mask */
SDE_REG_WRITE(&intr->hw, reg->en_off, cache_irq_mask);
- /* ensure register write goes through */
- wmb();
-
intr->cache_irq_mask[reg_idx] = cache_irq_mask;
}
spin_unlock_irqrestore(&intr->irq_lock, irq_flags);
@@ -1115,40 +1114,6 @@ static int sde_hw_intr_get_interrupt_sources(struct sde_hw_intr *intr,
return 0;
}
-static void sde_hw_intr_get_interrupt_statuses(struct sde_hw_intr *intr)
-{
- int i;
- u32 enable_mask;
- unsigned long irq_flags;
-
- if (!intr)
- return;
-
- spin_lock_irqsave(&intr->irq_lock, irq_flags);
- for (i = 0; i < intr->sde_irq_size; i++) {
- /* Read interrupt status */
- intr->save_irq_status[i] = SDE_REG_READ(&intr->hw,
- intr->sde_irq_tbl[i].status_off);
-
- /* Read enable mask */
- enable_mask = SDE_REG_READ(&intr->hw,
- intr->sde_irq_tbl[i].en_off);
-
- /* and clear the interrupt */
- if (intr->save_irq_status[i])
- SDE_REG_WRITE(&intr->hw, intr->sde_irq_tbl[i].clr_off,
- intr->save_irq_status[i]);
-
- /* Finally update IRQ status based on enable mask */
- intr->save_irq_status[i] &= enable_mask;
- }
-
- /* ensure register writes go through */
- wmb();
-
- spin_unlock_irqrestore(&intr->irq_lock, irq_flags);
-}
-
static void sde_hw_intr_clear_intr_status_force_mask(struct sde_hw_intr *intr,
int irq_idx, u32 irq_mask)
{
@@ -1200,12 +1165,20 @@ static void sde_hw_intr_clear_interrupt_status(struct sde_hw_intr *intr,
int irq_idx)
{
unsigned long irq_flags;
+ int reg_idx;
if (!intr)
return;
+ reg_idx = sde_irq_map[irq_idx].reg_idx;
+ if (reg_idx < 0 || reg_idx > intr->sde_irq_size) {
+ pr_err("invalid irq reg:%d irq:%d\n", reg_idx, irq_idx);
+ return;
+ }
+
spin_lock_irqsave(&intr->irq_lock, irq_flags);
- sde_hw_intr_clear_intr_status_nolock(intr, irq_idx);
+ SDE_REG_WRITE(&intr->hw, intr->sde_irq_tbl[reg_idx].clr_off,
+ sde_irq_map[irq_idx].irq_mask);
spin_unlock_irqrestore(&intr->irq_lock, irq_flags);
}
@@ -1272,9 +1245,6 @@ static u32 sde_hw_intr_get_interrupt_status(struct sde_hw_intr *intr,
SDE_REG_WRITE(&intr->hw, intr->sde_irq_tbl[reg_idx].clr_off,
intr_status);
- /* ensure register writes go through */
- wmb();
-
spin_unlock_irqrestore(&intr->irq_lock, irq_flags);
return intr_status;
@@ -1321,7 +1291,6 @@ static void __setup_intr_ops(struct sde_hw_intr_ops *ops)
ops->disable_all_irqs = sde_hw_intr_disable_irqs;
ops->get_valid_interrupts = sde_hw_intr_get_valid_interrupts;
ops->get_interrupt_sources = sde_hw_intr_get_interrupt_sources;
- ops->get_interrupt_statuses = sde_hw_intr_get_interrupt_statuses;
ops->clear_interrupt_status = sde_hw_intr_clear_interrupt_status;
ops->clear_intr_status_nolock = sde_hw_intr_clear_intr_status_nolock;
ops->clear_intr_status_force_mask =
@@ -1469,7 +1438,6 @@ void sde_hw_intr_destroy(struct sde_hw_intr *intr)
if (intr) {
kfree(intr->sde_irq_tbl);
kfree(intr->cache_irq_mask);
- kfree(intr->save_irq_status);
kfree(intr);
}
}
@@ -1578,13 +1546,6 @@ struct sde_hw_intr *sde_hw_intr_init(void __iomem *addr,
goto exit;
}
- intr->save_irq_status = kcalloc(intr->sde_irq_size, sizeof(u32),
- GFP_KERNEL);
- if (intr->save_irq_status == NULL) {
- ret = -ENOMEM;
- goto exit;
- }
-
spin_lock_init(&intr->irq_lock);
return intr;
@@ -1592,7 +1553,6 @@ struct sde_hw_intr *sde_hw_intr_init(void __iomem *addr,
exit:
kfree(intr->sde_irq_tbl);
kfree(intr->cache_irq_mask);
- kfree(intr->save_irq_status);
kfree(intr);
return ERR_PTR(ret);
}
diff --git a/drivers/gpu/drm/msm/sde/sde_hw_interrupts.h b/drivers/gpu/drm/msm/sde/sde_hw_interrupts.h
index 1d5a8427d0aa..e2de0e33bd59 100644
--- a/drivers/gpu/drm/msm/sde/sde_hw_interrupts.h
+++ b/drivers/gpu/drm/msm/sde/sde_hw_interrupts.h
@@ -189,14 +189,6 @@ struct sde_hw_intr_ops {
void *arg);
/**
- * get_interrupt_statuses - Gets and store value from all interrupt
- * status registers that are currently fired.
- * @intr: HW interrupt handle
- */
- void (*get_interrupt_statuses)(
- struct sde_hw_intr *intr);
-
- /**
* clear_interrupt_status - Clears HW interrupt status based on given
* lookup IRQ index.
* @intr: HW interrupt handle
@@ -292,7 +284,6 @@ struct sde_hw_intr_ops {
* @hw: virtual address mapping
* @ops: function pointer mapping for IRQ handling
* @cache_irq_mask: array of IRQ enable masks reg storage created during init
- * @save_irq_status: array of IRQ status reg storage created during init
* @irq_idx_tbl_size: total number of irq_idx mapped in the hw_interrupts
* @irq_lock: spinlock for accessing IRQ resources
* @sde_irq_size: total number of elements of the sde_irq_tbl
@@ -303,7 +294,6 @@ struct sde_hw_intr {
struct sde_hw_blk_reg_map hw;
struct sde_hw_intr_ops ops;
u32 *cache_irq_mask;
- u32 *save_irq_status;
u32 irq_idx_tbl_size;
u32 sde_irq_size;
struct sde_intr_reg *sde_irq_tbl;
diff --git a/drivers/gpu/drm/msm/sde/sde_hw_intf.c b/drivers/gpu/drm/msm/sde/sde_hw_intf.c
index 21b671164786..ba7510ab310d 100644
--- a/drivers/gpu/drm/msm/sde/sde_hw_intf.c
+++ b/drivers/gpu/drm/msm/sde/sde_hw_intf.c
@@ -613,7 +613,7 @@ static int sde_hw_intf_connect_external_te(struct sde_hw_intf *intf,
}
static int sde_hw_intf_get_vsync_info(struct sde_hw_intf *intf,
- struct sde_hw_pp_vsync_info *info)
+ struct sde_hw_pp_vsync_info *info, bool wr_ptr_only)
{
struct sde_hw_blk_reg_map *c = &intf->hw;
u32 val;
@@ -623,12 +623,14 @@ static int sde_hw_intf_get_vsync_info(struct sde_hw_intf *intf,
c = &intf->hw;
- val = SDE_REG_READ(c, INTF_TEAR_VSYNC_INIT_VAL);
- info->rd_ptr_init_val = val & 0xffff;
+ if (!wr_ptr_only) {
+ val = SDE_REG_READ(c, INTF_TEAR_VSYNC_INIT_VAL);
+ info->rd_ptr_init_val = val & 0xffff;
- val = SDE_REG_READ(c, INTF_TEAR_INT_COUNT_VAL);
- info->rd_ptr_frame_count = (val & 0xffff0000) >> 16;
- info->rd_ptr_line_count = val & 0xffff;
+ val = SDE_REG_READ(c, INTF_TEAR_INT_COUNT_VAL);
+ info->rd_ptr_frame_count = (val & 0xffff0000) >> 16;
+ info->rd_ptr_line_count = val & 0xffff;
+ }
val = SDE_REG_READ(c, INTF_TEAR_LINE_COUNT);
info->wr_ptr_line_count = val & 0xffff;
diff --git a/drivers/gpu/drm/msm/sde/sde_hw_intf.h b/drivers/gpu/drm/msm/sde/sde_hw_intf.h
index 413aac279619..ec38000c1970 100644
--- a/drivers/gpu/drm/msm/sde/sde_hw_intf.h
+++ b/drivers/gpu/drm/msm/sde/sde_hw_intf.h
@@ -141,7 +141,7 @@ struct sde_hw_intf_ops {
* line_count
*/
int (*get_vsync_info)(struct sde_hw_intf *intf,
- struct sde_hw_pp_vsync_info *info);
+ struct sde_hw_pp_vsync_info *info, bool wr_ptr_only);
/**
* configure and enable the autorefresh config
diff --git a/drivers/gpu/drm/msm/sde/sde_hw_pingpong.c b/drivers/gpu/drm/msm/sde/sde_hw_pingpong.c
index 64c1a90f5952..e03eb3d8391f 100644
--- a/drivers/gpu/drm/msm/sde/sde_hw_pingpong.c
+++ b/drivers/gpu/drm/msm/sde/sde_hw_pingpong.c
@@ -404,7 +404,7 @@ static int sde_hw_pp_connect_external_te(struct sde_hw_pingpong *pp,
}
static int sde_hw_pp_get_vsync_info(struct sde_hw_pingpong *pp,
- struct sde_hw_pp_vsync_info *info)
+ struct sde_hw_pp_vsync_info *info, bool wr_ptr_only)
{
struct sde_hw_blk_reg_map *c;
u32 val;
@@ -413,12 +413,14 @@ static int sde_hw_pp_get_vsync_info(struct sde_hw_pingpong *pp,
return -EINVAL;
c = &pp->hw;
- val = SDE_REG_READ(c, PP_VSYNC_INIT_VAL);
- info->rd_ptr_init_val = val & 0xffff;
+ if (!wr_ptr_only) {
+ val = SDE_REG_READ(c, PP_VSYNC_INIT_VAL);
+ info->rd_ptr_init_val = val & 0xffff;
- val = SDE_REG_READ(c, PP_INT_COUNT_VAL);
- info->rd_ptr_frame_count = (val & 0xffff0000) >> 16;
- info->rd_ptr_line_count = val & 0xffff;
+ val = SDE_REG_READ(c, PP_INT_COUNT_VAL);
+ info->rd_ptr_frame_count = (val & 0xffff0000) >> 16;
+ info->rd_ptr_line_count = val & 0xffff;
+ }
val = SDE_REG_READ(c, PP_LINE_COUNT);
info->wr_ptr_line_count = val & 0xffff;
diff --git a/drivers/gpu/drm/msm/sde/sde_hw_pingpong.h b/drivers/gpu/drm/msm/sde/sde_hw_pingpong.h
index 9cc755237c68..e83c26bf0eb0 100644
--- a/drivers/gpu/drm/msm/sde/sde_hw_pingpong.h
+++ b/drivers/gpu/drm/msm/sde/sde_hw_pingpong.h
@@ -72,7 +72,7 @@ struct sde_hw_pingpong_ops {
* line_count
*/
int (*get_vsync_info)(struct sde_hw_pingpong *pp,
- struct sde_hw_pp_vsync_info *info);
+ struct sde_hw_pp_vsync_info *info, bool wr_ptr_only);
/**
* configure and enable the autorefresh config
diff --git a/drivers/gpu/msm/Makefile b/drivers/gpu/msm/Makefile
index b1f075ce037d..623feb5a6cdf 100644
--- a/drivers/gpu/msm/Makefile
+++ b/drivers/gpu/msm/Makefile
@@ -30,16 +30,8 @@ msm_adreno-y += \
adreno_snapshot.o \
adreno_coresight.o \
adreno_trace.o \
- adreno_a3xx.o \
- adreno_a4xx.o \
- adreno_a5xx.o \
adreno_a6xx.o \
- adreno_a3xx_snapshot.o \
- adreno_a4xx_snapshot.o \
- adreno_a5xx_snapshot.o \
adreno_a6xx_snapshot.o \
- adreno_a4xx_preempt.o \
- adreno_a5xx_preempt.o \
adreno_a6xx_preempt.o \
adreno_a6xx_gmu.o \
adreno_a6xx_rgmu.o \
diff --git a/drivers/gpu/msm/adreno-gpulist.h b/drivers/gpu/msm/adreno-gpulist.h
index 1a7df11bda16..f2adcb7fd1d5 100644
--- a/drivers/gpu/msm/adreno-gpulist.h
+++ b/drivers/gpu/msm/adreno-gpulist.h
@@ -14,6 +14,7 @@
#define ANY_ID (~0)
static const struct adreno_gpu_core adreno_gpulist[] = {
+#if 0
{
.gpurev = ADRENO_REV_A306,
.core = 3,
@@ -335,6 +336,7 @@ static const struct adreno_gpu_core adreno_gpulist[] = {
.num_protected_regs = 0x20,
.busy_mask = 0xFFFFFFFE,
},
+#endif
{
.gpurev = ADRENO_REV_A630,
.core = 6,
diff --git a/drivers/gpu/msm/adreno.c b/drivers/gpu/msm/adreno.c
index e4021fd73e4a..3b1ed485e80f 100644
--- a/drivers/gpu/msm/adreno.c
+++ b/drivers/gpu/msm/adreno.c
@@ -1686,13 +1686,6 @@ int adreno_set_unsecured_mode(struct adreno_device *adreno_dev,
if (!adreno_is_a5xx(adreno_dev) && !adreno_is_a6xx(adreno_dev))
return -EINVAL;
- if (ADRENO_QUIRK(adreno_dev, ADRENO_QUIRK_CRITICAL_PACKETS) &&
- adreno_is_a5xx(adreno_dev)) {
- ret = a5xx_critical_packet_submit(adreno_dev, rb);
- if (ret)
- return ret;
- }
-
/* GPU comes up in secured mode, make it unsecured by default */
if (adreno_dev->zap_handle_ptr)
ret = adreno_switch_to_unsecure_mode(adreno_dev, rb);
diff --git a/drivers/gpu/msm/adreno_cp_parser.h b/drivers/gpu/msm/adreno_cp_parser.h
index 1fa46c147c3c..fa6a43ad33d6 100644
--- a/drivers/gpu/msm/adreno_cp_parser.h
+++ b/drivers/gpu/msm/adreno_cp_parser.h
@@ -134,15 +134,7 @@ static inline void adreno_ib_init_ib_obj(uint64_t gpuaddr,
static inline int adreno_cp_parser_getreg(struct adreno_device *adreno_dev,
enum adreno_cp_addr_regs reg_enum)
{
- if (reg_enum == ADRENO_CP_ADDR_MAX)
- return -EEXIST;
-
- if (adreno_is_a3xx(adreno_dev))
- return a3xx_cp_addr_regs[reg_enum];
- else if (adreno_is_a4xx(adreno_dev))
- return a4xx_cp_addr_regs[reg_enum];
- else
- return -EEXIST;
+ return -EEXIST;
}
/*
@@ -160,19 +152,6 @@ static inline int adreno_cp_parser_regindex(struct adreno_device *adreno_dev,
enum adreno_cp_addr_regs start,
enum adreno_cp_addr_regs end)
{
- int i;
- const unsigned int *regs;
-
- if (adreno_is_a4xx(adreno_dev))
- regs = a4xx_cp_addr_regs;
- else if (adreno_is_a3xx(adreno_dev))
- regs = a3xx_cp_addr_regs;
- else
- return -EEXIST;
-
- for (i = start; i <= end && i < ADRENO_CP_ADDR_MAX; i++)
- if (regs[i] == offset)
- return i;
return -EEXIST;
}
diff --git a/drivers/gpu/msm/kgsl.c b/drivers/gpu/msm/kgsl.c
index 0ced8a2450e5..b296299a6afd 100644
--- a/drivers/gpu/msm/kgsl.c
+++ b/drivers/gpu/msm/kgsl.c
@@ -5154,7 +5154,7 @@ static void kgsl_core_exit(void)
static int __init kgsl_core_init(void)
{
int result = 0;
- struct sched_param param = { .sched_priority = 2 };
+ struct sched_param param = { .sched_priority = 16 };
place_marker("M - DRIVER KGSL Init");
diff --git a/drivers/hid/hid-alps.c b/drivers/hid/hid-alps.c
index ed9c0ea5b026..1bc6ad0339d2 100644
--- a/drivers/hid/hid-alps.c
+++ b/drivers/hid/hid-alps.c
@@ -429,6 +429,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi)
ret = input_register_device(data->input2);
if (ret) {
input_free_device(input2);
+ ret = -ENOENT;
goto exit;
}
}
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 8c0718b3754e..df89f490e552 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -2391,7 +2391,7 @@ static void wacom_wac_finger_slot(struct wacom_wac *wacom_wac,
!wacom_wac->shared->is_touch_on) {
if (!wacom_wac->shared->touch_down)
return;
- prox = 0;
+ prox = false;
}
wacom_wac->hid_data.num_received++;
@@ -3346,8 +3346,6 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,
{
struct wacom_features *features = &wacom_wac->features;
- input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-
if (!(features->device_type & WACOM_DEVICETYPE_PEN))
return -ENODEV;
@@ -3360,6 +3358,7 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,
/* setup has already been done */
return 0;
+ input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
__set_bit(BTN_TOUCH, input_dev->keybit);
__set_bit(ABS_MISC, input_dev->absbit);
@@ -3508,8 +3507,6 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
{
struct wacom_features *features = &wacom_wac->features;
- input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-
if (!(features->device_type & WACOM_DEVICETYPE_TOUCH))
return -ENODEV;
@@ -3522,6 +3519,7 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
/* setup has already been done */
return 0;
+ input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
__set_bit(BTN_TOUCH, input_dev->keybit);
if (features->touch_max == 1) {
diff --git a/drivers/input/keyboard/nspire-keypad.c b/drivers/input/keyboard/nspire-keypad.c
index c7f26fa3034c..cf138d836eec 100644
--- a/drivers/input/keyboard/nspire-keypad.c
+++ b/drivers/input/keyboard/nspire-keypad.c
@@ -96,9 +96,15 @@ static irqreturn_t nspire_keypad_irq(int irq, void *dev_id)
return IRQ_HANDLED;
}
-static int nspire_keypad_chip_init(struct nspire_keypad *keypad)
+static int nspire_keypad_open(struct input_dev *input)
{
+ struct nspire_keypad *keypad = input_get_drvdata(input);
unsigned long val = 0, cycles_per_us, delay_cycles, row_delay_cycles;
+ int error;
+
+ error = clk_prepare_enable(keypad->clk);
+ if (error)
+ return error;
cycles_per_us = (clk_get_rate(keypad->clk) / 1000000);
if (cycles_per_us == 0)
@@ -124,30 +130,6 @@ static int nspire_keypad_chip_init(struct nspire_keypad *keypad)
keypad->int_mask = 1 << 1;
writel(keypad->int_mask, keypad->reg_base + KEYPAD_INTMSK);
- /* Disable GPIO interrupts to prevent hanging on touchpad */
- /* Possibly used to detect touchpad events */
- writel(0, keypad->reg_base + KEYPAD_UNKNOWN_INT);
- /* Acknowledge existing interrupts */
- writel(~0, keypad->reg_base + KEYPAD_UNKNOWN_INT_STS);
-
- return 0;
-}
-
-static int nspire_keypad_open(struct input_dev *input)
-{
- struct nspire_keypad *keypad = input_get_drvdata(input);
- int error;
-
- error = clk_prepare_enable(keypad->clk);
- if (error)
- return error;
-
- error = nspire_keypad_chip_init(keypad);
- if (error) {
- clk_disable_unprepare(keypad->clk);
- return error;
- }
-
return 0;
}
@@ -155,6 +137,11 @@ static void nspire_keypad_close(struct input_dev *input)
{
struct nspire_keypad *keypad = input_get_drvdata(input);
+ /* Disable interrupts */
+ writel(0, keypad->reg_base + KEYPAD_INTMSK);
+ /* Acknowledge existing interrupts */
+ writel(~0, keypad->reg_base + KEYPAD_INT);
+
clk_disable_unprepare(keypad->clk);
}
@@ -215,6 +202,25 @@ static int nspire_keypad_probe(struct platform_device *pdev)
return -ENOMEM;
}
+ error = clk_prepare_enable(keypad->clk);
+ if (error) {
+ dev_err(&pdev->dev, "failed to enable clock\n");
+ return error;
+ }
+
+ /* Disable interrupts */
+ writel(0, keypad->reg_base + KEYPAD_INTMSK);
+ /* Acknowledge existing interrupts */
+ writel(~0, keypad->reg_base + KEYPAD_INT);
+
+ /* Disable GPIO interrupts to prevent hanging on touchpad */
+ /* Possibly used to detect touchpad events */
+ writel(0, keypad->reg_base + KEYPAD_UNKNOWN_INT);
+ /* Acknowledge existing GPIO interrupts */
+ writel(~0, keypad->reg_base + KEYPAD_UNKNOWN_INT_STS);
+
+ clk_disable_unprepare(keypad->clk);
+
input_set_drvdata(input, keypad);
input->id.bustype = BUS_HOST;
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 0463ab79160b..f20e54f41dde 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -592,6 +592,7 @@ static const struct dmi_system_id i8042_dmi_noselftest_table[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
},
+ }, {
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */
diff --git a/drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_fe_ver1.c b/drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_fe_ver1.c
index 6f833b35287e..65f0c77bd217 100644
--- a/drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_fe_ver1.c
+++ b/drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_top/cam_vfe_fe_ver1.c
@@ -356,7 +356,6 @@ static int cam_vfe_fe_reg_dump(
struct cam_isp_resource_node *fe_res)
{
struct cam_vfe_mux_fe_data *fe_priv;
- struct cam_vfe_soc_private *soc_private;
int rc = 0, i;
uint32_t val = 0;
@@ -370,7 +369,6 @@ static int cam_vfe_fe_reg_dump(
return 0;
fe_priv = (struct cam_vfe_mux_fe_data *)fe_res->res_priv;
- soc_private = fe_priv->soc_info->soc_private;
for (i = 0xA3C; i <= 0xA90; i += 4) {
val = cam_io_r_mb(fe_priv->mem_base + i);
CAM_INFO(CAM_ISP, "offset 0x%x val 0x%x", i, val);
@@ -396,14 +394,6 @@ static int cam_vfe_fe_reg_dump(
CAM_INFO(CAM_ISP, "offset 0x%x val 0x%x", i, val);
}
- cam_cpas_reg_read((uint32_t)soc_private->cpas_handle,
- CAM_CPAS_REG_CAMNOC, 0x420, true, &val);
- CAM_INFO(CAM_ISP, "IFE02_MAXWR_LOW offset 0x420 val 0x%x", val);
-
- cam_cpas_reg_read((uint32_t)soc_private->cpas_handle,
- CAM_CPAS_REG_CAMNOC, 0x820, true, &val);
- CAM_INFO(CAM_ISP, "IFE13_MAXWR_LOW offset 0x820 val 0x%x", val);
-
return rc;
}
diff --git a/drivers/media/platform/msm/camera/cam_sensor_module/cam_csiphy/include/cam_csiphy_1_2_hwreg.h b/drivers/media/platform/msm/camera/cam_sensor_module/cam_csiphy/include/cam_csiphy_1_2_hwreg.h
index ac113d613fce..be66e39f5425 100644
--- a/drivers/media/platform/msm/camera/cam_sensor_module/cam_csiphy/include/cam_csiphy_1_2_hwreg.h
+++ b/drivers/media/platform/msm/camera/cam_sensor_module/cam_csiphy/include/cam_csiphy_1_2_hwreg.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -21,8 +21,8 @@ struct csiphy_reg_parms_t csiphy_v1_2 = {
.mipi_csiphy_glbl_irq_cmd_addr = 0x828,
.csiphy_common_array_size = 6,
.csiphy_reset_array_size = 5,
- .csiphy_2ph_config_array_size = 22,
- .csiphy_3ph_config_array_size = 38,
+ .csiphy_2ph_config_array_size = 23,
+ .csiphy_3ph_config_array_size = 30,
.csiphy_2ph_clock_lane = 0x1,
.csiphy_2ph_combo_ck_ln = 0x10,
};
@@ -30,8 +30,8 @@ struct csiphy_reg_parms_t csiphy_v1_2 = {
struct csiphy_reg_t csiphy_common_reg_1_2[] = {
{0x0814, 0xd5, 0x00, CSIPHY_LANE_ENABLE},
{0x0818, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x081C, 0x02, 0x00, CSIPHY_2PH_REGS},
- {0x081C, 0x52, 0x00, CSIPHY_3PH_REGS},
+ {0x081C, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0800, 0x03, 0x01, CSIPHY_DEFAULT_PARAMS},
{0x0800, 0x02, 0x00, CSIPHY_2PH_REGS},
{0x0800, 0x0E, 0x00, CSIPHY_3PH_REGS},
};
@@ -64,34 +64,34 @@ csiphy_reg_t csiphy_2ph_v1_2_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{0x0030, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0904, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0910, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0900, 0x06, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0908, 0x07, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0900, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0908, 0x06, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0904, 0x07, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x00C4, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x002C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0034, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0010, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x001C, 0x0A, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0014, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0028, 0x00, 0x00, CSIPHY_DNP_PARAMS},
+ {0x0028, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x003C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0000, 0x91, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0004, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0020, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0008, 0x10, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE},
- {0x000c, 0x00, 0x00, CSIPHY_DNP_PARAMS},
{0x0010, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0038, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x005C, 0xC0, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0060, 0x0D, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0800, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0000, 0x00, 0x00, CSIPHY_DNP_PARAMS},
},
{
{0x0730, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0C84, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0C90, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0C80, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0C88, 0x14, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0C88, 0x06, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0C84, 0x07, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x07C4, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x072C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0734, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0710, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -107,78 +107,83 @@ csiphy_reg_t csiphy_2ph_v1_2_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{0x0710, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0738, 0x1F, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0800, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0000, 0x00, 0x00, CSIPHY_DNP_PARAMS},
+ {0x0000, 0x00, 0x00, CSIPHY_DNP_PARAMS},
},
{
{0x0230, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0A04, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0A10, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0A00, 0x0B, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0A08, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0A00, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0A08, 0x06, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0A04, 0x07, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x02C4, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x022C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0234, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0210, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x021C, 0x0A, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0214, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0228, 0x00, 0x00, CSIPHY_DNP_PARAMS},
+ {0x0228, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x023C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0200, 0x91, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0204, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0220, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0208, 0x04, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE},
- {0x020c, 0x00, 0x00, CSIPHY_DNP_PARAMS},
{0x0210, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0238, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x025C, 0xC0, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0260, 0x0D, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0800, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0000, 0x00, 0x00, CSIPHY_DNP_PARAMS},
},
{
{0x0430, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0B04, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0B10, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0B00, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0B08, 0x03, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0B00, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0B08, 0x06, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0B04, 0x07, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x04C4, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x042C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0434, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0410, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x041C, 0x0A, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0414, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0428, 0x00, 0x00, CSIPHY_DNP_PARAMS},
+ {0x0428, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x043C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0400, 0x91, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0404, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0420, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0408, 0x04, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE},
- {0x040c, 0x00, 0x00, CSIPHY_DNP_PARAMS},
{0x0410, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0438, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x045C, 0xC0, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0460, 0x0D, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0800, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0000, 0x00, 0x00, CSIPHY_DNP_PARAMS},
},
{
{0x0630, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0C04, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0C10, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0C00, 0x0E, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0C08, 0x1D, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0C00, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0C08, 0x06, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0C04, 0x07, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x06C4, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x062C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0634, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0610, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x061C, 0x0A, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0614, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0628, 0x00, 0x00, CSIPHY_DNP_PARAMS},
+ {0x0628, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x063C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0600, 0x91, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0604, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0620, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0608, 0x04, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE},
- {0x060c, 0x00, 0x00, CSIPHY_DNP_PARAMS},
{0x0610, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0638, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x065C, 0xC0, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0660, 0x0D, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0800, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0000, 0x00, 0x00, CSIPHY_DNP_PARAMS},
},
};
@@ -188,34 +193,34 @@ struct csiphy_reg_t
{0x0030, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0904, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0910, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0900, 0x06, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0908, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0900, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0908, 0x06, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0904, 0x07, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x00C4, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x002C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0034, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0010, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x001C, 0x0A, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0014, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0028, 0x00, 0x00, CSIPHY_DNP_PARAMS},
{0x003C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0000, 0x91, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0004, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0020, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0008, 0x10, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE},
- {0x000c, 0x00, 0x00, CSIPHY_DNP_PARAMS},
{0x0010, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0038, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0800, 0x00, 0x00, CSIPHY_DNP_PARAMS},
+ {0x005C, 0xC0, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0060, 0x0D, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0800, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0000, 0x00, 0x00, CSIPHY_DNP_PARAMS},
+ {0x0000, 0x00, 0x00, CSIPHY_DNP_PARAMS},
},
{
{0x0730, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0C84, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0C90, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0C80, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0C88, 0x14, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0C88, 0x06, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0C84, 0x07, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x07C4, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x072C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0734, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0710, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -230,40 +235,42 @@ struct csiphy_reg_t
{0x070c, 0xFF, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0710, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0738, 0x1F, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0800, 0x00, 0x00, CSIPHY_DNP_PARAMS},
+ {0x075C, 0xC0, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0760, 0x0D, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0800, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
},
{
{0x0230, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0A04, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0A10, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0A00, 0x0B, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0A08, 0x03, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0A00, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0A08, 0x06, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0A04, 0x07, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x02C4, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x022C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0234, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0210, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x021C, 0x0A, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0214, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0228, 0x00, 0x00, CSIPHY_DNP_PARAMS},
{0x023C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0200, 0x91, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0204, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0220, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0208, 0x04, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE},
- {0x020c, 0x00, 0x00, CSIPHY_DNP_PARAMS},
{0x0210, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0238, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0800, 0x00, 0x00, CSIPHY_DNP_PARAMS},
+ {0x025C, 0xC0, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0260, 0x0D, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0800, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0000, 0x00, 0x00, CSIPHY_DNP_PARAMS},
+ {0x0000, 0x00, 0x00, CSIPHY_DNP_PARAMS},
},
{
{0x0430, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0B04, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0B10, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0B00, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0B08, 0x1D, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0B00, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0B08, 0x06, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0B04, 0x07, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x04C4, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x042C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0434, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0410, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -275,19 +282,20 @@ struct csiphy_reg_t
{0x0404, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0420, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0408, 0x04, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE},
- {0x040c, 0x00, 0x00, CSIPHY_DNP_PARAMS},
{0x0410, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0438, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0800, 0x00, 0x00, CSIPHY_DNP_PARAMS},
+ {0x045C, 0xC0, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0460, 0x0D, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0800, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0000, 0x00, 0x00, CSIPHY_DNP_PARAMS},
},
{
{0x0630, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0C04, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0C10, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0C00, 0x0E, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0C08, 0x14, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0C00, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0C08, 0x06, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0C04, 0x07, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x06C4, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x062C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0634, 0x0F, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0610, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -295,30 +303,29 @@ struct csiphy_reg_t
{0x0614, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0628, 0x0E, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x063C, 0xB8, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0600, 0x91, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0600, 0x80, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0604, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0620, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0608, 0x04, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE},
{0x060c, 0xFF, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0610, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0638, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0800, 0x00, 0x00, CSIPHY_DNP_PARAMS},
+ {0x065C, 0xC0, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0660, 0x0D, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0800, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
},
};
struct
csiphy_reg_t csiphy_3ph_v1_2_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{
- {0x015C, 0x66, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0990, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0994, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0998, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x015C, 0x46, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0990, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0994, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0998, 0x1A, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x098C, 0xAF, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0168, 0xAC, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x016C, 0xAD, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0168, 0xA0, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x016C, 0x25, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0104, 0x06, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x010C, 0x07, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE},
{0x0108, 0x00, 0x00, CSIPHY_SETTLE_CNT_HIGHER_BYTE},
@@ -338,27 +345,19 @@ csiphy_reg_t csiphy_3ph_v1_2_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{0x01CC, 0x41, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0164, 0x33, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x01DC, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x09C0, 0x80, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x09C4, 0x7D, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x09C8, 0x7F, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0984, 0x20, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0988, 0x05, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0980, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0984, 0xA0, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x09B0, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x09B4, 0x03, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x09B4, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0800, 0x0E, 0x00, CSIPHY_DEFAULT_PARAMS},
},
{
- {0x035C, 0x66, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0A90, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0A94, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0A98, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x035C, 0x46, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0A90, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0A94, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0A98, 0x1F, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0A8C, 0xBF, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0368, 0xAC, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x036C, 0xAD, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0A94, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0A98, 0x1A, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0A8C, 0xAF, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0368, 0xA0, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x036C, 0x25, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0304, 0x06, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x030C, 0x07, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE},
{0x0308, 0x00, 0x00, CSIPHY_SETTLE_CNT_HIGHER_BYTE},
@@ -378,27 +377,19 @@ csiphy_reg_t csiphy_3ph_v1_2_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{0x03CC, 0x41, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0364, 0x33, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x03DC, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0AC0, 0x80, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0AC4, 0x7D, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0AC8, 0x7F, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0A84, 0x20, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0A88, 0x05, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0A80, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0A84, 0xA0, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0AB0, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0AB4, 0x03, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0AB4, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0800, 0x0E, 0x00, CSIPHY_DEFAULT_PARAMS},
},
{
- {0x055C, 0x66, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0B90, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0B94, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0B98, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x055C, 0x46, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0B90, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0B94, 0x08, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0B98, 0x1A, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0B8C, 0xAF, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0568, 0xAC, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x056C, 0xAD, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0568, 0xA0, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x056C, 0x25, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0504, 0x06, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x050C, 0x07, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE},
{0x0508, 0x00, 0x00, CSIPHY_SETTLE_CNT_HIGHER_BYTE},
@@ -418,14 +409,9 @@ csiphy_reg_t csiphy_3ph_v1_2_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{0x05CC, 0x41, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0564, 0x33, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x05DC, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0BC0, 0x80, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0BC4, 0x7D, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0BC8, 0x7F, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0B84, 0x20, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0B88, 0x05, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0B80, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0B84, 0xA0, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0BB0, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0BB4, 0x03, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0BB4, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0800, 0x0E, 0x00, CSIPHY_DEFAULT_PARAMS},
},
};
@@ -436,82 +422,53 @@ struct data_rate_settings_t data_rate_delta_table_1_2 = {
{
/* (2.5 * 10**3 * 2.28) rounded value*/
.bandwidth = 5700000000,
- .data_rate_reg_array_size = 12,
+ .data_rate_reg_array_size = 6,
.csiphy_data_rate_regs = {
- {0x15C, 0x66, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x35C, 0x66, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x55C, 0x66, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x9B4, 0x03, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0xAB4, 0x03, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0xBB4, 0x03, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x144, 0x22, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x344, 0x22, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x544, 0x22, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x16C, 0xAD, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x36C, 0xAD, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x56C, 0xAD, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x984, 0xA0, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0xA84, 0xA0, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0xB84, 0xA0, 0x00, CSIPHY_DEFAULT_PARAMS},
}
},
{
/* (3.5 * 10**3 * 2.28) rounded value */
.bandwidth = 7980000000,
- .data_rate_reg_array_size = 24,
+ .data_rate_reg_array_size = 12,
.csiphy_data_rate_regs = {
- {0x15C, 0x46, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x35C, 0x46, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x55C, 0x46, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x9B4, 0x03, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0xAB4, 0x03, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0xBB4, 0x03, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x9B0, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0xAB0, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0xBB0, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x144, 0xA2, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x344, 0xA2, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x544, 0xA2, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x13C, 0x10, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x33C, 0x10, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x53C, 0x10, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x140, 0x81, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x340, 0x81, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x540, 0x81, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x168, 0xA0, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x368, 0xA0, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x568, 0xA0, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x16C, 0x25, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x36C, 0x25, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x56C, 0x25, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x984, 0x20, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0xA84, 0x20, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0xB84, 0x20, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0988, 0x05, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0980, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0A88, 0x05, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0A80, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0B88, 0x05, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0B80, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS},
},
},
{
/* (4.5 * 10**3 * 2.28) rounded value */
.bandwidth = 10260000000,
- .data_rate_reg_array_size = 24,
+ .data_rate_reg_array_size = 12,
.csiphy_data_rate_regs = {
- {0x15C, 0x46, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x35C, 0x46, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x55C, 0x46, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x9B4, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0xAB4, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0xBB4, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x9B0, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0xAB0, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0xBB0, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x144, 0xA2, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x344, 0xA2, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x544, 0xA2, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x13C, 0x10, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x33C, 0x10, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x53C, 0x10, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x140, 0x81, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x340, 0x81, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x540, 0x81, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x168, 0xA0, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x368, 0xA0, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x568, 0xA0, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x16C, 0x1D, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x36C, 0x1D, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x56C, 0x1D, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x984, 0x20, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0xA84, 0x20, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0xB84, 0x20, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0988, 0x05, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0980, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0A88, 0x05, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0A80, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0B88, 0x05, 0x00, CSIPHY_DEFAULT_PARAMS},
+ {0x0B80, 0x60, 0x00, CSIPHY_DEFAULT_PARAMS},
+
},
}
}
diff --git a/drivers/media/platform/msm/camera/cam_sensor_module/cam_res_mgr/cam_res_mgr.c b/drivers/media/platform/msm/camera/cam_sensor_module/cam_res_mgr/cam_res_mgr.c
index 91b19c8f7ff0..1fcb06105e5e 100644
--- a/drivers/media/platform/msm/camera/cam_sensor_module/cam_res_mgr/cam_res_mgr.c
+++ b/drivers/media/platform/msm/camera/cam_sensor_module/cam_res_mgr/cam_res_mgr.c
@@ -675,6 +675,9 @@ static int cam_res_mgr_probe(struct platform_device *pdev)
{
int rc = 0;
+ if (cam_res)
+ return 0;
+
cam_res = kzalloc(sizeof(*cam_res), GFP_KERNEL);
if (!cam_res)
return -ENOMEM;
diff --git a/drivers/media/platform/msm/camera/cam_smmu/cam_smmu_api.c b/drivers/media/platform/msm/camera/cam_smmu/cam_smmu_api.c
index 139884e95d84..f107d6b36ff3 100644
--- a/drivers/media/platform/msm/camera/cam_smmu/cam_smmu_api.c
+++ b/drivers/media/platform/msm/camera/cam_smmu/cam_smmu_api.c
@@ -176,6 +176,8 @@ struct cam_dma_buff_info {
struct cam_sec_buff_info {
struct dma_buf *buf;
+ struct dma_buf_attachment *attach;
+ struct sg_table *table;
enum dma_data_direction dir;
int ref_count;
dma_addr_t paddr;
@@ -2514,6 +2516,8 @@ static int cam_smmu_map_stage2_buffer_and_add_to_list(int idx, int ion_fd,
mapping_info->dir = dma_dir;
mapping_info->ref_count = 1;
mapping_info->buf = dmabuf;
+ mapping_info->attach = attach;
+ mapping_info->table = table;
CAM_DBG(CAM_SMMU, "idx=%d, ion_fd=%d, dev=%pK, paddr=%pK, len=%u",
idx, ion_fd,
@@ -2617,6 +2621,9 @@ static int cam_smmu_secure_unmap_buf_and_remove_from_list(
CAM_ERR(CAM_SMMU, "Error: List doesn't exist");
return -EINVAL;
}
+ dma_buf_unmap_attachment(mapping_info->attach, mapping_info->table,
+ mapping_info->dir);
+ dma_buf_detach(mapping_info->buf, mapping_info->attach);
dma_buf_put(mapping_info->buf);
list_del_init(&mapping_info->list);
diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
index 7f60d17819ce..073184f15c64 100644
--- a/drivers/net/ethernet/amd/pcnet32.c
+++ b/drivers/net/ethernet/amd/pcnet32.c
@@ -1548,8 +1548,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
}
pci_set_master(pdev);
- ioaddr = pci_resource_start(pdev, 0);
- if (!ioaddr) {
+ if (!pci_resource_len(pdev, 0)) {
if (pcnet32_debug & NETIF_MSG_PROBE)
pr_err("card has no PCI IO resources, aborting\n");
return -ENODEV;
@@ -1561,6 +1560,8 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
pr_err("architecture does not support 32bit PCI busmaster DMA\n");
return err;
}
+
+ ioaddr = pci_resource_start(pdev, 0);
if (!request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci")) {
if (pcnet32_debug & NETIF_MSG_PROBE)
pr_err("io address range already allocated\n");
diff --git a/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h b/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h
index b248966837b4..7aad40b2aa73 100644
--- a/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h
+++ b/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h
@@ -412,7 +412,7 @@
| CN6XXX_INTR_M0UNWI_ERR \
| CN6XXX_INTR_M1UPB0_ERR \
| CN6XXX_INTR_M1UPWI_ERR \
- | CN6XXX_INTR_M1UPB0_ERR \
+ | CN6XXX_INTR_M1UNB0_ERR \
| CN6XXX_INTR_M1UNWI_ERR \
| CN6XXX_INTR_INSTR_DB_OF_ERR \
| CN6XXX_INTR_SLIST_DB_OF_ERR \
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index a339ea2fd496..8b07890b0b23 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -1482,8 +1482,10 @@ dm9000_probe(struct platform_device *pdev)
/* Init network device */
ndev = alloc_etherdev(sizeof(struct board_info));
- if (!ndev)
- return -ENOMEM;
+ if (!ndev) {
+ ret = -ENOMEM;
+ goto out_regulator_disable;
+ }
SET_NETDEV_DEV(ndev, &pdev->dev);
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 4771dbee9681..66fddc4ba56b 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -891,19 +891,13 @@ static int __ibmvnic_open(struct net_device *netdev)
rc = set_link_state(adapter, IBMVNIC_LOGICAL_LNK_UP);
if (rc) {
- for (i = 0; i < adapter->req_rx_queues; i++)
- napi_disable(&adapter->napi[i]);
+ ibmvnic_napi_disable(adapter);
release_resources(adapter);
return rc;
}
netif_tx_start_all_queues(netdev);
- if (prev_state == VNIC_CLOSED) {
- for (i = 0; i < adapter->req_rx_queues; i++)
- napi_schedule(&adapter->napi[i]);
- }
-
adapter->state = VNIC_OPEN;
return rc;
}
@@ -1432,7 +1426,7 @@ static int do_reset(struct ibmvnic_adapter *adapter,
struct ibmvnic_rwi *rwi, u32 reset_state)
{
struct net_device *netdev = adapter->netdev;
- int i, rc;
+ int rc;
netdev_dbg(adapter->netdev, "Re-setting driver (%d)\n",
rwi->reset_reason);
@@ -1497,10 +1491,6 @@ static int do_reset(struct ibmvnic_adapter *adapter,
/* refresh device's multicast list */
ibmvnic_set_multi(netdev);
- /* kick napi */
- for (i = 0; i < adapter->req_rx_queues; i++)
- napi_schedule(&adapter->napi[i]);
-
if (adapter->reset_reason != VNIC_RESET_FAILOVER)
netdev_notify_peers(netdev);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 3f43e4f0d3b1..e25bb667fb59 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8941,6 +8941,7 @@ static int i40e_sw_init(struct i40e_pf *pf)
{
int err = 0;
int size;
+ u16 pow;
/* Set default capability flags */
pf->flags = I40E_FLAG_RX_CSUM_ENABLED |
@@ -8959,6 +8960,11 @@ static int i40e_sw_init(struct i40e_pf *pf)
pf->rss_table_size = pf->hw.func_caps.rss_table_size;
pf->rss_size_max = min_t(int, pf->rss_size_max,
pf->hw.func_caps.num_tx_qp);
+
+ /* find the next higher power-of-2 of num cpus */
+ pow = roundup_pow_of_two(num_online_cpus());
+ pf->rss_size_max = min_t(int, pf->rss_size_max, pow);
+
if (pf->hw.func_caps.rss) {
pf->flags |= I40E_FLAG_RSS_ENABLED;
pf->alloc_rss_size = min_t(int, pf->rss_size_max,
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index f48006c22a8a..2a9bb13ecb54 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -835,6 +835,9 @@ static int geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
__be16 df;
int err;
+ if (!pskb_network_may_pull(skb, sizeof(struct iphdr)))
+ return -EINVAL;
+
sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);
rt = geneve_get_v4_rt(skb, dev, gs4, &fl4, info,
geneve->info.key.tp_dst, sport);
@@ -882,6 +885,9 @@ static int geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
__be16 sport;
int err;
+ if (!pskb_network_may_pull(skb, sizeof(struct ipv6hdr)))
+ return -EINVAL;
+
sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);
dst = geneve_get_v6_dst(skb, dev, gs6, &fl6, info,
geneve->info.key.tp_dst, sport);
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 0e3d13e192e3..9ae6a1ccfbe1 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -626,7 +626,7 @@ static struct hso_serial *get_serial_by_index(unsigned index)
return serial;
}
-static int get_free_serial_index(void)
+static int obtain_minor(struct hso_serial *serial)
{
int index;
unsigned long flags;
@@ -634,8 +634,10 @@ static int get_free_serial_index(void)
spin_lock_irqsave(&serial_table_lock, flags);
for (index = 0; index < HSO_SERIAL_TTY_MINORS; index++) {
if (serial_table[index] == NULL) {
+ serial_table[index] = serial->parent;
+ serial->minor = index;
spin_unlock_irqrestore(&serial_table_lock, flags);
- return index;
+ return 0;
}
}
spin_unlock_irqrestore(&serial_table_lock, flags);
@@ -644,15 +646,12 @@ static int get_free_serial_index(void)
return -1;
}
-static void set_serial_by_index(unsigned index, struct hso_serial *serial)
+static void release_minor(struct hso_serial *serial)
{
unsigned long flags;
spin_lock_irqsave(&serial_table_lock, flags);
- if (serial)
- serial_table[index] = serial->parent;
- else
- serial_table[index] = NULL;
+ serial_table[serial->minor] = NULL;
spin_unlock_irqrestore(&serial_table_lock, flags);
}
@@ -2241,6 +2240,7 @@ static int hso_stop_serial_device(struct hso_device *hso_dev)
static void hso_serial_tty_unregister(struct hso_serial *serial)
{
tty_unregister_device(tty_drv, serial->minor);
+ release_minor(serial);
}
static void hso_serial_common_free(struct hso_serial *serial)
@@ -2265,25 +2265,23 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs,
int rx_size, int tx_size)
{
struct device *dev;
- int minor;
int i;
tty_port_init(&serial->port);
- minor = get_free_serial_index();
- if (minor < 0)
+ if (obtain_minor(serial))
goto exit2;
/* register our minor number */
serial->parent->dev = tty_port_register_device_attr(&serial->port,
- tty_drv, minor, &serial->parent->interface->dev,
+ tty_drv, serial->minor, &serial->parent->interface->dev,
serial->parent, hso_serial_dev_groups);
- if (IS_ERR(serial->parent->dev))
+ if (IS_ERR(serial->parent->dev)) {
+ release_minor(serial);
goto exit2;
+ }
dev = serial->parent->dev;
- /* fill in specific data for later use */
- serial->minor = minor;
serial->magic = HSO_SERIAL_MAGIC;
spin_lock_init(&serial->serial_lock);
serial->num_rx_urbs = num_urbs;
@@ -2676,9 +2674,6 @@ static struct hso_device *hso_create_bulk_serial_device(
serial->write_data = hso_std_serial_write_data;
- /* and record this serial */
- set_serial_by_index(serial->minor, serial);
-
/* setup the proc dirs and files if needed */
hso_log_port(hso_dev);
@@ -2735,9 +2730,6 @@ struct hso_device *hso_create_mux_serial_device(struct usb_interface *interface,
serial->shared_int->ref_count++;
mutex_unlock(&serial->shared_int->shared_int_lock);
- /* and record this serial */
- set_serial_by_index(serial->minor, serial);
-
/* setup the proc dirs and files if needed */
hso_log_port(hso_dev);
@@ -3121,8 +3113,7 @@ static void hso_free_interface(struct usb_interface *interface)
cancel_work_sync(&serial_table[i]->async_put_intf);
cancel_work_sync(&serial_table[i]->async_get_intf);
hso_serial_tty_unregister(serial);
- kref_put(&serial_table[i]->ref, hso_serial_ref_free);
- set_serial_by_index(i, NULL);
+ kref_put(&serial->parent->ref, hso_serial_ref_free);
}
}
diff --git a/drivers/net/wireless/virt_wifi.c b/drivers/net/wireless/virt_wifi.c
index 45ca9550ee24..c06b11c84732 100644
--- a/drivers/net/wireless/virt_wifi.c
+++ b/drivers/net/wireless/virt_wifi.c
@@ -12,6 +12,7 @@
#include <net/cfg80211.h>
#include <net/rtnetlink.h>
#include <linux/etherdevice.h>
+#include <linux/math64.h>
#include <linux/module.h>
#include <net/cfg80211.h>
@@ -173,11 +174,11 @@ static void virt_wifi_scan_result(struct work_struct *work)
scan_result.work);
struct wiphy *wiphy = priv_to_wiphy(priv);
struct cfg80211_scan_info scan_info = { .aborted = false };
+ u64 tsf = div_u64(ktime_get_boot_ns(), 1000);
informed_bss = cfg80211_inform_bss(wiphy, &channel_5ghz,
CFG80211_BSS_FTYPE_PRESP,
- fake_router_bssid,
- ktime_get_boot_ns(),
+ fake_router_bssid, tsf,
WLAN_CAPABILITY_ESS, 0,
(void *)&ssid, sizeof(ssid),
DBM_TO_MBM(-50), GFP_KERNEL);
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index 910322b442bd..9092b55e087f 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -1043,11 +1043,15 @@ static void connect(struct backend_info *be)
xenvif_carrier_on(be->vif);
unregister_hotplug_status_watch(be);
- err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch, NULL,
- hotplug_status_changed,
- "%s/%s", dev->nodename, "hotplug-status");
- if (!err)
+ if (xenbus_exists(XBT_NIL, dev->nodename, "hotplug-status")) {
+ err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch,
+ NULL, hotplug_status_changed,
+ "%s/%s", dev->nodename,
+ "hotplug-status");
+ if (err)
+ goto err;
be->have_hotplug_status_watch = 1;
+ }
netif_tx_wake_all_queues(be->vif->dev);
diff --git a/drivers/pinctrl/intel/pinctrl-lewisburg.c b/drivers/pinctrl/intel/pinctrl-lewisburg.c
index c2164db14e9c..9fdcae3260e8 100644
--- a/drivers/pinctrl/intel/pinctrl-lewisburg.c
+++ b/drivers/pinctrl/intel/pinctrl-lewisburg.c
@@ -300,9 +300,9 @@ static const struct pinctrl_pin_desc lbg_pins[] = {
static const struct intel_community lbg_communities[] = {
LBG_COMMUNITY(0, 0, 71),
LBG_COMMUNITY(1, 72, 132),
- LBG_COMMUNITY(3, 133, 144),
- LBG_COMMUNITY(4, 145, 180),
- LBG_COMMUNITY(5, 181, 246),
+ LBG_COMMUNITY(3, 133, 143),
+ LBG_COMMUNITY(4, 144, 178),
+ LBG_COMMUNITY(5, 179, 246),
};
static const struct intel_pinctrl_soc_data lbg_soc_data = {
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa.c b/drivers/platform/msm/ipa/ipa_v3/ipa.c
index 2c684f647c8d..7ee304336e91 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa.c
@@ -7262,6 +7262,13 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p,
result = -ENOMEM;
goto fail_hdr_offset_cache;
}
+ ipa3_ctx->fnr_stats_cache = kmem_cache_create("IPA_FNR_STATS",
+ sizeof(struct ipa_ioc_flt_rt_counter_alloc), 0, 0, NULL);
+ if (!ipa3_ctx->fnr_stats_cache) {
+ IPAERR(":ipa fnr stats cache create failed\n");
+ result = -ENOMEM;
+ goto fail_fnr_stats_cache;
+ }
ipa3_ctx->hdr_proc_ctx_cache = kmem_cache_create("IPA_HDR_PROC_CTX",
sizeof(struct ipa3_hdr_proc_ctx_entry), 0, 0, NULL);
if (!ipa3_ctx->hdr_proc_ctx_cache) {
@@ -7519,6 +7526,8 @@ fail_rt_tbl_cache:
fail_hdr_proc_ctx_offset_cache:
kmem_cache_destroy(ipa3_ctx->hdr_proc_ctx_cache);
fail_hdr_proc_ctx_cache:
+ kmem_cache_destroy(ipa3_ctx->fnr_stats_cache);
+fail_fnr_stats_cache:
kmem_cache_destroy(ipa3_ctx->hdr_offset_cache);
fail_hdr_offset_cache:
kmem_cache_destroy(ipa3_ctx->hdr_cache);
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h
index 7d3a95120462..bff5a7ffc3fe 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h
@@ -1775,6 +1775,7 @@ struct ipa3_app_clock_vote {
* @rt_rule_cache: routing rule cache
* @hdr_cache: header cache
* @hdr_offset_cache: header offset cache
+ * @fnr_stats_cache: FnR stats cache
* @hdr_proc_ctx_cache: processing context cache
* @hdr_proc_ctx_offset_cache: processing context offset cache
* @rt_tbl_cache: routing table cache
@@ -1870,6 +1871,7 @@ struct ipa3_context {
struct kmem_cache *rt_rule_cache;
struct kmem_cache *hdr_cache;
struct kmem_cache *hdr_offset_cache;
+ struct kmem_cache *fnr_stats_cache;
struct kmem_cache *hdr_proc_ctx_cache;
struct kmem_cache *hdr_proc_ctx_offset_cache;
struct kmem_cache *rt_tbl_cache;
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_pm.c b/drivers/platform/msm/ipa/ipa_v3/ipa_pm.c
index 350199cc60b1..f5c7e0662bb3 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_pm.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_pm.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -1254,14 +1254,15 @@ int ipa_pm_set_throughput(u32 hdl, int throughput)
return -EINVAL;
}
+ mutex_lock(&ipa_pm_ctx->client_mutex);
if (hdl >= IPA_PM_MAX_CLIENTS || ipa_pm_ctx->clients[hdl] == NULL
|| throughput < 0) {
IPA_PM_ERR("Invalid Params\n");
+ mutex_unlock(&ipa_pm_ctx->client_mutex);
return -EINVAL;
}
client = ipa_pm_ctx->clients[hdl];
- mutex_lock(&ipa_pm_ctx->client_mutex);
if (client->group == IPA_PM_GROUP_DEFAULT)
IPA_PM_DBG_LOW("Old throughput: %d\n", client->throughput);
else
@@ -1280,14 +1281,16 @@ int ipa_pm_set_throughput(u32 hdl, int throughput)
client->group, ipa_pm_ctx->group_tput[client->group]);
mutex_unlock(&ipa_pm_ctx->client_mutex);
- spin_lock_irqsave(&client->state_lock, flags);
- if (IPA_PM_STATE_ACTIVE(client->state) || (client->group !=
+ if (ipa_pm_ctx->clients[hdl]) {
+ spin_lock_irqsave(&client->state_lock, flags);
+ if (IPA_PM_STATE_ACTIVE(client->state) || (client->group !=
IPA_PM_GROUP_DEFAULT)) {
+ spin_unlock_irqrestore(&client->state_lock, flags);
+ do_clk_scaling();
+ return 0;
+ }
spin_unlock_irqrestore(&client->state_lock, flags);
- do_clk_scaling();
- return 0;
}
- spin_unlock_irqrestore(&client->state_lock, flags);
return 0;
}
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c b/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c
index 653e1e694107..f404218fee76 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c
@@ -6363,13 +6363,21 @@ static int __ipa3_alloc_counter_hdl
return id;
}
-int ipa3_alloc_counter_id(struct ipa_ioc_flt_rt_counter_alloc *counter)
+int ipa3_alloc_counter_id(struct ipa_ioc_flt_rt_counter_alloc *header)
{
int i, unused_cnt, unused_max, unused_start_id;
+ struct ipa_ioc_flt_rt_counter_alloc *counter;
idr_preload(GFP_KERNEL);
spin_lock(&ipa3_ctx->flt_rt_counters.hdl_lock);
+ counter = kmem_cache_zalloc(ipa3_ctx->fnr_stats_cache, GFP_KERNEL);
+ if (!counter) {
+ IPAERR_RL("failed to alloc fnr stats counter object\n");
+ spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock);
+ return -ENOMEM;
+ }
+ memcpy(counter, header, sizeof(struct ipa_ioc_flt_rt_counter_alloc));
/* allocate hw counters */
counter->hw_counter.start_id = 0;
counter->hw_counter.end_id = 0;
@@ -6469,7 +6477,7 @@ mark_hw_cnt:
unused_start_id = counter->hw_counter.start_id;
if (unused_start_id < 1 ||
unused_start_id > IPA_FLT_RT_HW_COUNTER) {
- IPAERR("unexpected hw_counter start id %d\n",
+ IPAERR_RL("unexpected hw_counter start id %d\n",
unused_start_id);
goto err;
}
@@ -6484,7 +6492,7 @@ mark_sw_cnt:
- IPA_FLT_RT_HW_COUNTER;
if (unused_start_id < 1 ||
unused_start_id > IPA_FLT_RT_SW_COUNTER) {
- IPAERR("unexpected sw_counter start id %d\n",
+ IPAERR_RL("unexpected sw_counter start id %d\n",
unused_start_id);
goto err;
}
@@ -6494,12 +6502,14 @@ mark_sw_cnt:
done:
/* get a handle from idr for dealloc */
counter->hdl = __ipa3_alloc_counter_hdl(counter);
+ memcpy(header, counter, sizeof(struct ipa_ioc_flt_rt_counter_alloc));
spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock);
idr_preload_end();
return 0;
err:
counter->hdl = -1;
+ kmem_cache_free(ipa3_ctx->fnr_stats_cache, counter);
spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock);
idr_preload_end();
return -ENOMEM;
@@ -6513,7 +6523,7 @@ void ipa3_counter_remove_hdl(int hdl)
spin_lock(&ipa3_ctx->flt_rt_counters.hdl_lock);
counter = idr_find(&ipa3_ctx->flt_rt_counters.hdl, hdl);
if (counter == NULL) {
- IPAERR("unexpected hdl %d\n", hdl);
+ IPAERR_RL("unexpected hdl %d\n", hdl);
goto err;
}
/* remove counters belong to this hdl, set used back to 0 */
@@ -6523,7 +6533,7 @@ void ipa3_counter_remove_hdl(int hdl)
memset(&ipa3_ctx->flt_rt_counters.used_hw + offset,
0, counter->hw_counter.num_counters * sizeof(bool));
} else {
- IPAERR("unexpected hdl %d\n", hdl);
+ IPAERR_RL("unexpected hdl %d\n", hdl);
goto err;
}
offset = counter->sw_counter.start_id - 1 - IPA_FLT_RT_HW_COUNTER;
@@ -6532,11 +6542,12 @@ void ipa3_counter_remove_hdl(int hdl)
memset(&ipa3_ctx->flt_rt_counters.used_sw + offset,
0, counter->sw_counter.num_counters * sizeof(bool));
} else {
- IPAERR("unexpected hdl %d\n", hdl);
+ IPAERR_RL("unexpected hdl %d\n", hdl);
goto err;
}
/* remove the handle */
idr_remove(&ipa3_ctx->flt_rt_counters.hdl, hdl);
+ kmem_cache_free(ipa3_ctx->fnr_stats_cache, counter);
err:
spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock);
}
@@ -6553,8 +6564,10 @@ void ipa3_counter_id_remove_all(void)
memset(&ipa3_ctx->flt_rt_counters.used_sw, 0,
sizeof(ipa3_ctx->flt_rt_counters.used_sw));
/* remove all handles */
- idr_for_each_entry(&ipa3_ctx->flt_rt_counters.hdl, counter, hdl)
+ idr_for_each_entry(&ipa3_ctx->flt_rt_counters.hdl, counter, hdl) {
idr_remove(&ipa3_ctx->flt_rt_counters.hdl, hdl);
+ kmem_cache_free(ipa3_ctx->fnr_stats_cache, counter);
+ }
spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock);
}
@@ -7079,7 +7092,7 @@ u32 ipa3_get_num_pipes(void)
/**
* ipa3_disable_apps_wan_cons_deaggr()-
- * set ipa_ctx->ipa_client_apps_wan_cons_agg_gro
+ * set ipa3_ctx->ipa_client_apps_wan_cons_agg_gro
*
* Return value: 0 or negative in case of failure
*/
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index 470e11b42820..9eb61a41be24 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -219,18 +219,17 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len);
task->total_xfer_len = qc->nbytes;
task->num_scatter = qc->n_elem;
+ task->data_dir = qc->dma_dir;
+ } else if (qc->tf.protocol == ATA_PROT_NODATA) {
+ task->data_dir = DMA_NONE;
} else {
for_each_sg(qc->sg, sg, qc->n_elem, si)
xfer += sg_dma_len(sg);
task->total_xfer_len = xfer;
task->num_scatter = si;
- }
-
- if (qc->tf.protocol == ATA_PROT_NODATA)
- task->data_dir = DMA_NONE;
- else
task->data_dir = qc->dma_dir;
+ }
task->scatter = qc->sg;
task->ata_task.retry_count = 1;
task->task_state_flags = SAS_TASK_STATE_PENDING;
diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c
index a0e35028ebda..118e764108f7 100644
--- a/drivers/scsi/scsi_transport_srp.c
+++ b/drivers/scsi/scsi_transport_srp.c
@@ -555,7 +555,7 @@ int srp_reconnect_rport(struct srp_rport *rport)
res = mutex_lock_interruptible(&rport->mutex);
if (res)
goto out;
- if (rport->state != SRP_RPORT_FAIL_FAST)
+ if (rport->state != SRP_RPORT_FAIL_FAST && rport->state != SRP_RPORT_LOST)
/*
* sdev state must be SDEV_TRANSPORT_OFFLINE, transition
* to SDEV_BLOCK is illegal. Calling scsi_target_unblock()
diff --git a/drivers/soc/qcom/pil-q6v5-mss.c b/drivers/soc/qcom/pil-q6v5-mss.c
index f36835a90404..14170a88ea0e 100644
--- a/drivers/soc/qcom/pil-q6v5-mss.c
+++ b/drivers/soc/qcom/pil-q6v5-mss.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -166,9 +166,11 @@ static void modem_crash_shutdown(const struct subsys_desc *subsys)
drv->crash_shutdown = true;
if (!subsys_get_crash_status(drv->subsys) &&
- subsys->force_stop_bit) {
+ subsys->state) {
qcom_smem_state_update_bits(subsys->state,
- BIT(subsys->force_stop_bit), 1);
+ BIT(subsys->force_stop_bit),
+ BIT(subsys->force_stop_bit));
+ drv->ignore_errors = true;
msleep(STOP_ACK_TIMEOUT_MS);
}
}
diff --git a/drivers/staging/fw-api/fw/htt.h b/drivers/staging/fw-api/fw/htt.h
index 2d92b288a40e..df354344e1c1 100644
--- a/drivers/staging/fw-api/fw/htt.h
+++ b/drivers/staging/fw-api/fw/htt.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -209,9 +209,11 @@
* 3.85 Add HTT_RX_PEER_META_DATA defs.
* 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
* 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
+ * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
+ * 3.89 Add MSDU queue enumerations.
*/
#define HTT_CURRENT_VERSION_MAJOR 3
-#define HTT_CURRENT_VERSION_MINOR 87
+#define HTT_CURRENT_VERSION_MINOR 89
#define HTT_NUM_TX_FRAG_DESC 1024
@@ -523,6 +525,7 @@ enum htt_h2t_msg_type {
HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
+ HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
/* keep this last */
HTT_H2T_NUM_MSGS
@@ -546,6 +549,9 @@ enum htt_h2t_msg_type {
/**
* @brief host -> target version number request message definition
*
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
+ *
+ *
* |31 24|23 16|15 8|7 0|
* |----------------+----------------+----------------+----------------|
* | reserved | msg type |
@@ -566,7 +572,7 @@ enum htt_h2t_msg_type {
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as a version number request message
- * Value: 0x0
+ * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
*/
#define HTT_VER_REQ_BYTES 4
@@ -578,6 +584,8 @@ enum htt_h2t_msg_type {
/**
* @brief HTT tx MSDU descriptor
*
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
+ *
* @details
* The HTT tx MSDU descriptor is created by the host HTT SW for each
* tx MSDU. The HTT tx MSDU descriptor contains the information that
@@ -2718,7 +2726,13 @@ PREPACK struct htt_tx_flow_metadata {
/**
- * @brief Used in HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY and HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY messages
+ * @brief host -> target ADD WDS Entry
+ *
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
+ *
+ * @brief host -> target DELETE WDS Entry
+ *
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
*
* @details
* HTT wds entry from source port learning
@@ -2742,8 +2756,8 @@ PREPACK struct htt_tx_flow_metadata {
* The message is interpreted as follows:
*
* dword0 - b'0:7 - msg_type: This will be set to
- * HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY or
- * HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
+ * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
+ * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
*
* dword0 - b'8:15 - vdev_id
*
@@ -2824,6 +2838,9 @@ PREPACK struct htt_wds_entry {
/**
* @brief MAC DMA rx ring setup specification
+ *
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
+ *
* @details
* To allow for dynamic rx ring reconfiguration and to avoid race
* conditions, the host SW never directly programs the MAC DMA rx ring(s)
@@ -2865,7 +2882,7 @@ PREPACK struct htt_wds_entry {
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as an rx ring configuration message
- * Value: 0x2
+ * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
* - NUM_RINGS
* Bits 15:8
* Purpose: indicates whether the host is setting up one rx ring or two
@@ -3333,6 +3350,8 @@ PREPACK struct htt_wds_entry {
/**
* @brief host -> target FW statistics retrieve
*
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
+ *
* @details
* The following field definitions describe the format of the HTT host
* to target FW stats retrieve message. The message specifies the type of
@@ -3354,7 +3373,7 @@ PREPACK struct htt_wds_entry {
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this is a stats upload request message
- * Value: 0x3
+ * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
* - UPLOAD_TYPES
* Bits 31:8
* Purpose: identifies which types of FW statistics to upload
@@ -3443,6 +3462,8 @@ PREPACK struct htt_wds_entry {
/**
* @brief host -> target HTT out-of-band sync request
*
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
+ *
* @details
* The HTT SYNC tells the target to suspend processing of subsequent
* HTT host-to-target messages until some other target agent locally
@@ -3464,7 +3485,7 @@ PREPACK struct htt_wds_entry {
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as a sync message
- * Value: 0x4
+ * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
* - SYNC_COUNT
* Bits 15:8
* Purpose: specifies what sync value the HTT FW will wait for from
@@ -3492,7 +3513,9 @@ PREPACK struct htt_wds_entry {
/**
- * @brief HTT aggregation configuration
+ * @brief host -> target HTT aggregation configuration
+ *
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
*/
#define HTT_AGGR_CFG_MSG_SZ 4
@@ -3523,6 +3546,8 @@ PREPACK struct htt_wds_entry {
/**
* @brief host -> target HTT configure max amsdu info per vdev
*
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
+ *
* @details
* The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
*
@@ -3534,7 +3559,7 @@ PREPACK struct htt_wds_entry {
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as a aggr cfg ex message
- * Value: 0xa
+ * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
* - MAX_NUM_AMSDU_SUBFRM
* Bits 15:8
* Purpose: max MSDUs per A-MSDU
@@ -3570,6 +3595,8 @@ PREPACK struct htt_wds_entry {
/**
* @brief HTT WDI_IPA Config Message
*
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
+ *
* @details
* The HTT WDI_IPA config message is created/sent by host at driver
* init time. It contains information about data structures used on
@@ -3649,7 +3676,7 @@ PREPACK struct htt_wds_entry {
* - MSG_TYPE
* Bits 7:0
* Purpose: Identifies this as WDI_IPA config message
- * value: = 0x8
+ * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
* - TX_PKT_POOL_SIZE
* Bits 15:0
* Purpose: Total number of TX packet buffer pool allocated by Host for
@@ -4246,6 +4273,8 @@ enum htt_wdi_ipa_op_code {
/**
* @brief HTT WDI_IPA Operation Request Message
*
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
+ *
* @details
* HTT WDI_IPA Operation Request message is sent by host
* to either suspend or resume WDI_IPA TX or RX path.
@@ -4258,7 +4287,7 @@ enum htt_wdi_ipa_op_code {
* - MSG_TYPE
* Bits 7:0
* Purpose: Identifies this as WDI_IPA Operation Request message
- * value: = 0x9
+ * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
* - OP_CODE
* Bits 31:16
* Purpose: Identifies operation host is requesting (e.g. TX suspend)
@@ -4290,6 +4319,8 @@ PREPACK struct htt_wdi_ipa_op_request_t
/*
* @brief host -> target HTT_SRING_SETUP message
*
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
+ *
* @details
* After target is booted up, Host can send SRING setup message for
* each host facing LMAC SRING. Target setups up HW registers based
@@ -4336,7 +4367,7 @@ PREPACK struct htt_wdi_ipa_op_request_t
*
* The message is interpreted as follows:
* dword0 - b'0:7 - msg_type: This will be set to
- * HTT_H2T_MSG_TYPE_SRING_SETUP
+ * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
* b'8:15 - pdev_id:
* 0 (for rings at SOC/UMAC level),
* 1/2/3 mac id (for rings at LMAC level)
@@ -4795,7 +4826,9 @@ enum htt_srng_ring_id {
/**
- * @brief HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
+ * @brief host -> target RX ring selection config message
+ *
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
*
* @details
* HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
@@ -4839,7 +4872,7 @@ enum htt_srng_ring_id {
* DT = drop_thresh_valid
* The message is interpreted as follows:
* dword0 - b'0:7 - msg_type: This will be set to
- * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
+ * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
* b'8:15 - pdev_id:
* 0 (for rings at SOC/UMAC level),
* 1/2/3 mac id (for rings at LMAC level)
@@ -5637,7 +5670,10 @@ PREPACK struct htt_rx_ring_selection_cfg_t {
word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
/**
- * @brief HTT_H2T_MSG_TYPE_RFS_CONFIG
+ * @brief host --> target Receive Flow Steering configuration message definition
+ *
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
+ *
* host --> target Receive Flow Steering configuration message definition.
* Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
* The reason for this is we want RFS to be configured and ready before MAC
@@ -5678,6 +5714,8 @@ PREPACK struct htt_rx_ring_selection_cfg_t {
/**
* @brief host -> target FW extended statistics retrieve
*
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
+ *
* @details
* The following field definitions describe the format of the HTT host
* to target FW extended stats retrieve message.
@@ -5705,7 +5743,7 @@ PREPACK struct htt_rx_ring_selection_cfg_t {
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this is a extended stats upload request message
- * Value: 0x10
+ * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
* - PDEV_MASK
* Bits 8:15
* Purpose: identifies the mask of PDEVs to retrieve stats from
@@ -5794,6 +5832,8 @@ PREPACK struct htt_rx_ring_selection_cfg_t {
/**
* @brief host -> target FW PPDU_STATS request message
*
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
+ *
* @details
* The following field definitions describe the format of the HTT host
* to target FW for PPDU_STATS_CFG msg.
@@ -5808,7 +5848,7 @@ PREPACK struct htt_rx_ring_selection_cfg_t {
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this is a req to configure ppdu_stats_ind from target
- * Value: 0x11
+ * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
* - PDEV_MASK
* Bits 8:15
* Purpose: identifies which pdevs this PPDU stats configuration applies to
@@ -5854,6 +5894,9 @@ PREPACK struct htt_rx_ring_selection_cfg_t {
/**
* @brief Host-->target HTT RX FSE setup message
+ *
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
+ *
* @details
* Through this message, the host will provide details of the flow tables
* in host DDR along with hash keys.
@@ -5868,7 +5911,7 @@ PREPACK struct htt_rx_ring_selection_cfg_t {
*
* Header fields:
* dword0 - b'7:0 - msg_type: This will be set to
- * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
+ * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
* b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
* 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
* pdev's LMAC ring.
@@ -5945,6 +5988,9 @@ enum htt_ip_da_sa_prefix {
/**
* @brief Host-->target HTT RX FISA configure and enable
+ *
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
+ *
* @details
* The host will send this command down to configure and enable the FISA
* operational params.
@@ -5952,8 +5998,8 @@ enum htt_ip_da_sa_prefix {
* register.
* Should configure both the MACs.
*
- * dword0 - b'7:0 - msg_type: This will be set to HTT_H2T_MSG_TYPE_RX_FISA_CFG
- *
+ * dword0 - b'7:0 - msg_type:
+ * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
* b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
* 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
* pdev's LMAC ring.
@@ -6404,6 +6450,9 @@ PREPACK struct htt_h2t_msg_rx_fse_setup_t {
/**
* @brief Host-->target HTT RX FSE operation message
+ *
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
+ *
* @details
* The host will send this Flow Search Engine (FSE) operation message for
* every flow add/delete operation.
@@ -6448,7 +6497,7 @@ PREPACK struct htt_h2t_msg_rx_fse_setup_t {
*
* Header fields:
* dword0 - b'7:0 - msg_type: This will be set to
- * HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
+ * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
* b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
* 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
* specified pdev's LMAC ring.
@@ -6527,6 +6576,9 @@ PREPACK struct htt_h2t_msg_rx_fse_operation_t {
/**
* @brief Host-->target HTT RX Full monitor mode register configuration message
+ *
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
+ *
* @details
* The host will send this Full monitor mode register configuration message.
* This message can be sent per SOC or per PDEV which is differentiated
@@ -6548,7 +6600,7 @@ PREPACK struct htt_h2t_msg_rx_fse_operation_t {
*
* Header fields:
* dword0 - b'7:0 - msg_type: This will be set to
- * HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE.
+ * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
* b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
* 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
* specified pdev's LMAC ring.
@@ -6779,8 +6831,9 @@ enum htt_rx_fse_operation {
/**
- * @brief HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
- * host --> target Receive to configure the RxOLE 3-tuple Hash
+ * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
+ *
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
*
* |31 24|23 |15 8|7 2|1|0|
* |----------------+----------------+----------------+----------------|
@@ -6798,7 +6851,7 @@ enum htt_rx_fse_operation {
*
* Header fields:
* dword0 - b'7:0 - msg_type: This will be set to
- * HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
+ * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
* b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
* 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
* specified pdev's LMAC ring.
@@ -6869,6 +6922,83 @@ PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
#define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
+/**
+ * @brief host --> target Host PA Address Size
+ *
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
+ *
+ * @details
+ * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
+ * provide the physical start address and size of each of the memory
+ * areas within host DDR that the target FW may need to access.
+ *
+ * For example, the host can use this message to allow the target FW
+ * to set up access to the host's pools of TQM link descriptors.
+ * The message would appear as follows:
+ *
+ * |31 24|23 16|15 8|7 0|
+ * |----------------+----------------+----------------+----------------|
+ * | reserved | num_entries | msg_type |
+ * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
+ * | mem area 0 size |
+ * |----------------+----------------+----------------+----------------|
+ * | mem area 0 physical_address_lo |
+ * |----------------+----------------+----------------+----------------|
+ * | mem area 0 physical_address_hi |
+ * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
+ * | mem area 1 size |
+ * |----------------+----------------+----------------+----------------|
+ * | mem area 1 physical_address_lo |
+ * |----------------+----------------+----------------+----------------|
+ * | mem area 1 physical_address_hi |
+ * |----------------+----------------+----------------+----------------|
+ * ...
+ * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
+ * | mem area N size |
+ * |----------------+----------------+----------------+----------------|
+ * | mem area N physical_address_lo |
+ * |----------------+----------------+----------------+----------------|
+ * | mem area N physical_address_hi |
+ * |----------------+----------------+----------------+----------------|
+ *
+ * The message is interpreted as follows:
+ * dword0 - b'0:7 - msg_type: This will be set to
+ * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
+ * b'8:15 - number_entries: Indicated the number of host memory
+ * areas specified within the remainder of the message
+ * b'16:31 - reserved.
+ * dword1 - b'0:31 - memory area 0 size in bytes
+ * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
+ * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
+ * and similar for memory area 1 through memory area N.
+ */
+
+PREPACK struct htt_h2t_host_paddr_size {
+ A_UINT32 msg_type: 8,
+ num_entries: 8,
+ reserved: 16;
+} POSTPACK;
+
+PREPACK struct htt_h2t_host_paddr_size_entry_t {
+ A_UINT32 size;
+ A_UINT32 physical_address_lo;
+ A_UINT32 physical_address_hi;
+} POSTPACK;
+
+#define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
+
+#define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
+#define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
+
+#define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
+ (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
+ HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
+
+#define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
+ do { \
+ HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
+ ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
+ } while (0)
/*=== target -> host messages ===============================================*/
@@ -6945,6 +7075,8 @@ enum htt_t2h_msg_type {
/**
* @brief target -> host version number confirmation message definition
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
+ *
* |31 24|23 16|15 8|7 0|
* |----------------+----------------+----------------+----------------|
* | reserved | major number | minor number | msg type |
@@ -6965,7 +7097,7 @@ enum htt_t2h_msg_type {
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as a version number confirmation message
- * Value: 0x0
+ * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
* - VER_MINOR
* Bits 15:8
* Purpose: Specify the minor number of the HTT message library version
@@ -7017,6 +7149,8 @@ enum htt_t2h_msg_type {
/**
* @brief - target -> host HTT Rx In order indication message
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
+ *
* @details
*
* |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
@@ -7443,6 +7577,8 @@ A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
/**
* @brief target -> host rx indication message definition
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
+ *
* @details
* The following field definitions describe the format of the rx indication
* message sent from the target to the host.
@@ -7519,7 +7655,7 @@ A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as an rx indication message
- * Value: 0x1
+ * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
* - EXT_TID
* Bits 12:8
* Purpose: identify the traffic ID of the rx data, including
@@ -8327,9 +8463,10 @@ PREPACK struct htt_chan_info_t
(((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
/*
- * HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
* @brief target -> host message definition for FW offloaded pkts
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
+ *
* @details
* The following field definitions describe the format of the firmware
* offload deliver message sent from the target to the host.
@@ -8655,6 +8792,8 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
/*
* @brief target -> host rx reorder flush message definition
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
+ *
* @details
* The following field definitions describe the format of the rx flush
* message sent from the target to the host.
@@ -8671,7 +8810,7 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as an rx flush message
- * Value: 0x2
+ * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
* - PEER_ID
* Bits 23:8 (only bits 18:8 actually used)
* Purpose: identify which peer's rx data is being flushed
@@ -8774,6 +8913,8 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
/*
* @brief target -> host rx pn check indication message
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
+ *
* @details
* The following field definitions describe the format of the Rx PN check
* indication message sent from the target to the host.
@@ -8795,7 +8936,7 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
* - MSG_TYPE
* Bits 7:0
* Purpose: Identifies this as an rx pn check indication message
- * Value: 0x2
+ * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
* - PEER_ID
* Bits 23:8 (only bits 18:8 actually used)
* Purpose: identify which peer
@@ -8900,6 +9041,8 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
/*
* @brief target -> host rx offload deliver message for LL system
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
+ *
* @details
* In a low latency system this message is sent whenever the offload
* manager flushes out the packets it has coalesced in its coalescing buffer.
@@ -9015,6 +9158,8 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
/**
* @brief target -> host rx peer map/unmap message definition
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
+ *
* @details
* The following diagram shows the format of the rx peer map message sent
* from the target to the host. This layout assumes the target operates
@@ -9050,6 +9195,8 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
* |-----------------------------------------------------------------------|
*
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
+ *
* The following diagram shows the format of the rx peer unmap message sent
* from the target to the host.
*
@@ -9063,7 +9210,8 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as an rx peer map or peer unmap message
- * Value: peer map -> 0x3, peer unmap -> 0x4
+ * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
+ * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
* - VDEV_ID
* Bits 15:8
* Purpose: Indicates which virtual device the peer is associated
@@ -9154,6 +9302,8 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
/**
* @brief target -> host rx peer map V2 message definition
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
+ *
* @details
* The following diagram shows the format of the rx peer map v2 message sent
* from the target to the host. This layout assumes the target operates
@@ -9211,7 +9361,7 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as an rx peer map v2 message
- * Value: peer map v2 -> 0x1e
+ * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
* - VDEV_ID
* Bits 15:8
* Purpose: Indicates which virtual device the peer is associated with.
@@ -9482,6 +9632,7 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
/**
* @brief target -> host rx peer unmap V2 message definition
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
*
* The following diagram shows the format of the rx peer unmap message sent
* from the target to the host.
@@ -9509,7 +9660,7 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as an rx peer unmap v2 message
- * Value: peer unmap v2 -> 0x1f
+ * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
* - VDEV_ID
* Bits 15:8
* Purpose: Indicates which virtual device the peer is associated
@@ -9593,6 +9744,8 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
/**
* @brief target -> host message specifying security parameters
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
+ *
* @details
* The following diagram shows the format of the security specification
* message sent from the target to the host.
@@ -9624,7 +9777,7 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as a security specification message
- * Value: 0xb
+ * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
* - SEC_TYPE
* Bits 14:8
* Purpose: specifies which type of security applies to the peer
@@ -9701,6 +9854,8 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
/**
* @brief target -> host rx ADDBA / DELBA message definitions
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
+ *
* @details
* The following diagram shows the format of the rx ADDBA message sent
* from the target to the host:
@@ -9710,6 +9865,8 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
* | peer ID | TID | window size | msg type |
* |---------------------------------------------------------------------|
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
+ *
* The following diagram shows the format of the rx DELBA message sent
* from the target to the host:
*
@@ -9723,7 +9880,8 @@ PREPACK struct htt_tx_offload_deliver_ind_hdr_t
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as an rx ADDBA or DELBA message
- * Value: ADDBA -> 0x5, DELBA -> 0x6
+ * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
+ * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
* - IR (initiator / recipient)
* Bits 9:8 (DELBA only)
* Purpose: specify whether the DELBA handshake was initiated by the
@@ -9973,6 +10131,8 @@ PREPACK struct htt_txq_group {
/**
* @brief target -> host TX completion indication message definition
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
+ *
* @details
* The following diagram shows the format of the TX completion indication sent
* from the target to the host
@@ -10021,7 +10181,7 @@ PREPACK struct htt_txq_group {
* - msg_type
* Bits 7:0
* Purpose: identifies this as HTT TX completion indication
- * Value: 0x7
+ * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
* - status
* Bits 10:8
* Purpose: the TX completion status of payload fragmentations descriptors
@@ -10477,6 +10637,8 @@ PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
/**
* @brief target -> host rate-control update indication message
*
+ * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
+ *
* @details
* The following diagram shows the format of the RC Update message
* sent from the target to the host, while processing the tx-completion
@@ -10566,6 +10728,8 @@ typedef struct {
/**
* @brief target -> host rx fragment indication message definition
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
+ *
* @details
* The following field definitions describe the format of the rx fragment
* indication message sent from the target to the host.
@@ -10591,7 +10755,7 @@ typedef struct {
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as an rx fragment indication message
- * Value: 0xa
+ * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
* - EXT_TID
* Bits 12:8
* Purpose: identify the traffic ID of the rx data, including
@@ -10671,6 +10835,8 @@ typedef struct {
/**
* @brief target -> host test message definition
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
+ *
* @details
* The following field definitions describe the format of the test
* message sent from the target to the host.
@@ -10727,6 +10893,8 @@ typedef struct {
/**
* @brief target -> host packet log message
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
+ *
* @details
* The following field definitions describe the format of the packet log
* message sent from the target to the host.
@@ -10742,7 +10910,7 @@ typedef struct {
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as a pktlog message
- * Value: HTT_T2H_MSG_TYPE_PKTLOG
+ * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
* - mac_id
* Bits 9:8
* Purpose: identifies which MAC/PHY instance generated this pktlog info
@@ -11009,6 +11177,8 @@ enum htt_dbg_stats_status {
/**
* @brief target -> host statistics upload
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
+ *
* @details
* The following field definitions describe the format of the HTT target
* to host stats upload confirmation message.
@@ -11049,7 +11219,7 @@ enum htt_dbg_stats_status {
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this is a statistics upload confirmation message
- * Value: 0x9
+ * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
* - COOKIE_LSBS
* Bits 31:0
* Purpose: Provide a mechanism to match a target->host stats confirmation
@@ -11131,6 +11301,8 @@ enum htt_dbg_stats_status {
/**
* @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
*
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
+ *
* @details
* The following field definitions describe the format of the HTT host
* to target frag_desc/msdu_ext bank configuration message.
@@ -11170,7 +11342,7 @@ enum htt_dbg_stats_status {
* Header fields:
* - MSG_TYPE
* Bits 7:0
- * Value: 0x6
+ * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
* for systems with 64-bit format for bus addresses:
* - BANKx_BASE_ADDRESS_LO
* Bits 31:0
@@ -11317,6 +11489,8 @@ TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
/**
* @brief target -> host HTT TX Credit total count update message definition
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
+ *
*|31 16|15|14 9| 8 |7 0 |
*|---------------------+--+----------+-------+----------|
*|cur htt credit delta | Q| reserved | sign | msg type |
@@ -11326,7 +11500,7 @@ TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as a htt tx credit delta update message
- * Value: 0xe
+ * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
* - SIGN
* Bits 8
* identifies whether credit delta is positive or negative
@@ -11392,6 +11566,8 @@ TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
/**
* @brief HTT WDI_IPA Operation Response Message
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
+ *
* @details
* HTT WDI_IPA Operation Response message is sent by target
* to host confirming suspend or resume operation.
@@ -11410,7 +11586,7 @@ TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
* - MSG_TYPE
* Bits 7:0
* Purpose: Identifies this as WDI_IPA Operation Response message
- * value: = 0x13
+ * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
* - OP_CODE
* Bits 31:16
* Purpose: Identifies the operation target is responding to (e.g. TX suspend)
@@ -11483,6 +11659,9 @@ enum htt_phy_mode {
/**
* @brief target -> host HTT channel change indication
+ *
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
+ *
* @details
* Specify when a channel change occurs.
* This allows the host to precisely determine which rx frames arrived
@@ -11505,7 +11684,7 @@ enum htt_phy_mode {
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as a htt channel change indication message
- * Value: 0x15
+ * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
* - PRIMARY_CHAN_CENTER_FREQ_MHZ
* Bits 31:0
* Purpose: identify the (center of the) new 20 MHz primary channel
@@ -11545,6 +11724,20 @@ PREPACK struct htt_chan_change_t
A_UINT32 contig_chan2_center_freq_mhz;
A_UINT32 phy_mode;
} POSTPACK;
+/*
+ * Due to historical / backwards-compatibility reasons, maintain the
+ * below htt_chan_change_msg struct definition, which needs to be
+ * consistent with the above htt_chan_change_t struct definition
+ * (aside from the htt_chan_change_t definition including the msg_type
+ * dword within the message, and the htt_chan_change_msg only containing
+ * the payload of the message that follows the msg_type dword).
+ */
+PREPACK struct htt_chan_change_msg {
+ A_UINT32 chan_mhz; /* frequency in mhz */
+ A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
+ A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
+ A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
+} POSTPACK;
#define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
#define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
@@ -11598,6 +11791,8 @@ PREPACK struct htt_chan_change_t
/**
* @brief rx offload packet error message
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
+ *
* @details
* HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
* of target payload like mic err.
@@ -11828,7 +12023,9 @@ enum htt_rx_ofld_pkt_err_type {
} while (0)
/**
- * @brief peer rate report message
+ * @brief target -> host peer rate report message
+ *
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
*
* @details
* HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
@@ -11942,7 +12139,9 @@ enum htt_peer_rate_report_phy_type {
} while (0)
/**
- * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_MAP Message
+ * @brief target -> host flow pool map message
+ *
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
*
* @details
* HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
@@ -11964,7 +12163,7 @@ enum htt_peer_rate_report_phy_type {
* |-------------------------------------------------------------------|
*
* The header field is one DWORD long and is interpreted as follows:
- * b'0:7 - msg_type: This will be set to HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
+ * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
* b'8-15 - num_flows: This will indicate the number of flows being setup in
* this message
* b'16-31 - reserved: These bits are reserved for future use
@@ -12120,7 +12319,9 @@ PREPACK struct htt_flow_pool_map_payload_t {
} while (0)
/**
- * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP Message
+ * @brief target -> host flow pool unmap message
+ *
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
*
* @details
* HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
@@ -12145,8 +12346,8 @@ PREPACK struct htt_flow_pool_map_payload_t {
* |-------------------------------------------------------------------|
*
* The message is interpreted as follows:
- * dword0 - b'0:7 - msg_type: This will be set to
- * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
+ * dword0 - b'0:7 - msg_type: This will be set to 0x19
+ * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
* b'8:31 - reserved0: Reserved for future use
*
* dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
@@ -12215,7 +12416,9 @@ PREPACK struct htt_flow_pool_unmap_t {
/**
- * @brief HTT_T2H_MSG_TYPE_SRING_SETUP_DONE Message
+ * @brief target -> host SRING setup done message
+ *
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
*
* @details
* HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
@@ -12232,8 +12435,8 @@ PREPACK struct htt_flow_pool_unmap_t {
* |-------------------------------------------------------------------|
*
* The message is interpreted as follows:
- * dword0 - b'0:7 - msg_type: This will be set to
- * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
+ * dword0 - b'0:7 - msg_type: This will be set to 0x1a
+ * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
* b'8:15 - pdev_id:
* 0 (for rings at SOC/UMAC level),
* 1/2/3 mac id (for rings at LMAC level)
@@ -12292,7 +12495,9 @@ enum htt_ring_setup_status {
/**
- * @brief HTT_T2H_MSG_TYPE_MAP_FLOW_INFO Message
+ * @brief target -> flow map flow info
+ *
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
*
* @details
* HTT TX map flow entry with tqm flow pointer
@@ -12317,8 +12522,8 @@ enum htt_ring_setup_status {
*
* The message is interpreted as follows:
*
- * dword0 - b'0:7 - msg_type: This will be set to
- * HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
+ * dword0 - b'0:7 - msg_type: This will be set to 0x1b
+ * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
*
* dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
* for this flow entry
@@ -12419,6 +12624,8 @@ enum htt_dbg_ext_stats_status {
/**
* @brief target -> host ppdu stats upload
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
+ *
* @details
* The following field definitions describe the format of the HTT target
* to host ppdu stats indication message.
@@ -12442,7 +12649,7 @@ enum htt_dbg_ext_stats_status {
* Bits 7:0
* Purpose: Identifies this is a PPDU STATS indication
* message.
- * Value: 0x1d
+ * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
* - mac_id
* Bits 9:8
* Purpose: mac_id of this ppdu_id
@@ -12532,6 +12739,8 @@ typedef struct {
/**
* @brief target -> host extended statistics upload
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
+ *
* @details
* The following field definitions describe the format of the HTT target
* to host stats upload confirmation message.
@@ -12565,7 +12774,7 @@ typedef struct {
* Bits 7:0
* Purpose: Identifies this is a extended statistics upload confirmation
* message.
- * Value: 0x1c
+ * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
* - COOKIE_LSBS
* Bits 31:0
* Purpose: Provide a mechanism to match a target->host stats confirmation
@@ -12678,6 +12887,8 @@ typedef enum {
/**
* @brief target -> host monitor mac header indication message
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
+ *
* @details
* The following diagram shows the format of the monitor mac header message
* sent from the target to the host.
@@ -12706,7 +12917,7 @@ typedef enum {
* - msg_type
* Bits 7:0
* Purpose: Identifies this is a monitor mac header indication message.
- * Value: 0x20
+ * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
* - peer_id
* Bits 31:16
* Purpose: Software peer id given by host during association,
@@ -12751,7 +12962,9 @@ typedef enum {
HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
/**
- * @brief HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE Message
+ * @brief target -> host flow pool resize Message
+ *
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
*
* @details
* HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
@@ -12767,8 +12980,8 @@ typedef enum {
* |-------------------------------------------------------------------|
*
* The message is interpreted as follows:
- * b'0:7 - msg_type: This will be set to
- * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
+ * b'0:7 - msg_type: This will be set to 0x21
+ * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
*
* b'0:15 - flow pool ID: Existing flow pool ID
*
@@ -12813,53 +13026,7 @@ PREPACK struct htt_flow_pool_resize_t {
((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
} while (0)
-/**
- * @brief host -> target channel change message
- *
- * @details
- * the meesage is generated by FW every time FW changes channel. This will be used by host mainly
- * to associate RX frames to correct channel they were received on.
- * The following field definitions describe the format of the HTT target
- * to host channel change message.
- * |31 16|15 8|7 5|4 0|
- * |------------------------------------------------------------|
- * | reserved | MSG_TYPE |
- * |------------------------------------------------------------|
- * | CHAN_MHZ |
- * |------------------------------------------------------------|
- * | BAND_CENTER_FREQ1 |
- * |------------------------------------------------------------|
- * | BAND_CENTER_FREQ2 |
- * |------------------------------------------------------------|
- * | CHAN_PHY_MODE |
- * |------------------------------------------------------------|
- * Header fields:
- * - MSG_TYPE
- * Bits 7:0
- * Value: 0xf
- * - CHAN_MHZ
- * Bits 31:0
- * Purpose: frequency of the primary 20mhz channel.
- * - BAND_CENTER_FREQ1
- * Bits 31:0
- * Purpose: centre frequency of the full channel.
- * - BAND_CENTER_FREQ2
- * Bits 31:0
- * Purpose: centre frequency2 of the channel. is only valid for 11acvht 80plus80.
- * - CHAN_PHY_MODE
- * Bits 31:0
- * Purpose: phy mode of the channel.
-*/
-
-PREPACK struct htt_chan_change_msg {
- A_UINT32 chan_mhz; /* frequency in mhz */
- A_UINT32 band_center_freq1; /* Center frequency 1 in MHz*/
-
- A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
-
- A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
-} POSTPACK;
#define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
#define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
@@ -12995,6 +13162,8 @@ typedef enum {
* @brief target -> host CFR dump completion indication message definition
* htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
*
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
+ *
* @details
* The following diagram shows the format of the Channel Frequency Response
* (CFR) dump completion indication. This inidcation is sent to the Host when
@@ -13067,7 +13236,7 @@ typedef enum {
* - msg_type
* Bits 7:0
* Purpose: Identifies this as CFR TX completion indication
- * Value: HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
+ * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
* - payload_present
* Bit 8
* Purpose: Identifies how CFR data is sent to host
@@ -13337,7 +13506,9 @@ PREPACK struct htt_cfr_dump_compl_ind {
/**
* @brief target -> host peer (PPDU) stats message
- * HTT_T2H_MSG_TYPE_PEER_STATS_IND
+ *
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
+ *
* @details
* This message is generated by FW when FW is sending stats to host
* about one or more PPDUs that the FW has transmitted to one or more peers.
@@ -13399,7 +13570,7 @@ PREPACK struct htt_cfr_dump_compl_ind {
*
* Header
* ------
- * dword0 - b'0:7 - msg_type : HTT_T2H_MSG_TYPE_PEER_STATS_IND
+ * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
* dword0 - b'8:31 - reserved : Reserved for future use
*
* payload include below peer_stats information
@@ -13430,7 +13601,9 @@ PREPACK struct htt_cfr_dump_compl_ind {
/**
- * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message
+ * @brief target -> host backpressure event
+ *
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
*
* @details
* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
@@ -13456,8 +13629,8 @@ PREPACK struct htt_cfr_dump_compl_ind {
* |-------------------------------------------------------------------|
*
* The message is interpreted as follows:
- * dword0 - b'0:7 - msg_type: This will be set to
- * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
+ * dword0 - b'0:7 - msg_type: This will be set to 0x24
+ * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
* b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
* 1, 2, 3 indicates pdev_id 0,1,2 and
the msg is for LMAC ring.
@@ -13864,8 +14037,13 @@ enum HTT_UL_OFDMA_TRIG_TYPE {
/**
* @brief target -> host channel calibration data message
+ *
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
+ *
* @brief host -> target channel calibration data message
*
+ * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
+ *
* @details
* The following field definitions describe the format of the channel
* calibration data message sent from the target to the host when
@@ -13890,8 +14068,8 @@ enum HTT_UL_OFDMA_TRIG_TYPE {
* - MSG_TYPE
* Bits 7:0
* Purpose: identifies this as a channel calibration data message
- * Value: HTT_T2H_MSG_TYPE_CHAN_CALDATA (0x15) or
- * HTT_H2T_MSG_TYPE_CHAN_CALDATA (0xb)
+ * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
+ * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
* - SUB_TYPE
* Bits 11:8
* Purpose: T2H: indicates whether target is providing chan cal data
@@ -14067,7 +14245,9 @@ PREPACK struct htt_chan_caldata_msg {
/**
- * @brief HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND Message
+ * @brief target -> host FSE CMEM based send
+ *
+ * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
*
* @details
* HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
@@ -14088,8 +14268,8 @@ PREPACK struct htt_chan_caldata_msg {
* |-------------------------------------------------------------------|
*
* The message is interpreted as follows:
- * dword0 - b'0:7 - msg_type: This will be set to
- * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
+ * dword0 - b'0:7 - msg_type: This will be set to 0x27
+ * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
* b'8:15 - number_entries: Indicated the number of entries
* programmed.
* b'16:31 - reserved.
@@ -14354,5 +14534,68 @@ PREPACK struct htt_rx_peer_metadata_v1 {
((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
} while (0)
+/*
+ * In some systems, the host SW wants to specify priorities between
+ * different MSDU / flow queues within the same peer-TID.
+ * The below enums are used for the host to identify to the target
+ * which MSDU queue's priority it wants to adjust.
+ */
+
+/*
+ * The MSDUQ index describe index of TCL HW, where each index is
+ * used for queuing particular types of MSDUs.
+ * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
+ */
+enum HTT_MSDUQ_INDEX {
+ HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
+ HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
+
+ HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
+ HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
+
+ HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
+ HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
+
+ HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
+ HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
+
+ HTT_MSDUQ_MAX_INDEX,
+};
+
+/* MSDU qtype definition */
+enum HTT_MSDU_QTYPE {
+ /*
+ * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
+ * relative priority. Instead, the relative priority of CRIT_0 versus
+ * CRIT_1 is controlled by the FW, through the configuration parameters
+ * it applies to the queues.
+ */
+ HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
+ HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
+ HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
+ HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
+ HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
+
+
+ /* New MSDU_QTYPE should be added above this line */
+ /*
+ * Below QTYPE_MAX will increase if additional QTYPEs are defined
+ * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
+ * any host/target message definitions. The QTYPE_MAX value can
+ * only be used internally within the host or within the target.
+ * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
+ * it must regard the unexpected value as a default qtype value,
+ * or ignore it.
+ */
+ HTT_MSDU_QTYPE_MAX,
+ HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
+};
+
+enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
+ HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
+ HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
+ HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
+ HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
+};
#endif
diff --git a/drivers/staging/fw-api/fw/wlan_defs.h b/drivers/staging/fw-api/fw/wlan_defs.h
index fee5cb68c06a..591ced86231e 100755
--- a/drivers/staging/fw-api/fw/wlan_defs.h
+++ b/drivers/staging/fw-api/fw/wlan_defs.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2016, 2018-2020 The Linux Foundation. All rights reserved.*
+ * Copyright (c) 2013-2016, 2018-2021 The Linux Foundation. All rights reserved.*
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -351,6 +351,15 @@ enum {
REGDMN_MODE_11AXA_HE80_BIT = 38, /* 5Ghz, HE80 */
REGDMN_MODE_11AXA_HE160_BIT = 39, /* 5Ghz, HE160 */
REGDMN_MODE_11AXA_HE80_80_BIT = 40, /* 5Ghz, HE80+80 */
+ REGDMN_MODE_11BEG_EHT20_BIT = 41, /* 2Ghz, EHT20 */
+ REGDMN_MODE_11BEA_EHT20_BIT = 42, /* 5Ghz, EHT20 */
+ REGDMN_MODE_11BEG_EHT40PLUS_BIT = 43, /* 2Ghz, EHT40+ */
+ REGDMN_MODE_11BEG_EHT40MINUS_BIT = 44, /* 2Ghz, EHT40- */
+ REGDMN_MODE_11BEA_EHT40PLUS_BIT = 45, /* 5Ghz, EHT40+ */
+ REGDMN_MODE_11BEA_EHT40MINUS_BIT = 46, /* 5Ghz, EHT40- */
+ REGDMN_MODE_11BEA_EHT80_BIT = 47, /* 5Ghz, EHT80 */
+ REGDMN_MODE_11BEA_EHT160_BIT = 48, /* 5Ghz, EHT160 */
+ REGDMN_MODE_11BEA_EHT320_BIT = 49, /* 5Ghz, EHT320 */
};
enum {
@@ -393,6 +402,15 @@ enum {
REGDMN_MODE_U32_11AXA_HE80 = 1 << (REGDMN_MODE_11AXA_HE80_BIT - 32),
REGDMN_MODE_U32_11AXA_HE160 = 1 << (REGDMN_MODE_11AXA_HE160_BIT - 32),
REGDMN_MODE_U32_11AXA_HE80_80 = 1 << (REGDMN_MODE_11AXA_HE80_80_BIT - 32),
+ REGDMN_MODE_U32_11BEG_EHT20 = 1 << (REGDMN_MODE_11BEG_EHT20_BIT - 32),
+ REGDMN_MODE_U32_11BEA_EHT20 = 1 << (REGDMN_MODE_11BEA_EHT20_BIT - 32),
+ REGDMN_MODE_U32_11BEG_EHT40PLUS = 1 << (REGDMN_MODE_11BEG_EHT40PLUS_BIT - 32),
+ REGDMN_MODE_U32_11BEG_EHT40MINUS = 1 << (REGDMN_MODE_11BEG_EHT40MINUS_BIT - 32),
+ REGDMN_MODE_U32_11BEA_EHT40PLUS = 1 << (REGDMN_MODE_11BEA_EHT40PLUS_BIT - 32),
+ REGDMN_MODE_U32_11BEA_EHT40MINUS = 1 << (REGDMN_MODE_11BEA_EHT40MINUS_BIT - 32),
+ REGDMN_MODE_U32_11BEA_EHT80 = 1 << (REGDMN_MODE_11BEA_EHT80_BIT - 32),
+ REGDMN_MODE_U32_11BEA_EHT160 = 1 << (REGDMN_MODE_11BEA_EHT160_BIT - 32),
+ REGDMN_MODE_U32_11BEA_EHT320 = 1 << (REGDMN_MODE_11BEA_EHT320_BIT - 32),
};
#define REGDMN_MODE_ALL (0xFFFFFFFF) /* REGDMN_MODE_ALL is defined out of the enum
@@ -536,7 +554,7 @@ typedef struct {
#define PROD_SCHED_BW_ENTRIES (NUM_SCHED_ENTRIES * NUM_DYN_BW)
-#if NUM_DYN_BW > 4
+#if NUM_DYN_BW > 5
/* Extend rate table module first */
#error "Extend rate table module first"
#endif
diff --git a/drivers/staging/fw-api/fw/wlan_module_ids.h b/drivers/staging/fw-api/fw/wlan_module_ids.h
index 3cf84c8913ff..d299b0a588e3 100644
--- a/drivers/staging/fw-api/fw/wlan_module_ids.h
+++ b/drivers/staging/fw-api/fw/wlan_module_ids.h
@@ -119,6 +119,7 @@ typedef enum {
WLAN_MODULE_CODE_COVER, /* 0x55 */ /* code coverage */
WLAN_MODULE_SHO, /* 0x56 */ /* SAP HW offload */
WLAN_MODULE_MLO_MGR, /* 0x57 */ /* MLO manager */
+ WLAN_MODULE_PEER_INIT, /* 0x58 */ /* peer init connection handling */
WLAN_MODULE_ID_MAX,
diff --git a/drivers/staging/fw-api/fw/wmi_services.h b/drivers/staging/fw-api/fw/wmi_services.h
index 6664ebfad107..fb5a5d1b34bf 100644
--- a/drivers/staging/fw-api/fw/wmi_services.h
+++ b/drivers/staging/fw-api/fw/wmi_services.h
@@ -528,6 +528,8 @@ typedef enum {
WMI_SERVICE_ENABLE_LOWER_6G_EDGE_CH_SUPP = 283, /* Indicates FW support for enabling lower 6 GHz edge channel 5935 */
WMI_SERVICE_DISABLE_UPPER_6G_EDGE_CH_SUPP = 284, /* Indicates FW support for disabling upper 6 GHz edge channel 7115 */
WMI_SERVICE_FORCED_DTIM_SUPP = 285, /* Indicates FW supports forced DTIM configuration */
+ WMI_SERVICE_DCS_AWGN_INT_SUPPORT = 286, /* Indicates FW supports AWGN Int */
+ WMI_SERVICE_IGMP_OFFLOAD_SUPPORT = 287, /* FW supports igmp offload during APPS suspend */
WMI_MAX_EXT2_SERVICE
diff --git a/drivers/staging/fw-api/fw/wmi_tlv_defs.h b/drivers/staging/fw-api/fw/wmi_tlv_defs.h
index b6cfbcabe42a..98b9c19ade02 100644
--- a/drivers/staging/fw-api/fw/wmi_tlv_defs.h
+++ b/drivers/staging/fw-api/fw/wmi_tlv_defs.h
@@ -1141,6 +1141,15 @@ typedef enum {
WMITLV_TAG_STRUC_wmi_pdev_get_dpd_status_evt_fixed_param,
WMITLV_TAG_STRUC_wmi_eht_rate_set,
WMITLV_TAG_STRUC_wmi_dcs_awgn_int_t,
+ WMITLV_TAG_STRUC_wmi_mlo_tx_send_params,
+ WMITLV_TAG_STRUC_wmi_partner_link_params,
+ WMITLV_TAG_STRUC_wmi_peer_assoc_mlo_partner_link_params,
+ WMITLV_TAG_STRUC_wmi_mlo_setup_cmd_fixed_param,
+ WMITLV_TAG_STRUC_wmi_mlo_setup_complete_event_fixed_param,
+ WMITLV_TAG_STRUC_wmi_mlo_ready_cmd_fixed_param,
+ WMITLV_TAG_STRUC_wmi_mlo_teardown_fixed_param,
+ WMITLV_TAG_STRUC_wmi_mlo_teardown_complete_fixed_param,
+ WMITLV_TAG_STRUC_wmi_igmp_offload_fixed_param,
} WMITLV_TAG_ID;
/*
@@ -1599,6 +1608,10 @@ typedef enum {
OP(WMI_PEER_TID_LATENCY_CONFIG_CMDID) \
OP(WMI_MLO_LINK_SET_ACTIVE_CMDID) \
OP(WMI_PDEV_GET_DPD_STATUS_CMDID) \
+ OP(WMI_MLO_SETUP_CMDID) \
+ OP(WMI_MLO_READY_CMDID) \
+ OP(WMI_MLO_TEARDOWN_CMDID) \
+ OP(WMI_VDEV_IGMP_OFFLOAD_CMDID) \
/* add new CMD_LIST elements above this line */
@@ -1862,6 +1875,8 @@ typedef enum {
OP(WMI_TWT_NOTIFY_EVENTID) \
OP(WMI_MLO_LINK_SET_ACTIVE_RESP_EVENTID) \
OP(WMI_PDEV_GET_DPD_STATUS_EVENTID) \
+ OP(WMI_MLO_SETUP_COMPLETE_EVENTID) \
+ OP(WMI_MLO_TEARDOWN_COMPLETE_EVENTID) \
/* add new EVT_LIST elements above this line */
@@ -2241,7 +2256,8 @@ WMITLV_CREATE_PARAM_STRUC(WMI_PDEV_SET_WMM_PARAMS_CMDID);
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_vdev_start_request_cmd_fixed_param, wmi_vdev_start_request_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_channel, wmi_channel, chan, WMITLV_SIZE_FIX) \
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_p2p_noa_descriptor, noa_descriptors, WMITLV_SIZE_VAR) \
- WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_vdev_start_mlo_params, mlo_params, WMITLV_SIZE_VAR)
+ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_vdev_start_mlo_params, mlo_params, WMITLV_SIZE_VAR) \
+ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_partner_link_params, partner_link_params, WMITLV_SIZE_VAR)
WMITLV_CREATE_PARAM_STRUC(WMI_VDEV_START_REQUEST_CMDID);
@@ -2336,7 +2352,8 @@ WMITLV_CREATE_PARAM_STRUC(WMI_VDEV_IPSEC_NATKEEPALIVE_FILTER_CMDID);
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_vht_rate_set, wmi_vht_rate_set, peer_vht_rates, WMITLV_SIZE_FIX) \
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_he_rate_set, peer_he_rates, WMITLV_SIZE_VAR) \
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_peer_assoc_mlo_params, mlo_params, WMITLV_SIZE_VAR) \
- WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_eht_rate_set, peer_eht_rates, WMITLV_SIZE_VAR)
+ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_eht_rate_set, peer_eht_rates, WMITLV_SIZE_VAR) \
+ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_peer_assoc_mlo_partner_link_params, partner_link_params, WMITLV_SIZE_VAR)
WMITLV_CREATE_PARAM_STRUC(WMI_PEER_ASSOC_CMDID);
@@ -2708,7 +2725,8 @@ WMITLV_CREATE_PARAM_STRUC(WMI_MGMT_TX_CMDID);
#define WMITLV_TABLE_WMI_MGMT_TX_SEND_CMDID(id,op,buf,len) \
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_mgmt_tx_send_cmd_fixed_param, wmi_mgmt_tx_send_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, bufp, WMITLV_SIZE_VAR) \
- WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_tx_send_params, wmi_tx_send_params, tx_send_params, WMITLV_SIZE_FIX)
+ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_tx_send_params, wmi_tx_send_params, tx_send_params, WMITLV_SIZE_FIX) \
+ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_mlo_tx_send_params, mlo_tx_send_params, WMITLV_SIZE_VAR)
WMITLV_CREATE_PARAM_STRUC(WMI_MGMT_TX_SEND_CMDID);
@@ -4610,6 +4628,28 @@ WMITLV_CREATE_PARAM_STRUC(WMI_MLO_LINK_SET_ACTIVE_CMDID);
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_pdev_get_dpd_status_cmd_fixed_param, wmi_pdev_get_dpd_status_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX)
WMITLV_CREATE_PARAM_STRUC(WMI_PDEV_GET_DPD_STATUS_CMDID);
+/** WMI cmd used to indicate hw_links part of MLO */
+#define WMITLV_TABLE_WMI_MLO_SETUP_CMDID(id,op,buf,len) \
+ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_mlo_setup_cmd_fixed_param, wmi_mlo_setup_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
+ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_UINT32, A_UINT32, hw_link_ids, WMITLV_SIZE_VAR)
+WMITLV_CREATE_PARAM_STRUC(WMI_MLO_SETUP_CMDID);
+
+/** WMI cmd used for init synchronization of hw_links part of MLO */
+#define WMITLV_TABLE_WMI_MLO_READY_CMDID(id,op,buf,len) \
+ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_mlo_ready_cmd_fixed_param, wmi_mlo_ready_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX)
+WMITLV_CREATE_PARAM_STRUC(WMI_MLO_READY_CMDID);
+
+/** WMI cmd used for tearing down a hw_link part of MLO */
+#define WMITLV_TABLE_WMI_MLO_TEARDOWN_CMDID(id,op,buf,len) \
+ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_mlo_teardown_fixed_param, wmi_mlo_teardown_fixed_param, fixed_param, WMITLV_SIZE_FIX)
+WMITLV_CREATE_PARAM_STRUC(WMI_MLO_TEARDOWN_CMDID);
+
+/* Mcast ipv4 address filter list cmd */
+#define WMITLV_TABLE_WMI_VDEV_IGMP_OFFLOAD_CMDID(id,op,buf,len) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_igmp_offload_fixed_param, wmi_igmp_offload_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
+ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_FIXED_STRUC, WMI_IPV4_ADDR, mc_ipv4_list, WMITLV_SIZE_VAR)
+WMITLV_CREATE_PARAM_STRUC(WMI_VDEV_IGMP_OFFLOAD_CMDID);
+
/************************** TLV definitions of WMI events *******************************/
@@ -6224,6 +6264,16 @@ WMITLV_CREATE_PARAM_STRUC(WMI_MLO_LINK_SET_ACTIVE_RESP_EVENTID);
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_pdev_get_dpd_status_evt_fixed_param, wmi_pdev_get_dpd_status_evt_fixed_param, fixed_param, WMITLV_SIZE_FIX)
WMITLV_CREATE_PARAM_STRUC(WMI_PDEV_GET_DPD_STATUS_EVENTID);
+/* Response event for MLO setup cmd */
+#define WMITLV_TABLE_WMI_MLO_SETUP_COMPLETE_EVENTID(id,op,buf,len) \
+ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_mlo_setup_complete_event_fixed_param, wmi_mlo_setup_complete_event_fixed_param, fixed_param, WMITLV_SIZE_FIX)
+WMITLV_CREATE_PARAM_STRUC(WMI_MLO_SETUP_COMPLETE_EVENTID);
+
+/* Response event for MLO teardown cmd */
+#define WMITLV_TABLE_WMI_MLO_TEARDOWN_COMPLETE_EVENTID(id,op,buf,len) \
+ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_mlo_teardown_complete_fixed_param, wmi_mlo_teardown_complete_fixed_param, fixed_param, WMITLV_SIZE_FIX)
+WMITLV_CREATE_PARAM_STRUC(WMI_MLO_TEARDOWN_COMPLETE_EVENTID);
+
#ifdef __cplusplus
}
diff --git a/drivers/staging/fw-api/fw/wmi_unified.h b/drivers/staging/fw-api/fw/wmi_unified.h
index cab8a0313443..94f6cdee48ae 100644
--- a/drivers/staging/fw-api/fw/wmi_unified.h
+++ b/drivers/staging/fw-api/fw/wmi_unified.h
@@ -535,6 +535,8 @@ typedef enum {
WMI_VDEV_GET_BIG_DATA_P2_CMDID,
/** set TPC PSD/non-PSD power */
WMI_VDEV_SET_TPC_POWER_CMDID,
+ /** IGMP OFFLOAD */
+ WMI_VDEV_IGMP_OFFLOAD_CMDID,
/* peer specific commands */
@@ -1366,6 +1368,12 @@ typedef enum {
/** WMI commands specific to MLO **/
/** MLO link active / inactive Request command */
WMI_MLO_LINK_SET_ACTIVE_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_MLO),
+ /** WMI cmd used to indicate hw_links part of MLO */
+ WMI_MLO_SETUP_CMDID,
+ /** WMI cmd used for init synchronization of hw_links part of MLO */
+ WMI_MLO_READY_CMDID,
+ /** WMI cmd used for tearing down a hw_link part of MLO */
+ WMI_MLO_TEARDOWN_CMDID,
} WMI_CMD_ID;
typedef enum {
@@ -2077,6 +2085,10 @@ typedef enum {
/** WMI event specific to MLO **/
/** MLO link active / inactive response event */
WMI_MLO_LINK_SET_ACTIVE_RESP_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_MLO),
+ /* Response event for MLO setup cmd */
+ WMI_MLO_SETUP_COMPLETE_EVENTID,
+ /* Response event for MLO teardown cmd */
+ WMI_MLO_TEARDOWN_COMPLETE_EVENTID,
} WMI_EVT_ID;
/* defines for OEM message sub-types */
@@ -5660,6 +5672,14 @@ typedef struct {
} wmi_tx_send_params;
typedef struct {
+ A_UINT32 tlv_header; /* TLV tag (WMITLV_TAG_STRUC_wmi_mlo_tx_send_params) and len */
+ A_UINT32 hw_link_id; /** Unique link id across SOCs, provided by QMI handshake.
+ * If 0xFFFF then the frame will be queued in the MLO queue
+ * If valid hw_link_id
+ */
+} wmi_mlo_tx_send_params;
+
+typedef struct {
A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_mgmt_tx_send_cmd_fixed_param */
A_UINT32 vdev_id;
A_UINT32 desc_id; /* echoed in tx_compl_event */
@@ -5699,6 +5719,7 @@ typedef struct {
*/
/* This TLV is followed by wmi_tx_send_params
* wmi_tx_send_params tx_send_params;
+ * wmi_mlo_tx_send_params mlo_tx_send_params[];
*/
} wmi_mgmt_tx_send_cmd_fixed_param;
@@ -10352,6 +10373,8 @@ typedef struct {
* bits 0 - mlo enable flag;
* bits 1 - assoc link flag;
* bits 2 - primary_umac flag;
+ * bits 3 - is logical link index valid
+ * bits 4 - is mlo peer id valid
*/
#define WMI_MLO_FLAGS_GET_ENABLED(mlo_flags) WMI_GET_BITS(mlo_flags, 0, 1)
#define WMI_MLO_FLAGS_SET_ENABLED(mlo_flags, value) WMI_SET_BITS(mlo_flags, 0, 1, value)
@@ -10359,6 +10382,10 @@ typedef struct {
#define WMI_MLO_FLAGS_SET_ASSOC_LINK(mlo_flags, value) WMI_SET_BITS(mlo_flags, 1, 1, value)
#define WMI_MLO_FLAGS_GET_PRIMARY_UMAC(mlo_flags) WMI_GET_BITS(mlo_flags, 2, 1)
#define WMI_MLO_FLAGS_SET_PRIMARY_UMAC(mlo_flags, value) WMI_SET_BITS(mlo_flags, 2, 1, value)
+#define WMI_MLO_FLAGS_GET_LINK_INDEX_VALID(mlo_flags) WMI_GET_BITS(mlo_flags, 3, 1)
+#define WMI_MLO_FLAGS_SET_LINK_INDEX_VALID(mlo_flags, value) WMI_SET_BITS(mlo_flags, 3, 1, value)
+#define WMI_MLO_FLAGS_GET_PEER_ID_VALID(mlo_flags) WMI_GET_BITS(mlo_flags, 4, 1)
+#define WMI_MLO_FLAGS_SET_PEER_ID_VALID(mlo_flags, value) WMI_SET_BITS(mlo_flags, 4, 1, value)
/* this structure used for pass mlo flags*/
typedef struct {
@@ -10367,12 +10394,21 @@ typedef struct {
A_UINT32 mlo_enabled:1, /* indicate is MLO enabled */
mlo_assoc_link:1, /* indicate is the link used to initialize the association of mlo connection */
mlo_primary_umac:1, /* indicate is the link on primary UMAC, WIN only flag */
- unused: 29;
+ mlo_logical_link_index_valid:1, /* indicate if the logial link index in wmi_peer_assoc_mlo_params is valid */
+ mlo_peer_id_valid:1, /* indicate if the mlo peer id in wmi_peer_assoc_mlo_params is valid */
+ unused: 27;
};
A_UINT32 mlo_flags;
};
} wmi_mlo_flags;
+typedef struct {
+ A_UINT32 tlv_header;/** TLV tag (WMITLV_TAG_STRUC_wmi_partner_link_params) and len;*/
+ A_UINT32 vdev_id; /** partner vdev_id */
+ A_UINT32 hw_link_id; /** hw_link_id: Unique link id across SOCs, got as part of QMI handshake */
+ wmi_mac_addr vdev_macaddr; /** VDEV MAC address */
+} wmi_partner_link_params;
+
/* this TLV structure used for pass mlo parameters on vdev create*/
typedef struct {
A_UINT32 tlv_header; /** TLV tag and len; */
@@ -11147,6 +11183,9 @@ typedef struct {
* wmi_vdev_start_mlo_params mlo_params[0,1]; <-- vdev start MLO parameters
* optional TLV, only present for MLO vdevs,
* If the vdev is non-MLO the array length should be 0.
+ * wmi_partner_link_info link_info[]; <-- partner link info
+ * optional TLV, only present for MLO vdevs,
+ * If the vdev is non-MLO the array length should be 0.
*/
} wmi_vdev_start_request_cmd_fixed_param;
@@ -14234,6 +14273,12 @@ enum WMI_PEER_STA_TYPE {
#define WMI_PEER_ASSOC_GET_BSS_MAX_IDLE_PERIOD(_dword) \
WMI_GET_BITS(_dword, WMI_PEER_ASSOC_BSS_MAX_IDLE_PERIOD_BITPOS, 16)
+typedef struct {
+ A_UINT32 tlv_header; /** TLV tag (MITLV_TAG_STRUC_wmi_peer_assoc_mlo_partner_link_params) and len */
+ A_UINT32 vdev_id; /** unique id identifying the VDEV, generated by the caller */
+ A_UINT32 hw_mld_link_id; /** Unique link id across SOCs, got as part of QMI handshake. */
+} wmi_peer_assoc_mlo_partner_link_params;
+
/* This TLV structure used to pass mlo Parameters on peer assoc, only apply for mlo-peers */
typedef struct {
A_UINT32 tlv_header; /** TLV tag and len; */
@@ -14241,6 +14286,13 @@ typedef struct {
wmi_mlo_flags mlo_flags;
/** MLD MAC address */
wmi_mac_addr mld_macaddr;
+ /** Unique index for links of the mlo. Starts with Zero */
+ A_UINT32 logical_link_index;
+ /** ML Peer ID
+ * In WIN systems, mld_peer_id is generated by Host.
+ * In MCL systems, mld_peer_id will be set to invalid peer id.
+ */
+ A_UINT32 mld_peer_id;
} wmi_peer_assoc_mlo_params;
typedef struct {
@@ -14383,6 +14435,7 @@ typedef struct {
* Only present for MLO peers.
* For non-MLO peers the array length should be 0.
* wmi_eht_rate_set_peer_eht_rates; <-- EHT capabilities of the peer
+ * wmi_peer_assoc_mlo_partner_link_params link_info[] <-- partner link info
*/
} wmi_peer_assoc_complete_cmd_fixed_param;
@@ -26907,7 +26960,7 @@ typedef enum wmi_hw_mode_config_type {
/*
* Per HW mode MLO capability flags
- * use bits 31:28 of A_UINT32 hw_mode_config_type for Per HW mode MLO
+ * use bits 31:27 of A_UINT32 hw_mode_config_type for Per HW mode MLO
* capability flags...
* WMI_MLO_CAP_FLAG_NONE: Do not support MLO for the specific HW mode
* WMI_MLO_CAP_FLAG_NON_STR_IN_DBS: Support STR MLO when DBS for the specific
@@ -26918,22 +26971,35 @@ typedef enum wmi_hw_mode_config_type {
* HW mode
* WMI_MLO_CAP_FLAG_STR_IN_SBS: Support Non-STR MLO when SBS for the
* specific HW mode
+ * WMI_MLO_CAP_FLAG_STR: Support STR for the specific HW mode.
*/
-#define WMI_MLO_CAP_FLAG_NONE 0x0
-#define WMI_MLO_CAP_FLAG_NON_STR_IN_DBS 0x1
-#define WMI_MLO_CAP_FLAG_STR_IN_DBS 0x2
-#define WMI_MLO_CAP_FLAG_NON_STR_IN_SBS 0x4
-#define WMI_MLO_CAP_FLAG_STR_IN_SBS 0x8
+#define WMI_MLO_CAP_FLAG_NONE 0x00
+#define WMI_MLO_CAP_FLAG_NON_STR_IN_DBS 0x01
+#define WMI_MLO_CAP_FLAG_STR_IN_DBS 0x02
+#define WMI_MLO_CAP_FLAG_NON_STR_IN_SBS 0x04
+#define WMI_MLO_CAP_FLAG_STR_IN_SBS 0x08
+#define WMI_MLO_CAP_FLAG_STR 0x10
/*
* hw_mode_config_type sub-fields for chips that support 802.11BE/MLO:
- * bits 28:0 - hw_mode_config
- * bits 31:28 - per HW mode MLO capability flags
+ * bits 26:0 - hw_mode_config
+ * bits 31:27 - per HW mode MLO capability flags
+ */
+#define WMI_BECAP_PHY_GET_HW_MODE_CFG(hw_mode_config_type) WMI_GET_BITS(hw_mode_config_type, 0, 27)
+#define WMI_BECAP_PHY_SET_HW_MODE_CFG(hw_mode_config_type, value) WMI_SET_BITS(hw_mode_config_type, 0, 27, value)
+#define WMI_BECAP_PHY_GET_MLO_CAP(hw_mode_config_type) WMI_GET_BITS(hw_mode_config_type, 27, 5)
+#define WMI_BECAP_PHY_SET_MLO_CAP(hw_mode_config_type, value) WMI_SET_BITS(hw_mode_config_type, 27, 5, value)
+
+/*
+ * pdev_id sub-fields for chips that support 802.11BE/MLO
+ * as part of WMI_MAC_PHY_CAPABILITIES and WMI_MAC_PHY_CAPABILITIES_EXT:
+ * bits 16:0 - pdev_id
+ * bits 32:16 - Unique link id across SOCs, got as part of QMI handshake.
*/
-#define WMI_BECAP_PHY_GET_HW_MODE_CFG(hw_mode_config_type) WMI_GET_BITS(hw_mode_config_type, 0, 28)
-#define WMI_BECAP_PHY_SET_HW_MODE_CFG(hw_mode_config_type, value) WMI_SET_BITS(hw_mode_config_type, 0, 28, value)
-#define WMI_BECAP_PHY_GET_MLO_CAP(hw_mode_config_type) WMI_GET_BITS(hw_mode_config_type, 28, 4)
-#define WMI_BECAP_PHY_SET_MLO_CAP(hw_mode_config_type, value) WMI_SET_BITS(hw_mode_config_type, 28, 4, value)
+#define WMI_PHY_GET_PDEV_ID(pdev_id) WMI_GET_BITS(pdev_id, 0, 16)
+#define WMI_PHY_SET_PDEV_ID(pdev_id, value) WMI_SET_BITS(pdev_id, 0, 16, value)
+#define WMI_PHY_GET_HW_LINK_ID(pdev_id) WMI_GET_BITS(pdev_id, 16, 16)
+#define WMI_PHY_SET_HW_LINK_ID(pdev_id, value) WMI_SET_BITS(pdev_id, 16, 16, value)
#define WMI_SUPPORT_11B_GET(flags) WMI_GET_BITS(flags, 0, 1)
#define WMI_SUPPORT_11B_SET(flags, value) WMI_SET_BITS(flags, 0, 1, value)
@@ -27035,8 +27101,20 @@ typedef struct {
* No particular ordering of WMI_MAC_PHY_CAPABILITIES elements should be assumed,
* though in practice the elements may always be ordered by hw_mode_id */
A_UINT32 hw_mode_id;
- /* pdev_id starts with 1. pdev_id 1 => phy_id 0, pdev_id 2 => phy_id 1 */
- A_UINT32 pdev_id;
+ /*
+ * pdev_id starts with 1. pdev_id 1 => phy_id 0, pdev_id 2 => phy_id 1
+ * hw_link_id: Unique link id across SOCs, got as part of QMI handshake.
+ * For legacy chips which do not support MLO, these top bits will always
+ * be set to 0, so it won't impact the legacy chips which treat pdev_id
+ * as 32 bits.
+ */
+ union {
+ struct {
+ A_UINT32 pdev_id:16,
+ hw_link_id:16;
+ } wmi_pdev_to_link_map;
+ A_UINT32 pdev_id;
+ };
/* phy id. Starts with 0 */
A_UINT32 phy_id;
/* supported modulations and number of MU beamformees */
@@ -27211,8 +27289,20 @@ typedef struct {
* No particular ordering of WMI_MAC_PHY_CAPABILITIES elements should be assumed,
* though in practice the elements may always be ordered by hw_mode_id */
A_UINT32 hw_mode_id;
- /* pdev_id starts with 1. pdev_id 1 => phy_id 0, pdev_id 2 => phy_id 1 */
- A_UINT32 pdev_id;
+ /*
+ * pdev_id starts with 1. pdev_id 1 => phy_id 0, pdev_id 2 => phy_id 1
+ * hw_link_id: Unique link id across SOCs, got as part of QMI handshake.
+ * For legacy chips which do not support MLO, these top bits will always
+ * be set to 0, so it won't impact the legacy chips which treat pdev_id
+ * as 32 bits.
+ */
+ union {
+ struct {
+ A_UINT32 pdev_id:16,
+ hw_link_id:16;
+ } wmi_pdev_to_link_map;
+ A_UINT32 pdev_id;
+ };
/* phy id. Starts with 0 */
A_UINT32 phy_id;
A_UINT32 wireless_modes_ext; /* REGDMN MODE EXT, see REGDMN_MODE_ enum */
@@ -27253,7 +27343,7 @@ typedef struct {
* Identify a particular type of HW mode such as SBS, DBS etc.
* Refer to WMI_HW_MODE_CONFIG_TYPE values.
*
- * Use bits 31:28 of hw_mode_config_type for Per HW mode MLO capability
+ * Use bits 31:27 of hw_mode_config_type for Per HW mode MLO capability
* flags.
* Refer to WMI_MLO_CAP_FLAG_XXX. For legacy chips which do not support
* MLO, these top bits will always be set to 0, so it won't impact the
@@ -27261,8 +27351,8 @@ typedef struct {
*/
union {
struct {
- A_UINT32 hw_mode_config :28,
- mlo_cap_flag :4; /* see WMI_MLO_CAP_FLAG_ defs */
+ A_UINT32 hw_mode_config :27,
+ mlo_cap_flag :5; /* see WMI_MLO_CAP_FLAG_ defs */
};
A_UINT32 hw_mode_config_type;
};
@@ -28380,6 +28470,10 @@ static INLINE A_UINT8 *wmi_id_to_name(A_UINT32 wmi_command)
WMI_RETURN_STRING(WMI_PEER_TID_LATENCY_CONFIG_CMDID);
WMI_RETURN_STRING(WMI_MLO_LINK_SET_ACTIVE_CMDID);
WMI_RETURN_STRING(WMI_PDEV_GET_DPD_STATUS_CMDID);
+ WMI_RETURN_STRING(WMI_MLO_SETUP_CMDID);
+ WMI_RETURN_STRING(WMI_MLO_READY_CMDID);
+ WMI_RETURN_STRING(WMI_MLO_TEARDOWN_CMDID);
+ WMI_RETURN_STRING(WMI_VDEV_IGMP_OFFLOAD_CMDID);
}
return "Invalid WMI cmd";
@@ -28506,6 +28600,7 @@ typedef enum {
WMI_REGULATORY_PHYMODE_NO11N = 0x0008, /* NO 11N */
WMI_REGULATORY_PHYMODE_NO11AC = 0x0010, /* NO 11AC */
WMI_REGULATORY_PHYMODE_NO11AX = 0x0020, /* NO 11AX */
+ WMI_REGULATORY_PHYMODE_NO11BE = 0x0040, /* NO 11BE */
} WMI_REGULATORY_PHYBITMAP;
typedef enum {
@@ -29387,6 +29482,8 @@ typedef enum _WMI_ADD_TWT_STATUS_T {
WMI_ADD_TWT_STATUS_UNKNOWN_ERROR, /* adding TWT dialog failed with an unknown reason */
WMI_ADD_TWT_STATUS_AP_PARAMS_NOT_IN_RANGE, /* peer AP wake interval, duration not in range */
WMI_ADD_TWT_STATUS_AP_IE_VALIDATION_FAILED, /* peer AP IE Validation Failed */
+ WMI_ADD_TWT_STATUS_ROAM_IN_PROGRESS, /* Roaming in progress */
+ WMI_ADD_TWT_STATUS_CHAN_SW_IN_PROGRESS, /* Channel switch in progress */
} WMI_ADD_TWT_STATUS_T;
typedef struct {
@@ -29423,6 +29520,7 @@ typedef struct {
* Refer to 11ax spec session "9.4.2.199 TWT element" for more info.
*/
A_UINT32 b_twt_persistence;
+ A_UINT32 is_bcast_twt;
} wmi_twt_del_dialog_cmd_fixed_param;
/* status code of deleting TWT dialog */
@@ -29436,6 +29534,8 @@ typedef enum _WMI_DEL_TWT_STATUS_T {
WMI_DEL_TWT_STATUS_UNKNOWN_ERROR, /* deleting TWT dialog failed with an unknown reason */
WMI_DEL_TWT_STATUS_PEER_INIT_TEARDOWN, /* Peer Initiated Teardown */
WMI_DEL_TWT_STATUS_ROAMING, /* Reason Roaming Start*/
+ WMI_DEL_TWT_STATUS_CONCURRENCY, /* Teardown due to concurrency */
+ WMI_DEL_TWT_STATUS_CHAN_SW_IN_PROGRESS, /* Channel switch in progress */
} WMI_DEL_TWT_STATUS_T;
typedef struct {
@@ -29464,6 +29564,7 @@ typedef enum _WMI_PAUSE_TWT_STATUS_T {
WMI_PAUSE_TWT_STATUS_UNKNOWN_ERROR, /* pausing TWT dialog failed with an unknown reason */
WMI_PAUSE_TWT_STATUS_ALREADY_PAUSED, /* The TWT dialog is already paused */
WMI_PAUSE_TWT_STATUS_TWT_INFO_FRM_NOT_SUPPORTED, /* TWT information frame is not supported by AP */
+ WMI_PAUSE_TWT_STATUS_CHAN_SW_IN_PROGRESS, /* Channel switch in progress */
} WMI_PAUSE_TWT_STATUS_T;
typedef struct {
@@ -29494,6 +29595,7 @@ typedef enum _WMI_RESUME_TWT_STATUS_T {
WMI_RESUME_TWT_STATUS_NO_ACK, /* peer AP/STA did not ACK the request/response frame */
WMI_RESUME_TWT_STATUS_UNKNOWN_ERROR, /* resuming TWT dialog failed with an unknown reason */
WMI_RESUME_TWT_STATUS_TWT_INFO_FRM_NOT_SUPPORTED, /* TWT information frame is not supported by AP */
+ WMI_RESUME_TWT_STATUS_CHAN_SW_IN_PROGRESS, /* Channel switch in progress */
} WMI_RESUME_TWT_STATUS_T;
typedef struct {
@@ -29524,6 +29626,7 @@ typedef enum _WMI_TWT_NUDGE_STATUS_T {
WMI_NUDGE_TWT_STATUS_UNKNOWN_ERROR, /* nudging TWT dialog failed with an unknown reason */
WMI_NUDGE_TWT_STATUS_ALREADY_PAUSED, /* The TWT dialog is already paused */
WMI_NUDGE_TWT_STATUS_TWT_INFO_FRM_NOT_SUPPORTED, /* TWT information frame is not supported by AP */
+ WMI_NUDGE_TWT_STATUS_CHAN_SW_IN_PROGRESS, /* Channel switch in progress */
} WMI_TWT_NUDGE_STATUS_T;
typedef struct {
@@ -33817,6 +33920,75 @@ typedef struct wmi_mlo_link_set_active_resp_event
*/
} wmi_mlo_link_set_active_resp_event_fixed_param;
+typedef struct {
+ /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_mlo_setup_cmd_fixed_param; */
+ A_UINT32 tlv_header;
+ /** Unique ID reprsenting the hw_links part of the MLD */
+ A_UINT32 mld_group_id;
+ /** pdev_id for identifying the MAC, See macros starting with WMI_PDEV_ID_ for values. */
+ A_UINT32 pdev_id;
+/*
+ * Followed by TLVs:
+ * A_UINT32 hw_link_ids[];
+ */
+} wmi_mlo_setup_cmd_fixed_param;
+
+typedef struct {
+ /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_mlo_setup_complete_event_fixed_param; */
+ A_UINT32 tlv_header;
+ /** pdev_id for identifying the MAC, See macros starting with WMI_PDEV_ID_ for values. */
+ A_UINT32 pdev_id;
+ /** Return status. 0 for success, non-zero otherwise */
+ A_UINT32 status;
+} wmi_mlo_setup_complete_event_fixed_param;
+
+typedef struct {
+ /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_mlo_ready_cmd_fixed_param; */
+ A_UINT32 tlv_header;
+ /** pdev_id for identifying the MAC, See macros starting with WMI_PDEV_ID_ for values. */
+ A_UINT32 pdev_id;
+} wmi_mlo_ready_cmd_fixed_param;
+
+typedef enum wmi_mlo_tear_down_reason_code_type {
+ WMI_MLO_TEARDOWN_SSR_REASON,
+} WMI_MLO_TEARDOWN_REASON_TYPE;
+
+typedef struct {
+ /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_mlo_teardown_fixed_param; */
+ A_UINT32 tlv_header;
+ /** pdev_id for identifying the MAC, See macros starting with WMI_PDEV_ID_ for values. */
+ A_UINT32 pdev_id;
+ /** reason_code: of type WMI_TEARDOWN_REASON_TYPE */
+ A_UINT32 reason_code;
+} wmi_mlo_teardown_fixed_param;
+
+typedef struct {
+ /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_mlo_teardown_complete_fixed_param; */
+ A_UINT32 tlv_header;
+ /** pdev_id for identifying the MAC, See macros starting with WMI_PDEV_ID_ for values. */
+ A_UINT32 pdev_id;
+ /** Return status. 0 for success, non-zero otherwise */
+ A_UINT32 status;
+} wmi_mlo_teardown_complete_fixed_param;
+
+#define WMI_IGMP_OFFLOAD_SUPPORT_DISABLE_BITMASK 0x0
+#define WMI_IGMP_V1_OFFLOAD_SUPPORT_BITMASK 0x1
+#define WMI_IGMP_V2_OFFLOAD_SUPPORT_BITMASK 0x2
+#define WMI_IGMP_V3_OFFLOAD_SUPPORT_BITMASK 0x4
+#define WMI_IGMP_OFFLOAD_SUPPORT_ALL_VERSION 0x7
+
+typedef struct {
+ A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_igmp_offload_fixed_param */
+ A_UINT32 vdev_id; /** VDEV identifier */
+ A_UINT32 enable; /** IGMP offload support enable/disable */
+ A_UINT32 version_support_bitmask; /** IGMP version support v1, v2 and/or v3*/
+
+/* Following this structure are the TLVs:
+ * WMI_IPV4_ADDR grp_ip_address[num_mcast_ipv4_addr];
+ */
+} wmi_igmp_offload_fixed_param;
+
+
/* ADD NEW DEFS HERE */
diff --git a/drivers/staging/fw-api/fw/wmi_version.h b/drivers/staging/fw-api/fw/wmi_version.h
index 17f8b86f01da..385e76d06272 100644
--- a/drivers/staging/fw-api/fw/wmi_version.h
+++ b/drivers/staging/fw-api/fw/wmi_version.h
@@ -36,7 +36,7 @@
#define __WMI_VER_MINOR_ 0
/** WMI revision number has to be incremented when there is a
* change that may or may not break compatibility. */
-#define __WMI_REVISION_ 973
+#define __WMI_REVISION_ 980
/** The Version Namespace should not be normally changed. Only
* host and firmware of the same WMI namespace will work
diff --git a/drivers/staging/qca-wifi-host-cmn/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c b/drivers/staging/qca-wifi-host-cmn/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c
index dc0f3d772cde..b2e99da459e2 100644
--- a/drivers/staging/qca-wifi-host-cmn/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c
+++ b/drivers/staging/qca-wifi-host-cmn/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c
@@ -1620,6 +1620,12 @@ static QDF_STATUS target_if_get_dbr_data(struct wlan_objmgr_pdev *pdev,
*cookie = WMI_HOST_DBR_DATA_ADDR_HI_HOST_DATA_GET(
dbr_rsp->dbr_entries[idx].paddr_hi);
dbr_data->vaddr = target_if_dbr_vaddr_lookup(mod_param, paddr, *cookie);
+
+ if (!dbr_data->vaddr) {
+ direct_buf_rx_err("dbr vaddr lookup failed, vaddr NULL");
+ return QDF_STATUS_E_FAILURE;
+ }
+
dbr_data->cookie = *cookie;
dbr_data->paddr = paddr;
direct_buf_rx_debug("Cookie = %d Vaddr look up = %pK",
diff --git a/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
index 9f2c4dcfdeac..d19b2678d0d9 100644
--- a/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
+++ b/drivers/staging/qcacld-3.0/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
@@ -4114,4 +4114,15 @@ ucfg_mlme_set_roam_reason_vsie_status(struct wlan_objmgr_psoc *psoc,
}
#endif
+
+/**
+ * ucfg_is_roaming_enabled() - Check if roaming enabled
+ * to firmware.
+ * @psoc: psoc context
+ * @vdev_id: vdev id
+ *
+ * Return: True if Roam state machine is in
+ * WLAN_ROAM_RSO_ENABLED/WLAN_ROAMING_IN_PROG/WLAN_ROAM_SYNCH_IN_PROG
+ */
+bool ucfg_is_roaming_enabled(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id);
#endif /* _WLAN_MLME_UCFG_API_H_ */
diff --git a/drivers/staging/qcacld-3.0/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/drivers/staging/qcacld-3.0/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c
index b511cf4c5efd..19910b21e64f 100644
--- a/drivers/staging/qcacld-3.0/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c
+++ b/drivers/staging/qcacld-3.0/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c
@@ -1911,3 +1911,13 @@ bool ucfg_mlme_validate_scan_period(uint32_t roam_scan_period)
return is_valid;
}
+
+bool ucfg_is_roaming_enabled(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id)
+{
+ struct wlan_objmgr_psoc *psoc = wlan_pdev_get_psoc(pdev);
+
+ if (mlme_get_roam_state(psoc, vdev_id) == ROAM_RSO_STARTED)
+ return true;
+
+ return false;
+}
diff --git a/drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c b/drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c
index 2a81b83f87cb..52723d2f6f4b 100644
--- a/drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c
@@ -13161,6 +13161,7 @@ static int __wlan_hdd_cfg80211_set_fast_roaming(struct wiphy *wiphy,
struct hdd_station_ctx *hdd_sta_ctx =
WLAN_HDD_GET_STATION_CTX_PTR(adapter);
mac_handle_t mac_handle;
+ bool roaming_enabled;
hdd_enter_dev(dev);
@@ -13191,6 +13192,13 @@ static int __wlan_hdd_cfg80211_set_fast_roaming(struct wiphy *wiphy,
tb[QCA_WLAN_VENDOR_ATTR_ROAMING_POLICY]);
hdd_debug("isFastRoamEnabled %d", is_fast_roam_enabled);
+ /*
+ * Get current roaming state and decide whether to wait for RSO_STOP
+ * response or not.
+ */
+ roaming_enabled = ucfg_is_roaming_enabled(hdd_ctx->pdev,
+ adapter->vdev_id);
+
/* Update roaming */
mac_handle = hdd_ctx->mac_handle;
qdf_status = sme_config_fast_roaming(mac_handle, adapter->vdev_id,
@@ -13201,6 +13209,7 @@ static int __wlan_hdd_cfg80211_set_fast_roaming(struct wiphy *wiphy,
ret = qdf_status_to_os_return(qdf_status);
if (eConnectionState_Associated == hdd_sta_ctx->conn_info.conn_state &&
+ roaming_enabled &&
QDF_IS_STATUS_SUCCESS(qdf_status) && !is_fast_roam_enabled) {
INIT_COMPLETION(adapter->lfr_fw_status.disable_lfr_event);
diff --git a/drivers/staging/qcacld-3.0/core/mac/inc/ani_system_defs.h b/drivers/staging/qcacld-3.0/core/mac/inc/ani_system_defs.h
index f47ad239c020..63a1b772d2a8 100644
--- a/drivers/staging/qcacld-3.0/core/mac/inc/ani_system_defs.h
+++ b/drivers/staging/qcacld-3.0/core/mac/inc/ani_system_defs.h
@@ -71,10 +71,8 @@ enum ani_akm_type {
ANI_AKM_TYPE_FT_RSN_PSK,
ANI_AKM_TYPE_RSN_PSK_SHA256,
ANI_AKM_TYPE_RSN_8021X_SHA256,
-#ifdef WLAN_FEATURE_SAE
ANI_AKM_TYPE_SAE,
ANI_AKM_TYPE_FT_SAE,
-#endif
ANI_AKM_TYPE_SUITEB_EAP_SHA256,
ANI_AKM_TYPE_SUITEB_EAP_SHA384,
ANI_AKM_TYPE_FT_SUITEB_EAP_SHA384,
diff --git a/drivers/staging/qcacld-3.0/core/mac/inc/qwlan_version.h b/drivers/staging/qcacld-3.0/core/mac/inc/qwlan_version.h
index e66c82a8f7b5..797693511b7f 100644
--- a/drivers/staging/qcacld-3.0/core/mac/inc/qwlan_version.h
+++ b/drivers/staging/qcacld-3.0/core/mac/inc/qwlan_version.h
@@ -32,9 +32,9 @@
#define QWLAN_VERSION_MAJOR 5
#define QWLAN_VERSION_MINOR 2
#define QWLAN_VERSION_PATCH 022
-#define QWLAN_VERSION_EXTRA "B"
+#define QWLAN_VERSION_EXTRA "F"
#define QWLAN_VERSION_BUILD 7
-#define QWLAN_VERSIONSTR "5.2.022.7B"
+#define QWLAN_VERSIONSTR "5.2.022.7F"
#endif /* QWLAN_VERSION_H */
diff --git a/drivers/staging/qcacld-3.0/core/mac/inc/sir_api.h b/drivers/staging/qcacld-3.0/core/mac/inc/sir_api.h
index 70c9d6a2f86c..8f2eae634b2e 100644
--- a/drivers/staging/qcacld-3.0/core/mac/inc/sir_api.h
+++ b/drivers/staging/qcacld-3.0/core/mac/inc/sir_api.h
@@ -3023,6 +3023,7 @@ struct roam_offload_synch_ind {
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
struct handoff_failure_ind {
uint8_t vdev_id;
+ struct qdf_mac_addr bssid;
};
struct roam_offload_synch_fail {
diff --git a/drivers/staging/qcacld-3.0/core/mac/src/include/parser_api.h b/drivers/staging/qcacld-3.0/core/mac/src/include/parser_api.h
index 32079b16a0c9..7c98e4213563 100644
--- a/drivers/staging/qcacld-3.0/core/mac/src/include/parser_api.h
+++ b/drivers/staging/qcacld-3.0/core/mac/src/include/parser_api.h
@@ -1229,6 +1229,20 @@ QDF_STATUS populate_dot11f_twt_extended_caps(struct mac_context *mac_ctx,
#endif
/**
+ * populate_dot11f_btm_caps() - populate btm extended capabilities
+ * @mac_ctx: Global MAC context.
+ * @pe_session: Pointer to the PE session.
+ * @dot11f: Pointer to the extended capabilities of the session.
+ *
+ * Disable btm for SAE types for Helium firmware limit
+ *
+ * Return: QDF_STATUS Success or Failure
+ */
+QDF_STATUS populate_dot11f_btm_caps(struct mac_context *mac_ctx,
+ struct pe_session *pe_session,
+ struct sDot11fIEExtCap *dot11f);
+
+/**
* lim_truncate_ppet: truncates ppet of trailling zeros
* @ppet: ppet to truncate
* max_len: max length of ppet
diff --git a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_message_queue.c b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_message_queue.c
index 381bcbdfe99d..3e7dd69581ac 100644
--- a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_message_queue.c
+++ b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_process_message_queue.c
@@ -524,8 +524,7 @@ static bool def_msg_decision(struct mac_context *mac_ctx,
if (mac_ctx->lim.gLimSmeState == eLIM_SME_OFFLINE_STATE) {
/* Defer processing this message */
if (lim_defer_msg(mac_ctx, lim_msg) != TX_SUCCESS) {
- QDF_TRACE(QDF_MODULE_ID_PE, LOGE,
- FL("Unable to Defer Msg"));
+ pe_err_rl("Unable to Defer Msg");
lim_log_session_states(mac_ctx);
lim_handle_defer_msg_error(mac_ctx, lim_msg);
}
@@ -1012,7 +1011,8 @@ uint32_t lim_defer_msg(struct mac_context *mac, struct scheduler_msg *pMsg)
(mac, NO_SESSION,
LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DEFERRED)));
} else {
- pe_err("Dropped lim message (0x%X) Message %s", pMsg->type, lim_msg_str(pMsg->type));
+ pe_err_rl("Dropped lim message (0x%X) Message %s", pMsg->type,
+ lim_msg_str(pMsg->type));
MTRACE(mac_trace_msg_rx
(mac, NO_SESSION,
LIM_TRACE_MAKE_RXMSG(pMsg->type, LIM_MSG_DROPPED)));
diff --git a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_send_management_frames.c b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_send_management_frames.c
index ca42c29be526..c6aafe9ee806 100644
--- a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_send_management_frames.c
+++ b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_send_management_frames.c
@@ -2204,6 +2204,8 @@ lim_send_assoc_req_mgmt_frame(struct mac_context *mac_ctx,
lim_merge_extcap_struct(&frm->ExtCap, &bcn_ext_cap,
false);
}
+
+ populate_dot11f_btm_caps(mac_ctx, pe_session, &frm->ExtCap);
/*
* TWT extended capabilities should be populated after the
* intersection of beacon caps and self caps is done because
diff --git a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_utils.c b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_utils.c
index 5877893c207f..f67e6392948c 100644
--- a/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_utils.c
+++ b/drivers/staging/qcacld-3.0/core/mac/src/pe/lim/lim_utils.c
@@ -769,8 +769,8 @@ uint8_t lim_write_deferred_msg_q(struct mac_context *mac_ctx,
* We reach the quota for management frames,
* drop this one
*/
- pe_warn("Too many queue->MsgQ Msg: %d count: %d",
- lim_msg->type, count);
+ pe_warn_rl("Too many queue->MsgQ Msg: %d count: %d",
+ lim_msg->type, count);
/* Return error, caller knows what to do */
return TX_QUEUE_FULL;
}
diff --git a/drivers/staging/qcacld-3.0/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/drivers/staging/qcacld-3.0/core/mac/src/sys/legacy/src/utils/src/parser_api.c
index 8c35a9d49e92..b17c583e66c0 100644
--- a/drivers/staging/qcacld-3.0/core/mac/src/sys/legacy/src/utils/src/parser_api.c
+++ b/drivers/staging/qcacld-3.0/core/mac/src/sys/legacy/src/utils/src/parser_api.c
@@ -45,6 +45,7 @@
#include "wlan_mlme_public_struct.h"
#include "wlan_mlme_ucfg_api.h"
#include "wlan_mlme_api.h"
+#include "wlan_crypto_global_api.h"
#define RSN_OUI_SIZE 4
/* ////////////////////////////////////////////////////////////////////// */
@@ -6246,4 +6247,28 @@ QDF_STATUS populate_dot11f_twt_extended_caps(struct mac_context *mac_ctx,
}
#endif
+QDF_STATUS populate_dot11f_btm_caps(struct mac_context *mac_ctx,
+ struct pe_session *pe_session,
+ struct sDot11fIEExtCap *dot11f)
+{
+ struct s_ext_cap *p_ext_cap;
+ uint32_t fw_akm_bitmap;
+ bool sae_can_roam;
+
+ dot11f->num_bytes = DOT11F_IE_EXTCAP_MAX_LEN;
+ p_ext_cap = (struct s_ext_cap *)dot11f->bytes;
+ fw_akm_bitmap = mac_ctx->mlme_cfg->lfr.fw_akm_bitmap;
+ sae_can_roam = (((fw_akm_bitmap) & (1 << AKM_SAE)) ? true : false);
+
+ if (pe_session->connected_akm == ANI_AKM_TYPE_SAE &&
+ !sae_can_roam) {
+ p_ext_cap->bss_transition = 0;
+ pe_debug("Disable btm cap for SAE roam not supported");
+ }
+
+ dot11f->num_bytes = lim_compute_ext_cap_ie_length(dot11f);
+
+ return QDF_STATUS_SUCCESS;
+}
+
/* parser_api.c ends here. */
diff --git a/drivers/staging/qcacld-3.0/core/sme/src/csr/csr_api_roam.c b/drivers/staging/qcacld-3.0/core/sme/src/csr/csr_api_roam.c
index f6d79dd8473a..2eb4d5c7548e 100644
--- a/drivers/staging/qcacld-3.0/core/sme/src/csr/csr_api_roam.c
+++ b/drivers/staging/qcacld-3.0/core/sme/src/csr/csr_api_roam.c
@@ -21204,6 +21204,7 @@ void csr_process_ho_fail_ind(struct mac_context *mac_ctx, void *msg_buf)
struct handoff_failure_ind *pSmeHOFailInd = msg_buf;
struct mlme_roam_after_data_stall *vdev_roam_params;
struct wlan_objmgr_vdev *vdev;
+ struct reject_ap_info ap_info;
uint32_t sessionId;
if (!pSmeHOFailInd) {
@@ -21212,6 +21213,12 @@ void csr_process_ho_fail_ind(struct mac_context *mac_ctx, void *msg_buf)
}
sessionId = pSmeHOFailInd->vdev_id;
+ ap_info.bssid = pSmeHOFailInd->bssid;
+ ap_info.reject_ap_type = DRIVER_AVOID_TYPE;
+ ap_info.reject_reason = REASON_ROAM_HO_FAILURE;
+ ap_info.source = ADDED_BY_DRIVER;
+ wlan_blm_add_bssid_to_reject_list(mac_ctx->pdev, &ap_info);
+
/* Roaming is supported only on Infra STA Mode. */
if (!csr_roam_is_sta_mode(mac_ctx, sessionId)) {
diff --git a/drivers/staging/qcacld-3.0/core/wma/src/wma_scan_roam.c b/drivers/staging/qcacld-3.0/core/wma/src/wma_scan_roam.c
index c82271375379..b97be88d38dc 100644
--- a/drivers/staging/qcacld-3.0/core/wma/src/wma_scan_roam.c
+++ b/drivers/staging/qcacld-3.0/core/wma/src/wma_scan_roam.c
@@ -4167,19 +4167,14 @@ wma_roam_ho_fail_handler(tp_wma_handle wma, uint32_t vdev_id,
struct handoff_failure_ind *ho_failure_ind;
struct scheduler_msg sme_msg = { 0 };
QDF_STATUS qdf_status;
- struct reject_ap_info ap_info;
-
- ap_info.bssid = bssid;
- ap_info.reject_ap_type = DRIVER_AVOID_TYPE;
- ap_info.reject_reason = REASON_ROAM_HO_FAILURE;
- ap_info.source = ADDED_BY_DRIVER;
- wlan_blm_add_bssid_to_reject_list(wma->pdev, &ap_info);
ho_failure_ind = qdf_mem_malloc(sizeof(*ho_failure_ind));
if (!ho_failure_ind)
return;
ho_failure_ind->vdev_id = vdev_id;
+ ho_failure_ind->bssid = bssid;
+
sme_msg.type = eWNI_SME_HO_FAIL_IND;
sme_msg.bodyptr = ho_failure_ind;
sme_msg.bodyval = 0;
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index b2f67d7ace6d..22a7f67e70e7 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1696,12 +1696,13 @@ static int acm_resume(struct usb_interface *intf)
struct urb *urb;
int rv = 0;
- acm_unpoison_urbs(acm);
spin_lock_irq(&acm->write_lock);
if (--acm->susp_count)
goto out;
+ acm_unpoison_urbs(acm);
+
if (tty_port_initialized(&acm->port)) {
rv = usb_submit_urb(acm->ctrlurb, GFP_ATOMIC);
diff --git a/drivers/usb/gadget/function/u_bam_dmux.c b/drivers/usb/gadget/function/u_bam_dmux.c
index 57aaebfcfd64..9ac3332dbf9e 100644
--- a/drivers/usb/gadget/function/u_bam_dmux.c
+++ b/drivers/usb/gadget/function/u_bam_dmux.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011-2018, 2020, Linux Foundation. All rights reserved.
+/* Copyright (c) 2011-2018, 2020-2021, Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -274,7 +274,7 @@ static void gbam_free_rx_skb_idle_list(struct gbam_port *port)
return;
d = &port->data_ch;
- gadget = port->port_usb->cdev->gadget;
+ gadget = port->gadget;
while (d->rx_skb_idle.qlen > 0) {
skb = __skb_dequeue(&d->rx_skb_idle);
@@ -1028,6 +1028,7 @@ static void gbam_port_free(enum bam_dmux_func_type func)
if (port) {
platform_driver_unregister(pdrv);
+ gbam_free_rx_skb_idle_list(port);
kfree(port);
bam_ports[func].port = NULL;
}
diff --git a/drivers/usb/usbip/vudc_sysfs.c b/drivers/usb/usbip/vudc_sysfs.c
index f44d98eeb36a..51cc5258b63e 100644
--- a/drivers/usb/usbip/vudc_sysfs.c
+++ b/drivers/usb/usbip/vudc_sysfs.c
@@ -187,7 +187,7 @@ static ssize_t store_sockfd(struct device *dev,
udc->ud.tcp_socket = socket;
udc->ud.tcp_rx = tcp_rx;
- udc->ud.tcp_rx = tcp_tx;
+ udc->ud.tcp_tx = tcp_tx;
udc->ud.status = SDEV_ST_USED;
spin_unlock_irq(&udc->ud.lock);
diff --git a/fs/dcache.c b/fs/dcache.c
index 2f01b271023d..0301c5dd5e5f 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -81,7 +81,7 @@
* dentry1->d_lock
* dentry2->d_lock
*/
-int sysctl_vfs_cache_pressure __read_mostly = 100;
+int sysctl_vfs_cache_pressure __read_mostly = 50;
EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure);
__cacheline_aligned_in_smp DEFINE_SEQLOCK(rename_lock);
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index f3ea2fb6906c..2cc5ecd3c5e3 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -613,7 +613,7 @@ static inline int utilization(struct f2fs_sb_info *sbi)
* F2FS_IPUT_DISABLE - disable IPU. (=default option in LFS mode)
*/
#define DEF_MIN_IPU_UTIL 70
-#define DEF_MIN_FSYNC_BLOCKS 8
+#define DEF_MIN_FSYNC_BLOCKS 20
#define DEF_MIN_HOT_BLOCKS 16
#define SMALL_VOLUME_SEGMENTS (16 * 512) /* 16GB */
diff --git a/fs/namespace.c b/fs/namespace.c
index 53db6cdba8ea..a994fde7d3c6 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2888,9 +2888,9 @@ long do_mount(const char *dev_name, const char __user *dir_name,
if (retval)
goto dput_out;
- /* Default to relatime unless overriden */
- if (!(flags & MS_NOATIME))
- mnt_flags |= MNT_RELATIME;
+ /* Default to noatime unless overriden */
+ if (!(flags & MS_RELATIME))
+ mnt_flags |= MNT_NOATIME;
/* Separate the per-mountpoint flags */
if (flags & MS_NOSUID)
diff --git a/fs/readdir.c b/fs/readdir.c
index 0c357663e33a..e6f4c7b8884b 100644
--- a/fs/readdir.c
+++ b/fs/readdir.c
@@ -133,6 +133,9 @@ static int fillonedir(struct dir_context *ctx, const char *name, int namlen,
if (buf->result)
return -EINVAL;
+ buf->result = verify_dirent_name(name, namlen);
+ if (buf->result < 0)
+ return buf->result;
d_ino = ino;
if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) {
buf->result = -EOVERFLOW;
@@ -392,6 +395,9 @@ static int compat_fillonedir(struct dir_context *ctx, const char *name,
if (buf->result)
return -EINVAL;
+ buf->result = verify_dirent_name(name, namlen);
+ if (buf->result < 0)
+ return buf->result;
d_ino = ino;
if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) {
buf->result = -EOVERFLOW;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 3d1d4bc8e037..9dca0ef6d759 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -657,10 +657,9 @@ struct request_queue {
#define QUEUE_FLAG_QUIESCED 28 /* queue has been quiesced */
#define QUEUE_FLAG_PREEMPT_ONLY 29 /* only process REQ_PREEMPT requests */
-#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
+#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_NONROT) | \
(1 << QUEUE_FLAG_STACKABLE) | \
- (1 << QUEUE_FLAG_SAME_COMP) | \
- (1 << QUEUE_FLAG_ADD_RANDOM))
+ (1 << QUEUE_FLAG_SAME_COMP))
#define QUEUE_FLAG_MQ_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
(1 << QUEUE_FLAG_STACKABLE) | \
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h
index 8996c092568b..d99e801b58cf 100644
--- a/include/linux/cgroup_subsys.h
+++ b/include/linux/cgroup_subsys.h
@@ -21,7 +21,7 @@ SUBSYS(cpu)
SUBSYS(cpuacct)
#endif
-#if IS_ENABLED(CONFIG_SCHED_TUNE)
+#if IS_ENABLED(CONFIG_SCHED_TUNE) || IS_ENABLED(CONFIG_SCHED_TUNE_DUMMY)
SUBSYS(schedtune)
#endif
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index a49623bc9070..78f0584bbbce 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -578,17 +578,6 @@ struct governor_attr {
size_t count);
};
-static inline bool cpufreq_can_do_remote_dvfs(struct cpufreq_policy *policy)
-{
- /*
- * Allow remote callbacks if:
- * - dvfs_possible_from_any_cpu flag is set
- * - the local and remote CPUs share cpufreq policy
- */
- return policy->dvfs_possible_from_any_cpu ||
- cpumask_test_cpu(smp_processor_id(), policy->cpus);
-}
-
/*********************************************************************
* FREQUENCY TABLE HELPERS *
*********************************************************************/
diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h
index c1bd9854ed30..63fbc5f2adfa 100644
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -69,6 +69,7 @@ enum cpuhp_state {
CPUHP_SLAB_PREPARE,
CPUHP_MD_RAID5_PREPARE,
CPUHP_RCUTREE_PREP,
+ CPUHP_CPUDEV_PM_PREPARE,
CPUHP_HYP_CORE_CTL_ISOLATION_DEAD,
CPUHP_CORE_CTL_ISOLATION_DEAD,
CPUHP_CPUIDLE_COUPLED_PREPARE,
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a1bf10263d11..807544a49667 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -903,7 +903,7 @@ struct file {
struct hlist_node f_hash;
#endif /* #ifdef CONFIG_FILE_TABLE_DEBUG */
} __randomize_layout
- __attribute__((aligned(4))); /* lest something weird decides that 2 is OK */
+ __attribute__((aligned(8)));
struct file_handle {
__u32 handle_bytes;
diff --git a/include/linux/sched.h b/include/linux/sched.h
index b36c0b033783..f54a3274da4f 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1435,6 +1435,12 @@ struct task_struct {
void *security;
#endif
+ struct {
+ struct work_struct work;
+ atomic_t running;
+ bool free_stack;
+ } async_free;
+
/*
* New fields for task_struct should be added above here, so that
* they are included in the randomized portion of task_struct.
diff --git a/include/linux/sched/cpufreq.h b/include/linux/sched/cpufreq.h
index e0234142b2f2..e11d47003fca 100644
--- a/include/linux/sched/cpufreq.h
+++ b/include/linux/sched/cpufreq.h
@@ -21,6 +21,8 @@
#define SCHED_CPUFREQ_RT_DL (SCHED_CPUFREQ_RT | SCHED_CPUFREQ_DL)
#ifdef CONFIG_CPU_FREQ
+struct cpufreq_policy;
+
struct update_util_data {
void (*func)(struct update_util_data *data, u64 time, unsigned int flags);
};
@@ -29,6 +31,7 @@ void cpufreq_add_update_util_hook(int cpu, struct update_util_data *data,
void (*func)(struct update_util_data *data, u64 time,
unsigned int flags));
void cpufreq_remove_update_util_hook(int cpu);
+bool cpufreq_can_do_remote_dvfs(struct cpufreq_policy *policy);
#endif /* CONFIG_CPU_FREQ */
#endif /* _LINUX_SCHED_CPUFREQ_H */
diff --git a/include/linux/sched/rt.h b/include/linux/sched/rt.h
index db865ed25ef3..d88c71cae796 100644
--- a/include/linux/sched/rt.h
+++ b/include/linux/sched/rt.h
@@ -48,9 +48,9 @@ extern void normalize_rt_tasks(void);
/*
- * default timeslice is 100 msecs (used only for SCHED_RR tasks).
+ * default timeslice is 1 jiffy (used only for SCHED_RR tasks).
* Timeslices get refilled after they expire.
*/
-#define RR_TIMESLICE (100 * HZ / 1000)
+#define RR_TIMESLICE (1)
#endif /* _LINUX_SCHED_RT_H */
diff --git a/include/linux/sync_file.h b/include/linux/sync_file.h
index 0ad87c434ae6..b5063948cdd0 100644
--- a/include/linux/sync_file.h
+++ b/include/linux/sync_file.h
@@ -30,14 +30,6 @@
*/
struct sync_file {
struct file *file;
- /**
- * @user_name:
- *
- * Name of the sync file provided by userspace, for merged fences.
- * Otherwise generated through driver callbacks (in which case the
- * entire array is 0).
- */
- char user_name[32];
#ifdef CONFIG_DEBUG_FS
struct list_head sync_file_list;
#endif
@@ -53,6 +45,5 @@ struct sync_file {
struct sync_file *sync_file_create(struct dma_fence *fence);
struct dma_fence *sync_file_get_fence(int fd);
-char *sync_file_get_name(struct sync_file *sync_file, char *buf, int len);
#endif /* _LINUX_SYNC_H */
diff --git a/include/uapi/linux/android/binder.h b/include/uapi/linux/android/binder.h
index 4fed615e494c..59c8a9ec2bca 100644
--- a/include/uapi/linux/android/binder.h
+++ b/include/uapi/linux/android/binder.h
@@ -266,6 +266,18 @@ struct binder_node_info_for_ref {
__u32 reserved3;
};
+struct binder_freeze_info {
+ __u32 pid;
+ __u32 enable;
+ __u32 timeout_ms;
+};
+
+struct binder_frozen_status_info {
+ __u32 pid;
+ __u32 sync_recv;
+ __u32 async_recv;
+};
+
#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
#define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)
#define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)
@@ -276,6 +288,8 @@ struct binder_node_info_for_ref {
#define BINDER_GET_NODE_DEBUG_INFO _IOWR('b', 11, struct binder_node_debug_info)
#define BINDER_GET_NODE_INFO_FOR_REF _IOWR('b', 12, struct binder_node_info_for_ref)
#define BINDER_SET_CONTEXT_MGR_EXT _IOW('b', 13, struct flat_binder_object)
+#define BINDER_FREEZE _IOW('b', 14, struct binder_freeze_info)
+#define BINDER_GET_FROZEN_INFO _IOWR('b', 15, struct binder_frozen_status_info)
/*
* NOTE: Two special error codes you should check for when calling
@@ -297,6 +311,7 @@ enum transaction_flags {
TF_ROOT_OBJECT = 0x04, /* contents are the component's root object */
TF_STATUS_CODE = 0x08, /* contents are a 32-bit status code */
TF_ACCEPT_FDS = 0x10, /* allow replies with file descriptors */
+ TF_CLEAR_BUF = 0x20, /* clear buffer on txn complete */
};
struct binder_transaction_data {
@@ -460,6 +475,12 @@ enum binder_driver_return_protocol {
* The the last transaction (either a bcTRANSACTION or
* a bcATTEMPT_ACQUIRE) failed (e.g. out of memory). No parameters.
*/
+
+ BR_FROZEN_REPLY = _IO('r', 18),
+ /*
+ * The target of the last transaction (either a bcTRANSACTION or
+ * a bcATTEMPT_ACQUIRE) is frozen. No parameters.
+ */
};
enum binder_driver_command_protocol {
diff --git a/init/Kconfig b/init/Kconfig
index ae2cb1423543..e7a28c53f886 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1188,6 +1188,13 @@ config SCHED_TUNE
If unsure, say N.
+config SCHED_TUNE_DUMMY
+ bool "Create dummy SCHEDTUNE nodes"
+ depends on SMP
+ depends on !SCHED_TUNE && !CGROUP_SCHEDTUNE
+ help
+ Create dummy SCHEDTUNE nodes.
+
config DEFAULT_USE_ENERGY_AWARE
bool "Default to enabling the Energy Aware Scheduler feature"
default n
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index ec0563b4484d..b04cd4c051eb 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -1879,45 +1879,6 @@ int cpu_uclamp_boost_write_u64_wrapper(struct cgroup_subsys_state *css,
struct cftype *cftype, u64 boost);
u64 cpu_uclamp_boost_read_u64_wrapper(struct cgroup_subsys_state *css,
struct cftype *cft);
-
-#if !defined(CONFIG_SCHED_TUNE)
-static u64 st_boost_read(struct cgroup_subsys_state *css,
- struct cftype *cft)
-{
- if (!strlen(css->cgroup->kn->name))
- return -EINVAL;
-
- return cpu_uclamp_boost_read_u64_wrapper(css, cft);
-}
-
-static int st_boost_write(struct cgroup_subsys_state *css,
- struct cftype *cft, u64 boost)
-{
- if (!strlen(css->cgroup->kn->name))
- return -EINVAL;
-
- return cpu_uclamp_boost_write_u64_wrapper(css, cft, boost);
-}
-
-static u64 st_prefer_idle_read(struct cgroup_subsys_state *css,
- struct cftype *cft)
-{
- if (!strlen(css->cgroup->kn->name))
- return -EINVAL;
-
- return cpu_uclamp_ls_read_u64_wrapper(css, cft);
-}
-
-static int st_prefer_idle_write(struct cgroup_subsys_state *css,
- struct cftype *cft, u64 prefer_idle)
-{
- if (!strlen(css->cgroup->kn->name))
- return -EINVAL;
-
- return cpu_uclamp_ls_write_u64_wrapper(css, cft, prefer_idle);
-}
-#endif
-
#endif
/*
@@ -2047,20 +2008,6 @@ static struct cftype files[] = {
.read_u64 = cpu_uclamp_boost_read_u64_wrapper,
.write_u64 = cpu_uclamp_boost_write_u64_wrapper,
},
-
-#if !defined(CONFIG_SCHED_TUNE)
- {
- .name = "schedtune.boost",
- .read_u64 = st_boost_read,
- .write_u64 = st_boost_write,
- },
- {
- .name = "schedtune.prefer_idle",
- .read_u64 = st_prefer_idle_read,
- .write_u64 = st_prefer_idle_write,
- },
-#endif
-
#endif
{ } /* terminate */
};
diff --git a/kernel/fork.c b/kernel/fork.c
index b46d05a9a7ff..20d04ce1374d 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -342,7 +342,7 @@ static void account_kernel_stack(struct task_struct *tsk, int account)
}
}
-static void release_task_stack(struct task_struct *tsk)
+void release_task_stack(struct task_struct *tsk)
{
if (WARN_ON(tsk->state != TASK_DEAD))
return; /* Better to leak the stack than to free prematurely */
diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index 57e28af96c5b..6dba40af542c 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -427,21 +427,31 @@ bool mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner,
{
bool ret = true;
- rcu_read_lock();
- while (__mutex_owner(lock) == owner) {
+ for (;;) {
+ unsigned int cpu;
+ bool same_owner;
+
/*
- * Ensure we emit the owner->on_cpu, dereference _after_
- * checking lock->owner still matches owner. If that fails,
+ * Ensure lock->owner still matches owner. If that fails,
* owner might point to freed memory. If it still matches,
* the rcu_read_lock() ensures the memory stays valid.
*/
- barrier();
+ rcu_read_lock();
+ same_owner = __mutex_owner(lock) == owner;
+ if (same_owner) {
+ ret = owner->on_cpu;
+ if (ret)
+ cpu = task_cpu(owner);
+ }
+ rcu_read_unlock();
+
+ if (!ret || !same_owner)
+ break;
/*
* Use vcpu_is_preempted to detect lock holder preemption issue.
*/
- if (!owner->on_cpu || need_resched() ||
- vcpu_is_preempted(task_cpu(owner))) {
+ if (need_resched() || vcpu_is_preempted(cpu)) {
ret = false;
break;
}
@@ -453,7 +463,6 @@ bool mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner,
cpu_relax();
}
- rcu_read_unlock();
return ret;
}
diff --git a/kernel/locking/rwsem-xadd.c b/kernel/locking/rwsem-xadd.c
index 350861f0da16..8917e6ceb3d0 100644
--- a/kernel/locking/rwsem-xadd.c
+++ b/kernel/locking/rwsem-xadd.c
@@ -400,32 +400,36 @@ static noinline bool rwsem_spin_on_owner(struct rw_semaphore *sem)
{
struct task_struct *owner = READ_ONCE(sem->owner);
- if (!is_rwsem_owner_spinnable(owner))
+ if (!owner || !is_rwsem_owner_spinnable(owner))
return false;
- rcu_read_lock();
- while (owner && (READ_ONCE(sem->owner) == owner)) {
+ while (true) {
+ bool on_cpu, same_owner;
+
/*
- * Ensure we emit the owner->on_cpu, dereference _after_
- * checking sem->owner still matches owner, if that fails,
+ * Ensure sem->owner still matches owner. If that fails,
* owner might point to free()d memory, if it still matches,
* the rcu_read_lock() ensures the memory stays valid.
*/
- barrier();
+ rcu_read_lock();
+ same_owner = sem->owner == owner;
+ if (same_owner)
+ on_cpu = owner->on_cpu &&
+ !vcpu_is_preempted(task_cpu(owner));
+ rcu_read_unlock();
+
+ if (!same_owner)
+ break;
/*
* abort spinning when need_resched or owner is not running or
* owner's cpu is preempted.
*/
- if (!owner->on_cpu || need_resched() ||
- vcpu_is_preempted(task_cpu(owner))) {
- rcu_read_unlock();
+ if (!on_cpu || need_resched())
return false;
- }
cpu_relax();
}
- rcu_read_unlock();
/*
* If there is a new owner or the owner is not set, we continue
diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile
index e9adba01c456..5bd0fbecc37b 100644
--- a/kernel/sched/Makefile
+++ b/kernel/sched/Makefile
@@ -26,6 +26,7 @@ obj-$(CONFIG_SCHED_AUTOGROUP) += autogroup.o
obj-$(CONFIG_SCHEDSTATS) += stats.o
obj-$(CONFIG_SCHED_DEBUG) += debug.o
obj-$(CONFIG_SCHED_TUNE) += tune.o
+obj-$(CONFIG_SCHED_TUNE_DUMMY) += tune_dummy.o
obj-$(CONFIG_CGROUP_CPUACCT) += cpuacct.o
obj-$(CONFIG_CPU_FREQ) += cpufreq.o
obj-$(CONFIG_CPU_FREQ_GOV_SCHEDUTIL) += cpufreq_schedutil.o
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 2e3c650573bb..5f832ae982e6 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3544,6 +3544,50 @@ prepare_task_switch(struct rq *rq, struct task_struct *prev,
prepare_arch_switch(next);
}
+void release_task_stack(struct task_struct *tsk);
+static void task_async_free(struct work_struct *work)
+{
+ struct task_struct *t = container_of(work, typeof(*t), async_free.work);
+ bool free_stack = READ_ONCE(t->async_free.free_stack);
+
+ atomic_set(&t->async_free.running, 0);
+
+ if (free_stack) {
+ release_task_stack(t);
+ put_task_struct(t);
+ } else {
+ __put_task_struct(t);
+ }
+}
+
+static void finish_task_switch_dead(struct task_struct *prev)
+{
+ if (atomic_cmpxchg(&prev->async_free.running, 0, 1)) {
+ put_task_stack(prev);
+ put_task_struct(prev);
+ return;
+ }
+
+ if (atomic_dec_and_test(&prev->stack_refcount)) {
+ prev->async_free.free_stack = true;
+ } else if (atomic_dec_and_test(&prev->usage)) {
+ prev->async_free.free_stack = false;
+ } else {
+ atomic_set(&prev->async_free.running, 0);
+ return;
+ }
+
+ INIT_WORK(&prev->async_free.work, task_async_free);
+ queue_work(system_unbound_wq, &prev->async_free.work);
+}
+
+static void mmdrop_async_free(struct work_struct *work)
+{
+ struct mm_struct *mm = container_of(work, typeof(*mm), async_put_work);
+
+ __mmdrop(mm);
+}
+
/**
* finish_task_switch - clean up after a task-switch
* @prev: the thread we just switched away from.
@@ -3617,8 +3661,10 @@ static struct rq *finish_task_switch(struct task_struct *prev)
kcov_finish_switch(current);
fire_sched_in_preempt_notifiers(current);
- if (mm)
- mmdrop(mm);
+ if (mm && atomic_dec_and_test(&mm->mm_count)) {
+ INIT_WORK(&mm->async_put_work, mmdrop_async_free);
+ queue_work(system_unbound_wq, &mm->async_put_work);
+ }
if (unlikely(prev_state == TASK_DEAD)) {
if (prev->sched_class->task_dead)
prev->sched_class->task_dead(prev);
@@ -3629,11 +3675,7 @@ static struct rq *finish_task_switch(struct task_struct *prev)
*/
kprobe_flush_task(prev);
- /* Task is done with its stack. */
- put_task_stack(prev);
-
- put_task_struct(prev);
-
+ finish_task_switch_dead(prev);
}
tick_nohz_task_switch();
@@ -5002,7 +5044,8 @@ static void __setscheduler_params(struct task_struct *p,
if (policy == SETPARAM_POLICY)
policy = p->policy;
- p->policy = policy;
+ /* Replace SCHED_FIFO with SCHED_RR to reduce latency */
+ p->policy = policy == SCHED_FIFO ? SCHED_RR : policy;
if (dl_policy(policy))
__setparam_dl(p, attr);
diff --git a/kernel/sched/cpufreq.c b/kernel/sched/cpufreq.c
index dbc51442ecbc..c2129347f793 100644
--- a/kernel/sched/cpufreq.c
+++ b/kernel/sched/cpufreq.c
@@ -8,6 +8,7 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
+#include <linux/cpufreq.h>
#include "sched.h"
@@ -61,3 +62,19 @@ void cpufreq_remove_update_util_hook(int cpu)
rcu_assign_pointer(per_cpu(cpufreq_update_util_data, cpu), NULL);
}
EXPORT_SYMBOL_GPL(cpufreq_remove_update_util_hook);
+
+/**
+ * cpufreq_can_do_remote_dvfs - Check if cpufreq policy can be updated.
+ * @policy: cpufreq policy to check.
+ *
+ * Return 'true' if:
+ * - the local and remote CPUs share @policy,
+ * - dvfs_possible_from_any_cpu is set in @policy and the local CPU is not going
+ * offline (in which case it is not expected to run cpufreq updates any more).
+ */
+bool cpufreq_can_do_remote_dvfs(struct cpufreq_policy *policy)
+{
+ return cpumask_test_cpu(smp_processor_id(), policy->cpus) ||
+ (policy->dvfs_possible_from_any_cpu &&
+ rcu_dereference_sched(*this_cpu_ptr(&cpufreq_update_util_data)));
+}
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index d92acbfece89..83b58e7fa864 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -108,12 +108,10 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time)
* by the hardware, as calculating the frequency is pointless if
* we cannot in fact act on it.
*
- * For the slow switching platforms, the kthread is always scheduled on
- * the right set of CPUs and any CPU can find the next frequency and
- * schedule the kthread.
+ * This is needed on the slow switching platforms too to prevent CPUs
+ * going offline from leaving stale IRQ work items behind.
*/
- if (sg_policy->policy->fast_switch_enabled &&
- !cpufreq_can_do_remote_dvfs(sg_policy->policy))
+ if (!cpufreq_can_do_remote_dvfs(sg_policy->policy))
return false;
if (unlikely(sg_policy->need_freq_update)) {
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index f676735e500a..0b521c46a86e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7822,6 +7822,13 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu,
continue;
/*
+ * Skip searching for active CPU for tasks have
+ * high priority & prefer_high_cap.
+ */
+ if (prefer_high_cap && p->prio <= DEFAULT_PRIO)
+ continue;
+
+ /*
* Case A.2: Target ACTIVE CPU
* Favor CPUs with max spare capacity.
*/
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index c8f70ea89099..63b871ddce22 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -196,7 +196,7 @@ static void cpuidle_idle_call(void)
*/
next_state = cpuidle_select(drv, dev, &stop_tick);
- if (stop_tick || tick_nohz_tick_stopped())
+ if (stop_tick)
tick_nohz_idle_stop_tick();
else
tick_nohz_idle_retain_tick();
@@ -239,7 +239,6 @@ static void do_idle(void)
*/
__current_set_polling();
- quiet_vmstat();
tick_nohz_idle_enter();
while (!need_resched()) {
diff --git a/kernel/sched/tune_dummy.c b/kernel/sched/tune_dummy.c
new file mode 100644
index 000000000000..271e7d9cc2f3
--- /dev/null
+++ b/kernel/sched/tune_dummy.c
@@ -0,0 +1,122 @@
+#include <linux/cgroup.h>
+#include "sched.h"
+
+#define BOOSTGROUPS_COUNT 5
+
+struct schedtune {
+ /* SchedTune CGroup subsystem */
+ struct cgroup_subsys_state css;
+
+ /* Boost value for tasks on that SchedTune CGroup */
+ int boost;
+
+ /* Hint to bias scheduling of tasks on that SchedTune CGroup
+ * towards idle CPUs */
+ int prefer_idle;
+};
+
+static struct schedtune
+root_schedtune = {
+ .boost = 0,
+ .prefer_idle = 0,
+};
+
+static struct schedtune *allocated_group[BOOSTGROUPS_COUNT] = {
+ &root_schedtune,
+ NULL,
+};
+
+static inline struct schedtune *css_st(struct cgroup_subsys_state *css)
+{
+ return container_of(css, struct schedtune, css);
+}
+
+static u64
+prefer_idle_read(struct cgroup_subsys_state *css, struct cftype *cft)
+{
+ return 0;
+}
+
+static int
+prefer_idle_write(struct cgroup_subsys_state *css, struct cftype *cft,
+ u64 prefer_idle)
+{
+ return 0;
+}
+
+static s64
+boost_read(struct cgroup_subsys_state *css, struct cftype *cft)
+{
+ return 0;
+}
+
+static int
+boost_write(struct cgroup_subsys_state *css, struct cftype *cft,
+ s64 boost)
+{
+ return 0;
+}
+
+static struct cftype files[] = {
+ {
+ .name = "boost",
+ .read_s64 = boost_read,
+ .write_s64 = boost_write,
+ },
+ {
+ .name = "prefer_idle",
+ .read_u64 = prefer_idle_read,
+ .write_u64 = prefer_idle_write,
+ },
+ { } /* terminate */
+};
+
+static struct cgroup_subsys_state *
+schedtune_css_alloc(struct cgroup_subsys_state *parent_css)
+{
+ struct schedtune *st;
+ int idx;
+
+ if (!parent_css)
+ return &root_schedtune.css;
+
+ /* Allow only single level hierachies */
+ if (parent_css != &root_schedtune.css) {
+ pr_err("Nested SchedTune boosting groups not allowed\n");
+ return ERR_PTR(-ENOMEM);
+ }
+
+ /* Allow only a limited number of boosting groups */
+ for (idx = 1; idx < BOOSTGROUPS_COUNT; ++idx)
+ if (!allocated_group[idx])
+ break;
+ if (idx == BOOSTGROUPS_COUNT) {
+ pr_err("Trying to create more than %d SchedTune boosting groups\n",
+ BOOSTGROUPS_COUNT);
+ return ERR_PTR(-ENOSPC);
+ }
+
+ st = kzalloc(sizeof(*st), GFP_KERNEL);
+ if (!st)
+ goto out;
+
+ return &st->css;
+
+out:
+ return ERR_PTR(-ENOMEM);
+}
+
+static void
+schedtune_css_free(struct cgroup_subsys_state *css)
+{
+ struct schedtune *st = css_st(css);
+
+ kfree(st);
+}
+
+struct cgroup_subsys schedtune_cgrp_subsys = {
+ .css_alloc = schedtune_css_alloc,
+ .css_free = schedtune_css_free,
+ .legacy_cftypes = files,
+ .early_init = 1,
+};
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index d8a2ae86ebd3..e9c7494ed8d9 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -29,6 +29,7 @@
#include <linux/timer.h>
#include <linux/context_tracking.h>
#include <linux/rq_stats.h>
+#include <linux/mm.h>
#include <asm/irq_regs.h>
@@ -823,6 +824,7 @@ static void tick_nohz_stop_tick(struct tick_sched *ts, int cpu)
if (!ts->tick_stopped) {
calc_load_nohz_start();
cpu_load_update_nohz_start();
+ quiet_vmstat();
ts->last_tick = hrtimer_get_expires(&ts->sched_timer);
ts->tick_stopped = 1;
diff --git a/mm/gup.c b/mm/gup.c
index c3a9fd237da1..3c5ea6cb560b 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -61,13 +61,22 @@ static int follow_pfn_pte(struct vm_area_struct *vma, unsigned long address,
}
/*
- * FOLL_FORCE can write to even unwritable pte's, but only
- * after we've gone through a COW cycle and they are dirty.
+ * FOLL_FORCE or a forced COW break can write even to unwritable pte's,
+ * but only after we've gone through a COW cycle and they are dirty.
*/
static inline bool can_follow_write_pte(pte_t pte, unsigned int flags)
{
- return pte_write(pte) ||
- ((flags & FOLL_FORCE) && (flags & FOLL_COW) && pte_dirty(pte));
+ return pte_write(pte) || ((flags & FOLL_COW) && pte_dirty(pte));
+}
+
+/*
+ * A (separate) COW fault might break the page the other way and
+ * get_user_pages() would return the page from what is now the wrong
+ * VM. So we need to force a COW break at GUP time even for reads.
+ */
+static inline bool should_force_cow_break(struct vm_area_struct *vma, unsigned int flags)
+{
+ return is_cow_mapping(vma->vm_flags) && (flags & FOLL_GET);
}
static struct page *follow_page_pte(struct vm_area_struct *vma,
@@ -696,12 +705,18 @@ static long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
if (!vma || check_vma_flags(vma, gup_flags))
return i ? : -EFAULT;
if (is_vm_hugetlb_page(vma)) {
+ if (should_force_cow_break(vma, foll_flags))
+ foll_flags |= FOLL_WRITE;
i = follow_hugetlb_page(mm, vma, pages, vmas,
&start, &nr_pages, i,
- gup_flags, nonblocking);
+ foll_flags, nonblocking);
continue;
}
}
+
+ if (should_force_cow_break(vma, foll_flags))
+ foll_flags |= FOLL_WRITE;
+
retry:
/*
* If we have a pending SIGKILL, don't keep faulting pages and
@@ -1800,6 +1815,10 @@ bool gup_fast_permitted(unsigned long start, int nr_pages, int write)
/*
* Like get_user_pages_fast() except it's IRQ-safe in that it won't fall back to
* the regular GUP. It will only return non-negative values.
+ *
+ * Careful, careful! COW breaking can go either way, so a non-write
+ * access can get ambiguous page results. If you call this function without
+ * 'write' set, you'd better be sure that you're ok with that ambiguity.
*/
int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
struct page **pages)
@@ -1827,6 +1846,12 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
*
* We do not adopt an rcu_read_lock(.) here as we also want to
* block IPIs that come from THPs splitting.
+ *
+ * NOTE! We allow read-only gup_fast() here, but you'd better be
+ * careful about possible COW pages. You'll get _a_ COW page, but
+ * not necessarily the one you intended to get depending on what
+ * COW event happens after this. COW may break the page copy in a
+ * random direction.
*/
if (gup_fast_permitted(start, nr_pages, write)) {
@@ -1872,9 +1897,16 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
(void __user *)start, len)))
return -EFAULT;
+ /*
+ * The FAST_GUP case requires FOLL_WRITE even for pure reads,
+ * because get_user_pages() may need to cause an early COW in
+ * order to avoid confusing the normal COW routines. So only
+ * targets that are already writable are safe to do by just
+ * looking at the page tables.
+ */
if (gup_fast_permitted(start, nr_pages, write)) {
local_irq_disable();
- gup_pgd_range(addr, end, write, pages, &nr);
+ gup_pgd_range(addr, end, 1, pages, &nr);
local_irq_enable();
ret = nr;
}
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 6315dad0e6ec..5c9ccb66a5ce 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1367,13 +1367,12 @@ out_unlock:
}
/*
- * FOLL_FORCE can write to even unwritable pmd's, but only
- * after we've gone through a COW cycle and they are dirty.
+ * FOLL_FORCE or a forced COW break can write even to unwritable pmd's,
+ * but only after we've gone through a COW cycle and they are dirty.
*/
static inline bool can_follow_write_pmd(pmd_t pmd, unsigned int flags)
{
- return pmd_write(pmd) ||
- ((flags & FOLL_FORCE) && (flags & FOLL_COW) && pmd_dirty(pmd));
+ return pmd_write(pmd) || ((flags & FOLL_COW) && pmd_dirty(pmd));
}
struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 6461990c8859..96a89da15e1f 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1275,7 +1275,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
* we can reinject the packet there.
*/
n2 = NULL;
- if (dst) {
+ if (dst && dst->obsolete != DST_OBSOLETE_DEAD) {
n2 = dst_neigh_lookup_skb(dst, skb);
if (n2)
n1 = n2;
diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index b10b297e76b7..b1c55db73764 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -1516,6 +1516,11 @@ nl802154_dump_llsec_key(struct sk_buff *skb, struct netlink_callback *cb)
if (err)
return err;
+ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) {
+ err = skb->len;
+ goto out_err;
+ }
+
if (!wpan_dev->netdev) {
err = -EINVAL;
goto out_err;
@@ -1688,6 +1693,11 @@ nl802154_dump_llsec_dev(struct sk_buff *skb, struct netlink_callback *cb)
if (err)
return err;
+ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) {
+ err = skb->len;
+ goto out_err;
+ }
+
if (!wpan_dev->netdev) {
err = -EINVAL;
goto out_err;
@@ -1775,6 +1785,9 @@ static int nl802154_add_llsec_dev(struct sk_buff *skb, struct genl_info *info)
struct wpan_dev *wpan_dev = dev->ieee802154_ptr;
struct ieee802154_llsec_device dev_desc;
+ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR)
+ return -EOPNOTSUPP;
+
if (ieee802154_llsec_parse_device(info->attrs[NL802154_ATTR_SEC_DEVICE],
&dev_desc) < 0)
return -EINVAL;
@@ -1861,6 +1874,11 @@ nl802154_dump_llsec_devkey(struct sk_buff *skb, struct netlink_callback *cb)
if (err)
return err;
+ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) {
+ err = skb->len;
+ goto out_err;
+ }
+
if (!wpan_dev->netdev) {
err = -EINVAL;
goto out_err;
@@ -1918,6 +1936,9 @@ static int nl802154_add_llsec_devkey(struct sk_buff *skb, struct genl_info *info
struct ieee802154_llsec_device_key key;
__le64 extended_addr;
+ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR)
+ return -EOPNOTSUPP;
+
if (!info->attrs[NL802154_ATTR_SEC_DEVKEY] ||
nla_parse_nested(attrs, NL802154_DEVKEY_ATTR_MAX,
info->attrs[NL802154_ATTR_SEC_DEVKEY],
@@ -2027,6 +2048,11 @@ nl802154_dump_llsec_seclevel(struct sk_buff *skb, struct netlink_callback *cb)
if (err)
return err;
+ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) {
+ err = skb->len;
+ goto out_err;
+ }
+
if (!wpan_dev->netdev) {
err = -EINVAL;
goto out_err;
@@ -2112,6 +2138,9 @@ static int nl802154_add_llsec_seclevel(struct sk_buff *skb,
struct wpan_dev *wpan_dev = dev->ieee802154_ptr;
struct ieee802154_llsec_seclevel sl;
+ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR)
+ return -EOPNOTSUPP;
+
if (llsec_parse_seclevel(info->attrs[NL802154_ATTR_SEC_LEVEL],
&sl) < 0)
return -EINVAL;
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index a598bb2080ef..6d85d995b942 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1804,9 +1804,9 @@ static void __net_exit sit_destroy_tunnels(struct net *net,
if (dev->rtnl_link_ops == &sit_link_ops)
unregister_netdevice_queue(dev, head);
- for (prio = 1; prio < 4; prio++) {
+ for (prio = 0; prio < 4; prio++) {
int h;
- for (h = 0; h < IP6_SIT_HASH_SIZE; h++) {
+ for (h = 0; h < (prio ? IP6_SIT_HASH_SIZE : 1); h++) {
struct ip_tunnel *t;
t = rtnl_dereference(sitn->tunnels[prio][h]);
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 0563bde0c285..3b3ed96c19e5 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1536,8 +1536,10 @@ static int ieee80211_change_station(struct wiphy *wiphy,
}
if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
- sta->sdata->u.vlan.sta)
+ sta->sdata->u.vlan.sta) {
+ ieee80211_clear_fast_rx(sta);
RCU_INIT_POINTER(sta->sdata->u.vlan.sta, NULL);
+ }
if (test_sta_flag(sta, WLAN_STA_AUTHORIZED))
ieee80211_vif_dec_num_mcast(sta->sdata);
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
index 3714c4a71cca..f8f3d1eb76dd 100644
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
@@ -272,6 +272,7 @@ static const char* l4proto_name(u16 proto)
case IPPROTO_GRE: return "gre";
case IPPROTO_SCTP: return "sctp";
case IPPROTO_UDPLITE: return "udplite";
+ case IPPROTO_ICMPV6: return "icmpv6";
}
return "unknown";
diff --git a/net/netfilter/nft_limit.c b/net/netfilter/nft_limit.c
index 72f13a1144dd..a7bdc532479a 100644
--- a/net/netfilter/nft_limit.c
+++ b/net/netfilter/nft_limit.c
@@ -79,13 +79,13 @@ static int nft_limit_init(struct nft_limit *limit,
return -EOVERFLOW;
if (pkts) {
- tokens = div_u64(limit->nsecs, limit->rate) * limit->burst;
+ tokens = div64_u64(limit->nsecs, limit->rate) * limit->burst;
} else {
/* The token bucket size limits the number of tokens can be
* accumulated. tokens_max specifies the bucket size.
* tokens_max = unit * (rate + burst) / rate.
*/
- tokens = div_u64(limit->nsecs * (limit->rate + limit->burst),
+ tokens = div64_u64(limit->nsecs * (limit->rate + limit->burst),
limit->rate);
}
diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
index 5e41b0e6fcd7..da469f86d45c 100644
--- a/net/qrtr/qrtr.c
+++ b/net/qrtr/qrtr.c
@@ -706,15 +706,20 @@ EXPORT_SYMBOL(qrtr_peek_pkt_size);
static void qrtr_alloc_backup(struct work_struct *work)
{
struct sk_buff *skb;
+ int errcode;
while (skb_queue_len(&qrtr_backup_lo) < QRTR_BACKUP_LO_NUM) {
- skb = alloc_skb(QRTR_BACKUP_LO_SIZE, GFP_KERNEL);
+ skb = alloc_skb_with_frags(sizeof(struct qrtr_hdr_v1),
+ QRTR_BACKUP_LO_SIZE, 0, &errcode,
+ GFP_KERNEL);
if (!skb)
break;
skb_queue_tail(&qrtr_backup_lo, skb);
}
while (skb_queue_len(&qrtr_backup_hi) < QRTR_BACKUP_HI_NUM) {
- skb = alloc_skb(QRTR_BACKUP_HI_SIZE, GFP_KERNEL);
+ skb = alloc_skb_with_frags(sizeof(struct qrtr_hdr_v1),
+ QRTR_BACKUP_HI_SIZE, 0, &errcode,
+ GFP_KERNEL);
if (!skb)
break;
skb_queue_tail(&qrtr_backup_hi, skb);
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 1f154276a681..5df93a00fda2 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1586,11 +1586,9 @@ static void sctp_close(struct sock *sk, long timeout)
/* Supposedly, no process has access to the socket, but
* the net layers still may.
- * Also, sctp_destroy_sock() needs to be called with addr_wq_lock
- * held and that should be grabbed before socket lock.
*/
- spin_lock_bh(&net->sctp.addr_wq_lock);
- bh_lock_sock_nested(sk);
+ local_bh_disable();
+ bh_lock_sock(sk);
/* Hold the sock, since sk_common_release() will put sock_put()
* and we have just a little more cleanup.
@@ -1599,7 +1597,7 @@ static void sctp_close(struct sock *sk, long timeout)
sk_common_release(sk);
bh_unlock_sock(sk);
- spin_unlock_bh(&net->sctp.addr_wq_lock);
+ local_bh_enable();
sock_put(sk);
@@ -4449,9 +4447,6 @@ static int sctp_init_sock(struct sock *sk)
sk_sockets_allocated_inc(sk);
sock_prot_inuse_add(net, sk->sk_prot, 1);
- /* Nothing can fail after this block, otherwise
- * sctp_destroy_sock() will be called without addr_wq_lock held
- */
if (net->sctp.default_auto_asconf) {
spin_lock(&sock_net(sk)->sctp.addr_wq_lock);
list_add_tail(&sp->auto_asconf_list,
@@ -4486,7 +4481,9 @@ static void sctp_destroy_sock(struct sock *sk)
if (sp->do_auto_asconf) {
sp->do_auto_asconf = 0;
+ spin_lock_bh(&sock_net(sk)->sctp.addr_wq_lock);
list_del(&sp->auto_asconf_list);
+ spin_unlock_bh(&sock_net(sk)->sctp.addr_wq_lock);
}
sctp_endpoint_free(sp->ep);
local_bh_disable();
diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index 6152ae24772b..3ac87f7843f6 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -494,11 +494,13 @@ static int fsl_esai_startup(struct snd_pcm_substream *substream,
ESAI_SAICR_SYNC, esai_priv->synchronous ?
ESAI_SAICR_SYNC : 0);
- /* Set a default slot number -- 2 */
+ /* Set slots count */
regmap_update_bits(esai_priv->regmap, REG_ESAI_TCCR,
- ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(2));
+ ESAI_xCCR_xDC_MASK,
+ ESAI_xCCR_xDC(esai_priv->slots));
regmap_update_bits(esai_priv->regmap, REG_ESAI_RCCR,
- ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(2));
+ ESAI_xCCR_xDC_MASK,
+ ESAI_xCCR_xDC(esai_priv->slots));
}
return 0;
diff --git a/techpack/audio/4.0/dsp/q6afe.c b/techpack/audio/4.0/dsp/q6afe.c
index e3d75ccc5727..cc6288da8956 100644
--- a/techpack/audio/4.0/dsp/q6afe.c
+++ b/techpack/audio/4.0/dsp/q6afe.c
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
-/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
*/
#include <linux/slab.h>
#include <linux/debugfs.h>
@@ -8829,6 +8829,7 @@ static int afe_get_cal_sp_th_vi_param(int32_t cal_type, size_t data_size,
if (cal_data == NULL ||
data_size > sizeof(*cal_data) ||
+ data_size < sizeof(cal_data->cal_hdr) ||
this_afe.cal_data[AFE_FB_SPKR_PROT_TH_VI_CAL] == NULL)
return 0;
@@ -8855,7 +8856,8 @@ static int afe_get_cal_sp_ex_vi_ftm_param(int32_t cal_type, size_t data_size,
pr_debug("%s: cal_type = %d\n", __func__, cal_type);
if (this_afe.cal_data[AFE_FB_SPKR_PROT_EX_VI_CAL] == NULL ||
cal_data == NULL ||
- data_size != sizeof(*cal_data))
+ data_size > sizeof(*cal_data) ||
+ data_size < sizeof(cal_data->cal_hdr))
goto done;
mutex_lock(&this_afe.cal_data[AFE_FB_SPKR_PROT_EX_VI_CAL]->lock);
diff --git a/techpack/audio/asoc/msm-pcm-routing-v2.c b/techpack/audio/asoc/msm-pcm-routing-v2.c
index 4518c0416496..9bdb4069ea57 100644
--- a/techpack/audio/asoc/msm-pcm-routing-v2.c
+++ b/techpack/audio/asoc/msm-pcm-routing-v2.c
@@ -1554,6 +1554,11 @@ static int msm_pcm_routing_channel_mixer(int fe_id, bool perf_mode,
for (i = 0; i < ADM_MAX_CHANNELS && channel_input[fe_id][i] > 0;
++i) {
be_id = channel_input[fe_id][i] - 1;
+ if (be_id < 0 || be_id >= MSM_BACKEND_DAI_MAX) {
+ pr_err("%s: Received out of bounds be_id %d\n",
+ __func__, be_id);
+ return -EINVAL;
+ }
channel_mixer[fe_id].input_channels[i] =
msm_bedais[be_id].channel;
@@ -3100,10 +3105,10 @@ static int msm_pcm_get_out_chs(struct snd_kcontrol *kcontrol,
static int msm_pcm_put_out_chs(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- u16 fe_id = 0;
-
+ u16 fe_id = 0, out_ch = 0;
fe_id = ((struct soc_multi_mixer_control *)
kcontrol->private_value)->shift;
+ out_ch = ucontrol->value.integer.value[0];
if (fe_id >= MSM_FRONTEND_DAI_MM_SIZE) {
pr_err("%s: invalid FE %d\n", __func__, fe_id);
return -EINVAL;
@@ -3112,6 +3117,12 @@ static int msm_pcm_put_out_chs(struct snd_kcontrol *kcontrol,
pr_debug("%s: fe_id is %d, output channels = %d\n", __func__,
fe_id,
(unsigned int)(ucontrol->value.integer.value[0]));
+ if (out_ch < 0 ||
+ out_ch > ADM_MAX_CHANNELS) {
+ pr_err("%s: invalid output channel %d\n", __func__,
+ out_ch);
+ return -EINVAL;
+ }
channel_mixer[fe_id].output_channel =
(unsigned int)(ucontrol->value.integer.value[0]);
diff --git a/techpack/audio/dsp/q6afe.c b/techpack/audio/dsp/q6afe.c
index cef80bb4e906..9975240112c6 100644
--- a/techpack/audio/dsp/q6afe.c
+++ b/techpack/audio/dsp/q6afe.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
* Copyright (C) 2021 XiaoMi, Inc.
*
* This program is free software; you can redistribute it and/or modify
@@ -8176,6 +8176,7 @@ static int afe_get_cal_sp_th_vi_param(int32_t cal_type, size_t data_size,
if (cal_data == NULL ||
data_size > sizeof(*cal_data) ||
+ data_size < sizeof(cal_data->cal_hdr) ||
this_afe.cal_data[AFE_FB_SPKR_PROT_TH_VI_CAL] == NULL)
return 0;
@@ -8202,7 +8203,8 @@ static int afe_get_cal_sp_ex_vi_ftm_param(int32_t cal_type, size_t data_size,
pr_debug("%s: cal_type = %d\n", __func__, cal_type);
if (this_afe.cal_data[AFE_FB_SPKR_PROT_EX_VI_CAL] == NULL ||
cal_data == NULL ||
- data_size != sizeof(*cal_data))
+ data_size > sizeof(*cal_data) ||
+ data_size < sizeof(cal_data->cal_hdr))
goto done;
mutex_lock(&this_afe.cal_data[AFE_FB_SPKR_PROT_EX_VI_CAL]->lock);
diff --git a/tools/arch/ia64/include/asm/barrier.h b/tools/arch/ia64/include/asm/barrier.h
index d808ee0e77b5..90f8bbd9aede 100644
--- a/tools/arch/ia64/include/asm/barrier.h
+++ b/tools/arch/ia64/include/asm/barrier.h
@@ -39,9 +39,6 @@
* sequential memory pages only.
*/
-/* XXX From arch/ia64/include/uapi/asm/gcc_intrin.h */
-#define ia64_mf() asm volatile ("mf" ::: "memory")
-
#define mb() ia64_mf()
#define rmb() mb()
#define wmb() mb()