| Message ID | 20251006123741.43462-4-enjuk@amazon.com |
|---|---|
| State | Accepted |
| Delegated to: | Anthony Nguyen |
| Headers | show |
| Series | igb/igc/ixgbe: use EOPNOTSUPP instead of ENOTSUPP | expand |
> -----Original Message----- > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf > Of Kohei Enju > Sent: Monday, October 6, 2025 2:35 PM > To: intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org > Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel, > Przemyslaw <przemyslaw.kitszel@intel.com>; Andrew Lunn > <andrew+netdev@lunn.ch>; David S. Miller <davem@davemloft.net>; Eric > Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo > Abeni <pabeni@redhat.com>; Auke Kok <auke-jan.h.kok@intel.com>; Jeff > Garzik <jgarzik@redhat.com>; Sasha Neftin <sasha.neftin@intel.com>; > Richard Cochran <richardcochran@gmail.com>; Keller, Jacob E > <jacob.e.keller@intel.com>; kohei.enju@gmail.com; Kohei Enju > <enjuk@amazon.com> > Subject: [Intel-wired-lan] [PATCH iwl-net v1 3/3] ixgbe: use > EOPNOTSUPP instead of ENOTSUPP in ixgbe_ptp_feature_enable() > > When the requested PTP feature is not supported, > ixgbe_ptp_feature_enable() returns -ENOTSUPP, causing userland > programs to get "Unknown error 524". > > Since EOPNOTSUPP should be used when error is propagated to userland, > return -EOPNOTSUPP instead of -ENOTSUPP. > > Fixes: 3a6a4edaa592 ("ixgbe: Hardware Timestamping + PTP Hardware > Clock (PHC)") > Signed-off-by: Kohei Enju <enjuk@amazon.com> > --- > drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c > b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c > index 114dd88fc71c..6885d2343c48 100644 > --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c > +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c > @@ -641,7 +641,7 @@ static int ixgbe_ptp_feature_enable(struct > ptp_clock_info *ptp, > * disabled > */ > if (rq->type != PTP_CLK_REQ_PPS || !adapter->ptp_setup_sdp) > - return -ENOTSUPP; > + return -EOPNOTSUPP; > > if (on) > adapter->flags2 |= IXGBE_FLAG2_PTP_PPS_ENABLED; > -- > 2.48.1 Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c index 114dd88fc71c..6885d2343c48 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c @@ -641,7 +641,7 @@ static int ixgbe_ptp_feature_enable(struct ptp_clock_info *ptp, * disabled */ if (rq->type != PTP_CLK_REQ_PPS || !adapter->ptp_setup_sdp) - return -ENOTSUPP; + return -EOPNOTSUPP; if (on) adapter->flags2 |= IXGBE_FLAG2_PTP_PPS_ENABLED;
When the requested PTP feature is not supported, ixgbe_ptp_feature_enable() returns -ENOTSUPP, causing userland programs to get "Unknown error 524". Since EOPNOTSUPP should be used when error is propagated to userland, return -EOPNOTSUPP instead of -ENOTSUPP. Fixes: 3a6a4edaa592 ("ixgbe: Hardware Timestamping + PTP Hardware Clock (PHC)") Signed-off-by: Kohei Enju <enjuk@amazon.com> --- drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)