From patchwork Thu Sep 10 09:48:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 53376 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 0344522B19 for ; Thu, 10 Sep 2015 09:49:25 +0000 (UTC) Received: by lbbti1 with SMTP id ti1sf11875721lbb.3 for ; Thu, 10 Sep 2015 02:49:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=V9470+QgnXaEUSXLR1kY5zbdxafG0eYAd5eG2Z8Z76Q=; b=SiuVL/n4O98CYYk8w/pMbCER2b+Qr7Dllz7oNM/9Ulek1PZp24+yquyx3uzOY8O3Nk Xd2rjGLvgHJ9MwlcXXujXoWhr5w8q29TP4MAw8bg9klnu37hJSPxBTUNJmxo93af1Elj TlLBUSQCzK76P8VcPUpS3n9Eou+jC5gdOBc49XyniKKhyzQXP9AigB6PUYCi3kvQWxyv Sdc0It8Rqi0YmFNwaH11ro3hWJR2aTq2YpsZg+u9zi7q1ORyHVI7xrpYpetqbBUuUtd4 SpDIUEYJnTEhnOs+/6ZFAjfhqGMJDloMj1q9bC84qtsjbz3IMWJ08DIytrFpK65cV2ee IGGw== X-Gm-Message-State: ALoCoQkftq7MWh4jDVhl1HkvpizcJg9gwy1I6PRYUWjAK5icWdpT3hN5AOnsp+imd3BQD9SdOMVi X-Received: by 10.112.78.101 with SMTP id a5mr9666127lbx.9.1441878563935; Thu, 10 Sep 2015 02:49:23 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.170 with SMTP id c10ls176707lah.14.gmail; Thu, 10 Sep 2015 02:49:23 -0700 (PDT) X-Received: by 10.112.161.232 with SMTP id xv8mr34626035lbb.123.1441878563754; Thu, 10 Sep 2015 02:49:23 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id y4si7928987lag.0.2015.09.10.02.49.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Sep 2015 02:49:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by laeb10 with SMTP id b10so24556376lae.1 for ; Thu, 10 Sep 2015 02:49:23 -0700 (PDT) X-Received: by 10.112.235.130 with SMTP id um2mr34924588lbc.72.1441878563634; Thu, 10 Sep 2015 02:49:23 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp850058lbq; Thu, 10 Sep 2015 02:49:22 -0700 (PDT) X-Received: by 10.140.98.213 with SMTP id o79mr50550597qge.19.1441878562340; Thu, 10 Sep 2015 02:49:22 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 79si12597834qku.67.2015.09.10.02.49.21; Thu, 10 Sep 2015 02:49:22 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 6141B61D23; Thu, 10 Sep 2015 09:49:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id B727C61A55; Thu, 10 Sep 2015 09:48:54 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 9396F61A1F; Thu, 10 Sep 2015 09:48:51 +0000 (UTC) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by lists.linaro.org (Postfix) with ESMTPS id C5D2B619EF for ; Thu, 10 Sep 2015 09:48:50 +0000 (UTC) Received: by wicfx3 with SMTP id fx3so16258802wic.0 for ; Thu, 10 Sep 2015 02:48:50 -0700 (PDT) X-Received: by 10.194.203.74 with SMTP id ko10mr58078954wjc.72.1441878530041; Thu, 10 Sep 2015 02:48:50 -0700 (PDT) Received: from khorivan.synapse.com ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id s9sm14710378wjy.16.2015.09.10.02.48.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Sep 2015 02:48:48 -0700 (PDT) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org, petri.savolainen@nokia.com, nmorey@kalray.eu Date: Thu, 10 Sep 2015 12:48:41 +0300 Message-Id: <1441878522-19505-2-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441878522-19505-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1441878522-19505-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Subject: [lng-odp] [Patch 1/2] linux-generic: odp_schedule: fix odp_schdule_wait_time X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ivan.khoronzhuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The resolution of schedule time can be more than 1ns. As result can happen that 1ns corresponds 0 ticks of timer counter, but if passed 1ns it's obvious that user wanted to schedule at least once. Currently it can lead to wait forever, as 0 corresponds to ODP_SCHED_WAIT, it can block program flow at all. Also ODP_SCHED_NO_WAIT corresponds to 1 tick, it's rarely but can wait a little, when shced time has slower rate. It should correspond to schedule only once. So, change ODP_SCHED_NO_WAIT to 0 and ODP_SCHED_NO_WAIT to UINT64_MAX. Signed-off-by: Ivan Khoronzhuk --- platform/linux-generic/include/odp/plat/schedule_types.h | 4 ++-- platform/linux-generic/odp_schedule.c | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/platform/linux-generic/include/odp/plat/schedule_types.h b/platform/linux-generic/include/odp/plat/schedule_types.h index c48b652..8cdc40b 100644 --- a/platform/linux-generic/include/odp/plat/schedule_types.h +++ b/platform/linux-generic/include/odp/plat/schedule_types.h @@ -22,8 +22,8 @@ extern "C" { * @{ */ -#define ODP_SCHED_WAIT 0 -#define ODP_SCHED_NO_WAIT 1 +#define ODP_SCHED_WAIT UINT64_MAX +#define ODP_SCHED_NO_WAIT 0 typedef int odp_schedule_prio_t; diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index c6619e5..827fcf0 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -646,9 +646,6 @@ void odp_schedule_resume(void) uint64_t odp_schedule_wait_time(uint64_t ns) { - if (ns <= ODP_SCHED_NO_WAIT) - ns = ODP_SCHED_NO_WAIT + 1; - return odp_time_ns_to_cycles(ns); }