Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp215575lqb; Tue, 16 Apr 2024 13:28:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXQ8yyZVp8jXafrLF98EOvqJRbg660QKbi/VGf2iIMIjBqVFrMhFsqCXprHPl/zegd0ATa6aQIKrxqP0Gq9Jgoym45D1/uYfarGODzxEQ== X-Google-Smtp-Source: AGHT+IEHER5dJKWVUY6SYn9v/xkPbcJvFFSUPcLiBspPxpMRWqp7CBKJmOrA3yp++3/FobnYTCnX X-Received: by 2002:a05:622a:1896:b0:434:895f:192c with SMTP id v22-20020a05622a189600b00434895f192cmr15785524qtc.18.1713299317919; Tue, 16 Apr 2024 13:28:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713299317; cv=pass; d=google.com; s=arc-20160816; b=CWCG471Juo3wj0vvneLPUruTUjHIhrQn8w9zVbS+6Dwd4O+2rI28vJSqbmD0oEutmg ewcXYPQL6BluxjLBbrl/BwbEDUSP/b/IwUkqtCLaaw4yM5N51aR/N9/N2M3q9y0Gk96P wK0yPkjQeS2Y9WrFJhoisFUe/TlPRTnK6ufS9XBPzhoK19NnIb94VVVEHOtbgquUdCOa W0G5ge14atp1GejGTD6E8TbqybqoTqNPGPE/BTJdVVhxFGLBMiBY8Sd69xf5x/rjOiuY SS697AxZNV2Lvh7QiEQJSH0i4eGCtVbg3h1q1jeDZNmqefCh2VEm73KLvEWOqZsMwuNk ly8w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=kLHgLls4gS5P0ihXiQKQoYaZ8yfQRK12740L+jVA5EU=; fh=PlOr0HGPwX8sysLAWA1FgDyQG5+QEsxpe46juAJC6y4=; b=ivrVMBvoBm0FJCTtMLyj2g67sSKU2TBoRu/GM6fYPVpjVHOBodPfp2cfDbQJ4IjyXO YNe9Jnf4XfmEc3Clmvbk56DC/k/TQxd2Ll9Iy9Ce2qMVuB77s/Gv5nJvvAlKaXZSNXJ1 OtqC1aECCcYfYU6eedWSMKsen7dO99Z24NvEnnKqDW0oMjoqETCKYzVmRNJwISd4LYh3 WQn+60ijekQQvxvUxG/8D1e4T8zoUVAWRahFfauEkU/XE5/H7t45G8BwJIEeJDdZFPBs grzWv7WhE/w4IzTHndO0NbCkfHnZy3aLJaayieqM291r+I8z24FSVgBiaV5dy2oQvNyW L1dg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=somainline.org); spf=pass (google.com: domain of linux-kernel+bounces-147518-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147518-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t35-20020a05622a182300b004367439d063si12680940qtc.696.2024.04.16.13.28.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 13:28:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147518-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=somainline.org); spf=pass (google.com: domain of linux-kernel+bounces-147518-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147518-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A1C551C211B8 for ; Tue, 16 Apr 2024 20:28:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 56DA213A259; Tue, 16 Apr 2024 20:28:34 +0000 (UTC) Received: from relay08.th.seeweb.it (relay08.th.seeweb.it [5.144.164.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1380137905; Tue, 16 Apr 2024 20:28:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.144.164.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713299313; cv=none; b=GlNRmi8EmX8ua9AI3L8TpJIDU30gcPOaF7bdf9zu94v2zKuexi9LzgsUfqOlNrj42MWbpkJfE5QFdBWo37i31nqBOEPt+su1N4/UA5oyDAUt6TutQeXOXrwUqQqV3o79EAset9PqC+iK7cfbZANuGN5ixjszi2MxYD5yaFSzBUA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713299313; c=relaxed/simple; bh=Jf3GFSgQq8PdR/zavIuEzjphkugs0D4gKD2oJXptHhY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PZ521bNVYFQCB90LLDtLadxKUAx0qz+BE0q8rCew0taDSaxm7A5GPzyQyzL2+bd8Bs7s1tLOiWsxb0MAE4wiDzfTAOCJT+nelE/8mpPzFV1KkU5T2li4HMyhNEkosfe4hyVz6yJywVZAMfSrK78w7dFsUk0j5fGPYSukbWSVorA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org; spf=pass smtp.mailfrom=somainline.org; arc=none smtp.client-ip=5.144.164.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=somainline.org Received: from SoMainline.org (94-211-6-86.cable.dynamic.v4.ziggo.nl [94.211.6.86]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id 6CFBF3FC93; Tue, 16 Apr 2024 22:22:35 +0200 (CEST) Date: Tue, 16 Apr 2024 22:22:34 +0200 From: Marijn Suijten To: Dmitry Baryshkov Cc: David Wronek , Neil Armstrong , Jessica Zhang , Sam Ravnborg , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org Subject: Re: [PATCH v2 2/2] drm/panel: Add driver for EDO RM69380 OLED panel Message-ID: Mail-Followup-To: Marijn Suijten , Dmitry Baryshkov , David Wronek , Neil Armstrong , Jessica Zhang , Sam Ravnborg , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org References: <20240415-raydium-rm69380-driver-v2-0-524216461306@mainlining.org> <20240415-raydium-rm69380-driver-v2-2-524216461306@mainlining.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On 2024-04-15 19:50:49, Dmitry Baryshkov wrote: > On Mon, Apr 15, 20 [...] > > +static int rm69380_on(struct rm69380_panel *ctx) [...] > ret = mipi_dsi_dcs_set_display_brightness_large(dsi, 0x7ff); Downstream may send this here, but why? As far as I've observed, update_status also sets &backlight_properties.brightness which you configure below. Try removing this line and maybe also set the initial brightness lower to the benefit of users' eyes and OLED lifetime? [...] > > + > > + if (dsi_sec) { > > + dev_dbg(dev, "Using Dual-DSI\n"); > > + > > + const struct mipi_dsi_device_info info = { "RM69380", 0, Personally I'm never really sure what to put in the name here, maybe something that signifies the second DSI interface of the panel? > > + dsi_sec }; > > + > > + dev_dbg(dev, "Found second DSI `%s`\n", dsi_sec->name); > > + > > + dsi_sec_host = of_find_mipi_dsi_host_by_node(dsi_sec); > > + of_node_put(dsi_sec); > > + if (!dsi_sec_host) { > > + return dev_err_probe(dev, -EPROBE_DEFER, > > + "Cannot get secondary DSI host\n"); > > + } > > + > > + ctx->dsi[1] = > > + mipi_dsi_device_register_full(dsi_sec_host, &info); > > Either you should be using devm_mipi_dsi_device_register_full() here or > you should call mipi_dsi_device_unregister() in the error and remove > paths. I'd suggest the former. There is also devm_mipi_dsi_attach() which may solve inadequate cleanup handling in the error paths below, as pointed out by Christophe. > > > + if (IS_ERR(ctx->dsi[1])) { > > + return dev_err_probe(dev, PTR_ERR(ctx->dsi[1]), > > + "Cannot get secondary DSI node\n"); > > + } > > + > > + dev_dbg(dev, "Second DSI name `%s`\n", ctx->dsi[1]->name); It looks like you inerited /all/ my debug logging when copy-pasting this setup from my in-progress dual-DSI dual-DSC Samsung ANA6707 panel driver. Since it's all working now, I suggest to remove mostly-useless debug lines like this. I'll continue the review on v3, as I mainly wanted to extend the initial devm_ suggestion from Dmitry done on v2. - Marijn