Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162985AbdD1Oj3 (ORCPT ); Fri, 28 Apr 2017 10:39:29 -0400 Received: from mail-sn1nam02on0072.outbound.protection.outlook.com ([104.47.36.72]:40576 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755718AbdD1OjU (ORCPT ); Fri, 28 Apr 2017 10:39:20 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; From: =?UTF-8?q?Horia=20Geant=C4=83?= To: , Roy Pledge CC: , , Stuart Yoder , Ioana Radulescu , Haiying Wang Subject: [PATCH] staging: fsl-mc/dpio: add cpu <--> LE conversion for dpaa2_fd Date: Fri, 28 Apr 2017 17:38:58 +0300 Message-ID: <20170428143858.15992-1-horia.geanta@nxp.com> X-Mailer: git-send-email 2.12.0.264.gd6db3f216544 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131378639587273340;(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)(39450400003)(39840400002)(39380400002)(39400400002)(39410400002)(39850400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(9170700003)(85426001)(50466002)(54906002)(39060400002)(47776003)(53936002)(5820100001)(305945005)(4326008)(8656002)(33646002)(356003)(23676002)(77096006)(8676002)(86362001)(105606002)(575784001)(6636002)(50226002)(6666003)(50986999)(106466001)(81166006)(2870700001)(104016004)(1076002)(38730400002)(36756003)(2906002)(5660300001)(189998001)(8936002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0301MB0603;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:ovrnspm;A:1;MX:1;PTR:InfoDomainNonexistent;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD023;1:UhPLPUGnKpkxADg6C2rjkZBKiKBBNoYGsGncBv83nfppEQAKtGbFs2/NA/a4gm1Xffwr6uhtupfjYy4nY4OVdwNUixenh+vfwxwhlVqHqCC2ZMoVd5Er3o+W7YTPE19Irc39n5TnX+/+MU3D3s14q7U0UNLqq/KZqUY1iwg6qL1LZEKhBqERTe0j2u1Q5XEhkxRCkh9vEyOPjDeg8o9JFE520vvA4FwsDAIsyQ9WMyqCK2+r8WXf1UdhT85suERJl4XUoorDuRMtr+xCrIG8BLr9M9D8rFL/oRa1DX+GJ2Q2T91bB2R6qAI7ZHeSuyHjutRQ2Yz+mzU9zlWzSze/RlRHcSo36QhGyyQ4mA7esMSA5eBWLjiMI1Zp+/vSc9h9SwhUwUuTaAQzl02D1IG7En/hUcdLtcT1Un99J2ZSc8gBIfyZ50nbXSnRzEVJXzwK6DIiYztEYPcRJrZPEKU/3xHoAvbpOXGHEA2Ah53PRmMugbPRdSvXqaTm9AkDoaUZqYyIjSImL0i1165lgfNSfDRYO6A7v42Tj53YydA2P1R5lK9s+EOx0Gc3BXB3yUaEJXHiqT3q7icFffoNexC3VSJTMa+G9Zpxt8bvwWsfZUp5+3JFlIjPPLnTkQWByY4KMxXPU3+/eDvVsLDL/9WnEfMmtvAAeuZvp1+Ofs6Tys6rKrXPmV/frMy5SxKrghR6uN6Aa+gOm4grODDEZP1LZlNzrpMRkruXz++Cn/B7YE4= X-MS-Office365-Filtering-Correlation-Id: 8d3d17d9-991d-4e06-091a-08d48e445a21 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131430075)(201703131517081);SRVR:CY1PR0301MB0603; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0603;3:8wC4rBQRmtSsM1c6/lEa9kzoBCgrZreBDRfRk00Ti0CQ5HbjzW+rW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4bg5i4XkbEOiw590Egz+4ihwxLcRw4/iG4RVr/Vq9qj2cLxSbqkDvIKFl0z7T6QWIxeCOlncRiQcZskruIFNTxuI/Uqcw04hd3bJ3au7urnsPHdawJYcQw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6095135)(601004)(2401047)(13024025)(13023025)(13017025)(13015025)(13018025)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123565025)(20161123556025)(20161123563025)(20161123561025)(201703131430075)(201703131448075)(201703131433075)(201703161259150);SRVR:CY1PR0301MB0603;BCL:0;PCL:0;RULEID:(400006);SRVR:CY1PR0301MB0603; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0603;4:x1xQMLTEt4+gGtd+sbm6KKqNSzO/aBrUBvSVAlSGjzwI8s6UPB0VW6urpRh6oUbgv0VasN4rsDMLGDw7hrVpYDQSxYUACtNX7mncNheI7OOocXDH/Xx7ALOeFQqsX+cteBjqFNaJodWcY0lzRnsGqsIJZnq58l7+w3fMnMx/OgwbU81d3NkBUj4JIq4h8rzNhXr6ICJn+aNNg3R4oHbQAHF5rFLaMFjv9oI3xUHsAL2JFVcdquvydc9Ck0zlR9ky/52JqopZ97XougP/9I8waJABS311IDeHGQJEB4licBzhC3vD8t4yOMtvq8irivIjYeRuDPoIwvMN0Vq1tTxg7wgjiQiEaX52LRPiVT+KxXsjhrkVOmfEf6l40Ms3P6mBwdjpb2+MzPmpNCQdCt/gCcV+V3eGdiPuBbx+ohJBw93NS0tijwOsCY9TxYpb8GnNkYX/QlcdGfkVTjhe8iLV7/7Ia4EqE/VMZkyIe2G082zWE4Cc1R87y8jHS2FSGq1iTMdbFxaTvZsmuMS63XuKgBxoidb5zaB6liwpwcfj8SGg1jBNpiFyNdhO7Z7H3HbpLYADwXJ/oMtDSltviylcIlqz+IP8DmhyCINCkmqdTB5aB2GZB4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PUTXVgN6H6GI/Qaabdw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB0603;7:uWUUHE4Mwv1v+OWqmsHDVARxSCLUep2tcDHQ+dK7Ykx8qiyCSVeiWBRHDnNqwuMa0MfnzNhjKD8pjmc0t914rkWGC7l7KnARD9JXimHvw0IP0x2EBiDsxNjZqoJCvg7KUkxtXxNcJZc5pUrWY4B12kaYnN6qsfIkCD8wT2beLwi9TBS6nWfW5riFEpuid6UpS/If3x11S2l0p8SKXV1R3G/hTEZbWdEXduUxSYAJfMSCNugGUBJLUEcB0wb7h8sNrVY2XVX5zEFOtDV4itAelvW9nZQLiIDq5qUVbt7dDsx30TWqmMy6Xn3cVxaaxX4nF+4HAhiwGMhs6ifRR7uBpA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2017 14:39:18.5557 (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: CY1PR0301MB0603 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5906 Lines: 187 While dpaa2_fd.simple structure fields are marked __leXX, corresponding cpu_to_leXX / leXX_to_cpu conversions are missing. While here, fix dpaa2_fd_{get,set}_bpid such that BMT, IVP bits sharing the 16-bit field with BPID are not affected. Fixes: d3269bdc7ebc ("bus: fsl-mc: dpio: add frame descriptor and scatter/gather APIs") Signed-off-by: Horia Geantă --- drivers/staging/fsl-mc/include/dpaa2-fd.h | 45 ++++++++++++++++--------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/drivers/staging/fsl-mc/include/dpaa2-fd.h b/drivers/staging/fsl-mc/include/dpaa2-fd.h index 9500123cc7f9..cf7857f00a5c 100644 --- a/drivers/staging/fsl-mc/include/dpaa2-fd.h +++ b/drivers/staging/fsl-mc/include/dpaa2-fd.h @@ -81,6 +81,7 @@ struct dpaa2_fd { #define FD_OFFSET_MASK 0x0FFF #define FD_FORMAT_MASK 0x3 #define FD_FORMAT_SHIFT 12 +#define FD_BPID_MASK 0x3FFF #define SG_SHORT_LEN_FLAG_MASK 0x1 #define SG_SHORT_LEN_FLAG_SHIFT 14 #define SG_SHORT_LEN_MASK 0x1FFFF @@ -105,7 +106,7 @@ enum dpaa2_fd_format { */ static inline dma_addr_t dpaa2_fd_get_addr(const struct dpaa2_fd *fd) { - return (dma_addr_t)fd->simple.addr; + return (dma_addr_t)le64_to_cpu(fd->simple.addr); } /** @@ -115,7 +116,7 @@ static inline dma_addr_t dpaa2_fd_get_addr(const struct dpaa2_fd *fd) */ static inline void dpaa2_fd_set_addr(struct dpaa2_fd *fd, dma_addr_t addr) { - fd->simple.addr = addr; + fd->simple.addr = cpu_to_le64(addr); } /** @@ -126,7 +127,7 @@ static inline void dpaa2_fd_set_addr(struct dpaa2_fd *fd, dma_addr_t addr) */ static inline u32 dpaa2_fd_get_frc(const struct dpaa2_fd *fd) { - return fd->simple.frc; + return le32_to_cpu(fd->simple.frc); } /** @@ -136,7 +137,7 @@ static inline u32 dpaa2_fd_get_frc(const struct dpaa2_fd *fd) */ static inline void dpaa2_fd_set_frc(struct dpaa2_fd *fd, u32 frc) { - fd->simple.frc = frc; + fd->simple.frc = cpu_to_le32(frc); } /** @@ -147,7 +148,7 @@ static inline void dpaa2_fd_set_frc(struct dpaa2_fd *fd, u32 frc) */ static inline u32 dpaa2_fd_get_ctrl(const struct dpaa2_fd *fd) { - return fd->simple.ctrl; + return le32_to_cpu(fd->simple.ctrl); } /** @@ -157,7 +158,7 @@ static inline u32 dpaa2_fd_get_ctrl(const struct dpaa2_fd *fd) */ static inline void dpaa2_fd_set_ctrl(struct dpaa2_fd *fd, u32 ctrl) { - fd->simple.ctrl = ctrl; + fd->simple.ctrl = cpu_to_le32(ctrl); } /** @@ -168,7 +169,7 @@ static inline void dpaa2_fd_set_ctrl(struct dpaa2_fd *fd, u32 ctrl) */ static inline dma_addr_t dpaa2_fd_get_flc(const struct dpaa2_fd *fd) { - return (dma_addr_t)fd->simple.flc; + return (dma_addr_t)le64_to_cpu(fd->simple.flc); } /** @@ -178,13 +179,13 @@ static inline dma_addr_t dpaa2_fd_get_flc(const struct dpaa2_fd *fd) */ static inline void dpaa2_fd_set_flc(struct dpaa2_fd *fd, dma_addr_t flc_addr) { - fd->simple.flc = flc_addr; + fd->simple.flc = cpu_to_le64(flc_addr); } static inline bool dpaa2_fd_short_len(const struct dpaa2_fd *fd) { - return !!((fd->simple.format_offset >> FD_SHORT_LEN_FLAG_SHIFT) - & FD_SHORT_LEN_FLAG_MASK); + return !!((le16_to_cpu(fd->simple.format_offset) >> + FD_SHORT_LEN_FLAG_SHIFT) & FD_SHORT_LEN_FLAG_MASK); } /** @@ -196,9 +197,9 @@ static inline bool dpaa2_fd_short_len(const struct dpaa2_fd *fd) static inline u32 dpaa2_fd_get_len(const struct dpaa2_fd *fd) { if (dpaa2_fd_short_len(fd)) - return fd->simple.len & FD_SHORT_LEN_MASK; + return le32_to_cpu(fd->simple.len) & FD_SHORT_LEN_MASK; - return fd->simple.len; + return le32_to_cpu(fd->simple.len); } /** @@ -208,7 +209,7 @@ static inline u32 dpaa2_fd_get_len(const struct dpaa2_fd *fd) */ static inline void dpaa2_fd_set_len(struct dpaa2_fd *fd, u32 len) { - fd->simple.len = len; + fd->simple.len = cpu_to_le32(len); } /** @@ -219,7 +220,7 @@ static inline void dpaa2_fd_set_len(struct dpaa2_fd *fd, u32 len) */ static inline uint16_t dpaa2_fd_get_offset(const struct dpaa2_fd *fd) { - return fd->simple.format_offset & FD_OFFSET_MASK; + return le16_to_cpu(fd->simple.format_offset) & FD_OFFSET_MASK; } /** @@ -229,8 +230,8 @@ static inline uint16_t dpaa2_fd_get_offset(const struct dpaa2_fd *fd) */ static inline void dpaa2_fd_set_offset(struct dpaa2_fd *fd, uint16_t offset) { - fd->simple.format_offset &= ~FD_OFFSET_MASK; - fd->simple.format_offset |= offset; + fd->simple.format_offset &= cpu_to_le16(~FD_OFFSET_MASK); + fd->simple.format_offset |= cpu_to_le16(offset); } /** @@ -242,7 +243,7 @@ static inline void dpaa2_fd_set_offset(struct dpaa2_fd *fd, uint16_t offset) static inline enum dpaa2_fd_format dpaa2_fd_get_format( const struct dpaa2_fd *fd) { - return (enum dpaa2_fd_format)((fd->simple.format_offset + return (enum dpaa2_fd_format)((le16_to_cpu(fd->simple.format_offset) >> FD_FORMAT_SHIFT) & FD_FORMAT_MASK); } @@ -254,8 +255,9 @@ static inline enum dpaa2_fd_format dpaa2_fd_get_format( static inline void dpaa2_fd_set_format(struct dpaa2_fd *fd, enum dpaa2_fd_format format) { - fd->simple.format_offset &= ~(FD_FORMAT_MASK << FD_FORMAT_SHIFT); - fd->simple.format_offset |= format << FD_FORMAT_SHIFT; + fd->simple.format_offset &= + cpu_to_le16(~(FD_FORMAT_MASK << FD_FORMAT_SHIFT)); + fd->simple.format_offset |= cpu_to_le16(format << FD_FORMAT_SHIFT); } /** @@ -266,7 +268,7 @@ static inline void dpaa2_fd_set_format(struct dpaa2_fd *fd, */ static inline uint16_t dpaa2_fd_get_bpid(const struct dpaa2_fd *fd) { - return fd->simple.bpid; + return le16_to_cpu(fd->simple.bpid) & FD_BPID_MASK; } /** @@ -276,7 +278,8 @@ static inline uint16_t dpaa2_fd_get_bpid(const struct dpaa2_fd *fd) */ static inline void dpaa2_fd_set_bpid(struct dpaa2_fd *fd, uint16_t bpid) { - fd->simple.bpid = bpid; + fd->simple.bpid &= cpu_to_le16(~(FD_BPID_MASK)); + fd->simple.bpid |= cpu_to_le16(bpid); } /** -- 2.12.0.264.gd6db3f216544