Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: Sven Schnelle <svens@stackframe.org>
Cc: Carlo Pisani <carlojpisani@gmail.com>,
	Helge Deller <deller@gmx.de>,
	linux-parisc@vger.kernel.org,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	John David Anglin <dave.anglin@bell.net>,
	linux-parisc-owner@vger.kernel.org
Subject: Re: [PATCH v3] parisc: Fix crash due alternative coding for NP iopdir_fdc bit
Date: Tue, 28 May 2019 13:28:12 +0200	[thread overview]
Message-ID: <8250bd3cf4a0bf32ff3ecb21dd81eca6@sf-tec.de> (raw)
In-Reply-To: <20190528110627.GA16860@t470p.stackframe.org>

> FWIW, i hacked up a small driver to read the firmware, i'm attaching it 
> to this
> Mail. Would be nice if some people could try reading the firmware from
> their PA-RISC
> system so we can collect and archive them. Note that it HPMC's in 32 
> Bit Mode,
> but it worked in 64 Bit mode on my C3750/J5000.

Nice!

> +static int __init pdc_firmware_register_sysfs(void)
> +{
> +	struct bin_attribute *attr;
> +	int size, err = -ENOMEM;
> +
> +	attr = kzalloc(sizeof(*attr), 0);
> +	if (!attr)
> +		return -ENOMEM;
> +
> +	size = 1048576; // FIXME
> +
> +	sysfs_bin_attr_init(attr);
> +
> +	attr->size = size;
> +	attr->attr.name = "pdcrom";
> +	attr->attr.mode = S_IRUSR;
> +	attr->read = pdc_firmware_read_rom;
> +#ifdef CONFIG_64BIT
> +	attr->private = ioremap(0xfffffff0f0000000, size);
> +#else
> +	attr->private = ioremap(0xf0000000, size);
> +#endif
> +	if (!attr->private)
> +		goto err_attr;
> +
> +	err = sysfs_create_bin_file(firmware_kobj, attr);
> +	if (err)
> +		goto err_unmap;
> +
> +	pdc_firmware_attr = attr;
> +	return 0;
> +
> +err_unmap:
> +	iounmap(attr->private);
> +err_attr:
> +	kfree(attr);
> +	return err;
> +}
> +
> +static int __init pdc_firmware_init(void)
> +{
> +	return pdc_firmware_register_sysfs();
> +}

Any particular reason you are not simply using BIN_ATTR_RO?

Eike

  reply	other threads:[~2019-05-28 11:28 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27 19:20 [PATCH v3] parisc: Fix crash due alternative coding for NP iopdir_fdc bit Helge Deller
2019-05-27 19:35 ` Carlo Pisani
2019-05-27 20:13   ` John David Anglin
2019-05-27 20:22     ` Sven Schnelle
2019-05-27 20:49       ` John David Anglin
2019-05-27 20:15   ` Sven Schnelle
2019-05-28 11:06     ` Sven Schnelle
2019-05-28 11:28       ` Rolf Eike Beer [this message]
2019-05-28 15:41         ` Sven Schnelle
2019-05-28 15:52           ` Helge Deller
     [not found]       ` <e81b7ae4-3126-5fda-58e4-4a83bd4fcfcf@bell.net>
2019-05-28 15:11         ` Helge Deller
2019-05-28 15:38           ` Sven Schnelle
2019-05-28 17:06             ` John David Anglin
2019-05-28 17:24               ` Rolf Eike Beer
2019-05-28 17:39                 ` Sven Schnelle
2019-05-28 18:40                   ` John David Anglin
2019-05-29 14:15                     ` Helge Deller
2019-05-29 17:01                       ` John David Anglin
2019-05-30 19:55                       ` Sven Schnelle
2019-05-30 20:59                         ` Sven Schnelle
2019-05-31 12:23                           ` John David Anglin
2019-06-02 10:29                             ` Carlo Pisani
2019-06-02 14:45                               ` John David Anglin
2019-06-02 14:38                             ` John David Anglin
2019-06-02 16:12                               ` John David Anglin
2019-05-27 19:41 ` John David Anglin
2019-05-27 20:11   ` Helge Deller
2019-05-27 20:16     ` Carlo Pisani
2019-05-27 20:45     ` John David Anglin

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=8250bd3cf4a0bf32ff3ecb21dd81eca6@sf-tec.de \
    --to=eike-kernel@sf-tec.de \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=carlojpisani@gmail.com \
    --cc=dave.anglin@bell.net \
    --cc=deller@gmx.de \
    --cc=linux-parisc-owner@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=svens@stackframe.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