Message ID | 20180405081547.13266-2-npiggin@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Return-Path: <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org> X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Gwk23Rgcz9s0p for <patchwork-incoming@ozlabs.org>; Thu, 5 Apr 2018 18:20:10 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ms4mqb3G"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40Gwk21WpCzF1vZ for <patchwork-incoming@ozlabs.org>; Thu, 5 Apr 2018 18:20:10 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ms4mqb3G"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::241; helo=mail-pl0-x241.google.com; envelope-from=npiggin@gmail.com; receiver=<UNKNOWN>) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ms4mqb3G"; dkim-atps=neutral Received: from mail-pl0-x241.google.com (mail-pl0-x241.google.com [IPv6:2607:f8b0:400e:c01::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40GwdF6N8KzF1pk for <linuxppc-dev@lists.ozlabs.org>; Thu, 5 Apr 2018 18:16:01 +1000 (AEST) Received: by mail-pl0-x241.google.com with SMTP id v18-v6so16106632ply.12 for <linuxppc-dev@lists.ozlabs.org>; Thu, 05 Apr 2018 01:16:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ksv3btaq3UpZ8a1H9NBdKrmdWw/J+Gs7fA7LzNixYew=; b=Ms4mqb3GbjtEDM+Umm+MFa/a3t4jsLeHLU78laV5QgJYb3bUcIIFYXKS0aZ5vk1dQj 602tbsHSrqsviTF9Icw38gqnAuYmnCLKWMU+uGYndGb0jB+TMasZpETLP313IaLB8ZxY uzQcxpHmNo1bq8ZkkC0jw/MP6m2WaK5lEOz5kkqDFf9Gx59yTwyr6cBd2+722QhK66a1 oOV7z4e1pKwp5WmWv53I/kRp2UCC6atCxL9B3DZc6WJxeaUarkFMjiZSkW0IrEpvLgJU oqcCWTNoHiXk9ohXroZLjIsPYjtM7ZNOZ3PQmbd6Pbnan42D3XbyQfo58F3PGn0Oxx3e aAKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ksv3btaq3UpZ8a1H9NBdKrmdWw/J+Gs7fA7LzNixYew=; b=iqr4iAgRZt6BI0ujkHVBSiBwO5TIcEVRuv4ZbxDKtRV4JwCwSDQGptYHbzZSrlvnrD XF9+2S+HtnLi8/Y8MuvRGtIKGdklDIbmQlUacOPHRku2iWkWzCzSybHY4/0J4SoVQlDw BoPwFrzX9b6UdrfNP0gf/hi8MgkF1LYPnEzQ8fQOLGzBHkKR5iW3NlvSP0caVLFtk9n1 N6RgDXNILrnVqVLW9P5WEql5hIlwjkKwdIOH7k/fd4uIetifpY9+Q7Ka6O+fE5AVnp9f 736TxvIaJgW0C4ZnL3q+pW5SnHtaEcv0ZDl+jZv89kzVVoWbB4YwRRuZD6O5zgUnDqnw BYVA== X-Gm-Message-State: AElRT7FdDFygf+bhmCOqeiyGL3pxEXeRWePRLicgiMTF+/bF/yKC2Wjm XYtEw1SEgoluUZRgofLJRd876g== X-Google-Smtp-Source: AIpwx4+yyEiNW3hiOg7IH2eZt8WjQAX1nistJ1yXcEyNvRgEaPJQI9E/1WhZRu6V4f8HB83epRrfag== X-Received: by 10.99.4.202 with SMTP id 193mr14108740pge.409.1522916159875; Thu, 05 Apr 2018 01:15:59 -0700 (PDT) Received: from roar.au.ibm.com (59-102-70-78.tpgi.com.au. [59.102.70.78]) by smtp.gmail.com with ESMTPSA id s7sm11303086pgq.48.2018.04.05.01.15.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Apr 2018 01:15:59 -0700 (PDT) From: Nicholas Piggin <npiggin@gmail.com> To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 1/6] powerpc/powernv: define a standard delay for OPAL_BUSY type retry loops Date: Thu, 5 Apr 2018 18:15:42 +1000 Message-Id: <20180405081547.13266-2-npiggin@gmail.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180405081547.13266-1-npiggin@gmail.com> References: <20180405081547.13266-1-npiggin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org> List-Unsubscribe: <https://lists.ozlabs.org/options/linuxppc-dev>, <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe> List-Archive: <http://lists.ozlabs.org/pipermail/linuxppc-dev/> List-Post: <mailto:linuxppc-dev@lists.ozlabs.org> List-Help: <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help> List-Subscribe: <https://lists.ozlabs.org/listinfo/linuxppc-dev>, <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe> Cc: Stewart Smith <stewart@linux.ibm.com>, Nicholas Piggin <npiggin@gmail.com> Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org> |
Series |
first step of standardising OPAL_BUSY handling
|
expand
|
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h index 12e70fb58700..fcf3ed5b8b18 100644 --- a/arch/powerpc/include/asm/opal.h +++ b/arch/powerpc/include/asm/opal.h @@ -21,6 +21,9 @@ /* We calculate number of sg entries based on PAGE_SIZE */ #define SG_ENTRIES_PER_NODE ((PAGE_SIZE - 16) / sizeof(struct opal_sg_entry)) +/* Default time to sleep or delay between OPAL_BUSY/OPAL_BUSY_EVENT loops */ +#define OPAL_BUSY_DELAY_MS 10 + /* /sys/firmware/opal */ extern struct kobject *opal_kobj;
This is the start of an effort to tidy up and standardise all the delays. Existing loops have a range of delay/sleep periods from 1ms to 20ms, and some have no delay. They all loop forever except rtc, which times out after 10 retries, and that uses 10ms delays. So use 10ms as our standard delay. The OPAL maintainer agrees 10ms is a reasonable starting point. The idea is to use the same recipe everywhere, once this is proven to work then it will be documented as an OPAL API standard. Then both firmware and OS can agree, and if a particular call needs something else, then that can be documented with reasoning. This is not the end-all of this effort, it's just a relatively easy change that fixes some existing high latency delays. There should be provision for standardising timeouts and/or interruptible loops where possible, so non-fatal firmware errors don't cause hangs. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> --- arch/powerpc/include/asm/opal.h | 3 +++ 1 file changed, 3 insertions(+)