Message ID | 20230404104800.301150-6-angelogioacchino.delregno@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2928925vqo; Tue, 4 Apr 2023 03:52:23 -0700 (PDT) X-Google-Smtp-Source: AKy350YQU41HGXMX3x98cRd8WQUahDvR7aR0nPfXTMjdMAlIXmyzetAppBHHbdPO/JbmOGdGVoLp X-Received: by 2002:a05:6a20:3aa6:b0:d9:5a7c:b1c5 with SMTP id d38-20020a056a203aa600b000d95a7cb1c5mr1867606pzh.11.1680605543642; Tue, 04 Apr 2023 03:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680605543; cv=none; d=google.com; s=arc-20160816; b=Jg2E5upTE9NXV24ItkNdpr0y2LVyRZUatXO4oUVbpy7YGHJWG24Wd7VKTHLTRlsWMM JZ1VPEiij1G5dEaOnK88NSSsEJt/CqHyxihiYV+qEhoRK6FOQ6PlKrDOKm0Aofc03+Nn NUHpatC36P3NEomVJcabqWQKXzWD81StQu5R/KdO7Q1WjIzmNFIZ8IbQ4p/SwunZgV0O UqGUkBGHFcu4UWmQMRr6q6JTicCsGZAnwtC5Bwx47koVM1xiWNCEb6wkMleRhF+IBaHw lN3xais8EYXXoTisesyAl1TloiC8p/T+K9AcZxTv6flGN62iaelxuERHHKCuGV7ug6xD sJiA== 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=6FtVoiMV/omg48bRFmqt6pDYPYlhyrqg6evx0w4MWTE=; b=K5WuSFwaHhr4EvrPN1PcV1HChLtWNaBLNaT+fbNpDK7Oq490fkqohgy481OMYV83zl pUpx6/gGv7s1JnGYKPZh9hCp0JvrGTx31uEDNreUnBNUmBLAruBmAtsoFcKbb55DT6kF 5SooFFhnM0lNS/GjopbIIAv69C2UexTVrjNYA5OTK9pJpYjsVtNlYCViwwVV495Z6vQd JhexpJQ246Cm+3CrS+C5imaX1ihbkx8kU96HRDjdpnnSxqlh6Ub9PetV7MTilnj+4unC 1qh5wmtq3Jn7sUbSmQxrbhGmJDic9ksE3CmDmmGFi+npRggiujZfQSZZDQBk5nqyYSst 440A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=i5C7Dnru; 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 p7-20020a63f447000000b0051410d92aeesi1929472pgk.184.2023.04.04.03.52.09; Tue, 04 Apr 2023 03:52:23 -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=i5C7Dnru; 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 S234577AbjDDKs1 (ORCPT <rfc822;lkml4gm@gmail.com> + 99 others); Tue, 4 Apr 2023 06:48:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234539AbjDDKsM (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 4 Apr 2023 06:48:12 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 202C61BD9 for <linux-kernel@vger.kernel.org>; Tue, 4 Apr 2023 03:48:11 -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 5F47166031F3; Tue, 4 Apr 2023 11:48:09 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1680605290; bh=dxC6MHx3NJXRAEW1ywTcNfOZX7I8dn5v2i9D/PKGK9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i5C7DnruKzSV3Agq2NqRphzX/Cx52AGby+gu0C7QGWQ5Imikzj8NFp4HQkc+PLgxQ ZiyN6JcMIpFRHHlsJdj5XvlYS2XgWDXes5ALWZP0AfhQbh0E3fVc0Ry8rKqalRFS3Q rDBb6W2dW3cY7WXdqXPlTNuYYYA5yUnfmI9kEaqKLQS3wtEzvVwYCaeVkEg1bn1ToK yckdl50XJ6WH/y2rGqZWpWBjrGG/nGgpMFKCenAIV6rj/nc620CTm0uwo7fC33X6/2 xwtQb/uxE5YMBMpjiYbRzWmDlXomG3arTedylYohRbUFkjS21Luo58QEiFCifgjFQV 19Yg+zRPBLDQg== 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 Subject: [PATCH v3 5/9] drm/mediatek: dp: Change logging to dev for mtk_dp_aux_transfer() Date: Tue, 4 Apr 2023 12:47:56 +0200 Message-Id: <20230404104800.301150-6-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230404104800.301150-1-angelogioacchino.delregno@collabora.com> References: <20230404104800.301150-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762242638493379184?= X-GMAIL-MSGID: =?utf-8?q?1762242638493379184?= |
Series |
MediaTek DisplayPort: support eDP and aux-bus
|
|
Commit Message
AngeloGioacchino Del Regno
April 4, 2023, 10:47 a.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>
---
drivers/gpu/drm/mediatek/mtk_dp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
On Tue, Apr 4, 2023 at 6:48 PM AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> 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. > > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> > --- > 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 ac21eca0e20e..19b145cf2e05 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dp.c > +++ b/drivers/gpu/drm/mediatek/mtk_dp.c > @@ -849,7 +849,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; > } > @@ -2061,7 +2061,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; > @@ -2077,7 +2077,7 @@ static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux, > to_access); > > if (ret) { > - drm_info(mtk_dp->drm_dev, > + dev_info(mtk_dp->dev, > "Failed to do AUX transfer: %d\n", ret); This part no longer applies cleanly due to drm/mediatek: dp: Change the aux retries times when receiving AUX_DEFER Also I think all these calls could be collapsed into one line? ChenYu > goto err; > } > -- > 2.40.0 >
diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c index ac21eca0e20e..19b145cf2e05 100644 --- a/drivers/gpu/drm/mediatek/mtk_dp.c +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -849,7 +849,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; } @@ -2061,7 +2061,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; @@ -2077,7 +2077,7 @@ static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux, to_access); if (ret) { - drm_info(mtk_dp->drm_dev, + dev_info(mtk_dp->dev, "Failed to do AUX transfer: %d\n", ret); goto err; }