From patchwork Fri Mar 11 08:30:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 596085 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 0EF01140213 for ; Fri, 11 Mar 2016 19:31:02 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id EECC41A035A for ; Fri, 11 Mar 2016 19:31:01 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e06smtp06.uk.ibm.com (e06smtp06.uk.ibm.com [195.75.94.102]) (using TLSv1.2 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id DE93F1A02EE for ; Fri, 11 Mar 2016 19:30:56 +1100 (AEDT) Received: from localhost by e06smtp06.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 11 Mar 2016 08:30:52 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp06.uk.ibm.com (192.168.101.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 11 Mar 2016 08:30:49 -0000 X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: clg@fr.ibm.com X-IBM-RcptTo: skiboot@lists.ozlabs.org Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id AD3F11B08067 for ; Fri, 11 Mar 2016 08:31:15 +0000 (GMT) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u2B8UmDu6750700 for ; Fri, 11 Mar 2016 08:30:48 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u2B7UofR032263 for ; Fri, 11 Mar 2016 00:30:50 -0700 Received: from hermes.ibm.com (icon-9-164-135-92.megacenter.de.ibm.com [9.164.135.92]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u2B7Un42032205; Fri, 11 Mar 2016 00:30:49 -0700 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: skiboot@lists.ozlabs.org Date: Fri, 11 Mar 2016 09:30:35 +0100 Message-Id: <1457685035-20213-1-git-send-email-clg@fr.ibm.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16031108-0025-0000-0000-000006546052 Subject: [Skiboot] [PATCH] bt: use the maximum retry count returned by the BMC 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: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" OpenPower systems using a AMI firmware on the BMC have a BT device configured with a capability of '1' maximum retry. The following code is equivalent to what skiboot currently supports but it will now also handle setups of other BT devices, like in qemu or OpenBMC. Signed-off-by: Cédric Le Goater Reviewed-by: Vasant Hegde --- hw/bt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Index: skiboot.git/hw/bt.c =================================================================== --- skiboot.git.orig/hw/bt.c +++ skiboot.git/hw/bt.c @@ -74,7 +74,7 @@ /* * Maximum number of times to attempt sending a message before giving up. */ -#define BT_MAX_SEND_COUNT 2 +#define BT_MAX_SEND_COUNT 1 #define BT_QUEUE_DEBUG 0 @@ -392,7 +392,7 @@ static void bt_expire_old_msg(uint64_t t if (bt_msg && bt_msg->tb > 0 && (tb_compare(tb, bt_msg->tb + secs_to_tb(bt.caps.msg_timeout)) == TB_AAFTERB)) { - if (bt_msg->send_count < BT_MAX_SEND_COUNT) { + if (bt_msg->send_count < bt.caps.num_retries + 1) { /* A message timeout is usually due to the BMC clearing the H2B_ATN flag without actually doing anything. The data will still be in the @@ -629,7 +629,7 @@ void bt_init(void) bt.caps.input_buf_len = BT_FIFO_LEN; bt.caps.output_buf_len = BT_FIFO_LEN; bt.caps.msg_timeout = BT_MSG_TIMEOUT; - bt.caps.num_retries = 1; + bt.caps.num_retries = BT_MAX_SEND_COUNT; /* We support only one */ n = dt_find_compatible_node(dt_root, NULL, "ipmi-bt");