linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: kbuild-all@lists.01.org, linux-remoteproc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	arnaud.pouliquen@foss.st.com
Subject: Re: [PATCH] rpmsg: virtio: set dst address on first message received
Date: Wed, 16 Mar 2022 06:47:53 +0800	[thread overview]
Message-ID: <202203160614.sjUMuSy8-lkp@intel.com> (raw)
In-Reply-To: <20220315153856.3117676-1-arnaud.pouliquen@foss.st.com>

Hi Arnaud,

I love your patch! Perhaps something to improve:

[auto build test WARNING on remoteproc/rpmsg-next]
[also build test WARNING on v5.17-rc8 next-20220315]
[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/Arnaud-Pouliquen/rpmsg-virtio-set-dst-address-on-first-message-received/20220315-234049
base:   git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux.git rpmsg-next
config: s390-randconfig-s031-20220313 (https://download.01.org/0day-ci/archive/20220316/202203160614.sjUMuSy8-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/0day-ci/linux/commit/ef182a34773917f6bf876b37485031962393a1cd
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Arnaud-Pouliquen/rpmsg-virtio-set-dst-address-on-first-message-received/20220315-234049
        git checkout ef182a34773917f6bf876b37485031962393a1cd
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=s390 SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> drivers/rpmsg/virtio_rpmsg_bus.c:756:36: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned int [usertype] dst @@     got restricted __rpmsg32 [usertype] src @@
   drivers/rpmsg/virtio_rpmsg_bus.c:756:36: sparse:     expected unsigned int [usertype] dst
   drivers/rpmsg/virtio_rpmsg_bus.c:756:36: sparse:     got restricted __rpmsg32 [usertype] src

vim +756 drivers/rpmsg/virtio_rpmsg_bus.c

   727	
   728		/*
   729		 * We currently use fixed-sized buffers, so trivially sanitize
   730		 * the reported payload length.
   731		 */
   732		if (len > vrp->buf_size ||
   733		    msg_len > (len - sizeof(struct rpmsg_hdr))) {
   734			dev_warn(dev, "inbound msg too big: (%d, %d)\n", len, msg_len);
   735			return -EINVAL;
   736		}
   737	
   738		/* use the dst addr to fetch the callback of the appropriate user */
   739		mutex_lock(&vrp->endpoints_lock);
   740	
   741		ept = idr_find(&vrp->endpoints, __rpmsg32_to_cpu(little_endian, msg->dst));
   742	
   743		/* let's make sure no one deallocates ept while we use it */
   744		if (ept)
   745			kref_get(&ept->refcount);
   746	
   747		mutex_unlock(&vrp->endpoints_lock);
   748	
   749		if (ept) {
   750			rpdev = ept->rpdev;
   751			if (rpdev->ept == ept && rpdev->dst == RPMSG_ADDR_ANY) {
   752				/*
   753				 * First message received from the remote side on the default endpoint,
   754				 * update channel destination address.
   755				 */
 > 756				rpdev->dst = msg->src;
   757			}
   758	
   759			/* make sure ept->cb doesn't go away while we use it */
   760			mutex_lock(&ept->cb_lock);
   761	
   762			if (ept->cb)
   763				ept->cb(ept->rpdev, msg->data, msg_len, ept->priv,
   764					__rpmsg32_to_cpu(little_endian, msg->src));
   765	
   766			mutex_unlock(&ept->cb_lock);
   767	
   768			/* farewell, ept, we don't need you anymore */
   769			kref_put(&ept->refcount, __ept_release);
   770		} else
   771			dev_warn_ratelimited(dev, "msg received with no recipient\n");
   772	
   773		/* publish the real size of the buffer */
   774		rpmsg_sg_init(&sg, msg, vrp->buf_size);
   775	
   776		/* add the buffer back to the remote processor's virtqueue */
   777		err = virtqueue_add_inbuf(vrp->rvq, &sg, 1, msg, GFP_KERNEL);
   778		if (err < 0) {
   779			dev_err(dev, "failed to add a virtqueue buffer: %d\n", err);
   780			return err;
   781		}
   782	
   783		return 0;
   784	}
   785	

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

  reply	other threads:[~2022-03-15 22:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15 15:38 [PATCH] rpmsg: virtio: set dst address on first message received Arnaud Pouliquen
2022-03-15 22:47 ` kernel test robot [this message]
2022-05-06 17:12 ` Mathieu Poirier
2022-05-09  9:18   ` Arnaud POULIQUEN
2022-05-10 14:45     ` Mathieu Poirier

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=202203160614.sjUMuSy8-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=arnaud.pouliquen@foss.st.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mathieu.poirier@linaro.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;
as well as URLs for NNTP newsgroup(s).