Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3026371pxj; Sun, 6 Jun 2021 23:37:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrJzj/twAMijbuCVMqrOP9X42+Zd28CMngtOhkmaqsLtnhbLRNEQgdrdO/XYbmtLZZNpyN X-Received: by 2002:a17:906:3845:: with SMTP id w5mr16867181ejc.518.1623047875667; Sun, 06 Jun 2021 23:37:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623047875; cv=none; d=google.com; s=arc-20160816; b=xoruHWkzOPp+j0uL2g0csJMHFDfdvnWFnJ8gfHCl9JlGwHwwRDaaXnJtyMQL5NQBY0 00gBOxwh9kZ6ktPo8rU5rDj7lqigp55lPmahEMrjR+BhT+ab/l9AtZIEoM5CT0n2icAs QQNeDXF+/F4DTOAN6tqHVZ/5avGcs8mIwKsoH2CSRJYoStV9XseIGaVtYCamY9amYnxg i5yBRNhPUs+/A8ms9/PL6uW+FFnuNATpJ40MDkRPxP+bsZs8pwAbIZYyQsj8Q2MdRMPQ 9caEbh00dAMYvRzd10V05ub1v2pGee+ly6/z3sfFagIZOndu0jP1gwrqMmMGe/l7vPey 9XzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=taqgbCHcuj0qyjcBjaHweEfJItUzyNJp9BNzrYy2hok=; b=hrnTil9qmaekq2w9yVD3n1uYocksE0W+rzJ91VGzztfZbh/7ktaNuV+8PyXcf+tcFx 95UTiFas/ig7PIOJ67HlwrI82MtqSuHF967Pj7VbMdU2waSuO+9DPaiTh5NKgBVGdHzo 98n8dPzy9Cd3O5SdoEUgbUFjNuq9ghecxPFf/9r0tw9IMOgg7HbAXxpFDfEjpgllEkCK f2tmocQVjo1jed0/OEiwAMNHFvqpmjzmudV/8ZaVoEByiGsnNuvN2dDwG/otj3idXhER bbcJYHccxqZyLyMr4ri9EZCOwpl9wYx8dgeFoOzufiw73PYpPm0XcFmi98aakWWA3TGj mQjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b13si13342673ede.412.2021.06.06.23.37.33; Sun, 06 Jun 2021 23:37:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230333AbhFGGhl (ORCPT + 99 others); Mon, 7 Jun 2021 02:37:41 -0400 Received: from lucky1.263xmail.com ([211.157.147.134]:43996 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230314AbhFGGhj (ORCPT ); Mon, 7 Jun 2021 02:37:39 -0400 Received: from localhost (unknown [192.168.167.235]) by lucky1.263xmail.com (Postfix) with ESMTP id 8BF31C8417; Mon, 7 Jun 2021 14:35:17 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-ABS-CHECKED: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P31748T140095280056064S1623047691557189_; Mon, 07 Jun 2021 14:35:18 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <8d9493f223f1bcd6bfd4f172197be8eb> X-RL-SENDER: jon.lin@rock-chips.com X-SENDER: jon.lin@rock-chips.com X-LOGIN-NAME: jon.lin@rock-chips.com X-FST-TO: broonie@kernel.org X-RCPT-COUNT: 7 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Jon Lin To: broonie@kernel.org Cc: Jon Lin , Heiko Stuebner , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 3/6] spi: rockchip: Set rx_fifo interrupt waterline base on transfer item Date: Mon, 7 Jun 2021 14:34:45 +0800 Message-Id: <20210607063448.29589-4-jon.lin@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210607063448.29589-1-jon.lin@rock-chips.com> References: <20210607063448.29589-1-jon.lin@rock-chips.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The error here is to calculate the width as 8 bits. In fact, 16 bits should be considered. Signed-off-by: Jon Lin --- Changes in v4: None Changes in v3: None drivers/spi/spi-rockchip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 99d66dff8c89..c4eff9a8a14d 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -540,8 +540,8 @@ static int rockchip_spi_config(struct rockchip_spi *rs, * interrupt exactly when the fifo is full doesn't seem to work, * so we need the strict inequality here */ - if (xfer->len < rs->fifo_len) - writel_relaxed(xfer->len - 1, rs->regs + ROCKCHIP_SPI_RXFTLR); + if ((xfer->len / rs->n_bytes) < rs->fifo_len) + writel_relaxed(xfer->len / rs->n_bytes - 1, rs->regs + ROCKCHIP_SPI_RXFTLR); else writel_relaxed(rs->fifo_len / 2 - 1, rs->regs + ROCKCHIP_SPI_RXFTLR); -- 2.17.1