Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1003143ioo; Sun, 22 May 2022 00:05:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6rWMc1xP5Jje1wLKarQBr17iq5x2CvHjJPerDoORS+F1J6rZdA8UNBiKiv407H/oQjuYU X-Received: by 2002:a05:6a00:be1:b0:518:86d3:4f93 with SMTP id x33-20020a056a000be100b0051886d34f93mr5177512pfu.35.1653203140772; Sun, 22 May 2022 00:05:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653203140; cv=none; d=google.com; s=arc-20160816; b=hT7RFNcReiVelHgCbtXfTvV6/Q/z5ouL81vnn4kijg4VupK5EpkgfEuWYwclmyKnBy uc1rV26WPY/3ycL2Cl3PWZpsgUFsbclvvLcFlmhziNsDJhHtfzgeSFFsK7zX8Xu0KgmG lWmRAKklxz0A+Ej2li9XJF/eMDjzqB7tD5RJ9bs3IGxdabyoNe5z/HOmblHdbpqt0wIE V+aQ/cx3psnLhGxwW4FyptgcYgG/8/xNejHBXu18skYFT8a3D3W3ZN6OrSCFt80+V5OD WGC1w896LQXro3DupyRkV5JX6Pkgzx0WP5S3vNLUNNjrm79/rPQYba8sy0LTFZnmogsH /New== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Nrv0Iiza1LmN7qqcdKq2k27BTitLX3r14UyxxcPN8LM=; b=N5KO2A3n5W41oqcKZzOlGQs1VoURzd8plP1THx7cvYfK1QL66G0i8HbNKI2e5DLT35 c0j7/lLZ80AETUcHqOIjvj3t8W8Oy2FKs6r6xoha1dhH9lweTUr1TdDHTa+X6vPVwIb9 erb8su8NkN3pw3YYzKnhTfY8oKYMa7r+o9Z8i0NZfclVBOV4EBhRM0799b0pyAzRP8bL cmQSdBvP+cDUlYRexsqoi3Z69jh1cjHQW4AdDSFxDfzH1rL7HK2+SQN3x/zOvwqN5Dcy eYoUwTBLbWFHihQ9JnZsaoO0ndY5ARsbPrhXHE4hIY1iRPETzVnYJf1e53rlj1yeQJrC /2cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=CKGNnBlz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pc18-20020a17090b3b9200b001dff2cac583si11906059pjb.75.2022.05.22.00.05.20; Sun, 22 May 2022 00:05:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=CKGNnBlz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347163AbiETImu (ORCPT + 99 others); Fri, 20 May 2022 04:42:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347309AbiETImr (ORCPT ); Fri, 20 May 2022 04:42:47 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AC2D55485; Fri, 20 May 2022 01:42:45 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id 60EF21F43F56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1653036164; bh=VV7uxDN1Imb56z7LKukCJYplYNlWvJ/o/kgUG//vB80=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=CKGNnBlz4UxZuDv7oD+pHQm7jL3iCcv8u3ytZdgZt3UxC7Kn+CH4sbiXcbZSkW6zk pp2ICEZD6VK0NzUkAbammKLfF42VOFCJusfNoIre8ZI3iQVTxKirFr/vrjwl67dqPg GHIBJtyzT9A01nFU+FpgxyZ/4E8BrF/LtizIvVHejrd608DjOsCgioQ1l+XEKNOT+j 8UnYE5WsOQ6PN+uj2YiLL06m/9WTm7u+ow0CJzC+MTx23OJlMxvVOnwo/rIxhCkaHR DD/JBHD04El4FpremJNnmTaH1ZYufM51vARbL03EBZhaV+MWvPwjPUgby88kldwWE7 ycqmpMXjAqvdA== Message-ID: <5b5f6656-8694-dc78-ef42-7ce301849aa4@collabora.com> Date: Fri, 20 May 2022 10:42:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH 3/6] clk: mediatek: reset: Return reset data pointer on register Content-Language: en-US To: Yassine Oudjana , Michael Turquette , Stephen Boyd , Matthias Brugger , Philipp Zabel Cc: Yassine Oudjana , Chen-Yu Tsai , Miles Chen , Chun-Jie Chen , =?UTF-8?B?Sm9zw6kgRXhww7NzaXRv?= , Rex-BC Chen , linux-mediatek@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht References: <20220519134728.456643-1-y.oudjana@protonmail.com> <20220519134728.456643-4-y.oudjana@protonmail.com> From: AngeloGioacchino Del Regno In-Reply-To: <20220519134728.456643-4-y.oudjana@protonmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 19/05/22 15:47, Yassine Oudjana ha scritto: > From: Yassine Oudjana > > Return a struct mtk_clk_rst_data * when registering a reset > controller in preparation for adding an unregister helper > that will take it as an argument. Make the necessary changes > in drivers that do not currently discard the return value > of register functions. > > Signed-off-by: Yassine Oudjana Hello Yassine, Thanks for your efforts on helping to make the MediaTek clocks better - I agree (and I'm not the only one..) that there's a lot of work to do on this side. Though... I don't think that this is the right direction: you're right about properly unregistering (in patch 4/6) the reset controllers on rmmod/failure but I'm not sure that this kind of noise brings any benefit. Explaining: You definitely saw that there's a new register _with_dev, which uses devm ops and that's going to automatically cleanup in case of removal/failure. This is what we should do. Hence, my proposal is to drop patch 3/6, 4/6, 5/6 and (slowly, steadily) migrate all of the MediaTek clocks from CLK_OF_DECLARE() to platform drivers (which also means that we can eventually change them to tristate!), so that we slowly remove all users of all functions that are not "_with_dev", and that we finally remove all of these then-unused functions as well. Making sure that I don't get misunderstood: I'm not implying that this huge migration work is on your shoulders! P.S.: Chen-Yu, Miles: do you also agree? :-) Cheers, Angelo