iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [patch V2 10/17] iommu/vt-d: Adjust system_state checks
       [not found] <20170516184231.564888231@linutronix.de>
@ 2017-05-16 18:42 ` Thomas Gleixner
  2017-05-16 18:42 ` [patch V2 11/17] iommu/of: Adjust system_state check Thomas Gleixner
  1 sibling, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2017-05-16 18:42 UTC (permalink / raw)
  To: LKML
  Cc: Mark Rutland, Peter Zijlstra, Greg Kroah-Hartman, Steven Rostedt,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	David Woodhouse, Ingo Molnar

[-- Attachment #1: iommu-vt-d--Adjust-system_state-check.patch --]
[-- Type: text/plain, Size: 1375 bytes --]

To enable smp_processor_id() and might_sleep() debug checks earlier, it's
required to add system states between SYSTEM_BOOTING and SYSTEM_RUNNING.

Adjust the system_state checks in dmar_parse_one_atsr() and
dmar_iommu_notify_scope_dev() to handle the extra states.

Signed-off-by: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
Acked-by: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Cc: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
---
 drivers/iommu/intel-iommu.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -4312,7 +4312,7 @@ int dmar_parse_one_atsr(struct acpi_dmar
 	struct acpi_dmar_atsr *atsr;
 	struct dmar_atsr_unit *atsru;
 
-	if (system_state != SYSTEM_BOOTING && !intel_iommu_enabled)
+	if (system_state >= SYSTEM_RUNNING && !intel_iommu_enabled)
 		return 0;
 
 	atsr = container_of(hdr, struct acpi_dmar_atsr, header);
@@ -4562,7 +4562,7 @@ int dmar_iommu_notify_scope_dev(struct d
 	struct acpi_dmar_atsr *atsr;
 	struct acpi_dmar_reserved_memory *rmrr;
 
-	if (!intel_iommu_enabled && system_state != SYSTEM_BOOTING)
+	if (!intel_iommu_enabled && system_state >= SYSTEM_RUNNING)
 		return 0;
 
 	list_for_each_entry(rmrru, &dmar_rmrr_units, list) {

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [patch V2 11/17] iommu/of: Adjust system_state check
       [not found] <20170516184231.564888231@linutronix.de>
  2017-05-16 18:42 ` [patch V2 10/17] iommu/vt-d: Adjust system_state checks Thomas Gleixner
@ 2017-05-16 18:42 ` Thomas Gleixner
  1 sibling, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2017-05-16 18:42 UTC (permalink / raw)
  To: LKML
  Cc: Mark Rutland, Peter Zijlstra, Greg Kroah-Hartman, Steven Rostedt,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Ingo Molnar

[-- Attachment #1: iommu-of--Adjust-system_state-check.patch --]
[-- Type: text/plain, Size: 1012 bytes --]

To enable smp_processor_id() and might_sleep() debug checks earlier, it's
required to add system states between SYSTEM_BOOTING and SYSTEM_RUNNING.

Adjust the system_state check in of_iommu_driver_present() to handle the
extra states.

Signed-off-by: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
Acked-by: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Acked-by: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
---
 drivers/iommu/of_iommu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/iommu/of_iommu.c
+++ b/drivers/iommu/of_iommu.c
@@ -103,7 +103,7 @@ static bool of_iommu_driver_present(stru
 	 * it never will be. We don't want to defer indefinitely, nor attempt
 	 * to dereference __iommu_of_table after it's been freed.
 	 */
-	if (system_state > SYSTEM_BOOTING)
+	if (system_state >= SYSTEM_RUNNING)
 		return false;
 
 	return of_match_node(&__iommu_of_table, np);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-16 18:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20170516184231.564888231@linutronix.de>
2017-05-16 18:42 ` [patch V2 10/17] iommu/vt-d: Adjust system_state checks Thomas Gleixner
2017-05-16 18:42 ` [patch V2 11/17] iommu/of: Adjust system_state check Thomas Gleixner

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).