Message ID | 20200908214727.GZ1551@shell.armlinux.org.uk |
---|---|
Headers | show |
Series | Marvell PP2.2 PTP support | expand |
On Tue, Sep 08, 2020 at 04:40:52PM -0700, Richard Cochran wrote: > On Tue, Sep 08, 2020 at 11:00:41PM +0100, Russell King wrote: > > > @@ -2984,13 +2985,19 @@ static irqreturn_t mvpp2_isr(int irq, void *dev_id) > > > > static void mvpp2_isr_handle_ptp_queue(struct mvpp2_port *port, int nq) > > { > > + struct skb_shared_hwtstamps shhwtstamps; > > + struct mvpp2_hwtstamp_queue *queue; > > + struct sk_buff *skb; > > void __iomem *ptp_q; > > + unsigned int id; > > u32 r0, r1, r2; > > > > ptp_q = port->priv->iface_base + MVPP22_PTP_BASE(port->gop_id); > > if (nq) > > ptp_q += MVPP22_PTP_TX_Q1_R0 - MVPP22_PTP_TX_Q0_R0; > > > > + queue = &port->tx_hwtstamp_queue[nq]; > > + > > while (1) { > > r0 = readl_relaxed(ptp_q + MVPP22_PTP_TX_Q0_R0) & 0xffff; > > if (!r0) > > @@ -2998,6 +3005,19 @@ static void mvpp2_isr_handle_ptp_queue(struct mvpp2_port *port, int nq) > > > > r1 = readl_relaxed(ptp_q + MVPP22_PTP_TX_Q0_R1) & 0xffff; > > r2 = readl_relaxed(ptp_q + MVPP22_PTP_TX_Q0_R2) & 0xffff; > > + > > + id = (r0 >> 1) & 31; > > + > > + skb = queue->skb[id]; > > + queue->skb[id] = NULL; > > + if (skb) { > > + u32 ts = r2 << 19 | r1 << 3 | r0 >> 13; > > + > > + netdev_info(port->dev, "tx stamp 0x%08x\n", ts); > > This probably should be _debug instead. It shouldn't be there; one of the problems of juggling patches between trees is that things sometimes get fixed in one tree but not in the "main" tree... will fix. This also should've been combined with patch 6. Anything else on any of the patches, so we don't have to continue doing this one comment at a time?
On Wed, Sep 09, 2020 at 11:00:47AM -0700, Richard Cochran wrote: > On Tue, Sep 08, 2020 at 11:00:41PM +0100, Russell King wrote: > > > +static bool mvpp2_tx_hw_tstamp(struct mvpp2_port *port, > > + struct mvpp2_tx_desc *tx_desc, > > + struct sk_buff *skb) > > +{ > > + unsigned int mtype, type, i, offset; > > + struct mvpp2_hwtstamp_queue *queue; > > + struct ptp_header *hdr; > > + u64 ptpdesc; > > + > > + if (port->priv->hw_version == MVPP21 || > > + port->tx_hwtstamp_type == HWTSTAMP_TX_OFF) > > + return false; > > + > > + type = ptp_classify_raw(skb); > > + if (!type) > > + return false; > > + > > + hdr = ptp_parse_header(skb, type); > > + if (!hdr) > > + return false; > > At this point, the skb will be queued up to receive a transmit time > stamp, and so it should be marked with: > > skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; Russell, since this series went in already, can you follow up with a patch for this please? Thanks, Richard