Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1508653ybk; Thu, 21 May 2020 08:31:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydBjwLhVJht3zgZIaADnB3Hr4JWqJIdLBQJfpYmdlHZfr7p3GQoCJG1/H7s+PXUCgyb9NA X-Received: by 2002:a50:cdc8:: with SMTP id h8mr7983584edj.26.1590075063423; Thu, 21 May 2020 08:31:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590075063; cv=none; d=google.com; s=arc-20160816; b=nAjpT93mLbvlNFV1WiIIj+vHgDKXWDwEg0zZQmOg3iof8FtM8oveY3ES+Z9lFzY1HK QBp1Ht9hV1bRh3/qRQiHIpPz7VBHULlvKppOXfmuGuCdVfa0URTIW4nO8hp020DIisfQ YSmQaSswOpGKm1sIAzLU1B55CZQMMxJpT0WD5YcwAwfg4hSLgt+RDQCSQmJFsgKGNYDF HCIquo7bw1aAtgXfisoTeWc2sj+rkL+FhQfrgdwGc6lWVKmsiG7B+cQR15FJmUZ72sth RPOYQdOBiQ7C5sfhkeQ41nL+dginS7Y6PgGzYcUTwADzigGxlRSNL75/I03Uk3aPnwhB qZYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xAVD62mkOetGvA66My1Ty1xjZeKTQZHsUgJIUD/VK34=; b=HeLFysRMhWcrVXOl9vptzc6EKqUWGIgEiRCUB0iLc2YqE9wWxwlzF0lpKpvcWcA3yW S0rBLRq5nQKvsQet9A7XDi7+7L7DeJBuR93WAa946gG2UJySlmTJ4fxW0S2xY3wRKEeJ ++NFVnel13vfKsXue2xdxeqCBtlC1uefQDp7fDNOnSBt8BEqkFnJt8IoglGxCFbh+1Db 67d2DP54ZdglcGXgmDlJKVvk7lE7Xrsa8GzIyLMXaXhs4CBv4pyfwYPGQYUHq9kU8jBX ODJ7LsJ+6cy1cH4s92vyF7/aZWNjHxxK7BJ6/lwwmMYY+DLnN/TkShfH0DjPtYgedWYV 3AqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=a3NfqAWR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id me25si3383345ejb.481.2020.05.21.08.30.40; Thu, 21 May 2020 08:31:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=a3NfqAWR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730183AbgEUP02 (ORCPT + 99 others); Thu, 21 May 2020 11:26:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:34414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730489AbgEUP0Y (ORCPT ); Thu, 21 May 2020 11:26:24 -0400 Received: from localhost.localdomain (unknown [157.51.235.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3124D204EA; Thu, 21 May 2020 15:26:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590074783; bh=L6ZqonRzSEXb8hKcfMyie44fNPXrf3YYfGTd/z8s76c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a3NfqAWR2So1aLfECVlthuwsONVqfYav4YsqJ+IfUymZ1dLMYsfL4vtusAHUk1YyA KkKRHnPxVhlYTDJJCLcVU2pjp2t0sPjEc5GecJhnGowV1+4WXLLFv6xn5FFIQKuDQS lvUP/E6PW9ldVcvCKvaerETKRIm+drBZCHjV3/j4= From: mani@kernel.org To: gregkh@linuxfoundation.org Cc: hemantk@codeaurora.org, jhugo@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bhaumik Bhatt , Manivannan Sadhasivam Subject: [PATCH 07/14] bus: mhi: core: Improve debug logs for loading firmware Date: Thu, 21 May 2020 20:55:33 +0530 Message-Id: <20200521152540.17335-8-mani@kernel.org> X-Mailer: git-send-email 2.26.GIT In-Reply-To: <20200521152540.17335-1-mani@kernel.org> References: <20200521152540.17335-1-mani@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bhaumik Bhatt Add log messages to track boot flow errors and timeouts in SBL or AMSS firmware loading to aid in debug. Signed-off-by: Bhaumik Bhatt Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Signed-off-by: Manivannan Sadhasivam --- drivers/bus/mhi/core/boot.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/bus/mhi/core/boot.c b/drivers/bus/mhi/core/boot.c index cf6dc5a2361c..80e4d7609aaa 100644 --- a/drivers/bus/mhi/core/boot.c +++ b/drivers/bus/mhi/core/boot.c @@ -121,7 +121,8 @@ static int __mhi_download_rddm_in_panic(struct mhi_controller *mhi_cntrl) ee = mhi_get_exec_env(mhi_cntrl); } - dev_dbg(dev, "Waiting for image download completion, current EE: %s\n", + dev_dbg(dev, + "Waiting for RDDM image download via BHIe, current EE:%s\n", TO_MHI_EXEC_STR(ee)); while (retry--) { @@ -152,11 +153,14 @@ static int __mhi_download_rddm_in_panic(struct mhi_controller *mhi_cntrl) int mhi_download_rddm_img(struct mhi_controller *mhi_cntrl, bool in_panic) { void __iomem *base = mhi_cntrl->bhie; + struct device *dev = &mhi_cntrl->mhi_dev->dev; u32 rx_status; if (in_panic) return __mhi_download_rddm_in_panic(mhi_cntrl); + dev_dbg(dev, "Waiting for RDDM image download via BHIe\n"); + /* Wait for the image download to complete */ wait_event_timeout(mhi_cntrl->state_event, mhi_read_reg_field(mhi_cntrl, base, @@ -174,6 +178,7 @@ static int mhi_fw_load_amss(struct mhi_controller *mhi_cntrl, const struct mhi_buf *mhi_buf) { void __iomem *base = mhi_cntrl->bhie; + struct device *dev = &mhi_cntrl->mhi_dev->dev; rwlock_t *pm_lock = &mhi_cntrl->pm_lock; u32 tx_status, sequence_id; int ret; @@ -184,6 +189,7 @@ static int mhi_fw_load_amss(struct mhi_controller *mhi_cntrl, return -EIO; } + dev_dbg(dev, "Starting AMSS download via BHIe\n"); mhi_write_reg(mhi_cntrl, base, BHIE_TXVECADDR_HIGH_OFFS, upper_32_bits(mhi_buf->dma_addr)); @@ -435,7 +441,12 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl) release_firmware(firmware); /* Error or in EDL mode, we're done */ - if (ret || mhi_cntrl->ee == MHI_EE_EDL) + if (ret) { + dev_err(dev, "MHI did not load SBL, ret:%d\n", ret); + return; + } + + if (mhi_cntrl->ee == MHI_EE_EDL) return; write_lock_irq(&mhi_cntrl->pm_lock); @@ -463,8 +474,10 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl) if (!mhi_cntrl->fbc_download) return; - if (ret) + if (ret) { + dev_err(dev, "MHI did not enter READY state\n"); goto error_read; + } /* Wait for the SBL event */ ret = wait_event_timeout(mhi_cntrl->state_event, @@ -482,6 +495,8 @@ void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl) ret = mhi_fw_load_amss(mhi_cntrl, /* Vector table is the last entry */ &image_info->mhi_buf[image_info->entries - 1]); + if (ret) + dev_err(dev, "MHI did not load AMSS, ret:%d\n", ret); release_firmware(firmware); -- 2.26.GIT