Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp911207imu; Thu, 20 Dec 2018 07:15:07 -0800 (PST) X-Google-Smtp-Source: AFSGD/WXTfCihYZCeN147BNwI6QWgXdlCxLv61rTMvBwM2HQj5SxFOAkl/I+WaA0SJxJuYGjQ1QY X-Received: by 2002:a63:1321:: with SMTP id i33mr11185267pgl.380.1545318907666; Thu, 20 Dec 2018 07:15:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545318907; cv=none; d=google.com; s=arc-20160816; b=E3qXisGMQl8wSpfwkLP9PDtbr9TQPwEqF7E7i4uN4nyglLvqHTq15PrNnyfYiEEKRW Jv6SWfChcjVZC67k09GRSYj9exwCzHqEq7Fg4e/6heygRAAt6/zNKeNK1vIU5asj2Qax zUCnK6khQ4K3GbDH9L3MkQ4kY+P9pB3sRsTSZ7kZ+Sd6za/vl4OYDYX4lgdcvpT552M8 q6NE5WEh7c5JGFDh3xdLgK1DusxKT66svQtvQIjsIdwrB4ZCtcRMs7J9FSx8RL3S9PgH pktpyii8hWE1Yj3UPuLmWmbLUfPndqUHkQzCttY5GnSXDrk4LgTAHFYrvtms9+kpBvvx WBQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=ir0envVVH0hSP6+Lnkse77QqFdAXZk5hEs4bcky0ZQc=; b=HHvnP3i70tgYl6KT/v2JRaT8gISHRb1HA5ml7myj6E6xXKpWah1RovVnRklbzX0x6D Kn/vtVFSpwSyblK2TmC4jUTO9k53KXR/F3qPdyks6vM7yj2Z8Iv+xm5fV8T+KqID/OJZ vNwm+dmeaY9GKtGN9QOavX6fgKviDtHl9UOTWY3V2e2xcOjA4UKVm3VhBqdF/uJWZbaY lEJFoJ2qsDKoZTbH4CpbbjBALO6m/8EIJ/GWc4nCf5Hl8u3hqGGUFVCRIoTLXCywxD35 XjdLE9QWBOEbPJWA8VukwEdEc6ADn/bPEzVKwu/XbeNymkxgE18hGoNyO4mZn6aQBzfo tmSA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e22si18863455pge.479.2018.12.20.07.14.50; Thu, 20 Dec 2018 07:15:07 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729924AbeLTLEd (ORCPT + 99 others); Thu, 20 Dec 2018 06:04:33 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:39156 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbeLTLEd (ORCPT ); Thu, 20 Dec 2018 06:04:33 -0500 Received: by mail-oi1-f196.google.com with SMTP id i6so1228377oia.6 for ; Thu, 20 Dec 2018 03:04:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ir0envVVH0hSP6+Lnkse77QqFdAXZk5hEs4bcky0ZQc=; b=pL2rX2JasPNc9SPIuuhqvUI7/Xi+/87HwvZBVEfa4Drap9JWccwOpCjJ5vLiD7lp38 MitquKjyMpWNObHdqAtd/4Fc1pXLJr4hWmQRJv3tee0Qyv7fAz8gt9N05EVshHN0CFmY lMrydhi4Aq6Yuj3TC+/jQTzl6FfA5y/EhhpMH4UqyVDrEX36njk0x5D3lKA5L1AJ2Mms e4Iao1M74yeSOV8MBlQXs4Vjc/ahkB/SYdMjARmVZRHep3NESt1BkM1iECHdnxX7X5hu Eo9oREkIj2g0ongbsBWo5HMZ/XlNOpeqJHv6Cpt4NaaVACF57u5hwNLzo2QFS20ZjlMn Nw/g== X-Gm-Message-State: AA+aEWas6NHXMeI6qEgLAu4I3B8soqQB4LBi1kTmwVPFIoJl/ZkMzMVG uiYuX3b8uHWavaahNZmdsHXXMjtPS9oLDydWwgs= X-Received: by 2002:aca:6c8b:: with SMTP id h133mr1730457oic.33.1545303872421; Thu, 20 Dec 2018 03:04:32 -0800 (PST) MIME-Version: 1.0 References: <20181220102247.4911-1-a.hajda@samsung.com> <20181220102247.4911-3-a.hajda@samsung.com> In-Reply-To: <20181220102247.4911-3-a.hajda@samsung.com> From: "Rafael J. Wysocki" Date: Thu, 20 Dec 2018 12:04:20 +0100 Message-ID: Subject: Re: [PATCH v4 2/3] driver core: add deferring probe reason to devices_deferred property To: Andrzej Hajda Cc: Greg Kroah-Hartman , Bartlomiej Zolnierkiewicz , Marek Szyprowski , "Rafael J. Wysocki" , Linux Kernel Mailing List , javierm@redhat.com, Linux ARM , Andy Shevchenko , Mark Brown , Russell King - ARM Linux Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 20, 2018 at 11:23 AM Andrzej Hajda wrote: > > /sys/kernel/debug/devices_deferred property contains list of deferred devices. > This list does not contain reason why the driver deferred probe, the patch > improves it. > The natural place to set the reason is probe_err function introduced recently, > ie. if probe_err will be called with -EPROBE_DEFER instead of printk the message > will be attached to deferred device and printed when user read devices_deferred > property. > > Signed-off-by: Andrzej Hajda > Reviewed-by: Mark Brown > Reviewed-by: Javier Martinez Canillas > Reviewed-by: Andy Shevchenko > --- > v4: > - removed NULL check before kfree, > - coding style tweaking. > v3: > - adjusted deferred_devs_show, to accept newline ended messages, > - changed conditonal check to positive, > - added R-b by Andy. > v2: > - changed __deferred_probe_set_msg args - like in __dev_printk, fits better, > - use kasprintf instead of bunch of code, > - keep consistent format of devices_deferred lines, > - added R-Bs (again I hope changes above are not against it). > --- > --- > drivers/base/base.h | 3 +++ > drivers/base/core.c | 9 +++++---- > drivers/base/dd.c | 21 ++++++++++++++++++++- > 3 files changed, 28 insertions(+), 5 deletions(-) > > diff --git a/drivers/base/base.h b/drivers/base/base.h > index 7a419a7a6235..effbd5e7f9f1 100644 > --- a/drivers/base/base.h > +++ b/drivers/base/base.h > @@ -75,6 +75,7 @@ struct device_private { > struct klist_node knode_driver; > struct klist_node knode_bus; > struct list_head deferred_probe; > + char *deferred_probe_msg; Many drivers will never use this, so is the memory overhead justified? > struct device *device; > };