From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AAB1C433DB for ; Fri, 12 Mar 2021 19:06:58 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0531364F80 for ; Fri, 12 Mar 2021 19:06:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0531364F80 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=znMqrZmE6lmbONbktIWZpPAGhm+l+9Rpm9ssaXXSFII=; b=C/bWxu+5tBtoUmK2nLRFsEbdZ TmPlxd357pEIIv6ZYhlrwEIdLXzm3rtZjQJrGK5e7m5JYUNZy0TuhnTAui5QtbUldqIrPCk/CZZoT YyiuK5uEa0/nXVNP7PuLonl2oh18Dh9cX3l2PleMa+DKROGBosz5a26K7PcJgIR6VRKhAV/udzDFQ Hrz1/uwFiIny+G9gfKdQ2UYbmmZeaamW/ltb5VPJjZoFmH9+l9h4HSj6N/eizzGd8aBOnV6T6bCP2 xYjffU2zS8B0cjfkaaIh1r6L38Pxmo5AwskKWoIqf4H0pYwokeCfFIxLdnKoTz+CPHJV4Kan0l0Bv mRmL0sBTQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKn7F-00CFRl-Kb; Fri, 12 Mar 2021 19:06:29 +0000 Received: from ssl.serverraum.org ([2a01:4f8:151:8464::1:2]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKn6r-00CFOH-Ef for linux-mtd@lists.infradead.org; Fri, 12 Mar 2021 19:06:08 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210312_190605_580273_5D5D7860 X-CRM114-Status: UNSURE ( 9.10 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.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 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/