mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
Merge android-4.14-p.87 (11d6531a) into msm-4.14
* refs/heads/tmp-11d6531a: Linux 4.14.87 tipc: use destination length for copy string net: qed: use correct strncpy() size mm: hide incomplete nr_indirectly_reclaimable in /proc/zoneinfo thermal/drivers/hisi: Remove costly sensor inspection thermal/drivers/hisi: Fix configuration register setting thermal/drivers/hisi: Encapsulate register writes into helpers thermal/drivers/hisi: Remove pointless lock thermal/drivers/hisi: Remove the multiple sensors support mm: cleancache: fix corruption on missed inode invalidation reset: remove remaining WARN_ON() in <linux/reset.h> reset: make device_reset_optional() really optional udf: Allow mounting volumes with incorrect identification strings arc: [devboards] Add support of NFSv3 ACL ARC: change defconfig defaults to ARCv2 btrfs: Always try all copies when reading extent buffers btrfs: tree-checker: Don't check max block group size as current max chunk size limit is unreliable Input: elan_i2c - add support for ELAN0621 touchpad Input: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15ARR Input: elan_i2c - add ELAN0620 to the ACPI table Input: cros_ec_keyb - fix button/switch capability reports Input: matrix_keypad - check for errors from of_get_named_gpio() Input: synaptics - add PNP ID for ThinkPad P50 to SMBus Input: xpad - quirk all PDP Xbox One gamepads drm/msm: fix OF child-node lookup svm: Add mutex_lock to protect apic_access_page_done on AMD systems kgdboc: Fix warning with module build kgdboc: Fix restrict error ALSA: trident: Suppress gcc string warning userfaultfd: shmem/hugetlbfs: only allow to register VM_MAYWRITE vmas scsi: scsi_devinfo: cleanly zero-pad devinfo strings userfaultfd: shmem: UFFDIO_COPY: set the page dirty if VM_WRITE is not set userfaultfd: shmem: add i_size checks userfaultfd: shmem: allocate anonymous memory for MAP_PRIVATE shmem userfaultfd: use ENOENT instead of EFAULT if the atomic copy user fails drm/meson: Fix OOB memory accesses in meson_viu_set_osd_lut() drm/meson: Enable fast_io in meson_dw_hdmi_regmap_config drm: set is_master to 0 upon drm_new_set_master() failure drm/ast: Fix incorrect free on ioregs IB/mlx5: Avoid load failure due to unknown link width mips: fix mips_get_syscall_arg o32 check MIPS: ralink: Fix mt7620 nd_sd pinmux uprobes: Fix handle_swbp() vs. unregister() + register() race once more iser: set sector for ambiguous mr status errors kdb: use memmove instead of overlapping memcpy staging: rts5208: fix gcc-8 logic error warning scsi: bfa: convert to strlcpy/strlcat drm: gma500: fix logic error ip_tunnel: Fix name string concatenate in __ip_tunnel_create() kernfs: Replace strncpy with memcpy unifdef: use memcpy instead of strncpy ALSA: intel_hdmi: Use strlcpy() instead of strncpy() kobject: Replace strncpy with memcpy test_hexdump: use memcpy instead of strncpy disable stringop truncation warnings for now Kbuild: suppress packed-not-aligned warning for default setting only Change-Id: I8b6e611925fe710d944256d011f76e29869f7508 Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org> Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
This commit is contained in:
commit
124f6fb729
5
Makefile
5
Makefile
@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 14
|
||||
SUBLEVEL = 86
|
||||
SUBLEVEL = 87
|
||||
EXTRAVERSION =
|
||||
NAME = Petit Gorille
|
||||
|
||||
@ -897,6 +897,9 @@ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
|
||||
# disable pointer signed / unsigned warnings in gcc 4.0
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign)
|
||||
|
||||
# disable stringop warnings in gcc 8+
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
|
||||
|
||||
# disable invalid "can't wrap" optimizations for signed / pointers
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
|
||||
|
||||
|
@ -109,7 +109,7 @@ endmenu
|
||||
|
||||
choice
|
||||
prompt "ARC Instruction Set"
|
||||
default ISA_ARCOMPACT
|
||||
default ISA_ARCV2
|
||||
|
||||
config ISA_ARCOMPACT
|
||||
bool "ARCompact ISA"
|
||||
|
@ -6,7 +6,7 @@
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
|
||||
KBUILD_DEFCONFIG := nsim_700_defconfig
|
||||
KBUILD_DEFCONFIG := nsim_hs_defconfig
|
||||
|
||||
cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
|
||||
cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7
|
||||
|
@ -15,6 +15,7 @@ CONFIG_PERF_EVENTS=y
|
||||
# CONFIG_VM_EVENT_COUNTERS is not set
|
||||
# CONFIG_SLUB_DEBUG is not set
|
||||
# CONFIG_COMPAT_BRK is not set
|
||||
CONFIG_ISA_ARCOMPACT=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_FORCE_LOAD=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
@ -98,6 +99,7 @@ CONFIG_VFAT_FS=y
|
||||
CONFIG_NTFS_FS=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V3_ACL=y
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
# CONFIG_ENABLE_WARN_DEPRECATED is not set
|
||||
|
@ -97,6 +97,7 @@ CONFIG_VFAT_FS=y
|
||||
CONFIG_NTFS_FS=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V3_ACL=y
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
# CONFIG_ENABLE_WARN_DEPRECATED is not set
|
||||
|
@ -100,6 +100,7 @@ CONFIG_VFAT_FS=y
|
||||
CONFIG_NTFS_FS=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V3_ACL=y
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
# CONFIG_ENABLE_WARN_DEPRECATED is not set
|
||||
|
@ -66,6 +66,7 @@ CONFIG_EXT3_FS=y
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V3_ACL=y
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
# CONFIG_ENABLE_WARN_DEPRECATED is not set
|
||||
|
@ -15,6 +15,7 @@ CONFIG_SYSCTL_SYSCALL=y
|
||||
CONFIG_EMBEDDED=y
|
||||
CONFIG_PERF_EVENTS=y
|
||||
# CONFIG_COMPAT_BRK is not set
|
||||
CONFIG_ISA_ARCOMPACT=y
|
||||
CONFIG_KPROBES=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_FORCE_LOAD=y
|
||||
@ -74,6 +75,7 @@ CONFIG_PROC_KCORE=y
|
||||
CONFIG_TMPFS=y
|
||||
# CONFIG_MISC_FILESYSTEMS is not set
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V3_ACL=y
|
||||
CONFIG_ROOT_NFS=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
# CONFIG_ENABLE_WARN_DEPRECATED is not set
|
||||
|
@ -16,6 +16,7 @@ CONFIG_EMBEDDED=y
|
||||
CONFIG_PERF_EVENTS=y
|
||||
# CONFIG_SLUB_DEBUG is not set
|
||||
# CONFIG_COMPAT_BRK is not set
|
||||
CONFIG_ISA_ARCOMPACT=y
|
||||
CONFIG_KPROBES=y
|
||||
CONFIG_MODULES=y
|
||||
# CONFIG_LBDAF is not set
|
||||
|
@ -16,6 +16,7 @@ CONFIG_EMBEDDED=y
|
||||
CONFIG_PERF_EVENTS=y
|
||||
# CONFIG_SLUB_DEBUG is not set
|
||||
# CONFIG_COMPAT_BRK is not set
|
||||
CONFIG_ISA_ARCOMPACT=y
|
||||
CONFIG_KPROBES=y
|
||||
CONFIG_MODULES=y
|
||||
# CONFIG_LBDAF is not set
|
||||
@ -69,5 +70,6 @@ CONFIG_EXT2_FS_XATTR=y
|
||||
CONFIG_TMPFS=y
|
||||
# CONFIG_MISC_FILESYSTEMS is not set
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V3_ACL=y
|
||||
# CONFIG_ENABLE_WARN_DEPRECATED is not set
|
||||
# CONFIG_ENABLE_MUST_CHECK is not set
|
||||
|
@ -68,5 +68,6 @@ CONFIG_EXT2_FS_XATTR=y
|
||||
CONFIG_TMPFS=y
|
||||
# CONFIG_MISC_FILESYSTEMS is not set
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V3_ACL=y
|
||||
# CONFIG_ENABLE_WARN_DEPRECATED is not set
|
||||
# CONFIG_ENABLE_MUST_CHECK is not set
|
||||
|
@ -79,6 +79,7 @@ CONFIG_EXT2_FS_XATTR=y
|
||||
CONFIG_TMPFS=y
|
||||
# CONFIG_MISC_FILESYSTEMS is not set
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V3_ACL=y
|
||||
# CONFIG_ENABLE_WARN_DEPRECATED is not set
|
||||
# CONFIG_ENABLE_MUST_CHECK is not set
|
||||
CONFIG_FTRACE=y
|
||||
|
@ -19,6 +19,7 @@ CONFIG_KALLSYMS_ALL=y
|
||||
# CONFIG_AIO is not set
|
||||
CONFIG_EMBEDDED=y
|
||||
# CONFIG_COMPAT_BRK is not set
|
||||
CONFIG_ISA_ARCOMPACT=y
|
||||
CONFIG_SLAB=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_FORCE_LOAD=y
|
||||
|
@ -88,6 +88,7 @@ CONFIG_NTFS_FS=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_JFFS2_FS=y
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V3_ACL=y
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
# CONFIG_ENABLE_WARN_DEPRECATED is not set
|
||||
|
@ -92,6 +92,7 @@ CONFIG_NTFS_FS=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_JFFS2_FS=y
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V3_ACL=y
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
# CONFIG_ENABLE_WARN_DEPRECATED is not set
|
||||
|
@ -51,7 +51,7 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
|
||||
#ifdef CONFIG_64BIT
|
||||
case 4: case 5: case 6: case 7:
|
||||
#ifdef CONFIG_MIPS32_O32
|
||||
if (test_thread_flag(TIF_32BIT_REGS))
|
||||
if (test_tsk_thread_flag(task, TIF_32BIT_REGS))
|
||||
return get_user(*arg, (int *)usp + n);
|
||||
else
|
||||
#endif
|
||||
|
@ -84,7 +84,7 @@ static struct rt2880_pmx_func pcie_rst_grp[] = {
|
||||
};
|
||||
static struct rt2880_pmx_func nd_sd_grp[] = {
|
||||
FUNC("nand", MT7620_GPIO_MODE_NAND, 45, 15),
|
||||
FUNC("sd", MT7620_GPIO_MODE_SD, 45, 15)
|
||||
FUNC("sd", MT7620_GPIO_MODE_SD, 47, 13)
|
||||
};
|
||||
|
||||
static struct rt2880_pmx_group mt7620a_pinmux_data[] = {
|
||||
|
@ -1399,20 +1399,23 @@ static u64 *avic_get_physical_id_entry(struct kvm_vcpu *vcpu,
|
||||
static int avic_init_access_page(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
struct kvm *kvm = vcpu->kvm;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
mutex_lock(&kvm->slots_lock);
|
||||
if (kvm->arch.apic_access_page_done)
|
||||
return 0;
|
||||
goto out;
|
||||
|
||||
ret = x86_set_memory_region(kvm,
|
||||
APIC_ACCESS_PAGE_PRIVATE_MEMSLOT,
|
||||
APIC_DEFAULT_PHYS_BASE,
|
||||
PAGE_SIZE);
|
||||
ret = __x86_set_memory_region(kvm,
|
||||
APIC_ACCESS_PAGE_PRIVATE_MEMSLOT,
|
||||
APIC_DEFAULT_PHYS_BASE,
|
||||
PAGE_SIZE);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto out;
|
||||
|
||||
kvm->arch.apic_access_page_done = true;
|
||||
return 0;
|
||||
out:
|
||||
mutex_unlock(&kvm->slots_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int avic_init_backing_page(struct kvm_vcpu *vcpu)
|
||||
|
@ -583,7 +583,8 @@ void ast_driver_unload(struct drm_device *dev)
|
||||
drm_mode_config_cleanup(dev);
|
||||
|
||||
ast_mm_fini(ast);
|
||||
pci_iounmap(dev->pdev, ast->ioregs);
|
||||
if (ast->ioregs != ast->regs + AST_IO_MM_OFFSET)
|
||||
pci_iounmap(dev->pdev, ast->ioregs);
|
||||
pci_iounmap(dev->pdev, ast->regs);
|
||||
kfree(ast);
|
||||
}
|
||||
|
@ -133,6 +133,7 @@ static int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv)
|
||||
|
||||
lockdep_assert_held_once(&dev->master_mutex);
|
||||
|
||||
WARN_ON(fpriv->is_master);
|
||||
old_master = fpriv->master;
|
||||
fpriv->master = drm_master_create(dev);
|
||||
if (!fpriv->master) {
|
||||
@ -161,6 +162,7 @@ out_err:
|
||||
/* drop references and restore old master on failure */
|
||||
drm_master_put(&fpriv->master);
|
||||
fpriv->master = old_master;
|
||||
fpriv->is_master = 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ void mdfldWaitForPipeEnable(struct drm_device *dev, int pipe)
|
||||
/* Wait for for the pipe enable to take effect. */
|
||||
for (count = 0; count < COUNT_MAX; count++) {
|
||||
temp = REG_READ(map->conf);
|
||||
if ((temp & PIPEACONF_PIPE_STATE) == 1)
|
||||
if (temp & PIPEACONF_PIPE_STATE)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -697,6 +697,7 @@ static const struct regmap_config meson_dw_hdmi_regmap_config = {
|
||||
.reg_read = meson_dw_hdmi_reg_read,
|
||||
.reg_write = meson_dw_hdmi_reg_write,
|
||||
.max_register = 0x10000,
|
||||
.fast_io = true,
|
||||
};
|
||||
|
||||
static bool meson_hdmi_connector_is_available(struct device *dev)
|
||||
|
@ -184,18 +184,18 @@ void meson_viu_set_osd_lut(struct meson_drm *priv, enum viu_lut_sel_e lut_sel,
|
||||
if (lut_sel == VIU_LUT_OSD_OETF) {
|
||||
writel(0, priv->io_base + _REG(addr_port));
|
||||
|
||||
for (i = 0; i < 20; i++)
|
||||
for (i = 0; i < (OSD_OETF_LUT_SIZE / 2); i++)
|
||||
writel(r_map[i * 2] | (r_map[i * 2 + 1] << 16),
|
||||
priv->io_base + _REG(data_port));
|
||||
|
||||
writel(r_map[OSD_OETF_LUT_SIZE - 1] | (g_map[0] << 16),
|
||||
priv->io_base + _REG(data_port));
|
||||
|
||||
for (i = 0; i < 20; i++)
|
||||
for (i = 0; i < (OSD_OETF_LUT_SIZE / 2); i++)
|
||||
writel(g_map[i * 2 + 1] | (g_map[i * 2 + 2] << 16),
|
||||
priv->io_base + _REG(data_port));
|
||||
|
||||
for (i = 0; i < 20; i++)
|
||||
for (i = 0; i < (OSD_OETF_LUT_SIZE / 2); i++)
|
||||
writel(b_map[i * 2] | (b_map[i * 2 + 1] << 16),
|
||||
priv->io_base + _REG(data_port));
|
||||
|
||||
@ -211,18 +211,18 @@ void meson_viu_set_osd_lut(struct meson_drm *priv, enum viu_lut_sel_e lut_sel,
|
||||
} else if (lut_sel == VIU_LUT_OSD_EOTF) {
|
||||
writel(0, priv->io_base + _REG(addr_port));
|
||||
|
||||
for (i = 0; i < 20; i++)
|
||||
for (i = 0; i < (OSD_EOTF_LUT_SIZE / 2); i++)
|
||||
writel(r_map[i * 2] | (r_map[i * 2 + 1] << 16),
|
||||
priv->io_base + _REG(data_port));
|
||||
|
||||
writel(r_map[OSD_EOTF_LUT_SIZE - 1] | (g_map[0] << 16),
|
||||
priv->io_base + _REG(data_port));
|
||||
|
||||
for (i = 0; i < 20; i++)
|
||||
for (i = 0; i < (OSD_EOTF_LUT_SIZE / 2); i++)
|
||||
writel(g_map[i * 2 + 1] | (g_map[i * 2 + 2] << 16),
|
||||
priv->io_base + _REG(data_port));
|
||||
|
||||
for (i = 0; i < 20; i++)
|
||||
for (i = 0; i < (OSD_EOTF_LUT_SIZE / 2); i++)
|
||||
writel(b_map[i * 2] | (b_map[i * 2 + 1] << 16),
|
||||
priv->io_base + _REG(data_port));
|
||||
|
||||
|
@ -223,8 +223,7 @@ static int adreno_get_legacy_pwrlevels(struct device *dev)
|
||||
struct device_node *child, *node;
|
||||
int ret;
|
||||
|
||||
node = of_find_compatible_node(dev->of_node, NULL,
|
||||
"qcom,gpu-pwrlevels");
|
||||
node = of_get_compatible_child(dev->of_node, "qcom,gpu-pwrlevels");
|
||||
if (!node) {
|
||||
dev_err(dev, "Could not find the GPU powerlevels\n");
|
||||
return -ENXIO;
|
||||
@ -245,6 +244,8 @@ static int adreno_get_legacy_pwrlevels(struct device *dev)
|
||||
dev_pm_opp_add(dev, val, 0);
|
||||
}
|
||||
|
||||
of_node_put(node);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -869,31 +869,26 @@ enum mlx5_ib_width {
|
||||
MLX5_IB_WIDTH_12X = 1 << 4
|
||||
};
|
||||
|
||||
static int translate_active_width(struct ib_device *ibdev, u8 active_width,
|
||||
static void translate_active_width(struct ib_device *ibdev, u8 active_width,
|
||||
u8 *ib_width)
|
||||
{
|
||||
struct mlx5_ib_dev *dev = to_mdev(ibdev);
|
||||
int err = 0;
|
||||
|
||||
if (active_width & MLX5_IB_WIDTH_1X) {
|
||||
if (active_width & MLX5_IB_WIDTH_1X)
|
||||
*ib_width = IB_WIDTH_1X;
|
||||
} else if (active_width & MLX5_IB_WIDTH_2X) {
|
||||
mlx5_ib_dbg(dev, "active_width %d is not supported by IB spec\n",
|
||||
(int)active_width);
|
||||
err = -EINVAL;
|
||||
} else if (active_width & MLX5_IB_WIDTH_4X) {
|
||||
else if (active_width & MLX5_IB_WIDTH_4X)
|
||||
*ib_width = IB_WIDTH_4X;
|
||||
} else if (active_width & MLX5_IB_WIDTH_8X) {
|
||||
else if (active_width & MLX5_IB_WIDTH_8X)
|
||||
*ib_width = IB_WIDTH_8X;
|
||||
} else if (active_width & MLX5_IB_WIDTH_12X) {
|
||||
else if (active_width & MLX5_IB_WIDTH_12X)
|
||||
*ib_width = IB_WIDTH_12X;
|
||||
} else {
|
||||
mlx5_ib_dbg(dev, "Invalid active_width %d\n",
|
||||
else {
|
||||
mlx5_ib_dbg(dev, "Invalid active_width %d, setting width to default value: 4x\n",
|
||||
(int)active_width);
|
||||
err = -EINVAL;
|
||||
*ib_width = IB_WIDTH_4X;
|
||||
}
|
||||
|
||||
return err;
|
||||
return;
|
||||
}
|
||||
|
||||
static int mlx5_mtu_to_ib_mtu(int mtu)
|
||||
@ -1001,10 +996,8 @@ static int mlx5_query_hca_port(struct ib_device *ibdev, u8 port,
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = translate_active_width(ibdev, ib_link_width_oper,
|
||||
&props->active_width);
|
||||
if (err)
|
||||
goto out;
|
||||
translate_active_width(ibdev, ib_link_width_oper, &props->active_width);
|
||||
|
||||
err = mlx5_query_port_ib_proto_oper(mdev, &props->active_speed, port);
|
||||
if (err)
|
||||
goto out;
|
||||
|
@ -1108,7 +1108,9 @@ u8 iser_check_task_pi_status(struct iscsi_iser_task *iser_task,
|
||||
IB_MR_CHECK_SIG_STATUS, &mr_status);
|
||||
if (ret) {
|
||||
pr_err("ib_check_mr_status failed, ret %d\n", ret);
|
||||
goto err;
|
||||
/* Not a lot we can do, return ambiguous guard error */
|
||||
*sector = 0;
|
||||
return 0x1;
|
||||
}
|
||||
|
||||
if (mr_status.fail_status & IB_MR_CHECK_SIG_STATUS) {
|
||||
@ -1136,9 +1138,6 @@ u8 iser_check_task_pi_status(struct iscsi_iser_task *iser_task,
|
||||
}
|
||||
|
||||
return 0;
|
||||
err:
|
||||
/* Not alot we can do here, return ambiguous guard error */
|
||||
return 0x1;
|
||||
}
|
||||
|
||||
void iser_err_comp(struct ib_wc *wc, const char *type)
|
||||
|
@ -483,18 +483,18 @@ static const u8 xboxone_hori_init[] = {
|
||||
};
|
||||
|
||||
/*
|
||||
* This packet is required for some of the PDP pads to start
|
||||
* This packet is required for most (all?) of the PDP pads to start
|
||||
* sending input reports. These pads include: (0x0e6f:0x02ab),
|
||||
* (0x0e6f:0x02a4).
|
||||
* (0x0e6f:0x02a4), (0x0e6f:0x02a6).
|
||||
*/
|
||||
static const u8 xboxone_pdp_init1[] = {
|
||||
0x0a, 0x20, 0x00, 0x03, 0x00, 0x01, 0x14
|
||||
};
|
||||
|
||||
/*
|
||||
* This packet is required for some of the PDP pads to start
|
||||
* This packet is required for most (all?) of the PDP pads to start
|
||||
* sending input reports. These pads include: (0x0e6f:0x02ab),
|
||||
* (0x0e6f:0x02a4).
|
||||
* (0x0e6f:0x02a4), (0x0e6f:0x02a6).
|
||||
*/
|
||||
static const u8 xboxone_pdp_init2[] = {
|
||||
0x06, 0x20, 0x00, 0x02, 0x01, 0x00
|
||||
@ -530,12 +530,8 @@ static const struct xboxone_init_packet xboxone_init_packets[] = {
|
||||
XBOXONE_INIT_PKT(0x0e6f, 0x0165, xboxone_hori_init),
|
||||
XBOXONE_INIT_PKT(0x0f0d, 0x0067, xboxone_hori_init),
|
||||
XBOXONE_INIT_PKT(0x0000, 0x0000, xboxone_fw2015_init),
|
||||
XBOXONE_INIT_PKT(0x0e6f, 0x02ab, xboxone_pdp_init1),
|
||||
XBOXONE_INIT_PKT(0x0e6f, 0x02ab, xboxone_pdp_init2),
|
||||
XBOXONE_INIT_PKT(0x0e6f, 0x02a4, xboxone_pdp_init1),
|
||||
XBOXONE_INIT_PKT(0x0e6f, 0x02a4, xboxone_pdp_init2),
|
||||
XBOXONE_INIT_PKT(0x0e6f, 0x02a6, xboxone_pdp_init1),
|
||||
XBOXONE_INIT_PKT(0x0e6f, 0x02a6, xboxone_pdp_init2),
|
||||
XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init1),
|
||||
XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init2),
|
||||
XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init),
|
||||
XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_rumblebegin_init),
|
||||
XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumblebegin_init),
|
||||
|
@ -506,7 +506,8 @@ static int cros_ec_keyb_register_bs(struct cros_ec_keyb *ckdev)
|
||||
for (i = 0; i < ARRAY_SIZE(cros_ec_keyb_bs); i++) {
|
||||
const struct cros_ec_bs_map *map = &cros_ec_keyb_bs[i];
|
||||
|
||||
if (buttons & BIT(map->bit))
|
||||
if ((map->ev_type == EV_KEY && (buttons & BIT(map->bit))) ||
|
||||
(map->ev_type == EV_SW && (switches & BIT(map->bit))))
|
||||
input_set_capability(idev, map->ev_type, map->code);
|
||||
}
|
||||
|
||||
|
@ -407,7 +407,7 @@ matrix_keypad_parse_dt(struct device *dev)
|
||||
struct matrix_keypad_platform_data *pdata;
|
||||
struct device_node *np = dev->of_node;
|
||||
unsigned int *gpios;
|
||||
int i, nrow, ncol;
|
||||
int ret, i, nrow, ncol;
|
||||
|
||||
if (!np) {
|
||||
dev_err(dev, "device lacks DT data\n");
|
||||
@ -452,12 +452,19 @@ matrix_keypad_parse_dt(struct device *dev)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
for (i = 0; i < pdata->num_row_gpios; i++)
|
||||
gpios[i] = of_get_named_gpio(np, "row-gpios", i);
|
||||
for (i = 0; i < nrow; i++) {
|
||||
ret = of_get_named_gpio(np, "row-gpios", i);
|
||||
if (ret < 0)
|
||||
return ERR_PTR(ret);
|
||||
gpios[i] = ret;
|
||||
}
|
||||
|
||||
for (i = 0; i < pdata->num_col_gpios; i++)
|
||||
gpios[pdata->num_row_gpios + i] =
|
||||
of_get_named_gpio(np, "col-gpios", i);
|
||||
for (i = 0; i < ncol; i++) {
|
||||
ret = of_get_named_gpio(np, "col-gpios", i);
|
||||
if (ret < 0)
|
||||
return ERR_PTR(ret);
|
||||
gpios[nrow + i] = ret;
|
||||
}
|
||||
|
||||
pdata->row_gpios = gpios;
|
||||
pdata->col_gpios = &gpios[pdata->num_row_gpios];
|
||||
@ -484,10 +491,8 @@ static int matrix_keypad_probe(struct platform_device *pdev)
|
||||
pdata = dev_get_platdata(&pdev->dev);
|
||||
if (!pdata) {
|
||||
pdata = matrix_keypad_parse_dt(&pdev->dev);
|
||||
if (IS_ERR(pdata)) {
|
||||
dev_err(&pdev->dev, "no platform data defined\n");
|
||||
if (IS_ERR(pdata))
|
||||
return PTR_ERR(pdata);
|
||||
}
|
||||
} else if (!pdata->keymap_data) {
|
||||
dev_err(&pdev->dev, "no keymap data defined\n");
|
||||
return -EINVAL;
|
||||
|
@ -1264,6 +1264,9 @@ static const struct acpi_device_id elan_acpi_id[] = {
|
||||
{ "ELAN0618", 0 },
|
||||
{ "ELAN061C", 0 },
|
||||
{ "ELAN061D", 0 },
|
||||
{ "ELAN061E", 0 },
|
||||
{ "ELAN0620", 0 },
|
||||
{ "ELAN0621", 0 },
|
||||
{ "ELAN0622", 0 },
|
||||
{ "ELAN1000", 0 },
|
||||
{ }
|
||||
|
@ -170,6 +170,7 @@ static const char * const smbus_pnp_ids[] = {
|
||||
"LEN0048", /* X1 Carbon 3 */
|
||||
"LEN0046", /* X250 */
|
||||
"LEN004a", /* W541 */
|
||||
"LEN005b", /* P50 */
|
||||
"LEN0071", /* T480 */
|
||||
"LEN0072", /* X1 Carbon Gen 5 (2017) - Elan/ALPS trackpoint */
|
||||
"LEN0073", /* X1 Carbon G5 (Elantech) */
|
||||
|
@ -3590,10 +3590,8 @@ static u32 qed_grc_dump_big_ram(struct qed_hwfn *p_hwfn,
|
||||
total_blocks = big_ram->num_of_blocks[dev_data->chip_id];
|
||||
ram_size = total_blocks * BIG_RAM_BLOCK_SIZE_DWORDS;
|
||||
|
||||
strncpy(type_name, big_ram->instance_name,
|
||||
strlen(big_ram->instance_name));
|
||||
strncpy(mem_name, big_ram->instance_name,
|
||||
strlen(big_ram->instance_name));
|
||||
strscpy(type_name, big_ram->instance_name, sizeof(type_name));
|
||||
strscpy(mem_name, big_ram->instance_name, sizeof(mem_name));
|
||||
|
||||
/* Dump memory header */
|
||||
offset += qed_grc_dump_mem_hdr(p_hwfn,
|
||||
|
@ -566,17 +566,18 @@ EXPORT_SYMBOL_GPL(__devm_reset_control_get);
|
||||
* device_reset - find reset controller associated with the device
|
||||
* and perform reset
|
||||
* @dev: device to be reset by the controller
|
||||
* @optional: whether it is optional to reset the device
|
||||
*
|
||||
* Convenience wrapper for reset_control_get() and reset_control_reset().
|
||||
* Convenience wrapper for __reset_control_get() and reset_control_reset().
|
||||
* This is useful for the common case of devices with single, dedicated reset
|
||||
* lines.
|
||||
*/
|
||||
int device_reset(struct device *dev)
|
||||
int __device_reset(struct device *dev, bool optional)
|
||||
{
|
||||
struct reset_control *rstc;
|
||||
int ret;
|
||||
|
||||
rstc = reset_control_get(dev, NULL);
|
||||
rstc = __reset_control_get(dev, NULL, 0, 0, optional);
|
||||
if (IS_ERR(rstc))
|
||||
return PTR_ERR(rstc);
|
||||
|
||||
@ -586,7 +587,7 @@ int device_reset(struct device *dev)
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(device_reset);
|
||||
EXPORT_SYMBOL_GPL(__device_reset);
|
||||
|
||||
/**
|
||||
* APIs to manage an array of reset controls.
|
||||
|
@ -1250,8 +1250,8 @@ fc_rspnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
|
||||
memset(rspnid, 0, sizeof(struct fcgs_rspnid_req_s));
|
||||
|
||||
rspnid->dap = s_id;
|
||||
rspnid->spn_len = (u8) strlen((char *)name);
|
||||
strncpy((char *)rspnid->spn, (char *)name, rspnid->spn_len);
|
||||
strlcpy(rspnid->spn, name, sizeof(rspnid->spn));
|
||||
rspnid->spn_len = (u8) strlen(rspnid->spn);
|
||||
|
||||
return sizeof(struct fcgs_rspnid_req_s) + sizeof(struct ct_hdr_s);
|
||||
}
|
||||
@ -1271,8 +1271,8 @@ fc_rsnn_nn_build(struct fchs_s *fchs, void *pyld, u32 s_id,
|
||||
memset(rsnn_nn, 0, sizeof(struct fcgs_rsnn_nn_req_s));
|
||||
|
||||
rsnn_nn->node_name = node_name;
|
||||
rsnn_nn->snn_len = (u8) strlen((char *)name);
|
||||
strncpy((char *)rsnn_nn->snn, (char *)name, rsnn_nn->snn_len);
|
||||
strlcpy(rsnn_nn->snn, name, sizeof(rsnn_nn->snn));
|
||||
rsnn_nn->snn_len = (u8) strlen(rsnn_nn->snn);
|
||||
|
||||
return sizeof(struct fcgs_rsnn_nn_req_s) + sizeof(struct ct_hdr_s);
|
||||
}
|
||||
|
@ -769,23 +769,23 @@ bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric)
|
||||
bfa_ioc_get_adapter_model(&fabric->fcs->bfa->ioc, model);
|
||||
|
||||
/* Model name/number */
|
||||
strncpy((char *)&port_cfg->sym_name, model,
|
||||
BFA_FCS_PORT_SYMBNAME_MODEL_SZ);
|
||||
strncat((char *)&port_cfg->sym_name, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
|
||||
sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
|
||||
strlcpy(port_cfg->sym_name.symname, model,
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
strlcat(port_cfg->sym_name.symname, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
|
||||
/* Driver Version */
|
||||
strncat((char *)&port_cfg->sym_name, (char *)driver_info->version,
|
||||
BFA_FCS_PORT_SYMBNAME_VERSION_SZ);
|
||||
strncat((char *)&port_cfg->sym_name, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
|
||||
sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
|
||||
strlcat(port_cfg->sym_name.symname, driver_info->version,
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
strlcat(port_cfg->sym_name.symname, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
|
||||
/* Host machine name */
|
||||
strncat((char *)&port_cfg->sym_name,
|
||||
(char *)driver_info->host_machine_name,
|
||||
BFA_FCS_PORT_SYMBNAME_MACHINENAME_SZ);
|
||||
strncat((char *)&port_cfg->sym_name, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
|
||||
sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
|
||||
strlcat(port_cfg->sym_name.symname,
|
||||
driver_info->host_machine_name,
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
strlcat(port_cfg->sym_name.symname, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
|
||||
/*
|
||||
* Host OS Info :
|
||||
@ -793,24 +793,24 @@ bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric)
|
||||
* OS name string and instead copy the entire OS info string (64 bytes).
|
||||
*/
|
||||
if (driver_info->host_os_patch[0] == '\0') {
|
||||
strncat((char *)&port_cfg->sym_name,
|
||||
(char *)driver_info->host_os_name,
|
||||
BFA_FCS_OS_STR_LEN);
|
||||
strncat((char *)&port_cfg->sym_name,
|
||||
strlcat(port_cfg->sym_name.symname,
|
||||
driver_info->host_os_name,
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
strlcat(port_cfg->sym_name.symname,
|
||||
BFA_FCS_PORT_SYMBNAME_SEPARATOR,
|
||||
sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
} else {
|
||||
strncat((char *)&port_cfg->sym_name,
|
||||
(char *)driver_info->host_os_name,
|
||||
BFA_FCS_PORT_SYMBNAME_OSINFO_SZ);
|
||||
strncat((char *)&port_cfg->sym_name,
|
||||
strlcat(port_cfg->sym_name.symname,
|
||||
driver_info->host_os_name,
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
strlcat(port_cfg->sym_name.symname,
|
||||
BFA_FCS_PORT_SYMBNAME_SEPARATOR,
|
||||
sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
|
||||
/* Append host OS Patch Info */
|
||||
strncat((char *)&port_cfg->sym_name,
|
||||
(char *)driver_info->host_os_patch,
|
||||
BFA_FCS_PORT_SYMBNAME_OSPATCH_SZ);
|
||||
strlcat(port_cfg->sym_name.symname,
|
||||
driver_info->host_os_patch,
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
}
|
||||
|
||||
/* null terminate */
|
||||
@ -830,26 +830,26 @@ bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric)
|
||||
bfa_ioc_get_adapter_model(&fabric->fcs->bfa->ioc, model);
|
||||
|
||||
/* Model name/number */
|
||||
strncpy((char *)&port_cfg->node_sym_name, model,
|
||||
BFA_FCS_PORT_SYMBNAME_MODEL_SZ);
|
||||
strncat((char *)&port_cfg->node_sym_name,
|
||||
strlcpy(port_cfg->node_sym_name.symname, model,
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
strlcat(port_cfg->node_sym_name.symname,
|
||||
BFA_FCS_PORT_SYMBNAME_SEPARATOR,
|
||||
sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
|
||||
/* Driver Version */
|
||||
strncat((char *)&port_cfg->node_sym_name, (char *)driver_info->version,
|
||||
BFA_FCS_PORT_SYMBNAME_VERSION_SZ);
|
||||
strncat((char *)&port_cfg->node_sym_name,
|
||||
strlcat(port_cfg->node_sym_name.symname, (char *)driver_info->version,
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
strlcat(port_cfg->node_sym_name.symname,
|
||||
BFA_FCS_PORT_SYMBNAME_SEPARATOR,
|
||||
sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
|
||||
/* Host machine name */
|
||||
strncat((char *)&port_cfg->node_sym_name,
|
||||
(char *)driver_info->host_machine_name,
|
||||
BFA_FCS_PORT_SYMBNAME_MACHINENAME_SZ);
|
||||
strncat((char *)&port_cfg->node_sym_name,
|
||||
strlcat(port_cfg->node_sym_name.symname,
|
||||
driver_info->host_machine_name,
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
strlcat(port_cfg->node_sym_name.symname,
|
||||
BFA_FCS_PORT_SYMBNAME_SEPARATOR,
|
||||
sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
|
||||
/* null terminate */
|
||||
port_cfg->node_sym_name.symname[BFA_SYMNAME_MAXLEN - 1] = 0;
|
||||
|
@ -2642,10 +2642,10 @@ bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_lport_fdmi_s *fdmi,
|
||||
bfa_ioc_get_adapter_fw_ver(&port->fcs->bfa->ioc,
|
||||
hba_attr->fw_version);
|
||||
|
||||
strncpy(hba_attr->driver_version, (char *)driver_info->version,
|
||||
strlcpy(hba_attr->driver_version, (char *)driver_info->version,
|
||||
sizeof(hba_attr->driver_version));
|
||||
|
||||
strncpy(hba_attr->os_name, driver_info->host_os_name,
|
||||
strlcpy(hba_attr->os_name, driver_info->host_os_name,
|
||||
sizeof(hba_attr->os_name));
|
||||
|
||||
/*
|
||||
@ -2653,23 +2653,23 @@ bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_lport_fdmi_s *fdmi,
|
||||
* to the os name along with a separator
|
||||
*/
|
||||
if (driver_info->host_os_patch[0] != '\0') {
|
||||
strncat(hba_attr->os_name, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
|
||||
sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
|
||||
strncat(hba_attr->os_name, driver_info->host_os_patch,
|
||||
sizeof(driver_info->host_os_patch));
|
||||
strlcat(hba_attr->os_name, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
|
||||
sizeof(hba_attr->os_name));
|
||||
strlcat(hba_attr->os_name, driver_info->host_os_patch,
|
||||
sizeof(hba_attr->os_name));
|
||||
}
|
||||
|
||||
/* Retrieve the max frame size from the port attr */
|
||||
bfa_fcs_fdmi_get_portattr(fdmi, &fcs_port_attr);
|
||||
hba_attr->max_ct_pyld = fcs_port_attr.max_frm_size;
|
||||
|
||||
strncpy(hba_attr->node_sym_name.symname,
|
||||
strlcpy(hba_attr->node_sym_name.symname,
|
||||
port->port_cfg.node_sym_name.symname, BFA_SYMNAME_MAXLEN);
|
||||
strcpy(hba_attr->vendor_info, "QLogic");
|
||||
hba_attr->num_ports =
|
||||
cpu_to_be32(bfa_ioc_get_nports(&port->fcs->bfa->ioc));
|
||||
hba_attr->fabric_name = port->fabric->lps->pr_nwwn;
|
||||
strncpy(hba_attr->bios_ver, hba_attr->option_rom_ver, BFA_VERSION_LEN);
|
||||
strlcpy(hba_attr->bios_ver, hba_attr->option_rom_ver, BFA_VERSION_LEN);
|
||||
|
||||
}
|
||||
|
||||
@ -2736,20 +2736,20 @@ bfa_fcs_fdmi_get_portattr(struct bfa_fcs_lport_fdmi_s *fdmi,
|
||||
/*
|
||||
* OS device Name
|
||||
*/
|
||||
strncpy(port_attr->os_device_name, (char *)driver_info->os_device_name,
|
||||
strlcpy(port_attr->os_device_name, driver_info->os_device_name,
|
||||
sizeof(port_attr->os_device_name));
|
||||
|
||||
/*
|
||||
* Host name
|
||||
*/
|
||||
strncpy(port_attr->host_name, (char *)driver_info->host_machine_name,
|
||||
strlcpy(port_attr->host_name, driver_info->host_machine_name,
|
||||
sizeof(port_attr->host_name));
|
||||
|
||||
port_attr->node_name = bfa_fcs_lport_get_nwwn(port);
|
||||
port_attr->port_name = bfa_fcs_lport_get_pwwn(port);
|
||||
|
||||
strncpy(port_attr->port_sym_name.symname,
|
||||
(char *)&bfa_fcs_lport_get_psym_name(port), BFA_SYMNAME_MAXLEN);
|
||||
strlcpy(port_attr->port_sym_name.symname,
|
||||
bfa_fcs_lport_get_psym_name(port).symname, BFA_SYMNAME_MAXLEN);
|
||||
bfa_fcs_lport_get_attr(port, &lport_attr);
|
||||
port_attr->port_type = cpu_to_be32(lport_attr.port_type);
|
||||
port_attr->scos = pport_attr.cos_supported;
|
||||
@ -3229,7 +3229,7 @@ bfa_fcs_lport_ms_gmal_response(void *fcsarg, struct bfa_fcxp_s *fcxp,
|
||||
rsp_str[gmal_entry->len-1] = 0;
|
||||
|
||||
/* copy IP Address to fabric */
|
||||
strncpy(bfa_fcs_lport_get_fabric_ipaddr(port),
|
||||
strlcpy(bfa_fcs_lport_get_fabric_ipaddr(port),
|
||||
gmal_entry->ip_addr,
|
||||
BFA_FCS_FABRIC_IPADDR_SZ);
|
||||
break;
|
||||
@ -4667,21 +4667,13 @@ bfa_fcs_lport_ns_send_rspn_id(void *ns_cbarg, struct bfa_fcxp_s *fcxp_alloced)
|
||||
* to that of the base port.
|
||||
*/
|
||||
|
||||
strncpy((char *)psymbl,
|
||||
(char *) &
|
||||
(bfa_fcs_lport_get_psym_name
|
||||
strlcpy(symbl,
|
||||
(char *)&(bfa_fcs_lport_get_psym_name
|
||||
(bfa_fcs_get_base_port(port->fcs))),
|
||||
strlen((char *) &
|
||||
bfa_fcs_lport_get_psym_name(bfa_fcs_get_base_port
|
||||
(port->fcs))));
|
||||
sizeof(symbl));
|
||||
|
||||
/* Ensure we have a null terminating string. */
|
||||
((char *)psymbl)[strlen((char *) &
|
||||
bfa_fcs_lport_get_psym_name(bfa_fcs_get_base_port
|
||||
(port->fcs)))] = 0;
|
||||
strncat((char *)psymbl,
|
||||
(char *) &(bfa_fcs_lport_get_psym_name(port)),
|
||||
strlen((char *) &bfa_fcs_lport_get_psym_name(port)));
|
||||
strlcat(symbl, (char *)&(bfa_fcs_lport_get_psym_name(port)),
|
||||
sizeof(symbl));
|
||||
} else {
|
||||
psymbl = (u8 *) &(bfa_fcs_lport_get_psym_name(port));
|
||||
}
|
||||
@ -5173,7 +5165,6 @@ bfa_fcs_lport_ns_util_send_rspn_id(void *cbarg, struct bfa_fcxp_s *fcxp_alloced)
|
||||
struct fchs_s fchs;
|
||||
struct bfa_fcxp_s *fcxp;
|
||||
u8 symbl[256];
|
||||
u8 *psymbl = &symbl[0];
|
||||
int len;
|
||||
|
||||
/* Avoid sending RSPN in the following states. */
|
||||
@ -5203,22 +5194,17 @@ bfa_fcs_lport_ns_util_send_rspn_id(void *cbarg, struct bfa_fcxp_s *fcxp_alloced)
|
||||
* For Vports, we append the vport's port symbolic name
|
||||
* to that of the base port.
|
||||
*/
|
||||
strncpy((char *)psymbl, (char *)&(bfa_fcs_lport_get_psym_name
|
||||
strlcpy(symbl, (char *)&(bfa_fcs_lport_get_psym_name
|
||||
(bfa_fcs_get_base_port(port->fcs))),
|
||||
strlen((char *)&bfa_fcs_lport_get_psym_name(
|
||||
bfa_fcs_get_base_port(port->fcs))));
|
||||
sizeof(symbl));
|
||||
|
||||
/* Ensure we have a null terminating string. */
|
||||
((char *)psymbl)[strlen((char *)&bfa_fcs_lport_get_psym_name(
|
||||
bfa_fcs_get_base_port(port->fcs)))] = 0;
|
||||
|
||||
strncat((char *)psymbl,
|
||||
strlcat(symbl,
|
||||
(char *)&(bfa_fcs_lport_get_psym_name(port)),
|
||||
strlen((char *)&bfa_fcs_lport_get_psym_name(port)));
|
||||
sizeof(symbl));
|
||||
}
|
||||
|
||||
len = fc_rspnid_build(&fchs, bfa_fcxp_get_reqbuf(fcxp),
|
||||
bfa_fcs_lport_get_fcid(port), 0, psymbl);
|
||||
bfa_fcs_lport_get_fcid(port), 0, symbl);
|
||||
|
||||
bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
|
||||
FC_CLASS_3, len, &fchs, NULL, NULL, FC_MAX_PDUSZ, 0);
|
||||
|
@ -2803,7 +2803,7 @@ void
|
||||
bfa_ioc_get_adapter_manufacturer(struct bfa_ioc_s *ioc, char *manufacturer)
|
||||
{
|
||||
memset((void *)manufacturer, 0, BFA_ADAPTER_MFG_NAME_LEN);
|
||||
strncpy(manufacturer, BFA_MFG_NAME, BFA_ADAPTER_MFG_NAME_LEN);
|
||||
strlcpy(manufacturer, BFA_MFG_NAME, BFA_ADAPTER_MFG_NAME_LEN);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -350,8 +350,8 @@ bfa_plog_str(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
|
||||
lp.eid = event;
|
||||
lp.log_type = BFA_PL_LOG_TYPE_STRING;
|
||||
lp.misc = misc;
|
||||
strncpy(lp.log_entry.string_log, log_str,
|
||||
BFA_PL_STRING_LOG_SZ - 1);
|
||||
strlcpy(lp.log_entry.string_log, log_str,
|
||||
BFA_PL_STRING_LOG_SZ);
|
||||
lp.log_entry.string_log[BFA_PL_STRING_LOG_SZ - 1] = '\0';
|
||||
bfa_plog_add(plog, &lp);
|
||||
}
|
||||
|
@ -983,20 +983,20 @@ bfad_start_ops(struct bfad_s *bfad) {
|
||||
|
||||
/* Fill the driver_info info to fcs*/
|
||||
memset(&driver_info, 0, sizeof(driver_info));
|
||||
strncpy(driver_info.version, BFAD_DRIVER_VERSION,
|
||||
sizeof(driver_info.version) - 1);
|
||||
strlcpy(driver_info.version, BFAD_DRIVER_VERSION,
|
||||
sizeof(driver_info.version));
|
||||
if (host_name)
|
||||
strncpy(driver_info.host_machine_name, host_name,
|
||||
sizeof(driver_info.host_machine_name) - 1);
|
||||
strlcpy(driver_info.host_machine_name, host_name,
|
||||
sizeof(driver_info.host_machine_name));
|
||||
if (os_name)
|
||||
strncpy(driver_info.host_os_name, os_name,
|
||||
sizeof(driver_info.host_os_name) - 1);
|
||||
strlcpy(driver_info.host_os_name, os_name,
|
||||
sizeof(driver_info.host_os_name));
|
||||
if (os_patch)
|
||||
strncpy(driver_info.host_os_patch, os_patch,
|
||||
sizeof(driver_info.host_os_patch) - 1);
|
||||
strlcpy(driver_info.host_os_patch, os_patch,
|
||||
sizeof(driver_info.host_os_patch));
|
||||
|
||||
strncpy(driver_info.os_device_name, bfad->pci_name,
|
||||
sizeof(driver_info.os_device_name) - 1);
|
||||
strlcpy(driver_info.os_device_name, bfad->pci_name,
|
||||
sizeof(driver_info.os_device_name));
|
||||
|
||||
/* FCS driver info init */
|
||||
spin_lock_irqsave(&bfad->bfad_lock, flags);
|
||||
|
@ -843,7 +843,7 @@ bfad_im_symbolic_name_show(struct device *dev, struct device_attribute *attr,
|
||||
char symname[BFA_SYMNAME_MAXLEN];
|
||||
|
||||
bfa_fcs_lport_get_attr(&bfad->bfa_fcs.fabric.bport, &port_attr);
|
||||
strncpy(symname, port_attr.port_cfg.sym_name.symname,
|
||||
strlcpy(symname, port_attr.port_cfg.sym_name.symname,
|
||||
BFA_SYMNAME_MAXLEN);
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", symname);
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ bfad_iocmd_ioc_get_attr(struct bfad_s *bfad, void *cmd)
|
||||
|
||||
/* fill in driver attr info */
|
||||
strcpy(iocmd->ioc_attr.driver_attr.driver, BFAD_DRIVER_NAME);
|
||||
strncpy(iocmd->ioc_attr.driver_attr.driver_ver,
|
||||
strlcpy(iocmd->ioc_attr.driver_attr.driver_ver,
|
||||
BFAD_DRIVER_VERSION, BFA_VERSION_LEN);
|
||||
strcpy(iocmd->ioc_attr.driver_attr.fw_ver,
|
||||
iocmd->ioc_attr.adapter_attr.fw_ver);
|
||||
@ -315,9 +315,9 @@ bfad_iocmd_port_get_attr(struct bfad_s *bfad, void *cmd)
|
||||
iocmd->attr.port_type = port_attr.port_type;
|
||||
iocmd->attr.loopback = port_attr.loopback;
|
||||
iocmd->attr.authfail = port_attr.authfail;
|
||||
strncpy(iocmd->attr.port_symname.symname,
|
||||
strlcpy(iocmd->attr.port_symname.symname,
|
||||
port_attr.port_cfg.sym_name.symname,
|
||||
sizeof(port_attr.port_cfg.sym_name.symname));
|
||||
sizeof(iocmd->attr.port_symname.symname));
|
||||
|
||||
iocmd->status = BFA_STATUS_OK;
|
||||
return 0;
|
||||
|
@ -34,7 +34,6 @@ struct scsi_dev_info_list_table {
|
||||
};
|
||||
|
||||
|
||||
static const char spaces[] = " "; /* 16 of them */
|
||||
static unsigned scsi_default_dev_flags;
|
||||
static LIST_HEAD(scsi_dev_info_list);
|
||||
static char scsi_dev_flags[256];
|
||||
@ -296,20 +295,13 @@ static void scsi_strcpy_devinfo(char *name, char *to, size_t to_length,
|
||||
size_t from_length;
|
||||
|
||||
from_length = strlen(from);
|
||||
strncpy(to, from, min(to_length, from_length));
|
||||
if (from_length < to_length) {
|
||||
if (compatible) {
|
||||
/*
|
||||
* NUL terminate the string if it is short.
|
||||
*/
|
||||
to[from_length] = '\0';
|
||||
} else {
|
||||
/*
|
||||
* space pad the string if it is short.
|
||||
*/
|
||||
strncpy(&to[from_length], spaces,
|
||||
to_length - from_length);
|
||||
}
|
||||
/* this zero-pads the destination */
|
||||
strncpy(to, from, to_length);
|
||||
if (from_length < to_length && !compatible) {
|
||||
/*
|
||||
* space pad the string if it is short.
|
||||
*/
|
||||
memset(&to[from_length], ' ', to_length - from_length);
|
||||
}
|
||||
if (from_length > to_length)
|
||||
printk(KERN_WARNING "%s: %s string '%s' is too long\n",
|
||||
|
@ -4125,12 +4125,6 @@ RTY_SEND_CMD:
|
||||
rtsx_trace(chip);
|
||||
return STATUS_FAIL;
|
||||
}
|
||||
|
||||
} else if (rsp_type == SD_RSP_TYPE_R0) {
|
||||
if ((ptr[3] & 0x1E) != 0x03) {
|
||||
rtsx_trace(chip);
|
||||
return STATUS_FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -461,10 +461,10 @@ static irqreturn_t hisi_thermal_alarm_irq_thread(int irq, void *dev)
|
||||
dev_crit(&data->pdev->dev, "THERMAL ALARM: %d > %d\n",
|
||||
temp, sensor->thres_temp);
|
||||
|
||||
thermal_zone_device_update(data->sensor.tzd,
|
||||
thermal_zone_device_update(data->sensors.tzd,
|
||||
THERMAL_EVENT_UNSPECIFIED);
|
||||
|
||||
} else {
|
||||
} else if (temp < sensor->thres_temp) {
|
||||
dev_crit(&data->pdev->dev, "THERMAL ALARM stopped: %d < %d\n",
|
||||
temp, sensor->thres_temp);
|
||||
}
|
||||
@ -524,6 +524,40 @@ static void hisi_thermal_toggle_sensor(struct hisi_thermal_sensor *sensor,
|
||||
on ? THERMAL_DEVICE_ENABLED : THERMAL_DEVICE_DISABLED);
|
||||
}
|
||||
|
||||
static int hisi_thermal_setup(struct hisi_thermal_data *data)
|
||||
{
|
||||
struct hisi_thermal_sensor *sensor;
|
||||
|
||||
sensor = &data->sensors;
|
||||
|
||||
/* disable module firstly */
|
||||
hisi_thermal_reset_enable(data->regs, 0);
|
||||
hisi_thermal_enable(data->regs, 0);
|
||||
|
||||
/* select sensor id */
|
||||
hisi_thermal_sensor_select(data->regs, sensor->id);
|
||||
|
||||
/* setting the hdak time */
|
||||
hisi_thermal_hdak_set(data->regs, 0);
|
||||
|
||||
/* setting lag value between current temp and the threshold */
|
||||
hisi_thermal_set_lag(data->regs, HISI_TEMP_LAG);
|
||||
|
||||
/* enable for interrupt */
|
||||
hisi_thermal_alarm_set(data->regs, sensor->thres_temp);
|
||||
|
||||
hisi_thermal_reset_set(data->regs, HISI_TEMP_RESET);
|
||||
|
||||
/* enable module */
|
||||
hisi_thermal_reset_enable(data->regs, 1);
|
||||
hisi_thermal_enable(data->regs, 1);
|
||||
|
||||
hisi_thermal_alarm_clear(data->regs, 0);
|
||||
hisi_thermal_alarm_enable(data->regs, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int hisi_thermal_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct hisi_thermal_data *data;
|
||||
|
@ -131,24 +131,6 @@ static void kgdboc_unregister_kbd(void)
|
||||
#define kgdboc_restore_input()
|
||||
#endif /* ! CONFIG_KDB_KEYBOARD */
|
||||
|
||||
static int kgdboc_option_setup(char *opt)
|
||||
{
|
||||
if (!opt) {
|
||||
pr_err("kgdboc: config string not provided\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (strlen(opt) >= MAX_CONFIG_LEN) {
|
||||
printk(KERN_ERR "kgdboc: config string too long\n");
|
||||
return -ENOSPC;
|
||||
}
|
||||
strcpy(config, opt);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__setup("kgdboc=", kgdboc_option_setup);
|
||||
|
||||
static void cleanup_kgdboc(void)
|
||||
{
|
||||
if (kgdb_unregister_nmi_console())
|
||||
@ -162,15 +144,13 @@ static int configure_kgdboc(void)
|
||||
{
|
||||
struct tty_driver *p;
|
||||
int tty_line = 0;
|
||||
int err;
|
||||
int err = -ENODEV;
|
||||
char *cptr = config;
|
||||
struct console *cons;
|
||||
|
||||
err = kgdboc_option_setup(config);
|
||||
if (err || !strlen(config) || isspace(config[0]))
|
||||
if (!strlen(config) || isspace(config[0]))
|
||||
goto noconfig;
|
||||
|
||||
err = -ENODEV;
|
||||
kgdboc_io_ops.is_console = 0;
|
||||
kgdb_tty_driver = NULL;
|
||||
|
||||
@ -319,6 +299,25 @@ static struct kgdb_io kgdboc_io_ops = {
|
||||
};
|
||||
|
||||
#ifdef CONFIG_KGDB_SERIAL_CONSOLE
|
||||
static int kgdboc_option_setup(char *opt)
|
||||
{
|
||||
if (!opt) {
|
||||
pr_err("config string not provided\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (strlen(opt) >= MAX_CONFIG_LEN) {
|
||||
pr_err("config string too long\n");
|
||||
return -ENOSPC;
|
||||
}
|
||||
strcpy(config, opt);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__setup("kgdboc=", kgdboc_option_setup);
|
||||
|
||||
|
||||
/* This is only available if kgdboc is a built in for early debugging */
|
||||
static int __init kgdboc_early_init(char *opt)
|
||||
{
|
||||
|
@ -451,9 +451,9 @@ static int btree_read_extent_buffer_pages(struct btrfs_fs_info *fs_info,
|
||||
int mirror_num = 0;
|
||||
int failed_mirror = 0;
|
||||
|
||||
clear_bit(EXTENT_BUFFER_CORRUPT, &eb->bflags);
|
||||
io_tree = &BTRFS_I(fs_info->btree_inode)->io_tree;
|
||||
while (1) {
|
||||
clear_bit(EXTENT_BUFFER_CORRUPT, &eb->bflags);
|
||||
ret = read_extent_buffer_pages(io_tree, eb, WAIT_COMPLETE,
|
||||
btree_get_extent, mirror_num);
|
||||
if (!ret) {
|
||||
@ -464,14 +464,6 @@ static int btree_read_extent_buffer_pages(struct btrfs_fs_info *fs_info,
|
||||
ret = -EIO;
|
||||
}
|
||||
|
||||
/*
|
||||
* This buffer's crc is fine, but its contents are corrupted, so
|
||||
* there is no reason to read the other copies, they won't be
|
||||
* any less wrong.
|
||||
*/
|
||||
if (test_bit(EXTENT_BUFFER_CORRUPT, &eb->bflags))
|
||||
break;
|
||||
|
||||
num_copies = btrfs_num_copies(fs_info,
|
||||
eb->start, eb->len);
|
||||
if (num_copies == 1)
|
||||
|
@ -348,13 +348,11 @@ static int check_block_group_item(struct btrfs_fs_info *fs_info,
|
||||
|
||||
/*
|
||||
* Here we don't really care about alignment since extent allocator can
|
||||
* handle it. We care more about the size, as if one block group is
|
||||
* larger than maximum size, it's must be some obvious corruption.
|
||||
* handle it. We care more about the size.
|
||||
*/
|
||||
if (key->offset > BTRFS_MAX_DATA_CHUNK_SIZE || key->offset == 0) {
|
||||
if (key->offset == 0) {
|
||||
block_group_err(fs_info, leaf, slot,
|
||||
"invalid block group size, have %llu expect (0, %llu]",
|
||||
key->offset, BTRFS_MAX_DATA_CHUNK_SIZE);
|
||||
"invalid block group size 0");
|
||||
return -EUCLEAN;
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ static int kernfs_get_target_path(struct kernfs_node *parent,
|
||||
int slen = strlen(kn->name);
|
||||
|
||||
len -= slen;
|
||||
strncpy(s + len, kn->name, slen);
|
||||
memcpy(s + len, kn->name, slen);
|
||||
if (len)
|
||||
s[--len] = '/';
|
||||
|
||||
|
@ -922,16 +922,20 @@ static int udf_load_pvoldesc(struct super_block *sb, sector_t block)
|
||||
}
|
||||
|
||||
ret = udf_dstrCS0toUTF8(outstr, 31, pvoldesc->volIdent, 32);
|
||||
if (ret < 0)
|
||||
goto out_bh;
|
||||
|
||||
strncpy(UDF_SB(sb)->s_volume_ident, outstr, ret);
|
||||
if (ret < 0) {
|
||||
strcpy(UDF_SB(sb)->s_volume_ident, "InvalidName");
|
||||
pr_warn("incorrect volume identification, setting to "
|
||||
"'InvalidName'\n");
|
||||
} else {
|
||||
strncpy(UDF_SB(sb)->s_volume_ident, outstr, ret);
|
||||
}
|
||||
udf_debug("volIdent[] = '%s'\n", UDF_SB(sb)->s_volume_ident);
|
||||
|
||||
ret = udf_dstrCS0toUTF8(outstr, 127, pvoldesc->volSetIdent, 128);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
ret = 0;
|
||||
goto out_bh;
|
||||
|
||||
}
|
||||
outstr[ret] = 0;
|
||||
udf_debug("volSetIdent[] = '%s'\n", outstr);
|
||||
|
||||
|
@ -341,6 +341,11 @@ try_again:
|
||||
return u_len;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert CS0 dstring to output charset. Warning: This function may truncate
|
||||
* input string if it is too long as it is used for informational strings only
|
||||
* and it is better to truncate the string than to refuse mounting a media.
|
||||
*/
|
||||
int udf_dstrCS0toUTF8(uint8_t *utf_o, int o_len,
|
||||
const uint8_t *ocu_i, int i_len)
|
||||
{
|
||||
@ -349,9 +354,12 @@ int udf_dstrCS0toUTF8(uint8_t *utf_o, int o_len,
|
||||
if (i_len > 0) {
|
||||
s_len = ocu_i[i_len - 1];
|
||||
if (s_len >= i_len) {
|
||||
pr_err("incorrect dstring lengths (%d/%d)\n",
|
||||
s_len, i_len);
|
||||
return -EINVAL;
|
||||
pr_warn("incorrect dstring lengths (%d/%d),"
|
||||
" truncating\n", s_len, i_len);
|
||||
s_len = i_len - 1;
|
||||
/* 2-byte encoding? Need to round properly... */
|
||||
if (ocu_i[0] == 16)
|
||||
s_len -= (s_len - 1) & 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1368,6 +1368,19 @@ static int userfaultfd_register(struct userfaultfd_ctx *ctx,
|
||||
ret = -EINVAL;
|
||||
if (!vma_can_userfault(cur))
|
||||
goto out_unlock;
|
||||
|
||||
/*
|
||||
* UFFDIO_COPY will fill file holes even without
|
||||
* PROT_WRITE. This check enforces that if this is a
|
||||
* MAP_SHARED, the process has write permission to the backing
|
||||
* file. If VM_MAYWRITE is set it also enforces that on a
|
||||
* MAP_SHARED vma: there is no F_WRITE_SEAL and no further
|
||||
* F_WRITE_SEAL can be taken until the vma is destroyed.
|
||||
*/
|
||||
ret = -EPERM;
|
||||
if (unlikely(!(cur->vm_flags & VM_MAYWRITE)))
|
||||
goto out_unlock;
|
||||
|
||||
/*
|
||||
* If this vma contains ending address, and huge pages
|
||||
* check alignment.
|
||||
@ -1413,6 +1426,7 @@ static int userfaultfd_register(struct userfaultfd_ctx *ctx,
|
||||
BUG_ON(!vma_can_userfault(vma));
|
||||
BUG_ON(vma->vm_userfaultfd_ctx.ctx &&
|
||||
vma->vm_userfaultfd_ctx.ctx != ctx);
|
||||
WARN_ON(!(vma->vm_flags & VM_MAYWRITE));
|
||||
|
||||
/*
|
||||
* Nothing to do: this vma is already registered into this
|
||||
@ -1562,6 +1576,7 @@ static int userfaultfd_unregister(struct userfaultfd_ctx *ctx,
|
||||
cond_resched();
|
||||
|
||||
BUG_ON(!vma_can_userfault(vma));
|
||||
WARN_ON(!(vma->vm_flags & VM_MAYWRITE));
|
||||
|
||||
/*
|
||||
* Nothing to do: this vma is already registered into this
|
||||
|
@ -20,22 +20,16 @@ struct reset_control *__reset_control_get(struct device *dev, const char *id,
|
||||
int index, bool shared,
|
||||
bool optional);
|
||||
void reset_control_put(struct reset_control *rstc);
|
||||
int __device_reset(struct device *dev, bool optional);
|
||||
struct reset_control *__devm_reset_control_get(struct device *dev,
|
||||
const char *id, int index, bool shared,
|
||||
bool optional);
|
||||
|
||||
int __must_check device_reset(struct device *dev);
|
||||
|
||||
struct reset_control *devm_reset_control_array_get(struct device *dev,
|
||||
bool shared, bool optional);
|
||||
struct reset_control *of_reset_control_array_get(struct device_node *np,
|
||||
bool shared, bool optional);
|
||||
|
||||
static inline int device_reset_optional(struct device *dev)
|
||||
{
|
||||
return device_reset(dev);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static inline int reset_control_reset(struct reset_control *rstc)
|
||||
@ -62,15 +56,9 @@ static inline void reset_control_put(struct reset_control *rstc)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int __must_check device_reset(struct device *dev)
|
||||
static inline int __device_reset(struct device *dev, bool optional)
|
||||
{
|
||||
WARN_ON(1);
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
static inline int device_reset_optional(struct device *dev)
|
||||
{
|
||||
return -ENOTSUPP;
|
||||
return optional ? 0 : -ENOTSUPP;
|
||||
}
|
||||
|
||||
static inline struct reset_control *__of_reset_control_get(
|
||||
@ -109,6 +97,16 @@ of_reset_control_array_get(struct device_node *np, bool shared, bool optional)
|
||||
|
||||
#endif /* CONFIG_RESET_CONTROLLER */
|
||||
|
||||
static inline int __must_check device_reset(struct device *dev)
|
||||
{
|
||||
return __device_reset(dev, false);
|
||||
}
|
||||
|
||||
static inline int device_reset_optional(struct device *dev)
|
||||
{
|
||||
return __device_reset(dev, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* reset_control_get_exclusive - Lookup and obtain an exclusive reference
|
||||
* to a reset controller.
|
||||
@ -127,9 +125,6 @@ of_reset_control_array_get(struct device_node *np, bool shared, bool optional)
|
||||
static inline struct reset_control *
|
||||
__must_check reset_control_get_exclusive(struct device *dev, const char *id)
|
||||
{
|
||||
#ifndef CONFIG_RESET_CONTROLLER
|
||||
WARN_ON(1);
|
||||
#endif
|
||||
return __reset_control_get(dev, id, 0, false, false);
|
||||
}
|
||||
|
||||
@ -275,9 +270,6 @@ static inline struct reset_control *
|
||||
__must_check devm_reset_control_get_exclusive(struct device *dev,
|
||||
const char *id)
|
||||
{
|
||||
#ifndef CONFIG_RESET_CONTROLLER
|
||||
WARN_ON(1);
|
||||
#endif
|
||||
return __devm_reset_control_get(dev, id, 0, false, false);
|
||||
}
|
||||
|
||||
|
@ -129,13 +129,13 @@ int kdbnearsym(unsigned long addr, kdb_symtab_t *symtab)
|
||||
}
|
||||
if (i >= ARRAY_SIZE(kdb_name_table)) {
|
||||
debug_kfree(kdb_name_table[0]);
|
||||
memcpy(kdb_name_table, kdb_name_table+1,
|
||||
memmove(kdb_name_table, kdb_name_table+1,
|
||||
sizeof(kdb_name_table[0]) *
|
||||
(ARRAY_SIZE(kdb_name_table)-1));
|
||||
} else {
|
||||
debug_kfree(knt1);
|
||||
knt1 = kdb_name_table[i];
|
||||
memcpy(kdb_name_table+i, kdb_name_table+i+1,
|
||||
memmove(kdb_name_table+i, kdb_name_table+i+1,
|
||||
sizeof(kdb_name_table[0]) *
|
||||
(ARRAY_SIZE(kdb_name_table)-i-1));
|
||||
}
|
||||
|
@ -616,7 +616,7 @@ static int prepare_uprobe(struct uprobe *uprobe, struct file *file,
|
||||
BUG_ON((uprobe->offset & ~PAGE_MASK) +
|
||||
UPROBE_SWBP_INSN_SIZE > PAGE_SIZE);
|
||||
|
||||
smp_wmb(); /* pairs with rmb() in find_active_uprobe() */
|
||||
smp_wmb(); /* pairs with the smp_rmb() in handle_swbp() */
|
||||
set_bit(UPROBE_COPY_INSN, &uprobe->flags);
|
||||
|
||||
out:
|
||||
@ -1910,10 +1910,18 @@ static void handle_swbp(struct pt_regs *regs)
|
||||
* After we hit the bp, _unregister + _register can install the
|
||||
* new and not-yet-analyzed uprobe at the same address, restart.
|
||||
*/
|
||||
smp_rmb(); /* pairs with wmb() in install_breakpoint() */
|
||||
if (unlikely(!test_bit(UPROBE_COPY_INSN, &uprobe->flags)))
|
||||
goto out;
|
||||
|
||||
/*
|
||||
* Pairs with the smp_wmb() in prepare_uprobe().
|
||||
*
|
||||
* Guarantees that if we see the UPROBE_COPY_INSN bit set, then
|
||||
* we must also see the stores to &uprobe->arch performed by the
|
||||
* prepare_uprobe() call.
|
||||
*/
|
||||
smp_rmb();
|
||||
|
||||
/* Tracing handlers use ->utask to communicate with fetch methods */
|
||||
if (!get_utask())
|
||||
goto out;
|
||||
|
@ -127,7 +127,7 @@ static void fill_kobj_path(struct kobject *kobj, char *path, int length)
|
||||
int cur = strlen(kobject_name(parent));
|
||||
/* back up enough to print this name with '/' */
|
||||
length -= cur;
|
||||
strncpy(path + length, kobject_name(parent), cur);
|
||||
memcpy(path + length, kobject_name(parent), cur);
|
||||
*(path + --length) = '/';
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ static void __init test_hexdump_prepare_test(size_t len, int rowsize,
|
||||
const char *q = *result++;
|
||||
size_t amount = strlen(q);
|
||||
|
||||
strncpy(p, q, amount);
|
||||
memcpy(p, q, amount);
|
||||
p += amount;
|
||||
|
||||
*p++ = ' ';
|
||||
|
@ -4039,7 +4039,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,
|
||||
|
||||
/* fallback to copy_from_user outside mmap_sem */
|
||||
if (unlikely(ret)) {
|
||||
ret = -EFAULT;
|
||||
ret = -ENOENT;
|
||||
*pagep = page;
|
||||
/* don't free the page */
|
||||
goto out;
|
||||
|
31
mm/shmem.c
31
mm/shmem.c
@ -2247,6 +2247,7 @@ static int shmem_mfill_atomic_pte(struct mm_struct *dst_mm,
|
||||
struct page *page;
|
||||
pte_t _dst_pte, *dst_pte;
|
||||
int ret;
|
||||
pgoff_t offset, max_off;
|
||||
|
||||
ret = -ENOMEM;
|
||||
if (!shmem_inode_acct_block(inode, 1))
|
||||
@ -2269,7 +2270,7 @@ static int shmem_mfill_atomic_pte(struct mm_struct *dst_mm,
|
||||
*pagep = page;
|
||||
shmem_inode_unacct_blocks(inode, 1);
|
||||
/* don't free the page */
|
||||
return -EFAULT;
|
||||
return -ENOENT;
|
||||
}
|
||||
} else { /* mfill_zeropage_atomic */
|
||||
clear_highpage(page);
|
||||
@ -2284,6 +2285,12 @@ static int shmem_mfill_atomic_pte(struct mm_struct *dst_mm,
|
||||
__SetPageSwapBacked(page);
|
||||
__SetPageUptodate(page);
|
||||
|
||||
ret = -EFAULT;
|
||||
offset = linear_page_index(dst_vma, dst_addr);
|
||||
max_off = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE);
|
||||
if (unlikely(offset >= max_off))
|
||||
goto out_release;
|
||||
|
||||
ret = mem_cgroup_try_charge(page, dst_mm, gfp, &memcg, false);
|
||||
if (ret)
|
||||
goto out_release;
|
||||
@ -2301,9 +2308,25 @@ static int shmem_mfill_atomic_pte(struct mm_struct *dst_mm,
|
||||
_dst_pte = mk_pte(page, dst_vma->vm_page_prot);
|
||||
if (dst_vma->vm_flags & VM_WRITE)
|
||||
_dst_pte = pte_mkwrite(pte_mkdirty(_dst_pte));
|
||||
else {
|
||||
/*
|
||||
* We don't set the pte dirty if the vma has no
|
||||
* VM_WRITE permission, so mark the page dirty or it
|
||||
* could be freed from under us. We could do it
|
||||
* unconditionally before unlock_page(), but doing it
|
||||
* only if VM_WRITE is not set is faster.
|
||||
*/
|
||||
set_page_dirty(page);
|
||||
}
|
||||
|
||||
dst_pte = pte_offset_map_lock(dst_mm, dst_pmd, dst_addr, &ptl);
|
||||
|
||||
ret = -EFAULT;
|
||||
max_off = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE);
|
||||
if (unlikely(offset >= max_off))
|
||||
goto out_release_uncharge_unlock;
|
||||
|
||||
ret = -EEXIST;
|
||||
dst_pte = pte_offset_map_lock(dst_mm, dst_pmd, dst_addr, &ptl);
|
||||
if (!pte_none(*dst_pte))
|
||||
goto out_release_uncharge_unlock;
|
||||
|
||||
@ -2321,13 +2344,15 @@ static int shmem_mfill_atomic_pte(struct mm_struct *dst_mm,
|
||||
|
||||
/* No need to invalidate - it was non-present before */
|
||||
update_mmu_cache(dst_vma, dst_addr, dst_pte);
|
||||
unlock_page(page);
|
||||
pte_unmap_unlock(dst_pte, ptl);
|
||||
unlock_page(page);
|
||||
ret = 0;
|
||||
out:
|
||||
return ret;
|
||||
out_release_uncharge_unlock:
|
||||
pte_unmap_unlock(dst_pte, ptl);
|
||||
ClearPageDirty(page);
|
||||
delete_from_page_cache(page);
|
||||
out_release_uncharge:
|
||||
mem_cgroup_cancel_charge(page, memcg, false);
|
||||
out_release:
|
||||
|
@ -471,9 +471,13 @@ void truncate_inode_pages_final(struct address_space *mapping)
|
||||
*/
|
||||
spin_lock_irq(&mapping->tree_lock);
|
||||
spin_unlock_irq(&mapping->tree_lock);
|
||||
|
||||
truncate_inode_pages(mapping, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Cleancache needs notification even if there are no pages or shadow
|
||||
* entries.
|
||||
*/
|
||||
truncate_inode_pages(mapping, 0);
|
||||
}
|
||||
EXPORT_SYMBOL(truncate_inode_pages_final);
|
||||
|
||||
|
@ -34,6 +34,8 @@ static int mcopy_atomic_pte(struct mm_struct *dst_mm,
|
||||
void *page_kaddr;
|
||||
int ret;
|
||||
struct page *page;
|
||||
pgoff_t offset, max_off;
|
||||
struct inode *inode;
|
||||
|
||||
if (!*pagep) {
|
||||
ret = -ENOMEM;
|
||||
@ -49,7 +51,7 @@ static int mcopy_atomic_pte(struct mm_struct *dst_mm,
|
||||
|
||||
/* fallback to copy_from_user outside mmap_sem */
|
||||
if (unlikely(ret)) {
|
||||
ret = -EFAULT;
|
||||
ret = -ENOENT;
|
||||
*pagep = page;
|
||||
/* don't free the page */
|
||||
goto out;
|
||||
@ -74,8 +76,17 @@ static int mcopy_atomic_pte(struct mm_struct *dst_mm,
|
||||
if (dst_vma->vm_flags & VM_WRITE)
|
||||
_dst_pte = pte_mkwrite(pte_mkdirty(_dst_pte));
|
||||
|
||||
ret = -EEXIST;
|
||||
dst_pte = pte_offset_map_lock(dst_mm, dst_pmd, dst_addr, &ptl);
|
||||
if (dst_vma->vm_file) {
|
||||
/* the shmem MAP_PRIVATE case requires checking the i_size */
|
||||
inode = dst_vma->vm_file->f_inode;
|
||||
offset = linear_page_index(dst_vma, dst_addr);
|
||||
max_off = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE);
|
||||
ret = -EFAULT;
|
||||
if (unlikely(offset >= max_off))
|
||||
goto out_release_uncharge_unlock;
|
||||
}
|
||||
ret = -EEXIST;
|
||||
if (!pte_none(*dst_pte))
|
||||
goto out_release_uncharge_unlock;
|
||||
|
||||
@ -109,11 +120,22 @@ static int mfill_zeropage_pte(struct mm_struct *dst_mm,
|
||||
pte_t _dst_pte, *dst_pte;
|
||||
spinlock_t *ptl;
|
||||
int ret;
|
||||
pgoff_t offset, max_off;
|
||||
struct inode *inode;
|
||||
|
||||
_dst_pte = pte_mkspecial(pfn_pte(my_zero_pfn(dst_addr),
|
||||
dst_vma->vm_page_prot));
|
||||
ret = -EEXIST;
|
||||
dst_pte = pte_offset_map_lock(dst_mm, dst_pmd, dst_addr, &ptl);
|
||||
if (dst_vma->vm_file) {
|
||||
/* the shmem MAP_PRIVATE case requires checking the i_size */
|
||||
inode = dst_vma->vm_file->f_inode;
|
||||
offset = linear_page_index(dst_vma, dst_addr);
|
||||
max_off = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE);
|
||||
ret = -EFAULT;
|
||||
if (unlikely(offset >= max_off))
|
||||
goto out_unlock;
|
||||
}
|
||||
ret = -EEXIST;
|
||||
if (!pte_none(*dst_pte))
|
||||
goto out_unlock;
|
||||
set_pte_at(dst_mm, dst_addr, dst_pte, _dst_pte);
|
||||
@ -206,8 +228,9 @@ retry:
|
||||
if (!dst_vma || !is_vm_hugetlb_page(dst_vma))
|
||||
goto out_unlock;
|
||||
/*
|
||||
* Only allow __mcopy_atomic_hugetlb on userfaultfd
|
||||
* registered ranges.
|
||||
* Check the vma is registered in uffd, this is
|
||||
* required to enforce the VM_MAYWRITE check done at
|
||||
* uffd registration time.
|
||||
*/
|
||||
if (!dst_vma->vm_userfaultfd_ctx.ctx)
|
||||
goto out_unlock;
|
||||
@ -275,7 +298,7 @@ retry:
|
||||
|
||||
cond_resched();
|
||||
|
||||
if (unlikely(err == -EFAULT)) {
|
||||
if (unlikely(err == -ENOENT)) {
|
||||
up_read(&dst_mm->mmap_sem);
|
||||
BUG_ON(!page);
|
||||
|
||||
@ -381,7 +404,17 @@ static __always_inline ssize_t mfill_atomic_pte(struct mm_struct *dst_mm,
|
||||
{
|
||||
ssize_t err;
|
||||
|
||||
if (vma_is_anonymous(dst_vma)) {
|
||||
/*
|
||||
* The normal page fault path for a shmem will invoke the
|
||||
* fault, fill the hole in the file and COW it right away. The
|
||||
* result generates plain anonymous memory. So when we are
|
||||
* asked to fill an hole in a MAP_PRIVATE shmem mapping, we'll
|
||||
* generate anonymous memory directly without actually filling
|
||||
* the hole. For the MAP_PRIVATE case the robustness check
|
||||
* only happens in the pagetable (to verify it's still none)
|
||||
* and not in the radix tree.
|
||||
*/
|
||||
if (!(dst_vma->vm_flags & VM_SHARED)) {
|
||||
if (!zeropage)
|
||||
err = mcopy_atomic_pte(dst_mm, dst_pmd, dst_vma,
|
||||
dst_addr, src_addr, page);
|
||||
@ -440,13 +473,9 @@ retry:
|
||||
if (!dst_vma)
|
||||
goto out_unlock;
|
||||
/*
|
||||
* Be strict and only allow __mcopy_atomic on userfaultfd
|
||||
* registered ranges to prevent userland errors going
|
||||
* unnoticed. As far as the VM consistency is concerned, it
|
||||
* would be perfectly safe to remove this check, but there's
|
||||
* no useful usage for __mcopy_atomic ouside of userfaultfd
|
||||
* registered ranges. This is after all why these are ioctls
|
||||
* belonging to the userfaultfd and not syscalls.
|
||||
* Check the vma is registered in uffd, this is required to
|
||||
* enforce the VM_MAYWRITE check done at uffd registration
|
||||
* time.
|
||||
*/
|
||||
if (!dst_vma->vm_userfaultfd_ctx.ctx)
|
||||
goto out_unlock;
|
||||
@ -480,7 +509,8 @@ retry:
|
||||
* dst_vma.
|
||||
*/
|
||||
err = -ENOMEM;
|
||||
if (vma_is_anonymous(dst_vma) && unlikely(anon_vma_prepare(dst_vma)))
|
||||
if (!(dst_vma->vm_flags & VM_SHARED) &&
|
||||
unlikely(anon_vma_prepare(dst_vma)))
|
||||
goto out_unlock;
|
||||
|
||||
while (src_addr < src_start + len) {
|
||||
@ -521,7 +551,7 @@ retry:
|
||||
src_addr, &page, zeropage);
|
||||
cond_resched();
|
||||
|
||||
if (unlikely(err == -EFAULT)) {
|
||||
if (unlikely(err == -ENOENT)) {
|
||||
void *page_kaddr;
|
||||
|
||||
up_read(&dst_mm->mmap_sem);
|
||||
|
@ -1504,6 +1504,10 @@ static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat,
|
||||
if (is_zone_first_populated(pgdat, zone)) {
|
||||
seq_printf(m, "\n per-node stats");
|
||||
for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++) {
|
||||
/* Skip hidden vmstat items. */
|
||||
if (*vmstat_text[i + NR_VM_ZONE_STAT_ITEMS +
|
||||
NR_VM_NUMA_STAT_ITEMS] == '\0')
|
||||
continue;
|
||||
seq_printf(m, "\n %-12s %lu",
|
||||
vmstat_text[i + NR_VM_ZONE_STAT_ITEMS +
|
||||
NR_VM_NUMA_STAT_ITEMS],
|
||||
|
@ -261,8 +261,8 @@ static struct net_device *__ip_tunnel_create(struct net *net,
|
||||
} else {
|
||||
if (strlen(ops->kind) > (IFNAMSIZ - 3))
|
||||
goto failed;
|
||||
strlcpy(name, ops->kind, IFNAMSIZ);
|
||||
strncat(name, "%d", 2);
|
||||
strcpy(name, ops->kind);
|
||||
strcat(name, "%d");
|
||||
}
|
||||
|
||||
ASSERT_RTNL();
|
||||
|
@ -375,7 +375,7 @@ int tipc_topsrv_start(struct net *net)
|
||||
topsrv->tipc_conn_new = tipc_subscrb_connect_cb;
|
||||
topsrv->tipc_conn_release = tipc_subscrb_release_cb;
|
||||
|
||||
strncpy(topsrv->name, name, strlen(name) + 1);
|
||||
strscpy(topsrv->name, name, sizeof(topsrv->name));
|
||||
tn->topsrv = topsrv;
|
||||
atomic_set(&tn->subscription_count, 0);
|
||||
|
||||
|
@ -11,6 +11,8 @@
|
||||
# are not supported by all versions of the compiler
|
||||
# ==========================================================================
|
||||
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned)
|
||||
|
||||
ifeq ("$(origin W)", "command line")
|
||||
export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W)
|
||||
endif
|
||||
@ -26,6 +28,7 @@ warning-1 += -Wold-style-definition
|
||||
warning-1 += $(call cc-option, -Wmissing-include-dirs)
|
||||
warning-1 += $(call cc-option, -Wunused-but-set-variable)
|
||||
warning-1 += $(call cc-option, -Wunused-const-variable)
|
||||
warning-1 += $(call cc-option, -Wpacked-not-aligned)
|
||||
warning-1 += $(call cc-disable-warning, missing-field-initializers)
|
||||
warning-1 += $(call cc-disable-warning, sign-compare)
|
||||
|
||||
|
@ -395,7 +395,7 @@ usage(void)
|
||||
* When we have processed a group that starts off with a known-false
|
||||
* #if/#elif sequence (which has therefore been deleted) followed by a
|
||||
* #elif that we don't understand and therefore must keep, we edit the
|
||||
* latter into a #if to keep the nesting correct. We use strncpy() to
|
||||
* latter into a #if to keep the nesting correct. We use memcpy() to
|
||||
* overwrite the 4 byte token "elif" with "if " without a '\0' byte.
|
||||
*
|
||||
* When we find a true #elif in a group, the following block will
|
||||
@ -450,7 +450,7 @@ static void Idrop (void) { Fdrop(); ignoreon(); }
|
||||
static void Itrue (void) { Ftrue(); ignoreon(); }
|
||||
static void Ifalse(void) { Ffalse(); ignoreon(); }
|
||||
/* modify this line */
|
||||
static void Mpass (void) { strncpy(keyword, "if ", 4); Pelif(); }
|
||||
static void Mpass (void) { memcpy(keyword, "if ", 4); Pelif(); }
|
||||
static void Mtrue (void) { keywordedit("else"); state(IS_TRUE_MIDDLE); }
|
||||
static void Melif (void) { keywordedit("endif"); state(IS_FALSE_TRAILER); }
|
||||
static void Melse (void) { keywordedit("endif"); state(IS_FALSE_ELSE); }
|
||||
|
@ -123,7 +123,7 @@ static int snd_trident_probe(struct pci_dev *pci,
|
||||
} else {
|
||||
strcpy(card->shortname, "Trident ");
|
||||
}
|
||||
strcat(card->shortname, card->driver);
|
||||
strcat(card->shortname, str);
|
||||
sprintf(card->longname, "%s PCI Audio at 0x%lx, irq %d",
|
||||
card->shortname, trident->port, trident->irq);
|
||||
|
||||
|
@ -1839,7 +1839,7 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
|
||||
/* setup private data which can be retrieved when required */
|
||||
pcm->private_data = ctx;
|
||||
pcm->info_flags = 0;
|
||||
strncpy(pcm->name, card->shortname, strlen(card->shortname));
|
||||
strlcpy(pcm->name, card->shortname, strlen(card->shortname));
|
||||
/* setup the ops for playabck */
|
||||
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &had_pcm_ops);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user