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


Groups > linux.kernel > #1458383

Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller driver

From Benjamin Poirier <benjamin.poirier@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller driver
Date 2016-08-09 05:30 +0200
Message-ID <s45TP-1Zf-11@gated-at.bofh.it> (permalink)
References <rZ6GS-8I-29@gated-at.bofh.it> <s3JTj-4vd-3@gated-at.bofh.it> <s3Nkd-6Qc-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2016/08/08 09:26, Andreas Werner wrote:
[...]
> > > +
> > > +	if (cf->can_dlc > 0)
> > > +		data[0] = be32_to_cpup((__be32 *)(cf->data));
> > > +	if (cf->can_dlc > 3)
> > > +		data[1] = be32_to_cpup((__be32 *)(cf->data + 4));
> > > +
> > > +	writel(id, &cf_buf->can_id);
> > > +	writel(cf->can_dlc, &cf_buf->length);
> > > +
> > > +	if (!(cf->can_id & CAN_RTR_FLAG)) {
> > > +		writel(data[0], &cf_buf->data[0]);
> > > +		writel(data[1], &cf_buf->data[1]);
> > > +
> > > +		stats->tx_bytes += cf->can_dlc;
> > > +	}
> > > +
> > > +	/* be sure everything is written to the
> > > +	 * device before acknowledge the data.
> > > +	 */
> > > +	mmiowb();
> > > +
> > > +	/* trigger the transmission */
> > > +	men_z192_ack_tx_pkg(priv, 1);
> > > +
> > > +	stats->tx_packets++;
> > > +
> > > +	kfree_skb(skb);
> > 
> > What prevents the skb data to be freed/reused before the device has
> > accessed it?

I'm sorry, I hadn't realized that all of the data (all 8 bytes of it!)
is written directly to the device. I was thinking about ethernet devices
that dma packet data.

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


Thread

[PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Andreas Werner <andreas.werner@men.de> - 2016-07-26 11:20 +0200
  Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Benjamin Poirier <benjamin.poirier@gmail.com> - 2016-08-08 06:00 +0200
    Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Andreas Werner <andreas.werner@men.de> - 2016-08-08 09:40 +0200
      Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Benjamin Poirier <benjamin.poirier@gmail.com> - 2016-08-09 05:30 +0200
        Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Andreas Werner <andreas.werner@men.de> - 2016-08-09 08:20 +0200
  Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Wolfgang Grandegger <wg@grandegger.com> - 2016-08-08 11:40 +0200
    Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Andreas Werner <andreas.werner@men.de> - 2016-08-08 13:50 +0200
      Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Wolfgang Grandegger <wg@grandegger.com> - 2016-08-08 14:30 +0200
        Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be> - 2016-08-08 15:30 +0200
          Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Andreas Werner <andreas.werner@men.de> - 2016-08-08 16:20 +0200
        Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Andreas Werner <andreas.werner@men.de> - 2016-08-08 16:10 +0200
          Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Wolfgang Grandegger <wg@grandegger.com> - 2016-08-08 16:40 +0200
            Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Andreas Werner <andreas.werner@men.de> - 2016-08-09 08:20 +0200
              Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Wolfgang Grandegger <wg@grandegger.com> - 2016-08-09 14:00 +0200
              Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Oliver Hartkopp <socketcan@hartkopp.net> - 2016-08-10 22:30 +0200
  RE: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller  driver Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com> - 2016-08-09 11:40 +0200

csiph-web