From ba3a5f47deaad7d5e7786052d9654b5a98a87938 Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Thu, 14 May 2020 12:50:57 -0500 Subject: Linux v5.6.13 --- ...d-agf-freeblocks-verify-in-xfs_agf_verify.patch | 107 +++++++++++++++++++++ kernel.spec | 13 ++- sources | 2 +- ...vent-log-version-before-reading-final-eve.patch | 81 ++++++++++++++++ 4 files changed, 201 insertions(+), 2 deletions(-) create mode 100644 0001-xfs-add-agf-freeblocks-verify-in-xfs_agf_verify.patch create mode 100644 tpm-check-event-log-version-before-reading-final-eve.patch diff --git a/0001-xfs-add-agf-freeblocks-verify-in-xfs_agf_verify.patch b/0001-xfs-add-agf-freeblocks-verify-in-xfs_agf_verify.patch new file mode 100644 index 000000000..8409a1f30 --- /dev/null +++ b/0001-xfs-add-agf-freeblocks-verify-in-xfs_agf_verify.patch @@ -0,0 +1,107 @@ +From d0c7feaf87678371c2c09b3709400be416b2dc62 Mon Sep 17 00:00:00 2001 +From: Zheng Bin +Date: Fri, 21 Feb 2020 07:38:20 -0800 +Subject: [PATCH] xfs: add agf freeblocks verify in xfs_agf_verify + +We recently used fuzz(hydra) to test XFS and automatically generate +tmp.img(XFS v5 format, but some metadata is wrong) + +xfs_repair information(just one AG): +agf_freeblks 0, counted 3224 in ag 0 +agf_longest 536874136, counted 3224 in ag 0 +sb_fdblocks 613, counted 3228 + +Test as follows: +mount tmp.img tmpdir +cp file1M tmpdir +sync + +In 4.19-stable, sync will stuck, the reason is: +xfs_mountfs + xfs_check_summary_counts + if ((!xfs_sb_version_haslazysbcount(&mp->m_sb) || + XFS_LAST_UNMOUNT_WAS_CLEAN(mp)) && + !xfs_fs_has_sickness(mp, XFS_SICK_FS_COUNTERS)) + return 0; -->just return, incore sb_fdblocks still be 613 + xfs_initialize_perag_data + +cp file1M tmpdir -->ok(write file to pagecache) +sync -->stuck(write pagecache to disk) +xfs_map_blocks + xfs_iomap_write_allocate + while (count_fsb != 0) { + nimaps = 0; + while (nimaps == 0) { --> endless loop + nimaps = 1; + xfs_bmapi_write(..., &nimaps) --> nimaps becomes 0 again +xfs_bmapi_write + xfs_bmap_alloc + xfs_bmap_btalloc + xfs_alloc_vextent + xfs_alloc_fix_freelist + xfs_alloc_space_available -->fail(agf_freeblks is 0) + +In linux-next, sync not stuck, cause commit c2b3164320b5 ("xfs: +use the latest extent at writeback delalloc conversion time") remove +the above while, dmesg is as follows: +[ 55.250114] XFS (loop0): page discard on page ffffea0008bc7380, inode 0x1b0c, offset 0. + +Users do not know why this page is discard, the better soultion is: +1. Like xfs_repair, make sure sb_fdblocks is equal to counted +(xfs_initialize_perag_data did this, who is not called at this mount) +2. Add agf verify, if fail, will tell users to repair + +This patch use the second soultion. + +Signed-off-by: Zheng Bin +Signed-off-by: Ren Xudong +Reviewed-by: Darrick J. Wong +Signed-off-by: Darrick J. Wong +--- + fs/xfs/libxfs/xfs_alloc.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c +index d8053bc96c4d..183dc2587092 100644 +--- a/fs/xfs/libxfs/xfs_alloc.c ++++ b/fs/xfs/libxfs/xfs_alloc.c +@@ -2858,6 +2858,13 @@ xfs_agf_verify( + be32_to_cpu(agf->agf_flcount) <= xfs_agfl_size(mp))) + return __this_address; + ++ if (be32_to_cpu(agf->agf_length) > mp->m_sb.sb_dblocks) ++ return __this_address; ++ ++ if (be32_to_cpu(agf->agf_freeblks) < be32_to_cpu(agf->agf_longest) || ++ be32_to_cpu(agf->agf_freeblks) > be32_to_cpu(agf->agf_length)) ++ return __this_address; ++ + if (be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]) < 1 || + be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]) < 1 || + be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]) > XFS_BTREE_MAXLEVELS || +@@ -2869,6 +2876,10 @@ xfs_agf_verify( + be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAP]) > XFS_BTREE_MAXLEVELS)) + return __this_address; + ++ if (xfs_sb_version_hasrmapbt(&mp->m_sb) && ++ be32_to_cpu(agf->agf_rmap_blocks) > be32_to_cpu(agf->agf_length)) ++ return __this_address; ++ + /* + * during growfs operations, the perag is not fully initialised, + * so we can't use it for any useful checking. growfs ensures we can't +@@ -2882,6 +2893,11 @@ xfs_agf_verify( + be32_to_cpu(agf->agf_btreeblks) > be32_to_cpu(agf->agf_length)) + return __this_address; + ++ if (xfs_sb_version_hasreflink(&mp->m_sb) && ++ be32_to_cpu(agf->agf_refcount_blocks) > ++ be32_to_cpu(agf->agf_length)) ++ return __this_address; ++ + if (xfs_sb_version_hasreflink(&mp->m_sb) && + (be32_to_cpu(agf->agf_refcount_level) < 1 || + be32_to_cpu(agf->agf_refcount_level) > XFS_BTREE_MAXLEVELS)) +-- +2.26.2 + diff --git a/kernel.spec b/kernel.spec index 60d5c4d05..082527de7 100644 --- a/kernel.spec +++ b/kernel.spec @@ -89,7 +89,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 12 +%define stable_update 13 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -901,6 +901,12 @@ Patch512: drm-dp_mst-Fix-drm_dp_send_dpcd_write-return-code.patch # CVE-2020-10711 rhbz 1825116 1834778 Patch513: net-netlabel-cope-with-NULL-catmap.patch +#rhbz 1779611 +Patch514: tpm-check-event-log-version-before-reading-final-eve.patch + +# CVE-2020-12655 rhbz 1832543 1832545 +Patch515: 0001-xfs-add-agf-freeblocks-verify-in-xfs_agf_verify.patch + # END OF PATCH DEFINITIONS %endif @@ -2931,6 +2937,11 @@ fi # # %changelog +* Thu May 14 2020 Justin M. Forbes - 5.6.13-200 +- Linux v5.6.13 +- Fix boot hang caused by buggy TPM support (rhbz 1779611) +- Fix CVE-2020-12655 (rhbz 1832543 1832545) + * Tue May 12 2020 Justin M. Forbes - Fix CVE-2020-10711 (rhbz 1825116 1834778) diff --git a/sources b/sources index ebd905da4..f184fd65a 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.6.tar.xz) = 80846fe2b4e4a7ff471d2dde28a8216ae807a3209f959e93d39ea4fc9a189ea28ec3db9d303b3fe15a28c2cb90e7446876678e93e23353c2d6f262e364a06bc9 -SHA512 (patch-5.6.12.xz) = e057961567d8482482ce8e27467b4fc47ddff604a3fd47f5e4f4092a29cc9ef5d180dd739f3edff91ab373108b699c04e55131722e8d4f153f4dd7e7833b48cd +SHA512 (patch-5.6.13.xz) = 10eabe59db21b0d82932b8122d3f07f12aec435900350a6d7f3e281676a1036860e24284252425c5b08fea02215166e3f65c49e5b4af8dbb7e03bcfbc6a86148 diff --git a/tpm-check-event-log-version-before-reading-final-eve.patch b/tpm-check-event-log-version-before-reading-final-eve.patch new file mode 100644 index 000000000..9668c807b --- /dev/null +++ b/tpm-check-event-log-version-before-reading-final-eve.patch @@ -0,0 +1,81 @@ +From MAILER-DAEMON Thu May 14 17:38:32 2020 +From: Loïc Yhuel +To: linux-integrity@vger.kernel.org +Cc: matthewgarrett@google.com, ardb@kernel.org, jarkko.sakkinen@linux.intel.com, javierm@redhat.com, Loïc Yhuel +Subject: [PATCH] tpm: check event log version before reading final events +Date: Tue, 12 May 2020 06:01:13 +0200 +Message-Id: <20200512040113.277768-1-loic.yhuel@gmail.com> +Sender: linux-integrity-owner@vger.kernel.org +List-ID: +X-Mailing-List: linux-integrity@vger.kernel.org +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +This fixes the boot issues since 5.3 on several Dell models when the TPM +is enabled. Depending on the exact grub binary, booting the kernel would +freeze early, or just report an error parsing the final events log. + +We get an event log in the SHA-1 format, which doesn't have a +tcg_efi_specid_event_head in the first event, and there is a final events +table which doesn't match the crypto agile format. +__calc_tpm2_event_size reads bad "count" and "efispecid->num_algs", and +either fails, or loops long enough for the machine to be appear frozen. + +So we now only parse the final events table, which is per the spec always +supposed to be in the crypto agile format, when we got a event log in this +format. + +Fixes: 166a2809d65b2 ("tpm: Don't duplicate events from the final event log in the TCG2 log") +Fixes: c46f3405692de ("tpm: Reserve the TPM final events table") +Signed-off-by: Loïc Yhuel +Reviewed-by: Javier Martinez Canillas +Reviewed-by: Jerry Snitselaar +Reviewed-by: Matthew Garrett +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1779611 +--- + drivers/firmware/efi/libstub/tpm.c | 5 +++-- + drivers/firmware/efi/tpm.c | 3 ++- + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/drivers/firmware/efi/libstub/tpm.c b/drivers/firmware/efi/libstub/tpm.c +index 1d59e103a2e3..e9a684637b70 100644 +--- a/drivers/firmware/efi/libstub/tpm.c ++++ b/drivers/firmware/efi/libstub/tpm.c +@@ -54,7 +54,7 @@ void efi_retrieve_tpm2_eventlog(void) + efi_status_t status; + efi_physical_addr_t log_location = 0, log_last_entry = 0; + struct linux_efi_tpm_eventlog *log_tbl = NULL; +- struct efi_tcg2_final_events_table *final_events_table; ++ struct efi_tcg2_final_events_table *final_events_table = NULL; + unsigned long first_entry_addr, last_entry_addr; + size_t log_size, last_entry_size; + efi_bool_t truncated; +@@ -127,7 +127,8 @@ void efi_retrieve_tpm2_eventlog(void) + * Figure out whether any events have already been logged to the + * final events structure, and if so how much space they take up + */ +- final_events_table = get_efi_config_table(LINUX_EFI_TPM_FINAL_LOG_GUID); ++ if (version == EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) ++ final_events_table = get_efi_config_table(LINUX_EFI_TPM_FINAL_LOG_GUID); + if (final_events_table && final_events_table->nr_events) { + struct tcg_pcr_event2_head *header; + int offset; +diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c +index 55b031d2c989..77e101a395e7 100644 +--- a/drivers/firmware/efi/tpm.c ++++ b/drivers/firmware/efi/tpm.c +@@ -62,7 +62,8 @@ int __init efi_tpm_eventlog_init(void) + tbl_size = sizeof(*log_tbl) + log_tbl->size; + memblock_reserve(efi.tpm_log, tbl_size); + +- if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR) ++ if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR || ++ log_tbl->version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) + goto out; + + final_tbl = early_memremap(efi.tpm_final_log, sizeof(*final_tbl)); +-- +2.26.2 + + -- cgit From a760bf919fde3175fd2f9c7658f8010e9351f3d4 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 18 May 2020 17:11:18 +0200 Subject: Add patch fixing backlight control on Cherry Trail devices (rhbz 1828927) --- ...x-get_state-runtime-pm-reference-handling.patch | 100 +++++++++++++++++++++ kernel.spec | 6 ++ 2 files changed, 106 insertions(+) create mode 100644 0001-pwm-lpss-Fix-get_state-runtime-pm-reference-handling.patch diff --git a/0001-pwm-lpss-Fix-get_state-runtime-pm-reference-handling.patch b/0001-pwm-lpss-Fix-get_state-runtime-pm-reference-handling.patch new file mode 100644 index 000000000..f5232e408 --- /dev/null +++ b/0001-pwm-lpss-Fix-get_state-runtime-pm-reference-handling.patch @@ -0,0 +1,100 @@ +From 3666fb55d53fb40f75ec4d665416fed1a714ef09 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 12 May 2020 00:39:24 +0200 +Subject: [PATCH] pwm: lpss: Fix get_state runtime-pm reference handling + +Before commit cfc4c189bc70 ("pwm: Read initial hardware state at request +time"), a driver's get_state callback would get called once per PWM from +pwmchip_add(). + +pwm-lpss' runtime-pm code was relying on this, getting a runtime-pm ref for +PWMs which are enabled at probe time from within its get_state callback, +before enabling runtime-pm. + +The change to calling get_state at request time causes a number of +problems: + +1. PWMs enabled at probe time may get runtime suspended before they are +requested, causing e.g. a LCD backlight controlled by the PWM to turn off. + +2. When the request happens when the PWM has been runtime suspended, the +ctrl register will read all 1 / 0xffffffff, causing get_state to store +bogus values in the pwm_state. + +3. get_state was using an async pm_runtime_get() call, because it assumed +that runtime-pm has not been enabled yet. If shortly after the request an +apply call is made, then the pwm_lpss_is_updating() check may trigger +because the resume triggered by the pm_runtime_get() call is not complete +yet, so the ctrl register still reads all 1 / 0xffffffff. + +This commit fixes these issues by moving the initial pm_runtime_get() call +for PWMs which are enabled at probe time to the pwm_lpss_probe() function; +and by making get_state take a runtime-pm ref before reading the ctrl reg. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1828927 +Fixes: cfc4c189bc70 ("pwm: Read initial hardware state at request time") +Cc: stable@vger.kernel.org +Reviewed-by: Andy Shevchenko +Signed-off-by: Hans de Goede +Upstream Status: https://lore.kernel.org/linux-acpi/5f15f6bc-8650-d86e-893f-0d41557c57c7@redhat.com/ +--- + drivers/pwm/pwm-lpss.c | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +diff --git a/drivers/pwm/pwm-lpss.c b/drivers/pwm/pwm-lpss.c +index 75bbfe5f3bc2..9d965ffe66d1 100644 +--- a/drivers/pwm/pwm-lpss.c ++++ b/drivers/pwm/pwm-lpss.c +@@ -158,7 +158,6 @@ static int pwm_lpss_apply(struct pwm_chip *chip, struct pwm_device *pwm, + return 0; + } + +-/* This function gets called once from pwmchip_add to get the initial state */ + static void pwm_lpss_get_state(struct pwm_chip *chip, struct pwm_device *pwm, + struct pwm_state *state) + { +@@ -167,6 +166,8 @@ static void pwm_lpss_get_state(struct pwm_chip *chip, struct pwm_device *pwm, + unsigned long long base_unit, freq, on_time_div; + u32 ctrl; + ++ pm_runtime_get_sync(chip->dev); ++ + base_unit_range = BIT(lpwm->info->base_unit_bits); + + ctrl = pwm_lpss_read(pwm); +@@ -187,8 +188,7 @@ static void pwm_lpss_get_state(struct pwm_chip *chip, struct pwm_device *pwm, + state->polarity = PWM_POLARITY_NORMAL; + state->enabled = !!(ctrl & PWM_ENABLE); + +- if (state->enabled) +- pm_runtime_get(chip->dev); ++ pm_runtime_put(chip->dev); + } + + static const struct pwm_ops pwm_lpss_ops = { +@@ -202,7 +202,8 @@ struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, struct resource *r, + { + struct pwm_lpss_chip *lpwm; + unsigned long c; +- int ret; ++ int i, ret; ++ u32 ctrl; + + if (WARN_ON(info->npwm > MAX_PWMS)) + return ERR_PTR(-ENODEV); +@@ -232,6 +233,12 @@ struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, struct resource *r, + return ERR_PTR(ret); + } + ++ for (i = 0; i < lpwm->info->npwm; i++) { ++ ctrl = pwm_lpss_read(&lpwm->chip.pwms[i]); ++ if (ctrl & PWM_ENABLE) ++ pm_runtime_get(dev); ++ } ++ + return lpwm; + } + EXPORT_SYMBOL_GPL(pwm_lpss_probe); +-- +2.26.2 + diff --git a/kernel.spec b/kernel.spec index 082527de7..f25fc76d8 100644 --- a/kernel.spec +++ b/kernel.spec @@ -907,6 +907,9 @@ Patch514: tpm-check-event-log-version-before-reading-final-eve.patch # CVE-2020-12655 rhbz 1832543 1832545 Patch515: 0001-xfs-add-agf-freeblocks-verify-in-xfs_agf_verify.patch +# rhbz 1828927 No backlight control on CHT devices, patch posted upstream +Patch516: 0001-pwm-lpss-Fix-get_state-runtime-pm-reference-handling.patch + # END OF PATCH DEFINITIONS %endif @@ -2937,6 +2940,9 @@ fi # # %changelog +* Mon May 18 2020 Hans de Goede +- Add patch fixing backlight control on Cherry Trail devices (rhbz 1828927) + * Thu May 14 2020 Justin M. Forbes - 5.6.13-200 - Linux v5.6.13 - Fix boot hang caused by buggy TPM support (rhbz 1779611) -- cgit From 8cbf8ccb0a8a977d54a607384afda6cf15dd9c45 Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Mon, 18 May 2020 17:23:50 -0500 Subject: Fix stability issue with the jetson-tk1 NIC --- ...a-Revert-raw_violation_fixup-for-tegra124.patch | 144 +++++++++++++++++++++ kernel.spec | 6 + 2 files changed, 150 insertions(+) create mode 100644 RFC-PCI-tegra-Revert-raw_violation_fixup-for-tegra124.patch diff --git a/RFC-PCI-tegra-Revert-raw_violation_fixup-for-tegra124.patch b/RFC-PCI-tegra-Revert-raw_violation_fixup-for-tegra124.patch new file mode 100644 index 000000000..3142df6dc --- /dev/null +++ b/RFC-PCI-tegra-Revert-raw_violation_fixup-for-tegra124.patch @@ -0,0 +1,144 @@ +From patchwork Mon Apr 20 16:43:04 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Nicolas Chauvet +X-Patchwork-Id: 1273561 +Return-Path: +X-Original-To: incoming@patchwork.ozlabs.org +Delivered-To: patchwork-incoming@bilbo.ozlabs.org +Authentication-Results: ozlabs.org; + spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org + (client-ip=23.128.96.18; helo=vger.kernel.org; + envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) +Authentication-Results: ozlabs.org; + dmarc=pass (p=none dis=none) header.from=gmail.com +Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; + unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 + header.s=20161025 header.b=TzeKBoiR; dkim-atps=neutral +Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) + by ozlabs.org (Postfix) with ESMTP id 495XZC49yWz9sP7 + for ; Tue, 21 Apr 2020 02:43:15 +1000 (AEST) +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1726731AbgDTQnK (ORCPT ); + Mon, 20 Apr 2020 12:43:10 -0400 +Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42314 "EHLO + lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) + by vger.kernel.org with ESMTP id S1726693AbgDTQnI (ORCPT + ); + Mon, 20 Apr 2020 12:43:08 -0400 +Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com + [IPv6:2a00:1450:4864:20::342]) + by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ED4CC061A0C; + Mon, 20 Apr 2020 09:43:08 -0700 (PDT) +Received: by mail-wm1-x342.google.com with SMTP id x25so280061wmc.0; + Mon, 20 Apr 2020 09:43:08 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; + h=from:to:cc:subject:date:message-id:mime-version + :content-transfer-encoding; + bh=IHuj1FiuJPknu8Z7Uq/JeXw8aSg2xFkcoVYT3QRT6dA=; + b=TzeKBoiR2hu1L+OGuVzAMrvuOnCDM+J1nsGD1QbB9tkwdgx5rUc3jCkTzkFKQpJZ+g + jx96zAcsJH7FSzAMjcpWTgiixmPWJj0xuWXML6IW4oVt5Npm6F2D8UyjZyfgnUKcGU/k + Ye+bmwRUMi6cBC1Jpn93V5znfun/KPJFuOi1qLjh4g9rRAQWp4o4mZYTnxBkkMhi63gU + V7L+RQlj4buS+IXOZ/xi5chAd/gFJkADDOm8HVDAcIG6pEUCkXciuRiNL3f81ss3nwjq + uQQg7uRc8wXqOP1IqZ+W8kYP25Bty+uiykVyhv6XfOg0vWk4GK+wnM0wcP7boPe8Y8sS + dTLg== +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:mime-version + :content-transfer-encoding; + bh=IHuj1FiuJPknu8Z7Uq/JeXw8aSg2xFkcoVYT3QRT6dA=; + b=YcZCjbicKhCKe1SzKhwIcD9gZI/8J/QS/LQk4lcoLCwcSjlg9p0O/m5t80TGXT4lcn + wFh0VyY+SsMR6uXCPrN8QXYbEY6fFVxEY2+btKzt+ft0v4jQUljopKGOV6n85FRs89U4 + DrjNPXoL7izbuheb/tW9ZBrrMTLQ1btIJ/MiAZ2gKtlrachezXQjW1Gtn66/hEpIQybL + 9ctDGvygIAju/Yd9fx+cakfzPUGzKTc/yOhjKjbMfxF6YxTbdqPc08+0a3cOYoSoRKLE + i/drXsQpQhJHOhzZWXinld37vEHc/1pa/HYv3QR+UAproGfZq4eGqBh6cIYY87fW7nHk + lsmg== +X-Gm-Message-State: AGi0PuYqEn+eRXnjHmfYwoSYQUy0ZK+SX7Vpbgu/XErfwPhXok1ZAmWe + N87IAyxXhJOQCMJxw6TgfSo= +X-Google-Smtp-Source: APiQypLsj3XpHj4CyxtmOjlqdZs3DB8oJEEo2ghhT6QywH/SywA9LShfe1OCbQ3t6MmEGWRd+WIiVw== +X-Received: by 2002:a1c:41d7:: with SMTP id o206mr194590wma.89.1587400987185; + Mon, 20 Apr 2020 09:43:07 -0700 (PDT) +Received: from arrakis.kwizart.net (lfbn-nic-1-185-211.w2-15.abo.wanadoo.fr. + [2.15.34.211]) + by smtp.gmail.com with ESMTPSA id l4sm47922wrv.60.2020.04.20.09.43.05 + (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); + Mon, 20 Apr 2020 09:43:06 -0700 (PDT) +From: Nicolas Chauvet +To: Manikanta Maddireddy , + Thierry Reding , + Jonathan Hunter +Cc: Lorenzo Pieralisi , + linux-tegra@vger.kernel.org, linux-pci@vger.kernel.org, + Nicolas Chauvet +Subject: [RFC] PCI: tegra: Revert raw_violation_fixup for tegra124 +Date: Mon, 20 Apr 2020 18:43:04 +0200 +Message-Id: <20200420164304.28810-1-kwizart@gmail.com> +X-Mailer: git-send-email 2.25.2 +MIME-Version: 1.0 +Sender: linux-tegra-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-tegra@vger.kernel.org + +As reported in https://bugzilla.kernel.org/206217 , raw_violation_fixup +is causing more harm than good in some common use-cases. + +This patch as RFC is a partial revert of the 191cd6fb5 commit: + "PCI: tegra: Add SW fixup for RAW violations" +that was first introduced in 5.3 kernel. +This fix the following regression since then. + + +When using both the network NIC and I/O on MMC this can lead to the +following message on jetson-tk1: + + NETDEV WATCHDOG: enp1s0 (r8169): transmit queue 0 timed out + +and + + pcieport 0000:00:02.0: AER: Uncorrected (Non-Fatal) error received: 0000:01:00.0 + r8169 0000:01:00.0: AER: PCIe Bus Error: severity=Uncorrected (Non-Fatal), type=Transaction Layer, (Requester ID) + r8169 0000:01:00.0: AER: device [10ec:8168] error status/mask=00004000/00400000 + r8169 0000:01:00.0: AER: [14] CmpltTO (First) + r8169 0000:01:00.0: AER: can't recover (no error_detected callback) + pcieport 0000:00:02.0: AER: device recovery failed + + +After that, the ethernet NIC isn't functional anymore even after reloading +the module. +After a reboot, this is reproducible by copying a large file over the +ethernet NIC to the MMC. +For some reasons this cannot be reproduced when the same file is copied +to a tmpfs. + + +This patch is RFC because it requires more understanding from Nvidia. + - Is the fixup (available in l4t downstrem) still needed for upstream ? + - Is there a need to update the fixup values for upstream ? + - If the fixup is reverted, does the hw bug can still be seen with + upstream ? + +Others can also provides more understanding: + - Conditions to reproduce the bug (or not)... + + +Signed-off-by: Nicolas Chauvet +Reviewed-by: Manikanta Maddireddy +--- + drivers/pci/controller/pci-tegra.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c +index 3e64ba6a36a8..4027e074094a 100644 +--- a/drivers/pci/controller/pci-tegra.c ++++ b/drivers/pci/controller/pci-tegra.c +@@ -2470,7 +2470,7 @@ static const struct tegra_pcie_soc tegra124_pcie = { + .program_uphy = true, + .update_clamp_threshold = true, + .program_deskew_time = false, +- .raw_violation_fixup = true, ++ .raw_violation_fixup = false, + .update_fc_timer = false, + .has_cache_bars = false, + .ectl.enable = false, diff --git a/kernel.spec b/kernel.spec index f25fc76d8..4f71331d5 100644 --- a/kernel.spec +++ b/kernel.spec @@ -910,6 +910,9 @@ Patch515: 0001-xfs-add-agf-freeblocks-verify-in-xfs_agf_verify.patch # rhbz 1828927 No backlight control on CHT devices, patch posted upstream Patch516: 0001-pwm-lpss-Fix-get_state-runtime-pm-reference-handling.patch +# kernel.org bz 206217 +Patch517: RFC-PCI-tegra-Revert-raw_violation_fixup-for-tegra124.patch + # END OF PATCH DEFINITIONS %endif @@ -2940,6 +2943,9 @@ fi # # %changelog +* Mon May 18 2020 Justin M. Forbes +- Fix stability issue with the jetson-tk1 NIC + * Mon May 18 2020 Hans de Goede - Add patch fixing backlight control on Cherry Trail devices (rhbz 1828927) -- cgit