Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/27653/?format=api
{ "id": 27653, "url": "http://patchwork.ozlabs.org/api/patches/27653/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20090526123406.17472.79948.stgit@terra/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<20090526123406.17472.79948.stgit@terra>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20090526123406.17472.79948.stgit@terra/", "date": "2009-05-26T12:34:06", "name": "[V5,1/5] powerpc: introduce macro spin_event_timeout()", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": true, "hash": "2ca446c7c72768610518ee3a90581a95675a466e", "submitter": { "id": 375, "url": "http://patchwork.ozlabs.org/api/people/375/?format=api", "name": "jonsmirl@gmail.com", "email": "jonsmirl@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20090526123406.17472.79948.stgit@terra/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/27653/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/27653/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org>", "X-Original-To": [ "patchwork-incoming@bilbo.ozlabs.org", "linuxppc-dev@ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "patchwork-incoming@ozlabs.org", "linuxppc-dev@ozlabs.org" ], "Received": [ "from ozlabs.org (ozlabs.org [203.10.76.45])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(Client CN \"mx.ozlabs.org\",\n\tIssuer \"CA Cert Signing Authority\" (verified OK))\n\tby bilbo.ozlabs.org (Postfix) with ESMTPS id CCC59B7067\n\tfor <patchwork-incoming@bilbo.ozlabs.org>;\n\tTue, 26 May 2009 22:36:06 +1000 (EST)", "by ozlabs.org (Postfix)\n\tid 72E0BDE69D; Tue, 26 May 2009 22:35:01 +1000 (EST)", "from ozlabs.org (localhost [127.0.0.1])\n\tby ozlabs.org (Postfix) with ESMTP id 711AFDE69C\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 26 May 2009 22:35:01 +1000 (EST)", "from mail-gx0-f220.google.com (mail-gx0-f220.google.com\n\t[209.85.217.220]) by ozlabs.org (Postfix) with ESMTP id D42F6DE081\n\tfor <linuxppc-dev@ozlabs.org>; Tue, 26 May 2009 22:34:10 +1000 (EST)", "by gxk20 with SMTP id 20so2687605gxk.9\n\tfor <linuxppc-dev@ozlabs.org>; Tue, 26 May 2009 05:34:08 -0700 (PDT)", "by 10.90.25.11 with SMTP id 11mr7359618agy.2.1243341248576;\n\tTue, 26 May 2009 05:34:08 -0700 (PDT)", "from terra (c-76-109-159-38.hsd1.fl.comcast.net [76.109.159.38])\n\tby mx.google.com with ESMTPS id 32sm16867585aga.4.2009.05.26.05.34.07\n\t(version=TLSv1/SSLv3 cipher=RC4-MD5);\n\tTue, 26 May 2009 05:34:08 -0700 (PDT)", "from localhost ([127.0.0.1] helo=[127.0.1.1])\n\tby terra with esmtp (Exim 4.69) (envelope-from <jonsmirl@gmail.com>)\n\tid 1M8vr4-0004ZD-8s; Tue, 26 May 2009 08:34:06 -0400" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; \n\th=domainkey-signature:received:received:received:subject:to:from:date\n\t:message-id:in-reply-to:references:user-agent:mime-version\n\t:content-type:content-transfer-encoding;\n\tbh=5lTuEKNNWXfGlT3eQlk6UxpIII8i5zCHtfrZhDccILU=;\n\tb=UDXTb7/AT3f3QuU5F0j/trq01HcUgt/IkLhTE6Fyk679xEEdaixHCBcn/jgxvjMSE0\n\tmDAsFvKxz3PcVHf5PB3i2kT7qWE5MWgv0C9HT7CFPG+sokLyaWlSRqjCBhR6UBy5yJWl\n\tDeXWBsjK2s7DNougNglZV02dPNMJANZ06be3k=", "DomainKey-Signature": "a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\n\th=subject:to:from:date:message-id:in-reply-to:references:user-agent\n\t:mime-version:content-type:content-transfer-encoding;\n\tb=hFay1AIv6VrCn/1AuAhhc8Tke7Vkvt86UX7Pa50lI+X8kjdFh2hlk2B/EFG9qxkV4g\n\tF9lFa+Uu/pmWs+cl40FqL50IFBFIy2gTijEN4bpvPmVmV4OfZw2vh9s/X9+z+nX9LIp7\n\ttSGOLQOMxXtIldHGspkAO569prhZ+1GOl7FUg=", "Subject": "[PATCH V5 1/5] powerpc: introduce macro spin_event_timeout()", "To": "grant.likely@secretlab.ca, linuxppc-dev@ozlabs.org,\n\talsa-devel@alsa-project.org, broonie@sirena.org.uk, timur@freescale.com", "From": "Jon Smirl <jonsmirl@gmail.com>", "Date": "Tue, 26 May 2009 08:34:06 -0400", "Message-ID": "<20090526123406.17472.79948.stgit@terra>", "In-Reply-To": "<20090526123235.17472.73912.stgit@terra>", "References": "<20090526123235.17472.73912.stgit@terra>", "User-Agent": "StGit/0.14.3.366.gf979", "MIME-Version": "1.0", "X-BeenThere": "linuxppc-dev@ozlabs.org", "X-Mailman-Version": "2.1.11", "Precedence": "list", "List-Id": "Linux on PowerPC Developers Mail List <linuxppc-dev.ozlabs.org>", "List-Unsubscribe": "<https://ozlabs.org/mailman/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://ozlabs.org/pipermail/linuxppc-dev>", "List-Post": "<mailto:linuxppc-dev@ozlabs.org>", "List-Help": "<mailto:linuxppc-dev-request@ozlabs.org?subject=help>", "List-Subscribe": "<https://ozlabs.org/mailman/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org", "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org" }, "content": "The macro spin_event_timeout() takes a condition and timeout value\n(in microseconds) as parameters. It spins until either the condition is true\nor the timeout expires. It returns the result of the condition when the loop\nwas terminated.\n\nThis primary purpose of this macro is to poll on a hardware register until a\nstatus bit changes. The timeout ensures that the loop still terminates if the\nbit doesn't change as expected. This macro makes it easier for driver\ndevelopers to perform this kind of operation properly.\n\nSigned-off-by: Timur Tabi <timur@freescale.com>\n---\n arch/powerpc/include/asm/delay.h | 33 +++++++++++++++++++++++++++++++++\n 1 files changed, 33 insertions(+), 0 deletions(-)", "diff": "diff --git a/arch/powerpc/include/asm/delay.h b/arch/powerpc/include/asm/delay.h\nindex f9200a6..af4a270 100644\n--- a/arch/powerpc/include/asm/delay.h\n+++ b/arch/powerpc/include/asm/delay.h\n@@ -2,8 +2,11 @@\n #define _ASM_POWERPC_DELAY_H\n #ifdef __KERNEL__\n \n+#include <asm/time.h>\n+\n /*\n * Copyright 1996, Paul Mackerras.\n+ * Copyright (C) 2009 Freescale Semiconductor, Inc. All rights reserved.\n *\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n@@ -30,5 +33,35 @@ extern void udelay(unsigned long usecs);\n #define mdelay(n)\tudelay((n) * 1000)\n #endif\n \n+/**\n+ * spin_event_timeout - spin until a condition gets true or a timeout elapses\n+ * @condition: a C expression to evalate\n+ * @timeout: timeout, in microseconds\n+ * @delay: the number of microseconds to delay between eache evaluation of\n+ * @condition\n+ * @rc: the last value of the condition\n+ *\n+ * The process spins until the condition evaluates to true (non-zero) or the\n+ * timeout elapses. Upon exit, @rc contains the value of the condition. This\n+ * allows you to test the condition without incurring any side effects.\n+ *\n+ * This primary purpose of this macro is to poll on a hardware register\n+ * until a status bit changes. The timeout ensures that the loop still\n+ * terminates even if the bit never changes. The delay is for devices that\n+ * need a delay in between successive reads.\n+ *\n+ * gcc will optimize out the if-statement if @delay is a constant.\n+ */\n+#define spin_event_timeout(condition, timeout, delay, rc) \\\n+{ \\\n+\tunsigned long __loops = tb_ticks_per_usec * timeout; \\\n+\tunsigned long __start = get_tbl(); \\\n+\twhile (!(rc = (condition)) && (tb_ticks_since(__start) <= __loops)) \\\n+\t\tif (delay) \\\n+\t\t\tudelay(delay); \\\n+\t\telse\t \\\n+\t\t\tcpu_relax(); \\\n+}\n+\n #endif /* __KERNEL__ */\n #endif /* _ASM_POWERPC_DELAY_H */\n", "prefixes": [ "V5", "1/5" ] }