[{"id":1752753,"web_url":"http://patchwork.ozlabs.org/comment/1752753/","msgid":"<DB5PR04MB1350C8E1642E3DFFCD9202F280870@DB5PR04MB1350.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-08-21T12:03:13","subject":"Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","submitter":{"id":70239,"url":"http://patchwork.ozlabs.org/api/people/70239/","name":"Suresh Gupta","email":"suresh.gupta@nxp.com"},"content":"Hi York, \n\nCan I delegate this patch to you? Delegate to Jagan (SPI Maintainer) delays the acceptance process. \n\nThanks \nSuresH\n\n> -----Original Message-----\n> From: Suresh Gupta [mailto:suresh.gupta@nxp.com]\n> Sent: Monday, August 21, 2017 3:56 PM\n> To: u-boot@lists.denx.de\n> Cc: York Sun <york.sun@nxp.com>; jagan@openedev.com; Prabhakar Kushwaha\n> <prabhakar.kushwaha@nxp.com>; Suresh Gupta <suresh.gupta@nxp.com>\n> Subject: [PATCH] spi: fsl_qspi: Add controller busy check before new spi\n> operation\n> \n> It is recommended to check either controller is free to take new spi action. The\n> IP_ACC and AHB_ACC bits indicates that the controller is busy in IP or AHB mode\n> respectively.\n> And the BUSY bit indicates that the controller is currently busy handling a\n> transaction to an external flash device\n> \n> Signed-off-by: Suresh Gupta <suresh.gupta@nxp.com>\n> ---\n>  drivers/spi/fsl_qspi.c | 26 ++++++++++++++++++++++++++  drivers/spi/fsl_qspi.h\n> |  4 ++++\n>  2 files changed, 30 insertions(+)\n> \n> diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index 1dfa89a..69e9712\n> 100644\n> --- a/drivers/spi/fsl_qspi.c\n> +++ b/drivers/spi/fsl_qspi.c\n> @@ -165,6 +165,27 @@ static inline u32 qspi_endian_xchg(u32 data)  #endif  }\n> \n> +static inline u32 qspi_controller_busy(struct fsl_qspi_priv *priv) {\n> +\tu32 sr;\n> +\tu32 retry = 5;\n> +\n> +\tdo {\n> +\t\tsr = qspi_read32(priv->flags, &priv->regs->sr);\n> +\t\tif ((sr & QSPI_SR_BUSY_MASK) ||\n> +\t\t    (sr & QSPI_SR_AHB_ACC_MASK) ||\n> +\t\t    (sr & QSPI_SR_IP_ACC_MASK)) {\n> +\t\t\tdebug(\"The controller is busy, sr = 0x%x\\n\", sr);\n> +\t\t\tudelay(1);\n> +\t\t} else {\n> +\t\t\tbreak;\n> +\t\t}\n> +\t} while (--retry);\n> +\n> +\treturn (sr & QSPI_SR_BUSY_MASK) ||\n> +\t\t(sr & QSPI_SR_AHB_ACC_MASK) || (sr &\n> QSPI_SR_IP_ACC_MASK); }\n> +\n>  static void qspi_set_lut(struct fsl_qspi_priv *priv)  {\n>  \tstruct fsl_qspi_regs *regs = priv->regs; @@ -765,6 +786,11 @@ int\n> qspi_xfer(struct fsl_qspi_priv *priv, unsigned int bitlen,\n> \n>  \tWATCHDOG_RESET();\n> \n> +\tif (qspi_controller_busy(priv)) {\n> +\t\tprintf(\"ERROR : The controller is busy\\n\");\n> +\t\treturn -EBUSY;\n> +\t}\n> +\n>  \tif (dout) {\n>  \t\tif (flags & SPI_XFER_BEGIN) {\n>  \t\t\tpriv->cur_seqid = *(u8 *)dout;\n> diff --git a/drivers/spi/fsl_qspi.h b/drivers/spi/fsl_qspi.h index 6cb3610..e468eb2\n> 100644\n> --- a/drivers/spi/fsl_qspi.h\n> +++ b/drivers/spi/fsl_qspi.h\n> @@ -105,6 +105,10 @@ struct fsl_qspi_regs {\n>  #define QSPI_RBCT_RXBRD_SHIFT\t\t8\n>  #define QSPI_RBCT_RXBRD_USEIPS\t\t(1 <<\n> QSPI_RBCT_RXBRD_SHIFT)\n> \n> +#define QSPI_SR_AHB_ACC_SHIFT\t\t2\n> +#define QSPI_SR_AHB_ACC_MASK\t\t(1 <<\n> QSPI_SR_AHB_ACC_SHIFT)\n> +#define QSPI_SR_IP_ACC_SHIFT\t\t1\n> +#define QSPI_SR_IP_ACC_MASK\t\t(1 << QSPI_SR_IP_ACC_SHIFT)\n>  #define QSPI_SR_BUSY_SHIFT\t\t0\n>  #define QSPI_SR_BUSY_MASK\t\t(1 << QSPI_SR_BUSY_SHIFT)\n> \n> --\n> 1.9.3","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"Agcc5kUX\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=suresh.gupta@nxp.com; "],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xbXWn61cxz9s8J\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 21 Aug 2017 22:08:05 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 76AE1C220DC; Mon, 21 Aug 2017 12:06:50 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id CEAC8C22175;\n\tMon, 21 Aug 2017 12:03:32 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 52F22C22175; Mon, 21 Aug 2017 12:03:21 +0000 (UTC)","from EUR01-DB5-obe.outbound.protection.outlook.com\n\t(mail-db5eur01on0077.outbound.protection.outlook.com [104.47.2.77])\n\tby lists.denx.de (Postfix) with ESMTPS id DFE68C21E3A\n\tfor <u-boot@lists.denx.de>; Mon, 21 Aug 2017 12:03:15 +0000 (UTC)","from DB5PR04MB1350.eurprd04.prod.outlook.com (10.162.220.156) by\n\tDB5PR04MB1174.eurprd04.prod.outlook.com (10.162.155.16) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.1.1362.18; Mon, 21 Aug 2017 12:03:14 +0000","from DB5PR04MB1350.eurprd04.prod.outlook.com\n\t([fe80::7175:9fbf:f392:a88f]) by\n\tDB5PR04MB1350.eurprd04.prod.outlook.com\n\t([fe80::7175:9fbf:f392:a88f%13]) with mapi id 15.01.1362.019;\n\tMon, 21 Aug 2017 12:03:13 +0000"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=D9ddHHWoYm7COpo70/leAWl/hlfhvWeKzEgmq7LI8lI=;\n\tb=Agcc5kUXo0Vtgr/F+dKL7xuWzQCil3cC8JJIQ+IH/U5dpPN5H5C3yb2EO2EAzemfnz/vQmHr2f8nYfVelVYbxW9Hp4aKfXvctJ4p6O2zudQ5TZ7trJAY+DWnPC+b+GWZHJgeFHuxX5R1AKqy7DBG1fjhAw2IC/5Q/T12+myPa8g=","From":"Suresh Gupta <suresh.gupta@nxp.com>","To":"Suresh Gupta <suresh.gupta@nxp.com>, \"u-boot@lists.denx.de\"\n\t<u-boot@lists.denx.de>","Thread-Topic":"[PATCH] spi: fsl_qspi: Add controller busy check before new spi\n\toperation","Thread-Index":"AQHTGmfSy+b8JHZqmkue7oAhJMoHYqKOtQhA","Date":"Mon, 21 Aug 2017 12:03:13 +0000","Message-ID":"<DB5PR04MB1350C8E1642E3DFFCD9202F280870@DB5PR04MB1350.eurprd04.prod.outlook.com>","References":"<1503311174-3574-1-git-send-email-suresh.gupta@nxp.com>","In-Reply-To":"<1503311174-3574-1-git-send-email-suresh.gupta@nxp.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","authentication-results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"Agcc5kUX\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=suresh.gupta@nxp.com; "],"x-originating-ip":"[192.88.169.1]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; DB5PR04MB1174;\n\t6:gf+LpwhyfgEUfJTiethjxZ/ZLcy5teLHCV7/vaRPjRVVVIT6u8aeurZ1to7ENJ6tdjzJso4oxxn5LSJUrvjYnBJEyP9Zp9XTnSJi9ep+rTsCLPiqjCF/Taw1GY6cxxtuqZeLOI4XdKNZn2M41UnnhHPptdTNkvg+KRhlCfXau3h9As+EHh+SsU57ypiOA67wx4e4zB8ZVu9WFwAzWH3M0Yc+4qOfFEBDegUY70IhRW9iITNgswFxNmTZl4Z0r/4Cod7SFnPcwfLohz3ALmC6AB2t6zOpkhRlzC0MB8ktsCoT2nY7+mSTvANdH4ePXnNc3t/Y4DkTYLq87N6gZ+tWMA==;\n\t5:55RekAaNTFtq8kb7J/3wLg+6L7lK7tNrGS+WE8aRtGXx+jtgppVal8/XHRSUMucCN8ZDiOHrOAuLVqvqg6i55XtkOfazMgq4UzZFvxdjJFyBPRfVTD/DS7OxmNyhzJuGdzvC4Vv4GYYAvro2OE2D3Q==;\n\t24:RdS+I6cow7+DzF5caZGuPwNkSw7L6JfA0Q9GyOlMzVt59y0iT1RJ+tB28p239tmRrrUg2aWQ92v+hsKETyh8PXfQBQDwvF1UVQxV9fVoSfk=;\n\t7:7Sz326jOfKs5rAT+DkY8W57XbLVVcxy9tZm4Pa9bVAjhjOHpl98uf/1ibJ99ddBxXuzdycx/757l4HF7RbLSaW9QuK//iU5kCdSvFd5PTbY1hIzIiWqRQO5buS1Wbl1PWIoHTOdVWJYT3beAyHG6iH2sWhipPhm4gaLclDc/sUdO3t+ZkVTKKqhATjCVodsZtF6J0tyuLwwE8BNqYe1Nt9XHolFfyEXuOdA2Rn6geSQ=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;SSOR;","x-forefront-antispam-report":"SFV:SKI; SCL:-1; SFV:NSPM;\n\tSFS:(10009020)(6009001)(39860400002)(199003)(189002)(13464003)(377454003)(6436002)(2501003)(50986999)(66066001)(106356001)(54356999)(76176999)(2950100002)(6506006)(229853002)(6246003)(105586002)(2900100001)(53936002)(9686003)(551934003)(54906002)(99286003)(101416001)(55016002)(305945005)(5250100002)(53546010)(5660300001)(4326008)(3660700001)(14454004)(81166006)(8936002)(8676002)(3280700002)(7696004)(81156014)(86362001)(2906002)(3846002)(97736004)(478600001)(68736007)(102836003)(6116002)(25786009)(33656002)(189998001)(74316002)(7736002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR04MB1174;\n\tH:DB5PR04MB1350.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; A:1; MX:1; LANG:en; ","x-ms-office365-filtering-correlation-id":"51d1981a-5cf0-4b99-228d-08d4e88c99a8","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:DB5PR04MB1174; ","x-ms-traffictypediagnostic":"DB5PR04MB1174:","x-exchange-antispam-report-test":"UriScan:(185117386973197)(16074681357397);","x-microsoft-antispam-prvs":"<DB5PR04MB11741A1227D48C61D822D5CC80870@DB5PR04MB1174.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123560025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:DB5PR04MB1174; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:DB5PR04MB1174; ","x-forefront-prvs":"040655413E","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-originalarrivaltime":"21 Aug 2017 12:03:13.6612\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"DB5PR04MB1174","Cc":"\"jagan@openedev.com\" <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1752919,"web_url":"http://patchwork.ozlabs.org/comment/1752919/","msgid":"<CAD6G_RSvvXn4RMp1NmqzptdPHdiKwA_N0o0BxZpG4_o8wiiNog@mail.gmail.com>","list_archive_url":null,"date":"2017-08-21T14:23:16","subject":"Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","submitter":{"id":20045,"url":"http://patchwork.ozlabs.org/api/people/20045/","name":"Jagan Teki","email":"jagannadh.teki@gmail.com"},"content":"On Mon, Aug 21, 2017 at 3:56 PM, Suresh Gupta <suresh.gupta@nxp.com> wrote:\n> It is recommended to check either controller is free to take\n> new spi action. The IP_ACC and AHB_ACC bits indicates that\n> the controller is busy in IP or AHB mode respectively.\n> And the BUSY bit indicates that the controller is currently\n> busy handling a transaction to an external flash device\n>\n> Signed-off-by: Suresh Gupta <suresh.gupta@nxp.com>\n> ---\n>  drivers/spi/fsl_qspi.c | 26 ++++++++++++++++++++++++++\n>  drivers/spi/fsl_qspi.h |  4 ++++\n>  2 files changed, 30 insertions(+)\n>\n> diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c\n> index 1dfa89a..69e9712 100644\n> --- a/drivers/spi/fsl_qspi.c\n> +++ b/drivers/spi/fsl_qspi.c\n> @@ -165,6 +165,27 @@ static inline u32 qspi_endian_xchg(u32 data)\n>  #endif\n>  }\n>\n> +static inline u32 qspi_controller_busy(struct fsl_qspi_priv *priv)\n> +{\n> +       u32 sr;\n> +       u32 retry = 5;\n> +\n> +       do {\n> +               sr = qspi_read32(priv->flags, &priv->regs->sr);\n> +               if ((sr & QSPI_SR_BUSY_MASK) ||\n\nDoes this bit need? we can check the busy-state with AHB_ACC and IP_ACC\n\n> +                   (sr & QSPI_SR_AHB_ACC_MASK) ||\n> +                   (sr & QSPI_SR_IP_ACC_MASK)) {\n> +                       debug(\"The controller is busy, sr = 0x%x\\n\", sr);\n> +                       udelay(1);\n> +               } else {\n> +                       break;\n> +               }\n> +       } while (--retry);\n\nThese retry and infine loop doesn't seems OK, how about using wait_for_bit?\n\n> +\n> +       return (sr & QSPI_SR_BUSY_MASK) ||\n> +               (sr & QSPI_SR_AHB_ACC_MASK) || (sr & QSPI_SR_IP_ACC_MASK);\n\nI didn't understand why these bits need to return? and when will the\nLUT trigger?\n\nthanks!","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"BLysuykt\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xbbX53mTFz9s7C\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 22 Aug 2017 00:23:32 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid C9A91C21E0F; Mon, 21 Aug 2017 14:23:22 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 697B4C21D04;\n\tMon, 21 Aug 2017 14:23:20 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid A7A74C21D04; Mon, 21 Aug 2017 14:23:18 +0000 (UTC)","from mail-lf0-f67.google.com (mail-lf0-f67.google.com\n\t[209.85.215.67])\n\tby lists.denx.de (Postfix) with ESMTPS id 124A4C21C4E\n\tfor <u-boot@lists.denx.de>; Mon, 21 Aug 2017 14:23:18 +0000 (UTC)","by mail-lf0-f67.google.com with SMTP id z12so2343119lfd.4\n\tfor <u-boot@lists.denx.de>; Mon, 21 Aug 2017 07:23:18 -0700 (PDT)","by 10.25.143.131 with HTTP; Mon, 21 Aug 2017 07:23:16 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=SMxdJKYxe8fnaoSEAPpORA8Dn8XAbL2OtjAPhzb6ba4=;\n\tb=BLysuyktI3VSWqfZorWkxBQTmmiUXImcJ/SVXn8CdkY+sW2auTpltMLRMjX2b4AHOO\n\tImeAOxS+VvxplAnkjSl8TyObebaolp53Ajbqe0KdPN8kQjlKtP5ZJavATC6n3pTMS141\n\tsVQUgQeS2gGTbHWSV/oOL/QcKdQjtD1zspocaSIkrBVc3AEgxutD3Oz7JPLJuwxV+kDx\n\t178flgukcaX2Yp7EJ2y0ZOp5cvRfc2vMAWAz4CwKcVSZph9BR11EW/YRrvrq/Yu+Hk4N\n\tUZmCFBFo8yfvAsO9EwedIxpq50iQL/C0Xb31fkYtIldCtweQxFs9gLa7cbv3FLHeBYQt\n\tBJ7A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=SMxdJKYxe8fnaoSEAPpORA8Dn8XAbL2OtjAPhzb6ba4=;\n\tb=UN0qWXASrgATuwWtIw/H0MZ42vZ75U5H1CYoib2BF+8/fQu/Qj5COfz1Yd7f6F96SH\n\t88ip7jDVGwjQx+0hggNVepCLb7BYhKrVsyhB89jwW/J39FfDl08YCRSRvs9BkVMUbvV5\n\tIACUH9txfpzdvTtl+TziExGqURxEWBH9u5qIckFg/wnNwu1/wAgcPXlEJV8CuWcLDgFv\n\t00a1o/QsV3EsEYNJh1FdxwoPMyogjAV5B6p/tnIY9Bn9Jb+GqWTBW1BCJ5M9pBSuGv6f\n\tiQPSHncWqP2YPdap//oaJMjz7N6T7yyk7JRoq8dD3DNypdWFdyeFtTZ2v9fwzhJ2n9Ww\n\taaOA==","X-Gm-Message-State":"AHYfb5g4Sfq+fYot0hfH1JsUYNGDapOVjN88Zk4kf/vr+O53s4NenOh+\n\tCBbIs7XtSWK14nUhD70uXDIveheXIw==","X-Received":"by 10.25.80.13 with SMTP id e13mr5397952lfb.92.1503325397391;\n\tMon, 21 Aug 2017 07:23:17 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<1503311174-3574-1-git-send-email-suresh.gupta@nxp.com>","References":"<1503311174-3574-1-git-send-email-suresh.gupta@nxp.com>","From":"Jagan Teki <jagannadh.teki@gmail.com>","Date":"Mon, 21 Aug 2017 19:53:16 +0530","Message-ID":"<CAD6G_RSvvXn4RMp1NmqzptdPHdiKwA_N0o0BxZpG4_o8wiiNog@mail.gmail.com>","To":"Suresh Gupta <suresh.gupta@nxp.com>","Cc":"\"u-boot@lists.denx.de\" <u-boot@lists.denx.de>,\n\tJagan Teki <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1753018,"web_url":"http://patchwork.ozlabs.org/comment/1753018/","msgid":"<VI1PR04MB207811BC9640A3CA1FC821F99A870@VI1PR04MB2078.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-08-21T16:03:50","subject":"Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","submitter":{"id":67822,"url":"http://patchwork.ozlabs.org/api/people/67822/","name":"York Sun","email":"york.sun@nxp.com"},"content":"I shouldn't take this patch without Jagan's ack.\n\nYork\n\nOn 08/21/2017 05:03 AM, Suresh Gupta wrote:\n> Hi York,\n> \n> Can I delegate this patch to you? Delegate to Jagan (SPI Maintainer) delays the acceptance process.\n> \n> Thanks\n> SuresH\n> \n>> -----Original Message-----\n>> From: Suresh Gupta [mailto:suresh.gupta@nxp.com]\n>> Sent: Monday, August 21, 2017 3:56 PM\n>> To: u-boot@lists.denx.de\n>> Cc: York Sun <york.sun@nxp.com>; jagan@openedev.com; Prabhakar Kushwaha\n>> <prabhakar.kushwaha@nxp.com>; Suresh Gupta <suresh.gupta@nxp.com>\n>> Subject: [PATCH] spi: fsl_qspi: Add controller busy check before new spi\n>> operation\n>>\n>> It is recommended to check either controller is free to take new spi action. The\n>> IP_ACC and AHB_ACC bits indicates that the controller is busy in IP or AHB mode\n>> respectively.\n>> And the BUSY bit indicates that the controller is currently busy handling a\n>> transaction to an external flash device\n>>\n>> Signed-off-by: Suresh Gupta <suresh.gupta@nxp.com>\n>> ---\n>>   drivers/spi/fsl_qspi.c | 26 ++++++++++++++++++++++++++  drivers/spi/fsl_qspi.h\n>> |  4 ++++\n>>   2 files changed, 30 insertions(+)\n>>\n>> diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index 1dfa89a..69e9712\n>> 100644\n>> --- a/drivers/spi/fsl_qspi.c\n>> +++ b/drivers/spi/fsl_qspi.c\n>> @@ -165,6 +165,27 @@ static inline u32 qspi_endian_xchg(u32 data)  #endif  }\n>>\n>> +static inline u32 qspi_controller_busy(struct fsl_qspi_priv *priv) {\n>> +\tu32 sr;\n>> +\tu32 retry = 5;\n>> +\n>> +\tdo {\n>> +\t\tsr = qspi_read32(priv->flags, &priv->regs->sr);\n>> +\t\tif ((sr & QSPI_SR_BUSY_MASK) ||\n>> +\t\t    (sr & QSPI_SR_AHB_ACC_MASK) ||\n>> +\t\t    (sr & QSPI_SR_IP_ACC_MASK)) {\n>> +\t\t\tdebug(\"The controller is busy, sr = 0x%x\\n\", sr);\n>> +\t\t\tudelay(1);\n>> +\t\t} else {\n>> +\t\t\tbreak;\n>> +\t\t}\n>> +\t} while (--retry);\n>> +\n>> +\treturn (sr & QSPI_SR_BUSY_MASK) ||\n>> +\t\t(sr & QSPI_SR_AHB_ACC_MASK) || (sr &\n>> QSPI_SR_IP_ACC_MASK); }\n>> +\n>>   static void qspi_set_lut(struct fsl_qspi_priv *priv)  {\n>>   \tstruct fsl_qspi_regs *regs = priv->regs; @@ -765,6 +786,11 @@ int\n>> qspi_xfer(struct fsl_qspi_priv *priv, unsigned int bitlen,\n>>\n>>   \tWATCHDOG_RESET();\n>>\n>> +\tif (qspi_controller_busy(priv)) {\n>> +\t\tprintf(\"ERROR : The controller is busy\\n\");\n>> +\t\treturn -EBUSY;\n>> +\t}\n>> +\n>>   \tif (dout) {\n>>   \t\tif (flags & SPI_XFER_BEGIN) {\n>>   \t\t\tpriv->cur_seqid = *(u8 *)dout;\n>> diff --git a/drivers/spi/fsl_qspi.h b/drivers/spi/fsl_qspi.h index 6cb3610..e468eb2\n>> 100644\n>> --- a/drivers/spi/fsl_qspi.h\n>> +++ b/drivers/spi/fsl_qspi.h\n>> @@ -105,6 +105,10 @@ struct fsl_qspi_regs {\n>>   #define QSPI_RBCT_RXBRD_SHIFT\t\t8\n>>   #define QSPI_RBCT_RXBRD_USEIPS\t\t(1 <<\n>> QSPI_RBCT_RXBRD_SHIFT)\n>>\n>> +#define QSPI_SR_AHB_ACC_SHIFT\t\t2\n>> +#define QSPI_SR_AHB_ACC_MASK\t\t(1 <<\n>> QSPI_SR_AHB_ACC_SHIFT)\n>> +#define QSPI_SR_IP_ACC_SHIFT\t\t1\n>> +#define QSPI_SR_IP_ACC_MASK\t\t(1 << QSPI_SR_IP_ACC_SHIFT)\n>>   #define QSPI_SR_BUSY_SHIFT\t\t0\n>>   #define QSPI_SR_BUSY_MASK\t\t(1 << QSPI_SR_BUSY_SHIFT)\n>>\n>> --\n>> 1.9.3\n> \n>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"wQyE0tOX\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=york.sun@nxp.com; "],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xbdm53v9hz9sRW\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 22 Aug 2017 02:04:04 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 9BB7DC21E18; Mon, 21 Aug 2017 16:03:57 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 09F65C21D5B;\n\tMon, 21 Aug 2017 16:03:55 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid AE198C21D5B; Mon, 21 Aug 2017 16:03:52 +0000 (UTC)","from EUR02-AM5-obe.outbound.protection.outlook.com\n\t(mail-eopbgr00058.outbound.protection.outlook.com [40.107.0.58])\n\tby lists.denx.de (Postfix) with ESMTPS id 49238C21C27\n\tfor <u-boot@lists.denx.de>; Mon, 21 Aug 2017 16:03:52 +0000 (UTC)","from VI1PR04MB2078.eurprd04.prod.outlook.com (10.166.43.18) by\n\tVI1PR04MB3229.eurprd04.prod.outlook.com (10.170.227.26) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.1.1362.18; Mon, 21 Aug 2017 16:03:51 +0000","from VI1PR04MB2078.eurprd04.prod.outlook.com\n\t([fe80::5ce6:46c1:8a2c:ca59]) by\n\tVI1PR04MB2078.eurprd04.prod.outlook.com\n\t([fe80::5ce6:46c1:8a2c:ca59%14]) with mapi id 15.01.1362.019;\n\tMon, 21 Aug 2017 16:03:50 +0000"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=D5Ac08VxS9kn17sM4AJjwWhqSEuzk0NWUFjOEXYPMs8=;\n\tb=wQyE0tOXoyMdBe6u8z8+gqg/c4KzEzMYKdBbN+yVs4yDXIc4hkbPLoP2VW/Y4n7Vtrw+4Ni5+ADcndB8dAaYemKoBrfIkjW4jFHTQykmAscNC1DhXrIURVY+qZtwLHT7INyVoDRhcA5/SRmqfhFdl0/1NRTo6fRK/CryG0Ajd7k=","From":"York Sun <york.sun@nxp.com>","To":"Suresh Gupta <suresh.gupta@nxp.com>, \"u-boot@lists.denx.de\"\n\t<u-boot@lists.denx.de>","Thread-Topic":"[PATCH] spi: fsl_qspi: Add controller busy check before new spi\n\toperation","Thread-Index":"AQHTGmfSLTG3pOWqPECVE1Bn5wVDRw==","Date":"Mon, 21 Aug 2017 16:03:50 +0000","Message-ID":"<VI1PR04MB207811BC9640A3CA1FC821F99A870@VI1PR04MB2078.eurprd04.prod.outlook.com>","References":"<1503311174-3574-1-git-send-email-suresh.gupta@nxp.com>\n\t<DB5PR04MB1350C8E1642E3DFFCD9202F280870@DB5PR04MB1350.eurprd04.prod.outlook.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","authentication-results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"wQyE0tOX\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=york.sun@nxp.com; "],"x-originating-ip":"[192.88.168.50]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; VI1PR04MB3229;\n\t6:9t2l0UZ7k0NlGIteH8HZ/TDVobsXEA/kIuLcuRtq7CKZHO+pbAkEHBn6S+gA8EwjUHLDFfSYvk1uO0eLIQEydavA+kijsWQiNhaWPj20uqY1LI42PDtTRKLQ93hNObVV35ifm1XN45Y6iflvtbIKZ73Db9bVOA06DMyF4vpMEvUDSBVkDUwevfBMe6/LN9ZU+ZN8dZUnGp0oLQ8RIObPRSMp36d1XYUg8GCtMoQ/Il7V9MPu5QumY2Fy1ETI1lULVIeUWV95zVHEtsZNqt4QSQirXp0jCFCPGnfRTL3SDEYnBvhhrX94q3pUSqL/8cITR93+/744KcEwzLPjmeDp8A==;\n\t5:9Br6A3Tul66gGLXrameaEudWvF57O6Jj8syAXuE4d0ve0pL2tKO3GheQqtJVcCepAz+2/pe/5FCSVHhw9zJcZ4Dri0y4r9VsxDKAp1mG+pc4X5GJ9zqGyVIbtoYHPhE4OJn6j/5+kE0ck+HkC8ifOg==;\n\t24:W6bXHlzUURoLsxw68+KCMYY/S7n4OMuuOIV2Ko8qunbX309U5+QoAIteZ4/HBWUTKECryXG2EoTzgpSM/pXJwDm86o0xWqJWzmfPG9+AYoU=;\n\t7:8GBqZQlKpRUMm+VS1Hz0d8b9VmSVCm9MD6XdQ0glIv4bQxCByY98tFg5IpN8Uh5JpJ60Y0rq6sCINlSNUul967sgNu5jO7Qk8i0iS+VVVr1rCWaM7IJMdiAZhM5vOswq8guXBk0mos9XydHCvqQA4s66Cr2bYcESExMya6ThntlEcz2FRiq3Duxk6fOO09H06GIc4f/opSkZ2rZ56pcMrL7Tl9PSx1zXX20iWbXtEJ8=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;SSOR;","x-forefront-antispam-report":"SFV:SKI; SCL:-1; SFV:NSPM;\n\tSFS:(10009020)(6009001)(39860400002)(199003)(377454003)(13464003)(24454002)(189002)(189998001)(6506006)(2900100001)(74316002)(97736004)(99286003)(305945005)(9686003)(54906002)(7736002)(55016002)(4326008)(50986999)(33656002)(6246003)(76176999)(53546010)(54356999)(43066003)(101416001)(551934003)(2906002)(14454004)(105586002)(229853002)(478600001)(25786009)(3450700001)(66066001)(106356001)(3660700001)(86362001)(3280700002)(53936002)(68736007)(5660300001)(6436002)(2501003)(5250100002)(8936002)(6116002)(81166006)(81156014)(7696004)(8676002)(3846002)(102836003);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB3229;\n\tH:VI1PR04MB2078.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; A:1; MX:1; LANG:en; ","x-ms-office365-filtering-correlation-id":"687ad34b-1f78-4740-a58a-08d4e8ae3692","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:VI1PR04MB3229; ","x-ms-traffictypediagnostic":"VI1PR04MB3229:","x-exchange-antispam-report-test":"UriScan:(185117386973197)(16074681357397);","x-microsoft-antispam-prvs":"<VI1PR04MB3229F5342AF4C2ED209491F79A870@VI1PR04MB3229.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:VI1PR04MB3229; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:VI1PR04MB3229; ","x-forefront-prvs":"040655413E","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-originalarrivaltime":"21 Aug 2017 16:03:50.2366\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"VI1PR04MB3229","Cc":"\"jagan@openedev.com\" <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Reply-To":"York Sun <york.sun@nxp.com>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1753736,"web_url":"http://patchwork.ozlabs.org/comment/1753736/","msgid":"<DB5PR04MB135035C87CDCAF998C8B98B780840@DB5PR04MB1350.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-08-22T10:49:16","subject":"Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","submitter":{"id":70239,"url":"http://patchwork.ozlabs.org/api/people/70239/","name":"Suresh Gupta","email":"suresh.gupta@nxp.com"},"content":"Thanks  Jagan for reviewing the code. \r\nPlease find comments in line \r\n\r\n> -----Original Message-----\r\n> From: Jagan Teki [mailto:jagannadh.teki@gmail.com]\r\n> Sent: Monday, August 21, 2017 7:53 PM\r\n> To: Suresh Gupta <suresh.gupta@nxp.com>\r\n> Cc: u-boot@lists.denx.de; Jagan Teki <jagan@openedev.com>\r\n> Subject: Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check before\r\n> new spi operation\r\n> \r\n> On Mon, Aug 21, 2017 at 3:56 PM, Suresh Gupta <suresh.gupta@nxp.com>\r\n> wrote:\r\n> > It is recommended to check either controller is free to take new spi\r\n> > action. The IP_ACC and AHB_ACC bits indicates that the controller is\r\n> > busy in IP or AHB mode respectively.\r\n> > And the BUSY bit indicates that the controller is currently busy\r\n> > handling a transaction to an external flash device\r\n> >\r\n> > Signed-off-by: Suresh Gupta <suresh.gupta@nxp.com>\r\n> > ---\r\n> >  drivers/spi/fsl_qspi.c | 26 ++++++++++++++++++++++++++\r\n> > drivers/spi/fsl_qspi.h |  4 ++++\r\n> >  2 files changed, 30 insertions(+)\r\n> >\r\n> > diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index\r\n> > 1dfa89a..69e9712 100644\r\n> > --- a/drivers/spi/fsl_qspi.c\r\n> > +++ b/drivers/spi/fsl_qspi.c\r\n> > @@ -165,6 +165,27 @@ static inline u32 qspi_endian_xchg(u32 data)\r\n> > #endif  }\r\n> >\r\n> > +static inline u32 qspi_controller_busy(struct fsl_qspi_priv *priv) {\r\n> > +       u32 sr;\r\n> > +       u32 retry = 5;\r\n> > +\r\n> > +       do {\r\n> > +               sr = qspi_read32(priv->flags, &priv->regs->sr);\r\n> > +               if ((sr & QSPI_SR_BUSY_MASK) ||\r\n> \r\n> Does this bit need? we can check the busy-state with AHB_ACC and IP_ACC\r\n\r\nThe definition of the three bits is \r\nBit2 - AHB_ACC: AHB Access: Asserted when the transaction currently executed was initiated by AHB bus.\r\nBit1 - IP_ACC: IP Access: Asserted when transaction currently executed was initiated by IP bus.\r\nBit0 - BUSY: Module Busy: Asserted when module is currently busy handling a transaction to an external flash device.\r\n\r\nAlso, the below are statements mentioned in the IP Block Guide\r\nFor AHB Access: Since the read access is triggered via the AHB bus, the QSPI_SR[AHB_ACC] \r\n\t\tstatus bit is set driving in turn the QSPI_SR[BUSY] bit until the transaction is finished.\r\nFor IP Access: Since the read access is triggered by an IP command the IP_ACC status bit and\r\n\t\tthe BUSY bit are both set (both are located in the Status Register (QSPI_SR) ).\r\n\r\nSo, BUSY flag is set when the controller is busy in communication with FLASH and this is true for both IP and AHB mode.\r\nThat’s the reason checking all three status bits ensures us that controller is free.  \r\n\r\n> \r\n> > +                   (sr & QSPI_SR_AHB_ACC_MASK) ||\r\n> > +                   (sr & QSPI_SR_IP_ACC_MASK)) {\r\n> > +                       debug(\"The controller is busy, sr = 0x%x\\n\", sr);\r\n> > +                       udelay(1);\r\n> > +               } else {\r\n> > +                       break;\r\n> > +               }\r\n> > +       } while (--retry);\r\n> \r\n> These retry and infine loop doesn't seems OK, how about using wait_for_bit?\r\nOk, I will use below and send a new patch\r\n\r\nret = wait_for_bit(__func__, regs->sr,\r\n                          QSPI_SR_BUSY_MASK |\r\n                          QSPI_SR_AHB_ACC_MASK |\r\n                          QSPI_SR_IP_ACC_MASK,\r\n                          false, 1000, false);\r\n> \r\n> > +\r\n> > +       return (sr & QSPI_SR_BUSY_MASK) ||\r\n> > +               (sr & QSPI_SR_AHB_ACC_MASK) || (sr &\r\n> > + QSPI_SR_IP_ACC_MASK);\r\n> \r\n> I didn't understand why these bits need to return? \r\nAfter wait_for_bit, this is not required \r\n\r\n> and when will the LUT trigger?\r\nThe check is added as it is recommended that before any new transaction, these bits should be 0 i.e. controller is not busy.\r\nThis check is required before all new types of transaction with FLASH. \r\nSo I added this in qspi_xfer() which intern calls actual hardware operations like qspi_op_write, qspi_op_erase, qspi_ahb_read, qspi_op_rdsr etc., which triggers the LUT.  \r\n\r\n> \r\n> thanks!\r\n> --\r\n> Jagan Teki\r\n> Free Software Engineer | www.openedev.com U-Boot, Linux | Upstream\r\n> Maintainer Hyderabad, India.","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"S8p9DV2l\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=suresh.gupta@nxp.com; "],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xc6kg1MS8z9s83\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 22 Aug 2017 20:49:31 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 352E3C21EA5; Tue, 22 Aug 2017 10:49:23 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 86E55C21DF3;\n\tTue, 22 Aug 2017 10:49:20 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 80A8FC21DF3; Tue, 22 Aug 2017 10:49:18 +0000 (UTC)","from EUR01-VE1-obe.outbound.protection.outlook.com\n\t(mail-ve1eur01on0052.outbound.protection.outlook.com [104.47.1.52])\n\tby lists.denx.de (Postfix) with ESMTPS id 06A0AC21D5B\n\tfor <u-boot@lists.denx.de>; Tue, 22 Aug 2017 10:49:18 +0000 (UTC)","from DB5PR04MB1350.eurprd04.prod.outlook.com (10.162.220.156) by\n\tDB5PR04MB1447.eurprd04.prod.outlook.com (10.162.221.141) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.1.1362.18; Tue, 22 Aug 2017 10:49:16 +0000","from DB5PR04MB1350.eurprd04.prod.outlook.com\n\t([fe80::7175:9fbf:f392:a88f]) by\n\tDB5PR04MB1350.eurprd04.prod.outlook.com\n\t([fe80::7175:9fbf:f392:a88f%13]) with mapi id 15.01.1362.019;\n\tTue, 22 Aug 2017 10:49:16 +0000"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=RLM25/IJum3fhmYKuUXU9cwL5vrY4bV+nuI+VfSyAsU=;\n\tb=S8p9DV2lRG05RZYs2FV4iwEQiV+fghWQ7931DUTyRttZcG+Jyu3maYPDk6ptkttx845uS7TD8HqO3y3pR3ozL75app39cCgSmoloR/tqzUTuiPNYV7nbZVjqDq+84TX/HnxwHn9TRkdz9X4kADDvw1RNDPVsCvzFdCwrYz9a7vw=","From":"Suresh Gupta <suresh.gupta@nxp.com>","To":"Jagan Teki <jagannadh.teki@gmail.com>","Thread-Topic":"[U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","Thread-Index":"AQHTGmfSy+b8JHZqmkue7oAhJMoHYqKO3T8AgAEqFBA=","Date":"Tue, 22 Aug 2017 10:49:16 +0000","Message-ID":"<DB5PR04MB135035C87CDCAF998C8B98B780840@DB5PR04MB1350.eurprd04.prod.outlook.com>","References":"<1503311174-3574-1-git-send-email-suresh.gupta@nxp.com>\n\t<CAD6G_RSvvXn4RMp1NmqzptdPHdiKwA_N0o0BxZpG4_o8wiiNog@mail.gmail.com>","In-Reply-To":"<CAD6G_RSvvXn4RMp1NmqzptdPHdiKwA_N0o0BxZpG4_o8wiiNog@mail.gmail.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","authentication-results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"S8p9DV2l\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=suresh.gupta@nxp.com; "],"x-originating-ip":"[192.88.169.1]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; DB5PR04MB1447;\n\t6:ooqzXZT/O+kBYhqvyHRnaFMXB78lwWHgLJYREBxbodkBk6SyvzUkIuHs31upQuchlMpip+h5WMmozV4uCwiZB2k52Ez7/GroLJLRyDxuFY+t2mIVw9STbI2tj28GoDHcU9OMooiOnHF1pz4CtPw+1XPYS7aL7uyzO+koXqkX1Dj+wCHMB2K8HlQfawr41Wg/+h9tZtovVcGCDcedB5XFXgu6gLX4nbH3ylwscASl2SXrdIOo3EAlGrJlP4qWHZTrv9O46JN7Ucp/wl2v5Jgh63nu41kkMUlCYf8Gd8zgLAFvffYBoHG8B2tchqkpkaqLKHNeB2YgJAuu5aROFQdB9g==;\n\t5:ezuLh6kemTM7MD0ZfklCTLgHmzkYsioMlC37BTK53+eITZaM0xnN9TZ+h6XHL1dxXbJAWZkwUqhXISzIPD/H4OovgErAMc9jQAInslb1/0OEucKeJdiUZeA1YlsHc1Y8ePcoz/sDACcpgmJqcuWTaA==;\n\t24:ahvZXmF+LlUMwTjAOUv6GOvQaUvX9xMaRhYZhG0Pa2MEHq247FyRI+ekU33cL0VVASTlxpP7Daqb9YH02fpSElQTmrHC1qYJXVJbpvLxwJU=;\n\t7:7upJ+8Ek+CtKX5pl3EUbtyEUBOoXqEqfB2k/4mvXTWWfvMeCopPIyXAJb86IDbwO/sbTz0ht3x8bOQlZbRaWBAU6adsV8xTGa1OWgX2+uKWKAVAw+LDq17dfAV7FNOs7NgT+dBa27Qi2EFTENxqmm3pFCIsXuOv28tZ84xx/lQRftSOL3CKxhQ++JbCfL5RaZl/Qv1M7SKj8RY9yulLdKBp9qJKHNg004/HWsWvG3aw=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;","x-ms-office365-filtering-correlation-id":"8a0d37c2-9983-4d29-fc3b-08d4e94b6f40","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:DB5PR04MB1447; ","x-ms-traffictypediagnostic":"DB5PR04MB1447:","x-exchange-antispam-report-test":"UriScan:(185117386973197)(16074681357397);","x-microsoft-antispam-prvs":"<DB5PR04MB1447A1045E5AB8FA32A6527280840@DB5PR04MB1447.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123560025)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:DB5PR04MB1447; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:DB5PR04MB1447; ","x-forefront-prvs":"04073E895A","x-forefront-antispam-report":"SFV:NSPM;\n\tSFS:(10009020)(6009001)(39860400002)(24454002)(199003)(13464003)(189002)(377454003)(6246003)(14454004)(39060400002)(97736004)(5250100002)(105586002)(74316002)(6436002)(53546010)(110136004)(2950100002)(15974865002)(66066001)(6916009)(6116002)(102836003)(189998001)(3846002)(7736002)(8936002)(86362001)(68736007)(3280700002)(33656002)(7696004)(2900100001)(6506006)(3660700001)(5660300001)(8676002)(305945005)(81156014)(81166006)(2906002)(53936002)(229853002)(50986999)(76176999)(101416001)(25786009)(54356999)(551934003)(54906002)(55016002)(9686003)(4326008)(99286003)(478600001)(106356001)(2004002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR04MB1447;\n\tH:DB5PR04MB1350.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; A:1; MX:1; LANG:en; ","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-originalarrivaltime":"22 Aug 2017 10:49:16.3650\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"DB5PR04MB1447","Cc":"\"u-boot@lists.denx.de\" <u-boot@lists.denx.de>,\n\tJagan Teki <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1754189,"web_url":"http://patchwork.ozlabs.org/comment/1754189/","msgid":"<VI1PR04MB2078E540C16DFBB31DBB8BFB9A840@VI1PR04MB2078.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-08-22T16:25:31","subject":"Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","submitter":{"id":67822,"url":"http://patchwork.ozlabs.org/api/people/67822/","name":"York Sun","email":"york.sun@nxp.com"},"content":"On 08/21/2017 03:25 AM, Suresh Gupta wrote:\n> It is recommended to check either controller is free to take\n> new spi action. The IP_ACC and AHB_ACC bits indicates that\n> the controller is busy in IP or AHB mode respectively.\n> And the BUSY bit indicates that the controller is currently\n> busy handling a transaction to an external flash device\n> \n> Signed-off-by: Suresh Gupta <suresh.gupta@nxp.com>\n> ---\n>   drivers/spi/fsl_qspi.c | 26 ++++++++++++++++++++++++++\n>   drivers/spi/fsl_qspi.h |  4 ++++\n>   2 files changed, 30 insertions(+)\n> \n> diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c\n> index 1dfa89a..69e9712 100644\n> --- a/drivers/spi/fsl_qspi.c\n> +++ b/drivers/spi/fsl_qspi.c\n> @@ -165,6 +165,27 @@ static inline u32 qspi_endian_xchg(u32 data)\n>   #endif\n>   }\n>   \n> +static inline u32 qspi_controller_busy(struct fsl_qspi_priv *priv)\n> +{\n> +\tu32 sr;\n> +\tu32 retry = 5;\n> +\n> +\tdo {\n> +\t\tsr = qspi_read32(priv->flags, &priv->regs->sr);\n> +\t\tif ((sr & QSPI_SR_BUSY_MASK) ||\n> +\t\t    (sr & QSPI_SR_AHB_ACC_MASK) ||\n> +\t\t    (sr & QSPI_SR_IP_ACC_MASK)) {\n> +\t\t\tdebug(\"The controller is busy, sr = 0x%x\\n\", sr);\n> +\t\t\tudelay(1);\n> +\t\t} else {\n> +\t\t\tbreak;\n> +\t\t}\n> +\t} while (--retry);\n\nDoes the 5 microsecond-delay make any difference?\n\n> +\n> +\treturn (sr & QSPI_SR_BUSY_MASK) ||\n> +\t\t(sr & QSPI_SR_AHB_ACC_MASK) || (sr & QSPI_SR_IP_ACC_MASK);\n> +}\n> +\n>   static void qspi_set_lut(struct fsl_qspi_priv *priv)\n>   {\n>   \tstruct fsl_qspi_regs *regs = priv->regs;\n> @@ -765,6 +786,11 @@ int qspi_xfer(struct fsl_qspi_priv *priv, unsigned int bitlen,\n>   \n>   \tWATCHDOG_RESET();\n>   \n> +\tif (qspi_controller_busy(priv)) {\n> +\t\tprintf(\"ERROR : The controller is busy\\n\");\n> +\t\treturn -EBUSY;\n> +\t}\n\nIf the controller should never be busy for this operation, I wonder if \nyou really need a delay above.\n\nYork","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"CmRut2QT\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=york.sun@nxp.com; "],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xcGBk60xsz9sRq\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 23 Aug 2017 02:25:49 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 82ADEC21D93; Tue, 22 Aug 2017 16:25:39 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 68D33C21D7B;\n\tTue, 22 Aug 2017 16:25:37 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid B0FB9C21D7B; Tue, 22 Aug 2017 16:25:35 +0000 (UTC)","from EUR01-VE1-obe.outbound.protection.outlook.com\n\t(mail-ve1eur01on0062.outbound.protection.outlook.com [104.47.1.62])\n\tby lists.denx.de (Postfix) with ESMTPS id 1BF2BC21C40\n\tfor <u-boot@lists.denx.de>; Tue, 22 Aug 2017 16:25:35 +0000 (UTC)","from VI1PR04MB2078.eurprd04.prod.outlook.com (10.166.43.18) by\n\tVI1PR04MB1119.eurprd04.prod.outlook.com (10.161.110.12) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.1.1362.18; Tue, 22 Aug 2017 16:25:33 +0000","from VI1PR04MB2078.eurprd04.prod.outlook.com\n\t([fe80::5ce6:46c1:8a2c:ca59]) by\n\tVI1PR04MB2078.eurprd04.prod.outlook.com\n\t([fe80::5ce6:46c1:8a2c:ca59%14]) with mapi id 15.01.1362.019;\n\tTue, 22 Aug 2017 16:25:31 +0000"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=QdKpmRSJt1vsVzu5dz0X6RWmB7bspeXC+tPGjsbTUyA=;\n\tb=CmRut2QTMRNs701yXH5b9h8kozRQjirAg3yloiaHIsQXjD1y2EMUSWXVK+l5rRwo2WE7ricZwbAi3iKsZ5+yQuURW0C2XdUuhFO7qbQNYTTQHnzyWqN8f4URqqp/uk0FiANuFwftnnMH6rIywVkK6FNXAoM1HvB0rUpZxCi9Ltk=","From":"York Sun <york.sun@nxp.com>","To":"Suresh Gupta <suresh.gupta@nxp.com>, \"u-boot@lists.denx.de\"\n\t<u-boot@lists.denx.de>","Thread-Topic":"[PATCH] spi: fsl_qspi: Add controller busy check before new spi\n\toperation","Thread-Index":"AQHTGmfSLTG3pOWqPECVE1Bn5wVDRw==","Date":"Tue, 22 Aug 2017 16:25:31 +0000","Message-ID":"<VI1PR04MB2078E540C16DFBB31DBB8BFB9A840@VI1PR04MB2078.eurprd04.prod.outlook.com>","References":"<1503311174-3574-1-git-send-email-suresh.gupta@nxp.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","authentication-results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"CmRut2QT\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=york.sun@nxp.com; "],"x-originating-ip":"[192.88.168.1]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; VI1PR04MB1119;\n\t6:2AI+TR8qSEnl8UKrN3GDGnXxuF/4f2JMbGsxVBOD6vCaNnStOZ/NwaIa6TXYyhN5pHBN1QlenjKUd5qxEpDQVz0mDkajzEcib506hA1q70C6rpmMk/RhtClpf5KubExY8XrNi20sbpJuPWwYdTkj5vGwR64M8A6O1XjT5rqt3a1u9zSYNagA02OgJid/VgNkMfS8ddU4awY/M/+sNVePVaO1KLeD/5epHb2SBl7BTyRzS7IkiPm5Va/inz5jkI409Q4ENPLHWmFKjO3plDhaPOab9qCHz8BzfjTXGc0+1S5Co8x8XuqVz2IVEmyPsN60nojhdH6pzIlSG0EM+N6TUg==;\n\t5:VSBtyg003AApVdogg5Rdxll6S+po5r3/qnqrs2Cm6xphXoiEMH1H81aezX9AyAKeZYvxTW+IULzkH/UHxRB87WwYWwXTASUpM8op+QTK3Bk2XlvSzvzAGIdEX1wXAIx5l3LD4HtfjjcnW/Kospod1A==;\n\t24:2xe9JQ8hFhWC5sTMtQ98Abi9r/qbNC4h8nBmrorh4mEQSQeYZqI9YJXK8T5dGFLw1yf+7n0z3x466z+86TdUUThISBz3OIQxar/udztoNzI=;\n\t7:I+lLmj0L9dKuyrIG1zQy7QK6FxY8o7iI3e7sdCZoBuJ4gMQahq0NKh7608wtkmbHiEi5ImF17IgZUO/wTaP955qOnpDaQdWoJTKmIRMdyBVWUwoazp4bX6rwdKncRg6c7WWaor6I/sytNKCV2+U/7BZAm48qyS4VmSq9t/66v/ytKATPC0FaIfAjCeIoCdXOo9f6Vxo8uFtXN/4ZuhDfFbou6efoiydEkxDu1jOZnY0=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;SSOR;","x-forefront-antispam-report":"SFV:SKI; SCL:-1; SFV:NSPM;\n\tSFS:(10009020)(979002)(6009001)(39860400002)(24454002)(189002)(199003)(377454003)(54094003)(43066003)(551934003)(7736002)(305945005)(478600001)(189998001)(66066001)(101416001)(2501003)(102836003)(5250100002)(6116002)(105586002)(106356001)(3846002)(2900100001)(86362001)(74316002)(5660300001)(81166006)(8936002)(3280700002)(2906002)(6506006)(9686003)(6436002)(33656002)(54906002)(68736007)(3660700001)(81156014)(8676002)(55016002)(99286003)(229853002)(25786009)(3450700001)(50986999)(14454004)(53546010)(76176999)(4326008)(97736004)(54356999)(6246003)(7696004)(53936002)(969003)(989001)(999001)(1009001)(1019001);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB1119;\n\tH:VI1PR04MB2078.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; MX:1; A:1; LANG:en; ","x-ms-office365-filtering-correlation-id":"2054879b-fab0-491a-1a75-08d4e97a68af","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603170)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:VI1PR04MB1119; ","x-ms-traffictypediagnostic":"VI1PR04MB1119:","x-exchange-antispam-report-test":"UriScan:(185117386973197);","x-microsoft-antispam-prvs":"<VI1PR04MB11193A02E8DC3D73A2C85DCE9A840@VI1PR04MB1119.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6041248)(20161123558100)(20161123560025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:VI1PR04MB1119; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:VI1PR04MB1119; ","x-forefront-prvs":"04073E895A","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-originalarrivaltime":"22 Aug 2017 16:25:31.5798\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"VI1PR04MB1119","Cc":"\"jagan@openedev.com\" <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Reply-To":"York Sun <york.sun@nxp.com>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1754650,"web_url":"http://patchwork.ozlabs.org/comment/1754650/","msgid":"<DB5PR04MB1350386DC172F25FD619628780850@DB5PR04MB1350.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-08-23T03:51:09","subject":"Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","submitter":{"id":70239,"url":"http://patchwork.ozlabs.org/api/people/70239/","name":"Suresh Gupta","email":"suresh.gupta@nxp.com"},"content":"> -----Original Message-----\n> From: York Sun\n> Sent: Tuesday, August 22, 2017 9:56 PM\n> To: Suresh Gupta <suresh.gupta@nxp.com>; u-boot@lists.denx.de\n> Cc: jagan@openedev.com; Prabhakar Kushwaha\n> <prabhakar.kushwaha@nxp.com>\n> Subject: Re: [PATCH] spi: fsl_qspi: Add controller busy check before new spi\n> operation\n> \n> On 08/21/2017 03:25 AM, Suresh Gupta wrote:\n> > It is recommended to check either controller is free to take new spi\n> > action. The IP_ACC and AHB_ACC bits indicates that the controller is\n> > busy in IP or AHB mode respectively.\n> > And the BUSY bit indicates that the controller is currently busy\n> > handling a transaction to an external flash device\n> >\n> > Signed-off-by: Suresh Gupta <suresh.gupta@nxp.com>\n> > ---\n> >   drivers/spi/fsl_qspi.c | 26 ++++++++++++++++++++++++++\n> >   drivers/spi/fsl_qspi.h |  4 ++++\n> >   2 files changed, 30 insertions(+)\n> >\n> > diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index\n> > 1dfa89a..69e9712 100644\n> > --- a/drivers/spi/fsl_qspi.c\n> > +++ b/drivers/spi/fsl_qspi.c\n> > @@ -165,6 +165,27 @@ static inline u32 qspi_endian_xchg(u32 data)\n> >   #endif\n> >   }\n> >\n> > +static inline u32 qspi_controller_busy(struct fsl_qspi_priv *priv) {\n> > +\tu32 sr;\n> > +\tu32 retry = 5;\n> > +\n> > +\tdo {\n> > +\t\tsr = qspi_read32(priv->flags, &priv->regs->sr);\n> > +\t\tif ((sr & QSPI_SR_BUSY_MASK) ||\n> > +\t\t    (sr & QSPI_SR_AHB_ACC_MASK) ||\n> > +\t\t    (sr & QSPI_SR_IP_ACC_MASK)) {\n> > +\t\t\tdebug(\"The controller is busy, sr = 0x%x\\n\", sr);\n> > +\t\t\tudelay(1);\n> > +\t\t} else {\n> > +\t\t\tbreak;\n> > +\t\t}\n> > +\t} while (--retry);\n> \n> Does the 5 microsecond-delay make any difference?\n> \n> > +\n> > +\treturn (sr & QSPI_SR_BUSY_MASK) ||\n> > +\t\t(sr & QSPI_SR_AHB_ACC_MASK) || (sr &\n> QSPI_SR_IP_ACC_MASK); }\n> > +\n> >   static void qspi_set_lut(struct fsl_qspi_priv *priv)\n> >   {\n> >   \tstruct fsl_qspi_regs *regs = priv->regs; @@ -765,6 +786,11 @@ int\n> > qspi_xfer(struct fsl_qspi_priv *priv, unsigned int bitlen,\n> >\n> >   \tWATCHDOG_RESET();\n> >\n> > +\tif (qspi_controller_busy(priv)) {\n> > +\t\tprintf(\"ERROR : The controller is busy\\n\");\n> > +\t\treturn -EBUSY;\n> > +\t}\n> \n> If the controller should never be busy for this operation, I wonder if you really\n> need a delay above.\n\nAs we see in our setup that controller get free after some time. So, I took 5 microseconds as arbitrary number. \nMoreover, below statement [1] of BG points that controller gets free after prefetch completes. \n\n[1] Snapshot from RM: \nFor any AHB access, the sequence pointed to by the QSPI_BFGENCR [SEQID] field is used for\nthe flash transaction initiated. The data is returned to the master as soon as the requested\namount is read from the serial flash. The controller however, continues to prefetch the\nrest of the data in anticipation of a next consecutive request.\n \n> \n> York","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"n+lnsfkO\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=suresh.gupta@nxp.com; "],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xcYPn4S5dz9sCZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 23 Aug 2017 13:51:24 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 0761DC21E41; Wed, 23 Aug 2017 03:51:15 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id D025CC21DCE;\n\tWed, 23 Aug 2017 03:51:12 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 32BC9C21DCE; Wed, 23 Aug 2017 03:51:12 +0000 (UTC)","from EUR03-DB5-obe.outbound.protection.outlook.com\n\t(mail-eopbgr40079.outbound.protection.outlook.com [40.107.4.79])\n\tby lists.denx.de (Postfix) with ESMTPS id 9596CC21C40\n\tfor <u-boot@lists.denx.de>; Wed, 23 Aug 2017 03:51:11 +0000 (UTC)","from DB5PR04MB1350.eurprd04.prod.outlook.com (10.162.220.156) by\n\tDB5PR04MB1206.eurprd04.prod.outlook.com (10.162.155.24) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.1.1362.18; Wed, 23 Aug 2017 03:51:10 +0000","from DB5PR04MB1350.eurprd04.prod.outlook.com\n\t([fe80::7175:9fbf:f392:a88f]) by\n\tDB5PR04MB1350.eurprd04.prod.outlook.com\n\t([fe80::7175:9fbf:f392:a88f%13]) with mapi id 15.01.1362.019;\n\tWed, 23 Aug 2017 03:51:09 +0000"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.6 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H2, RCVD_IN_SORBS_WEB, SPF_HELO_PASS,\n\tT_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=B9LfDPxdJq3dtxLe1gSBwJkelR4gUvuPRI9uwICP6EM=;\n\tb=n+lnsfkOKVaFfbHhkQk8IvjgobMvnU8rQtu13czWaQEhQA2QniNLokVjpirSVHVTjVOIZm23ZIAq4GN2Okf6O5zGK9AjPPX4kz2k661CeCNhs7SOnuIHRFYazVw8sanhLZmfCOgBfqxKYjksXvV3dvitqlm/N9fYFdyeLldKbC0=","From":"Suresh Gupta <suresh.gupta@nxp.com>","To":"York Sun <york.sun@nxp.com>,\n\t\"u-boot@lists.denx.de\" <u-boot@lists.denx.de>","Thread-Topic":"[PATCH] spi: fsl_qspi: Add controller busy check before new spi\n\toperation","Thread-Index":"AQHTGmfSy+b8JHZqmkue7oAhJMoHYqKRTjYg","Date":"Wed, 23 Aug 2017 03:51:09 +0000","Message-ID":"<DB5PR04MB1350386DC172F25FD619628780850@DB5PR04MB1350.eurprd04.prod.outlook.com>","References":"<1503311174-3574-1-git-send-email-suresh.gupta@nxp.com>\n\t<VI1PR04MB2078E540C16DFBB31DBB8BFB9A840@VI1PR04MB2078.eurprd04.prod.outlook.com>","In-Reply-To":"<VI1PR04MB2078E540C16DFBB31DBB8BFB9A840@VI1PR04MB2078.eurprd04.prod.outlook.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","authentication-results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"n+lnsfkO\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=suresh.gupta@nxp.com; "],"x-originating-ip":"[117.212.71.136]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; DB5PR04MB1206;\n\t6:TnjcxOkuaCbm5BhMuRBUVrhDepHHcldt0KkkJUYQS9IkSn/m8jo7+f+5Yy/NrUSCSkYLxt3UDSlYCMD6YTgGgqYeaWwUQHPMksbdTYQI1M3v3LxT2liP6/T2BGNgX2Up9jjcX1xTfnwIv9L1XSLpZoQj4Gmhcd43l44nrHfgUdf2yK9mL9g2QKh+8ZwVCKekvmwbACh2NR6FTJcGXgLuHRkQW7kR7tLMhH3IuTLf+UGwCkX6E4aouoPF9aq/JfUKLxDtNFdR8UChPfhvJBDPgfKBYxYsPRgCN8n6XUVLa4bO4CRxKHeCYj+wbL8/sFuUO8KX5yrfN5Iu6fhLQl0Ubg==;\n\t5:twIGJiElLy3CvQK5lLvORqGmM9OJj+DPnsJpi+TB+zHqSD1IbSspToQVYBqvTiaobJyEmGUgV3dFJIZ7KS6yLUvAPPZHF+o8kns9HR9aRMExqnEJk9Qx8SBqyNGq5YZB/g8wsgPCKHJtpdgH0V7+hQ==;\n\t24:UuMICyaLjrGZY5Un9ZObkBAL6fyRVFA8HIeoTsAYGSDQpSZPV7asXdhH9qK1t4l0uZCs/AmbFiSdxs4gX+voAuU5IBk10iClNDzHgzXbzzs=;\n\t7:uuT/jLv8fwtF9l0l0i8B/LysbqHZPD0p95BMEZN1tQ68J7LKHj2raWanGaLV/2ESdQ41G6sOIG7cktyqxzbrp+7774+XKk/FeLdkTzuLJZvlkkZWfQ9DaOc6QOxOyCM4DV1NW2jr3SzGoyja1UQ3MLCx6yZtgpcfqRXrmBJvQ/zrWn9T65hTdLF8OcuZX8ozVaVGXs8M4fZdIlHzeT4bzjli347LCo8LB0LaBVSTDBw=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;SSOR;","x-forefront-antispam-report":"SFV:SKI; SCL:-1; SFV:NSPM;\n\tSFS:(10009020)(6009001)(39860400002)(54094003)(377454003)(24454002)(189002)(199003)(13464003)(66066001)(76176999)(14454004)(33656002)(54356999)(50986999)(5660300001)(8936002)(68736007)(229853002)(2950100002)(106356001)(105586002)(53936002)(6246003)(6436002)(101416001)(9686003)(99286003)(74316002)(7696004)(102836003)(3280700002)(3660700001)(6506006)(6116002)(2906002)(551934003)(54906002)(55016002)(81166006)(7736002)(305945005)(478600001)(2900100001)(81156014)(25786009)(53546010)(4326008)(2501003)(5250100002)(8676002)(189998001)(86362001)(3846002)(97736004);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR04MB1206;\n\tH:DB5PR04MB1350.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; MX:1; A:1; LANG:en; ","x-ms-office365-filtering-correlation-id":"ddb8559a-b848-496a-4229-08d4e9da30d0","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603178)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:DB5PR04MB1206; ","x-ms-traffictypediagnostic":"DB5PR04MB1206:","x-exchange-antispam-report-test":"UriScan:(185117386973197)(16074681357397);","x-microsoft-antispam-prvs":"<DB5PR04MB1206587DA018881AD3FC553E80850@DB5PR04MB1206.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123560025)(20161123562025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:DB5PR04MB1206; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:DB5PR04MB1206; ","x-forefront-prvs":"040866B734","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-originalarrivaltime":"23 Aug 2017 03:51:09.5773\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"DB5PR04MB1206","Cc":"\"jagan@openedev.com\" <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1754688,"web_url":"http://patchwork.ozlabs.org/comment/1754688/","msgid":"<CAD6G_RS5yEVY-qAXyOFd4OmfDB-pdMwm0yNL=o6tFrab343SNA@mail.gmail.com>","list_archive_url":null,"date":"2017-08-23T05:27:25","subject":"Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","submitter":{"id":20045,"url":"http://patchwork.ozlabs.org/api/people/20045/","name":"Jagan Teki","email":"jagannadh.teki@gmail.com"},"content":"On Tue, Aug 22, 2017 at 4:19 PM, Suresh Gupta <suresh.gupta@nxp.com> wrote:\n> Thanks  Jagan for reviewing the code.\n> Please find comments in line\n>\n>> -----Original Message-----\n>> From: Jagan Teki [mailto:jagannadh.teki@gmail.com]\n>> Sent: Monday, August 21, 2017 7:53 PM\n>> To: Suresh Gupta <suresh.gupta@nxp.com>\n>> Cc: u-boot@lists.denx.de; Jagan Teki <jagan@openedev.com>\n>> Subject: Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check before\n>> new spi operation\n>>\n>> On Mon, Aug 21, 2017 at 3:56 PM, Suresh Gupta <suresh.gupta@nxp.com>\n>> wrote:\n>> > It is recommended to check either controller is free to take new spi\n>> > action. The IP_ACC and AHB_ACC bits indicates that the controller is\n>> > busy in IP or AHB mode respectively.\n>> > And the BUSY bit indicates that the controller is currently busy\n>> > handling a transaction to an external flash device\n>> >\n>> > Signed-off-by: Suresh Gupta <suresh.gupta@nxp.com>\n>> > ---\n>> >  drivers/spi/fsl_qspi.c | 26 ++++++++++++++++++++++++++\n>> > drivers/spi/fsl_qspi.h |  4 ++++\n>> >  2 files changed, 30 insertions(+)\n>> >\n>> > diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index\n>> > 1dfa89a..69e9712 100644\n>> > --- a/drivers/spi/fsl_qspi.c\n>> > +++ b/drivers/spi/fsl_qspi.c\n>> > @@ -165,6 +165,27 @@ static inline u32 qspi_endian_xchg(u32 data)\n>> > #endif  }\n>> >\n>> > +static inline u32 qspi_controller_busy(struct fsl_qspi_priv *priv) {\n>> > +       u32 sr;\n>> > +       u32 retry = 5;\n>> > +\n>> > +       do {\n>> > +               sr = qspi_read32(priv->flags, &priv->regs->sr);\n>> > +               if ((sr & QSPI_SR_BUSY_MASK) ||\n>>\n>> Does this bit need? we can check the busy-state with AHB_ACC and IP_ACC\n>\n> The definition of the three bits is\n> Bit2 - AHB_ACC: AHB Access: Asserted when the transaction currently executed was initiated by AHB bus.\n> Bit1 - IP_ACC: IP Access: Asserted when transaction currently executed was initiated by IP bus.\n> Bit0 - BUSY: Module Busy: Asserted when module is currently busy handling a transaction to an external flash device.\n>\n> Also, the below are statements mentioned in the IP Block Guide\n> For AHB Access: Since the read access is triggered via the AHB bus, the QSPI_SR[AHB_ACC]\n>                 status bit is set driving in turn the QSPI_SR[BUSY] bit until the transaction is finished.\n> For IP Access: Since the read access is triggered by an IP command the IP_ACC status bit and\n>                 the BUSY bit are both set (both are located in the Status Register (QSPI_SR) ).\n>\n> So, BUSY flag is set when the controller is busy in communication with FLASH and this is true for both IP and AHB mode.\n> That’s the reason checking all three status bits ensures us that controller is free.\n>\n>>\n>> > +                   (sr & QSPI_SR_AHB_ACC_MASK) ||\n>> > +                   (sr & QSPI_SR_IP_ACC_MASK)) {\n>> > +                       debug(\"The controller is busy, sr = 0x%x\\n\", sr);\n>> > +                       udelay(1);\n>> > +               } else {\n>> > +                       break;\n>> > +               }\n>> > +       } while (--retry);\n>>\n>> These retry and infine loop doesn't seems OK, how about using wait_for_bit?\n> Ok, I will use below and send a new patch\n>\n> ret = wait_for_bit(__func__, regs->sr,\n>                           QSPI_SR_BUSY_MASK |\n>                           QSPI_SR_AHB_ACC_MASK |\n>                           QSPI_SR_IP_ACC_MASK,\n>                           false, 1000, false);\n>>\n>> > +\n>> > +       return (sr & QSPI_SR_BUSY_MASK) ||\n>> > +               (sr & QSPI_SR_AHB_ACC_MASK) || (sr &\n>> > + QSPI_SR_IP_ACC_MASK);\n>>\n>> I didn't understand why these bits need to return?\n> After wait_for_bit, this is not required\n>\n>> and when will the LUT trigger?\n> The check is added as it is recommended that before any new transaction, these bits should be 0 i.e. controller is not busy.\n> This check is required before all new types of transaction with FLASH.\n> So I added this in qspi_xfer() which intern calls actual hardware operations like qspi_op_write, qspi_op_erase, qspi_ahb_read, qspi_op_rdsr etc., which triggers the LUT.\n\nWhat about moving this in claim_bus?, because xfer will call each\ntransfer with each transaction.and of course while probe or each\noperation claim_bus is initiating.\n\nthanks!","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"PFsfF6EF\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xcbXs6PKDz9s7h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 23 Aug 2017 15:27:40 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 070C6C21E57; Wed, 23 Aug 2017 05:27:31 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 0A727C21DD7;\n\tWed, 23 Aug 2017 05:27:29 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 123AAC21C39; Wed, 23 Aug 2017 05:27:26 +0000 (UTC)","from mail-lf0-f47.google.com (mail-lf0-f47.google.com\n\t[209.85.215.47])\n\tby lists.denx.de (Postfix) with ESMTPS id 51F39C21C39\n\tfor <u-boot@lists.denx.de>; Wed, 23 Aug 2017 05:27:26 +0000 (UTC)","by mail-lf0-f47.google.com with SMTP id l137so2750797lfg.3\n\tfor <u-boot@lists.denx.de>; Tue, 22 Aug 2017 22:27:26 -0700 (PDT)","by 10.25.143.131 with HTTP; Tue, 22 Aug 2017 22:27:25 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc:content-transfer-encoding;\n\tbh=iTnDJAHHt+VUon+f5Ha2z/gf+htrlZi+EBC8Dy8Eri0=;\n\tb=PFsfF6EFrLSxxKDcB3T+Ji8+6+XRZ7b+DxbkplK8Frsawn0Fawj+yR55UALklrH2Ov\n\tHoxJJkdW0l1elPr4o6peyCy7TRt7/wdx2H9PtqP98owavHu1TApw2v+RzZNXTR7JlpGQ\n\tUvTWxB9Rcb4yJ9RSnPCzy2QTfPtodhY55QrYJ5625fRtzIvaC9D+Gad9q4aqS50wLYqL\n\teP/H+LI3c6XTPsJ4Zp+HPZMKUXJPZ8WiuKKyZd4XxoLRuoFqyeH3FjtwcxD9F7nTyr2+\n\tCMukkYvT0pUecmDJLPlyGQK6htL0Cn2mO0yXGwRqf3D8nK5BPWD1zFuvtGgKsU+qJ7mA\n\tqsKg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc:content-transfer-encoding;\n\tbh=iTnDJAHHt+VUon+f5Ha2z/gf+htrlZi+EBC8Dy8Eri0=;\n\tb=GzKApr48catrETKJeN3BT7xjIZU64OCRPu/aE8jhdeC0fvj4YBUOuybaC5FL/YTsYj\n\tlsgvoo8DgoIu5AAG0Jekh2+7ZvC0N0kH0pv0OZ3OQIQqtyS8M4mCxZ1h9faqtNkP75Ib\n\t8SMUR9ZurbjdsK+53Sg8/noA/AUmUYZ2q0A0oKT/NvTCI6NTJeVKLFNc/7YmHUCgu26X\n\tbi9Gol6W+EGaMjBrFUM/zQX9doo4yw3o9XB94rVGzt6JzHqK5Etucdfpm4wpArrajIXF\n\tYrtjVaPP9PXT8yqbTFwa8cn4GhbPiqaIgVHfjSdZeaHzP+3ZJGLHxYzasFVlIvy12Ph6\n\t1FVQ==","X-Gm-Message-State":"AHYfb5j6Kiz006JFmLFU5sPcIsmST5TsxNG3QtW7/uHiZMfU3IscgTiO\n\t8gjPTt5KqXrhkNE+zvjOEWKc+Ilsvw==","X-Received":"by 10.46.21.20 with SMTP id s20mr447182ljd.147.1503466045632;\n\tTue, 22 Aug 2017 22:27:25 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<DB5PR04MB135035C87CDCAF998C8B98B780840@DB5PR04MB1350.eurprd04.prod.outlook.com>","References":"<1503311174-3574-1-git-send-email-suresh.gupta@nxp.com>\n\t<CAD6G_RSvvXn4RMp1NmqzptdPHdiKwA_N0o0BxZpG4_o8wiiNog@mail.gmail.com>\n\t<DB5PR04MB135035C87CDCAF998C8B98B780840@DB5PR04MB1350.eurprd04.prod.outlook.com>","From":"Jagan Teki <jagannadh.teki@gmail.com>","Date":"Wed, 23 Aug 2017 10:57:25 +0530","Message-ID":"<CAD6G_RS5yEVY-qAXyOFd4OmfDB-pdMwm0yNL=o6tFrab343SNA@mail.gmail.com>","To":"Suresh Gupta <suresh.gupta@nxp.com>","Cc":"\"u-boot@lists.denx.de\" <u-boot@lists.denx.de>,\n\tJagan Teki <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1754738,"web_url":"http://patchwork.ozlabs.org/comment/1754738/","msgid":"<DB5PR04MB1350948B9CC352135AEECB1680850@DB5PR04MB1350.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-08-23T06:21:16","subject":"Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","submitter":{"id":70239,"url":"http://patchwork.ozlabs.org/api/people/70239/","name":"Suresh Gupta","email":"suresh.gupta@nxp.com"},"content":"> -----Original Message-----\r\n> From: Jagan Teki [mailto:jagannadh.teki@gmail.com]\r\n> Sent: Wednesday, August 23, 2017 10:57 AM\r\n> To: Suresh Gupta <suresh.gupta@nxp.com>\r\n> Cc: u-boot@lists.denx.de; Jagan Teki <jagan@openedev.com>\r\n> Subject: Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check before\r\n> new spi operation\r\n> \r\n> On Tue, Aug 22, 2017 at 4:19 PM, Suresh Gupta <suresh.gupta@nxp.com>\r\n> wrote:\r\n> > Thanks  Jagan for reviewing the code.\r\n> > Please find comments in line\r\n> >\r\n> >> -----Original Message-----\r\n> >> From: Jagan Teki [mailto:jagannadh.teki@gmail.com]\r\n> >> Sent: Monday, August 21, 2017 7:53 PM\r\n> >> To: Suresh Gupta <suresh.gupta@nxp.com>\r\n> >> Cc: u-boot@lists.denx.de; Jagan Teki <jagan@openedev.com>\r\n> >> Subject: Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy\r\n> >> check before new spi operation\r\n> >>\r\n> >> On Mon, Aug 21, 2017 at 3:56 PM, Suresh Gupta <suresh.gupta@nxp.com>\r\n> >> wrote:\r\n> >> > It is recommended to check either controller is free to take new\r\n> >> > spi action. The IP_ACC and AHB_ACC bits indicates that the\r\n> >> > controller is busy in IP or AHB mode respectively.\r\n> >> > And the BUSY bit indicates that the controller is currently busy\r\n> >> > handling a transaction to an external flash device\r\n> >> >\r\n> >> > Signed-off-by: Suresh Gupta <suresh.gupta@nxp.com>\r\n> >> > ---\r\n> >> >  drivers/spi/fsl_qspi.c | 26 ++++++++++++++++++++++++++\r\n> >> > drivers/spi/fsl_qspi.h |  4 ++++\r\n> >> >  2 files changed, 30 insertions(+)\r\n> >> >\r\n> >> > diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index\r\n> >> > 1dfa89a..69e9712 100644\r\n> >> > --- a/drivers/spi/fsl_qspi.c\r\n> >> > +++ b/drivers/spi/fsl_qspi.c\r\n> >> > @@ -165,6 +165,27 @@ static inline u32 qspi_endian_xchg(u32 data)\r\n> >> > #endif  }\r\n> >> >\r\n> >> > +static inline u32 qspi_controller_busy(struct fsl_qspi_priv *priv) {\r\n> >> > +       u32 sr;\r\n> >> > +       u32 retry = 5;\r\n> >> > +\r\n> >> > +       do {\r\n> >> > +               sr = qspi_read32(priv->flags, &priv->regs->sr);\r\n> >> > +               if ((sr & QSPI_SR_BUSY_MASK) ||\r\n> >>\r\n> >> Does this bit need? we can check the busy-state with AHB_ACC and\r\n> >> IP_ACC\r\n> >\r\n> > The definition of the three bits is\r\n> > Bit2 - AHB_ACC: AHB Access: Asserted when the transaction currently\r\n> executed was initiated by AHB bus.\r\n> > Bit1 - IP_ACC: IP Access: Asserted when transaction currently executed was\r\n> initiated by IP bus.\r\n> > Bit0 - BUSY: Module Busy: Asserted when module is currently busy handling a\r\n> transaction to an external flash device.\r\n> >\r\n> > Also, the below are statements mentioned in the IP Block Guide For AHB\r\n> > Access: Since the read access is triggered via the AHB bus, the\r\n> QSPI_SR[AHB_ACC]\r\n> >                 status bit is set driving in turn the QSPI_SR[BUSY] bit until the\r\n> transaction is finished.\r\n> > For IP Access: Since the read access is triggered by an IP command the IP_ACC\r\n> status bit and\r\n> >                 the BUSY bit are both set (both are located in the Status Register\r\n> (QSPI_SR) ).\r\n> >\r\n> > So, BUSY flag is set when the controller is busy in communication with FLASH\r\n> and this is true for both IP and AHB mode.\r\n> > That’s the reason checking all three status bits ensures us that controller is\r\n> free.\r\n> >\r\n> >>\r\n> >> > +                   (sr & QSPI_SR_AHB_ACC_MASK) ||\r\n> >> > +                   (sr & QSPI_SR_IP_ACC_MASK)) {\r\n> >> > +                       debug(\"The controller is busy, sr = 0x%x\\n\", sr);\r\n> >> > +                       udelay(1);\r\n> >> > +               } else {\r\n> >> > +                       break;\r\n> >> > +               }\r\n> >> > +       } while (--retry);\r\n> >>\r\n> >> These retry and infine loop doesn't seems OK, how about using wait_for_bit?\r\n> > Ok, I will use below and send a new patch\r\n> >\r\n> > ret = wait_for_bit(__func__, regs->sr,\r\n> >                           QSPI_SR_BUSY_MASK |\r\n> >                           QSPI_SR_AHB_ACC_MASK |\r\n> >                           QSPI_SR_IP_ACC_MASK,\r\n> >                           false, 1000, false);\r\n> >>\r\n> >> > +\r\n> >> > +       return (sr & QSPI_SR_BUSY_MASK) ||\r\n> >> > +               (sr & QSPI_SR_AHB_ACC_MASK) || (sr &\r\n> >> > + QSPI_SR_IP_ACC_MASK);\r\n> >>\r\n> >> I didn't understand why these bits need to return?\r\n> > After wait_for_bit, this is not required\r\n> >\r\n> >> and when will the LUT trigger?\r\n> > The check is added as it is recommended that before any new transaction,\r\n> these bits should be 0 i.e. controller is not busy.\r\n> > This check is required before all new types of transaction with FLASH.\r\n> > So I added this in qspi_xfer() which intern calls actual hardware operations like\r\n> qspi_op_write, qspi_op_erase, qspi_ahb_read, qspi_op_rdsr etc., which triggers\r\n> the LUT.\r\n> \r\n> What about moving this in claim_bus?, because xfer will call each transfer with\r\n> each transaction.and of course while probe or each operation claim_bus is\r\n> initiating.\r\n> \r\nI will check and let you know tomorrow. \r\n\r\n\r\n> thanks!\r\n> --\r\n> Jagan Teki\r\n> Free Software Engineer | www.openedev.com U-Boot, Linux | Upstream\r\n> Maintainer Hyderabad, India.","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"E6yNioTX\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=suresh.gupta@nxp.com; "],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xcckw06Djz9sNd\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 23 Aug 2017 16:21:28 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid C7547C21E60; Wed, 23 Aug 2017 06:21:25 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id A0FDBC21DFE;\n\tWed, 23 Aug 2017 06:21:22 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 421E9C21DFE; Wed, 23 Aug 2017 06:21:21 +0000 (UTC)","from EUR02-HE1-obe.outbound.protection.outlook.com\n\t(mail-eopbgr10065.outbound.protection.outlook.com [40.107.1.65])\n\tby lists.denx.de (Postfix) with ESMTPS id D9A25C21DA5\n\tfor <u-boot@lists.denx.de>; Wed, 23 Aug 2017 06:21:18 +0000 (UTC)","from DB5PR04MB1350.eurprd04.prod.outlook.com (10.162.220.156) by\n\tDB5PR04MB2135.eurprd04.prod.outlook.com (10.166.172.140) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.1.1362.18; Wed, 23 Aug 2017 06:21:17 +0000","from DB5PR04MB1350.eurprd04.prod.outlook.com\n\t([fe80::7175:9fbf:f392:a88f]) by\n\tDB5PR04MB1350.eurprd04.prod.outlook.com\n\t([fe80::7175:9fbf:f392:a88f%13]) with mapi id 15.01.1362.019;\n\tWed, 23 Aug 2017 06:21:16 +0000"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=YpQ3PsMJi227UQMvfJ6VD7luenRZ4/upWrAUS1Idj/k=;\n\tb=E6yNioTXK2CNZ63QsQT8WuiOma8VHcsbznbJYUgIPRgNyUd/8YuMbSl3g5Uj3Rw8rmM/47elWhWkRlMmMbOjH55xwtAkZanWI/zaljjNuBFQBjohFUJcMTtYp1xJqbs21YwygCrgETvt3fTeBTsjlGZhdb2AG7/dBVCc3AFGhS8=","From":"Suresh Gupta <suresh.gupta@nxp.com>","To":"Jagan Teki <jagannadh.teki@gmail.com>","Thread-Topic":"[U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","Thread-Index":"AQHTGmfSy+b8JHZqmkue7oAhJMoHYqKO3T8AgAEqFBCAAWTegIAADrdA","Date":"Wed, 23 Aug 2017 06:21:16 +0000","Message-ID":"<DB5PR04MB1350948B9CC352135AEECB1680850@DB5PR04MB1350.eurprd04.prod.outlook.com>","References":"<1503311174-3574-1-git-send-email-suresh.gupta@nxp.com>\n\t<CAD6G_RSvvXn4RMp1NmqzptdPHdiKwA_N0o0BxZpG4_o8wiiNog@mail.gmail.com>\n\t<DB5PR04MB135035C87CDCAF998C8B98B780840@DB5PR04MB1350.eurprd04.prod.outlook.com>\n\t<CAD6G_RS5yEVY-qAXyOFd4OmfDB-pdMwm0yNL=o6tFrab343SNA@mail.gmail.com>","In-Reply-To":"<CAD6G_RS5yEVY-qAXyOFd4OmfDB-pdMwm0yNL=o6tFrab343SNA@mail.gmail.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","authentication-results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"E6yNioTX\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=suresh.gupta@nxp.com; "],"x-originating-ip":"[117.212.68.146]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; DB5PR04MB2135;\n\t6:ALS8A3J5urOICCsNfbLboYh8go3n+o6IA5+GpGLxoGTLVtA2zoHJakATcn0ccFoT5jTUso4++CpNf+j3a0YyNiQ7K1IybxlDMREAVjgCcU40kUYqb2yCR0olDYAnzMDZV3PpBKJdgM0Cw/sLTwfGkAeLuRCfCzjyuESkMPqRnCZlm5MpspnaU5FFfclWqGjz4k3XF+IWp2qsY+4qzytFlwXhjRnH2Ep3ekdKJuHNlDpp3Y2fez4+goUslE7eWMxbVfWl8IT9zDJ0qzvQLwGi6OFr6FHF731/6wwZeqUTb79ThQ/JjR0LKvDjNsk4GsHQOyCrtxo/4n7nWudCKOQrSQ==;\n\t5:e4OBywANlXzHh5ydzyakEEVidZNq9AAJVwPhyxq+dq6kWJjmIvrBzYLpRd+v9TxfGXgMy5oK5Lwko5tfO0NAb/CICdPLHC+HeDOyV3YURJl3U4v3a+F9aVNk2cKhfdG5HMnpNcuA8yHrXMnEm6V7aA==;\n\t24:8j8rrPqqEELXQiMJY8GpUn15Fz65YQ3a4YMwkGb37qSu3QEiTsvXn+fabI8V3BD8TMQ6ibQmmeefLmD0o8uqUpuzwv8vv8XAzajb70J9iao=;\n\t7:W68peodGG68xKltSu5vSv9SySN8xxrUHUCR6B13Nf0sD9Bz65ZrsLH9/Kmw/io+KjLW98hPVPGzbjeLrioKvKkyce4bDd/ruWwLer7T0k1HMExIZOAjtooXn583aGo6qeicsAhuOO+pU3L28/HbEUxtMEJH+qTNCg4UY71L1dNeRfdSiqjiFHAOo9JeLIwx/mqbvAeBUaNpwNc6q99a9/n6qfoZAeamHsBCV2QzU9wA=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;","x-ms-office365-filtering-correlation-id":"297c66e5-9fd8-46cc-956d-08d4e9ef2977","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603180)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:DB5PR04MB2135; ","x-ms-traffictypediagnostic":"DB5PR04MB2135:","x-exchange-antispam-report-test":"UriScan:(185117386973197)(16074681357397);","x-microsoft-antispam-prvs":"<DB5PR04MB2135A01F783210281F3F5AD780850@DB5PR04MB2135.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:DB5PR04MB2135; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:DB5PR04MB2135; ","x-forefront-prvs":"040866B734","x-forefront-antispam-report":"SFV:NSPM;\n\tSFS:(10009020)(6009001)(39860400002)(189002)(377454003)(199003)(13464003)(24454002)(2900100001)(66066001)(2906002)(50986999)(76176999)(6916009)(97736004)(7696004)(229853002)(54356999)(14454004)(6506006)(25786009)(93886005)(5250100002)(189998001)(68736007)(86362001)(53546010)(81166006)(8676002)(7736002)(2950100002)(15974865002)(4326008)(478600001)(81156014)(3660700001)(305945005)(6246003)(8936002)(3280700002)(9686003)(110136004)(39060400002)(33656002)(101416001)(99286003)(6436002)(106356001)(105586002)(551934003)(102836003)(74316002)(5660300001)(53936002)(3846002)(54906002)(6116002)(55016002)(2004002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR04MB2135;\n\tH:DB5PR04MB1350.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; MX:1; A:1; LANG:en; ","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-originalarrivaltime":"23 Aug 2017 06:21:16.6834\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"DB5PR04MB2135","Cc":"\"u-boot@lists.denx.de\" <u-boot@lists.denx.de>,\n\tJagan Teki <jagan@openedev.com>","Subject":"Re: [U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check\n\tbefore new spi operation","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]