Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3214263pxb; Mon, 9 Nov 2020 05:46:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzrCOMZ19+EttfwtYCIZsaBXHIrOa8DODglnz/9rAvBtRKNgLYXHgV56jFSFP8w+JpNItkx X-Received: by 2002:a17:906:b0d7:: with SMTP id bk23mr15489533ejb.103.1604929607029; Mon, 09 Nov 2020 05:46:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604929607; cv=none; d=google.com; s=arc-20160816; b=vE/vtSPVxeFrqbftIiYsKL3nxbLnNpzK6WaP/cN1of0XjVIHMRxQlK2JFqCZrUGEAv NfHKlfAFUJ92OIBsQgpWJ2nFFGrJCBSYr5K80csnqp+sezoVZS2KOCsfgfarNBd6FkwR bakSzeFa6OEbYJr0VpDQTMZ3O8aMk+E9lzrH5zg9VuYmXstSgddTX7N/EMe/0EODwE4K /2tRa1O9HdMvrlicua9mBg6zWL7maa7rP/WmlGxBIwqdDB6Au3c6O7IeT0603sA8C85y Gluq0ZB244knaN6ePKTnob5kgl8yOvpSB8+kXTv7XjjDqJgpzvgx7YrsQB+k5tpenqNr Zh+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/0wTJa6pokjM1eLzVSaVeUjhpRTdUUNv9aM9hPZ8AhE=; b=Ri9hCQq60vaaeTSi9YdyY1ZQxzy0ZNbkFNeHsM8ra+t0wJplfRZyp4arudUmsKvfzj Pl5vVk6+WBfUGtiSJVr0DmtnyrabvP0/lmk381manyaigTokofb/+fwkktGyLhYDWga7 R0kL1Q4nfc8swa1s7mLYWUG2ePITic5Lws42r1RhmWCWjF90TFdmJrn7X5AT6RH1GTo4 Glom2G1ALGD/h9gyYjYX9qzHkXJMxx42u6On2zaKo8n7pkPfyyDnAMuRCPYKUV+Tslz/ k2+QOJCmV8+bWiYjkXFchVFqQC2DGvcg5YldcQEXUXL03kqEUwkKP40WSXTm07iq0JhI AkXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Rh8aYK3J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r9si7122767ejo.134.2020.11.09.05.46.23; Mon, 09 Nov 2020 05:46:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Rh8aYK3J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388021AbgKINnA (ORCPT + 99 others); Mon, 9 Nov 2020 08:43:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:54588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730502AbgKINA1 (ORCPT ); Mon, 9 Nov 2020 08:00:27 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 804E720684; Mon, 9 Nov 2020 13:00:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604926826; bh=Jgnn8GoI7D8swA4JQ5DxH/63GCBrrC5loXSvgV+AMRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rh8aYK3JRFcTak2BogrkMSgke0g+RibXLM3atn/ZRpYmw4rbto6FssQ9ElFzx4EaQ 7+LAB2ET65cKQIjKH9JXy6BYqlTRJ954PTqcY3Qi17wxUsWpWl1190yFRPrMXGyNaK cMEKmXZsAQO2n0tGb/r6ZOXc4TyJYEVPOb0Cpao8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joe Perches , "Gustavo A. R. Silva" , Miquel Raynal Subject: [PATCH 4.9 010/117] mtd: lpddr: Fix bad logic in print_drs_error Date: Mon, 9 Nov 2020 13:53:56 +0100 Message-Id: <20201109125026.141875520@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125025.630721781@linuxfoundation.org> References: <20201109125025.630721781@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gustavo A. R. Silva commit 1c9c02bb22684f6949d2e7ddc0a3ff364fd5a6fc upstream. Update logic for broken test. Use a more common logging style. It appears the logic in this function is broken for the consecutive tests of if (prog_status & 0x3) ... else if (prog_status & 0x2) ... else (prog_status & 0x1) ... Likely the first test should be if ((prog_status & 0x3) == 0x3) Found by inspection of include files using printk. Fixes: eb3db27507f7 ("[MTD] LPDDR PFOW definition") Cc: stable@vger.kernel.org Reported-by: Joe Perches Signed-off-by: Gustavo A. R. Silva Acked-by: Miquel Raynal Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/3fb0e29f5b601db8be2938a01d974b00c8788501.1588016644.git.gustavo@embeddedor.com Signed-off-by: Greg Kroah-Hartman --- include/linux/mtd/pfow.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/mtd/pfow.h +++ b/include/linux/mtd/pfow.h @@ -127,7 +127,7 @@ static inline void print_drs_error(unsig if (!(dsr & DSR_AVAILABLE)) printk(KERN_NOTICE"DSR.15: (0) Device not Available\n"); - if (prog_status & 0x03) + if ((prog_status & 0x03) == 0x03) printk(KERN_NOTICE"DSR.9,8: (11) Attempt to program invalid " "half with 41h command\n"); else if (prog_status & 0x02)