Received: by 2002:a05:7208:13c3:b0:82:bbfa:f723 with SMTP id r3csp1135055rbe; Tue, 14 May 2024 12:35:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVrLtm5cetVu6gg7IwsBi8x1y+71uEc/dEMO5I44t1ipTE9DxfBuxLhQzxBy4GS3Jue0q5OIaQTIkzjutua3xdX7XPG2tlpMMmf4q1Y0Q== X-Google-Smtp-Source: AGHT+IFyNM8jdw2n+kPDI5a8TjNr5CYAnnz5676kQyArw4QmhnJA67obCLkPCBoLezWxmt/fIx+l X-Received: by 2002:a17:902:f547:b0:1eb:c70:9575 with SMTP id d9443c01a7336-1ef43f4ce30mr167885895ad.42.1715715358895; Tue, 14 May 2024 12:35:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715715358; cv=pass; d=google.com; s=arc-20160816; b=Z2S3nFTFB6aZALBSJa5kSx2QJgx753GJl+f6RwySCo5ekl2zw4xT1PPs1mzp0ZV/Js vJG0z9XqCxNdOYofhR4Ef0xfLP2aVIk5PSJD3gZzocmTsADdjkIVCqGHXIli/Pz+B6Bw TbqvanC+lEJQo5tzY2zHFFzhe25QqP/+FiJuPSRAHqXjChsSDd8pLjtiSks5I+4ZYcMd sRt80/KfVCGOo/Rt2cFD6wiEHk3w2NK76FvRlXdOc9Ad+qkTSKwcLB91gbPhucaKK2UE k1DjRYGtNHQ+HKZxOE2XJDW5lIRg08OHx9HdmwZ7zR05up/jKCjRiby1CLyGsGWwQZAP Iesw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=RBjD1PXcqEyPQ9OGRai77p2jN3RmV5v0l1B9yYVfJOA=; fh=oAkBl7wou/gU4RePwGw0wSE6YwFtpuaiwEpTF4RrXgY=; b=JGfLcG1JoQbj9E05/orTK2quYZkHRwvM/QlbkzZRhIRJrNma1Ub4//xgi4++83GU1B UW7pmAVVLQPk4pF121Htx7e7J1yn2Y7j5E3EZ7KOMigz+UTgzX9V3P+Gpwv0dmq+fX5j pBHhLyblFU0yVGo3ltEjNp9KOYPk5COgnyVJNYOmeKgiw62SvfdMuvx69vYrSPV3pVMM uBQRxR1t/TWJoFQCF8PdoR7ZsKIq4r+tiKi8uClofh94RhlHpZAFQxzIwPN6z8pKylfT x7xfGOPsf5qNHnfDUD45xrLvwKyHa1p+m2CvfjZnC95YI0EZchM8tleJmjfs04szyLKO 7/Kw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=2pDOyBmm; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-179102-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179102-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c26a435si122453935ad.612.2024.05.14.12.35.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 12:35:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179102-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=2pDOyBmm; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-179102-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179102-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.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 20769B21250 for ; Tue, 14 May 2024 19:35:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66D0E181325; Tue, 14 May 2024 19:35:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="2pDOyBmm" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (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 9F6E3144D0B; Tue, 14 May 2024 19:35:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715715346; cv=none; b=ht43VtWrO56f4ePv9pHaD6sF/1qhvH0Gg3dqEdEu+xvB1vSqvXiIH5gE0VC+fLU8c0u6nmjhLpUmcmtvmjlOhL9e32aKuR/76s+bGcpAv6NUB+ieW63L6w5gx51rrGkICdjqKzha//91IBSEOM5FwXrSW4aHT8q1R5hQWrP0G8Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715715346; c=relaxed/simple; bh=1AQKTqlthb0+71Ui6GRUS6m0XsgqkeBwGdVpQ+qWzzg=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=HrvkJolrWUttjr0STw/B2qlhdZDMHqh3wIFhgJ3lEjXrNqmbxS+kZYRjBBPaX/y0OgOblCe3xgHEb45XCdJwZg0JMaKUUwwSK9hGGUbySTpAvm5gbQjFFOa0DXtxLXEQ+AFQbFF4y4P0jjYgZIaoNrEBS6+iuau0RVg2AjZwCI8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=2pDOyBmm; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1715715345; x=1747251345; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=1AQKTqlthb0+71Ui6GRUS6m0XsgqkeBwGdVpQ+qWzzg=; b=2pDOyBmmD7+w4Mmabre/epfO7uaYaggV7KqWg3PRXy1EJ3nzcr64fKSP RfcK0DXg7rrMycV8SY/R2BpDpLigpJA/uLFkW6tC4MFIaMdkgkT2VE2ld VEohyub1EgCx4kD8x10V7KoKPq2F+ki863g2wPUvILZ8S8yqBFVyNCbHw xwiWgRlSu9Mv8TwTvSOn5ORkTok++GD3bcPej8guytlfW1qInF1GDMbWT 5ISYbnuYqmRD453NxUaNMmBNCEZdl1zz6vEyt/aefFqikSsjjUL+wmd+e C0NDhcTGhLSosmXsKzOQ5Z+g/phzxkXUPfgI2BEG0Mcn1XjqK55t2qSAH w==; X-CSE-ConnectionGUID: ghWqsb3zRqW8HedyXcqMOw== X-CSE-MsgGUID: nbtoIpUHTw2a/hkEZSLaNg== X-IronPort-AV: E=Sophos;i="6.08,159,1712646000"; d="scan'208";a="24731262" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 14 May 2024 12:35:44 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 14 May 2024 12:35:33 -0700 Received: from DEN-DL-M31836.microsemi.net (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Tue, 14 May 2024 12:35:30 -0700 From: Horatiu Vultur To: , , , , , , CC: , , , Horatiu Vultur Subject: [PATCH net] net: lan966x: Remove ptp traps in case the ptp is not enabled. Date: Tue, 14 May 2024 21:35:00 +0200 Message-ID: <20240514193500.577403-1-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Lan966x is adding ptp traps to redirect the ptp frames to the CPU such that the HW will not forward these frames anywhere. The issue is that in case ptp is not enabled and the timestamping source is et to HWTSTAMP_SOURCE_NETDEV then these traps would not be removed on the error path. Fix this by removing the traps in this case as they are not needed. Fixes: 54e1ed69c40a ("net: lan966x: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()") Signed-off-by: Horatiu Vultur --- drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c index 2635ef8958c80..318676e42bb62 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c @@ -479,8 +479,10 @@ static int lan966x_port_hwtstamp_set(struct net_device *dev, return err; if (cfg->source == HWTSTAMP_SOURCE_NETDEV) { - if (!port->lan966x->ptp) + if (!port->lan966x->ptp) { + lan966x_ptp_del_traps(port); return -EOPNOTSUPP; + } err = lan966x_ptp_hwtstamp_set(port, cfg, extack); if (err) { -- 2.34.1