[PATCH net-next V1 1/2] net: lan743x: Remove PTP_PF_EXTTS support for non-PCI11x1x devices

Raju Lakkaraju posted 2 patches 3 years, 6 months ago
There is a newer version of this series
[PATCH net-next V1 1/2] net: lan743x: Remove PTP_PF_EXTTS support for non-PCI11x1x devices
Posted by Raju Lakkaraju 3 years, 6 months ago
Remove PTP_PF_EXTTS support for non-PCI11x1x devices since they do not
support the PTP-IO Input event triggered timestamping mechanisms
added by commit 60942c397af6094c04406b77982314dfe69ef3c4

Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@microchip.com>
---
 drivers/net/ethernet/microchip/lan743x_ptp.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/microchip/lan743x_ptp.c b/drivers/net/ethernet/microchip/lan743x_ptp.c
index 6a11e2ceb013..da3ea905adbb 100644
--- a/drivers/net/ethernet/microchip/lan743x_ptp.c
+++ b/drivers/net/ethernet/microchip/lan743x_ptp.c
@@ -1049,6 +1049,10 @@ static int lan743x_ptpci_verify_pin_config(struct ptp_clock_info *ptp,
 					   enum ptp_pin_function func,
 					   unsigned int chan)
 {
+	struct lan743x_ptp *lan_ptp =
+		container_of(ptp, struct lan743x_ptp, ptp_clock_info);
+	struct lan743x_adapter *adapter =
+		container_of(lan_ptp, struct lan743x_adapter, ptp);
 	int result = 0;
 
 	/* Confirm the requested function is supported. Parameter
@@ -1057,7 +1061,10 @@ static int lan743x_ptpci_verify_pin_config(struct ptp_clock_info *ptp,
 	switch (func) {
 	case PTP_PF_NONE:
 	case PTP_PF_PEROUT:
+		break;
 	case PTP_PF_EXTTS:
+		if (!adapter->is_pci11x1x)
+			result = -1;
 		break;
 	case PTP_PF_PHYSYNC:
 	default:
-- 
2.25.1
Re: [PATCH net-next V1 1/2] net: lan743x: Remove PTP_PF_EXTTS support for non-PCI11x1x devices
Posted by Jakub Kicinski 3 years, 6 months ago
On Fri, 16 Sep 2022 17:27:57 +0530 Raju Lakkaraju wrote:
> Remove PTP_PF_EXTTS support for non-PCI11x1x devices since they do not
> support the PTP-IO Input event triggered timestamping mechanisms
> added by commit 60942c397af6094c04406b77982314dfe69ef3c4

Accepting configuration which is not in fact supported seems like a bug
which deserves a fix, please repost against net with a Fixes tag.