qcacmn: Fix pdev refcount issue in regulatory component

Regulatory component takes pdev reference count in pdev create handler by
invoking reg_send_scheduler_msg_sb() to call registered callback functions
to notify current channel change. We cannot take ref count in creation
handler of that pdev object since the object creation is not completed and
ref count initialization might be incomplete in some cases. For example,
if any component releases ref count, it will lead to object deletion.
If any component object fails to create, it requires complete object to be
cleaned up. That leads to leaking the object due to object reference
is held by another component.

Define dispatcher_pdev_open() and call it after creating the PDEV object.
Invoke reg_send_scheduler_msg_sb() from dispatcher_pdev_open() instead of
calling it from pdev create handler.

Change-Id: I0b000f5bbd56045abef3706182c208f63dea69aa
CRs-Fixed: 2168027
This commit is contained in:
Shashikala Prabhu
2018-01-04 22:11:50 +05:30
committed by snandini
부모 1863f93c9d
커밋 af18e70b24
6개의 변경된 파일109개의 추가작업 그리고 12개의 파일을 삭제

파일 보기

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -155,4 +155,26 @@ QDF_STATUS dispatcher_psoc_enable(struct wlan_objmgr_psoc *psoc);
*/
QDF_STATUS dispatcher_psoc_disable(struct wlan_objmgr_psoc *psoc);
/**
* dispatcher_pdev_open(): API to trigger PDEV open for all new components
* @pdev: pdev context
*
* This API calls all new components PDEV OPEN APIs. This is invoked from
* during PDEV object is created.
*
* Return: none
*/
QDF_STATUS dispatcher_pdev_open(struct wlan_objmgr_pdev *pdev);
/**
* dispatcher_pdev_close(): API to trigger PDEV close for all new components
* @pdev: pdev context
*
* This API calls all new components PDEV CLOSE APIs. This is invoked from
* during driver unload sequence.
*
* Return: none
*/
QDF_STATUS dispatcher_pdev_close(struct wlan_objmgr_pdev *pdev);
#endif /* End of !defined(__DISPATCHER_INIT_H) */