From patchwork Thu Mar 31 09:05:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 64742 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp36635lbc; Thu, 31 Mar 2016 02:08:03 -0700 (PDT) X-Received: by 10.31.58.139 with SMTP id h133mr8369850vka.158.1459415283773; Thu, 31 Mar 2016 02:08:03 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 36si2828365uaq.5.2016.03.31.02.08.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Mar 2016 02:08:03 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1alYYr-000228-1o; Thu, 31 Mar 2016 09:06:41 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1alYYp-000222-Kv for xen-devel@lists.xen.org; Thu, 31 Mar 2016 09:06:39 +0000 Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id C3/A4-16378-E98ECF65; Thu, 31 Mar 2016 09:06:38 +0000 X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-7.tower-206.messagelabs.com!1459415195!31990569!1 X-Originating-IP: [119.145.14.66] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NiA9PiA4NTI3\n X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 445 invoked from network); 31 Mar 2016 09:06:38 -0000 Received: from szxga03-in.huawei.com (HELO szxga03-in.huawei.com) (119.145.14.66) by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 31 Mar 2016 09:06:38 -0000 Received: from 172.24.1.36 (EHLO SZXEML429-HUB.china.huawei.com) ([172.24.1.36]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BZA39363; Thu, 31 Mar 2016 17:06:26 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by SZXEML429-HUB.china.huawei.com (10.82.67.184) with Microsoft SMTP Server id 14.3.235.1; Thu, 31 Mar 2016 17:06:17 +0800 From: Shannon Zhao To: Date: Thu, 31 Mar 2016 17:05:31 +0800 Message-ID: <1459415131-17460-1-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0203.56FCE898.0179, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: f1844d1133d583d998720d658589cf42 Cc: zhaoshenglong@huawei.com, julien.grall@arm.com, sstabellini@kernel.org, shannon.zhao@linaro.org, peter.huangpeng@huawei.com Subject: [Xen-devel] [PATCH] xen/arm: make the error log printk ratelimited X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" From: Shannon Zhao To avoid a lot of possible error logs in function map_dev_mmio_region, make it printk ratelimited. Signed-off-by: Shannon Zhao --- xen/arch/arm/p2m.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 0011708..be4ab9d 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1284,8 +1284,9 @@ int map_dev_mmio_region(struct domain *d, res = map_mmio_regions(d, start_gfn, nr, mfn); if ( res < 0 ) { - printk(XENLOG_ERR "Unable to map [%#lx - %#lx] in Dom%d\n", - start_gfn, start_gfn + nr - 1, d->domain_id); + if ( printk_ratelimit() ) + printk(XENLOG_ERR "Unable to map [%#lx - %#lx] in Dom%d\n", + start_gfn, start_gfn + nr - 1, d->domain_id); return res; }