Merge "msm_11ad: copy FW crash dump before starting SSR flow"
This commit is contained in:
commit
3e6592af2d
1 changed files with 26 additions and 21 deletions
|
@ -750,6 +750,25 @@ static int msm_11ad_ssr_powerup(const struct subsys_desc *subsys)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int msm_11ad_ssr_copy_ramdump(struct msm11ad_ctx *ctx)
|
||||||
|
{
|
||||||
|
if (ctx->rops.ramdump && ctx->wil_handle) {
|
||||||
|
int rc = ctx->rops.ramdump(ctx->wil_handle, ctx->ramdump_addr,
|
||||||
|
WIGIG_RAMDUMP_SIZE);
|
||||||
|
if (rc) {
|
||||||
|
dev_err(ctx->dev, "ramdump failed : %d\n", rc);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx->dump_data.version = WIGIG_DUMP_FORMAT_VER;
|
||||||
|
strlcpy(ctx->dump_data.name, WIGIG_SUBSYS_NAME,
|
||||||
|
sizeof(ctx->dump_data.name));
|
||||||
|
|
||||||
|
ctx->dump_data.magic = WIGIG_DUMP_MAGIC_VER_V1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int msm_11ad_ssr_ramdump(int enable, const struct subsys_desc *subsys)
|
static int msm_11ad_ssr_ramdump(int enable, const struct subsys_desc *subsys)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
@ -766,13 +785,10 @@ static int msm_11ad_ssr_ramdump(int enable, const struct subsys_desc *subsys)
|
||||||
if (!enable)
|
if (!enable)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (ctx->rops.ramdump && ctx->wil_handle) {
|
if (!ctx->recovery_in_progress) {
|
||||||
rc = ctx->rops.ramdump(ctx->wil_handle, ctx->ramdump_addr,
|
rc = msm_11ad_ssr_copy_ramdump(ctx);
|
||||||
WIGIG_RAMDUMP_SIZE);
|
if (rc)
|
||||||
if (rc) {
|
return rc;
|
||||||
dev_err(ctx->dev, "ramdump failed : %d\n", rc);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&segment, 0, sizeof(segment));
|
memset(&segment, 0, sizeof(segment));
|
||||||
|
@ -784,7 +800,6 @@ static int msm_11ad_ssr_ramdump(int enable, const struct subsys_desc *subsys)
|
||||||
|
|
||||||
static void msm_11ad_ssr_crash_shutdown(const struct subsys_desc *subsys)
|
static void msm_11ad_ssr_crash_shutdown(const struct subsys_desc *subsys)
|
||||||
{
|
{
|
||||||
int rc;
|
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
struct msm11ad_ctx *ctx;
|
struct msm11ad_ctx *ctx;
|
||||||
|
|
||||||
|
@ -796,19 +811,8 @@ static void msm_11ad_ssr_crash_shutdown(const struct subsys_desc *subsys)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->rops.ramdump && ctx->wil_handle) {
|
if (!ctx->recovery_in_progress)
|
||||||
rc = ctx->rops.ramdump(ctx->wil_handle, ctx->ramdump_addr,
|
(void)msm_11ad_ssr_copy_ramdump(ctx);
|
||||||
WIGIG_RAMDUMP_SIZE);
|
|
||||||
if (rc)
|
|
||||||
dev_err(ctx->dev, "ramdump failed : %d\n", rc);
|
|
||||||
/* continue */
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx->dump_data.version = WIGIG_DUMP_FORMAT_VER;
|
|
||||||
strlcpy(ctx->dump_data.name, WIGIG_SUBSYS_NAME,
|
|
||||||
sizeof(ctx->dump_data.name));
|
|
||||||
|
|
||||||
ctx->dump_data.magic = WIGIG_DUMP_MAGIC_VER_V1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void msm_11ad_ssr_deinit(struct msm11ad_ctx *ctx)
|
static void msm_11ad_ssr_deinit(struct msm11ad_ctx *ctx)
|
||||||
|
@ -1305,6 +1309,7 @@ static int msm_11ad_notify_crash(struct msm11ad_ctx *ctx)
|
||||||
|
|
||||||
if (ctx->subsys) {
|
if (ctx->subsys) {
|
||||||
dev_info(ctx->dev, "SSR requested\n");
|
dev_info(ctx->dev, "SSR requested\n");
|
||||||
|
(void)msm_11ad_ssr_copy_ramdump(ctx);
|
||||||
ctx->recovery_in_progress = true;
|
ctx->recovery_in_progress = true;
|
||||||
rc = subsystem_restart_dev(ctx->subsys);
|
rc = subsystem_restart_dev(ctx->subsys);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue