Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2646393ybv; Mon, 24 Feb 2020 08:58:35 -0800 (PST) X-Google-Smtp-Source: APXvYqyC40JO0GfxFpeKr9iuxm6cpH9okH8PeeXWJgvPHttwnXNmUYYtF/XU7lbNZ/06SilwshMU X-Received: by 2002:aca:db56:: with SMTP id s83mr13587257oig.171.1582563515408; Mon, 24 Feb 2020 08:58:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582563515; cv=none; d=google.com; s=arc-20160816; b=tPE9Wcgw9i5GmnG84/GuoR+AnuUsei8qkoQF5Y25hMAcLFyA+o7cjxOAIvG0sl6PgH /T7arCvRVcQLvXnqwbbtRXtQyAaFizbsy8A7vhOijTXPbadOyb4Fw3H/Ca55Xlm2taJ3 EzwTCvOHm3+UDgLwXWA23D5ei/v35q/OsPxm8pmub6hJNRzv/r+RyDGtQq2CGMW7T6KB YtK6eeTOER7IaYniSe9yRI7xJyaCkH0eLrd6My6+38K76xNo4rWrG2QnTGbpNDshKySl ATNVv4EZV5ZxEAU/syPzbAgirNONmZoD7TLY8MN0sq9WW56w8C1LuUZ5eN7q7ZYDs0wN cCCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=xGTqg70R0HpY0K6wfmhSCIS58d/hyLR1ddd8O9ry1UM=; b=XhAFcYEY2m3AU+HWHzMTSKHe+Cu4XOoSRCAq6dSH2/Nyn7J831Scqfr19vg4Cc2R2U C1ipw+GkFjF2fjk14qwd3CWxWH7NSMwUBxMgJ9mScKWizBux27y9nwVbZRDQp7fb7OY6 TVYTJj1YTAzE/KLqEnNcAcJH/TcTUOFufkVPBmaUDl27+7Klkgdc93i1FD0ebhbhdbTy alvtweFsRl7ade52ucwCYmhGUSyz5OH3vFIYvaiM5Hn97Ig8U0FrwtCwC0c8loOPkY5+ zU/dV53CgvLvtdb3QxqU+oZ73YkxbsbuUOxp37xCSVwqIS9LzhB95tepP7cwGBghUKFL YgSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MSIX1bCx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a23si5217026oie.81.2020.02.24.08.58.22; Mon, 24 Feb 2020 08:58:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MSIX1bCx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727972AbgBXQ55 (ORCPT + 99 others); Mon, 24 Feb 2020 11:57:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:38390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727401AbgBXQ55 (ORCPT ); Mon, 24 Feb 2020 11:57:57 -0500 Received: from localhost (unknown [122.182.199.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0D8E720836; Mon, 24 Feb 2020 16:57:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582563476; bh=/1bbEbIQcOxdlPPRg6xaUyuKQtDYNCF5hHOF4bi9Dvw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MSIX1bCxbpk+2AJam2QywGeWlRX7OxLdOc3qL45tSA1QX24QoNZL0tomMGZHpGM7U Qj360wozS445bx4ySv6JlYcQH9rp+Dqs6e45ssdEkA6fJ7ZxSPNw++9qtgXSG/Bi2w RRR5AbGfS7xFkUkGKe8pxQz05FGdm9WvBtMw/rQA= Date: Mon, 24 Feb 2020 22:27:52 +0530 From: Vinod Koul To: Fabio Estevam Cc: Martin Fuzzey , dmaengine@vger.kernel.org, stable , Shawn Guo , Sascha Hauer , NXP Linux Team , Robin Gong , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-kernel Subject: Re: [PATCH] dmaengine: imx-sdma: fix context cache Message-ID: <20200224165752.GE2618@vkoul-mobl> References: <1580305274-27274-1-git-send-email-martin.fuzzey@flowbird.group> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29-01-20, 17:19, Fabio Estevam wrote: > Hi Martin, > > Thanks for the fix. > > On Wed, Jan 29, 2020 at 10:41 AM Martin Fuzzey > wrote: > > > > There is a DMA problem with the serial ports on i.MX6. > > > > When the following sequence is performed: > > > > 1) Open a port > > 2) Write some data > > 3) Close the port > > 4) Open a *different* port > > 5) Write some data > > 6) Close the port > > > > The second write sends nothing and the second close hangs. > > If the first close() is omitted it works. > > > > Adding logs to the the UART driver shows that the DMA is being setup but > > the callback is never invoked for the second write. > > > > This used to work in 4.19. > > > > Git bisect leads to: > > ad0d92d: "dmaengine: imx-sdma: refine to load context only once" > > > > This commit adds a "context_loaded" flag used to avoid unnecessary context > > setups. > > However the flag is only reset in sdma_channel_terminate_work(), > > which is only invoked in a worker triggered by sdma_terminate_all() IF > > there is an active descriptor. > > > > So, if no active descriptor remains when the channel is terminated, the > > flag is not reset and, when the channel is later reused the old context > > is used. > > > > Fix the problem by always resetting the flag in sdma_free_chan_resources(). > > > > Fixes: ad0d92d: "dmaengine: imx-sdma: refine to load context only once" > > Nit: in the Fixes tag we use 12 digits for the commit ID and the > Subject is enclosed by parenthesis. > > The preferred format would be: > > Fixes: ad0d92d7ba6a ("dmaengine: imx-sdma: refine to load context only once") > > Reviewed-by: Fabio Estevam Applied, with updated Fixes line. Thanks -- ~Vinod