From patchwork Fri Feb 14 07:43:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 11381833 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 24D0F13A4 for ; Fri, 14 Feb 2020 07:44:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 03BB524654 for ; Fri, 14 Feb 2020 07:44:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581666249; bh=r9zsX8XEd5qvEkHa91w0t4J/RKl8sONWqH+tDi0ymqs=; h=From:To:Cc:Subject:Date:List-ID:From; b=wMfE23BU14RKtsdrSferKtB0BLgKBVyTrcyfpoCDBhgNZkSOmQvf9nzySxe+ccQPU 2qcwEAiA7SItuqCn1jQwlsHAYyZjru6Iys/N0589eLMhTabTCuDst7avGMRhPB6n5o D88b45LRdvnJPABI1T/RtqZm60ajpeOuLrs2k6Oo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729004AbgBNHoI (ORCPT ); Fri, 14 Feb 2020 02:44:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:53084 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729007AbgBNHoI (ORCPT ); Fri, 14 Feb 2020 02:44:08 -0500 Received: from localhost.localdomain (unknown [106.201.58.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 01D28217F4; Fri, 14 Feb 2020 07:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581666247; bh=r9zsX8XEd5qvEkHa91w0t4J/RKl8sONWqH+tDi0ymqs=; h=From:To:Cc:Subject:Date:From; b=GcEmMQZylBRtSRVfyitzOcTSaKFgAMjy26oQgjgyR6KDKSD9fgHWi8755hIlKRE0S JEQhB1aVVBhfeUq33cr1ojO0MKYXvmJ0ZYvf5oGs9LAkZF1eg04ot5NaczXyb+vUxS XhA55DgrGY5B9e2c7tNFwKf1bP7g9DUXuMzsOJTc= From: Vinod Koul To: Mark Brown Cc: linux-arm-msm@vger.kernel.org, Bjorn Andersson , Yuji Sasaki , Andy Gross , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Vinod Koul Subject: [PATCH] spi: qup: call spi_qup_pm_resume_runtime before suspending Date: Fri, 14 Feb 2020 13:13:40 +0530 Message-Id: <20200214074340.2286170-1-vkoul@kernel.org> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Yuji Sasaki spi_qup_suspend() will cause synchronous external abort when runtime suspend is enabled and applied, as it tries to access SPI controller register while clock is already disabled in spi_qup_pm_suspend_runtime(). Signed-off-by: Yuji sasaki Signed-off-by: Vinod Koul --- drivers/spi/spi-qup.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c index dd3434a407ea..a364b99497e2 100644 --- a/drivers/spi/spi-qup.c +++ b/drivers/spi/spi-qup.c @@ -1217,6 +1217,11 @@ static int spi_qup_suspend(struct device *device) struct spi_qup *controller = spi_master_get_devdata(master); int ret; + if (pm_runtime_suspended(device)) { + ret = spi_qup_pm_resume_runtime(device); + if (ret) + return ret; + } ret = spi_master_suspend(master); if (ret) return ret; @@ -1225,10 +1230,8 @@ static int spi_qup_suspend(struct device *device) if (ret) return ret; - if (!pm_runtime_suspended(device)) { - clk_disable_unprepare(controller->cclk); - clk_disable_unprepare(controller->iclk); - } + clk_disable_unprepare(controller->cclk); + clk_disable_unprepare(controller->iclk); return 0; }