mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Edward Cree <ecree@solarflare.com>
To: Nicolas Pitre <nicolas.pitre@linaro.org>,
	Richard Cochran <richardcochran@gmail.com>,
	"David S. Miller" <davem@davemloft.net>
Cc: John Stultz <john.stultz@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Josh Triplett <josh@joshtriplett.org>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ptp_clock: future-proofing drivers against PTP subsystem becoming optional
Date: Wed, 21 Sep 2016 16:10:29 +0100	[thread overview]
Message-ID: <a93c5c69-62bd-3c5b-f2f1-e6eb721087e7@solarflare.com> (raw)
In-Reply-To: <alpine.LFD.2.20.1609201915070.9311@knanqh.ubzr>

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>

  parent reply	other threads:[~2016-09-21 15:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-20 23:25 Nicolas Pitre
2016-09-21  8:45 ` Richard Cochran
2016-09-21 15:10 ` Edward Cree [this message]
2016-09-22  6:18 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a93c5c69-62bd-3c5b-f2f1-e6eb721087e7@solarflare.com \
    --to=ecree@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=john.stultz@linaro.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.pitre@linaro.org \
    --cc=richardcochran@gmail.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®