From: Sasha Levin <sashal@kernel.org>
To: David Laight <David.Laight@ACULAB.COM>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
Colin Ian King <colin.king@canonical.com>,
Inki Dae <inki.dae@samsung.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH AUTOSEL 5.2 51/59] drm/exynos: fix missing decrement of retry counter
Date: Sat, 17 Aug 2019 21:47:54 -0400 [thread overview]
Message-ID: <20190818014754.GE1318@sasha-vm> (raw)
In-Reply-To: <2ecde45912fc44b88df2ff5129b8ab67@AcuMS.aculab.com>
On Wed, Aug 07, 2019 at 08:49:52AM +0000, David Laight wrote:
>From: Sasha Levin
>> Sent: 06 August 2019 22:33
>>
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> [ Upstream commit 1bbbab097a05276e312dd2462791d32b21ceb1ee ]
>>
>> Currently the retry counter is not being decremented, leading to a
>> potential infinite spin if the scalar_reads don't change state.
>>
>> Addresses-Coverity: ("Infinite loop")
>> Fixes: 280e54c9f614 ("drm/exynos: scaler: Reset hardware before starting the operation")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> Signed-off-by: Inki Dae <inki.dae@samsung.com>
>> Signed-off-by: Sasha Levin <sashal@kernel.org>
>> ---
>> drivers/gpu/drm/exynos/exynos_drm_scaler.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c
>> index ec9c1b7d31033..8989f8af716b7 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c
>> @@ -94,12 +94,12 @@ static inline int scaler_reset(struct scaler_context *scaler)
>> scaler_write(SCALER_CFG_SOFT_RESET, SCALER_CFG);
>> do {
>> cpu_relax();
>> - } while (retry > 1 &&
>> + } while (--retry > 1 &&
>> scaler_read(SCALER_CFG) & SCALER_CFG_SOFT_RESET);
>> do {
>> cpu_relax();
>> scaler_write(1, SCALER_INT_EN);
>> - } while (retry > 0 && scaler_read(SCALER_INT_EN) != 1);
>> + } while (--retry > 0 && scaler_read(SCALER_INT_EN) != 1);
>>
>> return retry ? 0 : -EIO;
>
>If the first loop hits the retry limit the second loop won't be right
>and the final return value will be 0.
This looks like an upstream problem as well, no?
--
Thanks,
Sasha
prev parent reply other threads:[~2019-08-18 1:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190806213319.19203-1-sashal@kernel.org>
2019-08-06 21:32 ` [PATCH AUTOSEL 5.2 22/59] drm/bridge: lvds-encoder: Fix build error while CONFIG_DRM_KMS_HELPER=m Sasha Levin
2019-08-06 21:32 ` [PATCH AUTOSEL 5.2 23/59] drm/bridge: tc358764: Fix build error Sasha Levin
2019-08-06 21:32 ` [PATCH AUTOSEL 5.2 29/59] drm/amdkfd: Fix byte align on VegaM Sasha Levin
[not found] ` <20190806213319.19203-1-sashal-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2019-08-06 21:32 ` [PATCH AUTOSEL 5.2 30/59] drm/amd/powerplay: fix null pointer dereference around dpm state relates Sasha Levin
2019-08-06 21:32 ` [PATCH AUTOSEL 5.2 32/59] drm/amdgpu: fix a potential information leaking bug Sasha Levin
2019-08-06 21:32 ` [PATCH AUTOSEL 5.2 31/59] drm/amdgpu: fix error handling in amdgpu_cs_process_fence_dep Sasha Levin
2019-08-06 21:32 ` [PATCH AUTOSEL 5.2 37/59] drm/vgem: fix cache synchronization on arm/arm64 Sasha Levin
2019-08-06 22:45 ` Rob Clark
2019-08-18 1:45 ` Sasha Levin
2019-08-06 21:33 ` [PATCH AUTOSEL 5.2 49/59] drm: msm: Fix add_gpu_components Sasha Levin
2019-08-06 21:33 ` [PATCH AUTOSEL 5.2 51/59] drm/exynos: fix missing decrement of retry counter Sasha Levin
2019-08-07 8:49 ` David Laight
2019-08-18 1:47 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190818014754.GE1318@sasha-vm \
--to=sashal@kernel.org \
--cc=David.Laight@ACULAB.COM \
--cc=colin.king@canonical.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=inki.dae@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox