Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3493209imu; Sun, 11 Nov 2018 16:20:43 -0800 (PST) X-Google-Smtp-Source: AJdET5fHrdlbJ8m3R6KYllnnIRgKQEtbQ2gcVRFl65yH9XF6Oh2/eh+/3d6SWmR7Df2Rdqt61Ok1 X-Received: by 2002:a62:34c5:: with SMTP id b188-v6mr18748586pfa.65.1541982042887; Sun, 11 Nov 2018 16:20:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541982042; cv=none; d=google.com; s=arc-20160816; b=I3UJof0kEG1PeUpEkAzZG31shB1KErO0HNhOTiLKjdFQp8FTgk4I0+dGXg39XDVop7 DZkvNo2YxMaLMyDLwLRbk7VESUP8PzNblqd6YJiu0ukpKf7ZEaGGzDneH1B5vHfDahhY YrclPdb5w/Hv6+VsdGiexkZddwryM0UlIDl87EG+xmhTs/tmQeZOcIR9Gj/vp7SZ6fdt j9LNGTbiSReBYHp2KpM7M6BPNmhWDKPpaKAc1uV7c2iAGyCjzynnBhop9bsQ6TrL+2Iq MVxIQjCQIq3fcwIm1vLxZmvw771JmDw/5Na+iOCBSPn6EEahd56JQYfbcUIiTF/oVkZD L5fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6FV/1dxkSpvdEv2l1o/c3oWlzAEPShaZZxDkSfFUVVg=; b=ULlsfYVnenQbxyeQexJRqRtRW/CRkoiW53QWEWkPECc674P/px77FfQ6O9Q+ZI2mVH FBACIfbeEhOT8R6k/m6fCHUeexlNMoLHqkuAkiOpcBeIbA76Ynr+MfXWqP3k1JUPPO1R OWXWvfqriUwZlLnMo7k3QyL4bxMpHJoKp6L+0LYAlZXAvp9TSNpGtHat27Nec1Cish9b oPJOgjjg5XwLXOTUH3h5IPcf3ZLSFMy1l2wxen+vH6wMQXqOMUCS1fbffTs5AiYkK42f G0ZJY1IIoId/ZVGQkOypVHG+0I/OoawLvz94yY9wDTuRY9iVSf5b7Z49li3i4yVUZJyz 2e8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cbKxI7gx; 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 l11si14050749pgb.545.2018.11.11.16.20.27; Sun, 11 Nov 2018 16:20:42 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=cbKxI7gx; 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 S1729961AbeKLIQ6 (ORCPT + 99 others); Mon, 12 Nov 2018 03:16:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:58446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729918AbeKLIQ5 (ORCPT ); Mon, 12 Nov 2018 03:16:57 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C201D21780; Sun, 11 Nov 2018 22:27:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975221; bh=a60wFSQSYQOfn8SeFp4/acfEaW1iUxXiYPOGEE8y1yA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cbKxI7gx4jWNCDcmkZ7f6glt85aQ3qDaX2kA+QNQU0Z9Bt2vWPkeRgXrGiFMGn8Tb gSn/RLSd85DPXte010bck91ZgGKLGG4y+Jsj+YtoVVgeLcCkcRx5lSDeZxx521593h /akCZkfD19oQL/ed2cy5NhrZPD0sDNg5LMQIJ2Rw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Mack , Miquel Raynal Subject: [PATCH 4.19 004/361] mtd: rawnand: marvell: fix the IRQ handler complete() condition Date: Sun, 11 Nov 2018 14:15:51 -0800 Message-Id: <20181111221620.722293890@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Miquel Raynal commit 53c83b59759c1ee213f5ffa194909daee8902a28 upstream. With the current implementation, the complete() in the IRQ handler is supposed to be called only if the register status has one or the other RDY bit set. Other events might trigger an interrupt as well if enabled, but should not end-up with a complete() call. For this purpose, the code was checking if the other bits were set, in this case complete() was not called. This is wrong as two events might happen in a very tight time-frame and if the NDSR status read reports two bits set (eg. RDY(0) and RDDREQ) at the same time, complete() was not called. This logic would lead to timeouts in marvell_nfc_wait_op() and has been observed on PXA boards (NFCv1) in the Hamming write path. Fixes: 02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver") Cc: stable@vger.kernel.org Reported-by: Daniel Mack Signed-off-by: Miquel Raynal Tested-by: Daniel Mack Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/raw/marvell_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mtd/nand/raw/marvell_nand.c +++ b/drivers/mtd/nand/raw/marvell_nand.c @@ -686,7 +686,7 @@ static irqreturn_t marvell_nfc_isr(int i marvell_nfc_disable_int(nfc, st & NDCR_ALL_INT); - if (!(st & (NDSR_RDDREQ | NDSR_WRDREQ | NDSR_WRCMDREQ))) + if (st & (NDSR_RDY(0) | NDSR_RDY(1))) complete(&nfc->complete); return IRQ_HANDLED;