Received: by 10.213.65.68 with SMTP id h4csp915262imn; Tue, 27 Mar 2018 11:07:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+2Ldkq8vDXDQwV/XgspmnVAQ7YUd/lTY1kXsa6EGdosGKi6XVfKYy/UPThnTbnREei6Id2 X-Received: by 10.98.159.129 with SMTP id v1mr258925pfk.25.1522174031570; Tue, 27 Mar 2018 11:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522174031; cv=none; d=google.com; s=arc-20160816; b=Q4jpIWha+fTYetGWXACeHux+fDogpHb5nKFnFlnfLgknYPGXu5I0SxKPg157B+0M35 We60rn4vN6ZTdPoTsgkMX0Ym5NR8eq0h4Mru99f+f8VEAXALfLb6r37Bu7qUYwkbtsut z8Or/rq1QgANqHBLkfbiJ7930NFYZMnrlJtClXAEHNViYqLKsWPPOHgRZz3ovbj2VgrE IuevRgtFHlugX+mxp747rBONuV6jktJdGoIpxKf6lwpJGeFdKoI8UAmfZeRD9eCwVPVg LcWe25vlkc7e/WMk6xAyc0CmVJv0Ze0t/LyRybD6HKZnSlbF5pAAcIwwZKqKTlNDYvmv zK8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=UlEPmGP/T7QnhwO1qO4/EDae3ho5kCFtirDBTMLChNU=; b=JDFeUJgXAeN5kCT/tcgaszVjU4cRd8WaNlZZcOTEme+dpmfiXO8ELlm1VBv9QCC3oN L3jcGK5rhzMNHUc29DNJy37bsgVbhdIwEp7hLsDSTjEkhdyvOjsxHJqqGSKk4EHjrAEq e0XBiWSc9I5hoNTTXAjTPyiVCyEFS7HHUYvk4Htro4vnqSpyOeV3I6z46VfC6HM/9Ts2 H8wRBzaIyBNXAao67RUpuMd5SVaCA4BAfI0mdKrYaunFTGavcaLXNePPFwuNFMdaPQma o3GITUXZz+LJo2zEwu9+lo7r6NmpVQ7n6KZXygbbv9VrDz3SfQxSc8o/r8uu5c6hpDE9 2v5g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 85si1099232pfo.234.2018.03.27.11.06.56; Tue, 27 Mar 2018 11:07:11 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752831AbeC0SFu (ORCPT + 99 others); Tue, 27 Mar 2018 14:05:50 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41408 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752695AbeC0Q3g (ORCPT ); Tue, 27 Mar 2018 12:29:36 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E50E210B8; Tue, 27 Mar 2018 16:29:35 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jagdish Gediya , Prabhakar Kushwaha , Boris Brezillon Subject: [PATCH 4.4 29/43] mtd: nand: fsl_ifc: Fix nand waitfunc return value Date: Tue, 27 Mar 2018 18:27:33 +0200 Message-Id: <20180327162718.054406593@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162716.407986916@linuxfoundation.org> References: <20180327162716.407986916@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jagdish Gediya commit fa8e6d58c5bc260f4369c6699683d69695daed0a upstream. As per the IFC hardware manual, Most significant 2 bytes in nand_fsr register are the outcome of NAND READ STATUS command. So status value need to be shifted and aligned as per the nand framework requirement. Fixes: 82771882d960 ("NAND Machine support for Integrated Flash Controller") Cc: stable@vger.kernel.org # v3.18+ Signed-off-by: Jagdish Gediya Reviewed-by: Prabhakar Kushwaha Signed-off-by: Boris Brezillon Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/fsl_ifc_nand.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/mtd/nand/fsl_ifc_nand.c +++ b/drivers/mtd/nand/fsl_ifc_nand.c @@ -726,6 +726,7 @@ static int fsl_ifc_wait(struct mtd_info struct fsl_ifc_ctrl *ctrl = priv->ctrl; struct fsl_ifc_regs __iomem *ifc = ctrl->regs; u32 nand_fsr; + int status; /* Use READ_STATUS command, but wait for the device to be ready */ ifc_out32((IFC_FIR_OP_CW0 << IFC_NAND_FIR0_OP0_SHIFT) | @@ -740,12 +741,12 @@ static int fsl_ifc_wait(struct mtd_info fsl_ifc_run_command(mtd); nand_fsr = ifc_in32(&ifc->ifc_nand.nand_fsr); - + status = nand_fsr >> 24; /* * The chip always seems to report that it is * write-protected, even when it is not. */ - return nand_fsr | NAND_STATUS_WP; + return status | NAND_STATUS_WP; } static int fsl_ifc_read_page(struct mtd_info *mtd, struct nand_chip *chip,