From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C366C43381 for ; Thu, 14 Feb 2019 15:56:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 359CB222DA for ; Thu, 14 Feb 2019 15:56:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404870AbfBNP4V (ORCPT ); Thu, 14 Feb 2019 10:56:21 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:23072 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725976AbfBNP4V (ORCPT ); Thu, 14 Feb 2019 10:56:21 -0500 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1EFVCSo024967; Thu, 14 Feb 2019 16:56:07 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2qmxr741fh-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 14 Feb 2019 16:56:07 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 52C2E31; Thu, 14 Feb 2019 15:56:07 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag3node2.st.com [10.75.127.8]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 3299858A3; Thu, 14 Feb 2019 15:56:07 +0000 (GMT) Received: from [10.201.21.58] (10.75.127.47) by SFHDAG3NODE2.st.com (10.75.127.8) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 14 Feb 2019 16:56:07 +0100 Subject: Re: [net-next, PATCH] net: stmmac: use correct define to get rx timestamp on GMAC4 To: Jose Abreu , Giuseppe Cavallaro , CC: , , , References: <1550153571-14404-1-git-send-email-alexandre.torgue@st.com> <7c03dff4-5185-dbd2-eeb4-867972512f2b@synopsys.com> <478975ee-2254-96f2-be45-ab4e9539ad08@synopsys.com> From: Alexandre Torgue Message-ID: <9cfeff02-0bee-d15b-89f9-c75420c4f5eb@st.com> Date: Thu, 14 Feb 2019 16:56:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <478975ee-2254-96f2-be45-ab4e9539ad08@synopsys.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG3NODE2.st.com (10.75.127.8) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-14_07:,, signatures=0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2/14/19 4:30 PM, Jose Abreu wrote: > On 2/14/2019 3:00 PM, Alexandre Torgue wrote: >> Hi Jose >> >> On 2/14/19 3:18 PM, Jose Abreu wrote: >>> Hi Alexandre, >>> >>> On 2/14/2019 2:12 PM, Alexandre Torgue wrote: >>>> In dwmac4_wrback_get_rx_timestamp_status we looking for a RX >>>> timestamp. >>>> For that receive descriptors are handled and so we should use >>>> defines >>>> related to receive descriptors. It'll no change the functional >>>> behavior >>>> as RDES3_RDES1_VALID=TDES3_RS1V=BIT(26) but it makes code >>>> easier to read. >>>> >>>> Signed-off-by: Alexandre Torgue >>>> >>>> diff --git >>>> a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c >>>> b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c >>>> index 20299f6..9f062b3 100644 >>>> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c >>>> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c >>>> @@ -268,7 +268,7 @@ static int >>>> dwmac4_wrback_get_rx_timestamp_status(void *desc, void >>>> *next_desc, >>>>       int ret = -EINVAL; >>>>         /* Get the status from normal w/b descriptor */ >>>> -    if (likely(p->des3 & TDES3_RS1V)) { >>>> +    if (likely(p->des3 & RDES3_RDES1_VALID)) { >>> >>> Shouldn't this also use le32_to_cpu() like bellow ? >> >> I agree. I focused on cosmetic but yes you are right, we have to >> take car about endianness as this IP is used by different >> processors (using different endianness). I gonna send a v2. >> I think dwmac4_rx_check_timestamp have the same kind of issue. >> Another patch should be sent for it. no ? > > Yeah. Maybe you can send all of that in this v2 patch also ? I'll send another one separately, in order to have a correct commit header. I send it now. > > Thanks, > Jose Miguel Abreu > >> >> regards >> Alex >> >> >> >>> >>> Thanks, >>> Jose Miguel Abreu >>> >>>>           if (likely(le32_to_cpu(p->des1) & >>>> RDES1_TIMESTAMP_AVAILABLE)) { >>>>               int i = 0; >>>>