Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4276486pxy; Tue, 27 Apr 2021 00:41:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgZsm+iKPQLhEUW0P6KhdLg5mtm8kQ4EUEDySW/hF3C9vcOEQmt/AAzKPEqkY8C3DJifIv X-Received: by 2002:a17:906:7206:: with SMTP id m6mr22291806ejk.281.1619509265798; Tue, 27 Apr 2021 00:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619509265; cv=none; d=google.com; s=arc-20160816; b=BDzct2QgsVmhIuNqKKEsmRFD/xq97yOt8VrDQiCldBGxx+P3JkS9q0j4jy1ojVXJND 58ql5T7oDZkdUrm9U39RMqNFh716bu5WzRjR1pZr+ucquZp+WdJ6F5BTf4j8HLARapfV XhkwE3EQ7WA1vQ25SWrcAw3PNAWnwoPMrN9AbauywAPPbR/tFfTwK0sY89jkT0Y6zTvE aRoWTbS7xhHfKch1JIm6GmXVSHWBMgyfkFc7gW8kty6vxrDJI4ZTk5G5Tv0nGthIQHDL pWaNSMEqRaNZMnjTq0Rqu+dWtr5HmMME9TxQI9AFQCIgBdKF8/pPuNZwJ7gbxuNYQPBL aWTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=ukx7ZfTSUeH5kxFIjKghPbL714R8E0BG+Xo785FPvew=; b=tIQAcF4vkZzBB6b4miPdrRH7VUTkSfP3I8/Bgji9H07SSD9Cv/yH+fA43Jzaanp1vz aGFB1rTSKRmpvY+txCInidQok06k1W538PqZ/UcxRZx6T5p2t0EsDnyEyTZj4+qIji0y vuFG8f2cPAoCTLG0a5W8yRua0xN4UdnYy6wN029+xdaLnLSmt7toKKog+2t5b0c3kJFb JnaoFkxZ1+z+1TLVYGJDzDGD1mJkK1DSiFqvSjEPqd5vFn0M7dGbx417HUPANBTrlXF2 OgeoeQiJTMo050qVZP9cXNoPxzm2BYpJEBHz1/zL1uwwD/hasWIhyKNoSfT7g+4iA10L Rygw== 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 ss2si15747978ejb.370.2021.04.27.00.40.42; Tue, 27 Apr 2021 00:41:05 -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 S235042AbhD0Hi3 (ORCPT + 99 others); Tue, 27 Apr 2021 03:38:29 -0400 Received: from lucky1.263xmail.com ([211.157.147.132]:49828 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230062AbhD0Hi1 (ORCPT ); Tue, 27 Apr 2021 03:38:27 -0400 Received: from localhost (unknown [192.168.167.235]) by lucky1.263xmail.com (Postfix) with ESMTP id C2753F39DC; Tue, 27 Apr 2021 15:37:36 +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 P2750T140648996910848S1619509055243892_; Tue, 27 Apr 2021 15:37:36 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: 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: 8 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Jon Lin To: broonie@kernel.org Cc: heiko@sntech.de, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@esmil.dk, Jon Lin Subject: [PATCH v2 1/8] spi: rockchip: Set rx_fifo interrupt waterline base on transfer item Date: Tue, 27 Apr 2021 15:37:26 +0800 Message-Id: <20210427073733.31419-1-jon.lin@rock-chips.com> X-Mailer: git-send-email 2.17.1 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 --- 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 52d6259d96ed..406ea3c6abd9 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