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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47209C04AAF for ; Tue, 21 May 2019 07:33:19 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 1AE4E2173E for ; Tue, 21 May 2019 07:33:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="eCIyvTwz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AE4E2173E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject: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=9g/ZSSW1769sYPlcoNh31sLANR/PN0i4Uw87VgbWPes=; b=eCIyvTwzuHvrrJ ThXQYSej7yr4hX2sGIhlJUMKVforVI7+JzOFEsbLLtFuAw86HJn/lBVnqZq9CtFNyhHUu9i9t7sib hRyIb8qyoC8wqEbSiRls/254sYPFFaZisTWYOwpxHdPOsBBeDJiIF+RVT8De9jdsetuGtrbG9bzC7 /2KQCVSd0tQpGfii96EdKV9CoW9pvtgHJei7VtMP60Unbq+25sLvU3tm3qn3IGgI+s7HbTANSk4ls EL227AFSfxL8ka0RzoACnDy5otWGBIkU8XeovF1PCJ7YBAAv5ZMjhpwSbUQytf9g/Kfz7cq88CJgj tAXOA5xOOYuvUJxlTxSw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSzGr-0007Gt-An; Tue, 21 May 2019 07:33:13 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSzGn-0007EW-VM; Tue, 21 May 2019 07:33:11 +0000 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 9E41E2841E1; Tue, 21 May 2019 08:33:05 +0100 (BST) Date: Tue, 21 May 2019 09:33:02 +0200 From: Boris Brezillon To: Sascha Hauer Subject: Re: [PATCH v2 14/15] mtd: rawnand: Get rid of chip->numchips Message-ID: <20190521093302.079f5470@collabora.com> In-Reply-To: <20190521065948.GA16530@pengutronix.de> References: <20190304201522.11323-1-miquel.raynal@bootlin.com> <20190304201522.11323-15-miquel.raynal@bootlin.com> <20190521065948.GA16530@pengutronix.de> Organization: Collabora X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190521_003310_146729_1CD99A40 X-CRM114-Status: GOOD ( 20.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mason Yang , Vignesh R , Boris Brezillon , Julien Su , Richard Weinberger , Tudor Ambarus , Schrempf Frieder , Marek Vasut , Masahiro Yamada , linux-mtd@lists.infradead.org, Thomas Petazzoni , Miquel Raynal , Brian Norris , David Woodhouse , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 21 May 2019 08:59:48 +0200 Sascha Hauer wrote: > Hi, > > On Mon, Mar 04, 2019 at 09:15:21PM +0100, Miquel Raynal wrote: > > diff --git a/drivers/mtd/nand/raw/internals.h b/drivers/mtd/nand/raw/internals.h > > index fbf6ca015cd7..a204f9d7e123 100644 > > --- a/drivers/mtd/nand/raw/internals.h > > +++ b/drivers/mtd/nand/raw/internals.h > > @@ -110,7 +110,7 @@ static inline int nand_exec_op(struct nand_chip *chip, > > if (!nand_has_exec_op(chip)) > > return -ENOTSUPP; > > > > - if (WARN_ON(op->cs >= chip->numchips)) > > + if (WARN_ON(op->cs >= nanddev_ntargets(&chip->base))) > > return -EINVAL; > > This warning triggers when I apply my gpmi nand exec_op series. > > The gpmi driver calls: > > ret = nand_scan(chip, GPMI_IS_MX6(this) ? 2 : 1); > > This ends up in nand_scan_ident() with maxchips = 2. Here nand_detect() > is called which sets memorg->ntargets = 1; Later in nand_scan_ident() we > have: > > for (i = 1; i < maxchips; i++) { This loop should be fixed to test against nanddev_ntargets() instead of maxchips. > u8 id[2]; > > /* See comment in nand_get_flash_type for reset */ > ret = nand_reset(chip, i); > if (ret) > break; > .... > > this nand_reset() calls nand_exec_op() with op->cs = 1, nanddev_ntargets() = 1 > and boom. > > I can't see how this can work with anything else but maxchips = 1. Do you > have an idea how this is supposed to work? > > Sascha > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel