Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1721704yba; Thu, 4 Apr 2019 17:16:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRiMKnctd9cvIdfiJTctQz3hs1ayoRYGIYjs0RYXYQhb8fVhP1qzpeno5O9iN4ZBRjW1Nd X-Received: by 2002:a17:902:7247:: with SMTP id c7mr9508584pll.255.1554423410149; Thu, 04 Apr 2019 17:16:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554423410; cv=none; d=google.com; s=arc-20160816; b=MTk1m+jwRQXR6jsvFEGuTiJoB7Mss6HUNIzd6T91JxBOxX4dJi+ITD2I6IQchpEgDj Bsvi1EwDV8SrBeAMGqbUbfkDyoHi58yKXVmhPIroBnkL02iKn3ucFCjdrtVNPir9Lexf SbnLAPnUpMydwcC6D2Y8esUocH2zcd/zMOXJquELWymJvXaGoVYyUc/4JOPTjUCBiG5t BhEzhaz+/geGsy40zn/W7TpF/WTC2kOvY2LBz6ECxs/rohw0+40+IFxL0VqJKwCb8wm4 jnLYEKugtewZB5Mwm2RPWKY+p7VS5yEuCVuegIIOf3jXZv6mi0QitxM56ajMDtOlWEdO UyPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=NxSfVg0/vtVUkdE/HrUoF3WbI4gXkUlKWeU8EHPEa88=; b=wbV7tHO2HlCD1VS+Rbh/ubWVHjA6gV7ZE8uZl/ipX2WI1EXyN20STxT18RvMM+xICs tD150j4764G1mM9Q+ctaBQ1zbeSX5Ty8zhjtfoyb3t3CJL9VtHymVuF5xrO+NrhCgmsc +EBA+LHwgObSW/Q6t+oRewgRBptSGmqqjy7UkdPFaLqi61E9wo+GPR9tuqod1EZDdMXb FhwLfbxzZ4K/doQxrdcu2pDygWXf4eyUaIxk5rTmN34eZtIiRLBeUcIMlFO8uHBuN9Xh EfsiOjmlvf8j+xLkmhOKKOrkdiAZsdaQhW9F3n2GRyfo/6deWjG/i4axnMWDyqA7JNWt 7/1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=ntTFE+5M; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 16si17241967pfh.244.2019.04.04.17.16.33; Thu, 04 Apr 2019 17:16:50 -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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=ntTFE+5M; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730425AbfDEAOZ (ORCPT + 99 others); Thu, 4 Apr 2019 20:14:25 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:11293 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730291AbfDEAOY (ORCPT ); Thu, 4 Apr 2019 20:14:24 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 04 Apr 2019 17:14:21 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 04 Apr 2019 17:14:23 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 04 Apr 2019 17:14:23 -0700 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 5 Apr 2019 00:14:23 +0000 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 5 Apr 2019 00:14:23 +0000 Received: from skomatineni-linux.nvidia.com (Not Verified[10.110.103.48]) by hqnvemgw02.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Thu, 04 Apr 2019 17:14:22 -0700 From: Sowjanya Komatineni To: , , , , , , , CC: , , , , Subject: [PATCH V2 02/20] spi: tegra114: use unpacked mode for below 4 bytes Date: Thu, 4 Apr 2019 17:14:01 -0700 Message-ID: <1554423259-26056-2-git-send-email-skomatineni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554423259-26056-1-git-send-email-skomatineni@nvidia.com> References: <1554423259-26056-1-git-send-email-skomatineni@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1554423261; bh=NxSfVg0/vtVUkdE/HrUoF3WbI4gXkUlKWeU8EHPEa88=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=ntTFE+5MYSCXIqVshpRs/Z8GGvt79tr1bdmSDEQR7lpIpCEfFjyzrVIg6W2Ax43DG qAe+qbz5/nhwkObzQMoOrnanPT7mKdzvayq8MSYSgUej2JOQbZ2exVZfQKe8PQsvRt /0XpMyvN0O6E/UDdyYs7fkGFWzLMon2UeWAw9O0i6qA8htEeFltFDGhtH03KJ+xffF mgwO1C9NXKzsPkd7m6aa6FPeZV3CpuniYFwMZOdHdMO8iBEKiEZdjalYsa4T6mQ7zT M8f5udTJJIEH3FlQgnukBMMgQrk0Dy+HC+AZgSYnYp+M0ForGuxLmfvLy6/M3xBurH XQwV3b1aUuqbQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Packed mode expects minimum transfer length of 4 bytes. This patch fixes this by using unpacked mode for transfers less than 4 bytes. Signed-off-by: Sowjanya Komatineni --- drivers/spi/spi-tegra114.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c index ba1639310282..3042521c3785 100644 --- a/drivers/spi/spi-tegra114.c +++ b/drivers/spi/spi-tegra114.c @@ -259,7 +259,8 @@ static unsigned tegra_spi_calculate_curr_xfer_param( tspi->bytes_per_word = DIV_ROUND_UP(bits_per_word, 8); - if (bits_per_word == 8 || bits_per_word == 16 || bits_per_word == 32) { + if ((bits_per_word == 8 || bits_per_word == 16 || + bits_per_word == 32) && t->len > 3) { tspi->is_packed = 1; tspi->words_per_32bit = 32/bits_per_word; } else { -- 2.7.4