Skip to content

Commit

Permalink
Merge branch 'QK-eleven' into upstreamed-common
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Ayrton Lopez Arroyo <[email protected]>

# Conflicts:
#	drivers/soc/qcom/smp2p.c
#	net/ipv4/tcp.c
  • Loading branch information
Official-Ayrton990 committed Dec 5, 2021
2 parents 764ef93 + ab202aa commit 4e61523
Show file tree
Hide file tree
Showing 23 changed files with 325 additions and 132 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,20 +208,17 @@

qcom,mdss-dsi-dispparam-hbm-fod-on-command = [
39 00 00 00 00 00 03 F0 5A 5A
/* elvss dimming off */
39 00 00 00 00 00 02 B0 07
39 00 00 00 00 00 02 B7 51
39 01 00 00 00 00 03 F0 A5 A5
/* HBM on */
39 01 00 00 01 00 02 53 E0];
39 00 00 00 00 00 02 B0 03
39 00 00 00 00 00 02 B7 C9
39 00 00 00 00 00 03 F0 A5 A5
39 01 00 00 10 00 02 53 E0];
qcom,mdss-dsi-dispparam-hbm-fod-on-command-state = "dsi_hs_mode";
qcom,mdss-dsi-dispparam-hbm-fod-off-command = [
15 01 00 00 10 00 02 53 20
39 00 00 00 00 00 03 F0 5A 5A
/* elvss dimming on */
39 00 00 00 00 00 02 B0 07
39 00 00 00 00 00 02 B7 D1
39 01 00 00 00 00 03 F0 A5 A5];
39 00 00 00 00 00 02 B0 03
39 00 00 00 00 00 02 B7 C9
39 00 00 00 00 00 03 F0 A5 A5
39 01 00 00 10 00 02 53 20];
qcom,mdss-dsi-dispparam-hbm-fod-off-command-state = "dsi_hs_mode";

mi,mdss-dsi-hbm-off-command = [
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/configs/vendor/alioth_defconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG_LOCALVERSION="~Quantic"
CONFIG_LOCALVERSION="~Quantic-Re:Volution"
# CONFIG_AUDIT is not set
CONFIG_NO_HZ=y
CONFIG_HZ_100=y
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/configs/vendor/apollo_defconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG_LOCALVERSION="~Quantic"
CONFIG_LOCALVERSION="~Quantic-Re:Volution"
# CONFIG_AUDIT is not set
CONFIG_NO_HZ=y
CONFIG_HZ_100=y
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/configs/vendor/cmi_defconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG_LOCALVERSION="~Quantic"
CONFIG_LOCALVERSION="~Quantic-Re:Volution"
# CONFIG_AUDIT is not set
CONFIG_NO_HZ=y
CONFIG_HZ_100=y
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/configs/vendor/lmi_defconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG_LOCALVERSION="~Quantic"
CONFIG_LOCALVERSION="~Quantic-Re:Volution"
# CONFIG_AUDIT is not set
CONFIG_NO_HZ=y
CONFIG_HZ_100=y
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/configs/vendor/thyme_defconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG_LOCALVERSION="~Quantic"
CONFIG_LOCALVERSION="~Quantic-Re:Volution"
# CONFIG_AUDIT is not set
CONFIG_NO_HZ=y
CONFIG_HZ_100=y
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/configs/vendor/umi_defconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG_LOCALVERSION="~Quantic"
CONFIG_LOCALVERSION="~Quantic-Re:Volution"
# CONFIG_AUDIT is not set
CONFIG_NO_HZ=y
CONFIG_HZ_100=y
Expand Down
4 changes: 2 additions & 2 deletions drivers/android/binder.c
Original file line number Diff line number Diff line change
Expand Up @@ -5034,7 +5034,7 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)

if (copy_from_user(&max_threads, ubuf,
sizeof(max_threads))) {
ret = -EINVAL;
ret = -EFAULT;
goto err;
}
binder_inner_proc_lock(proc);
Expand All @@ -5046,7 +5046,7 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
struct flat_binder_object fbo;

if (copy_from_user(&fbo, ubuf, sizeof(fbo))) {
ret = -EINVAL;
ret = -EFAULT;
goto err;
}
ret = binder_ioctl_set_ctx_mgr(filp, &fbo);
Expand Down
56 changes: 56 additions & 0 deletions drivers/input/fingerprint/fpc_tee/fpc1020_tee.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
#include <linux/regulator/consumer.h>
#include <linux/pm_wakeup.h>
#include <linux/fb.h>
#include <drm/drm_bridge.h>
#include <linux/pinctrl/qcom-pinctrl.h>
#include <drm/drm_notifier_mi.h>

#define FPC_GPIO_NO_DEFAULT -1
#define FPC_GPIO_NO_DEFINED -2
Expand Down Expand Up @@ -113,6 +115,8 @@ struct fpc1020_data {

atomic_t wakeup_enabled; /* Used both in ISR and non-ISR */
int irqf;
struct notifier_block fb_notifier;
bool fb_black;
};

static int reset_gpio_res(struct fpc1020_data *fpc1020);
Expand Down Expand Up @@ -847,6 +851,58 @@ static int fpc1020_request_named_gpio(struct fpc1020_data *fpc1020,
return 0;
}

static void set_fingerprintd_nice(int nice)
{
struct task_struct *p;

read_lock(&tasklist_lock);
for_each_process(p) {
if (strstr(p->comm, "erprint"))
set_user_nice(p, nice);
}
read_unlock(&tasklist_lock);
}

static int fpc_fb_notif_callback(struct notifier_block *nb,
unsigned long val, void *data)
{
struct fpc1020_data *fpc1020 = container_of(nb, struct fpc1020_data,
fb_notifier);
struct fb_event *evdata = data;
unsigned int blank;

if (!fpc1020)
return 0;

if (val != MI_DRM_EVENT_BLANK )
return 0;

printk("hml [info] %s value = %d\n", __func__, (int)val);

if (evdata && evdata->data && val == MI_DRM_EVENT_BLANK) {
blank = *(int *)(evdata->data);
switch (blank) {
case MI_DRM_BLANK_POWERDOWN:
set_fingerprintd_nice(MIN_NICE);
fpc1020->fb_black = true;
break;
case MI_DRM_BLANK_UNBLANK:
set_fingerprintd_nice(0);
fpc1020->fb_black = false;
break;
default:
printk("%s defalut\n", __func__);
break;
}
}
return NOTIFY_OK;
}


static struct notifier_block fpc_notif_block = {
.notifier_call = fpc_fb_notif_callback,
};

static int fpc1020_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
Expand Down
14 changes: 7 additions & 7 deletions drivers/input/fingerprint/goodix_fod_lmi/gf_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#include <linux/pm_wakeup.h>
#include <drm/drm_bridge.h>
#ifndef GOODIX_DRM_INTERFACE_WA
#include <drm/drm_notifier.h>
#include <drm/drm_notifier_mi.h>
#endif

#include "gf_spi.h"
Expand Down Expand Up @@ -730,7 +730,7 @@ static int goodix_fb_state_chg_callback(struct notifier_block *nb,
unsigned int blank;
char temp[4] = { 0x0 };

if (val != DRM_EVENT_BLANK) {
if (val != MI_DRM_EVENT_BLANK) {
return 0;
}

Expand All @@ -739,11 +739,11 @@ static int goodix_fb_state_chg_callback(struct notifier_block *nb,
__func__, (int)val);
gf_dev = container_of(nb, struct gf_dev, notifier);

if (evdata && evdata->data && val == DRM_EVENT_BLANK && gf_dev) {
if (evdata && evdata->data && val == MI_DRM_EVENT_BLANK && gf_dev) {
blank = *(int *)(evdata->data);

switch (blank) {
case DRM_BLANK_POWERDOWN:
case MI_DRM_BLANK_POWERDOWN:
if (gf_dev->device_available == 1) {
gf_dev->fb_black = 1;
gf_dev->wait_finger_down = true;
Expand All @@ -760,7 +760,7 @@ static int goodix_fb_state_chg_callback(struct notifier_block *nb,
}
break;

case DRM_BLANK_UNBLANK:
case MI_DRM_BLANK_UNBLANK:
if (gf_dev->device_available == 1) {
gf_dev->fb_black = 0;
#if defined(GF_NETLINK_ENABLE)
Expand Down Expand Up @@ -891,7 +891,7 @@ static int gf_probe(struct platform_device *pdev)
#endif
#ifndef GOODIX_DRM_INTERFACE_WA
gf_dev->notifier = goodix_noti_block;
drm_register_client(&gf_dev->notifier);
mi_drm_register_client(&gf_dev->notifier);
#endif
gf_dev->irq = gf_irq_num(gf_dev);
fp_wakelock = wakeup_source_register(&gf_dev->spi->dev, "fp_wakelock");
Expand Down Expand Up @@ -955,7 +955,7 @@ static int gf_remove(struct platform_device *pdev)
gf_cleanup(gf_dev);
}
#ifndef GOODIX_DRM_INTERFACE_WA
drm_unregister_client(&gf_dev->notifier);
mi_drm_unregister_client(&gf_dev->notifier);
#endif
mutex_unlock(&device_list_lock);
return 0;
Expand Down
13 changes: 9 additions & 4 deletions drivers/soc/qcom/smp2p.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,7 @@ struct qcom_smp2p {
static void *ilc;
#define SMP2P_LOG_PAGE_CNT 2
#define SMP2P_INFO(x, ...) \
do { \
if (ilc) \
ipc_log_string(ilc, "[%s]: "x, __func__, ##__VA_ARGS__); \
} while (0)
ipc_log_string(ilc, "[%s]: "x, __func__, ##__VA_ARGS__)

static void qcom_smp2p_kick(struct qcom_smp2p *smp2p)
{
Expand Down Expand Up @@ -275,6 +272,9 @@ static void qcom_smp2p_notify_in(struct qcom_smp2p *smp2p)

status = val ^ entry->last_value;
entry->last_value = val;

/* Ensure irq_pending is read correctly */
mb();
status |= *entry->irq_pending;

/* No changes of this entry? */
Expand Down Expand Up @@ -396,6 +396,11 @@ static int smp2p_retrigger_irq(struct irq_data *irqd)
SMP2P_INFO("%d: %s: %lu\n", entry->smp2p->remote_pid, entry->name, irq);
set_bit(irq, entry->irq_pending);

/* Ensure irq_pending is visible to all cpus that retried interrupt
* can run on
*/
mb();

return 0;
}

Expand Down
3 changes: 3 additions & 0 deletions include/linux/rwsem.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ static inline int rwsem_is_contended(struct rw_semaphore *sem)
* lock for reading
*/
extern void down_read(struct rw_semaphore *sem);
extern int __must_check down_read_interruptible(struct rw_semaphore *sem);
extern int __must_check down_read_killable(struct rw_semaphore *sem);

/*
Expand Down Expand Up @@ -173,6 +174,7 @@ extern void downgrade_write(struct rw_semaphore *sem);
* See Documentation/locking/lockdep-design.txt for more details.)
*/
extern void down_read_nested(struct rw_semaphore *sem, int subclass);
extern int __must_check down_read_killable_nested(struct rw_semaphore *sem, int subclass);
extern void down_write_nested(struct rw_semaphore *sem, int subclass);
extern int down_write_killable_nested(struct rw_semaphore *sem, int subclass);
extern void _down_write_nest_lock(struct rw_semaphore *sem, struct lockdep_map *nest_lock);
Expand All @@ -193,6 +195,7 @@ extern void down_read_non_owner(struct rw_semaphore *sem);
extern void up_read_non_owner(struct rw_semaphore *sem);
#else
# define down_read_nested(sem, subclass) down_read(sem)
# define down_read_killable_nested(sem, subclass) down_read_killable(sem)
# define down_write_nest_lock(sem, nest_lock) down_write(sem)
# define down_write_nested(sem, subclass) down_write(sem)
# define down_write_killable_nested(sem, subclass) down_write_killable(sem)
Expand Down
2 changes: 2 additions & 0 deletions include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <linux/splice.h>
#include <linux/in6.h>
#include <linux/if_packet.h>
#include <linux/llist.h>
#include <net/flow.h>

/* The interface for checksum offload between the stack and networking drivers
Expand Down Expand Up @@ -679,6 +680,7 @@ struct sk_buff {
};
struct rb_node rbnode; /* used in netem, ip4 defrag, and tcp stack */
struct list_head list;
struct llist_node ll_node;
};

union {
Expand Down
12 changes: 3 additions & 9 deletions include/net/ip6_checksum.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,9 @@ static inline void __tcp_v6_send_check(struct sk_buff *skb,
{
struct tcphdr *th = tcp_hdr(skb);

if (skb->ip_summed == CHECKSUM_PARTIAL) {
th->check = ~tcp_v6_check(skb->len, saddr, daddr, 0);
skb->csum_start = skb_transport_header(skb) - skb->head;
skb->csum_offset = offsetof(struct tcphdr, check);
} else {
th->check = tcp_v6_check(skb->len, saddr, daddr,
csum_partial(th, th->doff << 2,
skb->csum));
}
th->check = ~tcp_v6_check(skb->len, saddr, daddr, 0);
skb->csum_start = skb_transport_header(skb) - skb->head;
skb->csum_offset = offsetof(struct tcphdr, check);
}

#if IS_ENABLED(CONFIG_IPV6)
Expand Down
2 changes: 2 additions & 0 deletions include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@

#include <linux/atomic.h>
#include <linux/refcount.h>
#include <linux/llist.h>
#include <net/dst.h>
#include <net/checksum.h>
#include <net/tcp_states.h>
Expand Down Expand Up @@ -384,6 +385,7 @@ struct sock {
struct sk_buff *head;
struct sk_buff *tail;
} sk_backlog;
struct llist_head defer_list;
#define sk_rmem_alloc sk_backlog.rmem_alloc

int sk_forward_alloc;
Expand Down
18 changes: 16 additions & 2 deletions include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,16 @@ static inline bool tcp_checksum_complete(struct sk_buff *skb)
}

bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb);

void __sk_defer_free_flush(struct sock *sk);

static inline void sk_defer_free_flush(struct sock *sk)
{
if (llist_empty(&sk->defer_list))
return;
__sk_defer_free_flush(sk);
}

int tcp_filter(struct sock *sk, struct sk_buff *skb);

#undef STATE_TRACE
Expand Down Expand Up @@ -2065,9 +2075,13 @@ static inline void tcp_segs_in(struct tcp_sock *tp, const struct sk_buff *skb)
u16 segs_in;

segs_in = max_t(u16, 1, skb_shinfo(skb)->gso_segs);
tp->segs_in += segs_in;

/* We update these fields while other threads might
* read them from tcp_get_info()
*/
WRITE_ONCE(tp->segs_in, tp->segs_in + segs_in);
if (skb->len > tcp_hdrlen(skb))
tp->data_segs_in += segs_in;
WRITE_ONCE(tp->data_segs_in, tp->data_segs_in + segs_in);
}

/*
Expand Down
9 changes: 4 additions & 5 deletions kernel/events/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -6607,7 +6607,6 @@ void perf_output_sample(struct perf_output_handle *handle,
static u64 perf_virt_to_phys(u64 virt)
{
u64 phys_addr = 0;
struct page *p = NULL;

if (!virt)
return 0;
Expand All @@ -6626,14 +6625,14 @@ static u64 perf_virt_to_phys(u64 virt)
* If failed, leave phys_addr as 0.
*/
if (current->mm != NULL) {
struct page *p;
pagefault_disable();
if (__get_user_pages_fast(virt, 1, 0, &p) == 1)
if (__get_user_pages_fast(virt, 1, 0, &p) == 1) {
phys_addr = page_to_phys(p) + virt % PAGE_SIZE;
put_page(p);
}
pagefault_enable();
}

if (p)
put_page(p);
}

return phys_addr;
Expand Down
Loading

0 comments on commit 4e61523

Please sign in to comment.