Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1040205AbdDUNuf (ORCPT ); Fri, 21 Apr 2017 09:50:35 -0400 Received: from mail-he1eur01on0068.outbound.protection.outlook.com ([104.47.0.68]:14734 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1040179AbdDUNuc (ORCPT ); Fri, 21 Apr 2017 09:50:32 -0400 From: =?iso-8859-2?Q?Horia_Geant=E3?= To: Stuart Yoder CC: "gregkh@linuxfoundation.org" , Roy Pledge , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" , Haiying Wang , "Ruxandra Ioana Radulescu" Subject: Re: [PATCH] bus: fsl-mc: dpio: fix alter FQ state command Thread-Topic: [PATCH] bus: fsl-mc: dpio: fix alter FQ state command Thread-Index: AQHSuqONnJfZxc2Qd0qDSM1Jzajikg== Date: Fri, 21 Apr 2017 13:50:24 +0000 Message-ID: References: <20170421120018.22232-1-horia.geanta@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [192.88.146.1] x-microsoft-exchange-diagnostics: 1;VI1PR0401MB2560;7:morQhexR8ijmhTLwroAy0zFxBiX6MnbFmPakjxulJkfyls/0Nn3QdihHoe2cxj+o274Kn2zX11jNPxZxKYn8nnpc8nxS7WRKdcr0uqKY6jJH/NbsiR/3Xpe1isgt37xsOCe79X9ljfcKMtRVzO9/Uy6evvT+32tW5XkuMEcdjcz65id6v/4RCu7t3ngY+xYXff+WxL0R3vJBoKijUjJiuY0JVHvoD7PiY2XLhHxtksZT7O7eJVDt4zqPyyGTZjzJ2Deuvb3L1IMzw33EGSVEyKoXDpy/Feo4AtuLUUt/q2DUS4TtzQE5yMKhnSkSYSTt68okCwd3JsXT7tmpRCY13Q== x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10009020)(6009001)(39450400003)(39840400002)(39860400002)(39400400002)(39410400002)(39850400002)(24454002)(377454003)(53936002)(6116002)(77096006)(39060400002)(102836003)(6436002)(66066001)(74316002)(76176999)(9686003)(54356999)(50986999)(54906002)(55016002)(6506006)(1411001)(99286003)(7736002)(38730400002)(6916009)(110136004)(305945005)(86362001)(33656002)(5660300001)(6246003)(189998001)(229853002)(3846002)(8936002)(7696004)(2906002)(8676002)(3660700001)(3280700002)(81166006)(4326008)(122556002)(25786009)(2900100001)(53546009);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB2560;H:VI1PR0401MB2591.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;LANG:en; x-ms-office365-filtering-correlation-id: 49862b5b-1cbd-48c4-15f8-08d488bd5c79 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:VI1PR0401MB2560; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197)(275809806118684); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(20161123560025)(20161123564025)(6072148);SRVR:VI1PR0401MB2560;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0401MB2560; x-forefront-prvs: 02843AA9E0 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-2" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Apr 2017 13:50:24.4535 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2560 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v3LDodPL015216 Content-Length: 1430 Lines: 38 On 4/21/2017 4:31 PM, Stuart Yoder wrote: > On Fri, Apr 21, 2017 at 7:00 AM, Horia Geant? wrote: >> >> When checking the response verb, the valid bit should be masked out, >> since its value flips depending on what Response Register >> (RR0 /RR1) it's been read from. >> >> Fixes: 321eecb06bfb ("bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2") >> Signed-off-by: Horia Geant? >> --- >> drivers/staging/fsl-mc/bus/dpio/qbman-portal.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c >> index 2a3ea29d9b43..5d020fb98c66 100644 >> --- a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c >> +++ b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c >> @@ -963,7 +963,7 @@ int qbman_swp_alt_fq_state(struct qbman_swp *s, u32 fqid, >> } >> >> /* Decode the outcome */ >> - WARN_ON(r->verb != alt_fq_verb); >> + WARN_ON((r->verb & 0x7f) != alt_fq_verb); > > Don't use magic constants like that. Create a #define for the valid bit. > Just looking at the surrounding code, this seems the preferred way to mask the valid bit. Though there are two defines that could be used in this case: #define QB_VALID_BIT ((u32)0x80) #define QBMAN_RESULT_MASK 0x7f Let me know whether keeping code similar would be preferred or not. Thanks, Horia