mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Dongliang Mu <mudongliangabcd@gmail.com>
Cc: Samuel Iglesias Gonsalvez <siglesias@igalia.com>,
	Jens Taprogge <jens.taprogge@taprogge.org>,
	Lv Yunlong <lyl2019@mail.ustc.edu.cn>,
	Aditya Srivastava <yashsri421@gmail.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	industrypack-devel@lists.sourceforge.net,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ipack: tpci200: change pci_iounmap to iounmap
Date: Fri, 27 Aug 2021 16:24:59 +0200	[thread overview]
Message-ID: <YSj1u1x7ruEysfNq@kroah.com> (raw)
In-Reply-To: <CAD-N9QUveJWdK_zaAd6JTwWidMWap5Ri-bRe0n7QnCuBpMqbew@mail.gmail.com>

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
> <gregkh@linuxfoundation.org> 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

  reply	other threads:[~2021-08-27 14:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27  9:43 Dongliang Mu
2021-08-27 10:00 ` Greg Kroah-Hartman
2021-08-27 10:33   ` Dongliang Mu
2021-08-27 14:24     ` Greg Kroah-Hartman [this message]
2021-08-30  1:22       ` Dongliang Mu
2021-08-30  2:32         ` Dongliang Mu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YSj1u1x7ruEysfNq@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=industrypack-devel@lists.sourceforge.net \
    --cc=jens.taprogge@taprogge.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyl2019@mail.ustc.edu.cn \
    --cc=mudongliangabcd@gmail.com \
    --cc=rdunlap@infradead.org \
    --cc=siglesias@igalia.com \
    --cc=yashsri421@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®