From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Geissler Date: Tue, 20 Feb 2024 06:36:15 -0600 Subject: [PATCH] ipmi: kcs: Update OBF poll timeout to reduce latency Message-ID: <20240220123615.963916-1-geissonator@gmail.com> List-Id: To: linux-aspeed@lists.ozlabs.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit From: Andrew Geissler Commit f90bc0f97f2b ("ipmi: kcs: Poll OBF briefly to reduce OBE latency") introduced an optimization to poll when the host has read the output data register (ODR). Testing has shown that the 100us timeout was not always enough. When we miss that 100us window, it results in 10x the time to get the next message from the BMC to the host. When you're sending 100's of messages between the BMC and Host, this results in a server boot taking 50% longer for IBM P10 machines. Started with 1000 and worked it down until the issue started to reoccur. 200 was the sweet spot in my testing. 150 showed the issue intermittently. Signed-off-by: Andrew Geissler --- drivers/char/ipmi/kcs_bmc_aspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/ipmi/kcs_bmc_aspeed.c b/drivers/char/ipmi/kcs_bmc_aspeed.c index 72640da55380..af1eae6153f6 100644 --- a/drivers/char/ipmi/kcs_bmc_aspeed.c +++ b/drivers/char/ipmi/kcs_bmc_aspeed.c @@ -422,7 +422,7 @@ static void aspeed_kcs_irq_mask_update(struct kcs_bmc_device *kcs_bmc, u8 mask, * missed the event. */ rc = read_poll_timeout_atomic(aspeed_kcs_inb, str, - !(str & KCS_BMC_STR_OBF), 1, 100, false, + !(str & KCS_BMC_STR_OBF), 1, 200, false, &priv->kcs_bmc, priv->kcs_bmc.ioreg.str); /* Time for the slow path? */ if (rc == -ETIMEDOUT) -- 2.39.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DA009C48BC3 for ; Tue, 20 Feb 2024 15:44:12 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=DiuZabsn; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4TfNxR2drlz3cWR for ; Wed, 21 Feb 2024 02:44:11 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=DiuZabsn; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::c2a; helo=mail-oo1-xc2a.google.com; envelope-from=geissonator@gmail.com; receiver=lists.ozlabs.org) Received: from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4TfNwJ5dxNz3bs2; Wed, 21 Feb 2024 02:43:11 +1100 (AEDT) Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-59fb0b5b47eso1454095eaf.3; Tue, 20 Feb 2024 07:43:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708443786; x=1709048586; darn=lists.ozlabs.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ba+FZT/y8DAA+ic+9F75Kom97L71NReEfdPzSuOXjjQ=; b=DiuZabsnLTH4YxtiCwbx9+AkhPbb1evXjmd0ItdROOanxi5a5feK3fbEw16BJK89wj vzZIEyaEhw9xu4O3q/9sS8cYTcag4iaT8UVuRqRnS4JXxsdtf4s7VCRM8boXG1EUdWNx WGyx2Iw3xjiw86Zti/bw1MH/dKe4JseMauIoRY6PHlvdB2LT5ClPzpOoUZkNuYXtoKUy QWhMZMeSFH47WPeY4kHC4E8paaP3w5yKd0eSFGUjieONOYz8VLdN/yMO9EvI1jfVRTpk JaXzQR/NQL001kbJnlhePxYm5SVorXhQOQHCSkL1LnS3qXCpQpirGZa5FRfR3OcEY6DZ 93aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708443786; x=1709048586; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ba+FZT/y8DAA+ic+9F75Kom97L71NReEfdPzSuOXjjQ=; b=l6C87WqQt9PZIyMy4tAYisPravBYQIK3VpMgBXbNWdjDB6BpgGYBXcarL9SiYldNdR Z2yicOhViu1rV1pD4L91N2tTvwbGyBFhNWqbfqqQ9Uez69x/o0skqyU86DAHQJY30fQ4 j9yrBZw4+7UPxhGKfBD6kB+sEfbp1jfrmtLslH87iZJ/T9G7L+l/uY4hgS6De4Yci6Y+ s46hXdn0BVN/TOHnQRhzrox8TmP7yWWg2ycj7zHcqFnpvDW+CyedaWKa91PKn9pACGbS M4vIIndIMdKa47l8IbItpnrTs1ZvZeAozth5z2Omr9EQRI4PR8+Xja603CP5XHXPb0iC e7dg== X-Forwarded-Encrypted: i=1; AJvYcCV/dwBOt204ZKbwQ5yFVdKBX5ibGQzoH3nMpSmoGG1KD0e7G+U9dEoxsiXzMwmQ+jbS+7A+A/GsgrUyjaxzZmUDonsrDZZBchVrCJ3+luFERxQ1J5ojAujlUbw3DWe8kMQMjoJfjUZM X-Gm-Message-State: AOJu0YySWxDsPkeGzyVgLKMsY3TGyKlMGJ8jvQ6PVft/gt6YorIsmLUa o6S+P1N0d4GHcykMLEmPXGv8CkLIaV4dO+lHQjl+9SZWtJ83dyP+ X-Google-Smtp-Source: AGHT+IGMh9C/THGjJ9L9lzGt8mkv2YzHJOx4qROhpehEf2GFdHrOOe/Lsm/J+pCmlIYkFTF5PQZHdg== X-Received: by 2002:a4a:355a:0:b0:59f:fc30:d3aa with SMTP id w26-20020a4a355a000000b0059ffc30d3aamr2191859oog.3.1708443786272; Tue, 20 Feb 2024 07:43:06 -0800 (PST) Received: from localhost.localdomain ([129.41.86.2]) by smtp.gmail.com with ESMTPSA id p3-20020a4adfc3000000b0059aaa2bebb6sm1388768ood.48.2024.02.20.07.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 07:43:05 -0800 (PST) From: Andrew Geissler To: minyard@acm.org, joel@jms.id.au, andrew@codeconstruct.com.au, openipmi-developer@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] ipmi: kcs: Update OBF poll timeout to reduce latency Date: Tue, 20 Feb 2024 06:36:15 -0600 Message-Id: <20240220123615.963916-1-geissonator@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openbmc@lists.ozlabs.org, Andrew Geissler Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" From: Andrew Geissler Commit f90bc0f97f2b ("ipmi: kcs: Poll OBF briefly to reduce OBE latency") introduced an optimization to poll when the host has read the output data register (ODR). Testing has shown that the 100us timeout was not always enough. When we miss that 100us window, it results in 10x the time to get the next message from the BMC to the host. When you're sending 100's of messages between the BMC and Host, this results in a server boot taking 50% longer for IBM P10 machines. Started with 1000 and worked it down until the issue started to reoccur. 200 was the sweet spot in my testing. 150 showed the issue intermittently. Signed-off-by: Andrew Geissler --- drivers/char/ipmi/kcs_bmc_aspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/ipmi/kcs_bmc_aspeed.c b/drivers/char/ipmi/kcs_bmc_aspeed.c index 72640da55380..af1eae6153f6 100644 --- a/drivers/char/ipmi/kcs_bmc_aspeed.c +++ b/drivers/char/ipmi/kcs_bmc_aspeed.c @@ -422,7 +422,7 @@ static void aspeed_kcs_irq_mask_update(struct kcs_bmc_device *kcs_bmc, u8 mask, * missed the event. */ rc = read_poll_timeout_atomic(aspeed_kcs_inb, str, - !(str & KCS_BMC_STR_OBF), 1, 100, false, + !(str & KCS_BMC_STR_OBF), 1, 200, false, &priv->kcs_bmc, priv->kcs_bmc.ioreg.str); /* Time for the slow path? */ if (rc == -ETIMEDOUT) -- 2.39.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A17DDC5475B for ; Tue, 20 Feb 2024 15:43:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=/5S0AzN52nKKok/yiyCtIa5L2atfE7+gt21GKTnU0lM=; b=lKZwQeob5n+ZHR KJ7AIxDV9LEy3GBAD2nkraImugaP9VEj4HruP5usQFzke3OCgvn2LtdWydx49Djgo5uWbCWQghTno pgE0e8cl7OQ0WYtMnX/EYuylQ2r2kcMjIRBAA0u7Ig4t9ISmmj2nPbasABoBV/Zhr35SPWFQYwLkW 3ixKnba9KyzXX87UyBt9GKZhi1ffL34O7g3W7o14o04qtCumYBj83ER64dsx3CDoKTwjyLOQHF3vp TBG/xK5etQHp5Dw/lx3lUheRxanzPNcgqbw47ssouo96XvhZVZz6nssKfxszwVhUR9QN0gCDGWGCK 72EGBiho6ydU+ZN4ubGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcSH1-0000000FJ8P-0imo; Tue, 20 Feb 2024 15:43:11 +0000 Received: from mail-oo1-xc35.google.com ([2607:f8b0:4864:20::c35]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcSGx-0000000FJ7e-3SZ2 for linux-arm-kernel@lists.infradead.org; Tue, 20 Feb 2024 15:43:09 +0000 Received: by mail-oo1-xc35.google.com with SMTP id 006d021491bc7-59a8ee08c23so2030647eaf.2 for ; Tue, 20 Feb 2024 07:43:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708443786; x=1709048586; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ba+FZT/y8DAA+ic+9F75Kom97L71NReEfdPzSuOXjjQ=; b=KSzhl//4+NM1aYPrzM0Vx8HAOZuaP9uXXm5cIqjlIjo+YrKBKRmcEok9O8iKZa9ZfO crk/eNyZVXHTb5H7uKn866NoHEDz1fWqfrprFObX2qx8X4MNp/2flHGdriIABZQj8ePj PLt5hg6Yv0aWm9qk+R2w6spYvLyW92zuvejL5dtIPOUtr19+5uGzyWTlkXolqPNKUn// tkphG0M+boUl+sullXml32owhNX1FXwrKlHVTz+0VN82tWokuae4AzDmSRd3dgQxW+F3 d2oi6NLchlio6JwrbKQdnqloLIMlXfnSRFwLN+d0Xcd9W14ZVTZwFL3uFr8AKt9oGvr2 soCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708443786; x=1709048586; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ba+FZT/y8DAA+ic+9F75Kom97L71NReEfdPzSuOXjjQ=; b=M57ExXU6zminooZI7E/yAEdqFUVAjQoY0sFqlbxPo8OrlilPzPvBfUcxi0RmPTJHY9 r6/PCVhVWqA0fPgqsrsRXq4PGkJXR0ws/V9yfB6JI562YWuRe0LXnUlPutad9IK/S4QT ALzLjsc2Y315+jLCwRJ23mjfd44/ds7vS8SdLkdNcMUgnsecOiEIXAU8/qeqtvAmuHJq prqH3qXyAg0KDqqOiSPchCKn1gUV7fjBEiLjzuiY35thjUkK6OlsXXwE3yTobSeU7hhL ShYf2lPG6DWBemfTF5mKgWhYoAX8MDGmpJVw7LmdP0sYXE4k+1znQ7qjVZXQkQaMPajq 7bdQ== X-Forwarded-Encrypted: i=1; AJvYcCXoprCTTbm9pce9whUPHYj24nQBZG4oOSAKy0+G5+40Cxn0sCGlQrfBBJEvTk6ROzIwtZRwvktj08w0qEJDmmUbfiuIWkIG4i4n/hsB0OowoNUbhGE= X-Gm-Message-State: AOJu0Yy7EiBUasmb57pWLLMH1qEv0Ub8XXeYEFv6vDNGgcuGyQQBp4xS vh7pgPdSaURr1RIctqjdVOTpZ/L6N3hEHSQ4mxuhCpGfqp6gXCIP X-Google-Smtp-Source: AGHT+IGMh9C/THGjJ9L9lzGt8mkv2YzHJOx4qROhpehEf2GFdHrOOe/Lsm/J+pCmlIYkFTF5PQZHdg== X-Received: by 2002:a4a:355a:0:b0:59f:fc30:d3aa with SMTP id w26-20020a4a355a000000b0059ffc30d3aamr2191859oog.3.1708443786272; Tue, 20 Feb 2024 07:43:06 -0800 (PST) Received: from localhost.localdomain ([129.41.86.2]) by smtp.gmail.com with ESMTPSA id p3-20020a4adfc3000000b0059aaa2bebb6sm1388768ood.48.2024.02.20.07.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 07:43:05 -0800 (PST) From: Andrew Geissler To: minyard@acm.org, joel@jms.id.au, andrew@codeconstruct.com.au, openipmi-developer@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Andrew Geissler , openbmc@lists.ozlabs.org Subject: [PATCH] ipmi: kcs: Update OBF poll timeout to reduce latency Date: Tue, 20 Feb 2024 06:36:15 -0600 Message-Id: <20240220123615.963916-1-geissonator@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240220_074307_891736_BF946165 X-CRM114-Status: GOOD ( 15.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Andrew Geissler Commit f90bc0f97f2b ("ipmi: kcs: Poll OBF briefly to reduce OBE latency") introduced an optimization to poll when the host has read the output data register (ODR). Testing has shown that the 100us timeout was not always enough. When we miss that 100us window, it results in 10x the time to get the next message from the BMC to the host. When you're sending 100's of messages between the BMC and Host, this results in a server boot taking 50% longer for IBM P10 machines. Started with 1000 and worked it down until the issue started to reoccur. 200 was the sweet spot in my testing. 150 showed the issue intermittently. Signed-off-by: Andrew Geissler --- drivers/char/ipmi/kcs_bmc_aspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/ipmi/kcs_bmc_aspeed.c b/drivers/char/ipmi/kcs_bmc_aspeed.c index 72640da55380..af1eae6153f6 100644 --- a/drivers/char/ipmi/kcs_bmc_aspeed.c +++ b/drivers/char/ipmi/kcs_bmc_aspeed.c @@ -422,7 +422,7 @@ static void aspeed_kcs_irq_mask_update(struct kcs_bmc_device *kcs_bmc, u8 mask, * missed the event. */ rc = read_poll_timeout_atomic(aspeed_kcs_inb, str, - !(str & KCS_BMC_STR_OBF), 1, 100, false, + !(str & KCS_BMC_STR_OBF), 1, 200, false, &priv->kcs_bmc, priv->kcs_bmc.ioreg.str); /* Time for the slow path? */ if (rc == -ETIMEDOUT) -- 2.39.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C93D627EA for ; Tue, 20 Feb 2024 15:43:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708443788; cv=none; b=UaTZxwQ23E5YA2F7YbrHuk6vKwkB6m4oqGTiPhDeECHytk4ppJ0f6D8wiFAPABUW8PZjVFq+5aMpi65pkl3FeK828QjuW43RGCfx2Fpfq6TWAjBlH+qfDfP8RC0ypU04qqc1Cf0ahV6YRIf3IRX7gF7M8AtkJnJlkhGR5JIcyis= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708443788; c=relaxed/simple; bh=BHwUKr8biU6qwSoYRciff715r/Wq10MJ8jrCOgZ4EeI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=VcZy380SU6gf233ivH/T3yQgzbF7AP+9+JgltTzj5IlPDNcGK8xlmOxB1fNJt3eUn2HnYjpIzEV0kwzmoRjEutDNZdGenOgHJrh1BqiQ1m8LQvTrkwf/B7cgYh0g0X9vOALKDTx/3jsipNtGMUSc+XY+yaD+ZP4BZkHRgBOLVt4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DL4j15bR; arc=none smtp.client-ip=209.85.161.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DL4j15bR" Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-59d78deb469so3513849eaf.1 for ; Tue, 20 Feb 2024 07:43:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708443786; x=1709048586; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ba+FZT/y8DAA+ic+9F75Kom97L71NReEfdPzSuOXjjQ=; b=DL4j15bRVw8JX0Ue+Ro2pio4rRhekzaUMSW1tEC7sQOMlxAiPh+xP330Y+nZm9Hlhz Wk8IoeF0J8sC69vf7kGBNng3CHShuVURcTx34I0z4ynj/VCzw20J+FJiovGZAMjMINLV T+QL2QgJhi4Gw41wbWkyuAQqlGVVqxInrfzyndyOqAuhuor/65HEnOqnSMDK90F3Er3I T3eDTA1IxWlKiUca0YgoHAZazT4/HIzS4XjTcyjSs+UAxA1NGaATlG3Bsf3+/1pym/Ro fgFld9PggqtwvfRmydvbmhjINQ1Uw2tyopRfRpr5nKD8Y1FyLzkkFYmLWywzzaNCeUvG G6sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708443786; x=1709048586; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ba+FZT/y8DAA+ic+9F75Kom97L71NReEfdPzSuOXjjQ=; b=LktsoA6HqA6Te1VklGP2MaC4euxQstPkxKBzZ8s4J8rKl78yxoCPSw0r4DsNz0EIXJ HK338ASiRJ4BfDTzR6hUEwzdL+glQGNGLNyPWbijUr1dVE+JcwCRYjsy2ILNjghHfT2b exrO/RmX2eEDiRXyFYbuZRuZtdDLjaprsI0gZ3OIk3c9ZEHIZG3SfQNb4JHCaKbeOWFg mkC3tnX7LPVPiciitJmeADykqfUsD9ZcM0CmPNNNvVPpTviPWw29n1eQn0d6xV5PEL5f 17ULJbx5mQ+OKNrkaEzKqYqkCQbzCS+bq4GvyozJ1VRaquNonV8c56oFTTT40zO4/PYe DQ3Q== X-Forwarded-Encrypted: i=1; AJvYcCW/ndu4QExu3rKkl83EjY03rgLO8iam8PyQLnHPlmlLu54CQ8To12lFOR2m8Y7v3c+sbv4rGAxOcoPC4H/aqomvmGVg07+hs7AhZazi X-Gm-Message-State: AOJu0Yy6+0M2OXbDgv8wopZDHKnWFoE1K/5b9IBL/ELhErVTciyz0u9A xppQK5RQj1OeBIT9WaGPOnO8moA9hKMZEcjmjozRZxW7ohQn5+FN X-Google-Smtp-Source: AGHT+IGMh9C/THGjJ9L9lzGt8mkv2YzHJOx4qROhpehEf2GFdHrOOe/Lsm/J+pCmlIYkFTF5PQZHdg== X-Received: by 2002:a4a:355a:0:b0:59f:fc30:d3aa with SMTP id w26-20020a4a355a000000b0059ffc30d3aamr2191859oog.3.1708443786272; Tue, 20 Feb 2024 07:43:06 -0800 (PST) Received: from localhost.localdomain ([129.41.86.2]) by smtp.gmail.com with ESMTPSA id p3-20020a4adfc3000000b0059aaa2bebb6sm1388768ood.48.2024.02.20.07.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 07:43:05 -0800 (PST) From: Andrew Geissler To: minyard@acm.org, joel@jms.id.au, andrew@codeconstruct.com.au, openipmi-developer@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Andrew Geissler , openbmc@lists.ozlabs.org Subject: [PATCH] ipmi: kcs: Update OBF poll timeout to reduce latency Date: Tue, 20 Feb 2024 06:36:15 -0600 Message-Id: <20240220123615.963916-1-geissonator@gmail.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Andrew Geissler Commit f90bc0f97f2b ("ipmi: kcs: Poll OBF briefly to reduce OBE latency") introduced an optimization to poll when the host has read the output data register (ODR). Testing has shown that the 100us timeout was not always enough. When we miss that 100us window, it results in 10x the time to get the next message from the BMC to the host. When you're sending 100's of messages between the BMC and Host, this results in a server boot taking 50% longer for IBM P10 machines. Started with 1000 and worked it down until the issue started to reoccur. 200 was the sweet spot in my testing. 150 showed the issue intermittently. Signed-off-by: Andrew Geissler --- drivers/char/ipmi/kcs_bmc_aspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/ipmi/kcs_bmc_aspeed.c b/drivers/char/ipmi/kcs_bmc_aspeed.c index 72640da55380..af1eae6153f6 100644 --- a/drivers/char/ipmi/kcs_bmc_aspeed.c +++ b/drivers/char/ipmi/kcs_bmc_aspeed.c @@ -422,7 +422,7 @@ static void aspeed_kcs_irq_mask_update(struct kcs_bmc_device *kcs_bmc, u8 mask, * missed the event. */ rc = read_poll_timeout_atomic(aspeed_kcs_inb, str, - !(str & KCS_BMC_STR_OBF), 1, 100, false, + !(str & KCS_BMC_STR_OBF), 1, 200, false, &priv->kcs_bmc, priv->kcs_bmc.ioreg.str); /* Time for the slow path? */ if (rc == -ETIMEDOUT) -- 2.39.2