From patchwork Thu Mar 1 13:39:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 879874 X-Patchwork-Delegate: boris.brezillon@free-electrons.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=infinera.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZwBBcUbV"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="rgrdeC1x"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zsYqz69sSz9ryr for ; Fri, 2 Mar 2018 00:56:15 +1100 (AEDT) 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=SM2J/ilXojW4k3Lc1p2LAwNY/+hh1hT7aw4vv9qDgS0=; b=ZwBBcUbV9nZ4h6JWNbTcnsbW7P H+Kq8A63RXTYld95IQ0KeAkI0Ssp3tCz7FlR7cpOUzUcHGzVP/2fuvde0oW8uchyqwYAlS22jMwQt 3IcCcnZgl47bW+/EcObigCdWd+1NYTqfQTRbxJdL7l9t0IyowpPytMRl2MWEmCxS3JQO7lj2P1Z+m t/nR5W0Vrg9F4+NPRf61xq6WJyYwmYP7udKMEdmWhgJIwXLMUs1pyTgHOdr4wV+DIIy0HUFNDlC3w J2hpBKqD24mS1sqMG2EKs2pWZo10rJFShl3TeAqt1lqF4YO56/0a32c2gEmdVypTe/1xesbjW1pig hx8b81Sg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1erOgm-0005fr-W2; Thu, 01 Mar 2018 13:56:05 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1erOgJ-0005FF-VY for linux-mtd@bombadil.infradead.org; Thu, 01 Mar 2018 13:55:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=k1KNANntwHh/msBPZPSkeRNxzKPz2aZQzYQE+VDiQUA=; b=rgrdeC1xGVOQ4vVc8zoyINwOn wx0KRpCUhtWff1AV9HLGhjVV+epxjD1aaG5zRD7OUoRAg63lnu1DQcaH4y/q2xqEq0Sa9LpeBK7jb X+5cz9DjBHJanNo9bryuq90SN6lJkbgC7+IEVxcPH3G3WTNoFaJNMIJH08VW2De5D+f5+vmI2gY92 nkMAlKpFEbdRi4+1RmsipCOnrjkcb3Onc41BMIYmEmvxzwgRH7uIlzo5FGyaiH0Xsm9XQrAU8LPI+ RFxFLoWoQ4Ac6IIsGW8a3YvVuZm2HGMzI/Be3Rz9gSxwXZvEbGt1x22WAP33P2+qyd17aCzf4Fz/x CaMOFL4Xw==; Received: from smtp.transmode.se ([31.15.61.139]) by casper.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1erORG-00076j-H7 for linux-mtd@lists.infradead.org; Thu, 01 Mar 2018 13:40:07 +0000 Received: from gentoo-jocke.infinera.com (gentoo-jocke.infinera.com [10.210.72.209]) by smtp.transmode.se (Postfix) with ESMTP id 80E78118ACF7; Thu, 1 Mar 2018 14:39:46 +0100 (CET) Received: from gentoo-jocke.infinera.com (gentoo-jocke.infinera.com [127.0.0.1]) by gentoo-jocke.infinera.com (8.14.9/8.14.9) with ESMTP id w21DdkuL019754; Thu, 1 Mar 2018 14:39:46 +0100 Received: (from jocke@localhost) by gentoo-jocke.infinera.com (8.14.9/8.14.9/Submit) id w21DdkuP019753; Thu, 1 Mar 2018 14:39:46 +0100 From: Joakim Tjernlund To: "linux-mtd @ lists . infradead . org" Subject: [PATCH 2/3] cfi_cmdset_0001: Workaround Micron Erase suspend bug. Date: Thu, 1 Mar 2018 14:39:40 +0100 Message-Id: <20180301133941.19660-3-joakim.tjernlund@infinera.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180301133941.19660-1-joakim.tjernlund@infinera.com> References: <20180301133941.19660-1-joakim.tjernlund@infinera.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180301_134002_613068_A152CBA7 X-CRM114-Status: GOOD ( 10.23 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-1.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joakim Tjernlund , Joakim Tjernlund , stable@vger.kernel.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Joakim Tjernlund Some Micron chips does not work well wrt Erase suspend for boot blocks. This avoids the issue by not allowing Erase suspend for the boot blocks for the 28F00AP30(1GBit) chip. Signed-off-by: Joakim Tjernlund Cc: --- drivers/mtd/chips/cfi_cmdset_0001.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index b59872304ae7..64ae65dab877 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c @@ -45,6 +45,7 @@ #define I82802AB 0x00ad #define I82802AC 0x00ac #define PF38F4476 0x881c +#define M28F00AP30 0x8963 /* STMicroelectronics chips */ #define M50LPW080 0x002F #define M50FLW080A 0x0080 @@ -375,6 +376,17 @@ static void cfi_fixup_major_minor(struct cfi_private *cfi, extp->MinorVersion = '1'; } +static int cfi_is_micron_28F00AP30(struct cfi_private *cfi, struct flchip *chip) +{ + /* + * Micron(was Numonyx) 1Gbit bottom boot are buggy w.r.t + * Erase Supend for their small Erase Blocks(0x8000) + */ + if (cfi->mfr == CFI_MFR_INTEL && cfi->id == M28F00AP30) + return 1; + return 0; +} + static inline struct cfi_pri_intelext * read_pri_intelext(struct map_info *map, __u16 adr) { @@ -854,6 +866,11 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long chip->in_progress_block_addr) goto sleep; + /* do not suspend small EBs, buggy Micron Chips */ + if (cfi_is_micron_28F00AP30(cfi, chip) && + (chip->in_progress_block_mask == ~(0x8000-1))) + goto sleep; + /* Erase suspend */ map_write(map, CMD(0xB0), chip->in_progress_block_addr);