All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@01.org
Cc: Zain Wang <wzz@rock-chips.com>, David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org,
	Jose Souza <jose.souza@intel.com>,
	Tomasz Figa <tfiga@chromium.org>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Sean Paul <seanpaul@chromium.org>,
	kbuild-all@01.org, Sean Paul <sean@poorly.run>
Subject: Re: [PATCH v2 1/5] drm: Add helpers to kick off self refresh mode in drivers
Date: Thu, 28 Mar 2019 17:42:36 +0300	[thread overview]
Message-ID: <20190328144236.GU32590@kadam> (raw)
In-Reply-To: <20190326204509.96515-1-sean@poorly.run>

Hi Sean,

url:    https://github.com/0day-ci/linux/commits/Sean-Paul/drm-Add-helpers-to-kick-off-self-refresh-mode-in-drivers/20190327-194853

smatch warnings:
drivers/gpu/drm/drm_self_refresh_helper.c:105 drm_self_refresh_helper_entry_work() error: uninitialized symbol 'ret'.

# https://github.com/0day-ci/linux/commit/f5a7344f61b9f1ff99802d4daa7fecbdf0040b42
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout f5a7344f61b9f1ff99802d4daa7fecbdf0040b42
vim +/ret +105 drivers/gpu/drm/drm_self_refresh_helper.c

f5a7344f Sean Paul 2019-03-26   50  
f5a7344f Sean Paul 2019-03-26   51  static void drm_self_refresh_helper_entry_work(struct work_struct *work)
f5a7344f Sean Paul 2019-03-26   52  {
f5a7344f Sean Paul 2019-03-26   53  	struct drm_self_refresh_state *sr_state = container_of(
f5a7344f Sean Paul 2019-03-26   54  				to_delayed_work(work),
f5a7344f Sean Paul 2019-03-26   55  				struct drm_self_refresh_state, entry_work);
f5a7344f Sean Paul 2019-03-26   56  	struct drm_crtc *crtc = sr_state->crtc;
f5a7344f Sean Paul 2019-03-26   57  	struct drm_device *dev = crtc->dev;
f5a7344f Sean Paul 2019-03-26   58  	struct drm_modeset_acquire_ctx ctx;
f5a7344f Sean Paul 2019-03-26   59  	struct drm_atomic_state *state;
f5a7344f Sean Paul 2019-03-26   60  	struct drm_connector *conn;
f5a7344f Sean Paul 2019-03-26   61  	struct drm_connector_state *conn_state;
f5a7344f Sean Paul 2019-03-26   62  	struct drm_crtc_state *crtc_state;
f5a7344f Sean Paul 2019-03-26   63  	int i, ret;
f5a7344f Sean Paul 2019-03-26   64  
f5a7344f Sean Paul 2019-03-26   65  	drm_modeset_acquire_init(&ctx, 0);
f5a7344f Sean Paul 2019-03-26   66  
f5a7344f Sean Paul 2019-03-26   67  	state = drm_atomic_state_alloc(dev);
f5a7344f Sean Paul 2019-03-26   68  	if (!state) {
f5a7344f Sean Paul 2019-03-26   69  		ret = -ENOMEM;
f5a7344f Sean Paul 2019-03-26   70  		goto out;
f5a7344f Sean Paul 2019-03-26   71  	}
f5a7344f Sean Paul 2019-03-26   72  
f5a7344f Sean Paul 2019-03-26   73  retry:
f5a7344f Sean Paul 2019-03-26   74  	state->acquire_ctx = &ctx;
f5a7344f Sean Paul 2019-03-26   75  
f5a7344f Sean Paul 2019-03-26   76  	crtc_state = drm_atomic_get_crtc_state(state, crtc);
f5a7344f Sean Paul 2019-03-26   77  	if (IS_ERR(crtc_state)) {
f5a7344f Sean Paul 2019-03-26   78  		ret = PTR_ERR(crtc_state);
f5a7344f Sean Paul 2019-03-26   79  		goto out;
f5a7344f Sean Paul 2019-03-26   80  	}
f5a7344f Sean Paul 2019-03-26   81  
f5a7344f Sean Paul 2019-03-26   82  	if (!crtc_state->enable)
f5a7344f Sean Paul 2019-03-26   83  		goto out;
                                                ^^^^^^^^
"ret" not set.

f5a7344f Sean Paul 2019-03-26   84  
f5a7344f Sean Paul 2019-03-26   85  	ret = drm_atomic_add_affected_connectors(state, crtc);
f5a7344f Sean Paul 2019-03-26   86  	if (ret)
f5a7344f Sean Paul 2019-03-26   87  		goto out;
f5a7344f Sean Paul 2019-03-26   88  
f5a7344f Sean Paul 2019-03-26   89  	crtc_state->active = false;
f5a7344f Sean Paul 2019-03-26   90  	crtc_state->self_refresh_active = true;
f5a7344f Sean Paul 2019-03-26   91  
f5a7344f Sean Paul 2019-03-26   92  	for_each_new_connector_in_state(state, conn, conn_state, i) {
f5a7344f Sean Paul 2019-03-26   93  		if (!conn_state->self_refresh_aware)
f5a7344f Sean Paul 2019-03-26   94  			goto out;
f5a7344f Sean Paul 2019-03-26   95  
f5a7344f Sean Paul 2019-03-26   96  		conn_state->self_refresh_changed = true;
f5a7344f Sean Paul 2019-03-26   97  		conn_state->self_refresh_active = true;
f5a7344f Sean Paul 2019-03-26   98  	}
f5a7344f Sean Paul 2019-03-26   99  
f5a7344f Sean Paul 2019-03-26  100  	ret = drm_atomic_commit(state);
f5a7344f Sean Paul 2019-03-26  101  	if (ret)
f5a7344f Sean Paul 2019-03-26  102  		goto out;
f5a7344f Sean Paul 2019-03-26  103  
f5a7344f Sean Paul 2019-03-26  104  out:
f5a7344f Sean Paul 2019-03-26 @105  	if (ret == -EDEADLK) {
f5a7344f Sean Paul 2019-03-26  106  		drm_atomic_state_clear(state);
f5a7344f Sean Paul 2019-03-26  107  		ret = drm_modeset_backoff(&ctx);
f5a7344f Sean Paul 2019-03-26  108  		if (!ret)
f5a7344f Sean Paul 2019-03-26  109  			goto retry;
f5a7344f Sean Paul 2019-03-26  110  	}
f5a7344f Sean Paul 2019-03-26  111  
f5a7344f Sean Paul 2019-03-26  112  	drm_atomic_state_put(state);
f5a7344f Sean Paul 2019-03-26  113  	drm_modeset_drop_locks(&ctx);
f5a7344f Sean Paul 2019-03-26  114  	drm_modeset_acquire_fini(&ctx);
f5a7344f Sean Paul 2019-03-26  115  }
f5a7344f Sean Paul 2019-03-26  116  

  parent reply	other threads:[~2019-03-28 14:42 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-26 20:44 [PATCH v2 1/5] drm: Add helpers to kick off self refresh mode in drivers Sean Paul
2019-03-26 20:44 ` [PATCH v2 2/5] drm/rockchip: Check for fast link training before enabling psr Sean Paul
2019-03-26 20:44 ` [PATCH v2 3/5] drm/rockchip: Use the helpers for PSR Sean Paul
2019-03-29 18:51   ` Heiko Stübner
2019-03-29 19:00     ` Sean Paul
2019-03-29 19:02       ` Heiko Stübner
2019-03-29 19:12         ` Sean Paul
2019-03-29 19:24           ` Daniel Vetter
2019-03-26 20:44 ` [PATCH v2 4/5] drm/rockchip: Don't fully disable vop on self refresh Sean Paul
2019-03-26 20:44 ` [PATCH v2 5/5] drm/rockchip: Use drm_atomic_helper_commit_tail_rpm Sean Paul
2019-03-27 18:15 ` [PATCH v2 1/5] drm: Add helpers to kick off self refresh mode in drivers Daniel Vetter
2019-03-28 21:03   ` Sean Paul
2019-03-29  8:21     ` Daniel Vetter
2019-03-29 13:16       ` Sean Paul
2019-03-29 15:36         ` Daniel Vetter
2019-03-29 18:10           ` Sean Paul
2019-03-29 19:21             ` Daniel Vetter
2019-04-01 13:49               ` Sean Paul
2019-04-02  7:49                 ` Daniel Vetter
2019-04-02 13:24                   ` Sean Paul
2019-04-02 16:05                     ` Daniel Vetter
2019-04-02 16:47                       ` Sean Paul
2019-04-03  6:52                         ` Daniel Vetter
2019-04-02 14:16                   ` Ville Syrjälä
2019-03-28 14:42 ` Dan Carpenter [this message]
2019-04-02  8:55 ` Neil Armstrong
2019-04-02  9:08   ` Daniel Vetter
2019-04-02  9:45     ` Neil Armstrong
2019-04-02  9:50       ` Daniel Vetter
2019-04-02  9:53 ` Daniel Vetter

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=20190328144236.GU32590@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jose.souza@intel.com \
    --cc=kbuild-all@01.org \
    --cc=kbuild@01.org \
    --cc=maxime.ripard@bootlin.com \
    --cc=sean@poorly.run \
    --cc=seanpaul@chromium.org \
    --cc=tfiga@chromium.org \
    --cc=wzz@rock-chips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.