Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp464485lqp; Tue, 11 Jun 2024 09:22:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU59uCgxf1FsoSNP2oGb2UyDMNXZ86ZuGU+BdGqFu4brZlPlIsiYFxWl8mSOVL5k/rSmjIr+ZCEQLEGmJHW3VnNT3OMKIU0N5fkXryjTw== X-Google-Smtp-Source: AGHT+IHxWjyej70j1ZVcTPVekRaJ4KX1L+M9olnYibqUHkadk6vnkQT7rPRHKTs4BihbD/TJq27V X-Received: by 2002:a05:6871:152:b0:250:7dba:9501 with SMTP id 586e51a60fabf-25464800011mr14131650fac.41.1718122940166; Tue, 11 Jun 2024 09:22:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718122940; cv=pass; d=google.com; s=arc-20160816; b=yKfFGaqFZoMHLjU0P9NMvNHkaZnX70lb6z5OCJ1Ondr8TqYmxE2NrmI7Cgfbgdgxcp vvTYGkIHXAyJqlACiseikbzOPTt/m97btXpgnGdIlYR64uqrMkwzu8ggMIeP+cU6mRPA P54zfAxr5+6KfHCZZLjgTsANi0rWLUouRpRk2LK8tbABr+fY8yGGhQ/AEWvAy3/uUHZD 74TgKxur6d7u/e/CjDtwin7bGLWZD9//fCkdCyfnrequccD7yC10nKGeQW06a1gN98g0 pQZ/iKgDnZc8QB3RBYfyrQtUkq5S8kmC8O6majXe24QPulV+NU/XF2m7sbWB8L8P3iTy NCXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=JQxvDf5UzR5oDkZoOHfjVzcIFa7H1tAgUbuPebpZYkA=; fh=U0QbBJpkNSq3lbLsDA4yghNW5O+xw4vFWodMOzo4bJw=; b=MTkmK8DO21FitwBDHIvQLDBZjgnC8Ol9LLVl355ngE3snyHtbBqqLbikQ2i0AiLP6X A4bnkK7em0dP3aCrYSUvY/Fjo/Rt1lMvf5tH+ykyfngJDopqJVLLJbWFnPSNW3vPLuGG 4eValAAx6GaFh/LWoxvtj2dHX8wxnnRWS0KHDGsjT8vTDBrzqi0unqPrhW+SUZi7VJVk GdL8UG5+sbYNPwduhLXOtc1rDr2xu3z3goti3+9fKcuzoFz4jJtJi1gSeKYRXGWBwYH+ WRw+y56fnDv6ulHBQFfZ0y7dOVj5lk8yCy3Il2DovkQJfof9hN/cRfzNBctlGq+RpWX4 jYJw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gHJCxLgj; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-210228-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210228-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ada2fe7eead31-48d80937d72si903564137.355.2024.06.11.09.22.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 09:22:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210228-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; dkim=pass header.i=@chromium.org header.s=google header.b=gHJCxLgj; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-210228-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210228-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 487811C237D9 for ; Tue, 11 Jun 2024 16:22:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 560C33CF63; Tue, 11 Jun 2024 16:22:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gHJCxLgj" Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com [209.85.219.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E2B873B2A2 for ; Tue, 11 Jun 2024 16:22:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718122933; cv=none; b=DpEhgftZk6z+Hx8yXrV3RqYxTTLYVd65T5kjWleyiwoEg9pUF/WlE9kz7cyLHG44RvZnMGXSeHYLdBr2B0ig80jvA10ZsUap0RQSO/klW8MS7GV5DgkBpsol3qHncLhpkrKnX6tMA7jasOQuKQ+4oqfy+AqKlOWmTx6OLS4CQLo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718122933; c=relaxed/simple; bh=Za4eT6Zh4nstNKeeM5l0obbQ8cEcGiiwE8dcwpGXF/A=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=HpxAxC5KJTQaU58kfd1QTBBMXPb+dNgUXLaMyfxttIRdMCRylXCQvl6VXx4x7CcFTLTGQdUqDs7KZ8Q6LnGPEVA0pGkIjHh34ctZCanKuVO6mgMkXxwrdG3xhe3x8Ak8j3W1CL+Z3AfVGu9KeVn/eROsCP+fbrACYkDnq3LOw4Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=gHJCxLgj; arc=none smtp.client-ip=209.85.219.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-yb1-f172.google.com with SMTP id 3f1490d57ef6-dfa6e0add60so5753305276.3 for ; Tue, 11 Jun 2024 09:22:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718122928; x=1718727728; 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=JQxvDf5UzR5oDkZoOHfjVzcIFa7H1tAgUbuPebpZYkA=; b=gHJCxLgj8t4sOzuFnGRcfsurUmL+7orfz/FW49AGQo85qlY/ITEo7FG+fBQ00Me9VQ t+27sgf6TZTPEj7SQBx8TzEGWTNo2LxCMSaCRStFqLOuKmr79h1YAlp315DxMGsR5CxY a8+eXhGNhf4uouX+udhAh6+Q3mxutkuGuYCnw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718122928; x=1718727728; 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=JQxvDf5UzR5oDkZoOHfjVzcIFa7H1tAgUbuPebpZYkA=; b=EYVSmyLWBGuWOk46m7QJBEMGT/romqmBfQ6thsPTrw0aPTRHHSBM0lAROg9TIbe0cL SlYtS2wHMo3tK8jRRjcYHMr0X2aI4ziS6O+FBYGxJ6e23+cB3XTFU/z9Dse70QabV8yh cFEDbm3N7ImTxL8xiiDJP3ZdcZSIyDkib8xEsuKrxU7etNgHzgFPyT3/ak7YvPw6WF7s VZKIE0a3XLO5tHt0fk1bcVqe/9d79wAX++h9MtYBDPCmITxrTBjXFxQAJdP9lzwxxb6k hLoT/yutYi8oZAr2Q6bngQHh3tG2zRBUsuhM2TPjPVBxvQsgi5zauZFOsaY6AOOsw3K+ WSZA== X-Forwarded-Encrypted: i=1; AJvYcCXd1M/urQ6F+wIp4ABmBms9agTRmrpQt713XpqI7lepOsVrU0gzr6020T76oBSWkGY6ZuJhX9loL0T5uYkjBj05n7yziXEs3Wz02tmv X-Gm-Message-State: AOJu0Yx15etZDkUt+fGyodr7CRork/bvUHfJhc/hCnIQ8BgS3vkXwF+d k+Q1oC46plLkCii3SWyZN8HzoKpUthT+S5Setm0W6Ydzga61mQmCASkR1ul4VjBVfP/cQNgdrXM = X-Received: by 2002:a25:d347:0:b0:dfa:febf:5a72 with SMTP id 3f1490d57ef6-dfafebf5d04mr10870275276.38.1718122927930; Tue, 11 Jun 2024 09:22:07 -0700 (PDT) Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com. [209.85.160.171]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-44155eec71fsm3041671cf.57.2024.06.11.09.22.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Jun 2024 09:22:07 -0700 (PDT) Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-4405dffca81so218191cf.1 for ; Tue, 11 Jun 2024 09:22:06 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWRGr3j/JiYuTN7vjRFSVFjd+CMih2IN87FC/usbTr+F3VPyh6k/Ao6svqDjr8c4c9Zn/PryB6uBZb+D6v38HS8JvXSGK3qlXsTU/4Z X-Received: by 2002:a05:622a:2b47:b0:441:5420:6d3b with SMTP id d75a77b69052e-44154206e67mr2028121cf.2.1718122925584; Tue, 11 Jun 2024 09:22:05 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <1b7c19ec-536f-4f28-a68f-b03c1b51b99b@gmail.com> In-Reply-To: <1b7c19ec-536f-4f28-a68f-b03c1b51b99b@gmail.com> From: Doug Anderson Date: Tue, 11 Jun 2024 09:21:54 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] drm/panel : himax-hx83102: fix incorrect argument to mipi_dsi_msleep To: Tejas Vipin Cc: neil.armstrong@linaro.org, quic_jesszhan@quicinc.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dmitry Baryshkov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Tue, Jun 11, 2024 at 7:05=E2=80=AFAM Tejas Vipin wrote: > > mipi_dsi_msleep expects struct mipi_dsi_multi_context to be passed as a > value and not as a reference. > > Fixes: a2ab7cb169da ("drm/panel: himax-hx83102: use wrapped MIPI DCS func= tions") > > Signed-off-by: Tejas Vipin Should be no blank line between "Fixes" and "Signed-off-by" > --- > > Changes in v2: > - Add Fixes tag > > v1: https://lore.kernel.org/all/d9f4546f-c2f9-456d-ba75-85cc195dd9b8@gmai= l.com/ > > --- > drivers/gpu/drm/panel/panel-himax-hx83102.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) I notice you didn't CC me, even though I authored the broken commit. Presumably get_maintainer should have suggested you CC me? > diff --git a/drivers/gpu/drm/panel/panel-himax-hx83102.c b/drivers/gpu/dr= m/panel/panel-himax-hx83102.c > index 6009a3fe1b8f..ab00fd92cce0 100644 > --- a/drivers/gpu/drm/panel/panel-himax-hx83102.c > +++ b/drivers/gpu/drm/panel/panel-himax-hx83102.c > @@ -479,7 +479,7 @@ static int hx83102_disable(struct drm_panel *panel) > mipi_dsi_dcs_set_display_off_multi(&dsi_ctx); > mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx); > > - mipi_dsi_msleep(&dsi_ctx, 150); > + mipi_dsi_msleep(dsi_ctx, 150); So while your fix is correct, it's not really enough. I swore that I compile tested my change and, sure enough, the bad code compile tests fine. This is because the macro mipi_dsi_msleep() fell into a macro trap. :( Specifically, we have: #define mipi_dsi_msleep(ctx, delay) \ do { \ if (!ctx.accum_err) \ msleep(delay); \ } while (0) Let's look at "if (!ctx.accum_err)". Before your patch, that translated to: if (!&dsi_ctx.accum_err) ...adding extra parentheses for order of operations, that is: if (!&(dsi_ctx.accum_err)) ...in other words it's testing whether the address of the "accum_err" is NULL. That's not a syntax error, but _really_ not what was meant. We really need to fix the macro trap by changing it like this: - if (!ctx.accum_err) \ + if (!(ctx).accum_err) \ When you do that, though, you find that half the users of the macro were using it wrong since every other "_multi_" function passes the address. IMO while fixing the macro trap we should just change this to pass the address and then fix up all the callers. This is a serious enough problem (thanks for noticing it) that I'm happy to send out patches, but also I'm fine if you want to tackle it. If I don't see anything from you in a day or two I'll send out patches. Thanks! -Doug