All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH] dma-buf: fix and rework dma_buf_poll v5
Date: Sat, 03 Jul 2021 00:00:31 +0800	[thread overview]
Message-ID: <202107022337.yVItk27c-lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210702103143.16824-1-christian.koenig@amd.com>
References: <20210702103143.16824-1-christian.koenig@amd.com>
TO: "Christian König" <ckoenig.leichtzumerken@gmail.com>
TO: dri-devel(a)lists.freedesktop.org
TO: daniel.vetter(a)ffwll.ch

Hi "Christian,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tegra-drm/drm/tegra/for-next]
[also build test WARNING on v5.13]
[cannot apply to linus/master next-20210701]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Christian-K-nig/dma-buf-fix-and-rework-dma_buf_poll-v5/20210702-183256
base:   git://anongit.freedesktop.org/tegra/linux.git drm/tegra/for-next
:::::: branch date: 5 hours ago
:::::: commit date: 5 hours ago
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0

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


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/dma-buf/dma-buf.c:253:11: warning: Unused variable: shared_count [unusedVariable]
    unsigned shared_count;
             ^
>> drivers/dma-buf/dma-buf.c:255:6: warning: Unused variable: r [unusedVariable]
    int r, i;
        ^
>> drivers/dma-buf/dma-buf.c:255:9: warning: Unused variable: i [unusedVariable]
    int r, i;
           ^

vim +253 drivers/dma-buf/dma-buf.c

9b495a5887994a Maarten Lankhorst 2014-07-01  248  
afc9a42b7464f7 Al Viro           2017-07-03  249  static __poll_t dma_buf_poll(struct file *file, poll_table *poll)
9b495a5887994a Maarten Lankhorst 2014-07-01  250  {
9b495a5887994a Maarten Lankhorst 2014-07-01  251  	struct dma_buf *dmabuf;
52791eeec1d9f4 Christian König   2019-08-11  252  	struct dma_resv *resv;
5bb0f0637b179f Christian König   2021-07-02 @253  	unsigned shared_count;
01699437758328 Al Viro           2017-07-03  254  	__poll_t events;
5bb0f0637b179f Christian König   2021-07-02 @255  	int r, i;
9b495a5887994a Maarten Lankhorst 2014-07-01  256  
9b495a5887994a Maarten Lankhorst 2014-07-01  257  	dmabuf = file->private_data;
9b495a5887994a Maarten Lankhorst 2014-07-01  258  	if (!dmabuf || !dmabuf->resv)
a9a08845e9acbd Linus Torvalds    2018-02-11  259  		return EPOLLERR;
9b495a5887994a Maarten Lankhorst 2014-07-01  260  
9b495a5887994a Maarten Lankhorst 2014-07-01  261  	resv = dmabuf->resv;
9b495a5887994a Maarten Lankhorst 2014-07-01  262  
9b495a5887994a Maarten Lankhorst 2014-07-01  263  	poll_wait(file, &dmabuf->poll, poll);
9b495a5887994a Maarten Lankhorst 2014-07-01  264  
a9a08845e9acbd Linus Torvalds    2018-02-11  265  	events = poll_requested_events(poll) & (EPOLLIN | EPOLLOUT);
9b495a5887994a Maarten Lankhorst 2014-07-01  266  	if (!events)
9b495a5887994a Maarten Lankhorst 2014-07-01  267  		return 0;
9b495a5887994a Maarten Lankhorst 2014-07-01  268  
5bb0f0637b179f Christian König   2021-07-02  269  	dma_resv_lock(resv, NULL);
9b495a5887994a Maarten Lankhorst 2014-07-01  270  
5bb0f0637b179f Christian König   2021-07-02  271  	if (events & EPOLLOUT) {
5bb0f0637b179f Christian König   2021-07-02  272  		struct dma_buf_poll_cb_t *dcb = &dmabuf->cb_out;
9b495a5887994a Maarten Lankhorst 2014-07-01  273  
5bb0f0637b179f Christian König   2021-07-02  274  		/* Check that callback isn't busy */
9b495a5887994a Maarten Lankhorst 2014-07-01  275  		spin_lock_irq(&dmabuf->poll.lock);
5bb0f0637b179f Christian König   2021-07-02  276  		if (dcb->active)
5bb0f0637b179f Christian König   2021-07-02  277  			events &= ~EPOLLOUT;
5bb0f0637b179f Christian König   2021-07-02  278  		else
5bb0f0637b179f Christian König   2021-07-02  279  			dcb->active = EPOLLOUT;
9b495a5887994a Maarten Lankhorst 2014-07-01  280  		spin_unlock_irq(&dmabuf->poll.lock);
9b495a5887994a Maarten Lankhorst 2014-07-01  281  
5bb0f0637b179f Christian König   2021-07-02  282  		if (events & EPOLLOUT && !dma_buf_poll_shared(resv, dcb) &&
5bb0f0637b179f Christian König   2021-07-02  283  		    !dma_buf_poll_excl(resv, dcb))
5bb0f0637b179f Christian König   2021-07-02  284  			/* No callback queued, wake up any other waiters */
3c3b177a9369b2 Maarten Lankhorst 2014-07-01  285  			dma_buf_poll_cb(NULL, &dcb->cb);
04a5faa8cbe5a8 Maarten Lankhorst 2014-07-01  286  	}
9b495a5887994a Maarten Lankhorst 2014-07-01  287  
5bb0f0637b179f Christian König   2021-07-02  288  	if (events & EPOLLIN) {
5bb0f0637b179f Christian König   2021-07-02  289  		struct dma_buf_poll_cb_t *dcb = &dmabuf->cb_in;
9b495a5887994a Maarten Lankhorst 2014-07-01  290  
5bb0f0637b179f Christian König   2021-07-02  291  		/* Check that callback isn't busy */
9b495a5887994a Maarten Lankhorst 2014-07-01  292  		spin_lock_irq(&dmabuf->poll.lock);
9b495a5887994a Maarten Lankhorst 2014-07-01  293  		if (dcb->active)
5bb0f0637b179f Christian König   2021-07-02  294  			events &= ~EPOLLIN;
9b495a5887994a Maarten Lankhorst 2014-07-01  295  		else
5bb0f0637b179f Christian König   2021-07-02  296  			dcb->active = EPOLLIN;
9b495a5887994a Maarten Lankhorst 2014-07-01  297  		spin_unlock_irq(&dmabuf->poll.lock);
9b495a5887994a Maarten Lankhorst 2014-07-01  298  
5bb0f0637b179f Christian König   2021-07-02  299  		if (events & EPOLLIN && !dma_buf_poll_excl(resv, dcb))
5bb0f0637b179f Christian König   2021-07-02  300  			/* No callback queued, wake up any other waiters */
9b495a5887994a Maarten Lankhorst 2014-07-01  301  			dma_buf_poll_cb(NULL, &dcb->cb);
9b495a5887994a Maarten Lankhorst 2014-07-01  302  	}
9b495a5887994a Maarten Lankhorst 2014-07-01  303  
5bb0f0637b179f Christian König   2021-07-02  304  	dma_resv_unlock(resv);
9b495a5887994a Maarten Lankhorst 2014-07-01  305  	return events;
9b495a5887994a Maarten Lankhorst 2014-07-01  306  }
9b495a5887994a Maarten Lankhorst 2014-07-01  307  

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

             reply	other threads:[~2021-07-02 16:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02 16:00 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-07-08 11:19 [PATCH] dma-buf: fix and rework dma_buf_poll v5 Christian König
2021-07-08 11:41 ` Christian König
2021-07-09 12:50 ` kernel test robot
2021-07-09 12:50   ` kernel test robot
2021-07-02 10:31 Christian König
2021-07-02 19:45 ` 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=202107022337.yVItk27c-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.