Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5784609imd; Wed, 31 Oct 2018 01:50:24 -0700 (PDT) X-Google-Smtp-Source: AJdET5efSmwSLfzghgHfXwRoXc2pJT4eg8NylKQXk/VcD2fIMkR7Hz6VZqx9QWsGjMPqrflxA/to X-Received: by 2002:a63:e505:: with SMTP id r5-v6mr2254392pgh.170.1540975824172; Wed, 31 Oct 2018 01:50:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540975824; cv=none; d=google.com; s=arc-20160816; b=Itx18Sub+3nvgKn/4CsOTwAKlihR2aZBcW8SkPOdFgWHbDxJ46RFuHp1E5IfN8B+6U sdF0HDxks44SjVaM+QIAf6EeG/2TUmi+/miBkNal0reIPETQwYx234q7GdyZ7yrjzyau XjIQtdlupTxzvdGj+KoBJHaPOMYaKpIYy8pst1KuF0t5NcWMDjRNKkG3yKW87xfPGm1f NP/iDGV/f3Gp+PW4GOyjVV7fRRANoRNbrUpyabySAYJ4EEBL38lSx15ZHceFjXXiDYO9 idlGW6dwQX768Rhg93q/zS6ivEjQF+xnjmu+MSpPE8P90hvTqFTlARwBKgMqJHXK8oU5 owmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=FTnZujyOy/Q1kwF1FE485kei0wN25Fqkxz+nBofKxJA=; b=CMqbTxGtklOdQbKOPqCTCWNFQ6Itm3zdfaUrpsozBujH5XpNJUPVO97n6qmEtYXwlB HWqXVxoFxKC+UopRghw2ahGr2pK3/QqTkMJzNSccRAVcangQ4JU/4cgHXLb7qi1lSEjA +7qUZiyHma7fI4jqzXaiTwEyzueIHdrIisadW7fFY4H3rUhs8nA0CQgfAk53bCNHMTTr TXAhTCQpyNAlrkDkBbYdUCGlBuWv3DVzUMRSDIwoV0SVs5Ip0hGOsdMyJ2zouEWIZrSc IrxbiZdYAOqafCVcapeUJY/rVaKrnbi9KZ2pwhgHi0N76Nz0MmZrg7yaVS1vcVzVZgMt ZXcg== ARC-Authentication-Results: i=1; mx.google.com; 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 w7-v6si25193699plz.23.2018.10.31.01.50.09; Wed, 31 Oct 2018 01:50:24 -0700 (PDT) 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; 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 S1727558AbeJaRq7 (ORCPT + 99 others); Wed, 31 Oct 2018 13:46:59 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:27289 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726054AbeJaRq7 (ORCPT ); Wed, 31 Oct 2018 13:46:59 -0400 X-UUID: c4b04d7c27fc4a4cb4096366f2ea5192-20181031 X-UUID: c4b04d7c27fc4a4cb4096366f2ea5192-20181031 Received: from mtkcas35.mediatek.inc [(172.27.4.250)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1296127811; Wed, 31 Oct 2018 16:49:34 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 31 Oct 2018 16:49:33 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 31 Oct 2018 16:49:32 +0800 From: Leilk Liu To: Mark Brown CC: Mark Rutland , Matthias Brugger , , , , , , Leilk Liu Subject: [PATCH] spi: mediatek: use correct mata->xfer_len when in fifo transfer Date: Wed, 31 Oct 2018 16:49:16 +0800 Message-ID: <1540975756-2021-1-git-send-email-leilk.liu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org when xfer_len is greater than 64 bytes and use fifo mode to transfer, the actual length from the third time is mata->xfer_len but not len in mtk_spi_interrupt(). Signed-off-by: Leilk Liu --- drivers/spi/spi-mt65xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c index 3dc3162..0c2867d 100644 --- a/drivers/spi/spi-mt65xx.c +++ b/drivers/spi/spi-mt65xx.c @@ -522,11 +522,11 @@ static irqreturn_t mtk_spi_interrupt(int irq, void *dev_id) mdata->xfer_len = min(MTK_SPI_MAX_FIFO_SIZE, len); mtk_spi_setup_packet(master); - cnt = len / 4; + cnt = mdata->xfer_len / 4; iowrite32_rep(mdata->base + SPI_TX_DATA_REG, trans->tx_buf + mdata->num_xfered, cnt); - remainder = len % 4; + remainder = mdata->xfer_len % 4; if (remainder > 0) { reg_val = 0; memcpy(®_val, -- 1.7.9.5