linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhao Yuanyuan <yuanyuan.zhao@hxt-semitech.com>
To: <marc.zyngier@arm.com>
Cc: <tglx@linutronix.de>, <jason@lakedaemon.net>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<yu.zheng@hxt-semitech.com>, <dongsheng.wang@hxt-semitech.com>,
	Zhao Yuanyuan <yuanyuan.zhao@hxt-semitech.com>
Subject: [PATCH 1/1] gic: its: Make sure a LPI is discarded before free.
Date: Thu, 20 Dec 2018 16:20:23 +0800	[thread overview]
Message-ID: <e37e3f5e0146be65c60092a457ca5c82e25581a0.1545292748.git.yuanyuan.zhao@hxt-semitech.com> (raw)

Its device will be removed after all events be freed.
Undisarded events can lead to unpredictable behaviar.

Signed-off-by: Zhao Yuanyuan <yuanyuan.zhao@hxt-semitech.com>
---
 drivers/irqchip/irq-gic-v3-its.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index db20e99..4fee008 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -2572,6 +2572,10 @@ static void its_irq_domain_free(struct irq_domain *domain, unsigned int virq,
                                                                virq + i);
                u32 event = its_get_event_id(data);

+               /* Discard irq before free */
+               if (irqd_is_activated(d))
+                       its_send_discard(its_dev, event);
+
                /* Mark interrupt index as unused */
                clear_bit(event, its_dev->event_map.lpi_map);

--
1.8.3.1




This email is intended only for the named addressee. It may contain information that is confidential/private, legally privileged, or copyright-protected, and you should handle it accordingly. If you are not the intended recipient, you do not have legal rights to retain, copy, or distribute this email or its contents, and should promptly delete the email and all electronic copies in your system; do not retain copies in any media. If you have received this email in error, please notify the sender promptly. Thank you.



WARNING: multiple messages have this Message-ID (diff)
From: Zhao Yuanyuan <yuanyuan.zhao@hxt-semitech.com>
To: <marc.zyngier@arm.com>
Cc: <tglx@linutronix.de>, <jason@lakedaemon.net>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<yu.zheng@hxt-semitech.com>, <dongsheng.wang@hxt-semitech.com>,
	Zhao Yuanyuan <yuanyuan.zhao@hxt-semitech.com>
Subject: [RESEND 1/1] gic: its: Make sure a LPI is discarded before free.
Date: Wed, 9 Jan 2019 11:53:27 +0800	[thread overview]
Message-ID: <e37e3f5e0146be65c60092a457ca5c82e25581a0.1545292748.git.yuanyuan.zhao@hxt-semitech.com> (raw)
Message-ID: <20190109035327.inWbzG5B-UJhAbhnN9Gz4J2UZqENEk88m0yBbQxJPxk@z> (raw)

Its device will be removed after all events be freed.
Undisarded events can lead to unpredictable behaviar.

Signed-off-by: Zhao Yuanyuan <yuanyuan.zhao@hxt-semitech.com>
---
 drivers/irqchip/irq-gic-v3-its.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index db20e99..4fee008 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -2572,6 +2572,10 @@ static void its_irq_domain_free(struct irq_domain *domain, unsigned int virq,
 								virq + i);
 		u32 event = its_get_event_id(data);
 
+		/* Discard irq before free */
+		if (irqd_is_activated(d))
+			its_send_discard(its_dev, event);
+
 		/* Mark interrupt index as unused */
 		clear_bit(event, its_dev->event_map.lpi_map);
 
-- 
1.8.3.1


             reply	other threads:[~2018-12-20  8:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-20  8:20 Zhao Yuanyuan [this message]
2019-01-09  3:53 ` [RESEND 1/1] gic: its: Make sure a LPI is discarded before free Zhao Yuanyuan
2019-01-09  7:43 ` Marc Zyngier
2019-01-09  9:29   ` Zhao, Yuanyuan
2019-01-09  9:52     ` Marc Zyngier
2019-01-10  9:42       ` Zhao, Yuanyuan
2019-01-10 12:55         ` Marc Zyngier

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=e37e3f5e0146be65c60092a457ca5c82e25581a0.1545292748.git.yuanyuan.zhao@hxt-semitech.com \
    --to=yuanyuan.zhao@hxt-semitech.com \
    --cc=dongsheng.wang@hxt-semitech.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=tglx@linutronix.de \
    --cc=yu.zheng@hxt-semitech.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).