From: Huacai Chen Date: Fri, 19 Dec 2014 14:38:18 +0000 (+0800) Subject: stmmac: Don't init ptp again when resume from suspend/hibernation X-Git-Tag: fixes-v4.0-rc1~357^2~38 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe13192911507c49002fc4882ef11f75f529a010;p=pandora-kernel.git stmmac: Don't init ptp again when resume from suspend/hibernation Both stmmac_open() and stmmac_resume() call stmmac_hw_setup(), and stmmac_hw_setup() call stmmac_init_ptp() unconditionally. However, only stmmac_release() calls stmmac_release_ptp(). Since stmmac_suspend() doesn't call stmmac_release_ptp(), stmmac_resume() also needn't call stmmac_init_ptp(). This patch also fix a "scheduling while atomic" problem when resume from suspend/hibernation. Because stmmac_init_ptp() will trigger scheduling while stmmac_resume() hold a spinlock. Callgraph of "scheduling while atomic": stmmac_resume() --> stmmac_hw_setup() --> stmmac_init_ptp() --> stmmac_ptp_register() --> ptp_clock_register() --> device_create() --> device_create_groups_vargs() --> device_add() --> devtmpfs_create_node() --> wait_for_common() --> schedule_timeout() --> __schedule() Signed-off-by: Huacai Chen Signed-off-by: David S. Miller --- Reading git-diff-tree failed