Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp264288rdb; Thu, 19 Oct 2023 04:04:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4C+fklnLMfXXe5emJbF3nbteM5SgdMMXmuExeWgdgAXmoWGZHfnECmUxCvewA3jU78rb6 X-Received: by 2002:a05:6a20:2446:b0:17a:d560:5d13 with SMTP id t6-20020a056a20244600b0017ad5605d13mr1842403pzc.22.1697713475766; Thu, 19 Oct 2023 04:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697713475; cv=none; d=google.com; s=arc-20160816; b=vjSHow6aV+q5lafCrg826Ljh84Kect4f5ybfprTBxcDf2Eh6p/C1DwvggN3iWKXuyU 6K2jBQBBDUm72bcvyXB2GBIUhjKzbDqHXf5JttDPwPR4hJKKnJ1ahscrqJHljX+2d7Oz e8oUTcw5JuyisEmEBd8uRRl3DLfdJluyuI8nh74aRkzusVHGx9xJNz9d1jDQW9bh/EUC UmkfDsfWoX5dFez2uhnqirozmJGhcgebpOoWez+x0IZ5aYeqfiRzo7BbeJcCg2AsNxyc 3tClim7LIWSCDWOs+z4jG9hhiqhz90yhhh2EyvM8vCHsTbcyQ9+4wQYXle4t8fei4f3+ JH6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UF/tya7qJuaESz6XEDI6S40zhfzgExwziADvuD98xUk=; fh=Z39ZXT9QATP3hSBZl+vxHVfAlmbGqHV96VPQD4pfHgE=; b=EaHTm9dQe/w7i0cR7bqMJVF8q4p8NCDqxF/rCGGl88qYTL6Pol2ZUmXnL3soI3mbPf kQ0WuvhHnpMM7hsQcI7XiyjgVmn1t3WAggt5RNcZMOSVZzSBJNgTiKt7DrXB/oQeZrkQ nqfUKCfAz5rhD0KmENj+Q2I9q8FZ/dfmUVzPsYedS+9HihehIJ6pog4tsgCEbPTgXFXC TX/3JLWci3bybeHPwPbSjf7Pszm5ZZcF9sK/0KHt+Auyt/9vlTYTbWiNOxm87QUHOsZ/ JkGcak73JoWgtpkV92sWiPj97P30C6DNRbP8HwhlxeFD9W6CBKXOE6M337F3rOtwjG5Y +rwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dty7tVuW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id d7-20020a656207000000b00563de199314si4050448pgv.896.2023.10.19.04.04.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 04:04:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dty7tVuW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id D9FA08182EF7; Thu, 19 Oct 2023 04:04:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345290AbjJSLEY (ORCPT + 99 others); Thu, 19 Oct 2023 07:04:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345224AbjJSLEX (ORCPT ); Thu, 19 Oct 2023 07:04:23 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAE0D119; Thu, 19 Oct 2023 04:04:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697713460; x=1729249460; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=zD1Nbo0e2j9JFXzrsBuYue3Ao3OZSe9Wd/XfAWure3M=; b=dty7tVuWl1I/Wmy7bYTbIkqUCrxcq3ids4M/HdvS4IUlYIkvlmNeLr7X ea9vKqtPT8Oz8EevCxXd7JRUMcbSuIJ0PV282VFg2LWWdxJopO7hkBghB JRyTY2vFeyl/Cgqw2CjoNcU0DvN9gydVDnBYtrfWll9/sjESy0VjribK6 2+GNRpv/cwEcx+1pnOBfd/RgBNHqKqwRXNwkCf0+2dj1bD6ATDhG3abDY AvmdJa/B08w+H1AWvQQs1jtMHEcDbU5e0/wOvjpHMUJP0XRAa70QDre0a 2rntuDnazqzyekE93ck0t8dBVIpbV7/SUobz7dAJeEXwahcnR46BpAkGn w==; X-IronPort-AV: E=McAfee;i="6600,9927,10867"; a="450443926" X-IronPort-AV: E=Sophos;i="6.03,237,1694761200"; d="scan'208";a="450443926" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2023 04:04:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,237,1694761200"; d="scan'208";a="4922323" Received: from lkp-server01.sh.intel.com (HELO 8917679a5d3e) ([10.239.97.150]) by fmviesa001.fm.intel.com with ESMTP; 19 Oct 2023 04:04:10 -0700 Received: from kbuild by 8917679a5d3e with local (Exim 4.96) (envelope-from ) id 1qtQov-00022e-1g; Thu, 19 Oct 2023 11:04:05 +0000 Date: Thu, 19 Oct 2023 19:03:47 +0800 From: kernel test robot To: Tanmay Shah , andersson@kernel.org, mathieu.poirier@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, michal.simek@amd.com, ben.levinsky@amd.com Cc: oe-kbuild-all@lists.linux.dev, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 4/4] remoteproc: zynqmp: parse TCM from device tree Message-ID: <202310191806.NjLsejwM-lkp@intel.com> References: <20231013042229.3954527-5-tanmay.shah@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231013042229.3954527-5-tanmay.shah@amd.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 19 Oct 2023 04:04:33 -0700 (PDT) Hi Tanmay, kernel test robot noticed the following build warnings: [auto build test WARNING on a7d272979d3a89b117ca2c547dc8a465c4f28635] url: https://github.com/intel-lab-lkp/linux/commits/Tanmay-Shah/dt-bindings-remoteproc-add-Tightly-Coupled-Memory-TCM-bindings/20231017-120805 base: a7d272979d3a89b117ca2c547dc8a465c4f28635 patch link: https://lore.kernel.org/r/20231013042229.3954527-5-tanmay.shah%40amd.com patch subject: [PATCH v6 4/4] remoteproc: zynqmp: parse TCM from device tree config: arm64-randconfig-002-20231019 (https://download.01.org/0day-ci/archive/20231019/202310191806.NjLsejwM-lkp@intel.com/config) compiler: aarch64-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231019/202310191806.NjLsejwM-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202310191806.NjLsejwM-lkp@intel.com/ All warnings (new ones prefixed by >>): drivers/remoteproc/xlnx_r5_remoteproc.c: In function 'zynqmp_r5_get_tcm_node_from_dt': >> drivers/remoteproc/xlnx_r5_remoteproc.c:1162:28: warning: array subscript 'struct mem_bank_data[0]' is partly outside array bounds of 'unsigned char[8]' [-Warray-bounds=] 1162 | tcm->da = (u32)abs_addr; | ^~ In file included from include/linux/dma-mapping.h:8, from drivers/remoteproc/xlnx_r5_remoteproc.c:8: In function 'devm_kzalloc', inlined from 'zynqmp_r5_get_tcm_node_from_dt' at drivers/remoteproc/xlnx_r5_remoteproc.c:1143:10: include/linux/device.h:314:16: note: object of size 8 allocated by 'devm_kmalloc' 314 | return devm_kmalloc(dev, size, gfp | __GFP_ZERO); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/remoteproc/xlnx_r5_remoteproc.c: In function 'zynqmp_r5_get_tcm_node_from_dt': drivers/remoteproc/xlnx_r5_remoteproc.c:1163:28: warning: array subscript 'struct mem_bank_data[0]' is partly outside array bounds of 'unsigned char[8]' [-Warray-bounds=] 1163 | tcm->size = (u32)size; | ^~ In function 'devm_kzalloc', inlined from 'zynqmp_r5_get_tcm_node_from_dt' at drivers/remoteproc/xlnx_r5_remoteproc.c:1143:10: include/linux/device.h:314:16: note: object of size 8 allocated by 'devm_kmalloc' 314 | return devm_kmalloc(dev, size, gfp | __GFP_ZERO); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/remoteproc/xlnx_r5_remoteproc.c: In function 'zynqmp_r5_get_tcm_node_from_dt': drivers/remoteproc/xlnx_r5_remoteproc.c:1172:28: warning: array subscript 'struct mem_bank_data[0]' is partly outside array bounds of 'unsigned char[8]' [-Warray-bounds=] 1172 | tcm->addr = (u32)res->start; | ^~ In function 'devm_kzalloc', inlined from 'zynqmp_r5_get_tcm_node_from_dt' at drivers/remoteproc/xlnx_r5_remoteproc.c:1143:10: include/linux/device.h:314:16: note: object of size 8 allocated by 'devm_kmalloc' 314 | return devm_kmalloc(dev, size, gfp | __GFP_ZERO); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/remoteproc/xlnx_r5_remoteproc.c: In function 'zynqmp_r5_get_tcm_node_from_dt': drivers/remoteproc/xlnx_r5_remoteproc.c:1173:28: warning: array subscript 'struct mem_bank_data[0]' is partly outside array bounds of 'unsigned char[8]' [-Warray-bounds=] 1173 | tcm->bank_name = (char *)res->name; | ^~ In function 'devm_kzalloc', inlined from 'zynqmp_r5_get_tcm_node_from_dt' at drivers/remoteproc/xlnx_r5_remoteproc.c:1143:10: include/linux/device.h:314:16: note: object of size 8 allocated by 'devm_kmalloc' 314 | return devm_kmalloc(dev, size, gfp | __GFP_ZERO); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from include/linux/device.h:17: drivers/remoteproc/xlnx_r5_remoteproc.c: In function 'zynqmp_r5_get_tcm_node_from_dt': drivers/remoteproc/xlnx_r5_remoteproc.c:1174:74: warning: array subscript 'struct mem_bank_data[0]' is partly outside array bounds of 'unsigned char[8]' [-Warray-bounds=] 1174 | res = devm_request_mem_region(dev, tcm->addr, tcm->size, | ^~ include/linux/ioport.h:306:63: note: in definition of macro 'devm_request_mem_region' 306 | __devm_request_region(dev, &iomem_resource, (start), (n), (name)) | ^ In function 'devm_kzalloc', inlined from 'zynqmp_r5_get_tcm_node_from_dt' at drivers/remoteproc/xlnx_r5_remoteproc.c:1143:10: include/linux/device.h:314:16: note: object of size 8 allocated by 'devm_kmalloc' 314 | return devm_kmalloc(dev, size, gfp | __GFP_ZERO); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim +1162 drivers/remoteproc/xlnx_r5_remoteproc.c 1108 1109 static int zynqmp_r5_get_tcm_node_from_dt(struct zynqmp_r5_cluster *cluster) 1110 { 1111 struct zynqmp_r5_core *r5_core; 1112 int i, j, tcm_bank_count, ret; 1113 struct platform_device *cpdev; 1114 struct mem_bank_data *tcm; 1115 struct device_node *np; 1116 struct resource *res; 1117 u64 abs_addr, size; 1118 struct device *dev; 1119 1120 for (i = 0; i < cluster->core_count; i++) { 1121 r5_core = cluster->r5_cores[i]; 1122 dev = r5_core->dev; 1123 np = dev_of_node(dev); 1124 1125 /* we have address cell 2 and size cell as 2 */ 1126 ret = of_property_count_elems_of_size(np, "reg", 1127 4 * sizeof(u32)); 1128 if (ret <= 0) { 1129 dev_err(dev, "can't get reg property err %d\n", ret); 1130 return -EINVAL; 1131 } 1132 1133 tcm_bank_count = ret; 1134 1135 r5_core->tcm_banks = devm_kcalloc(dev, tcm_bank_count, 1136 sizeof(struct mem_bank_data *), 1137 GFP_KERNEL); 1138 if (!r5_core->tcm_banks) 1139 ret = -ENOMEM; 1140 1141 r5_core->tcm_bank_count = tcm_bank_count; 1142 for (j = 0; j < tcm_bank_count; j++) { 1143 tcm = devm_kzalloc(dev, sizeof(struct mem_bank_data *), 1144 GFP_KERNEL); 1145 if (!tcm) 1146 return -ENOMEM; 1147 1148 r5_core->tcm_banks[j] = tcm; 1149 1150 /* get tcm address without translation */ 1151 ret = of_property_read_reg(np, j, &abs_addr, &size); 1152 if (ret) { 1153 dev_err(dev, "failed to get reg property\n"); 1154 return ret; 1155 } 1156 1157 /* 1158 * remote processor can address only 32 bits 1159 * so convert 64-bits into 32-bits. This will discard 1160 * any unwanted upper 32-bits. 1161 */ > 1162 tcm->da = (u32)abs_addr; 1163 tcm->size = (u32)size; 1164 1165 cpdev = to_platform_device(dev); 1166 res = platform_get_resource(cpdev, IORESOURCE_MEM, j); 1167 if (!res) { 1168 dev_err(dev, "failed to get tcm resource\n"); 1169 return -EINVAL; 1170 } 1171 1172 tcm->addr = (u32)res->start; 1173 tcm->bank_name = (char *)res->name; 1174 res = devm_request_mem_region(dev, tcm->addr, tcm->size, 1175 tcm->bank_name); 1176 if (!res) { 1177 dev_err(dev, "failed to request tcm resource\n"); 1178 return -EINVAL; 1179 } 1180 } 1181 } 1182 1183 return 0; 1184 } 1185 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki