public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	chrisw@redhat.com, ddutile@redhat.com, bjorn.helgaas@hp.com
Subject: Re: [PATCH] pci: Allow read/write access to I/O port resources
Date: Mon, 19 Jul 2010 07:56:30 +0200	[thread overview]
Message-ID: <201007190756.38412.eike-kernel@sf-tec.de> (raw)
In-Reply-To: <20100719031148.13524.25354.stgit@localhost6.localdomain6>

[-- Attachment #1: Type: Text/Plain, Size: 963 bytes --]

Alex Williamson wrote:
> PCI sysfs resource files currently only allow mmap'ing, which doesn't
> work on all architectures, particularly x86.  Add read/write to
> allow access to these device regions using sysfs.

I think you should update that description a bit. It took me some time to find 
out you are not talking about mmap() on PCI resource files in general, but 
those that are backed by I/O BARs. The other ones work fine on x86 with mmap().

> +static ssize_t
> +pci_resource_io(struct file *filp, struct kobject *kobj,
> +               struct bin_attribute *attr, char *buf,
> +               loff_t off, size_t count, int write)
> +{

The "write" can be bool.

> +       struct pci_dev *pdev = to_pci_dev(container_of(kobj,
> +                                                      struct device, 
kobj));
> +       struct resource *res = (struct resource *)attr->private;

No need to cast here, private is void* anyway.

Eike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2010-07-19  5:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-19  3:15 [PATCH] pci: Allow read/write access to I/O port resources Alex Williamson
2010-07-19  5:56 ` Rolf Eike Beer [this message]
2010-07-19 15:45 ` [PATCH v2] pci: Allow read/write access to sysfs " Alex Williamson
2010-07-23 15:10   ` Alex Williamson
2010-07-23 16:28     ` Jesse Barnes
2010-07-23 17:42       ` Chris Wright
2010-07-30 16:36   ` Jesse Barnes

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=201007190756.38412.eike-kernel@sf-tec.de \
    --to=eike-kernel@sf-tec.de \
    --cc=alex.williamson@redhat.com \
    --cc=bjorn.helgaas@hp.com \
    --cc=chrisw@redhat.com \
    --cc=ddutile@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@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