Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2137831iof; Tue, 7 Jun 2022 21:01:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjhfgjja2TARIDuA4xN6s03GppFVaaEO2XwVUXSHAbUnJ+bcCo4li3HmRnPaWbqI7y8XdR X-Received: by 2002:a63:2b02:0:b0:3fa:fdcf:9c5b with SMTP id r2-20020a632b02000000b003fafdcf9c5bmr27766349pgr.448.1654660895456; Tue, 07 Jun 2022 21:01:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654660895; cv=none; d=google.com; s=arc-20160816; b=Ffi0apT6mVjpiCILos2YdBJ/3XygLDbWQd5U1HX3sVKm7CspXf8by1+vqtXwaNSWUx FfDj7jhdDigrxzZuJc18bQGeKurX6RQ+2b3R/Bn1AgXFqA7g4Reu50Y2wGp/NwV8KCmB pqxAzwKlelrwQNyThH/WcF6ZNLCn0uWg3XhVn6EGRqdTPEq+0391OT7lJBUBAgf2LSmd 6otBzjCDysHs+WeTrCv6kSQkOYRl72wHYGF2MQro+MKWz9TLi2FKSPvWwT+RpFGugiey 3w2VtqscNW0O+bw7NfjOdvp6PEpB2CXcb/lvWrLCsU9dYWr7nrvO5yGtBBCwpyCXgAty Qykw== 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=JDdcqFQ7nSxtgVMiXemngKtP/Sn3MlzqeuO9LBDDad4=; b=UtWObYxfoytl+LiPQBSlxLqijccfD+IstyySVceu93qqI+KIF+TKevig1m2BJZytXL 0HkhaBJ9icnN4RtO0Wh8pM17ZRAMhlI+IqzvbFvueCNnnI05ZtmGLsEWvEVvOuo0MMN9 nLor9bFFev7BXviz0W0eqIfc2ySTxawagRr8PR/bpbF7cOb8TRSR7sojzoURM25OPmcq oltwiaXmnUdlC/PyAafA3DLhHRyye2hVenuIZjdVk/+GfUg6vlik9If97MrZpC6wZZ86 hcTme8ZQAe42x75Un17ZEZAeOaergjeDyHAWmUkwi+b+CBX2TgclZ6W9F/cm/IiLs33g s7Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eaYQOARU; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u7-20020a170902e5c700b00166449db813si24050491plf.464.2022.06.07.21.01.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:01:35 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eaYQOARU; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6FED53B8812; Tue, 7 Jun 2022 20:31:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383989AbiFGWJ4 (ORCPT + 99 others); Tue, 7 Jun 2022 18:09:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379375AbiFGVFy (ORCPT ); Tue, 7 Jun 2022 17:05:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99AD318E47F; Tue, 7 Jun 2022 11:49:27 -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 ams.source.kernel.org (Postfix) with ESMTPS id 66B68B8220B; Tue, 7 Jun 2022 18:49:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5CECC385A2; Tue, 7 Jun 2022 18:49:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654627763; bh=MBi8JzpAoUKy5cp3Ar4hTl0Sf7G2CWS3MZih0JaaO5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eaYQOARUvcCIah9N7Jf9Ebkio8L0a8218aXOdTelKudiwDt26H+B60G9OxWJTkAu2 ZDERiarTFbDcPIa+nPXOBeVhd1Vgz5phNGMchhWq+vIt4K9tSg6Y6jFD5NebhFazOg szwFwW+UTJF/oLgNg9xia/zWVBPoJQNIPom/h7Uc= 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.18 084/879] spi: spi-rspi: Remove setting {src,dst}_{addr,addr_width} based on DMA direction Date: Tue, 7 Jun 2022 18:53:22 +0200 Message-Id: <20220607165005.129247587@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 bd5708d7e5a1..7a014eeec2d0 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c @@ -1108,14 +1108,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) { @@ -1146,12 +1143,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