Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4985427img; Tue, 26 Mar 2019 23:00:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzR5mUFvg166/RIl7WG74UG0Q2QGgYy8R8uw0S5ZG54Qjg0TmUATYHWLp0S0MQgXPg6xEBU X-Received: by 2002:a63:84c7:: with SMTP id k190mr32627676pgd.255.1553666427033; Tue, 26 Mar 2019 23:00:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553666427; cv=none; d=google.com; s=arc-20160816; b=EZ6XO3gzVleX7E4T2g+IF0YlJ5bnDCHZQCAyUEOpg6esf+9x2sYWa8I0/PEIMINNKt isIzBYZsLoaCgXjak4FUta2DQROMLj1wAWOb5WUlQjLFY12/ySoRnh3ontb2K1pICF9Q ETh9ZDyDOc4QbFKI8A9KS9nPIF4haTZoSl8l1cdpzoSHaSDl1w+xXvntNrVEz7qxvym+ wWNnbDnI+5wHDKu/Nk4O4reTC1pxM0am5dQhRWnyeXhfEGQeBMv64hWSLPWqIuP364it HjD9+Htv7x3qwuU32Ei35LIXFYdXatvohMq1qzymcWY+n/rrWgfbGsDJSkzauVqEIjih KObg== 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=cDlXRQ1SN0n4d4SYvS+kdGr6T1K5bo/hbYzbW8FRIE4=; b=zN2ihxCJ2TvEWBYIydAOUS9rcyfSOaMUNXugfq7Bq23zdxczniXfGifB5lx0bc/Cqj xxns8ZdB3SigjLzOyfkVZHaQUzNby0NnudCMicDa5hAF4O2b7PT9Wh3JHH2LDsjIxFbp ca90BrV8QZzs1SfMOcTr+7OZRIFzlgzALbK4qxu8dStAeUM1qXPqSEp2yMuL9vMy3CzZ 4VsGlDCmR++K9qKijk4zDTypTnEBLfN2QSfL2xlEsv1A1okg50knIJGsKLb3sLGXeYgr uI892SmvVg8uRNVFrZ8qE83o4J6uILFfQ3CNeoHFWTEa1194VCe1tcNwHN6tfVzDlA97 4bmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=atBYM16P; 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 31si18971432pld.6.2019.03.26.23.00.12; Tue, 26 Mar 2019 23:00:27 -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=atBYM16P; 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 S1732974AbfC0F5Q (ORCPT + 99 others); Wed, 27 Mar 2019 01:57:16 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:6986 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732858AbfC0F5K (ORCPT ); Wed, 27 Mar 2019 01:57:10 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 26 Mar 2019 22:57:04 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 26 Mar 2019 22:57:09 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 26 Mar 2019 22:57:09 -0700 Received: from HQMAIL112.nvidia.com (172.18.146.18) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 27 Mar 2019 05:57:09 +0000 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL112.nvidia.com (172.18.146.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 27 Mar 2019 05:57:09 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 27 Mar 2019 05:57:09 +0000 Received: from skomatineni-linux.nvidia.com (Not Verified[10.2.161.83]) by hqnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Tue, 26 Mar 2019 22:57:08 -0700 From: Sowjanya Komatineni To: , , , , , , , CC: , , , , Subject: [PATCH V1 05/26] spi: tegra114: use unpacked mode for below 4 byte transfers Date: Tue, 26 Mar 2019 22:56:26 -0700 Message-ID: <1553666207-11414-5-git-send-email-skomatineni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1553666207-11414-1-git-send-email-skomatineni@nvidia.com> References: <1553666207-11414-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=1553666224; bh=cDlXRQ1SN0n4d4SYvS+kdGr6T1K5bo/hbYzbW8FRIE4=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=atBYM16PptrKQak4TkTQ++oDUsmQfq7yJAU7zxMZvI3NOI9Z1uSHyNgp1mvoCCgCY dxCg1iV4lsHg9ev0VEgTygAK/2W8kdhXRvKqF+xb7J3sDAj2FOHOtFqE2S3FrwgROT CINe/bI+oN2AFiT3eGi2UIz1aLE4YPl53zjAEU7DZM9e65uVGmhV5KLOsGTH+wuJPO kNADggy5naj0zrRHrJZCxB+mTjTyH7+TvP206sfSpuDtc2eSi4VoziEx5ct9NiPJHj g0rnnenaeQXb3dSrCfeHRpTap4zTLe5MynEMH4k51d+zGtfM54S2xJw6474ZXUSqHL 6jyjBGXBo5rNA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fixes: use unpacked mode when transfer length is less than 4 bytes. Packed mode expects minimum transfer length of 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 dc63536dbda4..716587b663a3 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