From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1.bemta8.messagelabs.com ([216.82.243.198]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fNxU1-0007Pi-6V for linux-mtd@lists.infradead.org; Wed, 30 May 2018 09:33:57 +0000 From: Tokunori Ikegami To: Boris Brezillon Cc: Tokunori Ikegami , Chris Packham , Brian Norris , David Woodhouse , Boris Brezillon , Marek Vasut , Richard Weinberger , Cyrille Pitchen , linux-mtd@lists.infradead.org Subject: [PATCH v8 5/5] mtd: cfi_cmdset_0002: Change erase one block to enable XIP once Date: Wed, 30 May 2018 18:32:30 +0900 Message-Id: <20180530093230.3240-6-ikegami@allied-telesis.co.jp> In-Reply-To: <20180530093230.3240-1-ikegami@allied-telesis.co.jp> References: <20180530093230.3240-1-ikegami@allied-telesis.co.jp> List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To enable XIP it is executed both normal and error cases. This call can be moved after the for loop as same with erase chip. Signed-off-by: Tokunori Ikegami Reviewed-by: Joakim Tjernlund Cc: Chris Packham Cc: Brian Norris Cc: David Woodhouse Cc: Boris Brezillon Cc: Marek Vasut Cc: Richard Weinberger Cc: Cyrille Pitchen Cc: linux-mtd@lists.infradead.org --- Changes since v7: - Just drop the Cc: stable tag from the commit message. Changes since v6: - Change Cc: Joakim Tjernlund tag as Reviewed-by: tag. - Add Cc: stable tag. Changes since v5: - None since this change is implemented by v6 patch series. drivers/mtd/chips/cfi_cmdset_0002.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 6adda4dc2007..6c681cbf2d37 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -2389,13 +2389,10 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, chip->erase_suspended = 0; } - if (chip_good(map, adr, map_word_ff(map))) { - xip_enable(map, chip, adr); + if (chip_good(map, adr, map_word_ff(map))) break; - } if (time_after(jiffies, timeo)) { - xip_enable(map, chip, adr); printk(KERN_WARNING "MTD %s(): software timeout\n", __func__); ret = -EIO; @@ -2418,6 +2415,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, } chip->state = FL_READY; + xip_enable(map, chip, adr); DISABLE_VPP(map); put_chip(map, chip, adr); mutex_unlock(&chip->mutex); -- 2.16.1