From: Greg KH <gregkh@linuxfoundation.org>
To: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Cc: linux@armlinux.org.uk, jirislaby@kernel.org,
p.rosenberger@kunbus.com, lukas@wunner.de,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] serial: amba-pl011: do not request memory region twice
Date: Fri, 26 Nov 2021 16:28:37 +0100 [thread overview]
Message-ID: <YaD9JW8i9vxmWWhk@kroah.com> (raw)
In-Reply-To: <20211126143925.18758-1-LinoSanfilippo@gmx.de>
On Fri, Nov 26, 2021 at 03:39:25PM +0100, Lino Sanfilippo wrote:
> The driver attempts to request and release the IO memory region for a uart
> port twice:
>
> First during the probe() function devm_ioremap_resource() is used to
> allocate and map the ports memory.
> Then a combo of pl011_config_port() and pl011_release_port() is used to
> request/release the same memory area. These functions are called by the
> serial core as soon as the uart is registered/unregistered.
>
> However since the allocation request via devm_ioremap_resource() already
> succeeds, the attempt to claim the memory again via pl011_config_port()
> fails. This failure remains unnoticed, since the concerning return value is
> not evaluated.
> Later at module unload also the attempt to release the unclaimed memory
> in pl011_release_port() fails. This time the failure results in a “Trying
> to free nonexistent resource" warning printed by the serial core.
>
> Fix these issues by removing the callbacks that implement the redundant
> memory allocation/release.
>
> Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
> ---
>
> This patch was tested on a 5.10 Raspberry Pi kernel with a CM3.
What commit id does this change fix?
thanks,
greg k-h
next prev parent reply other threads:[~2021-11-26 15:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-26 14:39 [PATCH] serial: amba-pl011: do not request memory region twice Lino Sanfilippo
2021-11-26 15:28 ` Greg KH [this message]
2021-11-26 16:11 ` Lino Sanfilippo
2021-11-26 16:09 ` Russell King (Oracle)
2021-11-26 16:27 ` Lino Sanfilippo
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=YaD9JW8i9vxmWWhk@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=LinoSanfilippo@gmx.de \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lukas@wunner.de \
--cc=p.rosenberger@kunbus.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