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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 84B53CE7B17 for ; Thu, 28 Sep 2023 10:23:01 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=C07hz1x9; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Rx8gm1GSJz3cjk for ; Thu, 28 Sep 2023 20:23:00 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=C07hz1x9; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=145.40.68.75; helo=ams.source.kernel.org; envelope-from=vkoul@kernel.org; receiver=lists.ozlabs.org) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Rx5GT2nKyz2ytV for ; Thu, 28 Sep 2023 17:49:21 +1000 (AEST) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id D8092B81A6E; Thu, 28 Sep 2023 07:49:17 +0000 (UTC) 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?= 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> X-Mailman-Approved-At: Thu, 28 Sep 2023 20:21:23 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Geert Uytterhoeven , linux-arm-msm@vger.kernel.org, Brian Xu , "Gustavo A. R. Silva" , Paul Cercueil , Biju Das , Chen-Yu Tsai , Laxman Dewangan , Chunyan Zhang , Jernej Skrabec , Radhey Shyam Pandey , Stefan Roese , Fabio Estevam , Swati Agarwal , Alyssa Rosenzweig , Rob Herring , Peter Korsgaard , Lars-Peter Clausen , Florian Fainelli , Samuel Holland , Green Wan , Viresh Kumar , Manivannan Sadhasivam , Sinan Kaya , Ludovic Desroches , Peter Ujfalusi , Jon Hunter , Zhang Wei , Tudor Ambarus , Andy Gross , Broadcom internal kernel review list , NXP Linux Team , ye xingchen , Olivier Dautricourt , Yangtao Li , Eugeniy Paltsev , Patrice Chotard , linux-tegra@vger.kernel.org, Kees Cook , Sven Peter , Ray Jui , Sascha Hauer , Sean Wang , linux-actions@lists.infradead.org, Lad Prabhakar , Haojian Zhuang , Liu Shixin , Robert Jarzmik , linux-mediatek@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, Baolin Wang , Orson Zhai , Matthias Brugger , Raj Kumar Rampelli , Andy Shevchenko , Michal Simek , linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , Harini Katakam , Lizhi Hou , Laurent Pinchart , Scott Branden , Shawn Guo , Bjorn Andersson , Hector Martin , linux-mips@vger.kernel.org, Li Yang , Konrad Dybcio , linux-sunxi@lists.linux.dev, Thierry Reding , asahi@lists.linux.dev, kernel@pengutronix.de, Pavel Machek , dmaengine@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Andreas =?iso-8859-1?Q?F=E4rber?= , Daniel Mack , Hien Huynh Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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