Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1488187

Re: [PATCH] ptp_clock: future-proofing drivers against PTP subsystem becoming optional

From Edward Cree <ecree@solarflare.com>
Newsgroups linux.kernel
Subject Re: [PATCH] ptp_clock: future-proofing drivers against PTP subsystem becoming optional
Date 2016-09-21 17:20 +0200
Message-ID <sjRtw-2de-15@gated-at.bofh.it> (permalink)
References <sjCE9-19L-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 21/09/16 00:25, Nicolas Pitre wrote:
> Drivers must be ready to accept NULL from ptp_clock_register() if the
> PTP clock subsystem is configured out.
>
> This patch documents that and ensures that all drivers cope well
> with a NULL return.
>
> Signed-off-by: Nicolas Pitre <nico@linaro.org>
> Reviewed-by: Eugenia Emantayev <eugenia@mellanox.com>
[...]
> diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
> index c771e0af4e..f105a170b4 100644
> --- a/drivers/net/ethernet/sfc/ptp.c
> +++ b/drivers/net/ethernet/sfc/ptp.c
> @@ -1269,13 +1269,13 @@ int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel)
>  		if (IS_ERR(ptp->phc_clock)) {
>  			rc = PTR_ERR(ptp->phc_clock);
>  			goto fail3;
> -		}
> -
> -		INIT_WORK(&ptp->pps_work, efx_ptp_pps_worker);
> -		ptp->pps_workwq = create_singlethread_workqueue("sfc_pps");
> -		if (!ptp->pps_workwq) {
> -			rc = -ENOMEM;
> -			goto fail4;
> +		} else if (ptp->phc_clock) {
> +			INIT_WORK(&ptp->pps_work, efx_ptp_pps_worker);
> +			ptp->pps_workwq = create_singlethread_workqueue("sfc_pps");
> +			if (!ptp->pps_workwq) {
> +				rc = -ENOMEM;
> +				goto fail4;
> +			}
>  		}
>  	}
>  	ptp->nic_ts_enabled = false;
For the sfc change:
Acked-by: Edward Cree <ecree@solarflare.com>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] ptp_clock: future-proofing drivers against PTP subsystem  becoming optional Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-09-21 01:30 +0200
  Re: [PATCH] ptp_clock: future-proofing drivers against PTP subsystem  becoming optional Richard Cochran <richardcochran@gmail.com> - 2016-09-21 10:50 +0200
  Re: [PATCH] ptp_clock: future-proofing drivers against PTP subsystem  becoming optional Edward Cree <ecree@solarflare.com> - 2016-09-21 17:20 +0200
  Re: [PATCH] ptp_clock: future-proofing drivers against PTP  subsystem becoming optional David Miller <davem@davemloft.net> - 2016-09-22 08:30 +0200

csiph-web