Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2145873iof; Tue, 7 Jun 2022 21:16:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxbcPstmiy+xQ9DnJqxC9n+ukQ7f5YxAgpZ2gz2AsuBha1NFiuhWmZZBwQVrI5bLy35hTq X-Received: by 2002:a63:e114:0:b0:3fd:97a1:7a5 with SMTP id z20-20020a63e114000000b003fd97a107a5mr14468421pgh.178.1654661809849; Tue, 07 Jun 2022 21:16:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654661809; cv=none; d=google.com; s=arc-20160816; b=vYFpok+/cq+y+rybpaSwWsHqYk3Wcqv0xYkiO3jvuKe/xdLfmvuJNzTzK+oNaJyojE IBTQtbu6XHIHjbNIYRkncwN+kOtiWvfLXACDYR8C7yo/accqU2nRXC+SVnZro7Gu6q85 hFMKCfLiVtsu2WX9Os1scZhxL66l8YxM760O7xV6bqozL8g2hxdjcyvgEAebP9382/dr NuJTGUpOS80MEgPxokUr7LAvzITs7e+FkJ1VxrWxs8iqm9hNle2VxmFkdOrZlL0uJ9Kf YGVUd0qhx1t1b6gON0hlU9Bdq1Mfb1IZLfi60vNmnSMSIFSX62YXKbygsxCf0PbAad2f ft3w== 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=00hc8gSRMpwQ6Yh+EiND25e3w3+8HUKky0+UTzSi/qjTJ0RGixfc3OPsHapBlYHAgV nZQrDk5y4lDqK7GB5Chjja+J3uRhnA+q3lU6siQM4vqf8A7jR48+ChwrICFRpP9PdvV2 0gjkRgsN/Q+0yVRDPuSERV5kBFAPon7d4J9b/aK22Q30Rm3cdJI91zoQjiK0qMHZQGDW n6cDTtHrnFZyPK6qUyfEevLZ2JTHYsWfyLKnZHrenE4+oTF0QmYNaDTtiyyHIO/I11J0 sewxXLMmfiQPBxRaGyCH/l9MHGKqTwTldV2JCQSx8Ho50rqEu0Ar47gcustQt1L3K0s/ y3Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BPeK23Id; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id p123-20020a622981000000b0050a952467b5si23400354pfp.338.2022.06.07.21.16.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:16:49 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BPeK23Id; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 D6D673004F4; Tue, 7 Jun 2022 20:48:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348977AbiFGRuY (ORCPT + 99 others); Tue, 7 Jun 2022 13:50:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346880AbiFGR3a (ORCPT ); Tue, 7 Jun 2022 13:29:30 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01228118D23; Tue, 7 Jun 2022 10:24:52 -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 sin.source.kernel.org (Postfix) with ESMTPS id 3797FCE2018; Tue, 7 Jun 2022 17:24:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C19DC385A5; Tue, 7 Jun 2022 17:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654622689; bh=seCFZk7YL+TVjD/DOD0zsxuIbf6/QXBn7zKIHdKSTeo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BPeK23IdpqrZ4KHvKoeqNDZpBwN0C78Md9PngHaswo8hvlxuilVhfstSwik1bQ66L BUd4G4EiGcQC8LL1VI0z7cyfQ5aToTNsxE3dF9Pm++xHJ1Li3G/fRm6PTZnFp/8h+z A83v8L95jvqMIcMzHQTJLzpJPHvT48i231pJtNM0= 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.10 148/452] mtd: rawnand: denali: Use managed device resources Date: Tue, 7 Jun 2022 19:00:05 +0200 Message-Id: <20220607164912.968882142@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@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