Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1994312ima; Mon, 22 Oct 2018 02:15:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV60SbD3hYumOxbT+32OTgi1sE1cuuACCBzJepB3x/B5CXQUIk5LmKnDLd+pMPJQX2G/OXVAw X-Received: by 2002:a63:2447:: with SMTP id k68-v6mr12721410pgk.156.1540199719812; Mon, 22 Oct 2018 02:15:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540199719; cv=none; d=google.com; s=arc-20160816; b=r/JsoGcfDM7yngCKlBWMxF6wpzVPlFYHSZP4co/JqkXmz3EmSuYjOU0U3OD+q++FOi FKD1k1IxOTij1ysUQIWiUmtYiWXXIvTzKozF5AUf/Dy3aepEYL70zMLPpy7R+DnaJGt2 /9K1jBI4d0vVWyn/kzT6gQtVRMAbxlctHjZlqC2snKuSL3/x03Ti95FVBgDt5A42+EqF I/SJ9Q8+1mvFhbdjS8K0KkVNcRezg6EyOkjTfBxTAmExU5NIRq8wU+i/8GnkGXsZpFto rwUGwZHUNmZFg8Ie+zuPzwXNTwuIu5NyVzCLaF//MeIrnX5Ps7Ss+Ne+HZhmMacdz0wV fU8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=T2icGRQdo8Zmdlo4F4FRNd6z2f0V3++wTnDkZkKBJso=; b=pms0Ve3YAIOYFYnLzna+ZluMclGMdkD3GIGRiqeqmBNGaM3w6Rl/Wy+VFNSCVOM3DZ hv+uCYWs051HHb2Z1hlNPPs+qcRxI85T5KDvuIJZ1v58gPzGZziAnCSo8CzvMaJZ1qRO rQmxKEe+Z2vnC1kdR0hxRs0X3IZKZHBRLGtojyMhojg2Bbh6MYanCpumEVUIRW0wwglt DfdfVmdk8oq+SS6nZqPQLlDceisZ13XpBrE3gkLvkFroswPrxpJRWO3UXNea9KHu1vsc NyNidF/2v4YCnCFrot83ACnnau4Ajp8VmgvqYKHThxl5XMSAoMA4wPAUXmrsDgRVMCYx 7bnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@microchiptechnology.onmicrosoft.com header.s=selector1-microchiptechnology-onmicrosoft-com header.b=C9i7Y7dG; 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 10-v6si15970687pgt.130.2018.10.22.02.15.04; Mon, 22 Oct 2018 02:15:19 -0700 (PDT) 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=fail header.i=@microchiptechnology.onmicrosoft.com header.s=selector1-microchiptechnology-onmicrosoft-com header.b=C9i7Y7dG; 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 S1728106AbeJVQva (ORCPT + 99 others); Mon, 22 Oct 2018 12:51:30 -0400 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:55373 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727218AbeJVQv3 (ORCPT ); Mon, 22 Oct 2018 12:51:29 -0400 X-IronPort-AV: E=Sophos;i="5.54,411,1534834800"; d="scan'208";a="22050520" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Oct 2018 01:33:56 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.38) with Microsoft SMTP Server (TLS) id 14.3.352.0; Mon, 22 Oct 2018 01:33:55 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T2icGRQdo8Zmdlo4F4FRNd6z2f0V3++wTnDkZkKBJso=; b=C9i7Y7dGc/qb/Zigl7lnE61RFgHaITIHhHQ7exPo4ntVwcwAJj5E9otdgpblLhNcTnm/EaK/gbI1xbiNsqKWs4g1BtHbCc0NEyp/M7S/YzW35FmMEmZkR4X7ikzD+ojnMvzvQGAmH6jhq7AbP1nzM85ZinRVhjC6/VTvnWNFYgc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Tudor.Ambarus@microchip.com; Received: from localhost.localdomain (185.7.230.214) by BN6PR11MB1841.namprd11.prod.outlook.com (2603:10b6:404:103::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.20; Mon, 22 Oct 2018 08:33:50 +0000 Subject: Re: [PATCH v3 1/2] mtd: spi-nor: add support to non-uniform SFDP SPI NOR flash memories To: Yogesh Narayan Gaur , Boris Brezillon CC: Cyrille Pitchen , "marek.vasut@gmail.com" , "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "richard@nod.at" , "linux-kernel@vger.kernel.org" , "nicolas.ferre@microchip.com" , "cyrille.pitchen@microchip.com" , "linux-mtd@lists.infradead.org" , "linux-arm-kernel@lists.infradead.org" , "Cristian.Birsan@microchip.com" , Mark Brown References: <20180911154007.17195-1-tudor.ambarus@microchip.com> <20180911154007.17195-2-tudor.ambarus@microchip.com> <31a8f6a9-1459-443a-6ef8-2b2c17769ae4@microchip.com> <20181017090724.12f2cd79@bbrezillon> <20181017091045.124e0266@bbrezillon> <20181017092941.3658bd9a@bbrezillon> <20181017115237.07310b74@bbrezillon> From: Tudor Ambarus Message-ID: Date: Mon, 22 Oct 2018 11:33:40 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [185.7.230.214] X-ClientProxiedBy: CWLP265CA0265.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:5c::13) To BN6PR11MB1841.namprd11.prod.outlook.com (2603:10b6:404:103::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5741f677-8df8-42cd-ee67-08d637f91901 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BN6PR11MB1841; X-Microsoft-Exchange-Diagnostics: 1;BN6PR11MB1841;3:LNXGb4pNNtGsLqYk4YL3Hwo7uOSsEnaA1axLm1Y9NL1GOjVn7E6vT579bwqXATouEJW7O/AVvMFCpZXbEe4oFlzoG3b5KLKOhASlli0nD0lTclO9dOfq6QbeTTSqAmfNNkQAKXUV0pUtFuCouxZlmyS8yaMu0qupJs3JAPKzpM87lgXDuuD3I02kmqOy00XfFeQLEIgiMRATJRNKmnHQTLLzJSCNZ/Rk1AqUXA6QmMufm9JJUcLy3HGeLehHOudo;25:k1FluSt+pfw9xSEMgNnqsznxKMwBEl2q14nPQI47CfgemlifrdsXDAAJLonChPwXnO3rkitR/nqxtY23gGbd5men8h3t3AeYmpYWlJn2M7Sgbbd/n9cceEYQks0B4rUUwc3k8IWKvuZ/IXuJiZ9PphfWKod1kmW86qRpkNW0zX3Js7bxBFIZtr19TILNDui7kNQqUOYL8GmxKSWJL2cpzAsUC/heuUNTUElfuTQdFFwXeHRGmYKV5jqf4RKl8I4PpfOXKZX1hOLGWMfV90acikIFhiVNC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a+g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231355)(944501410)(52105095)(3002001)(93006095)(93001095)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095);SRVR:BN6PR11MB1841;BCL:0;PCL:0;RULEID:;SRVR:BN6PR11MB1841; X-Forefront-PRVS: 08331F819E X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(366004)(396003)(136003)(346002)(39860400002)(376002)(189003)(199004)(386003)(6506007)(6246003)(26005)(93886005)(2616005)(446003)(58126008)(316002)(47776003)(186003)(54906003)(110136005)(23676004)(2486003)(52146003)(65806001)(66066001)(65956001)(6116002)(3846002)(52116002)(36756003)(106356001)(105586002)(7416002)(65826007)(97736004)(25786009)(6666004)(305945005)(7736002)(478600001)(2906002)(5660300001)(6486002)(76176011)(53936002)(6512007)(50466002)(230700001)(68736007)(229853002)(4326008)(39060400002)(31686004)(64126003)(81156014)(8676002)(81166006)(8936002)(44832011)(72206003)(86362001)(956004)(217873002)(476003)(11346002)(31696002)(486006)(16526019);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR11MB1841;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjExTUIxODQxOzIzOkIyUUJvYlJyTFdTeEQvNm1aRkpaSTB2OWM1?= =?utf-8?B?bmFzWmlMVXdiQS9Ib0Qrc09CRUlBMGRudkU5YWc1cXFCSWlYTEpSRjV5bnRO?= =?utf-8?B?NmplZW5pem9hTkh1cnpieVlzVkRwVkkxSWF6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==;5:CCYA7XH2YaovRpdNj607xJH8zbWVeEAfv9I4jwPa5dAG66an1ZwrTdiWxBybM8ixy35NmhUUS9XZWt3knXzq6LaKR0Phc7GOHgYDdk5qsoE2Sby9Aq3+PdnTFywcUX5DGFYM8+YDk6iWKMV3Or4qnA5wivZeLPvZRJ/qeblB1So=;7:qZiovOxvx9ib06YTVv6DeERv6oL22pUUairOahFEkI6p5ehpA5hA88adZ3FaBZ8oBBur5v/Gl6WxEfWJNxMTKp6nrgw2rsNGa5mTwWh5YoD8biova+T/b4cVp1AWKXQHo2udIAwBcCtIC77PgKnxuHOb/xIyX/m/XANpHd2RRa/KCgBga+28T7mZ/BY8HYhTldLqnNY5gC2DU4GZ6VdTpS1VUeQT6Rov62vfVfjG0ykBG+wLElLceHGM4nKsGKVH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2018 08:33:50.5914 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5741f677-8df8-42cd-ee67-08d637f91901 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1841 X-OriginatorOrg: microchip.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Please amend this as well. Thanks! --- drivers/mtd/spi-nor/spi-nor.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 3a9b69e9ba6d..3019708696cd 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -2887,10 +2887,15 @@ static u8 spi_nor_smpt_read_dummy(const struct spi_nor *nor, const u32 settings) static const u32 *spi_nor_get_map_in_use(struct spi_nor *nor, const u32 *smpt) { const u32 *ret = NULL; + u8 *dma_safe; u32 i, addr; int err; u8 addr_width, read_opcode, read_dummy; - u8 read_data_mask, data_byte, map_id; + u8 read_data_mask, map_id; + + dma_safe = kmalloc(sizeof(*dma_safe), GFP_KERNEL | GFP_DMA); + if (!dma_safe) + return ERR_PTR(-ENOMEM); addr_width = nor->addr_width; read_dummy = nor->read_dummy; @@ -2906,7 +2911,7 @@ static const u32 *spi_nor_get_map_in_use(struct spi_nor *nor, const u32 *smpt) nor->read_opcode = SMPT_CMD_OPCODE(smpt[i]); addr = smpt[i + 1]; - err = spi_nor_read_raw(nor, addr, 1, &data_byte); + err = spi_nor_read_raw(nor, addr, 1, dma_safe); if (err) goto out; @@ -2914,7 +2919,7 @@ static const u32 *spi_nor_get_map_in_use(struct spi_nor *nor, const u32 *smpt) * Build an index value that is used to select the Sector Map * Configuration that is currently in use. */ - map_id = map_id << 1 | !!(data_byte & read_data_mask); + map_id = map_id << 1 | !!(*dma_safe & read_data_mask); i = i + 2; } @@ -2929,6 +2934,7 @@ static const u32 *spi_nor_get_map_in_use(struct spi_nor *nor, const u32 *smpt) ret = smpt + i; /* fall through */ out: + kfree(dma_safe); nor->addr_width = addr_width; nor->read_dummy = read_dummy; nor->read_opcode = read_opcode; -- 2.9.4