From patchwork Thu Sep 10 00:08:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 516068 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 334DB140281 for ; Thu, 10 Sep 2015 10:09:55 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 191B11A2A82 for ; Thu, 10 Sep 2015 10:09:55 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e23smtp02.au.ibm.com (e23smtp02.au.ibm.com [202.81.31.144]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 18D511A0795 for ; Thu, 10 Sep 2015 10:09:52 +1000 (AEST) Received: from /spool/local by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 10 Sep 2015 10:09:50 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp02.au.ibm.com (202.81.31.208) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 10 Sep 2015 10:09:49 +1000 X-Helo: d23dlp01.au.ibm.com X-MailFrom: benh@au1.ibm.com X-RcptTo: skiboot@lists.ozlabs.org Received: from d23relay08.au.ibm.com (d23relay08.au.ibm.com [9.185.71.33]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id AE1262CE8050 for ; Thu, 10 Sep 2015 10:09:48 +1000 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t8A09VFX62324812 for ; Thu, 10 Sep 2015 10:09:40 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t8A09Gc5008587 for ; Thu, 10 Sep 2015 10:09:16 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t8A09G9Q008180 for ; Thu, 10 Sep 2015 10:09:16 +1000 Received: from pasglop.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id E2402A0278 for ; Thu, 10 Sep 2015 10:08:51 +1000 (AEST) Message-ID: <1441843731.26961.14.camel@au1.ibm.com> From: Benjamin Herrenschmidt To: skiboot@lists.ozlabs.org Date: Thu, 10 Sep 2015 10:08:51 +1000 Organization: IBM Australia X-Mailer: Evolution 3.16.5 (3.16.5-1.fc22) Mime-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15091000-0005-0000-0000-0000026D1975 Subject: [Skiboot] [PATCH 2/3] bt: Remove use of TIMER_POLL X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: benh@au1.ibm.com Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Use a 2s timer instead. TIMER_POLL can fire a *lot* when there is console activity and I would like to mostly get rid of it. We should still stop using that timer completely when interrupts are working unless there's an active request, in which case we can arm it for timeouts. Signed-off-by: Benjamin Herrenschmidt --- hw/bt.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hw/bt.c b/hw/bt.c index 41fe24e..42db3f3 100644 --- a/hw/bt.c +++ b/hw/bt.c @@ -39,8 +39,11 @@ #define BT_INTMASK_B2H_IRQ 0x02 #define BT_INTMASK_BMC_HWRST 0x80 -/* Default poll interval before interrupts are working */ -#define BT_DEFAULT_POLL_MS 200 +/* Poll interval before interrupts are working */ +#define BT_NOIRQ_POLL_MS 200 + +/* Poll interval when interrupts are working (for timeouts) */ +#define BT_IRQ_POLL_MS 2000 /* * Minimum size of an IPMI request/response including @@ -52,8 +55,6 @@ /* * How long (in uS) to poll for new ipmi data. */ -#define POLL_TIMEOUT 10000 - /* * Maximum number of outstanding messages to allow in the queue. */ @@ -393,7 +394,9 @@ static void bt_poll(struct timer *t __unused, void *data __unused, bt_send_and_unlock(); schedule_timer(&bt.poller, - bt.irq_ok ? TIMER_POLL : msecs_to_tb(BT_DEFAULT_POLL_MS)); + bt.irq_ok ? + msecs_to_tb(BT_IRQ_POLL_MS) : + msecs_to_tb(BT_NOIRQ_POLL_MS)); } static void bt_add_msg(struct bt_msg *bt_msg) @@ -551,7 +554,7 @@ void bt_init(void) * least until we have at least one interrupt occurring at which * point we turn it into a background poller */ - schedule_timer(&bt.poller, msecs_to_tb(BT_DEFAULT_POLL_MS)); + schedule_timer(&bt.poller, msecs_to_tb(BT_NOIRQ_POLL_MS)); irq = dt_prop_get_u32(n, "interrupts"); bt_lpc_client.interrupts = LPC_IRQ(irq);