Received: by 10.192.165.148 with SMTP id m20csp4193453imm; Mon, 30 Apr 2018 13:35:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoXxGiUDhH63Ep1GY9SKSkkqoECZA28zyx1Zz4RVrRObS7yyt6xrRXkk2jsqdfO88E48UHE X-Received: by 2002:a17:902:a986:: with SMTP id bh6-v6mr7726260plb.245.1525120503526; Mon, 30 Apr 2018 13:35:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525120503; cv=none; d=google.com; s=arc-20160816; b=XABzSo+SeeWhAVVjprS8ybf51TmdJcvcWZpq6PqpbbE6AWpgmd5hQAhlA9vzN7vs/t OYUzbIQNBmfgz0hnKZEqK1RUsn7OldklaOwLI7iWE8IXC1pEZnNIV5XXZ/H/Nzp7ammg mUl+i1sgHBt+ibFks/WKVQGuGb9CYS5Wot4NhgdkGfyo5x3EzYASlmDhpaYL6qIeNmJh /mfoXTqjoZCtDa1h9voWHtfFi7oClIdkjTgcz286zYN0vACsCFWx/smln7SQmpNcRuOo cSdCoY6a3cSPP680BHREHTptM9qfOJ9j3HNxtiubwf5maqjMGAQJZcdgcGzKjvcKggca bXbQ== 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=S1zVaw6304OtohHbt+gukv8FhinktR9kS0sS6AW+XUM=; b=v7xHKNT+vL+B8ImoPfvpKGR8Yi954zBYmwWBvIXOuknigpxawrQNgQWMTSgFxl6qNi C/+yboR+gRyDb0kimcrHqXzzPcvlsIVAR5oMixUzGGL45WGiSe+BZJsY7qZXHxpiawf3 NTYkm2ZREQB4Lpq5LkLtAOD1X6O+mJocxof9XaJVGnBQHdN79bFbrwt6SQvwMqnqnx6u MfH85kOjepIEgG3ADdu5P6o2UqpEBuvsyi/aZ19puFn7kUWp1+Jk5RYMrWYAFe4+KeXq l+oRoc1+dSUnETbMjktJ50F3VIg6JFsvmRlteoeQ+H5bb737HcTQy/zJEdCavJyO7T5C Kgmg== 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 b3-v6si7868766pla.505.2018.04.30.13.34.49; Mon, 30 Apr 2018 13:35:03 -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 S1755483AbeD3T0B (ORCPT + 99 others); Mon, 30 Apr 2018 15:26:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:59066 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755463AbeD3TZ7 (ORCPT ); Mon, 30 Apr 2018 15:25:59 -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 BB1D122DC1; Mon, 30 Apr 2018 19:25:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB1D122DC1 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.4 31/44] mtd: cfi: cmdset_0001: Workaround Micron Erase suspend bug. Date: Mon, 30 Apr 2018 12:24:42 -0700 Message-Id: <20180430190947.576190091@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430190946.093694747@linuxfoundation.org> References: <20180430190946.093694747@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.4-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) { @@ -830,6 +842,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);