From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A521D63D; Tue, 2 Jul 2024 17:31:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941467; cv=none; b=b2YrzZWHdhUEb7dqdl9BWWcwj2BjZpYJOTKBKtElePMZ9/yik0AzcTnmOOPAofe1HI+dJqTRW111fX2E7j8fA3rM56+kZr9anViRvolaGCzxV+GaDHZdCRijAJvreSKCpLvZ7yacX0FcfmkT5cecpZdsfFdx6oKmZI2vztDZ5+g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719941467; c=relaxed/simple; bh=zeKNxq86+JNWjFoITdv86odjRqSUz348vu9H2a9h9HI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nGeF1XSUZLxLsZyrhTNQt98LL5u26dSmcYu847PXY3XImZvUQfZZUk2mCVPK9ahxcrYwu9a9u43TZH10RePsjD2L22kqX4WEmZ/mdsA65Kxv7nD53gUNvA5bYQ0zKCvfFYfkUVuPX13vVKZ5xQAw9wdoJ+xKEyxUo89OB+Idyq8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mmf4GniU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="mmf4GniU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7855C116B1; Tue, 2 Jul 2024 17:31:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1719941467; bh=zeKNxq86+JNWjFoITdv86odjRqSUz348vu9H2a9h9HI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mmf4GniUa68AvYBMu0IToEgzyK9OKiKi3Ke55GLBJxDWG/ya9hyylZEVOJuKmB77Y LJOzJpGDDT28xhH8AjOpeMgtMpNX4dQbn6vHhMIBlwKGJl2Wj5ca1J26DvAL0x25ED QR0LqLsp0lgsnQs72PRFi8QgnTmSdSXNCYHgbWpU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Judith Mendez , David Lechner , William Breathitt Gray , Sasha Levin Subject: [PATCH 6.1 073/128] counter: ti-eqep: enable clock at probe Date: Tue, 2 Jul 2024 19:04:34 +0200 Message-ID: <20240702170228.993104239@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702170226.231899085@linuxfoundation.org> References: <20240702170226.231899085@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Lechner [ Upstream commit 0cf81c73e4c6a4861128a8f27861176ec312af4e ] 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. Fixes: f213729f6796 ("counter: new TI eQEP driver") Reviewed-by: Judith Mendez Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20240621-ti-eqep-enable-clock-v2-1-edd3421b54d4@baylibre.com Signed-off-by: William Breathitt Gray Signed-off-by: Sasha Levin --- 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 b0f24cf3e891d..4d3de4a35801f 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)) + 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); -- 2.43.0