Loading drivers/soc/qcom/peripheral-loader.c +9 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ static void __iomem *pil_info_base; static int proxy_timeout_ms = -1; module_param(proxy_timeout_ms, int, S_IRUGO | S_IWUSR); static bool disable_timeouts; /** * struct pil_mdt - Representation of <name>.mdt file in memory * @hdr: ELF32 header Loading Loading @@ -939,6 +940,10 @@ EXPORT_SYMBOL(pil_free_memory); static DEFINE_IDA(pil_ida); bool is_timeout_disabled(void) { return disable_timeouts; } /** * pil_desc_init() - Initialize a pil descriptor * @desc: descriptor to intialize Loading Loading @@ -1078,6 +1083,10 @@ static int __init msm_pil_init(void) pr_warn("pil: could not map imem region\n"); goto out; } if (__raw_readl(pil_info_base) == 0x53444247) { pr_info("pil: pil-imem set to disable pil timeouts\n"); disable_timeouts = true; } for (i = 0; i < resource_size(&res)/sizeof(u32); i++) writel_relaxed(0, pil_info_base + (i * sizeof(u32))); Loading drivers/soc/qcom/peripheral-loader.h +3 −1 Original line number Diff line number Diff line /* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2010-2016, 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 Loading Loading @@ -110,6 +110,7 @@ extern int pil_assign_mem_to_subsys_and_linux(struct pil_desc *desc, phys_addr_t addr, size_t size); extern int pil_reclaim_mem(struct pil_desc *desc, phys_addr_t addr, size_t size, int VMid); extern bool is_timeout_disabled(void); #else static inline int pil_desc_init(struct pil_desc *desc) { return 0; } static inline int pil_boot(struct pil_desc *desc) { return 0; } Loading Loading @@ -144,6 +145,7 @@ static inline int pil_reclaim_mem(struct pil_desc *desc, phys_addr_t addr, { return 0; } extern bool is_timeout_disabled(void) { return false; } #endif #endif drivers/soc/qcom/pil-msa.c +11 −8 Original line number Diff line number Diff line Loading @@ -238,10 +238,11 @@ static int pil_msa_wait_for_mba_ready(struct q6v5_data *drv) struct device *dev = drv->desc.dev; int ret; u32 status; u64 val = is_timeout_disabled() ? 0 : pbl_mba_boot_timeout_ms * 1000; /* Wait for PBL completion. */ ret = readl_poll_timeout(drv->rmb_base + RMB_PBL_STATUS, status, status != 0, POLL_INTERVAL_US, pbl_mba_boot_timeout_ms * 1000); status != 0, POLL_INTERVAL_US, val); if (ret) { dev_err(dev, "PBL boot timed out\n"); return ret; Loading @@ -253,7 +254,7 @@ static int pil_msa_wait_for_mba_ready(struct q6v5_data *drv) /* Wait for MBA completion. */ ret = readl_poll_timeout(drv->rmb_base + RMB_MBA_STATUS, status, status != 0, POLL_INTERVAL_US, pbl_mba_boot_timeout_ms * 1000); status != 0, POLL_INTERVAL_US, val); if (ret) { dev_err(dev, "MBA boot timed out\n"); return ret; Loading Loading @@ -318,13 +319,14 @@ int __pil_mss_deinit_image(struct pil_desc *pil, bool err_path) int ret = 0; struct device *dma_dev = drv->mba_mem_dev_fixed ?: &drv->mba_mem_dev; s32 status; u64 val = is_timeout_disabled() ? 0 : pbl_mba_boot_timeout_ms * 1000; if (err_path) { writel_relaxed(CMD_PILFAIL_NFY_MBA, drv->rmb_base + RMB_MBA_COMMAND); ret = readl_poll_timeout(drv->rmb_base + RMB_MBA_STATUS, status, status == STATUS_MBA_UNLOCKED || status < 0, POLL_INTERVAL_US, pbl_mba_boot_timeout_ms * 1000); POLL_INTERVAL_US, val); if (ret) dev_err(pil->dev, "MBA region unlock timed out\n"); else if (status < 0) Loading Loading @@ -649,6 +651,7 @@ static int pil_msa_auth_modem_mdt(struct pil_desc *pil, const u8 *metadata, s32 status; int ret; struct device *dma_dev = drv->mba_mem_dev_fixed ?: &drv->mba_mem_dev; u64 val = is_timeout_disabled() ? 0 : modem_auth_timeout_ms * 1000; DEFINE_DMA_ATTRS(attrs); Loading Loading @@ -687,7 +690,7 @@ static int pil_msa_auth_modem_mdt(struct pil_desc *pil, const u8 *metadata, writel_relaxed(CMD_META_DATA_READY, drv->rmb_base + RMB_MBA_COMMAND); ret = readl_poll_timeout(drv->rmb_base + RMB_MBA_STATUS, status, status == STATUS_META_DATA_AUTH_SUCCESS || status < 0, POLL_INTERVAL_US, modem_auth_timeout_ms * 1000); POLL_INTERVAL_US, val); if (ret) { dev_err(pil->dev, "MBA authentication of headers timed out\n"); } else if (status < 0) { Loading Loading @@ -765,11 +768,11 @@ static int pil_msa_mba_auth(struct pil_desc *pil) int ret; struct device *dma_dev = drv->mba_mem_dev_fixed ?: &drv->mba_mem_dev; s32 status; u64 val = is_timeout_disabled() ? 0 : modem_auth_timeout_ms * 1000; /* Wait for all segments to be authenticated or an error to occur */ ret = readl_poll_timeout(drv->rmb_base + RMB_MBA_STATUS, status, status == STATUS_AUTH_COMPLETE || status < 0, 50, modem_auth_timeout_ms * 1000); status == STATUS_AUTH_COMPLETE || status < 0, 50, val); if (ret) { dev_err(pil->dev, "MBA authentication of image timed out\n"); } else if (status < 0) { Loading drivers/soc/qcom/subsystem_restart.c +4 −2 Original line number Diff line number Diff line Loading @@ -40,6 +40,8 @@ #include <asm/current.h> #include "peripheral-loader.h" #define DISABLE_SSR 0x9889deed /* If set to 0x9889deed, call to subsystem_restart_dev() returns immediately */ static uint disable_restart_work; Loading Loading @@ -597,8 +599,8 @@ static int wait_for_err_ready(struct subsys_device *subsys) * If subsys is using generic_irq in which case err_ready_irq will be 0, * don't return. */ if ((subsys->desc->generic_irq <= 0 && !subsys->desc->err_ready_irq) || enable_debug == 1) if ((subsys->desc->generic_irq <= 0 && !subsys->desc->err_ready_irq) || enable_debug == 1 || is_timeout_disabled()) return 0; ret = wait_for_completion_timeout(&subsys->err_ready, Loading Loading
drivers/soc/qcom/peripheral-loader.c +9 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ static void __iomem *pil_info_base; static int proxy_timeout_ms = -1; module_param(proxy_timeout_ms, int, S_IRUGO | S_IWUSR); static bool disable_timeouts; /** * struct pil_mdt - Representation of <name>.mdt file in memory * @hdr: ELF32 header Loading Loading @@ -939,6 +940,10 @@ EXPORT_SYMBOL(pil_free_memory); static DEFINE_IDA(pil_ida); bool is_timeout_disabled(void) { return disable_timeouts; } /** * pil_desc_init() - Initialize a pil descriptor * @desc: descriptor to intialize Loading Loading @@ -1078,6 +1083,10 @@ static int __init msm_pil_init(void) pr_warn("pil: could not map imem region\n"); goto out; } if (__raw_readl(pil_info_base) == 0x53444247) { pr_info("pil: pil-imem set to disable pil timeouts\n"); disable_timeouts = true; } for (i = 0; i < resource_size(&res)/sizeof(u32); i++) writel_relaxed(0, pil_info_base + (i * sizeof(u32))); Loading
drivers/soc/qcom/peripheral-loader.h +3 −1 Original line number Diff line number Diff line /* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2010-2016, 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 Loading Loading @@ -110,6 +110,7 @@ extern int pil_assign_mem_to_subsys_and_linux(struct pil_desc *desc, phys_addr_t addr, size_t size); extern int pil_reclaim_mem(struct pil_desc *desc, phys_addr_t addr, size_t size, int VMid); extern bool is_timeout_disabled(void); #else static inline int pil_desc_init(struct pil_desc *desc) { return 0; } static inline int pil_boot(struct pil_desc *desc) { return 0; } Loading Loading @@ -144,6 +145,7 @@ static inline int pil_reclaim_mem(struct pil_desc *desc, phys_addr_t addr, { return 0; } extern bool is_timeout_disabled(void) { return false; } #endif #endif
drivers/soc/qcom/pil-msa.c +11 −8 Original line number Diff line number Diff line Loading @@ -238,10 +238,11 @@ static int pil_msa_wait_for_mba_ready(struct q6v5_data *drv) struct device *dev = drv->desc.dev; int ret; u32 status; u64 val = is_timeout_disabled() ? 0 : pbl_mba_boot_timeout_ms * 1000; /* Wait for PBL completion. */ ret = readl_poll_timeout(drv->rmb_base + RMB_PBL_STATUS, status, status != 0, POLL_INTERVAL_US, pbl_mba_boot_timeout_ms * 1000); status != 0, POLL_INTERVAL_US, val); if (ret) { dev_err(dev, "PBL boot timed out\n"); return ret; Loading @@ -253,7 +254,7 @@ static int pil_msa_wait_for_mba_ready(struct q6v5_data *drv) /* Wait for MBA completion. */ ret = readl_poll_timeout(drv->rmb_base + RMB_MBA_STATUS, status, status != 0, POLL_INTERVAL_US, pbl_mba_boot_timeout_ms * 1000); status != 0, POLL_INTERVAL_US, val); if (ret) { dev_err(dev, "MBA boot timed out\n"); return ret; Loading Loading @@ -318,13 +319,14 @@ int __pil_mss_deinit_image(struct pil_desc *pil, bool err_path) int ret = 0; struct device *dma_dev = drv->mba_mem_dev_fixed ?: &drv->mba_mem_dev; s32 status; u64 val = is_timeout_disabled() ? 0 : pbl_mba_boot_timeout_ms * 1000; if (err_path) { writel_relaxed(CMD_PILFAIL_NFY_MBA, drv->rmb_base + RMB_MBA_COMMAND); ret = readl_poll_timeout(drv->rmb_base + RMB_MBA_STATUS, status, status == STATUS_MBA_UNLOCKED || status < 0, POLL_INTERVAL_US, pbl_mba_boot_timeout_ms * 1000); POLL_INTERVAL_US, val); if (ret) dev_err(pil->dev, "MBA region unlock timed out\n"); else if (status < 0) Loading Loading @@ -649,6 +651,7 @@ static int pil_msa_auth_modem_mdt(struct pil_desc *pil, const u8 *metadata, s32 status; int ret; struct device *dma_dev = drv->mba_mem_dev_fixed ?: &drv->mba_mem_dev; u64 val = is_timeout_disabled() ? 0 : modem_auth_timeout_ms * 1000; DEFINE_DMA_ATTRS(attrs); Loading Loading @@ -687,7 +690,7 @@ static int pil_msa_auth_modem_mdt(struct pil_desc *pil, const u8 *metadata, writel_relaxed(CMD_META_DATA_READY, drv->rmb_base + RMB_MBA_COMMAND); ret = readl_poll_timeout(drv->rmb_base + RMB_MBA_STATUS, status, status == STATUS_META_DATA_AUTH_SUCCESS || status < 0, POLL_INTERVAL_US, modem_auth_timeout_ms * 1000); POLL_INTERVAL_US, val); if (ret) { dev_err(pil->dev, "MBA authentication of headers timed out\n"); } else if (status < 0) { Loading Loading @@ -765,11 +768,11 @@ static int pil_msa_mba_auth(struct pil_desc *pil) int ret; struct device *dma_dev = drv->mba_mem_dev_fixed ?: &drv->mba_mem_dev; s32 status; u64 val = is_timeout_disabled() ? 0 : modem_auth_timeout_ms * 1000; /* Wait for all segments to be authenticated or an error to occur */ ret = readl_poll_timeout(drv->rmb_base + RMB_MBA_STATUS, status, status == STATUS_AUTH_COMPLETE || status < 0, 50, modem_auth_timeout_ms * 1000); status == STATUS_AUTH_COMPLETE || status < 0, 50, val); if (ret) { dev_err(pil->dev, "MBA authentication of image timed out\n"); } else if (status < 0) { Loading
drivers/soc/qcom/subsystem_restart.c +4 −2 Original line number Diff line number Diff line Loading @@ -40,6 +40,8 @@ #include <asm/current.h> #include "peripheral-loader.h" #define DISABLE_SSR 0x9889deed /* If set to 0x9889deed, call to subsystem_restart_dev() returns immediately */ static uint disable_restart_work; Loading Loading @@ -597,8 +599,8 @@ static int wait_for_err_ready(struct subsys_device *subsys) * If subsys is using generic_irq in which case err_ready_irq will be 0, * don't return. */ if ((subsys->desc->generic_irq <= 0 && !subsys->desc->err_ready_irq) || enable_debug == 1) if ((subsys->desc->generic_irq <= 0 && !subsys->desc->err_ready_irq) || enable_debug == 1 || is_timeout_disabled()) return 0; ret = wait_for_completion_timeout(&subsys->err_ready, Loading