Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp843925lqo; Fri, 17 May 2024 03:23:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUQ16D2ckwd29IoJGehNVaaQ1mGdqTqERgETp7YpGsG7ov1ynWmGFcX95IIDjd9FkBLzL5jesb+ky+0mbiZPtyNybvHfvAutgBsCBfJrA== X-Google-Smtp-Source: AGHT+IHTDGSKSJQJO3Dw6FeLBpSiEPZLezAYTrSi7Edd54T1/veAxI8ymgQjKAaVbVeEEFAabbYy X-Received: by 2002:a05:6a21:1519:b0:1b0:2453:4261 with SMTP id adf61e73a8af0-1b024534486mr6319566637.26.1715941423670; Fri, 17 May 2024 03:23:43 -0700 (PDT) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6574afdde2dsi4197473a12.837.2024.05.17.03.23.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 03:23:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181990-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=WDBaXX62; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-181990-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181990-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 4EF9DB22F58 for ; Fri, 17 May 2024 10:23:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04AF3374DB; Fri, 17 May 2024 10:23:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="WDBaXX62" Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2051.outbound.protection.outlook.com [40.107.21.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 173CC3A1AB; Fri, 17 May 2024 10:23:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.51 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715941396; cv=fail; b=lgNJtCF2FYOoMIouUGa5OiMsLg5ooFKSQu6ma8rkLdGHFLTecjy+V1Ih03i80T+L8DeVsv402RsjjiPCE5zXHS/o3nY8J6ZjGc+LSU8gvXwiImJqKkGa3R7hMtCwXbTo6WJKiwy4I56RiCUu4+DBVxjX+h8mgGTNGP8/OOr0PV8= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715941396; c=relaxed/simple; bh=UUwT+yA6AG+t65iZUFDA3kycWLg9C+vVUPKjjxh8fhk=; h=Date:From:To:Cc:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=HF5bRaTziakxyFzg5pikCVC8jWJF1Xg58RjtywDklzgOrYGPbEx8nDEk6/bcUtQ19fpDJWLSqXMuKqMGN4SWkrTDYubPNhzrLKSTDnbZbIg9hFUHM5mmAGDRVFCrx2DhBJKvhyCxkUHvsVaRpUD03ePPfACjxukk6OtWKz1ARRk= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=WDBaXX62; arc=fail smtp.client-ip=40.107.21.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zonf2Kkd79oL6iB1gJ6uZlXDVtsMw8oS7UAhHTfBaNuvaXoXDiqwEDffI+0kjH/h61yd2RCmJWpI5jHE3UefHLryJgn4AwZY6467Uj9ElP3hJFNKh//0Rk8LrOHhXIW5WgsYPVCeo4IXxGPNvZKPOvQ5NrWLZPwnNhJpLWFPUMdMk5Ovk23DLErpY1WLC4RsNU4q9hLRmq1MGBryoQav1JzWtIAFYwW81OMO2eW/jihkWcpFwmt6pX8DuLUS9ZdmeNkd62aoXCTcXrpTMLMFfjmdgLmVyGL3y5d6SfCnEmb+fWleAE8kW3U38fZOUmnpGVDfMTM6sTvtIA7yirqYEQ== 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=mjo/fUcg5KjlEdOh8m5tryC4RCNfN3lXO7kjC8cicO8=; b=mvVWOljdDQqYQEuzQ9RACRroSuGtHODNvgenYtNdIZnuZJ+gzaeM/kUMB+CzRc9m8kpdgBBsdhaKBNxLmSS4N1CrHrl+xUKbg9Tju7HdScSC8Crj9ZNAoit1mCnG3gvmovD3LogPv8whcIFFfdSjAaMmspjoW08F9A31dDwHA4qfwgRgS2ha3QoEW/7Mu9X9inkNwMkPNhjsTi8vMiYMlMYdd+9kDn4n0eyoUYt0qReI1oRfX+88tK8Dw5emzRHbEvw1cGjBVs4ycfdcrzOSJmAfU2ASkaKhT9qqacx5Mbgpd2Xl9wEBzQvnN2Gx5VrcpkboDKnkHt5WO6cArQuYSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mjo/fUcg5KjlEdOh8m5tryC4RCNfN3lXO7kjC8cicO8=; b=WDBaXX62itvOWKPLpc0fcNoff/DSHuvs5tnHaFNLjmesdTnBrDjfIFb7I/VBJ6JFzgYEpkXSBuh5PAt5gdKc4Jby1bCYC8iNUJt/zyikdUuX9DKq/tSgAdkjP7o2+T7dMR26XzaDajx6Vg543RrNLVKQkpCRSYG4d06Gnb+hLjs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB7374.eurprd04.prod.outlook.com (2603:10a6:800:1ac::11) by VI2PR04MB10666.eurprd04.prod.outlook.com (2603:10a6:800:27f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.45; Fri, 17 May 2024 10:23:11 +0000 Received: from VE1PR04MB7374.eurprd04.prod.outlook.com ([fe80::1a84:eeb0:7353:4b87]) by VE1PR04MB7374.eurprd04.prod.outlook.com ([fe80::1a84:eeb0:7353:4b87%3]) with mapi id 15.20.7587.028; Fri, 17 May 2024 10:23:10 +0000 Date: Fri, 17 May 2024 13:23:07 +0300 From: Vladimir Oltean To: Horatiu Vultur Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com, jacob.e.keller@intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com Subject: Re: [PATCH net] net: lan966x: Remove ptp traps in case the ptp is not enabled. Message-ID: <20240517102307.7we5psrgbf56mden@skbuf> References: <20240514193500.577403-1-horatiu.vultur@microchip.com> <20240514222149.mhwtp3kduebb4zzs@skbuf> <20240516064855.ne6uf3xanns4hh2o@DEN-DL-M31836.microchip.com> <20240517100425.l5ddxbuyxbgx42ti@skbuf> <20240517101811.vsqcg7moapixlfpj@DEN-DL-M31836.microchip.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240517101811.vsqcg7moapixlfpj@DEN-DL-M31836.microchip.com> X-ClientProxiedBy: VI1PR0202CA0032.eurprd02.prod.outlook.com (2603:10a6:803:14::45) To VE1PR04MB7374.eurprd04.prod.outlook.com (2603:10a6:800:1ac::11) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB7374:EE_|VI2PR04MB10666:EE_ X-MS-Office365-Filtering-Correlation-Id: af451ed2-83ec-448a-a0e4-08dc765b5a22 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|7416005|366007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?bXeMJi92PrP/nfw/xiqc2Z0ODSQMETFX2EQQ2MTxivqn0MLnrLemS1j9Vd5O?= =?us-ascii?Q?WDxCdZvDxgTPRYAHjjdJtcnfLWaMf5Yb9MIkEVZLTmAD/rZcTSMytYQzuvdO?= =?us-ascii?Q?siEI2fOJednNZce8Uc8O5zRAGDGNfKuV08TV/kFem3LsARhMlRWYKj4baYM1?= =?us-ascii?Q?lzOZY2vtz/zfS9CfQQt8qsdmv0Q+Fylpy9DOg+ij5jg36Aj1q6OpIxcpSSWr?= =?us-ascii?Q?8B++oknSoixUgoCiRmE7LEbkdr71VqndpDFMrQZV733PH1gyKmc5xKSyvtaY?= =?us-ascii?Q?nh8An6tch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LDkvGi9?= =?us-ascii?Q?k8hFvir4AZjBcC+csX2wkISFq+W84/xmgL56X3b6O3j1YiZdD0XUzeMAbaef?= =?us-ascii?Q?OCXRBge3oGYVFcdMqUNlrPW8x8UcT0EnApRT1LPr/g=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB7374.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005)(7416005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?IduCMwFrPAwbWHYy+3VxWdrlkG9ZfE7/Eqm0oFzuafFCFxwVVU6H2xgRtmAB?= =?us-ascii?Q?1l2e1+IebAeCJFVrOKVlUL3ychEQ9jm99gWGe+IFGclm5ku/cvt/4jHT4Mib?= =?us-ascii?Q?6O5Ex1pT+lQUKp140n8bMKUva+/yNfrSbnBYpozzSgzf3nD2sxqwfbUNIT5g?= =?us-ascii?Q?j89J7QW0alJ21s/bqJzz+Mg7U6khYOd7Ahmn2LXZk2nKB9JaMvYGUiIRD2+4?= =?us-ascii?Q?UochIVsPsn03HPDEVH57iTDMEtqQ2cWmCjo2WpqS2BX+haPcw3mo9KcNfN5B?= =?us-ascii?Q?5Wn0at1c0Xk9mN5Yw3R915LqvqcbLDChiMYCZR5vFQqhDZfCVBGGeDOdTHGO?= =?us-ascii?Q?1v7OJBzAjezCFatJJaKpxjGULbS0CialdC1QZzgb32+RxbFZt57xbDcTyENf?= =?us-ascii?Q?NLC809KtWTrvwPz19ozNZhtrq4N42pwsSTQ1OHs86auh7lgKXOqCV7qJsfJ0?= =?us-ascii?Q?b4knH0M2qgS0NqTqp9YnU0tlGN+pHCgL9T5D6IYHXJCT076RWs2MUatXIzXs?= =?us-ascii?Q?3xahXFNIkFFWSYT9gVPmqiYr2sHRvPN3DTc/Q/7pBF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Jqg7MWAN/q7roXU1Zfx+hgBoXJSRjv1kgeMq6BDah?= =?us-ascii?Q?r1nEtOdpVwimbxvUayqAOBDPzgOEpic44QX1g26smCIHrwmmR1uBcQqTArr9?= =?us-ascii?Q?5ZQ61cN09XUs8mohB9YatHo1OR1wJcVCVJdPrd/aR8dWO/0BoFAPTmuNwqsS?= =?us-ascii?Q?kw=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: af451ed2-83ec-448a-a0e4-08dc765b5a22 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB7374.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2024 10:23:10.7136 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WzxiOubDommI0lq05iKZrLTkHNUkeONi6wvtf7DfaW/L/pkRk3vfGOuR7JbXwwUIE/8m37l9/wEVpqC8cpYkyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR04MB10666 On Fri, May 17, 2024 at 12:18:11PM +0200, Horatiu Vultur wrote: > The 05/17/2024 13:04, Vladimir Oltean wrote: > > > > On Thu, May 16, 2024 at 08:48:55AM +0200, Horatiu Vultur wrote: > > > > Alternatively, the -EOPNOTSUPP check could be moved before programming > > > > the traps in the first place. > > > > > > Thanks for the review. > > > Actually I don't think this alternative will work. In case of PHY > > > timestamping, we would still like to add those rules regardless if > > > ptp is enabled on lan966x. > > > > > > > > > > > Reviewed-by: Vladimir Oltean > > > > > > -- > > > /Horatiu > > > > I don't understand why this would not have worked? > > > > diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c > > index b12d3b8a64fd..1439a36e8394 100644 > > --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c > > +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c > > @@ -474,14 +474,14 @@ static int lan966x_port_hwtstamp_set(struct net_device *dev, > > cfg->source != HWTSTAMP_SOURCE_PHYLIB) > > return -EOPNOTSUPP; > > > > + if (cfg->source == HWTSTAMP_SOURCE_NETDEV && !port->lan966x->ptp) > > + return -EOPNOTSUPP; > > + > > This should also work. > Initially I thought you wanted to have only the check for > port->lan966x->ptp here. And that is why I said it would not work. Ok. I see the patch was marked as "changes requested". I think the second alternative would be better anyway, because a requested configuration which cannot be supported will be rejected outright, rather than doing some stuff, figuring out it cannot be done, then undoing what was done. Would you mind sending a v2 like this?