From: Simon Haynes <simon@baydel.com>
To: root@chaos.analogic.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: File access
Date: Tue, 19 Aug 2003 14:36:51 +0100 [thread overview]
Message-ID: <20A82354434A@baydel.com> (raw)
In-Reply-To: <Pine.LNX.4.53.0308190814420.3760@chaos>
Thanks I have looked at the attached file and I would really not like to
access a file from the kernel but I cannot seem to get the user land app to
work with writing. If you consider a kernel module which, in some event,
needs to save some information in a file. The usr app is blocked in a read
with interruptible_sleep_on. When the first write occurs the module calls
wake_up_interruptible to write the data. Before the module can write the next
chunk of data it needs to stall until the user process has finished.
I can not find a method of stalling the module so it seems my only solution
is to write the file from the kernel or dump the data somewhere manually.
Cheers
Simon.
On Tuesday 19 Aug 2003 1:17 pm, Richard B. Johnson wrote:
> On Tue, 19 Aug 2003, Simon Haynes wrote:
> > I actually had a character interface which I use for on the fly
> > configuration. I have now implemented some code which uses a user process
> > to pass the configuration to the driver. I have however run into problems
> > trying to write files from the driver. I have tried implementing a user
> > process which performs a blocking read. The user process is blocked with
> > interruptible_sleep_on and is woken by the main part of the driver when
> > it needs to write. The problem is I then need to stall the main part of
> > the driver while the data gets written out. My problem is that this write
> > needs to happen from an interrupt handler or a timer process. I cannot
> > seem to block these with interruptible_sleep_on, the kernel crashes. I
> > guess you cannot use this in these cases ? I have also tried semaphores
> > without much success. I have looked for the howto but failed there also.
> >
> > Could you please tell me where I could find this FAQ.
> >
> > Many Thanks
> >
> > Simon.
>
> You may want to post this somewhere. I don't have a web-page.
> We are treated like prisoners here ;;;)) Just kidding, Thor
> (network spy).
>
> Cheers,
> Dick Johnson
>
>
> Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips).
> Note 96.31% of all statistics are fiction.
next prev parent reply other threads:[~2003-08-19 16:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-14 11:32 File access Simon Haynes
2003-08-14 12:07 ` Richard B. Johnson
2003-08-19 9:53 ` Simon Haynes
2003-08-19 12:17 ` Richard B. Johnson
2003-08-19 13:36 ` Simon Haynes [this message]
2003-08-19 15:01 ` Richard B. Johnson
2003-08-14 12:19 ` Matti Aarnio
2003-08-14 12:28 ` Muli Ben-Yehuda
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=20A82354434A@baydel.com \
--to=simon@baydel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=root@chaos.analogic.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