Received: by 10.213.65.68 with SMTP id h4csp956186imn; Wed, 14 Mar 2018 05:30:49 -0700 (PDT) X-Google-Smtp-Source: AG47ELuWzWRzeg4+uetVFv1oUOqMS6voX56USo23IvJCNlrXVamk3qyryU7ZllHucbPVMLe/Wx6n X-Received: by 2002:a17:902:7716:: with SMTP id n22-v6mr3737951pll.227.1521030648964; Wed, 14 Mar 2018 05:30:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521030648; cv=none; d=google.com; s=arc-20160816; b=H8bm23PzBmZF947/cepFSnp4NQfwXCUnXvLWvEhSx9arFLzXjo20P5pW+F/ZbjOkMg gbaVq6WQqv5J6SVEbiaXyWkjpsq/W5Hr3Uhmg5F+yR2S9g/f1KOPvl+cPtUcc+GO5uhs SxSEWg/GxMos9n2yid/gQatJhUMGC4aEYhAV6AGjoAQzFk2rF8CVe7gJKOWXrDyR9dVm XRG2mIyJ5xPc22IBOgv+OVLOz8u7Z72uKsuvIU7B8ynk5hFLIT35Cv4i4W2SRBPmDcj7 AXDSRgkZhTLW0IkkukHMZVWzFTchc3y0hWeBOWmTuPoCuNqPsQHX93Dkp7CKRs9+ED1u sMbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=zxwe7WHPzjuJMJ3+uTifg5MRSw5odsXVJimTlL6s4Wo=; b=TVUd+Y3FqhlkDXTjIBHxPMJMVVG/JJOHnIsXtI50VLA5wFxPUUWQwPyeH/vp4A2/ow Qpep/zC13UksOtDfQArf3D3i714EgViX2zmrgLplP5NWVyAzee6W/7Vx+sXzbhTctptg fA1wZKmXP7gF0yQQyWLobjvNB+XgTcOTrCuUrdhzuxyef89A33NUd2cAALWlW6CTpAdv JJh7lBpxMnpRIj/R1ZZBcpeRrl+ej93pH0UixcRNTMKKoWC8PabNF2xVLaxTYd2fOc/2 YJkXKF00RmkJ0zI/F6K6DvWZXBU/N7mNZcK5h3MNpxsZMqgNprKfY/HYaD7oinQQnuoU /Ubw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9-v6si1831028plr.558.2018.03.14.05.30.32; Wed, 14 Mar 2018 05:30:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751959AbeCNM2D (ORCPT + 99 others); Wed, 14 Mar 2018 08:28:03 -0400 Received: from bmailout1.hostsharing.net ([83.223.95.100]:38507 "EHLO bmailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751344AbeCNM2C (ORCPT ); Wed, 14 Mar 2018 08:28:02 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 2F8A93000243B; Wed, 14 Mar 2018 13:28:00 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 07E10CCD4; Wed, 14 Mar 2018 13:27:59 +0100 (CET) Date: Wed, 14 Mar 2018 13:27:59 +0100 From: Lukas Wunner To: Robin Murphy Cc: "Rafael J. Wysocki" , Tomasz Figa , Vivek Gautam , Joerg Roedel , Rob Herring , "open list:IOMMU DRIVERS" , devicetree@vger.kernel.org, Linux Kernel Mailing List , Mark Rutland , Will Deacon , Rob Clark , Sricharan R , Marek Szyprowski , Archit Taneja , linux-arm-msm , Greg Kroah-Hartman Subject: Re: [PATCH v9 1/5] driver core: Find an existing link between two devices Message-ID: <20180314122759.GB19651@wunner.de> References: <20180313085534.11650-1-vivek.gautam@codeaurora.org> <2217404.A2W3Iek6du@aspire.rjw.lan> <2705105.V6KYPvoJqj@aspire.rjw.lan> <11eae0bc-7921-e598-9c01-63498400c85b@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11eae0bc-7921-e598-9c01-63498400c85b@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 wrote: > >>>>>On Tue, Mar 13, 2018 at 3:45 PM, Tomasz Figa wrote: > >>>>>>On Tue, Mar 13, 2018 at 5:55 PM, Vivek Gautam 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? Thanks, Lukas