Linux CAN drivers development
 help / color / mirror / Atom feed
From: "Alexander Shiyan" <shc_work@mail.ru>
To: "\"Rost, Martin\"" <Martin.Rost@tonfunk.de>
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
	"Marc Kleine-Budde" <mkl@pengutronix.de>
Subject: Re: AW: [PATCH] mcp251x: mcp2515 stops receiving
Date: Mon, 12 May 2014 21:47:24 +0400	[thread overview]
Message-ID: <1399916844.240257622@f45.i.mail.ru> (raw)
In-Reply-To: <2E9F00CBB66AB544A1ACDC59627518BA0DC8873C@mailserver>

Mon, 12 May 2014 17:34:14 +0000 от "Rost, Martin" <Martin.Rost@tonfunk.de>:
> Hello Alexander,
> 
> > I absolutely don't like the patch. This is not a solution to the problem but
> > ways to circumvent it.
> 
> True that. I whish I had a better solution.
> 
> > I would recommend to make a temporary parameter for sysfs, then when a
> > problem occurs, you could take a snapshot from all registers (including an
> > interrupt status register) and understand what the problem is.
> 
> I've never done that. Any hints on how to start on this?

I can not guarantee the accuracy, but something like this:

static ssize_t dbg_show(struct device *dev, struct device_attribute *attr, char *buf)
{
  unsigned i;
  ssize_t ret = 0;

  for (i = 0; i < NUM_SPI_REGS; i++)
    ret += sprintf(buf, "[0x%02x] = 0x%02x\n", i, SPI_REG[i]);

  return ret;
}

static DEVICE_ATTR_RO(dbg);

static struct attribute *dbg_sysfs_attrs[] = {
  &dev_attr_dbg.attr,
};

static const struct attribute_group dbg_sysfs_group = {
  .attrs = dbg_sysfs_attrs,
};

...
sysfs_create_group(&client->dev.kobj, &dbg_sysfs_group);

---


  reply	other threads:[~2014-05-12 17:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08  6:33 [PATCH] mcp251x: mcp2515 stops receiving Rost, Martin
2014-05-12 17:00 ` Marc Kleine-Budde
2014-05-12 17:14   ` Alexander Shiyan
2014-05-12 17:34     ` AW: " Rost, Martin
2014-05-12 17:47       ` Alexander Shiyan [this message]
2014-05-21 23:53   ` John Whitmore
2014-05-22  6:38     ` Rost, Martin
2014-05-22 10:28       ` John Whitmore
2014-05-22 16:08       ` Gerhard Bertelsmann

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=1399916844.240257622@f45.i.mail.ru \
    --to=shc_work@mail.ru \
    --cc=Martin.Rost@tonfunk.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.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