From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 71585C61DA4 for ; Thu, 9 Mar 2023 08:20:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=516Ibnigp7MeffxoRHxudpxKwxNSP6TnojDwrWXjfFQ=; b=h5RUMJ2Sauspkm 9XUMn2rYNRY2B9Pnd6gbD9JMaPQA/nZvUvc9wbc1pnOl9sl0ttKEPl6g3Ihsn2AbMBeCY80s0PLu6 xKPycJNX14LWANT5iJXGwlWywNammTI2HuIYBNkFeeBizDXZvLk0pjU0xbNqqK/lHmoZd5inCqMwS Bx5KU0KEe2cZ+swa2KXjR2vnx6ax3ApaKqtbU7qXJiC7WuTQfCmanuygwPUnRbl3d0jdn5Jg6EB6s 2r4OyZbPq1OkBCTqVP6EGR5zcPUifgEqNEMP5DuMN3npmpn0+S4DdLtfywxoyx0afqyN+IA5KAFX5 yeyh788cgLHxwJ7xz9iw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paBUj-008Td1-Qv; Thu, 09 Mar 2023 08:19:25 +0000 Received: from mga02.intel.com ([134.134.136.20]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paBUg-008Tai-Pq for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 08:19:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678349962; x=1709885962; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=LxitaPLDKDiwktycQFO+JpurANiChLYy613O1BTD8w8=; b=Y53hmIl2L6kZzkkj2Is8D9o9+XB591cdddq+jrRlfSyB1RAI3/tYnKHs fuAEgh0gocHvG2XuaszONiSy2eCpz9jY/C7VPZBHcestFgxQP8ZfamqR/ uZ878SgfIw2hYz/9u6fpATfB4+aJAUfXk/2hfomzHRYrSCyYPwzusx9t4 fTsZ/fIorfhjdFyFrS5ar3vbbaQD8VTLOW4x3UBgHGXSBqxqqsrigdIil hYJa8du5/ssmDi2Nv+CrxxbVhF4VCY0EkK4RQaSwGz+3khML/OjX7o9Mq moVxAgYNJDpu3JWUNbZEX5lrgnrZenbm0BofCqqkjj8W1p35DJHwGFKnb g==; X-IronPort-AV: E=McAfee;i="6500,9779,10643"; a="324707100" X-IronPort-AV: E=Sophos;i="5.98,245,1673942400"; d="scan'208";a="324707100" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2023 00:19:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10643"; a="627267779" X-IronPort-AV: E=Sophos;i="5.98,245,1673942400"; d="scan'208";a="627267779" Received: from lkp-server01.sh.intel.com (HELO b613635ddfff) ([10.239.97.150]) by orsmga003.jf.intel.com with ESMTP; 09 Mar 2023 00:19:16 -0800 Received: from kbuild by b613635ddfff with local (Exim 4.96) (envelope-from ) id 1paBUZ-0002ms-1T; Thu, 09 Mar 2023 08:19:15 +0000 Date: Thu, 9 Mar 2023 16:18:20 +0800 From: kernel test robot To: James Clark , coresight@lists.linaro.org Cc: oe-kbuild-all@lists.linux.dev, James Clark , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Leo Yan , Alexander Shishkin , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/8] coresight: Refactor out buffer allocation function for ETR Message-ID: <202303091603.UuxHblt7-lkp@intel.com> References: <20230308173904.3449231-7-james.clark@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230308173904.3449231-7-james.clark@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_001922_945348_86FE7753 X-CRM114-Status: GOOD ( 20.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi James, I love your patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v6.3-rc1 next-20230309] [cannot apply to atorgue-stm32/stm32-next soc/for-next] [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/James-Clark/coresight-Use-enum-type-for-cs_mode-wherever-possible/20230309-014226 patch link: https://lore.kernel.org/r/20230308173904.3449231-7-james.clark%40arm.com patch subject: [PATCH 6/8] coresight: Refactor out buffer allocation function for ETR config: arm-randconfig-r046-20230308 (https://download.01.org/0day-ci/archive/20230309/202303091603.UuxHblt7-lkp@intel.com/config) compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/3651e0e04e2a01c3cbcb4a4e9289092f2377dc13 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review James-Clark/coresight-Use-enum-type-for-cs_mode-wherever-possible/20230309-014226 git checkout 3651e0e04e2a01c3cbcb4a4e9289092f2377dc13 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/hwtracing/coresight/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Link: https://lore.kernel.org/oe-kbuild-all/202303091603.UuxHblt7-lkp@intel.com/ All warnings (new ones prefixed by >>): drivers/hwtracing/coresight/coresight-tmc-etr.c: In function 'tmc_etr_get_sysfs_buffer': >> drivers/hwtracing/coresight/coresight-tmc-etr.c:1174:13: warning: variable 'ret' set but not used [-Wunused-but-set-variable] 1174 | int ret = 0; | ^~~ vim +/ret +1174 drivers/hwtracing/coresight/coresight-tmc-etr.c 6c6ed1e244c053 Mathieu Poirier 2016-05-03 1171 3651e0e04e2a01 James Clark 2023-03-08 1172 static struct etr_buf *tmc_etr_get_sysfs_buffer(struct coresight_device *csdev) 6c6ed1e244c053 Mathieu Poirier 2016-05-03 1173 { de5461970b3e9e Mathieu Poirier 2016-05-03 @1174 int ret = 0; 6c6ed1e244c053 Mathieu Poirier 2016-05-03 1175 unsigned long flags; 6c6ed1e244c053 Mathieu Poirier 2016-05-03 1176 struct tmc_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); 96a7f644006ecc Suzuki K Poulose 2018-09-20 1177 struct etr_buf *sysfs_buf = NULL, *new_buf = NULL, *free_buf = NULL; 6c6ed1e244c053 Mathieu Poirier 2016-05-03 1178 de5461970b3e9e Mathieu Poirier 2016-05-03 1179 /* 75f4e3619fe202 Suzuki K Poulose 2018-07-11 1180 * If we are enabling the ETR from disabled state, we need to make 75f4e3619fe202 Suzuki K Poulose 2018-07-11 1181 * sure we have a buffer with the right size. The etr_buf is not reset 75f4e3619fe202 Suzuki K Poulose 2018-07-11 1182 * immediately after we stop the tracing in SYSFS mode as we wait for 75f4e3619fe202 Suzuki K Poulose 2018-07-11 1183 * the user to collect the data. We may be able to reuse the existing 75f4e3619fe202 Suzuki K Poulose 2018-07-11 1184 * buffer, provided the size matches. Any allocation has to be done 75f4e3619fe202 Suzuki K Poulose 2018-07-11 1185 * with the lock released. de5461970b3e9e Mathieu Poirier 2016-05-03 1186 */ 6c6ed1e244c053 Mathieu Poirier 2016-05-03 1187 spin_lock_irqsave(&drvdata->spinlock, flags); 96a7f644006ecc Suzuki K Poulose 2018-09-20 1188 sysfs_buf = READ_ONCE(drvdata->sysfs_buf); 96a7f644006ecc Suzuki K Poulose 2018-09-20 1189 if (!sysfs_buf || (sysfs_buf->size != drvdata->size)) { 6c6ed1e244c053 Mathieu Poirier 2016-05-03 1190 spin_unlock_irqrestore(&drvdata->spinlock, flags); de5461970b3e9e Mathieu Poirier 2016-05-03 1191 75f4e3619fe202 Suzuki K Poulose 2018-07-11 1192 /* Allocate memory with the locks released */ 75f4e3619fe202 Suzuki K Poulose 2018-07-11 1193 free_buf = new_buf = tmc_etr_setup_sysfs_buf(drvdata); 75f4e3619fe202 Suzuki K Poulose 2018-07-11 1194 if (IS_ERR(new_buf)) 3651e0e04e2a01 James Clark 2023-03-08 1195 return new_buf; de5461970b3e9e Mathieu Poirier 2016-05-03 1196 de5461970b3e9e Mathieu Poirier 2016-05-03 1197 /* Let's try again */ de5461970b3e9e Mathieu Poirier 2016-05-03 1198 spin_lock_irqsave(&drvdata->spinlock, flags); de5461970b3e9e Mathieu Poirier 2016-05-03 1199 } de5461970b3e9e Mathieu Poirier 2016-05-03 1200 75f4e3619fe202 Suzuki K Poulose 2018-07-11 1201 if (drvdata->reading || drvdata->mode == CS_MODE_PERF) { de5461970b3e9e Mathieu Poirier 2016-05-03 1202 ret = -EBUSY; de5461970b3e9e Mathieu Poirier 2016-05-03 1203 goto out; 6c6ed1e244c053 Mathieu Poirier 2016-05-03 1204 } 6c6ed1e244c053 Mathieu Poirier 2016-05-03 1205 f2facc3366d77e Mathieu Poirier 2016-05-03 1206 /* f2facc3366d77e Mathieu Poirier 2016-05-03 1207 * In sysFS mode we can have multiple writers per sink. Since this f2facc3366d77e Mathieu Poirier 2016-05-03 1208 * sink is already enabled no memory is needed and the HW need not be 75f4e3619fe202 Suzuki K Poulose 2018-07-11 1209 * touched, even if the buffer size has changed. f2facc3366d77e Mathieu Poirier 2016-05-03 1210 */ f973d88b757037 Mathieu Poirier 2019-04-25 1211 if (drvdata->mode == CS_MODE_SYSFS) { f973d88b757037 Mathieu Poirier 2019-04-25 1212 atomic_inc(csdev->refcnt); f2facc3366d77e Mathieu Poirier 2016-05-03 1213 goto out; f973d88b757037 Mathieu Poirier 2019-04-25 1214 } f2facc3366d77e Mathieu Poirier 2016-05-03 1215 de5461970b3e9e Mathieu Poirier 2016-05-03 1216 /* 75f4e3619fe202 Suzuki K Poulose 2018-07-11 1217 * If we don't have a buffer or it doesn't match the requested size, 75f4e3619fe202 Suzuki K Poulose 2018-07-11 1218 * use the buffer allocated above. Otherwise reuse the existing buffer. de5461970b3e9e Mathieu Poirier 2016-05-03 1219 */ 96a7f644006ecc Suzuki K Poulose 2018-09-20 1220 sysfs_buf = READ_ONCE(drvdata->sysfs_buf); 96a7f644006ecc Suzuki K Poulose 2018-09-20 1221 if (!sysfs_buf || (new_buf && sysfs_buf->size != new_buf->size)) { 96a7f644006ecc Suzuki K Poulose 2018-09-20 1222 free_buf = sysfs_buf; 96a7f644006ecc Suzuki K Poulose 2018-09-20 1223 drvdata->sysfs_buf = new_buf; de5461970b3e9e Mathieu Poirier 2016-05-03 1224 } de5461970b3e9e Mathieu Poirier 2016-05-03 1225 de5461970b3e9e Mathieu Poirier 2016-05-03 1226 out: 6c6ed1e244c053 Mathieu Poirier 2016-05-03 1227 spin_unlock_irqrestore(&drvdata->spinlock, flags); 6c6ed1e244c053 Mathieu Poirier 2016-05-03 1228 de5461970b3e9e Mathieu Poirier 2016-05-03 1229 /* Free memory outside the spinlock if need be */ 75f4e3619fe202 Suzuki K Poulose 2018-07-11 1230 if (free_buf) 75f4e3619fe202 Suzuki K Poulose 2018-07-11 1231 tmc_etr_free_sysfs_buf(free_buf); 3651e0e04e2a01 James Clark 2023-03-08 1232 return drvdata->sysfs_buf; 3651e0e04e2a01 James Clark 2023-03-08 1233 } 3651e0e04e2a01 James Clark 2023-03-08 1234 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel