Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2928943rwb; Mon, 15 Aug 2022 14:14:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR4QNnX5g7Q3WJmbL/sPk8yx3+IujL4VGHmN5LbvOldQdxw6/tg3G5LFMd00szFfjihGi8po X-Received: by 2002:a05:6402:424d:b0:43e:95d8:eb46 with SMTP id g13-20020a056402424d00b0043e95d8eb46mr16387492edb.306.1660597980960; Mon, 15 Aug 2022 14:13:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597980; cv=none; d=google.com; s=arc-20160816; b=qA3qtEq6+JR4KiYuw8FhV4Dugx1wy0MHitWTGI7IkwJZ3fIigTckrhkMfsJ29SfjB6 oF06wJ44JT6rHkGYqlO/1XwXDqerXrt0DwuOxTqBfQJaDYAiVlAIRYWQS5s7GklGwEQ9 vfrjW+QY4GA5jXRUHvXhKbXQUIIP7P/kvU8yEVFqGnUPqL20whghZ0SJpQX0MxgvO2zz 3CTooJAcOPQbeFZ7NLKqdgVzT4+bri4nzawxSfe1foMmaSJSJvV5pF2/FF3OJdfkmQty 0VxKKMH0DjLHUTPk+y5DRpBckvJ/F1SE7S/k3+hmtmJgs9Cl3J1fUIN908A1J6aQg0DC yuuw== 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=1Cpc4/akoCBYaJH6GDy/OSNA/LtcCokNjdOS53D7hXE=; b=HeURxKFbzYHHyVreYUWm9g3YUhoF9GIzp6SWcQUDqfBJZx8WjBAFqM+xxoBssk3PB5 1za/pagylj9C5j9UtVmpxeyWJjusjgdtmreSfgHzZh2dlZEBzUudt1OrWJ+XZiHYz0pP 8KyabtQjYsdRcC5sui9BidCOlSSDTW0Garjf5wAaNVeEz56tGLbPJ4eLvWwysHOFvRVY /lOtTgSaVDdAazLbhqJSPLYnQfFBDNEJu1mjS4jPzSPQhLy9USK9XUxUS4+vxqLng9jN u20Fp4pzn1u36MgljIWEMm3lLZiQXkTu/MC/+1JldTqPhtH0TrjQy84H51ihLFsa7VBb 0DdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kHbDQoQc; 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 ga14-20020a1709070c0e00b007317e0f2b71si9481950ejc.256.2022.08.15.14.12.35; Mon, 15 Aug 2022 14:13:00 -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=kHbDQoQc; 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 S1348116AbiHOUcH (ORCPT + 99 others); Mon, 15 Aug 2022 16:32:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347747AbiHOU0f (ORCPT ); Mon, 15 Aug 2022 16:26:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8BF79DB5E; Mon, 15 Aug 2022 12:03:36 -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 AED52B810A2; Mon, 15 Aug 2022 19:03:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 170B0C433C1; Mon, 15 Aug 2022 19:03:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590201; bh=DnYtPbjqI8A7s1DpXgqq9UjiYSjr7NuAbLDSButeqbE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kHbDQoQc7G5tqvgHzKul6LLRAxCgTUXnVTPU8Gs0/uhQvQaD9RnwvDaMEDkpj+1hd emTsUQIQGjXkHZQGFtuE7RHWhzMnbEy5hWxyw6IyIvKvU+6rrvtIuTe1G/fjG4ucDr JKWlKNdyju75seYCADb9Mn3ADQs9vrRbojd6INfk= 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.18 0184/1095] spi: spi-rspi: Fix PIO fallback on RZ platforms Date: Mon, 15 Aug 2022 19:53:03 +0200 Message-Id: <20220815180437.252014191@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 7a014eeec2d0..411b1307b7fd 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c @@ -613,6 +613,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