From patchwork Thu Apr 8 04:02:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quanyang Wang X-Patchwork-Id: 12189927 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=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,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 43422C433B4 for ; Thu, 8 Apr 2021 04:06:31 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DA36861157 for ; Thu, 8 Apr 2021 04:06:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA36861157 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wDhZBqPEy0YVNtNR026q1qp8he6K1LwIMwmuhCN4Bu0=; b=QUWuOwwA3YhNDakmnFux6/gIg uaDxHKRTJcOY/3hpLOF5MxbX0m39sDavjBKMeJ/uOh9+SAqkhYmEOSI+V9hz01yvAUNOvBDkmUUHw S7weryvDuSz41oICgOn8vWiGVOz95xrM5HiueYv3d5YCj4HfBlSCS2/zgfuNa2aelz6Q4m5221bFO Q7CX/bqAy6Sgk8wMiUnbPQOrV1TSwY6MmSEiP01bZpr4Ywx2qYM46k3gHsQob5apnDOFx8OKwUHWi 4SUX5IW6bAFZVLYUGYTcFZtwckgT2xrNehMD5FVqRemrdnzwA5W5CnqlVbS5zmpVV3w9GT1TvrNL2 7ZmG2xyow==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lULuQ-006lAn-On; Thu, 08 Apr 2021 04:04:47 +0000 Received: from mail-mw2nam12on2069.outbound.protection.outlook.com ([40.107.244.69] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lULto-006kxW-Tr for linux-arm-kernel@lists.infradead.org; Thu, 08 Apr 2021 04:04:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kKUupt6PixRsm7CLM1gxprtjZNZxiTBrYbvUcdYIsT1iHiJtgCiGVU1fHxSP5UFQ75aHNuncrOuokuweVIuMczIsAkqk+Lgknqijq6Flz4I7MlcS8/AkPg7eXT0P/ZndJ/4n7OvlwV7GRgoz0oN2EsqYpyfozOVQmzk6wd4BIVDnHmAseyA0xc764rTknS0A09eOHYFQbP/QHzPMzcTS/Qt65E3zLI+iyxv2EYnkrf1EPs7v04MYWgf6IOCR89CdJjonKyQ3MueiD0wCGhdI/1xaIor/igaAcRt8qzcsF2Op7Cxj0cbwcONxmx8/EIAokV4DigbiL04krJHJejM4vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ejx1z1Qj3X4US1q/1YdrUH2l/JvUF8seAXu7M/925nc=; b=E66BugkBTo+I7tMQu4/RCEGM4ixa5IDE+lyfCfXIui1CxpEC1QQqZGdyaLZa4MGFvA6ThijqBOW5LziRmjQ59M0skVc35OkdWMy6wuQxPvifjlPUrCY17EsTfccNtL9Fehc3PywURIDzsjgmyBuiIwY8vdgUQFHGw0KYSo5Jq930eGJZYAEWGbuZqt6fhRejt3DnbHbkhuO+kWgtAtNL/2ZaqlvjfFWmKRmVPBS9KoPk4NJEtcgkDzx1HB0uK7Mj2jspBEDQKwS3L8DRFKv6cludUI+r+E0G/r6Fmy+ucJTrRkaNbIAvMfj1srUDrQRkYwSDJ4jNQhu/Skjd3sv1mQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriversystems.onmicrosoft.com; s=selector2-windriversystems-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ejx1z1Qj3X4US1q/1YdrUH2l/JvUF8seAXu7M/925nc=; b=nm1HBzVZMdXvGMX28TS/7M/AMsgd0zpCDsPZuZX0j+OnkdN9nD3z9f5ADgA3rOW/AI+9bBKVX8oZOBpcC3pTCofAEwWFOWYM1Q+4iQv8sAiKiWjBhULLDlGXiyg5iRvyyIcmS3lTns2UVomTJbgRQnYt7kwFjxRHWyae4ovDkxs= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=windriver.com; Received: from CY4PR11MB0071.namprd11.prod.outlook.com (2603:10b6:910:7a::30) by CY4PR11MB1351.namprd11.prod.outlook.com (2603:10b6:903:26::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.29; Thu, 8 Apr 2021 04:03:57 +0000 Received: from CY4PR11MB0071.namprd11.prod.outlook.com ([fe80::f45f:e820:49f5:3725]) by CY4PR11MB0071.namprd11.prod.outlook.com ([fe80::f45f:e820:49f5:3725%6]) with mapi id 15.20.3999.032; Thu, 8 Apr 2021 04:03:56 +0000 From: quanyang.wang@windriver.com To: Mark Brown , Michal Simek , Amit Kumar Mahapatra Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Quanyang Wang Subject: [PATCH 4/4] spi: spi-zynqmp-gqspi: fix incorrect operating mode in zynqmp_qspi_read_op Date: Thu, 8 Apr 2021 12:02:23 +0800 Message-Id: <20210408040223.23134-5-quanyang.wang@windriver.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210408040223.23134-1-quanyang.wang@windriver.com> References: <20210408040223.23134-1-quanyang.wang@windriver.com> X-Originating-IP: [60.247.85.82] X-ClientProxiedBy: HK2PR02CA0138.apcprd02.prod.outlook.com (2603:1096:202:16::22) To CY4PR11MB0071.namprd11.prod.outlook.com (2603:10b6:910:7a::30) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pek-qwang2-d1.wrs.com (60.247.85.82) by HK2PR02CA0138.apcprd02.prod.outlook.com (2603:1096:202:16::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Thu, 8 Apr 2021 04:03:54 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f7f289e2-8a32-4cfe-cda1-08d8fa435482 X-MS-TrafficTypeDiagnostic: CY4PR11MB1351: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: auEcOlCHJXogD0ibbjlJKGg119x+jCo75tl9etS9QjRCvN/R1iQYnRLn7N33wcfsgraT+qw/LgcYeNf2fXsiawD+y642CRQ07DGKPM9eLLqeHnohfV9KWZjNnZTQj3K7XUMSowiSdT7lTec5ncjf7+GJmiFfqn3EnbKhc4BWgN3AxkmnlSZukmngbwA6CM+Nn2HOM55vGKt4WTYkiNqO5pjK/+dkPcKnrLDmIz5OnlnCOXA54iAhkCsICXbc7j7jLH3pr84xkDKPGgem+pW8Ll1/wyA3u0/aD7S+ZN7bEJRFudTyIa5bo1GkunWKhPRv0E+a+p0hyD/DFUOR5qUzRiRZ1l8y6wRr/RpnWO8+1ol8fqCIFDQwJTN50jQm40HytU9/cwvpOe9wUOZf+2hMF7qI78z5m0sSJgl4OS6vDDKEXAcoquFKfo9QjuUCngfKRRevO3H20nvUDC6YeshJcHLh/nDErEmtWvo3m3zVZrW2j/FlloxBg4Aq4okgjNpmAtgJkOj6U9NFxjbigeSIlzTKArwY896oeVImbr1kJ6jiVwvbAIWP3YmN3GFs1PhCJwVfKG2rFhzeBal/bZIYhMw+7hcbKa3AEsCHckRBwCTnOmv3ETCXmrUYdFVuLw7eympqa0VoJrGNYZmkiuOzt1VaZUuZ7Jk6aqlEr6Bcdf54S1put93I3BVHUMIf8Uzl X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR11MB0071.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(366004)(376002)(39850400004)(396003)(8936002)(478600001)(36756003)(38350700001)(6512007)(66476007)(2906002)(8676002)(83380400001)(26005)(186003)(16526019)(66556008)(9686003)(38100700001)(107886003)(6506007)(316002)(86362001)(52116002)(1076003)(6486002)(110136005)(5660300002)(956004)(66946007)(2616005)(4326008)(6666004); DIR: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02ffqJq2pW+p7v+vAFFOpHIOot7W7z0XUji7Kp86EV6tm8lPyQXDlocLxLnBXi8fyZRL2Dpo/ikD7rD/5hNvjBESShwE1EyqOiHI7O1OEmwTsv5wgUCSrVTY6pDcL4PA1FQ5i3SwB6TTQm7jOuHVN3mRVB1uZEoi1oY7pddGqUO7R8k3aCRudnaE56Qg7wUiryDETlvQxI1v6QinTCvK+xePhSvqr7DPizybRmTMXYYVfJ4i1EO+wAgoqmX7KfCPUaaG88qNilKAaCCI1jaViEa4M8ReimULhazkhG8DS+v+Mxshy X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: f7f289e2-8a32-4cfe-cda1-08d8fa435482 X-MS-Exchange-CrossTenant-AuthSource: CY4PR11MB0071.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2021 04:03:56.2155 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fCRDEvGFTZE1tGWhZDOMps462KDuqwjwNBsWJelm4Dg386rO63pYNICuOJmq/DXSy9jHLH9LLxiWaYZnSyLaggJc+qtp1BOD34BcX5xbjLU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1351 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210408_050409_084958_16E310D5 X-CRM114-Status: GOOD ( 12.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Quanyang Wang When starting a read operation, we should call zynqmp_qspi_setuprxdma first to set xqspi->mode according to xqspi->bytes_to_receive and to calculate correct xqspi->dma_rx_bytes. Then in the function zynqmp_qspi_fillgenfifo, generate the appropriate command with operating mode and bytes to transfer, and fill the GENFIFO with the command to perform the read operation. Calling zynqmp_qspi_fillgenfifo before zynqmp_qspi_setuprxdma will result in incorrect transfer length and operating mode. So change the calling order to fix this issue. Fixes: 1c26372e5aa9 ("spi: spi-zynqmp-gqspi: Update driver to use spi-mem framework") Signed-off-by: Quanyang Wang Reviewed-by: Amit Kumar Mahapatra --- drivers/spi/spi-zynqmp-gqspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c index cf73a069b759..036d8ae41c06 100644 --- a/drivers/spi/spi-zynqmp-gqspi.c +++ b/drivers/spi/spi-zynqmp-gqspi.c @@ -827,8 +827,8 @@ static void zynqmp_qspi_write_op(struct zynqmp_qspi *xqspi, u8 tx_nbits, static void zynqmp_qspi_read_op(struct zynqmp_qspi *xqspi, u8 rx_nbits, u32 genfifoentry) { - zynqmp_qspi_fillgenfifo(xqspi, rx_nbits, genfifoentry); zynqmp_qspi_setuprxdma(xqspi); + zynqmp_qspi_fillgenfifo(xqspi, rx_nbits, genfifoentry); } /**