From: Christoph Hellwig <hch@infradead.org>
To: Haren Myneni <haren@linux.vnet.ibm.com>
Cc: devicetree@vger.kernel.org, mikey@neuling.org,
herbert@gondor.apana.org.au, npiggin@gmail.com,
sukadev@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 06/14] powerpc/vas: Setup fault handler per VAS instance
Date: Wed, 27 Nov 2019 00:34:47 -0800 [thread overview]
Message-ID: <20191127083447.GE17097@infradead.org> (raw)
In-Reply-To: <1574816900.13250.12.camel@hbabu-laptop>
>
> +struct task_struct *fault_handler;
> +
> +void vas_wakeup_fault_handler(int virq, void *arg)
> +{
> + struct vas_instance *vinst = arg;
> +
> + atomic_inc(&vinst->pending_fault);
> + wake_up(&vinst->fault_wq);
> +}
> +
> +/*
> + * Fault handler thread for each VAS instance and process fault CRBs.
> + */
> +static int fault_handler_func(void *arg)
> +{
> + struct vas_instance *vinst = (struct vas_instance *)arg;
> +
> + do {
> + if (signal_pending(current))
> + flush_signals(current);
> +
> + wait_event_interruptible(vinst->fault_wq,
> + atomic_read(&vinst->pending_fault) ||
> + kthread_should_stop());
> +
> + if (kthread_should_stop())
> + break;
> +
> + atomic_dec(&vinst->pending_fault);
> + } while (!kthread_should_stop());
> +
> + return 0;
> +}
Pleae use threaded interrupts instead of reinventing them badly.
prev parent reply other threads:[~2019-11-27 8:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-27 1:08 [PATCH 06/14] powerpc/vas: Setup fault handler per VAS instance Haren Myneni
2019-11-27 8:34 ` Christoph Hellwig [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=20191127083447.GE17097@infradead.org \
--to=hch@infradead.org \
--cc=devicetree@vger.kernel.org \
--cc=haren@linux.vnet.ibm.com \
--cc=herbert@gondor.apana.org.au \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mikey@neuling.org \
--cc=npiggin@gmail.com \
--cc=sukadev@linux.vnet.ibm.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).