linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Cc: "balbi@ti.com" <balbi@ti.com>,
	Zhuang Jin Can <jin.can.zhuang@intel.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: dwc3: debugfs: add snapshot to dump requests trbs events
Date: Mon, 28 Apr 2014 18:59:57 -0500	[thread overview]
Message-ID: <20140428235957.GD18010@saruman.home> (raw)
In-Reply-To: <A2CA0424C0A6F04399FB9E1CD98E03046D192103@US01WEMBX2.internal.synopsys.com>

[-- Attachment #1: Type: text/plain, Size: 1441 bytes --]

On Mon, Apr 28, 2014 at 07:58:43PM +0000, Paul Zimmerman wrote:
> > From: linux-usb-owner@vger.kernel.org [mailto:linux-usb-owner@vger.kernel.org] On Behalf Of Felipe Balbi
> > Sent: Monday, April 28, 2014 8:56 AM
> > 
> > On Mon, Apr 28, 2014 at 04:49:23PM -0400, Zhuang Jin Can wrote:
> > > Adds a debugfs file "snapshot" to dump dwc3 requests, trbs and events.
> 
> < snip > 
> 
> > > +	for (i = 0; i < evt->length; i += 4) {
> > > +		event.raw = *(u32 *) (evt->buf + i);
> > > +		if (i == evt->lpos) {
> > > +			seq_puts(s, "lpos-------|\n");
> > > +			seq_puts(s, "           \\\n");
> > > +		}
> > > +		seq_printf(s, "event[%d]: %08x ", i, event.raw);
> > > +
> > > +		if (event.type.is_devspec)
> > > +			dwc3_dump_dev_event(s, &event.devt);
> > > +		else
> > > +			dwc3_dump_ep_event(s, &event.depevt);
> > > +		seq_puts(s, "\n");
> > > +	}
> > 
> > how well have you tested this ? I'm not entirely sure you should be
> > reading the event buffer at any time you want, though I might be wrong.
> 
> Just FYI, it is fine to read from the event buffer memory at any time.
> But of course, if you happen to read from a location at the same time
> the core is writing to it, you may read either the old value or the new,
> depending on the timing. So the results might not be 100% reliable.

Thanks, based on this I'll stick to my
"use-a-ring-buffer-to-store-last-5-events" suggestion :-)

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-04-29  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140428204923.GC12185@intel.com>
2014-04-28 15:55 ` [PATCH] usb: dwc3: debugfs: add snapshot to dump requests trbs events Felipe Balbi
2014-04-28 19:58   ` Paul Zimmerman
2014-04-28 23:59     ` Felipe Balbi [this message]
2014-04-29 21:21   ` Zhuang Jin Can
2014-04-29 16:10     ` Felipe Balbi
2014-05-01  5:06       ` Zhuang Jin Can
2014-04-30 17:14         ` Felipe Balbi
2014-05-01  5:31           ` Zhuang Jin Can

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=20140428235957.GD18010@saruman.home \
    --to=balbi@ti.com \
    --cc=Paul.Zimmerman@synopsys.com \
    --cc=jin.can.zhuang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).