Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp436665rdg; Thu, 12 Oct 2023 09:44:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEcHXCrSI7PfbwIF40vcVoLXgGyJYDbVhY/yaSXaQMewnv4ELlResEycaDnKymP1Dk9z/PX X-Received: by 2002:a17:90a:b945:b0:27c:f21b:6342 with SMTP id f5-20020a17090ab94500b0027cf21b6342mr7387055pjw.22.1697129066140; Thu, 12 Oct 2023 09:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697129066; cv=none; d=google.com; s=arc-20160816; b=yZidHqxgHoMRp9AvfZllS1MXsIjDnFcHuIf5XmzxqNjxmb5I2hv8D51lguU5Tgh6IZ gQDdI2iKrYQKohViR+y+x3IJl2o3+vYw9vxK2NJ8m0vN09k0r8vfyFwl39Z1JzQelHu8 YUyxSMtSlgkw1ytroj71Ij1VEJCk50QZ6XNOCiSDa5C/cdV6oH8829so48A7Sqgq2bH1 6UMsAicDYDa2FIBDmnWPAfA6kLo4OCvIPnYla/IIN1OrVjWZFA+XFV8Nw3zAAYdurZNr 3JDnkQB6VhBgNC+fAEPlgkMbV49LJOb0nioTiDD7+TJsGJgaG2SCC4YKjCtnbktowrPk PC3A== 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:from:in-reply-to:references:mime-version :dkim-signature; bh=z24YZGqTCXcSjZw7pVvFeMUQZsyzVXoHF/bkKgAPfjE=; fh=CZb2P/vCstX3isgLWVfyR9XlCe1mFLiDtIQ1CuVHeN0=; b=YqBIzD8PIu0MxmcQ0nfHxCLvk7YuO7kMYlOeQwH/Ww6BN+hNLfeieeCQNzPTfcwKV+ QlgkSGWQJZ+gMqXzI0YDQI/c1g2E6tb+LX5+4tIJw40qVky+7MkhbveylJi31UJnjklt yLOoSoA3J4d0tN4B5KLp8gbvEStca/KIkdbTWO5cXJ0ZAOSpSK44W/eGTvkDPoy8wfGr YsBAztPkAGlbBJuHi/cI9smxzc2OFtFzBI9bJl69iyXomXdqIUStp438fgDUy68xvuu4 26mpuwO7TteM9rTUWL7eJeV2PBqFgmYZO9jbbQSuCKyS/NOp1tRFtt7jSSc/gLD52yL6 Ysmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SHwx79G3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id kb4-20020a17090ae7c400b002765eee2b6bsi2890840pjb.46.2023.10.12.09.44.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 09:44:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SHwx79G3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 3F3CC823CE91; Thu, 12 Oct 2023 09:44:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379509AbjJLQoX (ORCPT + 99 others); Thu, 12 Oct 2023 12:44:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233988AbjJLQoV (ORCPT ); Thu, 12 Oct 2023 12:44:21 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F723C0 for ; Thu, 12 Oct 2023 09:44:18 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-9a645e54806so183904366b.0 for ; Thu, 12 Oct 2023 09:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1697129055; x=1697733855; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=z24YZGqTCXcSjZw7pVvFeMUQZsyzVXoHF/bkKgAPfjE=; b=SHwx79G3UQqzyVKeli6auhjv9NNPiTFdyyE7DBEMjaTw5VO6E8GtEZysztWDc4lX9c HWVKp7XTYvTXLs17uy2HXZNEOIdpuxYdpbCZWKOxmVq0PNgCkwy/qLvusznTk/qdfyIF 2WufDQOfkIFhfpWVsHrrgA5L9pGZB6iQxDZPE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697129055; x=1697733855; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z24YZGqTCXcSjZw7pVvFeMUQZsyzVXoHF/bkKgAPfjE=; b=RRY4VlJHuu7FcPS9AkYbTeMmwcyoEbJK802i0yNKAf2pEJbOTeaN1qKaBmUPQ7AiSY wWkf6RHTSWiWH55OJtDBtNcKcMgHNSkxhKxq5uIC6hrsOqANyBmX+V3PcxvdfmaLXjD8 pdP0tHEpzubuW1wGfmsIr6ZbmgSMYXqPNZKMfRuIf9YEQEbJHAu8xKkFval9xjbBJcdQ QUH2jxzNZ8QrZABdtFd2RJzn3hIL4JGcrZ7EsxQQNZOJbjByVU+twBu8aBkd9o8kh2Mo 9/IsXg/PWoiyYnQ2c1QKEf+se5U0ewG6qW+QtdQICz56dNN8iblg67pY2wqr/K3nVvQT fhtA== X-Gm-Message-State: AOJu0YwldyDINN6XkZXL7DdgLKf6EGB1IRHl41qOT4lw4DC7/3otrYQv bimI9BSSnR5jKptwDmpKGHfxlB7soYzgiT80ZiJ0Sw== X-Received: by 2002:a17:906:1d:b0:9ae:505d:310b with SMTP id 29-20020a170906001d00b009ae505d310bmr22063887eja.39.1697129055061; Thu, 12 Oct 2023 09:44:15 -0700 (PDT) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com. [209.85.128.54]) by smtp.gmail.com with ESMTPSA id a24-20020a170906685800b009828e26e519sm11215406ejs.122.2023.10.12.09.44.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Oct 2023 09:44:14 -0700 (PDT) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-405459d9a96so1855e9.0 for ; Thu, 12 Oct 2023 09:44:14 -0700 (PDT) X-Received: by 2002:a05:600c:1d10:b0:404:7462:1f87 with SMTP id l16-20020a05600c1d1000b0040474621f87mr293864wms.6.1697129053819; Thu, 12 Oct 2023 09:44:13 -0700 (PDT) MIME-Version: 1.0 References: <20231002235407.769399-1-swboyd@chromium.org> In-Reply-To: From: Doug Anderson Date: Thu, 12 Oct 2023 09:43:57 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/bridge: ti-sn65dsi86: Associate DSI device lifetime with auxiliary device To: Stephen Boyd 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=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Thu, 12 Oct 2023 09:44:25 -0700 (PDT) Hi, On Thu, Oct 5, 2023 at 10:18=E2=80=AFAM Stephen Boyd = wrote: > > 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 regis= ter > > > 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 ds= i > > > device created by devm_mipi_dsi_device_register_full() is left > > > registered because the devm managed device used to manage the lifetim= e > > > 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 err= ors > > > 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 = DSI 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! Pushed to drm-misc-fixes leaving your existing "Fixes" line: 7b821db95140 drm/bridge: ti-sn65dsi86: Associate DSI device lifetime with auxiliary device -Doug