All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/gpu/drm/exynos/exynos_drm_g2d.c:907 g2d_runqueue_worker() warn: inconsistent returns '&g2d->runqueue_mutex'.
Date: Tue, 24 Aug 2021 18:54:22 +0800	[thread overview]
Message-ID: <202108241809.A2EmbR3X-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4818 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Inki Dae <inki.dae@samsung.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d5ae8d7f85b7f6f6e60f1af8ff4be52b0926fde1
commit: 445d3bed75de4082c7c7794030ac9a5b8bfde886 drm/exynos: use pm_runtime_resume_and_get()
date:   2 months ago
:::::: branch date: 18 hours ago
:::::: commit date: 2 months ago
config: openrisc-randconfig-m031-20210824 (attached as .config)
compiler: or1k-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/gpu/drm/exynos/exynos_drm_g2d.c:907 g2d_runqueue_worker() warn: inconsistent returns '&g2d->runqueue_mutex'.

Old smatch warnings:
drivers/gpu/drm/exynos/exynos_drm_g2d.c:1237 exynos_g2d_set_cmdlist_ioctl() error: copy_from_user() 'cmdlist->data[cmdlist->last]' too small (2040 vs 4080)

vim +907 drivers/gpu/drm/exynos/exynos_drm_g2d.c

d7f1642c90ab5eb Joonyoung Shim 2012-05-17  863  
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  864  static void g2d_runqueue_worker(struct work_struct *work)
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  865  {
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  866  	struct g2d_data *g2d = container_of(work, struct g2d_data,
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  867  					    runqueue_work);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  868  	struct g2d_runqueue_node *runqueue_node;
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  869  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  870  	/*
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  871  	 * The engine is busy and the completion of the current node is going
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  872  	 * to poke the runqueue worker, so nothing to do here.
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  873  	 */
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  874  	if (test_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags))
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  875  		return;
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  876  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  877  	mutex_lock(&g2d->runqueue_mutex);
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  878  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  879  	runqueue_node = g2d->runqueue_node;
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  880  	g2d->runqueue_node = NULL;
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  881  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  882  	if (runqueue_node) {
7c3fc2b5ccd6694 Tobias Jakobi  2016-09-27  883  		pm_runtime_mark_last_busy(g2d->dev);
7c3fc2b5ccd6694 Tobias Jakobi  2016-09-27  884  		pm_runtime_put_autosuspend(g2d->dev);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  885  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  886  		complete(&runqueue_node->complete);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  887  		if (runqueue_node->async)
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  888  			g2d_free_runqueue_node(g2d, runqueue_node);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  889  	}
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  890  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  891  	if (!test_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags)) {
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  892  		g2d->runqueue_node = g2d_get_runqueue_node(g2d);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  893  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  894  		if (g2d->runqueue_node) {
445d3bed75de408 Inki Dae       2021-05-25  895  			int ret;
445d3bed75de408 Inki Dae       2021-05-25  896  
445d3bed75de408 Inki Dae       2021-05-25  897  			ret = pm_runtime_resume_and_get(g2d->dev);
445d3bed75de408 Inki Dae       2021-05-25  898  			if (ret < 0) {
445d3bed75de408 Inki Dae       2021-05-25  899  				dev_err(g2d->dev, "failed to enable G2D device.\n");
445d3bed75de408 Inki Dae       2021-05-25  900  				return;
445d3bed75de408 Inki Dae       2021-05-25  901  			}
445d3bed75de408 Inki Dae       2021-05-25  902  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  903  			g2d_dma_start(g2d, g2d->runqueue_node);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  904  		}
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  905  	}
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  906  
d7f1642c90ab5eb Joonyoung Shim 2012-05-17 @907  	mutex_unlock(&g2d->runqueue_mutex);
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  908  }
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  909  

:::::: The code at line 907 was first introduced by commit
:::::: d7f1642c90ab5eb2d7c48af0581c993094f97e1a drm/exynos: add G2D driver

:::::: TO: Joonyoung Shim <jy0922.shim@samsung.com>
:::::: CC: Inki Dae <inki.dae@samsung.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 35511 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: [kbuild] drivers/gpu/drm/exynos/exynos_drm_g2d.c:907 g2d_runqueue_worker() warn: inconsistent returns '&g2d->runqueue_mutex'.
Date: Tue, 24 Aug 2021 14:22:07 +0300	[thread overview]
Message-ID: <202108241809.A2EmbR3X-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4662 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git  master
head:   d5ae8d7f85b7f6f6e60f1af8ff4be52b0926fde1
commit: 445d3bed75de4082c7c7794030ac9a5b8bfde886 drm/exynos: use pm_runtime_resume_and_get()
config: openrisc-randconfig-m031-20210824 (attached as .config)
compiler: or1k-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/gpu/drm/exynos/exynos_drm_g2d.c:907 g2d_runqueue_worker() warn: inconsistent returns '&g2d->runqueue_mutex'.

Old smatch warnings:
drivers/gpu/drm/exynos/exynos_drm_g2d.c:1237 exynos_g2d_set_cmdlist_ioctl() error: copy_from_user() 'cmdlist->data[cmdlist->last]' too small (2040 vs 4080)
(Presumably this warning is generated from a 32 bit config.  The
 cmdlist->data[] is a unsigned long, but the code in
 exynos_g2d_set_cmdlist_ioctl() assumes it's 64 bit. )

vim +907 drivers/gpu/drm/exynos/exynos_drm_g2d.c

d7f1642c90ab5eb Joonyoung Shim 2012-05-17  864  static void g2d_runqueue_worker(struct work_struct *work)
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  865  {
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  866  	struct g2d_data *g2d = container_of(work, struct g2d_data,
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  867  					    runqueue_work);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  868  	struct g2d_runqueue_node *runqueue_node;
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  869  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  870  	/*
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  871  	 * The engine is busy and the completion of the current node is going
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  872  	 * to poke the runqueue worker, so nothing to do here.
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  873  	 */
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  874  	if (test_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags))
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  875  		return;
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  876  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  877  	mutex_lock(&g2d->runqueue_mutex);
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  878  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  879  	runqueue_node = g2d->runqueue_node;
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  880  	g2d->runqueue_node = NULL;
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  881  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  882  	if (runqueue_node) {
7c3fc2b5ccd6694 Tobias Jakobi  2016-09-27  883  		pm_runtime_mark_last_busy(g2d->dev);
7c3fc2b5ccd6694 Tobias Jakobi  2016-09-27  884  		pm_runtime_put_autosuspend(g2d->dev);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  885  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  886  		complete(&runqueue_node->complete);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  887  		if (runqueue_node->async)
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  888  			g2d_free_runqueue_node(g2d, runqueue_node);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  889  	}
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  890  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  891  	if (!test_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags)) {
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  892  		g2d->runqueue_node = g2d_get_runqueue_node(g2d);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  893  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  894  		if (g2d->runqueue_node) {
445d3bed75de408 Inki Dae       2021-05-25  895  			int ret;
445d3bed75de408 Inki Dae       2021-05-25  896  
445d3bed75de408 Inki Dae       2021-05-25  897  			ret = pm_runtime_resume_and_get(g2d->dev);
445d3bed75de408 Inki Dae       2021-05-25  898  			if (ret < 0) {
445d3bed75de408 Inki Dae       2021-05-25  899  				dev_err(g2d->dev, "failed to enable G2D device.\n");
445d3bed75de408 Inki Dae       2021-05-25  900  				return;

mutex_unlock(&g2d->runqueue_mutex);

445d3bed75de408 Inki Dae       2021-05-25  901  			}
445d3bed75de408 Inki Dae       2021-05-25  902  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  903  			g2d_dma_start(g2d, g2d->runqueue_node);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  904  		}
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  905  	}
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  906  
d7f1642c90ab5eb Joonyoung Shim 2012-05-17 @907  	mutex_unlock(&g2d->runqueue_mutex);
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  908  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org 

_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Inki Dae <inki.dae@samsung.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [kbuild] drivers/gpu/drm/exynos/exynos_drm_g2d.c:907 g2d_runqueue_worker() warn: inconsistent returns '&g2d->runqueue_mutex'.
Date: Tue, 24 Aug 2021 14:22:07 +0300	[thread overview]
Message-ID: <202108241809.A2EmbR3X-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git  master
head:   d5ae8d7f85b7f6f6e60f1af8ff4be52b0926fde1
commit: 445d3bed75de4082c7c7794030ac9a5b8bfde886 drm/exynos: use pm_runtime_resume_and_get()
config: openrisc-randconfig-m031-20210824 (attached as .config)
compiler: or1k-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/gpu/drm/exynos/exynos_drm_g2d.c:907 g2d_runqueue_worker() warn: inconsistent returns '&g2d->runqueue_mutex'.

Old smatch warnings:
drivers/gpu/drm/exynos/exynos_drm_g2d.c:1237 exynos_g2d_set_cmdlist_ioctl() error: copy_from_user() 'cmdlist->data[cmdlist->last]' too small (2040 vs 4080)
(Presumably this warning is generated from a 32 bit config.  The
 cmdlist->data[] is a unsigned long, but the code in
 exynos_g2d_set_cmdlist_ioctl() assumes it's 64 bit. )

vim +907 drivers/gpu/drm/exynos/exynos_drm_g2d.c

d7f1642c90ab5eb Joonyoung Shim 2012-05-17  864  static void g2d_runqueue_worker(struct work_struct *work)
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  865  {
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  866  	struct g2d_data *g2d = container_of(work, struct g2d_data,
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  867  					    runqueue_work);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  868  	struct g2d_runqueue_node *runqueue_node;
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  869  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  870  	/*
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  871  	 * The engine is busy and the completion of the current node is going
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  872  	 * to poke the runqueue worker, so nothing to do here.
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  873  	 */
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  874  	if (test_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags))
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  875  		return;
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  876  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  877  	mutex_lock(&g2d->runqueue_mutex);
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  878  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  879  	runqueue_node = g2d->runqueue_node;
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  880  	g2d->runqueue_node = NULL;
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  881  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  882  	if (runqueue_node) {
7c3fc2b5ccd6694 Tobias Jakobi  2016-09-27  883  		pm_runtime_mark_last_busy(g2d->dev);
7c3fc2b5ccd6694 Tobias Jakobi  2016-09-27  884  		pm_runtime_put_autosuspend(g2d->dev);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  885  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  886  		complete(&runqueue_node->complete);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  887  		if (runqueue_node->async)
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  888  			g2d_free_runqueue_node(g2d, runqueue_node);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  889  	}
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  890  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  891  	if (!test_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags)) {
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  892  		g2d->runqueue_node = g2d_get_runqueue_node(g2d);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  893  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  894  		if (g2d->runqueue_node) {
445d3bed75de408 Inki Dae       2021-05-25  895  			int ret;
445d3bed75de408 Inki Dae       2021-05-25  896  
445d3bed75de408 Inki Dae       2021-05-25  897  			ret = pm_runtime_resume_and_get(g2d->dev);
445d3bed75de408 Inki Dae       2021-05-25  898  			if (ret < 0) {
445d3bed75de408 Inki Dae       2021-05-25  899  				dev_err(g2d->dev, "failed to enable G2D device.\n");
445d3bed75de408 Inki Dae       2021-05-25  900  				return;

mutex_unlock(&g2d->runqueue_mutex);

445d3bed75de408 Inki Dae       2021-05-25  901  			}
445d3bed75de408 Inki Dae       2021-05-25  902  
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  903  			g2d_dma_start(g2d, g2d->runqueue_node);
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  904  		}
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  905  	}
22d6704dd4bf2c8 Tobias Jakobi  2016-09-27  906  
d7f1642c90ab5eb Joonyoung Shim 2012-05-17 @907  	mutex_unlock(&g2d->runqueue_mutex);
d7f1642c90ab5eb Joonyoung Shim 2012-05-17  908  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org 

_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org


             reply	other threads:[~2021-08-24 10:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24 10:54 kernel test robot [this message]
2021-08-24 11:22 ` [kbuild] drivers/gpu/drm/exynos/exynos_drm_g2d.c:907 g2d_runqueue_worker() warn: inconsistent returns '&g2d->runqueue_mutex' Dan Carpenter
2021-08-24 11:22 ` Dan Carpenter

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=202108241809.A2EmbR3X-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.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 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.