Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2132858iof; Tue, 7 Jun 2022 20:50:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+NuLnBZRmfmUBzx+3JqG9fRHRMPJOKyb3F+KwpAED4QSD33DQPyTfDIROAh3XkfN9G4DQ X-Received: by 2002:a63:3183:0:b0:3fd:6797:70a8 with SMTP id x125-20020a633183000000b003fd679770a8mr16954172pgx.206.1654660249153; Tue, 07 Jun 2022 20:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654660249; cv=none; d=google.com; s=arc-20160816; b=WJUbCfucpjrAYx3agyJh39caGeBM0zDHlUaKyYaP3BKElWQHgkAOkSO1DTq6bFUsVt lyWsHM/z1OPZAdqNe371PF6ySJTdDB9d6/bUWahTAnjSocnj8vjp0zlZRn/zyOcpxbUz P13a0aFLiFu49Og6c7Zch6TDfOHC/7RYtWE3TSEbWLMMTyx8O4TmwMkp077S39t61x56 k3hx+7fh4LVg0qeFUQdVYKhCW+esmneTblXcWx2BVvppAYulzNnGKJtpcCPzc9ERd7/g iTpahnQ8Il52DKbC4Um9F2gHH47/d3LEtUiltifpFW0/wLoZqDSMa0/C/UuHSt6XsP9r qHMA== 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=Y2lWu+JEIXSedZdMAfeUcjU5ZKkUDtLr7m9bp4XlxIM=; b=Zo1nxCoht7+YEtgh8PqPjgyCnzax2CIquElt14s6oQfSq6stVY4R4BsCaPtV6mSnid eMF8/4DFAmvIrHLQ1LfGu8EGR/+gJM8XMjF05hMec+nw9Qd67xvClV1HK076U1wPw/RV x6RaWUhRFn6flc+uOMy/u/HHXNtszpsoeWEl2yr53zAHJ+TIUE5P+iCvHMENclLmNc9K TyZ0S6uA8tbetze1g7Mxg1Wi9hBgNkfhGG/lAC3Zh7XIKZo8H0RhFA+vypXTGKSeOzke gZAa9heS5RQAltcO4tMFvUXh3FV3RalJPzYzqPRmj/xJXvo8oHHzABLHJ1XOzLXSt5lq Pydw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ter55Oun; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x6-20020a170902ec8600b0015827ec0073si20390399plg.452.2022.06.07.20.50.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 20:50:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ter55Oun; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8D9522149DE; Tue, 7 Jun 2022 20:38:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384614AbiFGWgJ (ORCPT + 99 others); Tue, 7 Jun 2022 18:36:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377899AbiFGVXy (ORCPT ); Tue, 7 Jun 2022 17:23:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEB3F227360; Tue, 7 Jun 2022 12:00:46 -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 5DD04B8239E; Tue, 7 Jun 2022 19:00:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B41A1C385A5; Tue, 7 Jun 2022 19:00:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628429; bh=seCFZk7YL+TVjD/DOD0zsxuIbf6/QXBn7zKIHdKSTeo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ter55OunemYImBJbumkJt8sAzjR6vlDg7LxAy5DpO6pCXuGr1W1qlJQ+3EpZ4A/jL 01DvWnwQrDsycwegHahq+vVy+sP5Agfn0iRAdRDAifVfvsX8cfCLM87mveCDRbMzqm 0wGHEtW4EatDZby/wFkSHLGmeodXlq6kZGv0Xyfw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zheyu Ma , Miquel Raynal , Sasha Levin Subject: [PATCH 5.18 324/879] mtd: rawnand: denali: Use managed device resources Date: Tue, 7 Jun 2022 18:57:22 +0200 Message-Id: <20220607165012.258107593@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Zheyu Ma [ Upstream commit 3a745b51cddafade99aaea1b93aad31e9614e230 ] All of the resources used by this driver has managed interfaces, so use them. Otherwise we will get the following splat: [ 4.472703] denali-nand-pci 0000:00:05.0: timeout while waiting for irq 0x1000 [ 4.474071] denali-nand-pci: probe of 0000:00:05.0 failed with error -5 [ 4.473538] nand: No NAND device found [ 4.474068] BUG: unable to handle page fault for address: ffffc90005000410 [ 4.475169] #PF: supervisor write access in kernel mode [ 4.475579] #PF: error_code(0x0002) - not-present page [ 4.478362] RIP: 0010:iowrite32+0x9/0x50 [ 4.486068] Call Trace: [ 4.486269] [ 4.486443] denali_isr+0x15b/0x300 [denali] [ 4.486788] ? denali_direct_write+0x50/0x50 [denali] [ 4.487189] __handle_irq_event_percpu+0x161/0x3b0 [ 4.487571] handle_irq_event+0x7d/0x1b0 [ 4.487884] handle_fasteoi_irq+0x2b0/0x770 [ 4.488219] __common_interrupt+0xc8/0x1b0 [ 4.488549] common_interrupt+0x9a/0xc0 Fixes: 93db446a424c ("mtd: nand: move raw NAND related code to the raw/ subdir") Signed-off-by: Zheyu Ma Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220411125808.958276-1-zheyuma97@gmail.com Signed-off-by: Sasha Levin --- drivers/mtd/nand/raw/denali_pci.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/mtd/nand/raw/denali_pci.c b/drivers/mtd/nand/raw/denali_pci.c index 20c085a30adc..de7e722d3826 100644 --- a/drivers/mtd/nand/raw/denali_pci.c +++ b/drivers/mtd/nand/raw/denali_pci.c @@ -74,22 +74,21 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) return ret; } - denali->reg = ioremap(csr_base, csr_len); + denali->reg = devm_ioremap(denali->dev, csr_base, csr_len); if (!denali->reg) { dev_err(&dev->dev, "Spectra: Unable to remap memory region\n"); return -ENOMEM; } - denali->host = ioremap(mem_base, mem_len); + denali->host = devm_ioremap(denali->dev, mem_base, mem_len); if (!denali->host) { dev_err(&dev->dev, "Spectra: ioremap failed!"); - ret = -ENOMEM; - goto out_unmap_reg; + return -ENOMEM; } ret = denali_init(denali); if (ret) - goto out_unmap_host; + return ret; nsels = denali->nbanks; @@ -117,10 +116,6 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) out_remove_denali: denali_remove(denali); -out_unmap_host: - iounmap(denali->host); -out_unmap_reg: - iounmap(denali->reg); return ret; } @@ -129,8 +124,6 @@ static void denali_pci_remove(struct pci_dev *dev) struct denali_controller *denali = pci_get_drvdata(dev); denali_remove(denali); - iounmap(denali->reg); - iounmap(denali->host); } static struct pci_driver denali_pci_driver = { -- 2.35.1