mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Pavan Savoy <pavan_savoy@sify.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: locks inside receive_buf
Date: Thu, 31 Mar 2011 11:25:59 +0100	[thread overview]
Message-ID: <20110331112559.090948a7@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <AANLkTi=FrmB=u09wvLoXzQstnV3h-U58R728t3k6_-B-@mail.gmail.com>

On Wed, 30 Mar 2011 17:51:27 +0530
Pavan Savoy <pavan_savoy@sify.com> wrote:

> Hi,
> 
> Does holding a lock make any sense inside the line discipline's
> ops->receive_buf?
> I see the locks being held and released - during some calls like
> flush_to_ldisc, which end up calling receive_buf....
> 
> 
> and yes, I would like to have a lock because, there are other
> functions in my ldisc driver executed in process context ...
> Is there some hints as to what should be the do's and don'ts inside
> the ldisc ops functions ? (say tty_wakeup ...)

It's not well documented no. Your ld->receive_buf is single threaded and
runs from a sleeping context (but please don't sleep too long)

The output path from user space will be in a sleeping context too, but
you can call the write method of the tty your driver is using from
interrupt context or holding a spinlock (eg from timers)




  reply	other threads:[~2011-03-31 10:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30 12:21 Pavan Savoy
2011-03-31 10:25 ` Alan Cox [this message]
2011-03-31 11:18   ` Pavan Savoy
2011-03-31 14:33     ` Steven Rostedt
2011-04-01  7:12       ` Pavan Savoy
2011-04-01 13:46         ` Steven Rostedt
2011-04-05 11:13           ` Pavan Savoy
2011-04-05 13:04             ` Steven Rostedt
2011-04-06  8:56               ` Pavan Savoy
2011-05-17 11:30                 ` Pavan Savoy

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=20110331112559.090948a7@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavan_savoy@sify.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

all inboxes | Powered by JetHome®