From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932267AbdJRLnI (ORCPT ); Wed, 18 Oct 2017 07:43:08 -0400 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:63316 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932217AbdJRLnG (ORCPT ); Wed, 18 Oct 2017 07:43:06 -0400 From: "Rafael J. Wysocki" To: jeffy Cc: linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com, heiko@sntech.de, briannorris@chromium.org, dianders@chromium.org, tfiga@chromium.org, broonie@kernel.org, seanpaul@chromium.org, thierry.reding@gmail.com, Greg Kroah-Hartman Subject: Re: [PATCH] driver core: Make sure device detached from driver before deleting it Date: Wed, 18 Oct 2017 13:33:28 +0200 Message-ID: <4487432.Xe1C0jCLjD@aspire.rjw.lan> In-Reply-To: <59E73BBF.5090609@rock-chips.com> References: <20171018054926.4756-1-jeffy.chen@rock-chips.com> <59E736C8.3080002@rock-chips.com> <59E73BBF.5090609@rock-chips.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, October 18, 2017 1:32:15 PM CEST jeffy wrote: > Hi Rafael, > > On 10/18/2017 07:11 PM, jeffy wrote: > >> > > my board has these devices: > > spi master device->spi child device->spi based pwm->pwm_bl > > > > and i add a device link to the pwm and pwm_bl, and got a warning about > > the pwm not unbound: > sorry, it happens when i try to unbind the spi child device, and it's > warning about the consumer(pwm_bl) not unbound. > > > > static void device_links_purge(struct device *dev) > > { > > ... > > list_for_each_entry_safe_reverse(link, ln, > > &dev->links.consumers, s_node) { > > WARN_ON(link->status != DL_STATE_DORMANT && > > link->status != DL_STATE_NONE); <-- warning here! > > __device_link_del(link); > > } > > and i've send a new patch to reorder the device_links_purge() and > bus_remove_device, thanks again :) Which I'm not sure is the right approach just yet. I'll follow up in the patch thread in any case. Thanks, Rafael