Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mailbox: tegra-hsp: Set lockdep class dynamically

On Tegra194, due to both BPMP and TCU using mailboxes, we get a
lockdep spew at boot. Both are using different instances of HSP,
so this is harmless. As such give each HSP instance a different
lockdep class.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>

authored by

Mikko Perttunen and committed by
Jassi Brar
d1e6bc0c 4450f128

+15
+15
drivers/mailbox/tegra-hsp.c
··· 98 98 unsigned int num_ss; 99 99 unsigned int num_db; 100 100 unsigned int num_si; 101 + 101 102 spinlock_t lock; 103 + struct lock_class_key lock_key; 102 104 103 105 struct list_head doorbells; 104 106 struct tegra_hsp_mailbox *mailboxes; ··· 777 775 return err; 778 776 } 779 777 778 + lockdep_register_key(&hsp->lock_key); 779 + lockdep_set_class(&hsp->lock, &hsp->lock_key); 780 + 781 + return 0; 782 + } 783 + 784 + static int tegra_hsp_remove(struct platform_device *pdev) 785 + { 786 + struct tegra_hsp *hsp = platform_get_drvdata(pdev); 787 + 788 + lockdep_unregister_key(&hsp->lock_key); 789 + 780 790 return 0; 781 791 } 782 792 ··· 848 834 .pm = &tegra_hsp_pm_ops, 849 835 }, 850 836 .probe = tegra_hsp_probe, 837 + .remove = tegra_hsp_remove, 851 838 }; 852 839 853 840 static int __init tegra_hsp_init(void)