Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2930833pxy; Mon, 3 May 2021 11:08:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMntkGkfs+eCopUSJuYPMk+3ZmgLc2Apz39ZOiE1rA2LSseJ0jiopAlcyFAPUa4/7/D2Vs X-Received: by 2002:a17:906:a48:: with SMTP id x8mr2299347ejf.127.1620065303512; Mon, 03 May 2021 11:08:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620065303; cv=none; d=google.com; s=arc-20160816; b=QdwftsSa9w0SRagjtP/epaNvHErMUxmYU40G6zdWEWf6GXsmSBO9RhOTp/S4cSZ+Bt gz/T6HJIYdYrNWGu45ywJ7E9+Gi+LqXNVAGs908fqwvd02vJVAR4AKnmRKJKOnzOXkUk 5PfldXgqF4ujokOnVdIuZcHyadfXhzpgW3tXr3uqLiINgndAATqcsP5DH2/zTyMc/JXO xMh/4ed4W8pfLhmdiI0s0gx2bkx0shygWV9ZwnWLbKe31vGOKoi02LHWbXtBrFwCG8eA osSecvotzrR0nv4ZHvCskhzOlTaU+eIKoHOG+jt6PwHVzAkF60vD+2ECzl+AYzA0/o3w cHRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=2GfKc5HbfMDbWm2QHYhaWC0gAtyXPGFfJ2bpCZgheEU=; b=ueYyP61Kj434YWEv7JHfvZpsnahlnPDEvoRTsyDTPlSr/b+xuLGQoJPx8mZVs9B3h0 570cMjxu05reU4X5qcpGMnlxxXFr5ZZT2/Xe1eGqwKUqqCtojGJcXVph7RRW5Ei8A5jf Ou6LWlHAXmfuaW42+IVnThDX8f2FrZIPAbv9E/UjJvxQ9M9o/mH3R0mN+yfp7b7o0gHB /omR+BQHCzFSSPZPiPxlX71vc4fScoNUoSitoau6DGLRbJ4slZeK3iyzPowypYWc16XC 2SErqHH7LbhmB5q0nX6zdNbOf0qP7xweAM5hZUwDmaZeZNiQz07R9eQ6BrC6sujS8MAz 6DUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QTKaiUY+; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y17si8950345edw.601.2021.05.03.11.07.58; Mon, 03 May 2021 11:08:23 -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=@kernel.org header.s=k20201202 header.b=QTKaiUY+; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233869AbhECM63 (ORCPT + 99 others); Mon, 3 May 2021 08:58:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:58144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233372AbhECM6V (ORCPT ); Mon, 3 May 2021 08:58:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 40DAB611C0; Mon, 3 May 2021 12:57:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620046648; bh=kBk7Zo6+NDEgM5HfLqkU6WXN+fEI6VrFo/57ce2FUGY=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=QTKaiUY+v8C918VY0IH+nTMQxDYRYt6oL4kHbcOhNbpHlXoZvuRq7j++C8scLEChI rZHCGiSRBZ1IeoHNCC0R0lxCTcl7LaxlQlMlEXWQm5Ir5SQOwpZjI4ZnJR3v80M1lo ewf6esuaMuzWOYu8Y+S+FEZJyvrihwvyn+tzMB8caPiS4EIKSRbbxM8ZmuqENvjzHc kXXMUPob10OQ1WC5BCOZjMcyDM8uO6byATH8GLQL+ejxEoX+ONcARJeTUcBw0Nyvz7 SEqbOG8tVIr/WYwAFRyKOJ9/+7ZMK+zUisLNm3Mk2XUPaJeGUa8YgEJ0zOsvvYBteu OQJxuUYe67DHg== Subject: Re: [PATCH 51/69] dmaengine: qcom_hidma: comment platform_driver_register call To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: Phillip Potter , Vinod Koul References: <20210503115736.2104747-1-gregkh@linuxfoundation.org> <20210503115736.2104747-52-gregkh@linuxfoundation.org> From: Sinan Kaya Message-ID: <10b38be6-39e3-bfb8-743c-10227714e641@kernel.org> Date: Mon, 3 May 2021 08:57:27 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <20210503115736.2104747-52-gregkh@linuxfoundation.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/3/2021 7:57 AM, Greg Kroah-Hartman wrote: > From: Phillip Potter > > 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. > > Cc: Sinan Kaya > Cc: Vinod Koul > Signed-off-by: Phillip Potter > Signed-off-by: Greg Kroah-Hartman > --- > 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; > Acked-By: Sinan Kaya