Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1178363
| From | "Wu, Feng" <feng.wu@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | RE: [RFC v2 3/6] irq: bypass: Extend skeleton for ARM forwarding control |
| Date | 2015-07-07 13:20 +0200 |
| Message-ID | <pJz4S-4Y0-27@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <pJdxn-82j-7@gated-at.bofh.it> <pJyLw-4Ca-27@gated-at.bofh.it> <pJyVb-4UD-1@gated-at.bofh.it> <pJz4S-4Y0-21@gated-at.bofh.it> <pJz4S-4Y0-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
> -----Original Message-----
> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> Sent: Tuesday, July 07, 2015 7:14 PM
> To: Wu, Feng; Eric Auger; eric.auger@st.com;
> linux-arm-kernel@lists.infradead.org; kvmarm@lists.cs.columbia.edu;
> kvm@vger.kernel.org; christoffer.dall@linaro.org; marc.zyngier@arm.com;
> alex.williamson@redhat.com; avi.kivity@gmail.com; mtosatti@redhat.com;
> joro@8bytes.org; b.reynal@virtualopensystems.com
> Cc: linux-kernel@vger.kernel.org; patches@linaro.org
> Subject: Re: [RFC v2 3/6] irq: bypass: Extend skeleton for ARM forwarding
> control
>
>
>
> On 07/07/2015 13:13, Wu, Feng wrote:
> >> > You can use container_of to add it to your own struct, e.g.
> >> >
> >> > struct irq_bypass_consumer cons;
> >> > struct irq_bypass_producer *prod;
> > Do you mean this:
> >
> > struct kvm_kernel_irqfd {
> >
> > ......
> >
> > struct irq_bypass_consumer cons;
> > struct irq_bypass_producer *prod;
> > };
>
> Yes.
Then I still need assign prod and de-assign prod in irq_bypass_register_consumer/irq_bypass_unregister_consumer,
Right? Would you please share why this is better. My original though is as below:
diff --git a/include/linux/irqbypass.h b/include/linux/irqbypass.h
index 8f62235..11930c1 100644
--- a/include/linux/irqbypass.h
+++ b/include/linux/irqbypass.h
@@ -20,6 +20,7 @@ struct irq_bypass_producer {
struct irq_bypass_consumer {
struct list_head node;
void *token;
+ struct irq_bypass_producer *producer;
void (*stop)(struct irq_bypass_consumer *);
void (*resume)(struct irq_bypass_consumer *);
void (*add_producer)(struct irq_bypass_consumer *,
diff --git a/kernel/irq/bypass.c b/kernel/irq/bypass.c
index efadbe5..be2da25 100644
--- a/kernel/irq/bypass.c
+++ b/kernel/irq/bypass.c
@@ -122,6 +122,7 @@ int irq_bypass_register_consumer(struct irq_bypass_consumer *consumer)
list_for_each_entry(producer, &producers, node) {
if (producer->token == consumer->token) {
+ consumer->producer = producer;
connect(producer, consumer);
break;
}
@@ -140,6 +141,7 @@ void irq_bypass_unregister_consumer(struct irq_bypass_consumer *consumer)
list_for_each_entry(producer, &producers, node) {
if (producer->token == consumer->token) {
+ consumer->producer = NULL;
disconnect(producer, consumer);
break;
}
Thanks,
Feng
>
> Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
RE: [RFC v2 3/6] irq: bypass: Extend skeleton for ARM forwarding control "Wu, Feng" <feng.wu@intel.com> - 2015-07-07 13:00 +0200
Re: [RFC v2 3/6] irq: bypass: Extend skeleton for ARM forwarding control Paolo Bonzini <pbonzini@redhat.com> - 2015-07-07 13:10 +0200
Re: [RFC v2 3/6] irq: bypass: Extend skeleton for ARM forwarding control Paolo Bonzini <pbonzini@redhat.com> - 2015-07-07 13:20 +0200
RE: [RFC v2 3/6] irq: bypass: Extend skeleton for ARM forwarding control "Wu, Feng" <feng.wu@intel.com> - 2015-07-07 13:20 +0200
RE: [RFC v2 3/6] irq: bypass: Extend skeleton for ARM forwarding control "Wu, Feng" <feng.wu@intel.com> - 2015-07-07 13:20 +0200
csiph-web