mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Colin Ian King <colin.king@canonical.com>
To: Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Inki Dae <inki.dae@samsung.com>,
	linux-samsung-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: drm/exynos: scaler: Reset hardware before starting the operation (bug report)
Date: Fri, 5 Jul 2019 17:09:06 +0100	[thread overview]
Message-ID: <c67b4671-aabc-df13-e9c7-ccbc25337b7c@canonical.com> (raw)

Hi,

Static analysis on today's linux-next has found a potential error in the
following commit:

commit 280e54c9f614c88292685383cf2d65057586e9fb
Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Date:   Thu Jun 7 13:06:08 2018 +0200

    drm/exynos: scaler: Reset hardware before starting the operation

In the following code the retry counter does not appear to be
decremented, so potentially the loop could get stuck forever if the H/W
does not change state:

static inline int scaler_reset(struct scaler_context *scaler)
{
        int retry = SCALER_RESET_WAIT_RETRIES;

        scaler_write(SCALER_CFG_SOFT_RESET, SCALER_CFG);
        do {
                cpu_relax();
        } 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);

        return retry ? 0 : -EIO;
}

Maybe I'm missing something here subtle.

Colin

             reply	other threads:[~2019-07-05 16:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190705160911epcas2p2754c2c703cc6086f7f1715e1840deb1b@epcas2p2.samsung.com>
2019-07-05 16:09 ` Colin Ian King [this message]
2019-07-22 17:05   ` Marek Szyprowski

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=c67b4671-aabc-df13-e9c7-ccbc25337b7c@canonical.com \
    --to=colin.king@canonical.com \
    --cc=andrzej.p@samsung.com \
    --cc=inki.dae@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    /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

all inboxes | Powered by JetHome®