Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7199276rwl; Thu, 23 Mar 2023 00:19:06 -0700 (PDT) X-Google-Smtp-Source: AK7set/qTnIWnRqjNOxSlQ6WMA6BCb+vjuRHWBecyKM7XH2k8rYBJVFmxJMMHk3yMvl2sWrhJZZY X-Received: by 2002:a17:906:60b:b0:931:bc69:8f94 with SMTP id s11-20020a170906060b00b00931bc698f94mr9119946ejb.45.1679555946607; Thu, 23 Mar 2023 00:19:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679555946; cv=pass; d=google.com; s=arc-20160816; b=hkTvRZtQP82lti6ZfE+BpZ9KM5ZWD1+o9XrlHZG6ofQ74wYl5mmauX3UAYYaTvLc1D LwOwSv5YWOtD57p9z/K/qawFkGUDah39QyPtUTveqVCK+u2hM+0bFaPJcncBMvBJ2j7G 8ffq0687dPcLr1aXwO2SLiRrK2rc7P+gD4d9VDMrMqd9ITiapHeAREJigPAbuM2otVR2 iI6EQI3UA9NWeZB0Do0ZJ86HWaRS0D+rPXcwpUvs3JYkRGRVozrfQ8G9DgUKOBTSqNVW 1YO7JX+3qs8k1/mu7poDDgtpux6EGSwRQL+tvTzWlZLuY2evaEAgAgNbXYtqvt6n07Vo KWGw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=f9XTPVPNEcYcyJlZJIr3Awz8wbJLM4iEX3F5YEbzST4=; b=kr/1VCNFHQ6vZYEfySSwEiaU1nt5hVG7fKKEixiJgDLQ8hLzAp4zy6Ua4IVlCfilqW aMlagr2qclkkozlC/Rx0Pz1B8/p+NYqv5ReBJET9JRzfchZxqSbN38qGokjZbxGrDh3p 1rMi4AA83dbx/0D8ie+oEziwA9nguh2jScdwnbHxOIWT1jXlvZHIXwbydS2I4pudCKNI 0JOl25RjBra1DtQtA73sdlJZF1NLJUM8f+vA85e+JqvFdwjavWQVokDkvhVkxgRfTsDn NlRYX5rk7W+gfklgJZXvGiEITaQ0HdO0Cu1QfuQsjhxJY1U/hvD+rsRSyROb4pMyhYEK yyVg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=WAPyaTO2; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w14-20020a1709064a0e00b00930943f134esi17593273eju.8.2023.03.23.00.18.42; Thu, 23 Mar 2023 00:19:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=WAPyaTO2; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231225AbjCWHDM (ORCPT + 99 others); Thu, 23 Mar 2023 03:03:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231163AbjCWHCx (ORCPT ); Thu, 23 Mar 2023 03:02:53 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2043.outbound.protection.outlook.com [40.107.244.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F6CE23123; Thu, 23 Mar 2023 00:02:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KXKvn20pVmTDaINAholNRjgGy3k2PdE88xASCTGdLS4o+kdcTDuab0EluhEbOdamRfLbcEQZnbsxS1TW/4Naj+1hH2RNzUBtrwqW0mMy3FJa0MYh4p7IRNfEZHfRoUQjrliq6NnXLY1DEiio9ywzKlqAb+2RdSyX10UPVdmIUcAEIb1IFvj8BMEpnQS4SmXahHmFiFISK64UBJ8Q4WK8RsWxDuC4lMlGCgIYa/KEwcF2N66Ct6MBx7havG8IdviiCW81c5si8URMPYvNCUcRpSWueVEtsKdugV1oJNIZiMm+Cd+as2I8mHZCwi4q5ODbl/GWFHUYuXA4yO7qCvQyKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=f9XTPVPNEcYcyJlZJIr3Awz8wbJLM4iEX3F5YEbzST4=; b=BTmh4n3uH2A/eCCMoy6P9dp0s+/2z+BBgFgRyakj/HDh9/i9S5ixg4srJ/FCLw3podClDtezEidkeepFoPzB5ccSs+3Nw0leCZDMULVhojS85tOi0ELoo7dmS4uoiz1CNt3rsVfG+r4xt0QVQMtWqJq+BOeg75WC1j7OkVpZfSyF//lE5ErOBcRhNo049JUavTmSDkZyZSpxmx1MYPRIOpJf6cmoMFk+nlyouhDy/oeKZWtrecexCUeOz9ZWkGLBk63qQBLAOvOQHm5s/9OcR3x2/q26tizgBa7A6yXAdQWmNjntsi765EbmZmhocJuvLhjARV8jNE5nz+rAg2R2eA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f9XTPVPNEcYcyJlZJIr3Awz8wbJLM4iEX3F5YEbzST4=; b=WAPyaTO2EjI+0eptmDxZTh5Ou2naDCQEdAz6YXN9k7VsjsC7LQYlasw3dwROHTbAnasxW1gqwn5+AUiYqA2cniyc9US5iOzIfA24dK9fRvmPZmrusM3zOwH7pCV3eA/nWRyyyTq5Bw3ukxdP3kSxOBbi8iQ1s+zKMFy4iWF40t8= Received: from BYAPR12MB4773.namprd12.prod.outlook.com (2603:10b6:a03:109::17) by SA1PR12MB6970.namprd12.prod.outlook.com (2603:10b6:806:24d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Thu, 23 Mar 2023 07:01:37 +0000 Received: from BYAPR12MB4773.namprd12.prod.outlook.com ([fe80::8709:da90:3d87:cdb2]) by BYAPR12MB4773.namprd12.prod.outlook.com ([fe80::8709:da90:3d87:cdb2%7]) with mapi id 15.20.6178.038; Thu, 23 Mar 2023 07:01:37 +0000 From: "Katakam, Harini" To: Jakub Kicinski CC: "nicolas.ferre@microchip.com" , "davem@davemloft.net" , "richardcochran@gmail.com" , "claudiu.beznea@microchip.com" , "andrei.pistirica@microchip.com" , "edumazet@google.com" , "pabeni@redhat.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Simek, Michal" , "harinikatakamlinux@gmail.com" Subject: RE: [PATCH net-next v2 1/2] net: macb: Enable PTP unicast Thread-Topic: [PATCH net-next v2 1/2] net: macb: Enable PTP unicast Thread-Index: AQHZW/JLtp5le6APU0K50iEquT1KP68H13eAgAAWqtA= Date: Thu, 23 Mar 2023 07:01:37 +0000 Message-ID: References: <20230321124005.7014-1-harini.katakam@amd.com> <20230321124005.7014-2-harini.katakam@amd.com> <20230322222403.39191060@kernel.org> In-Reply-To: <20230322222403.39191060@kernel.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BYAPR12MB4773:EE_|SA1PR12MB6970:EE_ x-ms-office365-filtering-correlation-id: 89a27b34-5ad5-4693-0487-08db2b6c7213 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NfPXjJmLGTRbAMw0AwkbpKwYtATNkQpdTYFYgljWAueEy79SBsPw4InH0UCkNRJKjoeAGZ9bwuq6be0dfIGQeJqhI3QmaoFmqGOn4KrMOU2wj2OuYzPBrZyYsL4X2LZYWfjnSKvd41+cRSh3qim3HN0L5gaSyGM8WQCkrH59hYw1xFAJ/ov47GLB+0+7Wfo0Y4rVDn9MYraEoBup/c9PE5PgaMMi5FhB9/D+tNN/8FPGvKMQy83dPGiuqueHi4hhZDmJzfu21GjJ8gHfUyhukAO/UNuVINZ8leMAqV7lsBLmoG/a4/iGkXe+396sZr/PlfYOoadWpCf0imu4Jo88hgcmLtDaqPAia02FWGhKr7cSlPN6DnV7irrn05Qnfzsm32y/F/a8RiyWOcYb8S0jKGVsP6qFLRTQhBc6TnaHDHHKlLHVDNFh0h5s/BrsRLOBgKLHVIEvfv08xfXCBVn7kEqTWI1kyAhAr70QVEnG+egFpAI4BeuvdVESc8d1bo75IsREDrD2VSHWFbgmzBWTw3lnF+/GRPdPTJc3ZN8fEwip1DNEMTcKp+35aSoMt2riupE2sqKKmkiF1k3hMOVoWbfdbAffeKfDqRToOg5poLkKpa/LpDNIurJz9tPCu/uD8DW3XMUi59GrLjvKePoTgZozmKb40b8shNH26+utZaz42P6rzxhx3FY8SoLJ720xZi9sYK1PWoGNz7dBlABSsQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB4773.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(366004)(136003)(376002)(396003)(346002)(451199018)(316002)(66946007)(6916009)(7696005)(76116006)(478600001)(66446008)(122000001)(64756008)(2906002)(4326008)(52536014)(8676002)(86362001)(83380400001)(66476007)(66556008)(33656002)(7416002)(186003)(71200400001)(38100700002)(41300700001)(54906003)(38070700005)(5660300002)(6506007)(26005)(8936002)(53546011)(9686003)(55016003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?bqqBN4lXhhhrk6jQDt/7GLMCbAG77CozjwrU5Mwv2CYk25kBBvgkefrsW329?= =?us-ascii?Q?7RlVTItVWHacQ4fo8FsuuwRFyUPLAUY7fBynJsRcwTw5nYLOUlCNJcxqEpRd?= =?us-ascii?Q?bOY13YQ2yjxYClWTIrp87jnGhO96DWAyq4kdZsHK4m2+xR1xztUO9uif5wID?= =?us-ascii?Q?o9/KaoMv+ZvLQKVkvZsEIyh4QaZ1TdV25uwAXzrm5ViFRnwPTuAhPXlVzA8u?= =?us-ascii?Q?F0hmgDu3sr6nggWyTcbh/yjpydic3J8M6+Pr9rSQV1hkOqaZltxyiMks98pj?= =?us-ascii?Q?7+j/z0+d3VTjr2txf2djLOmrfsHStEr050an8zz0rDNEoNqpnrBAJZu8+9zC?= =?us-ascii?Q?JdyuwdpYceFJIUFu2ZexTz3zrB+sYOfHQTVBF3EmTpe0fLBnZs/1R6CtcL6c?= =?us-ascii?Q?vHqO2hocFQpMSH9IWHU0vD5Gdo7FTttaVAGFtrmQird5x4KMloox9Lm4370v?= =?us-ascii?Q?XucF8KSm7ozzmy4C3pCvF9vXkoGG+qIBsw7daQ/O+g7s3Alf+8SU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HsO/IgotUfvaybPYLvreIQAp4oL2snLc?= =?us-ascii?Q?hJ00rGCZ7CwBP9xEhUc5ZJmmsUIElNoAuZaY8lPVekmR3vzcXcQGmcQcgorf?= =?us-ascii?Q?NHuRv/2gfEXi1SEdEnyfMNrCuD/a8Zeo+8MD4YmMcriYGK12Q1jLtYpOlK8J?= =?us-ascii?Q?rHB6R+E8T74Hg04hkhQ=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB4773.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89a27b34-5ad5-4693-0487-08db2b6c7213 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Mar 2023 07:01:37.3212 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: yxAD6+LUlL2zRO+zuDkaRy7tMJZBWr8B/WQ6kbXktwteJbSlo28agx1dQI46/b5u X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6970 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jakub, > -----Original Message----- > From: Jakub Kicinski > Sent: Thursday, March 23, 2023 10:54 AM > To: Katakam, Harini > Cc: nicolas.ferre@microchip.com; davem@davemloft.net; > richardcochran@gmail.com; claudiu.beznea@microchip.com; > andrei.pistirica@microchip.com; edumazet@google.com; > pabeni@redhat.com; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; > Simek, Michal ; harinikatakamlinux@gmail.com > Subject: Re: [PATCH net-next v2 1/2] net: macb: Enable PTP unicast >=20 > On Tue, 21 Mar 2023 18:10:04 +0530 Harini Katakam wrote: > > +#ifdef CONFIG_MACB_USE_HWSTAMP > > + if (gem_has_ptp(bp)) { > > + gem_writel(bp, RXPTPUNI, bottom); > > + gem_writel(bp, TXPTPUNI, bottom); > > + } > > +#endif >=20 > You can use the same IS_ENABLED() trick here as you used in the if () > below, to avoid the direct preprocessor use. In fact why not just > add the IS_ENABLED(CONFIG_MACB_USE_HWSTAMP) to the condition inside > gem_has_ptp() ? It looks like all callers want that extra check. Thanks for the suggestion. I believe gem_has_ptp was originally defined for checking device capability (Atmel/SiFive/AMD) and CONFIG_MACB_USE_HWSTAMP for the kernel selection but I agree that there is currently no usecase for a=20 scenario where gem_has_ptp is TRUE and MACB_USE_HWSTAMP is false. If hear are no objections, I'll include this check inside gem_has_ptp and send= v3. Regards, Harini