Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp449142rdb; Thu, 5 Oct 2023 10:25:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHVfvIrNfWXsVbFZ96LpyEDtmOZvFP1EnhoD6lEfZvwSghlnsvsefORltr3hvvbNC75iHn2 X-Received: by 2002:ac2:5e69:0:b0:505:6fcd:dc32 with SMTP id a9-20020ac25e69000000b005056fcddc32mr4411046lfr.28.1696526701512; Thu, 05 Oct 2023 10:25:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696526701; cv=none; d=google.com; s=arc-20160816; b=eKDE8plOM6XbDCWtSY/vqUmxh8WyNt1XdC7QgGQWGjLlK6vv/Dg5YukL0Hes1zosBK ps38Ny5C0wqUimGY2oAQiomTgfGnL3v8qvtLC7d5zTsjes7AW/e+WIsh9gZRIfkEPTcB tPIej7P7DGpFv8qJ/5gZHbp6n0X/UdT3TpNHoDMC5cXzS2QTNITnFdJLhVVAU5PcCasI 76iRrtPAPgwnu4sMGhvBPlEIYR72TywcFu9uvaZN3Hb1hoz9ShOLIs/ZK9AD3HtS7iS8 fJZuvvEUvjTtdoAEXMO8uUt3n6tc2CocpJVg710RcX6rK8sfpp7a41fueeJbe8yDoKx7 LNjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:user-agent:from:references:in-reply-to:mime-version :dkim-signature; bh=K4qtwUC5OWXLWsxsdHc8Vyp8jChtnD5xWpTwtPZAf1Y=; fh=PqiWda0xl/PiQYKfUvkBce5G1dGlkkHfMNjQ7KhjXW4=; b=h9WvdyC2T/0ttgy61dBJhutGv9CrwCg3WxLmIq7/ET3apDoKUIuqr8pl5THVI9tTtb 7pOxZ7MVbyjkbBgslqJaXC2totdP/7pKvVqTrPsmtiZlfJINqp0Iiaq9GytJrIhf7W7L 6XTkCIWDK6Q9r6qzzedWKA+LZ6iJKd6osAw5YDl4t1R0/+TtG95exzr3tCcPH+SSUnex qpAIWgV5yDepm1EWDOwpTElcMJdI4M7sJWVvxYMk+VZ1eH4mSI+z+7WhpLn0fp6pzTjB w31bbcqy81K905jM4yFNA11ypdAQMJbbAeqQK+0t0EiuDR0iW6EvwoAA+3lRhbkOz/Fd zbBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aufTk7Wg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id l15-20020a19c20f000000b004fe132171fcsi1643705lfc.597.2023.10.05.10.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 10:25:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aufTk7Wg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 9EADC8451ECA; Thu, 5 Oct 2023 10:24:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230140AbjJERYs (ORCPT + 99 others); Thu, 5 Oct 2023 13:24:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230129AbjJERYB (ORCPT ); Thu, 5 Oct 2023 13:24:01 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9877126A5 for ; Thu, 5 Oct 2023 10:18:57 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-50444e756deso1683288e87.0 for ; Thu, 05 Oct 2023 10:18:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696526336; x=1697131136; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:user-agent :from:references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=K4qtwUC5OWXLWsxsdHc8Vyp8jChtnD5xWpTwtPZAf1Y=; b=aufTk7WgCjA2W81VlyHK3EPYXITg2dkKoyqNTSQCb9iKg/joGncbf3BUNz+NZgnVso H/gj+LxUhFqnfqGMWxuUkkfh/jIMY+h0DEd3JCckTTqEaXNBqfKBZ2qYtmBf/yRBhGZt oNqV4s6KCKVZpEDu7JKlyb0us1/JU43HH2SpI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696526336; x=1697131136; h=content-transfer-encoding:cc:to:subject:message-id:date:user-agent :from:references:in-reply-to:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=K4qtwUC5OWXLWsxsdHc8Vyp8jChtnD5xWpTwtPZAf1Y=; b=gkm2V9esKuO6qzqEvaYWMOIAsEb3Tu25KUc7FHydXh0I09+HtLZjoF/ztE7Dy9doUy 4zWf7fU8IRA2/ksiqN+UXMO9rYonCpq6OzZ+d2JzSvXVU4MGFAyKGOnLqyHk1KRjrCFY c0bwHE4GYFOg7o8/5aMeZJPWz4NnTic/nUNJFwNJhfNDINrtqUtCGxtj+Td7mdrGtrM5 lORf338tUp6N3mlMZht21w93KqgTHo+xOGpNl/dcmlIEmxjqONl8q0sX7kf5K8W4P0wa SOGCAVoJVJ16mBBvunAT6Mu4McU0UK++4mUgNv17CifpygOn+BMC8p2YJT7s1MY2yid5 HhfQ== X-Gm-Message-State: AOJu0Yy84NmDpLHhuVRHttIwdBbrXt2yDEioQluMSP5eBz5ypQBCaWwA avRjNP25mx9fVI1TwQ7F5TlMBCW1f6sn+7eIzuMXSg== X-Received: by 2002:a05:6512:2030:b0:503:258f:fd15 with SMTP id s16-20020a056512203000b00503258ffd15mr4793359lfs.20.1696526335763; Thu, 05 Oct 2023 10:18:55 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 5 Oct 2023 12:18:55 -0500 MIME-Version: 1.0 In-Reply-To: References: <20231002235407.769399-1-swboyd@chromium.org> From: Stephen Boyd User-Agent: alot/0.10 Date: Thu, 5 Oct 2023 12:18:55 -0500 Message-ID: Subject: Re: [PATCH] drm/bridge: ti-sn65dsi86: Associate DSI device lifetime with auxiliary device To: Doug Anderson Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , linux-kernel@vger.kernel.org, patches@lists.linux.dev, dri-devel@lists.freedesktop.org, Maxime Ripard Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 05 Oct 2023 10:24:56 -0700 (PDT) Quoting Doug Anderson (2023-10-02 17:31:41) > Hi, > > On Mon, Oct 2, 2023 at 4:54=E2=80=AFPM Stephen Boyd = wrote: > > > > The kernel produces a warning splat and the DSI device fails to registe= r > > in this driver if the i2c driver probes, populates child auxiliary > > devices, and then somewhere in ti_sn_bridge_probe() a function call > > returns -EPROBE_DEFER. When the auxiliary driver probe defers, the dsi > > device created by devm_mipi_dsi_device_register_full() is left > > registered because the devm managed device used to manage the lifetime > > of the DSI device is the parent i2c device, not the auxiliary device > > that is being probed. > > > > Associate the DSI device created and managed by this driver to the > > lifetime of the auxiliary device, not the i2c device, so that the DSI > > device is removed when the auxiliary driver unbinds. Similarly change > > the device pointer used for dev_err_probe() so the deferred probe error= s > > are associated with the auxiliary device instead of the parent i2c > > device so we can narrow down future problems faster. > > > > Cc: Douglas Anderson > > Cc: Maxime Ripard > > Fixes: c3b75d4734cb ("drm/bridge: sn65dsi86: Register and attach our DS= I device at probe") > > Even before that commit I think it was using the main "dev" instead of > the auxiliary device's "dev" for some "devm" stuff. I guess the > difference is that it wouldn't mess with probe deferral? Searching > back, I think the first instance of a case that was using "devm_" with > the wrong device was commit 4e5763f03e10 ("drm/bridge: ti-sn65dsi86: > Wrap panel with panel-bridge")? Would it make sense to use that as a > Fixes, you think? The problem for me is that the dsi device is registered twice. That happens because probe for the auxiliary device happens twice. I was cautious about the fixes tag here because it didn't look like probe deferral was happening before commit c3b75d4734cb. > > In any case, this looks reasonable to me: > > Reviewed-by: Douglas Anderson > > I'll give it a week and then apply to "-fixes" if everything is quiet. Thanks!