[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47AB88AF.7090403@gmail.com>
Date: Thu, 07 Feb 2008 23:39:43 +0100
From: Jiri Slaby <jirislaby@...il.com>
To: Stephen Neuendorffer <stephen.neuendorffer@...inx.com>
CC: Grant Likely <grant.likely@...retlab.ca>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: Xilinx: hwicap driver comments
On 02/07/2008 11:31 PM, Stephen Neuendorffer wrote:
>> Few comments I have:
>> - release f_op retval is silently ignored, I guess you will get your
> device into
>> undefined state when the first function fails (esp. when you interrupt
> the sem)
>
> Hmm.. hadn't realized that. I'm open to suggestions on how to do this
> better. The real reason why the synchronization is there is to make
> sure that only one client is using the device at a time, using the
> is_open flag.
just mutex_lock(); that need not be interrupted.
>> - semaphores are deprecated
>> - class_device_create is deprecated
>
> What is preferred?
device_create(); and pass the struct device as a parent when you are at it.
Otherwise it will be in /sys/*/virtual/* I suppose.
>> - don't understand this:
>> memcpy(kbuf, drvdata->read_buffer, bytes_remaining);
>> drvdata->read_buffer_in_use = bytes_remaining;
>> free_page((unsigned long)kbuf);
>
> The physical device only generates/accepts complete words, the intention
> is to account for the possibility that a read does not read complete
> words, and to fulfill the read whenever possible.
> It's arguable that read() and write() should not accept or return
> partial words, I suppose
OK, but why are you copying anything to buffer which you free 2 lines below?
--
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