[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <726cf34b-568f-55c9-0459-ff34176f9927@codeaurora.org>
Date: Tue, 20 Mar 2018 13:26:52 +0530
From: Vivek Gautam <vivek.gautam@...eaurora.org>
To: Lukas Wunner <lukas@...ner.de>, Robin Murphy <robin.murphy@....com>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Tomasz Figa <tfiga@...omium.org>,
Joerg Roedel <joro@...tes.org>,
Rob Herring <robh+dt@...nel.org>,
"open list:IOMMU DRIVERS" <iommu@...ts.linux-foundation.org>,
devicetree@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Mark Rutland <mark.rutland@....com>,
Will Deacon <will.deacon@....com>,
Rob Clark <robdclark@...il.com>,
Sricharan R <sricharan@...eaurora.org>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Archit Taneja <architt@...eaurora.org>,
linux-arm-msm <linux-arm-msm@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v9 1/5] driver core: Find an existing link between two
devices
Hi Lukasz,
On 3/14/2018 5:57 PM, Lukas Wunner wrote:
> On Wed, Mar 14, 2018 at 12:14:15PM +0000, Robin Murphy wrote:
>>>> On Wed, Mar 14, 2018 at 8:12 PM, Rafael J. Wysocki <rjw@...ysocki.net> wrote:
>>>>> On Tuesday, March 13, 2018 12:23:34 PM CET Tomasz Figa wrote:
>>>>>> On Tue, Mar 13, 2018 at 7:34 PM, Vivek Gautam <vivek.gautam@...eaurora.org> wrote:
>>>>>>> On Tue, Mar 13, 2018 at 3:45 PM, Tomasz Figa <tfiga@...omium.org> wrote:
>>>>>>>> On Tue, Mar 13, 2018 at 5:55 PM, Vivek Gautam <vivek.gautam@...eaurora.org> wrote:
>>>>>>>>> The lists managing the device-links can be traversed to
>>>>>>>>> find the link between two devices. The device_link_add() APIs
>>>>>>>>> does traverse these lists to check if there's already a link
>>>>>>>>> setup between the two devices.
>>>>>>>>> So, add a new APIs, device_link_find(), to find an existing
>>>>>>>>> device link between two devices - suppliers and consumers.
>>>>>>>> I'm wondering if this API would be useful for anything else that the
>>>>>>>> problem we're trying to solve with deleting links without storing them
>>>>>>>> anywhere. Perhaps a device_link_del_dev(consumer, supplier) would be a
>>>>>>>> better alternative?
>>>>>>> Yea, that sounds simpler i think. Will add this API instead of
>>>>>>> find_link(). Thanks.
>>>>>> Perhaps let's wait for a moment to see if there are other opinions. :)
>>>>>>
>>>>>> Rafael, Lucas, any thoughts?
>>>>> It is not clear to me what the device_link_del_dev(consumer, supplier)
>>>>> would do.
>> Not quite - the issue here is that we have one supplier with an arbitrarily
>> large number of consumers, and would prefer that supplier not to have to
>> spend a whole bunch of memory to store all the struct device_link pointers
>> for the sole reason of having something to give to device_link_del() at the
>> end, given that the device links code is already keeping track of everything
>> internally anyway.
> Makes sense to me. How about an additional flag which autoremoves the
> link on provider unbind?
If I understand this correctly, if we create the device link with
DL_FLAG_AUTOREMOVE, the link is deleted after a consumer unbind. During
a supplier unbind all we get is a WARN_ON with DL_FLAG_AUTOREMOVE. I
guess that's an intended behavior?
If this is the case, then the consumer/supplier drivers just don't have
to take care of deleting the device link explicitly.
Is my understanding correct?
regards
Vivek
>
> Thanks,
>
> Lukas
Powered by blists - more mailing lists