From patchwork Sat Jan 26 13:10:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 156677 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1476899jaa; Sat, 26 Jan 2019 05:11:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN4enJeR1897ys0HWCmOgz5J4qe8DNXw7ZBXej0RwkNAzYeeUnhc0d/e5yOJePuLS9tvZ4nM X-Received: by 2002:a17:902:9897:: with SMTP id s23mr14369919plp.69.1548508278208; Sat, 26 Jan 2019 05:11:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548508278; cv=none; d=google.com; s=arc-20160816; b=EKXIsV7s/4TdelNVoo+BC8afCd+pgu2svbVr3Mp0A/q0Uosb3RkSR1T5HpwvYasCNa VloFPHwwN1+KITQhtl3M81aAGXBL+MSiQCTpiu7E5m5hUt1AKoP76opUC8qKKwv0I1Wv IgfdIKegRwd8TVjwYEQzDqEqS60KEfARax8I+4WonRla49nQ+FeTxnsRkBF7eDvN4bBj lpxgonzt0YajHiish/DzQ6FkKHRC10jl0Eo9uGq6O1J1MGrEuGj8otpHdUryS01TMDq0 eLdKcOMqCqkE5FHuiFrEKzrESNuEKNIq8Y5FMrtmUsxsBGQcbhrE8tsMUBHLJpx0Nr39 yj4A== 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=sY/gO7VWsTCLPzV4qu/BMswgHueJmxHqb+5RfbiOvso=; b=si2hxFsos5ftCJgp4zDxQ1Olnm7vk1XTOMRxgwDdwdnrOAsZIQrGfENfS5mspzpbOC heCHvlFEUAebJdKcHd+2WWANzYgU2Axz2KGvwify9spST/sgzslrYe6wtxct3DN4kPJJ tURq8ujUX6jamo+ElzeqBuo04AVGl8kl7SpeRWMb8Rj71Oxe2ECuS70YMTa+R5ZnqLZA TOUIWPOKStnaDBdDfBjOr2lqbXv2iDzWRoyIJRhxeCRunOIvOG6z5l87U4GjQ9d0zy1X VEpRkw2rBONHSkeAAH/LziW5a5gWnXsqcdqxkmEoTTEPGf1obNAen/wHrr0SGezlYrmG k1yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=F26CAX2r; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="XlxxHOM/"; 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 f17si25827848pgj.208.2019.01.26.05.11.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Jan 2019 05:11:18 -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=F26CAX2r; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="XlxxHOM/"; 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=sY/gO7VWsTCLPzV4qu/BMswgHueJmxHqb+5RfbiOvso=; b=F26CAX2rS8Kc+R dVVP/yafzBB/1AhbrFlaErFq/C0N6FzGuDGUpD/QYfO5v8FjFUvP4/DRXV77P4igDYz3iIhFZ72YE d1NXJ+NYS4F8ao/RIaEIaxFad4ALNtJVzW7ZJG++b0DdeED+C2rGFwKlOeaSozrQ/DSy9RDe93Z9D 6ugi2NKKlsXx0asM+shLCjDaMAmWEIK5dUbiTCfyPoqC/oxjyvrwY0XqZEhEUiTN5/Fbw4xKKG+nU vUtSKakVH/mrmzdNVzLe9Oy/kfnlORZItJGCtTnNXxHftXL8sT86Ams7q5hUcOLfTW0d664W5oFRv 0o3NizILWlN7CNiO3WHQ==; 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 1gnNjq-0003gW-Tt; Sat, 26 Jan 2019 13:11:10 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gnNjn-0003fb-EZ for linux-mtd@lists.infradead.org; Sat, 26 Jan 2019 13:11:08 +0000 Received: by mail-lj1-x242.google.com with SMTP id s5-v6so10549070ljd.12 for ; Sat, 26 Jan 2019 05:11:06 -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=XA5NLDhV30gS07NuF5vW5+O0eIjY1EdoatKv5HFYMHU=; b=XlxxHOM/Uw9+b06ncf1epzykozPgrLbdk5OCvfojmbbNw+3HlH01soA9hbScmY+XrI 5CZPnye4rz6GEvwcafuYj9O5IUtekfottYvJNDnU5sRCEbcTsB8wSECPVGTUL7NOqTHd sokK2jmELoBeBwyyLQBaBLn9mkH9DcknNIoEo= 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=XA5NLDhV30gS07NuF5vW5+O0eIjY1EdoatKv5HFYMHU=; b=Dc2KTY2zzwlocEbVOi45HC+l+MNpizXppMrDle/TOb5bPDVtqB0ZP/T2JxSpl+rFCr sRuH8kghtpUIUrnTgODygXtEr89wTj2olExOfKgpX0SSV5uZVPqBgKZNFJPtKDB4eXIa +0tuAOEVldV2jMnkWhvuXYNUlI75YUvxU9+zjhKwM0lIsbyA8Aha1iuJQKredO+dYyvH 99r5wGgE9nujefLYwzRwOTYcSjCIqK9w45MRKf7Kc5rBJospbmrC6LQGcEaIWa0wz0tn Y/+kRd5N+hkdOvgSgV9E3D9Q5YIE9ic/uuRE9u+ksypH1FGGuvF4ZE1OrowZDqzktptH 2D9Q== X-Gm-Message-State: AJcUukd5LY2HlC6FiOLDTgsWsQdGpnhr3cwQ2VRK99kJ1bUQqUBgR2Ru ajzNUpsk4HTqIhHYMXpXFSAB6g== X-Received: by 2002:a2e:5cc8:: with SMTP id q191-v6mr11876827ljb.192.1548508265061; Sat, 26 Jan 2019 05:11:05 -0800 (PST) Received: from linux.local (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id s127sm2109390lfe.8.2019.01.26.05.11.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Jan 2019 05:11:03 -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 v2] mtd: rawnand: fsmc: Reset NAND timings on resume() Date: Sat, 26 Jan 2019 14:10:55 +0100 Message-Id: <20190126131056.11364-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190126_051107_501041_C0715FBA 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:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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_EF Message has a valid DKIM or DK signature from envelope-from domain 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 , Miquel Raynal 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 and other settings may have been lost so reset the chip to bring it up in a known working state. The FSMC only supports single CS chips so we only need to call nand_reset(chip, 0). Cc: Miquel Raynal Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Update commit message. --- drivers/mtd/nand/raw/fsmc_nand.c | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 ______________________________________________________ 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 Sat Jan 26 13:10:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 156678 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1477111jaa; Sat, 26 Jan 2019 05:11:33 -0800 (PST) X-Google-Smtp-Source: ALg8bN6PDMCkSGKuqnvZdsn61RGvzWJLCWyBRuAwdEEBPdOs3IwJLK2zwRdJ2IYI3/TVehnAB9Fo X-Received: by 2002:a17:902:9691:: with SMTP id n17mr15410694plp.9.1548508293841; Sat, 26 Jan 2019 05:11:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548508293; cv=none; d=google.com; s=arc-20160816; b=1KNNPfbX/yaqpK3r26BjUGX14pW7NQYQABS7sLZNKf6ctF/2RA+AQbByzXAA1hMHCG R3BwNMUEU+fZYzY05iKzqAfGq+2f1VR2mwV6//OL+SYa7FkxIbqVoEAOlRPBiqs3dDPW y631iUEgWou0G7znWrsH1ALRjfxtq9QRzRT3gb4uwhqxY72A/fSRmYqKi1hI4p4Aosjz zn5NbrIFw3W1GjSoKEjMWr3CBtune41Q98XMsmQ0mT9sdJb+kgse8OeBLoeyajOmqxI3 Ekzwaaa4IpIU31qV7X/a/PMVQvYhnE/bJpOR9xTPF1eGP3JUWFiY+UUs+KqcBaYgZdwH Zteg== 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:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:dkim-signature; bh=jNaat2iFGIoAawO5LYSQms+YzOnhFCzZ132S/MukUGc=; b=S2gVnjbQiMNZ8NxrUniu6JliZ2IyB3amXWpJ//+Tr+36y4EbdfUgnZxun7AokZrfcU dPswPzRulJJLJOIVQOwNSoLAGL8i0d2zhfytJLFgGWf9L4owzpkTsvfts4RxHzZ1KRwr 2+EDe7RhfFvHUK1VsOpV1ZljtV7fDNbQSu8iiErayWN9cuRkpP9TNBNlKI6ybvy+lBML Qhf0EGv7pV2gmLRSUtyGxsfpF2OMWpZyKBRwdxn1mqegakg+Ez+qGtb1zz3RGqmQP54T kOXbGO5vN/vdvfsQIVsG8d36E+0fnlw1AKc335wkP3scPP4IqTuCdyiW3A5tSjZg6RWI Ne+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=dXvZiWfg; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PF0jWI4J; 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 c65si7430314pfe.202.2019.01.26.05.11.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Jan 2019 05:11: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=dXvZiWfg; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PF0jWI4J; 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:References:In-Reply-To: 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: List-Owner; bh=jNaat2iFGIoAawO5LYSQms+YzOnhFCzZ132S/MukUGc=; b=dXvZiWfgkkFWDb XuEuKFCFOJ7+H/oKwCRd8sha5DX9QntN5QVRVF7WT4kw4s3w0rRjNIUPLhbGrt2DjtmQAui98yQHp uYflUfnjRQqw3ZWX4+IgDYxyX2FGhw7Zt0mvSz97/sOt8E40AN89G5RQDH4er4+qYVqD80peaqkhS dn6SuP6VXxo+Bc7h97O5x3qfqhpB54jegoly5A2uFfQCd1A6nAXu6M93R2ChzL0fH4JD0rJZ3W25Q 4VdC5EvZi3lGA5LkkfLLqOTY7oyy53VwU9dV7lK2bC01zyv5lUWxVlvIByyP1E3/So7bsncmJtPHE GGKs7VRczAHLWZqjCpTw==; 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 1gnNk2-0003rf-1P; Sat, 26 Jan 2019 13:11:22 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gnNjq-0003gE-EU for linux-mtd@lists.infradead.org; Sat, 26 Jan 2019 13:11:11 +0000 Received: by mail-lj1-x243.google.com with SMTP id s5-v6so10549141ljd.12 for ; Sat, 26 Jan 2019 05:11:10 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=C/3TY6rq/0PZRVa0c05fWF4DRikwplDxAw+KXls7E4o=; b=PF0jWI4JGa7MljDBKfcZ3OLncwcKdnFTYk4oThgzI2HVPi04fE51hJJKeV4isxJ3nU HNeRz887zKi/VT2pdj5cU1TeYEu7ZzzjtAoNyHWekkVOzhTDbZ8b2QAgkEWfB4Ukk687 frN3FCracex0vBbf7Ead2sVV8TiHJNVZ4X/vQ= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=C/3TY6rq/0PZRVa0c05fWF4DRikwplDxAw+KXls7E4o=; b=gGCnCgtQay6CF9eLhk9HMx7eRJDtt/S31YdPiGEuIUOmGhkfqUuB/6axuPqWWK65HY WG5Iqj41xV6G4X4781yKG7IyAaZeu7DN+8ZHV3qkJZxiSvO3bH7Ri/O5eQRR8pQSc0tU /P9EHaHUwosli8yU6U26BP6p1drzzgkbrOnNerXiB7J6HKkNj4dJFY3SNI/fsG9B0VLi sH5sM1xe0hp3X2yujm6K+xYjsqwk6R5Hnd02T0i1zpkI8W1OtAn85UNufYiKIOIrR7qd 8d1BS1GyjpFP6Dbsr9dTU9J+ibH3wmI94p6es3+YFiF3yk2z7Vl1/75isAd0Lxb4oyEb JMEQ== X-Gm-Message-State: AJcUukcthbERss/wLRCVB7pIDwkmN7YAwpNgFmK5QqmwABZAf5bjIt7E JPccXw6i2V6rYQbc5hd2BAEhP1J5XkQ= X-Received: by 2002:a2e:2d11:: with SMTP id t17-v6mr11994173ljt.159.1548508268449; Sat, 26 Jan 2019 05:11:08 -0800 (PST) Received: from linux.local (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id s127sm2109390lfe.8.2019.01.26.05.11.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Jan 2019 05:11:07 -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 v2] mtd: rawnand: fsmc: Disable NAND on remove() Date: Sat, 26 Jan 2019 14:10:56 +0100 Message-Id: <20190126131056.11364-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190126131056.11364-1-linus.walleij@linaro.org> References: <20190126131056.11364-1-linus.walleij@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190126_051110_485797_C679C5D8 X-CRM114-Status: GOOD ( 17.02 ) 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:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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_EF Message has a valid DKIM or DK signature from envelope-from domain 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 , Miquel Raynal 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. Cc: Miquel Raynal Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Break out NAND bank disable code into its own function. --- drivers/mtd/nand/raw/fsmc_nand.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) -- 2.20.1 ______________________________________________________ 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..6c7ca41354be 100644 --- a/drivers/mtd/nand/raw/fsmc_nand.c +++ b/drivers/mtd/nand/raw/fsmc_nand.c @@ -965,6 +965,19 @@ static const struct nand_controller_ops fsmc_nand_controller_ops = { .setup_data_interface = fsmc_setup_data_interface, }; +/** + * fsmc_nand_disable() - Disables the NAND bank + * @host: The instance to disable + */ +static void fsmc_nand_disable(struct fsmc_nand_data *host) +{ + u32 val; + + val = readl(host->regs_va + FSMC_PC); + val &= ~FSMC_ENABLE; + writel(val, host->regs_va + FSMC_PC); +} + /* * fsmc_nand_probe - Probe function * @pdev: platform device structure @@ -1120,6 +1133,7 @@ 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: + fsmc_nand_disable(host); clk_disable_unprepare(host->clk); return ret; @@ -1134,6 +1148,7 @@ static int fsmc_nand_remove(struct platform_device *pdev) if (host) { nand_release(&host->nand); + fsmc_nand_disable(host); if (host->mode == USE_DMA_ACCESS) { dma_release_channel(host->write_dma_chan);