Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4880914pjb; Mon, 27 Jul 2020 07:29:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCSxBQmQF/L5vrNA6/R2WFdJk8Syc25bRNFiqgveuB6ruW6HhZ87DtlqAjMSqbjU83T3NJ X-Received: by 2002:a05:6402:7d5:: with SMTP id u21mr4814343edy.235.1595860172011; Mon, 27 Jul 2020 07:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860172; cv=none; d=google.com; s=arc-20160816; b=dWDj2GDY7vaiEj8oHqqVZD0fpbRtTvp9kXXvr3Lk80cn6Xua5asAXyVFDmFttYZp1L jCwu2j36lKvUtwjHGjTl0qHK7TkPp/5lKPjx9WfPA02hM0qC603B92uj4BEVBVkI79+A 6pOHS9JI7NifbqhBrVJKqwVxm1J3+RBcs2r7RaFz6DuxbYkaVIZt8lHFmR/VyavOxVza rUs+n+6ItVte77TIl4rUE/QfP/3odRwl7qpgX7OBhRBge+WJXTicSvAFWg8126JQfGfx GbZWTIziOIporm1W9hvuHh8h2WsACXBNrK+yHJ3Mozxse46RVoYOkYZ5SH4etuMc2DBg Ez1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cghQrcGTgNRhYl/LAdkN+oUzbli1dJjjp+EXpHgrXqc=; b=j0mcmPeGVQvhkNY5M5FYKaUOlbYEaFAzLl16Jng4MviOhWr1M8AYslLXbJQFDBAZ2i t75+osFFA/BsIP7TNawWE4tJfrRX8Db9Ia1eXJ5ac7eAEDWQY+6t4wAqTUct2q98ayt0 zGmXtFS00Wdba6GyLo+6qhVJcQ+WgjLtjrdT3fJOQqsgHF9y8Fncoc0bA8voYAoRm2wx dnBoLbAA9QAdsxAfCMO8Alb8Y9ijyYOk8LdEDOFMc1r3KNjWT/f2ODQxw6FE5KZghNHP Z2KUzNdW4S5gyxfZUdYWNso5mqd/bpYyU1dOjR3SEFam3yqJYi73HGugrPa9D5VEgrst +0HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="HlZ/kfuc"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o10si5539087ejn.140.2020.07.27.07.29.09; Mon, 27 Jul 2020 07:29:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="HlZ/kfuc"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732256AbgG0O1x (ORCPT + 99 others); Mon, 27 Jul 2020 10:27:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:55160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730881AbgG0OZQ (ORCPT ); Mon, 27 Jul 2020 10:25:16 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1075D22B43; Mon, 27 Jul 2020 14:25:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859915; bh=myRiqgsrgu8L7BwSvXexwZdTgvqMXP0UprAQ0a3Razo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HlZ/kfucsHTK+a/XTARJpGkz36EQCd8gU4nRAoT9J0BnX/noIU2VQShJdzD6a9xQ0 xFxkqptTRVoEJzvrQfRRGuKQxH2dWFCkc/JewPQNoyiCgo/sYScUGPnhVfwxwj5iX3 1kjdecElzoIgJU/q58Wyy5MXkH7ouxtfsWy0RcbQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Angelo Dureghello , kbuild test robot , Vinod Koul , Sasha Levin Subject: [PATCH 5.7 115/179] dmaengine: fsl-edma: fix wrong tcd endianness for big-endian cpu Date: Mon, 27 Jul 2020 16:04:50 +0200 Message-Id: <20200727134938.256828085@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Angelo Dureghello [ Upstream commit 8678c71c17721e0f771f135967ef0cce8f69ce9a ] Due to recent fixes in m68k arch-specific I/O accessor macros, this driver is not working anymore for ColdFire. Fix wrong tcd endianness removing additional swaps, since edma_writex() functions should already take care of any eventual swap if needed. Note, i could only test the change in ColdFire mcf54415 and Vybrid vf50 / Colibri where i don't see any issue. So, every feedback and test for all other SoCs involved is really appreciated. Signed-off-by: Angelo Dureghello Reported-by: kbuild test robot Link: https://lore.kernel.org/r/20200701225205.1674463-1-angelo.dureghello@timesys.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/fsl-edma-common.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c index 5697c3622699b..9285884758b27 100644 --- a/drivers/dma/fsl-edma-common.c +++ b/drivers/dma/fsl-edma-common.c @@ -352,26 +352,28 @@ static void fsl_edma_set_tcd_regs(struct fsl_edma_chan *fsl_chan, /* * TCD parameters are stored in struct fsl_edma_hw_tcd in little * endian format. However, we need to load the TCD registers in - * big- or little-endian obeying the eDMA engine model endian. + * big- or little-endian obeying the eDMA engine model endian, + * and this is performed from specific edma_write functions */ edma_writew(edma, 0, ®s->tcd[ch].csr); - edma_writel(edma, le32_to_cpu(tcd->saddr), ®s->tcd[ch].saddr); - edma_writel(edma, le32_to_cpu(tcd->daddr), ®s->tcd[ch].daddr); - edma_writew(edma, le16_to_cpu(tcd->attr), ®s->tcd[ch].attr); - edma_writew(edma, le16_to_cpu(tcd->soff), ®s->tcd[ch].soff); + edma_writel(edma, (s32)tcd->saddr, ®s->tcd[ch].saddr); + edma_writel(edma, (s32)tcd->daddr, ®s->tcd[ch].daddr); - edma_writel(edma, le32_to_cpu(tcd->nbytes), ®s->tcd[ch].nbytes); - edma_writel(edma, le32_to_cpu(tcd->slast), ®s->tcd[ch].slast); + edma_writew(edma, (s16)tcd->attr, ®s->tcd[ch].attr); + edma_writew(edma, tcd->soff, ®s->tcd[ch].soff); - edma_writew(edma, le16_to_cpu(tcd->citer), ®s->tcd[ch].citer); - edma_writew(edma, le16_to_cpu(tcd->biter), ®s->tcd[ch].biter); - edma_writew(edma, le16_to_cpu(tcd->doff), ®s->tcd[ch].doff); + edma_writel(edma, (s32)tcd->nbytes, ®s->tcd[ch].nbytes); + edma_writel(edma, (s32)tcd->slast, ®s->tcd[ch].slast); - edma_writel(edma, le32_to_cpu(tcd->dlast_sga), + edma_writew(edma, (s16)tcd->citer, ®s->tcd[ch].citer); + edma_writew(edma, (s16)tcd->biter, ®s->tcd[ch].biter); + edma_writew(edma, (s16)tcd->doff, ®s->tcd[ch].doff); + + edma_writel(edma, (s32)tcd->dlast_sga, ®s->tcd[ch].dlast_sga); - edma_writew(edma, le16_to_cpu(tcd->csr), ®s->tcd[ch].csr); + edma_writew(edma, (s16)tcd->csr, ®s->tcd[ch].csr); } static inline -- 2.25.1