From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.free-electrons.com ([62.4.15.54]:60109 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932193AbeAKVUY (ORCPT ); Thu, 11 Jan 2018 16:20:24 -0500 Date: Thu, 11 Jan 2018 22:20:20 +0100 From: Miquel RAYNAL To: Boris Brezillon , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Cyrille Pitchen Cc: linux-mtd@lists.infradead.org, stable@vger.kernel.org Subject: Re: [PATCH] mtd: nand: Fix nand_do_read_oob() return value Message-ID: <20180111222020.208d2359@xps13> In-Reply-To: <20180111203958.8211-1-miquel.raynal@free-electrons.com> References: <20180111203958.8211-1-miquel.raynal@free-electrons.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: stable-owner@vger.kernel.org List-ID: On Thu, 11 Jan 2018 21:39:58 +0100 Miquel Raynal wrote: > Starting from commit 041e4575f034 ("mtd: nand: handle ECC errors in > OOB"), nand_do_read_oob() (from the NAND core) did return 0 or a > negative error, and the MTD layer expected it. > > However, the trend for the NAND layer is now to return an error or a > positive number of bitflips. Deciding which status to return to the > user belongs to the MTD layer. > > Commit e47f68587b82 ("mtd: check for max_bitflips in mtd_read_oob()") > brought this logic to the mtd_read_oob() function while the status > coming from nand_do_read_oob() (called by the ->ecc.read_oob() hook) > was left unchanged. > > Fixes: e47f68587b82 ("mtd: check for max_bitflips in mtd_read_oob()") > Cc: stable@vger.kernel.org > Signed-off-by: Miquel Raynal > --- Oops, patch untested, will send a v2, sorry for the noise. Thanks, Miquèl