lkml.org 
[lkml]   [2008]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Intel Management Engine Interface
2008/8/12 Jiri Slaby <jirislaby@gmail.com>:
> On 08/12/2008 06:53 AM, Andrew Morton wrote:
>>
>> On Mon, 11 Aug 2008 21:23:01 +0200 (CEST)
>> Marcin Obara <marcin_obara@users.sourceforge.net> wrote:
>>> +#define ECORRUPTED_MESSAGE_HEADER 1000
>>> +#define ECOMPLETE_MESSAGE 1001
>>
>> What's this? The driver defines its onw errno numbers?
>>
>> Are these ever returned to userspace?
>>
>> This is risky/confusing/misleading, isn't it?
>
> Yes and already pointed out. This leaks to userspace and it's wrong. Please
> go and read my comments to version #1 once again and if you don't understand
> anything, please drop a message, but do not silently ignore others'
> comments.

Sorry.
I will try to explain.
This source code was designed few years ago and there is already
written userspace software.
Removal of driver internal error codes may affect software.
I think it is more risky than keeping these own errno numbers.

>
> E.g. unlocked_ioctl switch hasn't been done plus other things mentioned
> below too (not all of them)
>
unlocked_ioctl would require to add lock as big kernel lock replacement.
It is risky in such complex code, especially if speed increase is not expected.


>>> + spin_lock_bh(&dev->device_lock);
>>> + dev->wd_timer.function = &heci_wd_timer;
>>> + dev->wd_timer.data = (unsigned long) dev;
>>> + spin_unlock_bh(&dev->device_lock);
>>
>> Use setup_timer().
>>
>> Note that setup_timer() does init_timer(), but we already have an
>> init_timer(dev->wd_timer) elsewhere. Please sort that out.
>
> Already commented, left unchanged and without an explanation.

Sorry.
Explanation:
We don't want to init_timer() here. It is done later, to avoid race condition.
We only configure timer, but we are not ready to start it.

>
>>> +/* IOCTL commands */
>>> +#define IOCTL_HECI_GET_VERSION \
>>> + _IOWR('H' , 0x0, struct heci_message_data)
> ... and conflicts with hid as I commented before.

Sorry for missing explanations.
This conflict can't be avoided, because there is already written
software that depends on these ioctl definitions.

--
Regards
Marcin


\
 
 \ /
  Last update: 2008-08-12 21:27    [W:0.068 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site