From: David Miller <davem@davemloft.net>
To: richardcochran@gmail.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
ben@decadent.org.uk, christian.riesch@omicron.at,
stefan.sorensen@spectralink.com
Subject: Re: [PATCH net-next v2 1/9] ptp: introduce programmable pins.
Date: Thu, 20 Mar 2014 17:13:39 -0400 (EDT) [thread overview]
Message-ID: <20140320.171339.838529247165735046.davem@davemloft.net> (raw)
In-Reply-To: <20140320204307.GA4931@netboy>
From: Richard Cochran <richardcochran@gmail.com>
Date: Thu, 20 Mar 2014 21:43:08 +0100
> On Mon, Mar 17, 2014 at 09:25:34PM -0400, David Miller wrote:
>>
>> This locking seems unnecessarily complex to me. You should be able to
>> do the stateless sanity checks, take the mutex, then do all of the
>> rest of the operations until the end of the function before
>> dropping the lock.
>>
>> So just take the lock once over the operations that need it.
>
> The idea was to avoid holding the mutex when invoking the driver
> callbacks (.verify and .enable). Mostly this is my paranoia that some
> bad driver will call back into the core via ptp_set_pinfunc().
During my review, I checked all the implementations of said methods
and they all universally adjust software state and return.
> But you are right that the result is overly complex. I'll make the
> callers of ptp_set_pinfunc hold the mutex, and so the set path will
> look just like the get path.
Thanks.
next prev parent reply other threads:[~2014-03-20 21:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-16 13:29 [PATCH net-next v2 0/9] ptp: dynamic pin control Richard Cochran
2014-03-16 13:29 ` [PATCH net-next v2 1/9] ptp: introduce programmable pins Richard Cochran
2014-03-18 1:25 ` David Miller
2014-03-20 20:43 ` Richard Cochran
2014-03-20 21:13 ` David Miller [this message]
2014-03-16 13:29 ` [PATCH net-next v2 2/9] ptp: add the pin GET/SETFUNC ioctls to the testptp program Richard Cochran
2014-03-16 13:29 ` [PATCH net-next v2 3/9] ptp: expose the programmable pins via sysfs Richard Cochran
2014-03-16 13:29 ` [PATCH net-next v2 4/9] ptp: drivers: set the number of programmable pins Richard Cochran
2014-03-16 13:29 ` [PATCH net-next v2 5/9] dp83640: trivial fixes Richard Cochran
2014-03-16 13:29 ` [PATCH net-next v2 6/9] dp83640: correct the periodic output frequency Richard Cochran
2014-03-16 13:29 ` [PATCH net-next v2 7/9] dp83640: implement programmable pin functions Richard Cochran
2014-03-16 13:29 ` [PATCH net-next v2 8/9] dp83640: let external input pins from the module parameters be defaults Richard Cochran
2014-03-16 13:29 ` [PATCH net-next v2 9/9] dp83640: let the periodic pin from the module parameter be a default Richard Cochran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140320.171339.838529247165735046.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=ben@decadent.org.uk \
--cc=christian.riesch@omicron.at \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=stefan.sorensen@spectralink.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).