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=-6.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 BE1B5C432BE for ; Fri, 27 Aug 2021 14:25:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F5176101B for ; Fri, 27 Aug 2021 14:25:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245313AbhH0OZ7 (ORCPT ); Fri, 27 Aug 2021 10:25:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:52030 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233645AbhH0OZy (ORCPT ); Fri, 27 Aug 2021 10:25:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 101E661004; Fri, 27 Aug 2021 14:25:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1630074305; bh=EirSWY54CSyGcXPSy22/Yz2aZ9xdXrTwL7qJCDzFoKc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qQekdGVHqUAhZHe1qv2T8SdTwHwqUgI3VTQtQlsCAtVDYzxZ/04ehtHDVzuAGVJ2K hxP12li6G8Zys4LaSzoK3IBQDjN4UR9SkNS0bFB8OvoEXoD+p4efKDV1xL/EJ2xCq6 P6EdHsRM8KqKwTmotvge3phSXgwssduBNvEpMLSQ= Date: Fri, 27 Aug 2021 16:24:59 +0200 From: Greg Kroah-Hartman To: Dongliang Mu Cc: Samuel Iglesias Gonsalvez , Jens Taprogge , Lv Yunlong , Aditya Srivastava , Randy Dunlap , industrypack-devel@lists.sourceforge.net, linux-kernel Subject: Re: [PATCH] ipack: tpci200: change pci_iounmap to iounmap Message-ID: References: <20210827094351.203328-1-mudongliangabcd@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 27, 2021 at 06:33:46PM +0800, Dongliang Mu wrote: > On Fri, Aug 27, 2021 at 6:00 PM Greg Kroah-Hartman > wrote: > > > > On Fri, Aug 27, 2021 at 05:43:47PM +0800, Dongliang Mu wrote: > > > The deallocation api for ioremap should be iounmap, other than > > > pci_iounmap. > > > > why? > > Because the tpci200->info->cfg_regs/interface_regs is allocated by > ioremap. From my understanding, ioremap and iounmap are in pairs, > other than pci_iounmap. > See the code below. > > tpci200->info->interface_regs = > ioremap(pci_resource_start(tpci200->info->pdev, > TPCI200_IP_INTERFACE_BAR), > TPCI200_IFACE_SIZE); > > https://elixir.bootlin.com/linux/latest/source/drivers/ipack/carriers/tpci200.c#L297 > > tpci200->info->cfg_regs = ioremap( > pci_resource_start(pdev, TPCI200_CFG_MEM_BAR), > pci_resource_len(pdev, TPCI200_CFG_MEM_BAR)); > > https://elixir.bootlin.com/linux/latest/source/drivers/ipack/carriers/tpci200.c#L546 > > If there is any issue, please let me know The point is that the driver should be calling pci_iomap_bar() instead of ioremap(), and then the call to pci_ioumap() is correct here. Please make that change instead. thanks, greg k-h