From: Greg KH <greg@kroah.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Sergiu Iordache <sergiu@google.com>,
Marco Stornelli <marco.stornelli@gmail.com>,
"Ahmed S. Darwish" <darwish.07@gmail.com>,
Artem Bityutskiy <Artem.Bityutskiy@nokia.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] char drivers: ramoops debugfs entry
Date: Thu, 7 Jul 2011 16:33:35 -0700 [thread overview]
Message-ID: <20110707233335.GA15120@kroah.com> (raw)
In-Reply-To: <20110707162727.f361f053.akpm@linux-foundation.org>
On Thu, Jul 07, 2011 at 04:27:27PM -0700, Andrew Morton wrote:
> On Thu, 7 Jul 2011 16:16:43 -0700
> Sergiu Iordache <sergiu@google.com> wrote:
>
> > Ramoops currently dumps the log of a panic/oops in a memory area which
> > is known not to be overwritten on restart (for example 1MB starting at
> > 15MB). The way it works is by dividing the memory area in records of a
> > set size (fixed at 4K before my patches, configurable after) and by
> > dumping a record there for each oops/panic. The problem is that right
> > now you have to access that memory area through other means, such as
> > /dev/mem, which is not always possible.
> >
> > What my patch did was to add a debugfs entry which returns a valid
> > record each time (a single dump done by ramoops). The first call
> > returns the first dump. The first call after the last valid dump
> > returns an empty buffer. .
>
> Please fully describe this "record" in the v2 patch changelog. We'll
> want to review it for endianness, 32/64-bit compat issues,
> maintainability, extensibility, etc.
>
> > After it has returned nothing, the next
> > calls return records from the start again.
>
> That sounds a bit weird. One would expect it to keep returning zero,
> requiring userspace to lseek or close/open.
>
> > The validity of a dump is
> > checked by looking after the header. Any comments on this approach are
> > welcome.
> >
> > Changing the entry from debugfs to sysfs wouldn't be a problem. If
> > sysfs is a valid solution I'll come with a patch that updates the
> > documentation as well along with the sysfs entry.
>
> sysfs sounds OK to me. Then again, sysfs is supposed to be
> one-value-per-file, so using it would be naughty.
>
> I dunno, I'd be inclined to abuse the sysfs rule and hope that nobody
> notices rather than create a fake char device. But there's certainly
> plenty of precedent for the fake char driver.
No, please don't abuse sysfs that way.
Use debugfs or a char device node.
thanks,
greg k-h
next prev parent reply other threads:[~2011-07-07 23:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-06 23:29 [PATCH v3 0/3] char drivers: rammops improvements Sergiu Iordache
2011-07-06 23:29 ` [PATCH v3 1/3] char drivers: ramoops dump_oops platform data Sergiu Iordache
2011-07-06 23:29 ` [PATCH v3 2/3] char drivers: ramoops record_size module parameter Sergiu Iordache
2011-07-06 23:29 ` [PATCH v3 3/3] char drivers: ramoops debugfs entry Sergiu Iordache
2011-07-07 20:01 ` Andrew Morton
2011-07-07 22:34 ` Sergiu Iordache
2011-07-07 22:54 ` Andrew Morton
2011-07-07 23:16 ` Sergiu Iordache
2011-07-07 23:27 ` Andrew Morton
2011-07-07 23:33 ` Greg KH [this message]
2011-07-08 6:43 ` Marco Stornelli
2011-07-11 16:54 ` Sergiu Iordache
2011-07-12 6:41 ` Marco Stornelli
2011-07-29 0:15 ` Sergiu Iordache
2011-07-29 8:21 ` Marco Stornelli
2011-07-07 17:32 ` [PATCH v3 0/3] char drivers: rammops improvements Marco Stornelli
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=20110707233335.GA15120@kroah.com \
--to=greg@kroah.com \
--cc=Artem.Bityutskiy@nokia.com \
--cc=akpm@linux-foundation.org \
--cc=darwish.07@gmail.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marco.stornelli@gmail.com \
--cc=sergiu@google.com \
/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
Powered by JetHome