Received: by 10.223.164.202 with SMTP id h10csp1858688wrb; Fri, 24 Nov 2017 02:28:35 -0800 (PST) X-Google-Smtp-Source: AGs4zMbkZhgzmulmS+j9+j5Y0XFAF57Y1UnIoh5h20B9Hj4UCa+GIopTfKhGU2Oitr2w7/Z3v57p X-Received: by 10.84.130.66 with SMTP id 60mr1521346plc.325.1511519315425; Fri, 24 Nov 2017 02:28:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511519315; cv=none; d=google.com; s=arc-20160816; b=gj98soOgWkca4MHcfDFO/Belt9MzhGoo5oTWICLH8Wo/rz+V8O+EzsA+l32h9B5WLo sfNUjtPkfGnReFtBkx3p1BvwYXbCAEwm5ycvf/jq4xqXE8MMatERdct9RoP1g64cPHyv 5IdYa1eR+Em3TPItetouJp+r0UqbmvoID+qqhDqw+nfa9Rpi9qhEJnXD80jZJa6mvuyP lza3+Qa6hhnTgNzlVPANi4jjb6DdOqD3DcLyCQ9MR4LiSDAhVeORhk87RcCuQIz000h/ R/n6OsBDpOI73V1OUyC/pHDodoyjM4A9//OUg1afjvJP2yDBrzTdHGc8Ku/R1vd4YwAR jAeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:arc-authentication-results; bh=Kl8zB73CGy7L1SeYnQJoYfCY8z3w16JHf0f1+pfqxkU=; b=TJvld+b2pxbpsFDHgWKjOKPpzVsIu36dBd8k5HJaP3c9CA8onmQPbPdbZkTqBiQEyp Gwx2Z8/hRLBxZYxt1ZrrgNug3Oxf2vNy+sDzXtBviZWxKsUwDPa0Zf34wGWd9j2wZtB0 1omU27DeKcoXB5+qMwI/HH4yU/LitZJo+QHUOdhyNfC0F2uUcCSeju3teFbx43vXnn7v MwXicZqRBIHTVqnefTu0x7kusG4HNYCoNc+oYPMMMdnFlnZbJaK36tFBOsrMSppeevov yS5bfuXH1WcW5vEhTWQRetg62IQ2mCefvcDCaVVqy+d9qXHqr+7sZ9ocaDrzAZn5BrGU 3xaA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g66si19681166pfj.303.2017.11.24.02.28.24; Fri, 24 Nov 2017 02:28:35 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753466AbdKXK1j (ORCPT + 77 others); Fri, 24 Nov 2017 05:27:39 -0500 Received: from mail-dm3nam03on0071.outbound.protection.outlook.com ([104.47.41.71]:2607 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753416AbdKXK1c (ORCPT ); Fri, 24 Nov 2017 05:27:32 -0500 Received: from BN3PR03CA0074.namprd03.prod.outlook.com (10.167.1.162) by MWHPR03MB2704.namprd03.prod.outlook.com (10.168.207.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Fri, 24 Nov 2017 10:27:29 +0000 Received: from BL2FFO11FD025.protection.gbl (2a01:111:f400:7c09::194) by BN3PR03CA0074.outlook.office365.com (2a01:111:e400:7a4d::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.260.4 via Frontend Transport; Fri, 24 Nov 2017 10:27:29 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD025.mail.protection.outlook.com (10.173.161.104) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.218.12 via Frontend Transport; Fri, 24 Nov 2017 10:27:28 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vAOARInO009453; Fri, 24 Nov 2017 03:27:25 -0700 From: Zhiqiang Hou To: , , , , , , , CC: Hou Zhiqiang Subject: [PATCH 2/2] mtd: m25p80: restore the addressing mode when stop using the flash Date: Fri, 24 Nov 2017 18:08:48 +0800 Message-ID: <20171124100848.1828-3-Zhiqiang.Hou@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171124100848.1828-1-Zhiqiang.Hou@nxp.com> References: <20171124100848.1828-1-Zhiqiang.Hou@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131559928491624017;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(336005)(39860400002)(346002)(39380400002)(376002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(189998001)(6666003)(4326008)(47776003)(97736004)(8936002)(498600001)(39060400002)(72206003)(8676002)(81156014)(81166006)(48376002)(50226002)(77096006)(5660300001)(86362001)(50466002)(36756003)(104016004)(8656006)(2950100002)(106466001)(105606002)(85426001)(316002)(53936002)(2201001)(1076002)(356003)(50986999)(51416003)(2906002)(110136005)(76176999)(16586007)(68736007)(305945005)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR03MB2704;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD025;1:UASUeNTi1ZrGjir50vuBGPOfxgUFcoJEZzK3JvISctV8DNpmvp4gMSd0cjTKul14bWBYxmX1aQEmchaSbAc4nzFya3hCkNBj22In+zXw2LGgU2RFAAX58lLShTpuvEYX MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4628075)(201703131517081)(2017052603258);SRVR:MWHPR03MB2704; X-Microsoft-Exchange-Diagnostics: 1;MWHPR03MB2704;3:nVP3zWhThrun3S9PfvVv/6GpFQmj3Rwol0Lep9TlBp4kqlp8LY+ckGQVmuWtT4q/VR2c/xbY+iMnkeN7XUmh15Nh81y7814BhSoWe5z8xhfx8X7k/G7oW/ZcB7d2jsW0r23Bmr0Cdsjj5R5Nl6jwnAdGpQyraum0BZdXDoEr5CsPcLHnPFOuNBzQVYZxhobt0L1nVUpPrrhlTwniSbfMwVzWXSBx4KNrtqdGB0/7QQ7Xugij4GKkr4uhcTrsNEEB4hJeoxDYFJZv97a+Yf+Y0F1KZqfs+zkFz9UUOlzEtlMaVY0PXBlvjsvH79y48zfzecL417icyPeAIBhS5dIpxEH1cXkLLjK+6u8ocgWrABg=;25:F4zSB92TloEPlfkLcUJyCLZJM0F8mW1zQD1xu9oS4iqe75KnltULXqXgIXDMgTtlW9YalRoMy3BJnXcT1Z0b9YHwY7uRMjeHGg/vGMtfPWUBo+pW9uR7WL0yyR3XZafCbXVOLjQjclV2pjZcDT9BoH7QXpq3BSt96m5AwV8FugV8TVKOWLoYFvEAkaIVo2UAsNmM8lPb6/ocIsbspd2OANVfZHanSAT3VY16ixp5wIGn8WYAGXw+Ux1/S66zFZ0nJ74V+/AsRc2CHwAHAfX8k3MIXRhn5Zqtvk7dengx0JV7i6UzoCzW3jwOYCphkaz5pAUNMRG52k7G7JulJWjycA== X-MS-TrafficTypeDiagnostic: MWHPR03MB2704: X-MS-Office365-Filtering-Correlation-Id: 795efa98-8919-4866-e4f0-08d53325f6df X-Microsoft-Exchange-Diagnostics: 1;MWHPR03MB2704;31:KC9xByxxRnlNSU66UB6Q0HOF9kpWSXVo5UIHSa22iug26/h1tKfr/mZPT0bse+UNKteg2wTxUSv/TYAdVon/va2rMFfX1y+YjeeAPUQAHq3eGOBaH8NmpYjp845UFYP4M+KIu4HvrWqDw6DUZP+1xYyNp9oDTmmjJBDWNky5gH8WmYR2qhKspcL2s0WzeuQbeE/Az/zPUolvs221TKy6E5lof/kEK7qSJYtKzIsjUP4=;4:CGIalzynq3ghB53ya+zOWP0yEPoAiw5+9HB2OsMxZ/XogkgMPInE+UWCGJXvtOfG1RofoDYMJloWwXqUErV7W5jsj0aj6HJUm0nt2/RltLGZn56ieKOXBXWLg5NrPp/aStThFFefUR5ilrxqRKhdDdEWCl2ADeIqVHQxp5G23lci0DFEE5H4EFhPuB2FBRBqejLnoBzzpy0+4cHwDm8u1kszsobpcNA/juOkfCvyvynzd1L8wBPDStxLaIOrE3kvNfLJHpBbXLNfzapjcxxENcVUmB6ZXMwbOnMcEiTbcVhYUZ+x52sRCzkimG5aiUv5 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6095135)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231022)(3002001)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123561025)(20161123565025)(20161123559100)(20161123556025)(20161123563025)(201708071742011);SRVR:MWHPR03MB2704;BCL:0;PCL:0;RULEID:(100000803101)(100110400095)(400006);SRVR:MWHPR03MB2704; X-Forefront-PRVS: 05015EB482 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;MWHPR03MB2704;23:BSvduJnCVle383/ZZGjUqheErat2o+aVXtrQRHIor?= =?us-ascii?Q?PF+I2NSpyrbn0G8J1WFQA8Nz5+5qDMOsuw+2u+MEn9yW/UqPKJkzwMpR3Pwp?= =?us-ascii?Q?46rjssc7y7g/sL3PpzzlvyZscMwRiVzd+w4Xx662tk3MYeZjk8oEukGW+MJg?= =?us-ascii?Q?pVYVe2NJ7m3J5H5jS+kahFp77Tnrf2THTgji3w3/WaS2UCkd+G+3gOD0Z5Cw?= =?us-ascii?Q?6POFF5/pJ3K520bayfCaLXzkMZ3T6qVEa+TOPJb1gCCFhLWQ0Hnd9n4gU8tr?= =?us-ascii?Q?0G3UOiIrWWD6kBp1ZUoyHib23bSPZNtKqnpCzfK7rd2CIkfo272YYkD+opp9?= =?us-ascii?Q?e1E92/kDwX8zzykAAcHLnmEcJeTPsydgDVN4/gEEFqpcZWq+5C8WJPUgN6x0?= =?us-ascii?Q?CYU4hvOm7np58hQ40/39TywIa11+hLSoSbFyTwX184OxwEuLQEdKV5qF9GqI?= =?us-ascii?Q?tQbAaoDXmhUBWrZF8aRm9gOpOXK3fL3tv5/9AhZE2VSl5B9Km5jFlrEBz1A7?= =?us-ascii?Q?hZa9HfF1+8T4ViMRfTQBmrkZy8bHY7bXg+egqbmYIX4Gn2AnCHXtiKnKX/3o?= =?us-ascii?Q?gQfbzAMjPOiOmv4MetC069VAJat0NXOvBUWZypdTolNLT1gmTo2mRuPk6Pmo?= =?us-ascii?Q?Wsitta8TP+Scf0SaQGzaGtFp55iKWou/Na8lApG5VVIMl8dVf7WLocx877PJ?= =?us-ascii?Q?4BR2y8pAqKyk7p41mMP++hR+6CmmpGWSNsPYU+z2jw0WkQdP9o6cmnQVNDc+?= =?us-ascii?Q?LBK4J7EZcDE/u6PsNVOhNSPoLDbNe7qwhw29EC01qL/tTEXt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ff1Z1KTE5sPN2A=;24:OzpuGjmjIHeIPwM4dh2xrbtu7bPuOO56PFcc4JQ4m/4eTu/iOTCKxzXxVExQVG+BcNSMLUZcx5AnliM7JZ3gAgJYmF7shz/awOyt+hiJw4k=;7:8nwDK1rfUH6O0Td0cQzUVqiRU8raDsEbcXBU/B3ezjb3Rz4jcEqfa1+hsRZxwG/tEIEG3XzMTQ2xr0YBr1dfyK9yz1y28gjsEKM5aKgRcVSvVKDOI8M1/Z0GbIIqnpiDHvvhMQ3sruLhxM10hsar2ZrvPdVH1VpZViLmf+JW2vvlDrYWl6sx6IqXoI0PQly+dI4BwnJOxlqGsX+xcOnczCubU0NdsCmrXxjSdZ03peD1dMvGpbJN0CCGOwk4efTq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2017 10:27:28.9128 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 795efa98-8919-4866-e4f0-08d53325f6df X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2704 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hou Zhiqiang Add .shutdown function to restore the addressing mode in reboot process, and add the same operation to the .remove function. Signed-off-by: Hou Zhiqiang --- drivers/mtd/devices/m25p80.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index dbe6a1de2bb8..867bd2d5a267 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -307,10 +307,17 @@ static int m25p_remove(struct spi_device *spi) { struct m25p *flash = spi_get_drvdata(spi); + spi_nor_restore_addr_mode(&flash->spi_nor); /* Clean up MTD stuff. */ return mtd_device_unregister(&flash->spi_nor.mtd); } +static void m25p_shutdown(struct spi_device *spi) +{ + struct m25p *flash = spi_get_drvdata(spi); + + spi_nor_restore_addr_mode(&flash->spi_nor); +} /* * Do NOT add to this array without reading the following: * @@ -386,6 +393,7 @@ static struct spi_driver m25p80_driver = { .id_table = m25p_ids, .probe = m25p_probe, .remove = m25p_remove, + .shutdown = m25p_shutdown, /* REVISIT: many of these chips have deep power-down modes, which * should clearly be entered on suspend() to minimize power use. -- 2.14.1 From 1585562231949657366@xxx Fri Dec 01 06:32:57 +0000 2017 X-GM-THRID: 1585562231949657366 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread