From: Eli Billauer <eli.billauer@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, arnd@arndb.de
Subject: Re: [PATCH 2/2] New driver: Xillybus generic interface for FPGA (programmable logic)
Date: Fri, 30 Nov 2012 18:58:08 +0200 [thread overview]
Message-ID: <50B8E5A0.1020406@gmail.com> (raw)
In-Reply-To: <20121130163254.GB4478@kroah.com>
On 11/30/2012 06:32 PM, Greg KH wrote:
>
> As we need to review the user/kernel api here, putting the docs as part
> of the driver submission is a good idea :)
>
> I didn't know, nor do I trust, that a random web site would have the
> correct documentation for a kernel driver.
>
OK. I'll add a file in Documentation/misc-devices/.
>>>> +#if (PAGE_SIZE< 4096)
>>>> +#error Your processor architecture has a page size smaller than 4096
>>>> +#endif
>>>>
>>> That can never happen. Even if it does, you don't care about that in
>>> the driver.
>>>
>>>
>> I removed this check because it can't happen. But the driver *does*
>> care about this, since it creates a lot of buffers with different
>> alignments, hence depending on the pages' alignment.
>>
> Alignment is different than the size of a page. What happens if your
> driver runs on a machine with a page size bigger than 4K? You need to
> be able to handle that properly, so perhaps you should check that?
>
The problem is if the page size *smaller* than 4kB. The buffers
allocated by the driver must not cross a 4kB boundary, and it's assumed
that anything returned by __get_free_pages() is 4 kB-aligned. Otherwise
the FPGA will generate illegal PCIe packets by crossing that boundary.
If the page boundary is bigger than 4k, the driver handles that well.
>
> It is no problem to create dozens of misc devices. It makes your driver
> smaller, contain less code that I have to audit and you have to ensure
> you got right, and it removes another user of 'struct class' which we
> are trying to get rid of anyway. So please, move to use a misc device.
>
Very well. I'll remove that.
Thanks again for your comments. I'll prepare a v3.
Eli
next prev parent reply other threads:[~2012-11-30 17:24 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-28 15:41 [PATCH 1/2] pci_ids: Added FPGA-related entries Eli Billauer
2012-11-28 15:41 ` [PATCH 2/2] New driver: Xillybus generic interface for FPGA (programmable logic) Eli Billauer
2012-11-28 16:57 ` Greg KH
2012-11-30 14:50 ` Eli Billauer
2012-11-30 16:32 ` Greg KH
2012-11-30 16:58 ` Eli Billauer [this message]
2012-11-30 17:32 ` Arnd Bergmann
2012-12-02 17:26 ` Eli Billauer
2012-12-04 3:41 ` Greg KH
2012-12-04 10:13 ` Eli Billauer
2012-12-04 20:43 ` Arnd Bergmann
2012-12-04 21:42 ` Eli Billauer
2012-12-04 23:05 ` Arnd Bergmann
2012-12-05 0:03 ` Eli Billauer
2012-12-05 15:48 ` Greg KH
2012-11-30 17:28 ` Arnd Bergmann
2012-11-30 17:36 ` Greg KH
2012-12-01 3:19 ` Philip Balister
2012-12-01 16:56 ` Greg KH
2012-12-01 16:58 ` Greg KH
2012-12-01 19:30 ` Philip Balister
2012-12-01 20:33 ` Josh Cartwright
2012-12-01 20:48 ` Arnd Bergmann
2012-12-02 12:38 ` Eli Billauer
2012-12-03 20:24 ` John Linn
2012-12-04 19:49 ` Philip Balister
2012-12-04 20:54 ` Arnd Bergmann
2012-12-05 12:34 ` Pavel Machek
2012-11-28 16:50 ` [PATCH 1/2] pci_ids: Added FPGA-related entries Greg KH
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=50B8E5A0.1020406@gmail.com \
--to=eli.billauer@gmail.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.