Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2251229iof; Wed, 8 Jun 2022 00:31:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKUOQylaV/nFeIMcQOGZZc8sLH8yHCJZu9mIsgUQBz9ReI/k7zKFUyr/OqUrwbcpaefKxG X-Received: by 2002:a63:90c9:0:b0:3fc:f0c9:d0f with SMTP id a192-20020a6390c9000000b003fcf0c90d0fmr25859221pge.608.1654673461177; Wed, 08 Jun 2022 00:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654673461; cv=none; d=google.com; s=arc-20160816; b=Gz11Hz7Ykgoscm4a92vkKXBCO1ITFQGZ7erS45PAG2B9UzBEZ0V3qmaNbVVObPyJLO Cx/uE3w8x2LcRlIguDFusrUh7SeM6g/S2PTymhSKQ5oqXIc2UnWqukN50Wnzegpl+nIp LEtholFM+uKCCwbBUkRO/85OXzOOQkKyCxTt/9D+dFjRBOw/0N10dvZ8uc9iXIAPzWxh DTA+eVwnlwfYg4eearNkQmQVDtstkPR3Cwuquzzh1Q6qUn6WntlWq1CB7W3S4eE81Czb n8C+Zh9fmcucUJw9S6pVIe+UXwqhQTUlLNTH7rpBfzUq6HhWkC4t5HPbygDDh+9DSPS1 +B9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RWE+2mFoKed7WlNo6OopQlPUg+5LH0qrMaM4c4bGsV0=; b=P7olKYPAhuDFsynAG/n2CbYRlNf2NRKXElSb20olksvBzQKhk2bYTfvThW0JNfXzqQ lCc1DgMUud/5EEoTtYZA3iT+afShEgvFFe78ibx6MkM0xTZadSKo8q/yBwl3Wq/axiO6 h64yKn6WtQ2+HKg9sso+v0r7MCAZemuQU66FeAXIsHrV7VUQSqNBPY19ybkBUvxe/Wur 8IEWFkNUmlKXFdvPB6qk9xpUrKoqjuW+u0zA5379kl9F5XRwI50nZMY31BvX54ak8ZlK kru5ToW+90zTSnfxII8ZsKJainpEVtyQSuP6uOzXLTuz1xBQxKruEpDGIOO88K61Fu6a dzXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0L1AgPgl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h2-20020a63e142000000b003fc75297698si27532151pgk.36.2022.06.08.00.30.48; Wed, 08 Jun 2022 00:31:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0L1AgPgl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346098AbiFGRYC (ORCPT + 99 others); Tue, 7 Jun 2022 13:24:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345898AbiFGRTu (ORCPT ); Tue, 7 Jun 2022 13:19:50 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BF8F106565; Tue, 7 Jun 2022 10:19:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 050CDCE2017; Tue, 7 Jun 2022 17:19:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBAE5C385A5; Tue, 7 Jun 2022 17:19:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654622383; bh=irNiHLPnjDX5xM02HqZO7BlPyD+MMDTayUwBSi+oCtk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0L1AgPglS9waJgiUpT7npzXegfIXmPj6ch6hTdumh+72iSlWD2/jnxwq8OIsolpxC rPI4PfTevUM+uzD7uwRi452uXn4nI7uY2s+dW62BzJRljrafdhrIBN+1nPRZ39I6YM RiYKusPnUozX7hthrKPWhsDJ/O/N3JZDYBN5tF1Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Biju Das , Vinod Koul , Geert Uytterhoeven , Mark Brown , Sasha Levin Subject: [PATCH 5.10 040/452] spi: spi-rspi: Remove setting {src,dst}_{addr,addr_width} based on DMA direction Date: Tue, 7 Jun 2022 18:58:17 +0200 Message-Id: <20220607164909.742833226@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Biju Das [ Upstream commit 6f381481a5b236cb53d6de2c49c6ef83a4d0f432 ] The direction field in the DMA config is deprecated. The rspi driver sets {src,dst}_{addr,addr_width} based on the DMA direction and it results in dmaengine_slave_config() failure as RZ DMAC driver validates {src,dst}_addr_width values independent of DMA direction. This patch fixes the issue by passing both {src,dst}_{addr,addr_width} values independent of DMA direction. Signed-off-by: Biju Das Suggested-by: Vinod Koul Reviewed-by: Vinod Koul Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220411173115.6619-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-rspi.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index e39fd38f5180..ea03cc589e61 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c @@ -1107,14 +1107,11 @@ static struct dma_chan *rspi_request_dma_chan(struct device *dev, } memset(&cfg, 0, sizeof(cfg)); + cfg.dst_addr = port_addr + RSPI_SPDR; + cfg.src_addr = port_addr + RSPI_SPDR; + cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE; + cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE; cfg.direction = dir; - if (dir == DMA_MEM_TO_DEV) { - cfg.dst_addr = port_addr; - cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE; - } else { - cfg.src_addr = port_addr; - cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE; - } ret = dmaengine_slave_config(chan, &cfg); if (ret) { @@ -1145,12 +1142,12 @@ static int rspi_request_dma(struct device *dev, struct spi_controller *ctlr, } ctlr->dma_tx = rspi_request_dma_chan(dev, DMA_MEM_TO_DEV, dma_tx_id, - res->start + RSPI_SPDR); + res->start); if (!ctlr->dma_tx) return -ENODEV; ctlr->dma_rx = rspi_request_dma_chan(dev, DMA_DEV_TO_MEM, dma_rx_id, - res->start + RSPI_SPDR); + res->start); if (!ctlr->dma_rx) { dma_release_channel(ctlr->dma_tx); ctlr->dma_tx = NULL; -- 2.35.1