From patchwork Thu Mar 1 15:27:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 130293 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2952780edc; Thu, 1 Mar 2018 07:38:49 -0800 (PST) X-Google-Smtp-Source: AG47ELsBzPZ/8xCNz1anCSRcaH9PM1z0ys62UH3//roHGaWOrN8N1FGI6CZ1SOecJ4rbbXWxogsR X-Received: by 10.99.136.195 with SMTP id l186mr871043pgd.427.1519918729591; Thu, 01 Mar 2018 07:38:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519918729; cv=none; d=google.com; s=arc-20160816; b=CpYIzxKfTMcnuAZwGIT20YiwTqT7lFIXcC58h8H51WICTARJsAV0RSpM7PSwvV6wNW SayqeKN8ToaI9qvCdNP6JiTqGTQ4ryt/0iabNRdwR+Dql0hpPxJ9uu8RtcRRAKVa15bt O/ncHGyzcgk/cOv1SLzejDaYINUnGEyaJtHVHML/Ya1wedj5QkJmg08WyTcHmfeZN70W 4C0Qip4mljxYYWqSFnHgh5OLYjJGFP+MDPnjrR5ci72EHoefguqo+oxbp2jarGPquLT7 LuGIP3r+tudmp+Q2qnmc1nhKWz/Si/R1QHwTOI4piUiK7uGHQPdyggsW6Az3lmEXRTJg r0uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=xIkobooYRxvyaVpDfg1L19A9FTH0hNrgni1uVy/EwnI=; b=zFsPSttPV4C7zlvAjAxhmbY+CsGndfbg8Mq8FrBFidUt95jnT6Nm9HYXTa8xL8XxNR noyuAPKKIJ7ytsxA2bHYX5rV6uIjsHUj2DO4LwGupm1VmaHraqEH2zZPymnogY62ekWg 9cICdHNxSJpQQBPupJHlRaYJ7aFziFy+rpa03bu9GAfvnw6p77wkLSrvbwzIQCRqoz1y hTSkpZKwu03SVqVG9BEyfITBtS8ENPyeO+usKPs7y2Pz2bJYfeutM8r6YbwEpLmdcH0I J/x6nheU+cfApvSmuA4qZ+/QPlaUPcJ81n9+gokhUgO8RNCoS1NSMpCKJcvgo8GHpfox m0yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=jrLf9Txh; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b15si2586092pgs.318.2018.03.01.07.38.49; Thu, 01 Mar 2018 07:38:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=@microsoft.com header.s=selector1 header.b=jrLf9Txh; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032565AbeCAPir (ORCPT + 10 others); Thu, 1 Mar 2018 10:38:47 -0500 Received: from mail-sn1nam02on0127.outbound.protection.outlook.com ([104.47.36.127]:60979 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032566AbeCAPig (ORCPT ); Thu, 1 Mar 2018 10:38:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=xIkobooYRxvyaVpDfg1L19A9FTH0hNrgni1uVy/EwnI=; b=jrLf9Txh5+Qgv75xqHpXZIJpBGG85WZkqyTmHGQXZjjHHlOfK0/jqp9TsuD4Kv7l9ZM+btgk91W4ElPjxN8NQPBnshIiGhXE76ZjQiI/xkEeMTShqX8ONIQH81z55Yq3GjiRdf6D2zVSndLEJCp4g0kFSx15ge7f2Y+gk6djms0= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1016.namprd21.prod.outlook.com (52.132.133.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.2; Thu, 1 Mar 2018 15:38:29 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0567.006; Thu, 1 Mar 2018 15:38:29 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Arnd Bergmann , Brian Norris , Sasha Levin Subject: [added to the 4.1 stable tree] mtd: cfi: enforce valid geometry configuration Thread-Topic: [added to the 4.1 stable tree] mtd: cfi: enforce valid geometry configuration Thread-Index: AQHTsXHOP+RebEvPKE+sgjKDDZNpjg== Date: Thu, 1 Mar 2018 15:27:28 +0000 Message-ID: <20180301152116.1486-465-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1016; 7:y8QFWhtsL2Tb8QIHMZs1QGoq/yZt4MyoJU/Pt1VXU3Zoq0oPo3CH9jTaZQ5kxqFUS3qWqrQOKqoD9wWIr+swFCje7e480MGHwFzdKovzptaMbwnBnGmMEWvkbIGKykEjylSK9oH53RJu106OGowaeSEVejOUkPVHwiCpF5gb4vMn1q6WofsaKJuMHwkdJMHsjg6TK/m04Xg6YOFUiCNMs/LuHvMUewLOP7DS0MJnF/V9NuJDNbNToeOy2vR2aRBM x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: b1d24240-0c46-4f1a-21a7-08d57f8a7b7d x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020); SRVR:DM5PR2101MB1016; x-ms-traffictypediagnostic: DM5PR2101MB1016: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040501)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(3231220)(944501229)(52105095)(6055026)(61426038)(61427038)(6041288)(20161123560045)(20161123558120)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR2101MB1016; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1016; x-forefront-prvs: 05986C03E0 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(366004)(39860400002)(39380400002)(376002)(396003)(189003)(199004)(22452003)(6436002)(8676002)(81156014)(81166006)(53936002)(68736007)(6486002)(6512007)(97736004)(5660300001)(86362001)(59450400001)(6506007)(102836004)(6346003)(39060400002)(2906002)(26005)(186003)(4326008)(10290500003)(8936002)(76176011)(478600001)(105586002)(3280700002)(14454004)(54906003)(110136005)(3660700001)(2950100002)(305945005)(7736002)(6116002)(72206003)(1076002)(3846002)(316002)(2900100001)(25786009)(36756003)(2501003)(66066001)(107886003)(106356001)(5250100002)(86612001)(99286004)(10090500001)(22906009); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1016; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: e2Eda5g6uQBpCXs+Pms+6mNL23TlcTrvf65kIXarb0lmfdQ8xaXHsVg8cbFg4I4y4vdoepcNIgDxVVpDbWuRP0WZjhmdiUIUMjpWLFHA/P9pIKE+qzL6ZRdQ4OPpQhwnVA5+2B7QbrCCwDfNn+bNtH+9BvqiXyr6giNTCj8J+XI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: b1d24240-0c46-4f1a-21a7-08d57f8a7b7d X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2018 15:27:28.3308 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1016 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. -- 2.14.1 =============== [ Upstream commit f5f92b36fbbb8ac7d70ff5fa39ec2637cce3094c ] 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: Sasha Levin --- drivers/mtd/chips/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig index 6bc1f94333a5..e956231de30f 100644 --- a/drivers/mtd/chips/Kconfig +++ b/drivers/mtd/chips/Kconfig @@ -66,6 +66,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