From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.70.9 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796267470; b=MeiO3SSTbF4c3Sp03XxHKeNkk67/5La6RqkOOyyjQG7etxn7BfJIOxgigIfcQyPjNDVE +W2yvWOkmKMsrdjsMBEn+rpZa4eVBU5NIMFy9GwPexIGVIDp5NNxSD4/RXwhOTuNGURbz zAmcrUFWZ3LbrlkJiW5GSylWhnS9uACL/1/Rut/lzqHi1MGtEcLIp4jZzzo0l6FhTb42s jZ8mPuNezhWyqDS8j+YUZysT/zBVZEFdWSaPkPae4d15clzX14M6MgVoHO/5Yni6q6gI1 9zn1EDYU31ZaeOQzK7wu0QkeUwVT5ACSmX4xbPCR7HjRp8T9O3NXggKdZUgDPx1DZAQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796267470; h=DMARC-Filter:DKIM-Signature:Received:Received:Date:From:To:Cc: Subject:Message-ID:References:Content-Type:Content-Disposition: In-Reply-To:X-ClientProxiedBy:MIME-Version:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id: X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay: X-Microsoft-Antispam:X-Microsoft-Antispam-Message-Info: X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=0j5xQ8TvOoLdNaaanD96YR2Cg2Iv0OE2CngaWtFbAwQ=; b=1DTH78tprF/8rurTkV/J64MitYW0ARZawX4tpTJ8Bqh5ZWWDcxfrwNj8z8kPdVc8s73L nuVtJzjKvHuoM0ZgU+r6duaH5cokM+uKGP3eBKkvwoqySvxajz2jGaTp0DmIO5LBD2S14 Adbqtg08HhcT3kzeTb+BwQh9iYVENd8jrAH59fFdYn9n1MvIqoxeo+K/PvyYSxU/UeE4o 7o15thLLjj1KLgsigquRhgjSzhLDTmMG/laI3by+in0IfCee+Rc0X0wcjdvStprcrPFKB Wg8DMtYH2pZsoldzxles/KtxFHPzeJhPPUAQqW64l7h/JFKEeNzOuVL1pkHEG6uk3MQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-NXP1-onmicrosoft-com header.b=VaXvtPjp; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.70.9 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011009.outbound.protection.outlook.com [52.101.70.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5669A606A322; Thu, 3 Dec 2026 03:11:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5669A606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-NXP1-onmicrosoft-com header.b=VaXvtPjp ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Qs8MNvPg9SFNc4GY3yuYy6enOTwS6LfC96VJNHr6YlaBFxaFzFTRpXmM+cs7hka6+EBLoEvgc36c3a0oEWC56aYYZm1ANXuqkPcizKOFp61OpFczrH0CQXSigvtxoMOytYaXya+YB6jgo31XgcC1imAkV4JbQylu7cQ6CT93ilrT9bizoWDUcMQPwttP+VKjWLg6Lx/VJRhmAhjZr7wfBFGf9Z2gG7dydi8qDensZAI8gAyFO0adYKW3XxnYWoWKtJ0F0bnm+H5hwMr/HycRiCpBHIidW8Zv19/OHhivkutu9jrdZCBpvvorYQohbPY7rXRwxhBYtZx6ALpeUi2q2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=0j5xQ8TvOoLdNaaanD96YR2Cg2Iv0OE2CngaWtFbAwQ=; b=kd9bLPEGyekrkhZ46Cdqws9MbYYFVAnbySk/drHGGEIEJ7Ra30y8m6NExCtsXrtWvSzXayYvgYGj3wLq8pbQzc5bAiNmjqA70UFXyHGJsqzoFeCn2tspFFk6yiDiOhT8b/yiZ+FKEQxte4hM/PJqY2ycsPUJxcS1u6oHAw/erEnOZ83IbfPKPTB9wvgtnppTkg0jhDL1Csm+1mfcrFlQ3O5PXXq1raitoXs4QbunCTlt+jCmvtpzlNVZ8AfrwUQ5+nF+N8+F4f8zIcEtY0gxTGOzXkolT3MF17k25aU4oFsexPfBuh7hSwgld2s7lWm3agWKWyY4xkjH1zL1/97XJA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0j5xQ8TvOoLdNaaanD96YR2Cg2Iv0OE2CngaWtFbAwQ=; b=VaXvtPjpPtiKgptjqriKQVo4dwIv8dKelov/TRDkmU/3BcncMeWX3UHGY2mF/GaT9n+3W/vf083u/VQhdd4L0iN/+gDeSpeO89HYl6I1Ti5auKoYDJ10iTOYhHQb1Hi90QMjT5FBQJzN7jyg6TF104b3uDYLuydpQH4ftRZkml+HHHMlizwVoNKdqxztQFb8r7/jeAjqLzRhKCGYHL5dFeHUboxyf/JRM6Z4MUFSrBwBa5cwdsqhLaGEpAwEXKQQwtid8FZsWg4eiKOmbuxBdVwOruiZHasyryYEr3rN+H4zSJyDIQuAY2qtRSHxw1290qTyeE5jcDjWlRo7thajqQ== Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from MI3PR04MB12438.eurprd04.prod.outlook.com (2603:10a6:290:76::14) by GV1PR04MB10824.eurprd04.prod.outlook.com (2603:10a6:150:20c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.11; Thu, 3 Dec 2026 03:11:02 +0000 Received: from MI3PR04MB12438.eurprd04.prod.outlook.com ([fe80::c715:c32:8bb1:b70b]) by MI3PR04MB12438.eurprd04.prod.outlook.com ([fe80::c715:c32:8bb1:b70b%4]) with mapi id 15.21.0688.009; Thu, 3 Dec 2026 03:11:02 +0000 Date: Wed, 2 Dec 2026 21:10:43 -0600 From: Frank Li To: Andrea della Porta Cc: Vinod Koul , Frank Li , dmaengine@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Saenz Julienne , Stefan Wahren , Dave Stevenson , Phil Elwell , Dom Cobley , Maxime Ripard , Robin Murphy , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 11/28] dmaengine: bcm2835: drop info parameters Message-ID: References: <20261127122236.4976-1-andrea.porta@suse.com> <20261127122236.4976-12-andrea.porta@suse.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261127122236.4976-12-andrea.porta@suse.com> X-ClientProxiedBy: PH3PEPF000040A2.namprd05.prod.outlook.com (2603:10b6:518:1::56) To MI3PR04MB12438.eurprd04.prod.outlook.com (2603:10a6:290:76::14) X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MI3PR04MB12438:EE_|GV1PR04MB10824:EE_ X-MS-Office365-Filtering-Correlation-Id: 1ce79c5a-7081-47d1-5489-08df50eb0fb9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|1800799024|19092799006|366016|376014|7416014|18002099003|22082099003|10067099003|56012099006|261021133027099003|261026121527099003|261026140227099003|261026135527099003|261026130827099003|261021130227099003|261021123027099003|261021121427099003|261028144727099003|261102123227099003|261022075727099003|261022113327099003|261022105027099003|261022115727099003|261021135927099003|261009223027099003|4143699003|11063799006|3023799007; X-Microsoft-Antispam-Message-Info: tC5NbQWIgAmzT58vev18/ywZan4pwH1XUHl0sqFCmt/p/cHCA4FygIkKRw9vMm5Lf5bVz2YjVdSZWpuGF3HN5M32iDW/JzGXUkcU+FzTOM3v7TiNmV1e1qOKVXhzowDYj1zzdnH9akq+WWhKArKtDJ4qZUxDf/fhOymfO2kxedzH/Bt/3J04dG3qrSB9Hjq+wXELhEBQe+DQHMRyNQyWBGAUi2b4tQJcFQX9LKXFlrBg4i+OngyL3/uOiE5gk44RAexTF02FdGd4MwCAP4KmYW4yMNIqAPDX/9QRZelbLHcvjGgMfhC1mMKz/XWyxDEORcb4aEuK9rWcXnsjGdGzjGRibUlhBYcbT6kYlIBcl4S7+jVUL7bwmb9Pwy8SW9nu1tyP2SEwWHU9ZSsOHmp40dvwygJcRxXs8sO8S0stsEjS5RshsCv5W/vplsPz/a2Krl3C6VxlS3E5fZsfrO6pKG+1G2ItXabBydgTUoG7PNIYivDED3lL6apImO2z35lBTdhYImwRDEpCxbjlNr+I5j3ucm99XxstfNbAULDAdNohxwAMHGePcdTRo9TcbP+i+R6mPpli0BoU8CM89i0xxQeZMzmoYIjbvGcJa4C94Etay45N4URyONuetl1qiProGNYHEAQZq82vQC3Rg4SYcMTnz99DDN4NuuORSyzZPmk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MI3PR04MB12438.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(1800799024)(19092799006)(366016)(376014)(7416014)(18002099003)(22082099003)(10067099003)(56012099006)(261021133027099003)(261026121527099003)(261026140227099003)(261026135527099003)(261026130827099003)(261021130227099003)(261021123027099003)(261021121427099003)(261028144727099003)(261102123227099003)(261022075727099003)(261022113327099003)(261022105027099003)(261022115727099003)(261021135927099003)(261009223027099003)(4143699003)(11063799006)(3023799007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?fJ2ahnwBezI7WQ8bq+jL2IA/JuV7VXiCOOLIapNYDilsz7Izzv/Hm6nT6PyG?= =?us-ascii?Q?OTu4a3O3xf/3vgcvmCd2nSuBwtnCeTIe7F6lux8L2notIztjn9E8j5pIHRfm?= =?us-ascii?Q?oL2i9mP2CDrlEQEqoGGVzsHFf1Bev1B4BCxZZ9qDjSkYA6/sRTP4EGMNtqGn?= =?us-ascii?Q?3lvxL4TBH7CMS5CNJSAHu6QlmmktbBnOKI5hhfw9ci2K02lWORxpjmyh/P8P?= =?us-ascii?Q?27GlfcaOH7CMY06Duh8DL+eCRuj7T932UOexZI5JxZW60bGTmttbBUaHURiD?= =?us-ascii?Q?PvWpRtVlX6UR8hGTrsyFpPOR9RMNYg2CbZ39sh+3IzN/51giK9IhYB+RYIA/?= =?us-ascii?Q?vvsIipNlNkpU4nZziDkG0xCbGjD1pmCKX+PE/OBKO1OSCBzbP5cHJOwv5F7R?= =?us-ascii?Q?A0l9Bri+MFuCOtyKDMlTjvAnIzUUJI1VGDk1AZFiaFw89XdnqRNBZPS6O68t?= =?us-ascii?Q?ZzXAS926UwrgMKma4VN8tF7ffR7BvctRYvfnFKzYCzHuMPXD1/MjFsic20vT?= =?us-ascii?Q?BMm1Zuj4Ug3z9b6VaQBnaud1yPYKykbYG8hbeEc+ljdzTTdQ7DUst8AwfINb?= =?us-ascii?Q?xv7Sapwcq6Gwmr6GXTov9VIHoZLz3pA7PhY7APFWDvAy2oVnSt2UHUCepi6B?= =?us-ascii?Q?61HkfrT9nFKltpfsW0Xu3xf4y2ji71lb0qO5X+HsaZcbRwK5A57LTfpZrwGU?= =?us-ascii?Q?in/jcMszClWYYHXMlEoiXVkmnU4U5XCgMrAiDsyA4/PU8OjT0/Dwy5sYARXi?= =?us-ascii?Q?jq4CC7aJwRz9+upbdcrmIoHfzAP9zKF4yCd4U5LcSicpnVPptnfkbWzQBsvb?= =?us-ascii?Q?FtuOc4+Ylx0EF1CWlJ+YiJ5oNTeJNMWHZVLd8VkSSudHQ96vicNOvWqYo9cj?= =?us-ascii?Q?SLRpLyMu54bQncSLIp5nj9neLdxRButnADx47ewR/71cMGYsrZmtEFvLBeS1?= =?us-ascii?Q?9bzmlwEdYyX3foQbhwvS9/wt1brRDxjpSDwUahRi1MBut1a2OiUAZJkckg7G?= =?us-ascii?Q?SRCUw7OfyemJxyGGy/KRDkdpmy6BryX2ohqOmAYmmJepcTjisd26Ai5g86Xb?= =?us-ascii?Q?Gt4Ef1TrFKqRehlF1xIlPBSnJUlgSRTcDNSFwxppyCk55fdW8N3H8MV6r/nk?= =?us-ascii?Q?EzOnXUrOgxEfZ+XD1+KdvaO3KjCo9u6G5ZsFV1WQVII3VBcbxBd2Ew+m1kyX?= =?us-ascii?Q?Dq5Yvdnzfpe8XjiN9viVB5Ac+DVdTCx81eXszPdvwPY3pAz+O+oog6k3Nc/t?= =?us-ascii?Q?8nGkV34XxaxlUxBkci+P5ZRCw4x1l2a/jSswvg870Sc2r8mTOOxF/vsM1U1f?= =?us-ascii?Q?URgeVTrCRD9fW974onM86hWUkNchYJ+Hpo2wRMkmSN+8VuRPibtJ80V3BqjA?= =?us-ascii?Q?70CZVp5mFst+x3sWji/kq4Tcf5/aCu1dblJdMx6iI8X739YMTuAJJvxUx6Yg?= =?us-ascii?Q?Slq2dEo9IPq7I3ecaO4hjJAHxryBRoLCXr5hOxnT9hC+4Kt2nFmn9ooU+xOs?= =?us-ascii?Q?ftNq3i+ZaKaM0sg6oBd8/K+MLushJ3euNjvDDZgMmqdm/o4roQbSa+U4i6yy?= =?us-ascii?Q?Wdy0Gi70039P9TK33oN2wR6Vo05Pxzl5EcTmIciFXSVDcdqoFDqaoBILqx03?= =?us-ascii?Q?n09khcs2MjA2ogilGlMZe/tmMR9v7E1VW1MhY436hbotUn4tMs45VKtsxqhC?= =?us-ascii?Q?rsqEMokXQ1RxXKlLHPO9Ab9/FPiolIs5KD29YTFNom+nfoyxRV3ClWYooPZA?= =?us-ascii?Q?KQ8YbBqweg4mGZflBptsN5mkm2IeRKs5BkoJou1w1utigXwnYHmX?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ce79c5a-7081-47d1-5489-08df50eb0fb9 X-MS-Exchange-CrossTenant-AuthSource: MI3PR04MB12438.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2026 03:11:02.3376 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vgKYdUQdNAwKHqmaw9PYD6ogizHCv/Oy0l4jjyfTnTX5rLYeNHF0d3GzaXmHeb71byXdbFX79N1smeBcIZgLtsYHmtMQRvYKtlVkOjKFD7ma0zCHWTMoaJEr7Japt139 X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10824 On Fri, Nov 27, 2026 at 01:22:01PM +0100, Andrea della Porta wrote: > The parameters info and finalextrainfo are platform specific. So drop > them by generating them within bcm2835_dma_create_cb_chain(). > > Signed-off-by: Stefan Wahren > Signed-off-by: Andrea della Porta > --- Reviewed-by: Frank Li > drivers/dma/bcm2835-dma.c | 81 +++++++++++++++++++-------------------- > 1 file changed, 39 insertions(+), 42 deletions(-) > > diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c > index 1fa7cbfe3c2d..416d9882aeb2 100644 > --- a/drivers/dma/bcm2835-dma.c > +++ b/drivers/dma/bcm2835-dma.c > @@ -305,12 +305,11 @@ static void bcm2835_dma_desc_free(struct virt_dma_desc *vd) > bcm2835_dma_free_cb_chain(container_of(vd, struct bcm2835_desc, vd)); > } > > -static void bcm2835_dma_create_cb_set_length(struct bcm2835_chan *chan, > +static bool bcm2835_dma_create_cb_set_length(struct bcm2835_chan *chan, > struct bcm2835_dma_cb *control_block, > size_t len, > size_t period_len, > - size_t *total_len, > - u32 finalextrainfo) > + size_t *total_len) > { > size_t max_len = bcm2835_dma_max_frame_length(chan); > > @@ -319,7 +318,7 @@ static void bcm2835_dma_create_cb_set_length(struct bcm2835_chan *chan, > > /* finished if we have no period_length */ > if (!period_len) > - return; > + return false; > > /* > * period_len means: that we need to generate > @@ -333,7 +332,7 @@ static void bcm2835_dma_create_cb_set_length(struct bcm2835_chan *chan, > if (*total_len + control_block->length < period_len) { > /* update number of bytes in this period so far */ > *total_len += control_block->length; > - return; > + return false; > } > > /* calculate the length that remains to reach period_length */ > @@ -342,8 +341,7 @@ static void bcm2835_dma_create_cb_set_length(struct bcm2835_chan *chan, > /* reset total_length for next period */ > *total_len = 0; > > - /* add extrainfo bits in info */ > - control_block->info |= finalextrainfo; > + return true; > } > > /** > @@ -352,7 +350,6 @@ static void bcm2835_dma_create_cb_set_length(struct bcm2835_chan *chan, > * @chan: the @dma_chan for which we run this > * @direction: the direction in which we transfer > * @cyclic: it is a cyclic transfer > - * @info: the default info bits to apply per controlblock > * @frames: number of controlblocks to allocate > * @src: the src address to assign > * @dst: the dst address to assign > @@ -360,25 +357,27 @@ static void bcm2835_dma_create_cb_set_length(struct bcm2835_chan *chan, > * @period_len: the period length when to apply @finalextrainfo > * in addition to the last transfer > * this will also break some control-blocks early > - * @finalextrainfo: additional bits in last controlblock > - * (or when period_len is reached in case of cyclic) > * @gfp: the GFP flag to use for allocation > + * @flags: the dmaengine prep flags (DMA_PREP_*) of the transfer > */ > static struct bcm2835_desc *bcm2835_dma_create_cb_chain( > struct dma_chan *chan, > enum dma_transfer_direction direction, > - bool cyclic, u32 info, > - u32 finalextrainfo, > - size_t frames, dma_addr_t src, > - dma_addr_t dst, size_t buf_len, > - size_t period_len, gfp_t gfp) > + bool cyclic, size_t frames, > + dma_addr_t src, dma_addr_t dst, > + size_t buf_len, size_t period_len, > + gfp_t gfp, unsigned long flags) > { > + struct bcm2835_dmadev *od = to_bcm2835_dma_dev(chan->device); > struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); > size_t len = buf_len, total_len; > size_t frame; > struct bcm2835_desc *d; > struct bcm2835_cb_entry *cb_entry; > struct bcm2835_dma_cb *control_block; > + u32 extrainfo = bcm2835_dma_prepare_cb_extra(c, direction, cyclic, > + false, flags); > + bool zero_page = false; > > if (!frames) > return NULL; > @@ -392,6 +391,14 @@ static struct bcm2835_desc *bcm2835_dma_create_cb_chain( > d->dir = direction; > d->cyclic = cyclic; > > + switch (direction) { > + case DMA_MEM_TO_MEM: > + case DMA_DEV_TO_MEM: > + break; > + default: > + zero_page = src == od->zero_page; > + } > + > /* > * Iterate over all frames, create a control block > * for each frame and link them together. > @@ -405,7 +412,8 @@ static struct bcm2835_desc *bcm2835_dma_create_cb_chain( > > /* fill in the control block */ > control_block = cb_entry->cb; > - control_block->info = info; > + control_block->info = bcm2835_dma_prepare_cb_info(c, direction, > + zero_page); > control_block->src = src; > control_block->dst = dst; > control_block->stride = 0; > @@ -413,10 +421,12 @@ static struct bcm2835_desc *bcm2835_dma_create_cb_chain( > /* set up length in control_block if requested */ > if (buf_len) { > /* calculate length honoring period_length */ > - bcm2835_dma_create_cb_set_length(c, control_block, > - len, period_len, > - &total_len, > - cyclic ? finalextrainfo : 0); > + if (bcm2835_dma_create_cb_set_length(c, control_block, > + len, period_len, > + &total_len)) { > + /* add extrainfo bits in info */ > + control_block->info |= extrainfo; > + } > > /* calculate new remaining length */ > len -= control_block->length; > @@ -437,7 +447,9 @@ static struct bcm2835_desc *bcm2835_dma_create_cb_chain( > } > > /* the last frame requires extra flags */ > - d->cb_list[d->frames - 1].cb->info |= finalextrainfo; > + extrainfo = bcm2835_dma_prepare_cb_extra(c, direction, cyclic, true, > + flags); > + d->cb_list[d->frames - 1].cb->info |= extrainfo; > > /* detect a size mismatch */ > if (buf_len && d->size != buf_len) > @@ -690,9 +702,6 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_dma_memcpy( > { > struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); > struct bcm2835_desc *d; > - u32 info = bcm2835_dma_prepare_cb_info(c, DMA_MEM_TO_MEM, false); > - u32 extra = bcm2835_dma_prepare_cb_extra(c, DMA_MEM_TO_MEM, false, > - true, 0); > size_t max_len = bcm2835_dma_max_frame_length(c); > size_t frames; > > @@ -704,9 +713,8 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_dma_memcpy( > frames = bcm2835_dma_frames_for_length(len, max_len); > > /* allocate the CB chain - this also fills in the pointers */ > - d = bcm2835_dma_create_cb_chain(chan, DMA_MEM_TO_MEM, false, > - info, extra, frames, > - src, dst, len, 0, GFP_KERNEL); > + d = bcm2835_dma_create_cb_chain(chan, DMA_MEM_TO_MEM, false, frames, > + src, dst, len, 0, GFP_KERNEL, 0); > if (!d) > return NULL; > > @@ -722,8 +730,6 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_slave_sg( > struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); > struct bcm2835_desc *d; > dma_addr_t src = 0, dst = 0; > - u32 info = bcm2835_dma_prepare_cb_info(c, direction, false); > - u32 extra = bcm2835_dma_prepare_cb_extra(c, direction, false, true, 0); > size_t frames; > > if (!is_slave_direction(direction)) { > @@ -746,10 +752,8 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_slave_sg( > frames = sg_nents_for_dma(sgl, sg_len, bcm2835_dma_max_frame_length(c)); > > /* allocate the CB chain */ > - d = bcm2835_dma_create_cb_chain(chan, direction, false, > - info, extra, > - frames, src, dst, 0, 0, > - GFP_NOWAIT); > + d = bcm2835_dma_create_cb_chain(chan, direction, false, frames, src, > + dst, 0, 0, GFP_NOWAIT, 0); > if (!d) > return NULL; > > @@ -765,14 +769,9 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_dma_cyclic( > size_t period_len, enum dma_transfer_direction direction, > unsigned long flags) > { > - struct bcm2835_dmadev *od = to_bcm2835_dma_dev(chan->device); > struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); > struct bcm2835_desc *d; > dma_addr_t src, dst; > - u32 info = bcm2835_dma_prepare_cb_info(c, direction, > - buf_addr == od->zero_page); > - u32 extra = bcm2835_dma_prepare_cb_extra(c, direction, true, true, > - flags); > size_t max_len = bcm2835_dma_max_frame_length(c); > size_t frames; > > @@ -823,10 +822,8 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_dma_cyclic( > * note that we need to use GFP_NOWAIT, as the ALSA i2s dmaengine > * implementation calls prep_dma_cyclic with interrupts disabled. > */ > - d = bcm2835_dma_create_cb_chain(chan, direction, true, > - info, extra, > - frames, src, dst, buf_len, > - period_len, GFP_NOWAIT); > + d = bcm2835_dma_create_cb_chain(chan, direction, true, frames, src, dst, > + buf_len, period_len, GFP_NOWAIT, flags); > if (!d) > return NULL; > > -- > 2.51.0 >