Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1208702imu; Wed, 28 Nov 2018 06:18:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/V+QAyvVWgKTCaO0VD4Wnig06s/t6301ALFx+B6ldvIltUFKik7c2FB+ivV2ZXIzAXgfKI6 X-Received: by 2002:a17:902:b48b:: with SMTP id y11mr15943257plr.200.1543414684392; Wed, 28 Nov 2018 06:18:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543414684; cv=none; d=google.com; s=arc-20160816; b=ijYwmo7k7IfRbEk/wU1zEZBSFpibLB49UWmv4JX1cvOCedFMcMh7/0tX8hOSHqj0OI rgZgR3s2vKZDHCPahmuy5r9sg0094JyJj3+DFNMq8L8CSofAM8UABcqW8f1iEKA1Da/y 4hSuOdIg764VXmMNOzQjsB4gD3NJVrGet9pN3Ym50uC8OUEybQBrTjhdLmKvJmFCxJ+1 GhzafgV9XSBstIbJLy/uTmEQnAdD6dQVzw4rzKyPVM0qCcEjHoT6B6kU8kT+8o3o4wdS MFMPd7/cVN7TzIgPOU+DO+Jfyz+IZ3LOhV/42U3tN2LTfFULdUw5hUX/+oLdYkdmTH8L PT7Q== 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=inYqfR/zykxLuAKY7OphYKj6brzfL3pJLlvSrDBLWVc=; b=kf6GPDUODcrDhWOyZKgZV726X3DJayQF88xKC33DZBJ/ZTdx9TK+fn5YAQ/C7vfMO0 iK0WGCgk6EtqcKLsSsDD0zdoFdP7tPYu9Wxlw0mwE1AEqxdkYtgndLnV11B27yjvIpE9 I/rHfzKxtodNe9v8LqRy/94M3st3cHBehrOlxA9LgC0gCzNvanFEuKFAkPAZOUWw3Y3V HFNiEQtgGHfjOATkGxMPOFjzv/2/vGORvwLXBGIIdp7ZbJdKq8zQS90S9h3v/6zfqcjI LSFv0etUofezkeusFNdG3+Afdw3DDE0N+TRYedbiUITtOA6xCqfFm4zZF/t5Ofc3cdrs 46qw== 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 w15si8090377plk.357.2018.11.28.06.17.48; Wed, 28 Nov 2018 06:18:04 -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 S1728240AbeK2BSx (ORCPT + 99 others); Wed, 28 Nov 2018 20:18:53 -0500 Received: from mail.bootlin.com ([62.4.15.54]:33325 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727789AbeK2BSx (ORCPT ); Wed, 28 Nov 2018 20:18:53 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 6972120729; Wed, 28 Nov 2018 15:17:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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.2 Received: from bbrezillon (aaubervilliers-681-1-94-205.w90-88.abo.wanadoo.fr [90.88.35.205]) by mail.bootlin.com (Postfix) with ESMTPSA id 197D02039F; Wed, 28 Nov 2018 15:17:03 +0100 (CET) Date: Wed, 28 Nov 2018 15:17:02 +0100 From: Boris Brezillon To: "Sverdlin, Alexander (Nokia - DE/Ulm)" Cc: "Tudor.Ambarus@microchip.com" , "marek.vasut@gmail.com" , "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "richard@nod.at" , "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] mtd: spi-nor: fix erase_type array to indicate current map conf Message-ID: <20181128151702.5f8b1bf2@bbrezillon> In-Reply-To: <2ae2459e-f5e7-f621-fd63-0982a1e59e86@nokia.com> References: <20181126124531.17548-1-tudor.ambarus@microchip.com> <2ae2459e-f5e7-f621-fd63-0982a1e59e86@nokia.com> 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 Hi Alexander, On Mon, 26 Nov 2018 13:04:45 +0000 "Sverdlin, Alexander (Nokia - DE/Ulm)" wrote: > Hello Tudor and all, > > On 26/11/2018 13:45, Tudor.Ambarus@microchip.com wrote: > > From: Tudor Ambarus > > > > BFPT advertises all the erase types supported by all the possible > > map configurations. Mask out the erase types that are not supported > > by the current map configuration. > > > > Backward compatibility test done on sst26vf064b. > > > > Fixes: b038e8e3be72 ("mtd: spi-nor: parse SFDP Sector Map Parameter Table") > > Reported-by: Alexander Sverdlin > > I've verified the erasesize, partitioning and erase function of the S25FS128S > and all the above is at least back to pre-SFDP state. > > So the patch works as intended and it's > Tested-by: Alexander Sverdlin > > There is still a regression with write when S25FS128S is used with SFDP > because SFDP of the S25FS128S is just broken. It advertises 512 bytes > of write page size but factory delivery configuration wraps the address > on 256 bytes boundary. I found no way to fetch this configuration in a > vendor-neutral way (or JEDEC-conform way). Which means, S25FS128S > could be the first user of SPI_NOR_SKIP_SFDP flag :\. You might be interested in my work around SPI NOR fixups[1]. I added a few fixup hooks that can be implemented by manufacturer drivers (a new concept) or on a per-chip basis. Looks like you'd need to implement a ->post_bfpt() fixup hook for this particular chip (see what's been done for this Macronix chip [2]). Regards, Boris [1]https://github.com/bbrezillon/linux-0day/commits/spi-nor/manuf-drv [2]https://github.com/bbrezillon/linux-0day/commit/b29625fdc55fa8ccfd4299904d727b44f8382c18