From patchwork Sat Oct 22 07:25:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7845 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1154029wrr; Sat, 22 Oct 2022 04:07:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6cVF4pdbyHK3ffMDb+RLz1s6GYKGDJSUkEQcGzhgJ86LIEXgIHjtda+samNaFdjI+G8ztb X-Received: by 2002:a17:907:2e0d:b0:78e:314:9d88 with SMTP id ig13-20020a1709072e0d00b0078e03149d88mr19784412ejc.54.1666436842838; Sat, 22 Oct 2022 04:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666436842; cv=none; d=google.com; s=arc-20160816; b=R2XiON3Y25Kmhr66pbQ7A6N9JQv8Wbe8Feypc/N20401Nwn13Mtm4MSxSSrLZQTd5H q7oE7mr74LOCs/F1nIExJQUgGHtr3CJS2UtSmcoMe/AECM9iiyHQYzbmw5nu2Gjxqpy7 +ngwT6IMQC12pQRd/FbRYLUYQyDYk8pXSrvCIa/6lt3iP/cYmj4JmePVi7TFGj8CSdlT 6QI7yqLoi6x32M/UD326WOFM/Zbes09vuvHOyaFzih4HiaPG/sFYBDQunuGQ9IyrIzV+ XsHjLHJ8rqfrLK/+M4+FuMqvt5UrI5avIdkPKCQD2JSx1ksQqHPJyMoKVmAyvcUXcpWf 90ig== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cpMcjDTV9x8uURe/ZNs17adrE3pPe29XLOyQVuyJoNE=; b=gOlebzIzwG1QYSq+qQi3PzNHw9ZFUcpa6+PXQdhD5wnaBgz0pVI3R5blwKxXYwy/aK zydTki3SbNcBJSfWmuTyicM3zJedupz4CR8CWnot27le+iLs7q88rGvr3DSYx6e//PzH bYwSPviLkuFppG8j+EC2KbEA3Aeuc8e1lbqeN1Ft81Ed1w2DiT7XiYjOP0wUgKnXLXCJ RyPnr1CSZhBNSMe3Bdiyy9k68QJEISpeBsyAMw8SgSdjBTZ9wjF2kmzcgj3wCRIMhOIY xWh72zdeUfpRT/JYNf9HG42Q2jNrOufYzgwc9aWLWUCrZZ6wCNSvysUlLUyHzyMybKv1 Kj3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JTaNWvZs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m15-20020a056402050f00b00457fc1bcf12si19667078edv.183.2022.10.22.04.06.59; Sat, 22 Oct 2022 04:07:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JTaNWvZs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230526AbiJVLDQ (ORCPT + 99 others); Sat, 22 Oct 2022 07:03:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229707AbiJVLCk (ORCPT ); Sat, 22 Oct 2022 07:02:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3F9D2FA5FA; Sat, 22 Oct 2022 03:21:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 88A69B82E0B; Sat, 22 Oct 2022 07:55:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D19C4C433C1; Sat, 22 Oct 2022 07:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425301; bh=9BePWnK8/VkHjNuHRA8V9IPoLddrvuN0dJOkG015dOo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JTaNWvZsEa3Gjz4Jq5Q0SqKR7JD/X8pS+SLitewNRRR+QSXSGXNlqPmmJLyOKhCLa SmLw7bb2fqxUEHJQZaNlQzZYN1FxINAW/f218Z/YfNk3wrEA1IgmNqe6gBwftD7UYx KvfgVGBDvvzsvV4Z08I34rnlGv5rcRODSbmIw3eY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Blumenstingl , Miquel Raynal , Sasha Levin Subject: [PATCH 5.19 426/717] mtd: rawnand: intel: Read the chip-select line from the correct OF node Date: Sat, 22 Oct 2022 09:25:05 +0200 Message-Id: <20221022072517.275649060@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747385678978165764?= X-GMAIL-MSGID: =?utf-8?q?1747385678978165764?= From: Martin Blumenstingl [ Upstream commit bfc618fcc3f167ad082053e81e9d664e724c6288 ] The chip select has to be read from the flash node which is a child node of the NAND controller. Fixes: 0b1039f016e8a3 ("mtd: rawnand: Add NAND controller support on Intel LGM SoC") Signed-off-by: Martin Blumenstingl Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220702231227.1579176-4-martin.blumenstingl@googlemail.com Signed-off-by: Sasha Levin --- drivers/mtd/nand/raw/intel-nand-controller.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/intel-nand-controller.c b/drivers/mtd/nand/raw/intel-nand-controller.c index e91b879b32bd..3df3f32423f9 100644 --- a/drivers/mtd/nand/raw/intel-nand-controller.c +++ b/drivers/mtd/nand/raw/intel-nand-controller.c @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -580,6 +581,7 @@ static int ebu_nand_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct ebu_nand_controller *ebu_host; + struct device_node *chip_np; struct nand_chip *nand; struct mtd_info *mtd; struct resource *res; @@ -604,7 +606,12 @@ static int ebu_nand_probe(struct platform_device *pdev) if (IS_ERR(ebu_host->hsnand)) return PTR_ERR(ebu_host->hsnand); - ret = device_property_read_u32(dev, "reg", &cs); + chip_np = of_get_next_child(dev->of_node, NULL); + if (!chip_np) + return dev_err_probe(dev, -EINVAL, + "Could not find child node for the NAND chip\n"); + + ret = of_property_read_u32(chip_np, "reg", &cs); if (ret) { dev_err(dev, "failed to get chip select: %d\n", ret); return ret; @@ -660,7 +667,7 @@ static int ebu_nand_probe(struct platform_device *pdev) writel(ebu_host->cs[cs].addr_sel | EBU_ADDR_MASK(5) | EBU_ADDR_SEL_REGEN, ebu_host->ebu + EBU_ADDR_SEL(cs)); - nand_set_flash_node(&ebu_host->chip, dev->of_node); + nand_set_flash_node(&ebu_host->chip, chip_np); mtd = nand_to_mtd(&ebu_host->chip); if (!mtd->name) {