Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2047322ima; Mon, 22 Oct 2018 03:22:22 -0700 (PDT) X-Google-Smtp-Source: ACcGV60t7aAfhATTydYTcQLjVegiMSuVaRIFfWSEaEGcQKRTxDuBfrNzU8OrpMJuV58XoKMZBye9 X-Received: by 2002:a62:3047:: with SMTP id w68-v6mr44980807pfw.19.1540203742474; Mon, 22 Oct 2018 03:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540203742; cv=none; d=google.com; s=arc-20160816; b=aCZx1GcgQ+qdQokg1Bk9VxsmoDKiB9FK8Nz63b/k/AGcpktdgTYhIc7cJe9nXMV1T9 E0mpvbG6uuG8EpfLsLT7ECS4lmG4nUhId+afDzcZ76PBvxkCUrN56hnq2vUhib98pDNC hLtvMvfggJbmARJHm9adAZxW3UUhFXbbypWxDaW3Yy0OnousYpaU6MOEmMc4VmCyM8fH GVoZ6ocUsH9OFqkF0hM+ZFbvsV4XdleNUcPPgdKqpP/pDR1jz5+8lpXP/y+hlzRuuRbl 2ayjuDZRiVuWarsNhvhUe7ZoUc5bWAwGdQY0u3wAlWJDQ6A6O+iM+gke3Z/z56TBrmsB 4/XA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=kFnHO629CJ5tOj01waLD+dfCCUxDHQNTBf1iLyHSMOQ=; b=Cciy4OyykezEmDurnGA8xsIkgMpHUgFoKJZzH7X7o48JvCE/zpkt9lwt011sbmFU/N zRPLbVPbkVgi2xR3ohtvEARA4nEG7XrMIcNynL7zpY9i83wuli/j//yVGAQQC7g8u6Hy t5ilmlJY818tFe1hNKxubMd2oso1fcGjUy0Y5bO1mkFeLHo55Lmn5TTLn7nPlQB58jiS JQiVe56t9eoI1D2Ufk1TDY43vgsVBkIoHK4H+8btRpc1C4j/x8zjER/xE4V/2d20v/fC iGcPLefcP7yWmf/a+4Re0yHkkoS4D2gNK+BnuIm2dCwjdJ2pU+kzrotMjwKvf35xKu91 fwMw== 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 3-v6si36171954pfm.51.2018.10.22.03.22.07; Mon, 22 Oct 2018 03:22:22 -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; 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 S1728591AbeJVSjO (ORCPT + 99 others); Mon, 22 Oct 2018 14:39:14 -0400 Received: from mail.bootlin.com ([62.4.15.54]:45844 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729164AbeJVSi4 (ORCPT ); Mon, 22 Oct 2018 14:38:56 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 0CBC5209DA; Mon, 22 Oct 2018 12:20:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (aaubervilliers-681-1-25-52.w90-88.abo.wanadoo.fr [90.88.145.52]) by mail.bootlin.com (Postfix) with ESMTPSA id 9CC08208C7; Mon, 22 Oct 2018 12:20:48 +0200 (CEST) Date: Mon, 22 Oct 2018 12:20:48 +0200 From: Boris Brezillon To: Yogesh Narayan Gaur Cc: Tudor Ambarus , "richard@nod.at" , Mark Brown , "linux-kernel@vger.kernel.org" , "nicolas.ferre@microchip.com" , "marek.vasut@gmail.com" , "cyrille.pitchen@microchip.com" , "linux-mtd@lists.infradead.org" , "Cristian.Birsan@microchip.com" , Cyrille Pitchen , "computersforpeace@gmail.com" , "dwmw2@infradead.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH v3 1/2] mtd: spi-nor: add support to non-uniform SFDP SPI NOR flash memories Message-ID: <20181022122048.2b3633e0@bbrezillon> In-Reply-To: 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> <20181022111543.2a607efc@bbrezillon> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 22 Oct 2018 10:03:55 +0000 Yogesh Narayan Gaur wrote: > [ 1.624684] m25p80 spi0.0: found s25fl512s, expected m25p80 > [ 1.630377] Start [addr_width:00000000, read_dumy:08, read_opcode:00000000] > [ 1.637335] spi_nor_get_map_in_use:2882 smpt[0]=08ff65fc > [ 1.642641] spi_nor_get_map_in_use:2882 smpt[1]=00000004 > [ 1.647945] spi_nor_get_map_in_use:2882 smpt[2]=04ff65fc > [ 1.653248] spi_nor_get_map_in_use:2882 smpt[3]=00000002 > [ 1.658551] spi_nor_get_map_in_use:2882 smpt[4]=02ff65fd > [ 1.663855] spi_nor_get_map_in_use:2882 smpt[5]=00000004 > [ 1.669158] spi_nor_get_map_in_use:2882 smpt[6]=ff0201fe > [ 1.674461] spi_nor_get_map_in_use:2882 smpt[7]=00007ff1 > [ 1.679766] spi_nor_get_map_in_use:2882 smpt[8]=00037ff4 > [ 1.685070] spi_nor_get_map_in_use:2882 smpt[9]=03fbfff4 > [ 1.690375] spi_nor_get_map_in_use:2882 smpt[10]=ff0203fe > [ 1.695768] spi_nor_get_map_in_use:2882 smpt[11]=03fbfff4 > [ 1.701158] spi_nor_get_map_in_use:2882 smpt[12]=00037ff4 > [ 1.706550] spi_nor_get_map_in_use:2882 smpt[13]=00007ff1 > [ 1.711940] spi_nor_get_map_in_use:2882 smpt[14]=ff0005ff > [ 1.717330] spi_nor_get_map_in_use:2882 smpt[15]=03fffff4 > [ 1.722720] smpt[0]=[addr_width:00000000, read_dumy:08, read_opcode:00000065] Okay, so addr_width is wrong here (I guess read_dummy is wrong too). That's probably because we fall in the SMPT_CMD_ADDRESS_LEN_USE_CURRENT case and nor->addr_width has not yet been initialize when we reach this function. > [ 1.729861] spi_nor_get_map_in_use:2912 map_id=1 > > [...] > + for (i = 0; i + pr_info("%s:%i smpt[%d]=%08x\n", __func__, __LINE__, i, smpt[i]); > + > map_id = 0; > - i = 0; > /* Determine if there are any optional Detection Command Descriptors */ > - while (!(smpt[i] & SMPT_DESC_TYPE_MAP)) { > + for (i = 0; i< smpt_len; i++) { > + if ((smpt[i] & SMPT_DESC_TYPE_MAP)) > + break; > + > read_data_mask = SMPT_CMD_READ_DATA(smpt[i]); > nor->addr_width = spi_nor_smpt_addr_width(nor, smpt[i]); > nor->read_dummy = spi_nor_smpt_read_dummy(nor, smpt[i]); > nor->read_opcode = SMPT_CMD_OPCODE(smpt[i]); > + pr_info("smpt[%d]=[addr_width:%08x, read_dumy:%0x8, read_opcode:%08x]\n", i, nor->addr_width, nor->read_dummy, nor->read_opcode); ^ %08x