From: Konrad Rzeszutek Wilk <konrad@darnok.org>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Jonathan Corbet <corbet@lwn.net>,
Magnus Damm <magnus.damm@gmail.com>,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
iommu@lists.linux-foundation.org,
linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH 1/2] swiotlb: Rate-limit printing when running out of SW-IOMMU space
Date: Sat, 5 Nov 2016 15:40:19 -0400 [thread overview]
Message-ID: <20161105194018.GB26349@localhost.localdomain> (raw)
In-Reply-To: <1477928704-10611-2-git-send-email-geert+renesas@glider.be>
On Mon, Oct 31, 2016 at 04:45:03PM +0100, Geert Uytterhoeven wrote:
> If the system runs out of SW-IOMMU space, changes are high successive
> requests will fail, too, flooding the kernel log. This is true
> especially for streaming DMA, which is typically used repeatedly outside
> the driver's initialization routine. Add rate-limiting to fix this.
>
> While at it, get rid of the open-coded dev_name() handling by using the
> appropriate dev_err_*() variant.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
applied.
> ---
> lib/swiotlb.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/swiotlb.c b/lib/swiotlb.c
> index 22e13a0e19d76a2b..6ce764410ae475cc 100644
> --- a/lib/swiotlb.c
> +++ b/lib/swiotlb.c
> @@ -714,8 +714,8 @@ void swiotlb_tbl_sync_single(struct device *hwdev, phys_addr_t tlb_addr,
> * When the mapping is small enough return a static buffer to limit
> * the damage, or panic when the transfer is too big.
> */
> - printk(KERN_ERR "DMA: Out of SW-IOMMU space for %zu bytes at "
> - "device %s\n", size, dev ? dev_name(dev) : "?");
> + dev_err_ratelimited(dev, "DMA: Out of SW-IOMMU space for %zu bytes\n",
> + size);
>
> if (size <= io_tlb_overflow || !do_panic)
> return;
> --
> 1.9.1
>
next prev parent reply other threads:[~2016-11-05 19:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-31 15:45 [PATCH 0/2] swiotlb: Rate-limit printing and 64-bit memory debugging Geert Uytterhoeven
2016-10-31 15:45 ` [PATCH 1/2] swiotlb: Rate-limit printing when running out of SW-IOMMU space Geert Uytterhoeven
2016-10-31 16:02 ` Sergei Shtylyov
2016-11-05 19:40 ` Konrad Rzeszutek Wilk [this message]
2016-10-31 15:45 ` [PATCH 2/2] swiotlb: Add swiotlb=nobounce debug option Geert Uytterhoeven
2016-10-31 17:41 ` Robin Murphy
2016-10-31 18:20 ` Geert Uytterhoeven
2016-11-01 11:46 ` Robin Murphy
2016-11-07 15:41 ` Geert Uytterhoeven
[not found] ` <CAMuHMdUiVuZFG8T3US3D5EzBbXgW5VCoYypzAsQJEk4DgtyH5g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-11-07 17:18 ` Robin Murphy
2016-10-31 17:52 ` Konrad Rzeszutek Wilk
[not found] ` <20161031175252.GA6952-he5eyhs8q0BAdwtm4QZOy9BPR1lH4CV8@public.gmane.org>
2016-11-07 18:57 ` Geert Uytterhoeven
2016-11-07 19:20 ` Konrad Rzeszutek Wilk
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=20161105194018.GB26349@localhost.localdomain \
--to=konrad@darnok.org \
--cc=corbet@lwn.net \
--cc=geert+renesas@glider.be \
--cc=iommu@lists.linux-foundation.org \
--cc=konrad.wilk@oracle.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@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;
as well as URLs for NNTP newsgroup(s).