Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1981950pxx; Sat, 31 Oct 2020 04:46:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx80M7RyKzYMJCkf8XUN30lL25gqcOVRbtMEVE9l+IohJk+2WjOHZ4OihfVb8EvGYcVpS1l X-Received: by 2002:a17:906:51dd:: with SMTP id v29mr6881600ejk.69.1604144768841; Sat, 31 Oct 2020 04:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604144768; cv=none; d=google.com; s=arc-20160816; b=MI6erTN00lshWgkWxGGcGhYG5Bp27fJ8Hk1V6R2lB1cK5MmbZOagxbHs4fELuETP42 Ngm2doiW42Tgjf2bOouQOZPwY9HQuPKHNImM0XEaJdyX8+wxYOSJaDBqAOge/033I6/Q 9PsAgBGvTQJ8IRvy0veI+pjQgDj/twXyDjR1LYTIRYUpyMQciOU9C001s3u07WLeSQCj h42e2+x8Lb+43kFHOUIpzij4KyQj0EbV4NWFDo5VapM2vD0rFs8cEbmN8MZueg1HYJgf 5BfJ1V3RLOk11DhejnjG6/aCrIA5j204SvGyaQDA2AAoru0MSrZ3rTZL60aT9DSlsRQn K73A== 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=WksCj4Wt99wAFB8eR02JW/7nUk6bXrF4Uhb1OoL4OYc=; b=HInaEjbkRtfbZntbx0ZMXKiXZNBWVOJlzlcMOIc455cUuniFjysUNo/rLqjI5mCFUj eAn6swFZQVV6hhfmLLOoAA+XnSv69TxFYdkQxKTrXHi8nZCiGzd3HMm4+QiyltzJYwol LgH+6mtK12yRKB/KLzAXQRIiNs6t9OMJ0+g7MbSUpe8eGqEBpnVhIEuOeHDaGEJirLnJ 8SY/QTkzrJ2S0sKhcumr4NZ7OMH+9pb0r+Ot9xtEYutqytBPuTdntyUsil/Q2faxQsIm tiAQyWBtSdDZiEu+pnJ3pENgvxJikE7njBS3iwi+lqLbC3WuLddSCDlJWwEcIwHSMbOJ 5diQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="l7/fnwS7"; 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 v3si5801349ejx.576.2020.10.31.04.45.46; Sat, 31 Oct 2020 04:46:08 -0700 (PDT) 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="l7/fnwS7"; 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 S1727261AbgJaLmb (ORCPT + 99 others); Sat, 31 Oct 2020 07:42:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:42062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727864AbgJaLm3 (ORCPT ); Sat, 31 Oct 2020 07:42:29 -0400 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 6F9EC20731; Sat, 31 Oct 2020 11:42:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604144549; bh=ImkCi6wVJfwB6SBF9cHHXCHQVVWly6Y7DHUD+gkteAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l7/fnwS7yAWtKFuwDpA1ZDLaKtu9WnQOtJtml1ro6jNwslIuVMHWVVQw2MknncrnH Q9JKx/5VynCA6vNx/KTpfrat0VjMUWVvUlBHz7zQk7auyxIADxvx5ELVu/tmpvbB2g Tfr2H9RnNMPq1IgNpxUayWxxlY/v+vh5D4d+zSDE= 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 5.8 61/70] mtd: lpddr: Fix bad logic in print_drs_error Date: Sat, 31 Oct 2020 12:36:33 +0100 Message-Id: <20201031113502.422598969@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201031113459.481803250@linuxfoundation.org> References: <20201031113459.481803250@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 @@ -128,7 +128,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)