Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp768625imm; Wed, 1 Aug 2018 05:07:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcATZt9lu+4QvP8HyTeW+O2hdXa+7NDt1sdBMZ7UgZfWlrlAwUyPd+cQYbpF66S6BX/qm5h X-Received: by 2002:a63:460d:: with SMTP id t13-v6mr24137083pga.201.1533125242720; Wed, 01 Aug 2018 05:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533125242; cv=none; d=google.com; s=arc-20160816; b=ovmG6Y5hFTePyVgHo4c5omp11wdtdDUbvCj7/prOEqahOCcwBcNbWCFDXOAlCwPKxW sj3lY7fjwzSWA/RbGFg4yX0jrkP6y3pekKooMn8MXavnfysFzUeIS7crilftdnOur5WU plp7rLuYK40ycqbgrSKfsavU6B1obPQN2P2DwUI9igAojAhbEWl90snoEFyOvrjXEFtO RL74d+pGU8290HXY79G6fjPN+m9tzCRrMhkk9+qCM/qANlssqEJKHfD4WHMPgW/1sAqf XoybPbxBCcez2x9msL70hGL7emtr1fuu5QF5Q2eS+yuDybklFSUXqGJWX8sE4tWg7emr 4X1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=3TAUidmNFy1cHdWg/dKHkCv8a+/7oVcznM0BcNRE97o=; b=pCj2vMcAwNN4pwrCFlOi+/0aEmYauLB2pP7dPZb0gn1G/SVScjf/h1odoiXPK2OcGA aUv6Fy9OWFH9w66N7e8SFlFP7bCwj2EWk4QYxf8NUiBaECH6p0s6Oa3N1B8E/dHjj8PQ vVjoyRZcdpJG342DEFmb0+plOkSdJYwtc+A5JjLDa47tY/KrsKzp/JX9MXc6QKORA0ED ALspiPN4qDw1jJM9cqv5DOKcTi0Qmd4Nk+FksK4tibll9LsVTShatG+POSqWN+B4Jiha myk2cks028LmfS0BYQ+H88Muh1dL3fJb9Tb2zdPLCUU1PRSyTWfbiXZ+5h2HQhPh2rK/ VaTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=Wmb8pV0X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s10-v6si14133276pgv.47.2018.08.01.05.07.08; Wed, 01 Aug 2018 05:07:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=Wmb8pV0X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389103AbeHANvm (ORCPT + 99 others); Wed, 1 Aug 2018 09:51:42 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:41426 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389076AbeHANvm (ORCPT ); Wed, 1 Aug 2018 09:51:42 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w71C3QvF015888; Wed, 1 Aug 2018 12:06:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=3TAUidmNFy1cHdWg/dKHkCv8a+/7oVcznM0BcNRE97o=; b=Wmb8pV0X4VenWRV035hU52AuctXyE59eyk9Fh3CVLCpIvwWFosso3/UVbE+LQtzMwIKa u88zdGCz5G7I5oNDJ9+qg/SpgzsVrBRDTjU1eZLBgAYDRHqYLJHsKyHdbjUUwZ/kELtZ alTAYhDaYDYcPGwY3lb5A+N9b+/iRScGe8AWZ3Wd/J07kEwVHQi69T1lqnUNQt6nxdiS SrRWsvtK7hLs0suJE/TZzmEstW7sirqRh07AIm6B1M/KNOVyYAnQFG2/V+3mQBJqJDq+ 0oykIo9RtidgOqZmXwwdU+2nLiJgOzNhrZ2ADEI/zs+3mtGGzfHZZWQqQIvI9GjD5i/K OA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2kgfwt5chw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Aug 2018 12:06:03 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w71C61H2020043 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 Aug 2018 12:06:01 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w71C60oi010285; Wed, 1 Aug 2018 12:06:00 GMT Received: from mwanda (/197.232.248.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 01 Aug 2018 05:05:59 -0700 Date: Wed, 1 Aug 2018 15:05:51 +0300 From: Dan Carpenter To: Jheng-Jhong Wu , Palle Christensen Cc: devel@driverdev.osuosl.org, Boris Brezillon , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Palle Christensen , Masahiro Yamada , Arun Nagendran , Miquel Raynal Subject: Re: [PATCH] staging:mt29f_spinand: MT29F2G failing as only 16-bit arguments and variables used for addressing. Message-ID: <20180801120551.ju6zhxhoef6w5zim@mwanda> References: <1533093861-9761-1-git-send-email-goodwater.wu@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1533093861-9761-1-git-send-email-goodwater.wu@gmail.com> User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8971 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1808010128 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 01, 2018 at 11:24:19AM +0800, Jheng-Jhong Wu wrote: > For NAND flash chips with more than 1Gbit (e.g. MT29F2G) more than 16 bits > are necessary to address the correct page. The driver sets the address for > more than 16 bits, but it uses 16-bit arguments and variables (these are > page_id, block_id, row) to do address operations. Obviously, these > arguments and variables cannot deal with more than 16-bit address. > > Signed-off-by: Jheng-Jhong Wu This seems reasonable... It would be needed to make commit 6efb21d6d0e7 ("staging:mt29f_spinand: MT29F2G failing as only 16 bits used for addressing.") work. It also fixes a static checker warning. My only concern is that the mtd/nand code seems to use -1 as a magical page_id. For example: 2069 /** 2070 * nand_exit_status_op - Exit a STATUS operation 2071 * @chip: The NAND chip 2072 * 2073 * This function sends a READ0 command to cancel the effect of the STATUS 2074 * command to avoid reading only the status until a new read command is sent. 2075 * 2076 * This function does not select/unselect the CS line. 2077 * 2078 * Returns 0 on success, a negative error code otherwise. 2079 */ 2080 int nand_exit_status_op(struct nand_chip *chip) 2081 { 2082 struct mtd_info *mtd = nand_to_mtd(chip); 2083 2084 if (chip->exec_op) { 2085 struct nand_op_instr instrs[] = { 2086 NAND_OP_CMD(NAND_CMD_READ0, 0), 2087 }; 2088 struct nand_operation op = NAND_OPERATION(instrs); 2089 2090 return nand_exec_op(chip, &op); 2091 } 2092 2093 chip->cmdfunc(mtd, NAND_CMD_READ0, -1, -1); ^^^^^^^^^^^^^^ ^^ 2094 2095 return 0; 2096 } 2097 EXPORT_SYMBOL_GPL(nand_exit_status_op); I'm not sure if this affect spinand_read_page() etc. regards, dan carpenter