Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2810283rwb; Mon, 15 Aug 2022 11:48:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR7aAE1yQC7lVBMaJPimLZPA5HfjXz3DSVVDXtoS0XdQzW3SCKfzgffyjy4YiNXT8kwl4DGW X-Received: by 2002:a17:906:9749:b0:730:c005:5d59 with SMTP id o9-20020a170906974900b00730c0055d59mr11103050ejy.419.1660589290485; Mon, 15 Aug 2022 11:48:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660589290; cv=none; d=google.com; s=arc-20160816; b=GbCkvbjpVb3F2Td4H7UpkCJy56AZHl9foqun0Ujdf36w/oy8B0Zm82NbrGOMijNhHo baZ93suS6hotZ8D+e8uZsTj3hc13nca9RFiGX9QuOo6CesCSmSMG4+IEN8IG1nbR6iVW xWtHgubggQwO5RFcaMfYjNzj0OXk9XJiUDFD2hepbN7bxHQJiW0ij8CP2gyjtdvOqgl6 cv5SngVgrOa1KYrgg/PuGGCyzxqCtsHKg2xIe9ONSHDEZJWIgR/1cvg8hR0/FpVpK9Zt LiILlW30sxQgaum/mudjp2x6KTed0mLlnv6RIJYYYcXVfZ7IUoXfmOerOrjDk9tnHGAi yVpg== 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=mie9lNxCtyzusRfAtTvWHtml575eXINjAurncCae0GE=; b=qXZknpSgjWm4Bw+5IzOHcsRxDUMH3NJBCZ2HKTiMmybF3oG/x9vwBnx6YckId+z4hN hydKkmGwjLECmE8ZktZ+2O1Z8Fwn7bRZHA+sYPFk+pEc/CZLD9NnheBKhh3ucBZjeHWs rDPcTGzML0YwRqOxkFRC1v4ebjUZqdpZUvR+0dlOB23ZBlFR6cX3v99KJRxJvltce5Sj q70qCoPmi2yxRaV8l2hQbbDIJUx2VR/6lhPV94BHidbCj/gOMqxt3w5BiusHljkkuK3X D5LnaYyXSlgiHdZDh1ojSH+GWMxmfbBp8bJd1Dd5qEALcoqA2Nrc+inaF/wBFkdsc49T dtzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rYQJGFI4; 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 qa43-20020a17090786ab00b0072b7fa15683si9046817ejc.312.2022.08.15.11.47.44; Mon, 15 Aug 2022 11:48:10 -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=rYQJGFI4; 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 S243287AbiHOShm (ORCPT + 99 others); Mon, 15 Aug 2022 14:37:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244017AbiHOSgS (ORCPT ); Mon, 15 Aug 2022 14:36:18 -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 9C6AB3C15B; Mon, 15 Aug 2022 11:23:09 -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 87F0EB81071; Mon, 15 Aug 2022 18:23:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5398C433C1; Mon, 15 Aug 2022 18:23:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587786; bh=PYfW4qUNcV0ql8wYHgPWd/Nrk4am9nAFnFvDd23OFxw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rYQJGFI4InGsrqLZLWkkVEauqo4Q8hCXIcQatIxMq7xbCqH411lcuxyB4dSZ1pmqa bWhd99veAqatGPeV7OwGHqLcn3PlxJvgX4pdGumY/Q6gHJYK5AeifwSwff1z9WLI4J mGHW9JOGce+Bsh0QMubx8vUwSXExKhgJgiwvNBD0= 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.15 153/779] spi: spi-rspi: Fix PIO fallback on RZ platforms Date: Mon, 15 Aug 2022 19:56:37 +0200 Message-Id: <20220815180343.858223258@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 d575c935e9f0..f634a405382c 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c @@ -612,6 +612,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