Received: by 10.213.65.68 with SMTP id h4csp872800imn; Tue, 27 Mar 2018 10:19:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx48MPQnFoOKs/JVkVZ7rxANm493/5+T0gS9+cioHrs0HHF01/LgECIwWMCmiBFTlxWinQANi X-Received: by 10.98.139.143 with SMTP id e15mr163997pfl.134.1522171192441; Tue, 27 Mar 2018 10:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522171192; cv=none; d=google.com; s=arc-20160816; b=UIDyoU8dZUMtIekUXQz/NSKUzVV3FDItQlEIv4AdfTjwOjmP4TlkeKEfTI6BINU1w1 NTWg9M/JnLoWoE/caVgl7FQAtB1eD7K6RFXPjSW6OlPe2lR+GZBqeDggUB8lXNKDOiVY +T3Eq3rdH7MRtwjD/0B5WfGKL45mjnUA2GU7X80Tlli0dDf57dKIIYBA1IhGG2l4hSpq UUGwqgA4gVZaSpYcN/ajmAwMKNhCDrMAOs79J+sKeZpN+nx0EZ0v33tfpU2SKMK+MZUn Ke82KZ/p1zDj/aQQds/nP6AdlsqoHJp7N0wdxnQABSenONZ4krOkDPfItvF4J1hKLhKy hNdA== 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=QHP2ZcPBG+0xEFyIqfY3BQfMCySYFonJxY04NxxoJXE=; b=QIB1eF+6lycBACezjYiQ/YOeVClh/EPVkxl09DrmiHdyEINftBsc5nzabx5GNOHLny XwT/39AYFXWTQd3c5P+uSaD2KjNAKtZid4DQzfEzRz8pcrCo0OCcudW69oCXiO1CIBsm Wczum2rNvPmiuToDQ2I0Ff+agzo/jXtcBGw/kGtMkyZSgj2JPbOe2GKq+He9RasZBeo2 vUPtbuUgWZDh19srhKMb6iBf8wLXUHuhlUSL28QW+nuPIw6Ibb2NVlD4hcK3+4DAoI5A wPLTcGcDmW7AmgIRzmj+h4yCMXM0dKoM/T+RVNGfViirAZlOKxn5L2hXnn+oGHLfrYis ihrQ== 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.19.38; Tue, 27 Mar 2018 10:19:52 -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 S1755197AbeC0QiX (ORCPT + 99 others); Tue, 27 Mar 2018 12:38:23 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46688 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755168AbeC0QiQ (ORCPT ); Tue, 27 Mar 2018 12:38:16 -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 4B735FF7; Tue, 27 Mar 2018 16:38:15 +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.14 066/101] mtd: nand: fsl_ifc: Fix nand waitfunc return value Date: Tue, 27 Mar 2018 18:27:38 +0200 Message-Id: <20180327162754.077695792@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162749.993880276@linuxfoundation.org> References: <20180327162749.993880276@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.14-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 @@ -626,6 +626,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) | @@ -640,12 +641,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; } /*