Loading drivers/slimbus/slimbus.c +17 −9 Original line number Diff line number Diff line Loading @@ -333,6 +333,20 @@ static void slim_report(struct work_struct *work) } } static void slim_device_reset(struct work_struct *work) { struct slim_driver *sbdrv; struct slim_device *sbdev = container_of(work, struct slim_device, device_reset); if (!sbdev->dev.driver) return; sbdrv = to_slim_driver(sbdev->dev.driver); if (sbdrv && sbdrv->reset_device) sbdrv->reset_device(sbdev); } /* * slim_add_device: Add a new device without register board info. * @ctrl: Controller to which this device is to be added to. Loading @@ -353,6 +367,7 @@ int slim_add_device(struct slim_controller *ctrl, struct slim_device *sbdev) INIT_LIST_HEAD(&sbdev->mark_suspend); INIT_LIST_HEAD(&sbdev->mark_removal); INIT_WORK(&sbdev->wd, slim_report); INIT_WORK(&sbdev->device_reset, slim_device_reset); mutex_lock(&ctrl->m_ctrl); list_add_tail(&sbdev->dev_list, &ctrl->devs); mutex_unlock(&ctrl->m_ctrl); Loading Loading @@ -684,16 +699,9 @@ void slim_framer_booted(struct slim_controller *ctrl) mutex_unlock(&ctrl->sched.m_reconf); mutex_lock(&ctrl->m_ctrl); list_for_each_safe(pos, next, &ctrl->devs) { struct slim_driver *sbdrv; sbdev = list_entry(pos, struct slim_device, dev_list); mutex_unlock(&ctrl->m_ctrl); if (sbdev && sbdev->dev.driver) { sbdrv = to_slim_driver(sbdev->dev.driver); if (sbdrv->reset_device) sbdrv->reset_device(sbdev); } mutex_lock(&ctrl->m_ctrl); if (sbdev) queue_work(ctrl->wq, &sbdev->device_reset); } mutex_unlock(&ctrl->m_ctrl); } Loading include/linux/slimbus/slimbus.h +2 −0 Original line number Diff line number Diff line Loading @@ -684,6 +684,7 @@ struct slim_pending_ch { * first time it has reported present. * @dev_list: List of devices on a controller * @wd: Work structure associated with workqueue for presence notification * @device_reset: Work structure for device reset notification * @sldev_reconf: Mutex to protect the pending data-channel lists. * @pending_msgsl: Message bandwidth reservation request by this client in * slots that's pending reconfiguration. Loading @@ -706,6 +707,7 @@ struct slim_device { bool notified; struct list_head dev_list; struct work_struct wd; struct work_struct device_reset; struct mutex sldev_reconf; u32 pending_msgsl; u32 cur_msgsl; Loading Loading
drivers/slimbus/slimbus.c +17 −9 Original line number Diff line number Diff line Loading @@ -333,6 +333,20 @@ static void slim_report(struct work_struct *work) } } static void slim_device_reset(struct work_struct *work) { struct slim_driver *sbdrv; struct slim_device *sbdev = container_of(work, struct slim_device, device_reset); if (!sbdev->dev.driver) return; sbdrv = to_slim_driver(sbdev->dev.driver); if (sbdrv && sbdrv->reset_device) sbdrv->reset_device(sbdev); } /* * slim_add_device: Add a new device without register board info. * @ctrl: Controller to which this device is to be added to. Loading @@ -353,6 +367,7 @@ int slim_add_device(struct slim_controller *ctrl, struct slim_device *sbdev) INIT_LIST_HEAD(&sbdev->mark_suspend); INIT_LIST_HEAD(&sbdev->mark_removal); INIT_WORK(&sbdev->wd, slim_report); INIT_WORK(&sbdev->device_reset, slim_device_reset); mutex_lock(&ctrl->m_ctrl); list_add_tail(&sbdev->dev_list, &ctrl->devs); mutex_unlock(&ctrl->m_ctrl); Loading Loading @@ -684,16 +699,9 @@ void slim_framer_booted(struct slim_controller *ctrl) mutex_unlock(&ctrl->sched.m_reconf); mutex_lock(&ctrl->m_ctrl); list_for_each_safe(pos, next, &ctrl->devs) { struct slim_driver *sbdrv; sbdev = list_entry(pos, struct slim_device, dev_list); mutex_unlock(&ctrl->m_ctrl); if (sbdev && sbdev->dev.driver) { sbdrv = to_slim_driver(sbdev->dev.driver); if (sbdrv->reset_device) sbdrv->reset_device(sbdev); } mutex_lock(&ctrl->m_ctrl); if (sbdev) queue_work(ctrl->wq, &sbdev->device_reset); } mutex_unlock(&ctrl->m_ctrl); } Loading
include/linux/slimbus/slimbus.h +2 −0 Original line number Diff line number Diff line Loading @@ -684,6 +684,7 @@ struct slim_pending_ch { * first time it has reported present. * @dev_list: List of devices on a controller * @wd: Work structure associated with workqueue for presence notification * @device_reset: Work structure for device reset notification * @sldev_reconf: Mutex to protect the pending data-channel lists. * @pending_msgsl: Message bandwidth reservation request by this client in * slots that's pending reconfiguration. Loading @@ -706,6 +707,7 @@ struct slim_device { bool notified; struct list_head dev_list; struct work_struct wd; struct work_struct device_reset; struct mutex sldev_reconf; u32 pending_msgsl; u32 cur_msgsl; Loading