From patchwork Wed Jan 22 09:27:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233428 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=DATE_IN_PAST_03_06, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01EFBC2D0DB for ; Wed, 22 Jan 2020 13:20:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C03ED2467A for ; Wed, 22 Jan 2020 13:20:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699201; bh=KjfjgbCTqX+0P7kzgRGtTQuph1RQP1dgmSW8J+6GUXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=tlY5GHQI24u/nwCW93hMgsbFG1XAdOIaOZmLGAc+WSTtmFsq3CdY+5Y8RYT4E7HTw YQ/6bOmRdWaRdN5SJ1vsPYYsFCf2viJwxVCWlHQtlSMD3Vcyax4N+XniVs4X24U5e3 YP9rGTnbr/wUbWZ5vOkTKv/pfbdI6go8Zn8vPP0E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729332AbgAVNUB (ORCPT ); Wed, 22 Jan 2020 08:20:01 -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 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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;