Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3874157imu; Mon, 7 Jan 2019 11:02:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN6uTjoI2Ut3zlanDXc4mk3iUk9cawUjUKaW1InwxITghGQSyPqMSxFmfgU1wNVfcki7Ax81 X-Received: by 2002:a17:902:2006:: with SMTP id n6mr63129499pla.66.1546887777934; Mon, 07 Jan 2019 11:02:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546887777; cv=none; d=google.com; s=arc-20160816; b=FMPOl+5YnBQWcOcjg2dQlB0/quyNRNWdX+RxX5/AopRTiiR6rry/acxtk6DwNHdFal iwsRnwI8pNZHIf/nRslkeNA4o60nvxal2pPetdZuKPmdes9xJ3+CS0f+xzSGeF3bRb7O Fw4riWina7e3fDg0gSW6ejj/bn7H7c4F9eXh/xiAjAQoEftaQ3iRyqTIYS+bB1MnI+cV beU0ZlAVtfsVYz0R6UVZKcotBvvGMX4BMMv7D1UaGVgggPRm7Tl5l5PzcS7/lFi+sR05 3ipf+FXOHKHGKcEk9jMueAr2FonXO2t4wN1jM1XKMjRqbbnlAPv8UvzAGqSSXb5MTNjm q4Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=v9fqs7B44Lj5MtiBBA4eDrSOhItJlMvrEonlb/5do5M=; b=T8RMFPt6gVcXSe1c+jutUer0PuKaeg6M9mGW3zyoR/aq4gtryGeQkEEo/rHT1v6Ul+ 0bYfp+SqJ8Ge+ueDaVxYS2CF1LQbM3uMf2WdQ/CwgFRkj36VclNBy/M4FhjYFanlNWkS gE2tFNk49HLWJOGGWUyuBKy0dLqA0U2Z33+rnrKMIJI7MU+2GvvjM5JwIzMe1ZUZofaB ikf5ZlLQU7dScmb/S2FS0N+wZhbIeFj4jcxwMqabT0Ofs0ER85kvAZ1+ZAqeBjkbUIO1 zZUecMsgJPP6BA1gcEfTFTRVRmO/CgMe2HeAXK3DxO+9f0aMqQbWgDYcJDAPaxs1uLqC X4Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=GoxtLzlu; 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=fail (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 h19si61538232plr.67.2019.01.07.11.02.42; Mon, 07 Jan 2019 11:02:57 -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=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=GoxtLzlu; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729108AbfAGS7n (ORCPT + 99 others); Mon, 7 Jan 2019 13:59:43 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:43684 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726945AbfAGS7j (ORCPT ); Mon, 7 Jan 2019 13:59:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=v9fqs7B44Lj5MtiBBA4eDrSOhItJlMvrEonlb/5do5M=; b=GoxtLzlueeZV 0XLs/4tuzx2XqCx5sPYACeDchQ45cgnv1L17o8k3R3BD9/Q/Va/FaKvAwEkA69LKN2FFO8BLHRjD2 c8P0QA+TFrdkCHu2ad/psnzG7NiRxw7OnM6JSUCLQtXIjbVizqjy9KP83gaUke4Jn4Nf1KbY5O667 RzEg0=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1gga7d-0007st-Ct; Mon, 07 Jan 2019 18:59:37 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 033D01127491; Mon, 7 Jan 2019 18:59:37 +0000 (GMT) From: Mark Brown To: Clark Wang Cc: Mark Brown , "broonie@kernel.org" , "linux-spi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , linux-spi@vger.kernel.org Subject: Applied "spi: lpspi: Fix wrong transmission when don't use CONT" to the spi tree In-Reply-To: <20190107074639.6336-5-xiaoning.wang@nxp.com> X-Patchwork-Hint: ignore Message-Id: <20190107185937.033D01127491@debutante.sirena.org.uk> Date: Mon, 7 Jan 2019 18:59:37 +0000 (GMT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch spi: lpspi: Fix wrong transmission when don't use CONT has been applied to the spi tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 6a130448498c151d31f1fb6f3003f5cf37b829e0 Mon Sep 17 00:00:00 2001 From: Clark Wang Date: Mon, 7 Jan 2019 07:47:41 +0000 Subject: [PATCH] spi: lpspi: Fix wrong transmission when don't use CONT Add judgment on SR_MBF and FSR_RXCOUNT. In PIO mode, if don't use CONT to keep cs selected in one transfer, the transfer will go wrong. FCIE will be set after one frame transfer finish. If use CONT, the frame refer to the whole data in one transfer. If don't use CONT, the frame refer to one byte of whole data. This will cause the transfer ending early. This patch add a register reading in isr function, it might lead to a slight decrease in the max transmission speed in PIO mode. Signed-off-by: Clark Wang Signed-off-by: Mark Brown --- drivers/spi/spi-fsl-lpspi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index ba207931e209..d0b2d551cc43 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -48,6 +48,7 @@ #define CR_RTF BIT(8) #define CR_RST BIT(1) #define CR_MEN BIT(0) +#define SR_MBF BIT(24) #define SR_TCF BIT(10) #define SR_FCF BIT(9) #define SR_RDF BIT(1) @@ -61,6 +62,7 @@ #define CFGR1_PCSPOL BIT(8) #define CFGR1_NOSTALL BIT(3) #define CFGR1_MASTER BIT(0) +#define FSR_RXCOUNT (BIT(16)|BIT(17)|BIT(18)) #define RSR_RXEMPTY BIT(1) #define TCR_CPOL BIT(31) #define TCR_CPHA BIT(30) @@ -433,6 +435,13 @@ static irqreturn_t fsl_lpspi_isr(int irq, void *dev_id) return IRQ_HANDLED; } + if (temp_SR & SR_MBF || + readl(fsl_lpspi->base + IMX7ULP_FSR) & FSR_RXCOUNT) { + writel(SR_FCF, fsl_lpspi->base + IMX7ULP_SR); + fsl_lpspi_intctrl(fsl_lpspi, IER_FCIE); + return IRQ_HANDLED; + } + if (temp_SR & SR_FCF && (temp_IER & IER_FCIE)) { writel(SR_FCF, fsl_lpspi->base + IMX7ULP_SR); complete(&fsl_lpspi->xfer_done); -- 2.20.1