Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1778646pxj; Sat, 5 Jun 2021 02:51:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoiW5pseYNOMsDm7GySV8Ck0ABrRCnsLJVsPdob45BL0NfavID44WzYk8YYrmY6ndIOcFW X-Received: by 2002:a50:8fc3:: with SMTP id y61mr9132875edy.107.1622886712073; Sat, 05 Jun 2021 02:51:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622886712; cv=none; d=google.com; s=arc-20160816; b=b4ZkQ4m6roqz7mww/wXwjk98ubUHbrkkcgCVUxjUUQEo+2H3FdOEgjqPkKei1kIV47 JwbZ2sjj9W3JUopY8aBonbttQqWZ/+7knKYOUG5PDRxKAUB61a/mcGcj+heC+LHBfxho /ZKKG26TLv5HP5cMw7MT9DsUDJ/DZyX3/kFdTntav82rcRyfOAw5AqNDy7C7Wx8MxrV4 sU46dkh8YdJzeLRCOwXUKLc7oPj2SlKLQZFHZVGyskAkqR8CCJEmAauNGtUuwBwulvKP s72qlXu7dNR4xw9hRh15HZByClYyVj42uh2x985pFH1BJMOl0QjkLGjf7My+4AwyoDOZ 2IEw== 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=bmwR+YKdSPpkT7Gh0V47QPX5Nr0XHWFmRNCmRrGV/scgu18xgRVJzewsqK0yQjj0MY q5HGHIJD0h3NmKFF5ReY2DuVobmvxbJaBuokP9b8DvW1p4hOUdKrPw+hXOJnrK/ck2cI NkiUZfJL3mA0CYR0MVMaSJBekkgwTlz6QZwjOnXzq1PfiMk4PKgpHkieI/zlHkYd4oGB Bzni2F1yJglPKom7hS+e70hGif0Hcs1FkEcJLcT3rhpBYnD3/WCiwk5gYrX6fbC4AEv3 blbY+GL5Ud2+U7c5L+Plslp/F+Kibl2XGZNLhWy2mzZLAGBO9v5/Ou+KpSzmPKd0lox6 YEUg== 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 23si5509409ejg.232.2021.06.05.02.51.29; Sat, 05 Jun 2021 02:51:52 -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 S230103AbhFEJtd (ORCPT + 99 others); Sat, 5 Jun 2021 05:49:33 -0400 Received: from lucky1.263xmail.com ([211.157.147.134]:34564 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229963AbhFEJt2 (ORCPT ); Sat, 5 Jun 2021 05:49:28 -0400 Received: from localhost (unknown [192.168.167.105]) by lucky1.263xmail.com (Postfix) with ESMTP id 0FD06C84C4; Sat, 5 Jun 2021 17:47:05 +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 P26721T140686913419008S1622886424373318_; Sat, 05 Jun 2021 17:47:05 +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 v3 1/8] spi: rockchip: Set rx_fifo interrupt waterline base on transfer item Date: Sat, 5 Jun 2021 17:46:52 +0800 Message-Id: <20210605094659.13507-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