summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Bestas <mkbestas@lineageos.org>2020-12-09 20:52:59 +0200
committerMichael Bestas <mkbestas@lineageos.org>2020-12-09 20:52:59 +0200
commit7b1ec6c9c1ad407744d6480da1ef9d650679e831 (patch)
treed31f3414e510917cdde91dacc9c4dea5e4d32325
parent6107aa6dc24cc8c196bb18e5b5ec81f8f1a275a8 (diff)
parent0d6f3a76cfb07190719a68f7e73890f530427b91 (diff)
Merge tag 'LA.UM.8.4.r1-06200-8x98.0' of https://source.codeaurora.org/quic/la/kernel/msm-4.4 into lineage-17.1-caf-msm8998
* tag 'LA.UM.8.4.r1-06200-8x98.0' of https://source.codeaurora.org/quic/la/kernel/msm-4.4: crypto: Fix possible stack out of bound error ASoC: sdm660_cdc: Fix ear_pa_gain control soc: qcom: service-locator: Free PD list after client use cfg80211: Enhance the AKM advertizement to support per interface msm: kgsl: Don't wait for room in context queue when context is invalidated msm: kgsl: Don't allow re-importing memory owned by KGSL usb: dwc3: ep0: Return from handle_status if ep0_delegate_req succeeds scsi: ufs: Flush exception event before suspend msm: ipa: Fix deleting the routing entries mm-camera2:isp2: Add support for 12bit-plain16 raw format Revert "ipv6: defrag: drop non-last frags smaller than min mtu" usb: dwc3: ep0: Return from handle_status if ep0_delegate_req succeeds Change-Id: Ifcb5f033b250feaa41c4916bbbec757334e3429e
-rw-r--r--drivers/crypto/msm/qce50.c7
-rw-r--r--drivers/gpu/msm/adreno_dispatch.c23
-rw-r--r--drivers/gpu/msm/kgsl.c57
-rw-r--r--drivers/media/platform/msm/camera_v2/isp/msm_isp40.c10
-rw-r--r--drivers/media/platform/msm/camera_v2/isp/msm_isp47.c8
-rw-r--r--drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c8
-rw-r--r--drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c14
-rw-r--r--drivers/platform/msm/ipa/ipa_v3/ipa_rt.c48
-rw-r--r--drivers/scsi/ufs/ufshcd.c3
-rw-r--r--drivers/soc/qcom/service-locator.c14
-rw-r--r--include/net/cfg80211.h27
-rw-r--r--include/uapi/linux/nl80211.h34
-rw-r--r--include/uapi/media/msmb_isp.h4
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c4
-rw-r--r--net/ipv6/reassembly.c4
-rw-r--r--net/wireless/nl80211.c47
-rw-r--r--sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c9
17 files changed, 224 insertions, 97 deletions
diff --git a/drivers/crypto/msm/qce50.c b/drivers/crypto/msm/qce50.c
index 598b1aa0f4d7..7740a8c59126 100644
--- a/drivers/crypto/msm/qce50.c
+++ b/drivers/crypto/msm/qce50.c
@@ -1,6 +1,6 @@
/* Qualcomm Crypto Engine driver.
*
- * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2018, 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
@@ -846,6 +846,11 @@ static int _ce_setup_cipher(struct qce_device *pce_dev, struct qce_req *creq,
switch (creq->alg) {
case CIPHER_ALG_DES:
if (creq->mode != QCE_MODE_ECB) {
+ if (ivsize > MAX_IV_LENGTH) {
+ pr_err("%s: error: Invalid length parameter\n",
+ __func__);
+ return -EINVAL;
+ }
_byte_stream_to_net_words(enciv32, creq->iv, ivsize);
pce = cmdlistinfo->encr_cntr_iv;
pce->data = enciv32[0];
diff --git a/drivers/gpu/msm/adreno_dispatch.c b/drivers/gpu/msm/adreno_dispatch.c
index 9fee611e83d7..1a6d53b777d7 100644
--- a/drivers/gpu/msm/adreno_dispatch.c
+++ b/drivers/gpu/msm/adreno_dispatch.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-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
@@ -1210,7 +1210,16 @@ static inline int _wait_for_room_in_context_queue(
spin_lock(&drawctxt->lock);
trace_adreno_drawctxt_wake(drawctxt);
- if (ret <= 0)
+ /*
+ * Account for the possibility that the context got invalidated
+ * while we were sleeping
+ */
+
+ if (ret > 0) {
+ ret = _check_context_state(&drawctxt->base);
+ if (ret)
+ return ret;
+ } else
return (ret == 0) ? -ETIMEDOUT : (int) ret;
}
@@ -1225,15 +1234,7 @@ static unsigned int _check_context_state_to_queue_cmds(
if (ret)
return ret;
- ret = _wait_for_room_in_context_queue(drawctxt);
- if (ret)
- return ret;
-
- /*
- * Account for the possiblity that the context got invalidated
- * while we were sleeping
- */
- return _check_context_state(&drawctxt->base);
+ return _wait_for_room_in_context_queue(drawctxt);
}
static void _queue_drawobj(struct adreno_context *drawctxt,
diff --git a/drivers/gpu/msm/kgsl.c b/drivers/gpu/msm/kgsl.c
index c5845a13b8a1..de5405615891 100644
--- a/drivers/gpu/msm/kgsl.c
+++ b/drivers/gpu/msm/kgsl.c
@@ -2091,13 +2091,6 @@ long kgsl_ioctl_cmdstream_freememontimestamp_ctxtid(
return ret;
}
-static inline int _check_region(unsigned long start, unsigned long size,
- uint64_t len)
-{
- uint64_t end = ((uint64_t) start) + size;
- return (end > len);
-}
-
static int check_vma_flags(struct vm_area_struct *vma,
unsigned int flags)
{
@@ -2112,23 +2105,27 @@ static int check_vma_flags(struct vm_area_struct *vma,
return -EFAULT;
}
-static int check_vma(struct vm_area_struct *vma, struct file *vmfile,
- struct kgsl_memdesc *memdesc)
+static int check_vma(unsigned long hostptr, u64 size)
{
- if (vma == NULL || vma->vm_file != vmfile)
- return -EINVAL;
+ struct vm_area_struct *vma;
+ unsigned long cur = hostptr;
- /* userspace may not know the size, in which case use the whole vma */
- if (memdesc->size == 0)
- memdesc->size = vma->vm_end - vma->vm_start;
- /* range checking */
- if (vma->vm_start != memdesc->useraddr ||
- (memdesc->useraddr + memdesc->size) != vma->vm_end)
- return -EINVAL;
- return check_vma_flags(vma, memdesc->flags);
+ while (cur < (hostptr + size)) {
+ vma = find_vma(current->mm, cur);
+ if (!vma)
+ return false;
+
+ /* Don't remap memory that we already own */
+ if (vma->vm_file && vma->vm_file->f_op == &kgsl_fops)
+ return false;
+
+ cur = vma->vm_end;
+ }
+
+ return true;
}
-static int memdesc_sg_virt(struct kgsl_memdesc *memdesc, struct file *vmfile)
+static int memdesc_sg_virt(struct kgsl_memdesc *memdesc)
{
int ret = 0;
long npages = 0, i;
@@ -2150,19 +2147,17 @@ static int memdesc_sg_virt(struct kgsl_memdesc *memdesc, struct file *vmfile)
}
down_read(&current->mm->mmap_sem);
- /* If we have vmfile, make sure we map the correct vma and map it all */
- if (vmfile != NULL)
- ret = check_vma(find_vma(current->mm, memdesc->useraddr),
- vmfile, memdesc);
-
- if (ret == 0) {
- npages = get_user_pages(current, current->mm, memdesc->useraddr,
- sglen, write ? FOLL_WRITE : 0,
- pages, NULL);
- ret = (npages < 0) ? (int)npages : 0;
+ if (!check_vma(memdesc->useraddr, memdesc->size)) {
+ up_read(&current->mm->mmap_sem);
+ ret = ~EFAULT;
+ goto out;
}
+
+ npages = get_user_pages(current, current->mm, memdesc->useraddr,
+ sglen, write ? FOLL_WRITE : 0, pages, NULL);
up_read(&current->mm->mmap_sem);
+ ret = (npages < 0) ? (int)npages : 0;
if (ret)
goto out;
@@ -2213,7 +2208,7 @@ static int kgsl_setup_anon_useraddr(struct kgsl_pagetable *pagetable,
entry->memdesc.gpuaddr = (uint64_t) entry->memdesc.useraddr;
}
- return memdesc_sg_virt(&entry->memdesc, NULL);
+ return memdesc_sg_virt(&entry->memdesc);
}
static int match_file(const void *p, struct file *file, unsigned int fd)
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp40.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp40.c
index b19ec3141eec..72c0ba57fb50 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp40.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp40.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2018, 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
@@ -150,7 +150,7 @@ static int32_t msm_vfe40_init_qos_parms(struct vfe_device *vfe_dev,
void __iomem *vfebase = vfe_dev->vfe_base;
struct device_node *of_node;
uint32_t *ds_settings = NULL, *ds_regs = NULL, ds_entries = 0;
- int32_t i = 0 , rc = 0;
+ int32_t i = 0, rc = 0;
uint32_t *qos_settings = NULL, *qos_regs = NULL, qos_entries = 0;
of_node = vfe_dev->pdev->dev.of_node;
@@ -256,7 +256,7 @@ static int32_t msm_vfe40_init_vbif_parms(struct vfe_device *vfe_dev,
{
void __iomem *vfe_vbif_base = vfe_dev->vfe_vbif_base;
struct device_node *of_node;
- int32_t i = 0 , rc = 0;
+ int32_t i = 0, rc = 0;
uint32_t *vbif_settings = NULL, *vbif_regs = NULL, vbif_entries = 0;
of_node = vfe_dev->pdev->dev.of_node;
@@ -1244,6 +1244,10 @@ static void msm_vfe40_cfg_fetch_engine(struct vfe_device *vfe_dev,
case V4L2_PIX_FMT_P16GBRG10:
case V4L2_PIX_FMT_P16GRBG10:
case V4L2_PIX_FMT_P16RGGB10:
+ case V4L2_PIX_FMT_P16BGGR12:
+ case V4L2_PIX_FMT_P16GBRG12:
+ case V4L2_PIX_FMT_P16GRBG12:
+ case V4L2_PIX_FMT_P16RGGB12:
main_unpack_pattern = 0xB210;
break;
default:
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c
index cf9e7547d4e2..c74ea09b01ea 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-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
@@ -192,7 +192,7 @@ static int32_t msm_vfe47_init_dt_parms(struct vfe_device *vfe_dev,
struct msm_vfe_hw_init_parms *dt_parms, void __iomem *dev_mem_base)
{
struct device_node *of_node;
- int32_t i = 0 , rc = 0;
+ int32_t i = 0, rc = 0;
uint32_t *dt_settings = NULL, *dt_regs = NULL, num_dt_entries = 0;
of_node = vfe_dev->pdev->dev.of_node;
@@ -1257,6 +1257,10 @@ void msm_vfe47_cfg_fetch_engine(struct vfe_device *vfe_dev,
case V4L2_PIX_FMT_P16GBRG10:
case V4L2_PIX_FMT_P16GRBG10:
case V4L2_PIX_FMT_P16RGGB10:
+ case V4L2_PIX_FMT_P16BGGR12:
+ case V4L2_PIX_FMT_P16GBRG12:
+ case V4L2_PIX_FMT_P16GRBG12:
+ case V4L2_PIX_FMT_P16RGGB12:
main_unpack_pattern = 0xB210;
break;
default:
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c
index 9d83bf2a4ad4..f398ce00dab4 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c
@@ -243,6 +243,10 @@ static int msm_isp_validate_axi_request(struct vfe_device *vfe_dev,
case V4L2_PIX_FMT_P16GBRG10:
case V4L2_PIX_FMT_P16GRBG10:
case V4L2_PIX_FMT_P16RGGB10:
+ case V4L2_PIX_FMT_P16BGGR12:
+ case V4L2_PIX_FMT_P16GBRG12:
+ case V4L2_PIX_FMT_P16GRBG12:
+ case V4L2_PIX_FMT_P16RGGB12:
case V4L2_PIX_FMT_JPEG:
case V4L2_PIX_FMT_META:
case V4L2_PIX_FMT_META10:
@@ -386,6 +390,10 @@ static uint32_t msm_isp_axi_get_plane_size(
case V4L2_PIX_FMT_P16GBRG10:
case V4L2_PIX_FMT_P16GRBG10:
case V4L2_PIX_FMT_P16RGGB10:
+ case V4L2_PIX_FMT_P16BGGR12:
+ case V4L2_PIX_FMT_P16GBRG12:
+ case V4L2_PIX_FMT_P16GRBG12:
+ case V4L2_PIX_FMT_P16RGGB12:
size = plane_cfg[plane_idx].output_height *
plane_cfg[plane_idx].output_width;
break;
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
index 54ca0dd57819..3e9544fc94a7 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-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
@@ -1619,6 +1619,10 @@ int msm_isp_cal_word_per_line(uint32_t output_format,
case V4L2_PIX_FMT_P16GBRG10:
case V4L2_PIX_FMT_P16GRBG10:
case V4L2_PIX_FMT_P16RGGB10:
+ case V4L2_PIX_FMT_P16BGGR12:
+ case V4L2_PIX_FMT_P16GBRG12:
+ case V4L2_PIX_FMT_P16GRBG12:
+ case V4L2_PIX_FMT_P16RGGB12:
val = CAL_WORD(pixel_per_line, 1, 4);
break;
case V4L2_PIX_FMT_NV24:
@@ -1682,6 +1686,10 @@ enum msm_isp_pack_fmt msm_isp_get_pack_format(uint32_t output_format)
case V4L2_PIX_FMT_P16GBRG10:
case V4L2_PIX_FMT_P16GRBG10:
case V4L2_PIX_FMT_P16RGGB10:
+ case V4L2_PIX_FMT_P16BGGR12:
+ case V4L2_PIX_FMT_P16GBRG12:
+ case V4L2_PIX_FMT_P16GRBG12:
+ case V4L2_PIX_FMT_P16RGGB12:
return PLAIN16;
default:
msm_isp_print_fourcc_error(__func__, output_format);
@@ -1766,6 +1774,10 @@ int msm_isp_get_bit_per_pixel(uint32_t output_format)
case V4L2_PIX_FMT_QGRBG12:
case V4L2_PIX_FMT_QRGGB12:
case V4L2_PIX_FMT_Y12:
+ case V4L2_PIX_FMT_P16BGGR12:
+ case V4L2_PIX_FMT_P16GBRG12:
+ case V4L2_PIX_FMT_P16GRBG12:
+ case V4L2_PIX_FMT_P16RGGB12:
case MSM_V4L2_PIX_FMT_META12:
return 12;
case V4L2_PIX_FMT_SBGGR14:
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_rt.c b/drivers/platform/msm/ipa/ipa_v3/ipa_rt.c
index b0f1e5657410..d8afb0c3becc 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_rt.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_rt.c
@@ -77,14 +77,16 @@ static int ipa_generate_rt_hw_rule(enum ipa_ip_type ip,
if (entry->hdr) {
hdr_entry = ipa3_id_find(entry->rule.hdr_hdl);
- if (!hdr_entry || hdr_entry->cookie != IPA_HDR_COOKIE) {
+ if (!hdr_entry || (hdr_entry->cookie != IPA_HDR_COOKIE) ||
+ ipa3_check_idr_if_freed(entry->hdr)) {
IPAERR_RL("Header entry already deleted\n");
return -EPERM;
}
} else if (entry->proc_ctx) {
hdr_proc_entry = ipa3_id_find(entry->rule.hdr_proc_ctx_hdl);
if (!hdr_proc_entry ||
- hdr_proc_entry->cookie != IPA_PROC_HDR_COOKIE) {
+ (hdr_proc_entry->cookie != IPA_PROC_HDR_COOKIE) ||
+ ipa3_check_idr_if_freed(entry->proc_ctx)) {
IPAERR_RL("Proc header entry already deleted\n");
return -EPERM;
}
@@ -1355,18 +1357,19 @@ int __ipa3_del_rt_rule(u32 rule_hdl)
hdr_entry = ipa3_id_find(entry->rule.hdr_hdl);
if (!hdr_entry || hdr_entry->cookie != IPA_HDR_COOKIE) {
IPAERR_RL("Header entry already deleted\n");
- return -EINVAL;
+ entry->hdr = NULL;
}
} else if (entry->proc_ctx) {
hdr_proc_entry = ipa3_id_find(entry->rule.hdr_proc_ctx_hdl);
if (!hdr_proc_entry ||
hdr_proc_entry->cookie != IPA_PROC_HDR_COOKIE) {
IPAERR_RL("Proc header entry already deleted\n");
- return -EINVAL;
+ entry->proc_ctx = NULL;
}
}
- if (entry->hdr)
+ if (entry->hdr &&
+ (!ipa3_check_idr_if_freed(entry->hdr)))
__ipa3_release_hdr(entry->hdr->id);
else if (entry->proc_ctx &&
(!ipa3_check_idr_if_freed(entry->proc_ctx)))
@@ -1543,7 +1546,6 @@ int ipa3_reset_rt(enum ipa_ip_type ip, bool user_only)
if (!user_only ||
rule->ipacm_installed) {
- list_del(&rule->link);
if (rule->hdr) {
hdr_entry = ipa3_id_find(
rule->rule.hdr_hdl);
@@ -1551,8 +1553,7 @@ int ipa3_reset_rt(enum ipa_ip_type ip, bool user_only)
hdr_entry->cookie != IPA_HDR_COOKIE) {
IPAERR_RL(
"Header already deleted\n");
- mutex_unlock(&ipa3_ctx->lock);
- return -EINVAL;
+ rule->hdr = NULL;
}
} else if (rule->proc_ctx) {
hdr_proc_entry =
@@ -1563,12 +1564,13 @@ int ipa3_reset_rt(enum ipa_ip_type ip, bool user_only)
IPA_PROC_HDR_COOKIE) {
IPAERR_RL(
"Proc entry already deleted\n");
- mutex_unlock(&ipa3_ctx->lock);
- return -EINVAL;
+ rule->hdr = NULL;
}
}
tbl->rule_cnt--;
- if (rule->hdr)
+ list_del(&rule->link);
+ if (rule->hdr &&
+ (!ipa3_check_idr_if_freed(rule->hdr)))
__ipa3_release_hdr(rule->hdr->id);
else if (rule->proc_ctx &&
(!ipa3_check_idr_if_freed(
@@ -1744,20 +1746,8 @@ static int __ipa_mdfy_rt_rule(struct ipa_rt_rule_mdfy *rtrule)
struct ipa3_hdr_entry *hdr_entry;
struct ipa3_hdr_proc_ctx_entry *hdr_proc_entry;
- if (rtrule->rule.hdr_hdl) {
- hdr = ipa3_id_find(rtrule->rule.hdr_hdl);
- if ((hdr == NULL) || (hdr->cookie != IPA_HDR_COOKIE)) {
- IPAERR_RL("rt rule does not point to valid hdr\n");
- goto error;
- }
- } else if (rtrule->rule.hdr_proc_ctx_hdl) {
- proc_ctx = ipa3_id_find(rtrule->rule.hdr_proc_ctx_hdl);
- if ((proc_ctx == NULL) ||
- (proc_ctx->cookie != IPA_PROC_HDR_COOKIE)) {
- IPAERR_RL("rt rule does not point to valid proc ctx\n");
- goto error;
- }
- }
+ if (__ipa_rt_validate_hndls(&rtrule->rule, &hdr, &proc_ctx))
+ goto error;
entry = ipa3_id_find(rtrule->rt_rule_hdl);
if (entry == NULL) {
@@ -1780,14 +1770,16 @@ static int __ipa_mdfy_rt_rule(struct ipa_rt_rule_mdfy *rtrule)
if (entry->hdr) {
hdr_entry = ipa3_id_find(entry->rule.hdr_hdl);
- if (!hdr_entry || hdr_entry->cookie != IPA_HDR_COOKIE) {
+ if (!hdr_entry || (hdr_entry->cookie != IPA_HDR_COOKIE) ||
+ ipa3_check_idr_if_freed(entry->hdr)) {
IPAERR_RL("Header entry already deleted\n");
return -EPERM;
}
} else if (entry->proc_ctx) {
hdr_proc_entry = ipa3_id_find(entry->rule.hdr_proc_ctx_hdl);
if (!hdr_proc_entry ||
- hdr_proc_entry->cookie != IPA_PROC_HDR_COOKIE) {
+ (hdr_proc_entry->cookie != IPA_PROC_HDR_COOKIE) ||
+ ipa3_check_idr_if_freed(entry->proc_ctx)) {
IPAERR_RL("Proc header entry already deleted\n");
return -EPERM;
}
@@ -1795,7 +1787,7 @@ static int __ipa_mdfy_rt_rule(struct ipa_rt_rule_mdfy *rtrule)
if (entry->hdr)
entry->hdr->ref_cnt--;
- if (entry->proc_ctx)
+ else if (entry->proc_ctx)
entry->proc_ctx->ref_cnt--;
entry->rule = rtrule->rule;
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index af03899c842d..0a6a8900532a 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -3,7 +3,7 @@
*
* This code is based on drivers/scsi/ufs/ufshcd.c
* Copyright (C) 2011-2013 Samsung India Software Operations
- * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
*
* Authors:
* Santosh Yaraganavi <santosh.sy@samsung.com>
@@ -8806,6 +8806,7 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
goto enable_gating;
}
+ flush_work(&hba->eeh_work);
ret = ufshcd_link_state_transition(hba, req_link_state, 1);
if (ret)
goto set_dev_active;
diff --git a/drivers/soc/qcom/service-locator.c b/drivers/soc/qcom/service-locator.c
index 52355699e4f3..7d7cff136689 100644
--- a/drivers/soc/qcom/service-locator.c
+++ b/drivers/soc/qcom/service-locator.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-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
@@ -251,7 +251,6 @@ static int service_locator_send_msg(struct pd_qmi_client_data *pd)
req->domain_offset_valid = true;
req->domain_offset = 0;
- pd->domain_list = NULL;
do {
req->domain_offset += domains_read;
rc = servreg_loc_send_msg(&req_desc, &resp_desc, req, resp,
@@ -281,6 +280,7 @@ static int service_locator_send_msg(struct pd_qmi_client_data *pd)
pr_err("Service Locator DB updated for client %s\n",
pd->client_name);
kfree(pd->domain_list);
+ pd->domain_list = NULL;
rc = -EAGAIN;
goto out;
}
@@ -360,7 +360,7 @@ int get_service_location(char *client_name, char *service_name,
goto err;
}
- pqcd = kmalloc(sizeof(struct pd_qmi_client_data), GFP_KERNEL);
+ pqcd = kzalloc(sizeof(struct pd_qmi_client_data), GFP_KERNEL);
if (!pqcd) {
rc = -ENOMEM;
pr_err("Allocation failed\n");
@@ -401,7 +401,7 @@ static void pd_locator_work(struct work_struct *work)
pr_err("Unable to connect to service locator!, rc = %d\n", rc);
pdqw->notifier->notifier_call(pdqw->notifier,
LOCATOR_DOWN, NULL);
- goto err;
+ goto err_init_servloc;
}
rc = service_locator_send_msg(data);
if (rc) {
@@ -409,11 +409,13 @@ static void pd_locator_work(struct work_struct *work)
data->service_name, data->client_name, rc);
pdqw->notifier->notifier_call(pdqw->notifier,
LOCATOR_DOWN, NULL);
- goto err;
+ goto err_servloc_send_msg;
}
pdqw->notifier->notifier_call(pdqw->notifier, LOCATOR_UP, data);
-err:
+err_servloc_send_msg:
+ kfree(data->domain_list);
+err_init_servloc:
kfree(data);
kfree(pdqw);
}
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index ded36feda42d..5c0e1954647e 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -33,6 +33,9 @@
/* Indicate backport support for DH IE creation/update*/
#define CFG80211_EXTERNAL_DH_UPDATE_SUPPORT 1
+/* Indicate backport support for supported AKM advertisement per interface*/
+#define CFG80211_IFTYPE_AKM_SUITES_SUPPORT 1
+
/**
* DOC: Introduction
*
@@ -3332,6 +3335,21 @@ struct wiphy_iftype_ext_capab {
};
/**
+ * struct wiphy_iftype_akm_suites - This structure encapsulates supported akm
+ * suites for interface types defined in @iftypes_mask. Each type in the
+ * @iftypes_mask must be unique across all instances of iftype_akm_suites.
+ *
+ * @iftypes_mask: bitmask of interfaces types
+ * @akm_suites: points to an array of supported akm suites
+ * @n_akm_suites: number of supported AKM suites
+ */
+struct wiphy_iftype_akm_suites {
+ u16 iftypes_mask;
+ const u32 *akm_suites;
+ int n_akm_suites;
+};
+
+/**
* struct wiphy - wireless hardware description
* @reg_notifier: the driver's regulatory notification callback,
* note that if your driver uses wiphy_apply_custom_regulatory()
@@ -3343,6 +3361,12 @@ struct wiphy_iftype_ext_capab {
* @signal_type: signal type reported in &struct cfg80211_bss.
* @cipher_suites: supported cipher suites
* @n_cipher_suites: number of supported cipher suites
+ * @iftype_akm_suites: array of supported akm suites info per interface type.
+ * Note that the bits in @iftypes_mask inside this structure cannot
+ * overlap (i.e. only one occurrence of each type is allowed across all
+ * instances of iftype_akm_suites).
+ * @num_iftype_akm_suites: number of interface types for which supported akm
+ * suites are specified separately.
* @retry_short: Retry limit for short frames (dot11ShortRetryLimit)
* @retry_long: Retry limit for long frames (dot11LongRetryLimit)
* @frag_threshold: Fragmentation threshold (dot11FragmentationThreshold);
@@ -3527,6 +3551,9 @@ struct wiphy {
int n_cipher_suites;
const u32 *cipher_suites;
+ const struct wiphy_iftype_akm_suites *iftype_akm_suites;
+ unsigned int num_iftype_akm_suites;
+
u8 retry_short;
u8 retry_long;
u32 frag_threshold;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 1e64e46162be..d71f4a5ddb0f 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2162,6 +2162,13 @@ enum nl80211_commands {
* may offload authentication processing to user space if this capability
* is indicated in the respective requests from the user space.
*
+ * @NL80211_ATTR_IFTYPE_AKM_SUITES: nested array attribute, with each entry
+ * using attributes from &enum nl80211_iftype_akm_attributes. This
+ * attribute is sent in a response to %NL80211_CMD_GET_WIPHY indicating
+ * supported AKM suites capability per interface. AKMs advertised in
+ * %NL80211_ATTR_AKM_SUITES are default capabilities if AKM suites not
+ * advertised for a specific interface type.
+ *
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2591,6 +2598,9 @@ enum nl80211_attrs {
NL80211_ATTR_EXTERNAL_AUTH_ACTION,
NL80211_ATTR_EXTERNAL_AUTH_SUPPORT,
+ NL80211_ATTR_IFTYPE_AKM_SUITES =
+ NL80211_ATTR_EXTERNAL_AUTH_SUPPORT + 23,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -5316,4 +5326,28 @@ enum nl80211_external_auth_action {
NL80211_EXTERNAL_AUTH_ABORT,
};
+/**
+ * enum nl80211_iftype_akm_attributes - interface type AKM attributes
+ * @__NL80211_IFTYPE_AKM_ATTR_INVALID: Invalid
+ *
+ * @NL80211_IFTYPE_AKM_ATTR_IFTYPES: nested attribute containing a flag
+ * attribute for each interface type that supports AKM suites specified in
+ * %NL80211_IFTYPE_AKM_ATTR_SUITES
+ * @NL80211_IFTYPE_AKM_ATTR_SUITES: an array of u32. Used to indicate supported
+ * AKM suites for the specified interface types.
+ *
+ * @__NL80211_IFTYPE_AKM_ATTR_LAST: Internal
+ * @NL80211_IFTYPE_AKM_ATTR_MAX: highest interface type AKM attribute.
+ */
+enum nl80211_iftype_akm_attributes {
+ __NL80211_IFTYPE_AKM_ATTR_INVALID,
+
+ NL80211_IFTYPE_AKM_ATTR_IFTYPES,
+ NL80211_IFTYPE_AKM_ATTR_SUITES,
+
+ /* keep last */
+ __NL80211_IFTYPE_AKM_ATTR_LAST,
+ NL80211_IFTYPE_AKM_ATTR_MAX = __NL80211_IFTYPE_AKM_ATTR_LAST - 1,
+};
+
#endif /* __LINUX_NL80211_H */
diff --git a/include/uapi/media/msmb_isp.h b/include/uapi/media/msmb_isp.h
index b1c02f297e91..273388c657c5 100644
--- a/include/uapi/media/msmb_isp.h
+++ b/include/uapi/media/msmb_isp.h
@@ -879,6 +879,10 @@ struct msm_vfe_dual_lpm_mode {
#define V4L2_PIX_FMT_P16GBRG10 v4l2_fourcc('P', 'G', 'B', '0')
#define V4L2_PIX_FMT_P16GRBG10 v4l2_fourcc('P', 'G', 'R', '0')
#define V4L2_PIX_FMT_P16RGGB10 v4l2_fourcc('P', 'R', 'G', '0')
+#define V4L2_PIX_FMT_P16BGGR12 v4l2_fourcc('P', 'B', 'G', '2')
+#define V4L2_PIX_FMT_P16GBRG12 v4l2_fourcc('P', 'G', 'B', '2')
+#define V4L2_PIX_FMT_P16GRBG12 v4l2_fourcc('P', 'G', 'R', '2')
+#define V4L2_PIX_FMT_P16RGGB12 v4l2_fourcc('P', 'R', 'G', '2')
#define V4L2_PIX_FMT_NV14 v4l2_fourcc('N', 'V', '1', '4')
#define V4L2_PIX_FMT_NV41 v4l2_fourcc('N', 'V', '4', '1')
#define V4L2_PIX_FMT_META v4l2_fourcc('Q', 'M', 'E', 'T')
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 664c84e47bab..7444510a3928 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -576,10 +576,6 @@ struct sk_buff *nf_ct_frag6_gather(struct net *net, struct sk_buff *skb, u32 use
hdr = ipv6_hdr(clone);
fhdr = (struct frag_hdr *)skb_transport_header(clone);
- if (clone->len - skb_network_offset(clone) < IPV6_MIN_MTU &&
- fhdr->frag_off & htons(IP6_MF))
- goto ret_orig;
-
skb_orphan(skb);
fq = fq_find(net, fhdr->identification, user, hdr,
skb->dev ? skb->dev->ifindex : 0);
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 17e9ed2edb86..7b88fac606e1 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -516,10 +516,6 @@ static int ipv6_frag_rcv(struct sk_buff *skb)
return 1;
}
- if (skb->len - skb_network_offset(skb) < IPV6_MIN_MTU &&
- fhdr->frag_off & htons(IP6_MF))
- goto fail_hdr;
-
iif = skb->dev ? skb->dev->ifindex : 0;
fq = fq_find(net, fhdr->identification, hdr, iif);
if (fq) {
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 12e85fe97c86..2722b840620f 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1312,6 +1312,46 @@ nl80211_send_mgmt_stypes(struct sk_buff *msg,
return 0;
}
+static int
+nl80211_put_iftype_akm_suites(struct cfg80211_registered_device *rdev,
+ struct sk_buff *msg)
+{
+ int i;
+ struct nlattr *nested, *nested_akms;
+ const struct wiphy_iftype_akm_suites *iftype_akms;
+
+ if (!rdev->wiphy.num_iftype_akm_suites ||
+ !rdev->wiphy.iftype_akm_suites)
+ return 0;
+
+ nested = nla_nest_start(msg, NL80211_ATTR_IFTYPE_AKM_SUITES);
+ if (!nested)
+ return -ENOBUFS;
+
+ for (i = 0; i < rdev->wiphy.num_iftype_akm_suites; i++) {
+ nested_akms = nla_nest_start(msg, i + 1);
+ if (!nested_akms)
+ return -ENOBUFS;
+
+ iftype_akms = &rdev->wiphy.iftype_akm_suites[i];
+
+ if (nl80211_put_iftypes(msg, NL80211_IFTYPE_AKM_ATTR_IFTYPES,
+ iftype_akms->iftypes_mask))
+ return -ENOBUFS;
+
+ if (nla_put(msg, NL80211_IFTYPE_AKM_ATTR_SUITES,
+ sizeof(u32) * iftype_akms->n_akm_suites,
+ iftype_akms->akm_suites)) {
+ return -ENOBUFS;
+ }
+ nla_nest_end(msg, nested_akms);
+ }
+
+ nla_nest_end(msg, nested);
+
+ return 0;
+}
+
struct nl80211_dump_wiphy_state {
s64 filter_wiphy;
long start;
@@ -1858,6 +1898,13 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
nla_nest_end(msg, nested);
}
+ state->split_start++;
+ break;
+ case 14:
+
+ if (nl80211_put_iftype_akm_suites(rdev, msg))
+ goto nla_put_failure;
+
/* done */
state->split_start = 0;
break;
diff --git a/sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c b/sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c
index 66245ba438fc..eb093cf71b41 100644
--- a/sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c
+++ b/sound/soc/codecs/sdm660_cdc/msm-analog-cdc.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015-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
@@ -1631,11 +1631,11 @@ static int msm_anlg_cdc_pa_gain_get(struct snd_kcontrol *kcontrol,
if (ear_pa_gain == 0x00) {
ucontrol->value.integer.value[0] = 3;
} else if (ear_pa_gain == 0x01) {
- ucontrol->value.integer.value[1] = 2;
+ ucontrol->value.integer.value[0] = 2;
} else if (ear_pa_gain == 0x02) {
- ucontrol->value.integer.value[2] = 1;
+ ucontrol->value.integer.value[0] = 1;
} else if (ear_pa_gain == 0x03) {
- ucontrol->value.integer.value[3] = 0;
+ ucontrol->value.integer.value[0] = 0;
} else {
dev_err(codec->dev,
"%s: ERROR: Unsupported Ear Gain = 0x%x\n",
@@ -1657,7 +1657,6 @@ static int msm_anlg_cdc_pa_gain_get(struct snd_kcontrol *kcontrol,
return -EINVAL;
}
}
- ucontrol->value.integer.value[0] = ear_pa_gain;
dev_dbg(codec->dev, "%s: ear_pa_gain = 0x%x\n", __func__, ear_pa_gain);
return 0;
}