From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 057A512FF72 for ; Fri, 4 Oct 2024 07:21:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728026511; cv=none; b=Bkzijl+ovTKGq8Ykvdujm0qbJ3EkSMTIiJajYACazy3LJtzCDvMswyewbOBfDhfrJmq0QWp+oNIwOBi4n0zQLxHpcU78Ns9o5cWO2wFAW+0ikK0t9EgQXAp5qXTzScqzplJBc3VxkHTFFt/5qf5uhUy4azFiLr8j540WT3COQ30= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728026511; c=relaxed/simple; bh=wbOJ7mRuz12sXrxgb8Gruc0IjSMNRZiQXSCKn6islOc=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dTOQEqxhafkJTSeir9vXqIFj9QtRZCRHL2IdZh6smHapa9O//RuMzXKn3w7sRCoB984XMDCf4i8PPsY/8CoejWsC3KJsFh+xMD1qii7ohaWZUkUufvIWH71HVuui9CgLVCyjZpILYcUKo+1Ce4UCGAvtd5cce1hek7uoLIa/Gdc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=T2s4OCbS; arc=none smtp.client-ip=217.70.183.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="T2s4OCbS" Received: by mail.gandi.net (Postfix) with ESMTPSA id 0B0B01BF205; Fri, 4 Oct 2024 07:21:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1728026507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EB50ZWS7pX3weSaYhuDUsmGhx18VRAut/5Y88goDLAs=; b=T2s4OCbSOKMvGOHD6OxayLMLTxecMZym5OYdLujEe7H4xs0nCrgOAvHLLfNOa2GfC9cjWm 0pNeenGg0ExLblVpsEvQOeLHb1QhZ3l1v8GxuN/VOyZ9lX6pUmnoJYtCX5YVNiGA/ycR51 ShQINcdSv9RPwKw8QIzy6pI8TMh8iYxgRI/MHm8fWzKzmsYTgvQR+ma6mlA8Jsmbm55N4Q ffn/zyYmvXcPrdRFa5Xb0NkS+kJv5kURt2KxMKCz22acMTKuOfudWi5vMc7Gw8SlL+QeiH +w2l+R77SyZ/bz3JY0bKlpWDj8xk2w8zMEZJK5rsT8P0Gr04zosNtYL1Sh4Nnw== Date: Fri, 4 Oct 2024 09:21:44 +0200 From: Miquel Raynal To: Han Xu Cc: Richard Weinberger , Vignesh Raghavendra , imx@lists.linux.dev, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] mtd: nand: raw: gpmi: improve power management handling Message-ID: <20241004092144.3e0d89b5@xps-13> In-Reply-To: <20241003200508.x7tbf2lpbg6ngm7q@cozumel> References: <20241002153944.69733-1-han.xu@nxp.com> <20241002153944.69733-2-han.xu@nxp.com> <20241003093840.2965be20@xps-13> <20241003150500.uz2efay7kadu47if@cozumel> <20241003172820.50324192@xps-13> <20241003200508.x7tbf2lpbg6ngm7q@cozumel> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com Hi Han, han.xu@nxp.com wrote on Thu, 3 Oct 2024 15:05:08 -0500: > On 24/10/03 05:28PM, Miquel Raynal wrote: > > Hi Han, > >=20 > > han.xu@nxp.com wrote on Thu, 3 Oct 2024 10:05:16 -0500: > > =20 > > > On 24/10/03 09:38AM, Miquel Raynal wrote: =20 > > > > Hi Han, > > > >=20 > > > > han.xu@nxp.com wrote on Wed, 2 Oct 2024 10:39:44 -0500: > > > > =20 > > > > > The commit refactors the power management handling in the gpmi na= nd > > > > > driver. It removes redundant pm_runtime calls in the probe functi= on, > > > > > handles the pad control in suspend and resume, and moves the call= s to > > > > > acquire and release DMA channels to the runtime suspend and resume > > > > > functions. =20 > > > >=20 > > > > May I know the motivation to acquire and release the DMA channels > > > > during suspend? In general it seems like a different change which I= 'd > > > > prefer to see in its own commit with a justification. The rest looks > > > > ok otherwise. =20 > > >=20 > > > Hi Miquel, > > >=20 > > > Thanks for your comments. IMHO there is no much logic changes indeed,= just move > > > the dma channel acquire and release from system pm to the runtime pm,= releasing > > > the unused resources as early as possible. If you think it's necessar= y I will > > > split the patch into two parts. =20 > >=20 > > Actually I don't understand why these channels are released and > > acquired again. Does it make sense to do that in the (runtime) > > suspend/resume path? I'd be in favor of avoiding this extra > > configuration which as a first sight does not seem required here. =20 >=20 > Our local mxs-dma driver (will upstream the changes later) implemented th= e runtime > resume/suspend in channel alloc/release functions, so I did this in the g= pmi > nand driver suspend/resume path. I think it no longer makes sense. RPM takes care of the suppliers, at least since fw_devlink=3Drpm. Thanks, Miqu=C3=A8l From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 257DDCFA74F for ; Fri, 4 Oct 2024 07:21:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZqNlE0F5+PnP2KNTt+Tn0UXdbRBV6JRB4HK3Ic/xq4g=; b=vBUga+oUbGG5yR +CikbfwCXYDH+XBDcDE0jRhzIYo5iXNYXv2VC2iaeAXVHOt9m47bPkNkAA58Sn46FdDLn9q0eDWwl f3d6J6H1u9Xu8m7obg2yeuM/wE+zuvwcWVKe11LoPqsorNbzRpivzPEbUn67ShgsaY/e6cd1BsWZI VTCI0+/U7DIDlVTU/+8WOBGHI+lrdK0AGmRHH7MCtWC74F0Ckjqu/xGxbbYYFhApIWxN0D65aoBsf 6SO5tXqzXqS2Njt7WTybC9gvwajKqrC8uDPztb6mAitzEJ2rRtaIqtshZP6Y/MwbrnpLpltImlgoW TpLq+5AxjsfGYyy/SX5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1swcdN-0000000BDG7-3mdV; Fri, 04 Oct 2024 07:21:53 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1swcdK-0000000BDFM-0X1m for linux-mtd@lists.infradead.org; Fri, 04 Oct 2024 07:21:52 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 0B0B01BF205; Fri, 4 Oct 2024 07:21:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1728026507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EB50ZWS7pX3weSaYhuDUsmGhx18VRAut/5Y88goDLAs=; b=T2s4OCbSOKMvGOHD6OxayLMLTxecMZym5OYdLujEe7H4xs0nCrgOAvHLLfNOa2GfC9cjWm 0pNeenGg0ExLblVpsEvQOeLHb1QhZ3l1v8GxuN/VOyZ9lX6pUmnoJYtCX5YVNiGA/ycR51 ShQINcdSv9RPwKw8QIzy6pI8TMh8iYxgRI/MHm8fWzKzmsYTgvQR+ma6mlA8Jsmbm55N4Q ffn/zyYmvXcPrdRFa5Xb0NkS+kJv5kURt2KxMKCz22acMTKuOfudWi5vMc7Gw8SlL+QeiH +w2l+R77SyZ/bz3JY0bKlpWDj8xk2w8zMEZJK5rsT8P0Gr04zosNtYL1Sh4Nnw== Date: Fri, 4 Oct 2024 09:21:44 +0200 From: Miquel Raynal To: Han Xu Cc: Richard Weinberger , Vignesh Raghavendra , imx@lists.linux.dev, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] mtd: nand: raw: gpmi: improve power management handling Message-ID: <20241004092144.3e0d89b5@xps-13> In-Reply-To: <20241003200508.x7tbf2lpbg6ngm7q@cozumel> References: <20241002153944.69733-1-han.xu@nxp.com> <20241002153944.69733-2-han.xu@nxp.com> <20241003093840.2965be20@xps-13> <20241003150500.uz2efay7kadu47if@cozumel> <20241003172820.50324192@xps-13> <20241003200508.x7tbf2lpbg6ngm7q@cozumel> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-GND-Sasl: miquel.raynal@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241004_002150_772734_AE6A7E46 X-CRM114-Status: GOOD ( 21.24 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org SGkgSGFuLAoKaGFuLnh1QG54cC5jb20gd3JvdGUgb24gVGh1LCAzIE9jdCAyMDI0IDE1OjA1OjA4 IC0wNTAwOgoKPiBPbiAyNC8xMC8wMyAwNToyOFBNLCBNaXF1ZWwgUmF5bmFsIHdyb3RlOgo+ID4g SGkgSGFuLAo+ID4gCj4gPiBoYW4ueHVAbnhwLmNvbSB3cm90ZSBvbiBUaHUsIDMgT2N0IDIwMjQg MTA6MDU6MTYgLTA1MDA6Cj4gPiAgIAo+ID4gPiBPbiAyNC8xMC8wMyAwOTozOEFNLCBNaXF1ZWwg UmF5bmFsIHdyb3RlOiAgCj4gPiA+ID4gSGkgSGFuLAo+ID4gPiA+IAo+ID4gPiA+IGhhbi54dUBu eHAuY29tIHdyb3RlIG9uIFdlZCwgIDIgT2N0IDIwMjQgMTA6Mzk6NDQgLTA1MDA6Cj4gPiA+ID4g ICAgIAo+ID4gPiA+ID4gVGhlIGNvbW1pdCByZWZhY3RvcnMgdGhlIHBvd2VyIG1hbmFnZW1lbnQg aGFuZGxpbmcgaW4gdGhlIGdwbWkgbmFuZAo+ID4gPiA+ID4gZHJpdmVyLiBJdCByZW1vdmVzIHJl ZHVuZGFudCBwbV9ydW50aW1lIGNhbGxzIGluIHRoZSBwcm9iZSBmdW5jdGlvbiwKPiA+ID4gPiA+ IGhhbmRsZXMg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