Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3285957lfo; Mon, 23 May 2022 00:43:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkMMkBrleidQXRhKZXmgwNJ0Z2FpcvZNR/XCS8Lqyh1F5UEuN9Kllx/h3XXA4O9yaYqti0 X-Received: by 2002:a05:6a00:24c1:b0:50d:33cf:811f with SMTP id d1-20020a056a0024c100b0050d33cf811fmr22445926pfv.78.1653291819092; Mon, 23 May 2022 00:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653291819; cv=none; d=google.com; s=arc-20160816; b=d5J1Q7RIPdokfv4hmi8UvJonctwNX1la/nnknEV9GbEIhzDx6GC4ZaHypmA81SNK1z k5W5ILJOaMFtlgMcA7LvL8SiKhc1TdcAmgqdYG2Yb9gk6P0bPU73knD4Y1cVXLr1TyT2 9+KtxDDXrgb2xjLXUCNkfD7BQ0O1ru1TxNK3QSElEK8usVWx87Ly1AoKi9tuiNjYuhBV t70B0MZHLnpGRw8OmLcOKQgCPlBVhikMRn3HhwU1z5QZL6oS1v/tuu/tGKIsezYlKoT/ w+l+svkW8U6Jk8KLvnSEDCX71CU2paPmvDOAVJcsa0rZG0lkRFsCkt6O2oZbTBKISu32 WaQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=QKmUJF1anHWjOfPQl6wU+ROhTyxsa1Rv/nGtZdce0GY=; b=i9ikT3j4BYwqyc9216SkKR4pu9ceFc56PcUTnGr+D2KefvhqfGMGvP8/V6cUgjtpoN uauL3O6q70lS2r+hEWX/2Ae7XB+O47t0TDVRoSCuky1R8w4zM2+eRPi45eTLMS5iesWp f+0TMFZr023grZWFM3wB2p7+ToXQbqAJg4FWIAgqSrMTy9vVPbVjg3kmZKFNuaqLNYpA N7Ilz2HNQYOH908Q6sTDnas97FZljx7Mp1XecFRA6Y9i3CYkHtwHjOq9kQB3g1SEs8Pi HndLEs7YUW0n771tr60oNsyqVhijtEZmLFzZQIyvKXywo2oIAWB+k85V6QXjU/PIwgNF b3YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YUHoJjWZ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d2-20020a634f02000000b003c23346be2csi9674848pgb.732.2022.05.23.00.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:43:39 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YUHoJjWZ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5982952E60; Sun, 22 May 2022 23:49:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244203AbiETJCj (ORCPT + 99 others); Fri, 20 May 2022 05:02:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237101AbiETJCh (ORCPT ); Fri, 20 May 2022 05:02:37 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 662BFA5012 for ; Fri, 20 May 2022 02:02:35 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id wh22so14248179ejb.7 for ; Fri, 20 May 2022 02:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QKmUJF1anHWjOfPQl6wU+ROhTyxsa1Rv/nGtZdce0GY=; b=YUHoJjWZPLdgkjzdP8yFhlkh/fh/W2URfrIKZyDrXfA1Bbwfb3Vkeydu7AHkve/yZM K2TPKdjupVnpwoirGeGJtiabsY6Jrq3mcqM3sngTxRG62LujWuPRdYQACiNgcg6YuTK0 eZ29ANkx/HQ/SyIt0dGah38NRE5SQbWbaD6Wg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QKmUJF1anHWjOfPQl6wU+ROhTyxsa1Rv/nGtZdce0GY=; b=w5DDHj+ZZfbXUTDOPIuPFS9bNKv+lB9gIY14GmV3m2BtLzWfgWmbyOux9ANMEQ+rhe LreL/qXYnxqxKDAbvGbij5oVPSgTR6Wc0hgEf0aMnsaPYHdHDEmvdJOgrYe6PgUdlfun nGV0vHN5/iYVSomKowN4pZfVRmpJq1mL+MxIYXQ4i6W/X10w8/GO8bzeNI0eIHB5/pfd yHTfGRkX6PIIIiVekmli/uowEZKdbAd5DTOTNvROyRdv6cwWEQz5Z1Ed+Bp73VzYg8Vl nDZpwEdzJmFGAqHmtlPvdo4d0rkhk4YKcOWvlt7mPY1bGjcfw408GBiePrJHVyDXZE21 Qgow== X-Gm-Message-State: AOAM531ShP22E941w6zK2OXk6xgcPQoayh5yEX7oxp/dhe63B+FnZcpX zSAtgb5Etngozeu/LgZt1RwNM7oFbsxAkbEymhCeYg== X-Received: by 2002:a17:906:a10e:b0:6f3:e70b:b572 with SMTP id t14-20020a170906a10e00b006f3e70bb572mr7549904ejy.546.1653037353979; Fri, 20 May 2022 02:02:33 -0700 (PDT) MIME-Version: 1.0 References: <20220519134728.456643-1-y.oudjana@protonmail.com> <20220519134728.456643-4-y.oudjana@protonmail.com> <5b5f6656-8694-dc78-ef42-7ce301849aa4@collabora.com> In-Reply-To: <5b5f6656-8694-dc78-ef42-7ce301849aa4@collabora.com> From: Chen-Yu Tsai Date: Fri, 20 May 2022 17:02:22 +0800 Message-ID: Subject: Re: [PATCH 3/6] clk: mediatek: reset: Return reset data pointer on register To: AngeloGioacchino Del Regno Cc: Yassine Oudjana , Michael Turquette , Stephen Boyd , Matthias Brugger , Philipp Zabel , Yassine Oudjana , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On Fri, May 20, 2022 at 4:42 PM AngeloGioacchino Del Regno wrote: > > 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. Since Rex is working on cleaning up the reset bits, maybe also coordinate with him? > 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. I don't think they use devres at the moment. They should, but I haven't gotten that far with my improvements. *wink* > 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. I agree with moving all the drivers off of CLK_OF_DECLARE() if possible. There are definitely going to be a few ARM32 ones that can't be converted, likely because they don't have the ARM arch timer, and need a clock registered before the timers. Been there. And there's a whole lot of work to be done for all the old drivers so that they clean up after themselves. My desire is to clean up the API (the naming and the parameters) so that they more closely match up with the underlying CCF APIs they call. We can then add devres variants (and of_ ones for the unfortunate platforms that need them). > Making sure that I don't get misunderstood: > I'm not implying that this huge migration work is on your shoulders! Yeah. I'll likely take up quite a bit of it after all my currently planned cleanup work is done. Unless of course someone beats me to it. > P.S.: Chen-Yu, Miles: do you also agree? :-) Yes. Regards ChenYu