Received: by 10.213.65.68 with SMTP id h4csp896051imn; Tue, 27 Mar 2018 10:45:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx48CikIHmjF5sNJJamWpcK2YtjDwSrdrCnQ+L0bF5NOf6u3NHtF/v8K/RWnwNsBgQV84XcRY X-Received: by 10.99.101.198 with SMTP id z189mr169334pgb.97.1522172733075; Tue, 27 Mar 2018 10:45:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522172733; cv=none; d=google.com; s=arc-20160816; b=0yIEfGX51nRD6tn4RLOFU4D3RYbICPVGo1H18bf7PLczpb1OnD0KulmuKa4xjV/nhM stZSfvVjaBhqEOC0e9/dDayvJ64QWFp/nvGMJ+Lr8JkizcBe6hsYltFBppUOTOg1+XuX RaBjvo1nRxWjEmPM8NdP0KEGMEcZxr/WlrD3VRtz4v5vW5IosPEDrToT48Wf41AqW4kS FKdNB09bbG5rlOkKoEiBbRl57LmvXqIEGWBqtTS66gpnnNIW/sJdU4VV8YxkPG4fminx qX5SwIaFj9kloXLhHcrpbtlxSL1OiP2veEJNxjJkxwQD8rN7CqDAh1LBcOnSByKWFFKz rEQQ== 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=dzVmKpvh7MVK3QfvpXMD7f+o8SehUNRV4AypIuCcY9I=; b=vrs8GjMZNg90miUghPDBdEmWpw4OEs19Q17bFxI0Xe95FkvOAfXUJux//Y9kSe7qxI qYCbhKptakJQji2J4mU7vOh07H1m0SRHgbTJbGIF0rVN3A8kLrUiZmDV04zP50YXGp0e DC6T7xLgE4xNxgTQ5lb+QCe85c8TjQoqwKxl3+q83ZclMfeZux1x1/hd2Fho9Cu0SpFm 7Q2mOLAmtsZnWWCTZGqtwrJrkgQWusemyw/VRPwWvr9xuM2sCUNAwgpHkFgtnGbuE/bF S05woAPr3EPVtGRb3e8qJ+VbISlaCeerTixhWmUiqIDWJcERt00VFMP5t4ccCxR2NiGm DIog== 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 91-v6si1651500pld.396.2018.03.27.10.45.18; Tue, 27 Mar 2018 10:45:33 -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 S1753975AbeC0Qdf (ORCPT + 99 others); Tue, 27 Mar 2018 12:33:35 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43916 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753883AbeC0Qdc (ORCPT ); Tue, 27 Mar 2018 12:33:32 -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 BF59A10CE; Tue, 27 Mar 2018 16:33:31 +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.9 39/67] mtd: nand: fsl_ifc: Fix nand waitfunc return value Date: Tue, 27 Mar 2018 18:27:31 +0200 Message-Id: <20180327162729.151278230@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162726.702411083@linuxfoundation.org> References: <20180327162726.702411083@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.9-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 @@ -656,6 +656,7 @@ static int fsl_ifc_wait(struct mtd_info struct fsl_ifc_ctrl *ctrl = priv->ctrl; struct fsl_ifc_runtime __iomem *ifc = ctrl->rregs; 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) | @@ -670,12 +671,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,