Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3513781rwa; Tue, 23 Aug 2022 06:05:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR6kOPJf3f/dnV+wr9LFusnbZv+xwvYHbwRsLTr1vOxYdJDxhhLULS+PG7rvUniwyOWrc29w X-Received: by 2002:aa7:8887:0:b0:536:7078:75f7 with SMTP id z7-20020aa78887000000b00536707875f7mr12834684pfe.82.1661259953172; Tue, 23 Aug 2022 06:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661259953; cv=none; d=google.com; s=arc-20160816; b=Rg0/qEUUM0JPTz5zjHHwaiQB+Qy0hCgKDFu5NqauOEfTF+0Pph1lkKM4/kJkc89qdz LkTL/1A7Uh9BZXFyelow5L4INwTcbcVfCRNaoJCp6pgeevxSGzD0nHfva9YMVTg2Kt7S nxqlK4N0obLQR4KZieLANtcdKIrxJ2QwaRXzk8OdfeCEMiyK2aahwOx7zYb/evgTtGYN ebXIp94X+TUzOi9FyKDt4xQwIoQHcF7QpRJDiyXpEehjZyxnLbbfop3z7w5NvaRK8FDb jJQTuk+aMfRIQp2v1xJRKfPCxrYsgbtdupo1T9yoP5+QtFys77r1UYbGMHoJBwtDSLp3 W2rw== 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=mVWUnncOCtt6VE+QYcWmt9zYCKUKLLcksREpQ9BofZk=; b=wfqGOBnPbPwXdD7NpeN2pZx0d+wnpQ0AT9T1rb10JXMicxVai6Auy2lP2ufEgO8S23 zSuo54ortaTvL2DsiYlWGLLB84YoaS/OssMBwBpedP3ar5kvAIEN4tf53wCRaixQIuB+ 9oDbjcTa7eosmtz+LYVw1u2jsOErCddxiOnTyjrUD+mcHjQOLXTvpdCv9xJYzhR2Vqq5 Fk6CrxY/4wHItYb3A1RronX/fHLPaZOluHBLIydBN+bjSJn5c8DxQ1zQWE2moK5l4pXQ vnfzr8uobEvaeBeUvtih0XMZIJYnm94uAte/fRNQOQOeGVikh7ge/8oL/chQN81QHrah PsVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xlWYIA9f; 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 na10-20020a17090b4c0a00b001ecf6b6f350si17423173pjb.42.2022.08.23.06.05.41; Tue, 23 Aug 2022 06:05:53 -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=xlWYIA9f; 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 S242726AbiHWLUD (ORCPT + 99 others); Tue, 23 Aug 2022 07:20:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352713AbiHWLO4 (ORCPT ); Tue, 23 Aug 2022 07:14:56 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E177CB942C; Tue, 23 Aug 2022 02:18:54 -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 A86C5B81C94; Tue, 23 Aug 2022 09:18:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E59F7C433D6; Tue, 23 Aug 2022 09:18:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661246322; bh=lpSj1NNhiHPnDfqWLUp3MPq8+c3a0hP1j7exSHushs0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xlWYIA9fgW99sFe0J7zo568Zz9XfxGYTrpq6NVePr4bEwMIheyl75AM/RGUkTRYEA RGfdvDNihfG9MsizFr+MhWSBG3d+IxvaVqI+aQ4VH2jXCiuTk8M334LvK3nMn/X+9Q AZRF4T9ns+V8xO34vdmz6EHDt/AB3W/f2AMTw7LE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Biju Das , Geert Uytterhoeven , Mark Brown , Sasha Levin Subject: [PATCH 5.4 073/389] spi: spi-rspi: Fix PIO fallback on RZ platforms Date: Tue, 23 Aug 2022 10:22:31 +0200 Message-Id: <20220823080118.688874692@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080115.331990024@linuxfoundation.org> References: <20220823080115.331990024@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 b620aa3a7be346f04ae7789b165937615c6ee8d3 ] RSPI IP on RZ/{A, G2L} SoC's has the same signal for both interrupt and DMA transfer request. Setting DMARS register for DMA transfer makes the signal to work as a DMA transfer request signal and subsequent interrupt requests to the interrupt controller are masked. PIO fallback does not work as interrupt signal is disabled. This patch fixes this issue by re-enabling the interrupts by calling dmaengine_synchronize(). Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220721143449.879257-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-rspi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index 0524741d73b9..8ae2ac40b4b2 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c @@ -595,6 +595,10 @@ static int rspi_dma_transfer(struct rspi_data *rspi, struct sg_table *tx, rspi->dma_callbacked, HZ); if (ret > 0 && rspi->dma_callbacked) { ret = 0; + if (tx) + dmaengine_synchronize(rspi->ctlr->dma_tx); + if (rx) + dmaengine_synchronize(rspi->ctlr->dma_rx); } else { if (!ret) { dev_err(&rspi->ctlr->dev, "DMA timeout\n"); -- 2.35.1