Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1439276ybk; Sat, 16 May 2020 11:20:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxScacl8DeRX2ncQeknweMYE1L1LPkbvAc9G1dA/bLbYiboPcX5yUNoJkEwR0ZwbsHO4xPd X-Received: by 2002:a17:906:b348:: with SMTP id cd8mr2934615ejb.139.1589653227579; Sat, 16 May 2020 11:20:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589653227; cv=none; d=google.com; s=arc-20160816; b=m1Ciytp7OyV72lQoFMIcorVbvlufH+UBJMX2I006Ed9ipjyDvwyC7Y/s/a4GQYReXv fPSb8/1BuAntZLyn6S1kb4nJZcB99bq0cgDjL/TfmxBnCBjlksEWPORdc8iUgihTIShM EcANh+SG9FU4Vth+ncKrtOxavgYX5Pm+XwJgvFbxuRpk4uZ8bblL//Oz7AnPh9KgFv2R zEb9Cn/exidhD/rGKJtOeuHF+AlqZW3PqfHvShRlQ7c+VY7TRS5M7S2d5bOdXA+OgJWz tRPJMq76yzZfnurmQIF49eI57W2Yb43fwG8n+4YS3AlCa+xMH4gvQOcElSyxZ/16Z/Wu OYxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=51NZmWw8OgodGFU6Kwk+1cHIUOclm2JMHWgqoLAcNto=; b=xy1+7s2+rN4RvGEh8r7bm4/T8Fj6+kyVRFSJSQmMLqh5BZBDgvoK8bvUdiOP8r1CIM 4mT0S7e/R0l/JK/TyaFziLsydHKeXYm6OTHZFg9vLmMed0Npiq+dzMzXAXbrK+qewZnb RZP8sm6FIVNXrOgLTmuNpL3G+/e94HrMTCmKWq6qunEH6dk8jUOdhBP0EYEgCJz3Z62y soelO7fzr0J1DiIXQK+d/QqnDzsnCPFuxJq5SqG65R0blA54MdFDkEI08oqB4kGQmXnx AHZPvSvYdIMwn5WE5XGyGN/TiiNdMgP7s1R1Q1KLu5JxEVqvTwh0nVJfu4xPyITYtpy/ RWsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=vdVL1oGO; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s23si3384609edr.581.2020.05.16.11.20.04; Sat, 16 May 2020 11:20:27 -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=@googlemail.com header.s=20161025 header.b=vdVL1oGO; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726528AbgEPSSs (ORCPT + 99 others); Sat, 16 May 2020 14:18:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726341AbgEPSSr (ORCPT ); Sat, 16 May 2020 14:18:47 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 962F0C061A0C; Sat, 16 May 2020 11:18:47 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id s3so5190865eji.6; Sat, 16 May 2020 11:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=51NZmWw8OgodGFU6Kwk+1cHIUOclm2JMHWgqoLAcNto=; b=vdVL1oGOOCFNBnvnlLIFS59MY8Zba5m/lomLUqa2xGj9MprTK15U9qOHtzZVZGXMki SRN/aRKYtdCByVFzAojZ+XpUchGlaufRsvLH4w6QYnpoIB/13LLwh0DXVQoOqvTKRRc+ groVxEd9/Nw5xIgB34HgKy0XZB57mqx0iKOZoknX88EYycJCqcjl6FFL65siJsJFwWBV ikUNwN8YdC3l8It0+L9bzbGKXcWn+1BxDWPaCZHuQTwjhGfv0C9oetzA7JqSfdkfwptx U5aI2RX6UfOokaz6JXDSAZ4VjK+i5BYcIyMe3aAH740tOG3iGlR0vf0ebzASP4lDZcVa m9CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=51NZmWw8OgodGFU6Kwk+1cHIUOclm2JMHWgqoLAcNto=; b=Sx2/47ggQg/wnsWIU7LxmkQNl90UFW1bBbNbE8s/NfdW/dykVdowIzXIsHieLb79m2 SCXGBb3K12X2Y2SoxW8fysbXUcvBA8gesY56yIGd03gaLSRcPg4NkW/y4/Eb+dnKY+vz zHTmhihV4w+E/KJIO/4XVPA1pk2EvTXazXncW5S9WBrhUttdO/IrpU69SbyNDvwmVdV9 Vun3UwNmkJL3jMLwOJqW2f6rrHVTC0ORrZ25bSiwOXnb6YzzauYz4aTkKAyN9ttTNyb9 JgwZAlJx8sqTvwN2zgay5vmRNgLKcZeFkIBDPWAEpppNE8cfcN6WkBF/x8wR42TjatZZ ZLsw== X-Gm-Message-State: AOAM531wS/t7mMilV7eyANQwZRpbg/tAUwtdLZU3I7zzEhJO22009Qbp nLdZVocB9j8PRIFUVGnKdzSZyV1gsvtBAkMAj9M= X-Received: by 2002:a17:906:ca14:: with SMTP id jt20mr7861078ejb.233.1589653126099; Sat, 16 May 2020 11:18:46 -0700 (PDT) MIME-Version: 1.0 References: <158948864581.215346.7236327959062539884@swboyd.mtv.corp.google.com> In-Reply-To: <158948864581.215346.7236327959062539884@swboyd.mtv.corp.google.com> From: Martin Blumenstingl Date: Sat, 16 May 2020 20:18:35 +0200 Message-ID: Subject: Re: clk_hw.init and -EPROBE_DEFER / driver re-load To: Stephen Boyd Cc: linux-clk@vger.kernel.org, mturquette@baylibre.com, linux-kernel@vger.kernel.org, jbrunet@baylibre.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stephen, On Thu, May 14, 2020 at 10:37 PM Stephen Boyd wrote: [...] > Do you have some sort of array of clk_hw pointers to register? Maybe we > could make a new clk registration structure to simplify this for users, > but I'm not super interested in introducing yet another registration > API! :/ > > struct clk_hw_desc { > struct clk_hw *hw; > struct clk_init_data *init; > }; I could make an array of clk_hw pointers but I think it will make things more complicated then they have to be. In another version of my MMC controller patches I had a dedicated array of clk_init_data: [0] compare this with the latest version (which has made it to linux-next yesterday) where I'm initializing all clocks inside a few functions (meson_mx_sdhc_register_clkc, rather than a static table): [1] it's not great because it means I can't use a loop to register everything. but it's fairly easy to read so I think it's the best I can do for now. With the "solution" from [1] I also don't run into the issue which I described in my original mail because now clk_init_data only exists on the stack. I'm not sure if this is a recurring pattern or not, but for now I feel like a new API is not needed. Thank you for your time, Martin [0] https://patchwork.kernel.org/patch/11515631/ [1] https://patchwork.kernel.org/patch/11543939/