public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Phillip Potter <phil@philpotter.co.uk>,
	Vinod Koul <vkoul@kernel.org>, Sinan Kaya <okaya@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sasha Levin <sashal@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org
Subject: [PATCH AUTOSEL 4.9 09/19] dmaengine: qcom_hidma: comment platform_driver_register call
Date: Mon, 24 May 2021 10:50:56 -0400	[thread overview]
Message-ID: <20210524145106.2499571-9-sashal@kernel.org> (raw)
In-Reply-To: <20210524145106.2499571-1-sashal@kernel.org>

From: Phillip Potter <phil@philpotter.co.uk>

[ Upstream commit 4df2a8b0ad634d98a67e540a4e18a60f943e7d9f ]

Place a comment in hidma_mgmt_init explaining why success must
currently be assumed, due to the cleanup issue that would need to
be considered were this module ever to be unloadable or were this
platform_driver_register call ever to fail.

Acked-By: Vinod Koul <vkoul@kernel.org>
Acked-By: Sinan Kaya <okaya@kernel.org>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210503115736.2104747-52-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/dma/qcom/hidma_mgmt.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/dma/qcom/hidma_mgmt.c b/drivers/dma/qcom/hidma_mgmt.c
index 82f36e466083..143ea7cad756 100644
--- a/drivers/dma/qcom/hidma_mgmt.c
+++ b/drivers/dma/qcom/hidma_mgmt.c
@@ -398,6 +398,20 @@ static int __init hidma_mgmt_init(void)
 		of_node_put(child);
 	}
 #endif
+	/*
+	 * We do not check for return value here, as it is assumed that
+	 * platform_driver_register must not fail. The reason for this is that
+	 * the (potential) hidma_mgmt_of_populate_channels calls above are not
+	 * cleaned up if it does fail, and to do this work is quite
+	 * complicated. In particular, various calls of of_address_to_resource,
+	 * of_irq_to_resource, platform_device_register_full, of_dma_configure,
+	 * and of_msi_configure which then call other functions and so on, must
+	 * be cleaned up - this is not a trivial exercise.
+	 *
+	 * Currently, this module is not intended to be unloaded, and there is
+	 * no module_exit function defined which does the needed cleanup. For
+	 * this reason, we have to assume success here.
+	 */
 	platform_driver_register(&hidma_mgmt_driver);
 
 	return 0;
-- 
2.30.2


  parent reply	other threads:[~2021-05-24 15:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24 14:50 [PATCH AUTOSEL 4.9 01/19] platform/x86: hp_accel: Avoid invoking _INI to speed up resume Sasha Levin
2021-05-24 14:50 ` [PATCH AUTOSEL 4.9 02/19] serial: max310x: unregister uart driver in case of failure and abort Sasha Levin
2021-05-24 14:50 ` [PATCH AUTOSEL 4.9 03/19] net: fujitsu: fix potential null-ptr-deref Sasha Levin
2021-05-24 14:50 ` [PATCH AUTOSEL 4.9 04/19] net: caif: remove BUG_ON(dev == NULL) in caif_xmit Sasha Levin
2021-05-24 14:50 ` [PATCH AUTOSEL 4.9 05/19] char: hpet: add checks after calling ioremap Sasha Levin
2021-05-24 14:50 ` [PATCH AUTOSEL 4.9 06/19] ALSA: sb8: Add a comment note regarding an unused pointer Sasha Levin
2021-05-24 14:50 ` [PATCH AUTOSEL 4.9 07/19] isdn: mISDNinfineon: check/cleanup ioremap failure correctly in setup_io Sasha Levin
2021-05-24 14:50 ` [PATCH AUTOSEL 4.9 08/19] ath6kl: return error code in ath6kl_wmi_set_roam_lrssi_cmd() Sasha Levin
2021-05-24 14:50 ` Sasha Levin [this message]
2021-05-24 14:50 ` [PATCH AUTOSEL 4.9 10/19] libertas: register sysfs groups properly Sasha Levin
2021-05-24 14:50 ` [PATCH AUTOSEL 4.9 11/19] media: dvb: Add check on sp8870_readreg return Sasha Levin
2021-05-24 14:50 ` [PATCH AUTOSEL 4.9 12/19] media: gspca: mt9m111: Check write_bridge for timeout Sasha Levin
2021-05-24 14:51 ` [PATCH AUTOSEL 4.9 13/19] media: gspca: properly check for errors in po1030_probe() Sasha Levin
2021-05-24 14:51 ` [PATCH AUTOSEL 4.9 14/19] cdrom: gdrom: initialize global variable at init time Sasha Levin
2021-05-24 14:51 ` [PATCH AUTOSEL 4.9 15/19] scsi: BusLogic: Fix 64-bit system enumeration error for Buslogic Sasha Levin
2021-05-24 14:51 ` [PATCH AUTOSEL 4.9 16/19] openrisc: Define memory barrier mb Sasha Levin
2021-05-24 14:51 ` [PATCH AUTOSEL 4.9 17/19] btrfs: do not BUG_ON in link_to_fixup_dir Sasha Levin
2021-05-24 14:51 ` [PATCH AUTOSEL 4.9 18/19] platform/x86: intel_punit_ipc: Append MODULE_DEVICE_TABLE for ACPI Sasha Levin
2021-05-24 14:51 ` [PATCH AUTOSEL 4.9 19/19] drm/amdgpu: Fix a use-after-free Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210524145106.2499571-9-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=okaya@kernel.org \
    --cc=phil@philpotter.co.uk \
    --cc=stable@vger.kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox