Date: Mon, 21 Feb 2011 11:38:15 +0100 From: Svatopluk Kraus <onwahe@gmail.com> To: freebsd-hackers@freebsd.org Cc: Hans Petter Selasky <hselasky@c2i.net> Subject: Re: ichsmb - correct locking strategy? Message-ID: <AANLkTik%2BrCywN6hUun-2xR7eFfd-OWnBaPcoyZAwPDir@mail.gmail.com> In-Reply-To: <201102181609.39955.hselasky@c2i.net> References: <AANLkTinv8EkNqvQaNWpbW_q8J8kqSiJuLSb3j5S842a=@mail.gmail.com> <201102181609.39955.hselasky@c2i.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Feb 18, 2011 at 4:09 PM, Hans Petter Selasky <hselasky@c2i.net> wro= te: > On Friday 18 February 2011 15:10:47 Svatopluk Kraus wrote: >> Hi, >> >> =A0 I try to figure out locking strategy in FreeBSD and found 'ichsmb' >> device. There is a mutex which protects smb bus (ichsmb device). For >> example in ichsmb_readw() in sys/dev/ichsmb/ichsmb.c, the mutex is >> locked and a command is written to bus, then unbounded (but with >> timeout) sleep is done (mutex is unlocked during sleep). After sleep a >> word is read from bus and the mutex is unlocked. >> >> =A0 1. If an use of the device IS NOT serialized by layers around then >> more calls to this function (or others) can be started or even done >> before the first one is finished. The mutex don't protect sms bus. >> >> =A0 2. If an use of the device IS serialized by layers around then the >> mutex is useless. >> >> =A0 Moreover, I don't mension interrupt routine which uses the mutex and >> smb bus too. >> >> =A0 Am I right? Or did I miss something? > > man sx ? > > struct sx ? > > --HPS > Thanks for your reply. It seems that everybody knows that ichsmb driver is not in good shape but nobody cares for ... Svata
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTik%2BrCywN6hUun-2xR7eFfd-OWnBaPcoyZAwPDir>