From patchwork Thu Aug 29 19:59:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11122385 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 119811398 for ; Thu, 29 Aug 2019 20:00:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E33B323404 for ; Thu, 29 Aug 2019 20:00:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="CH3Z10dM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728026AbfH2UAG (ORCPT ); Thu, 29 Aug 2019 16:00:06 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:39037 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726697AbfH2UAG (ORCPT ); Thu, 29 Aug 2019 16:00:06 -0400 Received: by mail-pf1-f194.google.com with SMTP id y200so2797460pfb.6 for ; Thu, 29 Aug 2019 13:00:06 -0700 (PDT) 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; bh=S9d3dFoh7F6gGH5LTQyJ8UyxGo/MvVuvj+hyEE/NkTM=; b=CH3Z10dMKFNa5EUmXWfmO9kVZYBLmTzxs99xBrQZa34CnaWlLZ/e/TJGcWMmfgsVB6 fbGWYVF61zStU3OZ3c4J09h572gEWcekJS9a9s1STntCydJRS4S+bJjKr1GFFPevhKjB uZXZuULcjvP9TNWnWZ5gUtJuhXkCpGo5Q1FylX1MGpXn4QIk5JEjXSX1Q1MWBWAsfSZh Y3XGxXaszNMDvWfih8zVS5X6l5P1jhp0JnKuzXXsLsas1cnOI0l6wWvsEjPjBR0TMyLp ZP5J3Hy4nDNsUH7UsCts6P9CduZTxfhth9z6VwRWe6YZX49SH0wun0MhB+e7V7D2e2kT LlUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=S9d3dFoh7F6gGH5LTQyJ8UyxGo/MvVuvj+hyEE/NkTM=; b=BjnD+I6qDTMboyh8iE6+qwb4AtMMloqDRz88z53HfnY6vGOUf8tJLJ0afpo939kQQF F61cVHB54Y6iAafprBpDaUWxZC1PpGaIwYkJPXMjOInBFWs97GKfWfvHlBMEz/5C76MN YNX+sjzMMbptK2E5OK9PmrlXyuQijRSfU16fhBKXhocEKHyKceCjFFbqQcCnA4H9UF9k srV6IGio7pB27q6/maM5K+9xC6W6UvLxz7qnU6jabYqLEgGqroItugOFzo/3MiA8xxlT bWU6eAaMeOkLe3rj7YoO3GGmzY+TpCsFko01i+CTRpJ/T5kQPGjY6nvDD4ZN/n/YHRkz I4/g== X-Gm-Message-State: APjAAAVeO9BKt1mXbQ01Hs4tb3k1aH91xblrbvoesmejRPh7rNihJaZd MTHEc11NzzRiKfKh1WSAo10JgA== X-Google-Smtp-Source: APXvYqwgfpvBc6rpBf/WbtITtoaWYyjizOJiXzMZpQhfc76Y+pvPxSdoJdzus+CAnHFnfaEjre9aBw== X-Received: by 2002:a63:5951:: with SMTP id j17mr9734953pgm.143.1567108805398; Thu, 29 Aug 2019 13:00:05 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id u7sm3053766pgr.94.2019.08.29.13.00.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 13:00:04 -0700 (PDT) From: Mathieu Poirier To: stable@vger.kernel.org Cc: architt@codeaurora.org, a.hajda@samsung.com, Laurent.pinchart@ideasonboard.com, airlied@linux.ie, jsarha@ti.com, tomi.valkeinen@ti.com, vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [BACKPORT 4.19.y 1/3] drm/bridge: tfp410: fix memleak in get_modes() Date: Thu, 29 Aug 2019 13:59:59 -0600 Message-Id: <20190829200001.17092-2-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829200001.17092-1-mathieu.poirier@linaro.org> References: <20190829200001.17092-1-mathieu.poirier@linaro.org> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Tomi Valkeinen commit c08f99c39083ab55a9c93b3e93cef48711294dad upstream We don't free the edid blob allocated by the call to drm_get_edid(), causing a memleak. Fix this by calling kfree(edid) at the end of the get_modes(). Signed-off-by: Tomi Valkeinen Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20190610135739.6077-1-tomi.valkeinen@ti.com Signed-off-by: Mathieu Poirier --- drivers/gpu/drm/bridge/ti-tfp410.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index c3e32138c6bb..9dc109df0808 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -64,7 +64,12 @@ static int tfp410_get_modes(struct drm_connector *connector) drm_connector_update_edid_property(connector, edid); - return drm_add_edid_modes(connector, edid); + ret = drm_add_edid_modes(connector, edid); + + kfree(edid); + + return ret; + fallback: /* No EDID, fallback on the XGA standard modes */ ret = drm_add_modes_noedid(connector, 1920, 1200); From patchwork Thu Aug 29 20:00:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11122381 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A52751398 for ; Thu, 29 Aug 2019 20:00:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 827712080F for ; Thu, 29 Aug 2019 20:00:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="EwHFoY3n" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726661AbfH2UAK (ORCPT ); Thu, 29 Aug 2019 16:00:10 -0400 Received: from mail-pf1-f171.google.com ([209.85.210.171]:37490 "EHLO mail-pf1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727929AbfH2UAI (ORCPT ); Thu, 29 Aug 2019 16:00:08 -0400 Received: by mail-pf1-f171.google.com with SMTP id y9so2804127pfl.4 for ; Thu, 29 Aug 2019 13:00:07 -0700 (PDT) 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; bh=leAjuo9QrYfGsQp+lWwGPaf44FJzdIsTdXXe6kBTcvQ=; b=EwHFoY3nn78Ablhc+fvFTk63+ihmkRvuN2b9otTYYBLJ/20wMokgUtop/hP29hf8Ss JdtCG3A2s67swE9FFPf0Jn+PmiCySXAL8wwZW4h1dWPNwTUU0OJvimlv7euDgKnQOI0H dGcfTjNrOk+RUaAs/nmRNL6f5930YGwO+xPmerXZ3YLIx3T4GB15/JNvn/WKFJkiPNSh JSGhphPYJfykXMMRch+fpjVH5JYudf5o7RljVoXQc8rIl3R5Wt9ClH9N90i/eEYtQIfH U7UKjZIIr6lociKHiO8DTHScDkrVxuqSHtCT0pJuou4Ml1+ekF7rLvtgaf+1OlCmupbW YbfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=leAjuo9QrYfGsQp+lWwGPaf44FJzdIsTdXXe6kBTcvQ=; b=Ue3zDMrPIePkJ090cxW8eA+k+91/G/+csTWMhrEgKNT92flWdyf2dKzlQ6cABXaf9T ozo26EpP+KgazVHHN07nFSBkk9EJRS6Fy5DWdKTosUpWh/TwqHVL4brITOLnmBo6KOHB UzhvygGl/pX/0PB1A3dosWLbzN3iZL3MPoOiIRFVr6H0wKMrxtzhd4FEocsttqF1e5sW 5K5uy6nz/sgp0B7A2+02VW8Z2UqwXyyOwiKaw2ljL9e7/regrQ5yl3pdUfL6eLhIBTyD XycZ1d1HG4s6NoEAQj2IgzFWXgEylXcdLr5whT/2LAQgBkJU4mnHsqY7OP3ooGT3yF34 Jjrg== X-Gm-Message-State: APjAAAVh9qfp2mCBeTSNqMvZMV2JWufSmh88Ri5rHWlpruRNxe5L29jt dEv2TG1a02Bd9uv7hk/iWc/k93cIXqY= X-Google-Smtp-Source: APXvYqxmRtZml8EdnZ16J1Jmfc6FgL+TVFfQC+dCMCvoM/+VMjg+z1xJm3jSCGVPmaKApRCFQG6kdw== X-Received: by 2002:a63:1f1b:: with SMTP id f27mr9740387pgf.233.1567108807182; Thu, 29 Aug 2019 13:00:07 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id u7sm3053766pgr.94.2019.08.29.13.00.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 13:00:06 -0700 (PDT) From: Mathieu Poirier To: stable@vger.kernel.org Cc: architt@codeaurora.org, a.hajda@samsung.com, Laurent.pinchart@ideasonboard.com, airlied@linux.ie, jsarha@ti.com, tomi.valkeinen@ti.com, vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [BACKPORT 4.19.y 2/3] scsi: ufs: Fix RX_TERMINATION_FORCE_ENABLE define value Date: Thu, 29 Aug 2019 14:00:00 -0600 Message-Id: <20190829200001.17092-3-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829200001.17092-1-mathieu.poirier@linaro.org> References: <20190829200001.17092-1-mathieu.poirier@linaro.org> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Pedro Sousa commit ebcb8f8508c5edf428f52525cec74d28edea7bcb upstream Fix RX_TERMINATION_FORCE_ENABLE define value from 0x0089 to 0x00A9 according to MIPI Alliance MPHY specification. Fixes: e785060ea3a1 ("ufs: definitions for phy interface") Signed-off-by: Pedro Sousa Signed-off-by: Martin K. Petersen Signed-off-by: Mathieu Poirier --- drivers/scsi/ufs/unipro.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/unipro.h b/drivers/scsi/ufs/unipro.h index 23129d7b2678..c77e36526447 100644 --- a/drivers/scsi/ufs/unipro.h +++ b/drivers/scsi/ufs/unipro.h @@ -52,7 +52,7 @@ #define RX_HS_UNTERMINATED_ENABLE 0x00A6 #define RX_ENTER_HIBERN8 0x00A7 #define RX_BYPASS_8B10B_ENABLE 0x00A8 -#define RX_TERMINATION_FORCE_ENABLE 0x0089 +#define RX_TERMINATION_FORCE_ENABLE 0x00A9 #define RX_MIN_ACTIVATETIME_CAPABILITY 0x008F #define RX_HIBERN8TIME_CAPABILITY 0x0092 #define RX_REFCLKFREQ 0x00EB From patchwork Thu Aug 29 20:00:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11122383 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 402461398 for ; Thu, 29 Aug 2019 20:00:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1DA1E2080F for ; Thu, 29 Aug 2019 20:00:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ljvhUTB5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728153AbfH2UAK (ORCPT ); Thu, 29 Aug 2019 16:00:10 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:35013 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728121AbfH2UAJ (ORCPT ); Thu, 29 Aug 2019 16:00:09 -0400 Received: by mail-pl1-f196.google.com with SMTP id gn20so2094497plb.2 for ; Thu, 29 Aug 2019 13:00:09 -0700 (PDT) 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; bh=LnwOSHW+qkIfwX+CEo6pre2vAtIHSJHM7Ipb0uTKcN8=; b=ljvhUTB5kgie6mZn/Katfok8X2WrFwgXFmGKAsJBCEExxJK+Nxf6/5JnDHhk1LxGzy GYRAppVUeZ1sd1GoWZIlw7jgdNHty21ipU5Xwbsjv2pDu76zTUuu2M0TYKjBIGiG+5/U z01+UGUU35QOWpFRzt7fPcfbQ99aFBb2fmxT0/oIwQsg9/ldDduJhzRqeDTeL/2cT+fn xZEkAhbQh16HdO3N3dLit2heuBIRhD2aWB6bocU4JidBTKhPZUvGLVHHMbcSP5Om8Rkn fjF4IfC7pe9zuVYT61BgDPYNoG1OUc1oLDYMoO1xaeTde3LKzueqjrs2vOyE7CXBh8Pc jvRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LnwOSHW+qkIfwX+CEo6pre2vAtIHSJHM7Ipb0uTKcN8=; b=BFeYaqcO4n/MTfph7lbtNffZNzhgVggBbsMkk9PrSJDJ8TiXhWDTIDMg2Th7FYzQ7w n9+I5GV7YlvJaWdkOTgahMip4z4BgCG9NvzHva4Z4G858SY96r/N5LewHSRzquXUJMit PJL7n81AQ4vIcV1uFTFOKjm7YQjofbLRTT28+Ipxu0Sx5gkQnkuIN8+DKaUZgT8btw2K kjqz57UdbFmpxKGvaYd1diCXs+aYvslUsEQeBiNzsCeo2YfB9xcJurh3TtuhCW3QbLr2 5rZZqgFRryZRHgzQrTu7Y9wOgsOondJeuAWh+eIPSAgytTPyIiAfuNqWzJPIH7O1pIzO iBRA== X-Gm-Message-State: APjAAAV3bGAq7kdlyP7KigeczPIRkHOArBbwifS6C+DyfaRzDfky1KB5 MbbAZPqjNPvHaaZIaDOS6NNA8Q== X-Google-Smtp-Source: APXvYqwdxPRjNZXc7J371kYMqpuaaLwSfZc+tGFJrILbQTyvwMq61GQBgGE76g8xmKy3HX0ZAhYEFg== X-Received: by 2002:a17:902:9a07:: with SMTP id v7mr12015218plp.245.1567108808730; Thu, 29 Aug 2019 13:00:08 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id u7sm3053766pgr.94.2019.08.29.13.00.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 13:00:08 -0700 (PDT) From: Mathieu Poirier To: stable@vger.kernel.org Cc: architt@codeaurora.org, a.hajda@samsung.com, Laurent.pinchart@ideasonboard.com, airlied@linux.ie, jsarha@ti.com, tomi.valkeinen@ti.com, vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [BACKPORT 4.19.y 3/3] drm/tilcdc: Register cpufreq notifier after we have initialized crtc Date: Thu, 29 Aug 2019 14:00:01 -0600 Message-Id: <20190829200001.17092-4-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190829200001.17092-1-mathieu.poirier@linaro.org> References: <20190829200001.17092-1-mathieu.poirier@linaro.org> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Jyri Sarha commit 432973fd3a20102840d5f7e61af9f1a03c217a4c upstream Register cpufreq notifier after we have initialized the crtc and unregister it before we remove the ctrc. Receiving a cpufreq notify without crtc causes a crash. Reported-by: Peter Ujfalusi Signed-off-by: Jyri Sarha Signed-off-by: Mathieu Poirier --- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index 0fb300d41a09..e1868776da25 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -184,6 +184,12 @@ static void tilcdc_fini(struct drm_device *dev) { struct tilcdc_drm_private *priv = dev->dev_private; +#ifdef CONFIG_CPU_FREQ + if (priv->freq_transition.notifier_call) + cpufreq_unregister_notifier(&priv->freq_transition, + CPUFREQ_TRANSITION_NOTIFIER); +#endif + if (priv->crtc) tilcdc_crtc_shutdown(priv->crtc); @@ -198,12 +204,6 @@ static void tilcdc_fini(struct drm_device *dev) drm_mode_config_cleanup(dev); tilcdc_remove_external_device(dev); -#ifdef CONFIG_CPU_FREQ - if (priv->freq_transition.notifier_call) - cpufreq_unregister_notifier(&priv->freq_transition, - CPUFREQ_TRANSITION_NOTIFIER); -#endif - if (priv->clk) clk_put(priv->clk); @@ -274,17 +274,6 @@ static int tilcdc_init(struct drm_driver *ddrv, struct device *dev) goto init_failed; } -#ifdef CONFIG_CPU_FREQ - priv->freq_transition.notifier_call = cpufreq_transition; - ret = cpufreq_register_notifier(&priv->freq_transition, - CPUFREQ_TRANSITION_NOTIFIER); - if (ret) { - dev_err(dev, "failed to register cpufreq notifier\n"); - priv->freq_transition.notifier_call = NULL; - goto init_failed; - } -#endif - if (of_property_read_u32(node, "max-bandwidth", &priv->max_bandwidth)) priv->max_bandwidth = TILCDC_DEFAULT_MAX_BANDWIDTH; @@ -361,6 +350,17 @@ static int tilcdc_init(struct drm_driver *ddrv, struct device *dev) } modeset_init(ddev); +#ifdef CONFIG_CPU_FREQ + priv->freq_transition.notifier_call = cpufreq_transition; + ret = cpufreq_register_notifier(&priv->freq_transition, + CPUFREQ_TRANSITION_NOTIFIER); + if (ret) { + dev_err(dev, "failed to register cpufreq notifier\n"); + priv->freq_transition.notifier_call = NULL; + goto init_failed; + } +#endif + if (priv->is_componentized) { ret = component_bind_all(dev, ddev); if (ret < 0)