Return-Path: Received: from mail-bl2nam02on0116.outbound.protection.outlook.com ([104.47.38.116]:50074 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753476AbeARVCt (ORCPT ); Thu, 18 Jan 2018 16:02:49 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Peter Ujfalusi , Tony Lindgren , Sasha Levin Subject: [added to the 4.1 stable tree] ARM: OMAP1: DMA: Correct the number of logical channels Date: Thu, 18 Jan 2018 21:00:30 +0000 Message-ID: <20180118205908.3220-124-alexander.levin@microsoft.com> References: <20180118205908.3220-1-alexander.levin@microsoft.com> In-Reply-To: <20180118205908.3220-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: Peter Ujfalusi This patch has been added to the stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit 657279778af54f35e54b07b6687918f254a2992c ] OMAP1510, OMAP5910 and OMAP310 have only 9 logical channels. OMAP1610, OMAP5912, OMAP1710, OMAP730, and OMAP850 have 16 logical channels available. The wired 17 for the lch_count must have been used to cover the 16 + 1 dedicated LCD channel, in reality we can only use 9 or 16 channels. The d->chan_count is not used by the omap-dma stack, so we can skip the setup. chan_count was configured to the number of logical channels and not the actual number of physical channels anyways. Signed-off-by: Peter Ujfalusi Acked-by: Aaro Koskinen Signed-off-by: Tony Lindgren Signed-off-by: Sasha Levin --- arch/arm/mach-omap1/dma.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-omap1/dma.c b/arch/arm/mach-omap1/dma.c index 4be601b638d7..8129e5f9c94d 100644 --- a/arch/arm/mach-omap1/dma.c +++ b/arch/arm/mach-omap1/dma.c @@ -31,7 +31,6 @@ #include =20 #define OMAP1_DMA_BASE (0xfffed800) -#define OMAP1_LOGICAL_DMA_CH_COUNT 17 =20 static u32 enable_1510_mode; =20 @@ -311,8 +310,6 @@ static int __init omap1_system_dma_init(void) goto exit_iounmap; } =20 - d->lch_count =3D OMAP1_LOGICAL_DMA_CH_COUNT; - /* Valid attributes for omap1 plus processors */ if (cpu_is_omap15xx()) d->dev_caps =3D ENABLE_1510_MODE; @@ -329,13 +326,14 @@ static int __init omap1_system_dma_init(void) d->dev_caps |=3D CLEAR_CSR_ON_READ; d->dev_caps |=3D IS_WORD_16; =20 - if (cpu_is_omap15xx()) - d->chan_count =3D 9; - else if (cpu_is_omap16xx() || cpu_is_omap7xx()) { - if (!(d->dev_caps & ENABLE_1510_MODE)) - d->chan_count =3D 16; + /* available logical channels */ + if (cpu_is_omap15xx()) { + d->lch_count =3D 9; + } else { + if (d->dev_caps & ENABLE_1510_MODE) + d->lch_count =3D 9; else - d->chan_count =3D 9; + d->lch_count =3D 16; } =20 p =3D dma_plat_info; --=20 2.11.0