Message ID | fa5d8b944a5cca488ac54ba37c95e775ac2deb34.1601612872.git.Takahiro.Kuwano@infineon.com |
---|---|
State | Accepted |
Delegated to: | Ambarus Tudor |
Headers | show
Return-Path: <linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=RJGEoMPU; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=tB903S9d; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C2dbq0LqSz9sSG for <incoming@patchwork.ozlabs.org>; Fri, 2 Oct 2020 15:20:07 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IS72uJgcCwKWJY8fO9Q5lBzBBEBWuc30JuX4mzChcr4=; b=RJGEoMPUISK72sTEhvHF6Nf24 vAxmtDlXOIVNEBAt8qDa40ca5pTVymbJiioDS5jyq11LSwbp81OVCrSdTzum5SfefwaDzj9lXoHSF PZ97Y7kWd90GjzSNKamySxmUdpz05IjXMI3sfZ8g6APCmQqY0sU65Ke2BsvjTi9qg9JPAVdjSWmsj TLRR7t5/lhn+Zz37qC4VqjKHM6tn4G2iErDf1OhWOUQj0Cf+ICxnhHfjYb71Im5+c6FYPiVeqgOZT Eag7h6jl07kS+MHgoLjkFJcvwivI1dJwNSy3D0J25kpz5q3b+uJUvBpfyJ0IDdfbpMp9etIeje9i5 4KQl7NmwA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kODTI-0004uL-MQ; Fri, 02 Oct 2020 05:19:08 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kODTD-0004su-4q for linux-mtd@lists.infradead.org; Fri, 02 Oct 2020 05:19:04 +0000 Received: by mail-pg1-x542.google.com with SMTP id q18so88551pgk.7 for <linux-mtd@lists.infradead.org>; Thu, 01 Oct 2020 22:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4E3IS7TggbFV7hmwrBoh7Uq8+hUtMQHnOwBge5NYzyI=; b=tB903S9dfsbluBdP8Xip8/YqYUZdbh0qPkcVIZ/YSfJksNIEq3qVLgrTV+v/Y1YkDc Xzq01zemu2h6WSxGrPLo1UJTmt5s79PDH08jPMo6VFNs5h/mTwjtkuf0Sp2BEUGND12p 61FALDlC9HdU41SwnpLmSqAQsaM3VWoKOqwNSKhQycHe9h35iFZJKBZCMx26xLhdtzqd V8SX2KHj7CjFIdiOO0UnzeoW3GqU9UmGT4bW3597iU2y4QWpPAU67Su3IUebSbzIPQDA /H49JjNBBnslb2OMaJBjYvZl14ixp3oabaZc49uYefkqGIuEavuPL8oh820QR6wE4AsF b2bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4E3IS7TggbFV7hmwrBoh7Uq8+hUtMQHnOwBge5NYzyI=; b=XFYsIBsKVZYTcikSmguGsQub0rMlyQ2R+7TLaQfmJgYO5PveekpTZ7OhtkTX5hpeAC ErphDxRYguScVNmBZDF4xP8vo+nuTGtyBJRlTXe2cUXfoxzKWiIui1NSYZD2l35oiW68 8oFkF4RcxDgQasVWshcG+9G25KSNcqGsLoy9hBmeuFQWuAPiMv/cD31bsi1tHHemszYh 1aqDAjh5k8kF0BdBuoHAaKuKO9QEXZe+Y50SCb4fE747nSRhJQUkIsa39E9w7dMZ2gIy YA0p9PqLlTLVkkvmd8HHH/WrfYOKNM5cW0sMVQgnVDUhp6rttzdaocEmuXosBMClNtHX IOLA== X-Gm-Message-State: AOAM533u2InEuQbg4lmM3EtknFNNf4EL8XxYUfii/lY5K6MbBbMVvPYt Zhmg4YmL2gvO0up3CahZ2f4aqk72hBP+yA== X-Google-Smtp-Source: ABdhPJzdQBX8CnE5VO7GhrZCTacAtEpUi6VgO+qwwKpuA9ydCIT/8t8zGlfPTJfQVdQLdCRAQlgP+w== X-Received: by 2002:a62:52ce:0:b029:13e:50c8:499b with SMTP id g197-20020a6252ce0000b029013e50c8499bmr805421pfb.14.1601615940852; Thu, 01 Oct 2020 22:19:00 -0700 (PDT) Received: from ISCNPF1JZGWX.infineon.com (zz20174137476F6254EB.userreverse.dion.ne.jp. [111.98.84.235]) by smtp.gmail.com with ESMTPSA id s66sm380773pfc.159.2020.10.01.22.18.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 22:19:00 -0700 (PDT) From: tkuw584924@gmail.com X-Google-Original-From: Takahiro.Kuwano@infineon.com To: linux-mtd@lists.infradead.org Subject: [PATCH 3/4] mtd: spi-nor: core: Fix erase type discovery for overlaid region Date: Fri, 2 Oct 2020 14:18:01 +0900 Message-Id: <fa5d8b944a5cca488ac54ba37c95e775ac2deb34.1601612872.git.Takahiro.Kuwano@infineon.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <cover.1601612872.git.Takahiro.Kuwano@infineon.com> References: <cover.1601612872.git.Takahiro.Kuwano@infineon.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201002_011903_213414_0E5E8D3D X-CRM114-Status: GOOD ( 12.88 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:542 listed in] [list.dnswl.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [tkuw584924[at]gmail.com] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [tkuw584924[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list <linux-mtd.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-mtd/> List-Post: <mailto:linux-mtd@lists.infradead.org> List-Help: <mailto:linux-mtd-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mtd>, <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe> Cc: vigneshr@ti.com, tudor.ambarus@microchip.com, richard@nod.at, Bacem.Daassi@infineon.com, tkuw584924@gmail.com, miquel.raynal@bootlin.com, Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" <linux-mtd-bounces@lists.infradead.org> Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
Series |
mtd: spi-nor: Fix non-uniform erase map issues
|
expand
|
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 0369d98b2d12..c7d5c86905fa 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -1212,14 +1212,15 @@ spi_nor_find_best_erase_type(const struct spi_nor_erase_map *map, erase = &map->erase_type[i]; + /* Alignment is not mandatory for overlaid regions */ + if (region->offset & SNOR_OVERLAID_REGION && + region->size <= len) + return erase; + /* Don't erase more than what the user has asked for. */ if (erase->size > len) continue; - /* Alignment is not mandatory for overlaid regions */ - if (region->offset & SNOR_OVERLAID_REGION) - return erase; - spi_nor_div_by_erase_size(erase, addr, &rem); if (rem) continue;