Re: [OT] Re: keyboard driver of 2.6 kernel




>> 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/



Relevant Pages

  • Re: RT patch acceptance
    ... These transients will occur on a desktop kernel, ... Since these transient events do occur, and folks may have learned to ... although it probably doesnt need full semaphore ... > And maybe some of the heavier spinlocks. ...
    (Linux-Kernel)
  • RE: Debugging kernel semaphore contention and priority inversion
    ... > current kernel to sort this issue out.... ... I'm considering enhancing it to get to the inode->i_sem semaphore I ... > dealing with some priority inversion issue? ... > others have suggested a serial console/net console would help a bunch. ...
    (Linux-Kernel)
  • Integer overflow in OpenBSD kernel
    ... Local security bug in OpenBSD semaphore handling ... Fix available: Yes ... An integer overflow condition exists in the OpenBSD 3.3-release kernel ...
    (Bugtraq)
  • Re: [PATCH] Replace completions with semaphores
    ... the myriads of semaphore implementations that Linux has spread out. ... One of the strengths of the Linux kernel is that the barrier for new ... The LWN book is getting outdated after all the 2.6 kernel API changes, ...
    (Linux-Kernel)
  • Re: Sharing a Semaphore with a application.
    ... So have an IOCTL you call instead of the semaphore and have the semaphore in ... the kernel, the cost of the kernel transition is going to be the big ticket ... the cost of doing this with an IOCTL versus calling into the kernel ...
    (microsoft.public.development.device.drivers)