From: Rama Nichanamatlu Date: Thu, 10 Nov 2016 08:30:07 +0000 (-0800) Subject: IB/core: uverbs: Do not wait for uverbs dev closure during forced system shutdown. X-Git-Tag: v4.1.12-92~37^2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=273c5e76ecc252e6fca4f5a6991eeafa1736f32d;p=users%2Fjedix%2Flinux-maple.git IB/core: uverbs: Do not wait for uverbs dev closure during forced system shutdown. Waiting for uverbs dev file closure in the system forced shutdown [e.g reboot -f] path locks up the reboot process forever preventing system shutdown as application closure of this device file is very unlikely at this time. This closure happens in orderly shutdown [e.g reboot] as processes are sent SIGTERM. Orabug: 24918039 Signed-off-by: Rama Nichanamatlu Reviewed-by: Avinash Repaka --- diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index 59bf2aca2036..b2a8bd749170 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c @@ -1111,7 +1111,10 @@ static void ib_uverbs_remove_one(struct ib_device *device) if (atomic_dec_and_test(&uverbs_dev->refcount)) ib_uverbs_comp_dev(uverbs_dev); - wait_for_completion(&uverbs_dev->comp); + + if (system_state == SYSTEM_RUNNING) + wait_for_completion(&uverbs_dev->comp); + kobject_put(&uverbs_dev->kobj); }