From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF2DBC352A5 for ; Mon, 10 Feb 2020 17:56:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C92502080C for ; Mon, 10 Feb 2020 17:56:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QQHrVR7j" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727570AbgBJR4A (ORCPT ); Mon, 10 Feb 2020 12:56:00 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:51162 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726950AbgBJRz7 (ORCPT ); Mon, 10 Feb 2020 12:55:59 -0500 Received: by mail-pj1-f65.google.com with SMTP id r67so78630pjb.0; Mon, 10 Feb 2020 09:55:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=hc6rF8tlHFAsqTDsCihq67MPiEh5lF+F1GiLZq84Qik=; b=QQHrVR7jLfmXoJ0ywI0mYNlYQWcb/iYz7I3/ygJ/2w3i11LF0T04GYV+yN83LFgvc1 kC/Z8mr4ZhJeNSsVBIJTjRYVXKlx6OU387B97X4+Vki880RQrvnKL4vL+/nkrTfK521k WM55qs6WP44XuuN+nhU6+cZlaf2RY9yglzCmZa4tm2eP6TAaiigJt84qfDxJ8KBwg/tL 7DUc1Qw4LXsn4fVeEQN+yORgH0/M89rKBeZJ4VvfK2qORWRBNuN6LfBFGWIGB4HV4Gr3 1HBECqnSzho4IMaUZKj43ijLo3WMNT+xn5PKHEZZOg1nhN3aQHQ925ac15HmnKIgP81w OdqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=hc6rF8tlHFAsqTDsCihq67MPiEh5lF+F1GiLZq84Qik=; b=WDy4MO5hAMMQ6doQAbSbo6m1S/sofq/znEJUyWUIiq3t4u0P1fJ0PlAMQMgPUsi9Vs juBZy2wenlVveONHX8F+Br2ooByp/Y20KUHWnP7S7U+tO45+xGqUDS8go8A07lqrlkma yp4cnWTmdE3a5DRyLSHjTgJs58olYCc3CjKx9vUwtIf+4HcMdYrRy6X/9dUe0/HH9+di Y2sApLPNwL+c9aypm/WqrPzNTwFb+nk46nJG5E9ByOHgivgBA0BhjdcWiKXlYPUSfB+c O7r3cYnLtU2kDiF7gxtc9v0KvsMkZlfGOFCU+C7k39ULAQuhXldLjLrZQBYqQo8ewlM0 X15Q== X-Gm-Message-State: APjAAAXcZpTrhWEcyi+yaoqfxtDGcx1eOyMhXBAmbi71sslKnr4+KaW5 TKPXdgl32Q0C73HYelL9sp3Jj+ng X-Google-Smtp-Source: APXvYqy0avjAeGUBKACUW6Emn643XOzeKfGaF9sv6cHS63WgyqpQ0N7h27veZbjutko2+st5x44zXQ== X-Received: by 2002:a17:902:694b:: with SMTP id k11mr13918876plt.334.1581357358837; Mon, 10 Feb 2020 09:55:58 -0800 (PST) Received: from dtor-ws ([2620:15c:202:201:3adc:b08c:7acc:b325]) by smtp.gmail.com with ESMTPSA id c11sm1004540pfo.170.2020.02.10.09.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Feb 2020 09:55:57 -0800 (PST) Date: Mon, 10 Feb 2020 09:55:54 -0800 From: Dmitry Torokhov To: Horia Geanta Cc: Robin Gong , =?iso-8859-1?Q?Andr=E9?= Draszik , "linux-kernel@vger.kernel.org" , Anson Huang , Aymen Sghaier , Herbert Xu , "David S. Miller" , Rob Herring , Mark Rutland , "linux-crypto@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-input@vger.kernel.org" , dl-linux-imx Subject: Re: [PATCH 2/3] Input: snvs_pwrkey - enable snvs clock as needed Message-ID: <20200210175554.GB199269@dtor-ws> References: <20200130204516.4760-1-git@andred.net> <20200130204516.4760-2-git@andred.net> <20200209223836.GA199269@dtor-ws> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 10, 2020 at 06:33:30AM +0000, Horia Geanta wrote: > On 2/10/2020 4:03 AM, Robin Gong wrote: > > On 2020/02/10 Dmitry Torokhov wrote: > >> On Fri, Feb 07, 2020 at 08:10:22AM +0000, Horia Geanta wrote: > >>> On 1/30/2020 10:45 PM, André Draszik wrote: > >>>> @@ -140,6 +148,25 @@ static int imx_snvs_pwrkey_probe(struct > >> platform_device *pdev) > >>>> if (pdata->irq < 0) > >>>> return -EINVAL; > >>>> > >>>> + pdata->clk = devm_clk_get(&pdev->dev, "snvs-pwrkey"); > >>>> + if (IS_ERR(pdata->clk)) { > >>>> + pdata->clk = NULL; > >>> Using devm_clk_get_optional() would simplify error handling. > >> > >> It sounds to me that this clock is not at all optional and the driver currently > >> "works" only by accident and therefore optional is not suitable here. > > Yes, then we need to add all snvs clk in dts for on legacy i.MX chips in this patchset > > to avoid any potential function broken. How many are there? I am not too terribly opposed of having the driver handle missing clk if there are very many legacy DTSes out there. But then we need to handle it properly (i.e. current iteration does not handle referral properly for example). > In that case the DT binding should be updated too, > to make the clock mandatory. I think this should be done in either case, as as far I understand the part can not function without the clock and it worked purely by chance on some systems as something else was turning the clock on. Thanks. -- Dmitry