Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4779389pxu; Wed, 21 Oct 2020 05:19:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLVTOGZdOgVXOhkeyj9WLDVsbQ1+dy2Zv+MwDocWAFN0xjI1lfpZ7E5bNiTlqelB+XrN7b X-Received: by 2002:a17:906:557:: with SMTP id k23mr3112481eja.425.1603282788108; Wed, 21 Oct 2020 05:19:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603282788; cv=none; d=google.com; s=arc-20160816; b=PhYg/juSS/1ik74NH6M5McciBDqrOKYA9W9BFCmzpKUKUdbeS1Nm+hTcAK8sc6aNgi hrefnyjBIxeR+Hp6i/PTX7ZQ7+Kdeyi6qCyb9XC7fz1eOgINJerOgc+l3RYMKWdzoLKB x8gKBHIyvBpWx3EdezqGYUv/fEkkF3g7zTfZCQ0Qe3VEEGe/EoyrzHoBLo5dxloSA53j eIw7IT3Ho7yV324IM4NMnJ/rpSPszeJcT/EKZZlfVyeexd/HeqmEbU1poXuYC4JqEhjr bdovZDVRFyc6LYo3TkfHxErn3nhumTk6/MDIzQAry89hTlXukoQqQwVrlKxmfSB7t2tm yKTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=okDKMzXzCtX+DL70PlkyYgGodwergNlDE9kGKTPNIKg=; b=AbBMWfmucj8YX581FCMW4EaSoI29EVlpYBA2k3BCGrHePvVyrHK0WVsb7tQLs3Obg4 86IG0penLb5iNsxYxJoEcxfLl59tKApHH4zPScl0kfmREFsDtLTbuVIAnVXvxjQD+JiD 7ppnlVmEMbZ9F1AtVm8xSqsZnHL5hCMvc1ZTv1MziY5rXDwgGDbZ5QbiV3QFdh5ExZmX dPWgtqTDREpOrRVbWnBJ/YaSVns0WR33UwJ3nwD9idat+s7GJWi2obSaPcHYSCfmNAnv s5cMFKWfypW5VteGa08MpUlhN698YfxKr1QBKqb2zi5cfakt1eVyJvIRs5p3a2n8fZu8 hrFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jelfM9Yy; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u5si1230791edb.608.2020.10.21.05.19.25; Wed, 21 Oct 2020 05:19:48 -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=@chromium.org header.s=google header.b=jelfM9Yy; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2411747AbgJUD1l (ORCPT + 99 others); Tue, 20 Oct 2020 23:27:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2411737AbgJUD1l (ORCPT ); Tue, 20 Oct 2020 23:27:41 -0400 Received: from mail-vs1-xe42.google.com (mail-vs1-xe42.google.com [IPv6:2607:f8b0:4864:20::e42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D28D2C0613CE for ; Tue, 20 Oct 2020 20:27:40 -0700 (PDT) Received: by mail-vs1-xe42.google.com with SMTP id u7so417182vsq.11 for ; Tue, 20 Oct 2020 20:27:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=okDKMzXzCtX+DL70PlkyYgGodwergNlDE9kGKTPNIKg=; b=jelfM9YyqCKcnDtniLjUFPu6VhMOAsfQOqqWSfu0zlFEjfKhE7JnIz/kRKKRoK2VJv Xw8SL0BTy6z2ymLtcBHN8Gl8opJuePohe1HySszT+qFcfjdRZHkNizRExSD9rKGs++br pFjvyn6iF/NQ2MrM4Ps9lF31Hb3CHtu2q5iGw= 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=okDKMzXzCtX+DL70PlkyYgGodwergNlDE9kGKTPNIKg=; b=uLZxV4PZeIluQpiz7O+6oMUJzU948mn43eQyGNTpVpmKGKHT2L8H7yp4TZXiyi37Ci xZgVt3yMqxCNU5/Ehx9v+i7imibF7eFNNeBwi61shFT/FnsUbDXwU4+ehdS8RKq85o0f UfD1qra7fSFC+UZMpLH2n6UZxQm5Yvq4kSMHKlaP1WaWm6+k2JJojcap0zbfNUCDdiUL VJbLzkvuQ6DBHlSjlWGfaQMIrhX6jgZYjxOg21xU578+dJLiV6d8SJ+wZsVr/yrLTzy4 JJ7Gy5qxIOh4ID4n4SCcyEOeuBRbAfKv1x9YSnF8cuciHTiTI/Zzq5NQhdTFNMnMsu0H exiQ== X-Gm-Message-State: AOAM530ZYB281QBv7a8P2mhTNysgj8qzNyQXMno7xTeWpdbRdbj8nOny 4F72yIYBqqN7IyzOkT4Ca1bLkOO0/Okno0YAbPPZOA== X-Received: by 2002:a67:2c4c:: with SMTP id s73mr448412vss.53.1603250858758; Tue, 20 Oct 2020 20:27:38 -0700 (PDT) MIME-Version: 1.0 References: <20201019223257.261223-1-abhishekpandit@chromium.org> <20201019153232.1.I797f9874972a07fc381fe586b6748ce71c7b1fda@changeid> <20201020055738.GD3437534@kroah.com> In-Reply-To: <20201020055738.GD3437534@kroah.com> From: Abhishek Pandit-Subedi Date: Tue, 20 Oct 2020 20:27:27 -0700 Message-ID: Subject: Re: [PATCH 1/1] kobject: Don't emit change events if not in sysfs To: Greg Kroah-Hartman Cc: Rafael Wysocki , Stephen Boyd , LKML , Linux PM , "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, I was debugging without a live repro and I was told this patch improved behavior but it's only by chance (someone bisected a Dell D6000 dock's displayport issue to this commit and this change seemed to help; udev logs later shows that's not the case). I took another look at device_init_wakeup and I can see that device_set_wakeup_capable does indeed check for device_is_registered before adding the wakeup attributes so the ordering of events I suspected cannot occur. Thanks for pushing back Greg. It made me take a deeper look at an assumption I hadn't challenged. Please consider this patch abandoned. Abhishek On Mon, Oct 19, 2020 at 10:56 PM Greg Kroah-Hartman wrote: > > On Mon, Oct 19, 2020 at 03:32:57PM -0700, Abhishek Pandit-Subedi wrote: > > Add a check to make sure the kobj is created and in sysfs before sending > > a change event notification. Otherwise, udev rules that depend on the > > change notification may find that the path that changed doesn't actually > > exist. > > Why is the user of the kobject trying to emit a uevent before it is > registered? Shouldn't we fix the root problem here instead? Otherwise > the event is still "gone", the caller will not know what to do about it. > > Please fix the root problem here. > > thanks, > > greg k-h