Merge "msm: mdss: hdmi: Handle fast HPD interrupts"
diff --git a/arch/arm/boot/dts/dsi-panel-generic-720p-cmd.dtsi b/arch/arm/boot/dts/dsi-panel-generic-720p-cmd.dtsi
index 214c7f8..4b0d3d2 100644
--- a/arch/arm/boot/dts/dsi-panel-generic-720p-cmd.dtsi
+++ b/arch/arm/boot/dts/dsi-panel-generic-720p-cmd.dtsi
@@ -75,6 +75,7 @@
qcom,mdss-dsi-mdp-trigger = "none";
qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_pwm";
qcom,mdss-dsi-reset-sequence = <1 20>, <0 200>, <1 20>;
+ qcom,panel-roi-alignment = <2 2 2 2 0 0>;
qcom,partial-update-enabled;
};
};
diff --git a/arch/arm/boot/dts/dsi-panel-nt35590-720p-cmd.dtsi b/arch/arm/boot/dts/dsi-panel-nt35590-720p-cmd.dtsi
index 996fcae..af322d2 100644
--- a/arch/arm/boot/dts/dsi-panel-nt35590-720p-cmd.dtsi
+++ b/arch/arm/boot/dts/dsi-panel-nt35590-720p-cmd.dtsi
@@ -533,6 +533,7 @@
qcom,mdss-dsi-reset-sequence = <1 20>, <0 1>, <1 20>;
qcom,mdss-pan-physical-width-dimension = <59>;
qcom,mdss-pan-physical-height-dimension = <104>;
+ qcom,panel-roi-alignment = <2 2 2 2 0 0>;
};
};
diff --git a/drivers/cpufreq/cpu-boost.c b/drivers/cpufreq/cpu-boost.c
index f50c050..f546805 100644
--- a/drivers/cpufreq/cpu-boost.c
+++ b/drivers/cpufreq/cpu-boost.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2015, 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
@@ -34,6 +34,7 @@
int cpu;
spinlock_t lock;
bool pending;
+ atomic_t being_woken;
int src_cpu;
unsigned int boost_min;
unsigned int input_boost_min;
@@ -206,7 +207,16 @@
s->pending = true;
s->src_cpu = (int) arg;
spin_unlock_irqrestore(&s->lock, flags);
- wake_up(&s->sync_wq);
+ /*
+ * Avoid issuing recursive wakeup call, as sync thread itself could be
+ * seen as migrating triggering this notification. Note that sync thread
+ * of a cpu could be running for a short while with its affinity broken
+ * because of CPU hotplug.
+ */
+ if (!atomic_cmpxchg(&s->being_woken, 0, 1)) {
+ wake_up(&s->sync_wq);
+ atomic_set(&s->being_woken, 0);
+ }
return NOTIFY_OK;
}
@@ -346,6 +356,7 @@
s = &per_cpu(sync_info, cpu);
s->cpu = cpu;
init_waitqueue_head(&s->sync_wq);
+ atomic_set(&s->being_woken, 0);
spin_lock_init(&s->lock);
INIT_DELAYED_WORK(&s->boost_rem, do_boost_rem);
INIT_DELAYED_WORK(&s->input_boost_rem, do_input_boost_rem);
diff --git a/drivers/media/platform/msm/camera_v2/ispif/msm_ispif.c b/drivers/media/platform/msm/camera_v2/ispif/msm_ispif.c
index a38fd7a..3f8f844 100755
--- a/drivers/media/platform/msm/camera_v2/ispif/msm_ispif.c
+++ b/drivers/media/platform/msm/camera_v2/ispif/msm_ispif.c
@@ -60,8 +60,8 @@
static inline int msm_ispif_is_intf_valid(uint32_t csid_version,
uint8_t intf_type)
{
- return ((csid_version <= CSID_VERSION_V22 && intf_type != VFE0) ||
- (intf_type >= VFE_MAX)) ? false : true;
+ return ((csid_version <= CSID_VERSION_V22 && intf_type != VFE0) ||
+ (intf_type >= VFE_MAX)) ? false : true;
}
static struct msm_cam_clk_info ispif_8626_reset_clk_info[] = {
@@ -127,7 +127,7 @@
rc = msm_cam_clk_enable(&ispif->pdev->dev,
ispif_8626_reset_clk_info, reset_clk1,
ARRAY_SIZE(ispif_8626_reset_clk_info), 1);
- if (rc < 0){
+ if (rc < 0) {
pr_err("%s: cannot enable clock, error = %d",
__func__, rc);
} else {
@@ -159,12 +159,13 @@
rc = msm_cam_clk_enable(&ispif->pdev->dev,
ispif_8974_reset_clk_info, reset_clk,
ARRAY_SIZE(ispif_8974_reset_clk_info), 0);
- if (rc < 0){
+ if (rc < 0) {
rc = msm_cam_clk_enable(&ispif->pdev->dev,
ispif_8626_reset_clk_info, reset_clk1,
ARRAY_SIZE(ispif_8626_reset_clk_info), 0);
if (rc < 0)
- pr_err("%s: VFE0 reset wait timeout\n", __func__);
+ pr_err("%s: VFE0 reset wait timeout\n",
+ __func__);
}
return -ETIMEDOUT;
}
@@ -183,7 +184,7 @@
}
}
- if (ispif->clk_idx == 1){
+ if (ispif->clk_idx == 1) {
rc = msm_cam_clk_enable(&ispif->pdev->dev,
ispif_8974_reset_clk_info, reset_clk,
ARRAY_SIZE(ispif_8974_reset_clk_info), 0);
@@ -193,13 +194,13 @@
}
}
- if (ispif->clk_idx == 2){
- rc = msm_cam_clk_enable(&ispif->pdev->dev,
+ if (ispif->clk_idx == 2) {
+ rc = msm_cam_clk_enable(&ispif->pdev->dev,
ispif_8626_reset_clk_info, reset_clk1,
ARRAY_SIZE(ispif_8626_reset_clk_info), 0);
- if (rc < 0) {
- pr_err("%s: cannot disable clock, error = %d",
- __func__, rc);
+ if (rc < 0) {
+ pr_err("%s: cannot disable clock, error = %d",
+ __func__, rc);
}
}
@@ -946,7 +947,8 @@
struct msm_ispif_vfe_info *vfe_info)
{
memcpy(&ispif->vfe_info, vfe_info, sizeof(struct msm_ispif_vfe_info));
-
+ if (ispif->vfe_info.num_vfe > ispif->hw_num_isps)
+ return -EINVAL;
return 0;
}
diff --git a/drivers/media/platform/msm/vidc/hfi_response_handler.c b/drivers/media/platform/msm/vidc/hfi_response_handler.c
index 032cca4..9365681 100644
--- a/drivers/media/platform/msm/vidc/hfi_response_handler.c
+++ b/drivers/media/platform/msm/vidc/hfi_response_handler.c
@@ -1266,6 +1266,7 @@
}
static void hfi_process_sys_property_info(
+ msm_vidc_callback callback, u32 device_id,
struct hfi_msg_sys_property_info_packet *pkt)
{
if (!pkt) {
@@ -1335,7 +1336,7 @@
msg_hdr);
break;
case HFI_MSG_SYS_PROPERTY_INFO:
- hfi_process_sys_property_info(
+ hfi_process_sys_property_info(callback, device_id,
(struct hfi_msg_sys_property_info_packet *)
msg_hdr);
break;
diff --git a/drivers/media/platform/msm/vidc/msm_vidc_debug.c b/drivers/media/platform/msm/vidc/msm_vidc_debug.c
index ee91513..8c9e746 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc_debug.c
+++ b/drivers/media/platform/msm/vidc/msm_vidc_debug.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2015, 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
@@ -63,7 +63,9 @@
{
struct msm_vidc_core *core = file->private_data;
struct hfi_device *hdev;
- int i = 0;
+ struct hal_fw_info fw_info;
+ int i = 0, rc = 0;
+
if (!core || !core->device) {
dprintk(VIDC_ERR, "Invalid params, core: %p\n", core);
return 0;
@@ -73,19 +75,19 @@
write_str(&dbg_buf, "===============================\n");
write_str(&dbg_buf, "CORE %d: 0x%p\n", core->id, core);
write_str(&dbg_buf, "===============================\n");
- write_str(&dbg_buf, "state: %d\n", core->state);
- write_str(&dbg_buf, "base addr: 0x%x\n",
- call_hfi_op(hdev, get_fw_info, hdev->hfi_device_data,
- FW_BASE_ADDRESS));
- write_str(&dbg_buf, "register_base: 0x%x\n",
- call_hfi_op(hdev, get_fw_info, hdev->hfi_device_data,
- FW_REGISTER_BASE));
- write_str(&dbg_buf, "register_size: %u\n",
- call_hfi_op(hdev, get_fw_info, hdev->hfi_device_data,
- FW_REGISTER_SIZE));
- write_str(&dbg_buf, "irq: %u\n",
- call_hfi_op(hdev, get_fw_info, hdev->hfi_device_data,
- FW_IRQ));
+ write_str(&dbg_buf, "Core state: %d\n", core->state);
+ rc = call_hfi_op(hdev, get_fw_info, hdev->hfi_device_data, &fw_info);
+ if (rc) {
+ dprintk(VIDC_WARN, "Failed to read FW info\n");
+ goto err_fw_info;
+ }
+
+ write_str(&dbg_buf, "FW version : %s\n", &fw_info.version);
+ write_str(&dbg_buf, "base addr: 0x%x\n", fw_info.base_addr);
+ write_str(&dbg_buf, "register_base: 0x%x\n", fw_info.register_base);
+ write_str(&dbg_buf, "register_size: %u\n", fw_info.register_size);
+ write_str(&dbg_buf, "irq: %u\n", fw_info.irq);
+
write_str(&dbg_buf, "clock count: %d\n",
call_hfi_op(hdev, get_info, hdev->hfi_device_data,
DEV_CLOCK_COUNT));
@@ -98,6 +100,7 @@
write_str(&dbg_buf, "power enabled: %u\n",
call_hfi_op(hdev, get_info, hdev->hfi_device_data,
DEV_PWR_ENABLED));
+err_fw_info:
for (i = SYS_MSG_START; i < SYS_MSG_END; i++) {
write_str(&dbg_buf, "completions[%d]: %s\n", i,
completion_done(&core->completions[SYS_MSG_INDEX(i)]) ?
diff --git a/drivers/media/platform/msm/vidc/msm_vidc_internal.h b/drivers/media/platform/msm/vidc/msm_vidc_internal.h
index e655d71..58f5f2f 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc_internal.h
+++ b/drivers/media/platform/msm/vidc/msm_vidc_internal.h
@@ -34,7 +34,6 @@
#include <media/msm_media_info.h>
#include "vidc_hfi_api.h"
-#include "vidc_hfi_api.h"
#define MSM_VIDC_DRV_NAME "msm_vidc_driver"
#define MSM_VIDC_VERSION KERNEL_VERSION(0, 0, 1);
diff --git a/drivers/media/platform/msm/vidc/venus_hfi.c b/drivers/media/platform/msm/vidc/venus_hfi.c
index 2371f3b..ea44ea57 100644
--- a/drivers/media/platform/msm/vidc/venus_hfi.c
+++ b/drivers/media/platform/msm/vidc/venus_hfi.c
@@ -34,6 +34,7 @@
#define FIRMWARE_SIZE 0X00A00000
#define REG_ADDR_OFFSET_BITMASK 0x000FFFFF
+#define VENUS_VERSION_LENGTH 128
/*Workaround for simulator */
#define HFI_SIM_FW_BIAS 0x0
@@ -3768,37 +3769,42 @@
return rc;
}
-static int venus_hfi_get_fw_info(void *dev, enum fw_info info)
+static int venus_hfi_get_fw_info(void *dev, struct hal_fw_info *fw_info)
{
- int rc = 0;
+ int rc = 0, i = 0, j = 0;
struct venus_hfi_device *device = dev;
+ u32 smem_block_size = 0;
+ u8 *smem_table_ptr;
+ char version[VENUS_VERSION_LENGTH];
+ const u32 version_string_size = VENUS_VERSION_LENGTH;
+ const u32 smem_image_index_venus = 14 * 128;
- if (!device) {
- dprintk(VIDC_ERR, "%s Invalid paramter: %p\n",
- __func__, device);
+
+ if (!device|| !fw_info) {
+ dprintk(VIDC_ERR,
+ "%s Invalid paramter: device = %p fw_info = %p\n",
+ __func__, device, fw_info);
return -EINVAL;
}
+ smem_table_ptr = smem_get_entry(SMEM_IMAGE_VERSION_TABLE,
+ &smem_block_size);
+ if (smem_table_ptr &&
+ ((smem_image_index_venus +
+ version_string_size) <= smem_block_size))
+ memcpy(version,
+ smem_table_ptr + smem_image_index_venus,
+ version_string_size);
- switch (info) {
- case FW_BASE_ADDRESS:
- rc = device->base_addr;
- break;
+ while (version[i++] != 'V' && i < version_string_size)
+ ;
- case FW_REGISTER_BASE:
- rc = device->register_base;
- break;
+ for (i--; i < version_string_size && j < version_string_size; i++)
+ fw_info->version[j++] = version[i];
+ fw_info->version[version_string_size - 1] = '\0';
+ dprintk(VIDC_DBG, "F/W version retrieved : %s\n", fw_info->version);
- case FW_REGISTER_SIZE:
- rc = device->register_size;
- break;
-
- case FW_IRQ:
- rc = device->irq;
- break;
-
- default:
- dprintk(VIDC_ERR, "Invalid fw info requested");
- }
+ fw_info->register_base = (u32)device->res->register_base;
+ fw_info->irq = device->hal_data->irq;
return rc;
}
diff --git a/drivers/media/platform/msm/vidc/vidc_hfi_api.h b/drivers/media/platform/msm/vidc/vidc_hfi_api.h
index 6cc4dee..1fde726 100644
--- a/drivers/media/platform/msm/vidc/vidc_hfi_api.h
+++ b/drivers/media/platform/msm/vidc/vidc_hfi_api.h
@@ -888,6 +888,14 @@
u32 seq_hdr_len;
};
+struct hal_fw_info {
+ char version[128];
+ int base_addr;
+ int register_base;
+ int register_size;
+ int irq;
+};
+
enum hal_flush {
HAL_FLUSH_INPUT,
HAL_FLUSH_OUTPUT,
@@ -1095,14 +1103,6 @@
OCMEM_MEM = 0x2,
};
-enum fw_info {
- FW_BASE_ADDRESS,
- FW_REGISTER_BASE,
- FW_REGISTER_SIZE,
- FW_IRQ,
- FW_INFO_MAX,
-};
-
enum dev_info {
DEV_CLOCK_COUNT,
DEV_CLOCK_ENABLED,
@@ -1161,7 +1161,7 @@
int (*load_fw)(void *dev);
void (*unload_fw)(void *dev);
int (*resurrect_fw)(void *dev);
- int (*get_fw_info)(void *dev, enum fw_info info);
+ int (*get_fw_info)(void *dev, struct hal_fw_info *fw_info);
int (*get_info) (void *dev, enum dev_info info);
int (*get_stride_scanline)(int color_fmt, int width,
int height, int *stride, int *scanlines);
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 939379f..1f71ac2 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2852,7 +2852,8 @@
return;
}
-static bool mmc_is_vaild_state_for_clk_scaling(struct mmc_host *host)
+static bool mmc_is_vaild_state_for_clk_scaling(struct mmc_host *host,
+ enum mmc_load state)
{
struct mmc_card *card = host->card;
u32 status;
@@ -2865,7 +2866,8 @@
*/
if (!card || (mmc_card_mmc(card) &&
card->part_curr == EXT_CSD_PART_CONFIG_ACC_RPMB)
- || host->clk_scaling.invalid_state)
+ || (state != MMC_LOAD_LOW &&
+ host->clk_scaling.invalid_state))
goto out;
if (mmc_send_status(card, &status)) {
@@ -2896,7 +2898,7 @@
}
if (freq != host->clk_scaling.curr_freq) {
- if (!mmc_is_vaild_state_for_clk_scaling(host)) {
+ if (!mmc_is_vaild_state_for_clk_scaling(host, state)) {
err = -EAGAIN;
goto error;
}
diff --git a/drivers/thermal/msm_thermal.c b/drivers/thermal/msm_thermal.c
index 0652410..00801df 100644
--- a/drivers/thermal/msm_thermal.c
+++ b/drivers/thermal/msm_thermal.c
@@ -41,6 +41,7 @@
#include <linux/msm_thermal_ioctl.h>
#include <mach/rpm-smd.h>
#include <mach/scm.h>
+#include <linux/sched.h>
#define MAX_CURRENT_UA 1000000
#define MAX_RAILS 5
@@ -1081,12 +1082,14 @@
{
int ret = 0;
uint32_t cpu = 0, mask = 0;
+ struct sched_param param = {.sched_priority = MAX_RT_PRIO-2};
if (!core_control_enabled) {
pr_debug("Core control disabled\n");
return -EINVAL;
}
+ sched_setscheduler(current, SCHED_FIFO, ¶m);
while (!kthread_should_stop()) {
while (wait_for_completion_interruptible(
&hotplug_notify_complete) != 0)
@@ -1539,7 +1542,9 @@
{
int ret = 0;
uint32_t cpu = 0, max_freq_req = 0, min_freq_req = 0;
+ struct sched_param param = {.sched_priority = MAX_RT_PRIO-1};
+ sched_setscheduler(current, SCHED_FIFO, ¶m);
while (!kthread_should_stop()) {
while (wait_for_completion_interruptible(
&freq_mitigation_complete) != 0)
diff --git a/drivers/video/msm/mdss/mdss_dsi_panel.c b/drivers/video/msm/mdss/mdss_dsi_panel.c
index 6e2a7f5..2fb4bc6 100644
--- a/drivers/video/msm/mdss/mdss_dsi_panel.c
+++ b/drivers/video/msm/mdss/mdss_dsi_panel.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2015, 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
@@ -786,12 +786,12 @@
data = of_find_property(np, "qcom,panel-roi-alignment", &len);
len /= sizeof(u32);
if (!data || (len != 6)) {
- pr_debug("%s: Panel roi alignment not found", __func__);
+ pr_err("%s: Panel roi alignment not found", __func__);
} else {
int rc = of_property_read_u32_array(np,
"qcom,panel-roi-alignment", value, len);
if (rc)
- pr_debug("%s: Error reading panel roi alignment values",
+ pr_err("%s: Error reading panel roi alignment values",
__func__);
else {
pinfo->xstart_pix_align = value[0];
@@ -802,7 +802,7 @@
pinfo->min_height = value[5];
}
- pr_debug("%s: ROI alignment: [%d, %d, %d, %d, %d, %d]",
+ pr_info("%s: ROI alignment: [%d, %d, %d, %d, %d, %d]",
__func__, pinfo->xstart_pix_align,
pinfo->width_pix_align, pinfo->ystart_pix_align,
pinfo->height_pix_align, pinfo->min_width,
diff --git a/drivers/video/msm/mdss/mdss_fb.c b/drivers/video/msm/mdss/mdss_fb.c
index db66761..34e203e 100644
--- a/drivers/video/msm/mdss/mdss_fb.c
+++ b/drivers/video/msm/mdss/mdss_fb.c
@@ -1142,6 +1142,7 @@
}
} else {
pr_err("No IOMMU Domain");
+ rc = -EINVAL;
goto fb_mmap_failed;
}
diff --git a/kernel/resource.c b/kernel/resource.c
index 7203c06..e9ba077 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -142,7 +142,7 @@
static int __init ioresources_init(void)
{
proc_create("ioports", 0, NULL, &proc_ioports_operations);
- proc_create("iomem", 0, NULL, &proc_iomem_operations);
+ proc_create("iomem", S_IRUSR, NULL, &proc_iomem_operations);
return 0;
}
__initcall(ioresources_init);