Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2260038ybg; Fri, 5 Jun 2020 09:23:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+zfCTp1Uc1V55LLtcWCbr/drL3Gb+gO0RYNTZ5dlGfyDet5JJlBE+HQ6RylnIGipCmH0/ X-Received: by 2002:a17:906:3da:: with SMTP id c26mr9061115eja.451.1591374221216; Fri, 05 Jun 2020 09:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591374221; cv=none; d=google.com; s=arc-20160816; b=uNHYe+QFenZJMThZAhBcihq/rLZKXihMw1iCIVrLle8932Ccw4IASLS9cKZclUP3VR wJmk5iUmcUK9IFvjzymmlrgZpZOE0p7NPqJIOkguiZYckF8EuagCsic/JFt1n5MEuhXK CLCM5MhGvxd49eUfx61G0n7vGzlqGzdrNlPf73kCX27lgEPEfSBH4OXRX0rFRG7PWrUh ETi5f9apgjWVME2sbN8XpWSDjCdujXf8SlvfUVsWXfRUESV3n+tVTjiXe797efEK7pPw l4ivzgPAicUxtlQvyC0btwoJwao4nMlvM8dpyaHQrtDrKF4T6ukwk8wY40mQl3JVnSaU UPyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature:dkim-filter; bh=oWQZJZplEJZBqXpZYEbF9oPcUbFjFfMJkc7TjwSg4XE=; b=wEr7FbW/gAD0TaVM7muPHjVnwiEzN76kqws3nY4AQ8Hr7x34Rd2PoHXm5bQwzqutia OMMD3HJxkMq6JCZmWtnTzlWlZbZ2ZmuIbpUqFZOHC17shhGAcajZQ9emjLU7XU8bv+Ls paKVdjLrQ1SnURMUnXeaxlMxAmDd35BamBZfb35NST9trkdM2hHVs57KLxwFpEsUQOvd JR4OxfnVDnjt60AEEP8Q/JjL8TtKa2HOmDpi/wbEXPXZGjOKw8OevdCHCyid3eJxTcjw XS+VB1x+U631Sw8/H4xA+AmOXfq3Ltk5NuURWa0C4MjfTxYYPd37k4rsuUt8KJFkLqkw 2SCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=gRDL6HY3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ot10si144686ejb.319.2020.06.05.09.23.18; Fri, 05 Jun 2020 09:23:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=gRDL6HY3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726294AbgFEQUQ (ORCPT + 99 others); Fri, 5 Jun 2020 12:20:16 -0400 Received: from linux.microsoft.com ([13.77.154.182]:49276 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbgFEQUP (ORCPT ); Fri, 5 Jun 2020 12:20:15 -0400 Received: from [192.168.1.14] (unknown [76.104.235.235]) by linux.microsoft.com (Postfix) with ESMTPSA id 25ED220B7185; Fri, 5 Jun 2020 09:20:15 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 25ED220B7185 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1591374015; bh=oWQZJZplEJZBqXpZYEbF9oPcUbFjFfMJkc7TjwSg4XE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=gRDL6HY3EUJxZLKIcBN0Mxyl58qHMz5tXHSb7XJcVwXco2sX3FtiyUVi8SGtCCeYw FPLnx+VzxBGPp6mNMP8lPQWXKUYC4NQjMhaiTtoMRGO1fLcIV7Dmm54YoHsVZsFHJM uRFLT+g5ILUaQWtVK+QnKRT5zKrmXX7NgLcADZhw= Subject: Re: [PATCH] software node: recursively unregister child swnodes To: Greg Kroah-Hartman Cc: Heikki Krogerus , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, linux-next@vger.kernel.org References: <20200604193623.16946-1-jorhand@linux.microsoft.com> <20200604201523.GA1308830@kroah.com> <20200605075459.GB2209311@kroah.com> From: Jordan Hand Message-ID: Date: Fri, 5 Jun 2020 09:20:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200605075459.GB2209311@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/5/20 12:54 AM, Greg Kroah-Hartman wrote: > Right now, the way the driver model and sysfs/kobjects work is that all > objects must be removed in child-first order. The problem of your > change where you want to try to remove the devices in parent-first order > is that you do not really know if you still have a reference to a child > device somewhere else, which would prevent this all from happening > correctly, right? > > So if you "know" it is safe to drop a child, that's great, and expected. > Don't work to make this one tiny user of the kobjects (which I'm still > not quite sure why they are kobjects and not devices), do things in a > different way from the rest of the kernel without a strong reason to do > so. > > thanks, > > greg k-h > I see, thanks for taking the time to explain, the reason for the existing behavior is more clear to me now. I agree it is better to have the caller remove the nodes in the correct order rather than having the swnode infrastructure try to have some special behavior. Thanks, Jordan