Re: [OT] Re: keyboard driver of 2.6 kernel
- From: Jan Engelhardt <jengelh@xxxxxxxxxxxxxxx>
- Date: Fri, 6 Jan 2006 08:01:26 +0100 (MET)
>> rid of the extra fluff -- the dependency on moduleparm.h which doesn't
>> exit in 2.4.22
Good to know.
>> the BSD defines
In the kernel part? Where?
>> the 2.6 defines, etc. Also, if built as a
>> module, it'll be called 'rpl' instead of 'rpldev'.
>
> Why?
By default, it's called rpldev everywhere.
> Thanks for sharing your work! Comments on the coding style aside (it's not
> exactly winning a beauty contest), one thing I spotted while skimming over your
> patch:
>
>> +static int urpl_open(struct inode *inode, struct file *filp) {
>> + // This one is called when the device node has been opened.
>> + if(inode != NULL) {
>> + inode->i_mtime = CURRENT_TIME;
>> + inode->i_mode &= ~(S_IWUGO | S_IXUGO);
>> + }
>> +
>> + /* The RPL device should only be opened once, since otherwise,
> different
>> + packets could go to different readers. */
>> + down(&Open_lock);
>> + if(Open_count) {
>> + up(&Open_lock);
>> + return -EBUSY;
>> + }
>> + ++Open_count;
>> + up(&Open_lock);
>> +
>> + down(&Buffer_lock);
>> + Buffer = __vmalloc(Bufsize, GFP_KERNEL | __GFP_HIGHMEM,
> PAGE_KERNEL);
>> + if(Buffer == NULL) {
>> + up(&Buffer_lock);
>> + up(&Open_lock);
>
> This does not seem to be correct. This semaphore has been released already and
> urpl_open is not called under a lock AFAICS.
Semaphoring is right, i.e. Open_lock is only acquired to check Open_count.
However, that last line is certainly invalid - Open_lock is up'ped twice,
which can't be. Thanks for spotting that.
I will have 2.4 put back in.
Jan Engelhardt
--
| Alphagate Systems, http://alphagate.hopto.org/
| jengelh's site, http://jengelh.hopto.org/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [OT] Re: keyboard driver of 2.6 kernel
- From: Nuno Monteiro
- Re: [OT] Re: keyboard driver of 2.6 kernel
- References:
- keyboard driver of 2.6 kernel
- From: P.Manohar
- Re: keyboard driver of 2.6 kernel
- From: Arjan van de Ven
- Re: keyboard driver of 2.6 kernel
- From: Leonard Milcin Jr.
- Re: keyboard driver of 2.6 kernel
- From: Jan Engelhardt
- [OT] Re: keyboard driver of 2.6 kernel
- From: Roberto Nibali
- Re: [OT] Re: keyboard driver of 2.6 kernel
- From: Jan Engelhardt
- Re: [OT] Re: keyboard driver of 2.6 kernel
- From: Roberto Nibali
- Re: [OT] Re: keyboard driver of 2.6 kernel
- From: Nuno Monteiro
- Re: [OT] Re: keyboard driver of 2.6 kernel
- From: Roberto Nibali
- keyboard driver of 2.6 kernel
- Prev by Date: Re: oops pauser. / boot_delayer
- Next by Date: Re: oops pauser.
- Previous by thread: Re: [OT] Re: keyboard driver of 2.6 kernel
- Next by thread: Re: [OT] Re: keyboard driver of 2.6 kernel
- Index(es):
Relevant Pages
|