From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-co1nam03on0122.outbound.protection.outlook.com ([104.47.40.122]:38374 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729450AbeIOGud (ORCPT ); Sat, 15 Sep 2018 02:50:33 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Andy Shevchenko , Vinod Koul , Sasha Levin Subject: [PATCH AUTOSEL 4.14 50/57] dmaengine: idma64: Support dmaengine_terminate_sync() Date: Sat, 15 Sep 2018 01:33:00 +0000 Message-ID: <20180915013223.179909-50-alexander.levin@microsoft.com> References: <20180915013223.179909-1-alexander.levin@microsoft.com> In-Reply-To: <20180915013223.179909-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Andy Shevchenko [ Upstream commit bbacb8e78a3b29ebdbb6af7d54fcf25d3f1c248f ] It appears that the driver misses the support of dmaengine_terminate_sync()= . Since many of callers expects this behaviour implement the new device_synchronize() callback to allow proper synchronization when stopping a channel. Fixes: b36f09c3c441 ("dmaengine: Add transfer termination synchronization s= upport") Signed-off-by: Andy Shevchenko Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/idma64.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/dma/idma64.c b/drivers/dma/idma64.c index 1953e57505f4..2ee93cf98f00 100644 --- a/drivers/dma/idma64.c +++ b/drivers/dma/idma64.c @@ -496,6 +496,13 @@ static int idma64_terminate_all(struct dma_chan *chan) return 0; } =20 +static void idma64_synchronize(struct dma_chan *chan) +{ + struct idma64_chan *idma64c =3D to_idma64_chan(chan); + + vchan_synchronize(&idma64c->vchan); +} + static int idma64_alloc_chan_resources(struct dma_chan *chan) { struct idma64_chan *idma64c =3D to_idma64_chan(chan); @@ -583,6 +590,7 @@ static int idma64_probe(struct idma64_chip *chip) idma64->dma.device_pause =3D idma64_pause; idma64->dma.device_resume =3D idma64_resume; idma64->dma.device_terminate_all =3D idma64_terminate_all; + idma64->dma.device_synchronize =3D idma64_synchronize; =20 idma64->dma.src_addr_widths =3D IDMA64_BUSWIDTHS; idma64->dma.dst_addr_widths =3D IDMA64_BUSWIDTHS; --=20 2.17.1