[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTincy=mqLA8iBncftAqjYUY_Cg82zJVZ5DGZCRRT@mail.gmail.com>
Date: Fri, 25 Mar 2011 18:58:50 -0400
From: Mike Frysinger <vapier@...too.org>
To: Jamie Iles <jamie@...ieiles.com>
Cc: linux-kernel@...r.kernel.org, gregkh@...e.de
Subject: Re: [RFC PATCHv3 1/4] drivers/otp: add initial support for OTP memory
On Fri, Mar 25, 2011 at 18:55, Jamie Iles wrote:
> On Fri, Mar 25, 2011 at 06:50:36PM -0400, Mike Frysinger wrote:
>> On Fri, Mar 25, 2011 at 18:47, Jamie Iles wrote:
>> > On Fri, Mar 25, 2011 at 05:58:05PM -0400, Mike Frysinger wrote:
>> >> On Fri, Mar 25, 2011 at 13:14, Jamie Iles wrote:
>> >> > +static unsigned long registered_otp_map[BITS_TO_LONGS(MAX_OTP_DEVICES)];
>> >> > +static DEFINE_MUTEX(otp_register_mutex);
>> >>
>> >> do we really need this ? if we let the minor number dictate
>> >> availability, then we can increment until that errors/wraps, and we
>> >> dont need to do any tracking ...
>> >
>> > OK, so it would be nice to get rid of this but afaict we still need to
>> > do some accounting of available minor numbers in the range that we've
>> > allocated. We could do a simple increment % 255 for the minor number
>> > but if OTP devices are removed at runtime then that may get fragmented
>> > and we would need to do retries of device_register() which feels a bit
>> > too easy to mess up.
>> >
>> > Certainly allocating one major number for OTP devices then allocating
>> > the minors one by one would be much better than what I have now.
>> >
>> > We probably also want it so that if you remove the OTP device that has
>> > had regions called otpaN then reinsert it they doesn't suddenly become
>> > otpbN.
>>
>> yeah that's true. guess i'll leave it be then ;).
>
> OK, but it still might be worth pruning it down to a single major number
> or is that something worth doing later on if it becomes needed?
i dont think we'll see an explosion of OTP devices where we have to
worry about major # exhaustion. if that day comes, we'll worry about
things then.
as long as we stick to dynamic device numbers, we have the flexibility
to screw around later.
-mike
--
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