Message ID | 20180409052431.26405-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 [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40KJl11261z9s2S for <patchwork-incoming@ozlabs.org>; Mon, 9 Apr 2018 15:29:17 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UbpEj7iS"; 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 40KJl06NXMzDqvM for <patchwork-incoming@ozlabs.org>; Mon, 9 Apr 2018 15:29:16 +1000 (AEST) 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="UbpEj7iS"; 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:c00::241; helo=mail-pf0-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="UbpEj7iS"; dkim-atps=neutral Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::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 40KJfl2bwkzDqlJ for <linuxppc-dev@lists.ozlabs.org>; Mon, 9 Apr 2018 15:25:35 +1000 (AEST) Received: by mail-pf0-x241.google.com with SMTP id a2so5214501pff.8 for <linuxppc-dev@lists.ozlabs.org>; Sun, 08 Apr 2018 22:25:35 -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=6Ui/KKts6hzXpXThUGHpIhhDFAZVDf3Sy5e28fKXbEI=; b=UbpEj7iSdtN51r6ipCay0ccy8j5z5SyPYPvg2AaE5MlT2fC+jDVSDyBZ5qMn3a7IS/ MBL6IarRnNos+8o4JvMXSaw5LYSl332YXn1ml2QHzucNK6NpQbS+IGCZ13/38XDNyFO/ 7a7PnKLzo7sbcJ53S3duDnnQNjNi6hMOt2PIkVGoGuEiXJoKkXRDycAPB0xIWA8Ie5nZ CnUBd3ESAxlhzo6MMbyi2rvZlMCC0RZDu3czi1QBdnUY1v9pNRfRuDP8XbUqyHDv8bQS CUpFHfpJLy6avlFT5siAJ3oZPFyKtj0QW8lcOt/jEhhRbdr7QMGDxCFlKi0CuwboxVa+ 74tw== 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=6Ui/KKts6hzXpXThUGHpIhhDFAZVDf3Sy5e28fKXbEI=; b=XewaotC549VsfqG1pjrq83L0RiyKeTSz2d+4T9u5LK9CLzTVJ1hDAyUOyX8S7xZ9pZ Gx0HT2taEci+Fnft5jthgN1f/qsJyenBpLpqC9Rce+6A1DAJ8YPhxsFZBgq8inbxtfOP BTYHo8Rf7tXKhh0xiMOSXx4rj11++FMPK49WWblUmHVGUoDzgm3tYp4JQv71lhwvrPTh OXP0hkGPW9FEe1HXUpjpDcTplMecbpFuIKjAqYl3D+6yGjcffncs+by6DvdA9W36rEzg nAwVSQB6jfv0QXzhDBcjc4oPEhDkJBej0TZ5rPC07OjHeFUmjfABaGK9F/5h4SKYUb0Q jUhA== X-Gm-Message-State: AElRT7HClwrrPywJ7UC25HJvIyi/l+SGeX88yZLiN22B8OgpTdZaQD6r h8Egz44a94+zo/kRK7UceHpdqg== X-Google-Smtp-Source: AIpwx4/Ph0ioZnmx0nDZKiVzab+paJmg5eJlemhUnARZYuszWOmzdBs2XPjBSCluP1sk37gBWct73Q== X-Received: by 10.99.0.200 with SMTP id 191mr24087330pga.33.1523251533454; Sun, 08 Apr 2018 22:25:33 -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 v7sm24464425pfm.147.2018.04.08.22.25.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Apr 2018 22:25:32 -0700 (PDT) From: Nicholas Piggin <npiggin@gmail.com> To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 1/9] powerpc/powernv: define a standard delay for OPAL_BUSY type retry loops Date: Mon, 9 Apr 2018 15:24:23 +1000 Message-Id: <20180409052431.26405-2-npiggin@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180409052431.26405-1-npiggin@gmail.com> References: <20180409052431.26405-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: 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 7159e1a6a61a..03e1a920491e 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(+)