diff options
21 files changed, 196 insertions, 131 deletions
diff --git a/drivers/hwmon/qpnp-adc-common.c b/drivers/hwmon/qpnp-adc-common.c index 812b96b381e3..6f4c094309f6 100644 --- a/drivers/hwmon/qpnp-adc-common.c +++ b/drivers/hwmon/qpnp-adc-common.c @@ -1,4 +1,4 @@ -/* 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 @@ -1247,7 +1247,7 @@ int32_t qpnp_adc_scale_default(struct qpnp_vadc_chip *vadc, } else { qpnp_adc_scale_with_calib_param(adc_code, adc_properties, chan_properties, &scale_voltage); - if (!chan_properties->calib_type == CALIB_ABSOLUTE) + if (!(chan_properties->calib_type == CALIB_ABSOLUTE)) scale_voltage *= 1000; } diff --git a/drivers/hwmon/qpnp-adc-voltage.c b/drivers/hwmon/qpnp-adc-voltage.c index 6ed947e5603b..81ad68548c6b 100644 --- a/drivers/hwmon/qpnp-adc-voltage.c +++ b/drivers/hwmon/qpnp-adc-voltage.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2016, 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 @@ -1488,7 +1488,7 @@ int32_t qpnp_vadc_calib_vref(struct qpnp_vadc_chip *vadc, conv.mode_sel = ADC_OP_NORMAL_MODE << QPNP_VADC_OP_MODE_SHIFT; conv.hw_settle_time = ADC_CHANNEL_HW_SETTLE_DELAY_0US; conv.fast_avg_setup = ADC_FAST_AVG_SAMPLE_1; - conv.cal_val = calib_type; + conv.cal_val = (enum qpnp_adc_cal_val)calib_type; if (vadc->vadc_hc) { rc = qpnp_vadc_hc_configure(vadc, &conv); @@ -1561,7 +1561,7 @@ int32_t qpnp_vadc_calib_gnd(struct qpnp_vadc_chip *vadc, conv.mode_sel = ADC_OP_NORMAL_MODE << QPNP_VADC_OP_MODE_SHIFT; conv.hw_settle_time = ADC_CHANNEL_HW_SETTLE_DELAY_0US; conv.fast_avg_setup = ADC_FAST_AVG_SAMPLE_1; - conv.cal_val = calib_type; + conv.cal_val = (enum qpnp_adc_cal_val)calib_type; if (vadc->vadc_hc) { rc = qpnp_vadc_hc_configure(vadc, &conv); @@ -1679,10 +1679,10 @@ static int32_t qpnp_vadc_calib_device(struct qpnp_vadc_chip *vadc) (calib_read_1 - calib_read_2); vadc->adc->amux_prop->chan_prop->adc_graph[CALIB_RATIOMETRIC].dx = vadc->adc->adc_prop->adc_vdd_reference; - vadc->adc->amux_prop->chan_prop->adc_graph[CALIB_RATIOMETRIC].adc_vref - = calib_read_1; - vadc->adc->amux_prop->chan_prop->adc_graph[CALIB_RATIOMETRIC].adc_gnd - = calib_read_2; + vadc->adc->amux_prop->chan_prop->adc_graph[CALIB_RATIOMETRIC].adc_vref = + calib_read_1; + vadc->adc->amux_prop->chan_prop->adc_graph[CALIB_RATIOMETRIC].adc_gnd = + calib_read_2; calib_fail: return rc; diff --git a/drivers/media/platform/msm/sde/rotator/sde_rotator_r3.c b/drivers/media/platform/msm/sde/rotator/sde_rotator_r3.c index 10f72a2155db..d08191cfff32 100644 --- a/drivers/media/platform/msm/sde/rotator/sde_rotator_r3.c +++ b/drivers/media/platform/msm/sde/rotator/sde_rotator_r3.c @@ -1,4 +1,4 @@ -/* 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 @@ -49,30 +49,56 @@ /* Macro for constructing the REGDMA command */ #define SDE_REGDMA_WRITE(p, off, data) \ do { \ - *p++ = REGDMA_OP_REGWRITE | \ - ((off) & REGDMA_ADDR_OFFSET_MASK); \ - *p++ = (data); \ + SDEROT_DBG("SDEREG.W:[%s:0x%X] <= 0x%X\n", #off, (off),\ + (u32)(data));\ + writel_relaxed_no_log( \ + (REGDMA_OP_REGWRITE | \ + ((off) & REGDMA_ADDR_OFFSET_MASK)), \ + p); \ + p += sizeof(u32); \ + writel_relaxed_no_log(data, p); \ + p += sizeof(u32); \ } while (0) #define SDE_REGDMA_MODIFY(p, off, mask, data) \ do { \ - *p++ = REGDMA_OP_REGMODIFY | \ - ((off) & REGDMA_ADDR_OFFSET_MASK); \ - *p++ = (mask); \ - *p++ = (data); \ + SDEROT_DBG("SDEREG.M:[%s:0x%X] <= 0x%X\n", #off, (off),\ + (u32)(data));\ + writel_relaxed_no_log( \ + (REGDMA_OP_REGMODIFY | \ + ((off) & REGDMA_ADDR_OFFSET_MASK)), \ + p); \ + p += sizeof(u32); \ + writel_relaxed_no_log(mask, p); \ + p += sizeof(u32); \ + writel_relaxed_no_log(data, p); \ + p += sizeof(u32); \ } while (0) #define SDE_REGDMA_BLKWRITE_INC(p, off, len) \ do { \ - *p++ = REGDMA_OP_BLKWRITE_INC | \ - ((off) & REGDMA_ADDR_OFFSET_MASK); \ - *p++ = (len); \ + SDEROT_DBG("SDEREG.B:[%s:0x%X:0x%X]\n", #off, (off),\ + (u32)(len));\ + writel_relaxed_no_log( \ + (REGDMA_OP_BLKWRITE_INC | \ + ((off) & REGDMA_ADDR_OFFSET_MASK)), \ + p); \ + p += sizeof(u32); \ + writel_relaxed_no_log(len, p); \ + p += sizeof(u32); \ } while (0) #define SDE_REGDMA_BLKWRITE_DATA(p, data) \ do { \ - *(p) = (data); \ - (p)++; \ + SDEROT_DBG("SDEREG.I:[:] <= 0x%X\n", (u32)(data));\ + writel_relaxed_no_log(data, p); \ + p += sizeof(u32); \ + } while (0) + +#define SDE_REGDMA_READ(p, data) \ + do { \ + data = readl_relaxed_no_log(p); \ + p += sizeof(u32); \ } while (0) /* Macro for directly accessing mapped registers */ @@ -454,7 +480,7 @@ static void sde_hw_rotator_unmap_vaddr(struct sde_dbg_buf *dbgbuf) static void sde_hw_rotator_setup_timestamp_packet( struct sde_hw_rotator_context *ctx, u32 mask, u32 swts) { - u32 *wrptr; + char __iomem *wrptr; wrptr = sde_hw_rotator_get_regdma_segment(ctx); @@ -520,7 +546,7 @@ static void sde_hw_rotator_setup_fetchengine(struct sde_hw_rotator_context *ctx, struct sde_mdp_format_params *fmt; struct sde_mdp_data *data; struct sde_rot_data_type *mdata = sde_rot_get_mdata(); - u32 *wrptr; + char __iomem *wrptr; u32 opmode = 0; u32 chroma_samp = 0; u32 src_format = 0; @@ -697,7 +723,7 @@ static void sde_hw_rotator_setup_wbengine(struct sde_hw_rotator_context *ctx, u32 flags) { struct sde_mdp_format_params *fmt; - u32 *wrptr; + char __iomem *wrptr; u32 pack = 0; u32 dst_format = 0; int i; @@ -838,13 +864,18 @@ static u32 sde_hw_rotator_start_no_regdma(struct sde_hw_rotator_context *ctx, enum sde_rot_queue_prio queue_id) { struct sde_hw_rotator *rot = ctx->rot; - u32 *wrptr; - u32 *rdptr; - u8 *addr; + char __iomem *wrptr; + char __iomem *mem_rdptr; + char __iomem *addr; u32 mask; + u32 cmd0, cmd1, cmd2; u32 blksize; - rdptr = sde_hw_rotator_get_regdma_segment_base(ctx); + /* + * when regdma is not using, the regdma segment is just a normal + * DRAM, and not an iomem. + */ + mem_rdptr = sde_hw_rotator_get_regdma_segment_base(ctx); wrptr = sde_hw_rotator_get_regdma_segment(ctx); if (rot->irq_num >= 0) { @@ -862,54 +893,65 @@ static u32 sde_hw_rotator_start_no_regdma(struct sde_hw_rotator_context *ctx, SDEROT_DBG("BEGIN %d\n", ctx->timestamp); /* Write all command stream to Rotator blocks */ /* Rotator will start right away after command stream finish writing */ - while (rdptr < wrptr) { - u32 op = REGDMA_OP_MASK & *rdptr; + while (mem_rdptr < wrptr) { + u32 op = REGDMA_OP_MASK & readl_relaxed_no_log(mem_rdptr); switch (op) { case REGDMA_OP_NOP: SDEROT_DBG("NOP\n"); - rdptr++; + mem_rdptr += sizeof(u32); break; case REGDMA_OP_REGWRITE: + SDE_REGDMA_READ(mem_rdptr, cmd0); + SDE_REGDMA_READ(mem_rdptr, cmd1); SDEROT_DBG("REGW %6.6x %8.8x\n", - rdptr[0] & REGDMA_ADDR_OFFSET_MASK, - rdptr[1]); + cmd0 & REGDMA_ADDR_OFFSET_MASK, + cmd1); addr = rot->mdss_base + - (*rdptr++ & REGDMA_ADDR_OFFSET_MASK); - writel_relaxed(*rdptr++, addr); + (cmd0 & REGDMA_ADDR_OFFSET_MASK); + writel_relaxed(cmd1, addr); break; case REGDMA_OP_REGMODIFY: + SDE_REGDMA_READ(mem_rdptr, cmd0); + SDE_REGDMA_READ(mem_rdptr, cmd1); + SDE_REGDMA_READ(mem_rdptr, cmd2); SDEROT_DBG("REGM %6.6x %8.8x %8.8x\n", - rdptr[0] & REGDMA_ADDR_OFFSET_MASK, - rdptr[1], rdptr[2]); + cmd0 & REGDMA_ADDR_OFFSET_MASK, + cmd1, cmd2); addr = rot->mdss_base + - (*rdptr++ & REGDMA_ADDR_OFFSET_MASK); - mask = *rdptr++; - writel_relaxed((readl_relaxed(addr) & mask) | *rdptr++, + (cmd0 & REGDMA_ADDR_OFFSET_MASK); + mask = cmd1; + writel_relaxed((readl_relaxed(addr) & mask) | cmd2, addr); break; case REGDMA_OP_BLKWRITE_SINGLE: + SDE_REGDMA_READ(mem_rdptr, cmd0); + SDE_REGDMA_READ(mem_rdptr, cmd1); SDEROT_DBG("BLKWS %6.6x %6.6x\n", - rdptr[0] & REGDMA_ADDR_OFFSET_MASK, - rdptr[1]); + cmd0 & REGDMA_ADDR_OFFSET_MASK, + cmd1); addr = rot->mdss_base + - (*rdptr++ & REGDMA_ADDR_OFFSET_MASK); - blksize = *rdptr++; + (cmd0 & REGDMA_ADDR_OFFSET_MASK); + blksize = cmd1; while (blksize--) { - SDEROT_DBG("DATA %8.8x\n", rdptr[0]); - writel_relaxed(*rdptr++, addr); + SDE_REGDMA_READ(mem_rdptr, cmd0); + SDEROT_DBG("DATA %8.8x\n", cmd0); + writel_relaxed(cmd0, addr); } break; case REGDMA_OP_BLKWRITE_INC: + SDE_REGDMA_READ(mem_rdptr, cmd0); + SDE_REGDMA_READ(mem_rdptr, cmd1); SDEROT_DBG("BLKWI %6.6x %6.6x\n", - rdptr[0] & REGDMA_ADDR_OFFSET_MASK, - rdptr[1]); + cmd0 & REGDMA_ADDR_OFFSET_MASK, + cmd1); addr = rot->mdss_base + - (*rdptr++ & REGDMA_ADDR_OFFSET_MASK); - blksize = *rdptr++; + (cmd0 & REGDMA_ADDR_OFFSET_MASK); + blksize = cmd1; while (blksize--) { - SDEROT_DBG("DATA %8.8x\n", rdptr[0]); - writel_relaxed(*rdptr++, addr); + SDE_REGDMA_READ(mem_rdptr, cmd0); + SDEROT_DBG("DATA %8.8x\n", cmd0); + writel_relaxed(cmd0, addr); addr += 4; } break; @@ -918,7 +960,7 @@ static u32 sde_hw_rotator_start_no_regdma(struct sde_hw_rotator_context *ctx, * Skip data for now for unregonized OP mode */ SDEROT_DBG("UNDEFINED\n"); - rdptr++; + mem_rdptr += sizeof(u32); break; } } @@ -936,11 +978,11 @@ static u32 sde_hw_rotator_start_regdma(struct sde_hw_rotator_context *ctx, enum sde_rot_queue_prio queue_id) { struct sde_hw_rotator *rot = ctx->rot; - u32 *wrptr; + char __iomem *wrptr; u32 regdmaSlot; u32 offset; - long length; - long ts_length; + u32 length; + u32 ts_length; u32 enableInt; u32 swts = 0; u32 mask = 0; @@ -957,13 +999,13 @@ static u32 sde_hw_rotator_start_regdma(struct sde_hw_rotator_context *ctx, * Start REGDMA with command offset and size */ regdmaSlot = sde_hw_rotator_get_regdma_ctxidx(ctx); - length = ((long)wrptr - (long)ctx->regdma_base) / 4; - offset = (u32)(ctx->regdma_base - (u32 *)(rot->mdss_base + - REGDMA_RAM_REGDMA_CMD_RAM)); + length = (wrptr - ctx->regdma_base) / 4; + offset = (ctx->regdma_base - (rot->mdss_base + + REGDMA_RAM_REGDMA_CMD_RAM)) / sizeof(u32); enableInt = ((ctx->timestamp & 1) + 1) << 30; SDEROT_DBG( - "regdma(%d)[%d] <== INT:0x%X|length:%ld|offset:0x%X, ts:%X\n", + "regdma(%d)[%d] <== INT:0x%X|length:%d|offset:0x%X, ts:%X\n", queue_id, regdmaSlot, enableInt, length, offset, ctx->timestamp); @@ -989,6 +1031,7 @@ static u32 sde_hw_rotator_start_regdma(struct sde_hw_rotator_context *ctx, sde_hw_rotator_setup_timestamp_packet(ctx, mask, swts); offset += length; ts_length = sde_hw_rotator_get_regdma_segment(ctx) - wrptr; + ts_length /= sizeof(u32); WARN_ON((length + ts_length) > SDE_HW_ROT_REGDMA_SEG_SIZE); /* ensure command packet is issue before the submit command */ @@ -2564,21 +2607,22 @@ int sde_rotator_r3_init(struct sde_rot_mgr *mgr) /* REGDMA initialization */ if (rot->mode == ROT_REGDMA_OFF) { for (i = 0; i < SDE_HW_ROT_REGDMA_TOTAL_CTX; i++) - rot->cmd_wr_ptr[0][i] = &rot->cmd_queue[ - SDE_HW_ROT_REGDMA_SEG_SIZE * i]; + rot->cmd_wr_ptr[0][i] = (char __iomem *)( + &rot->cmd_queue[ + SDE_HW_ROT_REGDMA_SEG_SIZE * i]); } else { for (i = 0; i < SDE_HW_ROT_REGDMA_TOTAL_CTX; i++) rot->cmd_wr_ptr[ROT_QUEUE_HIGH_PRIORITY][i] = - (u32 *)(rot->mdss_base + + rot->mdss_base + REGDMA_RAM_REGDMA_CMD_RAM + - SDE_HW_ROT_REGDMA_SEG_SIZE * 4 * i); + SDE_HW_ROT_REGDMA_SEG_SIZE * 4 * i; for (i = 0; i < SDE_HW_ROT_REGDMA_TOTAL_CTX; i++) rot->cmd_wr_ptr[ROT_QUEUE_LOW_PRIORITY][i] = - (u32 *)(rot->mdss_base + + rot->mdss_base + REGDMA_RAM_REGDMA_CMD_RAM + SDE_HW_ROT_REGDMA_SEG_SIZE * 4 * - (i + SDE_HW_ROT_REGDMA_TOTAL_CTX)); + (i + SDE_HW_ROT_REGDMA_TOTAL_CTX); } atomic_set(&rot->timestamp[0], 0); diff --git a/drivers/media/platform/msm/sde/rotator/sde_rotator_r3_internal.h b/drivers/media/platform/msm/sde/rotator/sde_rotator_r3_internal.h index 5502cc09ae19..325bacb5ba03 100644 --- a/drivers/media/platform/msm/sde/rotator/sde_rotator_r3_internal.h +++ b/drivers/media/platform/msm/sde/rotator/sde_rotator_r3_internal.h @@ -1,4 +1,4 @@ -/* 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 @@ -207,8 +207,8 @@ struct sde_hw_rotator_context { struct sde_rot_hw_resource *hwres; enum sde_rot_queue_prio q_id; u32 session_id; - u32 *regdma_base; - u32 *regdma_wrptr; + char __iomem *regdma_base; + char __iomem *regdma_wrptr; u32 timestamp; struct completion rot_comp; wait_queue_head_t regdma_waitq; @@ -249,7 +249,7 @@ struct sde_hw_rotator { u32 cmd_queue[SDE_HW_ROT_REGDMA_RAM_SIZE]; /* Cmd Queue Write Ptr */ - u32 *cmd_wr_ptr[ROT_QUEUE_MAX][SDE_HW_ROT_REGDMA_TOTAL_CTX]; + char __iomem *cmd_wr_ptr[ROT_QUEUE_MAX][SDE_HW_ROT_REGDMA_TOTAL_CTX]; /* Rotator Context */ struct sde_hw_rotator_context @@ -301,7 +301,7 @@ static inline u32 sde_hw_rotator_get_regdma_ctxidx( * @ctx: Rotator Context * return: base segment address */ -static inline u32 *sde_hw_rotator_get_regdma_segment_base( +static inline char __iomem *sde_hw_rotator_get_regdma_segment_base( struct sde_hw_rotator_context *ctx) { SDEROT_DBG("regdma base @slot[%d]: %p\n", @@ -317,11 +317,11 @@ static inline u32 *sde_hw_rotator_get_regdma_segment_base( * @ctx: Rotator Context * return: segment address */ -static inline u32 *sde_hw_rotator_get_regdma_segment( +static inline char __iomem *sde_hw_rotator_get_regdma_segment( struct sde_hw_rotator_context *ctx) { u32 idx = sde_hw_rotator_get_regdma_ctxidx(ctx); - u32 *addr = ctx->regdma_wrptr; + char __iomem *addr = ctx->regdma_wrptr; SDEROT_DBG("regdma slot[%d] ==> %p\n", idx, addr); return addr; @@ -335,7 +335,7 @@ static inline u32 *sde_hw_rotator_get_regdma_segment( */ static inline void sde_hw_rotator_put_regdma_segment( struct sde_hw_rotator_context *ctx, - u32 *wrptr) + char __iomem *wrptr) { u32 idx = sde_hw_rotator_get_regdma_ctxidx(ctx); diff --git a/drivers/mmc/host/sdhci-msm-ice.c b/drivers/mmc/host/sdhci-msm-ice.c index e73bdfd424cc..ca2a411878bf 100644 --- a/drivers/mmc/host/sdhci-msm-ice.c +++ b/drivers/mmc/host/sdhci-msm-ice.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 @@ -301,6 +301,7 @@ void sdhci_msm_ice_hci_update_noncq_cfg(struct sdhci_host *host, struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_msm_host *msm_host = pltfm_host->priv; unsigned int crypto_params = 0; + unsigned int crypto_enable = !bypass; /* * The naming convention got changed between ICE2.0 and ICE3.0 * registers fields. Below is the equivalent names for @@ -311,7 +312,7 @@ void sdhci_msm_ice_hci_update_noncq_cfg(struct sdhci_host *host, */ /* Configure ICE bypass mode */ crypto_params |= - (!bypass & MASK_SDHCI_MSM_ICE_HCI_PARAM_CE) + (crypto_enable & MASK_SDHCI_MSM_ICE_HCI_PARAM_CE) << OFFSET_SDHCI_MSM_ICE_HCI_PARAM_CE; /* Configure Crypto Configure Index (CCI) */ crypto_params |= (key_index & diff --git a/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c b/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c index 7518e437acd2..79515ba637ee 100644 --- a/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c +++ b/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2019, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-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 @@ -701,7 +701,7 @@ static int wwan_add_ul_flt_rule_to_ipa(void) /* send ipa_fltr_installed_notif_req_msg_v01 to Q6*/ req->source_pipe_index = ipa2_get_ep_mapping(IPA_CLIENT_APPS_LAN_WAN_PROD); - req->install_status = QMI_RESULT_SUCCESS_V01; + req->install_status = IPA_QMI_RESULT_SUCCESS_V01; req->filter_index_list_len = num_q6_rule; mutex_lock(&ipa_qmi_lock); for (i = 0; i < num_q6_rule; i++) { diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_rt.c b/drivers/platform/msm/ipa/ipa_v3/ipa_rt.c index 5413e62a75d8..bc63b3188276 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_rt.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_rt.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-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 @@ -1243,7 +1243,7 @@ int ipa3_add_rt_rule_after(struct ipa_ioc_add_rt_rule_after *rules) tbl = __ipa3_find_rt_tbl(rules->ip, rules->rt_tbl_name); if (tbl == NULL || (tbl->cookie != IPA_RT_TBL_COOKIE)) { IPAERR_RL("failed finding rt tbl name = %s\n", - rules->rt_tbl_name ? rules->rt_tbl_name : ""); + (rules->rt_tbl_name != NULL) ? rules->rt_tbl_name : ""); ret = -EINVAL; goto bail; } diff --git a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c index cccd597646a7..3392cd0413a9 100644 --- a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c +++ b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2019, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-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 @@ -722,7 +722,8 @@ static int ipa3_wwan_add_ul_flt_rule_to_ipa(void) retval = -EFAULT; } - req->install_status = QMI_RESULT_SUCCESS_V01; + req->install_status = (enum ipa_qmi_result_type_v01) + IPA_QMI_RESULT_SUCCESS_V01; req->rule_id_valid = 1; req->rule_id_len = rmnet_ipa3_ctx->num_q6_rules; for (i = 0; i < rmnet_ipa3_ctx->num_q6_rules; i++) { diff --git a/drivers/soc/qcom/glink_debugfs.c b/drivers/soc/qcom/glink_debugfs.c index 8e65e4ac9b8e..4bc01704d8aa 100644 --- a/drivers/soc/qcom/glink_debugfs.c +++ b/drivers/soc/qcom/glink_debugfs.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-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 @@ -559,9 +559,9 @@ void glink_dfs_update_list(struct dentry *curr_dent, struct dentry *parent, dbgfs_dent_s->parent = parent; dbgfs_dent_s->self = curr_dent; strlcpy(dbgfs_dent_s->self_name, - curr, strlen(curr) + 1); + curr, sizeof(dbgfs_dent_s->self_name)); strlcpy(dbgfs_dent_s->par_name, par_dir, - strlen(par_dir) + 1); + sizeof(dbgfs_dent_s->par_name)); mutex_lock(&dent_list_lock_lha0); list_add_tail(&dbgfs_dent_s->list_node, &dent_list); mutex_unlock(&dent_list_lock_lha0); diff --git a/drivers/soc/qcom/msm-spm.c b/drivers/soc/qcom/msm-spm.c index 508aa77c7e42..ea49db406eef 100644 --- a/drivers/soc/qcom/msm-spm.c +++ b/drivers/soc/qcom/msm-spm.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2016, 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 @@ -153,7 +153,7 @@ static void msm_spm_drv_flush_shadow(struct msm_spm_driver_data *dev, { BUG_ON(!dev); - BUG_ON(!dev->reg_shadow); + BUG_ON(dev->reg_shadow == NULL); __raw_writel(dev->reg_shadow[reg_index], dev->reg_base_addr + dev->reg_offsets[reg_index]); diff --git a/drivers/soc/qcom/rpm_master_stat.c b/drivers/soc/qcom/rpm_master_stat.c index b8bf3a059677..a53af5344490 100644 --- a/drivers/soc/qcom/rpm_master_stat.c +++ b/drivers/soc/qcom/rpm_master_stat.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-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 @@ -351,7 +351,7 @@ static struct msm_rpm_master_stats_platform_data { struct msm_rpm_master_stats_platform_data *pdata; struct device_node *node = dev->of_node; - int rc = 0, i; + int rc = 0, i, rpm_master_name_len = 0; pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); if (!pdata) @@ -387,7 +387,7 @@ static struct msm_rpm_master_stats_platform_data * Read master names from DT */ for (i = 0; i < pdata->num_masters; i++) { - const char *master_name; + const char *master_name = NULL; of_property_read_string_index(node, "qcom,masters", i, &master_name); @@ -395,9 +395,9 @@ static struct msm_rpm_master_stats_platform_data strlen(master_name) + 1, GFP_KERNEL); if (!pdata->masters[i]) goto err; - + rpm_master_name_len = strlen(master_name); strlcpy(pdata->masters[i], master_name, - strlen(master_name) + 1); + rpm_master_name_len + 1); } return pdata; err: diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c index 1de38bfd0adf..e269de5be22f 100644 --- a/drivers/soc/qcom/smp2p.c +++ b/drivers/soc/qcom/smp2p.c @@ -1,6 +1,6 @@ /* drivers/soc/qcom/smp2p.c * - * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2016, 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 @@ -989,17 +989,29 @@ void smp2p_init_header(struct smp2p_smem __iomem *header_ptr, int local_pid, int remote_pid, uint32_t features, uint32_t version) { - header_ptr->magic = SMP2P_MAGIC; - SMP2P_SET_LOCAL_PID(header_ptr->rem_loc_proc_id, local_pid); - SMP2P_SET_REMOTE_PID(header_ptr->rem_loc_proc_id, remote_pid); - SMP2P_SET_FEATURES(header_ptr->feature_version, features); - SMP2P_SET_ENT_TOTAL(header_ptr->valid_total_ent, SMP2P_MAX_ENTRY); - SMP2P_SET_ENT_VALID(header_ptr->valid_total_ent, 0); - header_ptr->flags = 0; + uint32_t rem_loc_proc_id = 0; + uint32_t valid_total_ent = 0; + uint32_t feature_version = 0; + + writel_relaxed(SMP2P_MAGIC, &header_ptr->magic); + + SMP2P_SET_LOCAL_PID(rem_loc_proc_id, local_pid); + SMP2P_SET_REMOTE_PID(rem_loc_proc_id, remote_pid); + writel_relaxed(rem_loc_proc_id, &header_ptr->rem_loc_proc_id); + + SMP2P_SET_FEATURES(feature_version, features); + writel_relaxed(feature_version, &header_ptr->feature_version); + + SMP2P_SET_ENT_TOTAL(valid_total_ent, SMP2P_MAX_ENTRY); + SMP2P_SET_ENT_VALID(valid_total_ent, 0); + writel_relaxed(valid_total_ent, &header_ptr->valid_total_ent); + + writel_relaxed(0, &header_ptr->flags); /* ensure that all fields are valid before version is written */ wmb(); - SMP2P_SET_VERSION(header_ptr->feature_version, version); + SMP2P_SET_VERSION(feature_version, version); + writel_relaxed(feature_version, &header_ptr->feature_version); } /** diff --git a/drivers/soc/qcom/sysmon-qmi.c b/drivers/soc/qcom/sysmon-qmi.c index 1063b96d8d83..e3b947390856 100644 --- a/drivers/soc/qcom/sysmon-qmi.c +++ b/drivers/soc/qcom/sysmon-qmi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-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 @@ -474,7 +474,7 @@ int sysmon_send_shutdown(struct subsys_desc *dest_desc) shutdown_ack_ret = wait_for_shutdown_ack(dest_desc); if (shutdown_ack_ret < 0) { pr_err("shutdown_ack SMP2P bit for %s not set\n", data->name); - if (!&data->ind_recv.done) { + if (!completion_done(&data->ind_recv)) { pr_err("QMI shutdown indication not received\n"); ret = shutdown_ack_ret; } diff --git a/drivers/staging/android/ion/ion_cma_heap.c b/drivers/staging/android/ion/ion_cma_heap.c index bd481af4035c..ad3fdf8aa15b 100644 --- a/drivers/staging/android/ion/ion_cma_heap.c +++ b/drivers/staging/android/ion/ion_cma_heap.c @@ -4,6 +4,8 @@ * Copyright (C) Linaro 2012 * Author: <benjamin.gaignard@linaro.org> for ST-Ericsson. * + * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. @@ -221,7 +223,7 @@ struct ion_heap *ion_cma_heap_create(struct ion_platform_heap *data) /* set device as private heaps data, later it will be * used to make the link with reserved CMA memory */ heap->priv = data->priv; - heap->type = ION_HEAP_TYPE_DMA; + heap->type = (enum ion_heap_type)ION_HEAP_TYPE_DMA; cma_heap_has_outer_cache = data->has_outer_cache; return heap; } @@ -363,7 +365,7 @@ struct ion_heap *ion_cma_secure_heap_create(struct ion_platform_heap *data) * used to make the link with reserved CMA memory */ heap->priv = data->priv; - heap->type = ION_HEAP_TYPE_HYP_CMA; + heap->type = (enum ion_heap_type)ION_HEAP_TYPE_HYP_CMA; cma_heap_has_outer_cache = data->has_outer_cache; return heap; } diff --git a/drivers/staging/android/ion/ion_cma_secure_heap.c b/drivers/staging/android/ion/ion_cma_secure_heap.c index 6102b1765182..6fde2a5105c4 100644 --- a/drivers/staging/android/ion/ion_cma_secure_heap.c +++ b/drivers/staging/android/ion/ion_cma_secure_heap.c @@ -3,7 +3,7 @@ * * Copyright (C) Linaro 2012 * Author: <benjamin.gaignard@linaro.org> for ST-Ericsson. - * Copyright (c) 2013-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2017, 2020, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -854,7 +854,7 @@ struct ion_heap *ion_secure_cma_heap_create(struct ion_platform_heap *data) mutex_init(&sheap->chunk_lock); mutex_init(&sheap->alloc_lock); sheap->heap.ops = &ion_secure_cma_ops; - sheap->heap.type = ION_HEAP_TYPE_SECURE_DMA; + sheap->heap.type = (enum ion_heap_type)ION_HEAP_TYPE_SECURE_DMA; sheap->npages = data->size >> PAGE_SHIFT; sheap->base = data->base; sheap->heap_size = data->size; diff --git a/drivers/staging/android/ion/ion_system_secure_heap.c b/drivers/staging/android/ion/ion_system_secure_heap.c index c7585118a41c..53662683d0e1 100644 --- a/drivers/staging/android/ion/ion_system_secure_heap.c +++ b/drivers/staging/android/ion/ion_system_secure_heap.c @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-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 @@ -49,10 +49,10 @@ struct prefetch_info { static bool is_cp_flag_present(unsigned long flags) { - return flags && (ION_FLAG_CP_TOUCH || - ION_FLAG_CP_BITSTREAM || - ION_FLAG_CP_PIXEL || - ION_FLAG_CP_NON_PIXEL || + return flags & (ION_FLAG_CP_TOUCH | + ION_FLAG_CP_BITSTREAM | + ION_FLAG_CP_PIXEL | + ION_FLAG_CP_NON_PIXEL | ION_FLAG_CP_CAMERA); } @@ -117,7 +117,7 @@ static int ion_system_secure_heap_allocate(struct ion_heap *heap, heap); if (!ion_heap_is_system_secure_heap_type(secure_heap->heap.type) || - !is_cp_flag_present(flags)) { + !(is_cp_flag_present(flags) || (flags & ION_FLAG_SECURE))) { pr_info("%s: Incorrect heap type or incorrect flags\n", __func__); return -EINVAL; @@ -392,7 +392,7 @@ struct ion_heap *ion_system_secure_heap_create(struct ion_platform_heap *unused) if (!heap) return ERR_PTR(-ENOMEM); heap->heap.ops = &system_secure_heap_ops; - heap->heap.type = ION_HEAP_TYPE_SYSTEM_SECURE; + heap->heap.type = (enum ion_heap_type)ION_HEAP_TYPE_SYSTEM_SECURE; heap->sys_heap = get_ion_heap(ION_SYSTEM_HEAP_ID); heap->destroy_heap = false; diff --git a/drivers/staging/android/ion/msm/msm_ion.c b/drivers/staging/android/ion/msm/msm_ion.c index d3069fe4dd78..1a3aca407c9e 100644 --- a/drivers/staging/android/ion/msm/msm_ion.c +++ b/drivers/staging/android/ion/msm/msm_ion.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-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 @@ -809,13 +809,15 @@ long msm_ion_custom_ioctl(struct ion_client *client, int ret; ret = ion_walk_heaps(client, data.prefetch_data.heap_id, - ION_HEAP_TYPE_SECURE_DMA, - (void *)data.prefetch_data.len, - ion_secure_cma_prefetch); + (enum ion_heap_type) + ION_HEAP_TYPE_SECURE_DMA, + (void *)data.prefetch_data.len, + ion_secure_cma_prefetch); if (ret) return ret; ret = ion_walk_heaps(client, data.prefetch_data.heap_id, + (enum ion_heap_type) ION_HEAP_TYPE_SYSTEM_SECURE, (void *)&data.prefetch_data, ion_system_secure_heap_prefetch); @@ -828,14 +830,16 @@ long msm_ion_custom_ioctl(struct ion_client *client, int ret; ret = ion_walk_heaps(client, data.prefetch_data.heap_id, - ION_HEAP_TYPE_SECURE_DMA, - (void *)data.prefetch_data.len, - ion_secure_cma_drain_pool); + (enum ion_heap_type) + ION_HEAP_TYPE_SECURE_DMA, + (void *)data.prefetch_data.len, + ion_secure_cma_drain_pool); if (ret) return ret; ret = ion_walk_heaps(client, data.prefetch_data.heap_id, + (enum ion_heap_type) ION_HEAP_TYPE_SYSTEM_SECURE, (void *)&data.prefetch_data, ion_system_secure_heap_drain); diff --git a/drivers/tty/serial/msm_smd_tty.c b/drivers/tty/serial/msm_smd_tty.c index ea3f221a0b25..0092437faaa2 100644 --- a/drivers/tty/serial/msm_smd_tty.c +++ b/drivers/tty/serial/msm_smd_tty.c @@ -1,5 +1,5 @@ /* Copyright (C) 2007 Google, Inc. - * Copyright (c) 2009-2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2009-2015, 2020, The Linux Foundation. All rights reserved. * Author: Brian Swetland <swetland@google.com> * * This software is licensed under the terms of the GNU General Public @@ -368,7 +368,7 @@ static int smd_tty_dummy_probe(struct platform_device *pdev) int n; for (n = 0; n < MAX_SMD_TTYS; ++n) { - if (!smd_tty[n].dev_name) + if (smd_tty[n].dev_name == NULL) continue; if (pdev->id == smd_tty[n].edge && @@ -502,7 +502,7 @@ static int smd_tty_port_activate(struct tty_port *tport, struct smd_tty_info *info; const char *peripheral = NULL; - if (n >= MAX_SMD_TTYS || !smd_tty[n].ch_name) + if (n >= MAX_SMD_TTYS || smd_tty[n].ch_name == NULL) return -ENODEV; info = smd_tty + n; diff --git a/drivers/video/fbdev/msm/mdss_mdp_pp.c b/drivers/video/fbdev/msm/mdss_mdp_pp.c index 79e1277c9ca6..edc154b2b0c6 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_pp.c +++ b/drivers/video/fbdev/msm/mdss_mdp_pp.c @@ -3417,7 +3417,7 @@ static int pp_ad_calc_bl(struct msm_fb_data_type *mfd, int bl_in, int *bl_out, } if (!ad->bl_mfd || !ad->bl_mfd->panel_info || - !ad->bl_att_lut) { + ad->bl_att_lut == NULL) { pr_err("Invalid ad info: bl_mfd = 0x%pK, ad->bl_mfd->panel_info = 0x%pK, bl_att_lut = 0x%pK\n", ad->bl_mfd, (!ad->bl_mfd) ? NULL : ad->bl_mfd->panel_info, @@ -6968,7 +6968,7 @@ static int is_valid_calib_dspp_addr(char __iomem *ptr) ret = MDP_PP_OPS_READ | MDP_PP_OPS_WRITE; break; /* Dither enable/disable */ - } else if ((ptr == base + MDSS_MDP_REG_DSPP_DITHER_DEPTH)) { + } else if (ptr == base + MDSS_MDP_REG_DSPP_DITHER_DEPTH) { ret = MDP_PP_OPS_READ | MDP_PP_OPS_WRITE; break; /* Six zone and mem color */ diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index 52d5609bff8e..e54065331f72 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h @@ -104,9 +104,10 @@ extern unsigned int sysctl_numa_balancing_scan_period_max; extern unsigned int sysctl_numa_balancing_scan_size; #ifdef CONFIG_SCHED_DEBUG -extern unsigned int sysctl_sched_migration_cost; -extern unsigned int sysctl_sched_nr_migrate; -extern unsigned int sysctl_sched_time_avg; +extern __read_mostly unsigned int sysctl_sched_migration_cost; +extern __read_mostly unsigned int sysctl_sched_nr_migrate; +extern __read_mostly unsigned int sysctl_sched_time_avg; + extern unsigned int sysctl_sched_shares_window; int sched_proc_update_handler(struct ctl_table *table, int write, diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 21de9ad7f151..80ec65692524 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -479,7 +479,7 @@ static bool is_zspage_isolated(struct zspage *zspage) return zspage->isolated; } -static int is_first_page(struct page *page) +static __maybe_unused int is_first_page(struct page *page) { return PagePrivate(page); } |
