All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dongliang Mu <mudongliangabcd@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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: Mon, 30 Aug 2021 09:22:04 +0800	[thread overview]
Message-ID: <CAD-N9QU-zPU6EVaytsN1bEYqHQc1cDcXa4aXrPqg6VTwDkXb5w@mail.gmail.com> (raw)
In-Reply-To: <YSj1u1x7ruEysfNq@kroah.com>

On Fri, Aug 27, 2021 at 10:25 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> 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.

No problem. I will modify the patch and send a v2 patch afterwards.

>
> thanks,
>
> greg k-h

  reply	other threads:[~2021-08-30  1:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27  9:43 [PATCH] ipack: tpci200: change pci_iounmap to iounmap 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
2021-08-30  1:22       ` Dongliang Mu [this message]
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=CAD-N9QU-zPU6EVaytsN1bEYqHQc1cDcXa4aXrPqg6VTwDkXb5w@mail.gmail.com \
    --to=mudongliangabcd@gmail.com \
    --cc=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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.