]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/log
mirror_ubuntu-bionic-kernel.git
5 years agonet: hns3: add l4_type check for both ipv4 and ipv6
Peng Li [Thu, 28 Jun 2018 04:12:22 +0000 (12:12 +0800)]
net: hns3: add l4_type check for both ipv4 and ipv6

BugLink: https://bugs.launchpad.net/bugs/1787477
HW supports UDP, TCP and SCTP packets checksum for both ipv4 and
ipv6,  but do not support other type packets checksum for ipv4 or
ipv6.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 94c5e532130207f6ecfe0e1afd4ed3495ec1706f)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agonet: hns3: add vector status check before free vector
Peng Li [Thu, 28 Jun 2018 04:12:21 +0000 (12:12 +0800)]
net: hns3: add vector status check before free vector

BugLink: https://bugs.launchpad.net/bugs/1787477
If the hdev->vector_status[vector_id] is already HCLGE_INVALID_VPORT,
should log the error and return.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 36cbbdf6439729878271ff15422a643d13f133d4)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agonet: hns3: rename the interface for init_client_instance and uninit_client_instance
Peng Li [Thu, 28 Jun 2018 04:12:20 +0000 (12:12 +0800)]
net: hns3: rename the interface for init_client_instance and uninit_client_instance

BugLink: https://bugs.launchpad.net/bugs/1787477
The interface init_client_instance and uninit_client_instance
do not register anything, only initialize the client instance.
This patch rename the related interface to make the function
name to indicate the purpose.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e718a93fee036fa8f9b09c76319c81713473287b)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agonet: hns3: remove hclge_get_vector_index from hclge_bind_ring_with_vector
Peng Li [Thu, 28 Jun 2018 04:12:19 +0000 (12:12 +0800)]
net: hns3: remove hclge_get_vector_index from hclge_bind_ring_with_vector

BugLink: https://bugs.launchpad.net/bugs/1787477
In hclge_unmap_ring_frm_vector, there are 2 steps:
step 1: get vector index.
step 2 unbind ring with vector.

But it gets vector id again in step 2 interface. This patch
removes hclge_get_vector_index from hclge_bind_ring_with_vector,
and make the step the same with hns3 PF driver.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b204bc74840080136bf11643e998dc83afc2c11e)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agonet: hns3: Optimize PF CMDQ interrupt switching process
Xi Wang [Wed, 6 Jun 2018 13:07:53 +0000 (14:07 +0100)]
net: hns3: Optimize PF CMDQ interrupt switching process

BugLink: https://bugs.launchpad.net/bugs/1787477
When the PF frequently switches the CMDQ interrupt, if the CMDQ_SRC is
not cleared before the hardware interrupt is generated, the new interrupt
will not be reported.

This patch optimizes this problem by clearing CMDQ_SRC and RESET_STS
before enabling interrupt and syncing pending IRQ handlers after disabling
interrupt.

Fixes: 466b0c00391b ("net: hns3: Add support for misc interrupt")
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8e52a602b5126183f7a6487c4d48f6a00af4e4fd)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agonet: hns3: Fix for VF mailbox receiving unknown message
Xi Wang [Wed, 6 Jun 2018 13:07:52 +0000 (14:07 +0100)]
net: hns3: Fix for VF mailbox receiving unknown message

BugLink: https://bugs.launchpad.net/bugs/1787477
Before the firmware updates the crq's tail pointer, if the VF driver
reads the data in the crq, the data may be incomplete at this time,
which will lead to the driver read an unknown message.

This patch fixes it by checking if crq is empty before reading the
message.

Fixes: b11a0bb231f3 ("net: hns3: Add mailbox support to VF driver")
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6444e2a5f1e680278b58ced3568bdff84afe14a5)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agonet: hns3: Fix for VF mailbox cannot receiving PF response
Xi Wang [Wed, 6 Jun 2018 13:07:51 +0000 (14:07 +0100)]
net: hns3: Fix for VF mailbox cannot receiving PF response

BugLink: https://bugs.launchpad.net/bugs/1787477
When the VF frequently switches the CMDQ interrupt, if the CMDQ_SRC is not
cleared, the VF will not receive the new PF response after the interrupt
is re-enabled, the corresponding log is as follows:

[  317.482222] hns3 0000:00:03.0: VF could not get mbx resp(=0) from PF
in 500 tries
[  317.483137] hns3 0000:00:03.0: VF request to get tqp info from PF
failed -5

This patch fixes this problem by clearing CMDQ_SRC before enabling
interrupt and syncing pending IRQ handlers after disabling interrupt.

Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support")
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1819e40908ee76c7219287224c22c772556c927e)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agonet: hns3: remove unused hclgevf_cfg_func_mta_filter
Arnd Bergmann [Tue, 5 Jun 2018 11:38:21 +0000 (13:38 +0200)]
net: hns3: remove unused hclgevf_cfg_func_mta_filter

BugLink: https://bugs.launchpad.net/bugs/1787477
The last patch apparently added a complete replacement for this
function, but left the old one in place, which now causes a
harmless warning:

drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c:731:12: 'hclgevf_cfg_func_mta_filter' defined but not used

I assume it can be removed.

Fixes: 3a678b5806e6 ("net: hns3: Optimize the VF's process of updating multicast MAC")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4f416db98beaef2f047709e4693b0a4c64d9bbf8)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agonet: hns3: Updates RX packet info fetch in case of multi BD
Peng Li [Fri, 25 May 2018 18:42:56 +0000 (19:42 +0100)]
net: hns3: Updates RX packet info fetch in case of multi BD

BugLink: https://bugs.launchpad.net/bugs/1787477
In the latest revision of the hardware, if a packet is spanning
across multiple BDs then only VLD bit and current data size info
is valid in each BD, and rest of the information is only valid
in the last BD of the packet. In such case we should make sure
we are fetching RX packet size from the first descriptor and
information like VLAN should be fetched from last BD.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Reviewed-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 846fcc83638f8908a465583fa93f4d6f14161420)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: add support for serdes loopback selftest"
dann frazier [Thu, 16 Aug 2018 19:19:45 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: add support for serdes loopback selftest"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 2fd5416a2f614133a5b65993312337efe83193a8.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: RX BD information valid only in last BD...
dann frazier [Thu, 16 Aug 2018 19:19:44 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: RX BD information valid only in last BD except VLD bit and buffer size"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 70edc2eff688e9f32ee5197ed263e477203224cc.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: remove hclge_get_vector_index from hclge_b...
dann frazier [Thu, 16 Aug 2018 19:19:44 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: remove hclge_get_vector_index from hclge_bind_ring_with_vector"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 4e223bdc5e98288655b03624c07cfc32cff43860.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: rename the interface for init_client_insta...
dann frazier [Thu, 16 Aug 2018 19:19:43 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: rename the interface for init_client_instance and uninit_client_instance"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit e7e09222c1fe15917fae14494abcd69eacf0591b.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: add vector status check before free vector"
dann frazier [Thu, 16 Aug 2018 19:19:42 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: add vector status check before free vector"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 617cb5a2ee5682f413d4e5373956a65f2f9fc182.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: add l4_type check for both ipv4 and ipv6"
dann frazier [Thu, 16 Aug 2018 19:19:41 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: add l4_type check for both ipv4 and ipv6"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit d0d2616cc546e074271ad21660e2b279d7e4b556.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: remove unused head file in hnae3.c"
dann frazier [Thu, 16 Aug 2018 19:19:41 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: remove unused head file in hnae3.c"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 90261a24a400077f1bccbd623be93a2328ee5641.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: extraction an interface for state state...
dann frazier [Thu, 16 Aug 2018 19:19:40 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: extraction an interface for state state init|uninit"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 71d7e8eae30d5f5d24b75c6802f8bf421e42f4fc.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: print the ret value in error information"
dann frazier [Thu, 16 Aug 2018 19:19:39 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: print the ret value in error information"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 31ce0f41d8ee93bcac77428731400b54e5134575.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: remove the Redundant put_vector in hns3_cl...
dann frazier [Thu, 16 Aug 2018 19:19:38 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: remove the Redundant put_vector in hns3_client_uninit"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 21484e2ec8dba15f4856f44ab5b67b9c4f800583.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: add unlikely for error check"
dann frazier [Thu, 16 Aug 2018 19:19:38 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: add unlikely for error check"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 060ee442ac114e9e8d13a4ceb1ee5bc196ca2f32.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: remove back in struct hclge_hw"
dann frazier [Thu, 16 Aug 2018 19:19:37 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: remove back in struct hclge_hw"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 40a3c283e315fb700ad66c7dc4fcb38e494ec4c6.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: use lower_32_bits and upper_32_bits"
dann frazier [Thu, 16 Aug 2018 19:19:36 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: use lower_32_bits and upper_32_bits"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 6f3ea4f0b78b206ac070ff61dd9d41f97dbcff40.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: remove unused hclge_ring_to_dma_dir"
dann frazier [Thu, 16 Aug 2018 19:19:35 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: remove unused hclge_ring_to_dma_dir"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 27430c60d2ae49216951579664a3e807367c729f.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: remove useless code in hclge_cmd_send"
dann frazier [Thu, 16 Aug 2018 19:19:35 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: remove useless code in hclge_cmd_send"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 7dfa9f5cf003dd056c796637a95ce84eec2d0e55.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: remove some redundant assignments"
dann frazier [Thu, 16 Aug 2018 19:19:34 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: remove some redundant assignments"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 60d7d474ce0cd9bf1366cce4145ad770f7d544c2.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: simplify hclge_cmd_csq_clean"
dann frazier [Thu, 16 Aug 2018 19:19:33 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: simplify hclge_cmd_csq_clean"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 4838ebbaa47933074d0df03271a1054198ec1c6a.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: using modulo for cyclic counters in hclge_...
dann frazier [Fri, 17 Aug 2018 14:47:28 +0000 (08:47 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: using modulo for cyclic counters in hclge_cmd_send"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit c4a05b6f9f4b6389960245c9cc8c85172827caa6.

Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: remove a redundant hclge_cmd_csq_done"
dann frazier [Thu, 16 Aug 2018 19:19:32 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: remove a redundant hclge_cmd_csq_done"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit eed8c7c7240b24dd7478cc13407cb2a2a82f0cfd.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: remove some unused members of some structures"
dann frazier [Thu, 16 Aug 2018 19:19:32 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: remove some unused members of some structures"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 4334fd0cc11a674e531bcb8495ce00f572607bd0.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: give default option while dependency HNS3...
dann frazier [Thu, 16 Aug 2018 19:19:31 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: give default option while dependency HNS3 set"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 3028c344add416d05bf5bc5d5e973cd07a02f860.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: use dma_zalloc_coherent instead of kzalloc...
dann frazier [Thu, 16 Aug 2018 19:19:30 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: use dma_zalloc_coherent instead of kzalloc/dma_map_single"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 139b93ed1e68b21a75974a5e8fde85b127317d23.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: modify hnae_ to hnae3_"
dann frazier [Thu, 16 Aug 2018 19:19:29 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: modify hnae_ to hnae3_"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit e22b531b5889df48c77c44e9bc1ca0ee8e7a4c8d.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: fix unused function warning in VF driver"
dann frazier [Thu, 16 Aug 2018 19:19:29 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: fix unused function warning in VF driver"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 2090bd683ccc850faf3796b081a409790f760bdd.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: remove some redundant assignments"
dann frazier [Thu, 16 Aug 2018 19:19:28 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: remove some redundant assignments"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 6b4c81f1d5082085bbe8813ff3ee4559508009c6.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: standardize the handle of return value"
dann frazier [Thu, 16 Aug 2018 19:19:27 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: standardize the handle of return value"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit e125295a3c14bf38a4985a53be8d79d2c9ff6eef.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: remove extra space and brackets"
dann frazier [Thu, 16 Aug 2018 19:19:26 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: remove extra space and brackets"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit de4116e0c193e966532e28a358f82a9d639e7213.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: fix unreasonable code comments"
dann frazier [Thu, 16 Aug 2018 19:19:26 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: fix unreasonable code comments"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit ec7a62b9d265a09ec7002ce5e5190c327d97e907.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: use decimal for bit offset macros"
dann frazier [Thu, 16 Aug 2018 19:19:25 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: use decimal for bit offset macros"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 884ac31ad0e56667445c8f5258f6d0d49c26315e.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: modify inconsistent bit mask macros"
dann frazier [Thu, 16 Aug 2018 19:19:24 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: modify inconsistent bit mask macros"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit b28556c9e2f066e5068f1c06ba26cfbfb49eaa45.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: fix mislead parameter name"
dann frazier [Thu, 16 Aug 2018 19:19:23 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: fix mislead parameter name"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 5724458a1d6a8d2f1633fccd7c184d784faa7ff6.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: remove unused struct member and definition"
dann frazier [Thu, 16 Aug 2018 19:19:23 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: remove unused struct member and definition"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit f657456efc50204dd7f8ce3541cfaa8047700b16.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: Add SPDX tags to hns3 driver"
dann frazier [Thu, 16 Aug 2018 19:19:22 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: Add SPDX tags to hns3 driver"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 4e2e261deeb7dcac8cc190a9b243cc0fa741dd24.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: fix tc setup when netdev is first up"
dann frazier [Thu, 16 Aug 2018 19:19:21 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: fix tc setup when netdev is first up"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit c109b9dbbfefb39baee147af7abfb7f1578624cd.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: fix for mac pause not disable in pfc mode"
dann frazier [Thu, 16 Aug 2018 19:19:20 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: fix for mac pause not disable in pfc mode"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit c5172f8580446c8a01627e36382badf054f8d364.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: fix for waterline not setting correctly"
dann frazier [Thu, 16 Aug 2018 19:19:20 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: fix for waterline not setting correctly"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 1b9980c7632c0f4916eec49aaecc7ae5808fef51.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: fix for l4 checksum offload bug"
dann frazier [Thu, 16 Aug 2018 19:19:19 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: fix for l4 checksum offload bug"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 773583ecc9b3b120165e713aee19b01cc2d3ae59.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: fix for mailbox message truncated problem"
dann frazier [Thu, 16 Aug 2018 19:19:18 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: fix for mailbox message truncated problem"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 3f8c29a19c859345af09cabcf0e4c4b0382791a6.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: Add configure for mac minimal frame size"
dann frazier [Thu, 16 Aug 2018 19:19:17 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: Add configure for mac minimal frame size"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 51d434460b4d84490ddf67be289e8fe34fa34154.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: fix warning bug when doing lp selftest"
dann frazier [Thu, 16 Aug 2018 19:19:17 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: fix warning bug when doing lp selftest"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 9fc999febaff573c9faa512eb8801c67aa56bc87.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: fix get_vector ops in hclgevf_main module"
dann frazier [Thu, 16 Aug 2018 19:19:16 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: fix get_vector ops in hclgevf_main module"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 9c70f72ae293257e6895a78f017c03ca9c6b793a.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: remove the warning when clear reset cause"
dann frazier [Thu, 16 Aug 2018 19:19:15 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: remove the warning when clear reset cause"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit fef35fbb8da23052f35a0b7c5f8ccfd8fe32be14.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: prevent sending command during global...
dann frazier [Thu, 16 Aug 2018 19:19:14 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: prevent sending command during global or core reset"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 79d505d3bc14e4692a5fbbf21eee0342644cb228.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: modify the order of initializeing command...
dann frazier [Thu, 16 Aug 2018 19:19:13 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: modify the order of initializeing command queue register"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit c4cf5a7aee22f28c15aa086d5ac98f2e83081ee0.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: reset net device with rtnl_lock"
dann frazier [Thu, 16 Aug 2018 19:19:13 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: reset net device with rtnl_lock"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 778daa1121e4e9d62c1fbf8426e8946b8dd41ee4.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: prevent to request reset frequently"
dann frazier [Thu, 16 Aug 2018 19:19:12 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: prevent to request reset frequently"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit c7ddaa3718acd5a32cad19264843e98152ffb90b.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: correct reset event status register"
dann frazier [Thu, 16 Aug 2018 19:19:11 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: correct reset event status register"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 71f93d407c8ec71d616047e5ca3984f3f2f6567b.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: separate roce from nic when resetting"
dann frazier [Thu, 16 Aug 2018 19:19:10 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: separate roce from nic when resetting"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 0520c2e5923b6d3c3bb69a50de5da8596f4896d9.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: net: hns3: Fix for phy link issue when using marvell phy driver"
dann frazier [Thu, 16 Aug 2018 21:05:18 +0000 (15:05 -0600)]
Revert "UBUNTU: SAUCE: net: hns3: Fix for phy link issue when using marvell phy driver"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit add49408b9f1b715a3fc427bd9344191f10fc66c.

Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: fix return value error in hns3_reset_notif...
dann frazier [Thu, 16 Aug 2018 19:19:10 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: fix return value error in hns3_reset_notify_down_enet"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 732066d749c30efaea59fbec80765d348eb008c8.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: remove unnecessary ring configuration...
dann frazier [Thu, 16 Aug 2018 19:19:09 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: remove unnecessary ring configuration operation while resetting"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit f09bfe6e9c69865285b7f0a5f176f5672f31fb90.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: fix for reset_level default assignment...
dann frazier [Thu, 16 Aug 2018 19:19:08 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: fix for reset_level default assignment probelm"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 861cd0230413ccabc40264195eb81ecc440aed75.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: fix for using wrong mask and shift in...
dann frazier [Thu, 16 Aug 2018 19:19:07 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: fix for using wrong mask and shift in hclge_get_ring_chain_from_mbx"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 144df05a95ac43de83940ba3377ef8415954b9b6.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: {topost} net: hns3: fix comments for hclge_get_ring_chain_from...
dann frazier [Thu, 16 Aug 2018 19:19:06 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: {topost} net: hns3: fix comments for hclge_get_ring_chain_from_mbx"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit d67f2d88930abeb8a52ff2b43a0d7b4e379a1465.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: net: hns3: Fix for VF mailbox cannot receiving PF response"
dann frazier [Thu, 16 Aug 2018 19:19:06 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: net: hns3: Fix for VF mailbox cannot receiving PF response"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 847c96512a5767d585857e179c0c06ea2bdcf14d.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: net: hns3: Fix for VF mailbox receiving unknown message"
dann frazier [Thu, 16 Aug 2018 19:19:05 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: net: hns3: Fix for VF mailbox receiving unknown message"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit 500c12d24904a684cc88ec4dc17771c4b1338596.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoRevert "UBUNTU: SAUCE: net: hns3: Optimize PF CMDQ interrupt switching process"
dann frazier [Thu, 16 Aug 2018 19:19:04 +0000 (13:19 -0600)]
Revert "UBUNTU: SAUCE: net: hns3: Optimize PF CMDQ interrupt switching process"

BugLink: https://bugs.launchpad.net/bugs/1787477
This reverts commit e9ebd8a5e53a12e579ae1d7c4816c23123123899.
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoUBUNTU: SAUCE: irda: Only insert new objects into the global database via setsockopt
Tyler Hicks [Tue, 4 Sep 2018 15:11:00 +0000 (17:11 +0200)]
UBUNTU: SAUCE: irda: Only insert new objects into the global database via setsockopt

The irda_setsockopt() function conditionally allocates memory for a new
self->ias_object or, in some cases, reuses the existing
self->ias_object. Existing objects were incorrectly reinserted into the
LM_IAS database which corrupted the doubly linked list used for the
hashbin implementation of the LM_IAS database. When combined with a
memory leak in irda_bind(), this issue could be leveraged to create a
use-after-free vulnerability in the hashbin list. This patch fixes the
issue by only inserting newly allocated objects into the database.

CVE-2018-6555

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reviewed-by: Seth Arnold <seth.arnold@canonical.com>
Reviewed-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoUBUNTU: SAUCE: irda: Fix memory leak caused by repeated binds of irda socket
Tyler Hicks [Tue, 4 Sep 2018 15:10:00 +0000 (17:10 +0200)]
UBUNTU: SAUCE: irda: Fix memory leak caused by repeated binds of irda socket

The irda_bind() function allocates memory for self->ias_obj without
checking to see if the socket is already bound. A userspace process
could repeatedly bind the socket, have each new object added into the
LM-IAS database, and lose the reference to the old object assigned to
the socket to exhaust memory resources. This patch errors out of the
bind operation when self->ias_obj is already assigned.

CVE-2018-6554

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reviewed-by: Seth Arnold <seth.arnold@canonical.com>
Reviewed-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agousb: gadget: udc: renesas_usb3: should fail if devm_phy_get() returns error
Yoshihiro Shimoda [Tue, 10 Apr 2018 05:38:53 +0000 (14:38 +0900)]
usb: gadget: udc: renesas_usb3: should fail if devm_phy_get() returns error

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 0259068f63f23a665ded28647f2f9cdb6b20dc72 upstream.

This patch fixes an issue that this driver ignores errors other than
the non-existence of the device, f.e. a memory allocation failure
in devm_phy_get(). So, this patch replaces devm_phy_get() with
devm_phy_optional_get().

Reported-by: Simon Horman <horms+renesas@verge.net.au>
Fixes: 279d4bc64060 ("usb: gadget: udc: renesas_usb3: add support for generic phy")
Cc: <stable@vger.kernel.org> # v4.15+
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agousb: gadget: udc: renesas_usb3: should call devm_phy_get() before add udc
Yoshihiro Shimoda [Tue, 10 Apr 2018 05:38:52 +0000 (14:38 +0900)]
usb: gadget: udc: renesas_usb3: should call devm_phy_get() before add udc

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 003bc1dee216b1fb8e02040a95672bea0f1fe797 upstream.

This patch fixes an issue that this driver cannot call phy_init()
if a gadget driver is alreadly loaded because usb_add_gadget_udc()
might call renesas_usb3_start() via .udc_start.
This patch also revises the typo (s/an optional/optional/).

Fixes: 279d4bc64060 ("usb: gadget: udc: renesas_usb3: add support for generic phy")
Cc: <stable@vger.kernel.org> # v4.15+
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agousb: gadget: udc: renesas_usb3: should call pm_runtime_enable() before add udc
Yoshihiro Shimoda [Tue, 10 Apr 2018 05:38:51 +0000 (14:38 +0900)]
usb: gadget: udc: renesas_usb3: should call pm_runtime_enable() before add udc

BugLink: http://bugs.launchpad.net/bugs/1790188
commit d998844016b24a8d71b9aa5eae7e51d70f2de438 upstream.

This patch fixes an issue that this driver causes panic if a gadget
driver is already loaded because usb_add_gadget_udc() might call
renesas_usb3_start() via .udc_start, and then pm_runtime_get_sync()
in renesas_usb3_start() doesn't work correctly.
Note that the usb3_to_dev() macro should not be called at this timing
because the macro uses the gadget structure.

Fixes: cf06df3fae28 ("usb: gadget: udc: renesas_usb3: move pm_runtime_{en,dis}able()")
Cc: <stable@vger.kernel.org> # v4.15+
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agousb: gadget: udc: renesas_usb3: should remove debugfs
Yoshihiro Shimoda [Tue, 10 Apr 2018 05:38:50 +0000 (14:38 +0900)]
usb: gadget: udc: renesas_usb3: should remove debugfs

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 1990cf7c21ea185cec98c6d45a82c04481261e35 upstream.

This patch fixes an issue that this driver doesn't remove its debugfs.

Fixes: 43ba968b00ea ("usb: gadget: udc: renesas_usb3: add debugfs to set the b-device mode")
Cc: <stable@vger.kernel.org> # v4.14+
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agousb: gadget: udc: renesas_usb3: fix double phy_put()
Yoshihiro Shimoda [Mon, 2 Apr 2018 12:21:31 +0000 (21:21 +0900)]
usb: gadget: udc: renesas_usb3: fix double phy_put()

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 8223b2f89ca63e203dcb54148e30d94979f17b0b upstream.

This patch fixes an issue that this driver cause double phy_put()
calling. This driver must not call phy_put() in the remove because
the driver calls devm_phy_get() in the probe.

Fixes: 279d4bc64060 ("usb: gadget: udc: renesas_usb3: add support for generic phy")
Cc: <stable@vger.kernel.org> # v4.15+
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agousb: typec: wcove: Remove dependency on HW FSM
Heikki Krogerus [Thu, 24 May 2018 10:49:52 +0000 (13:49 +0300)]
usb: typec: wcove: Remove dependency on HW FSM

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 05826ff135ee083d28c006fbde6e810f17437166 upstream.

The USB Type-C PHY in Intel WhiskeyCove PMIC has build-in
USB Type-C state machine which we were relying on to
configure the CC lines correctly. This patch removes that
dependency and configures the CC line according to commands
from the port manager (tcpm.c) in wcove_set_cc().

This fixes an issue where USB devices attached to the USB
Type-C port do not get enumerated. When acting as
source/host, the HW FSM sometimes fails to configure the PHY
correctly.

Fixes: 3c4fb9f16921 ("usb: typec: wcove: start using tcpm for USB PD support")
Cc: stable@vger.kernel.org
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agocrypto: omap-sham - fix memleak
Bin Liu [Tue, 17 Apr 2018 19:53:13 +0000 (14:53 -0500)]
crypto: omap-sham - fix memleak

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 9dbc8a0328efa485a6f5b68b867f9f523a3fbeff upstream.

Fixes: 8043bb1ae03cb ("crypto: omap-sham - convert driver logic to use sgs for data xmit")
The memory pages freed in omap_sham_finish_req() were less than those
allocated in omap_sham_copy_sgs().

Cc: stable@vger.kernel.org
Signed-off-by: Bin Liu <b-liu@ti.com>
Acked-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agocrypto: vmx - Remove overly verbose printk from AES XTS init
Michael Ellerman [Thu, 3 May 2018 12:29:30 +0000 (22:29 +1000)]
crypto: vmx - Remove overly verbose printk from AES XTS init

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 730f23b66095a700e2f0786abda6bca011b31558 upstream.

In p8_aes_xts_init() we do a printk(KERN_INFO ...) to report the
fallback implementation we're using. However with a slow console this
can significantly affect the speed of crypto operations. So remove it.

Fixes: c07f5d3da643 ("crypto: vmx - Adding support for XTS")
Cc: stable@vger.kernel.org # v4.8+
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agocrypto: vmx - Remove overly verbose printk from AES init routines
Michael Ellerman [Thu, 3 May 2018 12:29:29 +0000 (22:29 +1000)]
crypto: vmx - Remove overly verbose printk from AES init routines

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 1411b5218adbcf1d45ddb260db5553c52e8d917c upstream.

In the vmx AES init routines we do a printk(KERN_INFO ...) to report
the fallback implementation we're using.

However with a slow console this can significantly affect the speed of
crypto operations. Using 'cryptsetup benchmark' the removal of the
printk() leads to a ~5x speedup for aes-cbc decryption.

So remove them.

Fixes: 8676590a1593 ("crypto: vmx - Adding AES routines for VMX module")
Fixes: 8c755ace357c ("crypto: vmx - Adding CBC routines for VMX module")
Fixes: 4f7f60d312b3 ("crypto: vmx - Adding CTR routines for VMX module")
Fixes: cc333cd68dfa ("crypto: vmx - Adding GHASH routines for VMX module")
Cc: stable@vger.kernel.org # v4.1+
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agocrypto: caam - fix size of RSA prime factor q
Horia Geantă [Fri, 27 Apr 2018 08:40:11 +0000 (11:40 +0300)]
crypto: caam - fix size of RSA prime factor q

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 4bffaab373d9afaf862f3924442c33340bd26736 upstream.

Fix a typo where size of RSA prime factor q is using the size of
prime factor p.

Cc: <stable@vger.kernel.org> # 4.13+
Fixes: 52e26d77b8b3 ("crypto: caam - add support for RSA key form 2")
Fixes: 4a651b122adb ("crypto: caam - add support for RSA key form 3")
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agocrypto: caam/qi - fix IV DMA mapping and updating
Horia Geantă [Wed, 28 Mar 2018 12:39:19 +0000 (15:39 +0300)]
crypto: caam/qi - fix IV DMA mapping and updating

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 3a488aaec6f343b5dc6d94529847a840bbeaf009 upstream.

There are two IV-related issues:
(1) crypto API does not guarantee to provide an IV buffer that is DMAable,
thus it's incorrect to DMA map it
(2) for in-place decryption, since ciphertext is overwritten with
plaintext, updated IV (req->info) will contain the last block of plaintext
(instead of the last block of ciphertext)

While these two issues could be fixed separately, it's straightforward
to fix both in the same time - by using the {ablkcipher,aead}_edesc
extended descriptor to store the IV that will be fed to the crypto engine;
this allows for fixing (2) by saving req->src[last_block] in req->info
directly, i.e. without allocating yet another temporary buffer.

A side effect of the fix is that it's no longer possible to have the IV
contiguous with req->src or req->dst.
Code checking for this case is removed.

Cc: <stable@vger.kernel.org> # 4.14+
Fixes: a68a19380522 ("crypto: caam/qi - properly set IV after {en,de}crypt")
Link: http://lkml.kernel.org/r/20170113084620.GF22022@gondor.apana.org.au
Reported-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agocrypto: caam - fix IV DMA mapping and updating
Horia Geantă [Wed, 28 Mar 2018 12:39:18 +0000 (15:39 +0300)]
crypto: caam - fix IV DMA mapping and updating

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 115957bb3e59fcb226ce76b97af14533f239e0ac upstream.

There are two IV-related issues:
(1) crypto API does not guarantee to provide an IV buffer that is DMAable,
thus it's incorrect to DMA map it
(2) for in-place decryption, since ciphertext is overwritten with
plaintext, updated req->info will contain the last block of plaintext
(instead of the last block of ciphertext)

While these two issues could be fixed separately, it's straightforward
to fix both in the same time - by allocating extra space in the
ablkcipher_edesc for the IV that will be fed to the crypto engine;
this allows for fixing (2) by saving req->src[last_block] in req->info
directly, i.e. without allocating another temporary buffer.

A side effect of the fix is that it's no longer possible to have the IV
and req->src contiguous. Code checking for this case is removed.

Cc: <stable@vger.kernel.org> # 4.13+
Fixes: 854b06f76879 ("crypto: caam - properly set IV after {en,de}crypt")
Link: http://lkml.kernel.org/r/20170113084620.GF22022@gondor.apana.org.au
Reported-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agocrypto: caam - fix DMA mapping dir for generated IV
Horia Geantă [Wed, 28 Mar 2018 12:39:17 +0000 (15:39 +0300)]
crypto: caam - fix DMA mapping dir for generated IV

BugLink: http://bugs.launchpad.net/bugs/1790188
commit a38acd236cac914aafffd80af79b9556fc2c3934 upstream.

In case of GIVCIPHER, IV is generated by the device.
Fix the DMA mapping direction.

Cc: <stable@vger.kernel.org> # 3.19+
Fixes: 7222d1a34103 ("crypto: caam - add support for givencrypt cbc(aes) and rfc3686(ctr(aes))")
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agocrypto: caam - strip input zeros from RSA input buffer
Horia Geantă [Mon, 16 Apr 2018 13:07:05 +0000 (08:07 -0500)]
crypto: caam - strip input zeros from RSA input buffer

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 8a2a0dd35f2e54c023d9041a5428b6c5639af86c upstream.

Sometimes the provided RSA input buffer provided is not stripped
of leading zeros. This could cause its size to be bigger than that
of the modulus, making the HW complain:

caam_jr 2142000.jr1: 40000789: DECO: desc idx 7:
Protocol Size Error - A protocol has seen an error in size. When
running RSA, pdb size N < (size of F) when no formatting is used; or
pdb size N < (F + 11) when formatting is used.

Fix the problem by stripping off the leading zero from input data
before feeding it to the CAAM accelerator.

Fixes: 8c419778ab57e ("crypto: caam - add support for RSA algorithm")
Cc: <stable@vger.kernel.org> # 4.8+
Reported-by: Martin Townsend <mtownsend1973@gmail.com>
Link: https://lkml.kernel.org/r/CABatt_ytYORYKtApcB4izhNanEKkGFi9XAQMjHi_n-8YWoCRiw@mail.gmail.com
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoInput: goodix - add new ACPI id for GPD Win 2 touch screen
Ethan Lee [Thu, 31 May 2018 23:13:17 +0000 (16:13 -0700)]
Input: goodix - add new ACPI id for GPD Win 2 touch screen

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 5ca4d1ae9bad0f59bd6f851c39b19f5366953666 upstream.

GPD Win 2 Website: http://www.gpd.hk/gpdwin2.asp

Tested on a unit from the first production run sent to Indiegogo backers

Signed-off-by: Ethan Lee <flibitijibibo@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agokvm: x86: use correct privilege level for sgdt/sidt/fxsave/fxrstor access
Paolo Bonzini [Wed, 6 Jun 2018 15:38:09 +0000 (17:38 +0200)]
kvm: x86: use correct privilege level for sgdt/sidt/fxsave/fxrstor access

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 3c9fa24ca7c9c47605672916491f79e8ccacb9e6 upstream.

The functions that were used in the emulation of fxrstor, fxsave, sgdt and
sidt were originally meant for task switching, and as such they did not
check privilege levels.  This is very bad when the same functions are used
in the emulation of unprivileged instructions.  This is CVE-2018-10853.

The obvious fix is to add a new argument to ops->read_std and ops->write_std,
which decides whether the access is a "system" access or should use the
processor's CPL.

Fixes: 129a72a0d3c8 ("KVM: x86: Introduce segmented_write_std", 2017-01-12)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agotty: pl011: Avoid spuriously stuck-off interrupts
Dave Martin [Thu, 10 May 2018 17:08:23 +0000 (18:08 +0100)]
tty: pl011: Avoid spuriously stuck-off interrupts

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 4a7e625ce50412a7711efa0f2ef0b96ce3826759 upstream.

Commit 9b96fbacda34 ("serial: PL011: clear pending interrupts")
clears the RX and receive timeout interrupts on pl011 startup, to
avoid a screaming-interrupt scenario that can occur when the
firmware or bootloader leaves these interrupts asserted.

This has been noted as an issue when running Linux on qemu [1].

Unfortunately, the above fix seems to lead to potential
misbehaviour if the RX FIFO interrupt is asserted _non_ spuriously
on driver startup, if the RX FIFO is also already full to the
trigger level.

Clearing the RX FIFO interrupt does not change the FIFO fill level.
In this scenario, because the interrupt is now clear and because
the FIFO is already full to the trigger level, no new assertion of
the RX FIFO interrupt can occur unless the FIFO is drained back
below the trigger level.  This never occurs because the pl011
driver is waiting for an RX FIFO interrupt to tell it that there is
something to read, and does not read the FIFO at all until that
interrupt occurs.

Thus, simply clearing "spurious" interrupts on startup may be
misguided, since there is no way to be sure that the interrupts are
truly spurious, and things can go wrong if they are not.

This patch instead clears the interrupt condition by draining the
RX FIFO during UART startup, after clearing any potentially
spurious interrupt.  This should ensure that an interrupt will
definitely be asserted if the RX FIFO subsequently becomes
sufficiently full.

The drain is done at the point of enabling interrupts only.  This
means that it will occur any time the UART is newly opened through
the tty layer.  It will not apply to polled-mode use of the UART by
kgdboc: since that scenario cannot use interrupts by design, this
should not matter.  kgdboc will interact badly with "normal" use of
the UART in any case: this patch makes no attempt to paper over
such issues.

This patch does not attempt to address the case where the RX FIFO
fills faster than it can be drained: that is a pathological
hardware design problem that is beyond the scope of the driver to
work around.  As a failsafe, the number of poll iterations for
draining the FIFO is limited to twice the FIFO size.  This will
ensure that the kernel at least boots even if it is impossible to
drain the FIFO for some reason.

[1] [Qemu-devel] [Qemu-arm] [PATCH] pl011: do not put into fifo
before enabled the interruption
https://lists.gnu.org/archive/html/qemu-devel/2018-01/msg06446.html

Reported-by: Wei Xu <xuwei5@hisilicon.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Peter Maydell <peter.maydell@linaro.org>
Fixes: 9b96fbacda34 ("serial: PL011: clear pending interrupts")
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Cc: stable <stable@vger.kernel.org>
Tested-by: Wei Xu <xuwei5@hisilicon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agovmw_balloon: fixing double free when batching mode is off
Gil Kupfer [Fri, 1 Jun 2018 07:47:47 +0000 (00:47 -0700)]
vmw_balloon: fixing double free when batching mode is off

BugLink: http://bugs.launchpad.net/bugs/1790188
commit b23220fe054e92f616b82450fae8cd3ab176cc60 upstream.

The balloon.page field is used for two different purposes if batching is
on or off. If batching is on, the field point to the page which is used
to communicate with with the hypervisor. If it is off, balloon.page
points to the page that is about to be (un)locked.

Unfortunately, this dual-purpose of the field introduced a bug: when the
balloon is popped (e.g., when the machine is reset or the balloon driver
is explicitly removed), the balloon driver frees, unconditionally, the
page that is held in balloon.page.  As a result, if batching is
disabled, this leads to double freeing the last page that is sent to the
hypervisor.

The following error occurs during rmmod when kernel checkers are on, and
the balloon is not empty:

[   42.307653] ------------[ cut here ]------------
[   42.307657] Kernel BUG at ffffffffba1e4b28 [verbose debug info unavailable]
[   42.307720] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC
[   42.312512] Modules linked in: vmw_vsock_vmci_transport vsock ppdev joydev vmw_balloon(-) input_leds serio_raw vmw_vmci parport_pc shpchp parport i2c_piix4 nfit mac_hid autofs4 vmwgfx drm_kms_helper hid_generic syscopyarea sysfillrect usbhid sysimgblt fb_sys_fops hid ttm mptspi scsi_transport_spi ahci mptscsih drm psmouse vmxnet3 libahci mptbase pata_acpi
[   42.312766] CPU: 10 PID: 1527 Comm: rmmod Not tainted 4.12.0+ #5
[   42.312803] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 09/30/2016
[   42.313042] task: ffff9bf9680f8000 task.stack: ffffbfefc1638000
[   42.313290] RIP: 0010:__free_pages+0x38/0x40
[   42.313510] RSP: 0018:ffffbfefc163be98 EFLAGS: 00010246
[   42.313731] RAX: 000000000000003e RBX: ffffffffc02b9720 RCX: 0000000000000006
[   42.313972] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9bf97e08e0a0
[   42.314201] RBP: ffffbfefc163be98 R08: 0000000000000000 R09: 0000000000000000
[   42.314435] R10: 0000000000000000 R11: 0000000000000000 R12: ffffffffc02b97e4
[   42.314505] R13: ffffffffc02b9748 R14: ffffffffc02b9728 R15: 0000000000000200
[   42.314550] FS:  00007f3af5fec700(0000) GS:ffff9bf97e080000(0000) knlGS:0000000000000000
[   42.314599] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   42.314635] CR2: 00007f44f6f4ab24 CR3: 00000003a7d12000 CR4: 00000000000006e0
[   42.314864] Call Trace:
[   42.315774]  vmballoon_pop+0x102/0x130 [vmw_balloon]
[   42.315816]  vmballoon_exit+0x42/0xd64 [vmw_balloon]
[   42.315853]  SyS_delete_module+0x1e2/0x250
[   42.315891]  entry_SYSCALL_64_fastpath+0x23/0xc2
[   42.315924] RIP: 0033:0x7f3af5b0e8e7
[   42.315949] RSP: 002b:00007fffe6ce0148 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[   42.315996] RAX: ffffffffffffffda RBX: 000055be676401e0 RCX: 00007f3af5b0e8e7
[   42.316951] RDX: 000000000000000a RSI: 0000000000000800 RDI: 000055be67640248
[   42.317887] RBP: 0000000000000003 R08: 0000000000000000 R09: 1999999999999999
[   42.318845] R10: 0000000000000883 R11: 0000000000000206 R12: 00007fffe6cdf130
[   42.319755] R13: 0000000000000000 R14: 0000000000000000 R15: 000055be676401e0
[   42.320606] Code: c0 74 1c f0 ff 4f 1c 74 02 5d c3 85 f6 74 07 e8 0f d8 ff ff 5d c3 31 f6 e8 c6 fb ff ff 5d c3 48 c7 c6 c8 0f c5 ba e8 58 be 02 00 <0f> 0b 66 0f 1f 44 00 00 66 66 66 66 90 48 85 ff 75 01 c3 55 48
[   42.323462] RIP: __free_pages+0x38/0x40 RSP: ffffbfefc163be98
[   42.325735] ---[ end trace 872e008e33f81508 ]---

To solve the bug, we eliminate the dual purpose of balloon.page.

Fixes: f220a80f0c2e ("VMware balloon: add batching to the vmw_balloon.")
Cc: stable@vger.kernel.org
Reported-by: Oleksandr Natalenko <onatalen@redhat.com>
Signed-off-by: Gil Kupfer <gilkup@gmail.com>
Signed-off-by: Nadav Amit <namit@vmware.com>
Reviewed-by: Xavier Deguillard <xdeguillard@vmware.com>
Tested-by: Oleksandr Natalenko <oleksandr@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoserial: 8250: omap: Fix idling of clocks for unused uarts
Tony Lindgren [Fri, 4 May 2018 17:44:09 +0000 (10:44 -0700)]
serial: 8250: omap: Fix idling of clocks for unused uarts

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 13dc04d0e5fdc25c8f713ad23fdce51cf2bf96ba upstream.

I noticed that unused UARTs won't necessarily idle properly always
unless at least one byte tx transfer is done first.

After some debugging I narrowed down the problem to the scr register
dma configuration bits that need to be set before softreset for the
clocks to idle. Unless we do this, the module clkctrl idlest bits
may be set to 1 instead of 3 meaning the clock will never idle and
is blocking deeper idle states for the whole domain.

This might be related to the configuration done by the bootloader
or kexec booting where certain configurations cause the 8250 or
the clkctrl clock to jam in a way where setting of the scr bits
and reset is needed to clear it. I've tried diffing the 8250
registers for the various modes, but did not see anything specific.
So far I've only seen this on omap4 but I'm suspecting this might
also happen on the other clkctrl using SoCs considering they
already have a quirk enabled for UART_ERRATA_CLOCK_DISABLE.

Let's fix the issue by configuring scr before reset for basic dma
even if we don't use it. The scr register will be reset when we do
softreset few lines after, and we restore scr on resume. We should
do this for all the SoCs with UART_ERRATA_CLOCK_DISABLE quirk flag
set since the ones with UART_ERRATA_CLOCK_DISABLE are all based
using clkctrl similar to omap4.

Looks like both OMAP_UART_SCR_DMAMODE_1 | OMAP_UART_SCR_DMAMODE_CTL
bits are needed for the clkctrl to idle after a softreset.

And we need to add omap4 to also use the UART_ERRATA_CLOCK_DISABLE
for the related workaround to be enabled. This same compatible
value will also be used for omap5.

Fixes: cdb929e4452a ("serial: 8250_omap: workaround errata around idling UART after using DMA")
Cc: Keerthy <j-keerthy@ti.com>
Cc: Matthijs van Duin <matthijsvanduin@gmail.com>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoserial: samsung: fix maxburst parameter for DMA transactions
Marek Szyprowski [Thu, 10 May 2018 06:41:13 +0000 (08:41 +0200)]
serial: samsung: fix maxburst parameter for DMA transactions

BugLink: http://bugs.launchpad.net/bugs/1790188
commit aa2f80e752c75e593b3820f42c416ed9458fa73e upstream.

The best granularity of residue that DMA engine can report is in the BURST
units, so the serial driver must use MAXBURST = 1 and DMA_SLAVE_BUSWIDTH_1_BYTE
if it relies on exact number of bytes transferred by DMA engine.

Fixes: 62c37eedb74c ("serial: samsung: add dma reqest/release functions")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agotty/serial: atmel: use port->name as name in request_irq()
Sebastian Andrzej Siewior [Mon, 7 May 2018 17:11:30 +0000 (19:11 +0200)]
tty/serial: atmel: use port->name as name in request_irq()

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 9594b5be7ec110ed11acec58fa94f3f293668c85 upstream.

I was puzzled while looking at /proc/interrupts and random things showed
up between reboots. This occurred more often but I realised it later. The
"correct" output should be:
|38:      11861  atmel-aic5   2 Level     ttyS0

but I saw sometimes
|38:       6426  atmel-aic5   2 Level     tty1

and accounted it wrongly as correct. This is use after free and the
former example randomly got the "old" pointer which pointed to the same
content. With SLAB_FREELIST_RANDOM and HARDENED I even got
|38:       7067  atmel-aic5   2 Level     E=Started User Manager for UID 0

or other nonsense.
As it turns out the tty, pointer that is accessed in atmel_startup(), is
freed() before atmel_shutdown(). It seems to happen quite often that the
tty for ttyS0 is allocated and freed while ->shutdown is not invoked. I
don't do anything special - just a systemd boot :)

Use dev_name(&pdev->dev) as the IRQ name for request_irq(). This exists
as long as the driver is loaded so no use-after-free here.

Cc: stable@vger.kernel.org
Fixes: 761ed4a94582 ("tty: serial_core: convert uart_close to use tty_port_close")
Acked-by: Richard Genoud <richard.genoud@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoserial: sh-sci: Stop using printk format %pCr
Geert Uytterhoeven [Fri, 1 Jun 2018 09:28:21 +0000 (11:28 +0200)]
serial: sh-sci: Stop using printk format %pCr

BugLink: http://bugs.launchpad.net/bugs/1790188
commit d63c16f8e1ab761775275adcf54f4bef7c330295 upstream.

Printk format "%pCr" will be removed soon, as clk_get_rate() must not be
called in atomic context.

Replace it by open-coding the operation.  This is safe here, as the code
runs in task context.

Link: http://lkml.kernel.org/r/1527845302-12159-4-git-send-email-geert+renesas@glider.be
To: Jia-Ju Bai <baijiaju1990@gmail.com>
To: Jonathan Corbet <corbet@lwn.net>
To: Michael Turquette <mturquette@baylibre.com>
To: Stephen Boyd <sboyd@kernel.org>
To: Zhang Rui <rui.zhang@intel.com>
To: Eduardo Valentin <edubezval@gmail.com>
To: Eric Anholt <eric@anholt.net>
To: Stefan Wahren <stefan.wahren@i2se.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-doc@vger.kernel.org
Cc: linux-clk@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Cc: linux-serial@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: stable@vger.kernel.org # 4.5+
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agousb: gadget: udc: renesas_usb3: disable the controller's irqs for reconnecting
Yoshihiro Shimoda [Tue, 10 Apr 2018 05:38:54 +0000 (14:38 +0900)]
usb: gadget: udc: renesas_usb3: disable the controller's irqs for reconnecting

BugLink: http://bugs.launchpad.net/bugs/1790188
commit bd6bce004d78b867ba0c6d3712f1c5b50398af9a upstream.

This patch fixes an issue that reconnection is possible to fail
because unexpected state handling happens by the irqs. To fix the issue,
the driver disables the controller's irqs when disconnected.

Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller")
Cc: <stable@vger.kernel.org> # v4.5+
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agousb: gadget: function: printer: avoid wrong list handling in printer_write()
Yoshihiro Shimoda [Mon, 21 May 2018 11:18:07 +0000 (20:18 +0900)]
usb: gadget: function: printer: avoid wrong list handling in printer_write()

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 4a014a7339f441b0851ce012f469c0fadac61c81 upstream.

When printer_write() calls usb_ep_queue(), a udc driver (e.g.
renesas_usbhs driver) may call usb_gadget_giveback_request() in
the udc .queue ops immediately. Then, printer_write() calls
list_add(&req->list, &dev->tx_reqs_active) wrongly. After that,
if we do unbind the printer driver, WARN_ON() happens in
printer_func_unbind() because the list entry is not removed.

So, this patch moves list_add(&req->list, &dev->tx_reqs_active)
calling before usb_ep_queue().

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agophy: qcom-qusb2: Fix crash if nvmem cell not specified
Manu Gautam [Wed, 2 May 2018 21:06:10 +0000 (02:36 +0530)]
phy: qcom-qusb2: Fix crash if nvmem cell not specified

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 0b4555e776ba0712c6fafb98b226b21fd05d2427 upstream.

Driver currently crashes due to NULL pointer deference
while updating PHY tune register if nvmem cell is NULL.
Since, fused value for Tune1/2 register is optional,
we'd rather bail out.

Fixes: ca04d9d3e1b1 ("phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips")
Reviewed-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Reviewed-by: Evan Green <evgreen@chromium.org>
Cc: stable <stable@vger.kernel.org> # 4.14+
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoInput: xpad - add GPD Win 2 Controller USB IDs
Ethan Lee [Fri, 1 Jun 2018 18:46:08 +0000 (11:46 -0700)]
Input: xpad - add GPD Win 2 Controller USB IDs

BugLink: http://bugs.launchpad.net/bugs/1790188
commit c1ba08390a8bb13c927e699330896adc15b78205 upstream.

GPD Win 2 Website: http://www.gpd.hk/gpdwin2.asp

Tested on a unit from the first production run sent to Indiegogo backers

Signed-off-by: Ethan Lee <flibitijibibo@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agousb-storage: Add compatibility quirk flags for G-Technologies G-Drive
Alexander Kappner [Sat, 19 May 2018 04:50:16 +0000 (21:50 -0700)]
usb-storage: Add compatibility quirk flags for G-Technologies G-Drive

BugLink: http://bugs.launchpad.net/bugs/1790188
commit ca7d9515d0e6825351ce106066cea1f60e40b1c8 upstream.

The "G-Drive" (sold by G-Technology) external USB 3.0 drive
 hangs on write access under UAS and usb-storage:

[  136.079121] sd 15:0:0:0: [sdi] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  136.079144] sd 15:0:0:0: [sdi] tag#0 Sense Key : Illegal Request [current]
[  136.079152] sd 15:0:0:0: [sdi] tag#0 Add. Sense: Invalid field in cdb
[  136.079176] sd 15:0:0:0: [sdi] tag#0 CDB: Write(16) 8a 08 00 00 00 00 00 00 00 00 00 00 00 08 00 00
[  136.079180] print_req_error: critical target error, dev sdi, sector 0
[  136.079183] Buffer I/O error on dev sdi, logical block 0, lost sync page write
[  136.173148] EXT4-fs (sdi): mounted filesystem with ordered data mode. Opts: (null)
[  140.583998] sd 15:0:0:0: [sdi] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  140.584010] sd 15:0:0:0: [sdi] tag#0 Sense Key : Illegal Request [current]
[  140.584016] sd 15:0:0:0: [sdi] tag#0 Add. Sense: Invalid field in cdb
[  140.584022] sd 15:0:0:0: [sdi] tag#0 CDB: Write(16) 8a 08 00 00 00 00 e8 c4 00 18 00 00 00 08 00 00
[  140.584025] print_req_error: critical target error, dev sdi, sector 3905159192
[  140.584044] print_req_error: critical target error, dev sdi, sector 3905159192
[  140.584052] Aborting journal on device sdi-8.

The proposed patch adds compatibility quirks. Because the drive requires two
quirks (one to work with UAS, and another to work with usb-storage), adding this
under unusual_devs.h and not just unusual_uas.h so kernels compiled without UAS
receive the quirk. With the patch, the drive works reliably on UAS and usb-
storage.
(tested on NEC Corporation uPD720200 USB 3.0 host controller).

Signed-off-by: Alexander Kappner <agk@godking.net>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agousb-storage: Add support for FL_ALWAYS_SYNC flag in the UAS driver
Alexander Kappner [Sat, 19 May 2018 04:50:15 +0000 (21:50 -0700)]
usb-storage: Add support for FL_ALWAYS_SYNC flag in the UAS driver

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 8c4e97ddfe73a0958bb0abf7e6a3bc4cc3e04936 upstream.

The ALWAYS_SYNC flag is currently honored by the usb-storage driver but not UAS
and is required to work around devices that become unstable upon being
queried for cache. This code is taken straight from:
drivers/usb/storage/scsiglue.c:284

Signed-off-by: Alexander Kappner <agk@godking.net>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@vger.kernel.org>
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agousbip: vhci_sysfs: fix potential Spectre v1
Gustavo A. R. Silva [Sat, 19 May 2018 01:13:42 +0000 (20:13 -0500)]
usbip: vhci_sysfs: fix potential Spectre v1

BugLink: http://bugs.launchpad.net/bugs/1790188
commit a0d6ec88090d7b1b008429c44532a388e29bb1bd upstream.

pdev_nr and rhport can be controlled by user-space, hence leading to
a potential exploitation of the Spectre variant 1 vulnerability.

This issue was detected with the help of Smatch:
drivers/usb/usbip/vhci_sysfs.c:238 detach_store() warn: potential spectre issue 'vhcis'
drivers/usb/usbip/vhci_sysfs.c:328 attach_store() warn: potential spectre issue 'vhcis'
drivers/usb/usbip/vhci_sysfs.c:338 attach_store() warn: potential spectre issue 'vhci->vhci_hcd_ss->vdev'
drivers/usb/usbip/vhci_sysfs.c:340 attach_store() warn: potential spectre issue 'vhci->vhci_hcd_hs->vdev'

Fix this by sanitizing pdev_nr and rhport before using them to index
vhcis and vhci->vhci_hcd_ss->vdev respectively.

Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].

[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2

Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoNFC: pn533: don't send USB data off of the stack
Greg Kroah-Hartman [Sun, 20 May 2018 13:19:46 +0000 (15:19 +0200)]
NFC: pn533: don't send USB data off of the stack

BugLink: http://bugs.launchpad.net/bugs/1790188
commit dbafc28955fa6779dc23d1607a0fee5e509a278b upstream.

It's amazing that this driver ever worked, but now that x86 doesn't
allow USB data to be sent off of the stack, it really does not work at
all.  Fix this up by properly allocating the data for the small
"commands" that get sent to the device off of the stack.

We do this for one command by having a whole urb just for ack messages,
as they can be submitted in interrupt context, so we can not use
usb_bulk_msg().  But the poweron command can sleep (and does), so use
usb_bulk_msg() for that transfer.

Reported-by: Carlos Manuel Santos <cmmpsantos@gmail.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agostaging: android: ion: Switch to pr_warn_once in ion_buffer_destroy
Laura Abbott [Mon, 14 May 2018 21:35:09 +0000 (14:35 -0700)]
staging: android: ion: Switch to pr_warn_once in ion_buffer_destroy

BugLink: http://bugs.launchpad.net/bugs/1790188
commit 45ad559a29629cb1c64ee636563c69b71524f077 upstream.

Syzbot reported yet another warning with Ion:

WARNING: CPU: 0 PID: 1467 at drivers/staging/android/ion/ion.c:122
ion_buffer_destroy+0xd4/0x190 drivers/staging/android/ion/ion.c:122
Kernel panic - not syncing: panic_on_warn set ...

This is catching that a buffer was freed with an existing kernel mapping
still present. This can be easily be triggered from userspace by calling
DMA_BUF_SYNC_START without calling DMA_BUF_SYNC_END. Switch to a single
pr_warn_once to indicate the error without being disruptive.

Reported-by: syzbot+cd8bcd40cb049efa2770@syzkaller.appspotmail.com
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Laura Abbott <labbott@redhat.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
5 years agoKVM: x86: pass kvm_vcpu to kvm_read_guest_virt and kvm_write_guest_virt_system
Paolo Bonzini [Wed, 6 Jun 2018 15:37:49 +0000 (17:37 +0200)]
KVM: x86: pass kvm_vcpu to kvm_read_guest_virt and kvm_write_guest_virt_system

BugLink: http://bugs.launchpad.net/bugs/1790188
commit ce14e868a54edeb2e30cb7a7b104a2fc4b9d76ca upstream.

Int the next patch the emulator's .read_std and .write_std callbacks will
grow another argument, which is not needed in kvm_read_guest_virt and
kvm_write_guest_virt_system's callers.  Since we have to make separate
functions, let's give the currently existing names a nicer interface, too.

Fixes: 129a72a0d3c8 ("KVM: x86: Introduce segmented_write_std", 2017-01-12)
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>