Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4819646ybl; Wed, 22 Jan 2020 05:22:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzQ/6VNecDFozcJxNAkvAVVW7yEhylId5eZpAlAzAa/05YIrTf9WVOsekWH/2Rw+fGXHme8 X-Received: by 2002:a9d:4789:: with SMTP id b9mr4157763otf.277.1579699323984; Wed, 22 Jan 2020 05:22:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699323; cv=none; d=google.com; s=arc-20160816; b=nD9TAis+YyIBAJRHuddnoxkgIUT3IabARVYg+B1x4H1uY8LiPcj6KptASFP9gGZQA2 m/YUohCpRjGwPXbJ/IYxvidbI7i9I7iPyJTiw1jdreoEmXS6YsVCaQumT0iFZmGfy7a2 4RjyjDW8nLEgWP477SJCyU74IWlb8nowg3Roua89uXS2kTw0h8iVvTz0PiyhJ97J+9QL nbho+2eDcQmWuGsEkgJVxeNdAHU3mZRIddua2SetVcQytQCdG6XyMZt/fqfQbPU2Kp4Q iu/UsCCOg2SpB4mPfQBULTRL8qH7w7Jwvj2nCVAJK4fOzy3+YThwsK+Z7Ude5mqN4MBJ mjSw== 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=skYPVRzpClK55TumVltoeTTmlOc0/zaG7fxxcEz99qg=; b=rMwZxMsbIuHWw/XQzZtNSmRevjtKxINd5fv4xfIwMTOuhnScfn2Lg528sreNIMM4ik QO1TnpaTBNcMTgbN3UNfTfqFKTIFiiE8GFEW/Mx2Dw06YzzHZeVA7cu449Zndirr5aME 19W0Di65ydHUz/d2pRk95V3PG6gRQQK9ZI2Ou1WoW8DSRTfVNQ5e/1QCuelo/N7V5Puo 0obm7AUBYjaEWVVA0c4FLJNobQLycaOp6dyCMCxR90BPS6nqhLlC+CwuV3ENTfQHZKD2 1lZyO7h00JUcTveNXfNjB0y+UHZ5VLNGPljEPqKb/F/+h7bEZSqBaXFmRkM6DEdd8aJZ afdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dEIHI6kr; 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 l204si20818968oig.31.2020.01.22.05.21.52; Wed, 22 Jan 2020 05:22:03 -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=dEIHI6kr; 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 S1729281AbgAVNUC (ORCPT + 99 others); Wed, 22 Jan 2020 08:20:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:36026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729849AbgAVNT5 (ORCPT ); Wed, 22 Jan 2020 08:19:57 -0500 Received: from localhost (unknown [84.241.205.26]) (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 6436A2467E; Wed, 22 Jan 2020 13:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699197; bh=KjfjgbCTqX+0P7kzgRGtTQuph1RQP1dgmSW8J+6GUXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dEIHI6kr58asRz5alAVHwrgewcyunWz/JMhdSwpWfjsDZniyI4u6r3eXN0mCwFJEZ 26NI5IoN3OF7FYWDZH+Kqs+qmtbg+6AmyagEqeNmWeWT12WNsg6W7Czqo+veIr4H0w Ics6BHBjPShIliWMuWTKLUB6XYJWnNQc3mNhLWBI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vignesh Raghavendra , Tudor Ambarus , Miquel Raynal Subject: [PATCH 5.4 069/222] mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion Date: Wed, 22 Jan 2020 10:27:35 +0100 Message-Id: <20200122092838.664472744@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Vignesh Raghavendra commit 440b6d50254bdbd84c2a665c7f53ec69dd741a4f upstream. mtd->size is still unassigned when running spansion_post_sfdp_fixups() hook, therefore use nor->params.size to determine the size of flash device. This makes sure that 4-byte addressing opcodes are used on Spansion flashes that are larger than 16MiB and don't have SFDP 4BAIT table populated. Fixes: 92094ebc385e ("mtd: spi-nor: Add spansion_post_sfdp_fixups()") Signed-off-by: Vignesh Raghavendra Reviewed-by: Tudor Ambarus Signed-off-by: Miquel Raynal Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/spi-nor/spi-nor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -4544,9 +4544,7 @@ static void spi_nor_info_init_params(str static void spansion_post_sfdp_fixups(struct spi_nor *nor) { - struct mtd_info *mtd = &nor->mtd; - - if (mtd->size <= SZ_16M) + if (nor->params.size <= SZ_16M) return; nor->flags |= SNOR_F_4B_OPCODES;