Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3524612imu; Mon, 7 Jan 2019 05:05:08 -0800 (PST) X-Google-Smtp-Source: AFSGD/UiNRIjJU9DRzW8atWodGZ/aoF4V0/deU9XcpVloTfPYlu4EE84/GYZdcYYxjdFQQ5rYiJO X-Received: by 2002:a62:1484:: with SMTP id 126mr62168537pfu.257.1546866308507; Mon, 07 Jan 2019 05:05:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546866308; cv=none; d=google.com; s=arc-20160816; b=xed0MtpyNTGk2W1aHrHWUFhXa5xlhhE6HXduUQG68wbwQXO+wrVfVdiZbNeZl2L6Ao mtSxnIRPhZtpRrCn7PwSBN0m3n28s8vKTuQYA2W5Rp18VwQthiW9nocv+VjxXpEvnq+c yzhNKMJiJcohZlvqtm3AIERrBHrr3b/N9dmqRkRHXyc7e9U5XZude1xZGyD+dDSGiJpI Jv6F5l6OTF3FLHGnfw5lbxemNPj+zfCs3+xvlJWClNhxCOdSK1oX6V7S7Bq+IKmZri7H yMtDsYN/GrGfqgbadzVSE82ejDcbrmct8g4gDbO688kDZL57M504nMFtVHIJFrWd4pN/ wXDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3OH+UW7GadB3gGpk2Xmz9tllPeu2sStdb2nxNMtWLYQ=; b=Pcr2NAGUefUmYLBIj8vOpIlvgVAntLQZ0YNBXSLxMUekCgLLYOn7sQ+5+DnBVkyOrN vtfKL+L/s4USIP+zd6IFSSr3Bydm4VFvlzSj6hVcJmOu+2fw7MRVeAkBSqfCoL70Mmy/ jxDI/TYVRfB3sqYSrRmKBowc9TOaKf9r6o0KTV9bBSx8vbyEh3iUlj2GGtpbo1QQaxvw 6f90gNmYO09bTUJDYiRDivLu9ztCDWLdihCNxQGmCSTac+N+xkGi6E1YxyBbZua/HkTd erx4s1yVp09JRGMtsAFF8Zpj3ueRxQOSwHCIoEEx5HpAWqcQOxM+3Wrm60LRqxHI5k8T BNdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zmueCPcm; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cb2si46047663plb.298.2019.01.07.05.04.52; Mon, 07 Jan 2019 05:05:08 -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=zmueCPcm; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730910AbfAGNDB (ORCPT + 99 others); Mon, 7 Jan 2019 08:03:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:50460 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730900AbfAGNC6 (ORCPT ); Mon, 7 Jan 2019 08:02:58 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 35AD0206BB; Mon, 7 Jan 2019 13:02:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546866177; bh=iLxnWlURcDZ/MKgxGi6yDEVSeaLYPvnPGBbK0PgXfXA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zmueCPcmr0Kj0xh2nPZ+v4cMnEzX+wXSeyDcOM7zOYXWurBxK1aruY6NOj81NHdxI CFyBDX4oJBa/b9sLcGvI3vL788Y68rdTb5vonJDP5zOngzQbyJV8PcAGtR12jDQ2tr gOwDS1cWhIKo8wo4Az9/9PxzhhW7q3hqVMwWEMxM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lukas Wunner , Mathias Duckeck , Frank Pavlic , Martin Sperl , =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= , Mark Brown Subject: [PATCH 4.14 070/101] spi: bcm2835: Fix book-keeping of DMA termination Date: Mon, 7 Jan 2019 13:32:58 +0100 Message-Id: <20190107105336.821784097@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107105330.372621917@linuxfoundation.org> References: <20190107105330.372621917@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lukas Wunner commit dbc944115eed48af110646992893dc43321368d8 upstream. If submission of a DMA TX transfer succeeds but submission of the corresponding RX transfer does not, the BCM2835 SPI driver terminates the TX transfer but neglects to reset the dma_pending flag to false. Thus, if the next transfer uses interrupt mode (because it is shorter than BCM2835_SPI_DMA_MIN_LENGTH) and runs into a timeout, dmaengine_terminate_all() will be called both for TX (once more) and for RX (which was never started in the first place). Fix it. Signed-off-by: Lukas Wunner Fixes: 3ecd37edaa2a ("spi: bcm2835: enable dma modes for transfers meeting certain conditions") Cc: stable@vger.kernel.org # v4.2+ Cc: Mathias Duckeck Cc: Frank Pavlic Cc: Martin Sperl Cc: Noralf Trønnes Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-bcm2835.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -341,6 +341,7 @@ static int bcm2835_spi_transfer_one_dma( if (ret) { /* need to reset on errors */ dmaengine_terminate_all(master->dma_tx); + bs->dma_pending = false; bcm2835_spi_reset_hw(master); return ret; }