Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2721365rdb; Fri, 22 Sep 2023 06:50:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEMJ51p0IEu6MMJQEi4/bCBPj3bnF9H8l9RR8tB37L+1HUYrN6IeKmCr0ZgzpmZOH0/Iomt X-Received: by 2002:a17:902:ced1:b0:1bc:8c6c:217d with SMTP id d17-20020a170902ced100b001bc8c6c217dmr9051420plg.61.1695390632849; Fri, 22 Sep 2023 06:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695390632; cv=none; d=google.com; s=arc-20160816; b=fVsP4Eftn2CtIBMopfN+GwS0thzSY+/zzHAQLvuT+0w++CesI4CzaDziTOcKMBFe1h hBF9QBO8OHc+q+U0YZoqftOHGO9Dd2Wfb2EXqvDGP4l6XKmf2TdNIvRFOalpiG/aEaoN heOcFEDOVv0VHTpTrXrKHtCw2w8HGTR3dFHmG66pU/F/DqkuWD9N+XiCVXfTZ6vBmDUO V/x2HNsoEVMDXwv3a0fsSkbsPLTZCzbyq+ApG38Z/cGbax+ani/rUPzCua07gDgu7gbm uAdPI19vdmTnZBjeFyInK+EyqWt1CEKpRayZgXfXyVtS0Er+G1HVr3ZVDY1AKQ+wOkXI cn8g== 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=EybrjM4esmh9woe6+rG1AbuR3jkha+4WVrnoJvc0aPo=; fh=ub60Dw7AafvWIssClMhBvljVIt1wFmLIpEGFtJn7AxI=; b=snLUcPlxCTqUVHufj0J+xPIjLGWyRETTKPxXlf1g3nIz5RmBe708qfgy3yS+V1o0sj z9bDdLNx4yopd3IUzLzluADHnxBvYfz9pOOUH8mtPWlwwaFxPHQ2cfVQONHqbPcIL+Ux 1LznQlJcgVA1P+ugMfH8bDzVTt1QmEuuEmJ8u8YT/ca+OiZVZGcRuHhFRbSsSH3A4SeZ 80/+Mcc5p1i2ldBg02kOF+wEGXaBhgHTA7eHpTQF9LjMSLCltvDB9rmBUCYFR6Mve8Ky sMVMM1nYmcXUNWo3PV31zOF+RjpnGEup+vuNA8yRpvwmtUeD51iaLb6ymHPRKk6uNWAW psqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AXW1B+ht; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id lc13-20020a170902fa8d00b001be025f8407si3741528plb.37.2023.09.22.06.50.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 06:50:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AXW1B+ht; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id ECEBE83C2276; Fri, 22 Sep 2023 04:20:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233551AbjIVLUy (ORCPT + 99 others); Fri, 22 Sep 2023 07:20:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233384AbjIVLUw (ORCPT ); Fri, 22 Sep 2023 07:20:52 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C9D1AC for ; Fri, 22 Sep 2023 04:20:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695381646; x=1726917646; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=n4Hqh+EesdfCfNWk8JXFJpfFC9hBA4g5JNHzJZ8272A=; b=AXW1B+htjfusHmxvJTgol5gn3N++CKxZZNC5GAZtbU80+ZZbgG4HH7+q vAy3w/gdL0iR7oLOWOpoAA+v8Y6aoMXbl2muiTSqNTrrAFdoQEEsTTtuw WgdvOyDzUjA7y8iuvImXiJWPecrPuWxxDCRjuJVONX8KyLgBBpEb2TO+5 Hr7PpZcCgig2kEGg9YvSRN2s4cdgmkH0vWopyuoDCMr8+yQsmk/de9q46 dpOtbQL4uqGLrGBxJhzpCUEPoHKfz34cO3jchUZB8bDHHdOnd+vVY5vEf 8nJLkCvL29DL4Yevo3LFoGasJEhzHqy2qif2nfExiXXy2ilIvs8FUcR8s Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="360183553" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="360183553" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2023 04:20:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="921121964" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="921121964" Received: from lkp-server02.sh.intel.com (HELO 493f6c7fed5d) ([10.239.97.151]) by orsmga005.jf.intel.com with ESMTP; 22 Sep 2023 04:20:42 -0700 Received: from kbuild by 493f6c7fed5d with local (Exim 4.96) (envelope-from ) id 1qjeDA-0000b7-0N; Fri, 22 Sep 2023 11:20:40 +0000 Date: Fri, 22 Sep 2023 19:20:32 +0800 From: kernel test robot To: Rouven Czerwinski , Martin =?iso-8859-1?Q?Hundeb=F8ll?= , =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , JaimeLiao Cc: oe-kbuild-all@lists.linux.dev, kernel@pengutronix.de, Rouven Czerwinski , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mtd: rawnand: check nand support for cache reads Message-ID: <202309221938.wpGSSUjJ-lkp@intel.com> References: <20230922100116.145090-1-r.czerwinski@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230922100116.145090-1-r.czerwinski@pengutronix.de> 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,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Fri, 22 Sep 2023 04:20:57 -0700 (PDT) Hi Rouven, kernel test robot noticed the following build warnings: [auto build test WARNING on linus/master] [also build test WARNING on v6.6-rc2 next-20230921] [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/Rouven-Czerwinski/mtd-rawnand-check-nand-support-for-cache-reads/20230922-180317 base: linus/master patch link: https://lore.kernel.org/r/20230922100116.145090-1-r.czerwinski%40pengutronix.de patch subject: [PATCH] mtd: rawnand: check nand support for cache reads config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20230922/202309221938.wpGSSUjJ-lkp@intel.com/config) compiler: m68k-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230922/202309221938.wpGSSUjJ-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/202309221938.wpGSSUjJ-lkp@intel.com/ All warnings (new ones prefixed by >>): drivers/mtd/nand/raw/nand_onfi.c: In function 'nand_onfi_detect': >> drivers/mtd/nand/raw/nand_onfi.c:307:33: warning: statement with no effect [-Wunused-value] 307 | chip->parameters.supports_read_cache; | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ -- drivers/mtd/nand/raw/nand_jedec.c: In function 'nand_jedec_detect': >> drivers/mtd/nand/raw/nand_jedec.c:98:33: warning: statement with no effect [-Wunused-value] 98 | chip->parameters.supports_read_cache; | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ vim +307 drivers/mtd/nand/raw/nand_onfi.c 140 141 /* 142 * Check if the NAND chip is ONFI compliant, returns 1 if it is, 0 otherwise. 143 */ 144 int nand_onfi_detect(struct nand_chip *chip) 145 { 146 struct nand_device *base = &chip->base; 147 struct mtd_info *mtd = nand_to_mtd(chip); 148 struct nand_memory_organization *memorg; 149 struct nand_onfi_params *p = NULL, *pbuf; 150 struct onfi_params *onfi; 151 bool use_datain = false; 152 int onfi_version = 0; 153 char id[4]; 154 int i, ret, val; 155 u16 crc; 156 157 memorg = nanddev_get_memorg(&chip->base); 158 159 /* Try ONFI for unknown chip or LP */ 160 ret = nand_readid_op(chip, 0x20, id, sizeof(id)); 161 if (ret || strncmp(id, "ONFI", 4)) 162 return 0; 163 164 /* ONFI chip: allocate a buffer to hold its parameter page */ 165 pbuf = kzalloc((sizeof(*pbuf) * ONFI_PARAM_PAGES), GFP_KERNEL); 166 if (!pbuf) 167 return -ENOMEM; 168 169 if (!nand_has_exec_op(chip) || chip->controller->supported_op.data_only_read) 170 use_datain = true; 171 172 for (i = 0; i < ONFI_PARAM_PAGES; i++) { 173 if (!i) 174 ret = nand_read_param_page_op(chip, 0, &pbuf[i], 175 sizeof(*pbuf)); 176 else if (use_datain) 177 ret = nand_read_data_op(chip, &pbuf[i], sizeof(*pbuf), 178 true, false); 179 else 180 ret = nand_change_read_column_op(chip, sizeof(*pbuf) * i, 181 &pbuf[i], sizeof(*pbuf), 182 true); 183 if (ret) { 184 ret = 0; 185 goto free_onfi_param_page; 186 } 187 188 crc = onfi_crc16(ONFI_CRC_BASE, (u8 *)&pbuf[i], 254); 189 if (crc == le16_to_cpu(pbuf[i].crc)) { 190 p = &pbuf[i]; 191 break; 192 } 193 } 194 195 if (i == ONFI_PARAM_PAGES) { 196 const void *srcbufs[ONFI_PARAM_PAGES]; 197 unsigned int j; 198 199 for (j = 0; j < ONFI_PARAM_PAGES; j++) 200 srcbufs[j] = pbuf + j; 201 202 pr_warn("Could not find a valid ONFI parameter page, trying bit-wise majority to recover it\n"); 203 nand_bit_wise_majority(srcbufs, ONFI_PARAM_PAGES, pbuf, 204 sizeof(*pbuf)); 205 206 crc = onfi_crc16(ONFI_CRC_BASE, (u8 *)pbuf, 254); 207 if (crc != le16_to_cpu(pbuf->crc)) { 208 pr_err("ONFI parameter recovery failed, aborting\n"); 209 goto free_onfi_param_page; 210 } 211 p = pbuf; 212 } 213 214 if (chip->manufacturer.desc && chip->manufacturer.desc->ops && 215 chip->manufacturer.desc->ops->fixup_onfi_param_page) 216 chip->manufacturer.desc->ops->fixup_onfi_param_page(chip, p); 217 218 /* Check version */ 219 val = le16_to_cpu(p->revision); 220 if (val & ONFI_VERSION_2_3) 221 onfi_version = 23; 222 else if (val & ONFI_VERSION_2_2) 223 onfi_version = 22; 224 else if (val & ONFI_VERSION_2_1) 225 onfi_version = 21; 226 else if (val & ONFI_VERSION_2_0) 227 onfi_version = 20; 228 else if (val & ONFI_VERSION_1_0) 229 onfi_version = 10; 230 231 if (!onfi_version) { 232 pr_info("unsupported ONFI version: %d\n", val); 233 goto free_onfi_param_page; 234 } 235 236 sanitize_string(p->manufacturer, sizeof(p->manufacturer)); 237 sanitize_string(p->model, sizeof(p->model)); 238 chip->parameters.model = kstrdup(p->model, GFP_KERNEL); 239 if (!chip->parameters.model) { 240 ret = -ENOMEM; 241 goto free_onfi_param_page; 242 } 243 244 memorg->pagesize = le32_to_cpu(p->byte_per_page); 245 mtd->writesize = memorg->pagesize; 246 247 /* 248 * pages_per_block and blocks_per_lun may not be a power-of-2 size 249 * (don't ask me who thought of this...). MTD assumes that these 250 * dimensions will be power-of-2, so just truncate the remaining area. 251 */ 252 memorg->pages_per_eraseblock = 253 1 << (fls(le32_to_cpu(p->pages_per_block)) - 1); 254 mtd->erasesize = memorg->pages_per_eraseblock * memorg->pagesize; 255 256 memorg->oobsize = le16_to_cpu(p->spare_bytes_per_page); 257 mtd->oobsize = memorg->oobsize; 258 259 memorg->luns_per_target = p->lun_count; 260 memorg->planes_per_lun = 1 << p->interleaved_bits; 261 262 /* See erasesize comment */ 263 memorg->eraseblocks_per_lun = 264 1 << (fls(le32_to_cpu(p->blocks_per_lun)) - 1); 265 memorg->max_bad_eraseblocks_per_lun = le32_to_cpu(p->blocks_per_lun); 266 memorg->bits_per_cell = p->bits_per_cell; 267 268 if (le16_to_cpu(p->features) & ONFI_FEATURE_16_BIT_BUS) 269 chip->options |= NAND_BUSWIDTH_16; 270 271 if (p->ecc_bits != 0xff) { 272 struct nand_ecc_props requirements = { 273 .strength = p->ecc_bits, 274 .step_size = 512, 275 }; 276 277 nanddev_set_ecc_requirements(base, &requirements); 278 } else if (onfi_version >= 21 && 279 (le16_to_cpu(p->features) & ONFI_FEATURE_EXT_PARAM_PAGE)) { 280 281 /* 282 * The nand_flash_detect_ext_param_page() uses the 283 * Change Read Column command which maybe not supported 284 * by the chip->legacy.cmdfunc. So try to update the 285 * chip->legacy.cmdfunc now. We do not replace user supplied 286 * command function. 287 */ 288 nand_legacy_adjust_cmdfunc(chip); 289 290 /* The Extended Parameter Page is supported since ONFI 2.1. */ 291 if (nand_flash_detect_ext_param_page(chip, p)) 292 pr_warn("Failed to detect ONFI extended param page\n"); 293 } else { 294 pr_warn("Could not retrieve ONFI ECC requirements\n"); 295 } 296 297 /* Save some parameters from the parameter page for future use */ 298 if (le16_to_cpu(p->opt_cmd) & ONFI_OPT_CMD_SET_GET_FEATURES) { 299 chip->parameters.supports_set_get_features = true; 300 bitmap_set(chip->parameters.get_feature_list, 301 ONFI_FEATURE_ADDR_TIMING_MODE, 1); 302 bitmap_set(chip->parameters.set_feature_list, 303 ONFI_FEATURE_ADDR_TIMING_MODE, 1); 304 } 305 306 if (le16_to_cpu(p->opt_cmd) & ONFI_OPT_CMD_READ_CACHE) > 307 chip->parameters.supports_read_cache; -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki