Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2704428pxj; Mon, 31 May 2021 08:39:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtQec5h/sGQjSuudYCRbNymPe8uaI7bOCrmNMdp8lUyfuTSHTbVjLDQtBWTDjex/fJk1Od X-Received: by 2002:a02:b897:: with SMTP id p23mr9095513jam.71.1622475597597; Mon, 31 May 2021 08:39:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622475597; cv=none; d=google.com; s=arc-20160816; b=ohcLjmxkrIjS2ZnKVy1CMI0wTbL/wiJZqZCx70alDgO1Gm2DqvYFesK/5j7tQhnLv7 0I9JRURT/07EAOL99oTNx3yrMslNqUWeRz8lglKnjYOXQ2fBXtXxH0GfRyEiiYdgEqWX 76t6N9NH6eBV0bEYdM8h+4HpPR6ZszNkAOXO76j/Uk5lL10zE81gWc6Gl1y9Vu22Jwwm w1wikegARKvT9ofrQbtlYUqtNi2xm5vOqIt/M/FcI7KMezwbmLJL3ijEn+4vdJbgyxIB 9cY4zOKXEuuJNpNEFfH11TLHXRz9KI3GqiABt4OD0XLLIHV0Z7JoiDVZAulDPDI8+kq9 eUGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Yw+3IIwia+EXI/HGd0RtUonfAeCjrLjFGQK6psIZfrc=; b=yaA6XEI9oQfm/w7aHWlnQL9ntllnueQ2z02IHVW8W9SIZk+/ld1uQPZlC9uMyKB5jq IltBSNqDOI/dInxXAdy+3IgF6tdxAoN36e91+PTBh+KB5qjxpUHsmV4floEwYhAqkMHn 7VfKg7Vg1zPrRcSAlobWGCU+VtQ5ATf7TL9le9XOtMimkPnhhprsc/NNEEilAdSl/z0j INn81SPI5dYGDE8EyLwMYQPmB2OE1UBO1KwpmX+mMtmtM/drFhvs1WXcJcN5mE7ZEpMg TDlSVrQMhVArVlVXiJoYabgle3tm0tST0iuC42cDPaMWi6Ar3Iau0xT6FCqSiaP6OLP6 8HMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y2rmouE1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s9si13055079jat.121.2021.05.31.08.39.44; Mon, 31 May 2021 08:39:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y2rmouE1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234960AbhEaPkg (ORCPT + 99 others); Mon, 31 May 2021 11:40:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:48844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232905AbhEaOXY (ORCPT ); Mon, 31 May 2021 10:23:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 32C0A61418; Mon, 31 May 2021 13:45:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468737; bh=FjffVfX7ZHBpMoEV5UGia/iEkAw5C7P7xXuBqUhqT+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y2rmouE15oqI27OD+mhszOjkz4taK1/7Zg9nDUKDLATsrrrMaEDP0Lrl5Pe+q2Y8U C5SfRDaxm/kwxoNU3xhLqvXXYKo5oukkbp04kvBwXUVpH7Pp7CTsqk2rIAWIsrqQhu WSfnstd2UitNPsLs4L8r3+5xlSQClVqykJZjgjXQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vinod Koul , Sinan Kaya , Phillip Potter , Sasha Levin Subject: [PATCH 5.4 108/177] dmaengine: qcom_hidma: comment platform_driver_register call Date: Mon, 31 May 2021 15:14:25 +0200 Message-Id: <20210531130651.640740130@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Phillip Potter [ 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 Acked-By: Sinan Kaya Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210503115736.2104747-52-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- 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 fe87b01f7a4e..62026607f3f8 100644 --- a/drivers/dma/qcom/hidma_mgmt.c +++ b/drivers/dma/qcom/hidma_mgmt.c @@ -418,6 +418,20 @@ static int __init hidma_mgmt_init(void) hidma_mgmt_of_populate_channels(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