From patchwork Thu Sep 1 09:15:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 601852 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27FFAECAAD1 for ; Thu, 1 Sep 2022 09:15:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232646AbiIAJPm (ORCPT ); Thu, 1 Sep 2022 05:15:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234077AbiIAJPc (ORCPT ); Thu, 1 Sep 2022 05:15:32 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47D2BA61FA for ; Thu, 1 Sep 2022 02:15:31 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id z6so23492110lfu.9 for ; Thu, 01 Sep 2022 02:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=jNM+5myziriC40IcLi6KZeIacAr+ajJ9scGcT8bKpzo=; b=TPU5kkYcJ/bgeVpCEiOlPxfeLqUaaCPDobVW8KvP0t4ccjSpwx+gYAwldV7QaklzxM YUPO6qjo6OEi/7l1GhfjVE7Cr1igB6CdWJgTTi9HpjS4QT84noyhAXEd9QLaJl5h4M1/ GoAueKnl0gIsq6AjZPXF1rO/kQX6sRaTq4B6jeCkc4fuIVWEcEu1NF6Vg/kn2PQ9V3Dn hyPSkDhVH3aLmX1e1Hk0ApD8P3TFuIT/lJwxfF16QivYZfYsrD9sXF8WjNQb8fxmuDOy yOYvEnlvZEWp+LVI7Cw+6XmzXhhB2Rphl6NsmERJvi7sgabkLedAVqAa8hbJjEIlur9w oQ/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=jNM+5myziriC40IcLi6KZeIacAr+ajJ9scGcT8bKpzo=; b=Zj6be8I9VRQ5gj7wnJpqiNiZp6EXEqQzj6k/Dt/zau9yMptj54x7MTill8G1Sh7MOG hqrhx5MzMmfwBLy6Kkdyauti51ykGRXXowKLN9Iq/6taZJfH3S/4ONHdZqKG365nPzJp rrPDVGh1Lfv164TMPhIdl3WsTPW+XP1/1RueEp4XJYJEN7FnunqMa6kPGiSZojcOtdC8 4CxcpdWg6/iS8g0gVqvXXxjwDlbhK2fYJnI9+tP4D6us9lnXxj08QdgFUhNQC8gyVSn9 HKOCj+8KIUwTl7vpkGgcBkIwqc2zCGH61MiGu9sLqMr4iyRc7iawHT+yRDtSbDCXpKXO gTvA== X-Gm-Message-State: ACgBeo3qpO7mdgOfSAoPM9dw/iLL4hZS7WHOi+QcMcjUToSgvIMxvGwD 4w9EPb0zxpVqAiNIa4zqGh/k9w== X-Google-Smtp-Source: AA6agR5LX8WMcaeVD4ENclbBhkqZGs2/l0DYGO4bc0F6WTraZHk3TbrLnXaw4WnOMwev2kp1gk7JMQ== X-Received: by 2002:a05:6512:2350:b0:494:9925:f734 with SMTP id p16-20020a056512235000b004949925f734mr965847lfu.97.1662023729618; Thu, 01 Sep 2022 02:15:29 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id t17-20020a2e2d11000000b00261b4df9ec4sm2422349ljt.138.2022.09.01.02.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 02:15:29 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Johan Hovold Subject: [RFC PATCH 1/3] drm/msm/dp: fold disable_irq into devm_request_irq Date: Thu, 1 Sep 2022 12:15:25 +0300 Message-Id: <20220901091527.1992208-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220901091527.1992208-1-dmitry.baryshkov@linaro.org> References: <20220901091527.1992208-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Calling disable_irq() right after devm_request_irq() is a bad practice. it leaves a small window when the driver doesn't expect the IRQ, but the hardware still can trigger it. Use the IRQF_NO_AUTOEN flag to prevent the request_irq from enabling the IRQ line. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_display.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index bfd0aeff3f0d..3173e6962a78 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1251,13 +1251,12 @@ int dp_display_request_irq(struct msm_dp *dp_display) rc = devm_request_irq(&dp->pdev->dev, dp->irq, dp_display_irq_handler, - IRQF_TRIGGER_HIGH, "dp_display_isr", dp); + IRQF_TRIGGER_HIGH | IRQF_NO_AUTOEN, "dp_display_isr", dp); if (rc < 0) { DRM_ERROR("failed to request IRQ%u: %d\n", dp->irq, rc); return rc; } - disable_irq(dp->irq); return 0; } From patchwork Thu Sep 1 09:15:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 602477 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61ABFECAAD5 for ; Thu, 1 Sep 2022 09:15:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231343AbiIAJPm (ORCPT ); Thu, 1 Sep 2022 05:15:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233778AbiIAJPe (ORCPT ); Thu, 1 Sep 2022 05:15:34 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C6516D56E for ; Thu, 1 Sep 2022 02:15:32 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id z6so23492184lfu.9 for ; Thu, 01 Sep 2022 02:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=0PopVUeDqVd8id5zcihhw1xot4mofrXOyc1GZjax4ec=; b=IvP5i70p6ppN98XYu7InwUNO/+mqptBcaId0KlOwGkf8kyje4IQAH2CDYHJMDp/ZkV ghEi4pY9LVoo25cOb3Hn6nvWNCrDZKlvqmXrmQy/2QZBmTJI4DlLM2sG00w3mIYIj2X1 2tZsUDbm0nz3vikoSorTOUEXrx7rY+G/beM993ie//kW8O4VYZFpH8OZwv6tcD0bfeBS Zox9T3tugtECHNPlCggRMug5xoVMHWC6mRXfC3J2F53BXuVVr1lqRrYu30dpb8wOl7iF Yy/a7pLx90ybXbpD4qmPqCn5+xj5wmjKBY9H/FXKsaDUmnGyJ/+9O9MciMzRpAz2QB+H qipg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=0PopVUeDqVd8id5zcihhw1xot4mofrXOyc1GZjax4ec=; b=Rx/shNfJw22TmtE3nOGn3hGVMGRjoxPzMD//8MqDCK6hgMoZDKkJsk0ZQsWkZyG7C0 1R/hpS68lN/F1FGb8GX7iuh1OPMmpXLCImLMtv6A9dcl3ZbPVRxYHbiZUgNl2q1H1wDR RiOzZT337oO00Ti4rC/qJeVcbVVGGgeu1Hj8bVxJ2/kcZEi9KsnDUCKHvHVkJmtVm5Ri TmH2j6Yf5hrDSbxzueMhZYyWPGqta0XVMwO+yEZVMiJ3x2UqC1RClXKR4j7QvdDtP18H A/OHeAFIFL0f9smRwwsBzwnn4NDMlzoc/SK9edPl509a+1vDf/S5Ux3hIpRxnnFLEZZF +fVQ== X-Gm-Message-State: ACgBeo0CCtlVNjFwslHclgYopeq2evT/vEIPVKJ6lQT4hBtLBWqUd+0g GFGJevlbEUHzNO9K9GtVor7hNQ== X-Google-Smtp-Source: AA6agR5gcvtrIHFZtE7o0eCPzN0rFEUKDxuoa820dKQCQFP47AtJxDVJ+nfan1kBmHAfIo9uLh6Mtw== X-Received: by 2002:a05:6512:3fa2:b0:48a:16df:266f with SMTP id x34-20020a0565123fa200b0048a16df266fmr10153605lfa.414.1662023730688; Thu, 01 Sep 2022 02:15:30 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id t17-20020a2e2d11000000b00261b4df9ec4sm2422349ljt.138.2022.09.01.02.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 02:15:29 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Johan Hovold Subject: [RFC PATCH 2/3] drm/msm/dp: switch to using platform_get_irq() Date: Thu, 1 Sep 2022 12:15:26 +0300 Message-Id: <20220901091527.1992208-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220901091527.1992208-1-dmitry.baryshkov@linaro.org> References: <20220901091527.1992208-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org There is little point in using irq_of_parse_and_map(). Switch to plain and usual platform_get_irq() for parsing the DP IRQ line. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 3173e6962a78..40c7f91abec9 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1243,8 +1243,8 @@ int dp_display_request_irq(struct msm_dp *dp_display) dp = container_of(dp_display, struct dp_display_private, dp_display); - dp->irq = irq_of_parse_and_map(dp->pdev->dev.of_node, 0); - if (!dp->irq) { + dp->irq = platform_get_irq(dp->pdev, 0); + if (dp->irq < 0) { DRM_ERROR("failed to get irq\n"); return -EINVAL; } From patchwork Thu Sep 1 09:15:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 602476 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41AB4ECAAD3 for ; Thu, 1 Sep 2022 09:15:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233224AbiIAJPp (ORCPT ); Thu, 1 Sep 2022 05:15:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234102AbiIAJPf (ORCPT ); Thu, 1 Sep 2022 05:15:35 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 444D7A8CF1 for ; Thu, 1 Sep 2022 02:15:33 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id v26so13255262lfd.10 for ; Thu, 01 Sep 2022 02:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=BMbeQq19sn0fA0AoYnzWmV5qecQuUrgkwG2C68BA4hc=; b=radD6aYjGiJPEPBluvbtUZ5aMLsaPprP8pZ78SyXCV8iyl4/S1yF3t9ZpSFxI/9mUe UUFVg6zUZWr265Q4HDV4brYbBeW8Gh+GOLYcY4wAXRdezEV+rrAY0lsWG0JxwvYIQJyt ouy8tchtOWEn7WuorHXEfRB8cfnlgXTAuf402y/N0tiIGJy+dHe/q/Ff+6eTxnqj/GZL dCpz80+yB67MlPVbNMpPMHkbwIGI1Xk9ahqWXgAiMvsRKCRDVROFhgCwKKO3YoKMy967 Uw1/eozSODBheaZyUIS1R5D8bY3VrR5ZMcYhitQj9EnddlpcfOtcJGNmXcW++uiM6NV7 r1HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=BMbeQq19sn0fA0AoYnzWmV5qecQuUrgkwG2C68BA4hc=; b=HOZPLQXjik27F14QnccJrn3FS+vgOvJ8W0D+/2S5kdOw9nGY1UyNYQEoDn17Pnp0gG k70fay2b30hkB2RX+HqvhFDv2pIS2QavuhQgftuXPiKBi3qI7e+QS45ZjaOsdkVsWFhc fV4YosK9nNnFS7vqKooA4q4vEJ30p6c3k7vhhNkfYr4IYMXvCDR4inXAv1XaYoGGEDCN BbnJkybYEnaqXziFPTzGZBtHo0IaROQWJW2RM6k0mMawetP4CQmbIiLKNLlA4a0q9yTA qRJwkd4UokQfs+dZrp6wamvP3UMbQojYJok5Q7l+lKjJYr2yHRrNCSLcH3QmXsfCgn/g 3t8Q== X-Gm-Message-State: ACgBeo18irg6POm6/q4F/X8BDWZt2QthosCTgOsdT6GXyVHqgmw1Nr4X 0tJ2aCrJvvRe1bzi3A97brf+sg== X-Google-Smtp-Source: AA6agR74ZWr0PIZ5NxMAgLXhJEsB89eCwt/udydQWWaFNZ7X4TMZk1BJ3f9j2jAKS8CjzPHFNyOafg== X-Received: by 2002:a05:6512:12c4:b0:494:8373:5678 with SMTP id p4-20020a05651212c400b0049483735678mr2935544lfg.577.1662023731661; Thu, 01 Sep 2022 02:15:31 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id t17-20020a2e2d11000000b00261b4df9ec4sm2422349ljt.138.2022.09.01.02.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 02:15:31 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Johan Hovold Subject: [RFC PATCH 3/3] drm/msm/dp: move dp_request_irq() call to dp_display_probe() Date: Thu, 1 Sep 2022 12:15:27 +0300 Message-Id: <20220901091527.1992208-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220901091527.1992208-1-dmitry.baryshkov@linaro.org> References: <20220901091527.1992208-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org As the MDSS registers the IRQ domain before populating child devices, there is little point in deferring the IRQ request up to the msm_dp_modeset_init(). Following the 'get resources as early as possible' paradigm, move dp_request_irq() call to dp_display_probe(). Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd --- drivers/gpu/drm/msm/dp/dp_display.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 40c7f91abec9..0fb3cb773bec 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1309,6 +1309,12 @@ static int dp_display_probe(struct platform_device *pdev) dp->dp_display.is_edp = (dp->dp_display.connector_type == DRM_MODE_CONNECTOR_eDP); + rc = dp_display_request_irq(&dp->dp_display); + if (rc) { + DRM_ERROR("request_irq failed, ret=%d\n", rc); + return rc; + } + rc = dp_init_sub_modules(dp); if (rc) { DRM_ERROR("init sub module failed\n"); @@ -1600,12 +1606,6 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, dp_priv = container_of(dp_display, struct dp_display_private, dp_display); - ret = dp_display_request_irq(dp_display); - if (ret) { - DRM_ERROR("request_irq failed, ret=%d\n", ret); - return ret; - } - ret = dp_display_get_next_bridge(dp_display); if (ret) return ret;