From patchwork Tue Feb 1 17:47:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 538952 Delivered-To: patch@linaro.org Received: by 2002:a5d:59ac:0:0:0:0:0 with SMTP id p12csp956732wrr; Tue, 1 Feb 2022 09:47:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzylMBn33awKUNO2+lsDJNTvqF2Zf5r+6cXwJvUq5wM7Sq8NieojtBN+iMORHCtwwHccoAN X-Received: by 2002:a05:6a00:158c:: with SMTP id u12mr25822760pfk.18.1643737677907; Tue, 01 Feb 2022 09:47:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643737677; cv=none; d=google.com; s=arc-20160816; b=dRqK5+nphMNdZYcs8k3DvI9E2VsmUf66KkWg30HeAhh6HV9t5w53iyM2W+IhX14shl MhcZtDsQjn8G2hHUGQ+XtOXXmm53AzWwi0HfQHmFIe2BQg4GatcW+r6RtRfsA1JEZ+RF ITcHYeGtRoDqFPtAfWismO6bbERXBwThks5ydCWRC5rLfmNutCEyHYkPnLDX5A0Dtz6h Bg4DA1RgM7y/HTS/txS7PHF+tTz+DZyl2qdyAjcWY0EHI4dKhN6Ii7Ht748mWGfV9a1H akR6WexkV1sYBX0IoBqRO2naYUSUQDmtnEVWD9q8cDDUX5qbRwUCq+qpDerlqSO5isnM 50hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=R75JAp3M1abKRfmniOJ5Fuzudqh5/VKktmnzYEpT+SA=; b=nuYyMejoITktRJuDOvSlaYracxPZzGt/PSxWLPnZTpmVw000dFxKv/HqFHtrRc/HGA cjqsiT0nCqqYLAJqXG9eq7YYiC40ttDWCPxztSGAwAYA50PLzIk8luEne9zj2XQvtTv4 R8HTyFeO2sEr586QFQ0PoPj7gNcuFSD+XlVLtWqiIzwYWGcvlmIKBM7v6muXGang+D9z Zpxi2Sj8+cdv70QiI4lnuyV/wHVt2M+1i/wZkyOFzGilnfWKdQbJ9ntacBo47Vl3aSVr BywVEwq9dxhjkwFnL7oLGRpHkbA27INTz6lhGZfycKYdXQXJmQogZlqzgIsPoy/izVAq fGMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=oc9p+IVn; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id d15si2923510pjd.35.2022.02.01.09.47.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 09:47:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=oc9p+IVn; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D311E10E4ED; Tue, 1 Feb 2022 17:47:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1CBE410E469 for ; Tue, 1 Feb 2022 17:47:49 +0000 (UTC) Received: by mail-wr1-x42a.google.com with SMTP id w11so33472871wra.4 for ; Tue, 01 Feb 2022 09:47:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R75JAp3M1abKRfmniOJ5Fuzudqh5/VKktmnzYEpT+SA=; b=oc9p+IVnBHLB7LZf1r+Ni3OD5gI1bzBxGsS5LT4cHBQaWFBb8jmm09tcie0gM8UUXm ibm81fKzJqBSY+FMLvG73EWI84K2BM1YX13xch+ZfGy/lkyDQmUlKPdd5ATMe4tP2qAY q2LLC47PesQHEdn+4fhjytGJiJ8lZaxKwWYKNVKC7mTuna62YxR4MvheG0z2k8wcTm5P y4irdy/vhh7Ze/iNid4lRN7TC6PRVv/3sRnZvxcMK59xmIrHUgLW9gCH7CvxL5r6bJsZ 846qFCxExqndxRykCeG3S3C3H6tO3V8aBmYYve9TYbeFxWYiQ4I32VVGSXqXVIdVuoOC Tc3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R75JAp3M1abKRfmniOJ5Fuzudqh5/VKktmnzYEpT+SA=; b=5d6AeaFTWdH/ja2uDiabv9TKllEUO3JegHiq5pGjkM8aLLcxaLBVt06np+ZSX7yW7q +RpHng1I8u1HnnqKjQ9VOlfcI9/1Jnn+VvG9hBpwoSdKWjeduTgTDFhWirmtRQ1rpCCh EXlVD3XbBs4aVApo2VmMeNAXysE9cWncjj5qEXctVC9kO2VqXg0/UfrNBpTQF5rzPTnm m+/bEtHkDWha0lJJ3JfLoRbUbL38x4V16CnAnqXMYBeYV/xsBF0DIZq29l03M1urusqh 50oR+tptqvIJSwMbBkVyfBAJCYfu57+MUJu8cz4vWxo1xMBwHq1cK7KRR1HF/jK6Jk7N hCyQ== X-Gm-Message-State: AOAM53028gOdnHCmQF43SHUPZd0dlnaDda32GmPhOeB9LKmamHzjQVVJ 3NBeOh8sfs8B/nKVJGHn9+2Ebg== X-Received: by 2002:adf:f141:: with SMTP id y1mr22073899wro.104.1643737667624; Tue, 01 Feb 2022 09:47:47 -0800 (PST) Received: from maple.lan (cpc141216-aztw34-2-0-cust174.18-1.cable.virginm.net. [80.7.220.175]) by smtp.gmail.com with ESMTPSA id r2sm3392332wmq.24.2022.02.01.09.47.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 09:47:47 -0800 (PST) From: Daniel Thompson To: Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH v2 1/2] drm/msm/dsi: Remove spurious IRQF_ONESHOT flag Date: Tue, 1 Feb 2022 17:47:32 +0000 Message-Id: <20220201174734.196718-2-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220201174734.196718-1-daniel.thompson@linaro.org> References: <20220201174734.196718-1-daniel.thompson@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Thompson , David Airlie , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Quoting the header comments, IRQF_ONESHOT is "Used by threaded interrupts which need to keep the irq line disabled until the threaded handler has been run.". When applied to an interrupt that doesn't request a threaded irq then IRQF_ONESHOT has a lesser known (undocumented?) side effect, which it to disable the forced threading of irqs (and for "normal" kernels it is a nop). In this case I can find no evidence that suppressing forced threading is intentional. Had it been intentional then a driver must adopt the raw_spinlock API in order to avoid deadlocks on PREEMPT_RT kernels (and avoid calling any kernel API that uses regular spinlocks). Fix this by removing the spurious additional flag. This change is required for my Snapdragon 7cx Gen2 tablet to boot-to-GUI with PREEMPT_RT enabled. Signed-off-by: Daniel Thompson Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 6b3ced4aaaf5d..3a3f53f0c8ae1 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1877,7 +1877,7 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi) /* do not autoenable, will be enabled later */ ret = devm_request_irq(&pdev->dev, msm_host->irq, dsi_host_irq, - IRQF_TRIGGER_HIGH | IRQF_ONESHOT | IRQF_NO_AUTOEN, + IRQF_TRIGGER_HIGH | IRQF_NO_AUTOEN, "dsi_isr", msm_host); if (ret < 0) { dev_err(&pdev->dev, "failed to request IRQ%u: %d\n", From patchwork Tue Feb 1 17:47:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 538951 Delivered-To: patch@linaro.org Received: by 2002:a5d:59ac:0:0:0:0:0 with SMTP id p12csp956710wrr; Tue, 1 Feb 2022 09:47:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuUonYdmUa++v4utREHSCl11ZLEs9bp4bQbSVoHSOtUJe9rkYnW+msydQyJEMZkXw90You X-Received: by 2002:a17:902:c1ca:: with SMTP id c10mr27196709plc.88.1643737675589; Tue, 01 Feb 2022 09:47:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643737675; cv=none; d=google.com; s=arc-20160816; b=KPxMbuiIgIESyfU02y5czYOnel3YzPJ0e//sPVIgrkwz9I4Pm1VQtYFiDumfTlGHFf VLUbxPArWnT2DACbz9+5RCDGc4big5+H+6Mx/8gAxX5ztgquRnd8Gmme6sgE7T2CjX49 VjUnb6ABB8nyOhxM+kC/iJ5E8CUi9fh/IDvzgT1/59WrPITDh52nOuM+x/QqMkiSkr+G BIJGYA5/jJGUbfAYGjNEN3POSPjliHk0ysPMIzK1b9SVaFQgF01g+gB8I46v7kktEP2e GlXn5lcgfLpj08rTvQVPkQzChAYT/QhRn3LLhw401UTfuaBuEf8ePL2DGWrv24Acs9tO YttA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=7TPcuWXxFU6hWv6NeLAOie1udRWkhLJ1DWe5t2FsQ+M=; b=d5eptcAPQoFJUd+i9I9/4hn/23HEXhX9UGJfytUB6GQBNa+CXdt0S0rWWD1OLRgyE7 aV8v6cSBpC1N2+IYBw8goOCBZh4hXsS2DvZFmutrYyluKBFyrgLbPq/erLJMLnBTguNO +JtXS1XeE7CY/zTat/gbeFzCSBuCT3sm03kujE9cus3InP3bVUuO9k8PHgu9G7v43InA d1YuMS7fKob9zy/y5nZAY37U8V4tM2o77cRItZCKu/77XmcKXU+E18KknxfgTK5cg9cN PF5/njFuo64SCAmGVZ7DLzWPg1NiBDSp8C9CSQ7epBP41eX5xtECSe4lFCxj184wDUaY u+Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NuDwlgu6; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id z18si18486887plg.152.2022.02.01.09.47.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 09:47:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NuDwlgu6; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B5D0A10E4E0; Tue, 1 Feb 2022 17:47:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2F1DC10E1B7 for ; Tue, 1 Feb 2022 17:47:50 +0000 (UTC) Received: by mail-wr1-x42b.google.com with SMTP id l25so33416338wrb.13 for ; Tue, 01 Feb 2022 09:47:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7TPcuWXxFU6hWv6NeLAOie1udRWkhLJ1DWe5t2FsQ+M=; b=NuDwlgu6ILp+04FQNgBAsUPzgY4AJ4bWp5fA+81vgbrR5oDX2XCAO6zFTyz1N6KBkU 1kdQkH85xpE2ggU6G7YOsyHHkTToqT8hEBjk5z4lr12RD7yj4VqBh0sdrZL5PnVifknW 4Yd8p3bHKpvTFcIiHl+wEjbshC1kHaYl4TwJhUINoU5P7+NT6/c0K3F2jcQT7LSNe9yy FaXvEgb0ZLMnKx8Bk9pyEz77Z7+wYBdKtsrkqcuuKGXhgjKJySsryv8ltvb/6sadloTy UzkbJtcaH9lrLMA/LhpmdFsKm7icqg8TsZuhhQDF0expi5wKdSPQ3x9ySEnfmKNh7Pkn ccBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7TPcuWXxFU6hWv6NeLAOie1udRWkhLJ1DWe5t2FsQ+M=; b=uWs49JHExRR+0R48j+6q5l9fivPldgpmiuvwKap4mYPpsEvC8v0NKNGOhH0YyEZPwh eusDY7rdtvGkmOKCgHAOs0NPLIr+OAIzNmDG8/y+FffGYSr0jMxoc4c4b2BwwPQB/KaK +RpMXASKsSp2F/ihIUFF4UGPH1eHMzSHgz22Gq5K3cjqm6j0oe5UP+Oij0mtZ8Maq7Bm TDCL/pYBABpkZi97LVPdpXoo+2i7uvaOGHLaPpv125V4yHJCawaxhZFYdhdDYdxTuALp IyJOV1OdOu6ib5ZOIejfVGzj/qRT2PJOQELyuMfdCE/n3kbpjP3ijJTNDRYEpC9FW6lP f2gQ== X-Gm-Message-State: AOAM533UEy1LqN2ioxZF49CyGDmt/qUuanSbd+XBjkZOXJllfoOiIRr3 EjjI96oG4OyK2wqfd0jIhLQO7nCHHBhfyhgr X-Received: by 2002:a05:6000:1548:: with SMTP id 8mr21586066wry.504.1643737668657; Tue, 01 Feb 2022 09:47:48 -0800 (PST) Received: from maple.lan (cpc141216-aztw34-2-0-cust174.18-1.cable.virginm.net. [80.7.220.175]) by smtp.gmail.com with ESMTPSA id r2sm3392332wmq.24.2022.02.01.09.47.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 09:47:48 -0800 (PST) From: Daniel Thompson To: Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH v2 2/2] drm/msm/hdmi: Remove spurious IRQF_ONESHOT flag Date: Tue, 1 Feb 2022 17:47:33 +0000 Message-Id: <20220201174734.196718-3-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220201174734.196718-1-daniel.thompson@linaro.org> References: <20220201174734.196718-1-daniel.thompson@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Thompson , David Airlie , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Quoting the header comments, IRQF_ONESHOT is "Used by threaded interrupts which need to keep the irq line disabled until the threaded handler has been run.". When applied to an interrupt that doesn't request a threaded irq then IRQF_ONESHOT has a lesser known (undocumented?) side effect, which it to disable the forced threading of irqs. For "normal" kernels if there is no thread_fn then IRQF_ONESHOT is a nop. In this case disabling forced threading is not appropriate because the driver calls wake_up_all() (via msm_hdmi_i2c_irq) and also directly uses the regular spinlock API for locking (in msm_hdmi_hdcp_irq() ). Neither of these APIs can be called from no-thread interrupt handlers on PREEMPT_RT systems. Fix this by removing IRQF_ONESHOT. Signed-off-by: Daniel Thompson Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 719720709e9e7..e167817b42958 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -306,7 +306,7 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi, } ret = devm_request_irq(&pdev->dev, hdmi->irq, - msm_hdmi_irq, IRQF_TRIGGER_HIGH | IRQF_ONESHOT, + msm_hdmi_irq, IRQF_TRIGGER_HIGH, "hdmi_isr", hdmi); if (ret < 0) { DRM_DEV_ERROR(dev->dev, "failed to request IRQ%u: %d\n",