From patchwork Thu Oct 11 07:40:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 10636241 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A8F4112B for ; Thu, 11 Oct 2018 07:40:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84CA82AFFC for ; Thu, 11 Oct 2018 07:40:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78C912AFE6; Thu, 11 Oct 2018 07:40:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 914292AEF8 for ; Thu, 11 Oct 2018 07:40:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726893AbeJKPGg (ORCPT ); Thu, 11 Oct 2018 11:06:36 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:46178 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726311AbeJKPGg (ORCPT ); Thu, 11 Oct 2018 11:06:36 -0400 Received: by mail-lj1-f195.google.com with SMTP id x3-v6so7264006lji.13 for ; Thu, 11 Oct 2018 00:40:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PNsNkRWrSHWQYTCUNZk4fEzPHueMy4PGGdR/3rZX8vA=; b=uJTjM9mnlpwU9iJjriWIfLlJKBjbPHRYbTkawrCEX0d9t0UD5s0015Dc0q81Kw9C4V em03+h2poQg4xipwvKHYDDdeAWc4jVM504xvv6bs7dMZ7IaX1hkk/LJfsZiE33J98zLn 4FJu6EcrERsbevcm+twM/Vj/AQy5RmvaJ4nF1Inidx6J4F7GlwweF9iSieDhuVBI/Jsr NrjN1ztC0KjlYL0STVSLw3EWWr2nawswX1BWgpSiNKmmFk1xdI5AGT+segoIFGgxPwku 5pYfPVqOtTqg6ewIblMwG+XHa8pB9gtkKo1DB8PGYJhaSzv5ICCWXIlX53Kdq0EzLXi4 Eehw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PNsNkRWrSHWQYTCUNZk4fEzPHueMy4PGGdR/3rZX8vA=; b=GglSDl+qgPy8Mju1G0ocvssa3G54mtvfm/uuyAczWD1RN/PBKsNix1RWvyDGdfoHBJ LxqkZxVcyG27nj44H7fuvUUBztgmQwFkRaV+Zk5qvaTZQ3sdsNKkl/KAwDciyczlYx+M HtlYhwe1/Slx8itWwGLqc3sgAsMivY42l3dq78TRbopAFOvQCbroNtzXYb35SwGKZot8 8rxkrjxjkRIre0ZdLTAHQXNNQ9OS4UwoFM+HdWedVqd9JBsnwzt+uvo2ByLqEtOSwW4P BjnMgwqO4Ph+hy+UyLdpRcPx8uFR7dljaMFVofeFiiaCHoWTAf7uqT+M91HFfOHeA7oa NSHA== X-Gm-Message-State: ABuFfoiSizuZWXu4/hYLEF1WeR6km038JqZbi/u0ghrXHwefXPe+TWRo +ajHpPsYNkWXWx+2Fg7fPjw= X-Google-Smtp-Source: ACcGV62k6lkkWc4HBcmvmHDgnT+4aVtvmqrN5N1D8FjK1RhbdJlsNH8LkQH8uWN0NXn1elhFJQ+R4Q== X-Received: by 2002:a2e:9883:: with SMTP id b3-v6mr327666ljj.171.1539243632658; Thu, 11 Oct 2018 00:40:32 -0700 (PDT) Received: from linux-veee.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id u70-v6sm5621716lfg.48.2018.10.11.00.40.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Oct 2018 00:40:31 -0700 (PDT) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Mark Brown , linux-spi@vger.kernel.org Cc: Kamal Dasu , Boris Brezillon , Hauke Mehrtens , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH FIX] spi: bcm-qspi: fix calculation of address length Date: Thu, 11 Oct 2018 09:40:22 +0200 Message-Id: <20181011074022.9967-1-zajec5@gmail.com> X-Mailer: git-send-email 2.13.7 MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafał Miłecki During implementation of the new API bcm_qspi_bspi_set_flex_mode() has been modified breaking calculation of address length. An unnecessary multiplication was added breaking flash reads. Fixes: 5f195ee7d830 ("spi: bcm-qspi: Implement the spi_mem interface") Cc: stable@vger.kernel.org # 4.18+ Signed-off-by: Rafał Miłecki Reviewed-by: Boris Brezillon Acked-by: Kamal Dasu --- drivers/spi/spi-bcm-qspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c index 8612525fa4e3..eb3d67f01e8c 100644 --- a/drivers/spi/spi-bcm-qspi.c +++ b/drivers/spi/spi-bcm-qspi.c @@ -355,7 +355,7 @@ static int bcm_qspi_bspi_set_flex_mode(struct bcm_qspi *qspi, int bpc = 0, bpp = 0; u8 command = op->cmd.opcode; int width = op->cmd.buswidth ? op->cmd.buswidth : SPI_NBITS_SINGLE; - int addrlen = op->addr.nbytes * 8; + int addrlen = op->addr.nbytes; int flex_mode = 1; dev_dbg(&qspi->pdev->dev, "set flex mode w %x addrlen %x hp %d\n",