From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.12 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796109299; b=dKOv3R0jyzuG29/ZnZgP7vKOTddyqDo7wQ8h8HLXY+VifLVUtCjX3WBxg0Y60VOXwdnU SdXTs1cpt9vv9zFqRUeXWRBgG2xgNgDR+d0QcIJQ6UpkOnE8wslSSIUh8zxZD4oo42WM/ PcEHbzhX8yzosa2/zLIpNe+0vxgH9hZWltwoJyuovqJBRfX+HXzgM0PFAXoT/l2cmkIEN PZkuHYOBz6I+CFsthafbpFfvH7B6xkco1u7Syu05dKvAtdjH6WQwIc+1fYRzc1iPdQQ6Z CHSuwXLa9/W1rPnTO1fXllOx8Zh9Mnm9tCK2A1222A6eFWGsqgpgvXsSfELOtalOzKg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796109299; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Received:Date:From:To: Cc:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition; bh=5TiUPO0AYraPoJTjQSrOLYcrJIGuPAdjYjH0eS1AIDo=; b=BJvS8hPJH79wZc754MwR9WjOR2CIkKGCRnspicZxo212emCaLxGvmPoO3EIDP9W5MDpi T+cBuTFTbLV3oLp4xatZTaTiKOIsfYbRU4RgEOMv0EihRA3IZuWppI4cy/FjMxu9MBAkD djNsMZj9nh1xmmzRXxId9DtGSaEcos1NZ1+6YuIcOyR6uK5Z23YtUzAy2N2CrttymetGg 7Me8NkKK3c6qNIC7LkBC+NerGZ22O0N3OvpMQlX2lAmgTT3WN4J8EXUtSYmWKT+vcZafJ I/yHqc6/oViFvloLU21DSXAyuDjTeXZg5PIzlSe+aK08ZIr0E7W+HebeH0i0VmoTK5Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=FF+I5fDs; arc=none smtp.remote-ip=198.175.65.12 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EEE4606A6AA for ; Tue, 1 Dec 2026 07:14:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6EEE4606A6AA Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=FF+I5fDs DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796109295; x=1827645295; h=date:from:to:cc:subject:message-id:mime-version; bh=5TiUPO0AYraPoJTjQSrOLYcrJIGuPAdjYjH0eS1AIDo=; b=FF+I5fDsJ3PgukzI/mWj4rqkaGKlsJ1MQR0oM83v+/p/b91HPsJTvB/w hF6XtvxuFCo2eonWJzTUU6dKUb886wna+D9jUt96N8pAiQecJCb3hRLr/ moo26aoiCDHCE33yl2rsbD9U9nakevkxDK9acm5k2d55lDTAPtRFNNKZK ZtFutCcGK8HoEoZ2puUxvcf5ludAw3OllmuSqNy4dgMFauNEOzYb0qp9E Teo0f7iS3hX2jDqkb39kn19Gw3nDYUmkC6Y1qVd/KLNCK92QK0yLtvYiT NSwd/Dw3SqP8CNLBygMoiODYdIGrHwObOr5S4YM0GnaNJAzu78TneYBoo g==; X-CSE-ConnectionGUID: gf8dh5iNT1+/nl72Fs/P0A== X-CSE-MsgGUID: 7rIFdGPUR7aQzTojmXIGwA== X-IronPort-AV: E=McAfee;i="6800,10657,11982"; a="4879025" X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="4879025" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 23:14:54 -0800 X-CSE-ConnectionGUID: ce7Jx+wtR/ekxV3cRAVr6Q== X-CSE-MsgGUID: vvxqzD3rRYe1qVoRB0HyEA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="13386847" Received: from igk-lkp-server01.igk.intel.com (HELO 146cf1e082f1) ([10.211.93.152]) by fmviesa003.fm.intel.com with ESMTP; 30 Nov 2026 23:14:53 -0800 Received: from kbuild by 146cf1e082f1 with local (Exim 4.98.2) (envelope-from ) id 1xYI4h-000000001as-2KiD; Tue, 01 Dec 2026 07:14:51 +0000 Date: Tue, 1 Dec 2026 08:14:00 +0100 From: kernel test robot To: oe-kbuild@lists.linux.dev Cc: lkp@intel.com, Dan Carpenter Subject: Re: [PATCH v5 2/3] mtd: rawnand: Add Cortina CS7542 controller support Message-ID: <20261201080340.G4oDRTAt-lkp@intel.com> X-Mailing-List: oe-kbuild@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Unfiltered warning: this smatch report is sent as-is and has not been reviewed for false positives, so please treat it with due skepticism. BCC: lkp@intel.com CC: oe-kbuild-all@lists.linux.dev In-Reply-To: <20261127-b4-cs7542-nand-v5-2-45b1a92bd13d@gmail.com> References: <20261127-b4-cs7542-nand-v5-2-45b1a92bd13d@gmail.com> TO: Fil Dunsky via B4 Relay TO: Miquel Raynal TO: Richard Weinberger TO: Vignesh Raghavendra TO: Rob Herring TO: Krzysztof Kozlowski TO: Conor Dooley TO: Philipp Zabel CC: linux-mtd@lists.infradead.org CC: devicetree@vger.kernel.org CC: linux-kernel@vger.kernel.org Hi Fil, kernel test robot noticed the following build warnings: [auto build test WARNING on b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f] url: https://github.com/intel-lab-lkp/linux/commits/Fil-Dunsky-via-B4-Relay/dt-bindings-mtd-Add-Cortina-CS7542-NAND-controller/20261127-185404 base: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f patch link: https://lore.kernel.org/r/20261127-b4-cs7542-nand-v5-2-45b1a92bd13d%40gmail.com patch subject: [PATCH v5 2/3] mtd: rawnand: Add Cortina CS7542 controller support :::::: branch date: 4 days ago :::::: commit date: 4 days ago config: arm64-randconfig-2200-20261201 (https://download.01.org/0day-ci/archive/20261201/20261201080340.G4oDRTAt-lkp@intel.com/config) compiler: aarch64-linux-gcc (GCC) 8.5.0 smatch: v0.5.0-9187-g5189e3fb 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 | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/20261201080340.G4oDRTAt-lkp@intel.com/ smatch warnings: drivers/mtd/nand/raw/cs752x_nand.c:477 cs752x_nand_exec_op() error: we previously assumed 'p.data' could be null (see line 466) vim +477 drivers/mtd/nand/raw/cs752x_nand.c fef89bafa0003f3 Fil Dunsky 2026-11-27 453 fef89bafa0003f3 Fil Dunsky 2026-11-27 454 static int cs752x_nand_exec_op(struct nand_chip *chip, fef89bafa0003f3 Fil Dunsky 2026-11-27 455 const struct nand_operation *op, bool check_only) fef89bafa0003f3 Fil Dunsky 2026-11-27 456 { fef89bafa0003f3 Fil Dunsky 2026-11-27 457 struct cs752x_nand_host *h = to_host(chip); fef89bafa0003f3 Fil Dunsky 2026-11-27 458 struct mtd_info *mtd = nand_to_mtd(chip); fef89bafa0003f3 Fil Dunsky 2026-11-27 459 struct cs752x_nand_op p; fef89bafa0003f3 Fil Dunsky 2026-11-27 460 unsigned int len, requested, col; fef89bafa0003f3 Fil Dunsky 2026-11-27 461 int ret; fef89bafa0003f3 Fil Dunsky 2026-11-27 462 fef89bafa0003f3 Fil Dunsky 2026-11-27 463 ret = cs752x_nand_supports_op(op, &p); fef89bafa0003f3 Fil Dunsky 2026-11-27 464 if (ret || check_only) fef89bafa0003f3 Fil Dunsky 2026-11-27 465 return ret; fef89bafa0003f3 Fil Dunsky 2026-11-27 @466 requested = p.data ? p.data->ctx.data.len : 0; fef89bafa0003f3 Fil Dunsky 2026-11-27 467 if (!p.ncmds && p.wait_ready) { fef89bafa0003f3 Fil Dunsky 2026-11-27 468 ret = cs752x_nand_wait_ready(h, p.timeout_ms); fef89bafa0003f3 Fil Dunsky 2026-11-27 469 if (p.delay_ns) fef89bafa0003f3 Fil Dunsky 2026-11-27 470 ndelay(p.delay_ns); fef89bafa0003f3 Fil Dunsky 2026-11-27 471 return ret; fef89bafa0003f3 Fil Dunsky 2026-11-27 472 } fef89bafa0003f3 Fil Dunsky 2026-11-27 473 if (h->use_hwecc && p.data && p.ncmds == 2 && fef89bafa0003f3 Fil Dunsky 2026-11-27 474 p.naddrs >= 4 && !(p.address & 0xffff) && fef89bafa0003f3 Fil Dunsky 2026-11-27 475 requested == mtd->writesize) fef89bafa0003f3 Fil Dunsky 2026-11-27 476 return cs752x_nand_hwecc_op(h, &p); fef89bafa0003f3 Fil Dunsky 2026-11-27 @477 if (!p.ncmds && p.data->type == NAND_OP_DATA_OUT_INSTR) { fef89bafa0003f3 Fil Dunsky 2026-11-27 478 h->buf_data_len = 0; fef89bafa0003f3 Fil Dunsky 2026-11-27 479 h->buf_offs = 0; fef89bafa0003f3 Fil Dunsky 2026-11-27 480 return cs752x_nand_pio(h, &p, (u8 *)p.data->ctx.data.buf.out, fef89bafa0003f3 Fil Dunsky 2026-11-27 481 requested, true); fef89bafa0003f3 Fil Dunsky 2026-11-27 482 } fef89bafa0003f3 Fil Dunsky 2026-11-27 483 if (!p.ncmds) { fef89bafa0003f3 Fil Dunsky 2026-11-27 484 if (h->read_mode != NAND_CMD_STATUS) fef89bafa0003f3 Fil Dunsky 2026-11-27 485 goto cached; fef89bafa0003f3 Fil Dunsky 2026-11-27 486 if (requested != 1) fef89bafa0003f3 Fil Dunsky 2026-11-27 487 return -EOPNOTSUPP; fef89bafa0003f3 Fil Dunsky 2026-11-27 488 p.command = NAND_CMD_STATUS; fef89bafa0003f3 Fil Dunsky 2026-11-27 489 p.ncmds = 1; fef89bafa0003f3 Fil Dunsky 2026-11-27 490 } fef89bafa0003f3 Fil Dunsky 2026-11-27 491 if (p.command == (NAND_CMD_RNDOUT | (NAND_CMD_RNDOUTSTART << 8))) { fef89bafa0003f3 Fil Dunsky 2026-11-27 492 col = p.address; fef89bafa0003f3 Fil Dunsky 2026-11-27 493 if (h->read_mode != NAND_CMD_PARAM && h->read_mode != NAND_CMD_READ0) fef89bafa0003f3 Fil Dunsky 2026-11-27 494 return -EINVAL; fef89bafa0003f3 Fil Dunsky 2026-11-27 495 if (col < h->cache_column || col - h->cache_column > h->buf_data_len) fef89bafa0003f3 Fil Dunsky 2026-11-27 496 return -EINVAL; fef89bafa0003f3 Fil Dunsky 2026-11-27 497 h->buf_offs = col - h->cache_column; fef89bafa0003f3 Fil Dunsky 2026-11-27 498 goto cached; fef89bafa0003f3 Fil Dunsky 2026-11-27 499 } fef89bafa0003f3 Fil Dunsky 2026-11-27 500 h->buf_offs = 0; fef89bafa0003f3 Fil Dunsky 2026-11-27 501 h->buf_data_len = 0; fef89bafa0003f3 Fil Dunsky 2026-11-27 502 h->read_mode = p.command & 0xff; fef89bafa0003f3 Fil Dunsky 2026-11-27 503 h->cache_column = 0; fef89bafa0003f3 Fil Dunsky 2026-11-27 504 len = p.data && p.data->type == NAND_OP_DATA_IN_INSTR ? requested : 0; fef89bafa0003f3 Fil Dunsky 2026-11-27 505 switch (p.command) { fef89bafa0003f3 Fil Dunsky 2026-11-27 506 case NAND_CMD_READID: fef89bafa0003f3 Fil Dunsky 2026-11-27 507 len = max(requested, 8U); fef89bafa0003f3 Fil Dunsky 2026-11-27 508 break; fef89bafa0003f3 Fil Dunsky 2026-11-27 509 case NAND_CMD_PARAM: fef89bafa0003f3 Fil Dunsky 2026-11-27 510 /* Keep all standard ONFI copies plus room for extended parameters. */ fef89bafa0003f3 Fil Dunsky 2026-11-27 511 len = sizeof(h->own_buf); fef89bafa0003f3 Fil Dunsky 2026-11-27 512 break; fef89bafa0003f3 Fil Dunsky 2026-11-27 513 case NAND_CMD_STATUS: fef89bafa0003f3 Fil Dunsky 2026-11-27 514 len = 1; fef89bafa0003f3 Fil Dunsky 2026-11-27 515 break; fef89bafa0003f3 Fil Dunsky 2026-11-27 516 case NAND_CMD_READ0 | (NAND_CMD_READSTART << 8): fef89bafa0003f3 Fil Dunsky 2026-11-27 517 col = p.address & 0xffff; fef89bafa0003f3 Fil Dunsky 2026-11-27 518 if (col >= mtd->writesize + mtd->oobsize) fef89bafa0003f3 Fil Dunsky 2026-11-27 519 return -EINVAL; fef89bafa0003f3 Fil Dunsky 2026-11-27 520 h->cache_column = col; fef89bafa0003f3 Fil Dunsky 2026-11-27 521 len = mtd->writesize + mtd->oobsize - col; fef89bafa0003f3 Fil Dunsky 2026-11-27 522 break; fef89bafa0003f3 Fil Dunsky 2026-11-27 523 default: fef89bafa0003f3 Fil Dunsky 2026-11-27 524 break; fef89bafa0003f3 Fil Dunsky 2026-11-27 525 } fef89bafa0003f3 Fil Dunsky 2026-11-27 526 if (len > sizeof(h->own_buf) || (requested > len && fef89bafa0003f3 Fil Dunsky 2026-11-27 527 (!p.data || p.data->type == NAND_OP_DATA_IN_INSTR))) fef89bafa0003f3 Fil Dunsky 2026-11-27 528 return -EOPNOTSUPP; fef89bafa0003f3 Fil Dunsky 2026-11-27 529 if (p.data && p.data->type == NAND_OP_DATA_OUT_INSTR) fef89bafa0003f3 Fil Dunsky 2026-11-27 530 return cs752x_nand_pio(h, &p, (u8 *)p.data->ctx.data.buf.out, fef89bafa0003f3 Fil Dunsky 2026-11-27 531 requested, true); fef89bafa0003f3 Fil Dunsky 2026-11-27 532 fef89bafa0003f3 Fil Dunsky 2026-11-27 533 ret = cs752x_nand_pio(h, &p, h->own_buf, len, fef89bafa0003f3 Fil Dunsky 2026-11-27 534 p.command == NAND_CMD_RESET); fef89bafa0003f3 Fil Dunsky 2026-11-27 535 if (ret) fef89bafa0003f3 Fil Dunsky 2026-11-27 536 return ret; fef89bafa0003f3 Fil Dunsky 2026-11-27 537 h->buf_data_len = len; fef89bafa0003f3 Fil Dunsky 2026-11-27 538 cached: fef89bafa0003f3 Fil Dunsky 2026-11-27 539 if (!requested) fef89bafa0003f3 Fil Dunsky 2026-11-27 540 return 0; fef89bafa0003f3 Fil Dunsky 2026-11-27 541 if (h->buf_offs > h->buf_data_len || fef89bafa0003f3 Fil Dunsky 2026-11-27 542 requested > h->buf_data_len - h->buf_offs) fef89bafa0003f3 Fil Dunsky 2026-11-27 543 return -EOPNOTSUPP; fef89bafa0003f3 Fil Dunsky 2026-11-27 544 memcpy(p.data->ctx.data.buf.in, h->own_buf + h->buf_offs, requested); fef89bafa0003f3 Fil Dunsky 2026-11-27 545 h->buf_offs += requested; fef89bafa0003f3 Fil Dunsky 2026-11-27 546 return 0; fef89bafa0003f3 Fil Dunsky 2026-11-27 547 } fef89bafa0003f3 Fil Dunsky 2026-11-27 548 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki