From patchwork Fri Jan 18 21:06:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 156046 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3706187jaa; Fri, 18 Jan 2019 13:06:33 -0800 (PST) X-Google-Smtp-Source: ALg8bN5VTDiYUYOFTE3UNFPPuajkRMRmEtsS8w4p+t9WlLY+lGXfPF9c3/1/f2/kY5JVUoEsLcXp X-Received: by 2002:a65:4049:: with SMTP id h9mr18992252pgp.304.1547845593693; Fri, 18 Jan 2019 13:06:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547845593; cv=none; d=google.com; s=arc-20160816; b=t8oZxKtY/HnUdYbd+6Ss5Tf681LPaSXWK/UQ6EWbBU5Qq2BdHT/mrDAxxO3De23Mqi Rt9CXaxlMd2V4tpkPZar1QA0ESkM6tQxmuP4xj2xq/sqEXhMITrLsiJHTlnn/B795h+F Tjpgaao12ObZYFO7o9fihqkLkwHM3RHCf1ygUzYNtcjTwmMCnO44hoPhjUk52WosLNX/ 8XMOkqAPC2LdWYpXyB1gmW2ULtcFanpVyxKGKTJqN/Vl+zBEjCpMCwiGSgusOwXWL8al ylxjDF/1jxBquzTNsqftMCxLs4mCh8/FgwDhzCVKB+c2zTEHwYX9ga7U7QbQh+OWVeRp ZfPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:dkim-signature; bh=OFsDt9LkKYTfZ5Vr+/tbcNmQXEls0RK6LYL3sqO9ALc=; b=akUtgHqdScsgKyTj/ZTK+AHpqPlFPB95O3yWp9rV/CVe73yDDmQ7976KzwQ8EL25uN EW/LfFWfd/elqzxDT6K24fxIMWIAs/1dv4xaMmTCzGlRBUwzcC1uap8gsyfccy1MPu6Q /8fxToVZFa9skdn16TgYWx/ymGdYVYpl/cv9bbtZVB+6VG6dFiO0wuY7E9rC9OtQREjT BUYis2uAG8zsYB54SGIXxOP6/tfV7ik2BaXKuXFR/IqI+8HDoKWmz0kJypFEK2LnfNxt 0boWiKz+pNcVFlXvEhN7WXjDiiVDM8TyX8ctO0blZaJxkmFqII6UfYDmHqCfb/U0RXlh Y1vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b="eRJ8Ib/M"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="Kc/iWEoU"; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id h10si1995569pgi.562.2019.01.18.13.06.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jan 2019 13:06:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b="eRJ8Ib/M"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="Kc/iWEoU"; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=OFsDt9LkKYTfZ5Vr+/tbcNmQXEls0RK6LYL3sqO9ALc=; b=eRJ8Ib/M/HhcZ2 v3iOQG6NInvAg4MSa5R+ZA98zTHVTKA2dPbFERoeaJVvDtmHWdSBEZ4RhqkX/LgfQudbgnPc8rbjp gof7293yUR98Z9YLAOafaFSQ8lqJko7pGszPVZkn6qGmLjz9wQc8NYVYUWAIpQAep/pvd3E5XBrp6 KR0mc1mDp30eATWUuj/8qwaUuqyJ7CsLwFvY4TeuU1Lti9+0S8ILgciUHHO91iRObUjlU+Se97y9y 8vFjYilhxhhsgkkpNX2dy4ssKgzuxdMbZWc5OiRExRYy9z4K6eyLbPRcfV/4gvgJSRMHHdtJe/w3g b3/CVYL1YuFJcHCWcUUg==; 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 1gkbLE-00050b-5B; Fri, 18 Jan 2019 21:06:16 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkbLB-000502-6E for linux-mtd@lists.infradead.org; Fri, 18 Jan 2019 21:06:14 +0000 Received: by mail-lj1-x241.google.com with SMTP id k15-v6so12757476ljc.8 for ; Fri, 18 Jan 2019 13:06:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7jX5zdy+b8YE7tC69x5iiWFVbJ0EmPYf9FF8/dNUZV0=; b=Kc/iWEoUpCt2hd+UpbSktEIiuf2h8BtfaPSAyfUun0NiwpgcgI5BOw3TPTRiZBke9X Z0NPRLFqZ+uEsKK4Z/dxO8zt8ZG9RRzPukqrD885R/2nSAHVp+/WspnXztdApOP933Tk AIYhxAlu25Ia3FqhhQDn9d6ikOAyYUn9R7akc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7jX5zdy+b8YE7tC69x5iiWFVbJ0EmPYf9FF8/dNUZV0=; b=r6nWLsGKoUXC1tNCJvSNPkLpsnH54FtZj/IJ424/JSIBtOEi1FYYxue+sHrcNdsTs1 e5VMjkvhDc6S/PhKD/tk/kyBXNz1zCpDo2T9LWi3+0Y3NOAFt/SL3ro4nphrJXtDYeeW CBNvFyuCVz8N+F0LpYIW5YCY079t7YNMcqJ8wJPbvKrphupnbxXi42YUb0zD0pQPf3zU Aq/4wPyepyfx9qNyTBmlqLh8sY/HB8A5x1vj9O9ID/oJtWQos1LWpgf+oJZsCGHHSJl3 cjD0kTUgzW5uHvyrL+j10fzmCyd51StAxoXFwcojnV6uiBQAHvhkYVrrMjrLiWJHZSYQ x2jw== X-Gm-Message-State: AJcUukdcu3XmNGgs6rcF/xzEtH628a+9EPMNCo3JI1NpBl2zA+GrXwdb IxhQom68Vjgr9zIKYmXCxXZHEw== X-Received: by 2002:a2e:4218:: with SMTP id p24-v6mr12982091lja.58.1547845570980; Fri, 18 Jan 2019 13:06:10 -0800 (PST) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id k68-v6sm923993ljb.35.2019.01.18.13.06.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jan 2019 13:06:09 -0800 (PST) From: Linus Walleij To: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , linux-mtd@lists.infradead.org Subject: [PATCH 1/2] mtd: rawnand: fsmc: Reset NAND timings on resume() Date: Fri, 18 Jan 2019 22:06:04 +0100 Message-Id: <20190118210604.8231-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190118_130613_238208_1E37E4E7 X-CRM114-Status: GOOD ( 13.92 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: Linus Walleij Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org When we go through a suspend/resume cycle the NAND timings may have been lost so reset the chip. This hardware will autonomously enable/disable the chip selects depending on what memory is accessed and chip selects are not software controlled, so we only lass chip select "0" for "all chips". Signed-off-by: Linus Walleij --- drivers/mtd/nand/raw/fsmc_nand.c | 1 + 1 file changed, 1 insertion(+) -- 2.19.2 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c index c9149a37f8f0..4050843dd35e 100644 --- a/drivers/mtd/nand/raw/fsmc_nand.c +++ b/drivers/mtd/nand/raw/fsmc_nand.c @@ -1164,6 +1164,7 @@ static int fsmc_nand_resume(struct device *dev) clk_prepare_enable(host->clk); if (host->dev_timings) fsmc_nand_setup(host, host->dev_timings); + nand_reset(&host->nand, 0); } return 0; From patchwork Fri Jan 18 21:06:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 156047 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3706231jaa; Fri, 18 Jan 2019 13:06:37 -0800 (PST) X-Google-Smtp-Source: ALg8bN7aajP5wg6Zc4hzdPQV2DlBaupU905fW07bnSBHF9CFmAzhekEG6O2hX01XtGs9ZjVKWBVa X-Received: by 2002:a63:2b82:: with SMTP id r124mr4311096pgr.300.1547845597550; Fri, 18 Jan 2019 13:06:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547845597; cv=none; d=google.com; s=arc-20160816; b=Nrq/lAc9htv6Cz63Yn/LWoOvU2LCnpWR3sLPOJF2UOkiVkANmZvJClMGxxU2UJ9ssu mF7tIeiXB+iRthYC7nj9Fis13zyqgm8pAkmuYo4TPcFt7OsS5skI/JOyagKJid/sJ+vF 8tmapW5Z7HAfxUzRDWOFpuxp1zowz3zYN0BKkPB1iyfbPg2rAYIbQfui5C7qD+3qkRQw FChtCXvH41JDVBW+2Bt0GxZmXenqKcgnQLK+O2xImWLOQqsBxnLbHNPrEKNVj3rWmXzV iaRTSkejGK4UmvxpIDDisTqxF8ltGIAZrULDhRX794EcIiBIHWn4VNEbVr0dgdT738+X +s6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:dkim-signature; bh=v8tzMGMxNnRMS/e8q/SawHdBxSnFPXjUk0c6an1lv58=; b=R1SryX5NYtm8SANuLZTlPWkU9Vo0s6En+bBHwlSFmMXwU1M8c65FCasMMG2+ny2CAs zCgvsPlbYxWnbd0DZtUEEh9ZgMAIMJK8ARTN4U19yhOslp9EHZUdhak56XuFOMFIHCNL 0qoGs1xZmhGhsAALD8hyhI+do3FdmVl+V2pEdduP2mdkhTQloZeWLVl25UbJX5Ullo0z G4GRiX3Fed7VoRCtnP6SpzY08TZLK6qbgZ6Rb03Mez7O5M6wCfOLGRH2ITQgIGeRoh0/ CmKCecu+Kf0vsFGn3RzL7gkwxErj7fIgzABZMPbbYkm0vAPDbAOKFkOXnb0cpP5wXg/h sYtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=FE7DUk0r; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CNxuoiZC; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id p4si917722pgm.342.2019.01.18.13.06.37 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jan 2019 13:06:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=FE7DUk0r; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CNxuoiZC; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=v8tzMGMxNnRMS/e8q/SawHdBxSnFPXjUk0c6an1lv58=; b=FE7DUk0rQB7iZM D+oMM7Wvq260tr5wmu4GJocqGD6+CvAUK8TWcJVI6Bms9pubbYWIqRFdiW7TESXaKh8JaFhRm7HT7 qAB3AoFtrfI2QBBWhdmop3ucMeWj/Hf2Z/8KE9bPOzj/GqutssCCNqX+CrIGm6Bc9aWydyllw/V0D nXYM7oOb4gQz5s2n/dHIrJfWHKj+ViqvNDgbMYAblS6biMQurTPQlapiNl5Vj8KZU6PIY5IkUWAKY gyM284iiGE7zISFwcy4bxSK2SKUtDBAxMk4HMutsOxk6roxeb80kVHa+gKOm+hZbRUzNhJOM6MAX1 iTKdBtlIcWiW/Tsb/OSw==; 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 1gkbLQ-0005Bu-0g; Fri, 18 Jan 2019 21:06:28 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkbLI-00052W-1Z for linux-mtd@lists.infradead.org; Fri, 18 Jan 2019 21:06:25 +0000 Received: by mail-lj1-x244.google.com with SMTP id c19-v6so12787361lja.5 for ; Fri, 18 Jan 2019 13:06:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K5lyavPbDV0iJg1W50ZkDSeB+HjlRIbMOn2Z/gYczK4=; b=CNxuoiZC9gW/DXv+uu9yBig9/tj07y5XzfBDdYCHBmDaYvzfWerjTrnOhy9UqR8/kl waP7Y+1aixaI6BGvL8yEpXbG2HI8aMxqYNGaTnnyag8DhnBVL34z1cX2lx+oHankrkLO qliPCEqMOjqV2oxRRz+gJZvYNnQWQTLaSSM5Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K5lyavPbDV0iJg1W50ZkDSeB+HjlRIbMOn2Z/gYczK4=; b=CYRXz+R2VzhcB3IjWcmAjmXqZoyuTt7nYanVIJUNJZuEb1tAebWB2mOGnLpeTrTZWs 3+s+qwm37k1YIno4hyTMyrvKZg4U0fC7IZet8z2baW3fykvtmECaqhTYs+YPsGN8rfhF tziNtB2GK2uoEeQ+VfxUkZ38/BGbsXWhixD9dD6OMAsClv+XecS3mSm0rgl+8Iv47eGu eSA/QC4MMj+HeUSYVfiVIwuwsjQCE+IBSCxaP/AoXbFropaBdlnuCzuUm4s6kpZpWRQJ +xFY/DS1FZYJsX8Ghuced5uxDUO40sCokvBvzSZVOVz7TAeMS8k4RYBh4r/s19EGhIE6 XQeg== X-Gm-Message-State: AJcUukelSHzjVg7oMEjQPsS1lUDDVUNJBs1liiChf0s1H6dKks/Ntltz loWiWfYwd/29C05uR8CMm+Ps2Q== X-Received: by 2002:a2e:7f04:: with SMTP id a4-v6mr14043495ljd.156.1547845577941; Fri, 18 Jan 2019 13:06:17 -0800 (PST) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id u21-v6sm914310lju.46.2019.01.18.13.06.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Jan 2019 13:06:16 -0800 (PST) From: Linus Walleij To: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , linux-mtd@lists.infradead.org Subject: [PATCH 2/2] mtd: rawnand: fsmc: Disable NAND on remove() Date: Fri, 18 Jan 2019 22:06:15 +0100 Message-Id: <20190118210615.8286-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190118_130620_709496_17A0B35B X-CRM114-Status: GOOD ( 14.73 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: Linus Walleij Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org This disables the NAND on remove() and the errorpath, making sure the chipselect gets deasserted when the NAND is not in use. Signed-off-by: Linus Walleij --- drivers/mtd/nand/raw/fsmc_nand.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.19.2 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c index 4050843dd35e..118b1b1cd8da 100644 --- a/drivers/mtd/nand/raw/fsmc_nand.c +++ b/drivers/mtd/nand/raw/fsmc_nand.c @@ -979,6 +979,7 @@ static int __init fsmc_nand_probe(struct platform_device *pdev) dma_cap_mask_t mask; int ret = 0; u32 pid; + u32 val; int i; /* Allocate memory for the device structure (and zero it) */ @@ -1120,6 +1121,9 @@ static int __init fsmc_nand_probe(struct platform_device *pdev) if (host->mode == USE_DMA_ACCESS) dma_release_channel(host->read_dma_chan); disable_clk: + val = readl(host->regs_va + FSMC_PC); + val &= ~FSMC_ENABLE; + writel(val, host->regs_va + FSMC_PC); clk_disable_unprepare(host->clk); return ret; @@ -1131,10 +1135,15 @@ static int __init fsmc_nand_probe(struct platform_device *pdev) static int fsmc_nand_remove(struct platform_device *pdev) { struct fsmc_nand_data *host = platform_get_drvdata(pdev); + u32 val; if (host) { nand_release(&host->nand); + val = readl(host->regs_va + FSMC_PC); + val &= ~FSMC_ENABLE; + writel(val, host->regs_va + FSMC_PC); + if (host->mode == USE_DMA_ACCESS) { dma_release_channel(host->write_dma_chan); dma_release_channel(host->read_dma_chan);