Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp373884pxb; Tue, 9 Feb 2021 02:37:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9caMt707pjVEJdhgBr+SQYZt7xw56QPcgmJQJmE6UF1wd5Mj4F6IqFrUG9p3BcmRJ8EZW X-Received: by 2002:a17:906:4c4b:: with SMTP id d11mr21968727ejw.387.1612867044927; Tue, 09 Feb 2021 02:37:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612867044; cv=none; d=google.com; s=arc-20160816; b=lK5/tgaiaL7dtsfjutQFJT9MxdNyuej6L5eOfA8fKt27VRx1IS7TFXfTSxCi9U5rZQ xS2Zx+fEKI2W2/4Lwla99FoVqdOxCWH5sjXJyyDWGKe3Ggfm8a7yYChSBIOqAgDcb61h QSaDKvECGDUcHY67CR54jlzuPM3Pw5VceeboUGCOkhKoPAuqho7OYWhydTPupBgyMGqQ fENBKSS2bFqHryCfEGq2Y21joC81PLf1fE38qBTfNjg2bdA2gad2i9RHsxs+WO/xvG2R JiO5TIg8xILTsSin2T9rGanszgRfMV/kXwGFyWnH7vRjHC/T9CKNX3tMqIPiDXzOHTk5 swEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:message-id; bh=H5M+eJgC9S3CuBt7XBqw0HR328Uc5qDZfafyOZkJMqM=; b=KUPNvXcgPVPhFVv/6/UIxbMrwWiNNTa5a/6K0+GSkRxMqw5dOCIDr6zly/sRbumGtv Q5fkrgtbFTe3vWhy/Mzi+hqt6X66M7ZM1Q3DFVtTHWFOLVnqmIF8/AJvMQ3uCD/LrE4z 0UB3AzbYoyCrfUvhx4wSoP3Lm9HZAmRe1DD08YnBPYs6cZvic8FfSiDnqy/HZxiCtT7C mhjx6CD27++VRjS/N09DiTE1j31yGNDVJSyUcRAqcNzdM982ymkUB1o7Crr56qMiVvo2 PUP1qXPvjqY97jP9Uylho0wqWqmT7R9/EMO+VSs2s/jclP/P8jRbLozv2LKl2ffkcwmR WCBg== 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 v12si13242308ejy.529.2021.02.09.02.37.01; Tue, 09 Feb 2021 02:37:24 -0800 (PST) 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 S231950AbhBIKc5 (ORCPT + 99 others); Tue, 9 Feb 2021 05:32:57 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:37722 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231796AbhBIK1J (ORCPT ); Tue, 9 Feb 2021 05:27:09 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4DZfF85lnFz9tx3V; Tue, 9 Feb 2021 11:26:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id srx25kv8u0IC; Tue, 9 Feb 2021 11:26:20 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4DZfF850Jrz9tx2x; Tue, 9 Feb 2021 11:26:20 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A50188B7D6; Tue, 9 Feb 2021 11:26:21 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 8p7HUzzF1Kv1; Tue, 9 Feb 2021 11:26:21 +0100 (CET) Received: from po16121vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 57B668B7D8; Tue, 9 Feb 2021 11:26:21 +0100 (CET) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 1AD0E6733E; Tue, 9 Feb 2021 10:26:21 +0000 (UTC) Message-Id: <99bf008e2970de7f8ed3225cda69a6d06ae1a644.1612866360.git.christophe.leroy@csgroup.eu> From: Christophe Leroy Subject: [PATCH 1/3] spi: mpc52xx: Avoid using get_tbl() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , broonie@kernel.org Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-spi@vger.kernel.org Date: Tue, 9 Feb 2021 10:26:21 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org get_tbl() is confusing as it returns the content TBL register on PPC32 but the concatenation of TBL and TBU on PPC64. Use mftb() instead. This will allow the removal of get_tbl() in a following patch. Signed-off-by: Christophe Leroy --- drivers/spi/spi-mpc52xx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-mpc52xx.c b/drivers/spi/spi-mpc52xx.c index ef2f24420460..e6a30f232370 100644 --- a/drivers/spi/spi-mpc52xx.c +++ b/drivers/spi/spi-mpc52xx.c @@ -120,7 +120,7 @@ static void mpc52xx_spi_start_transfer(struct mpc52xx_spi *ms) ms->cs_change = ms->transfer->cs_change; /* Write out the first byte */ - ms->wcol_tx_timestamp = get_tbl(); + ms->wcol_tx_timestamp = mftb(); if (ms->tx_buf) out_8(ms->regs + SPI_DATA, *ms->tx_buf++); else @@ -221,8 +221,8 @@ static int mpc52xx_spi_fsmstate_transfer(int irq, struct mpc52xx_spi *ms, * but it can also be worked around simply by retrying the * transfer which is what we do here. */ ms->wcol_count++; - ms->wcol_ticks += get_tbl() - ms->wcol_tx_timestamp; - ms->wcol_tx_timestamp = get_tbl(); + ms->wcol_ticks += mftb() - ms->wcol_tx_timestamp; + ms->wcol_tx_timestamp = mftb(); data = 0; if (ms->tx_buf) data = *(ms->tx_buf - 1); @@ -247,14 +247,14 @@ static int mpc52xx_spi_fsmstate_transfer(int irq, struct mpc52xx_spi *ms, /* Is the transfer complete? */ ms->len--; if (ms->len == 0) { - ms->timestamp = get_tbl(); + ms->timestamp = mftb(); ms->timestamp += ms->transfer->delay_usecs * tb_ticks_per_usec; ms->state = mpc52xx_spi_fsmstate_wait; return FSM_CONTINUE; } /* Write out the next byte */ - ms->wcol_tx_timestamp = get_tbl(); + ms->wcol_tx_timestamp = mftb(); if (ms->tx_buf) out_8(ms->regs + SPI_DATA, *ms->tx_buf++); else @@ -276,7 +276,7 @@ mpc52xx_spi_fsmstate_wait(int irq, struct mpc52xx_spi *ms, u8 status, u8 data) dev_err(&ms->master->dev, "spurious irq, status=0x%.2x\n", status); - if (((int)get_tbl()) - ms->timestamp < 0) + if (((int)mftb()) - ms->timestamp < 0) return FSM_POLL; ms->message->actual_length += ms->transfer->len; -- 2.25.0