Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp4291599pxp; Tue, 15 Mar 2022 17:32:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2By3ACV+ZX0Gk1VQ8vOcg2186gfLz+KPpMTzeHWSI3bXB42Z7IHxlwSerw4FajxEEYP/j X-Received: by 2002:aa7:cc0a:0:b0:413:a674:7d33 with SMTP id q10-20020aa7cc0a000000b00413a6747d33mr27492418edt.369.1647390779579; Tue, 15 Mar 2022 17:32:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647390779; cv=none; d=google.com; s=arc-20160816; b=Olgs+4vfG9rPAzl6Y+I2N3qT6cF+sVjMnpJ19B1jkY4j7i+1DD9VbJxzA/WLoUmq0m 5eJwb17Oy3lVFIYIApqRJ9JJTLMMszMIRRD2RMVSn06Xy1t2pXt5146s0AOyIGzdQFuW zacFc5FhOD1ObmOXYLoOHDZNCU+eMln8jn8j0dmX29AVdD/D6oDywPqasNSbWR37kRh+ Nr13lCVnqeKtqQlxUYv0amkkKZmdxOTFCN4IUgAH32CYNZ95XeTzasZjy/8T20OXtBsP P2fcBQUZh+KX6GGrOemXG5ax9xcMegi+wBqCNn5H8BXb5h19PzG1mqHTiHL05Qf8ZrzM srZw== 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=T4GJRKm5NE4GFmdgAMZuARgRxAhbcQ5Fvc1N+oTWOLw=; b=uBjvRvk/YL/r7hoa5IrVog8ko/llBN14x7Ta3ORlXpdQvms9CG9R3SvPoD2dFHMeLY c56XH5Ooh/U5vQNATcNzR9YNQ2sBzRPfhYyQGUKoqcvzFwCUNL9F5GbeowtAvbEtjlbj 1ZdAabAqb00yUulW9p7VtN+dMah3rigM1GC4GHg7Sz10gPR9ycQAl4upc7SuvRpSaKF/ Bo44J0iKOZ/aXH3JPQI/ODNTsZg5fpVinkBIUjV1BZ0iHcw2YK4rbXKwZkVZSujIL7t4 FZmIPibDJDvwJCbF1dPmOiYBB9rgyl7UMVrL0eU6vTk99fNxxLR/gX1avfhsEhEBe1aK +lqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PZQLZbOn; 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 nb11-20020a1709071c8b00b006d90af95a8bsi344560ejc.369.2022.03.15.17.32.20; Tue, 15 Mar 2022 17:32:59 -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=PZQLZbOn; 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 S242156AbiCNMSs (ORCPT + 99 others); Mon, 14 Mar 2022 08:18:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242388AbiCNMJz (ORCPT ); Mon, 14 Mar 2022 08:09:55 -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 95CB91FCD4; Mon, 14 Mar 2022 05:07:37 -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 4ECADB80DEC; Mon, 14 Mar 2022 12:07:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F65CC340E9; Mon, 14 Mar 2022 12:07:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647259655; bh=4Fma61kxyBtoEpmgucDXrTf9L5hhilvU5ts6daQFQuc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PZQLZbOnjcAaofkD1G+q7wK9o7HbCkP3icqBWLOs6lv6/zsDOe7B4hjPMBMMcXYPe vvgLtw+oaS+6Bo7mNdJ4JA7EO39xRLuk+Xvs3lnl86sp7C+ODEQ5cp9eNlzs/px8XA 9LAqby06fREmPTaS56IiU8a0DBvoYVtaov1M/i2o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jon Lin , Mark Brown , Sasha Levin Subject: [PATCH 5.15 059/110] spi: rockchip: terminate dma transmission when slave abort Date: Mon, 14 Mar 2022 12:54:01 +0100 Message-Id: <20220314112744.682396436@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112743.029192918@linuxfoundation.org> References: <20220314112743.029192918@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.6 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: Jon Lin [ Upstream commit 80808768e41324d2e23de89972b5406c1020e6e4 ] After slave abort, all DMA should be stopped, or it will affect the next transmission and maybe abort again. Signed-off-by: Jon Lin Link: https://lore.kernel.org/r/20220216014028.8123-3-jon.lin@rock-chips.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-rockchip.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 4f65ba3dd19c..c6a1bb09be05 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -585,6 +585,12 @@ static int rockchip_spi_slave_abort(struct spi_controller *ctlr) { struct rockchip_spi *rs = spi_controller_get_devdata(ctlr); + if (atomic_read(&rs->state) & RXDMA) + dmaengine_terminate_sync(ctlr->dma_rx); + if (atomic_read(&rs->state) & TXDMA) + dmaengine_terminate_sync(ctlr->dma_tx); + atomic_set(&rs->state, 0); + spi_enable_chip(rs, false); rs->slave_abort = true; spi_finalize_current_transfer(ctlr); -- 2.34.1