Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18afa4d3 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Merge android11-5.4.61+ (364ec3d2) into msm-5.4"

parents c2d5eb90 022f93cd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
LTS_5.4.61_5327444e834f
LTS_5.4.61_364ec3d27d09
+21 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
  bpf_trace_run4
  __breadahead
  bus_register
  bus_set_iommu
  bus_unregister
  call_rcu
  cancel_delayed_work
@@ -110,6 +111,7 @@
  device_destroy
  device_initialize
  device_init_wakeup
  device_link_add
  device_match_fwnode
  device_match_name
  device_property_present
@@ -180,6 +182,10 @@
  drm_dev_register
  drm_err
  drm_ioctl
  drm_mm_init
  drm_mm_insert_node_in_range
  drm_mm_remove_node
  drm_mm_takedown
  drm_mode_config_cleanup
  drm_mode_config_init
  drm_open
@@ -281,7 +287,11 @@
  iommu_alloc_resv_region
  iommu_attach_device
  iommu_detach_device
  iommu_device_link
  iommu_device_register
  iommu_device_sysfs_add
  iommu_device_sysfs_remove
  iommu_device_unlink
  iommu_device_unregister
  iommu_dma_get_resv_regions
  iommu_domain_alloc
@@ -292,6 +302,7 @@
  iommu_fwspec_free
  iommu_get_dma_cookie
  iommu_get_domain_for_dev
  iommu_group_alloc
  iommu_group_get
  iommu_group_get_for_dev
  iommu_group_get_iommudata
@@ -995,6 +1006,7 @@
  skb_checksum_help
  strim
  xfrm_lookup
  completion_done

# required by kfifo_buf.ko
  devres_add
@@ -1144,6 +1156,7 @@

# required by pvrsrvkm.ko
  autoremove_wake_function
  bpf_trace_run6
  bpf_trace_run7
  bpf_trace_run8
  cache_line_size
@@ -1196,6 +1209,7 @@
  get_unused_fd_flags
  idr_preload
  idr_replace
  ion_query_heaps_kernel
  kill_pid
  ksize
  kthread_freezable_should_stop
@@ -1207,6 +1221,7 @@
  of_modalias_node
  on_each_cpu
  prepare_to_wait
  proc_remove
  put_unused_fd
  _raw_read_lock_bh
  _raw_read_unlock_bh
@@ -1222,6 +1237,7 @@
  strsep
  sync_file_create
  sync_file_get_fence
  __task_pid_nr_ns
  trace_print_symbols_seq
  trace_set_clr_event
  unmap_mapping_range
@@ -1993,6 +2009,7 @@
# required by usb_f_mtp.ko
  usb_os_desc_prepare_interf_dir
  usb_string_id
  config_group_init_type_name

# required by usbserial.ko
  device_del
@@ -2549,3 +2566,7 @@
  kobject_init_and_add
  sched_setscheduler_nocheck
  strpbrk

# required by sprd_wdf.ko
  kstrtoull_from_user
  smpboot_register_percpu_thread
+77 −91
Original line number Diff line number Diff line
@@ -1015,7 +1015,10 @@ static int armv8pmu_probe_pmu(struct arm_pmu *cpu_pmu)
	return probe.present ? 0 : -ENODEV;
}

static int armv8_pmu_init(struct arm_pmu *cpu_pmu)
static int armv8_pmu_init(struct arm_pmu *cpu_pmu, char *name,
			  int (*map_event)(struct perf_event *event),
			  const struct attribute_group *events,
			  const struct attribute_group *format)
{
	int ret = armv8pmu_probe_pmu(cpu_pmu);
	if (ret)
@@ -1034,144 +1037,127 @@ static int armv8_pmu_init(struct arm_pmu *cpu_pmu)
	cpu_pmu->set_event_filter	= armv8pmu_set_event_filter;
	cpu_pmu->filter_match		= armv8pmu_filter_match;

	cpu_pmu->name			= name;
	cpu_pmu->map_event		= map_event;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] = events ?
			events : &armv8_pmuv3_events_attr_group;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] = format ?
			format : &armv8_pmuv3_format_attr_group;

	return 0;
}

static int armv8_pmuv3_init(struct arm_pmu *cpu_pmu)
{
	int ret = armv8_pmu_init(cpu_pmu);
	if (ret)
		return ret;

	cpu_pmu->name			= "armv8_pmuv3";
	cpu_pmu->map_event		= armv8_pmuv3_map_event;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] =
		&armv8_pmuv3_events_attr_group;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] =
		&armv8_pmuv3_format_attr_group;
	return armv8_pmu_init(cpu_pmu, "armv8_pmuv3",
			      armv8_pmuv3_map_event, NULL, NULL);
}

	return 0;
static int armv8_a34_pmu_init(struct arm_pmu *cpu_pmu)
{
	return armv8_pmu_init(cpu_pmu, "armv8_cortex_a34",
			      armv8_pmuv3_map_event, NULL, NULL);
}

static int armv8_a35_pmu_init(struct arm_pmu *cpu_pmu)
{
	int ret = armv8_pmu_init(cpu_pmu);
	if (ret)
		return ret;

	cpu_pmu->name			= "armv8_cortex_a35";
	cpu_pmu->map_event		= armv8_a53_map_event;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] =
		&armv8_pmuv3_events_attr_group;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] =
		&armv8_pmuv3_format_attr_group;

	return 0;
	return armv8_pmu_init(cpu_pmu, "armv8_cortex_a35",
			      armv8_a53_map_event, NULL, NULL);
}

static int armv8_a53_pmu_init(struct arm_pmu *cpu_pmu)
{
	int ret = armv8_pmu_init(cpu_pmu);
	if (ret)
		return ret;

	cpu_pmu->name			= "armv8_cortex_a53";
	cpu_pmu->map_event		= armv8_a53_map_event;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] =
		&armv8_pmuv3_events_attr_group;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] =
		&armv8_pmuv3_format_attr_group;
	return armv8_pmu_init(cpu_pmu, "armv8_cortex_a53",
			      armv8_a53_map_event, NULL, NULL);
}

	return 0;
static int armv8_a55_pmu_init(struct arm_pmu *cpu_pmu)
{
	return armv8_pmu_init(cpu_pmu, "armv8_cortex_a55",
			      armv8_pmuv3_map_event, NULL, NULL);
}

static int armv8_a57_pmu_init(struct arm_pmu *cpu_pmu)
{
	int ret = armv8_pmu_init(cpu_pmu);
	if (ret)
		return ret;

	cpu_pmu->name			= "armv8_cortex_a57";
	cpu_pmu->map_event		= armv8_a57_map_event;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] =
		&armv8_pmuv3_events_attr_group;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] =
		&armv8_pmuv3_format_attr_group;
	return armv8_pmu_init(cpu_pmu, "armv8_cortex_a57",
			      armv8_a57_map_event, NULL, NULL);
}

	return 0;
static int armv8_a65_pmu_init(struct arm_pmu *cpu_pmu)
{
	return armv8_pmu_init(cpu_pmu, "armv8_cortex_a65",
			      armv8_pmuv3_map_event, NULL, NULL);
}

static int armv8_a72_pmu_init(struct arm_pmu *cpu_pmu)
{
	int ret = armv8_pmu_init(cpu_pmu);
	if (ret)
		return ret;

	cpu_pmu->name			= "armv8_cortex_a72";
	cpu_pmu->map_event		= armv8_a57_map_event;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] =
		&armv8_pmuv3_events_attr_group;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] =
		&armv8_pmuv3_format_attr_group;

	return 0;
	return armv8_pmu_init(cpu_pmu, "armv8_cortex_a72",
			      armv8_a57_map_event, NULL, NULL);
}

static int armv8_a73_pmu_init(struct arm_pmu *cpu_pmu)
{
	int ret = armv8_pmu_init(cpu_pmu);
	if (ret)
		return ret;

	cpu_pmu->name			= "armv8_cortex_a73";
	cpu_pmu->map_event		= armv8_a73_map_event;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] =
		&armv8_pmuv3_events_attr_group;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] =
		&armv8_pmuv3_format_attr_group;
	return armv8_pmu_init(cpu_pmu, "armv8_cortex_a73",
			      armv8_a73_map_event, NULL, NULL);
}

	return 0;
static int armv8_a75_pmu_init(struct arm_pmu *cpu_pmu)
{
	return armv8_pmu_init(cpu_pmu, "armv8_cortex_a75",
			      armv8_pmuv3_map_event, NULL, NULL);
}

static int armv8_thunder_pmu_init(struct arm_pmu *cpu_pmu)
static int armv8_a76_pmu_init(struct arm_pmu *cpu_pmu)
{
	int ret = armv8_pmu_init(cpu_pmu);
	if (ret)
		return ret;
	return armv8_pmu_init(cpu_pmu, "armv8_cortex_a76",
			      armv8_pmuv3_map_event, NULL, NULL);
}

	cpu_pmu->name			= "armv8_cavium_thunder";
	cpu_pmu->map_event		= armv8_thunder_map_event;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] =
		&armv8_pmuv3_events_attr_group;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] =
		&armv8_pmuv3_format_attr_group;
static int armv8_a77_pmu_init(struct arm_pmu *cpu_pmu)
{
	return armv8_pmu_init(cpu_pmu, "armv8_cortex_a77",
			      armv8_pmuv3_map_event, NULL, NULL);
}

	return 0;
static int armv8_e1_pmu_init(struct arm_pmu *cpu_pmu)
{
	return armv8_pmu_init(cpu_pmu, "armv8_neoverse_e1",
			      armv8_pmuv3_map_event, NULL, NULL);
}

static int armv8_vulcan_pmu_init(struct arm_pmu *cpu_pmu)
static int armv8_n1_pmu_init(struct arm_pmu *cpu_pmu)
{
	int ret = armv8_pmu_init(cpu_pmu);
	if (ret)
		return ret;
	return armv8_pmu_init(cpu_pmu, "armv8_neoverse_n1",
			      armv8_pmuv3_map_event, NULL, NULL);
}

	cpu_pmu->name			= "armv8_brcm_vulcan";
	cpu_pmu->map_event		= armv8_vulcan_map_event;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] =
		&armv8_pmuv3_events_attr_group;
	cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] =
		&armv8_pmuv3_format_attr_group;
static int armv8_thunder_pmu_init(struct arm_pmu *cpu_pmu)
{
	return armv8_pmu_init(cpu_pmu, "armv8_cavium_thunder",
			      armv8_thunder_map_event, NULL, NULL);
}

	return 0;
static int armv8_vulcan_pmu_init(struct arm_pmu *cpu_pmu)
{
	return armv8_pmu_init(cpu_pmu, "armv8_brcm_vulcan",
			      armv8_vulcan_map_event, NULL, NULL);
}

static const struct of_device_id armv8_pmu_of_device_ids[] = {
	{.compatible = "arm,armv8-pmuv3",	.data = armv8_pmuv3_init},
	{.compatible = "arm,cortex-a34-pmu",	.data = armv8_a34_pmu_init},
	{.compatible = "arm,cortex-a35-pmu",	.data = armv8_a35_pmu_init},
	{.compatible = "arm,cortex-a53-pmu",	.data = armv8_a53_pmu_init},
	{.compatible = "arm,cortex-a55-pmu",	.data = armv8_a55_pmu_init},
	{.compatible = "arm,cortex-a57-pmu",	.data = armv8_a57_pmu_init},
	{.compatible = "arm,cortex-a65-pmu",	.data = armv8_a65_pmu_init},
	{.compatible = "arm,cortex-a72-pmu",	.data = armv8_a72_pmu_init},
	{.compatible = "arm,cortex-a73-pmu",	.data = armv8_a73_pmu_init},
	{.compatible = "arm,cortex-a75-pmu",	.data = armv8_a75_pmu_init},
	{.compatible = "arm,cortex-a76-pmu",	.data = armv8_a76_pmu_init},
	{.compatible = "arm,cortex-a77-pmu",	.data = armv8_a77_pmu_init},
	{.compatible = "arm,neoverse-e1-pmu",	.data = armv8_e1_pmu_init},
	{.compatible = "arm,neoverse-n1-pmu",	.data = armv8_n1_pmu_init},
	{.compatible = "cavium,thunder-pmu",	.data = armv8_thunder_pmu_init},
	{.compatible = "brcm,vulcan-pmu",	.data = armv8_vulcan_pmu_init},
	{},
+2 −0
Original line number Diff line number Diff line
@@ -67,3 +67,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_regs);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_wq_lockup_pool);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sysrq_crash);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_busiest_group);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_map_util_freq);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_em_pd_energy);
+86 −37
Original line number Diff line number Diff line
@@ -200,6 +200,7 @@ static struct mu3h_sch_ep_info *create_sch_ep(struct usb_device *udev,

	sch_ep->sch_tt = tt;
	sch_ep->ep = ep;
	INIT_LIST_HEAD(&sch_ep->tt_endpoint);

	return sch_ep;
}
@@ -583,6 +584,8 @@ int xhci_mtk_sch_init(struct xhci_hcd_mtk *mtk)

	mtk->sch_array = sch_array;

	INIT_LIST_HEAD(&mtk->bw_ep_list_new);

	return 0;
}
EXPORT_SYMBOL_GPL(xhci_mtk_sch_init);
@@ -601,19 +604,14 @@ int xhci_mtk_add_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev,
	struct xhci_ep_ctx *ep_ctx;
	struct xhci_slot_ctx *slot_ctx;
	struct xhci_virt_device *virt_dev;
	struct mu3h_sch_bw_info *sch_bw;
	struct mu3h_sch_ep_info *sch_ep;
	struct mu3h_sch_bw_info *sch_array;
	unsigned int ep_index;
	int bw_index;
	int ret = 0;

	xhci = hcd_to_xhci(hcd);
	virt_dev = xhci->devs[udev->slot_id];
	ep_index = xhci_get_endpoint_index(&ep->desc);
	slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->in_ctx);
	ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index);
	sch_array = mtk->sch_array;

	xhci_dbg(xhci, "%s() type:%d, speed:%d, mpkt:%d, dir:%d, ep:%p\n",
		__func__, usb_endpoint_type(&ep->desc), udev->speed,
@@ -632,39 +630,34 @@ int xhci_mtk_add_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev,
		return 0;
	}

	bw_index = get_bw_index(xhci, udev, ep);
	sch_bw = &sch_array[bw_index];

	sch_ep = create_sch_ep(udev, ep, ep_ctx);
	if (IS_ERR_OR_NULL(sch_ep))
		return -ENOMEM;

	setup_sch_info(udev, ep_ctx, sch_ep);

	ret = check_sch_bw(udev, sch_bw, sch_ep);
	if (ret) {
		xhci_err(xhci, "Not enough bandwidth!\n");
		if (is_fs_or_ls(udev->speed))
			drop_tt(udev);
	list_add_tail(&sch_ep->endpoint, &mtk->bw_ep_list_new);

		kfree(sch_ep);
		return -ENOSPC;
	return 0;
}
EXPORT_SYMBOL_GPL(xhci_mtk_add_ep_quirk);

	list_add_tail(&sch_ep->endpoint, &sch_bw->bw_ep_list);

	ep_ctx->reserved[0] |= cpu_to_le32(EP_BPKTS(sch_ep->pkts)
		| EP_BCSCOUNT(sch_ep->cs_count) | EP_BBM(sch_ep->burst_mode));
	ep_ctx->reserved[1] |= cpu_to_le32(EP_BOFFSET(sch_ep->offset)
		| EP_BREPEAT(sch_ep->repeat));
static void xhci_mtk_drop_ep(struct xhci_hcd_mtk *mtk, struct usb_device *udev,
			     struct mu3h_sch_ep_info *sch_ep)
{
	struct xhci_hcd *xhci = hcd_to_xhci(mtk->hcd);
	int bw_index = get_bw_index(xhci, udev, sch_ep->ep);
	struct mu3h_sch_bw_info *sch_bw = &mtk->sch_array[bw_index];

	xhci_dbg(xhci, " PKTS:%x, CSCOUNT:%x, BM:%x, OFFSET:%x, REPEAT:%x\n",
			sch_ep->pkts, sch_ep->cs_count, sch_ep->burst_mode,
			sch_ep->offset, sch_ep->repeat);
	update_bus_bw(sch_bw, sch_ep, 0);
	list_del(&sch_ep->endpoint);

	return 0;
	if (sch_ep->sch_tt) {
		list_del(&sch_ep->tt_endpoint);
		drop_tt(udev);
	}
	kfree(sch_ep);
}
EXPORT_SYMBOL_GPL(xhci_mtk_add_ep_quirk);

void xhci_mtk_drop_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev,
		struct usb_host_endpoint *ep)
@@ -675,7 +668,7 @@ void xhci_mtk_drop_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev,
	struct xhci_virt_device *virt_dev;
	struct mu3h_sch_bw_info *sch_array;
	struct mu3h_sch_bw_info *sch_bw;
	struct mu3h_sch_ep_info *sch_ep;
	struct mu3h_sch_ep_info *sch_ep, *tmp;
	int bw_index;

	xhci = hcd_to_xhci(hcd);
@@ -694,17 +687,73 @@ void xhci_mtk_drop_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev,
	bw_index = get_bw_index(xhci, udev, ep);
	sch_bw = &sch_array[bw_index];

	list_for_each_entry(sch_ep, &sch_bw->bw_ep_list, endpoint) {
	list_for_each_entry_safe(sch_ep, tmp, &sch_bw->bw_ep_list, endpoint) {
		if (sch_ep->ep == ep) {
			update_bus_bw(sch_bw, sch_ep, 0);
			list_del(&sch_ep->endpoint);
			if (is_fs_or_ls(udev->speed)) {
				list_del(&sch_ep->tt_endpoint);
				drop_tt(udev);
			}
			kfree(sch_ep);
			break;
			xhci_mtk_drop_ep(mtk, udev, sch_ep);
		}
	}
}
EXPORT_SYMBOL_GPL(xhci_mtk_drop_ep_quirk);

int xhci_mtk_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
{
	struct xhci_hcd_mtk *mtk = hcd_to_mtk(hcd);
	struct xhci_hcd *xhci = hcd_to_xhci(hcd);
	struct xhci_virt_device *virt_dev = xhci->devs[udev->slot_id];
	struct mu3h_sch_bw_info *sch_bw;
	struct mu3h_sch_ep_info *sch_ep, *tmp;
	int bw_index, ret;

	dev_dbg(&udev->dev, "%s\n", __func__);

	list_for_each_entry(sch_ep, &mtk->bw_ep_list_new, endpoint) {
		bw_index = get_bw_index(xhci, udev, sch_ep->ep);
		sch_bw = &mtk->sch_array[bw_index];

		ret = check_sch_bw(udev, sch_bw, sch_ep);
		if (ret) {
			xhci_err(xhci, "Not enough bandwidth!\n");
			return -ENOSPC;
		}
	}

	list_for_each_entry_safe(sch_ep, tmp, &mtk->bw_ep_list_new, endpoint) {
		struct xhci_ep_ctx *ep_ctx;
		struct usb_host_endpoint *ep = sch_ep->ep;
		unsigned int ep_index = xhci_get_endpoint_index(&ep->desc);

		bw_index = get_bw_index(xhci, udev, ep);
		sch_bw = &mtk->sch_array[bw_index];

		list_move_tail(&sch_ep->endpoint, &sch_bw->bw_ep_list);

		ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index);
		ep_ctx->reserved[0] |= cpu_to_le32(EP_BPKTS(sch_ep->pkts)
			| EP_BCSCOUNT(sch_ep->cs_count)
			| EP_BBM(sch_ep->burst_mode));
		ep_ctx->reserved[1] |= cpu_to_le32(EP_BOFFSET(sch_ep->offset)
			| EP_BREPEAT(sch_ep->repeat));

		xhci_dbg(xhci, " PKTS:%x, CSCOUNT:%x, BM:%x, OFFSET:%x, REPEAT:%x\n",
			sch_ep->pkts, sch_ep->cs_count, sch_ep->burst_mode,
			sch_ep->offset, sch_ep->repeat);
	}

	return xhci_check_bandwidth(hcd, udev);
}
EXPORT_SYMBOL_GPL(xhci_mtk_check_bandwidth);

void xhci_mtk_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
{
	struct xhci_hcd_mtk *mtk = hcd_to_mtk(hcd);
	struct mu3h_sch_ep_info *sch_ep, *tmp;

	dev_dbg(&udev->dev, "%s\n", __func__);

	list_for_each_entry_safe(sch_ep, tmp, &mtk->bw_ep_list_new, endpoint) {
		xhci_mtk_drop_ep(mtk, udev, sch_ep);
	}

	xhci_reset_bandwidth(hcd, udev);
}
EXPORT_SYMBOL_GPL(xhci_mtk_reset_bandwidth);
Loading