Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754799AbbGOJ3s (ORCPT ); Wed, 15 Jul 2015 05:29:48 -0400 Received: from mail-bl2on0114.outbound.protection.outlook.com ([65.55.169.114]:11617 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752042AbbGOJ3o convert rfc822-to-8bit (ORCPT ); Wed, 15 Jul 2015 05:29:44 -0400 X-Greylist: delayed 368 seconds by postgrey-1.27 at vger.kernel.org; Wed, 15 Jul 2015 05:29:44 EDT From: Yao Yuan To: "vinod.koul@intel.com" CC: "dmaengine@vger.kernel.org" , "dan.j.williams@intel.com" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: RE: Re: [PATCH 2/2] dmaengine: fsl-edma: add PM suspend/resume support Thread-Topic: Re: [PATCH 2/2] dmaengine: fsl-edma: add PM suspend/resume support Thread-Index: AdC96bEFO+ZK29yLSGyPq8XIFPYfzQAACXGg Date: Wed, 15 Jul 2015 09:29:42 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none; x-originating-ip: [199.59.226.141] x-microsoft-exchange-diagnostics: 1;BL2PR03MB339;5:6y2ZnXNcJXTmgFD/IpNJYHkMBIitiyeZGXQYbIyHbe+M0XxfsUZn5dUP2DhLooRJ5Y1brSByvemgtZG5oOnZMxUs1l6RILyDt1N1aRv46FpAQmNZeHpPquAA4q6pJm2YFtNkPNsvk6m0wwHx1sk31g==;24:8CzxIG8zlYZn/8PlcSsib9iAot24Ll1qVqliQzE+0oQVyq9+tD/9gJK5vz/5+v6c6pGQowAu73BzqinaLeD7bWHI8cmfRQK4PivTN8yJpLo=;20:/gHxnE5tT4iM9tGmRuoPHGHdvX/8dWrBRsjhMD5QENwmNetvQv6SKdPrGK2voO/fXsu9J/dU3CNINEW+opFsrw== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB339; bl2pr03mb339: X-MS-Exchange-Organization-RulesExecuted x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BL2PR03MB339;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB339; x-forefront-prvs: 0638FD5066 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(24454002)(51704005)(377424004)(15975445007)(77156002)(77096005)(2900100001)(62966003)(2950100001)(102836002)(2351001)(1720100001)(5003600100002)(92566002)(122556002)(76176999)(40100003)(46102003)(189998001)(33656002)(2656002)(19580395003)(66066001)(5001960100002)(76576001)(4001150100001)(575784001)(86362001)(50986999)(87936001)(2501003)(5002640100001)(74316001)(19580405001)(110136002)(54356999);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR03MB339;H:BL2PR03MB338.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jul 2015 09:29:42.9987 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB339 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3756 Lines: 112 Hi Vinod, Thanks for your review, now I will take over the eDMA. I have some different in understanding with PM suspend/resume support. And I will send a patch for RFC later. Also please check my comment in line for this patch. I hope you can help to review it for me. Thanks. Best Regards, Yuan Yao On 2015-5-5 18:35, Vinod Koul wrote: > On 2014-12-30 09:41, Jingchang Lu wrote: > > This adds power management suspend/resume support for the fsl-edma > > driver. > > > > Signed-off-by: Jingchang Lu > > --- > > drivers/dma/fsl-edma.c | 38 > ++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 38 insertions(+) > > > > diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c index > > e0bd517..6a81699 100644 > > --- a/drivers/dma/fsl-edma.c > > +++ b/drivers/dma/fsl-edma.c > > @@ -1017,6 +1017,43 @@ static int fsl_edma_remove(struct > platform_device *pdev) > > return 0; > > } > > > > +#ifdef CONFIG_PM_SLEEP > > +static int fsl_edma_pm_suspend(struct device *dev) { > > + struct fsl_edma_engine *fsl_edma = dev_get_drvdata(dev); > > + struct fsl_edma_chan *fsl_chan; > > + int i; > > + > > + for (i = 0; i < fsl_edma->n_chans; i++) { > > + fsl_chan = &fsl_edma->chans[i]; > > + fsl_edma_chan_mux(fsl_chan, 0, false); > > + } > > + > > + return 0; > > +} > > + > > +static int fsl_edma_pm_resume(struct device *dev) { > > + struct fsl_edma_engine *fsl_edma = dev_get_drvdata(dev); > > + struct fsl_edma_chan *fsl_chan; > > + int i; > > + > > + for (i = 0; i < fsl_edma->n_chans; i++) { > > + fsl_chan = &fsl_edma->chans[i]; > > + edma_writew(fsl_edma, 0x0, fsl_edma->membase + > EDMA_TCD_CSR(i)); > > What is the expectation of the suspend mode, are the registers and descriptors > cleared during suspend? So this makes sure we have all descriptors disabled on > wake-up, right? Yes, suspend mode will power down the eDMA controller. > > > + /* restore the channel slave id configuration */ > > + fsl_edma_chan_mux(fsl_chan, fsl_chan->slave_id, true); > > And here the channel gets muxed again. > > But the user is expected to reconfigure a channel, e.g. using > dmaengine_slave_config and the dmaengine_prep*? Also and cyclic DMA > which has been paused before would be interrupted, is this correct? No, In fact the channel in eDMA is a little different form the other channel. Every IP just have only one channel. The IP should get his corresponding channel when boot up and release it until power down or IP removed. > I don't know what the common exception of the API is, I'm just asking so I now > what I can expect when using the DMA driver in other device drivers... > > -- > Stefan > > > + } > > + > > + edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, > > + fsl_edma->membase + EDMA_CR); > > + > > + return 0; > > +} > > +#endif > > +static > > +SIMPLE_DEV_PM_OPS(fsl_edma_pm_ops, fsl_edma_pm_suspend, > > +fsl_edma_pm_resume); > > + > > static const struct of_device_id fsl_edma_dt_ids[] = { > > { .compatible = "fsl,vf610-edma", }, > > { /* sentinel */ } > > @@ -1027,6 +1064,7 @@ static struct platform_driver fsl_edma_driver = { > > .driver = { > > .name = "fsl-edma", > > .of_match_table = fsl_edma_dt_ids, > > + .pm = &fsl_edma_pm_ops, > > }, > > .probe = fsl_edma_probe, > > .remove = fsl_edma_remove, > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/