Received: by 10.223.185.116 with SMTP id b49csp1128876wrg; Fri, 23 Feb 2018 12:26:20 -0800 (PST) X-Google-Smtp-Source: AH8x226yRqP34yYBvtGoBzVWm+nYBPvHhyIpquCr9hdvh+vISFzbTezPRaRWJ73seAClZGD1Nlkg X-Received: by 10.101.93.82 with SMTP id e18mr2289234pgt.371.1519417580368; Fri, 23 Feb 2018 12:26:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519417580; cv=none; d=google.com; s=arc-20160816; b=M5JSB9eernbumT4xXxqcqDHX3fC11oL3B3kEz7YdDuBTFdKv5YpmiFEuD2v/EWsX+t sTYa26ESkNaxjlDXFjWl1Q2ATEaA85Yb2PO2dbEmB57N4TBEfryphur/ozkhj72OSJao sl/Nw5ctcGTDu2OBLOsyGsk1lXD4QrqBjE+ndcqemOb5GtXAyjgGg4BzVL5M/+dIgG1E jFaByEpo4PNZsIY5ymcShg+8vHxHupOMMQo0UeLURSPc6ykr1epfjBLnM9xdm7GyyJcq QKTb2HEDSSGrxM69vtN1Bik8oZP/xUV2aQTSYVJOlr42iMUNSqG44P/xYmIYFTI6/AF8 qKsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+TxwMbq2Q4AmMlfogKWQ3TW+QLK0v5rhJQ6XQ+bVP68=; b=YKEmteMsO9Uxmt8e8JioZjSPQy/pY2D8yQsSi+dAcoCzOGD+8J938RGFvHzzP072Hp 4DalkzOWT5TJ64Q2lbmQuD7OqKbPMy/pXJpMVq4ckGZFoWz5V5ieV+/SmZ5WzTHShCUf 1SWW2e2GmEkY4+WzAXrsfD4mRs1KX76QFhEaRQW4flW/KKHaKpsvdVRRF4gt273weeWc H1F9c2ev+Xwu9OwC5c0yEir/+ebT2S6aWncOFn0nE197AUp7cY4wjN+NauwLOvMNxJgJ pJybbYPzdSQ/awo+uQL0k5Jnv83jN6aFcQgMjsA2A26QBKJu2diuyHLx2JTShy1Bcf9l OEMQ== ARC-Authentication-Results: i=1; mx.google.com; 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 x21-v6si2264798pln.416.2018.02.23.12.26.04; Fri, 23 Feb 2018 12:26:20 -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; 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 S1755279AbeBWUZZ (ORCPT + 99 others); Fri, 23 Feb 2018 15:25:25 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:38764 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754260AbeBWShl (ORCPT ); Fri, 23 Feb 2018 13:37:41 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2AAB4FA9; Fri, 23 Feb 2018 18:37:41 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Brian Norris Subject: [PATCH 4.4 107/193] mtd: cfi: enforce valid geometry configuration Date: Fri, 23 Feb 2018 19:25:40 +0100 Message-Id: <20180223170342.702974596@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170325.997716448@linuxfoundation.org> References: <20180223170325.997716448@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit f5f92b36fbbb8ac7d70ff5fa39ec2637cce3094c upstream. MTD allows compile-time configuration of the possible CFI geometry settings that are allowed by the kernel, but that includes a couple of invalid configurations, where no bank width or no interleave setting is allowed. These are then caught with a compile-time warning: include/linux/mtd/cfi.h:76:2: warning: #warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support can work. include/linux/mtd/map.h:145:2: warning: #warning "No CONFIG_MTD_MAP_BANK_WIDTH_xx selected. No NOR chip support can work" This is a bit annoying for randconfig tests, and can be avoided if we change the Kconfig logic to always select the simplest configuration when no other one is enabled. Signed-off-by: Arnd Bergmann Signed-off-by: Brian Norris Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/chips/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/mtd/chips/Kconfig +++ b/drivers/mtd/chips/Kconfig @@ -67,6 +67,10 @@ endchoice config MTD_CFI_GEOMETRY bool "Specific CFI Flash geometry selection" depends on MTD_CFI_ADV_OPTIONS + select MTD_MAP_BANK_WIDTH_1 if !(MTD_MAP_BANK_WIDTH_2 || \ + MTD_MAP_BANK_WIDTH_4 || MTD_MAP_BANK_WIDTH_8 || \ + MTD_MAP_BANK_WIDTH_16 || MTD_MAP_BANK_WIDTH_32) + select MTD_CFI_I1 if !(MTD_CFI_I2 || MTD_CFI_I4 || MTD_CFI_I8) help This option does not affect the code directly, but will enable some other configuration options which would allow you to reduce