Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4819073ybl; Wed, 22 Jan 2020 05:21:26 -0800 (PST) X-Google-Smtp-Source: APXvYqx8cF7zsu1FaPTIcSvYcz9p6X13y4I482QM9znCLna7oQzsDYosniwLLGPseTtwFQVfIhCf X-Received: by 2002:aca:2407:: with SMTP id n7mr6792298oic.14.1579699286251; Wed, 22 Jan 2020 05:21:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699286; cv=none; d=google.com; s=arc-20160816; b=IrOyIoSXQSacYm8Cubozq2381Z7TOViaGojlnx5YQG8X6TorZrDyizHDh16KgnMA/A VNL9k5ltF1+yRQzGsw5gKZlOHnQe/hIHIgFhBBjarMCYTisdNjTseV+FWp5v0LAghRtJ 1wEjUG/8iBsjGhyN0f10Tlrwpmb7kCVxIU3U6AU4tXvQFgNZHzZ6y/ziecfSHPRKPVxg 68/8S5ZpRvg+w/xqZDe4lpcJgJ1Wo3AxBE+75hFFLpv7yXKOC3knqaNaQefJWJPx7BE5 rp+erURSKafsH/x7idc2L7O+KFNihuDl2BoPQZZFRuXA9zSLSM3KV9C+2/DMt+D+CPCG OlcQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=c+TZlpUWKj0j/vioD9B+duhsvK+pclXanUqFuPL91Vw=; b=cnYbnMFyq5QnxxejS+FKQIhCLDy8tMviAVMr+uQ4WaTTCM5U7adw4KzW6EGIHtjkEN bed40C9rI1iRg0bOoNGEW2nHgOV4VVtCDb1lk1aT2JGptfdv31Z+QjC0gVf+wuBx+LCU 9Gc0rz4j7jSwvQYexWqleLioLmtMlw8ra+mDcMLt7OL7mb4Zdijigo5I9/QoBFmIetUC TObdVzReLG8sVZ7OHI8NhqNCF3BAkipC/kLPq+cyXp/Ve2Vn5OCKbGE3U8Dw34YQScAO GCZo3IFXhlEcQRnlzJZx/vfJvcV10lcsvwwZYrfZSEjUlaRjMWdk6x5m110axG73Lbgy nNog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YrGdV6J8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d22si24194422oti.316.2020.01.22.05.21.14; Wed, 22 Jan 2020 05:21:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YrGdV6J8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729636AbgAVNTU (ORCPT + 99 others); Wed, 22 Jan 2020 08:19:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:35200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728665AbgAVNTT (ORCPT ); Wed, 22 Jan 2020 08:19:19 -0500 Received: from localhost (unknown [84.241.205.26]) (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 E61162467F; Wed, 22 Jan 2020 13:19:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699158; bh=MFlrl2mAvjcriUlNfYGIlpC6736k2fCgkJURBDnWGHY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YrGdV6J8NpkrFiWSmjsZUYqcU35ycTmPPnnayACp+u3wi3Iu0ktqF+7fzLOJ13ngX lQe+GiOTfKo91JfCqKmjX8UULdEB9Zi81SUlA4XBgSqqZxiti60IVExwLHkbS4zJbQ rAUm4Uwd5zzVCUgRivc3St6CwbP7RDi7+OvBN+hc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Esben Haabendal , Han Xu , Miquel Raynal Subject: [PATCH 5.4 058/222] mtd: rawnand: gpmi: Fix suspend/resume problem Date: Wed, 22 Jan 2020 10:27:24 +0100 Message-Id: <20200122092837.865067935@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Esben Haabendal commit 5bc6bb603b4d0c8802af75e4932232683ab2d761 upstream. On system resume, the gpmi clock must be enabled before accessing gpmi block. Without this, resume causes something like [ 661.348790] gpmi_reset_block(5cbb0f7e): module reset timeout [ 661.348889] gpmi-nand 1806000.gpmi-nand: Error setting GPMI : -110 [ 661.348928] PM: dpm_run_callback(): platform_pm_resume+0x0/0x44 returns -110 [ 661.348961] PM: Device 1806000.gpmi-nand failed to resume: error -110 Fixes: ef347c0cfd61 ("mtd: rawnand: gpmi: Implement exec_op") Cc: stable@vger.kernel.org Signed-off-by: Esben Haabendal Acked-by: Han Xu Signed-off-by: Miquel Raynal Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c @@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_da struct resources *r = &this->resources; int ret; + ret = pm_runtime_get_sync(this->dev); + if (ret < 0) + return ret; + ret = gpmi_reset_block(r->gpmi_regs, false); if (ret) goto err_out; @@ -179,8 +183,9 @@ static int gpmi_init(struct gpmi_nand_da */ writel(BM_GPMI_CTRL1_DECOUPLE_CS, r->gpmi_regs + HW_GPMI_CTRL1_SET); - return 0; err_out: + pm_runtime_mark_last_busy(this->dev); + pm_runtime_put_autosuspend(this->dev); return ret; }