From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755876AbbGQF4Y (ORCPT ); Fri, 17 Jul 2015 01:56:24 -0400 Received: from mail-bn1bon0133.outbound.protection.outlook.com ([157.56.111.133]:38640 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750872AbbGQF4X convert rfc822-to-8bit (ORCPT ); Fri, 17 Jul 2015 01:56:23 -0400 From: Yao Yuan To: Vinod Koul CC: "stefan@agner.ch" , "dan.j.williams@intel.com" , "dmaengine@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: RE: [PATCH] dmaengine: fsl-edma: add PM suspend/resume support Thread-Topic: [PATCH] dmaengine: fsl-edma: add PM suspend/resume support Thread-Index: AQHQvuIIHiVEsscjaU+Rwk9xSEcOnp3cRLQAgAHS7oCAAOVvwA== Date: Fri, 17 Jul 2015 05:41:55 +0000 Message-ID: References: <1436952778-28000-1-git-send-email-yao.yuan@freescale.com> <1436952778-28000-2-git-send-email-yao.yuan@freescale.com> <20150716132411.GX5086@localhost> In-Reply-To: <20150716132411.GX5086@localhost> 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: [192.158.241.86] x-microsoft-exchange-diagnostics: 1;BL2PR03MB338;5:Fi/MRa8nVWsLS0GHZzDrOOoP7TfaWYAXLOHIZRC8himA8Y/aX0sGXZ2mwalr4kuKB0LQpWd32xj2C3bfM/WFz55DTyst+gDoTu4BtVwYsJIqtbJfrSNZoIC1TDUbKAYZHlDZKeHsBxwFVCxm4qFrHg==;24:vUG6HuV4nfrNq2N3EmNyDr3DKuxQlCj4jskJ9amdauDPsR0imeyB4xQArd3uPNFHBByIE908zRDYTo3jgUxyyUS1EMXx6dhVPURuVlmwIzc=;20:4DJQpTj2I1WxZMpUWv4B6E5vY/M6lskYRIpuLGda+nwa1iT6ZM/QA/PniQ8ztMkMKPOt5GQF5zX/2dlUkhSO1w== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB338; bl2pr03mb338: 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:BL2PR03MB338;BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB338; x-forefront-prvs: 06400060E1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(24454002)(189998001)(99286002)(2950100001)(5003600100002)(2900100001)(40100003)(122556002)(62966003)(92566002)(74316001)(33656002)(77156002)(110136002)(5001960100002)(5002640100001)(77096005)(106116001)(66066001)(102836002)(86362001)(2656002)(76576001)(46102003)(54356999)(76176999)(50986999)(87936001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR03MB338;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: 17 Jul 2015 05:41:55.1207 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB338 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vinod, eDMA sullpies the data transmission service for other IPs, so it should be suspended later and resumed earlier. For example: Synchronous Audio Interface (SAI), SAI use DMA to transfer the data. When suspend: 1, SAI using suspend handlers to stop the DMA transmission. 2, DMA using suspend_late handlers to check whether DMA chan is idle. When resume: 1, DMA using resume_early to enable. And then can servicing for others. 2, SAI using resume and then can use DMA to data transmission. We must sure the order is right, so I think DMA should using early/late handlers. Thanks. Best Regards, Yuan Yao On Thursday, July 16, 2015 9:24 PM, Vinod wrote: > On Wed, Jul 15, 2015 at 05:32:58PM +0800, Yuan Yao wrote: > > + > > +static const struct dev_pm_ops fsl_edma_pm_ops = { > > + .suspend_late = fsl_edma_suspend_late, > > + .resume_early = fsl_edma_resume_early, > any reason why you are using early/late handlers? > > -- > ~Vinod From mboxrd@z Thu Jan 1 00:00:00 1970 From: yao.yuan@freescale.com (Yao Yuan) Date: Fri, 17 Jul 2015 05:41:55 +0000 Subject: [PATCH] dmaengine: fsl-edma: add PM suspend/resume support In-Reply-To: <20150716132411.GX5086@localhost> References: <1436952778-28000-1-git-send-email-yao.yuan@freescale.com> <1436952778-28000-2-git-send-email-yao.yuan@freescale.com> <20150716132411.GX5086@localhost> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Vinod, eDMA sullpies the data transmission service for other IPs, so it should be suspended later and resumed earlier. For example: Synchronous Audio Interface (SAI), SAI use DMA to transfer the data. When suspend: 1, SAI using suspend handlers to stop the DMA transmission. 2, DMA using suspend_late handlers to check whether DMA chan is idle. When resume: 1, DMA using resume_early to enable. And then can servicing for others. 2, SAI using resume and then can use DMA to data transmission. We must sure the order is right, so I think DMA should using early/late handlers. Thanks. Best Regards, Yuan Yao On Thursday, July 16, 2015 9:24 PM, Vinod wrote: > On Wed, Jul 15, 2015 at 05:32:58PM +0800, Yuan Yao wrote: > > + > > +static const struct dev_pm_ops fsl_edma_pm_ops = { > > + .suspend_late = fsl_edma_suspend_late, > > + .resume_early = fsl_edma_resume_early, > any reason why you are using early/late handlers? > > -- > ~Vinod