From patchwork Sun May 2 01:42:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 12235099 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CA0DC43461 for ; Sun, 2 May 2021 01:42:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 408CC61462 for ; Sun, 2 May 2021 01:42:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231739AbhEBBnp (ORCPT ); Sat, 1 May 2021 21:43:45 -0400 Received: from mail2.protonmail.ch ([185.70.40.22]:64143 "EHLO mail2.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231593AbhEBBnp (ORCPT ); Sat, 1 May 2021 21:43:45 -0400 Date: Sun, 02 May 2021 01:42:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=connolly.tech; s=protonmail; t=1619919772; bh=CvSw3JV9plNu6EjH386w84c2cwf+Awbm2otRgqsgPUQ=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=dN9RVqZmJBfWMbwKnGI8IWWQSBc7pf0hJTyjnWhFx2GuAZQ6vg+y9J/+NMXvX8nIa KmAUg79QR0PnzaZEkbLFDl7wzpiQHGP2OUIGddVT0rZfc/5sxc3g56UXbe4LnJ6CY6 jd2Ab0D3Wra74E+jua9Q6ZHiQjof45bqyG3f9fIY= To: caleb@connolly.tech, Andy Gross , Bjorn Andersson , Rob Herring From: Caleb Connolly Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Caleb Connolly Subject: [PATCH 1/4] arm64: dts: qcom: sdm845-oneplus-common: remove panel reset gpio Message-ID: <20210502014146.85642-2-caleb@connolly.tech> In-Reply-To: <20210502014146.85642-1-caleb@connolly.tech> References: <20210502014146.85642-1-caleb@connolly.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Resetting the panel causes issues on fajita, it is also completely unnecessary for normal use so lets just not bother. Signed-off-by: Caleb Connolly --- arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi index 8f617f7b6d34..8f3f5c687b4a 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi @@ -314,8 +314,6 @@ display_panel: panel@0 { vddio-supply = <&vreg_l14a_1p88>; - reset-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>; - pinctrl-names = "default"; pinctrl-0 = <&panel_reset_pins &panel_te_pin &panel_esd_pin>; From patchwork Sun May 2 01:42:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 12235101 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9223C433B4 for ; Sun, 2 May 2021 01:42:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C7F1F61459 for ; Sun, 2 May 2021 01:42:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232021AbhEBBnt (ORCPT ); Sat, 1 May 2021 21:43:49 -0400 Received: from mail-40133.protonmail.ch ([185.70.40.133]:55190 "EHLO mail-40133.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231593AbhEBBnt (ORCPT ); Sat, 1 May 2021 21:43:49 -0400 Date: Sun, 02 May 2021 01:42:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=connolly.tech; s=protonmail; t=1619919776; bh=Kl3Jo+OZEZzf10VJacbXDH3A1fF+G/d1ql1pz/OtWqI=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=a29YV91YarPuYd+ZgiO2zQf9fSlWHiDHo8E62fQRNqW4dxw2rUuwV3k27xSeHIJun fzVc8h5St4JjOlfqwfIbENSdGZft1O38P3GF9j4iUd65wI8WX/m5R7CxQpp7CTxILR acqjI8EZtPl8usqMEeAjOf2ksUxdHtP7JYiAtLlM= To: caleb@connolly.tech, Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter From: Caleb Connolly Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Reply-To: Caleb Connolly Subject: [PATCH 2/4] drm: panel: sofef00: remove reset GPIO handling Message-ID: <20210502014146.85642-3-caleb@connolly.tech> In-Reply-To: <20210502014146.85642-1-caleb@connolly.tech> References: <20210502014146.85642-1-caleb@connolly.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Resetting the panel on fajita causes it to never come back, we aren't quite sure why this is so for now lets remove reset handling as it is effectively broken. It is also not needed on enchilada. Signed-off-by: Caleb Connolly --- drivers/gpu/drm/panel/panel-samsung-sofef00.c | 26 +++---------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef00.c b/drivers/gpu/drm/panel/panel-samsung-sofef00.c index 8cb1853574bb..cfc8b2a19742 100644 --- a/drivers/gpu/drm/panel/panel-samsung-sofef00.c +++ b/drivers/gpu/drm/panel/panel-samsung-sofef00.c @@ -23,7 +23,6 @@ struct sofef00_panel { struct drm_panel panel; struct mipi_dsi_device *dsi; struct regulator *supply; - struct gpio_desc *reset_gpio; const struct drm_display_mode *mode; bool prepared; }; @@ -42,16 +41,6 @@ struct sofef00_panel *to_sofef00_panel(struct drm_panel *panel) return ret; \ } while (0) -static void sofef00_panel_reset(struct sofef00_panel *ctx) -{ - gpiod_set_value_cansleep(ctx->reset_gpio, 0); - usleep_range(5000, 6000); - gpiod_set_value_cansleep(ctx->reset_gpio, 1); - usleep_range(2000, 3000); - gpiod_set_value_cansleep(ctx->reset_gpio, 0); - usleep_range(12000, 13000); -} - static int sofef00_panel_on(struct sofef00_panel *ctx) { struct mipi_dsi_device *dsi = ctx->dsi; @@ -132,12 +121,9 @@ static int sofef00_panel_prepare(struct drm_panel *panel) return ret; } - sofef00_panel_reset(ctx); - ret = sofef00_panel_on(ctx); if (ret < 0) { dev_err(dev, "Failed to initialize panel: %d\n", ret); - gpiod_set_value_cansleep(ctx->reset_gpio, 1); return ret; } @@ -155,8 +141,11 @@ static int sofef00_panel_unprepare(struct drm_panel *panel) return 0; ret = sofef00_panel_off(ctx); - if (ret < 0) + + if (ret < 0) { dev_err(dev, "Failed to un-initialize panel: %d\n", ret); + return ret; + } regulator_disable(ctx->supply); @@ -276,13 +265,6 @@ static int sofef00_panel_probe(struct mipi_dsi_device *dsi) return ret; } - ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); - if (IS_ERR(ctx->reset_gpio)) { - ret = PTR_ERR(ctx->reset_gpio); - dev_warn(dev, "Failed to get reset-gpios: %d\n", ret); - return ret; - } - ctx->dsi = dsi; mipi_dsi_set_drvdata(dsi, ctx); From patchwork Sun May 2 01:42:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 12235103 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 914F2C433ED for ; Sun, 2 May 2021 01:43:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7650461476 for ; Sun, 2 May 2021 01:43:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232235AbhEBBn5 (ORCPT ); Sat, 1 May 2021 21:43:57 -0400 Received: from mail2.protonmail.ch ([185.70.40.22]:49525 "EHLO mail2.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231593AbhEBBn5 (ORCPT ); Sat, 1 May 2021 21:43:57 -0400 Date: Sun, 02 May 2021 01:42:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=connolly.tech; s=protonmail; t=1619919785; bh=7t4+OnZ/tHUs6smHDPvOJLoDoNjQoDuPdjhxhLCKuwI=; h=Date:To:From:Cc:Reply-To:Subject:From; b=WKodFOfNITQ7HtUCzgYbMZNvGTvs1bG4ekvk/oLjmNn56ydlgXB5qhp5u5YAC69ce 257C8u0IoYIuhQ+6OhUBXeZA+K6e5/DJ/QI8yI3yYgZXu3nP4PtgrhrhW9ZjE262my 8Blacmbo8DcHPaJJO5cSJAGT9gtHLrx5cpU55Nvg= To: caleb@connolly.tech, Andy Gross , Bjorn Andersson , Rob Herring From: Caleb Connolly Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Caleb Connolly Subject: [PATCH 3/4] dts: qcom: sdm845-oneplus-common: guard rmtfs-mem Message-ID: <20210502014146.85642-4-caleb@connolly.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The rmtfs_mem region is a weird one, downstream allocates it dynamically, and supports a "qcom,guard-memory" property which when set will reserve 4k above and below the rmtfs memory. A common from qcom 4.9 kernel msm_sharedmem driver: /* * If guard_memory is set, then the shared memory region * will be guarded by SZ_4K at the start and at the end. * This is needed to overcome the XPU limitation on few * MSM HW, so as to make this memory not contiguous with * other allocations that may possibly happen from other * clients in the system. */ When the kernel tries to touch memory that is too close the rmtfs region it may cause an XPU violation. Such is the case on the OnePlus 6 where random crashes would occur usually after boot. Reserve 4k above and below the rmtfs_mem to avoid hitting these XPU Violations. This doesn't entirely solve the random crashes on the OnePlus 6/6T but it does seem to prevent the ones which happen shortly after modem bringup. Signed-off-by: Caleb Connolly --- arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi index 8f3f5c687b4a..96c370b90550 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi @@ -46,6 +46,14 @@ vol-up { }; reserved-memory { + /* The rmtfs_mem needs to be guarded due to "XPU limitations" + * it is otherwise possible for an allocation adjacent to the + * rmtfs_mem region to trigger an XPU violation, causing a crash. + */ + rmtfs_lower_guard: memory@f5b00000 { + no-map; + reg = <0 0xf5b00000 0 0x1000>; + }; /* * The rmtfs memory region in downstream is 'dynamically allocated' * but given the same address every time. Hard code it as this address is @@ -59,6 +67,10 @@ rmtfs_mem: memory@f5b01000 { qcom,client-id = <1>; qcom,vmid = <15>; }; + rmtfs_upper_guard: memory@f5d01000 { + no-map; + reg = <0 0xf5d01000 0 0x2000>; + }; /* * It seems like reserving the old rmtfs_mem region is also needed to prevent From patchwork Sun May 2 01:43:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 12235105 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76E4EC43460 for ; Sun, 2 May 2021 01:43:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59A1561450 for ; Sun, 2 May 2021 01:43:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231593AbhEBBoL (ORCPT ); Sat, 1 May 2021 21:44:11 -0400 Received: from mail-40131.protonmail.ch ([185.70.40.131]:54276 "EHLO mail-40131.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232225AbhEBBoK (ORCPT ); Sat, 1 May 2021 21:44:10 -0400 Date: Sun, 02 May 2021 01:43:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=connolly.tech; s=protonmail; t=1619919798; bh=1twZjmk0G+fLgXmyNkb7Ue7rlpuc4SbKld7JI01l880=; h=Date:To:From:Cc:Reply-To:Subject:From; b=d9ixEQ8r4A9EW6+c68ryrPidt0XtsWGl8xbMqCK0iY/qtspbeJFU7APBqNkin5sM2 OkpNi9bb/2pLQTjFY45Z0U56BcM93xqbR0H+SCHIqAnl02TymP5OPKh7OUDspI4zBk Lysis1ZfnbbSfBeQ0V+VdlbP/HEdcc3wgF7J57o0= To: caleb@connolly.tech, Andy Gross , Bjorn Andersson , Rob Herring From: Caleb Connolly Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Caleb Connolly Subject: [PATCH 4/4] dts: arm64: sdm845-oneplus-common: enable ipa Message-ID: <20210502014146.85642-5-caleb@connolly.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Enable the ipa node so that we can bring up mobile data. Signed-off-by: Caleb Connolly --- arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi index 96c370b90550..a6ec1d0b4263 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi @@ -397,6 +397,12 @@ rmi4_f12: rmi4-f12@12 { }; }; +&ipa { + status = "okay"; + + memory-region = <&ipa_fw_mem>; +}; + &mdss { status = "okay"; };