Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp392725lqp; Mon, 10 Jun 2024 07:19:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVo2d9opJjt/D/OFTvsPc4/WK3AqE/R2z4j+jxZKVdvV3k8gZwpp45R7FafIEuNenZQATAJEcfQv0lj5x5FEaA+XGs+pCRnGwIGd113ZA== X-Google-Smtp-Source: AGHT+IGP0wWNFWu7eD2GQ4CfmhELUaJvcFB1ntVGe0kQrnbKYiERAqNv4W2LVXg+u5e2F+4Uw5bJ X-Received: by 2002:a17:903:18a:b0:1f7:195d:8e79 with SMTP id d9443c01a7336-1f7195d90ebmr22223545ad.59.1718029141415; Mon, 10 Jun 2024 07:19:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718029141; cv=pass; d=google.com; s=arc-20160816; b=sN6VvJcncSlC1JE78coaPpK5hrYOn7/SfYewOPAnnK6Cgwqz+VAlSpDZhQT+siU/hn QpADx7/nr6X12esdUs0IjMWFlQxl78xAmiyUtyuX/JzlphWpLIB26Rd4+d5J0SKFpVxZ Ug6zbaRisL7uFnm73MnE4Tgmt2dy9HlHCaNVeD7V5EAfFLg865hrXbuMntP2Cwzet8Lp sSyx/QO+vcKnNwJvTP8E4LLPhWcy+nqe5A2YSNrRpxbqiB7EFjS1PyAqfjwIz1E4ZEtx W5JVLW9yQAuGeoi7wMnbBK027vZlacPcTPxMFJu7PEkTFwqXBNtu6KakQPBxLNj/5+1o VXEg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=V/x3U3X0mcaP5gaC2fbscMMkAEeKf/QY7Cd2x5DBz6k=; fh=8PTiYHPD5E1q562bZaoHeSuyoSO/5vze3t6L/XSSv1Y=; b=mx3myqn+e4LAaiXaCF6fqqPd+elKy6dKAoSzCA9/KcHSGUJpCntMaxoIg8zhVXrZkx 6Z2MB7pO3LRwBYaPF5E+DjzkXsMlQU5kWWFJFG5j5d43JhiwUH+WGGqw8Cqdwt7b58iI RxmLKjFCHwouHm62RtOi/g+9C2QKKjLg/FBuH94s8XaEK2ktUIvbztm2FPNUJLYqe8ay f2BtRjWEA0fIMDUjqF/ks6ga6mdzi8TVsXXGjaXGl10vQ3obEzhOyUnkgEwLfGWOWf7B 4T4Nza6i0C5NimqpN+epXzndWWsnN+slo655Ds3YnejduK/iZNnrg72X8RjO1C6Sz3R+ oZjw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=UdLzdP7x; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-208343-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208343-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f721b7b1f0si5266995ad.80.2024.06.10.07.19.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 07:19:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208343-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=UdLzdP7x; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-208343-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208343-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9A9272886DF for ; Mon, 10 Jun 2024 14:12:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01B89132115; Mon, 10 Jun 2024 14:12:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="UdLzdP7x" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 658E956452; Mon, 10 Jun 2024 14:11:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718028721; cv=none; b=YW30TPSYvcydNR2m/nShhmWpyHzhrjWtyuKMr3qIAniEMYrC7382FYyAI0D2FyG4i5+1+YjL0M088nw9jD7X2/Zx8jBtBV31xsGGUPZfj3E+WyPNTolBiVoks3N+eoZO48URc+FFgwjhXwvYTQiSoE9y9TyDVK1Od8LpcvmeL40= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718028721; c=relaxed/simple; bh=HR+lksdyc5JYfCfjZIT+yqIKvZpO1Qoxls2Zl7YzbDE=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=HTvQ4wHEeUdbFRZ+U8DLh0AYHf06MTo7XFnrv/94CfyGgJQ0Lytyebw7yf6kYLNBDqZIkTQ7XUjvj6gSSEH7GrQavh4VX9El5hdq1HupOOlqZcfyswcsGDI79XEnjJSNbgcgzQoHIG+oMJBqPjb3mE+s5BazVrM3t+AlQ0fNGZc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=UdLzdP7x; arc=none smtp.client-ip=198.47.19.142 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 45AEBsI6127506; Mon, 10 Jun 2024 09:11:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1718028714; bh=V/x3U3X0mcaP5gaC2fbscMMkAEeKf/QY7Cd2x5DBz6k=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=UdLzdP7xMufku7MfzPk0J556NgUtQpPk/tD6ZJF+PaaCXsFwa2DY7PrWQlgLo6jH2 NbM8yJVtNj9T/m07/oljuI7V5uIe6X8NY5xvVq03CIR8cH8Zoia1efShGrriz00oOM 6u3eoQrQDDuEv/0SiigEqKUnQDO3o/PG5VsVFR7M= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 45AEBsbc095560 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 10 Jun 2024 09:11:54 -0500 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 10 Jun 2024 09:11:53 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 10 Jun 2024 09:11:54 -0500 Received: from [128.247.81.105] (judy-hp.dhcp.ti.com [128.247.81.105]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 45AEBsKl065670; Mon, 10 Jun 2024 09:11:54 -0500 Message-ID: <573a01e0-0954-4238-b5d6-3bb2b30ecace@ti.com> Date: Mon, 10 Jun 2024 09:11:54 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] counter: ti-eqep: enable clock at probe To: David Lechner , William Breathitt Gray CC: , References: <20240609-ti-eqep-enable-clock-v1-1-1e9e7626467e@baylibre.com> Content-Language: en-US From: Judith Mendez In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Hi David, On 6/10/24 8:53 AM, David Lechner wrote: > On 6/10/24 8:44 AM, Judith Mendez wrote: >> Hi David, >> >> On 6/9/24 3:27 PM, David Lechner wrote: >>> The TI eQEP clock is both a functional and interface clock. Since it is >>> required for the device to function, we should be enabling it at probe. >>> >>> Up to now, we've just been lucky that the clock was enabled by something >>> else on the system already. >>> >>> Signed-off-by: David Lechner >>> --- >>>   drivers/counter/ti-eqep.c | 6 ++++++ >>>   1 file changed, 6 insertions(+) >>> >>> diff --git a/drivers/counter/ti-eqep.c b/drivers/counter/ti-eqep.c >>> index 072b11fd6b32..825ae22c3ebc 100644 >>> --- a/drivers/counter/ti-eqep.c >>> +++ b/drivers/counter/ti-eqep.c >>> @@ -6,6 +6,7 @@ >>>    */ >>>     #include >>> +#include >>>   #include >>>   #include >>>   #include >>> @@ -376,6 +377,7 @@ static int ti_eqep_probe(struct platform_device *pdev) >>>       struct counter_device *counter; >>>       struct ti_eqep_cnt *priv; >>>       void __iomem *base; >>> +    struct clk *clk; >>>       int err; >>>         counter = devm_counter_alloc(dev, sizeof(*priv)); >>> @@ -415,6 +417,10 @@ static int ti_eqep_probe(struct platform_device *pdev) >>>       pm_runtime_enable(dev); >>>       pm_runtime_get_sync(dev); >>>   +    clk = devm_clk_get_enabled(dev, NULL); >>> +    if (IS_ERR(clk)) >> >> I think it would be nice to have print here in case the we fail to get >> the clock. > > Do you mean that we should call devm_clk_get() and clk_prepare_enable() > separately so that we get two different error messages? > > The dev_err_probe() below will already print a message on any error > (other that EPROBE_DEFER). Apologies, I misread. The way you have it is good, thanks. Reviewed-by: Judith Mendez > >> >> ~ Judith >> >>> +        return dev_err_probe(dev, PTR_ERR(clk), "failed to enable clock\n"); >>> + >>>       err = counter_add(counter); >>>       if (err < 0) { >>>           pm_runtime_put_sync(dev); >>> >>> --- >>> base-commit: bb3f1c5fc434b0b177449f7f73ea9b112b397dd1 >>> change-id: 20240609-ti-eqep-enable-clock-91697095ca81 >> >