From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B202CE7B08 for ; Thu, 28 Sep 2023 07:49:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231144AbjI1HtU (ORCPT ); Thu, 28 Sep 2023 03:49:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230450AbjI1HtT (ORCPT ); Thu, 28 Sep 2023 03:49:19 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E151997; Thu, 28 Sep 2023 00:49:17 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87A57C433C8; Thu, 28 Sep 2023 07:49:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695887357; bh=Gs6aFP7wkoeloUPjh3P+7ZqWXKrUV+lmRvPOXvjf8Ds=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=C07hz1x9ZBOot13NmBg/w+8/7UOMHZqam5kdmBhRs0FIMx+p817yeI0/AwYqADdFf LyROsByfc7udfgvzO+iVFxt40scEHqiTsEuBV2anPvz2pvOqA5rNaglngGFVYkDqNi 8llzR1bKPikKnXdUU/UiExt0M1sNhonfI2Tg9VWZ4Ep2jjWHYlWMlubIYLpGAoPemh /llBuONh0YVRMZh24Aia4Qvo0KfHmtLVm+XDoqoKF4CTK02whHvixcoVQ+egWgMk7x FTO4SCB3n9ecoNHU2OdnjDnT9Gq59BrqP6Jgw3zOEG+2pLxraJj4zpxQ8BtWBKRvcG KuqZYg3uAID5g== Date: Thu, 28 Sep 2023 13:19:13 +0530 From: Vinod Koul To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Olivier Dautricourt , Stefan Roese , dmaengine@vger.kernel.org, kernel@pengutronix.de, Hector Martin , Sven Peter , Alyssa Rosenzweig , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Ludovic Desroches , Tudor Ambarus , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden , linux-rpi-kernel@lists.infradead.org, Rob Herring , Lars-Peter Clausen , Paul Cercueil , linux-mips@vger.kernel.org, Eugeniy Paltsev , Viresh Kumar , Andy Shevchenko , Li Yang , Zhang Wei , linuxppc-dev@lists.ozlabs.org, Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , linux-mediatek@lists.infradead.org, Andreas =?iso-8859-1?Q?F=E4rber?= , Manivannan Sadhasivam , linux-actions@lists.infradead.org, ye xingchen , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, Sinan Kaya , Green Wan , Kees Cook , "Gustavo A. R. Silva" , Biju Das , Geert Uytterhoeven , Lad Prabhakar , Pavel Machek , Hien Huynh , Yangtao Li , Peter Ujfalusi , Jernej Skrabec , Orson Zhai , Baolin Wang , Chunyan Zhang , Patrice Chotard , Chen-Yu Tsai , Samuel Holland , linux-sunxi@lists.linux.dev, Laxman Dewangan , Jon Hunter , Thierry Reding , linux-tegra@vger.kernel.org, Lizhi Hou , Brian Xu , Raj Kumar Rampelli , Michal Simek , Radhey Shyam Pandey , Peter Korsgaard , Liu Shixin , Laurent Pinchart , Harini Katakam , Swati Agarwal Subject: Re: [PATCH 00/59] dma: Convert to platform remove callback returning void Message-ID: References: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org On 19-09-23, 15:31, Uwe Kleine-König wrote: > Hello, > > this series convert nearly all platform drivers below drivers/dma to use > .remove_new(). The motivation is to get rid of an integer return code > that is (mostly) ignored by the platform driver core and error prone on > the driver side. I have applied this, with change of subsystem to dmaengine: xxx > > See commit 5c5a7680e67b ("platform: Provide a remove callback that > returns no value") for an extended explanation and the eventual goal. > > There are 4 drivers I didn't convert in this series: > > drivers/dma/milbeaut-hdmac.c > drivers/dma/milbeaut-xdmac.c > drivers/dma/uniphier-mdmac.c > drivers/dma/uniphier-xdmac.c > > These all might return early in .remove() if dmaengine_terminate_sync() > fails. I only looked deeper into the first one, and this shows exactly > the error that is easy to make with .remove() returning an int: When > returning early from .remove(), some cleanup (here: > dma_async_device_unregister()) is skipped. So the dma device stays > known, but the device is still unregistered and the devm allocated stuff > (here e.g. *mdev) is freed. So it can probably easily happen, that > something tries to use the dma device and this will likely result in an > oops. We should convert these too, thanks for your work for the conversion -- ~Vinod