From patchwork Tue Oct 27 13:46:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 289724 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BC46C83010 for ; Tue, 27 Oct 2020 15:27:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3D5AD20728 for ; Tue, 27 Oct 2020 15:27:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812462; bh=JTw+OZECR89UPHKNKWzF0xdqQv+MFgn4N9oUhzti3y4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=IK2gFrse5H0gPbTzcxxCSXcL6TUsm0NVDSh6JHb9XBwIKcIjeOaxA+ONG+uxUREWx 9mgx/M+McThUTM34smodul0cK2zrtgK3efP+xErwR0tHFbwOn0Aw2ENA0R0NKPdz2H wqzkPLmSVvQXzT99bWbcbkntmLIeFmmeFUGey+xU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S368772AbgJ0P1k (ORCPT ); Tue, 27 Oct 2020 11:27:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:40710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1798135AbgJ0PZn (ORCPT ); Tue, 27 Oct 2020 11:25:43 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D34B020657; Tue, 27 Oct 2020 15:25:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812341; bh=JTw+OZECR89UPHKNKWzF0xdqQv+MFgn4N9oUhzti3y4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0HMAst97HYi22wsouCq1HS60yoQpx71uyc4FHJMYn4nUgvhMdJ9eTFfqnwH4uLyyo tMOxZMLlsJQ9iZQ1lOoL55q/gJ2PpJmfVlDqYVqeOdNfax7cUBgPEqRhKYv8doUnZt sckw38ZYS/sZvHPH8IfGirUEPTTV5Xus5Iyg6eb4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brad Bishop , Eddie James , Joel Stanley , Mark Brown , Sasha Levin Subject: [PATCH 5.9 145/757] spi: fsi: Handle 9 to 15 byte transfers lengths Date: Tue, 27 Oct 2020 14:46:35 +0100 Message-Id: <20201027135457.401970892@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Brad Bishop [ Upstream commit 2b3cef0fc757bd06ed9b83bd4c436bfa55f47370 ] The trailing - 8 bytes of transfer data in this size range is no longer ignored. Fixes: bbb6b2f9865b ("spi: Add FSI-attached SPI controller driver") Signed-off-by: Brad Bishop Signed-off-by: Eddie James Reviewed-by: Joel Stanley Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20200909222857.28653-2-eajames@linux.ibm.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-fsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-fsi.c b/drivers/spi/spi-fsi.c index 37a3e0f8e7526..8f64af0140e09 100644 --- a/drivers/spi/spi-fsi.c +++ b/drivers/spi/spi-fsi.c @@ -258,15 +258,15 @@ static int fsi_spi_sequence_transfer(struct fsi_spi *ctx, if (loops > 1) { fsi_spi_sequence_add(seq, SPI_FSI_SEQUENCE_BRANCH(idx)); - if (rem) - fsi_spi_sequence_add(seq, rem); - rc = fsi_spi_write_reg(ctx, SPI_FSI_COUNTER_CFG, SPI_FSI_COUNTER_CFG_LOOPS(loops - 1)); if (rc) return rc; } + if (rem) + fsi_spi_sequence_add(seq, rem); + return 0; }