From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-eopbgr730120.outbound.protection.outlook.com ([40.107.73.120]:32793 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729449AbeIOGud (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 49/57] dmaengine: hsu: Support dmaengine_terminate_sync() Date: Sat, 15 Sep 2018 01:33:00 +0000 Message-ID: <20180915013223.179909-49-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 2abc66cd499aa16876e45c6438788902f7d1ce22 ] 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/hsu/hsu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/dma/hsu/hsu.c b/drivers/dma/hsu/hsu.c index 29d04ca71d52..202ffa9f7611 100644 --- a/drivers/dma/hsu/hsu.c +++ b/drivers/dma/hsu/hsu.c @@ -413,6 +413,13 @@ static void hsu_dma_free_chan_resources(struct dma_cha= n *chan) vchan_free_chan_resources(to_virt_chan(chan)); } =20 +static void hsu_dma_synchronize(struct dma_chan *chan) +{ + struct hsu_dma_chan *hsuc =3D to_hsu_dma_chan(chan); + + vchan_synchronize(&hsuc->vchan); +} + int hsu_dma_probe(struct hsu_dma_chip *chip) { struct hsu_dma *hsu; @@ -459,6 +466,7 @@ int hsu_dma_probe(struct hsu_dma_chip *chip) hsu->dma.device_pause =3D hsu_dma_pause; hsu->dma.device_resume =3D hsu_dma_resume; hsu->dma.device_terminate_all =3D hsu_dma_terminate_all; + hsu->dma.device_synchronize =3D hsu_dma_synchronize; =20 hsu->dma.src_addr_widths =3D HSU_DMA_BUSWIDTHS; hsu->dma.dst_addr_widths =3D HSU_DMA_BUSWIDTHS; --=20 2.17.1