* [bug report] iommu/amd: Improve amd_iommu_v2_exit()
@ 2022-03-09 12:52 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2022-03-09 12:52 UTC (permalink / raw)
To: suravee.suthikulpanit; +Cc: iommu
Hello Suravee Suthikulpanit,
The patch d46c04558fdd: "iommu/amd: Improve amd_iommu_v2_exit()" from
Mar 1, 2022, leads to the following Smatch static checker warning:
drivers/iommu/amd/iommu_v2.c:133 free_device_state()
warn: sleeping in atomic context
drivers/iommu/amd/iommu_v2.c
955 static void __exit amd_iommu_v2_exit(void)
956 {
957 struct device_state *dev_state, *next;
958 unsigned long flags;
959
960 if (!amd_iommu_v2_supported())
961 return;
962
963 amd_iommu_unregister_ppr_notifier(&ppr_nb);
964
965 flush_workqueue(iommu_wq);
966
967 /*
968 * The loop below might call flush_workqueue(), so call
969 * destroy_workqueue() after it
970 */
971 spin_lock_irqsave(&state_lock, flags);
Holding a spin lock.
972
973 list_for_each_entry_safe(dev_state, next, &state_list, list) {
974 WARN_ON_ONCE(1);
975
976 put_device_state(dev_state);
977 list_del(&dev_state->list);
978 free_device_state(dev_state);
Calling a sleeping function (wait_event()).
979 }
980
981 spin_unlock_irqrestore(&state_lock, flags);
982
983 destroy_workqueue(iommu_wq);
984 }
regards,
dan carpenter
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-09 12:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-09 12:52 [bug report] iommu/amd: Improve amd_iommu_v2_exit() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox