Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034095AbcJ0OnL (ORCPT ); Thu, 27 Oct 2016 10:43:11 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:55136 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S941951AbcJ0OnI (ORCPT ); Thu, 27 Oct 2016 10:43:08 -0400 Subject: Re: [PATCH (net.git) 2/3] stmmac: fix PTP support for GMAC4 To: Rayagond Kokatanur References: <1477464964-5960-1-git-send-email-peppe.cavallaro@st.com> <1477464964-5960-3-git-send-email-peppe.cavallaro@st.com> CC: netdev , , Richard Cochran , , From: Giuseppe CAVALLARO Message-ID: <743ffe4a-2c8f-e5f7-f93c-6be16a8a0350@st.com> Date: Thu, 27 Oct 2016 12:32:46 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.52.139.54] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-27_06:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 877 Lines: 23 Hello Rayagond ! On 10/27/2016 12:25 PM, Rayagond Kokatanur wrote: >> +static int dwmac4_wrback_get_rx_timestamp_status(void *desc, u32 ats) >> > { >> > struct dma_desc *p = (struct dma_desc *)desc; >> > + int ret = -EINVAL; >> > + >> > + /* Get the status from normal w/b descriptor */ >> > + if (likely(p->des3 & TDES3_RS1V)) { >> > + if (likely(p->des1 & RDES1_TIMESTAMP_AVAILABLE)) { >> > + int i = 0; >> > + >> > + /* Check if timestamp is OK from context descriptor */ >> > + do { >> > + ret = dwmac4_rx_check_timestamp(desc); > Here, "desc" is not pointing to next descriptor (ie context > descriptor). Driver should check the context descriptor. you are right and this is done by the caller: stmmac_get_rx_hwtstamp Cheers peppe