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

Commit b530a0fe authored by yungwenpeng's avatar yungwenpeng
Browse files

Merge branch release into fairphone

* ssh://ch-git3.arimacomm.com.tw:29418/kernel/msm-4.9:
  ALSA: timer: Fix incorrectly assigned timer instance
  Input: ff-memless - kill timer in destroy()
  HID: Fix assumption that devices have inputs
  Fix android.security.sts.Poc19_02#testPocCVE_2018_13900
  The ramp steps and timing of LED breath display modified
  msm: kgsl: Check user generated timestamp before queuing drawobjs
  msm: kgsl: Disable deprecated ioctls
  usb: gadget: core: unmap request from DMA only if previously mapped
  USB: core: Fix races in character device registration and deregistraion
  HID: hiddev: avoid opening a disconnected device
  HID: hiddev: do cleanup in failure of opening a device
  tcp: Clear sk_send_head after purging the write queue

Change-Id: I2a3e3b5805e44fe01bd4c294f4b38e5317aaf8da
parents 3224bdc8 c1b7eb8f
Loading
Loading
Loading
Loading
+50 −0
Original line number Diff line number Diff line
@@ -581,30 +581,80 @@
			nvmem = <&pmi632_sdam7>;
			qcom,pbs-client = <&pmi632_pbs_client3>;
			qcom,lut-sdam-base = <0x80>;
		//<2019/10/25-Yuting Shih.[FAIRPHONE][MISC][COMMON][LED][][]Modified for breath ramp and timing.
		#if 1
			qcom,lut-patterns = <0 0 0 0 0 0 0 0 0 0 2 16 30 44 58 72 86 100 100
						100 100 86 72 58 44 30 16 2 0 0 0 0 0 0 0 0 0 0>;
		#else
			/* Code default */
			qcom,lut-patterns = <0 0 0 14 28 42 56 70 84 100
						100 84 70 56 42 28 14 0 0 0>;
		#endif
		//>2019/10/25-Yuting Shih.[FAIRPHONE][MISC][COMMON][LED][][].
			lpg@1 {
				qcom,lpg-chan-id = <1>;
		//<2019/10/25-Yuting Shih.[FAIRPHONE][MISC][COMMON][LED][][]Modified for breath ramp and timing.
		#if 1
				qcom,ramp-step-ms = <80>;
				qcom,ramp-pause-hi-count = <80>;
				qcom,ramp-pause-lo-count = <80>;
				qcom,ramp-low-index = <0>;
				qcom,ramp-high-index = <37>;
				//qcom,ramp-toggle; /* ramp from high to low */
				//qcom,ramp-from-low-to-high;
				qcom,ramp-pattern-repeat;
		#else
			/* Code default */
				qcom,ramp-step-ms = <200>;
				qcom,ramp-low-index = <0>;
				qcom,ramp-high-index = <19>;
				qcom,ramp-pattern-repeat;
		#endif
		//>2019/10/25-Yuting Shih.[FAIRPHONE][MISC][COMMON][LED][][].
				qcom,lpg-sdam-base = <0x48>;
			};
			lpg@2 {
				qcom,lpg-chan-id = <2>;
		//<2019/10/25-Yuting Shih.[FAIRPHONE][MISC][COMMON][LED][][]Modified for breath ramp and timing.
		#if 1
				qcom,ramp-step-ms = <80>;
				qcom,ramp-pause-hi-count = <80>;
				qcom,ramp-pause-lo-count = <80>;
				qcom,ramp-low-index = <0>;
				qcom,ramp-high-index = <37>;
				//qcom,ramp-toggle; /* ramp from high to low */
				//qcom,ramp-from-low-to-high;
				qcom,ramp-pattern-repeat;
		#else
			/* Code default */
				qcom,ramp-step-ms = <200>;
				qcom,ramp-low-index = <0>;
				qcom,ramp-high-index = <19>;
				qcom,ramp-pattern-repeat;
		#endif
		//>2019/10/25-Yuting Shih.[FAIRPHONE][MISC][COMMON][LED][][].
				qcom,lpg-sdam-base = <0x56>;
			};
			lpg@3 {
				qcom,lpg-chan-id = <3>;
		//<2019/10/25-Yuting Shih.[FAIRPHONE][MISC][COMMON][LED][][]Modified for breath ramp and timing.
		#if 1
				qcom,ramp-step-ms = <80>;
				qcom,ramp-pause-hi-count = <80>;
				qcom,ramp-pause-lo-count = <80>;
				qcom,ramp-low-index = <0>;
				qcom,ramp-high-index = <37>;
				//qcom,ramp-toggle; /* ramp from high to low */
				//qcom,ramp-from-low-to-high;
				qcom,ramp-pattern-repeat;
		#else
			/* Code default */
				qcom,ramp-step-ms = <200>;
				qcom,ramp-low-index = <0>;
				qcom,ramp-high-index = <19>;
				qcom,ramp-pattern-repeat;
		#endif
		//>2019/10/25-Yuting Shih.[FAIRPHONE][MISC][COMMON][LED][][].
				qcom,lpg-sdam-base = <0x64>;
			};
		};
+17 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2019, 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
@@ -1411,6 +1411,22 @@ int adreno_dispatcher_queue_cmds(struct kgsl_device_private *dev_priv,

	user_ts = *timestamp;

	/*
	 * If there is only one drawobj in the array and it is of
	 * type SYNCOBJ_TYPE, skip comparing user_ts as it can be 0
	 */
	if (!(count == 1 && drawobj[0]->type == SYNCOBJ_TYPE) &&
		(drawctxt->base.flags & KGSL_CONTEXT_USER_GENERATED_TS)) {
		/*
		 * User specified timestamps need to be greater than the last
		 * issued timestamp in the context
		 */
		if (timestamp_cmp(drawctxt->timestamp, user_ts) >= 0) {
			spin_unlock(&drawctxt->lock);
			return -ERANGE;
		}
	}

	for (i = 0; i < count; i++) {

		switch (drawobj[i]->type) {
+26 −0
Original line number Diff line number Diff line
@@ -3337,12 +3337,16 @@ long kgsl_ioctl_sparse_phys_alloc(struct kgsl_device_private *dev_priv,
	unsigned int cmd, void *data)
{
	struct kgsl_process_private *process = dev_priv->process_priv;
	struct kgsl_device *device = dev_priv->device;
	struct kgsl_sparse_phys_alloc *param = data;
	struct kgsl_mem_entry *entry;
	uint64_t flags;
	int ret;
	int id;

	if (!(device->flags & KGSL_FLAG_SPARSE))
		return -ENOTSUPP;

	ret = _sparse_alloc_param_sanity_check(param->size, param->pagesize);
	if (ret)
		return ret;
@@ -3422,9 +3426,13 @@ long kgsl_ioctl_sparse_phys_free(struct kgsl_device_private *dev_priv,
	unsigned int cmd, void *data)
{
	struct kgsl_process_private *process = dev_priv->process_priv;
	struct kgsl_device *device = dev_priv->device;
	struct kgsl_sparse_phys_free *param = data;
	struct kgsl_mem_entry *entry;

	if (!(device->flags & KGSL_FLAG_SPARSE))
		return -ENOTSUPP;

	entry = kgsl_sharedmem_find_id_flags(process, param->id,
			KGSL_MEMFLAGS_SPARSE_PHYS);
	if (entry == NULL)
@@ -3454,10 +3462,14 @@ long kgsl_ioctl_sparse_virt_alloc(struct kgsl_device_private *dev_priv,
	unsigned int cmd, void *data)
{
	struct kgsl_process_private *private = dev_priv->process_priv;
	struct kgsl_device *device = dev_priv->device;
	struct kgsl_sparse_virt_alloc *param = data;
	struct kgsl_mem_entry *entry;
	int ret;

	if (!(device->flags & KGSL_FLAG_SPARSE))
		return -ENOTSUPP;

	ret = _sparse_alloc_param_sanity_check(param->size, param->pagesize);
	if (ret)
		return ret;
@@ -3498,9 +3510,13 @@ long kgsl_ioctl_sparse_virt_free(struct kgsl_device_private *dev_priv,
	unsigned int cmd, void *data)
{
	struct kgsl_process_private *process = dev_priv->process_priv;
	struct kgsl_device *device = dev_priv->device;
	struct kgsl_sparse_virt_free *param = data;
	struct kgsl_mem_entry *entry = NULL;

	if (!(device->flags & KGSL_FLAG_SPARSE))
		return -ENOTSUPP;

	entry = kgsl_sharedmem_find_id_flags(process, param->id,
			KGSL_MEMFLAGS_SPARSE_VIRT);
	if (entry == NULL)
@@ -3847,6 +3863,7 @@ long kgsl_ioctl_sparse_bind(struct kgsl_device_private *dev_priv,
		unsigned int cmd, void *data)
{
	struct kgsl_process_private *private = dev_priv->process_priv;
	struct kgsl_device *device = dev_priv->device;
	struct kgsl_sparse_bind *param = data;
	struct kgsl_sparse_binding_object obj;
	struct kgsl_mem_entry *virt_entry;
@@ -3855,6 +3872,9 @@ long kgsl_ioctl_sparse_bind(struct kgsl_device_private *dev_priv,
	int ret = 0;
	int i = 0;

	if (!(device->flags & KGSL_FLAG_SPARSE))
		return -ENOTSUPP;

	ptr = (void __user *) (uintptr_t) param->list;

	if (param->size > sizeof(struct kgsl_sparse_binding_object) ||
@@ -3910,6 +3930,9 @@ long kgsl_ioctl_gpu_sparse_command(struct kgsl_device_private *dev_priv,
	long result;
	unsigned int i = 0;

	if (!(device->flags & KGSL_FLAG_SPARSE))
		return -ENOTSUPP;

	/* Make sure sparse and syncpoint count isn't too big */
	if (param->numsparse > KGSL_MAX_SPARSE ||
		param->numsyncs > KGSL_MAX_SYNCPOINTS)
@@ -4665,6 +4688,9 @@ int kgsl_device_platform_probe(struct kgsl_device *device)
	/* Initialize logging first, so that failures below actually print. */
	kgsl_device_debugfs_init(device);

	/* Disable the sparse ioctl invocation as they are not used */
	device->flags &= ~KGSL_FLAG_SPARSE;

	status = kgsl_pwrctrl_init(device);
	if (status)
		goto error;
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2002,2007-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2002,2007-2019, 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
@@ -66,6 +66,7 @@ enum kgsl_event_results {
};

#define KGSL_FLAG_WAKE_ON_TOUCH BIT(0)
#define KGSL_FLAG_SPARSE        BIT(1)

/*
 * "list" of event types for ftrace symbolic magic
+9 −2
Original line number Diff line number Diff line
@@ -75,13 +75,20 @@ static int axff_init(struct hid_device *hid)
{
	struct axff_device *axff;
	struct hid_report *report;
	struct hid_input *hidinput = list_first_entry(&hid->inputs, struct hid_input, list);
	struct hid_input *hidinput;
	struct list_head *report_list =&hid->report_enum[HID_OUTPUT_REPORT].report_list;
	struct input_dev *dev = hidinput->input;
	struct input_dev *dev;
	int field_count = 0;
	int i, j;
	int error;

	if (list_empty(&hid->inputs)) {
		hid_err(hid, "no inputs found\n");
		return -ENODEV;
	}
	hidinput = list_first_entry(&hid->inputs, struct hid_input, list);
	dev = hidinput->input;

	if (list_empty(report_list)) {
		hid_err(hid, "no output reports found\n");
		return -ENODEV;
Loading