Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1508818pxf; Fri, 12 Mar 2021 11:10:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEiv4XFC0gIZ9ID9ovpWRcSw2YN314FQ56d4kh4enSyhagPkhFtKWJu7x3SDrSEFLUWXuu X-Received: by 2002:a17:906:874f:: with SMTP id hj15mr10104257ejb.404.1615576210773; Fri, 12 Mar 2021 11:10:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615576210; cv=none; d=google.com; s=arc-20160816; b=ydrdR7m5+k3ygmtKE83xaH06tatflMBVHsPhhOkvyYNVy3L1LdIpiYIDZdMkI7igMu 1FKYD2Zb01TbcHiulk9tjDQGWuU4mEtNB0pP4oTkDxCAwm9tO2vNzn1CqEu1+VZH/ey7 uJnzpT/GT4JwqCW5DXU2VKptFDuc9s260HycXqK5s5CfFOM2E3D2U7C/aO0q9rLNgKVa /+oC8O4hT93gS4ddLZxNMleOrf8hfZ5BffBA5tXKaxF6GfaAy9mnim98f0LOF3CuJGAI Djh2VOoprdDPBKvK5bDgBRUBBG3cckI/cVuEmaJmlsc+uHI+/P/7cdTj6OMbVeJEMKn5 iLwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bcjeaOvsIJqEoG91kpU1zOMrmJbEeoZZ6ee1XBJrTMY=; b=uEbMtFJgVFhrrPLqeyKXgFIGi3NeBXqW7hg0gIqNNxURuXSnqbtFWieSz2Bm0K1QCP zwEnUACcEh1z0wpJiSJWSKE1SNUTwzC34t28gbwH+wh2WeHeZNMBhM4mox8ivGezBhTK /+AgUdrnLbEsFseTGUGzOH0p4i2Op+EMM0ZLJmcFANXTh39Qj6cPvuX5uRADO2Jh3Fiu OJakmffL9rxtWsQV3mNi819oOi65Tp3/IKA0CfndxfGh7y9nNhndtTfOm3IeMtoLHT8j 2h9f4PL/HfcTzHOHcLOawTEBAUMb8RYJK0+qwz/YUTTKkLCAp5BI7A/1050HaHVFwJmP cNzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b="JD23R/rp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a29si5186459edb.437.2021.03.12.11.09.48; Fri, 12 Mar 2021 11:10:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b="JD23R/rp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234148AbhCLTGj (ORCPT + 99 others); Fri, 12 Mar 2021 14:06:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234105AbhCLTGG (ORCPT ); Fri, 12 Mar 2021 14:06:06 -0500 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACDE4C061574 for ; Fri, 12 Mar 2021 11:06:06 -0800 (PST) Received: from mwalle01.fritz.box (unknown [IPv6:2a02:810c:c200:2e91:fa59:71ff:fe9b:b851]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id C0EFD2224E; Fri, 12 Mar 2021 20:06:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1615575964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bcjeaOvsIJqEoG91kpU1zOMrmJbEeoZZ6ee1XBJrTMY=; b=JD23R/rpOboZgZkxgVqCjnNqj1tGEG3NOZuTVEW+KhmN3KHYc6/ugNrOh7sB2GNwzp0+p1 hQh2Bokb1YOYZTS9FgRcW1oiZu3UxOXAdWnrkaTTUjPM0xmFdgnkXGuJkKZGGeAwyClrkN IMSOxA44zW5FjcGJa4QY4B5PqFmVn38= From: Michael Walle To: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org Cc: Tudor Ambarus , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Michael Walle Subject: [RFC PATCH 2/3] mtd: spi-nor: sfdp: fix spi_nor_read_sfdp() Date: Fri, 12 Mar 2021 20:05:47 +0100 Message-Id: <20210312190548.6954-3-michael@walle.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210312190548.6954-1-michael@walle.cc> References: <20210312190548.6954-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If spi_nor_read_sfdp() is used after probe, we have to set read_proto and the read dirmap. Signed-off-by: Michael Walle --- drivers/mtd/spi-nor/sfdp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mtd/spi-nor/sfdp.c b/drivers/mtd/spi-nor/sfdp.c index b1814afefc33..47634ec9b899 100644 --- a/drivers/mtd/spi-nor/sfdp.c +++ b/drivers/mtd/spi-nor/sfdp.c @@ -179,19 +179,27 @@ static int spi_nor_read_sfdp(struct spi_nor *nor, u32 addr, size_t len, void *buf) { u8 addr_width, read_opcode, read_dummy; + struct spi_mem_dirmap_desc *rdesc; + enum spi_nor_protocol read_proto; int ret; read_opcode = nor->read_opcode; + read_proto = nor->read_proto; + rdesc = nor->dirmap.rdesc; addr_width = nor->addr_width; read_dummy = nor->read_dummy; nor->read_opcode = SPINOR_OP_RDSFDP; + nor->read_proto = SNOR_PROTO_1_1_1; + nor->dirmap.rdesc = NULL; nor->addr_width = 3; nor->read_dummy = 8; ret = spi_nor_read_raw(nor, addr, len, buf); nor->read_opcode = read_opcode; + nor->read_proto = read_proto; + nor->dirmap.rdesc = rdesc; nor->addr_width = addr_width; nor->read_dummy = read_dummy; -- 2.20.1