[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAErSpo5rgDUUPB6DX1t_3k_d+YD7eFkGPJmgX0bxs7iFsjowBw@mail.gmail.com>
Date: Mon, 8 Apr 2013 11:29:17 -0600
From: Bjorn Helgaas <bhelgaas@...gle.com>
To: James Bottomley <James.Bottomley@...senpartnership.com>
Cc: Robert Hancock <hancockrwd@...il.com>,
Myron Stowe <myron.stowe@...hat.com>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
Xiangliang Yu <yuxiangl@...vell.com>,
xiangliang yu <yxlraid@...il.com>,
Greg Kroah-Hartman <greg@...ah.com>,
"alex.williamson@...hat.com" <alex.williamson@...hat.com>,
Kay Sievers <kay@...y.org>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/3] PCI: Handle device quirks when accessing sysfs
resource<N> entries
On Sat, Apr 6, 2013 at 2:49 AM, James Bottomley
<James.Bottomley@...senpartnership.com> wrote:
> On Thu, 2013-04-04 at 12:06 -0600, Bjorn Helgaas wrote:
>> On Thu, Mar 21, 2013 at 6:51 PM, Robert Hancock <hancockrwd@...il.com> wrote:
>> > -Reconsider whether supporting read/write on the resource files for IO port
>> > regions like these makes any sense. Obviously mmap isn't very practical for
>> > IO port access on x86 but you could even do something like an ioctl for this
>> > purpose. Not very many pieces of software would need to access these files
>> > so it's likely OK if the API is a bit ugly. That would prevent something
>> > like grepping through sysfs from generating port accesses to random devices.
>>
>> This is the approach I'd like to push on for a kernel fix.
>
> Me too. I think the quirks approach is unsupportable. Worst case I
> think we should have an ability for the *driver* to mark the region as
> having strange access rules.
>
>> I'm not a
>> VM person, but if it were possible to support .mmap() in such a way
>> that a handler would be called for every access to the region, we
>> could easily support I/O port access that way.
>
> We could ... the OS could trigger a page fault on every access using the
> COW mechanism ... however, that mechanism wasn't intended for write
> combining, so although it's theoretically possible to add it, I'd be a
> bit wary.
The current problem case is only I/O port accesses, so we only have to
support 1/2/4-byte accesses, and I don't think write combining is an
issue. But it still sounds like COW might be trying to force a square
peg into a round hole. Maybe there are other approaches. I just
thought of .mmap() because that's already used for MEM space accesses.
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists