Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/android12-base' into android12-next
Browse files Browse the repository at this point in the history
* origin/android12-base:
  soc: qcom: core_hang: Add support to check available cpus
  soc: qcom: socinfo: Add API for defective core/part information
  clk: qcom: clk-rcg2: Update logic to calculate D value for RCG
  cnss2: Only assert for remap window register when link is not down
  cnss2: Make sure the write to remap window register take effect
  qcom/l2cache_counters: Add support to check available CPUS
  fw-api: CL 19622099 - update fw common interface files
  fw-api: CL 19606967 - update fw common interface files
  UPSTREAM: binderfs: use refcount for binder control devices too
  FROMGIT: arm64: fix oops in concurrently setting insn_emulation sysctls
  media:uvc: supports dynamic setting of urb configuration
  qcacmn: Update set ch params API to consider passive ch
  msm: camera: Increase the total number of camera ID's supported
  cpu-topology: Don't error on more than CONFIG_NR_CPUS CPUs in device tree
  msm: vidc: Update maximum supported slice count
  fw-api: CL 19556986 - update fw common interface files
  usb: gadget: rndis: prevent integer overflow in rndis_set_response()
  FROMLIST: binder: fix UAF of ref->proc caused by race condition
  fw-api: CL 19533452 - update fw common interface files
  fw-api: CL 19477285 - update fw common interface files
  fw-api: CL 19472001 - update fw common interface files
  fw-api: CL 19468705 - update fw common interface files
  fw-api: CL 19457721 - update fw common interface files
  fw-api: CL 19438550 - update fw common interface files
  fw-api: CL 19435748 - update fw common interface files
  fw-api: CL 19429798 - update fw common interface files
  fw-api: CL 19427858 - update fw common interface files
  msm_perf: check cpu_possible to improve stability
  msm: adsprpc: Validate the CID
  Release 5.2.022.11O
  qcacld-3.0: Avoid double free in sch_gen_timing_advert_frame
  fw-api: Add ipq5332 target header files to fw-api project
  msm: vidc: Enable intra cyclic refresh
  Release 5.2.022.11N
  qcacld-3.0: Add support for dynamic GRO for Helium target
  Release 5.2.022.11M
  qcacld-3.0: Properly set htCapable and vhtCapable
  Release 5.2.022.11L
  qcacld-3.0: Control GRO en/dis based on TC filter prio
  qcacld-3.0: Add an ini control to disable Dynamic GRO feature
  qcacld-3.0: Do GRO en/dis based on qdisc only for standalone STA
  qcacld-3.0: Dynamically control rx aggregation based on ingress filter
  fw-api: CL 19415475 - update fw common interface files
  fw-api: CL 19412691 - update fw common interface files
  soc: qcom: socinfo: Add soc information for Khaje IOT
  fw-api: CL 19398158 - update fw common interface files
  fw-api: CL 19397642 - update fw common interface files
  fw-api: CL 19394669 - update fw common interface files
  fw-api: CL 19391619 - update fw common interface files
  fw-api: CL 19391596 - update fw common interface files
  fw-api: CL 19370853 - update fw common interface files
  fw-api: CL 19370849 - update fw common interface files
  fw-api: CL 19349228 - update fw common interface files
  fw-api: CL 19348400 - update fw common interface files
  fw-api: CL 19327828 - update fw common interface files
  fw-api: CL 19327825 - update fw common interface files
  fw-api: CL 19280734 - update fw common interface files
  fw-api: CL 19280530 - update fw common interface files
  fw-api: CL 19259024 - update fw common interface files
  qcacmn: Add support for dynamic GRO for Helium target
  fw-api: CL 19232954 - update fw common interface files
  fw-api: CL 19207537 - update fw common interface files
  fw-api: CL 19198716 - update fw common interface files
  fw-api: CL 19196446 - update fw common interface files
  fw-api: CL 19192070 - update fw common interface files
  fw-api: CL 19177839 - update fw common interface files
  fw-api: CL 19172232 - update fw common interface files
  fw-api: CL 19168628 - update fw common interface files
  fw-api: CL 19157233 - update fw common interface files
  fw-api: CL 19115988 - update fw common interface files
  fw-api: CL 19090770 - update fw common interface files
  fw-api: Add wlanfw_health_mon.h for FW Health Monitor
  Release 5.2.022.11K
  qcacld-3.0: validate vdev id for APF enable command
  fw-api: CL 19087861 - update fw common interface files
  fw-api: CL 19061926 - update fw common interface files
  fw-api: CL 19061219 - update fw common interface files
  fw-api: CL 19047183 - update fw common interface files
  fw-api: CL 19029549 - update fw common interface files
  fw-api: CL 19024619 - update fw common interface files
  fw-api: CL 19024615 - update fw common interface files
  fw-api: CL 19010813 - update fw common interface files
  fw-api: CL 18998456 - update fw common interface files
  fw-api: CL 18987039 - update fw common interface files
  fw-api: CL 18966584 - update fw common interface files
  fw-api: CL 18946469 - update fw common interface files
  fw-api: CL 18946444 - update fw common interface files
  fw-api: CL 18916860 - update fw common interface files
  qcacmn: Add ini to set priority for TC ingress filter
  qcacmn: Add an ini control to disable Dynamic GRO feature
  power: qpnp-fg-gen4: Improve SDAM corruption check
  qcacld-3.0: Correct the condition to reject TDLS
  fw-api: Add headers for qcn9224 v2
  fw-api: CL 18860032 - update fw common interface files
  fw-api: CL 18844589 - update fw common interface files
  fw-api: CL 18844583 - update fw common interface files
  msm: ADSPRPC: Restrict untrusted applications from attaching to GuestOS
  fw-api: CL 18827872 - update fw common interface files
  fw-api: CL 18809954 - update fw common interface files
  fw-api: CL 18774949 - update fw common interface files
  fw-api: CL 18757174 - update fw common interface files
  fw-api: CL 18739769 - update fw common interface files
  fw-api: CL 18709242 - update fw common interface files
  fw-api: CL 18685702 - update fw common interface files
  msm: kgsl: Zap performance counters across context switches
  msm: kgsl: Add a sysfs node to control performance counter reads
  tzlog: update struct to get normal and fatal diag logs
  firmware: qcom: Remove garbage characters from qsee log
  firmware: qcom: add enlarged qsee log support
  firmware: qcom: encrypted tz and qsee log support
  qcacmn: Check function pointer to avoid NULL point dereference
  msm: vidc: set ib bandwidth for holi
  qcacld-3.0: Invalid rem_len computation in roam stats evt handler
  serial: msm_geni_serial: Reduce stale delay added in stop_rx_sequencer
  qcacmn: Fix OOB read issue in SSID ie
  qcacmn: Possible Integer overflow in wifi_pos_oem_rsp_handler
  qcacmn: Use local skb pointer for reentrant cld80211_msg_allocator
  clk: qcom: debugcc: Remove the gcc_camss_camnoc clocks
  qcacmn: Fix possible OOB in wmi_extract_dbr_buf_release_entry
  defconfig: Enable CONFIG_ION_SYSTEM_HEAP for bengal
  f2fs: fix the periodic wakeups of discard thread
  f2fs: allow to change discard policy based on cached discard cmds
  msm: adsprpc: Lock list before removing node
  clk: qcom: gpucc: Update the post div ops for GPUCC PLL for KHAJE
  clk: qcom: clk-alpha-pll: Update implementation for Zonda PLL
  msm: kgsl: Use pid struct to find the process to reclaim
  mm: process_reclaim: pass pid struct instead of tgid
  msm: kgsl: Change vma->vm_file to shmem file
  mm: process_reclaim: skip target_vma
  net: qrtr: Excessive logging casuing boot failure
  Revert "msm: kgsl: Add GPUCC register dumps to A6xx GPU snapshot"
  qcacmn: Validate NDP app info length before accessing NDP app info
  qcacld-3.0: Send vdev create cmd from vdevmgr_mlme_ext_hdl_create
  qcacmn: Add length check in ndp event handler
  defconfig: msm: Enable CONFIG_STATIC_USERMODEHELPER for bengal_32
  fdt: Update CRC check for rng-seed
  msm: vidc: update all intra to allow more than 30 fps
  defconfig: Enable blk-crypto-fallback to handle sw crypto request
  md: dm-default-key: Use system sector size for SDHCI devices
  msm: mink: Fix copy_to_user issue
  fix corrupt merge
  msm: vdec: set hfi property when set by client
  serial: msm_geni_serial: Disable irq only for HSUART usecase
  msm_geni_serial: Correct the DMA RX interrupt logic

Change-Id: I3d2c79635d7186da89d9f802a5955540a182b8f1
Signed-off-by: UtsavBalar1231 <[email protected]>
  • Loading branch information
UtsavBalar1231 committed Oct 14, 2022
2 parents 01e24ac + cc68f3f commit 4a3aedc
Show file tree
Hide file tree
Showing 663 changed files with 340,478 additions and 233 deletions.
18 changes: 14 additions & 4 deletions arch/arm64/kernel/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
#include <asm/cputype.h>
#include <asm/topology.h>

/*
* This function returns the logic cpu number of the node.
* There are basically three kinds of return values:
* (1) logic cpu number which is > 0.
* (2) -ENODEV when the device tree(DT) node is valid and found in the DT but
* there is no possible logical CPU in the kernel to match. This happens
* when CONFIG_NR_CPUS is configure to be smaller than the number of
* CPU nodes in DT. We need to just ignore this case.
* (3) -1 if the node does not exist in the device tree
*/
static int __init get_cpu_for_node(struct device_node *node)
{
struct device_node *cpu_node;
Expand All @@ -44,8 +54,8 @@ static int __init get_cpu_for_node(struct device_node *node)
if (cpu >= 0)
topology_parse_cpu_capacity(cpu_node, cpu);
else
pr_crit("Unable to find CPU node for %pOF\n", cpu_node);

pr_info("CPU node for %pOF exist but the possible cpu range is :%*pbl\n",
cpu_node, cpumask_pr_args(cpu_possible_mask));
of_node_put(cpu_node);
return cpu;
}
Expand All @@ -69,7 +79,7 @@ static int __init parse_core(struct device_node *core, int package_id,
cpu_topology[cpu].package_id = package_id;
cpu_topology[cpu].core_id = core_id;
cpu_topology[cpu].thread_id = i;
} else {
} else if (cpu != -ENODEV) {
pr_err("%pOF: Can't get CPU for thread\n",
t);
of_node_put(t);
Expand All @@ -90,7 +100,7 @@ static int __init parse_core(struct device_node *core, int package_id,

cpu_topology[cpu].package_id = package_id;
cpu_topology[cpu].core_id = core_id;
} else if (leaf) {
} else if (leaf && cpu != -ENODEV) {
pr_err("%pOF: Can't get CPU for leaf core\n", core);
return -EINVAL;
}
Expand Down
7 changes: 5 additions & 2 deletions drivers/char/adsprpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1467,8 +1467,11 @@ static int context_alloc(struct fastrpc_file *fl, uint32_t kernel,

spin_lock(&fl->hlock);
hlist_add_head(&ctx->hn, &clst->pending);
cid = (fl->cid >= ADSP_DOMAIN_ID && fl->cid < NUM_CHANNELS)
? fl->cid : 0;
if (!(fl->cid >= ADSP_DOMAIN_ID && fl->cid < NUM_CHANNELS)) {
err = -ECHRNG;
goto bail;
}
cid = fl->cid;
chan = &me->channel[cid];
spin_unlock(&fl->hlock);

Expand Down
13 changes: 11 additions & 2 deletions drivers/clk/qcom/clk-rcg2.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ static bool clk_rcg2_current_config(struct clk_rcg2 *rcg,

static int __clk_rcg2_configure(struct clk_rcg2 *rcg, const struct freq_tbl *f)
{
u32 cfg, mask;
u32 cfg, mask, d_val, not2d_val, n_minus_m;
struct clk_hw *hw = &rcg->clkr.hw;
int ret, index = qcom_find_src_index(hw, rcg->parent_map, f->src);

Expand All @@ -525,8 +525,17 @@ static int __clk_rcg2_configure(struct clk_rcg2 *rcg, const struct freq_tbl *f)
if (ret)
return ret;

/* Calculate 2d value */
d_val = f->n;

n_minus_m = f->n - f->m;
n_minus_m *= 2;

d_val = clamp_t(u32, d_val, f->m, n_minus_m);
not2d_val = ~d_val & mask;

ret = regmap_update_bits(rcg->clkr.regmap,
rcg->cmd_rcgr + D_REG, mask, ~f->n);
rcg->cmd_rcgr + D_REG, mask, not2d_val);
if (ret)
return ret;
}
Expand Down
71 changes: 71 additions & 0 deletions drivers/media/usb/uvc/uvc_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2096,6 +2096,71 @@ struct uvc_device_info {
u32 meta_format;
};

/* ------------------------------------------------------------------------
* set urb queue size and urb packet size
*
*/
static ssize_t store_urb_config(struct device *dev,
struct device_attribute *attr, const char *buff, size_t count)
{
struct uvc_streaming *stream;
struct usb_interface *intf = to_usb_interface(dev);
struct uvc_device *udev = usb_get_intfdata(intf);
long max_urb, max_urb_packets;
int ret;
char *arr, *tmp;

arr = kstrdup(buff, GFP_KERNEL);

if (!arr)
return -ENOMEM;

tmp = strsep(&arr, ":");

if (!tmp)
return -EINVAL;

ret = kstrtol(tmp, 10, &max_urb);
if (ret < 0)
return ret;

tmp = strsep(&arr, ":");
if (!tmp)
return -EINVAL;

ret = kstrtol(tmp, 10, &max_urb_packets);
if (ret < 0)
return ret;

if (max_urb <= 0 || max_urb > 128 ||
max_urb_packets <= 0 || max_urb_packets > 128)
return -EINVAL;

list_for_each_entry(stream, &udev->streams, list) {
if (stream->refcnt)
continue;
stream->max_urb = max_urb;
stream->max_urb_packets = max_urb_packets;
}

return count;
}

static ssize_t show_urb_config(struct device *dev,
struct device_attribute *attr, char *buff)
{
return 0;
}

static struct device_attribute urb_config_attr = {
.attr = {
.name = "urb_config",
.mode = 00660,
},
.show = show_urb_config,
.store = store_urb_config,
};

static int uvc_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
Expand Down Expand Up @@ -2228,6 +2293,12 @@ static int uvc_probe(struct usb_interface *intf,

uvc_trace(UVC_TRACE_PROBE, "UVC device initialized.\n");
usb_enable_autosuspend(udev);

/* sysfs file for dynamically setting urb configs */
ret = sysfs_create_file(&dev->intf->dev.kobj, &urb_config_attr.attr);
if (ret != 0)
pr_info("Unable to initialize urb configuration: %d\n", ret);

return 0;

error:
Expand Down
40 changes: 28 additions & 12 deletions drivers/media/usb/uvc/uvc_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ static void uvc_free_urb_buffers(struct uvc_streaming *stream)
{
unsigned int i;

for (i = 0; i < UVC_URBS; ++i) {
for (i = 0; i < stream->max_urb; ++i) {
if (stream->urb_buffer[i]) {
#ifndef CONFIG_DMA_NONCOHERENT
usb_free_coherent(stream->dev->udev, stream->urb_size,
Expand Down Expand Up @@ -1587,12 +1587,22 @@ static int uvc_alloc_urb_buffers(struct uvc_streaming *stream,
* payloads across multiple URBs.
*/
npackets = DIV_ROUND_UP(size, psize);
if (npackets > UVC_MAX_PACKETS)
npackets = UVC_MAX_PACKETS;
if (npackets > stream->max_urb_packets)
npackets = stream->max_urb_packets;


/* Allocate memory for storing URB pointers */
stream->urb = kcalloc(stream->max_urb,
sizeof(struct urb *), gfp_flags | __GFP_NOWARN);
stream->urb_buffer = kcalloc(stream->max_urb,
sizeof(char *), gfp_flags | __GFP_NOWARN);
stream->urb_dma = kcalloc(stream->max_urb,
sizeof(dma_addr_t), gfp_flags | __GFP_NOWARN);


/* Retry allocations until one succeed. */
for (; npackets > 1; npackets /= 2) {
for (i = 0; i < UVC_URBS; ++i) {
for (i = 0; i < stream->max_urb; ++i) {
stream->urb_size = psize * npackets;
#ifndef CONFIG_DMA_NONCOHERENT
stream->urb_buffer[i] = usb_alloc_coherent(
Expand All @@ -1608,10 +1618,10 @@ static int uvc_alloc_urb_buffers(struct uvc_streaming *stream,
}
}

if (i == UVC_URBS) {
uvc_trace(UVC_TRACE_VIDEO, "Allocated %u URB buffers "
"of %ux%u bytes each.\n", UVC_URBS, npackets,
psize);
if (i == stream->max_urb) {
uvc_trace(UVC_TRACE_VIDEO,
"Allocated %u URB buffers of %ux%u bytes each.\n",
stream->max_urb, npackets, psize);
return npackets;
}
}
Expand All @@ -1631,7 +1641,7 @@ static void uvc_uninit_video(struct uvc_streaming *stream, int free_buffers)

uvc_video_stats_stop(stream);

for (i = 0; i < UVC_URBS; ++i) {
for (i = 0; i < stream->max_urb; ++i) {
urb = stream->urb[i];
if (urb == NULL)
continue;
Expand All @@ -1643,6 +1653,8 @@ static void uvc_uninit_video(struct uvc_streaming *stream, int free_buffers)

if (free_buffers)
uvc_free_urb_buffers(stream);

stream->refcnt--;
}

/*
Expand Down Expand Up @@ -1692,7 +1704,7 @@ static int uvc_init_video_isoc(struct uvc_streaming *stream,

size = npackets * psize;

for (i = 0; i < UVC_URBS; ++i) {
for (i = 0; i < stream->max_urb; ++i) {
urb = usb_alloc_urb(npackets, gfp_flags);
if (urb == NULL) {
uvc_uninit_video(stream, 1);
Expand Down Expand Up @@ -1758,7 +1770,7 @@ static int uvc_init_video_bulk(struct uvc_streaming *stream,
if (stream->type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
size = 0;

for (i = 0; i < UVC_URBS; ++i) {
for (i = 0; i < stream->max_urb; ++i) {
urb = usb_alloc_urb(0, gfp_flags);
if (urb == NULL) {
uvc_uninit_video(stream, 1);
Expand Down Expand Up @@ -1867,7 +1879,8 @@ static int uvc_init_video(struct uvc_streaming *stream, gfp_t gfp_flags)
return ret;

/* Submit the URBs. */
for (i = 0; i < UVC_URBS; ++i) {
stream->refcnt++;
for (i = 0; i < stream->max_urb; ++i) {
ret = usb_submit_urb(stream->urb[i], gfp_flags);
if (ret < 0) {
uvc_printk(KERN_ERR, "Failed to submit URB %u "
Expand Down Expand Up @@ -2028,6 +2041,9 @@ int uvc_video_init(struct uvc_streaming *stream)
stream->cur_format = format;
stream->cur_frame = frame;

stream->max_urb = UVC_URBS;
stream->max_urb_packets = UVC_MAX_PACKETS;

/* Select the video decoding function */
if (stream->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
if (stream->dev->quirks & UVC_QUIRK_BUILTIN_ISIGHT)
Expand Down
15 changes: 12 additions & 3 deletions drivers/media/usb/uvc/uvcvideo.h
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,9 @@ struct uvc_streaming {
u32 max_payload_size;
} bulk;

struct urb *urb[UVC_URBS];
char *urb_buffer[UVC_URBS];
dma_addr_t urb_dma[UVC_URBS];
struct urb **urb;
char **urb_buffer;
dma_addr_t *urb_dma;
unsigned int urb_size;

u32 sequence;
Expand Down Expand Up @@ -570,6 +570,15 @@ struct uvc_streaming {

spinlock_t lock;
} clock;

/* Maximum number of URBs that can be submitted */
u32 max_urb;

/* Maximum number of packets per URB */
u32 max_urb_packets;

/*set if stream in progress */
u8 refcnt;
};

struct uvc_device {
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/cnss2/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,8 @@ static void cnss_pci_select_window(struct cnss_pci_data *pci_priv, u32 offset)
if (val != window_enable) {
cnss_pr_err("Failed to config window register to 0x%x, current value: 0x%x\n",
window_enable, val);
CNSS_ASSERT(0);
if (!cnss_pci_check_link_status(pci_priv))
CNSS_ASSERT(0);
}
}

Expand Down
12 changes: 10 additions & 2 deletions drivers/perf/qcom_l2_counters.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,8 +1037,8 @@ static int l2_cache_pmu_probe_cluster(struct device *parent,
struct cluster_pmu *cluster;
u32 fw_cluster_id;
struct resource res;
int ret;
int irq;
int ret = 0;
int irq, cpu, cpu_count = 0;

cluster = kzalloc(sizeof(*cluster), GFP_KERNEL);
if (!cluster) {
Expand All @@ -1064,6 +1064,14 @@ static int l2_cache_pmu_probe_cluster(struct device *parent,
goto err_put_dev;
}

for_each_possible_cpu(cpu) {
if (topology_physical_package_id(cpu) == fw_cluster_id) {
cpu_count++;
break;
}
}
if (cpu_count == 0)
goto err_put_dev;
ret = of_address_to_resource(cn, 0, &res);
if (ret) {
pr_err(L2_COUNTERS_BUG "not able to find the resource\n");
Expand Down
Loading

0 comments on commit 4a3aedc

Please sign in to comment.