lkml.org 
[lkml]   [2015]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V2 1/6] SLIMbus: Device management on SLIMbus
On 6/17/2015 7:16 AM, Mark Brown wrote:
> On Tue, Jun 16, 2015 at 07:45:59PM -0600, Sagar Dharia wrote:
>
>> + if (status) {
>> + slim_dev->driver = NULL;
>> + } else if (driver->device_up) {
>> + ctrl = slim_dev->ctrl;
>> + queue_work(ctrl->wq, &slim_dev->wd);
>> + }
> Nothing ever cleans this work up if it didn't manage to run or
> complete.
>
>> +static void slim_report(struct work_struct *work)
>> +{
>> + struct slim_driver *sbdrv;
>> + struct slim_device *sbdev = container_of(work, struct slim_device, wd);
>> +
>> + if (!sbdev->dev.driver)
>> + return;
> So we just forget about the device if we don't have a driver for it?
If device comes up before driver (e.g. dynamic module driver, or
late-init driver), then to begin with: this doesn't do anything.
But once the driver-binding happens and probe succeeds, we queue
device_up again.
>
>> + /* check if device-up or down needs to be called */
>> + if ((!sbdev->reported && !sbdev->notified) ||
>> + (sbdev->reported && sbdev->notified))
>> + return;
> No locking here?
You are right, first I thought this was only touched in workqueue
(singlethreaded), but this is also touched from logical-address
assignment, driver removal etc.
I will add device-level lock for these.
Thanks
Sagar
>
>> +/**
>> + * slim_ctrl_add_boarddevs: Add devices registered by board-info
>> + * @ctrl: Controller to which these devices are to be added to.
>> + * This API is called by controller when it is up and running.
>> + * If devices on a controller were registered before controller,
>> + * this will make sure that they get probed when controller is up.
>> + */
>> +void slim_ctrl_add_boarddevs(struct slim_controller *ctrl)
> My concerns about the split here still remain.


--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation



\
 
 \ /
  Last update: 2015-06-17 20:01    [W:0.077 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site