Received: by 10.192.165.148 with SMTP id m20csp4174824imm; Mon, 30 Apr 2018 13:12:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqRaf6e6v9MIRKlngbdlfwP+W1TclyRnxHHqYRHuwYR2AgZpXj4u+broRDARKPEMxX756VX X-Received: by 10.98.17.82 with SMTP id z79mr13060292pfi.135.1525119137749; Mon, 30 Apr 2018 13:12:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525119137; cv=none; d=google.com; s=arc-20160816; b=lmyEr0abFcOdm8Lu+Ete898HVUW4OR0bCKgbqmvyPPn3x9QQbyaO5vAe/9KtsMuQMI ZDEpO4JIDqxlp094IJPPmsSdQvhXAc/K2Eq86ASoonkS+JT6DL58EC1HpBglqmVep1Qe AqfNtmjW32cXMSeph8fTPzksywrRqyrVxbOjjMGWAwqXNZTW7vrhHkbamn2mVy48lSe4 1uox+9tE6m2aeWg5qb6OgYTryFaluBAAwlCFKtkeicVv9fZDODAXZ7aD0sl2wCsp52nY CP6RiKkfzDmoLy1tlDX9zzcGQCshHojcIb+r2zWpqIby9WlS8zxUhlPASxjpIbauKGsX oEMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=FvnpPqrqC3r3KAWvaNa9sDF8owUKAXenE/o40wu3wLM=; b=k15Ruyg7droaNFy9cbc+uoGwio1ksLG1V2BdJUCteIdbZVM3ksMRq9YkgU1Ec8PTBa wRCn7zvNOiOvlpTBG6w/oZYaYfka7MKUGSMeH2X7PBm21QrVwsPNPdmMHbf9dK0zgNaB MvVPvLeVwKZz23gv9lzw30e8f4wA3e85vM6zxeEwr/4xfkuzGxHkOoWic90M+Ivn7N9v aOyqXwFfiJkNMWqZIUD7Zkfg3ZczIb2oAGI1PFglzd+bW1o6CPSj3QRhYHgicFOPv5Bl svYbnL/r/Ig6TguGsZccDTAmbbtYT8VjwJixkTM4lInm/s6wbl43JwNOcM2s+J7CQawt 7qBQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10-v6si6484258pgt.109.2018.04.30.13.11.33; Mon, 30 Apr 2018 13:12:17 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756084AbeD3UHq (ORCPT + 99 others); Mon, 30 Apr 2018 16:07:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:33768 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932167AbeD3T1W (ORCPT ); Mon, 30 Apr 2018 15:27:22 -0400 Received: from localhost (unknown [104.132.1.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2D84022DCC; Mon, 30 Apr 2018 19:27:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D84022DCC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joakim Tjernlund , Richard Weinberger , Boris Brezillon Subject: [PATCH 4.14 52/91] mtd: cfi: cmdset_0001: Workaround Micron Erase suspend bug. Date: Mon, 30 Apr 2018 12:24:34 -0700 Message-Id: <20180430184006.893708743@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184004.216234025@linuxfoundation.org> References: <20180430184004.216234025@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Joakim Tjernlund commit 46a16a2283f9e678a4e26829175e0c37a5191860 upstream. 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: Reviewed-by: Richard Weinberger Signed-off-by: Boris Brezillon Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/chips/cfi_cmdset_0001.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) --- 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 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) { @@ -836,6 +848,11 @@ static int chip_ready (struct map_info * 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);