Received: by 10.192.165.148 with SMTP id m20csp4187808imm; Mon, 30 Apr 2018 13:28:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpLXwSwv01zvakSduJYxUuWWk6KQy6BWtItmgt+O6jQbKBQTUiz/X8cxd3lq3i41TOUibbo X-Received: by 2002:a65:5d8e:: with SMTP id f14-v6mr11263914pgt.25.1525120127744; Mon, 30 Apr 2018 13:28:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525120127; cv=none; d=google.com; s=arc-20160816; b=DiD6pbKdpRtZtiM1K30lMorleJ9E9LXODmw8p78Yl1nGipfQ8uav2C2XOugIK+x5lf p1+SIMxQxyFj4zFNwO12jzyO7ZXO1Xi1gK8p2tCPNfYnpNELa0lodyZ9O4aFDqEbrRtC 3s6JO7jgfYxD9QE+Fk+iga5OgIsRx2SR3aU/DgRC/lNcoQ3x4r9Tt6+s6h88r4yzTp6k RzABN6mqdFTrREhirXYb9JtpxbncY0vINrkIVrrCOJ4sc5u53u+9nsGJtwRzjo3kQUnj yTT8ieDxnO2LPHYA1Lj/6tiqxDCJzsle0Nec86Hbs2kUpqW4aM/Uf7GAdpovamEBTsOs uAfg== 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=GLPpa/+S51hIFVYp4rjztYiFjHKzW0REFC7uhSpLa04=; b=o63gn7KW7irlE29LOKKdMr/jYJDVkyn7OZCLP4MdCYbIg5SAhCABUfaEFaACcGpr+I tsUDtj19IXuiBu11JiziqwSfV820g7+AZmVVaanUivD65/FyLW85EIYmC5ItFHC7B9Z6 viLzw2F6cqMslwMTQp5G15FJfQC3jalshw3tZ1+J3BH1KcuwpwFkiyRVIiH16HuO9sgu aMNcdObDOH4rCdK/CPkKcSjBX/JXnjN5aQGNFFqk5AGV1oqoykbwB3V9x1WlDk6UeATe Nyt/zVLo85FEJSnPcMTKIi/aV+1vrYBWSgae0NmhQ/Z+p/IpcT0ivl6IgDNkHDC6N0+f EY8g== 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 h12-v6si6117911pgp.462.2018.04.30.13.28.03; Mon, 30 Apr 2018 13:28:47 -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 S1756132AbeD3UX6 (ORCPT + 99 others); Mon, 30 Apr 2018 16:23:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:60396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755699AbeD3T0e (ORCPT ); Mon, 30 Apr 2018 15:26:34 -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 22F6422DAE; Mon, 30 Apr 2018 19:26:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 22F6422DAE 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.9 37/61] mtd: cfi: cmdset_0001: Workaround Micron Erase suspend bug. Date: Mon, 30 Apr 2018 12:24:40 -0700 Message-Id: <20180430183954.482062431@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430183951.312721450@linuxfoundation.org> References: <20180430183951.312721450@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.9-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);