Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5336145rwb; Mon, 14 Nov 2022 03:08:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf6BuIxfYyH8KI5eiqJNkyepx6JerQX+UfRsidZUPLLyPUlCZ8X7dlkgCAlS7hCA9FNKIPP+ X-Received: by 2002:a17:90a:fa18:b0:217:f56b:a861 with SMTP id cm24-20020a17090afa1800b00217f56ba861mr13084547pjb.64.1668424119260; Mon, 14 Nov 2022 03:08:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668424119; cv=none; d=google.com; s=arc-20160816; b=Eb1dgahlr78O1twCEw6BfMjE+U2Qlz0jhSOIffXENH5Ia2e9X+MKTfjqL5UQc2olGV lJ5hwYPgpin0Z7IVbQLulE7Pwt9gwKULuZWl9QU/ciYSw23t+Gq+Sdsw8DRtSi9QC4aF XgrIjVoPR4tqq2x/YKAA8xuBb77wu2rRKvfc3j+mef4m4bp/UeqUXfvgUgPDrFqDBrXP pvT8/GnjrKct5mAlIXWpjT0CQ5eU5l4Zz8Xoqv94oJsmDR+zfGd0zKnqwP0NGuGQsWTe HCxkdSWhfswN5KFlNCPn03vaXR0XHXjdBQN5Cv16b1AS6XjtSvVDWdfv4cI1yJst7RiT avLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=AhHgaPyMLnpJ5++gawG0QijAoM1g+cxmqIYDdOjt/No=; b=VWY8oNCgpHEbVv/XwIh8KfsBPEXl3QHO28yBR3jOSuaZZcIgm6hUW3OFgF8ZOCle1+ XRv0LcsVTz8RZyQ7wkCFavESLWA6VCBNVLlCsT4q5fae5aYF1iSDPP0bmXMRDV461ag3 N+KhWXGFZMT3309l5ORF2aWfbgIVUytXQx7O8Cn9N22UK3EAUeo8wSW97DXYCi0UHszD rGQQUUtZRBjtskxwWEF4pXfLKjd74L+Emhao+db0voysi91I9mYoO1TrEpR046gG8ef7 LzkRayTPBfcRfmuvlWrt2du26QoJxnegJnkAX7B4d1iR+cYuPNZUq+t1v7USRgtpeDqq l8GA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t64-20020a638143000000b0046439853c62si9567717pgd.127.2022.11.14.03.08.28; Mon, 14 Nov 2022 03:08:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236089AbiKNKtw (ORCPT + 88 others); Mon, 14 Nov 2022 05:49:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235956AbiKNKtv (ORCPT ); Mon, 14 Nov 2022 05:49:51 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 25E75FACD for ; Mon, 14 Nov 2022 02:49:48 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2C69E23A; Mon, 14 Nov 2022 02:49:54 -0800 (PST) Received: from [10.57.39.18] (unknown [10.57.39.18]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 52E663F73D; Mon, 14 Nov 2022 02:49:45 -0800 (PST) Message-ID: Date: Mon, 14 Nov 2022 10:49:43 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v12 1/2] drivers/coresight: Add UltraSoc System Memory Buffer driver To: kernel test robot , Junhao He , 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 References: <20221109135008.9485-2-hejunhao3@huawei.com> <202211120623.aFVBerTp-lkp@intel.com> From: Suzuki K Poulose In-Reply-To: <202211120623.aFVBerTp-lkp@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > 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