From: hejunhao <hejunhao3@huawei.com>
To: Suzuki K Poulose <suzuki.poulose@arm.com>,
kernel test robot <lkp@intel.com>, <mathieu.poirier@linaro.org>,
<mike.leach@linaro.org>, <leo.yan@linaro.org>,
<jonathan.cameron@huawei.com>, <john.garry@huawei.com>
Cc: <oe-kbuild-all@lists.linux.dev>, <coresight@lists.linaro.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <lpieralisi@kernel.org>,
<linuxarm@huawei.com>, <liuqi115@huawei.com>,
<f.fangjian@huawei.com>, <prime.zeng@hisilicon.com>
Subject: Re: [PATCH v12 1/2] drivers/coresight: Add UltraSoc System Memory Buffer driver
Date: Mon, 14 Nov 2022 21:06:51 +0800 [thread overview]
Message-ID: <901ee9b4-f0b3-437e-fce9-be3c6c214afe@huawei.com> (raw)
In-Reply-To: <a1343ef8-19f2-e3fc-35b7-02a989e093f5@arm.com>
On 2022/11/14 18:49, Suzuki K Poulose wrote:
> On 11/11/2022 22:06, kernel test robot wrote:
>> Hi Junhao,
>>
>> I love your patch! Perhaps something to improve:
>>
>> [auto build test WARNING on soc/for-next]
>> [also build test WARNING on linus/master v6.1-rc4 next-20221111]
>> [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#_base_tree_information]
>>
>> url:
>> https://github.com/intel-lab-lkp/linux/commits/Junhao-He/Add-support-for-UltraSoc-System-Memory-Buffer/20221109-215158
>> base: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git
>> for-next
>> patch link:
>> https://lore.kernel.org/r/20221109135008.9485-2-hejunhao3%40huawei.com
>> patch subject: [PATCH v12 1/2] drivers/coresight: Add UltraSoc System
>> Memory Buffer driver
>> config: arm64-randconfig-s033-20221111
>> compiler: aarch64-linux-gcc (GCC) 12.1.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-39-gce1a6720-dirty
>> #
>> https://github.com/intel-lab-lkp/linux/commit/49ede03fd874b65deca5382ea84c3377188136da
>> git remote add linux-review
>> https://github.com/intel-lab-lkp/linux
>> git fetch --no-tags linux-review
>> Junhao-He/Add-support-for-UltraSoc-System-Memory-Buffer/20221109-215158
>> git checkout 49ede03fd874b65deca5382ea84c3377188136da
>> # save the config file
>> mkdir build_dir && cp config build_dir/.config
>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0
>> make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
>> O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/hwtracing/coresight/
>>
>> If you fix the issue, kindly add following tag where applicable
>> | Reported-by: kernel test robot <lkp@intel.com>
>>
>> sparse warnings: (new ones prefixed by >>)
>>>> drivers/hwtracing/coresight/ultrasoc-smb.c:113:33: sparse: sparse:
>>>> cast removes address space '__iomem' of expression
>>>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse: sparse:
>>>> incorrect type in argument 1 (different address spaces) @@
>>>> expected void const * @@ got void [noderef] __iomem * @@
>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse:
>> expected void const *
>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse:
>> got void [noderef] __iomem *
>>>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse: sparse:
>>>> incorrect type in argument 1 (different address spaces) @@
>>>> expected void const * @@ got void [noderef] __iomem * @@
>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse:
>> expected void const *
>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse:
>> got void [noderef] __iomem *
>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse:
>> sparse: incorrect type in argument 2 (different address spaces)
>> @@ expected void const * @@ got void [noderef] __iomem * @@
>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse:
>> expected void const *
>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse:
>> got void [noderef] __iomem *
>>>> drivers/hwtracing/coresight/ultrasoc-smb.c:463:14: sparse: sparse:
>>>> incorrect type in assignment (different address spaces) @@
>>>> expected void [noderef] __iomem *base @@ got void * @@
>> drivers/hwtracing/coresight/ultrasoc-smb.c:463:14: sparse:
>> expected void [noderef] __iomem *base
>> drivers/hwtracing/coresight/ultrasoc-smb.c:463:14: sparse:
>> got void *
>>
>> vim +/__iomem +113 drivers/hwtracing/coresight/ultrasoc-smb.c
>>
>> 89
>> 90 static ssize_t smb_read(struct file *file, char __user
>> *data, size_t len,
>> 91 loff_t *ppos)
>> 92 {
>> 93 struct smb_drv_data *drvdata =
>> container_of(file->private_data,
>> 94 struct smb_drv_data, miscdev);
>> 95 struct smb_data_buffer *sdb = &drvdata->sdb;
>> 96 struct device *dev = &drvdata->csdev->dev;
>> 97 ssize_t to_copy = 0;
>> 98
>> 99 mutex_lock(&drvdata->mutex);
>> 100
>> 101 if (!sdb->data_size) {
>> 102 smb_update_data_size(drvdata);
>> 103 if (!sdb->data_size)
>> 104 goto out;
>> 105 }
>> 106
>> 107 to_copy = min(sdb->data_size, len);
>> 108
>> 109 /* Copy parts of trace data when read pointer wrap
>> around SMB buffer */
>> 110 if (sdb->rd_offset + to_copy > sdb->buf_size)
>> 111 to_copy = sdb->buf_size - sdb->rd_offset;
>> 112
>> > 113 if (copy_to_user(data, (void *)sdb->buf_base +
>> sdb->rd_offset,
>> 114 to_copy)) {
>> 115 dev_dbg(dev, "Failed to copy data to user\n");
>> 116 to_copy = -EFAULT;
>> 117 goto out;
>> 118 }
>> 119
>
> Please could we replace this with copy_to_user_fromio() ?
>
> Suzuki
>
> _______________________________________________
> CoreSight mailing list -- coresight@lists.linaro.org
> To unsubscribe send an email to coresight-leave@lists.linaro.org
> .
>
Hi Suzuki,
This is a cache memory, due to improper use of "__iomem" , the sparse
generates warnings.
I has fix it in v13.
https://lore.kernel.org/lkml/20221114090316.63157-2-hejunhao3@huawei.com/
Best regards,
Junhao.
WARNING: multiple messages have this Message-ID (diff)
From: hejunhao <hejunhao3@huawei.com>
To: Suzuki K Poulose <suzuki.poulose@arm.com>,
kernel test robot <lkp@intel.com>, <mathieu.poirier@linaro.org>,
<mike.leach@linaro.org>, <leo.yan@linaro.org>,
<jonathan.cameron@huawei.com>, <john.garry@huawei.com>
Cc: <oe-kbuild-all@lists.linux.dev>, <coresight@lists.linaro.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <lpieralisi@kernel.org>,
<linuxarm@huawei.com>, <liuqi115@huawei.com>,
<f.fangjian@huawei.com>, <prime.zeng@hisilicon.com>
Subject: Re: [PATCH v12 1/2] drivers/coresight: Add UltraSoc System Memory Buffer driver
Date: Mon, 14 Nov 2022 21:06:51 +0800 [thread overview]
Message-ID: <901ee9b4-f0b3-437e-fce9-be3c6c214afe@huawei.com> (raw)
In-Reply-To: <a1343ef8-19f2-e3fc-35b7-02a989e093f5@arm.com>
On 2022/11/14 18:49, Suzuki K Poulose wrote:
> On 11/11/2022 22:06, kernel test robot wrote:
>> Hi Junhao,
>>
>> I love your patch! Perhaps something to improve:
>>
>> [auto build test WARNING on soc/for-next]
>> [also build test WARNING on linus/master v6.1-rc4 next-20221111]
>> [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#_base_tree_information]
>>
>> url:
>> https://github.com/intel-lab-lkp/linux/commits/Junhao-He/Add-support-for-UltraSoc-System-Memory-Buffer/20221109-215158
>> base: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git
>> for-next
>> patch link:
>> https://lore.kernel.org/r/20221109135008.9485-2-hejunhao3%40huawei.com
>> patch subject: [PATCH v12 1/2] drivers/coresight: Add UltraSoc System
>> Memory Buffer driver
>> config: arm64-randconfig-s033-20221111
>> compiler: aarch64-linux-gcc (GCC) 12.1.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-39-gce1a6720-dirty
>> #
>> https://github.com/intel-lab-lkp/linux/commit/49ede03fd874b65deca5382ea84c3377188136da
>> git remote add linux-review
>> https://github.com/intel-lab-lkp/linux
>> git fetch --no-tags linux-review
>> Junhao-He/Add-support-for-UltraSoc-System-Memory-Buffer/20221109-215158
>> git checkout 49ede03fd874b65deca5382ea84c3377188136da
>> # save the config file
>> mkdir build_dir && cp config build_dir/.config
>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0
>> make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
>> O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/hwtracing/coresight/
>>
>> If you fix the issue, kindly add following tag where applicable
>> | Reported-by: kernel test robot <lkp@intel.com>
>>
>> sparse warnings: (new ones prefixed by >>)
>>>> drivers/hwtracing/coresight/ultrasoc-smb.c:113:33: sparse: sparse:
>>>> cast removes address space '__iomem' of expression
>>>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse: sparse:
>>>> incorrect type in argument 1 (different address spaces) @@
>>>> expected void const * @@ got void [noderef] __iomem * @@
>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse:
>> expected void const *
>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse:
>> got void [noderef] __iomem *
>>>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse: sparse:
>>>> incorrect type in argument 1 (different address spaces) @@
>>>> expected void const * @@ got void [noderef] __iomem * @@
>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse:
>> expected void const *
>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse:
>> got void [noderef] __iomem *
>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse:
>> sparse: incorrect type in argument 2 (different address spaces)
>> @@ expected void const * @@ got void [noderef] __iomem * @@
>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse:
>> expected void const *
>> drivers/hwtracing/coresight/ultrasoc-smb.c:354:17: sparse:
>> got void [noderef] __iomem *
>>>> drivers/hwtracing/coresight/ultrasoc-smb.c:463:14: sparse: sparse:
>>>> incorrect type in assignment (different address spaces) @@
>>>> expected void [noderef] __iomem *base @@ got void * @@
>> drivers/hwtracing/coresight/ultrasoc-smb.c:463:14: sparse:
>> expected void [noderef] __iomem *base
>> drivers/hwtracing/coresight/ultrasoc-smb.c:463:14: sparse:
>> got void *
>>
>> vim +/__iomem +113 drivers/hwtracing/coresight/ultrasoc-smb.c
>>
>> 89
>> 90 static ssize_t smb_read(struct file *file, char __user
>> *data, size_t len,
>> 91 loff_t *ppos)
>> 92 {
>> 93 struct smb_drv_data *drvdata =
>> container_of(file->private_data,
>> 94 struct smb_drv_data, miscdev);
>> 95 struct smb_data_buffer *sdb = &drvdata->sdb;
>> 96 struct device *dev = &drvdata->csdev->dev;
>> 97 ssize_t to_copy = 0;
>> 98
>> 99 mutex_lock(&drvdata->mutex);
>> 100
>> 101 if (!sdb->data_size) {
>> 102 smb_update_data_size(drvdata);
>> 103 if (!sdb->data_size)
>> 104 goto out;
>> 105 }
>> 106
>> 107 to_copy = min(sdb->data_size, len);
>> 108
>> 109 /* Copy parts of trace data when read pointer wrap
>> around SMB buffer */
>> 110 if (sdb->rd_offset + to_copy > sdb->buf_size)
>> 111 to_copy = sdb->buf_size - sdb->rd_offset;
>> 112
>> > 113 if (copy_to_user(data, (void *)sdb->buf_base +
>> sdb->rd_offset,
>> 114 to_copy)) {
>> 115 dev_dbg(dev, "Failed to copy data to user\n");
>> 116 to_copy = -EFAULT;
>> 117 goto out;
>> 118 }
>> 119
>
> Please could we replace this with copy_to_user_fromio() ?
>
> Suzuki
>
> _______________________________________________
> CoreSight mailing list -- coresight@lists.linaro.org
> To unsubscribe send an email to coresight-leave@lists.linaro.org
> .
>
Hi Suzuki,
This is a cache memory, due to improper use of "__iomem" , the sparse
generates warnings.
I has fix it in v13.
https://lore.kernel.org/lkml/20221114090316.63157-2-hejunhao3@huawei.com/
Best regards,
Junhao.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-11-14 13:07 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 13:50 [PATCH v12 0/2] Add support for UltraSoc System Memory Buffer Junhao He
2022-11-09 13:50 ` Junhao He
2022-11-09 13:50 ` [PATCH v12 1/2] drivers/coresight: Add UltraSoc System Memory Buffer driver Junhao He
2022-11-09 13:50 ` Junhao He
2022-11-09 16:56 ` Jonathan Cameron
2022-11-09 16:56 ` Jonathan Cameron
2022-11-10 11:13 ` hejunhao
2022-11-10 11:13 ` hejunhao
2022-11-10 12:05 ` Yicong Yang
2022-11-10 12:05 ` Yicong Yang
2022-11-11 13:30 ` kernel test robot
2022-11-11 22:06 ` kernel test robot
2022-11-14 10:49 ` Suzuki K Poulose
2022-11-14 10:49 ` Suzuki K Poulose
2022-11-14 13:06 ` hejunhao [this message]
2022-11-14 13:06 ` hejunhao
2022-11-14 13:59 ` Suzuki K Poulose
2022-11-14 13:59 ` Suzuki K Poulose
2022-11-15 7:11 ` hejunhao
2022-11-15 7:11 ` hejunhao
2022-11-09 13:50 ` [PATCH v12 2/2] Documentation: Add document for UltraSoc SMB drivers Junhao He
2022-11-09 13:50 ` Junhao He
2022-11-09 16:57 ` Jonathan Cameron
2022-11-09 16:57 ` Jonathan Cameron
2022-11-10 11:20 ` hejunhao
2022-11-10 11:20 ` hejunhao
2022-11-10 12:08 ` Yicong Yang
2022-11-10 12:08 ` Yicong Yang
2022-11-12 10:06 ` hejunhao
2022-11-12 10:06 ` hejunhao
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=901ee9b4-f0b3-437e-fce9-be3c6c214afe@huawei.com \
--to=hejunhao3@huawei.com \
--cc=coresight@lists.linaro.org \
--cc=f.fangjian@huawei.com \
--cc=john.garry@huawei.com \
--cc=jonathan.cameron@huawei.com \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=liuqi115@huawei.com \
--cc=lkp@intel.com \
--cc=lpieralisi@kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=mike.leach@linaro.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=prime.zeng@hisilicon.com \
--cc=suzuki.poulose@arm.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.