Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757492AbbFQRgS (ORCPT ); Wed, 17 Jun 2015 13:36:18 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:44698 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755501AbbFQRgK (ORCPT ); Wed, 17 Jun 2015 13:36:10 -0400 Message-ID: <5581B006.6070804@codeaurora.org> Date: Wed, 17 Jun 2015 11:36:06 -0600 From: Sagar Dharia User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Mark Brown CC: gregkh@linuxfoundation.org, bp@suse.de, poeschel@lemonage.de, treding@nvidia.com, gong.chen@linux.intel.com, andreas.noever@gmail.com, alan@linux.intel.com, mathieu.poirier@linaro.org, daniel@ffwll.ch, oded.gabbay@amd.com, jkosina@suse.cz, sharon.dvir1@mail.huji.ac.il, joe@perches.com, davem@davemloft.net, james.hogan@imgtec.com, michael.opdenacker@free-electrons.com, daniel.thompson@linaro.org, linux-kernel@vger.kernel.org, nkaje@codeaurora.org, kheitke@audience.com, mlocke@codeaurora.org, agross@codeaurora.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH V2 1/6] SLIMbus: Device management on SLIMbus References: <1434505564-14333-1-git-send-email-sdharia@codeaurora.org> <1434505564-14333-2-git-send-email-sdharia@codeaurora.org> <20150617131609.GG3214@sirena.org.uk> In-Reply-To: <20150617131609.GG3214@sirena.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2084 Lines: 57 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/