From patchwork Fri Oct 19 16:55:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: IKEGAMI Tokunori X-Patchwork-Id: 986903 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=allied-telesis.co.jp Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fIP1rwEw"; 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 42cBwk5lsVz9sj4 for ; Sat, 20 Oct 2018 03:59:50 +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: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:In-Reply-To: References:List-Owner; bh=GWupLV5ho0N/U99xyOZoZ791jrbYqt73o1BrKqz+e8A=; b=fIP 1rwEwBVahs4vDhg2yr0W6EBvmLBD/SBprZA2iEaKqVXmCs4zWJTKyUYQ9QZLPMT5YPaE6CGHjrbo4 WifjTbwPfMrVX7499C5TkHNxGjwIaUjtObwZVVIB8qscsvnvtphMw4hNRQj2y0Ez2Z96WNvcaXf3b VIadIzFV4DYfQQHlNpc+OFK9A8/PlWHBG3U2U48eye2OEOkUUIMHeCd6wt0WvHY8CIgy7jjLRnmbg vcGZAA54FhK/hBdsopX4hPFnkyZMoG8YuVqCZVM+LaUlJUaY60ehXIaCjC+1agL6vQkZLTq0LHvCT EvoPD8I76JWNDnl9emcav6p7u7zimFw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gDY7h-0000L7-Cr; Fri, 19 Oct 2018 16:59:41 +0000 Received: from mail1.bemta23.messagelabs.com ([67.219.246.212]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gDY48-0007F6-AK for linux-mtd@lists.infradead.org; Fri, 19 Oct 2018 16:56:23 +0000 Received: from [67.219.246.100] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-2.bemta.az-b.us-east-1.aws.symcld.net id 98/3C-10938-09C0ACB5; Fri, 19 Oct 2018 16:55:44 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrALMWRWlGSWpSXmKPExsUyLfyHiO4EnlP RBu0H+Cx2Ny1jd2D02LykPoAxijUzLym/IoE1Y+mXo8wFC3kquls+MDUw3uLqYuTiEBKYyygx 69Jzpi5GTiDnF6PEi8WJIDabgKnE9FcLGUFsEQE1ia395xhBGpgF7jNKnF37DqxBWCBS4taWS 6wgNouAqkT782awBl4BR4nFj9+CxSUE5CUeHm9nhFigKfG85zsjRDwYyO5jn8DIvYCRYRWjWV JRZnpGSW5iZo6uoYGBrqGhka6RrqGxmV5ilW6SXmmxbmpicYmuoV5iebFecWVuck6KXl5qySZ GoO9TCpg6djAu7Uo/xCjJwaQkylugfjJaiC8pP6UyI7E4I76oNCe1+BCjDAeHkgQvH/epaCHB otT01Iq0zBxgEMKkJTh4lER4Q0HSvMUFibnFmekQqVOMuhwdT6/PYBZiycvPS5US55UFKRIAK coozYMbAYuIS4yyUsK8jAwMDEI8BalFuZklqPKvGMU5GJWEeQtBpvBk5pXAbXoFdAQT0BEnTE +AHFGSiJCSamBsmlbz7fZZhT1fQv+es03te/paZ6n37lvO9vknSh5Wzdwg+anAUDSl4ae3+Py Zuy9e37bH+ldSsI76S3GfTJOF74SuLbftuvTp7kZJ4yDvg3ZPDvL7NeoUWsV7lHHnWumI/ynT i42e3blqRW3n57ciWVfPPve6fWKKzrv/CUd0hPef5Dx3stRSiaU4I9FQi7moOBEAYGZ694MCA AA= X-Env-Sender: ikegami@allied-telesis.co.jp X-Msg-Ref: server-15.tower-384.messagelabs.com!1539968143!649932!1 X-Originating-IP: [150.87.248.20] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.14.24; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12108 invoked from network); 19 Oct 2018 16:55:44 -0000 Received: from abricot-inet.allied-telesis.co.jp (HELO TKY-DS01.at.lc) (150.87.248.20) by server-15.tower-384.messagelabs.com with SMTP; 19 Oct 2018 16:55:44 -0000 Received: from swim-manx.rd.allied-telesis.co.jp ([150.87.21.50]) by TKY-DS01.at.lc with Microsoft SMTPSVC(8.0.9200.16384); Sat, 20 Oct 2018 01:55:42 +0900 Received: from ikegami-pc.rd.allied-telesis.co.jp by swim-manx.rd.allied-telesis.co.jp (AlliedTelesis SMTPRS 1.3 pl 1 ++E6B86F8C687C6288D9B5559052954DC9) with ESMTP id ; Sat, 20 Oct 2018 01:55:42 +0900 From: Tokunori Ikegami To: boris.brezillon@free-electrons.com Subject: [PATCH v2 00/10] mtd: cfi_cmdset_0002: Fix flash write issue for OpenWrt Project Date: Sat, 20 Oct 2018 01:55:16 +0900 Message-Id: <20181019165526.11159-1-ikegami@allied-telesis.co.jp> X-Mailer: git-send-email 2.18.0 X-OriginalArrivalTime: 19 Oct 2018 16:55:42.0878 (UTC) FILETIME=[9275F3E0:01D467CC] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181019_095600_516128_1BF3CF8C X-CRM114-Status: UNSURE ( 8.06 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [67.219.246.212 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [67.219.246.212 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 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: Tokunori Ikegami , Joakim Tjernlund , Chris Packham , linux-mtd@lists.infradead.org, Fabio Bettoni MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The change is based on the fix for flash erase to use chip_good() done in the past. And it is fixed as same way in the OpenWrt Project as below. Also includes some refactoring changes. Signed-off-by: Tokunori Ikegami Cc: Fabio Bettoni Co: Hauke Mehrtens Co: Koen Vandeputte Cc: Chris Packham Cc: Joakim Tjernlund Cc: Boris Brezillon Cc: linux-mtd@lists.infradead.org Tokunori Ikegami (10): mtd: cfi_cmdset_0002: Change do_write_oneword() to use chip_good() mtd: cfi_cmdset_0002: Remove chip_ready() from do_write_buffer() mtd: cfi_cmdset_0002: Remove goto statement from do_write_buffer() mtd: cfi_cmdset_0002: Call xip_enable() once only in do_write_buffer(). mtd: cfi_cmdset_0002: Split do_write_oneword() to reduce function size mtd: cfi_cmdset_0002: Split do_write_oneword() op_done goto statement mtd: cfi_cmdset_0002: Remove op_done goto statement from do_write_oneword() mtd: cfi_cmdset_0002: Remove retry goto statement from do_write_oneword() mtd: cfi_cmdset_0002: Split write-to-buffer-reset sequence mtd: cfi_cmdset_0002: Split to wait write buffer to check if completed drivers/mtd/chips/cfi_cmdset_0002.c | 253 ++++++++++++++++------------ 1 file changed, 146 insertions(+), 107 deletions(-)