Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3618354pxb; Mon, 24 Jan 2022 13:38:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxOltRYoCUT0Gj4nzWq0PRf07q++deUbtPZqUvOgRslpa6eOF4Dx4RRVaWBtPoz+ZJr7XzY X-Received: by 2002:a63:8f02:: with SMTP id n2mr13533949pgd.270.1643060306933; Mon, 24 Jan 2022 13:38:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643060306; cv=none; d=google.com; s=arc-20160816; b=wENOt8rUHHQ6UcnYa1eDQ/t+7RPGMdBN/ziWKJX0CsXo5TasIZTIjFnd3guPEBsaZN dPxesELc+LAE5t4oVNUdIFcx28yKeGS2LT8YLShAtT7nskAnyzivb5Bcsp+LBvrNHsS4 VbE0oWfyfc8BFdAB3ncChmGBCtkeHlZXY2sqA7Hhfs9A4VCYOr/43Xxw8bZHviodlDOe dsIxVs71d6WWwxsSvmBHVkAkuiNy0qobPrZsA5y2C6G03FibyNK5NgzK6WEtdTYD3nfT PM72yAVM/NVhYswpIv+yr8aGTYy36F1ZEfP3p9LzNmArcDeLKHQ7xIGfCHI0rXizQ9ss 6Vsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=dirECEoakoO9/goeYDljZOmYzaKDm0NkWGs5awRwMsY=; b=WIpenLnAv9QJ3iPw6qCe/ap1M/2B2aQS5aL0L9QxlK+LWCuzZ2yyyRV8zd45DjETDK rjTM0IVtyncX8WMlsHpA66MztcdX8Xby7JMhRpr4Q+x2sFcptQoNL5IQwn5FKZH2dgIM jZrTGJdBaNobmcL4ZRGVKK47jwgXMlWKXOlengRYLY54PjfELCqr7RVnnAntU7qfMKHO qSdysmUa6DQ5uhLZPC+yMGdoCc6qnb1gynZmt1UdLP6V6dZ/EhvVE5Pu7Cdl2XUK6iL5 U5TMWHhcMrh2dNFR0pwlcNkQwMOKrrfigESBvh5/9s6nk40i2+lHpBey/qH23om3Vsc0 vKbQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b7si16412208pfl.232.2022.01.24.13.38.15; Mon, 24 Jan 2022 13:38:26 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1447057AbiAXVS2 (ORCPT + 99 others); Mon, 24 Jan 2022 16:18:28 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:56536 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1391925AbiAXUuE (ORCPT ); Mon, 24 Jan 2022 15:50:04 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id AB6CF1C0B76; Mon, 24 Jan 2022 21:41:48 +0100 (CET) Date: Mon, 24 Jan 2022 21:41:48 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Stefan Riedmueller , Christian Eggers , Han Xu , Miquel Raynal Subject: Re: [PATCH 5.4 007/320] mtd: rawnand: gpmi: Add ERR007117 protection for nfc_apply_timings Message-ID: <20220124204148.GB19321@duo.ucw.cz> References: <20220124183953.750177707@linuxfoundation.org> <20220124183954.021297586@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SkvwRMAIpAhPCcCJ" Content-Disposition: inline In-Reply-To: <20220124183954.021297586@linuxfoundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --SkvwRMAIpAhPCcCJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > commit f53d4c109a666bf1a4883b45d546fba079258717 upstream. >=20 > gpmi_io clock needs to be gated off when changing the parent/dividers of > enfc_clk_root (i.MX6Q/i.MX6UL) respectively qspi2_clk_root (i.MX6SX). > Otherwise this rate change can lead to an unresponsive GPMI core which > results in DMA timeouts and failed driver probe: =2E.. > @@ -2429,7 +2449,9 @@ static int gpmi_nfc_exec_op(struct nand_ > */ > if (this->hw.must_apply_timings) { > this->hw.must_apply_timings =3D false; > - gpmi_nfc_apply_timings(this); > + ret =3D gpmi_nfc_apply_timings(this); > + if (ret) > + return ret; > } > =20 > dev_dbg(this->dev, "%s: %d instructions\n", __func__, op->ninstrs); > AFAICT this leaks pm reference in the error case. Not sure what variant is right, there, so... Best regards, Pavel diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/= raw/gpmi-nand/gpmi-nand.c index 1b64c5a5140d..06840cff6945 100644 --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c @@ -2284,8 +2284,10 @@ static int gpmi_nfc_exec_op(struct nand_chip *chip, if (this->hw.must_apply_timings) { this->hw.must_apply_timings =3D false; ret =3D gpmi_nfc_apply_timings(this); - if (ret) + if (ret) { + pm_runtime_put_....(this->dev); return ret; + } } =20 dev_dbg(this->dev, "%s: %d instructions\n", __func__, op->ninstrs); --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --SkvwRMAIpAhPCcCJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCYe8PDAAKCRAw5/Bqldv6 8v7vAJoDfKtboxtAqFDCxbUgNCrwj/NDCwCgv3VjVjkIMPLCMGOdIpi+XjFLSjM= =C1YM -----END PGP SIGNATURE----- --SkvwRMAIpAhPCcCJ--