Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933434AbdDEN0h (ORCPT ); Wed, 5 Apr 2017 09:26:37 -0400 Received: from mail-sn1nam01on0086.outbound.protection.outlook.com ([104.47.32.86]:36620 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932625AbdDENYU (ORCPT ); Wed, 5 Apr 2017 09:24:20 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=fail action=none header.from=nxp.com; From: Ioana Radulescu To: , CC: , , , , Subject: [PATCH] staging: fsl-mc/dpio: Fix early writing of valid bit Date: Wed, 5 Apr 2017 08:24:17 -0500 Message-ID: <20170405132417.15925-1-ruxandra.radulescu@nxp.com> X-Mailer: git-send-email 2.11.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131358722583272137;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(336005)(39860400002)(39840400002)(39400400002)(39850400002)(39380400002)(39410400002)(39450400003)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(9170700003)(2906002)(48376002)(50466002)(38730400002)(36756003)(50986999)(85426001)(54906002)(8656002)(77096006)(39060400002)(5003940100001)(104016004)(53936002)(8676002)(106466001)(81166006)(105606002)(6636002)(33646002)(189998001)(5660300001)(1076002)(86362001)(4326008)(356003)(305945005)(47776003)(8936002)(50226002);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR03MB391;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:ovrnspm;MX:1;A:1;PTR:InfoDomainNonexistent;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD018;1:OiKYM+PoxTkfNDLjQk/Td49DRylcaTHWMtVv6kNj8zdS1UD1D5/rAdd6MSaSwsBuUTMhHiieLwR8emcUT5/8HL4DR7dcyyxIFvqQya8aJtjNL051rF8nUrr+O4YIKKuN4HiCbsbkMlJuVsCh1o3IUWP2vPGI3uyMN5s/IE8AVM3Ad9anzjkUWl1SmdqDY0RRgdH0Y5UqyA50yLdDDmJvK5SZRt4LF/uv0Z6wZN9LtaCs6ocNzd5ytrGY8aOIMRrxeI4Xn9C/bOKQlncQdZPTTla7bpJbfPScFqqrpxn8fowrF94IFJvza+8ygNkfoU6t5kz/aojh3+TTJluhVOHq3zqMffX/K1ljQqh8z+nAgHK2RiEqcEiZKSVOc3loMtCzn09sExJmMa0/Dvs5AUYYHyKC7gPmkBTXDRtDAS3NcaEc+sDW1fprzfoRO5ooc/B+ilKNwzmyb2a9JT/l6cxXxj+WKPEDeCb9KVJZmC7SPDUck/AUNsNy9/dx7H+JQylUMAgyE5j8zcGMp0mZuBcS48oY0MWL4u1eCDKMp3undcbKnlr3xSQREO5EEdVg9UD2+H5d3zox9ZPoQtc+ESDQ1C9SyzvuBsM463ycGbFcG4Cp2XE+k9NlMmlTMFXPJ9yy MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 1cf8abaf-adda-4806-3969-08d47c27102e X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131430075)(201703131517081);SRVR:BLUPR03MB391; X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB391;3:DPujoSzq1r5ukBFhN1AYWTPOCTm7JPAhRGyP+S6eX4Rcbs9c3kFPTi+ppCnUvsS/ezEEs9TMk20xki6ACephlM5uypmmDQVWUhD1PQpGBhYUvQ9ut0npBVA8Frb/BA5zIqffXf1esGetVjV9U4Wk/xzXdolHlqQsi7c8o4NZhXlxGmnXU5csnoCT15978bVfDYlkNz0nG3lYp+keoZOP6VGsfpwr8NJBgwEzZ/TXCoztssIO7mnp15yln6dyniP/4bC7TeD4CpbdGvGKwevmg+xoqk22OwGF1qlK7fpCqTlzP1GYm/PCMCbdpBQs/R9p/CujMm80fpt8/e0bNlBj5qFc8c0frCS5M6IUoMLJ7w67DheQSK9Y3p02ex5osGEjBL1BgLOZmtnbJssNtw+bAHUO4zq6lp1w2+cM4rSFIqa5EZGXpaUl0V7OpE1potxe;25:G1ODeu5NXl1BDC06DsvdmUAfMoDZzHM2XLLBaNar85uG4F1XoTBM4SY13Y4vJQfT4CsBpBRMGKxdSgT4B7l3oCU6CKtS/iXYYuyaoKoqst0AGZJn3YWMeMQgRdNwDNW/wVA5grTzG3yHcPK5f7xmezBjr05bCDghzfJzsbjmwEfPYhbtYhgCrJKA7RtZBE7sbi2ZXBjir/ngFCzmdlIVvoWTfV+t9J31gfwIk6LEeiddMjup/D690U1Qt44T0EKv9F3+GaWQxvlF8g+cXBoR84no8RPK0TQSPQwdO9UECUzbBubsjI6C+PqUJWnPv9Mgh/O7ruT1uZzRyTdMnN0hepQB8QnoTtN9/G+GuQH78oF9DtG0A9Aw1q8FKHdE5/5wIuq7Lz/ySdTsGS2MUgxa4fBg0XFVHZiWGogZv3X4O6hOA5RvpE7NJr/JPyhj5td//JrW+blCHIzUiV1ZPSXONQ== X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB391;31:WJgkQwbnZkUB7Ewbfv+BjNHFJzxsHkarpsq9qHSXzFPy8G/aem0mpy3Ksb53jrg64HOt8/pLXXUfJJEQ9nOc3xjFJrWE4tcsrN0ov5EQD3v/0x+rI52aB3ujPHB+h7vuxYKS1KyURn2aRW5wtiGasgPDoZz2HyCTEqmvoZbv/qgAzkHFO+NY9EcYTnBOTz9n5HYwBqAHqASujHazKrF0rOfcsdHyFl4cvpyKhk04FUbZJcJbLKLia322Ztr/ru+1VgHkKdr1AWSwFG5bJ/deXwdWQwcPvPeKsn6qSp9xoyE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(227817650892897); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6095135)(601004)(2401047)(13024025)(13023025)(13018025)(8121501046)(5005006)(13015025)(13017025)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123561025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259075)(20161123565025)(20161123556025)(20161123563025);SRVR:BLUPR03MB391;BCL:0;PCL:0;RULEID:(400006);SRVR:BLUPR03MB391; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR03MB391;4:YspYRHpJhpA8XLtenlmCMtiL8XKZKV0geTQ3pPLh4rl?= =?us-ascii?Q?ZVh7lzoBeGSynj6pVDQLHmviU1+UbZS8PE3jfO5DRg30gPgj465FsYTXWTo2?= =?us-ascii?Q?O3kmfHUJ0MWcTYbmndmK9QulSBRjMKVnf2iytcsKcESQ8+DJ7mXRYV1ICsLP?= =?us-ascii?Q?SfAQaKeZMwI3DzPNpmZ9QVE7+TnvUgu2NdLfKJFdljq8aCAonn4REVnh6LbD?= =?us-ascii?Q?hSQJMyYtJaQ/oqqZL0z4Av1fRnk9YFBnEq5qswXis++XyvldrLIc0z+bfi1V?= =?us-ascii?Q?V5GgBkGEmIcxTlTJwsKZS/36I/IqHg3YjM89iBdygLuPLvBrT/76wMA151u1?= =?us-ascii?Q?8bJjPJFYjxYFE+wV74/FQ8+CvRH4YXiaXR1xHyXpRCDVco39ZzqYZaadGnUr?= =?us-ascii?Q?u+7NmVcCL9WnTcvQN/c0U3NIwGgbbHlRJTs/3DQgTV4+o3UXwAI3Ipbg158Y?= =?us-ascii?Q?UDuQSHR9t5q7OFms6X3p5+gnVIsf5/Uz3biopmX7sRV8TuVeh93D7sOzeBcv?= =?us-ascii?Q?Pswd7I2EZCKmBdyd7yrt0+igiX7xs8Nyv4+HGdpM2iFLX0pkrtkq6NEjTZi4?= =?us-ascii?Q?E9CUlR2+nNVjQEAPwUPfpMFk/LVo2Ix1p8njTYvRpTBgnrBJQQmNWBHrJw/E?= =?us-ascii?Q?c5qu9LwLAMJDnQTlZYt6/ozz1d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DPsLc11yK+1kz8ZcmdrAHHED+blWzypiN41XZD1qYppXmnQMR6XmRSITW6lVB/j9u7TZCFF6SDgdiPTsJQsB92i0p6xyLklTtWVLiedh7Okk4GJj8VtPeHEgYfIsNr19aydSbyziH9Ppy01Eilq17y6oWVuddgM3gHbGPec8hs336bvytNv38a8nmP9oDHtulVWnfEwW/Pc3l4kWCBOB5eg==;5:RRHfIzoMYbELS2a/UuJKDmHBAEdV5iMIzPEJ0D0WJuROAkzoOJjc8BgQKwBWa3K2L8hAjB774Nqfz4XXfOUiwxn6+0FiLpJ3yVZPgPg1rbMqbXsIsyCRMavHrFmt7q3CDaUI8qW+NWY2QrxnXcMVeOsPUXcv7rZU1URTYz4HprZr1+tbWuCPWNefUN2o3Gyf;24:Ke8n6vAkenZxV+C1TG7jplq35oSFhkT11ieJqP5WRPQj+t4A9wMXPs/I1vlFTIdajoVmA48f36o4ybilBIWKMPAdSQVAKaTnNa8ei/y6nJQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB391;7:kCzDTZ5xSgVcrIgpGCLgsFzUOIz2H6qgKwDtWG0402SkLWV2J7odyjso+y3zThrCNxlseZi0TEzp4ymPZRyTt+LTcoIpfvnWddfVh+hzcXtsSztQjfKdlhHGBhrotUKRuKFoFwpi/s2bf/b71OEzlk8vXKZCjFr+iCIf+BakqFThtU/IiqLM9HMBeixMsei3uu2dbza1JDEhywvK3CI3XpAzZNi9t1kP0NaWKPqLgPVgvGuFZmXyPcNlyISI+kjR6nDihc+h9bZw0CfoSv+MNcVxB0hJY4RK9DfTRVHz2oROeT9ds8lAssmLWD4Y4YJN5pIwp3fneAgAKOzVPoTPTg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2017 13:24:18.1244 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB391 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1825 Lines: 51 Commands written to the QMan software portals have a valid bit in the "verb" field of the command that, when set with the right value, notifies the hardware that the command is fully written and ready to be processed. The "verb" field should be the last one to be written in the swp command registers, after all other fields are filled in. The current implementation doesn't follow this rule for all commands, which may result in an incompletely configured command being processed by the hardware. Enforce the correct order of writes to avoid this situation. Signed-off-by: Ioana Radulescu --- drivers/staging/fsl-mc/bus/dpio/qbman-portal.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c index c75f546b24fa..2a3ea29d9b43 100644 --- a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c +++ b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c @@ -616,13 +616,16 @@ int qbman_swp_pull(struct qbman_swp *s, struct qbman_pull_desc *d) return -EBUSY; } s->vdq.storage = (void *)d->rsp_addr_virt; - d->tok = QMAN_DQ_TOKEN_VALID; p = qbman_get_cmd(s, QBMAN_CENA_SWP_VDQCR); - *p = *d; + p->numf = d->numf; + p->tok = QMAN_DQ_TOKEN_VALID; + p->dq_src = d->dq_src; + p->rsp_addr = d->rsp_addr; + p->rsp_addr_virt = d->rsp_addr_virt; dma_wmb(); /* Set the verb byte, have to substitute in the valid-bit */ - p->verb |= s->vdq.valid_bit; + p->verb = d->verb | s->vdq.valid_bit; s->vdq.valid_bit ^= QB_VALID_BIT; return 0; @@ -1004,7 +1007,6 @@ int qbman_swp_CDAN_set(struct qbman_swp *s, u16 channelid, return -EBUSY; /* Encode the caller-provided attributes */ - p->verb = 0; p->ch = cpu_to_le16(channelid); p->we = we_mask; if (cdan_en) -- 2.11.0