Message ID | 01e5dae1-d4b0-cf31-516b-423b11b077f1@axentia.se |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2306464vqo; Tue, 23 May 2023 10:30:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ywQ1aDYC4sbfVQiwldphj+EtDqu5wkv2M5Od19h/rpj3ws6ZgscX2IzOQgCnG5aA+8qac X-Received: by 2002:a17:90a:e2d2:b0:253:2816:2a12 with SMTP id fr18-20020a17090ae2d200b0025328162a12mr15936083pjb.14.1684863033986; Tue, 23 May 2023 10:30:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684863033; cv=pass; d=google.com; s=arc-20160816; b=gl/7c08Gckr29HOhMRnALYo/AO86Q9j1E+S9hWwsYFmwjJWUuKY+ltXgeofh9ivxGQ ijvaMgUedPfh6OarTG+MRyzr7M/Lycy+ZP9mML9CMbIfxjCHI7+lmB/rC/lxUsZ+joFj GWHo+JY/DOIcZF7I/ekhDxjiMa/VVmupbuyPlBj3BIo5gac/6YFV+JSYBLZy+VYULhAV cgm6hCvD8DEu6aSaOM0fR0k1tLABXzgaTIkwEugNFigLRxAVqoVIqqRkBBLaK+ibVDVm Tu9mBPzq9MS3rmHQ67FefnmegbTcX0XarRUJ7LiBsn2YnO2Znjhb5TiyiE9nkIe+Fq8k 27BA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:subject:from:cc:to:content-language :user-agent:date:message-id:dkim-signature; bh=kB58yjEPuX4C0k3fpbaGhxAt2iJZZExBLlkMV7jNHH0=; b=sBwtMDcNH3QvCTVOhvXylm42Z8JVye5hGIaVdNN5akF7Jnz/SRzINFWD7BjzZ3bMiD FMPwEGTrHRx8JhDas4UkSIw2PS4mgl7rewT0gpWQZChibWPYU/ORrjPxqaDxLwxOgtkt iGM1V+jvFEgHjFfTKJUUdlWLTE9IF8UnxNp02g8whO+FnrZ/h6poeBIVp1C6eMUrMemF OsWaBpio5W2Y1f3pNyh1rY/8488H4sfYXluSC5+EriDpZcWl94pfF9rGE1KfJ9LvGOVe 63SNjD0CZWFqFLDmXd3kVziLUJsI3LMwyF+m4RO7Ldl9u5fQ5cmQON4GImfHxIp3sNj9 5U7Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@axentia.se header.s=selector2 header.b=B5Mpcj2L; arc=pass (i=1 spf=pass spfdomain=axentia.se dkim=pass dkdomain=axentia.se dmarc=pass fromdomain=axentia.se); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 10-20020a17090a0f8a00b00250291be156si8865425pjz.148.2023.05.23.10.30.17; Tue, 23 May 2023 10:30:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@axentia.se header.s=selector2 header.b=B5Mpcj2L; arc=pass (i=1 spf=pass spfdomain=axentia.se dkim=pass dkdomain=axentia.se dmarc=pass fromdomain=axentia.se); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235370AbjEWRUq (ORCPT <rfc822;ahmedalshaiji.dev@gmail.com> + 99 others); Tue, 23 May 2023 13:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237357AbjEWRUo (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 23 May 2023 13:20:44 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2136.outbound.protection.outlook.com [40.107.6.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C8D990; Tue, 23 May 2023 10:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n47gtomelcj011q0pxUkpwpCr8adDTDMB4Tfx4ql5IFCGjM6HbWF5M596oig5Iue9mLFajraCLhbvsw5PUHs++/VssXyRvGbrQms2J1LxkuY4osdQ8OnlfUV6n2fjrW+5bI4YFnObH3/ulkCME3oPKUrNSUJJejIPHbByH8oBj4u6LFH0AQHSk6CI7+CItyPrqKoCqXxUbhcyJccQ7lYEM/8qdmPRCm8s/JB7Sm7sRxgfTSAs8XSCJVN5sMdmiAIMrnE/hbGtaTYx5o8+MAjoctNL8uggFHLumVZkQWbnRnr0gtq0wFI1dyfSQxOH52hxstGyegzn8JlBsj10Xo80w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kB58yjEPuX4C0k3fpbaGhxAt2iJZZExBLlkMV7jNHH0=; b=X1VCwAtVMi8g5b+94rK+FoRQ+OnnlL0Ac9SlGxsEP1vS67UFDH8GaEtqoW+InnOfSQVY91jj6lpt9IuAtpnMPN+cVLgclmz29dVKcUt1tqyU9Qxckiakv1/lfOv3EwpIlb7lyjet8B8J8f5e+gstRvaH6Ef4PGSZtNHKA0iQi8jLhdtbS+bgbrNGPyrzL23nNKJr0PmhZTj4wd0eywFDAZP115Wp29qIuKlgIavezjDm2mJ33dXRN3hcYnH+c85sckHBULAqBTGp021pcqX0MXKrpM63Kw82kHI4QTY0tANBTLkWDB3mg33DmcfHYUwRlWZ1Gkk6GQQtlauURSF3zA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=axentia.se; dmarc=pass action=none header.from=axentia.se; dkim=pass header.d=axentia.se; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentia.se; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kB58yjEPuX4C0k3fpbaGhxAt2iJZZExBLlkMV7jNHH0=; b=B5Mpcj2Lbot2Hs98haHHVWnSb1d6JGEDggTvpx8kAS7k9twt1lYewqBxsuHI8iIu3KSV0/C3D8UkVKcQ6w4U+0QW/R1sYl12ggfvlokG7W5qsJV4pN1g+ug6DqEPxPMaxzEjw8+jTRwUyUanZDupgiJvIHWEHt7CCIjnb3j5EZo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=axentia.se; Received: from AM0PR02MB4436.eurprd02.prod.outlook.com (2603:10a6:208:ed::15) by PAVPR02MB9205.eurprd02.prod.outlook.com (2603:10a6:102:320::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Tue, 23 May 2023 17:20:40 +0000 Received: from AM0PR02MB4436.eurprd02.prod.outlook.com ([fe80::681f:7dcc:3f6c:3b36]) by AM0PR02MB4436.eurprd02.prod.outlook.com ([fe80::681f:7dcc:3f6c:3b36%5]) with mapi id 15.20.6411.028; Tue, 23 May 2023 17:20:40 +0000 Message-ID: <01e5dae1-d4b0-cf31-516b-423b11b077f1@axentia.se> Date: Tue, 23 May 2023 19:20:37 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Content-Language: sv-SE To: LKML <linux-kernel@vger.kernel.org> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>, Tudor Ambarus <tudor.ambarus@linaro.org>, Vinod Koul <vkoul@kernel.org>, Nicolas Ferre <nicolas.ferre@microchip.com>, linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, "stable@vger.kernel.org" <stable@vger.kernel.org> From: Peter Rosin <peda@axentia.se> Subject: [PATCH v2 1/2] dmaengine: at_hdmac: Repair bitfield macros for peripheral ID handling In-Reply-To: <221d19e2-6b92-7f38-7d8a-a730f54c33ea@axentia.se> References: <221d19e2-6b92-7f38-7d8a-a730f54c33ea@axentia.se> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MM0P280CA0071.SWEP280.PROD.OUTLOOK.COM (2603:10a6:190:8::25) To AM0PR02MB4436.eurprd02.prod.outlook.com (2603:10a6:208:ed::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR02MB4436:EE_|PAVPR02MB9205:EE_ X-MS-Office365-Filtering-Correlation-Id: 97d11365-e5eb-47ac-71c6-08db5bb2081e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WXY3oiOC6APCUKfbN2Nm7ihJ4e+GGM9RT+N8mqIzs0tT4akpD5PlcO+WNDhncsRckydpbuobixOMDuC3rlD77Oqv6CEcZStPrhG1ZaI2cfsh+aEJ7tbvrPfSHaXwjkhor/f+ceUYpwaWUOIjpg1d9pj9Yu++uHXc5mesyBiWRI5R/sTaXzQ5vLetEA+NTc/yEBNjqzaGXmQ4AbJwOwSMDtDluJgIr0xS4IAlYheuOf1LLnRRKxLOxp1EDfBQhxd3WobTw/OSz0P+5mTcx6AI/6VGVuB1Gxxw6XjK1mPvwfpRXXj6cJ4j1oCQiRwBPQe+dkN9cCckWApOQpFx2S4cuY1pjutCjtCaxYvqKzyEO5Sl9AvrBNwxzafMLCe0co3piAlqbFdhR9dwL/fPf3XU6/5PUpXUTsO0crZPf6GinJlKiiZJaL1bMNeO4PbXdW6x0e0BQJATW3Tk+v+OfHv8hB5QHe1hRz7DAPVKXR7AvP8X8vk3TBEjQEfZJag9ZMXM37wcTsIpPw5F0jpXibme2iw6jgnnAu5PznevV+U6LEax6FnSrfagGqCGNojaeRYgrUQiJdqoVoBdHyrqX4gvTKLW8tnEvMq1Rxqw1MKmeDkw3L5gNldmWl9HTkKvs7VznKLId2Dl+WHCn8oENHH+nw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR02MB4436.eurprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(39840400004)(376002)(396003)(136003)(366004)(451199021)(8936002)(8676002)(5660300002)(186003)(83380400001)(26005)(6506007)(6512007)(86362001)(31696002)(2616005)(38100700002)(41300700001)(6666004)(6486002)(66476007)(66556008)(66946007)(6916009)(4326008)(36756003)(478600001)(316002)(54906003)(2906002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?R9BsyqpWJeTFbi67ojtrbn8Ez87U?= =?utf-8?q?4/tzBJxxh1geWC0c5MBKAXFu0pUn2YnjktVkLo+7N4OBIUhAfRwpqpgNWJ6s6jBtT?= =?utf-8?q?XgzpDHgmlNH9jGuqrkY+OzpypOKXKdDtsdT+bedgRZ+28JQ8MDH+JcqNfMookGZVa?= =?utf-8?q?A/EVXtCUGh3/xwPc/VCe4STaZYC4AWMVOuWvOF20Gl7WX+o/cE4ZXHngXlarhecSE?= =?utf-8?q?2T4+XLoBBWpKNBtCHGLGCm5NRyiiefWxKeHBjtIDwhww9TdQukzX9LUT+XZVJN4c9?= =?utf-8?q?Pii4RhIOfCzDDcvdKlKxehmRAH5McgLj7+2W1gXuhtZGUVxT+0q2ZxKR1ejs9bYpd?= =?utf-8?q?pJ391f5QQ/htRRJojur1V6omCgj85AqUriKhTMDFiqYHWzYivaSxeR9lIc4vHQ+2U?= =?utf-8?q?uoY2r8F980OLbitL4mZdmLMv/xB6OVoRjSPqqaUo7RQgJBSID2/LTqBjS39iB6Rwq?= =?utf-8?q?1AbF75C4ujDDdG2E07fHt1saRq9rS6vjvW+omy8AWOv52bY3DZ9XniB+nbsby6qSE?= =?utf-8?q?jUWGPaQWHO7/iQnJoSShMvtjvxdWPqugG7EmFfxr3DQtTrBtn6nhIYkySFDEE2Bsy?= =?utf-8?q?7DcqVOQvKQySey/3TI7A9x2gPGMXrH3u6YisZxaaNw81QKzpf7xVova0nBpRmCYaX?= =?utf-8?q?lfvXMfyaH+FhI27rKUBRdXWCFUTYryQG7TXmaqzjwNDczJK249DaEQ4YRnvgajWNS?= =?utf-8?q?Mnc8CpD9ePllQ8eVNSCcnGVVn8UM6T81Tyc0uCrtGCbPlzEZsrvEDJHcjTvQWpMOM?= =?utf-8?q?8ZGV5Pj1/xjhECRuFchw0PSAjsSKN6gWB5RA6Atli9V3EfK3nsjl68euLcGl2jAZJ?= =?utf-8?q?1YvHm2f7rsvXGqyBNNX6L8ZlUyJ+JQD4PgqG6gpj10iyjgy7qCJ3QdqiUrKBYOnvR?= =?utf-8?q?nMFD6xyjQ8K4Wjn1mhg5Hwwv3LgQ3sVB1R78NUT6sVXMEB77lJJjhfndCLINLTsPA?= =?utf-8?q?VjVmfksgiGcGBxIcelX5iO0X3T01C1tHsxGziMngRwRH6EE/8OO0b70iViZThu6Na?= =?utf-8?q?jCH/e+6f78ouW4V0cq30SVNcdMiH+6i2fKxpZ3WFBBolygl7ue1KfSrrwF3x2NkT1?= =?utf-8?q?cZJEmS2aZ9z39dppzs58kR91akDZx5RUIRztp/jUyrM0eHsovdMkAja0JXEQTFbWw?= =?utf-8?q?+1fMtS7amRaWCa8I5PGNJEuGggUu8YFQPFOvWNUbwkCoPpSY3BD2ELi6uQHQ1mI+o?= =?utf-8?q?2pwMxpHh3zBvKSo26Hvfqv7T9ezvJ8ClY4Jf9H7iyVYyMEe6UvgCqwu0ZnsF8+G8S?= =?utf-8?q?Tz13ftrD+/+W3i+28dpeyYfEdho0x1FiRnf5N1T8kpvkzj9TSb2vUSWPDFUPodIXV?= =?utf-8?q?7E1BFiliCmBXlkillUtfYm3k68znV7+GqONiQBQtU02GZIPKwGgHS9H85zlUimNtU?= =?utf-8?q?0tUSsga65Oi4J+8O3ZlRC0wAxXIlRyAdHSzVtIr3McYQ3hsZFUYYZiq/pE9M2rrn0?= =?utf-8?q?LNHJkPn2KHF7clW6kJtNLJg9mVy8X0VzORqsTdXnTnYfnQeMRXeB8u0muGyVMdGt+?= =?utf-8?q?hrJucEuezgyX?= X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-Network-Message-Id: 97d11365-e5eb-47ac-71c6-08db5bb2081e X-MS-Exchange-CrossTenant-AuthSource: AM0PR02MB4436.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2023 17:20:40.2906 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4ee68585-03e1-4785-942a-df9c1871a234 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wgJlz3NgaJNayRtroz7AtbT8cWywv99pdskEbcucHomWvV0p+seXPv99CaWSj4Zk X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR02MB9205 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766706940612422966?= X-GMAIL-MSGID: =?utf-8?q?1766706940612422966?= |
Series |
dmaengine: at_hdmac: Regression fix and cleanup
|
|
Commit Message
Peter Rosin
May 23, 2023, 5:20 p.m. UTC
The MSB part of the peripheral IDs need to go into the ATC_SRC_PER_MSB
and ATC_DST_PER_MSB fields. Not the LSB part.
This fixes a severe regression for TSE-850 devices (compatible
axentia,tse850v3) where output to the audio I2S codec (the main
purpose of the device) simply do not work.
Fixes: d8840a7edcf0 ("dmaengine: at_hdmac: Use bitfield access macros")
Cc: stable@vger.kernel.org
Signed-off-by: Peter Rosin <peda@axentia.se>
---
drivers/dma/at_hdmac.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
Comments
On 5/23/23 18:20, Peter Rosin wrote: > The MSB part of the peripheral IDs need to go into the ATC_SRC_PER_MSB > and ATC_DST_PER_MSB fields. Not the LSB part. > > This fixes a severe regression for TSE-850 devices (compatible > axentia,tse850v3) where output to the audio I2S codec (the main > purpose of the device) simply do not work. > > Fixes: d8840a7edcf0 ("dmaengine: at_hdmac: Use bitfield access macros") > Cc: stable@vger.kernel.org > Signed-off-by: Peter Rosin <peda@axentia.se> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org> > --- > drivers/dma/at_hdmac.c | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c > index 8858470246e1..6362013b90df 100644 > --- a/drivers/dma/at_hdmac.c > +++ b/drivers/dma/at_hdmac.c > @@ -153,8 +153,6 @@ > #define ATC_AUTO BIT(31) /* Auto multiple buffer tx enable */ > > /* Bitfields in CFG */ > -#define ATC_PER_MSB(h) ((0x30U & (h)) >> 4) /* Extract most significant bits of a handshaking identifier */ > - > #define ATC_SRC_PER GENMASK(3, 0) /* Channel src rq associated with periph handshaking ifc h */ > #define ATC_DST_PER GENMASK(7, 4) /* Channel dst rq associated with periph handshaking ifc h */ > #define ATC_SRC_REP BIT(8) /* Source Replay Mod */ > @@ -181,10 +179,15 @@ > #define ATC_DPIP_HOLE GENMASK(15, 0) > #define ATC_DPIP_BOUNDARY GENMASK(25, 16) > > -#define ATC_SRC_PER_ID(id) (FIELD_PREP(ATC_SRC_PER_MSB, (id)) | \ > - FIELD_PREP(ATC_SRC_PER, (id))) > -#define ATC_DST_PER_ID(id) (FIELD_PREP(ATC_DST_PER_MSB, (id)) | \ > - FIELD_PREP(ATC_DST_PER, (id))) > +#define ATC_PER_MSB GENMASK(5, 4) /* Extract MSBs of a handshaking identifier */ > +#define ATC_SRC_PER_ID(id) \ > + ({ typeof(id) _id = (id); \ > + FIELD_PREP(ATC_SRC_PER_MSB, FIELD_GET(ATC_PER_MSB, _id)) | \ > + FIELD_PREP(ATC_SRC_PER, _id); }) > +#define ATC_DST_PER_ID(id) \ > + ({ typeof(id) _id = (id); \ > + FIELD_PREP(ATC_DST_PER_MSB, FIELD_GET(ATC_PER_MSB, _id)) | \ > + FIELD_PREP(ATC_DST_PER, _id); }) > > >
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 8858470246e1..6362013b90df 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -153,8 +153,6 @@ #define ATC_AUTO BIT(31) /* Auto multiple buffer tx enable */ /* Bitfields in CFG */ -#define ATC_PER_MSB(h) ((0x30U & (h)) >> 4) /* Extract most significant bits of a handshaking identifier */ - #define ATC_SRC_PER GENMASK(3, 0) /* Channel src rq associated with periph handshaking ifc h */ #define ATC_DST_PER GENMASK(7, 4) /* Channel dst rq associated with periph handshaking ifc h */ #define ATC_SRC_REP BIT(8) /* Source Replay Mod */ @@ -181,10 +179,15 @@ #define ATC_DPIP_HOLE GENMASK(15, 0) #define ATC_DPIP_BOUNDARY GENMASK(25, 16) -#define ATC_SRC_PER_ID(id) (FIELD_PREP(ATC_SRC_PER_MSB, (id)) | \ - FIELD_PREP(ATC_SRC_PER, (id))) -#define ATC_DST_PER_ID(id) (FIELD_PREP(ATC_DST_PER_MSB, (id)) | \ - FIELD_PREP(ATC_DST_PER, (id))) +#define ATC_PER_MSB GENMASK(5, 4) /* Extract MSBs of a handshaking identifier */ +#define ATC_SRC_PER_ID(id) \ + ({ typeof(id) _id = (id); \ + FIELD_PREP(ATC_SRC_PER_MSB, FIELD_GET(ATC_PER_MSB, _id)) | \ + FIELD_PREP(ATC_SRC_PER, _id); }) +#define ATC_DST_PER_ID(id) \ + ({ typeof(id) _id = (id); \ + FIELD_PREP(ATC_DST_PER_MSB, FIELD_GET(ATC_PER_MSB, _id)) | \ + FIELD_PREP(ATC_DST_PER, _id); })