linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Daris Nevil <Daris.Nevil@snmc.com>
To: Greg Johnson <gjohnson@research.canon.com.au>
Cc: Linux PPC Mailing List <linuxppc-embedded@lists.linuxppc.org>
Subject: Re: Task Queues
Date: Thu, 08 Jun 2000 10:01:51 -0500	[thread overview]
Message-ID: <393FB55F.4CE6988@snmc.com> (raw)
In-Reply-To: 20000608042335.85655415FA@elph.research.canon.com.au


Greg,

Not sure what is going wrong for you, but I can show you what
works for me.

Somewhere in your device driver data structure (or as a static
variable) create a task queue:

    struct tq_struct bh_tq;

In your driver initialization function, initialize the task queue:

    static void bottom_half_handler(void* dev);

    bh_tq.routine = bottom_half_hander;
    bh_tq.data = (void*)dev; // Or pass whatever data structure you will need

Then, when you are ready to place your function in the queue:

    queue_task(&bh_tq, &tq_immediate);
    mark_bh(IMMEDIATE_BH); // This might be the step you are missing

The mark_bh() function sets a flag that tells the scheduler it needs to
run the list of functions in the tq_immediate queue.

Hope this helps.

Regards,
Daris Nevil
SiSIC Inc/SNMC
www.snmc.com

Greg Johnson wrote:

> Hi All,
>
> I am trying to create an ISR for our hardware that implements a
> "bottom half" interrupt handler. I use a task queue to do this
> since our driver is a loadable module. Everything works fine
> except that if the task is added to the tq_immediate task queue
> it does not seem to run. If I use the tq_scheduler task queue
> it works fine. I gather that for bottom halfves that it is
> appropriate to schedule them on the immediate queue.
>
> I have also tried running other tasks that are scheduled elsewhere
> in the driver, and have the same problem.
>
> Thanks
>
> Greg.
>
> --
> +------------------------------------------------------+
> | Do you want to know more? www.geocities.com/worfsom/ |
> |              ..ooOO Greg Johnson OOoo..              |
> | HW/SW Engineer        gjohnson@research.canon.com.au |
> | Canon Information Systems Research Australia (CISRA) |
> | 1 Thomas Holt Dr., North Ryde, NSW, 2113,  Australia |
> |      "I FLEXed my BISON and it went YACC!" - me.     |
> +------------------------------------------------------+
>


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

      reply	other threads:[~2000-06-08 15:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-08  4:23 Task Queues Greg Johnson
2000-06-08 15:01 ` Daris Nevil [this message]

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=393FB55F.4CE6988@snmc.com \
    --to=daris.nevil@snmc.com \
    --cc=gjohnson@research.canon.com.au \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    /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).