Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6722034ybl; Wed, 15 Jan 2020 09:10:24 -0800 (PST) X-Google-Smtp-Source: APXvYqxeT7iOv8bt2XGlsIFX3fY7T8TgTo5BvvxX+PYmrnmxPhkgVTpH1ffLbo86fvUk6KJ25sQ6 X-Received: by 2002:a05:6830:1e30:: with SMTP id t16mr3590433otr.220.1579108222816; Wed, 15 Jan 2020 09:10:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579108222; cv=none; d=google.com; s=arc-20160816; b=g3IzR/adYrLvgamfP4Hl/CPbAGB+i1/xOSh/ocfqjKpQ4y4ZvUcXc0bwJxA4B7lDEQ nc9W1tctGXSJmL58ttMSUItgdnAO+zrLo4Gq+2MrRiYuWMYFVV8LecxvkZbKucg1Di0r LcqYZIwTQc295TlArg2fhpk/TpKo5pCl50ebJlZaxv1du/UkF2MPlEdYMK/3tUagC+DW 8bRgOJkGr4sDIFjbg+622fMb0gtXyH+Dv46u8y2fNf0JBByxfudMhCvNrOYvb9xrCwbq iTLLhD/Hvz2P64002dAh9ygjpNwRA+lcTwxj/9lvAWyezxPzBI/Nurv382KN8i1q9VY6 t+pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=fXNBToYSle/zi2rPrm6QiTylxYEvhm9xjCHiqn/onLY=; b=CZ5j8QbmgGKshqSud66YQgHUgn4m2y6+Lo2W0SzAJy/cpNL6w5UqfeKxDr/WbSlpXi 6IhtwAL5JBJnOF5u9vVIBWLASHrsTsST6+IqEUVigzU1WY0mFG4GadbKkB8owoV4DHjf jK+lCa79/VyYBLJDTsdBlGt324xX4vnPpO1/+06/QKeFXkNFcHzFFKUjoRFJFlQ8XYBH DbRx9cN/33ExgTbAo+5Ng5RZNS8WhkJ3VNT/2VxJb3nEaQxGv88YusjOoA0r1IOIaMFy zhdWNNe80LAvMyn+AfSaYZmL0kClmj4tTSc/Ii3sAzbg0K0JSSnwfmuVHX9pBKxmYHz0 hhLQ== 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11si10642043otr.197.2020.01.15.09.10.10; Wed, 15 Jan 2020 09:10:22 -0800 (PST) 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729078AbgAORHl (ORCPT + 99 others); Wed, 15 Jan 2020 12:07:41 -0500 Received: from 212.199.177.27.static.012.net.il ([212.199.177.27]:38830 "EHLO herzl.nuvoton.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729028AbgAORHk (ORCPT ); Wed, 15 Jan 2020 12:07:40 -0500 Received: from taln60.nuvoton.co.il (ntil-fw [212.199.177.25]) by herzl.nuvoton.co.il (8.13.8/8.13.8) with ESMTP id 00FGN3DI021574; Wed, 15 Jan 2020 18:23:03 +0200 Received: by taln60.nuvoton.co.il (Postfix, from userid 10070) id D85536032F; Wed, 15 Jan 2020 18:23:03 +0200 (IST) From: Tomer Maimon To: broonie@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, avifishman70@gmail.com, tali.perry1@gmail.com, venture@google.com, yuenn@google.com, benjaminfair@google.com Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, Tomer Maimon Subject: [PATCH v1 2/4] spi: npcm-pspi: improve spi transfer performance Date: Wed, 15 Jan 2020 18:22:59 +0200 Message-Id: <20200115162301.235926-3-tmaimon77@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20200115162301.235926-1-tmaimon77@gmail.com> References: <20200115162301.235926-1-tmaimon77@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Improving spi 8 bit per word mode transfer performance by using 16 bit per word transfer and receive when the data length is even and larger than one. Signed-off-by: Tomer Maimon --- drivers/spi/spi-npcm-pspi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/spi/spi-npcm-pspi.c b/drivers/spi/spi-npcm-pspi.c index c74611abe2a9..eac7ba18b4b9 100644 --- a/drivers/spi/spi-npcm-pspi.c +++ b/drivers/spi/spi-npcm-pspi.c @@ -178,6 +178,13 @@ static void npcm_pspi_setup_transfer(struct spi_device *spi, priv->mode = spi->mode; } + /* + * If transfer is even length, and 8 bits per word transfer, + * then implement 16 bits-per-word transfer. + */ + if (priv->bits_per_word == 8 && !(t->len & 0x1)) + t->bits_per_word = 16; + if (!priv->is_save_param || priv->bits_per_word != t->bits_per_word) { npcm_pspi_set_transfer_size(priv, t->bits_per_word); priv->bits_per_word = t->bits_per_word; -- 2.22.0