From patchwork Wed Jun 24 16:36:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 50290 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B580B21575 for ; Wed, 24 Jun 2015 16:36:49 +0000 (UTC) Received: by laka10 with SMTP id a10sf12392221lak.2 for ; Wed, 24 Jun 2015 09:36:48 -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: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=uyAlCLAJWaZW4EfvXoMsP8EI6ukxkCNQZqF9FxcA/8U=; b=lYfz653ujywUQYQgjk9PU8m6gaa0s+qywMskGwHAJxZSENilFH1GCRTfDfQLq8o3zv /JC74RZeo9a5LwoDODptBDis9uJxUrA/D/Tt3Z4qmF4Cgh13Bniq4rwwnpQque1EbkKj aoKFauznJq/4mJR/dEjeuvCTgaxHXPIuSQrfwMmdCXeQHWcazRDKB9TOowUXSj7cCbtc KRMZJcDZx6vxFoms2RSL4wiQ6qnTDmG1yYzJZEVTMnXBBg5yFxDTsc+m7a+EBpMT4yhs YHhH8WIBTkmtGGx+HaP9lTJkOwRuc1JlKubmeOItqwiV5JY+WYOwsq6U0E8GobT4S0hG Yy7w== X-Gm-Message-State: ALoCoQndhfsfF16mS4yVcZOchEUGcloRIhTGLR7acshGd7vYgeBk3Gya15+2nzceUUxrUdoIJQK4 X-Received: by 10.152.27.130 with SMTP id t2mr36601645lag.2.1435163808624; Wed, 24 Jun 2015 09:36:48 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.138 with SMTP id am10ls194952lac.67.gmail; Wed, 24 Jun 2015 09:36:48 -0700 (PDT) X-Received: by 10.112.122.9 with SMTP id lo9mr41213302lbb.104.1435163808478; Wed, 24 Jun 2015 09:36:48 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id wj6si22426989lbb.87.2015.06.24.09.36.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jun 2015 09:36:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lagx9 with SMTP id x9so29524421lag.1 for ; Wed, 24 Jun 2015 09:36:48 -0700 (PDT) X-Received: by 10.152.7.7 with SMTP id f7mr41351961laa.106.1435163808245; Wed, 24 Jun 2015 09:36:48 -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.108.230 with SMTP id hn6csp26785lbb; Wed, 24 Jun 2015 09:36:47 -0700 (PDT) X-Received: by 10.140.80.170 with SMTP id c39mr52957707qgd.55.1435163806931; Wed, 24 Jun 2015 09:36:46 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f5si26302831qhc.72.2015.06.24.09.36.45; Wed, 24 Jun 2015 09:36:46 -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 422E56203F; Wed, 24 Jun 2015 16:36:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 4D7B66201D; Wed, 24 Jun 2015 16:36:41 +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 3201C62033; Wed, 24 Jun 2015 16:36:38 +0000 (UTC) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com [209.85.217.175]) by lists.linaro.org (Postfix) with ESMTPS id EC23D6200C for ; Wed, 24 Jun 2015 16:36:36 +0000 (UTC) Received: by lbnk3 with SMTP id k3so29873129lbn.1 for ; Wed, 24 Jun 2015 09:36:35 -0700 (PDT) X-Received: by 10.152.1.40 with SMTP id 8mr41714508laj.56.1435163794992; Wed, 24 Jun 2015 09:36:34 -0700 (PDT) Received: from khorivan.itg.ti.com ([195.238.92.128]) by mx.google.com with ESMTPSA id w9sm6461042laj.21.2015.06.24.09.36.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Jun 2015 09:36:33 -0700 (PDT) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Wed, 24 Jun 2015 19:36:16 +0300 Message-Id: <1435163776-29778-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: timers patch Subject: [lng-odp] [PATCH v2] linux-generic: timer: set timer queue to ODP_QUEUE_INVALID on init 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.42 as permitted sender) smtp.mail=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 set_next_free() checks if timer queue is not set, that is ODP_QUEUE_INVALID. In case of linux-generic the invalid queue handle is 0. By coincidence, after allocation, the timer queue handle is also 0, by this way the ODP_ASSERT is masked. In case ODP_QUEUE_INVALID is another from 0 the test generates error. It's not correct, the code shouldn't have such kind dependency from macro definition, and it prevents to re-use this code for another platforms with different ODP_QUEUE_INVALID. So, fix it. Reviewed-by: Ola Liljedahl Signed-off-by: Ivan Khoronzhuk --- platform/linux-generic/odp_timer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index e5391dc..bd1b778 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -238,6 +238,7 @@ static odp_timer_pool *odp_timer_pool_new( /* Initialize all odp_timer entries */ uint32_t i; for (i = 0; i < tp->param.num_timers; i++) { + tp->timers[i].queue = ODP_QUEUE_INVALID; set_next_free(&tp->timers[i], i + 1); tp->timers[i].user_ptr = NULL; odp_atomic_init_u64(&tp->tick_buf[i].exp_tck, TMO_UNUSED);