Message ID | 20230717141438.274419-4-angelogioacchino.delregno@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1149433vqt; Mon, 17 Jul 2023 07:32:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlGZjUDXjqoyjQAiBRJAoMPPVbKEz862DIO9+ppqVK09XKn6OM9Waq8u0iZy8mlluVbQhYKO X-Received: by 2002:a17:902:744b:b0:1b8:1c9e:442c with SMTP id e11-20020a170902744b00b001b81c9e442cmr9613154plt.20.1689604358320; Mon, 17 Jul 2023 07:32:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689604358; cv=none; d=google.com; s=arc-20160816; b=pwU7Btc5+42Tt71ZHHOa46MIPuT0jwdgz3d55hTlDUCJ+ssGTKo1PZgzVCfuYPq8hN MYQ5Q4SuPqV1DdXVy1H8J6ok+ZeQpaGtz+kWBOaP//SzZDlgw0FyxGH0l7hc6ljxdUAf 1l49oaOG5nsdX1S/dc3GlPlPZ/v12QSuZfLOXGmC38855tp37C+jNM0boeGABJ4Cho8C k+0NOj2M8UjMTy+kY0z/5m6tML2Q1SISGDD3ag7T2IbkESmHgDEG6D8TscmP4Xcr9Arl aru8SSZUURb13iazESGj4VXR7i08Yu8A5vvNdDOgTIHyrdsxc1dp/hgh6dJxXrDV73fn 3V/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FnYMi4qY2uYO9bM6HVyTfvzGs8TTERa37BKNZmNJIgM=; fh=JpmmvsKbFEtjFcPhKwAU/TS0J6xmkcPCzvp06hVht3s=; b=Ro9YLrSlW5EV9VZ54P3KBfp9/dpWAND9oEsJtyUe5MwWu/5Gozhfe+VNHgUh3QBusf ewgo9IrMb+w/ZWS7ZniRq77Nm9Nnw0n6Y1TEvW7h9XKIw/z8DTOOZF0768AYTK4NtIes TG47YB3M71whLNkOa/la4TYozUq7Tr5iHRlrzc9rtc0Mz0vDhiq/PawFEP0LT6amEqhy lMWn4G09G3kwQAzli4+VKqcUQhhOUtShF8tSx1k0+vNBgsoBmAdw4TOSk6IgmafdXRcV 3Zkjb123VUB9/kS2UXAjOxy8ebD/xLv4nKIu1o4lHGT6tHgW8N31eRbIRkNlN99oXRHS Av1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=V9dF57Qc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j4-20020a170903028400b001b8ae69289dsi11862614plr.539.2023.07.17.07.32.25; Mon, 17 Jul 2023 07:32:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=V9dF57Qc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232187AbjGQOPE (ORCPT <rfc822;hadasmailinglist@gmail.com> + 99 others); Mon, 17 Jul 2023 10:15:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232152AbjGQOOw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Jul 2023 10:14:52 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 430F410D7 for <linux-kernel@vger.kernel.org>; Mon, 17 Jul 2023 07:14:47 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 61AB86607065; Mon, 17 Jul 2023 15:14:45 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1689603286; bh=kKU4HTE/J0aKcQTNyeW8JikkjhCBaQvDbF5Kxj8x8Ac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V9dF57QcRiObKK67hOr4s5T5zw3R5AYW2tB0g1jsSSlvILbDFACdFMQEK84l/5Hd9 w03KHbK18/q7dUuu6Lz0QCOsCxrUU78SvI9drbtUBjPW0YjbvuuNsBl+Mpsvdlj38E YEZdiQDeMTzBhozuYzzl/lBbGGvJLWqcyJRNh0Gz+CE5pHJf6ac/v5zMTRR8gp35MV AzzprVD9plVViIjRD8nK9xbRTD2z6Z5m6BF9x7wFINyGmNQtWpxfeNWGSi1tAFbeJc lT2gdCF+4hSYFlxps/1lAZTw6wiHZtS8YN5PhdKJSb1P18ONQlwoBjRM+BLZ6xIb/u ZkKz6xLUdwS5A== From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> To: chunkuang.hu@kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, wenst@chromium.org, nfraprado@collabora.com Subject: [PATCH v6 03/11] drm/mediatek: dp: Change logging to dev for mtk_dp_aux_transfer() Date: Mon, 17 Jul 2023 16:14:30 +0200 Message-Id: <20230717141438.274419-4-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230717141438.274419-1-angelogioacchino.delregno@collabora.com> References: <20230717141438.274419-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771678579556464954 X-GMAIL-MSGID: 1771678579556464954 |
Series |
MediaTek DisplayPort: support eDP and aux-bus
|
|
Commit Message
AngeloGioacchino Del Regno
July 17, 2023, 2:14 p.m. UTC
Change logging from drm_{err,info}() to dev_{err,info}() in functions mtk_dp_aux_transfer() and mtk_dp_aux_do_transfer(): this will be essential to avoid getting NULL pointer kernel panics if any kind of error happens during AUX transfers happening before the bridge is attached. This may potentially start happening in a later commit implementing aux-bus support, as AUX transfers will be triggered from the panel driver (for EDID) before the mtk-dp bridge gets attached, and it's done in preparation for the same. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: Chen-Yu Tsai <wenst@chromium.org> --- drivers/gpu/drm/mediatek/mtk_dp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Comments
Hi, Angelo: On Mon, 2023-07-17 at 16:14 +0200, AngeloGioacchino Del Regno wrote: > > External email : Please do not click links or open attachments until > you have verified the sender or the content. > Change logging from drm_{err,info}() to dev_{err,info}() in > functions > mtk_dp_aux_transfer() and mtk_dp_aux_do_transfer(): this will be > essential to avoid getting NULL pointer kernel panics if any kind > of error happens during AUX transfers happening before the bridge > is attached. > > This may potentially start happening in a later commit implementing > aux-bus support, as AUX transfers will be triggered from the panel > driver (for EDID) before the mtk-dp bridge gets attached, and it's > done in preparation for the same. Reviewed-by: CK Hu <ck.hu@mediatek.com> > > Signed-off-by: AngeloGioacchino Del Regno < > angelogioacchino.delregno@collabora.com> > Tested-by: Chen-Yu Tsai <wenst@chromium.org> > --- > drivers/gpu/drm/mediatek/mtk_dp.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c > b/drivers/gpu/drm/mediatek/mtk_dp.c > index 77da0d002e9f..98f63d8230e4 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dp.c > +++ b/drivers/gpu/drm/mediatek/mtk_dp.c > @@ -847,7 +847,7 @@ static int mtk_dp_aux_do_transfer(struct mtk_dp > *mtk_dp, bool is_read, u8 cmd, > u32 phy_status = mtk_dp_read(mtk_dp, > MTK_DP_AUX_P0_3628) & > AUX_RX_PHY_STATE_AUX_TX_P0_MASK; > if (phy_status != AUX_RX_PHY_STATE_AUX_TX_P0_RX_IDLE) { > - drm_err(mtk_dp->drm_dev, > + dev_err(mtk_dp->dev, > "AUX Rx Aux hang, need SW reset\n"); > return -EIO; > } > @@ -2054,7 +2054,7 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > is_read = true; > break; > default: > - drm_err(mtk_aux->drm_dev, "invalid aux cmd = %d\n", > + dev_err(mtk_dp->dev, "invalid aux cmd = %d\n", > msg->request); > ret = -EINVAL; > goto err; > @@ -2070,7 +2070,7 @@ static ssize_t mtk_dp_aux_transfer(struct > drm_dp_aux *mtk_aux, > to_access, &msg->reply); > > if (ret) { > - drm_info(mtk_dp->drm_dev, > + dev_info(mtk_dp->dev, > "Failed to do AUX transfer: %d\n", > ret); > goto err; > } > -- > 2.40.1
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> On 17/07/2023 16:14, AngeloGioacchino Del Regno wrote: > Change logging from drm_{err,info}() to dev_{err,info}() in functions > mtk_dp_aux_transfer() and mtk_dp_aux_do_transfer(): this will be > essential to avoid getting NULL pointer kernel panics if any kind > of error happens during AUX transfers happening before the bridge > is attached. > > This may potentially start happening in a later commit implementing > aux-bus support, as AUX transfers will be triggered from the panel > driver (for EDID) before the mtk-dp bridge gets attached, and it's > done in preparation for the same.
diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c index 77da0d002e9f..98f63d8230e4 100644 --- a/drivers/gpu/drm/mediatek/mtk_dp.c +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -847,7 +847,7 @@ static int mtk_dp_aux_do_transfer(struct mtk_dp *mtk_dp, bool is_read, u8 cmd, u32 phy_status = mtk_dp_read(mtk_dp, MTK_DP_AUX_P0_3628) & AUX_RX_PHY_STATE_AUX_TX_P0_MASK; if (phy_status != AUX_RX_PHY_STATE_AUX_TX_P0_RX_IDLE) { - drm_err(mtk_dp->drm_dev, + dev_err(mtk_dp->dev, "AUX Rx Aux hang, need SW reset\n"); return -EIO; } @@ -2054,7 +2054,7 @@ static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux, is_read = true; break; default: - drm_err(mtk_aux->drm_dev, "invalid aux cmd = %d\n", + dev_err(mtk_dp->dev, "invalid aux cmd = %d\n", msg->request); ret = -EINVAL; goto err; @@ -2070,7 +2070,7 @@ static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux, to_access, &msg->reply); if (ret) { - drm_info(mtk_dp->drm_dev, + dev_info(mtk_dp->dev, "Failed to do AUX transfer: %d\n", ret); goto err; }