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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 761DBC5CFC0 for ; Mon, 18 Jun 2018 04:53:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3188420864 for ; Mon, 18 Jun 2018 04:53:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="g/l8Iy8D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3188420864 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=alliedtelesis.co.nz Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754519AbeFRExL (ORCPT ); Mon, 18 Jun 2018 00:53:11 -0400 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:43539 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754259AbeFRExJ (ORCPT ); Mon, 18 Jun 2018 00:53:09 -0400 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 2241D800E6; Mon, 18 Jun 2018 16:53:07 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail; t=1529297587; bh=UlAY+e3cK3Ui1RBOrDe7i2oJrA7T6AjIQSnNt6o87tI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=g/l8Iy8DyG7QhpwUHCmu0wf5S5iutavF/rwHwr8joT4bO2sl6uuZSXQKFqjD5qWa+ Fqh3kYtEF/jXeTO0JTMIifpShmOV0gZZg7vz+PTSs5HriseYwX21GqI5qUURgrneBH fMdjzY8YfU18VrF3wV0iDG3gjmxCZpuJq0vYb2kw= Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7,5,8,10121) id ; Mon, 18 Jun 2018 16:53:06 +1200 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by smtp (Postfix) with ESMTP id 02DE613EED3; Mon, 18 Jun 2018 16:53:10 +1200 (NZST) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id DFA6F1E2626; Mon, 18 Jun 2018 16:53:06 +1200 (NZST) From: Chris Packham To: miquel.raynal@bootlin.com, boris.brezillon@bootlin.com, dwmw2@infradead.org, computersforpeace@gmail.com, linux-mtd@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Chris Packham , Richard Weinberger , Marek Vasut Subject: [RFC PATCH 1/2] mtd: rawnand: handle ONFI revision number field being 0 Date: Mon, 18 Jun 2018 16:52:54 +1200 Message-Id: <20180618045255.8015-2-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618045255.8015-1-chris.packham@alliedtelesis.co.nz> References: <20180618045255.8015-1-chris.packham@alliedtelesis.co.nz> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some Micron NAND chips (MT29F1G08ABAFAWP-ITE:F) report 00 00 for the revision number field of the ONFI parameter page. Rather than rejecting these outright assume ONFI version 1.0 if the revision number is 00 00. Signed-off-by: Chris Packham --- At the moment I haven't qualified this check on anything, I should probably at least include vendor == MICRON. As far as I can tell revision number == 0 is not permitted by the ONFI spec but this wouldn't be the first time a vendor has ignored a spec. On the other hand maybe I'm reading the spec wrong and someone here will say "oh 0 means ...". drivers/mtd/nand/raw/nand_base.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 0cd3e216b95c..1691c7005ae4 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -5184,6 +5184,8 @@ static int nand_flash_detect_onfi(struct nand_chip *chip) chip->parameters.onfi.version = 20; else if (val & (1 << 1)) chip->parameters.onfi.version = 10; + else if (val == 0) + chip->parameters.onfi.version = 10; if (!chip->parameters.onfi.version) { pr_info("unsupported ONFI version: %d\n", val); -- 2.17.1