From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A02FC49361 for ; Tue, 15 Jun 2021 19:36:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6515E60E0C for ; Tue, 15 Jun 2021 19:36:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229749AbhFOTiN (ORCPT ); Tue, 15 Jun 2021 15:38:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41178 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230205AbhFOTiL (ORCPT ); Tue, 15 Jun 2021 15:38:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623785766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=llnAE3X+Il5R8O881N30+k0POgEFanp8l+fSoeV24QM=; b=AmAd4DXFZi99Gn8uMAsF7+V7TEz7YAW0UTslZNbEzvscCe80/wMcgiGdmaQZv2ohyJVfgs ipy0meWow1aitj65B8plxvwd1ryAE/2IRufnnn4wCmbxMsPcGYmcFw3kSmGhSEVj1U1e/u RtAZdKtPYClEf+bj7jAijYz/Noc6vZs= Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-478-O_iyQDBePw2VR5qzDHP3ug-1; Tue, 15 Jun 2021 15:36:05 -0400 X-MC-Unique: O_iyQDBePw2VR5qzDHP3ug-1 Received: by mail-oo1-f71.google.com with SMTP id d12-20020a4aeb8c0000b029023bbaaddcbbso95162ooj.13 for ; Tue, 15 Jun 2021 12:36:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=llnAE3X+Il5R8O881N30+k0POgEFanp8l+fSoeV24QM=; b=OODPyfg/nqYfUvKfEYXAzSy3i48Ptz24DasdDiepDyyc/A3H/1GJFVwCv3I/L52AOK JBjhRrzIX6rphlSMIN6u8A2hjlwg7IYWxbaScgGhQImlETMRU+pl5IOy64wN6OSMCkzQ 0BA4XY2XXqr5WRWlRPcYGYPZ3D4Ju1n4SJujQfSaTWOtjY/aZShjB/4hvEYvcmZDc3Bq Y09QO+8dm+hJElnCXpZeTQMRWRHC74dOLQN9yY2blZe1EnOgL9rULVBhBP+pJOODu8fr Zoyx27KHtkgOPzwrvtshX2USTs2jyIhRnNmZ4owQ1fmEjHRVUYgfk7uiKhf/ay7LP/Bz nXqg== X-Gm-Message-State: AOAM532EnZijI+Vz06hpGnrR2SQSMrjwy0AIlby/LMo9oWZQNOlssB+/ OCt8jB/XfrCJA29i6g+YPaSIgkDkqZhGHNappXj2sjpus0t18dhS+Q2sk7D11rYZn9m8h26o5aN 6jxCtzxppfjm51AeDfZw8Cg== X-Received: by 2002:a05:6808:210:: with SMTP id l16mr500267oie.154.1623785764704; Tue, 15 Jun 2021 12:36:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8QXhsFTV+W1cxlEpGDuWEWDQP8JmMvkjeZyUYAqX7GqD4McjXkjMc2mNDLmE9O/Xu0RrqmA== X-Received: by 2002:a05:6808:210:: with SMTP id l16mr500251oie.154.1623785764560; Tue, 15 Jun 2021 12:36:04 -0700 (PDT) Received: from redhat.com ([198.99.80.109]) by smtp.gmail.com with ESMTPSA id u1sm3965076ooo.18.2021.06.15.12.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 12:36:04 -0700 (PDT) Date: Tue, 15 Jun 2021 13:36:02 -0600 From: Alex Williamson To: Christoph Hellwig Cc: Greg Kroah-Hartman , Jason Gunthorpe , Kirti Wankhede , David Airlie , Tony Krowiak , Christian Borntraeger , Cornelia Huck , Jonathan Corbet , Daniel Vetter , dri-devel@lists.freedesktop.org, Vasily Gorbik , Heiko Carstens , intel-gfx@lists.freedesktop.org, Jani Nikula , Jason Herne , Joonas Lahtinen , kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-s390@vger.kernel.org, Halil Pasic , "Rafael J. Wysocki" , Rodrigo Vivi Subject: Re: [PATCH 04/10] driver core: Don't return EPROBE_DEFER to userspace during sysfs bind Message-ID: <20210615133602.0699492d.alex.williamson@redhat.com> In-Reply-To: <20210615133519.754763-5-hch@lst.de> References: <20210615133519.754763-1-hch@lst.de> <20210615133519.754763-5-hch@lst.de> Organization: Red Hat X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-s390@vger.kernel.org On Tue, 15 Jun 2021 15:35:13 +0200 Christoph Hellwig wrote: > @@ -547,10 +538,9 @@ static int call_driver_probe(struct device *dev, struct device_driver *drv) > > static int really_probe(struct device *dev, struct device_driver *drv) > { > - int local_trigger_count = atomic_read(&deferred_trigger_count); > bool test_remove = IS_ENABLED(CONFIG_DEBUG_TEST_DRIVER_REMOVE) && > !drv->suppress_bind_attrs; > - int ret = -EPROBE_DEFER, probe_ret = 0; > + int ret, probe_ret = 0; nit, probe_ret initialization could be removed with this patch too. > > if (defer_all_probes) { > /* > @@ -559,17 +549,13 @@ static int really_probe(struct device *dev, struct device_driver *drv) > * wait_for_device_probe() right after that to avoid any races. > */ > dev_dbg(dev, "Driver %s force probe deferral\n", drv->name); > - driver_deferred_probe_add(dev); > - return ret; > + return -EPROBE_DEFER; > } > > ret = device_links_check_suppliers(dev); > - if (ret == -EPROBE_DEFER) > - driver_deferred_probe_add_trigger(dev, local_trigger_count); > if (ret) > return ret; > > - atomic_inc(&probe_count); > pr_debug("bus: '%s': %s: probing driver %s with device %s\n", > drv->bus->name, __func__, drv->name, dev_name(dev)); > if (!list_empty(&dev->devres_head)) { > @@ -681,11 +667,7 @@ static int really_probe(struct device *dev, struct device_driver *drv) > dev->pm_domain->dismiss(dev); > pm_runtime_reinit(dev); > dev_pm_set_driver_flags(dev, 0); > - if (probe_ret == -EPROBE_DEFER) > - driver_deferred_probe_add_trigger(dev, local_trigger_count); This was the only possible uninitialized use case afaict. Thanks, Alex From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F48AC48BDF for ; Tue, 15 Jun 2021 19:36:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E45A26128B for ; Tue, 15 Jun 2021 19:36:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E45A26128B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 633336E1EC; Tue, 15 Jun 2021 19:36:13 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 681BD6E1EC for ; Tue, 15 Jun 2021 19:36:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623785771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=llnAE3X+Il5R8O881N30+k0POgEFanp8l+fSoeV24QM=; b=WkXP7izZfBCKEUWa/5avWj0TBZXdPWYXjhFHs0GoDAMPYncw7X29kUmVFY7DCG9fd6mixH SNakYpQubiOHjxUmSFgPYa241Cj8UX6WwuueZJxAPMlRQ7uo+nk2/rI+je7kadIjh7Af/e 5HhXYNB3QPHWiiX+3e+j3Uqv093eiW0= Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-596-rarn76vCPvCWUNpGCu4Rkg-1; Tue, 15 Jun 2021 15:36:05 -0400 X-MC-Unique: rarn76vCPvCWUNpGCu4Rkg-1 Received: by mail-oo1-f70.google.com with SMTP id f5-20020a4ab0050000b029023e3bd79e80so101770oon.10 for ; Tue, 15 Jun 2021 12:36:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=llnAE3X+Il5R8O881N30+k0POgEFanp8l+fSoeV24QM=; b=YP2LDi+0DyDOJulGdTUrg0s5LB/1IzYjDcbG2MPWVeFeNncc73/FPtW71aC0+v0uak omWbhH+jXFx2tfkKnFGuwOoMQUsz8c8xsNeFyQUYLFKiodgv73xLyb3ue+psTSdGd5kr i4pE2hQFk8WNu2dAOBkS4/hPGtjZyBGG2GT7HFPg3YG/cRyWtNU6SAeaSfv2j3PCUG1I gVDRgJljPmusjYgBbV1UghsRSRvNdzV9qOW8QdiuA/Dh/v3kitJQyz2ygpJlbc9qyhyD 1LPjqq6UxqQZJqkk7t/ZY4NR8yx/je023sVq0g+DR/gx6LxLwlt7SxexQhFCGEIUuZXv B59w== X-Gm-Message-State: AOAM531za6ldYX/ul4X8GZJqcYHkw5ajdVeg39qF/sTWHtWo14qpQOBN 8/Y/1b6ubrGfqjzToSK2WEY6t/d10p2fuOtCUG+CWZwUJZdYD+sXUWiZ8AAxDoy8dkVd3VEs6vn 9iD1Xf6Es2LhhUGcPuTzMy7GaXMhu X-Received: by 2002:a05:6808:210:: with SMTP id l16mr500273oie.154.1623785764705; Tue, 15 Jun 2021 12:36:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8QXhsFTV+W1cxlEpGDuWEWDQP8JmMvkjeZyUYAqX7GqD4McjXkjMc2mNDLmE9O/Xu0RrqmA== X-Received: by 2002:a05:6808:210:: with SMTP id l16mr500251oie.154.1623785764560; Tue, 15 Jun 2021 12:36:04 -0700 (PDT) Received: from redhat.com ([198.99.80.109]) by smtp.gmail.com with ESMTPSA id u1sm3965076ooo.18.2021.06.15.12.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 12:36:04 -0700 (PDT) Date: Tue, 15 Jun 2021 13:36:02 -0600 From: Alex Williamson To: Christoph Hellwig Subject: Re: [PATCH 04/10] driver core: Don't return EPROBE_DEFER to userspace during sysfs bind Message-ID: <20210615133602.0699492d.alex.williamson@redhat.com> In-Reply-To: <20210615133519.754763-5-hch@lst.de> References: <20210615133519.754763-1-hch@lst.de> <20210615133519.754763-5-hch@lst.de> Organization: Red Hat X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=alex.williamson@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, linux-doc@vger.kernel.org, David Airlie , dri-devel@lists.freedesktop.org, Kirti Wankhede , linux-s390@vger.kernel.org, Jonathan Corbet , "Rafael J. Wysocki" , Halil Pasic , Christian Borntraeger , Jason Gunthorpe , intel-gfx@lists.freedesktop.org, Jason Herne , Vasily Gorbik , Heiko Carstens , Rodrigo Vivi , Tony Krowiak , Greg Kroah-Hartman , Cornelia Huck Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, 15 Jun 2021 15:35:13 +0200 Christoph Hellwig wrote: > @@ -547,10 +538,9 @@ static int call_driver_probe(struct device *dev, struct device_driver *drv) > > static int really_probe(struct device *dev, struct device_driver *drv) > { > - int local_trigger_count = atomic_read(&deferred_trigger_count); > bool test_remove = IS_ENABLED(CONFIG_DEBUG_TEST_DRIVER_REMOVE) && > !drv->suppress_bind_attrs; > - int ret = -EPROBE_DEFER, probe_ret = 0; > + int ret, probe_ret = 0; nit, probe_ret initialization could be removed with this patch too. > > if (defer_all_probes) { > /* > @@ -559,17 +549,13 @@ static int really_probe(struct device *dev, struct device_driver *drv) > * wait_for_device_probe() right after that to avoid any races. > */ > dev_dbg(dev, "Driver %s force probe deferral\n", drv->name); > - driver_deferred_probe_add(dev); > - return ret; > + return -EPROBE_DEFER; > } > > ret = device_links_check_suppliers(dev); > - if (ret == -EPROBE_DEFER) > - driver_deferred_probe_add_trigger(dev, local_trigger_count); > if (ret) > return ret; > > - atomic_inc(&probe_count); > pr_debug("bus: '%s': %s: probing driver %s with device %s\n", > drv->bus->name, __func__, drv->name, dev_name(dev)); > if (!list_empty(&dev->devres_head)) { > @@ -681,11 +667,7 @@ static int really_probe(struct device *dev, struct device_driver *drv) > dev->pm_domain->dismiss(dev); > pm_runtime_reinit(dev); > dev_pm_set_driver_flags(dev, 0); > - if (probe_ret == -EPROBE_DEFER) > - driver_deferred_probe_add_trigger(dev, local_trigger_count); This was the only possible uninitialized use case afaict. Thanks, Alex From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B6CFC48BE5 for ; Tue, 15 Jun 2021 19:36:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 64EAE61350 for ; Tue, 15 Jun 2021 19:36:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 64EAE61350 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E92B26E18E; Tue, 15 Jun 2021 19:36:07 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4964C6E18E for ; Tue, 15 Jun 2021 19:36:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623785766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=llnAE3X+Il5R8O881N30+k0POgEFanp8l+fSoeV24QM=; b=AmAd4DXFZi99Gn8uMAsF7+V7TEz7YAW0UTslZNbEzvscCe80/wMcgiGdmaQZv2ohyJVfgs ipy0meWow1aitj65B8plxvwd1ryAE/2IRufnnn4wCmbxMsPcGYmcFw3kSmGhSEVj1U1e/u RtAZdKtPYClEf+bj7jAijYz/Noc6vZs= Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-590-yZRBEGKQNliD93y16AOu3w-1; Tue, 15 Jun 2021 15:36:05 -0400 X-MC-Unique: yZRBEGKQNliD93y16AOu3w-1 Received: by mail-oo1-f70.google.com with SMTP id v8-20020a0568200048b0290249f46c70eeso74781oob.22 for ; Tue, 15 Jun 2021 12:36:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=llnAE3X+Il5R8O881N30+k0POgEFanp8l+fSoeV24QM=; b=tTL++M0ZvwkFl7iNdCTBe/5kPGinDE2zgTIT/uniGp6ja3uFL+f6wkEoPjTEJtjs6H yuNpnEdahEX67L52xmnJuJOWRIUfugw4gRp+BJ2RO6F+xvjRuj7HfY2AALizgNNtSjxt 6Oq+45wrhkqbjIWTQfLa+QG83j2EzrNmYEBhe2Hk9oaGR7lDGfKziaFWhVMdSfD8usHe UIUSWJbQIvaxHmD7rtKbhqGA8QtYzBQ8c3b5mSb0lcEj8KFuVJRbK3caAlEQe/pa+29L nK7TILvlMBT6b25rD9Q6vZvtZxYTu6NtAkIh3FcV/GRZXuOYiUfIpwyE1bEmsNI8xxUf vO+w== X-Gm-Message-State: AOAM53088EH34iJscJGp9GOVbYZTfDxg6GL4HOtICVp72y7v6xWX8/Nj baBq6Sm48JVcMwBK4JQ0g5B9QgDsKk/m/Tc6d+jw/I4ATc28nhz64K8hG2yMS/t9tuJemI9xQ72 MMMxGS6PFxGnSMpQECAVdTGplsX+R X-Received: by 2002:a05:6808:210:: with SMTP id l16mr500262oie.154.1623785764704; Tue, 15 Jun 2021 12:36:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8QXhsFTV+W1cxlEpGDuWEWDQP8JmMvkjeZyUYAqX7GqD4McjXkjMc2mNDLmE9O/Xu0RrqmA== X-Received: by 2002:a05:6808:210:: with SMTP id l16mr500251oie.154.1623785764560; Tue, 15 Jun 2021 12:36:04 -0700 (PDT) Received: from redhat.com ([198.99.80.109]) by smtp.gmail.com with ESMTPSA id u1sm3965076ooo.18.2021.06.15.12.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 12:36:04 -0700 (PDT) Date: Tue, 15 Jun 2021 13:36:02 -0600 From: Alex Williamson To: Christoph Hellwig Message-ID: <20210615133602.0699492d.alex.williamson@redhat.com> In-Reply-To: <20210615133519.754763-5-hch@lst.de> References: <20210615133519.754763-1-hch@lst.de> <20210615133519.754763-5-hch@lst.de> Organization: Red Hat X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=alex.williamson@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: Re: [Intel-gfx] [PATCH 04/10] driver core: Don't return EPROBE_DEFER to userspace during sysfs bind X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, linux-doc@vger.kernel.org, David Airlie , dri-devel@lists.freedesktop.org, Kirti Wankhede , linux-s390@vger.kernel.org, Jonathan Corbet , "Rafael J. Wysocki" , Halil Pasic , Christian Borntraeger , Jason Gunthorpe , intel-gfx@lists.freedesktop.org, Jason Herne , Vasily Gorbik , Heiko Carstens , Tony Krowiak , Greg Kroah-Hartman , Cornelia Huck Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, 15 Jun 2021 15:35:13 +0200 Christoph Hellwig wrote: > @@ -547,10 +538,9 @@ static int call_driver_probe(struct device *dev, struct device_driver *drv) > > static int really_probe(struct device *dev, struct device_driver *drv) > { > - int local_trigger_count = atomic_read(&deferred_trigger_count); > bool test_remove = IS_ENABLED(CONFIG_DEBUG_TEST_DRIVER_REMOVE) && > !drv->suppress_bind_attrs; > - int ret = -EPROBE_DEFER, probe_ret = 0; > + int ret, probe_ret = 0; nit, probe_ret initialization could be removed with this patch too. > > if (defer_all_probes) { > /* > @@ -559,17 +549,13 @@ static int really_probe(struct device *dev, struct device_driver *drv) > * wait_for_device_probe() right after that to avoid any races. > */ > dev_dbg(dev, "Driver %s force probe deferral\n", drv->name); > - driver_deferred_probe_add(dev); > - return ret; > + return -EPROBE_DEFER; > } > > ret = device_links_check_suppliers(dev); > - if (ret == -EPROBE_DEFER) > - driver_deferred_probe_add_trigger(dev, local_trigger_count); > if (ret) > return ret; > > - atomic_inc(&probe_count); > pr_debug("bus: '%s': %s: probing driver %s with device %s\n", > drv->bus->name, __func__, drv->name, dev_name(dev)); > if (!list_empty(&dev->devres_head)) { > @@ -681,11 +667,7 @@ static int really_probe(struct device *dev, struct device_driver *drv) > dev->pm_domain->dismiss(dev); > pm_runtime_reinit(dev); > dev_pm_set_driver_flags(dev, 0); > - if (probe_ret == -EPROBE_DEFER) > - driver_deferred_probe_add_trigger(dev, local_trigger_count); This was the only possible uninitialized use case afaict. Thanks, Alex _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx