From patchwork Fri Jul 25 09:40:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shukla X-Patchwork-Id: 34271 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 09BAB235AB for ; Fri, 25 Jul 2014 09:40:59 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id ft15sf25422465pdb.6 for ; Fri, 25 Jul 2014 02:40:59 -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:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=cLnOvgT6TS6cHpe6+PUnei2ToF+HKaGjKz9ITYjVps8=; b=LWSWzktVUQ58Mp7DFiICG61/iEk0b/HzG8EfIIWFdK843U+lJgXmHOk+jMU3kh0EWk x78ReZerDdZzT6e/IBlFt9c8UoDwknsN0o8hMzQDXfB5jUXatJYlGMifS0rVDZtoRuSl iUW1YE6m8rkCmtqnNYdo/pnrI4+/e3pbXIgu3cAfj2fkDe0va2Yg2J7+i5JMkSyANJkV zYQnSrW3Iy9vvM+9RszYBwz29Bl0Ox0kFnlrMUoBUaZzZTmsn8oSY/gbWudn0z1gvXa1 0PFj4npOGEZIFwdjE+q0m0TyyMz0YLtddXl+emnVdW/uVHsQOY6GvDZm9/v53/YmahzJ dk7A== X-Gm-Message-State: ALoCoQn5VJpVlQLkNknYOn8zuracdphJ86fv8uZKJVDPRYwKmhk/5l05mb9+LsQnftHmtADM5eJM X-Received: by 10.66.252.6 with SMTP id zo6mr7578713pac.40.1406281259261; Fri, 25 Jul 2014 02:40:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.169 with SMTP id x38ls1146023qgx.28.gmail; Fri, 25 Jul 2014 02:40:59 -0700 (PDT) X-Received: by 10.221.56.5 with SMTP id wa5mr19121861vcb.25.1406281259109; Fri, 25 Jul 2014 02:40:59 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id yw1si7058525vdb.44.2014.07.25.02.40.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Jul 2014 02:40:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id la4so6840300vcb.23 for ; Fri, 25 Jul 2014 02:40:59 -0700 (PDT) X-Received: by 10.52.248.232 with SMTP id yp8mr131534vdc.83.1406281259037; Fri, 25 Jul 2014 02:40:59 -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.221.37.5 with SMTP id tc5csp24116vcb; Fri, 25 Jul 2014 02:40:58 -0700 (PDT) X-Received: by 10.224.20.136 with SMTP id f8mr20936081qab.104.1406281258563; Fri, 25 Jul 2014 02:40:58 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id 8si15455726qgz.7.2014.07.25.02.40.57 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 25 Jul 2014 02:40:58 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XAbzl-0007ET-Gj; Fri, 25 Jul 2014 09:40:57 +0000 Received: from mail-pd0-f174.google.com ([209.85.192.174]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XAbzf-0007EO-Ee for lng-odp@lists.linaro.org; Fri, 25 Jul 2014 09:40:51 +0000 Received: by mail-pd0-f174.google.com with SMTP id fp1so5370562pdb.5 for ; Fri, 25 Jul 2014 02:40:45 -0700 (PDT) X-Received: by 10.68.219.162 with SMTP id pp2mr17318149pbc.47.1406281244219; Fri, 25 Jul 2014 02:40:44 -0700 (PDT) Received: from santosh-Latitude-E5530-non-vPro.10.0.0.5 ([111.93.218.67]) by mx.google.com with ESMTPSA id z3sm30774542pas.15.2014.07.25.02.40.41 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Jul 2014 02:40:43 -0700 (PDT) From: Santosh Shukla To: lng-odp@lists.linaro.org Date: Fri, 25 Jul 2014 15:10:07 +0530 Message-Id: <1406281207-14534-1-git-send-email-santosh.shukla@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Topics: timers patch Subject: [lng-odp] [PATCH] timer : use timeout hdr in cancel_tmo X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: santosh.shukla@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.220.178 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 This commit (9b8a4bb) introduced timeout_hdr api to get the tick from tmo_buf. Lack of this conversion in odp_timer_cancel_tmo() lead to fail any tmo search in ticklist. It impacted odp_timer.c api_test. ./odp_timer google.com odp_timer_ping.c:106:listen_to_pingack(): cancel_tmo failed ..exiting listner Signed-off-by: Santosh Shukla Signed-off-by: santosh shukla --- platform/linux-generic/odp_timer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index 612e80f..73a690b 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -110,13 +110,16 @@ int odp_timer_cancel_tmo(odp_timer_t timer, odp_timer_tmo_t tmo) int id; uint64_t tick_idx; timeout_t *cancel_tmo; + odp_timeout_hdr_t *tmo_hdr; tick_t *tick; /* get id */ id = timer - 1; + tmo_hdr = odp_timeout_hdr((odp_timeout_t) tmo); /* get tmo_buf to cancel */ - cancel_tmo = (timeout_t *)odp_buffer_addr(tmo); + cancel_tmo = &tmo_hdr->meta; + tick_idx = cancel_tmo->tick; tick = &odp_timer.timer[id].tick[tick_idx];