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


Groups > linux.kernel > #1533185

Re: [PATCH 3/6] net: ethernet: ti: cpts: add support of cpts HW_TS_PUSH

From Richard Cochran <richardcochran@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/6] net: ethernet: ti: cpts: add support of cpts HW_TS_PUSH
Date 2016-11-30 11:20 +0100
Message-ID <sJa9A-4PB-7@gated-at.bofh.it> (permalink)
References <sIDdD-75-21@gated-at.bofh.it> <sIDdD-75-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Nov 28, 2016 at 05:04:25PM -0600, Grygorii Strashko wrote:
> +/* HW TS */
> +static int cpts_extts_enable(struct cpts *cpts, u32 index, int on)
> +{
> +	unsigned long flags;
> +	u32 v;
> +
> +	if (index >= cpts->info.n_ext_ts)
> +		return -ENXIO;
> +
> +	if (((cpts->hw_ts_enable & BIT(index)) >> index) == on)
> +		return 0;
> +
> +	spin_lock_irqsave(&cpts->lock, flags);
> +
> +	v = cpts_read32(cpts, control);
> +	if (on) {
> +		v |= BIT(8 + index);
> +		cpts->hw_ts_enable |= BIT(index);
> +	} else {
> +		v &= ~BIT(8 + index);
> +		cpts->hw_ts_enable &= ~BIT(index);
> +	}
> +	cpts_write32(cpts, v, control);
> +
> +	spin_unlock_irqrestore(&cpts->lock, flags);
> +
> +	if (cpts->hw_ts_enable)
> +		/* poll for events faster - evry 200 ms */

every

> +		cpts->ov_check_period =
> +			msecs_to_jiffies(CPTS_EVENT_HWSTAMP_TIMEOUT);

Bad indentation.  Use braces {} to contain the comment and assignment
statement.

> +	else
> +		cpts->ov_check_period = cpts->ov_check_period_slow;
> +
> +	mod_delayed_work(system_wq, &cpts->overflow_work,
> +			 cpts->ov_check_period);
> +
> +	return 0;
> +}

Thanks,
Richard

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


Thread

[PATCH 3/6] net: ethernet: ti: cpts: add support of cpts HW_TS_PUSH Grygorii Strashko <grygorii.strashko@ti.com> - 2016-11-29 00:10 +0100
  Re: [PATCH 3/6] net: ethernet: ti: cpts: add support of cpts  HW_TS_PUSH Richard Cochran <richardcochran@gmail.com> - 2016-11-30 11:20 +0100
  Re: [PATCH 3/6] net: ethernet: ti: cpts: add support of cpts  HW_TS_PUSH Jan Lübbe <jlu@pengutronix.de> - 2016-11-30 12:10 +0100
    Re: [PATCH 3/6] net: ethernet: ti: cpts: add support of cpts  HW_TS_PUSH Grygorii Strashko <grygorii.strashko@ti.com> - 2016-11-30 21:20 +0100
  Re: [PATCH 3/6] net: ethernet: ti: cpts: add support of cpts  HW_TS_PUSH Richard Cochran <richardcochran@gmail.com> - 2016-12-04 00:30 +0100
    Re: [PATCH 3/6] net: ethernet: ti: cpts: add support of cpts  HW_TS_PUSH Grygorii Strashko <grygorii.strashko@ti.com> - 2016-12-08 20:10 +0100
      Re: [PATCH 3/6] net: ethernet: ti: cpts: add support of cpts  HW_TS_PUSH Richard Cochran <richardcochran@gmail.com> - 2016-12-09 10:00 +0100

csiph-web