Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp376714lqp; Mon, 10 Jun 2024 06:57:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXwqapECTWuzaeHDwx5qCAqAC19WN4A2HKHWqgfLor5Cx4Sfx8U2sQp2sAnTeWb+uZavJif27sRFhzcsjWLEDC11I9mXAFH8FZ8AL85lQ== X-Google-Smtp-Source: AGHT+IHh5Z1rYsaKIrDCa0r/0jb9UUYbgmZfpilZB2Hgpx67Scp7V/lqza+vwD2a1kpKqmEJPtcH X-Received: by 2002:a17:902:da86:b0:1f4:8d7b:53d3 with SMTP id d9443c01a7336-1f6d0389123mr108685625ad.44.1718027869310; Mon, 10 Jun 2024 06:57:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718027869; cv=pass; d=google.com; s=arc-20160816; b=FEKMbLyKXHhK4HUZWZW5ZPbxcFvOjiSvvmvbZTCAzcxWhVvkjU9ykAcNCpRG/bH8RH lsVZxp9YtxuVoparLF31AnpK9GSB43ycZ3NHSQ94l0DqOFtONcZeYQ0Cg1pUSZYQqOaF 5vDOwkeZEJbO5xow/9nwv8eOqZvyZ+6sxyMUKLowL2rNpu0lv4sNDDbbdGu4EjM5yrqO GYheCZKKKrOyfQBcJiboYJeh5sn4XN/1+f8rTl/VhZAbCHXIo2o8dxvp1zy4bHHH08J5 wyjtAt8ij4fQ9bzQh/uBVeA+eMTzIkJOxLSDjWB95ctaf5g8gO3lZsPn8/LPLBmshVvO LwUA== 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=vXTNQpYiFCEGscRvW5gsaNUTZPm4hZbQ7RlNRX5SwOg=; fh=8PTiYHPD5E1q562bZaoHeSuyoSO/5vze3t6L/XSSv1Y=; b=pWbxDOetal2nYoPaPcMv7gkFlL1ItwWB4J3s15myqo8QtmB72Tt6he81Mpubr3T7Bf PjJX6x66JO4/Z+rcZlkfDZLnavzJ4Dz0pUd2CHFcgFTV9nW/ZOgV98zbzyp8mSJ7m2aV YlpwpXnovYnI1f9MeimiqUy3Yrt0KKVakZ3YJ+Q5osVUjcNH45fUnrLktaG7sUal3klj cduU86pP4+Eluyzk66/Ne3BWp5k4HpUxgA7ZFl1NxKdkBmfj9o/f/Gn/N9tLIfHbE6eg uWdenLzlgGgixjbhLoxhtJiv24BaYovtXs/+IoAkB7/mJB/fX/9ar/trOvDgKO00To4V Gmjw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Z7NC400z; 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-208283-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208283-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-1f6e1844c64si54772775ad.497.2024.06.10.06.57.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 06:57:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208283-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=Z7NC400z; 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-208283-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208283-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 948702811B3 for ; Mon, 10 Jun 2024 13:54:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A12E21581E6; Mon, 10 Jun 2024 13:44:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="Z7NC400z" Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (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 C0A04157A49; Mon, 10 Jun 2024 13:44:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718027055; cv=none; b=qp88rAj7KRZEI3yj0WMJLiwtnWqpTH0jcFWf4bxcrYqB1RNi186adkbaJNNGhgkTbd+Kd2zKXfb/npBWlunL4F+Xluo/WokZqmKjYEE+ml+fqlTIi5a2UcpF51TjKNtDzzhrOrPWaob4P62Do8l5O4iN8fwMrVwkKaiGnvJ8Tl0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718027055; c=relaxed/simple; bh=6whD5BlfPkc/QXVawZYc6zaMAcHZDXkfeq80yqWQhFI=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=EDtvC97M9ijiwUMvPqzrgzf0m4KBBeCzcsVHjZv8cTeCbcyR0mdlO24aDIA9wDtue0hEz8SdI1LTB9cG5/hhheWjp4pbDgNGbOq5gJQhwLzjOW+uTa2m10EhKkIRso/COqcLWzWIJ3fdJzK8FjaWs6olW9K714KzpMYvK4zd3eA= 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=Z7NC400z; arc=none smtp.client-ip=198.47.19.141 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 lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 45ADi9xj027827; Mon, 10 Jun 2024 08:44:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1718027049; bh=vXTNQpYiFCEGscRvW5gsaNUTZPm4hZbQ7RlNRX5SwOg=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=Z7NC400zQSneRRg3jYzLhE0gmiJObRspKLkJWwL++nI8k/PI1g/+c/gGpYkDkRaMz Wchxe/byMX/ktu2fvO+bzsnlj33JnQRGuBTPMc5wotjoDlB7iRz6x0aThj0HH5jZei 4vApvXwmgO+iPhI0fXhu4rYLp4LLBGdzHnEMkyFM= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 45ADi97k030826 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 10 Jun 2024 08:44:09 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE105.ent.ti.com (157.170.170.35) 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 08:44:08 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE105.ent.ti.com (157.170.170.35) 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 08:44:08 -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 45ADi8T7018764; Mon, 10 Jun 2024 08:44:08 -0500 Message-ID: Date: Mon, 10 Jun 2024 08:44:08 -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: <20240609-ti-eqep-enable-clock-v1-1-1e9e7626467e@baylibre.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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. ~ 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