summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThorsten Leemhuis <fedora@leemhuis.info>2019-05-02 10:17:18 +0200
committerThorsten Leemhuis <fedora@leemhuis.info>2019-05-02 10:17:18 +0200
commit124c42326d16cfc11e1594374e0eaef21e0b3d13 (patch)
tree4900028d9316866d8bfcecb9efd5dab2956a1d54
parentdd81fe88747cf23ce6fc3302d488bc9de934bbd9 (diff)
parent5ff888cd8f08a753aeeeedb2204bb6e35a8c34f9 (diff)
downloadkernel-124c42326d16cfc11e1594374e0eaef21e0b3d13.tar.gz
kernel-124c42326d16cfc11e1594374e0eaef21e0b3d13.tar.xz
kernel-124c42326d16cfc11e1594374e0eaef21e0b3d13.zip
merge origin
-rw-r--r--0001-platform-x86-ideapad-laptop-Remove-no_hw_rfkill_list.patch365
-rw-r--r--kernel.spec13
-rw-r--r--v3-tpm-fix-an-invalid-condition-in-tpm_common_poll.patch103
3 files changed, 375 insertions, 106 deletions
diff --git a/0001-platform-x86-ideapad-laptop-Remove-no_hw_rfkill_list.patch b/0001-platform-x86-ideapad-laptop-Remove-no_hw_rfkill_list.patch
new file mode 100644
index 000000000..5ecaffc1a
--- /dev/null
+++ b/0001-platform-x86-ideapad-laptop-Remove-no_hw_rfkill_list.patch
@@ -0,0 +1,365 @@
+From de5d850913e9d5fb272f386fb36ef5f5776afb0c Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Mon, 29 Apr 2019 15:11:26 +0200
+Subject: [PATCH] platform/x86: ideapad-laptop: Remove no_hw_rfkill_list
+
+When the ideapad-laptop driver was first written it was written for laptops
+which had a hardware rfkill switch. So when the first ideapad laptops
+showed up without a hw rfkill switch and it turned out that in this case
+the ideapad firmware interface would always report the wifi being hardware-
+blocked, a DMI id list of models which lack a hw rfkill switch was started
+(by yours truly). Things were done this way to avoid regressing existing
+models with a hw rfkill switch. In hindsight this was a mistake.
+
+Lenovo releases a lot of ideapad models every year and even the latest
+models still use the "VPC2004" ACPI interface the ideapad-laptop driver
+binds to. Having a hw rfkill switch is quite rare on modern hardware, so
+all these new models need to be added to the no_hw_rfkill_list, leading
+to a never ending game of whack a mole.
+
+Worse the failure mode when not present on the list, is very bad. In this
+case the ideapad-laptop driver will report the wifi as being hw-blocked,
+at which points NetworkManager does not even try to use it and the user
+ends up with non working wifi.
+
+This leads to various Linux fora on the internet being filled with
+wifi not working on ideapad laptops stories, which does not make Linux
+look good.
+
+The failure mode when we flip the default to assuming that a hw rfkill
+switch is not present OTOH is quite benign. When we properly report the
+wifi as being hw-blocked on ideapads which do have the hw-switch; and it
+is in the wifi-off position, then at least when using NetworkManager +
+GNOME3 the user will get a "wifi disabled in hardware" message when trying
+to connect to the wifi from the UI. If OTOH we assume there is no hardware
+rfkill switch, then the user will get an empty list for the list of
+available networks. Although the empty list vs the "wifi disabled in
+hardware" message is a regression, it is a very minor regression and it
+can easily be fixed on a model by model basis by filling the new
+hw_rfkill_list this commit introduces.
+
+Therefor this commit removes the ever growing no_hw_rfkill_list, flipping
+the default to assuming there is no hw rfkill switch and adding a new
+hw_rfkill_list. Thereby fixing the wifi not working on all the current
+ideapad and yoga models which are not on the list yet and also fixing it
+for all future ideapad and yoga models using the "VPC2004" ACPI interface.
+
+Note once this patch has been accepted upstream. I plan to write a blog
+post asking for users of ideapads and yoga's with a hw rfkill switch to
+step forward, so that we can populate the new hw_rfkill_list with the few
+older yoga and ideapad models which actually have a hw rfkill switch.
+
+BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1703338
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+---
+ drivers/platform/x86/ideapad-laptop.c | 321 ++------------------------
+ 1 file changed, 15 insertions(+), 306 deletions(-)
+
+diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
+index c53ae86b59c7..2d94536dea88 100644
+--- a/drivers/platform/x86/ideapad-laptop.c
++++ b/drivers/platform/x86/ideapad-laptop.c
+@@ -980,277 +980,21 @@ static void ideapad_wmi_notify(u32 value, void *context)
+ #endif
+
+ /*
+- * Some ideapads don't have a hardware rfkill switch, reading VPCCMD_R_RF
+- * always results in 0 on these models, causing ideapad_laptop to wrongly
+- * report all radios as hardware-blocked.
++ * Some ideapads have a hardware rfkill switch, but most do not have one.
++ * Reading VPCCMD_R_RF always results in 0 on models without a hardware rfkill,
++ * switch causing ideapad_laptop to wrongly report all radios as hw-blocked.
++ * There used to be a long list of DMI ids for models without a hw rfkill
++ * switch here, but that resulted in playing whack a mole.
++ * More importantly wrongly reporting the wifi radio as hw-blocked, results in
++ * non working wifi. Whereas not reporting it hw-blocked, when it actually is
++ * hw-blocked results in an empty SSID list, which is a much more benign
++ * failure mode.
++ * So the default now is the much safer option of assuming there is no
++ * hardware rfkill switch. This default also actually matches most hardware,
++ * since having a hw rfkill switch is quite rare on modern hardware, so this
++ * also leads to a much shorter list.
+ */
+-static const struct dmi_system_id no_hw_rfkill_list[] = {
+- {
+- .ident = "Lenovo RESCUER R720-15IKBN",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo R720-15IKBN"),
+- },
+- },
+- {
+- .ident = "Lenovo G40-30",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo G40-30"),
+- },
+- },
+- {
+- .ident = "Lenovo G50-30",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo G50-30"),
+- },
+- },
+- {
+- .ident = "Lenovo V310-14IKB",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo V310-14IKB"),
+- },
+- },
+- {
+- .ident = "Lenovo V310-14ISK",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo V310-14ISK"),
+- },
+- },
+- {
+- .ident = "Lenovo V310-15IKB",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo V310-15IKB"),
+- },
+- },
+- {
+- .ident = "Lenovo V310-15ISK",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo V310-15ISK"),
+- },
+- },
+- {
+- .ident = "Lenovo V510-15IKB",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo V510-15IKB"),
+- },
+- },
+- {
+- .ident = "Lenovo ideapad 300-15IBR",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 300-15IBR"),
+- },
+- },
+- {
+- .ident = "Lenovo ideapad 300-15IKB",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 300-15IKB"),
+- },
+- },
+- {
+- .ident = "Lenovo ideapad 300S-11IBR",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 300S-11BR"),
+- },
+- },
+- {
+- .ident = "Lenovo ideapad 310-15ABR",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 310-15ABR"),
+- },
+- },
+- {
+- .ident = "Lenovo ideapad 310-15IAP",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 310-15IAP"),
+- },
+- },
+- {
+- .ident = "Lenovo ideapad 310-15IKB",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 310-15IKB"),
+- },
+- },
+- {
+- .ident = "Lenovo ideapad 310-15ISK",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad 310-15ISK"),
+- },
+- },
+- {
+- .ident = "Lenovo ideapad Y700-14ISK",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad Y700-14ISK"),
+- },
+- },
+- {
+- .ident = "Lenovo ideapad Y700-15ACZ",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad Y700-15ACZ"),
+- },
+- },
+- {
+- .ident = "Lenovo ideapad Y700-15ISK",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad Y700-15ISK"),
+- },
+- },
+- {
+- .ident = "Lenovo ideapad Y700 Touch-15ISK",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad Y700 Touch-15ISK"),
+- },
+- },
+- {
+- .ident = "Lenovo ideapad Y700-17ISK",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad Y700-17ISK"),
+- },
+- },
+- {
+- .ident = "Lenovo ideapad MIIX 720-12IKB",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "MIIX 720-12IKB"),
+- },
+- },
+- {
+- .ident = "Lenovo Legion Y520-15IKB",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Y520-15IKB"),
+- },
+- },
+- {
+- .ident = "Lenovo Y520-15IKBM",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Y520-15IKBM"),
+- },
+- },
+- {
+- .ident = "Lenovo Legion Y530-15ICH",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Legion Y530-15ICH"),
+- },
+- },
+- {
+- .ident = "Lenovo Legion Y720-15IKB",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Y720-15IKB"),
+- },
+- },
+- {
+- .ident = "Lenovo Legion Y720-15IKBN",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Y720-15IKBN"),
+- },
+- },
+- {
+- .ident = "Lenovo Y720-15IKBM",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Y720-15IKBM"),
+- },
+- },
+- {
+- .ident = "Lenovo Yoga 2 11 / 13 / Pro",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 2"),
+- },
+- },
+- {
+- .ident = "Lenovo Yoga 2 11 / 13 / Pro",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_BOARD_NAME, "Yoga2"),
+- },
+- },
+- {
+- .ident = "Lenovo Yoga 2 13",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Yoga 2 13"),
+- },
+- },
+- {
+- .ident = "Lenovo Yoga 3 1170 / 1470",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 3"),
+- },
+- },
+- {
+- .ident = "Lenovo Yoga 3 Pro 1370",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 3"),
+- },
+- },
+- {
+- .ident = "Lenovo Yoga 700",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 700"),
+- },
+- },
+- {
+- .ident = "Lenovo Yoga 900",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 900"),
+- },
+- },
+- {
+- .ident = "Lenovo Yoga 900",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_BOARD_NAME, "VIUU4"),
+- },
+- },
+- {
+- .ident = "Lenovo YOGA 910-13IKB",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 910-13IKB"),
+- },
+- },
+- {
+- .ident = "Lenovo YOGA 920-13IKB",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 920-13IKB"),
+- },
+- },
+- {
+- .ident = "Lenovo Zhaoyang E42-80",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+- DMI_MATCH(DMI_PRODUCT_VERSION, "ZHAOYANG E42-80"),
+- },
+- },
++static const struct dmi_system_id hw_rfkill_list[] = {
+ {}
+ };
+
+@@ -1311,7 +1020,7 @@ static int ideapad_acpi_add(struct platform_device *pdev)
+ priv->cfg = cfg;
+ priv->adev = adev;
+ priv->platform_device = pdev;
+- priv->has_hw_rfkill_switch = !dmi_check_system(no_hw_rfkill_list);
++ priv->has_hw_rfkill_switch = dmi_check_system(hw_rfkill_list);
+
+ ret = ideapad_sysfs_init(priv);
+ if (ret)
+--
+2.21.0
+
diff --git a/kernel.spec b/kernel.spec
index 69f530d5c..534942eb5 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -45,6 +45,7 @@ Summary: The Linux kernel
# gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
#
%global baserelease 350
+
%global fedora_build %{baserelease}
# base_sublevel is the kernel version we're starting with and patching
@@ -635,9 +636,6 @@ Patch510: i915-enable-fastboot-on-vlv-chv.patch
# rhbz 1689750, patch submitted upstream
Patch511: 0001-virt-vbox-Implement-passing-requestor-info-to-the-ho.patch
-# rhbz 1688283
-Patch512: v3-tpm-fix-an-invalid-condition-in-tpm_common_poll.patch
-
# rhbz 1683382
Patch515: nfsv4.1-avoid-false-retries.patch
@@ -665,6 +663,9 @@ Patch523: KEYS-Make-use-of-platform-keyring-for-module-signature.patch
# CVE-2019-3900 rhbz 1698757 1702940
Patch524: net-vhost_net-fix-possible-infinite-loop.patch
+# Fix wifi on various ideapad models not working (rhbz#1703338)
+Patch525: 0001-platform-x86-ideapad-laptop-Remove-no_hw_rfkill_list.patch
+
# END OF PATCH DEFINITIONS
%endif
@@ -1941,6 +1942,12 @@ fi
#
#
%changelog
+* Tue Apr 30 2019 Laura Abbott <labbott@redhat.com> - 5.0.10-300
+- Linux v5.0.10
+
+* Tue Apr 30 2019 Hans de Goede <hdegoede@redhat.com>
+- Fix wifi on various ideapad models not working (rhbz#1703338)
+
* Thu Apr 25 2019 Justin M. Forbes <jforbes@fedoraproject.org>
- Fix CVE-2019-3900 (rhbz 1698757 1702940)
diff --git a/v3-tpm-fix-an-invalid-condition-in-tpm_common_poll.patch b/v3-tpm-fix-an-invalid-condition-in-tpm_common_poll.patch
deleted file mode 100644
index 606373aa4..000000000
--- a/v3-tpm-fix-an-invalid-condition-in-tpm_common_poll.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From patchwork Thu Mar 21 23:02:12 2019
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 8bit
-X-Patchwork-Submitter: Tadeusz Struk <tadeusz.struk@intel.com>
-X-Patchwork-Id: 10864497
-Return-Path: <linux-integrity-owner@kernel.org>
-Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
- [172.30.200.125])
- by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 711816C2
- for <patchwork-linux-integrity@patchwork.kernel.org>;
- Thu, 21 Mar 2019 23:02:15 +0000 (UTC)
-Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
- by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57B312A4A8
- for <patchwork-linux-integrity@patchwork.kernel.org>;
- Thu, 21 Mar 2019 23:02:15 +0000 (UTC)
-Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
- id 4AA482A539; Thu, 21 Mar 2019 23:02:15 +0000 (UTC)
-X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
- pdx-wl-mail.web.codeaurora.org
-X-Spam-Level:
-X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI,
- RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1
-Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
- by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C399A2A4A8
- for <patchwork-linux-integrity@patchwork.kernel.org>;
- Thu, 21 Mar 2019 23:02:14 +0000 (UTC)
-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
- id S1727157AbfCUXCO (ORCPT
- <rfc822;patchwork-linux-integrity@patchwork.kernel.org>);
- Thu, 21 Mar 2019 19:02:14 -0400
-Received: from mga04.intel.com ([192.55.52.120]:7149 "EHLO mga04.intel.com"
- rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
- id S1727086AbfCUXCO (ORCPT <rfc822;linux-integrity@vger.kernel.org>);
- Thu, 21 Mar 2019 19:02:14 -0400
-X-Amp-Result: SKIPPED(no attachment in message)
-X-Amp-File-Uploaded: False
-Received: from orsmga004.jf.intel.com ([10.7.209.38])
- by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
- 21 Mar 2019 16:02:13 -0700
-X-ExtLoop1: 1
-X-IronPort-AV: E=Sophos;i="5.60,254,1549958400";
- d="scan'208";a="284777192"
-Received: from jdemuth-mobl.amr.corp.intel.com (HELO
- tstruk-mobl1.jf.intel.com) ([10.251.150.110])
- by orsmga004.jf.intel.com with ESMTP; 21 Mar 2019 16:02:13 -0700
-Subject: [PATCH v3] tpm: fix an invalid condition in tpm_common_poll
-From: Tadeusz Struk <tadeusz.struk@intel.com>
-To: jarkko.sakkinen@linux.intel.com
-Cc: grawity@gmail.com, James.Bottomley@HansenPartnership.com,
- linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
- stable@vger.kernel.org, tadeusz.struk@intel.com
-Date: Thu, 21 Mar 2019 16:02:12 -0700
-Message-ID:
- <155320933278.5015.1752135965699928631.stgit@tstruk-mobl1.jf.intel.com>
-User-Agent: StGit/unknown-version
-MIME-Version: 1.0
-Content-Type: text/plain; charset="utf-8"
-Sender: linux-integrity-owner@vger.kernel.org
-Precedence: bulk
-List-ID: <linux-integrity.vger.kernel.org>
-X-Mailing-List: linux-integrity@vger.kernel.org
-X-Virus-Scanned: ClamAV using ClamSMTP
-
-The poll condition should only check response_length,
-because reads should only be issued if there is data to read.
-The response_read flag only prevents double writes.
-The problem was that the write set the response_read to false,
-enqued a tpm job, and returned. Then application called poll
-which checked the response_read flag and returned EPOLLIN.
-Then the application called read, but got nothing.
-After all that the async_work kicked in.
-Added also mutex_lock around the poll check to prevent
-other possible race conditions.
-
-Fixes: 9488585b21bef0df12 ("tpm: add support for partial reads")
-Reported-by: Mantas Mikulėnas <grawity@gmail.com>
-Tested-by: Mantas Mikulėnas <grawity@gmail.com>
-Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
----
- drivers/char/tpm/tpm-dev-common.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/char/tpm/tpm-dev-common.c b/drivers/char/tpm/tpm-dev-common.c
-index 5eecad233ea1..7312d3214381 100644
---- a/drivers/char/tpm/tpm-dev-common.c
-+++ b/drivers/char/tpm/tpm-dev-common.c
-@@ -203,12 +203,14 @@ __poll_t tpm_common_poll(struct file *file, poll_table *wait)
- __poll_t mask = 0;
-
- poll_wait(file, &priv->async_wait, wait);
-+ mutex_lock(&priv->buffer_mutex);
-
-- if (!priv->response_read || priv->response_length)
-+ if (priv->response_length)
- mask = EPOLLIN | EPOLLRDNORM;
- else
- mask = EPOLLOUT | EPOLLWRNORM;
-
-+ mutex_unlock(&priv->buffer_mutex);
- return mask;
- }
-