Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/803939/?format=api
{ "id": 803939, "url": "http://patchwork.ozlabs.org/api/1.2/patches/803939/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/1503311174-3574-1-git-send-email-suresh.gupta@nxp.com/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/1.2/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1503311174-3574-1-git-send-email-suresh.gupta@nxp.com>", "list_archive_url": null, "date": "2017-08-21T10:26:14", "name": "[U-Boot] spi: fsl_qspi: Add controller busy check before new spi operation", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "baf5cae203b5e7138d8d249b545581a30142f531", "submitter": { "id": 70239, "url": "http://patchwork.ozlabs.org/api/1.2/people/70239/?format=api", "name": "Suresh Gupta", "email": "suresh.gupta@nxp.com" }, "delegate": { "id": 17739, "url": "http://patchwork.ozlabs.org/api/1.2/users/17739/?format=api", "username": "jagan", "first_name": "Jagannadha Sutradharudu", "last_name": "Teki", "email": "jagannadh.teki@gmail.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/1503311174-3574-1-git-send-email-suresh.gupta@nxp.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/803939/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/803939/checks/", "tags": {}, "related": [], "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>)", "spf=fail (sender IP is 192.88.168.50)\n\tsmtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed)\n\theader.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;" ], "Received": [ "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xbVFt6q6bz9s81\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 21 Aug 2017 20:25:54 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid A518DC21DB9; Mon, 21 Aug 2017 10:25:42 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id C4444C21DB9;\n\tMon, 21 Aug 2017 10:25:39 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid 8E515C21DB9; Mon, 21 Aug 2017 10:25:38 +0000 (UTC)", "from NAM01-BY2-obe.outbound.protection.outlook.com\n\t(mail-by2nam01on0041.outbound.protection.outlook.com [104.47.34.41])\n\tby lists.denx.de (Postfix) with ESMTPS id 7F9F4C21D92\n\tfor <u-boot@lists.denx.de>; Mon, 21 Aug 2017 10:25:37 +0000 (UTC)", "from BLUPR0301CA0029.namprd03.prod.outlook.com (10.162.113.167) by\n\tCY4PR03MB3317.namprd03.prod.outlook.com (10.171.246.150) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id\n\t15.1.1362.18; Mon, 21 Aug 2017 10:25:29 +0000", "from BN1AFFO11FD018.protection.gbl (2a01:111:f400:7c10::181) by\n\tBLUPR0301CA0029.outlook.office365.com (2a01:111:e400:5259::39) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18\n\tvia Frontend Transport; Mon, 21 Aug 2017 10:25:29 +0000", "from tx30smr01.am.freescale.net (192.88.168.50) by\n\tBN1AFFO11FD018.mail.protection.outlook.com (10.58.52.78) with\n\tMicrosoft SMTP Server (version=TLS1_0,\n\tcipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15\n\tvia Frontend Transport; Mon, 21 Aug 2017 10:25:28 +0000", "from suresh_machine.ap.freescale.net\n\t(suresh_machine.ap.freescale.net [10.232.133.11])\n\tby tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id\n\tv7LAPPNV006511; Mon, 21 Aug 2017 03:25:26 -0700" ], "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=BAD_ENC_HEADER,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,\n\tSPF_HELO_PASS autolearn=unavailable\n\tautolearn_force=no version=3.4.0", "Received-SPF": "Fail (protection.outlook.com: domain of nxp.com does not\n\tdesignate 192.88.168.50 as permitted sender)\n\treceiver=protection.outlook.com; \n\tclient-ip=192.88.168.50; helo=tx30smr01.am.freescale.net;", "From": "Suresh Gupta <suresh.gupta@nxp.com>", "To": "<u-boot@lists.denx.de>", "Date": "Mon, 21 Aug 2017 15:56:14 +0530", "Message-ID": "<1503311174-3574-1-git-send-email-suresh.gupta@nxp.com>", "X-Mailer": "git-send-email 1.9.3", "X-EOPAttributedMessage": "0", "X-Matching-Connectors": "131477847289845916;\n\t(91ab9b29-cfa4-454e-5278-08d120cd25b8); ()", "X-Forefront-Antispam-Report": "CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI;\n\tSFV:NSPM;\n\tSFS:(10009020)(6009001)(336005)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(81166006)(81156014)(104016004)(8676002)(551934003)(6916009)(105606002)(498600001)(5660300001)(50986999)(189998001)(8936002)(86362001)(33646002)(6666003)(47776003)(50466002)(50226002)(8656003)(48376002)(2351001)(106466001)(36756003)(53936002)(626005)(110136004)(54906002)(356003)(4326008)(77096006)(2906002)(97736004)(68736007)(5003940100001)(85426001)(305945005);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB3317;\n\tH:tx30smr01.am.freescale.net; \n\tFPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; ", "X-Microsoft-Exchange-Diagnostics": [ "1; BN1AFFO11FD018;\n\t1:lt4Sab6RagK4pMDBlC+wh11NXcia3jeO1C7unLG+tw6mVG/XA1nLer0wBIaRybNkhIZc3dRMI/BLcwOVXDFkKsMDgq4QJuJ0Imnm8XSHBz+jqI7Q5TS1hP+X7vPwiXGa", "1; CY4PR03MB3317;\n\t3:0aANFLjiv71kwRDvEk27JbDRfCtg1QYjHeJAcoJ2rQUl8skggjWp2rSBLP/2XZ3xwyxRieCN8hnUr3qQd0CwfrlEqtEf/DCtozskHkehI5QN1gtT5t00U0dojrT2Oco/AihmCnL7Fpgm1nljUq5kwV9g1cRKLDI3vBMZieNzryaOfEZK6cUPR3IEp1GBBPWjKhoEa7R2nGNafyj7jmkMji3B9FDoByECCgo7NetRZL2691H2w7M06An0yp2eDLZefh8OOIxkuOGLE98r0UnVLtIABDJebp6O/M7nRxQ/wSJtLa431vbHnpvLsax/7OU5+6K2edfAdDqN5+TRCVwFYi36sY3/UecVkHWJawKJ5mc=;\n\t25:Oa8lOu50Y7U797LAw8ozu4L5hkz3F6Amnvy+vOezMqox/R/pZrtm/BCh0s650Sw3yfzXUYsjAklOWoZZYSKDdNlgKgtf2aVPtxCq5gOyC6Az/fkwZvO08D85LweH1vsramvtdhazoLbgmzjGC/0031uMyMk3Ggz1Si27oHpuMbn4iY2RVXwPh8lu/HYBNjDXSGJ4YJ3VWa2eV/mDRa/XRNHb0QscUkkshuT0XdRXI7x68S+ktvhSREaqTvXQLOmzF1CvDMlj4StBOMqlRP/pQ6EcM9HttQx2PC+M6g7OZEqizOFM6MWGBGugXipD/L6lMMXY7Czi6TfbJONUOTZg9A==", "1;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3kGkFBAcMpUVC9cyk0LRMoKGFBEPTaVynKXb1uTqGyjbydA20kqe7DH8JdGnjIjCJQKwwP3QrySExSAf6yiemiIDIz4JflzwgIilVq45rBUq8rieJ90VmnVMJWHqe0TYoVg4emaIHWggK23JfYmUal16ql7j5pTbmOD9Lu2HW1bW70c14jzUNcIYbfOI+js7N5yRee2irP5G9y2ln7R1CxWjvbnzi/AjJ6701oFOai8rKS7D9CzWN+28pmA8IaohcSw7CmXrc/pdKuLBoBsmfUUgms3oPFkkok3ldnBgIjS+hMjWZbhkOANsNcCN+cO5Q183dVLKng==;\n\t5:BYs7+WIi3ouH3pOg0EN5pyEb/INTRWnuCFRDka3wUprzYPgCMzLCZnAKbKV62+4IkIxCLmJpDeyL4iYlM7iTc75LSpAjhruTkv0mXP8yy1/LFlHkpYZf5Q560dnc/qmZPRgFLLtG1NMg4TeFqkHnsA==;\n\t24:ptoeKLiF9tr6ck0Cz3QDZoFHtD9Zh/Lwz1VeyAky0Gq5dCk9XciaX5ELqpQi0bmEfLrhFI3eCVcT+uA+AA+u6S+z0YJ7i98B50T9WZ4YLMg=;\n\t7:CJiz64Nret6S2NTYRrsBm2L/WFfbKUTjV1c6nccS1ryCqgvjOE4as1BD2zrMRnJi4bRdiHFhabosbwhAx/o/PoAsWD4ch+hVq0BSr1WBGoaU2/40BLlbyr17666PKGb157YoOzEyt7hPiphGs+UfMnpXbOo06Q4/SpK4La6GUcb/UZrdc+Y7M6adBXBwPozCqjY+3t/Q3Su2OpMwwxymVmexru0ZKR2M12vP5o8s4YY=" ], "MIME-Version": "1.0", "X-MS-PublicTrafficType": "Email", "X-MS-Office365-Filtering-Correlation-Id": "a673fab8-6248-4fb3-f73b-08d4e87ef1ff", "X-Microsoft-Antispam": "UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603031)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:CY4PR03MB3317; ", "X-MS-TrafficTypeDiagnostic": "CY4PR03MB3317:", "X-Exchange-Antispam-Report-Test": "UriScan:(185117386973197);", "X-Microsoft-Antispam-PRVS": "<CY4PR03MB331708B8B2349E7E1789C74F80870@CY4PR03MB3317.namprd03.prod.outlook.com>", "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(5005006)(13016025)(13018025)(8121501046)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6096035)(20161123559100)(20161123556025)(20161123565025)(20161123561025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:CY4PR03MB3317; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:CY4PR03MB3317; ", "X-Forefront-PRVS": "040655413E", "SpamDiagnosticOutput": "1:99", "SpamDiagnosticMetadata": "NSPM", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "21 Aug 2017 10:25:28.7973\n\t(UTC)", "X-MS-Exchange-CrossTenant-Id": "5afe0b00-7697-4969-b663-5eab37d5f47e", "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;\n\tIp=[192.88.168.50]; \n\tHelo=[tx30smr01.am.freescale.net]", "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "CY4PR03MB3317", "Cc": "jagan@openedev.com, Suresh Gupta <suresh.gupta@nxp.com>", "Subject": "[U-Boot] [PATCH] spi: fsl_qspi: Add controller busy check before\n\tnew 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>" }, "content": "It is recommended to check either controller is free to take\nnew spi action. The IP_ACC and AHB_ACC bits indicates that\nthe controller is busy in IP or AHB mode respectively.\nAnd the BUSY bit indicates that the controller is currently\nbusy handling a transaction to an external flash device\n\nSigned-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(+)", "diff": "diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c\nindex 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+\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+\n \tif (dout) {\n \t\tif (flags & SPI_XFER_BEGIN) {\n \t\t\tpriv->cur_seqid = *(u8 *)dout;\ndiff --git a/drivers/spi/fsl_qspi.h b/drivers/spi/fsl_qspi.h\nindex 6cb3610..e468eb2 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 << QSPI_RBCT_RXBRD_SHIFT)\n \n+#define QSPI_SR_AHB_ACC_SHIFT\t\t2\n+#define QSPI_SR_AHB_ACC_MASK\t\t(1 << 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", "prefixes": [ "U-Boot" ] }