diff options
233 files changed, 1313 insertions, 767 deletions
diff --git a/Documentation/doc-guide/parse-headers.rst b/Documentation/doc-guide/parse-headers.rst index 96a0423d5dba..82a3e43b6864 100644 --- a/Documentation/doc-guide/parse-headers.rst +++ b/Documentation/doc-guide/parse-headers.rst | |||
| @@ -177,14 +177,14 @@ BUGS | |||
| 177 | **** | 177 | **** |
| 178 | 178 | ||
| 179 | 179 | ||
| 180 | Report bugs to Mauro Carvalho Chehab <mchehab@s-opensource.com> | 180 | Report bugs to Mauro Carvalho Chehab <mchehab@kernel.org> |
| 181 | 181 | ||
| 182 | 182 | ||
| 183 | COPYRIGHT | 183 | COPYRIGHT |
| 184 | ********* | 184 | ********* |
| 185 | 185 | ||
| 186 | 186 | ||
| 187 | Copyright (c) 2016 by Mauro Carvalho Chehab <mchehab@s-opensource.com>. | 187 | Copyright (c) 2016 by Mauro Carvalho Chehab <mchehab+samsung@kernel.org>. |
| 188 | 188 | ||
| 189 | License GPLv2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>. | 189 | License GPLv2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>. |
| 190 | 190 | ||
diff --git a/Documentation/media/uapi/rc/keytable.c.rst b/Documentation/media/uapi/rc/keytable.c.rst index e6ce1e3f5a78..217237f93b37 100644 --- a/Documentation/media/uapi/rc/keytable.c.rst +++ b/Documentation/media/uapi/rc/keytable.c.rst | |||
| @@ -7,7 +7,7 @@ file: uapi/v4l/keytable.c | |||
| 7 | 7 | ||
| 8 | /* keytable.c - This program allows checking/replacing keys at IR | 8 | /* keytable.c - This program allows checking/replacing keys at IR |
| 9 | 9 | ||
| 10 | Copyright (C) 2006-2009 Mauro Carvalho Chehab <mchehab@infradead.org> | 10 | Copyright (C) 2006-2009 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 11 | 11 | ||
| 12 | This program is free software; you can redistribute it and/or modify | 12 | This program is free software; you can redistribute it and/or modify |
| 13 | it under the terms of the GNU General Public License as published by | 13 | it under the terms of the GNU General Public License as published by |
diff --git a/Documentation/media/uapi/v4l/v4l2grab.c.rst b/Documentation/media/uapi/v4l/v4l2grab.c.rst index 5aabd0b7b089..f0d0ab6abd41 100644 --- a/Documentation/media/uapi/v4l/v4l2grab.c.rst +++ b/Documentation/media/uapi/v4l/v4l2grab.c.rst | |||
| @@ -6,7 +6,7 @@ file: media/v4l/v4l2grab.c | |||
| 6 | .. code-block:: c | 6 | .. code-block:: c |
| 7 | 7 | ||
| 8 | /* V4L2 video picture grabber | 8 | /* V4L2 video picture grabber |
| 9 | Copyright (C) 2009 Mauro Carvalho Chehab <mchehab@infradead.org> | 9 | Copyright (C) 2009 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 10 | 10 | ||
| 11 | This program is free software; you can redistribute it and/or modify | 11 | This program is free software; you can redistribute it and/or modify |
| 12 | it under the terms of the GNU General Public License as published by | 12 | it under the terms of the GNU General Public License as published by |
diff --git a/Documentation/sphinx/parse-headers.pl b/Documentation/sphinx/parse-headers.pl index a958d8b5e99d..d410f47567e9 100755 --- a/Documentation/sphinx/parse-headers.pl +++ b/Documentation/sphinx/parse-headers.pl | |||
| @@ -387,11 +387,11 @@ tree for more details. | |||
| 387 | 387 | ||
| 388 | =head1 BUGS | 388 | =head1 BUGS |
| 389 | 389 | ||
| 390 | Report bugs to Mauro Carvalho Chehab <mchehab@s-opensource.com> | 390 | Report bugs to Mauro Carvalho Chehab <mchehab@kernel.org> |
| 391 | 391 | ||
| 392 | =head1 COPYRIGHT | 392 | =head1 COPYRIGHT |
| 393 | 393 | ||
| 394 | Copyright (c) 2016 by Mauro Carvalho Chehab <mchehab@s-opensource.com>. | 394 | Copyright (c) 2016 by Mauro Carvalho Chehab <mchehab+samsung@kernel.org>. |
| 395 | 395 | ||
| 396 | License GPLv2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>. | 396 | License GPLv2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>. |
| 397 | 397 | ||
diff --git a/Documentation/translations/zh_CN/video4linux/v4l2-framework.txt b/Documentation/translations/zh_CN/video4linux/v4l2-framework.txt index 698660b7f21f..c77c0f060864 100644 --- a/Documentation/translations/zh_CN/video4linux/v4l2-framework.txt +++ b/Documentation/translations/zh_CN/video4linux/v4l2-framework.txt | |||
| @@ -6,7 +6,7 @@ communicating in English you can also ask the Chinese maintainer for | |||
| 6 | help. Contact the Chinese maintainer if this translation is outdated | 6 | help. Contact the Chinese maintainer if this translation is outdated |
| 7 | or if there is a problem with the translation. | 7 | or if there is a problem with the translation. |
| 8 | 8 | ||
| 9 | Maintainer: Mauro Carvalho Chehab <mchehab@infradead.org> | 9 | Maintainer: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 10 | Chinese maintainer: Fu Wei <tekkamanninja@gmail.com> | 10 | Chinese maintainer: Fu Wei <tekkamanninja@gmail.com> |
| 11 | --------------------------------------------------------------------- | 11 | --------------------------------------------------------------------- |
| 12 | Documentation/video4linux/v4l2-framework.txt 的中文翻译 | 12 | Documentation/video4linux/v4l2-framework.txt 的中文翻译 |
| @@ -14,7 +14,7 @@ Documentation/video4linux/v4l2-framework.txt 的中文翻译 | |||
| 14 | 如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文 | 14 | 如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文 |
| 15 | 交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻 | 15 | 交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻 |
| 16 | 译存在问题,请联系中文版维护者。 | 16 | 译存在问题,请联系中文版维护者。 |
| 17 | 英文版维护者: Mauro Carvalho Chehab <mchehab@infradead.org> | 17 | 英文版维护者: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 18 | 中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com> | 18 | 中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com> |
| 19 | 中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com> | 19 | 中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com> |
| 20 | 中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com> | 20 | 中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com> |
diff --git a/MAINTAINERS b/MAINTAINERS index b1ccabd0dbc3..df6e9bb2559a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -2554,7 +2554,6 @@ F: Documentation/devicetree/bindings/sound/axentia,* | |||
| 2554 | F: sound/soc/atmel/tse850-pcm5142.c | 2554 | F: sound/soc/atmel/tse850-pcm5142.c |
| 2555 | 2555 | ||
| 2556 | AZ6007 DVB DRIVER | 2556 | AZ6007 DVB DRIVER |
| 2557 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 2558 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 2557 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 2559 | L: linux-media@vger.kernel.org | 2558 | L: linux-media@vger.kernel.org |
| 2560 | W: https://linuxtv.org | 2559 | W: https://linuxtv.org |
| @@ -3083,7 +3082,6 @@ F: include/linux/btrfs* | |||
| 3083 | F: include/uapi/linux/btrfs* | 3082 | F: include/uapi/linux/btrfs* |
| 3084 | 3083 | ||
| 3085 | BTTV VIDEO4LINUX DRIVER | 3084 | BTTV VIDEO4LINUX DRIVER |
| 3086 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 3087 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 3085 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 3088 | L: linux-media@vger.kernel.org | 3086 | L: linux-media@vger.kernel.org |
| 3089 | W: https://linuxtv.org | 3087 | W: https://linuxtv.org |
| @@ -3812,7 +3810,6 @@ S: Maintained | |||
| 3812 | F: drivers/media/dvb-frontends/cx24120* | 3810 | F: drivers/media/dvb-frontends/cx24120* |
| 3813 | 3811 | ||
| 3814 | CX88 VIDEO4LINUX DRIVER | 3812 | CX88 VIDEO4LINUX DRIVER |
| 3815 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 3816 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 3813 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 3817 | L: linux-media@vger.kernel.org | 3814 | L: linux-media@vger.kernel.org |
| 3818 | W: https://linuxtv.org | 3815 | W: https://linuxtv.org |
| @@ -5053,7 +5050,6 @@ F: drivers/edac/thunderx_edac* | |||
| 5053 | 5050 | ||
| 5054 | EDAC-CORE | 5051 | EDAC-CORE |
| 5055 | M: Borislav Petkov <bp@alien8.de> | 5052 | M: Borislav Petkov <bp@alien8.de> |
| 5056 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 5057 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 5053 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5058 | L: linux-edac@vger.kernel.org | 5054 | L: linux-edac@vger.kernel.org |
| 5059 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git for-next | 5055 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git for-next |
| @@ -5082,7 +5078,6 @@ S: Maintained | |||
| 5082 | F: drivers/edac/fsl_ddr_edac.* | 5078 | F: drivers/edac/fsl_ddr_edac.* |
| 5083 | 5079 | ||
| 5084 | EDAC-GHES | 5080 | EDAC-GHES |
| 5085 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 5086 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 5081 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5087 | L: linux-edac@vger.kernel.org | 5082 | L: linux-edac@vger.kernel.org |
| 5088 | S: Maintained | 5083 | S: Maintained |
| @@ -5099,21 +5094,18 @@ S: Maintained | |||
| 5099 | F: drivers/edac/i5000_edac.c | 5094 | F: drivers/edac/i5000_edac.c |
| 5100 | 5095 | ||
| 5101 | EDAC-I5400 | 5096 | EDAC-I5400 |
| 5102 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 5103 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 5097 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5104 | L: linux-edac@vger.kernel.org | 5098 | L: linux-edac@vger.kernel.org |
| 5105 | S: Maintained | 5099 | S: Maintained |
| 5106 | F: drivers/edac/i5400_edac.c | 5100 | F: drivers/edac/i5400_edac.c |
| 5107 | 5101 | ||
| 5108 | EDAC-I7300 | 5102 | EDAC-I7300 |
| 5109 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 5110 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 5103 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5111 | L: linux-edac@vger.kernel.org | 5104 | L: linux-edac@vger.kernel.org |
| 5112 | S: Maintained | 5105 | S: Maintained |
| 5113 | F: drivers/edac/i7300_edac.c | 5106 | F: drivers/edac/i7300_edac.c |
| 5114 | 5107 | ||
| 5115 | EDAC-I7CORE | 5108 | EDAC-I7CORE |
| 5116 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 5117 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 5109 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5118 | L: linux-edac@vger.kernel.org | 5110 | L: linux-edac@vger.kernel.org |
| 5119 | S: Maintained | 5111 | S: Maintained |
| @@ -5163,7 +5155,6 @@ S: Maintained | |||
| 5163 | F: drivers/edac/r82600_edac.c | 5155 | F: drivers/edac/r82600_edac.c |
| 5164 | 5156 | ||
| 5165 | EDAC-SBRIDGE | 5157 | EDAC-SBRIDGE |
| 5166 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 5167 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 5158 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5168 | L: linux-edac@vger.kernel.org | 5159 | L: linux-edac@vger.kernel.org |
| 5169 | S: Maintained | 5160 | S: Maintained |
| @@ -5222,7 +5213,6 @@ S: Maintained | |||
| 5222 | F: drivers/net/ethernet/ibm/ehea/ | 5213 | F: drivers/net/ethernet/ibm/ehea/ |
| 5223 | 5214 | ||
| 5224 | EM28XX VIDEO4LINUX DRIVER | 5215 | EM28XX VIDEO4LINUX DRIVER |
| 5225 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 5226 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 5216 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5227 | L: linux-media@vger.kernel.org | 5217 | L: linux-media@vger.kernel.org |
| 5228 | W: https://linuxtv.org | 5218 | W: https://linuxtv.org |
| @@ -7677,9 +7667,11 @@ L: linux-kbuild@vger.kernel.org | |||
| 7677 | S: Maintained | 7667 | S: Maintained |
| 7678 | F: Documentation/kbuild/ | 7668 | F: Documentation/kbuild/ |
| 7679 | F: Makefile | 7669 | F: Makefile |
| 7680 | F: scripts/Makefile.* | 7670 | F: scripts/Kbuild* |
| 7671 | F: scripts/Makefile* | ||
| 7681 | F: scripts/basic/ | 7672 | F: scripts/basic/ |
| 7682 | F: scripts/mk* | 7673 | F: scripts/mk* |
| 7674 | F: scripts/mod/ | ||
| 7683 | F: scripts/package/ | 7675 | F: scripts/package/ |
| 7684 | 7676 | ||
| 7685 | KERNEL JANITORS | 7677 | KERNEL JANITORS |
| @@ -8871,7 +8863,6 @@ F: Documentation/devicetree/bindings/media/nvidia,tegra-vde.txt | |||
| 8871 | F: drivers/staging/media/tegra-vde/ | 8863 | F: drivers/staging/media/tegra-vde/ |
| 8872 | 8864 | ||
| 8873 | MEDIA INPUT INFRASTRUCTURE (V4L/DVB) | 8865 | MEDIA INPUT INFRASTRUCTURE (V4L/DVB) |
| 8874 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 8875 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 8866 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 8876 | P: LinuxTV.org Project | 8867 | P: LinuxTV.org Project |
| 8877 | L: linux-media@vger.kernel.org | 8868 | L: linux-media@vger.kernel.org |
| @@ -12260,7 +12251,6 @@ S: Odd Fixes | |||
| 12260 | F: drivers/media/i2c/saa6588* | 12251 | F: drivers/media/i2c/saa6588* |
| 12261 | 12252 | ||
| 12262 | SAA7134 VIDEO4LINUX DRIVER | 12253 | SAA7134 VIDEO4LINUX DRIVER |
| 12263 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 12264 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 12254 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 12265 | L: linux-media@vger.kernel.org | 12255 | L: linux-media@vger.kernel.org |
| 12266 | W: https://linuxtv.org | 12256 | W: https://linuxtv.org |
| @@ -12765,7 +12755,6 @@ S: Maintained | |||
| 12765 | F: drivers/media/radio/si4713/radio-usb-si4713.c | 12755 | F: drivers/media/radio/si4713/radio-usb-si4713.c |
| 12766 | 12756 | ||
| 12767 | SIANO DVB DRIVER | 12757 | SIANO DVB DRIVER |
| 12768 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 12769 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 12758 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 12770 | L: linux-media@vger.kernel.org | 12759 | L: linux-media@vger.kernel.org |
| 12771 | W: https://linuxtv.org | 12760 | W: https://linuxtv.org |
| @@ -13756,7 +13745,6 @@ S: Maintained | |||
| 13756 | F: drivers/media/i2c/tda9840* | 13745 | F: drivers/media/i2c/tda9840* |
| 13757 | 13746 | ||
| 13758 | TEA5761 TUNER DRIVER | 13747 | TEA5761 TUNER DRIVER |
| 13759 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 13760 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 13748 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 13761 | L: linux-media@vger.kernel.org | 13749 | L: linux-media@vger.kernel.org |
| 13762 | W: https://linuxtv.org | 13750 | W: https://linuxtv.org |
| @@ -13765,7 +13753,6 @@ S: Odd fixes | |||
| 13765 | F: drivers/media/tuners/tea5761.* | 13753 | F: drivers/media/tuners/tea5761.* |
| 13766 | 13754 | ||
| 13767 | TEA5767 TUNER DRIVER | 13755 | TEA5767 TUNER DRIVER |
| 13768 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 13769 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 13756 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 13770 | L: linux-media@vger.kernel.org | 13757 | L: linux-media@vger.kernel.org |
| 13771 | W: https://linuxtv.org | 13758 | W: https://linuxtv.org |
| @@ -14181,7 +14168,6 @@ F: Documentation/networking/tlan.txt | |||
| 14181 | F: drivers/net/ethernet/ti/tlan.* | 14168 | F: drivers/net/ethernet/ti/tlan.* |
| 14182 | 14169 | ||
| 14183 | TM6000 VIDEO4LINUX DRIVER | 14170 | TM6000 VIDEO4LINUX DRIVER |
| 14184 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 14185 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 14171 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 14186 | L: linux-media@vger.kernel.org | 14172 | L: linux-media@vger.kernel.org |
| 14187 | W: https://linuxtv.org | 14173 | W: https://linuxtv.org |
| @@ -15408,7 +15394,6 @@ S: Maintained | |||
| 15408 | F: arch/x86/entry/vdso/ | 15394 | F: arch/x86/entry/vdso/ |
| 15409 | 15395 | ||
| 15410 | XC2028/3028 TUNER DRIVER | 15396 | XC2028/3028 TUNER DRIVER |
| 15411 | M: Mauro Carvalho Chehab <mchehab@s-opensource.com> | ||
| 15412 | M: Mauro Carvalho Chehab <mchehab@kernel.org> | 15397 | M: Mauro Carvalho Chehab <mchehab@kernel.org> |
| 15413 | L: linux-media@vger.kernel.org | 15398 | L: linux-media@vger.kernel.org |
| 15414 | W: https://linuxtv.org | 15399 | W: https://linuxtv.org |
| @@ -2,8 +2,8 @@ | |||
| 2 | VERSION = 4 | 2 | VERSION = 4 |
| 3 | PATCHLEVEL = 17 | 3 | PATCHLEVEL = 17 |
| 4 | SUBLEVEL = 0 | 4 | SUBLEVEL = 0 |
| 5 | EXTRAVERSION = -rc3 | 5 | EXTRAVERSION = -rc4 |
| 6 | NAME = Fearless Coyote | 6 | NAME = Merciless Moray |
| 7 | 7 | ||
| 8 | # *DOCUMENTATION* | 8 | # *DOCUMENTATION* |
| 9 | # To see a list of typical targets execute "make help" | 9 | # To see a list of typical targets execute "make help" |
diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h index 23b33e8ea03a..1dab3a984608 100644 --- a/arch/arm64/include/asm/kvm_emulate.h +++ b/arch/arm64/include/asm/kvm_emulate.h | |||
| @@ -333,7 +333,7 @@ static inline void kvm_vcpu_set_be(struct kvm_vcpu *vcpu) | |||
| 333 | } else { | 333 | } else { |
| 334 | u64 sctlr = vcpu_read_sys_reg(vcpu, SCTLR_EL1); | 334 | u64 sctlr = vcpu_read_sys_reg(vcpu, SCTLR_EL1); |
| 335 | sctlr |= (1 << 25); | 335 | sctlr |= (1 << 25); |
| 336 | vcpu_write_sys_reg(vcpu, SCTLR_EL1, sctlr); | 336 | vcpu_write_sys_reg(vcpu, sctlr, SCTLR_EL1); |
| 337 | } | 337 | } |
| 338 | } | 338 | } |
| 339 | 339 | ||
diff --git a/arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c b/arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c index 86801b6055d6..39be799d0417 100644 --- a/arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c +++ b/arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c | |||
| @@ -18,11 +18,20 @@ | |||
| 18 | #include <linux/compiler.h> | 18 | #include <linux/compiler.h> |
| 19 | #include <linux/irqchip/arm-gic.h> | 19 | #include <linux/irqchip/arm-gic.h> |
| 20 | #include <linux/kvm_host.h> | 20 | #include <linux/kvm_host.h> |
| 21 | #include <linux/swab.h> | ||
| 21 | 22 | ||
| 22 | #include <asm/kvm_emulate.h> | 23 | #include <asm/kvm_emulate.h> |
| 23 | #include <asm/kvm_hyp.h> | 24 | #include <asm/kvm_hyp.h> |
| 24 | #include <asm/kvm_mmu.h> | 25 | #include <asm/kvm_mmu.h> |
| 25 | 26 | ||
| 27 | static bool __hyp_text __is_be(struct kvm_vcpu *vcpu) | ||
| 28 | { | ||
| 29 | if (vcpu_mode_is_32bit(vcpu)) | ||
| 30 | return !!(read_sysreg_el2(spsr) & COMPAT_PSR_E_BIT); | ||
| 31 | |||
| 32 | return !!(read_sysreg(SCTLR_EL1) & SCTLR_ELx_EE); | ||
| 33 | } | ||
| 34 | |||
| 26 | /* | 35 | /* |
| 27 | * __vgic_v2_perform_cpuif_access -- perform a GICV access on behalf of the | 36 | * __vgic_v2_perform_cpuif_access -- perform a GICV access on behalf of the |
| 28 | * guest. | 37 | * guest. |
| @@ -64,14 +73,19 @@ int __hyp_text __vgic_v2_perform_cpuif_access(struct kvm_vcpu *vcpu) | |||
| 64 | addr += fault_ipa - vgic->vgic_cpu_base; | 73 | addr += fault_ipa - vgic->vgic_cpu_base; |
| 65 | 74 | ||
| 66 | if (kvm_vcpu_dabt_iswrite(vcpu)) { | 75 | if (kvm_vcpu_dabt_iswrite(vcpu)) { |
| 67 | u32 data = vcpu_data_guest_to_host(vcpu, | 76 | u32 data = vcpu_get_reg(vcpu, rd); |
| 68 | vcpu_get_reg(vcpu, rd), | 77 | if (__is_be(vcpu)) { |
| 69 | sizeof(u32)); | 78 | /* guest pre-swabbed data, undo this for writel() */ |
| 79 | data = swab32(data); | ||
| 80 | } | ||
| 70 | writel_relaxed(data, addr); | 81 | writel_relaxed(data, addr); |
| 71 | } else { | 82 | } else { |
| 72 | u32 data = readl_relaxed(addr); | 83 | u32 data = readl_relaxed(addr); |
| 73 | vcpu_set_reg(vcpu, rd, vcpu_data_host_to_guest(vcpu, data, | 84 | if (__is_be(vcpu)) { |
| 74 | sizeof(u32))); | 85 | /* guest expects swabbed data */ |
| 86 | data = swab32(data); | ||
| 87 | } | ||
| 88 | vcpu_set_reg(vcpu, rd, data); | ||
| 75 | } | 89 | } |
| 76 | 90 | ||
| 77 | return 1; | 91 | return 1; |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 8a5b185735e1..ce243f7d2d4e 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
| @@ -848,6 +848,11 @@ void get_cpu_cap(struct cpuinfo_x86 *c) | |||
| 848 | c->x86_power = edx; | 848 | c->x86_power = edx; |
| 849 | } | 849 | } |
| 850 | 850 | ||
| 851 | if (c->extended_cpuid_level >= 0x80000008) { | ||
| 852 | cpuid(0x80000008, &eax, &ebx, &ecx, &edx); | ||
| 853 | c->x86_capability[CPUID_8000_0008_EBX] = ebx; | ||
| 854 | } | ||
| 855 | |||
| 851 | if (c->extended_cpuid_level >= 0x8000000a) | 856 | if (c->extended_cpuid_level >= 0x8000000a) |
| 852 | c->x86_capability[CPUID_8000_000A_EDX] = cpuid_edx(0x8000000a); | 857 | c->x86_capability[CPUID_8000_000A_EDX] = cpuid_edx(0x8000000a); |
| 853 | 858 | ||
| @@ -871,7 +876,6 @@ static void get_cpu_address_sizes(struct cpuinfo_x86 *c) | |||
| 871 | 876 | ||
| 872 | c->x86_virt_bits = (eax >> 8) & 0xff; | 877 | c->x86_virt_bits = (eax >> 8) & 0xff; |
| 873 | c->x86_phys_bits = eax & 0xff; | 878 | c->x86_phys_bits = eax & 0xff; |
| 874 | c->x86_capability[CPUID_8000_0008_EBX] = ebx; | ||
| 875 | } | 879 | } |
| 876 | #ifdef CONFIG_X86_32 | 880 | #ifdef CONFIG_X86_32 |
| 877 | else if (cpu_has(c, X86_FEATURE_PAE) || cpu_has(c, X86_FEATURE_PSE36)) | 881 | else if (cpu_has(c, X86_FEATURE_PAE) || cpu_has(c, X86_FEATURE_PSE36)) |
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 91e6da48cbb6..74392d9d51e0 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
| @@ -1067,6 +1067,7 @@ static struct clocksource clocksource_tsc_early = { | |||
| 1067 | .resume = tsc_resume, | 1067 | .resume = tsc_resume, |
| 1068 | .mark_unstable = tsc_cs_mark_unstable, | 1068 | .mark_unstable = tsc_cs_mark_unstable, |
| 1069 | .tick_stable = tsc_cs_tick_stable, | 1069 | .tick_stable = tsc_cs_tick_stable, |
| 1070 | .list = LIST_HEAD_INIT(clocksource_tsc_early.list), | ||
| 1070 | }; | 1071 | }; |
| 1071 | 1072 | ||
| 1072 | /* | 1073 | /* |
| @@ -1086,6 +1087,7 @@ static struct clocksource clocksource_tsc = { | |||
| 1086 | .resume = tsc_resume, | 1087 | .resume = tsc_resume, |
| 1087 | .mark_unstable = tsc_cs_mark_unstable, | 1088 | .mark_unstable = tsc_cs_mark_unstable, |
| 1088 | .tick_stable = tsc_cs_tick_stable, | 1089 | .tick_stable = tsc_cs_tick_stable, |
| 1090 | .list = LIST_HEAD_INIT(clocksource_tsc.list), | ||
| 1089 | }; | 1091 | }; |
| 1090 | 1092 | ||
| 1091 | void mark_tsc_unstable(char *reason) | 1093 | void mark_tsc_unstable(char *reason) |
| @@ -1098,13 +1100,9 @@ void mark_tsc_unstable(char *reason) | |||
| 1098 | clear_sched_clock_stable(); | 1100 | clear_sched_clock_stable(); |
| 1099 | disable_sched_clock_irqtime(); | 1101 | disable_sched_clock_irqtime(); |
| 1100 | pr_info("Marking TSC unstable due to %s\n", reason); | 1102 | pr_info("Marking TSC unstable due to %s\n", reason); |
| 1101 | /* Change only the rating, when not registered */ | 1103 | |
| 1102 | if (clocksource_tsc.mult) { | 1104 | clocksource_mark_unstable(&clocksource_tsc_early); |
| 1103 | clocksource_mark_unstable(&clocksource_tsc); | 1105 | clocksource_mark_unstable(&clocksource_tsc); |
| 1104 | } else { | ||
| 1105 | clocksource_tsc.flags |= CLOCK_SOURCE_UNSTABLE; | ||
| 1106 | clocksource_tsc.rating = 0; | ||
| 1107 | } | ||
| 1108 | } | 1106 | } |
| 1109 | 1107 | ||
| 1110 | EXPORT_SYMBOL_GPL(mark_tsc_unstable); | 1108 | EXPORT_SYMBOL_GPL(mark_tsc_unstable); |
| @@ -1244,7 +1242,7 @@ static void tsc_refine_calibration_work(struct work_struct *work) | |||
| 1244 | 1242 | ||
| 1245 | /* Don't bother refining TSC on unstable systems */ | 1243 | /* Don't bother refining TSC on unstable systems */ |
| 1246 | if (tsc_unstable) | 1244 | if (tsc_unstable) |
| 1247 | return; | 1245 | goto unreg; |
| 1248 | 1246 | ||
| 1249 | /* | 1247 | /* |
| 1250 | * Since the work is started early in boot, we may be | 1248 | * Since the work is started early in boot, we may be |
| @@ -1297,11 +1295,12 @@ static void tsc_refine_calibration_work(struct work_struct *work) | |||
| 1297 | 1295 | ||
| 1298 | out: | 1296 | out: |
| 1299 | if (tsc_unstable) | 1297 | if (tsc_unstable) |
| 1300 | return; | 1298 | goto unreg; |
| 1301 | 1299 | ||
| 1302 | if (boot_cpu_has(X86_FEATURE_ART)) | 1300 | if (boot_cpu_has(X86_FEATURE_ART)) |
| 1303 | art_related_clocksource = &clocksource_tsc; | 1301 | art_related_clocksource = &clocksource_tsc; |
| 1304 | clocksource_register_khz(&clocksource_tsc, tsc_khz); | 1302 | clocksource_register_khz(&clocksource_tsc, tsc_khz); |
| 1303 | unreg: | ||
| 1305 | clocksource_unregister(&clocksource_tsc_early); | 1304 | clocksource_unregister(&clocksource_tsc_early); |
| 1306 | } | 1305 | } |
| 1307 | 1306 | ||
| @@ -1311,8 +1310,8 @@ static int __init init_tsc_clocksource(void) | |||
| 1311 | if (!boot_cpu_has(X86_FEATURE_TSC) || tsc_disabled > 0 || !tsc_khz) | 1310 | if (!boot_cpu_has(X86_FEATURE_TSC) || tsc_disabled > 0 || !tsc_khz) |
| 1312 | return 0; | 1311 | return 0; |
| 1313 | 1312 | ||
| 1314 | if (check_tsc_unstable()) | 1313 | if (tsc_unstable) |
| 1315 | return 0; | 1314 | goto unreg; |
| 1316 | 1315 | ||
| 1317 | if (tsc_clocksource_reliable) | 1316 | if (tsc_clocksource_reliable) |
| 1318 | clocksource_tsc.flags &= ~CLOCK_SOURCE_MUST_VERIFY; | 1317 | clocksource_tsc.flags &= ~CLOCK_SOURCE_MUST_VERIFY; |
| @@ -1328,6 +1327,7 @@ static int __init init_tsc_clocksource(void) | |||
| 1328 | if (boot_cpu_has(X86_FEATURE_ART)) | 1327 | if (boot_cpu_has(X86_FEATURE_ART)) |
| 1329 | art_related_clocksource = &clocksource_tsc; | 1328 | art_related_clocksource = &clocksource_tsc; |
| 1330 | clocksource_register_khz(&clocksource_tsc, tsc_khz); | 1329 | clocksource_register_khz(&clocksource_tsc, tsc_khz); |
| 1330 | unreg: | ||
| 1331 | clocksource_unregister(&clocksource_tsc_early); | 1331 | clocksource_unregister(&clocksource_tsc_early); |
| 1332 | return 0; | 1332 | return 0; |
| 1333 | } | 1333 | } |
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 70dcb5548022..b74c9c1405b9 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c | |||
| @@ -1463,23 +1463,6 @@ static void start_sw_tscdeadline(struct kvm_lapic *apic) | |||
| 1463 | local_irq_restore(flags); | 1463 | local_irq_restore(flags); |
| 1464 | } | 1464 | } |
| 1465 | 1465 | ||
| 1466 | static void start_sw_period(struct kvm_lapic *apic) | ||
| 1467 | { | ||
| 1468 | if (!apic->lapic_timer.period) | ||
| 1469 | return; | ||
| 1470 | |||
| 1471 | if (apic_lvtt_oneshot(apic) && | ||
| 1472 | ktime_after(ktime_get(), | ||
| 1473 | apic->lapic_timer.target_expiration)) { | ||
| 1474 | apic_timer_expired(apic); | ||
| 1475 | return; | ||
| 1476 | } | ||
| 1477 | |||
| 1478 | hrtimer_start(&apic->lapic_timer.timer, | ||
| 1479 | apic->lapic_timer.target_expiration, | ||
| 1480 | HRTIMER_MODE_ABS_PINNED); | ||
| 1481 | } | ||
| 1482 | |||
| 1483 | static void update_target_expiration(struct kvm_lapic *apic, uint32_t old_divisor) | 1466 | static void update_target_expiration(struct kvm_lapic *apic, uint32_t old_divisor) |
| 1484 | { | 1467 | { |
| 1485 | ktime_t now, remaining; | 1468 | ktime_t now, remaining; |
| @@ -1546,6 +1529,26 @@ static void advance_periodic_target_expiration(struct kvm_lapic *apic) | |||
| 1546 | apic->lapic_timer.period); | 1529 | apic->lapic_timer.period); |
| 1547 | } | 1530 | } |
| 1548 | 1531 | ||
| 1532 | static void start_sw_period(struct kvm_lapic *apic) | ||
| 1533 | { | ||
| 1534 | if (!apic->lapic_timer.period) | ||
| 1535 | return; | ||
| 1536 | |||
| 1537 | if (ktime_after(ktime_get(), | ||
| 1538 | apic->lapic_timer.target_expiration)) { | ||
| 1539 | apic_timer_expired(apic); | ||
| 1540 | |||
| 1541 | if (apic_lvtt_oneshot(apic)) | ||
| 1542 | return; | ||
| 1543 | |||
| 1544 | advance_periodic_target_expiration(apic); | ||
| 1545 | } | ||
| 1546 | |||
| 1547 | hrtimer_start(&apic->lapic_timer.timer, | ||
| 1548 | apic->lapic_timer.target_expiration, | ||
| 1549 | HRTIMER_MODE_ABS_PINNED); | ||
| 1550 | } | ||
| 1551 | |||
| 1549 | bool kvm_lapic_hv_timer_in_use(struct kvm_vcpu *vcpu) | 1552 | bool kvm_lapic_hv_timer_in_use(struct kvm_vcpu *vcpu) |
| 1550 | { | 1553 | { |
| 1551 | if (!lapic_in_kernel(vcpu)) | 1554 | if (!lapic_in_kernel(vcpu)) |
diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c index c36d23aa6c35..357969a3697c 100644 --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c | |||
| @@ -421,45 +421,33 @@ static void xen_load_gdt(const struct desc_ptr *dtr) | |||
| 421 | { | 421 | { |
| 422 | unsigned long va = dtr->address; | 422 | unsigned long va = dtr->address; |
| 423 | unsigned int size = dtr->size + 1; | 423 | unsigned int size = dtr->size + 1; |
| 424 | unsigned pages = DIV_ROUND_UP(size, PAGE_SIZE); | 424 | unsigned long pfn, mfn; |
| 425 | unsigned long frames[pages]; | 425 | int level; |
| 426 | int f; | 426 | pte_t *ptep; |
| 427 | 427 | void *virt; | |
| 428 | /* | ||
| 429 | * A GDT can be up to 64k in size, which corresponds to 8192 | ||
| 430 | * 8-byte entries, or 16 4k pages.. | ||
| 431 | */ | ||
| 432 | 428 | ||
| 433 | BUG_ON(size > 65536); | 429 | /* @size should be at most GDT_SIZE which is smaller than PAGE_SIZE. */ |
| 430 | BUG_ON(size > PAGE_SIZE); | ||
| 434 | BUG_ON(va & ~PAGE_MASK); | 431 | BUG_ON(va & ~PAGE_MASK); |
| 435 | 432 | ||
| 436 | for (f = 0; va < dtr->address + size; va += PAGE_SIZE, f++) { | 433 | /* |
| 437 | int level; | 434 | * The GDT is per-cpu and is in the percpu data area. |
| 438 | pte_t *ptep; | 435 | * That can be virtually mapped, so we need to do a |
| 439 | unsigned long pfn, mfn; | 436 | * page-walk to get the underlying MFN for the |
| 440 | void *virt; | 437 | * hypercall. The page can also be in the kernel's |
| 441 | 438 | * linear range, so we need to RO that mapping too. | |
| 442 | /* | 439 | */ |
| 443 | * The GDT is per-cpu and is in the percpu data area. | 440 | ptep = lookup_address(va, &level); |
| 444 | * That can be virtually mapped, so we need to do a | 441 | BUG_ON(ptep == NULL); |
| 445 | * page-walk to get the underlying MFN for the | ||
| 446 | * hypercall. The page can also be in the kernel's | ||
| 447 | * linear range, so we need to RO that mapping too. | ||
| 448 | */ | ||
| 449 | ptep = lookup_address(va, &level); | ||
| 450 | BUG_ON(ptep == NULL); | ||
| 451 | |||
| 452 | pfn = pte_pfn(*ptep); | ||
| 453 | mfn = pfn_to_mfn(pfn); | ||
| 454 | virt = __va(PFN_PHYS(pfn)); | ||
| 455 | 442 | ||
| 456 | frames[f] = mfn; | 443 | pfn = pte_pfn(*ptep); |
| 444 | mfn = pfn_to_mfn(pfn); | ||
| 445 | virt = __va(PFN_PHYS(pfn)); | ||
| 457 | 446 | ||
| 458 | make_lowmem_page_readonly((void *)va); | 447 | make_lowmem_page_readonly((void *)va); |
| 459 | make_lowmem_page_readonly(virt); | 448 | make_lowmem_page_readonly(virt); |
| 460 | } | ||
| 461 | 449 | ||
| 462 | if (HYPERVISOR_set_gdt(frames, size / sizeof(struct desc_struct))) | 450 | if (HYPERVISOR_set_gdt(&mfn, size / sizeof(struct desc_struct))) |
| 463 | BUG(); | 451 | BUG(); |
| 464 | } | 452 | } |
| 465 | 453 | ||
| @@ -470,34 +458,22 @@ static void __init xen_load_gdt_boot(const struct desc_ptr *dtr) | |||
| 470 | { | 458 | { |
| 471 | unsigned long va = dtr->address; | 459 | unsigned long va = dtr->address; |
| 472 | unsigned int size = dtr->size + 1; | 460 | unsigned int size = dtr->size + 1; |
| 473 | unsigned pages = DIV_ROUND_UP(size, PAGE_SIZE); | 461 | unsigned long pfn, mfn; |
| 474 | unsigned long frames[pages]; | 462 | pte_t pte; |
| 475 | int f; | ||
| 476 | |||
| 477 | /* | ||
| 478 | * A GDT can be up to 64k in size, which corresponds to 8192 | ||
| 479 | * 8-byte entries, or 16 4k pages.. | ||
| 480 | */ | ||
| 481 | 463 | ||
| 482 | BUG_ON(size > 65536); | 464 | /* @size should be at most GDT_SIZE which is smaller than PAGE_SIZE. */ |
| 465 | BUG_ON(size > PAGE_SIZE); | ||
| 483 | BUG_ON(va & ~PAGE_MASK); | 466 | BUG_ON(va & ~PAGE_MASK); |
| 484 | 467 | ||
| 485 | for (f = 0; va < dtr->address + size; va += PAGE_SIZE, f++) { | 468 | pfn = virt_to_pfn(va); |
| 486 | pte_t pte; | 469 | mfn = pfn_to_mfn(pfn); |
| 487 | unsigned long pfn, mfn; | ||
| 488 | 470 | ||
| 489 | pfn = virt_to_pfn(va); | 471 | pte = pfn_pte(pfn, PAGE_KERNEL_RO); |
| 490 | mfn = pfn_to_mfn(pfn); | ||
| 491 | 472 | ||
| 492 | pte = pfn_pte(pfn, PAGE_KERNEL_RO); | 473 | if (HYPERVISOR_update_va_mapping((unsigned long)va, pte, 0)) |
| 493 | 474 | BUG(); | |
| 494 | if (HYPERVISOR_update_va_mapping((unsigned long)va, pte, 0)) | ||
| 495 | BUG(); | ||
| 496 | |||
| 497 | frames[f] = mfn; | ||
| 498 | } | ||
| 499 | 475 | ||
| 500 | if (HYPERVISOR_set_gdt(frames, size / sizeof(struct desc_struct))) | 476 | if (HYPERVISOR_set_gdt(&mfn, size / sizeof(struct desc_struct))) |
| 501 | BUG(); | 477 | BUG(); |
| 502 | } | 478 | } |
| 503 | 479 | ||
diff --git a/block/blk-mq.c b/block/blk-mq.c index c3621453ad87..9ce9cac16c3f 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
| @@ -95,18 +95,15 @@ static void blk_mq_check_inflight(struct blk_mq_hw_ctx *hctx, | |||
| 95 | { | 95 | { |
| 96 | struct mq_inflight *mi = priv; | 96 | struct mq_inflight *mi = priv; |
| 97 | 97 | ||
| 98 | if (blk_mq_rq_state(rq) == MQ_RQ_IN_FLIGHT) { | 98 | /* |
| 99 | /* | 99 | * index[0] counts the specific partition that was asked for. index[1] |
| 100 | * index[0] counts the specific partition that was asked | 100 | * counts the ones that are active on the whole device, so increment |
| 101 | * for. index[1] counts the ones that are active on the | 101 | * that if mi->part is indeed a partition, and not a whole device. |
| 102 | * whole device, so increment that if mi->part is indeed | 102 | */ |
| 103 | * a partition, and not a whole device. | 103 | if (rq->part == mi->part) |
| 104 | */ | 104 | mi->inflight[0]++; |
| 105 | if (rq->part == mi->part) | 105 | if (mi->part->partno) |
| 106 | mi->inflight[0]++; | 106 | mi->inflight[1]++; |
| 107 | if (mi->part->partno) | ||
| 108 | mi->inflight[1]++; | ||
| 109 | } | ||
| 110 | } | 107 | } |
| 111 | 108 | ||
| 112 | void blk_mq_in_flight(struct request_queue *q, struct hd_struct *part, | 109 | void blk_mq_in_flight(struct request_queue *q, struct hd_struct *part, |
| @@ -118,6 +115,25 @@ void blk_mq_in_flight(struct request_queue *q, struct hd_struct *part, | |||
| 118 | blk_mq_queue_tag_busy_iter(q, blk_mq_check_inflight, &mi); | 115 | blk_mq_queue_tag_busy_iter(q, blk_mq_check_inflight, &mi); |
| 119 | } | 116 | } |
| 120 | 117 | ||
| 118 | static void blk_mq_check_inflight_rw(struct blk_mq_hw_ctx *hctx, | ||
| 119 | struct request *rq, void *priv, | ||
| 120 | bool reserved) | ||
| 121 | { | ||
| 122 | struct mq_inflight *mi = priv; | ||
| 123 | |||
| 124 | if (rq->part == mi->part) | ||
| 125 | mi->inflight[rq_data_dir(rq)]++; | ||
| 126 | } | ||
| 127 | |||
| 128 | void blk_mq_in_flight_rw(struct request_queue *q, struct hd_struct *part, | ||
| 129 | unsigned int inflight[2]) | ||
| 130 | { | ||
| 131 | struct mq_inflight mi = { .part = part, .inflight = inflight, }; | ||
| 132 | |||
| 133 | inflight[0] = inflight[1] = 0; | ||
| 134 | blk_mq_queue_tag_busy_iter(q, blk_mq_check_inflight_rw, &mi); | ||
| 135 | } | ||
| 136 | |||
| 121 | void blk_freeze_queue_start(struct request_queue *q) | 137 | void blk_freeze_queue_start(struct request_queue *q) |
| 122 | { | 138 | { |
| 123 | int freeze_depth; | 139 | int freeze_depth; |
diff --git a/block/blk-mq.h b/block/blk-mq.h index 89b5cd3a6c70..e1bb420dc5d6 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h | |||
| @@ -188,7 +188,9 @@ static inline bool blk_mq_hw_queue_mapped(struct blk_mq_hw_ctx *hctx) | |||
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | void blk_mq_in_flight(struct request_queue *q, struct hd_struct *part, | 190 | void blk_mq_in_flight(struct request_queue *q, struct hd_struct *part, |
| 191 | unsigned int inflight[2]); | 191 | unsigned int inflight[2]); |
| 192 | void blk_mq_in_flight_rw(struct request_queue *q, struct hd_struct *part, | ||
| 193 | unsigned int inflight[2]); | ||
| 192 | 194 | ||
| 193 | static inline void blk_mq_put_dispatch_budget(struct blk_mq_hw_ctx *hctx) | 195 | static inline void blk_mq_put_dispatch_budget(struct blk_mq_hw_ctx *hctx) |
| 194 | { | 196 | { |
diff --git a/block/genhd.c b/block/genhd.c index dc7e089373b9..c4513fe1adda 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
| @@ -82,6 +82,18 @@ void part_in_flight(struct request_queue *q, struct hd_struct *part, | |||
| 82 | } | 82 | } |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | void part_in_flight_rw(struct request_queue *q, struct hd_struct *part, | ||
| 86 | unsigned int inflight[2]) | ||
| 87 | { | ||
| 88 | if (q->mq_ops) { | ||
| 89 | blk_mq_in_flight_rw(q, part, inflight); | ||
| 90 | return; | ||
| 91 | } | ||
| 92 | |||
| 93 | inflight[0] = atomic_read(&part->in_flight[0]); | ||
| 94 | inflight[1] = atomic_read(&part->in_flight[1]); | ||
| 95 | } | ||
| 96 | |||
| 85 | struct hd_struct *__disk_get_part(struct gendisk *disk, int partno) | 97 | struct hd_struct *__disk_get_part(struct gendisk *disk, int partno) |
| 86 | { | 98 | { |
| 87 | struct disk_part_tbl *ptbl = rcu_dereference(disk->part_tbl); | 99 | struct disk_part_tbl *ptbl = rcu_dereference(disk->part_tbl); |
diff --git a/block/partition-generic.c b/block/partition-generic.c index 08dabcd8b6ae..db57cced9b98 100644 --- a/block/partition-generic.c +++ b/block/partition-generic.c | |||
| @@ -145,13 +145,15 @@ ssize_t part_stat_show(struct device *dev, | |||
| 145 | jiffies_to_msecs(part_stat_read(p, time_in_queue))); | 145 | jiffies_to_msecs(part_stat_read(p, time_in_queue))); |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | ssize_t part_inflight_show(struct device *dev, | 148 | ssize_t part_inflight_show(struct device *dev, struct device_attribute *attr, |
| 149 | struct device_attribute *attr, char *buf) | 149 | char *buf) |
| 150 | { | 150 | { |
| 151 | struct hd_struct *p = dev_to_part(dev); | 151 | struct hd_struct *p = dev_to_part(dev); |
| 152 | struct request_queue *q = part_to_disk(p)->queue; | ||
| 153 | unsigned int inflight[2]; | ||
| 152 | 154 | ||
| 153 | return sprintf(buf, "%8u %8u\n", atomic_read(&p->in_flight[0]), | 155 | part_in_flight_rw(q, p, inflight); |
| 154 | atomic_read(&p->in_flight[1])); | 156 | return sprintf(buf, "%8u %8u\n", inflight[0], inflight[1]); |
| 155 | } | 157 | } |
| 156 | 158 | ||
| 157 | #ifdef CONFIG_FAIL_MAKE_REQUEST | 159 | #ifdef CONFIG_FAIL_MAKE_REQUEST |
diff --git a/drivers/clk/clk-cs2000-cp.c b/drivers/clk/clk-cs2000-cp.c index c58019750b7e..a2f8c42e527a 100644 --- a/drivers/clk/clk-cs2000-cp.c +++ b/drivers/clk/clk-cs2000-cp.c | |||
| @@ -541,7 +541,7 @@ probe_err: | |||
| 541 | return ret; | 541 | return ret; |
| 542 | } | 542 | } |
| 543 | 543 | ||
| 544 | static int cs2000_resume(struct device *dev) | 544 | static int __maybe_unused cs2000_resume(struct device *dev) |
| 545 | { | 545 | { |
| 546 | struct cs2000_priv *priv = dev_get_drvdata(dev); | 546 | struct cs2000_priv *priv = dev_get_drvdata(dev); |
| 547 | 547 | ||
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c index ac4a042f8658..1628b93655ed 100644 --- a/drivers/clk/clk-mux.c +++ b/drivers/clk/clk-mux.c | |||
| @@ -112,10 +112,18 @@ static int clk_mux_set_parent(struct clk_hw *hw, u8 index) | |||
| 112 | return 0; | 112 | return 0; |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | static int clk_mux_determine_rate(struct clk_hw *hw, | ||
| 116 | struct clk_rate_request *req) | ||
| 117 | { | ||
| 118 | struct clk_mux *mux = to_clk_mux(hw); | ||
| 119 | |||
| 120 | return clk_mux_determine_rate_flags(hw, req, mux->flags); | ||
| 121 | } | ||
| 122 | |||
| 115 | const struct clk_ops clk_mux_ops = { | 123 | const struct clk_ops clk_mux_ops = { |
| 116 | .get_parent = clk_mux_get_parent, | 124 | .get_parent = clk_mux_get_parent, |
| 117 | .set_parent = clk_mux_set_parent, | 125 | .set_parent = clk_mux_set_parent, |
| 118 | .determine_rate = __clk_mux_determine_rate, | 126 | .determine_rate = clk_mux_determine_rate, |
| 119 | }; | 127 | }; |
| 120 | EXPORT_SYMBOL_GPL(clk_mux_ops); | 128 | EXPORT_SYMBOL_GPL(clk_mux_ops); |
| 121 | 129 | ||
diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c index f1d5967b4b39..edd3cf451401 100644 --- a/drivers/clk/clk-stm32mp1.c +++ b/drivers/clk/clk-stm32mp1.c | |||
| @@ -216,7 +216,7 @@ static const char * const usart1_src[] = { | |||
| 216 | "pclk5", "pll3_q", "ck_hsi", "ck_csi", "pll4_q", "ck_hse" | 216 | "pclk5", "pll3_q", "ck_hsi", "ck_csi", "pll4_q", "ck_hse" |
| 217 | }; | 217 | }; |
| 218 | 218 | ||
| 219 | const char * const usart234578_src[] = { | 219 | static const char * const usart234578_src[] = { |
| 220 | "pclk1", "pll4_q", "ck_hsi", "ck_csi", "ck_hse" | 220 | "pclk1", "pll4_q", "ck_hsi", "ck_csi", "ck_hse" |
| 221 | }; | 221 | }; |
| 222 | 222 | ||
| @@ -224,10 +224,6 @@ static const char * const usart6_src[] = { | |||
| 224 | "pclk2", "pll4_q", "ck_hsi", "ck_csi", "ck_hse" | 224 | "pclk2", "pll4_q", "ck_hsi", "ck_csi", "ck_hse" |
| 225 | }; | 225 | }; |
| 226 | 226 | ||
| 227 | static const char * const dfsdm_src[] = { | ||
| 228 | "pclk2", "ck_mcu" | ||
| 229 | }; | ||
| 230 | |||
| 231 | static const char * const fdcan_src[] = { | 227 | static const char * const fdcan_src[] = { |
| 232 | "ck_hse", "pll3_q", "pll4_q" | 228 | "ck_hse", "pll3_q", "pll4_q" |
| 233 | }; | 229 | }; |
| @@ -316,10 +312,8 @@ struct stm32_clk_mgate { | |||
| 316 | struct clock_config { | 312 | struct clock_config { |
| 317 | u32 id; | 313 | u32 id; |
| 318 | const char *name; | 314 | const char *name; |
| 319 | union { | 315 | const char *parent_name; |
| 320 | const char *parent_name; | 316 | const char * const *parent_names; |
| 321 | const char * const *parent_names; | ||
| 322 | }; | ||
| 323 | int num_parents; | 317 | int num_parents; |
| 324 | unsigned long flags; | 318 | unsigned long flags; |
| 325 | void *cfg; | 319 | void *cfg; |
| @@ -469,7 +463,7 @@ static void mp1_gate_clk_disable(struct clk_hw *hw) | |||
| 469 | } | 463 | } |
| 470 | } | 464 | } |
| 471 | 465 | ||
| 472 | const struct clk_ops mp1_gate_clk_ops = { | 466 | static const struct clk_ops mp1_gate_clk_ops = { |
| 473 | .enable = mp1_gate_clk_enable, | 467 | .enable = mp1_gate_clk_enable, |
| 474 | .disable = mp1_gate_clk_disable, | 468 | .disable = mp1_gate_clk_disable, |
| 475 | .is_enabled = clk_gate_is_enabled, | 469 | .is_enabled = clk_gate_is_enabled, |
| @@ -698,7 +692,7 @@ static void mp1_mgate_clk_disable(struct clk_hw *hw) | |||
| 698 | mp1_gate_clk_disable(hw); | 692 | mp1_gate_clk_disable(hw); |
| 699 | } | 693 | } |
| 700 | 694 | ||
| 701 | const struct clk_ops mp1_mgate_clk_ops = { | 695 | static const struct clk_ops mp1_mgate_clk_ops = { |
| 702 | .enable = mp1_mgate_clk_enable, | 696 | .enable = mp1_mgate_clk_enable, |
| 703 | .disable = mp1_mgate_clk_disable, | 697 | .disable = mp1_mgate_clk_disable, |
| 704 | .is_enabled = clk_gate_is_enabled, | 698 | .is_enabled = clk_gate_is_enabled, |
| @@ -732,7 +726,7 @@ static int clk_mmux_set_parent(struct clk_hw *hw, u8 index) | |||
| 732 | return 0; | 726 | return 0; |
| 733 | } | 727 | } |
| 734 | 728 | ||
| 735 | const struct clk_ops clk_mmux_ops = { | 729 | static const struct clk_ops clk_mmux_ops = { |
| 736 | .get_parent = clk_mmux_get_parent, | 730 | .get_parent = clk_mmux_get_parent, |
| 737 | .set_parent = clk_mmux_set_parent, | 731 | .set_parent = clk_mmux_set_parent, |
| 738 | .determine_rate = __clk_mux_determine_rate, | 732 | .determine_rate = __clk_mux_determine_rate, |
| @@ -1048,10 +1042,10 @@ struct stm32_pll_cfg { | |||
| 1048 | u32 offset; | 1042 | u32 offset; |
| 1049 | }; | 1043 | }; |
| 1050 | 1044 | ||
| 1051 | struct clk_hw *_clk_register_pll(struct device *dev, | 1045 | static struct clk_hw *_clk_register_pll(struct device *dev, |
| 1052 | struct clk_hw_onecell_data *clk_data, | 1046 | struct clk_hw_onecell_data *clk_data, |
| 1053 | void __iomem *base, spinlock_t *lock, | 1047 | void __iomem *base, spinlock_t *lock, |
| 1054 | const struct clock_config *cfg) | 1048 | const struct clock_config *cfg) |
| 1055 | { | 1049 | { |
| 1056 | struct stm32_pll_cfg *stm_pll_cfg = cfg->cfg; | 1050 | struct stm32_pll_cfg *stm_pll_cfg = cfg->cfg; |
| 1057 | 1051 | ||
| @@ -1405,7 +1399,8 @@ enum { | |||
| 1405 | G_USBH, | 1399 | G_USBH, |
| 1406 | G_ETHSTP, | 1400 | G_ETHSTP, |
| 1407 | G_RTCAPB, | 1401 | G_RTCAPB, |
| 1408 | G_TZC, | 1402 | G_TZC1, |
| 1403 | G_TZC2, | ||
| 1409 | G_TZPC, | 1404 | G_TZPC, |
| 1410 | G_IWDG1, | 1405 | G_IWDG1, |
| 1411 | G_BSEC, | 1406 | G_BSEC, |
| @@ -1417,7 +1412,7 @@ enum { | |||
| 1417 | G_LAST | 1412 | G_LAST |
| 1418 | }; | 1413 | }; |
| 1419 | 1414 | ||
| 1420 | struct stm32_mgate mp1_mgate[G_LAST]; | 1415 | static struct stm32_mgate mp1_mgate[G_LAST]; |
| 1421 | 1416 | ||
| 1422 | #define _K_GATE(_id, _gate_offset, _gate_bit_idx, _gate_flags,\ | 1417 | #define _K_GATE(_id, _gate_offset, _gate_bit_idx, _gate_flags,\ |
| 1423 | _mgate, _ops)\ | 1418 | _mgate, _ops)\ |
| @@ -1440,7 +1435,7 @@ struct stm32_mgate mp1_mgate[G_LAST]; | |||
| 1440 | &mp1_mgate[_id], &mp1_mgate_clk_ops) | 1435 | &mp1_mgate[_id], &mp1_mgate_clk_ops) |
| 1441 | 1436 | ||
| 1442 | /* Peripheral gates */ | 1437 | /* Peripheral gates */ |
| 1443 | struct stm32_gate_cfg per_gate_cfg[G_LAST] = { | 1438 | static struct stm32_gate_cfg per_gate_cfg[G_LAST] = { |
| 1444 | /* Multi gates */ | 1439 | /* Multi gates */ |
| 1445 | K_GATE(G_MDIO, RCC_APB1ENSETR, 31, 0), | 1440 | K_GATE(G_MDIO, RCC_APB1ENSETR, 31, 0), |
| 1446 | K_MGATE(G_DAC12, RCC_APB1ENSETR, 29, 0), | 1441 | K_MGATE(G_DAC12, RCC_APB1ENSETR, 29, 0), |
| @@ -1506,7 +1501,8 @@ struct stm32_gate_cfg per_gate_cfg[G_LAST] = { | |||
| 1506 | K_GATE(G_BSEC, RCC_APB5ENSETR, 16, 0), | 1501 | K_GATE(G_BSEC, RCC_APB5ENSETR, 16, 0), |
| 1507 | K_GATE(G_IWDG1, RCC_APB5ENSETR, 15, 0), | 1502 | K_GATE(G_IWDG1, RCC_APB5ENSETR, 15, 0), |
| 1508 | K_GATE(G_TZPC, RCC_APB5ENSETR, 13, 0), | 1503 | K_GATE(G_TZPC, RCC_APB5ENSETR, 13, 0), |
| 1509 | K_GATE(G_TZC, RCC_APB5ENSETR, 12, 0), | 1504 | K_GATE(G_TZC2, RCC_APB5ENSETR, 12, 0), |
| 1505 | K_GATE(G_TZC1, RCC_APB5ENSETR, 11, 0), | ||
| 1510 | K_GATE(G_RTCAPB, RCC_APB5ENSETR, 8, 0), | 1506 | K_GATE(G_RTCAPB, RCC_APB5ENSETR, 8, 0), |
| 1511 | K_MGATE(G_USART1, RCC_APB5ENSETR, 4, 0), | 1507 | K_MGATE(G_USART1, RCC_APB5ENSETR, 4, 0), |
| 1512 | K_MGATE(G_I2C6, RCC_APB5ENSETR, 3, 0), | 1508 | K_MGATE(G_I2C6, RCC_APB5ENSETR, 3, 0), |
| @@ -1600,7 +1596,7 @@ enum { | |||
| 1600 | M_LAST | 1596 | M_LAST |
| 1601 | }; | 1597 | }; |
| 1602 | 1598 | ||
| 1603 | struct stm32_mmux ker_mux[M_LAST]; | 1599 | static struct stm32_mmux ker_mux[M_LAST]; |
| 1604 | 1600 | ||
| 1605 | #define _K_MUX(_id, _offset, _shift, _width, _mux_flags, _mmux, _ops)\ | 1601 | #define _K_MUX(_id, _offset, _shift, _width, _mux_flags, _mmux, _ops)\ |
| 1606 | [_id] = {\ | 1602 | [_id] = {\ |
| @@ -1623,7 +1619,7 @@ struct stm32_mmux ker_mux[M_LAST]; | |||
| 1623 | _K_MUX(_id, _offset, _shift, _width, _mux_flags,\ | 1619 | _K_MUX(_id, _offset, _shift, _width, _mux_flags,\ |
| 1624 | &ker_mux[_id], &clk_mmux_ops) | 1620 | &ker_mux[_id], &clk_mmux_ops) |
| 1625 | 1621 | ||
| 1626 | const struct stm32_mux_cfg ker_mux_cfg[M_LAST] = { | 1622 | static const struct stm32_mux_cfg ker_mux_cfg[M_LAST] = { |
| 1627 | /* Kernel multi mux */ | 1623 | /* Kernel multi mux */ |
| 1628 | K_MMUX(M_SDMMC12, RCC_SDMMC12CKSELR, 0, 3, 0), | 1624 | K_MMUX(M_SDMMC12, RCC_SDMMC12CKSELR, 0, 3, 0), |
| 1629 | K_MMUX(M_SPI23, RCC_SPI2S23CKSELR, 0, 3, 0), | 1625 | K_MMUX(M_SPI23, RCC_SPI2S23CKSELR, 0, 3, 0), |
| @@ -1860,7 +1856,8 @@ static const struct clock_config stm32mp1_clock_cfg[] = { | |||
| 1860 | PCLK(USART1, "usart1", "pclk5", 0, G_USART1), | 1856 | PCLK(USART1, "usart1", "pclk5", 0, G_USART1), |
| 1861 | PCLK(RTCAPB, "rtcapb", "pclk5", CLK_IGNORE_UNUSED | | 1857 | PCLK(RTCAPB, "rtcapb", "pclk5", CLK_IGNORE_UNUSED | |
| 1862 | CLK_IS_CRITICAL, G_RTCAPB), | 1858 | CLK_IS_CRITICAL, G_RTCAPB), |
| 1863 | PCLK(TZC, "tzc", "pclk5", CLK_IGNORE_UNUSED, G_TZC), | 1859 | PCLK(TZC1, "tzc1", "ck_axi", CLK_IGNORE_UNUSED, G_TZC1), |
| 1860 | PCLK(TZC2, "tzc2", "ck_axi", CLK_IGNORE_UNUSED, G_TZC2), | ||
| 1864 | PCLK(TZPC, "tzpc", "pclk5", CLK_IGNORE_UNUSED, G_TZPC), | 1861 | PCLK(TZPC, "tzpc", "pclk5", CLK_IGNORE_UNUSED, G_TZPC), |
| 1865 | PCLK(IWDG1, "iwdg1", "pclk5", 0, G_IWDG1), | 1862 | PCLK(IWDG1, "iwdg1", "pclk5", 0, G_IWDG1), |
| 1866 | PCLK(BSEC, "bsec", "pclk5", CLK_IGNORE_UNUSED, G_BSEC), | 1863 | PCLK(BSEC, "bsec", "pclk5", CLK_IGNORE_UNUSED, G_BSEC), |
| @@ -1916,8 +1913,7 @@ static const struct clock_config stm32mp1_clock_cfg[] = { | |||
| 1916 | KCLK(RNG1_K, "rng1_k", rng_src, 0, G_RNG1, M_RNG1), | 1913 | KCLK(RNG1_K, "rng1_k", rng_src, 0, G_RNG1, M_RNG1), |
| 1917 | KCLK(RNG2_K, "rng2_k", rng_src, 0, G_RNG2, M_RNG2), | 1914 | KCLK(RNG2_K, "rng2_k", rng_src, 0, G_RNG2, M_RNG2), |
| 1918 | KCLK(USBPHY_K, "usbphy_k", usbphy_src, 0, G_USBPHY, M_USBPHY), | 1915 | KCLK(USBPHY_K, "usbphy_k", usbphy_src, 0, G_USBPHY, M_USBPHY), |
| 1919 | KCLK(STGEN_K, "stgen_k", stgen_src, CLK_IGNORE_UNUSED, | 1916 | KCLK(STGEN_K, "stgen_k", stgen_src, CLK_IS_CRITICAL, G_STGEN, M_STGEN), |
| 1920 | G_STGEN, M_STGEN), | ||
| 1921 | KCLK(SPDIF_K, "spdif_k", spdif_src, 0, G_SPDIF, M_SPDIF), | 1917 | KCLK(SPDIF_K, "spdif_k", spdif_src, 0, G_SPDIF, M_SPDIF), |
| 1922 | KCLK(SPI1_K, "spi1_k", spi123_src, 0, G_SPI1, M_SPI1), | 1918 | KCLK(SPI1_K, "spi1_k", spi123_src, 0, G_SPI1, M_SPI1), |
| 1923 | KCLK(SPI2_K, "spi2_k", spi123_src, 0, G_SPI2, M_SPI23), | 1919 | KCLK(SPI2_K, "spi2_k", spi123_src, 0, G_SPI2, M_SPI23), |
| @@ -1948,8 +1944,8 @@ static const struct clock_config stm32mp1_clock_cfg[] = { | |||
| 1948 | KCLK(FDCAN_K, "fdcan_k", fdcan_src, 0, G_FDCAN, M_FDCAN), | 1944 | KCLK(FDCAN_K, "fdcan_k", fdcan_src, 0, G_FDCAN, M_FDCAN), |
| 1949 | KCLK(SAI1_K, "sai1_k", sai_src, 0, G_SAI1, M_SAI1), | 1945 | KCLK(SAI1_K, "sai1_k", sai_src, 0, G_SAI1, M_SAI1), |
| 1950 | KCLK(SAI2_K, "sai2_k", sai2_src, 0, G_SAI2, M_SAI2), | 1946 | KCLK(SAI2_K, "sai2_k", sai2_src, 0, G_SAI2, M_SAI2), |
| 1951 | KCLK(SAI3_K, "sai3_k", sai_src, 0, G_SAI2, M_SAI3), | 1947 | KCLK(SAI3_K, "sai3_k", sai_src, 0, G_SAI3, M_SAI3), |
| 1952 | KCLK(SAI4_K, "sai4_k", sai_src, 0, G_SAI2, M_SAI4), | 1948 | KCLK(SAI4_K, "sai4_k", sai_src, 0, G_SAI4, M_SAI4), |
| 1953 | KCLK(ADC12_K, "adc12_k", adc12_src, 0, G_ADC12, M_ADC12), | 1949 | KCLK(ADC12_K, "adc12_k", adc12_src, 0, G_ADC12, M_ADC12), |
| 1954 | KCLK(DSI_K, "dsi_k", dsi_src, 0, G_DSI, M_DSI), | 1950 | KCLK(DSI_K, "dsi_k", dsi_src, 0, G_DSI, M_DSI), |
| 1955 | KCLK(ADFSDM_K, "adfsdm_k", sai_src, 0, G_ADFSDM, M_SAI1), | 1951 | KCLK(ADFSDM_K, "adfsdm_k", sai_src, 0, G_ADFSDM, M_SAI1), |
| @@ -1992,10 +1988,6 @@ static const struct clock_config stm32mp1_clock_cfg[] = { | |||
| 1992 | _DIV(RCC_MCO2CFGR, 4, 4, 0, NULL)), | 1988 | _DIV(RCC_MCO2CFGR, 4, 4, 0, NULL)), |
| 1993 | 1989 | ||
| 1994 | /* Debug clocks */ | 1990 | /* Debug clocks */ |
| 1995 | FIXED_FACTOR(NO_ID, "ck_axi_div2", "ck_axi", 0, 1, 2), | ||
| 1996 | |||
| 1997 | GATE(DBG, "ck_apb_dbg", "ck_axi_div2", 0, RCC_DBGCFGR, 8, 0), | ||
| 1998 | |||
| 1999 | GATE(CK_DBG, "ck_sys_dbg", "ck_axi", 0, RCC_DBGCFGR, 8, 0), | 1991 | GATE(CK_DBG, "ck_sys_dbg", "ck_axi", 0, RCC_DBGCFGR, 8, 0), |
| 2000 | 1992 | ||
| 2001 | COMPOSITE(CK_TRACE, "ck_trace", ck_trace_src, CLK_OPS_PARENT_ENABLE, | 1993 | COMPOSITE(CK_TRACE, "ck_trace", ck_trace_src, CLK_OPS_PARENT_ENABLE, |
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index ea67ac81c6f9..7af555f0e60c 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c | |||
| @@ -426,9 +426,9 @@ static bool mux_is_better_rate(unsigned long rate, unsigned long now, | |||
| 426 | return now <= rate && now > best; | 426 | return now <= rate && now > best; |
| 427 | } | 427 | } |
| 428 | 428 | ||
| 429 | static int | 429 | int clk_mux_determine_rate_flags(struct clk_hw *hw, |
| 430 | clk_mux_determine_rate_flags(struct clk_hw *hw, struct clk_rate_request *req, | 430 | struct clk_rate_request *req, |
| 431 | unsigned long flags) | 431 | unsigned long flags) |
| 432 | { | 432 | { |
| 433 | struct clk_core *core = hw->core, *parent, *best_parent = NULL; | 433 | struct clk_core *core = hw->core, *parent, *best_parent = NULL; |
| 434 | int i, num_parents, ret; | 434 | int i, num_parents, ret; |
| @@ -488,6 +488,7 @@ out: | |||
| 488 | 488 | ||
| 489 | return 0; | 489 | return 0; |
| 490 | } | 490 | } |
| 491 | EXPORT_SYMBOL_GPL(clk_mux_determine_rate_flags); | ||
| 491 | 492 | ||
| 492 | struct clk *__clk_lookup(const char *name) | 493 | struct clk *__clk_lookup(const char *name) |
| 493 | { | 494 | { |
diff --git a/drivers/clk/meson/clk-regmap.c b/drivers/clk/meson/clk-regmap.c index 3645fdb62343..ab7a3556f5b2 100644 --- a/drivers/clk/meson/clk-regmap.c +++ b/drivers/clk/meson/clk-regmap.c | |||
| @@ -153,10 +153,19 @@ static int clk_regmap_mux_set_parent(struct clk_hw *hw, u8 index) | |||
| 153 | val << mux->shift); | 153 | val << mux->shift); |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | static int clk_regmap_mux_determine_rate(struct clk_hw *hw, | ||
| 157 | struct clk_rate_request *req) | ||
| 158 | { | ||
| 159 | struct clk_regmap *clk = to_clk_regmap(hw); | ||
| 160 | struct clk_regmap_mux_data *mux = clk_get_regmap_mux_data(clk); | ||
| 161 | |||
| 162 | return clk_mux_determine_rate_flags(hw, req, mux->flags); | ||
| 163 | } | ||
| 164 | |||
| 156 | const struct clk_ops clk_regmap_mux_ops = { | 165 | const struct clk_ops clk_regmap_mux_ops = { |
| 157 | .get_parent = clk_regmap_mux_get_parent, | 166 | .get_parent = clk_regmap_mux_get_parent, |
| 158 | .set_parent = clk_regmap_mux_set_parent, | 167 | .set_parent = clk_regmap_mux_set_parent, |
| 159 | .determine_rate = __clk_mux_determine_rate, | 168 | .determine_rate = clk_regmap_mux_determine_rate, |
| 160 | }; | 169 | }; |
| 161 | EXPORT_SYMBOL_GPL(clk_regmap_mux_ops); | 170 | EXPORT_SYMBOL_GPL(clk_regmap_mux_ops); |
| 162 | 171 | ||
diff --git a/drivers/clk/meson/gxbb-aoclk.h b/drivers/clk/meson/gxbb-aoclk.h index 0be78383f257..badc4c22b4ee 100644 --- a/drivers/clk/meson/gxbb-aoclk.h +++ b/drivers/clk/meson/gxbb-aoclk.h | |||
| @@ -17,8 +17,6 @@ | |||
| 17 | #define AO_RTC_ALT_CLK_CNTL0 0x94 | 17 | #define AO_RTC_ALT_CLK_CNTL0 0x94 |
| 18 | #define AO_RTC_ALT_CLK_CNTL1 0x98 | 18 | #define AO_RTC_ALT_CLK_CNTL1 0x98 |
| 19 | 19 | ||
| 20 | extern const struct clk_ops meson_aoclk_gate_regmap_ops; | ||
| 21 | |||
| 22 | struct aoclk_cec_32k { | 20 | struct aoclk_cec_32k { |
| 23 | struct clk_hw hw; | 21 | struct clk_hw hw; |
| 24 | struct regmap *regmap; | 22 | struct regmap *regmap; |
diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c index cc2992493e0b..d0524ec71aad 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c | |||
| @@ -253,7 +253,7 @@ static struct clk_fixed_factor meson8b_fclk_div3_div = { | |||
| 253 | .mult = 1, | 253 | .mult = 1, |
| 254 | .div = 3, | 254 | .div = 3, |
| 255 | .hw.init = &(struct clk_init_data){ | 255 | .hw.init = &(struct clk_init_data){ |
| 256 | .name = "fclk_div_div3", | 256 | .name = "fclk_div3_div", |
| 257 | .ops = &clk_fixed_factor_ops, | 257 | .ops = &clk_fixed_factor_ops, |
| 258 | .parent_names = (const char *[]){ "fixed_pll" }, | 258 | .parent_names = (const char *[]){ "fixed_pll" }, |
| 259 | .num_parents = 1, | 259 | .num_parents = 1, |
| @@ -632,7 +632,8 @@ static struct clk_regmap meson8b_cpu_clk = { | |||
| 632 | .hw.init = &(struct clk_init_data){ | 632 | .hw.init = &(struct clk_init_data){ |
| 633 | .name = "cpu_clk", | 633 | .name = "cpu_clk", |
| 634 | .ops = &clk_regmap_mux_ro_ops, | 634 | .ops = &clk_regmap_mux_ro_ops, |
| 635 | .parent_names = (const char *[]){ "xtal", "cpu_out_sel" }, | 635 | .parent_names = (const char *[]){ "xtal", |
| 636 | "cpu_scale_out_sel" }, | ||
| 636 | .num_parents = 2, | 637 | .num_parents = 2, |
| 637 | .flags = (CLK_SET_RATE_PARENT | | 638 | .flags = (CLK_SET_RATE_PARENT | |
| 638 | CLK_SET_RATE_NO_REPARENT), | 639 | CLK_SET_RATE_NO_REPARENT), |
diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index bc5fc1630876..b15115a48775 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c | |||
| @@ -126,6 +126,49 @@ static void cppc_cpufreq_stop_cpu(struct cpufreq_policy *policy) | |||
| 126 | cpu->perf_caps.lowest_perf, cpu_num, ret); | 126 | cpu->perf_caps.lowest_perf, cpu_num, ret); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | /* | ||
| 130 | * The PCC subspace describes the rate at which platform can accept commands | ||
| 131 | * on the shared PCC channel (including READs which do not count towards freq | ||
| 132 | * trasition requests), so ideally we need to use the PCC values as a fallback | ||
| 133 | * if we don't have a platform specific transition_delay_us | ||
| 134 | */ | ||
| 135 | #ifdef CONFIG_ARM64 | ||
| 136 | #include <asm/cputype.h> | ||
| 137 | |||
| 138 | static unsigned int cppc_cpufreq_get_transition_delay_us(int cpu) | ||
| 139 | { | ||
| 140 | unsigned long implementor = read_cpuid_implementor(); | ||
| 141 | unsigned long part_num = read_cpuid_part_number(); | ||
| 142 | unsigned int delay_us = 0; | ||
| 143 | |||
| 144 | switch (implementor) { | ||
| 145 | case ARM_CPU_IMP_QCOM: | ||
| 146 | switch (part_num) { | ||
| 147 | case QCOM_CPU_PART_FALKOR_V1: | ||
| 148 | case QCOM_CPU_PART_FALKOR: | ||
| 149 | delay_us = 10000; | ||
| 150 | break; | ||
| 151 | default: | ||
| 152 | delay_us = cppc_get_transition_latency(cpu) / NSEC_PER_USEC; | ||
| 153 | break; | ||
| 154 | } | ||
| 155 | break; | ||
| 156 | default: | ||
| 157 | delay_us = cppc_get_transition_latency(cpu) / NSEC_PER_USEC; | ||
| 158 | break; | ||
| 159 | } | ||
| 160 | |||
| 161 | return delay_us; | ||
| 162 | } | ||
| 163 | |||
| 164 | #else | ||
| 165 | |||
| 166 | static unsigned int cppc_cpufreq_get_transition_delay_us(int cpu) | ||
| 167 | { | ||
| 168 | return cppc_get_transition_latency(cpu) / NSEC_PER_USEC; | ||
| 169 | } | ||
| 170 | #endif | ||
| 171 | |||
| 129 | static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy) | 172 | static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy) |
| 130 | { | 173 | { |
| 131 | struct cppc_cpudata *cpu; | 174 | struct cppc_cpudata *cpu; |
| @@ -162,8 +205,7 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
| 162 | cpu->perf_caps.highest_perf; | 205 | cpu->perf_caps.highest_perf; |
| 163 | policy->cpuinfo.max_freq = cppc_dmi_max_khz; | 206 | policy->cpuinfo.max_freq = cppc_dmi_max_khz; |
| 164 | 207 | ||
| 165 | policy->transition_delay_us = cppc_get_transition_latency(cpu_num) / | 208 | policy->transition_delay_us = cppc_cpufreq_get_transition_delay_us(cpu_num); |
| 166 | NSEC_PER_USEC; | ||
| 167 | policy->shared_type = cpu->shared_type; | 209 | policy->shared_type = cpu->shared_type; |
| 168 | 210 | ||
| 169 | if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) { | 211 | if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) { |
diff --git a/drivers/gpu/drm/bridge/dumb-vga-dac.c b/drivers/gpu/drm/bridge/dumb-vga-dac.c index 498d5948d1a8..9837c8d69e69 100644 --- a/drivers/gpu/drm/bridge/dumb-vga-dac.c +++ b/drivers/gpu/drm/bridge/dumb-vga-dac.c | |||
| @@ -56,7 +56,9 @@ static int dumb_vga_get_modes(struct drm_connector *connector) | |||
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | drm_mode_connector_update_edid_property(connector, edid); | 58 | drm_mode_connector_update_edid_property(connector, edid); |
| 59 | return drm_add_edid_modes(connector, edid); | 59 | ret = drm_add_edid_modes(connector, edid); |
| 60 | kfree(edid); | ||
| 61 | return ret; | ||
| 60 | 62 | ||
| 61 | fallback: | 63 | fallback: |
| 62 | /* | 64 | /* |
diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c index 41e6c75a7f3c..f9550ea46c26 100644 --- a/drivers/gpu/drm/i915/intel_csr.c +++ b/drivers/gpu/drm/i915/intel_csr.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | */ | 35 | */ |
| 36 | 36 | ||
| 37 | #define I915_CSR_GLK "i915/glk_dmc_ver1_04.bin" | 37 | #define I915_CSR_GLK "i915/glk_dmc_ver1_04.bin" |
| 38 | MODULE_FIRMWARE(I915_CSR_GLK); | ||
| 38 | #define GLK_CSR_VERSION_REQUIRED CSR_VERSION(1, 4) | 39 | #define GLK_CSR_VERSION_REQUIRED CSR_VERSION(1, 4) |
| 39 | 40 | ||
| 40 | #define I915_CSR_CNL "i915/cnl_dmc_ver1_07.bin" | 41 | #define I915_CSR_CNL "i915/cnl_dmc_ver1_07.bin" |
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index bf4667481935..c61dff594195 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c | |||
| @@ -760,6 +760,7 @@ static irqreturn_t vc4_crtc_irq_handler(int irq, void *data) | |||
| 760 | struct vc4_async_flip_state { | 760 | struct vc4_async_flip_state { |
| 761 | struct drm_crtc *crtc; | 761 | struct drm_crtc *crtc; |
| 762 | struct drm_framebuffer *fb; | 762 | struct drm_framebuffer *fb; |
| 763 | struct drm_framebuffer *old_fb; | ||
| 763 | struct drm_pending_vblank_event *event; | 764 | struct drm_pending_vblank_event *event; |
| 764 | 765 | ||
| 765 | struct vc4_seqno_cb cb; | 766 | struct vc4_seqno_cb cb; |
| @@ -789,6 +790,23 @@ vc4_async_page_flip_complete(struct vc4_seqno_cb *cb) | |||
| 789 | 790 | ||
| 790 | drm_crtc_vblank_put(crtc); | 791 | drm_crtc_vblank_put(crtc); |
| 791 | drm_framebuffer_put(flip_state->fb); | 792 | drm_framebuffer_put(flip_state->fb); |
| 793 | |||
| 794 | /* Decrement the BO usecnt in order to keep the inc/dec calls balanced | ||
| 795 | * when the planes are updated through the async update path. | ||
| 796 | * FIXME: we should move to generic async-page-flip when it's | ||
| 797 | * available, so that we can get rid of this hand-made cleanup_fb() | ||
| 798 | * logic. | ||
| 799 | */ | ||
| 800 | if (flip_state->old_fb) { | ||
| 801 | struct drm_gem_cma_object *cma_bo; | ||
| 802 | struct vc4_bo *bo; | ||
| 803 | |||
| 804 | cma_bo = drm_fb_cma_get_gem_obj(flip_state->old_fb, 0); | ||
| 805 | bo = to_vc4_bo(&cma_bo->base); | ||
| 806 | vc4_bo_dec_usecnt(bo); | ||
| 807 | drm_framebuffer_put(flip_state->old_fb); | ||
| 808 | } | ||
| 809 | |||
| 792 | kfree(flip_state); | 810 | kfree(flip_state); |
| 793 | 811 | ||
| 794 | up(&vc4->async_modeset); | 812 | up(&vc4->async_modeset); |
| @@ -813,9 +831,22 @@ static int vc4_async_page_flip(struct drm_crtc *crtc, | |||
| 813 | struct drm_gem_cma_object *cma_bo = drm_fb_cma_get_gem_obj(fb, 0); | 831 | struct drm_gem_cma_object *cma_bo = drm_fb_cma_get_gem_obj(fb, 0); |
| 814 | struct vc4_bo *bo = to_vc4_bo(&cma_bo->base); | 832 | struct vc4_bo *bo = to_vc4_bo(&cma_bo->base); |
| 815 | 833 | ||
| 834 | /* Increment the BO usecnt here, so that we never end up with an | ||
| 835 | * unbalanced number of vc4_bo_{dec,inc}_usecnt() calls when the | ||
| 836 | * plane is later updated through the non-async path. | ||
| 837 | * FIXME: we should move to generic async-page-flip when it's | ||
| 838 | * available, so that we can get rid of this hand-made prepare_fb() | ||
| 839 | * logic. | ||
| 840 | */ | ||
| 841 | ret = vc4_bo_inc_usecnt(bo); | ||
| 842 | if (ret) | ||
| 843 | return ret; | ||
| 844 | |||
| 816 | flip_state = kzalloc(sizeof(*flip_state), GFP_KERNEL); | 845 | flip_state = kzalloc(sizeof(*flip_state), GFP_KERNEL); |
| 817 | if (!flip_state) | 846 | if (!flip_state) { |
| 847 | vc4_bo_dec_usecnt(bo); | ||
| 818 | return -ENOMEM; | 848 | return -ENOMEM; |
| 849 | } | ||
| 819 | 850 | ||
| 820 | drm_framebuffer_get(fb); | 851 | drm_framebuffer_get(fb); |
| 821 | flip_state->fb = fb; | 852 | flip_state->fb = fb; |
| @@ -826,10 +857,23 @@ static int vc4_async_page_flip(struct drm_crtc *crtc, | |||
| 826 | ret = down_interruptible(&vc4->async_modeset); | 857 | ret = down_interruptible(&vc4->async_modeset); |
| 827 | if (ret) { | 858 | if (ret) { |
| 828 | drm_framebuffer_put(fb); | 859 | drm_framebuffer_put(fb); |
| 860 | vc4_bo_dec_usecnt(bo); | ||
| 829 | kfree(flip_state); | 861 | kfree(flip_state); |
| 830 | return ret; | 862 | return ret; |
| 831 | } | 863 | } |
| 832 | 864 | ||
| 865 | /* Save the current FB before it's replaced by the new one in | ||
| 866 | * drm_atomic_set_fb_for_plane(). We'll need the old FB in | ||
| 867 | * vc4_async_page_flip_complete() to decrement the BO usecnt and keep | ||
| 868 | * it consistent. | ||
| 869 | * FIXME: we should move to generic async-page-flip when it's | ||
| 870 | * available, so that we can get rid of this hand-made cleanup_fb() | ||
| 871 | * logic. | ||
| 872 | */ | ||
| 873 | flip_state->old_fb = plane->state->fb; | ||
| 874 | if (flip_state->old_fb) | ||
| 875 | drm_framebuffer_get(flip_state->old_fb); | ||
| 876 | |||
| 833 | WARN_ON(drm_crtc_vblank_get(crtc) != 0); | 877 | WARN_ON(drm_crtc_vblank_get(crtc) != 0); |
| 834 | 878 | ||
| 835 | /* Immediately update the plane's legacy fb pointer, so that later | 879 | /* Immediately update the plane's legacy fb pointer, so that later |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c index 2582ffd36bb5..ba0cdb743c3e 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | |||
| @@ -441,11 +441,11 @@ static int vmwgfx_set_config_internal(struct drm_mode_set *set) | |||
| 441 | struct drm_crtc *crtc = set->crtc; | 441 | struct drm_crtc *crtc = set->crtc; |
| 442 | struct drm_framebuffer *fb; | 442 | struct drm_framebuffer *fb; |
| 443 | struct drm_crtc *tmp; | 443 | struct drm_crtc *tmp; |
| 444 | struct drm_modeset_acquire_ctx *ctx; | ||
| 445 | struct drm_device *dev = set->crtc->dev; | 444 | struct drm_device *dev = set->crtc->dev; |
| 445 | struct drm_modeset_acquire_ctx ctx; | ||
| 446 | int ret; | 446 | int ret; |
| 447 | 447 | ||
| 448 | ctx = dev->mode_config.acquire_ctx; | 448 | drm_modeset_acquire_init(&ctx, 0); |
| 449 | 449 | ||
| 450 | restart: | 450 | restart: |
| 451 | /* | 451 | /* |
| @@ -458,7 +458,7 @@ restart: | |||
| 458 | 458 | ||
| 459 | fb = set->fb; | 459 | fb = set->fb; |
| 460 | 460 | ||
| 461 | ret = crtc->funcs->set_config(set, ctx); | 461 | ret = crtc->funcs->set_config(set, &ctx); |
| 462 | if (ret == 0) { | 462 | if (ret == 0) { |
| 463 | crtc->primary->crtc = crtc; | 463 | crtc->primary->crtc = crtc; |
| 464 | crtc->primary->fb = fb; | 464 | crtc->primary->fb = fb; |
| @@ -473,20 +473,13 @@ restart: | |||
| 473 | } | 473 | } |
| 474 | 474 | ||
| 475 | if (ret == -EDEADLK) { | 475 | if (ret == -EDEADLK) { |
| 476 | dev->mode_config.acquire_ctx = NULL; | 476 | drm_modeset_backoff(&ctx); |
| 477 | |||
| 478 | retry_locking: | ||
| 479 | drm_modeset_backoff(ctx); | ||
| 480 | |||
| 481 | ret = drm_modeset_lock_all_ctx(dev, ctx); | ||
| 482 | if (ret) | ||
| 483 | goto retry_locking; | ||
| 484 | |||
| 485 | dev->mode_config.acquire_ctx = ctx; | ||
| 486 | |||
| 487 | goto restart; | 477 | goto restart; |
| 488 | } | 478 | } |
| 489 | 479 | ||
| 480 | drm_modeset_drop_locks(&ctx); | ||
| 481 | drm_modeset_acquire_fini(&ctx); | ||
| 482 | |||
| 490 | return ret; | 483 | return ret; |
| 491 | } | 484 | } |
| 492 | 485 | ||
| @@ -624,7 +617,6 @@ static int vmw_fb_set_par(struct fb_info *info) | |||
| 624 | } | 617 | } |
| 625 | 618 | ||
| 626 | mutex_lock(&par->bo_mutex); | 619 | mutex_lock(&par->bo_mutex); |
| 627 | drm_modeset_lock_all(vmw_priv->dev); | ||
| 628 | ret = vmw_fb_kms_framebuffer(info); | 620 | ret = vmw_fb_kms_framebuffer(info); |
| 629 | if (ret) | 621 | if (ret) |
| 630 | goto out_unlock; | 622 | goto out_unlock; |
| @@ -657,7 +649,6 @@ out_unlock: | |||
| 657 | drm_mode_destroy(vmw_priv->dev, old_mode); | 649 | drm_mode_destroy(vmw_priv->dev, old_mode); |
| 658 | par->set_mode = mode; | 650 | par->set_mode = mode; |
| 659 | 651 | ||
| 660 | drm_modeset_unlock_all(vmw_priv->dev); | ||
| 661 | mutex_unlock(&par->bo_mutex); | 652 | mutex_unlock(&par->bo_mutex); |
| 662 | 653 | ||
| 663 | return ret; | 654 | return ret; |
| @@ -713,18 +704,14 @@ int vmw_fb_init(struct vmw_private *vmw_priv) | |||
| 713 | par->max_width = fb_width; | 704 | par->max_width = fb_width; |
| 714 | par->max_height = fb_height; | 705 | par->max_height = fb_height; |
| 715 | 706 | ||
| 716 | drm_modeset_lock_all(vmw_priv->dev); | ||
| 717 | ret = vmw_kms_fbdev_init_data(vmw_priv, 0, par->max_width, | 707 | ret = vmw_kms_fbdev_init_data(vmw_priv, 0, par->max_width, |
| 718 | par->max_height, &par->con, | 708 | par->max_height, &par->con, |
| 719 | &par->crtc, &init_mode); | 709 | &par->crtc, &init_mode); |
| 720 | if (ret) { | 710 | if (ret) |
| 721 | drm_modeset_unlock_all(vmw_priv->dev); | ||
| 722 | goto err_kms; | 711 | goto err_kms; |
| 723 | } | ||
| 724 | 712 | ||
| 725 | info->var.xres = init_mode->hdisplay; | 713 | info->var.xres = init_mode->hdisplay; |
| 726 | info->var.yres = init_mode->vdisplay; | 714 | info->var.yres = init_mode->vdisplay; |
| 727 | drm_modeset_unlock_all(vmw_priv->dev); | ||
| 728 | 715 | ||
| 729 | /* | 716 | /* |
| 730 | * Create buffers and alloc memory | 717 | * Create buffers and alloc memory |
| @@ -832,7 +819,9 @@ int vmw_fb_close(struct vmw_private *vmw_priv) | |||
| 832 | cancel_delayed_work_sync(&par->local_work); | 819 | cancel_delayed_work_sync(&par->local_work); |
| 833 | unregister_framebuffer(info); | 820 | unregister_framebuffer(info); |
| 834 | 821 | ||
| 822 | mutex_lock(&par->bo_mutex); | ||
| 835 | (void) vmw_fb_kms_detach(par, true, true); | 823 | (void) vmw_fb_kms_detach(par, true, true); |
| 824 | mutex_unlock(&par->bo_mutex); | ||
| 836 | 825 | ||
| 837 | vfree(par->vmalloc); | 826 | vfree(par->vmalloc); |
| 838 | framebuffer_release(info); | 827 | framebuffer_release(info); |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index f11601b6fd74..96fd7a03d2f8 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | |||
| @@ -2595,6 +2595,7 @@ void vmw_kms_helper_resource_finish(struct vmw_validation_ctx *ctx, | |||
| 2595 | vmw_kms_helper_buffer_finish(res->dev_priv, NULL, ctx->buf, | 2595 | vmw_kms_helper_buffer_finish(res->dev_priv, NULL, ctx->buf, |
| 2596 | out_fence, NULL); | 2596 | out_fence, NULL); |
| 2597 | 2597 | ||
| 2598 | vmw_dmabuf_unreference(&ctx->buf); | ||
| 2598 | vmw_resource_unreserve(res, false, NULL, 0); | 2599 | vmw_resource_unreserve(res, false, NULL, 0); |
| 2599 | mutex_unlock(&res->dev_priv->cmdbuf_mutex); | 2600 | mutex_unlock(&res->dev_priv->cmdbuf_mutex); |
| 2600 | } | 2601 | } |
| @@ -2680,7 +2681,9 @@ int vmw_kms_fbdev_init_data(struct vmw_private *dev_priv, | |||
| 2680 | struct vmw_display_unit *du; | 2681 | struct vmw_display_unit *du; |
| 2681 | struct drm_display_mode *mode; | 2682 | struct drm_display_mode *mode; |
| 2682 | int i = 0; | 2683 | int i = 0; |
| 2684 | int ret = 0; | ||
| 2683 | 2685 | ||
| 2686 | mutex_lock(&dev_priv->dev->mode_config.mutex); | ||
| 2684 | list_for_each_entry(con, &dev_priv->dev->mode_config.connector_list, | 2687 | list_for_each_entry(con, &dev_priv->dev->mode_config.connector_list, |
| 2685 | head) { | 2688 | head) { |
| 2686 | if (i == unit) | 2689 | if (i == unit) |
| @@ -2691,7 +2694,8 @@ int vmw_kms_fbdev_init_data(struct vmw_private *dev_priv, | |||
| 2691 | 2694 | ||
| 2692 | if (i != unit) { | 2695 | if (i != unit) { |
| 2693 | DRM_ERROR("Could not find initial display unit.\n"); | 2696 | DRM_ERROR("Could not find initial display unit.\n"); |
| 2694 | return -EINVAL; | 2697 | ret = -EINVAL; |
| 2698 | goto out_unlock; | ||
| 2695 | } | 2699 | } |
| 2696 | 2700 | ||
| 2697 | if (list_empty(&con->modes)) | 2701 | if (list_empty(&con->modes)) |
| @@ -2699,7 +2703,8 @@ int vmw_kms_fbdev_init_data(struct vmw_private *dev_priv, | |||
| 2699 | 2703 | ||
| 2700 | if (list_empty(&con->modes)) { | 2704 | if (list_empty(&con->modes)) { |
| 2701 | DRM_ERROR("Could not find initial display mode.\n"); | 2705 | DRM_ERROR("Could not find initial display mode.\n"); |
| 2702 | return -EINVAL; | 2706 | ret = -EINVAL; |
| 2707 | goto out_unlock; | ||
| 2703 | } | 2708 | } |
| 2704 | 2709 | ||
| 2705 | du = vmw_connector_to_du(con); | 2710 | du = vmw_connector_to_du(con); |
| @@ -2720,7 +2725,10 @@ int vmw_kms_fbdev_init_data(struct vmw_private *dev_priv, | |||
| 2720 | head); | 2725 | head); |
| 2721 | } | 2726 | } |
| 2722 | 2727 | ||
| 2723 | return 0; | 2728 | out_unlock: |
| 2729 | mutex_unlock(&dev_priv->dev->mode_config.mutex); | ||
| 2730 | |||
| 2731 | return ret; | ||
| 2724 | } | 2732 | } |
| 2725 | 2733 | ||
| 2726 | /** | 2734 | /** |
diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig index ee270e065ba9..2a972ed6851b 100644 --- a/drivers/infiniband/Kconfig +++ b/drivers/infiniband/Kconfig | |||
| @@ -61,9 +61,12 @@ config INFINIBAND_ON_DEMAND_PAGING | |||
| 61 | pages on demand instead. | 61 | pages on demand instead. |
| 62 | 62 | ||
| 63 | config INFINIBAND_ADDR_TRANS | 63 | config INFINIBAND_ADDR_TRANS |
| 64 | bool | 64 | bool "RDMA/CM" |
| 65 | depends on INFINIBAND | 65 | depends on INFINIBAND |
| 66 | default y | 66 | default y |
| 67 | ---help--- | ||
| 68 | Support for RDMA communication manager (CM). | ||
| 69 | This allows for a generic connection abstraction over RDMA. | ||
| 67 | 70 | ||
| 68 | config INFINIBAND_ADDR_TRANS_CONFIGFS | 71 | config INFINIBAND_ADDR_TRANS_CONFIGFS |
| 69 | bool | 72 | bool |
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index e337b08de2ff..fb2d347f760f 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c | |||
| @@ -291,14 +291,18 @@ static int find_gid(struct ib_gid_table *table, const union ib_gid *gid, | |||
| 291 | * so lookup free slot only if requested. | 291 | * so lookup free slot only if requested. |
| 292 | */ | 292 | */ |
| 293 | if (pempty && empty < 0) { | 293 | if (pempty && empty < 0) { |
| 294 | if (data->props & GID_TABLE_ENTRY_INVALID) { | 294 | if (data->props & GID_TABLE_ENTRY_INVALID && |
| 295 | /* Found an invalid (free) entry; allocate it */ | 295 | (default_gid == |
| 296 | if (data->props & GID_TABLE_ENTRY_DEFAULT) { | 296 | !!(data->props & GID_TABLE_ENTRY_DEFAULT))) { |
| 297 | if (default_gid) | 297 | /* |
| 298 | empty = curr_index; | 298 | * Found an invalid (free) entry; allocate it. |
| 299 | } else { | 299 | * If default GID is requested, then our |
| 300 | empty = curr_index; | 300 | * found slot must be one of the DEFAULT |
| 301 | } | 301 | * reserved slots or we fail. |
| 302 | * This ensures that only DEFAULT reserved | ||
| 303 | * slots are used for default property GIDs. | ||
| 304 | */ | ||
| 305 | empty = curr_index; | ||
| 302 | } | 306 | } |
| 303 | } | 307 | } |
| 304 | 308 | ||
| @@ -420,8 +424,10 @@ int ib_cache_gid_add(struct ib_device *ib_dev, u8 port, | |||
| 420 | return ret; | 424 | return ret; |
| 421 | } | 425 | } |
| 422 | 426 | ||
| 423 | int ib_cache_gid_del(struct ib_device *ib_dev, u8 port, | 427 | static int |
| 424 | union ib_gid *gid, struct ib_gid_attr *attr) | 428 | _ib_cache_gid_del(struct ib_device *ib_dev, u8 port, |
| 429 | union ib_gid *gid, struct ib_gid_attr *attr, | ||
| 430 | unsigned long mask, bool default_gid) | ||
| 425 | { | 431 | { |
| 426 | struct ib_gid_table *table; | 432 | struct ib_gid_table *table; |
| 427 | int ret = 0; | 433 | int ret = 0; |
| @@ -431,11 +437,7 @@ int ib_cache_gid_del(struct ib_device *ib_dev, u8 port, | |||
| 431 | 437 | ||
| 432 | mutex_lock(&table->lock); | 438 | mutex_lock(&table->lock); |
| 433 | 439 | ||
| 434 | ix = find_gid(table, gid, attr, false, | 440 | ix = find_gid(table, gid, attr, default_gid, mask, NULL); |
| 435 | GID_ATTR_FIND_MASK_GID | | ||
| 436 | GID_ATTR_FIND_MASK_GID_TYPE | | ||
| 437 | GID_ATTR_FIND_MASK_NETDEV, | ||
| 438 | NULL); | ||
| 439 | if (ix < 0) { | 441 | if (ix < 0) { |
| 440 | ret = -EINVAL; | 442 | ret = -EINVAL; |
| 441 | goto out_unlock; | 443 | goto out_unlock; |
| @@ -452,6 +454,17 @@ out_unlock: | |||
| 452 | return ret; | 454 | return ret; |
| 453 | } | 455 | } |
| 454 | 456 | ||
| 457 | int ib_cache_gid_del(struct ib_device *ib_dev, u8 port, | ||
| 458 | union ib_gid *gid, struct ib_gid_attr *attr) | ||
| 459 | { | ||
| 460 | unsigned long mask = GID_ATTR_FIND_MASK_GID | | ||
| 461 | GID_ATTR_FIND_MASK_GID_TYPE | | ||
| 462 | GID_ATTR_FIND_MASK_DEFAULT | | ||
| 463 | GID_ATTR_FIND_MASK_NETDEV; | ||
| 464 | |||
| 465 | return _ib_cache_gid_del(ib_dev, port, gid, attr, mask, false); | ||
| 466 | } | ||
| 467 | |||
| 455 | int ib_cache_gid_del_all_netdev_gids(struct ib_device *ib_dev, u8 port, | 468 | int ib_cache_gid_del_all_netdev_gids(struct ib_device *ib_dev, u8 port, |
| 456 | struct net_device *ndev) | 469 | struct net_device *ndev) |
| 457 | { | 470 | { |
| @@ -728,7 +741,7 @@ void ib_cache_gid_set_default_gid(struct ib_device *ib_dev, u8 port, | |||
| 728 | unsigned long gid_type_mask, | 741 | unsigned long gid_type_mask, |
| 729 | enum ib_cache_gid_default_mode mode) | 742 | enum ib_cache_gid_default_mode mode) |
| 730 | { | 743 | { |
| 731 | union ib_gid gid; | 744 | union ib_gid gid = { }; |
| 732 | struct ib_gid_attr gid_attr; | 745 | struct ib_gid_attr gid_attr; |
| 733 | struct ib_gid_table *table; | 746 | struct ib_gid_table *table; |
| 734 | unsigned int gid_type; | 747 | unsigned int gid_type; |
| @@ -736,7 +749,9 @@ void ib_cache_gid_set_default_gid(struct ib_device *ib_dev, u8 port, | |||
| 736 | 749 | ||
| 737 | table = ib_dev->cache.ports[port - rdma_start_port(ib_dev)].gid; | 750 | table = ib_dev->cache.ports[port - rdma_start_port(ib_dev)].gid; |
| 738 | 751 | ||
| 739 | make_default_gid(ndev, &gid); | 752 | mask = GID_ATTR_FIND_MASK_GID_TYPE | |
| 753 | GID_ATTR_FIND_MASK_DEFAULT | | ||
| 754 | GID_ATTR_FIND_MASK_NETDEV; | ||
| 740 | memset(&gid_attr, 0, sizeof(gid_attr)); | 755 | memset(&gid_attr, 0, sizeof(gid_attr)); |
| 741 | gid_attr.ndev = ndev; | 756 | gid_attr.ndev = ndev; |
| 742 | 757 | ||
| @@ -747,12 +762,12 @@ void ib_cache_gid_set_default_gid(struct ib_device *ib_dev, u8 port, | |||
| 747 | gid_attr.gid_type = gid_type; | 762 | gid_attr.gid_type = gid_type; |
| 748 | 763 | ||
| 749 | if (mode == IB_CACHE_GID_DEFAULT_MODE_SET) { | 764 | if (mode == IB_CACHE_GID_DEFAULT_MODE_SET) { |
| 750 | mask = GID_ATTR_FIND_MASK_GID_TYPE | | 765 | make_default_gid(ndev, &gid); |
| 751 | GID_ATTR_FIND_MASK_DEFAULT; | ||
| 752 | __ib_cache_gid_add(ib_dev, port, &gid, | 766 | __ib_cache_gid_add(ib_dev, port, &gid, |
| 753 | &gid_attr, mask, true); | 767 | &gid_attr, mask, true); |
| 754 | } else if (mode == IB_CACHE_GID_DEFAULT_MODE_DELETE) { | 768 | } else if (mode == IB_CACHE_GID_DEFAULT_MODE_DELETE) { |
| 755 | ib_cache_gid_del(ib_dev, port, &gid, &gid_attr); | 769 | _ib_cache_gid_del(ib_dev, port, &gid, |
| 770 | &gid_attr, mask, true); | ||
| 756 | } | 771 | } |
| 757 | } | 772 | } |
| 758 | } | 773 | } |
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 51a641002e10..a693fcd4c513 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c | |||
| @@ -382,6 +382,8 @@ struct cma_hdr { | |||
| 382 | #define CMA_VERSION 0x00 | 382 | #define CMA_VERSION 0x00 |
| 383 | 383 | ||
| 384 | struct cma_req_info { | 384 | struct cma_req_info { |
| 385 | struct sockaddr_storage listen_addr_storage; | ||
| 386 | struct sockaddr_storage src_addr_storage; | ||
| 385 | struct ib_device *device; | 387 | struct ib_device *device; |
| 386 | int port; | 388 | int port; |
| 387 | union ib_gid local_gid; | 389 | union ib_gid local_gid; |
| @@ -866,7 +868,6 @@ static int cma_modify_qp_rtr(struct rdma_id_private *id_priv, | |||
| 866 | { | 868 | { |
| 867 | struct ib_qp_attr qp_attr; | 869 | struct ib_qp_attr qp_attr; |
| 868 | int qp_attr_mask, ret; | 870 | int qp_attr_mask, ret; |
| 869 | union ib_gid sgid; | ||
| 870 | 871 | ||
| 871 | mutex_lock(&id_priv->qp_mutex); | 872 | mutex_lock(&id_priv->qp_mutex); |
| 872 | if (!id_priv->id.qp) { | 873 | if (!id_priv->id.qp) { |
| @@ -889,12 +890,6 @@ static int cma_modify_qp_rtr(struct rdma_id_private *id_priv, | |||
| 889 | if (ret) | 890 | if (ret) |
| 890 | goto out; | 891 | goto out; |
| 891 | 892 | ||
| 892 | ret = ib_query_gid(id_priv->id.device, id_priv->id.port_num, | ||
| 893 | rdma_ah_read_grh(&qp_attr.ah_attr)->sgid_index, | ||
| 894 | &sgid, NULL); | ||
| 895 | if (ret) | ||
| 896 | goto out; | ||
| 897 | |||
| 898 | BUG_ON(id_priv->cma_dev->device != id_priv->id.device); | 893 | BUG_ON(id_priv->cma_dev->device != id_priv->id.device); |
| 899 | 894 | ||
| 900 | if (conn_param) | 895 | if (conn_param) |
| @@ -1340,11 +1335,11 @@ static bool validate_net_dev(struct net_device *net_dev, | |||
| 1340 | } | 1335 | } |
| 1341 | 1336 | ||
| 1342 | static struct net_device *cma_get_net_dev(struct ib_cm_event *ib_event, | 1337 | static struct net_device *cma_get_net_dev(struct ib_cm_event *ib_event, |
| 1343 | const struct cma_req_info *req) | 1338 | struct cma_req_info *req) |
| 1344 | { | 1339 | { |
| 1345 | struct sockaddr_storage listen_addr_storage, src_addr_storage; | 1340 | struct sockaddr *listen_addr = |
| 1346 | struct sockaddr *listen_addr = (struct sockaddr *)&listen_addr_storage, | 1341 | (struct sockaddr *)&req->listen_addr_storage; |
| 1347 | *src_addr = (struct sockaddr *)&src_addr_storage; | 1342 | struct sockaddr *src_addr = (struct sockaddr *)&req->src_addr_storage; |
| 1348 | struct net_device *net_dev; | 1343 | struct net_device *net_dev; |
| 1349 | const union ib_gid *gid = req->has_gid ? &req->local_gid : NULL; | 1344 | const union ib_gid *gid = req->has_gid ? &req->local_gid : NULL; |
| 1350 | int err; | 1345 | int err; |
| @@ -1359,11 +1354,6 @@ static struct net_device *cma_get_net_dev(struct ib_cm_event *ib_event, | |||
| 1359 | if (!net_dev) | 1354 | if (!net_dev) |
| 1360 | return ERR_PTR(-ENODEV); | 1355 | return ERR_PTR(-ENODEV); |
| 1361 | 1356 | ||
| 1362 | if (!validate_net_dev(net_dev, listen_addr, src_addr)) { | ||
| 1363 | dev_put(net_dev); | ||
| 1364 | return ERR_PTR(-EHOSTUNREACH); | ||
| 1365 | } | ||
| 1366 | |||
| 1367 | return net_dev; | 1357 | return net_dev; |
| 1368 | } | 1358 | } |
| 1369 | 1359 | ||
| @@ -1490,15 +1480,51 @@ static struct rdma_id_private *cma_id_from_event(struct ib_cm_id *cm_id, | |||
| 1490 | } | 1480 | } |
| 1491 | } | 1481 | } |
| 1492 | 1482 | ||
| 1483 | /* | ||
| 1484 | * Net namespace might be getting deleted while route lookup, | ||
| 1485 | * cm_id lookup is in progress. Therefore, perform netdevice | ||
| 1486 | * validation, cm_id lookup under rcu lock. | ||
| 1487 | * RCU lock along with netdevice state check, synchronizes with | ||
| 1488 | * netdevice migrating to different net namespace and also avoids | ||
| 1489 | * case where net namespace doesn't get deleted while lookup is in | ||
| 1490 | * progress. | ||
| 1491 | * If the device state is not IFF_UP, its properties such as ifindex | ||
| 1492 | * and nd_net cannot be trusted to remain valid without rcu lock. | ||
| 1493 | * net/core/dev.c change_net_namespace() ensures to synchronize with | ||
| 1494 | * ongoing operations on net device after device is closed using | ||
| 1495 | * synchronize_net(). | ||
| 1496 | */ | ||
| 1497 | rcu_read_lock(); | ||
| 1498 | if (*net_dev) { | ||
| 1499 | /* | ||
| 1500 | * If netdevice is down, it is likely that it is administratively | ||
| 1501 | * down or it might be migrating to different namespace. | ||
| 1502 | * In that case avoid further processing, as the net namespace | ||
| 1503 | * or ifindex may change. | ||
| 1504 | */ | ||
| 1505 | if (((*net_dev)->flags & IFF_UP) == 0) { | ||
| 1506 | id_priv = ERR_PTR(-EHOSTUNREACH); | ||
| 1507 | goto err; | ||
| 1508 | } | ||
| 1509 | |||
| 1510 | if (!validate_net_dev(*net_dev, | ||
| 1511 | (struct sockaddr *)&req.listen_addr_storage, | ||
| 1512 | (struct sockaddr *)&req.src_addr_storage)) { | ||
| 1513 | id_priv = ERR_PTR(-EHOSTUNREACH); | ||
| 1514 | goto err; | ||
| 1515 | } | ||
| 1516 | } | ||
| 1517 | |||
| 1493 | bind_list = cma_ps_find(*net_dev ? dev_net(*net_dev) : &init_net, | 1518 | bind_list = cma_ps_find(*net_dev ? dev_net(*net_dev) : &init_net, |
| 1494 | rdma_ps_from_service_id(req.service_id), | 1519 | rdma_ps_from_service_id(req.service_id), |
| 1495 | cma_port_from_service_id(req.service_id)); | 1520 | cma_port_from_service_id(req.service_id)); |
| 1496 | id_priv = cma_find_listener(bind_list, cm_id, ib_event, &req, *net_dev); | 1521 | id_priv = cma_find_listener(bind_list, cm_id, ib_event, &req, *net_dev); |
| 1522 | err: | ||
| 1523 | rcu_read_unlock(); | ||
| 1497 | if (IS_ERR(id_priv) && *net_dev) { | 1524 | if (IS_ERR(id_priv) && *net_dev) { |
| 1498 | dev_put(*net_dev); | 1525 | dev_put(*net_dev); |
| 1499 | *net_dev = NULL; | 1526 | *net_dev = NULL; |
| 1500 | } | 1527 | } |
| 1501 | |||
| 1502 | return id_priv; | 1528 | return id_priv; |
| 1503 | } | 1529 | } |
| 1504 | 1530 | ||
diff --git a/drivers/infiniband/core/iwpm_util.c b/drivers/infiniband/core/iwpm_util.c index 9821ae900f6d..da12da1c36f6 100644 --- a/drivers/infiniband/core/iwpm_util.c +++ b/drivers/infiniband/core/iwpm_util.c | |||
| @@ -114,7 +114,7 @@ int iwpm_create_mapinfo(struct sockaddr_storage *local_sockaddr, | |||
| 114 | struct sockaddr_storage *mapped_sockaddr, | 114 | struct sockaddr_storage *mapped_sockaddr, |
| 115 | u8 nl_client) | 115 | u8 nl_client) |
| 116 | { | 116 | { |
| 117 | struct hlist_head *hash_bucket_head; | 117 | struct hlist_head *hash_bucket_head = NULL; |
| 118 | struct iwpm_mapping_info *map_info; | 118 | struct iwpm_mapping_info *map_info; |
| 119 | unsigned long flags; | 119 | unsigned long flags; |
| 120 | int ret = -EINVAL; | 120 | int ret = -EINVAL; |
| @@ -142,6 +142,9 @@ int iwpm_create_mapinfo(struct sockaddr_storage *local_sockaddr, | |||
| 142 | } | 142 | } |
| 143 | } | 143 | } |
| 144 | spin_unlock_irqrestore(&iwpm_mapinfo_lock, flags); | 144 | spin_unlock_irqrestore(&iwpm_mapinfo_lock, flags); |
| 145 | |||
| 146 | if (!hash_bucket_head) | ||
| 147 | kfree(map_info); | ||
| 145 | return ret; | 148 | return ret; |
| 146 | } | 149 | } |
| 147 | 150 | ||
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index c50596f7f98a..b28452a55a08 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c | |||
| @@ -59,7 +59,7 @@ module_param_named(recv_queue_size, mad_recvq_size, int, 0444); | |||
| 59 | MODULE_PARM_DESC(recv_queue_size, "Size of receive queue in number of work requests"); | 59 | MODULE_PARM_DESC(recv_queue_size, "Size of receive queue in number of work requests"); |
| 60 | 60 | ||
| 61 | static struct list_head ib_mad_port_list; | 61 | static struct list_head ib_mad_port_list; |
| 62 | static u32 ib_mad_client_id = 0; | 62 | static atomic_t ib_mad_client_id = ATOMIC_INIT(0); |
| 63 | 63 | ||
| 64 | /* Port list lock */ | 64 | /* Port list lock */ |
| 65 | static DEFINE_SPINLOCK(ib_mad_port_list_lock); | 65 | static DEFINE_SPINLOCK(ib_mad_port_list_lock); |
| @@ -377,7 +377,7 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device, | |||
| 377 | } | 377 | } |
| 378 | 378 | ||
| 379 | spin_lock_irqsave(&port_priv->reg_lock, flags); | 379 | spin_lock_irqsave(&port_priv->reg_lock, flags); |
| 380 | mad_agent_priv->agent.hi_tid = ++ib_mad_client_id; | 380 | mad_agent_priv->agent.hi_tid = atomic_inc_return(&ib_mad_client_id); |
| 381 | 381 | ||
| 382 | /* | 382 | /* |
| 383 | * Make sure MAD registration (if supplied) | 383 | * Make sure MAD registration (if supplied) |
diff --git a/drivers/infiniband/core/roce_gid_mgmt.c b/drivers/infiniband/core/roce_gid_mgmt.c index cc2966380c0c..c0e4fd55e2cc 100644 --- a/drivers/infiniband/core/roce_gid_mgmt.c +++ b/drivers/infiniband/core/roce_gid_mgmt.c | |||
| @@ -255,6 +255,7 @@ static void bond_delete_netdev_default_gids(struct ib_device *ib_dev, | |||
| 255 | struct net_device *rdma_ndev) | 255 | struct net_device *rdma_ndev) |
| 256 | { | 256 | { |
| 257 | struct net_device *real_dev = rdma_vlan_dev_real_dev(event_ndev); | 257 | struct net_device *real_dev = rdma_vlan_dev_real_dev(event_ndev); |
| 258 | unsigned long gid_type_mask; | ||
| 258 | 259 | ||
| 259 | if (!rdma_ndev) | 260 | if (!rdma_ndev) |
| 260 | return; | 261 | return; |
| @@ -264,21 +265,22 @@ static void bond_delete_netdev_default_gids(struct ib_device *ib_dev, | |||
| 264 | 265 | ||
| 265 | rcu_read_lock(); | 266 | rcu_read_lock(); |
| 266 | 267 | ||
| 267 | if (rdma_is_upper_dev_rcu(rdma_ndev, event_ndev) && | 268 | if (((rdma_ndev != event_ndev && |
| 268 | is_eth_active_slave_of_bonding_rcu(rdma_ndev, real_dev) == | 269 | !rdma_is_upper_dev_rcu(rdma_ndev, event_ndev)) || |
| 269 | BONDING_SLAVE_STATE_INACTIVE) { | 270 | is_eth_active_slave_of_bonding_rcu(rdma_ndev, real_dev) |
| 270 | unsigned long gid_type_mask; | 271 | == |
| 271 | 272 | BONDING_SLAVE_STATE_INACTIVE)) { | |
| 272 | rcu_read_unlock(); | 273 | rcu_read_unlock(); |
| 274 | return; | ||
| 275 | } | ||
| 273 | 276 | ||
| 274 | gid_type_mask = roce_gid_type_mask_support(ib_dev, port); | 277 | rcu_read_unlock(); |
| 275 | 278 | ||
| 276 | ib_cache_gid_set_default_gid(ib_dev, port, rdma_ndev, | 279 | gid_type_mask = roce_gid_type_mask_support(ib_dev, port); |
| 277 | gid_type_mask, | 280 | |
| 278 | IB_CACHE_GID_DEFAULT_MODE_DELETE); | 281 | ib_cache_gid_set_default_gid(ib_dev, port, rdma_ndev, |
| 279 | } else { | 282 | gid_type_mask, |
| 280 | rcu_read_unlock(); | 283 | IB_CACHE_GID_DEFAULT_MODE_DELETE); |
| 281 | } | ||
| 282 | } | 284 | } |
| 283 | 285 | ||
| 284 | static void enum_netdev_ipv4_ips(struct ib_device *ib_dev, | 286 | static void enum_netdev_ipv4_ips(struct ib_device *ib_dev, |
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index 74329483af6d..eab43b17e9cf 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c | |||
| @@ -159,6 +159,23 @@ static void ucma_put_ctx(struct ucma_context *ctx) | |||
| 159 | complete(&ctx->comp); | 159 | complete(&ctx->comp); |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | /* | ||
| 163 | * Same as ucm_get_ctx but requires that ->cm_id->device is valid, eg that the | ||
| 164 | * CM_ID is bound. | ||
| 165 | */ | ||
| 166 | static struct ucma_context *ucma_get_ctx_dev(struct ucma_file *file, int id) | ||
| 167 | { | ||
| 168 | struct ucma_context *ctx = ucma_get_ctx(file, id); | ||
| 169 | |||
| 170 | if (IS_ERR(ctx)) | ||
| 171 | return ctx; | ||
| 172 | if (!ctx->cm_id->device) { | ||
| 173 | ucma_put_ctx(ctx); | ||
| 174 | return ERR_PTR(-EINVAL); | ||
| 175 | } | ||
| 176 | return ctx; | ||
| 177 | } | ||
| 178 | |||
| 162 | static void ucma_close_event_id(struct work_struct *work) | 179 | static void ucma_close_event_id(struct work_struct *work) |
| 163 | { | 180 | { |
| 164 | struct ucma_event *uevent_close = container_of(work, struct ucma_event, close_work); | 181 | struct ucma_event *uevent_close = container_of(work, struct ucma_event, close_work); |
| @@ -683,7 +700,7 @@ static ssize_t ucma_resolve_ip(struct ucma_file *file, | |||
| 683 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) | 700 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) |
| 684 | return -EFAULT; | 701 | return -EFAULT; |
| 685 | 702 | ||
| 686 | if (!rdma_addr_size_in6(&cmd.src_addr) || | 703 | if ((cmd.src_addr.sin6_family && !rdma_addr_size_in6(&cmd.src_addr)) || |
| 687 | !rdma_addr_size_in6(&cmd.dst_addr)) | 704 | !rdma_addr_size_in6(&cmd.dst_addr)) |
| 688 | return -EINVAL; | 705 | return -EINVAL; |
| 689 | 706 | ||
| @@ -734,7 +751,7 @@ static ssize_t ucma_resolve_route(struct ucma_file *file, | |||
| 734 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) | 751 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) |
| 735 | return -EFAULT; | 752 | return -EFAULT; |
| 736 | 753 | ||
| 737 | ctx = ucma_get_ctx(file, cmd.id); | 754 | ctx = ucma_get_ctx_dev(file, cmd.id); |
| 738 | if (IS_ERR(ctx)) | 755 | if (IS_ERR(ctx)) |
| 739 | return PTR_ERR(ctx); | 756 | return PTR_ERR(ctx); |
| 740 | 757 | ||
| @@ -1050,7 +1067,7 @@ static ssize_t ucma_connect(struct ucma_file *file, const char __user *inbuf, | |||
| 1050 | if (!cmd.conn_param.valid) | 1067 | if (!cmd.conn_param.valid) |
| 1051 | return -EINVAL; | 1068 | return -EINVAL; |
| 1052 | 1069 | ||
| 1053 | ctx = ucma_get_ctx(file, cmd.id); | 1070 | ctx = ucma_get_ctx_dev(file, cmd.id); |
| 1054 | if (IS_ERR(ctx)) | 1071 | if (IS_ERR(ctx)) |
| 1055 | return PTR_ERR(ctx); | 1072 | return PTR_ERR(ctx); |
| 1056 | 1073 | ||
| @@ -1092,7 +1109,7 @@ static ssize_t ucma_accept(struct ucma_file *file, const char __user *inbuf, | |||
| 1092 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) | 1109 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) |
| 1093 | return -EFAULT; | 1110 | return -EFAULT; |
| 1094 | 1111 | ||
| 1095 | ctx = ucma_get_ctx(file, cmd.id); | 1112 | ctx = ucma_get_ctx_dev(file, cmd.id); |
| 1096 | if (IS_ERR(ctx)) | 1113 | if (IS_ERR(ctx)) |
| 1097 | return PTR_ERR(ctx); | 1114 | return PTR_ERR(ctx); |
| 1098 | 1115 | ||
| @@ -1120,7 +1137,7 @@ static ssize_t ucma_reject(struct ucma_file *file, const char __user *inbuf, | |||
| 1120 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) | 1137 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) |
| 1121 | return -EFAULT; | 1138 | return -EFAULT; |
| 1122 | 1139 | ||
| 1123 | ctx = ucma_get_ctx(file, cmd.id); | 1140 | ctx = ucma_get_ctx_dev(file, cmd.id); |
| 1124 | if (IS_ERR(ctx)) | 1141 | if (IS_ERR(ctx)) |
| 1125 | return PTR_ERR(ctx); | 1142 | return PTR_ERR(ctx); |
| 1126 | 1143 | ||
| @@ -1139,7 +1156,7 @@ static ssize_t ucma_disconnect(struct ucma_file *file, const char __user *inbuf, | |||
| 1139 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) | 1156 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) |
| 1140 | return -EFAULT; | 1157 | return -EFAULT; |
| 1141 | 1158 | ||
| 1142 | ctx = ucma_get_ctx(file, cmd.id); | 1159 | ctx = ucma_get_ctx_dev(file, cmd.id); |
| 1143 | if (IS_ERR(ctx)) | 1160 | if (IS_ERR(ctx)) |
| 1144 | return PTR_ERR(ctx); | 1161 | return PTR_ERR(ctx); |
| 1145 | 1162 | ||
| @@ -1167,15 +1184,10 @@ static ssize_t ucma_init_qp_attr(struct ucma_file *file, | |||
| 1167 | if (cmd.qp_state > IB_QPS_ERR) | 1184 | if (cmd.qp_state > IB_QPS_ERR) |
| 1168 | return -EINVAL; | 1185 | return -EINVAL; |
| 1169 | 1186 | ||
| 1170 | ctx = ucma_get_ctx(file, cmd.id); | 1187 | ctx = ucma_get_ctx_dev(file, cmd.id); |
| 1171 | if (IS_ERR(ctx)) | 1188 | if (IS_ERR(ctx)) |
| 1172 | return PTR_ERR(ctx); | 1189 | return PTR_ERR(ctx); |
| 1173 | 1190 | ||
| 1174 | if (!ctx->cm_id->device) { | ||
| 1175 | ret = -EINVAL; | ||
| 1176 | goto out; | ||
| 1177 | } | ||
| 1178 | |||
| 1179 | resp.qp_attr_mask = 0; | 1191 | resp.qp_attr_mask = 0; |
| 1180 | memset(&qp_attr, 0, sizeof qp_attr); | 1192 | memset(&qp_attr, 0, sizeof qp_attr); |
| 1181 | qp_attr.qp_state = cmd.qp_state; | 1193 | qp_attr.qp_state = cmd.qp_state; |
| @@ -1316,13 +1328,13 @@ static ssize_t ucma_set_option(struct ucma_file *file, const char __user *inbuf, | |||
| 1316 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) | 1328 | if (copy_from_user(&cmd, inbuf, sizeof(cmd))) |
| 1317 | return -EFAULT; | 1329 | return -EFAULT; |
| 1318 | 1330 | ||
| 1331 | if (unlikely(cmd.optlen > KMALLOC_MAX_SIZE)) | ||
| 1332 | return -EINVAL; | ||
| 1333 | |||
| 1319 | ctx = ucma_get_ctx(file, cmd.id); | 1334 | ctx = ucma_get_ctx(file, cmd.id); |
| 1320 | if (IS_ERR(ctx)) | 1335 | if (IS_ERR(ctx)) |
| 1321 | return PTR_ERR(ctx); | 1336 | return PTR_ERR(ctx); |
| 1322 | 1337 | ||
| 1323 | if (unlikely(cmd.optlen > KMALLOC_MAX_SIZE)) | ||
| 1324 | return -EINVAL; | ||
| 1325 | |||
| 1326 | optval = memdup_user(u64_to_user_ptr(cmd.optval), | 1338 | optval = memdup_user(u64_to_user_ptr(cmd.optval), |
| 1327 | cmd.optlen); | 1339 | cmd.optlen); |
| 1328 | if (IS_ERR(optval)) { | 1340 | if (IS_ERR(optval)) { |
| @@ -1384,7 +1396,7 @@ static ssize_t ucma_process_join(struct ucma_file *file, | |||
| 1384 | else | 1396 | else |
| 1385 | return -EINVAL; | 1397 | return -EINVAL; |
| 1386 | 1398 | ||
| 1387 | ctx = ucma_get_ctx(file, cmd->id); | 1399 | ctx = ucma_get_ctx_dev(file, cmd->id); |
| 1388 | if (IS_ERR(ctx)) | 1400 | if (IS_ERR(ctx)) |
| 1389 | return PTR_ERR(ctx); | 1401 | return PTR_ERR(ctx); |
| 1390 | 1402 | ||
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 13cb5e4deb86..21a887c9523b 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c | |||
| @@ -691,6 +691,7 @@ ssize_t ib_uverbs_reg_mr(struct ib_uverbs_file *file, | |||
| 691 | 691 | ||
| 692 | mr->device = pd->device; | 692 | mr->device = pd->device; |
| 693 | mr->pd = pd; | 693 | mr->pd = pd; |
| 694 | mr->dm = NULL; | ||
| 694 | mr->uobject = uobj; | 695 | mr->uobject = uobj; |
| 695 | atomic_inc(&pd->usecnt); | 696 | atomic_inc(&pd->usecnt); |
| 696 | mr->res.type = RDMA_RESTRACK_MR; | 697 | mr->res.type = RDMA_RESTRACK_MR; |
| @@ -765,6 +766,11 @@ ssize_t ib_uverbs_rereg_mr(struct ib_uverbs_file *file, | |||
| 765 | 766 | ||
| 766 | mr = uobj->object; | 767 | mr = uobj->object; |
| 767 | 768 | ||
| 769 | if (mr->dm) { | ||
| 770 | ret = -EINVAL; | ||
| 771 | goto put_uobjs; | ||
| 772 | } | ||
| 773 | |||
| 768 | if (cmd.flags & IB_MR_REREG_ACCESS) { | 774 | if (cmd.flags & IB_MR_REREG_ACCESS) { |
| 769 | ret = ib_check_mr_access(cmd.access_flags); | 775 | ret = ib_check_mr_access(cmd.access_flags); |
| 770 | if (ret) | 776 | if (ret) |
diff --git a/drivers/infiniband/core/uverbs_ioctl.c b/drivers/infiniband/core/uverbs_ioctl.c index 8c93970dc8f1..8d32c4ae368c 100644 --- a/drivers/infiniband/core/uverbs_ioctl.c +++ b/drivers/infiniband/core/uverbs_ioctl.c | |||
| @@ -234,6 +234,15 @@ static int uverbs_validate_kernel_mandatory(const struct uverbs_method_spec *met | |||
| 234 | return -EINVAL; | 234 | return -EINVAL; |
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | for (; i < method_spec->num_buckets; i++) { | ||
| 238 | struct uverbs_attr_spec_hash *attr_spec_bucket = | ||
| 239 | method_spec->attr_buckets[i]; | ||
| 240 | |||
| 241 | if (!bitmap_empty(attr_spec_bucket->mandatory_attrs_bitmask, | ||
| 242 | attr_spec_bucket->num_attrs)) | ||
| 243 | return -EINVAL; | ||
| 244 | } | ||
| 245 | |||
| 237 | return 0; | 246 | return 0; |
| 238 | } | 247 | } |
| 239 | 248 | ||
diff --git a/drivers/infiniband/core/uverbs_std_types_flow_action.c b/drivers/infiniband/core/uverbs_std_types_flow_action.c index cbcec3da12f6..b4f016dfa23d 100644 --- a/drivers/infiniband/core/uverbs_std_types_flow_action.c +++ b/drivers/infiniband/core/uverbs_std_types_flow_action.c | |||
| @@ -363,28 +363,28 @@ static int UVERBS_HANDLER(UVERBS_METHOD_FLOW_ACTION_ESP_MODIFY)(struct ib_device | |||
| 363 | 363 | ||
| 364 | static const struct uverbs_attr_spec uverbs_flow_action_esp_keymat[] = { | 364 | static const struct uverbs_attr_spec uverbs_flow_action_esp_keymat[] = { |
| 365 | [IB_UVERBS_FLOW_ACTION_ESP_KEYMAT_AES_GCM] = { | 365 | [IB_UVERBS_FLOW_ACTION_ESP_KEYMAT_AES_GCM] = { |
| 366 | .ptr = { | 366 | { .ptr = { |
| 367 | .type = UVERBS_ATTR_TYPE_PTR_IN, | 367 | .type = UVERBS_ATTR_TYPE_PTR_IN, |
| 368 | UVERBS_ATTR_TYPE(struct ib_uverbs_flow_action_esp_keymat_aes_gcm), | 368 | UVERBS_ATTR_TYPE(struct ib_uverbs_flow_action_esp_keymat_aes_gcm), |
| 369 | .flags = UVERBS_ATTR_SPEC_F_MIN_SZ_OR_ZERO, | 369 | .flags = UVERBS_ATTR_SPEC_F_MIN_SZ_OR_ZERO, |
| 370 | }, | 370 | } }, |
| 371 | }, | 371 | }, |
| 372 | }; | 372 | }; |
| 373 | 373 | ||
| 374 | static const struct uverbs_attr_spec uverbs_flow_action_esp_replay[] = { | 374 | static const struct uverbs_attr_spec uverbs_flow_action_esp_replay[] = { |
| 375 | [IB_UVERBS_FLOW_ACTION_ESP_REPLAY_NONE] = { | 375 | [IB_UVERBS_FLOW_ACTION_ESP_REPLAY_NONE] = { |
| 376 | .ptr = { | 376 | { .ptr = { |
| 377 | .type = UVERBS_ATTR_TYPE_PTR_IN, | 377 | .type = UVERBS_ATTR_TYPE_PTR_IN, |
| 378 | /* No need to specify any data */ | 378 | /* No need to specify any data */ |
| 379 | .len = 0, | 379 | .len = 0, |
| 380 | } | 380 | } } |
| 381 | }, | 381 | }, |
| 382 | [IB_UVERBS_FLOW_ACTION_ESP_REPLAY_BMP] = { | 382 | [IB_UVERBS_FLOW_ACTION_ESP_REPLAY_BMP] = { |
| 383 | .ptr = { | 383 | { .ptr = { |
| 384 | .type = UVERBS_ATTR_TYPE_PTR_IN, | 384 | .type = UVERBS_ATTR_TYPE_PTR_IN, |
| 385 | UVERBS_ATTR_STRUCT(struct ib_uverbs_flow_action_esp_replay_bmp, size), | 385 | UVERBS_ATTR_STRUCT(struct ib_uverbs_flow_action_esp_replay_bmp, size), |
| 386 | .flags = UVERBS_ATTR_SPEC_F_MIN_SZ_OR_ZERO, | 386 | .flags = UVERBS_ATTR_SPEC_F_MIN_SZ_OR_ZERO, |
| 387 | } | 387 | } } |
| 388 | }, | 388 | }, |
| 389 | }; | 389 | }; |
| 390 | 390 | ||
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 7eff3aeffe01..6ddfb1fade79 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c | |||
| @@ -1656,6 +1656,7 @@ struct ib_mr *ib_alloc_mr(struct ib_pd *pd, | |||
| 1656 | if (!IS_ERR(mr)) { | 1656 | if (!IS_ERR(mr)) { |
| 1657 | mr->device = pd->device; | 1657 | mr->device = pd->device; |
| 1658 | mr->pd = pd; | 1658 | mr->pd = pd; |
| 1659 | mr->dm = NULL; | ||
| 1659 | mr->uobject = NULL; | 1660 | mr->uobject = NULL; |
| 1660 | atomic_inc(&pd->usecnt); | 1661 | atomic_inc(&pd->usecnt); |
| 1661 | mr->need_inval = false; | 1662 | mr->need_inval = false; |
diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c index 6f2b26126c64..2be2e1ac1b5f 100644 --- a/drivers/infiniband/hw/cxgb4/cq.c +++ b/drivers/infiniband/hw/cxgb4/cq.c | |||
| @@ -315,7 +315,7 @@ static void advance_oldest_read(struct t4_wq *wq) | |||
| 315 | * Deal with out-of-order and/or completions that complete | 315 | * Deal with out-of-order and/or completions that complete |
| 316 | * prior unsignalled WRs. | 316 | * prior unsignalled WRs. |
| 317 | */ | 317 | */ |
| 318 | void c4iw_flush_hw_cq(struct c4iw_cq *chp) | 318 | void c4iw_flush_hw_cq(struct c4iw_cq *chp, struct c4iw_qp *flush_qhp) |
| 319 | { | 319 | { |
| 320 | struct t4_cqe *hw_cqe, *swcqe, read_cqe; | 320 | struct t4_cqe *hw_cqe, *swcqe, read_cqe; |
| 321 | struct c4iw_qp *qhp; | 321 | struct c4iw_qp *qhp; |
| @@ -339,6 +339,13 @@ void c4iw_flush_hw_cq(struct c4iw_cq *chp) | |||
| 339 | if (qhp == NULL) | 339 | if (qhp == NULL) |
| 340 | goto next_cqe; | 340 | goto next_cqe; |
| 341 | 341 | ||
| 342 | if (flush_qhp != qhp) { | ||
| 343 | spin_lock(&qhp->lock); | ||
| 344 | |||
| 345 | if (qhp->wq.flushed == 1) | ||
| 346 | goto next_cqe; | ||
| 347 | } | ||
| 348 | |||
| 342 | if (CQE_OPCODE(hw_cqe) == FW_RI_TERMINATE) | 349 | if (CQE_OPCODE(hw_cqe) == FW_RI_TERMINATE) |
| 343 | goto next_cqe; | 350 | goto next_cqe; |
| 344 | 351 | ||
| @@ -390,6 +397,8 @@ void c4iw_flush_hw_cq(struct c4iw_cq *chp) | |||
| 390 | next_cqe: | 397 | next_cqe: |
| 391 | t4_hwcq_consume(&chp->cq); | 398 | t4_hwcq_consume(&chp->cq); |
| 392 | ret = t4_next_hw_cqe(&chp->cq, &hw_cqe); | 399 | ret = t4_next_hw_cqe(&chp->cq, &hw_cqe); |
| 400 | if (qhp && flush_qhp != qhp) | ||
| 401 | spin_unlock(&qhp->lock); | ||
| 393 | } | 402 | } |
| 394 | } | 403 | } |
| 395 | 404 | ||
diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c index feeb8ee6f4a2..44161ca4d2a8 100644 --- a/drivers/infiniband/hw/cxgb4/device.c +++ b/drivers/infiniband/hw/cxgb4/device.c | |||
| @@ -875,6 +875,11 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev) | |||
| 875 | 875 | ||
| 876 | rdev->status_page->db_off = 0; | 876 | rdev->status_page->db_off = 0; |
| 877 | 877 | ||
| 878 | init_completion(&rdev->rqt_compl); | ||
| 879 | init_completion(&rdev->pbl_compl); | ||
| 880 | kref_init(&rdev->rqt_kref); | ||
| 881 | kref_init(&rdev->pbl_kref); | ||
| 882 | |||
| 878 | return 0; | 883 | return 0; |
| 879 | err_free_status_page_and_wr_log: | 884 | err_free_status_page_and_wr_log: |
| 880 | if (c4iw_wr_log && rdev->wr_log) | 885 | if (c4iw_wr_log && rdev->wr_log) |
| @@ -893,13 +898,15 @@ destroy_resource: | |||
| 893 | 898 | ||
| 894 | static void c4iw_rdev_close(struct c4iw_rdev *rdev) | 899 | static void c4iw_rdev_close(struct c4iw_rdev *rdev) |
| 895 | { | 900 | { |
| 896 | destroy_workqueue(rdev->free_workq); | ||
| 897 | kfree(rdev->wr_log); | 901 | kfree(rdev->wr_log); |
| 898 | c4iw_release_dev_ucontext(rdev, &rdev->uctx); | 902 | c4iw_release_dev_ucontext(rdev, &rdev->uctx); |
| 899 | free_page((unsigned long)rdev->status_page); | 903 | free_page((unsigned long)rdev->status_page); |
| 900 | c4iw_pblpool_destroy(rdev); | 904 | c4iw_pblpool_destroy(rdev); |
| 901 | c4iw_rqtpool_destroy(rdev); | 905 | c4iw_rqtpool_destroy(rdev); |
| 906 | wait_for_completion(&rdev->pbl_compl); | ||
| 907 | wait_for_completion(&rdev->rqt_compl); | ||
| 902 | c4iw_ocqp_pool_destroy(rdev); | 908 | c4iw_ocqp_pool_destroy(rdev); |
| 909 | destroy_workqueue(rdev->free_workq); | ||
| 903 | c4iw_destroy_resource(&rdev->resource); | 910 | c4iw_destroy_resource(&rdev->resource); |
| 904 | } | 911 | } |
| 905 | 912 | ||
diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h index cc929002c05e..831027717121 100644 --- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h +++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h | |||
| @@ -185,6 +185,10 @@ struct c4iw_rdev { | |||
| 185 | struct wr_log_entry *wr_log; | 185 | struct wr_log_entry *wr_log; |
| 186 | int wr_log_size; | 186 | int wr_log_size; |
| 187 | struct workqueue_struct *free_workq; | 187 | struct workqueue_struct *free_workq; |
| 188 | struct completion rqt_compl; | ||
| 189 | struct completion pbl_compl; | ||
| 190 | struct kref rqt_kref; | ||
| 191 | struct kref pbl_kref; | ||
| 188 | }; | 192 | }; |
| 189 | 193 | ||
| 190 | static inline int c4iw_fatal_error(struct c4iw_rdev *rdev) | 194 | static inline int c4iw_fatal_error(struct c4iw_rdev *rdev) |
| @@ -1049,7 +1053,7 @@ u32 c4iw_pblpool_alloc(struct c4iw_rdev *rdev, int size); | |||
| 1049 | void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 addr, int size); | 1053 | void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 addr, int size); |
| 1050 | u32 c4iw_ocqp_pool_alloc(struct c4iw_rdev *rdev, int size); | 1054 | u32 c4iw_ocqp_pool_alloc(struct c4iw_rdev *rdev, int size); |
| 1051 | void c4iw_ocqp_pool_free(struct c4iw_rdev *rdev, u32 addr, int size); | 1055 | void c4iw_ocqp_pool_free(struct c4iw_rdev *rdev, u32 addr, int size); |
| 1052 | void c4iw_flush_hw_cq(struct c4iw_cq *chp); | 1056 | void c4iw_flush_hw_cq(struct c4iw_cq *chp, struct c4iw_qp *flush_qhp); |
| 1053 | void c4iw_count_rcqes(struct t4_cq *cq, struct t4_wq *wq, int *count); | 1057 | void c4iw_count_rcqes(struct t4_cq *cq, struct t4_wq *wq, int *count); |
| 1054 | int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp); | 1058 | int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp); |
| 1055 | int c4iw_flush_rq(struct t4_wq *wq, struct t4_cq *cq, int count); | 1059 | int c4iw_flush_rq(struct t4_wq *wq, struct t4_cq *cq, int count); |
diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c index de77b6027d69..ae167b686608 100644 --- a/drivers/infiniband/hw/cxgb4/qp.c +++ b/drivers/infiniband/hw/cxgb4/qp.c | |||
| @@ -1343,12 +1343,12 @@ static void __flush_qp(struct c4iw_qp *qhp, struct c4iw_cq *rchp, | |||
| 1343 | qhp->wq.flushed = 1; | 1343 | qhp->wq.flushed = 1; |
| 1344 | t4_set_wq_in_error(&qhp->wq); | 1344 | t4_set_wq_in_error(&qhp->wq); |
| 1345 | 1345 | ||
| 1346 | c4iw_flush_hw_cq(rchp); | 1346 | c4iw_flush_hw_cq(rchp, qhp); |
| 1347 | c4iw_count_rcqes(&rchp->cq, &qhp->wq, &count); | 1347 | c4iw_count_rcqes(&rchp->cq, &qhp->wq, &count); |
| 1348 | rq_flushed = c4iw_flush_rq(&qhp->wq, &rchp->cq, count); | 1348 | rq_flushed = c4iw_flush_rq(&qhp->wq, &rchp->cq, count); |
| 1349 | 1349 | ||
| 1350 | if (schp != rchp) | 1350 | if (schp != rchp) |
| 1351 | c4iw_flush_hw_cq(schp); | 1351 | c4iw_flush_hw_cq(schp, qhp); |
| 1352 | sq_flushed = c4iw_flush_sq(qhp); | 1352 | sq_flushed = c4iw_flush_sq(qhp); |
| 1353 | 1353 | ||
| 1354 | spin_unlock(&qhp->lock); | 1354 | spin_unlock(&qhp->lock); |
diff --git a/drivers/infiniband/hw/cxgb4/resource.c b/drivers/infiniband/hw/cxgb4/resource.c index 3cf25997ed2b..0ef25ae05e6f 100644 --- a/drivers/infiniband/hw/cxgb4/resource.c +++ b/drivers/infiniband/hw/cxgb4/resource.c | |||
| @@ -260,12 +260,22 @@ u32 c4iw_pblpool_alloc(struct c4iw_rdev *rdev, int size) | |||
| 260 | rdev->stats.pbl.cur += roundup(size, 1 << MIN_PBL_SHIFT); | 260 | rdev->stats.pbl.cur += roundup(size, 1 << MIN_PBL_SHIFT); |
| 261 | if (rdev->stats.pbl.cur > rdev->stats.pbl.max) | 261 | if (rdev->stats.pbl.cur > rdev->stats.pbl.max) |
| 262 | rdev->stats.pbl.max = rdev->stats.pbl.cur; | 262 | rdev->stats.pbl.max = rdev->stats.pbl.cur; |
| 263 | kref_get(&rdev->pbl_kref); | ||
| 263 | } else | 264 | } else |
| 264 | rdev->stats.pbl.fail++; | 265 | rdev->stats.pbl.fail++; |
| 265 | mutex_unlock(&rdev->stats.lock); | 266 | mutex_unlock(&rdev->stats.lock); |
| 266 | return (u32)addr; | 267 | return (u32)addr; |
| 267 | } | 268 | } |
| 268 | 269 | ||
| 270 | static void destroy_pblpool(struct kref *kref) | ||
| 271 | { | ||
| 272 | struct c4iw_rdev *rdev; | ||
| 273 | |||
| 274 | rdev = container_of(kref, struct c4iw_rdev, pbl_kref); | ||
| 275 | gen_pool_destroy(rdev->pbl_pool); | ||
| 276 | complete(&rdev->pbl_compl); | ||
| 277 | } | ||
| 278 | |||
| 269 | void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 addr, int size) | 279 | void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 addr, int size) |
| 270 | { | 280 | { |
| 271 | pr_debug("addr 0x%x size %d\n", addr, size); | 281 | pr_debug("addr 0x%x size %d\n", addr, size); |
| @@ -273,6 +283,7 @@ void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 addr, int size) | |||
| 273 | rdev->stats.pbl.cur -= roundup(size, 1 << MIN_PBL_SHIFT); | 283 | rdev->stats.pbl.cur -= roundup(size, 1 << MIN_PBL_SHIFT); |
| 274 | mutex_unlock(&rdev->stats.lock); | 284 | mutex_unlock(&rdev->stats.lock); |
| 275 | gen_pool_free(rdev->pbl_pool, (unsigned long)addr, size); | 285 | gen_pool_free(rdev->pbl_pool, (unsigned long)addr, size); |
| 286 | kref_put(&rdev->pbl_kref, destroy_pblpool); | ||
| 276 | } | 287 | } |
| 277 | 288 | ||
| 278 | int c4iw_pblpool_create(struct c4iw_rdev *rdev) | 289 | int c4iw_pblpool_create(struct c4iw_rdev *rdev) |
| @@ -310,7 +321,7 @@ int c4iw_pblpool_create(struct c4iw_rdev *rdev) | |||
| 310 | 321 | ||
| 311 | void c4iw_pblpool_destroy(struct c4iw_rdev *rdev) | 322 | void c4iw_pblpool_destroy(struct c4iw_rdev *rdev) |
| 312 | { | 323 | { |
| 313 | gen_pool_destroy(rdev->pbl_pool); | 324 | kref_put(&rdev->pbl_kref, destroy_pblpool); |
| 314 | } | 325 | } |
| 315 | 326 | ||
| 316 | /* | 327 | /* |
| @@ -331,12 +342,22 @@ u32 c4iw_rqtpool_alloc(struct c4iw_rdev *rdev, int size) | |||
| 331 | rdev->stats.rqt.cur += roundup(size << 6, 1 << MIN_RQT_SHIFT); | 342 | rdev->stats.rqt.cur += roundup(size << 6, 1 << MIN_RQT_SHIFT); |
| 332 | if (rdev->stats.rqt.cur > rdev->stats.rqt.max) | 343 | if (rdev->stats.rqt.cur > rdev->stats.rqt.max) |
| 333 | rdev->stats.rqt.max = rdev->stats.rqt.cur; | 344 | rdev->stats.rqt.max = rdev->stats.rqt.cur; |
| 345 | kref_get(&rdev->rqt_kref); | ||
| 334 | } else | 346 | } else |
| 335 | rdev->stats.rqt.fail++; | 347 | rdev->stats.rqt.fail++; |
| 336 | mutex_unlock(&rdev->stats.lock); | 348 | mutex_unlock(&rdev->stats.lock); |
| 337 | return (u32)addr; | 349 | return (u32)addr; |
| 338 | } | 350 | } |
| 339 | 351 | ||
| 352 | static void destroy_rqtpool(struct kref *kref) | ||
| 353 | { | ||
| 354 | struct c4iw_rdev *rdev; | ||
| 355 | |||
| 356 | rdev = container_of(kref, struct c4iw_rdev, rqt_kref); | ||
| 357 | gen_pool_destroy(rdev->rqt_pool); | ||
| 358 | complete(&rdev->rqt_compl); | ||
| 359 | } | ||
| 360 | |||
| 340 | void c4iw_rqtpool_free(struct c4iw_rdev *rdev, u32 addr, int size) | 361 | void c4iw_rqtpool_free(struct c4iw_rdev *rdev, u32 addr, int size) |
| 341 | { | 362 | { |
| 342 | pr_debug("addr 0x%x size %d\n", addr, size << 6); | 363 | pr_debug("addr 0x%x size %d\n", addr, size << 6); |
| @@ -344,6 +365,7 @@ void c4iw_rqtpool_free(struct c4iw_rdev *rdev, u32 addr, int size) | |||
| 344 | rdev->stats.rqt.cur -= roundup(size << 6, 1 << MIN_RQT_SHIFT); | 365 | rdev->stats.rqt.cur -= roundup(size << 6, 1 << MIN_RQT_SHIFT); |
| 345 | mutex_unlock(&rdev->stats.lock); | 366 | mutex_unlock(&rdev->stats.lock); |
| 346 | gen_pool_free(rdev->rqt_pool, (unsigned long)addr, size << 6); | 367 | gen_pool_free(rdev->rqt_pool, (unsigned long)addr, size << 6); |
| 368 | kref_put(&rdev->rqt_kref, destroy_rqtpool); | ||
| 347 | } | 369 | } |
| 348 | 370 | ||
| 349 | int c4iw_rqtpool_create(struct c4iw_rdev *rdev) | 371 | int c4iw_rqtpool_create(struct c4iw_rdev *rdev) |
| @@ -380,7 +402,7 @@ int c4iw_rqtpool_create(struct c4iw_rdev *rdev) | |||
| 380 | 402 | ||
| 381 | void c4iw_rqtpool_destroy(struct c4iw_rdev *rdev) | 403 | void c4iw_rqtpool_destroy(struct c4iw_rdev *rdev) |
| 382 | { | 404 | { |
| 383 | gen_pool_destroy(rdev->rqt_pool); | 405 | kref_put(&rdev->rqt_kref, destroy_rqtpool); |
| 384 | } | 406 | } |
| 385 | 407 | ||
| 386 | /* | 408 | /* |
diff --git a/drivers/infiniband/hw/hfi1/affinity.c b/drivers/infiniband/hw/hfi1/affinity.c index a97055dd4fbd..b5fab55cc275 100644 --- a/drivers/infiniband/hw/hfi1/affinity.c +++ b/drivers/infiniband/hw/hfi1/affinity.c | |||
| @@ -412,7 +412,6 @@ static void hfi1_cleanup_sdma_notifier(struct hfi1_msix_entry *msix) | |||
| 412 | static int get_irq_affinity(struct hfi1_devdata *dd, | 412 | static int get_irq_affinity(struct hfi1_devdata *dd, |
| 413 | struct hfi1_msix_entry *msix) | 413 | struct hfi1_msix_entry *msix) |
| 414 | { | 414 | { |
| 415 | int ret; | ||
| 416 | cpumask_var_t diff; | 415 | cpumask_var_t diff; |
| 417 | struct hfi1_affinity_node *entry; | 416 | struct hfi1_affinity_node *entry; |
| 418 | struct cpu_mask_set *set = NULL; | 417 | struct cpu_mask_set *set = NULL; |
| @@ -424,10 +423,6 @@ static int get_irq_affinity(struct hfi1_devdata *dd, | |||
| 424 | extra[0] = '\0'; | 423 | extra[0] = '\0'; |
| 425 | cpumask_clear(&msix->mask); | 424 | cpumask_clear(&msix->mask); |
| 426 | 425 | ||
| 427 | ret = zalloc_cpumask_var(&diff, GFP_KERNEL); | ||
| 428 | if (!ret) | ||
| 429 | return -ENOMEM; | ||
| 430 | |||
| 431 | entry = node_affinity_lookup(dd->node); | 426 | entry = node_affinity_lookup(dd->node); |
| 432 | 427 | ||
| 433 | switch (msix->type) { | 428 | switch (msix->type) { |
| @@ -458,6 +453,9 @@ static int get_irq_affinity(struct hfi1_devdata *dd, | |||
| 458 | * finds its CPU here. | 453 | * finds its CPU here. |
| 459 | */ | 454 | */ |
| 460 | if (cpu == -1 && set) { | 455 | if (cpu == -1 && set) { |
| 456 | if (!zalloc_cpumask_var(&diff, GFP_KERNEL)) | ||
| 457 | return -ENOMEM; | ||
| 458 | |||
| 461 | if (cpumask_equal(&set->mask, &set->used)) { | 459 | if (cpumask_equal(&set->mask, &set->used)) { |
| 462 | /* | 460 | /* |
| 463 | * We've used up all the CPUs, bump up the generation | 461 | * We've used up all the CPUs, bump up the generation |
| @@ -469,6 +467,8 @@ static int get_irq_affinity(struct hfi1_devdata *dd, | |||
| 469 | cpumask_andnot(diff, &set->mask, &set->used); | 467 | cpumask_andnot(diff, &set->mask, &set->used); |
| 470 | cpu = cpumask_first(diff); | 468 | cpu = cpumask_first(diff); |
| 471 | cpumask_set_cpu(cpu, &set->used); | 469 | cpumask_set_cpu(cpu, &set->used); |
| 470 | |||
| 471 | free_cpumask_var(diff); | ||
| 472 | } | 472 | } |
| 473 | 473 | ||
| 474 | cpumask_set_cpu(cpu, &msix->mask); | 474 | cpumask_set_cpu(cpu, &msix->mask); |
| @@ -482,7 +482,6 @@ static int get_irq_affinity(struct hfi1_devdata *dd, | |||
| 482 | hfi1_setup_sdma_notifier(msix); | 482 | hfi1_setup_sdma_notifier(msix); |
| 483 | } | 483 | } |
| 484 | 484 | ||
| 485 | free_cpumask_var(diff); | ||
| 486 | return 0; | 485 | return 0; |
| 487 | } | 486 | } |
| 488 | 487 | ||
diff --git a/drivers/infiniband/hw/hfi1/driver.c b/drivers/infiniband/hw/hfi1/driver.c index 46d1475b2154..bd837a048bf4 100644 --- a/drivers/infiniband/hw/hfi1/driver.c +++ b/drivers/infiniband/hw/hfi1/driver.c | |||
| @@ -433,31 +433,43 @@ void hfi1_process_ecn_slowpath(struct rvt_qp *qp, struct hfi1_packet *pkt, | |||
| 433 | bool do_cnp) | 433 | bool do_cnp) |
| 434 | { | 434 | { |
| 435 | struct hfi1_ibport *ibp = to_iport(qp->ibqp.device, qp->port_num); | 435 | struct hfi1_ibport *ibp = to_iport(qp->ibqp.device, qp->port_num); |
| 436 | struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); | ||
| 436 | struct ib_other_headers *ohdr = pkt->ohdr; | 437 | struct ib_other_headers *ohdr = pkt->ohdr; |
| 437 | struct ib_grh *grh = pkt->grh; | 438 | struct ib_grh *grh = pkt->grh; |
| 438 | u32 rqpn = 0, bth1; | 439 | u32 rqpn = 0, bth1; |
| 439 | u16 pkey, rlid, dlid = ib_get_dlid(pkt->hdr); | 440 | u16 pkey; |
| 441 | u32 rlid, slid, dlid = 0; | ||
| 440 | u8 hdr_type, sc, svc_type; | 442 | u8 hdr_type, sc, svc_type; |
| 441 | bool is_mcast = false; | 443 | bool is_mcast = false; |
| 442 | 444 | ||
| 445 | /* can be called from prescan */ | ||
| 443 | if (pkt->etype == RHF_RCV_TYPE_BYPASS) { | 446 | if (pkt->etype == RHF_RCV_TYPE_BYPASS) { |
| 444 | is_mcast = hfi1_is_16B_mcast(dlid); | 447 | is_mcast = hfi1_is_16B_mcast(dlid); |
| 445 | pkey = hfi1_16B_get_pkey(pkt->hdr); | 448 | pkey = hfi1_16B_get_pkey(pkt->hdr); |
| 446 | sc = hfi1_16B_get_sc(pkt->hdr); | 449 | sc = hfi1_16B_get_sc(pkt->hdr); |
| 450 | dlid = hfi1_16B_get_dlid(pkt->hdr); | ||
| 451 | slid = hfi1_16B_get_slid(pkt->hdr); | ||
| 447 | hdr_type = HFI1_PKT_TYPE_16B; | 452 | hdr_type = HFI1_PKT_TYPE_16B; |
| 448 | } else { | 453 | } else { |
| 449 | is_mcast = (dlid > be16_to_cpu(IB_MULTICAST_LID_BASE)) && | 454 | is_mcast = (dlid > be16_to_cpu(IB_MULTICAST_LID_BASE)) && |
| 450 | (dlid != be16_to_cpu(IB_LID_PERMISSIVE)); | 455 | (dlid != be16_to_cpu(IB_LID_PERMISSIVE)); |
| 451 | pkey = ib_bth_get_pkey(ohdr); | 456 | pkey = ib_bth_get_pkey(ohdr); |
| 452 | sc = hfi1_9B_get_sc5(pkt->hdr, pkt->rhf); | 457 | sc = hfi1_9B_get_sc5(pkt->hdr, pkt->rhf); |
| 458 | dlid = ib_get_dlid(pkt->hdr); | ||
| 459 | slid = ib_get_slid(pkt->hdr); | ||
| 453 | hdr_type = HFI1_PKT_TYPE_9B; | 460 | hdr_type = HFI1_PKT_TYPE_9B; |
| 454 | } | 461 | } |
| 455 | 462 | ||
| 456 | switch (qp->ibqp.qp_type) { | 463 | switch (qp->ibqp.qp_type) { |
| 464 | case IB_QPT_UD: | ||
| 465 | dlid = ppd->lid; | ||
| 466 | rlid = slid; | ||
| 467 | rqpn = ib_get_sqpn(pkt->ohdr); | ||
| 468 | svc_type = IB_CC_SVCTYPE_UD; | ||
| 469 | break; | ||
| 457 | case IB_QPT_SMI: | 470 | case IB_QPT_SMI: |
| 458 | case IB_QPT_GSI: | 471 | case IB_QPT_GSI: |
| 459 | case IB_QPT_UD: | 472 | rlid = slid; |
| 460 | rlid = ib_get_slid(pkt->hdr); | ||
| 461 | rqpn = ib_get_sqpn(pkt->ohdr); | 473 | rqpn = ib_get_sqpn(pkt->ohdr); |
| 462 | svc_type = IB_CC_SVCTYPE_UD; | 474 | svc_type = IB_CC_SVCTYPE_UD; |
| 463 | break; | 475 | break; |
| @@ -482,7 +494,6 @@ void hfi1_process_ecn_slowpath(struct rvt_qp *qp, struct hfi1_packet *pkt, | |||
| 482 | dlid, rlid, sc, grh); | 494 | dlid, rlid, sc, grh); |
| 483 | 495 | ||
| 484 | if (!is_mcast && (bth1 & IB_BECN_SMASK)) { | 496 | if (!is_mcast && (bth1 & IB_BECN_SMASK)) { |
| 485 | struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); | ||
| 486 | u32 lqpn = bth1 & RVT_QPN_MASK; | 497 | u32 lqpn = bth1 & RVT_QPN_MASK; |
| 487 | u8 sl = ibp->sc_to_sl[sc]; | 498 | u8 sl = ibp->sc_to_sl[sc]; |
| 488 | 499 | ||
diff --git a/drivers/infiniband/hw/hfi1/hfi.h b/drivers/infiniband/hw/hfi1/hfi.h index 32c48265405e..cac2c62bc42d 100644 --- a/drivers/infiniband/hw/hfi1/hfi.h +++ b/drivers/infiniband/hw/hfi1/hfi.h | |||
| @@ -1537,13 +1537,13 @@ void set_link_ipg(struct hfi1_pportdata *ppd); | |||
| 1537 | void process_becn(struct hfi1_pportdata *ppd, u8 sl, u32 rlid, u32 lqpn, | 1537 | void process_becn(struct hfi1_pportdata *ppd, u8 sl, u32 rlid, u32 lqpn, |
| 1538 | u32 rqpn, u8 svc_type); | 1538 | u32 rqpn, u8 svc_type); |
| 1539 | void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, | 1539 | void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, |
| 1540 | u32 pkey, u32 slid, u32 dlid, u8 sc5, | 1540 | u16 pkey, u32 slid, u32 dlid, u8 sc5, |
| 1541 | const struct ib_grh *old_grh); | 1541 | const struct ib_grh *old_grh); |
| 1542 | void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, | 1542 | void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, |
| 1543 | u32 remote_qpn, u32 pkey, u32 slid, u32 dlid, | 1543 | u32 remote_qpn, u16 pkey, u32 slid, u32 dlid, |
| 1544 | u8 sc5, const struct ib_grh *old_grh); | 1544 | u8 sc5, const struct ib_grh *old_grh); |
| 1545 | typedef void (*hfi1_handle_cnp)(struct hfi1_ibport *ibp, struct rvt_qp *qp, | 1545 | typedef void (*hfi1_handle_cnp)(struct hfi1_ibport *ibp, struct rvt_qp *qp, |
| 1546 | u32 remote_qpn, u32 pkey, u32 slid, u32 dlid, | 1546 | u32 remote_qpn, u16 pkey, u32 slid, u32 dlid, |
| 1547 | u8 sc5, const struct ib_grh *old_grh); | 1547 | u8 sc5, const struct ib_grh *old_grh); |
| 1548 | 1548 | ||
| 1549 | #define PKEY_CHECK_INVALID -1 | 1549 | #define PKEY_CHECK_INVALID -1 |
| @@ -2437,7 +2437,7 @@ static inline void hfi1_make_16b_hdr(struct hfi1_16b_header *hdr, | |||
| 2437 | ((slid >> OPA_16B_SLID_SHIFT) << OPA_16B_SLID_HIGH_SHIFT); | 2437 | ((slid >> OPA_16B_SLID_SHIFT) << OPA_16B_SLID_HIGH_SHIFT); |
| 2438 | lrh2 = (lrh2 & ~OPA_16B_DLID_MASK) | | 2438 | lrh2 = (lrh2 & ~OPA_16B_DLID_MASK) | |
| 2439 | ((dlid >> OPA_16B_DLID_SHIFT) << OPA_16B_DLID_HIGH_SHIFT); | 2439 | ((dlid >> OPA_16B_DLID_SHIFT) << OPA_16B_DLID_HIGH_SHIFT); |
| 2440 | lrh2 = (lrh2 & ~OPA_16B_PKEY_MASK) | (pkey << OPA_16B_PKEY_SHIFT); | 2440 | lrh2 = (lrh2 & ~OPA_16B_PKEY_MASK) | ((u32)pkey << OPA_16B_PKEY_SHIFT); |
| 2441 | lrh2 = (lrh2 & ~OPA_16B_L4_MASK) | l4; | 2441 | lrh2 = (lrh2 & ~OPA_16B_L4_MASK) | l4; |
| 2442 | 2442 | ||
| 2443 | hdr->lrh[0] = lrh0; | 2443 | hdr->lrh[0] = lrh0; |
diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c index 33eba2356742..6309edf811df 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c | |||
| @@ -88,9 +88,9 @@ | |||
| 88 | * pio buffers per ctxt, etc.) Zero means use one user context per CPU. | 88 | * pio buffers per ctxt, etc.) Zero means use one user context per CPU. |
| 89 | */ | 89 | */ |
| 90 | int num_user_contexts = -1; | 90 | int num_user_contexts = -1; |
| 91 | module_param_named(num_user_contexts, num_user_contexts, uint, S_IRUGO); | 91 | module_param_named(num_user_contexts, num_user_contexts, int, 0444); |
| 92 | MODULE_PARM_DESC( | 92 | MODULE_PARM_DESC( |
| 93 | num_user_contexts, "Set max number of user contexts to use"); | 93 | num_user_contexts, "Set max number of user contexts to use (default: -1 will use the real (non-HT) CPU count)"); |
| 94 | 94 | ||
| 95 | uint krcvqs[RXE_NUM_DATA_VL]; | 95 | uint krcvqs[RXE_NUM_DATA_VL]; |
| 96 | int krcvqsset; | 96 | int krcvqsset; |
| @@ -1209,30 +1209,49 @@ static void finalize_asic_data(struct hfi1_devdata *dd, | |||
| 1209 | kfree(ad); | 1209 | kfree(ad); |
| 1210 | } | 1210 | } |
| 1211 | 1211 | ||
| 1212 | static void __hfi1_free_devdata(struct kobject *kobj) | 1212 | /** |
| 1213 | * hfi1_clean_devdata - cleans up per-unit data structure | ||
| 1214 | * @dd: pointer to a valid devdata structure | ||
| 1215 | * | ||
| 1216 | * It cleans up all data structures set up by | ||
| 1217 | * by hfi1_alloc_devdata(). | ||
| 1218 | */ | ||
| 1219 | static void hfi1_clean_devdata(struct hfi1_devdata *dd) | ||
| 1213 | { | 1220 | { |
| 1214 | struct hfi1_devdata *dd = | ||
| 1215 | container_of(kobj, struct hfi1_devdata, kobj); | ||
| 1216 | struct hfi1_asic_data *ad; | 1221 | struct hfi1_asic_data *ad; |
| 1217 | unsigned long flags; | 1222 | unsigned long flags; |
| 1218 | 1223 | ||
| 1219 | spin_lock_irqsave(&hfi1_devs_lock, flags); | 1224 | spin_lock_irqsave(&hfi1_devs_lock, flags); |
| 1220 | idr_remove(&hfi1_unit_table, dd->unit); | 1225 | if (!list_empty(&dd->list)) { |
| 1221 | list_del(&dd->list); | 1226 | idr_remove(&hfi1_unit_table, dd->unit); |
| 1227 | list_del_init(&dd->list); | ||
| 1228 | } | ||
| 1222 | ad = release_asic_data(dd); | 1229 | ad = release_asic_data(dd); |
| 1223 | spin_unlock_irqrestore(&hfi1_devs_lock, flags); | 1230 | spin_unlock_irqrestore(&hfi1_devs_lock, flags); |
| 1224 | if (ad) | 1231 | |
| 1225 | finalize_asic_data(dd, ad); | 1232 | finalize_asic_data(dd, ad); |
| 1226 | free_platform_config(dd); | 1233 | free_platform_config(dd); |
| 1227 | rcu_barrier(); /* wait for rcu callbacks to complete */ | 1234 | rcu_barrier(); /* wait for rcu callbacks to complete */ |
| 1228 | free_percpu(dd->int_counter); | 1235 | free_percpu(dd->int_counter); |
| 1229 | free_percpu(dd->rcv_limit); | 1236 | free_percpu(dd->rcv_limit); |
| 1230 | free_percpu(dd->send_schedule); | 1237 | free_percpu(dd->send_schedule); |
| 1231 | free_percpu(dd->tx_opstats); | 1238 | free_percpu(dd->tx_opstats); |
| 1239 | dd->int_counter = NULL; | ||
| 1240 | dd->rcv_limit = NULL; | ||
| 1241 | dd->send_schedule = NULL; | ||
| 1242 | dd->tx_opstats = NULL; | ||
| 1232 | sdma_clean(dd, dd->num_sdma); | 1243 | sdma_clean(dd, dd->num_sdma); |
| 1233 | rvt_dealloc_device(&dd->verbs_dev.rdi); | 1244 | rvt_dealloc_device(&dd->verbs_dev.rdi); |
| 1234 | } | 1245 | } |
| 1235 | 1246 | ||
| 1247 | static void __hfi1_free_devdata(struct kobject *kobj) | ||
| 1248 | { | ||
| 1249 | struct hfi1_devdata *dd = | ||
| 1250 | container_of(kobj, struct hfi1_devdata, kobj); | ||
| 1251 | |||
| 1252 | hfi1_clean_devdata(dd); | ||
| 1253 | } | ||
| 1254 | |||
| 1236 | static struct kobj_type hfi1_devdata_type = { | 1255 | static struct kobj_type hfi1_devdata_type = { |
| 1237 | .release = __hfi1_free_devdata, | 1256 | .release = __hfi1_free_devdata, |
| 1238 | }; | 1257 | }; |
| @@ -1265,6 +1284,8 @@ struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_t extra) | |||
| 1265 | return ERR_PTR(-ENOMEM); | 1284 | return ERR_PTR(-ENOMEM); |
| 1266 | dd->num_pports = nports; | 1285 | dd->num_pports = nports; |
| 1267 | dd->pport = (struct hfi1_pportdata *)(dd + 1); | 1286 | dd->pport = (struct hfi1_pportdata *)(dd + 1); |
| 1287 | dd->pcidev = pdev; | ||
| 1288 | pci_set_drvdata(pdev, dd); | ||
| 1268 | 1289 | ||
| 1269 | INIT_LIST_HEAD(&dd->list); | 1290 | INIT_LIST_HEAD(&dd->list); |
| 1270 | idr_preload(GFP_KERNEL); | 1291 | idr_preload(GFP_KERNEL); |
| @@ -1331,9 +1352,7 @@ struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_t extra) | |||
| 1331 | return dd; | 1352 | return dd; |
| 1332 | 1353 | ||
| 1333 | bail: | 1354 | bail: |
| 1334 | if (!list_empty(&dd->list)) | 1355 | hfi1_clean_devdata(dd); |
| 1335 | list_del_init(&dd->list); | ||
| 1336 | rvt_dealloc_device(&dd->verbs_dev.rdi); | ||
| 1337 | return ERR_PTR(ret); | 1356 | return ERR_PTR(ret); |
| 1338 | } | 1357 | } |
| 1339 | 1358 | ||
diff --git a/drivers/infiniband/hw/hfi1/pcie.c b/drivers/infiniband/hw/hfi1/pcie.c index 83d66e862207..c1c982908b4b 100644 --- a/drivers/infiniband/hw/hfi1/pcie.c +++ b/drivers/infiniband/hw/hfi1/pcie.c | |||
| @@ -163,9 +163,6 @@ int hfi1_pcie_ddinit(struct hfi1_devdata *dd, struct pci_dev *pdev) | |||
| 163 | resource_size_t addr; | 163 | resource_size_t addr; |
| 164 | int ret = 0; | 164 | int ret = 0; |
| 165 | 165 | ||
| 166 | dd->pcidev = pdev; | ||
| 167 | pci_set_drvdata(pdev, dd); | ||
| 168 | |||
| 169 | addr = pci_resource_start(pdev, 0); | 166 | addr = pci_resource_start(pdev, 0); |
| 170 | len = pci_resource_len(pdev, 0); | 167 | len = pci_resource_len(pdev, 0); |
| 171 | 168 | ||
diff --git a/drivers/infiniband/hw/hfi1/platform.c b/drivers/infiniband/hw/hfi1/platform.c index d486355880cb..cbf7faa5038c 100644 --- a/drivers/infiniband/hw/hfi1/platform.c +++ b/drivers/infiniband/hw/hfi1/platform.c | |||
| @@ -199,6 +199,7 @@ void free_platform_config(struct hfi1_devdata *dd) | |||
| 199 | { | 199 | { |
| 200 | /* Release memory allocated for eprom or fallback file read. */ | 200 | /* Release memory allocated for eprom or fallback file read. */ |
| 201 | kfree(dd->platform_config.data); | 201 | kfree(dd->platform_config.data); |
| 202 | dd->platform_config.data = NULL; | ||
| 202 | } | 203 | } |
| 203 | 204 | ||
| 204 | void get_port_type(struct hfi1_pportdata *ppd) | 205 | void get_port_type(struct hfi1_pportdata *ppd) |
diff --git a/drivers/infiniband/hw/hfi1/qsfp.c b/drivers/infiniband/hw/hfi1/qsfp.c index 1869f639c3ae..b5966991d647 100644 --- a/drivers/infiniband/hw/hfi1/qsfp.c +++ b/drivers/infiniband/hw/hfi1/qsfp.c | |||
| @@ -204,6 +204,8 @@ static void clean_i2c_bus(struct hfi1_i2c_bus *bus) | |||
| 204 | 204 | ||
| 205 | void clean_up_i2c(struct hfi1_devdata *dd, struct hfi1_asic_data *ad) | 205 | void clean_up_i2c(struct hfi1_devdata *dd, struct hfi1_asic_data *ad) |
| 206 | { | 206 | { |
| 207 | if (!ad) | ||
| 208 | return; | ||
| 207 | clean_i2c_bus(ad->i2c_bus0); | 209 | clean_i2c_bus(ad->i2c_bus0); |
| 208 | ad->i2c_bus0 = NULL; | 210 | ad->i2c_bus0 = NULL; |
| 209 | clean_i2c_bus(ad->i2c_bus1); | 211 | clean_i2c_bus(ad->i2c_bus1); |
diff --git a/drivers/infiniband/hw/hfi1/ruc.c b/drivers/infiniband/hw/hfi1/ruc.c index 3daa94bdae3a..c0071ca4147a 100644 --- a/drivers/infiniband/hw/hfi1/ruc.c +++ b/drivers/infiniband/hw/hfi1/ruc.c | |||
| @@ -733,6 +733,20 @@ static inline void hfi1_make_ruc_bth(struct rvt_qp *qp, | |||
| 733 | ohdr->bth[2] = cpu_to_be32(bth2); | 733 | ohdr->bth[2] = cpu_to_be32(bth2); |
| 734 | } | 734 | } |
| 735 | 735 | ||
| 736 | /** | ||
| 737 | * hfi1_make_ruc_header_16B - build a 16B header | ||
| 738 | * @qp: the queue pair | ||
| 739 | * @ohdr: a pointer to the destination header memory | ||
| 740 | * @bth0: bth0 passed in from the RC/UC builder | ||
| 741 | * @bth2: bth2 passed in from the RC/UC builder | ||
| 742 | * @middle: non zero implies indicates ahg "could" be used | ||
| 743 | * @ps: the current packet state | ||
| 744 | * | ||
| 745 | * This routine may disarm ahg under these situations: | ||
| 746 | * - packet needs a GRH | ||
| 747 | * - BECN needed | ||
| 748 | * - migration state not IB_MIG_MIGRATED | ||
| 749 | */ | ||
| 736 | static inline void hfi1_make_ruc_header_16B(struct rvt_qp *qp, | 750 | static inline void hfi1_make_ruc_header_16B(struct rvt_qp *qp, |
| 737 | struct ib_other_headers *ohdr, | 751 | struct ib_other_headers *ohdr, |
| 738 | u32 bth0, u32 bth2, int middle, | 752 | u32 bth0, u32 bth2, int middle, |
| @@ -777,6 +791,12 @@ static inline void hfi1_make_ruc_header_16B(struct rvt_qp *qp, | |||
| 777 | else | 791 | else |
| 778 | middle = 0; | 792 | middle = 0; |
| 779 | 793 | ||
| 794 | if (qp->s_flags & RVT_S_ECN) { | ||
| 795 | qp->s_flags &= ~RVT_S_ECN; | ||
| 796 | /* we recently received a FECN, so return a BECN */ | ||
| 797 | becn = true; | ||
| 798 | middle = 0; | ||
| 799 | } | ||
| 780 | if (middle) | 800 | if (middle) |
| 781 | build_ahg(qp, bth2); | 801 | build_ahg(qp, bth2); |
| 782 | else | 802 | else |
| @@ -784,11 +804,6 @@ static inline void hfi1_make_ruc_header_16B(struct rvt_qp *qp, | |||
| 784 | 804 | ||
| 785 | bth0 |= pkey; | 805 | bth0 |= pkey; |
| 786 | bth0 |= extra_bytes << 20; | 806 | bth0 |= extra_bytes << 20; |
| 787 | if (qp->s_flags & RVT_S_ECN) { | ||
| 788 | qp->s_flags &= ~RVT_S_ECN; | ||
| 789 | /* we recently received a FECN, so return a BECN */ | ||
| 790 | becn = true; | ||
| 791 | } | ||
| 792 | hfi1_make_ruc_bth(qp, ohdr, bth0, bth1, bth2); | 807 | hfi1_make_ruc_bth(qp, ohdr, bth0, bth1, bth2); |
| 793 | 808 | ||
| 794 | if (!ppd->lid) | 809 | if (!ppd->lid) |
| @@ -806,6 +821,20 @@ static inline void hfi1_make_ruc_header_16B(struct rvt_qp *qp, | |||
| 806 | pkey, becn, 0, l4, priv->s_sc); | 821 | pkey, becn, 0, l4, priv->s_sc); |
| 807 | } | 822 | } |
| 808 | 823 | ||
| 824 | /** | ||
| 825 | * hfi1_make_ruc_header_9B - build a 9B header | ||
| 826 | * @qp: the queue pair | ||
| 827 | * @ohdr: a pointer to the destination header memory | ||
| 828 | * @bth0: bth0 passed in from the RC/UC builder | ||
| 829 | * @bth2: bth2 passed in from the RC/UC builder | ||
| 830 | * @middle: non zero implies indicates ahg "could" be used | ||
| 831 | * @ps: the current packet state | ||
| 832 | * | ||
| 833 | * This routine may disarm ahg under these situations: | ||
| 834 | * - packet needs a GRH | ||
| 835 | * - BECN needed | ||
| 836 | * - migration state not IB_MIG_MIGRATED | ||
| 837 | */ | ||
| 809 | static inline void hfi1_make_ruc_header_9B(struct rvt_qp *qp, | 838 | static inline void hfi1_make_ruc_header_9B(struct rvt_qp *qp, |
| 810 | struct ib_other_headers *ohdr, | 839 | struct ib_other_headers *ohdr, |
| 811 | u32 bth0, u32 bth2, int middle, | 840 | u32 bth0, u32 bth2, int middle, |
| @@ -839,6 +868,12 @@ static inline void hfi1_make_ruc_header_9B(struct rvt_qp *qp, | |||
| 839 | else | 868 | else |
| 840 | middle = 0; | 869 | middle = 0; |
| 841 | 870 | ||
| 871 | if (qp->s_flags & RVT_S_ECN) { | ||
| 872 | qp->s_flags &= ~RVT_S_ECN; | ||
| 873 | /* we recently received a FECN, so return a BECN */ | ||
| 874 | bth1 |= (IB_BECN_MASK << IB_BECN_SHIFT); | ||
| 875 | middle = 0; | ||
| 876 | } | ||
| 842 | if (middle) | 877 | if (middle) |
| 843 | build_ahg(qp, bth2); | 878 | build_ahg(qp, bth2); |
| 844 | else | 879 | else |
| @@ -846,11 +881,6 @@ static inline void hfi1_make_ruc_header_9B(struct rvt_qp *qp, | |||
| 846 | 881 | ||
| 847 | bth0 |= pkey; | 882 | bth0 |= pkey; |
| 848 | bth0 |= extra_bytes << 20; | 883 | bth0 |= extra_bytes << 20; |
| 849 | if (qp->s_flags & RVT_S_ECN) { | ||
| 850 | qp->s_flags &= ~RVT_S_ECN; | ||
| 851 | /* we recently received a FECN, so return a BECN */ | ||
| 852 | bth1 |= (IB_BECN_MASK << IB_BECN_SHIFT); | ||
| 853 | } | ||
| 854 | hfi1_make_ruc_bth(qp, ohdr, bth0, bth1, bth2); | 884 | hfi1_make_ruc_bth(qp, ohdr, bth0, bth1, bth2); |
| 855 | hfi1_make_ib_hdr(&ps->s_txreq->phdr.hdr.ibh, | 885 | hfi1_make_ib_hdr(&ps->s_txreq->phdr.hdr.ibh, |
| 856 | lrh0, | 886 | lrh0, |
diff --git a/drivers/infiniband/hw/hfi1/ud.c b/drivers/infiniband/hw/hfi1/ud.c index bcf3b0bebac8..69c17a5ef038 100644 --- a/drivers/infiniband/hw/hfi1/ud.c +++ b/drivers/infiniband/hw/hfi1/ud.c | |||
| @@ -628,7 +628,7 @@ int hfi1_lookup_pkey_idx(struct hfi1_ibport *ibp, u16 pkey) | |||
| 628 | } | 628 | } |
| 629 | 629 | ||
| 630 | void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, | 630 | void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, |
| 631 | u32 remote_qpn, u32 pkey, u32 slid, u32 dlid, | 631 | u32 remote_qpn, u16 pkey, u32 slid, u32 dlid, |
| 632 | u8 sc5, const struct ib_grh *old_grh) | 632 | u8 sc5, const struct ib_grh *old_grh) |
| 633 | { | 633 | { |
| 634 | u64 pbc, pbc_flags = 0; | 634 | u64 pbc, pbc_flags = 0; |
| @@ -687,7 +687,7 @@ void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, | |||
| 687 | } | 687 | } |
| 688 | 688 | ||
| 689 | void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, | 689 | void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, |
| 690 | u32 pkey, u32 slid, u32 dlid, u8 sc5, | 690 | u16 pkey, u32 slid, u32 dlid, u8 sc5, |
| 691 | const struct ib_grh *old_grh) | 691 | const struct ib_grh *old_grh) |
| 692 | { | 692 | { |
| 693 | u64 pbc, pbc_flags = 0; | 693 | u64 pbc, pbc_flags = 0; |
diff --git a/drivers/infiniband/hw/hns/hns_roce_hem.c b/drivers/infiniband/hw/hns/hns_roce_hem.c index 0eeabfbee192..63b5b3edabcb 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hem.c +++ b/drivers/infiniband/hw/hns/hns_roce_hem.c | |||
| @@ -912,7 +912,7 @@ int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, | |||
| 912 | obj_per_chunk = buf_chunk_size / obj_size; | 912 | obj_per_chunk = buf_chunk_size / obj_size; |
| 913 | num_hem = (nobj + obj_per_chunk - 1) / obj_per_chunk; | 913 | num_hem = (nobj + obj_per_chunk - 1) / obj_per_chunk; |
| 914 | bt_chunk_num = bt_chunk_size / 8; | 914 | bt_chunk_num = bt_chunk_size / 8; |
| 915 | if (table->type >= HEM_TYPE_MTT) | 915 | if (type >= HEM_TYPE_MTT) |
| 916 | num_bt_l0 = bt_chunk_num; | 916 | num_bt_l0 = bt_chunk_num; |
| 917 | 917 | ||
| 918 | table->hem = kcalloc(num_hem, sizeof(*table->hem), | 918 | table->hem = kcalloc(num_hem, sizeof(*table->hem), |
| @@ -920,7 +920,7 @@ int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, | |||
| 920 | if (!table->hem) | 920 | if (!table->hem) |
| 921 | goto err_kcalloc_hem_buf; | 921 | goto err_kcalloc_hem_buf; |
| 922 | 922 | ||
| 923 | if (check_whether_bt_num_3(table->type, hop_num)) { | 923 | if (check_whether_bt_num_3(type, hop_num)) { |
| 924 | unsigned long num_bt_l1; | 924 | unsigned long num_bt_l1; |
| 925 | 925 | ||
| 926 | num_bt_l1 = (num_hem + bt_chunk_num - 1) / | 926 | num_bt_l1 = (num_hem + bt_chunk_num - 1) / |
| @@ -939,8 +939,8 @@ int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, | |||
| 939 | goto err_kcalloc_l1_dma; | 939 | goto err_kcalloc_l1_dma; |
| 940 | } | 940 | } |
| 941 | 941 | ||
| 942 | if (check_whether_bt_num_2(table->type, hop_num) || | 942 | if (check_whether_bt_num_2(type, hop_num) || |
| 943 | check_whether_bt_num_3(table->type, hop_num)) { | 943 | check_whether_bt_num_3(type, hop_num)) { |
| 944 | table->bt_l0 = kcalloc(num_bt_l0, sizeof(*table->bt_l0), | 944 | table->bt_l0 = kcalloc(num_bt_l0, sizeof(*table->bt_l0), |
| 945 | GFP_KERNEL); | 945 | GFP_KERNEL); |
| 946 | if (!table->bt_l0) | 946 | if (!table->bt_l0) |
| @@ -1039,14 +1039,14 @@ void hns_roce_cleanup_hem_table(struct hns_roce_dev *hr_dev, | |||
| 1039 | void hns_roce_cleanup_hem(struct hns_roce_dev *hr_dev) | 1039 | void hns_roce_cleanup_hem(struct hns_roce_dev *hr_dev) |
| 1040 | { | 1040 | { |
| 1041 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->cq_table.table); | 1041 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->cq_table.table); |
| 1042 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->qp_table.irrl_table); | ||
| 1043 | if (hr_dev->caps.trrl_entry_sz) | 1042 | if (hr_dev->caps.trrl_entry_sz) |
| 1044 | hns_roce_cleanup_hem_table(hr_dev, | 1043 | hns_roce_cleanup_hem_table(hr_dev, |
| 1045 | &hr_dev->qp_table.trrl_table); | 1044 | &hr_dev->qp_table.trrl_table); |
| 1045 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->qp_table.irrl_table); | ||
| 1046 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->qp_table.qp_table); | 1046 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->qp_table.qp_table); |
| 1047 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->mr_table.mtpt_table); | 1047 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->mr_table.mtpt_table); |
| 1048 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->mr_table.mtt_table); | ||
| 1049 | if (hns_roce_check_whether_mhop(hr_dev, HEM_TYPE_CQE)) | 1048 | if (hns_roce_check_whether_mhop(hr_dev, HEM_TYPE_CQE)) |
| 1050 | hns_roce_cleanup_hem_table(hr_dev, | 1049 | hns_roce_cleanup_hem_table(hr_dev, |
| 1051 | &hr_dev->mr_table.mtt_cqe_table); | 1050 | &hr_dev->mr_table.mtt_cqe_table); |
| 1051 | hns_roce_cleanup_hem_table(hr_dev, &hr_dev->mr_table.mtt_table); | ||
| 1052 | } | 1052 | } |
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 8b84ab7800d8..25916e8522ed 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c | |||
| @@ -71,6 +71,11 @@ static int set_rwqe_data_seg(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
| 71 | return -EINVAL; | 71 | return -EINVAL; |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | if (wr->opcode == IB_WR_RDMA_READ) { | ||
| 75 | dev_err(hr_dev->dev, "Not support inline data!\n"); | ||
| 76 | return -EINVAL; | ||
| 77 | } | ||
| 78 | |||
| 74 | for (i = 0; i < wr->num_sge; i++) { | 79 | for (i = 0; i < wr->num_sge; i++) { |
| 75 | memcpy(wqe, ((void *)wr->sg_list[i].addr), | 80 | memcpy(wqe, ((void *)wr->sg_list[i].addr), |
| 76 | wr->sg_list[i].length); | 81 | wr->sg_list[i].length); |
| @@ -148,7 +153,7 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
| 148 | ibqp->qp_type != IB_QPT_GSI && | 153 | ibqp->qp_type != IB_QPT_GSI && |
| 149 | ibqp->qp_type != IB_QPT_UD)) { | 154 | ibqp->qp_type != IB_QPT_UD)) { |
| 150 | dev_err(dev, "Not supported QP(0x%x)type!\n", ibqp->qp_type); | 155 | dev_err(dev, "Not supported QP(0x%x)type!\n", ibqp->qp_type); |
| 151 | *bad_wr = NULL; | 156 | *bad_wr = wr; |
| 152 | return -EOPNOTSUPP; | 157 | return -EOPNOTSUPP; |
| 153 | } | 158 | } |
| 154 | 159 | ||
| @@ -182,7 +187,8 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
| 182 | qp->sq.wrid[(qp->sq.head + nreq) & (qp->sq.wqe_cnt - 1)] = | 187 | qp->sq.wrid[(qp->sq.head + nreq) & (qp->sq.wqe_cnt - 1)] = |
| 183 | wr->wr_id; | 188 | wr->wr_id; |
| 184 | 189 | ||
| 185 | owner_bit = ~(qp->sq.head >> ilog2(qp->sq.wqe_cnt)) & 0x1; | 190 | owner_bit = |
| 191 | ~(((qp->sq.head + nreq) >> ilog2(qp->sq.wqe_cnt)) & 0x1); | ||
| 186 | 192 | ||
| 187 | /* Corresponding to the QP type, wqe process separately */ | 193 | /* Corresponding to the QP type, wqe process separately */ |
| 188 | if (ibqp->qp_type == IB_QPT_GSI) { | 194 | if (ibqp->qp_type == IB_QPT_GSI) { |
| @@ -456,6 +462,7 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
| 456 | } else { | 462 | } else { |
| 457 | dev_err(dev, "Illegal qp_type(0x%x)\n", ibqp->qp_type); | 463 | dev_err(dev, "Illegal qp_type(0x%x)\n", ibqp->qp_type); |
| 458 | spin_unlock_irqrestore(&qp->sq.lock, flags); | 464 | spin_unlock_irqrestore(&qp->sq.lock, flags); |
| 465 | *bad_wr = wr; | ||
| 459 | return -EOPNOTSUPP; | 466 | return -EOPNOTSUPP; |
| 460 | } | 467 | } |
| 461 | } | 468 | } |
| @@ -2592,10 +2599,12 @@ static void modify_qp_init_to_init(struct ib_qp *ibqp, | |||
| 2592 | roce_set_field(qpc_mask->byte_4_sqpn_tst, V2_QPC_BYTE_4_SQPN_M, | 2599 | roce_set_field(qpc_mask->byte_4_sqpn_tst, V2_QPC_BYTE_4_SQPN_M, |
| 2593 | V2_QPC_BYTE_4_SQPN_S, 0); | 2600 | V2_QPC_BYTE_4_SQPN_S, 0); |
| 2594 | 2601 | ||
| 2595 | roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M, | 2602 | if (attr_mask & IB_QP_DEST_QPN) { |
| 2596 | V2_QPC_BYTE_56_DQPN_S, hr_qp->qpn); | 2603 | roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M, |
| 2597 | roce_set_field(qpc_mask->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M, | 2604 | V2_QPC_BYTE_56_DQPN_S, hr_qp->qpn); |
| 2598 | V2_QPC_BYTE_56_DQPN_S, 0); | 2605 | roce_set_field(qpc_mask->byte_56_dqpn_err, |
| 2606 | V2_QPC_BYTE_56_DQPN_M, V2_QPC_BYTE_56_DQPN_S, 0); | ||
| 2607 | } | ||
| 2599 | roce_set_field(context->byte_168_irrl_idx, | 2608 | roce_set_field(context->byte_168_irrl_idx, |
| 2600 | V2_QPC_BYTE_168_SQ_SHIFT_BAK_M, | 2609 | V2_QPC_BYTE_168_SQ_SHIFT_BAK_M, |
| 2601 | V2_QPC_BYTE_168_SQ_SHIFT_BAK_S, | 2610 | V2_QPC_BYTE_168_SQ_SHIFT_BAK_S, |
| @@ -2650,8 +2659,7 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp, | |||
| 2650 | return -EINVAL; | 2659 | return -EINVAL; |
| 2651 | } | 2660 | } |
| 2652 | 2661 | ||
| 2653 | if ((attr_mask & IB_QP_ALT_PATH) || (attr_mask & IB_QP_ACCESS_FLAGS) || | 2662 | if (attr_mask & IB_QP_ALT_PATH) { |
| 2654 | (attr_mask & IB_QP_PKEY_INDEX) || (attr_mask & IB_QP_QKEY)) { | ||
| 2655 | dev_err(dev, "INIT2RTR attr_mask (0x%x) error\n", attr_mask); | 2663 | dev_err(dev, "INIT2RTR attr_mask (0x%x) error\n", attr_mask); |
| 2656 | return -EINVAL; | 2664 | return -EINVAL; |
| 2657 | } | 2665 | } |
| @@ -2800,10 +2808,12 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp, | |||
| 2800 | V2_QPC_BYTE_140_RR_MAX_S, 0); | 2808 | V2_QPC_BYTE_140_RR_MAX_S, 0); |
| 2801 | } | 2809 | } |
| 2802 | 2810 | ||
| 2803 | roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M, | 2811 | if (attr_mask & IB_QP_DEST_QPN) { |
| 2804 | V2_QPC_BYTE_56_DQPN_S, attr->dest_qp_num); | 2812 | roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M, |
| 2805 | roce_set_field(qpc_mask->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M, | 2813 | V2_QPC_BYTE_56_DQPN_S, attr->dest_qp_num); |
| 2806 | V2_QPC_BYTE_56_DQPN_S, 0); | 2814 | roce_set_field(qpc_mask->byte_56_dqpn_err, |
| 2815 | V2_QPC_BYTE_56_DQPN_M, V2_QPC_BYTE_56_DQPN_S, 0); | ||
| 2816 | } | ||
| 2807 | 2817 | ||
| 2808 | /* Configure GID index */ | 2818 | /* Configure GID index */ |
| 2809 | port_num = rdma_ah_get_port_num(&attr->ah_attr); | 2819 | port_num = rdma_ah_get_port_num(&attr->ah_attr); |
| @@ -2845,7 +2855,7 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp, | |||
| 2845 | if (ibqp->qp_type == IB_QPT_GSI || ibqp->qp_type == IB_QPT_UD) | 2855 | if (ibqp->qp_type == IB_QPT_GSI || ibqp->qp_type == IB_QPT_UD) |
| 2846 | roce_set_field(context->byte_24_mtu_tc, V2_QPC_BYTE_24_MTU_M, | 2856 | roce_set_field(context->byte_24_mtu_tc, V2_QPC_BYTE_24_MTU_M, |
| 2847 | V2_QPC_BYTE_24_MTU_S, IB_MTU_4096); | 2857 | V2_QPC_BYTE_24_MTU_S, IB_MTU_4096); |
| 2848 | else | 2858 | else if (attr_mask & IB_QP_PATH_MTU) |
| 2849 | roce_set_field(context->byte_24_mtu_tc, V2_QPC_BYTE_24_MTU_M, | 2859 | roce_set_field(context->byte_24_mtu_tc, V2_QPC_BYTE_24_MTU_M, |
| 2850 | V2_QPC_BYTE_24_MTU_S, attr->path_mtu); | 2860 | V2_QPC_BYTE_24_MTU_S, attr->path_mtu); |
| 2851 | 2861 | ||
| @@ -2922,11 +2932,9 @@ static int modify_qp_rtr_to_rts(struct ib_qp *ibqp, | |||
| 2922 | return -EINVAL; | 2932 | return -EINVAL; |
| 2923 | } | 2933 | } |
| 2924 | 2934 | ||
| 2925 | /* If exist optional param, return error */ | 2935 | /* Not support alternate path and path migration */ |
| 2926 | if ((attr_mask & IB_QP_ALT_PATH) || (attr_mask & IB_QP_ACCESS_FLAGS) || | 2936 | if ((attr_mask & IB_QP_ALT_PATH) || |
| 2927 | (attr_mask & IB_QP_QKEY) || (attr_mask & IB_QP_PATH_MIG_STATE) || | 2937 | (attr_mask & IB_QP_PATH_MIG_STATE)) { |
| 2928 | (attr_mask & IB_QP_CUR_STATE) || | ||
| 2929 | (attr_mask & IB_QP_MIN_RNR_TIMER)) { | ||
| 2930 | dev_err(dev, "RTR2RTS attr_mask (0x%x)error\n", attr_mask); | 2938 | dev_err(dev, "RTR2RTS attr_mask (0x%x)error\n", attr_mask); |
| 2931 | return -EINVAL; | 2939 | return -EINVAL; |
| 2932 | } | 2940 | } |
| @@ -3161,7 +3169,8 @@ static int hns_roce_v2_modify_qp(struct ib_qp *ibqp, | |||
| 3161 | (cur_state == IB_QPS_RTR && new_state == IB_QPS_ERR) || | 3169 | (cur_state == IB_QPS_RTR && new_state == IB_QPS_ERR) || |
| 3162 | (cur_state == IB_QPS_RTS && new_state == IB_QPS_ERR) || | 3170 | (cur_state == IB_QPS_RTS && new_state == IB_QPS_ERR) || |
| 3163 | (cur_state == IB_QPS_SQD && new_state == IB_QPS_ERR) || | 3171 | (cur_state == IB_QPS_SQD && new_state == IB_QPS_ERR) || |
| 3164 | (cur_state == IB_QPS_SQE && new_state == IB_QPS_ERR)) { | 3172 | (cur_state == IB_QPS_SQE && new_state == IB_QPS_ERR) || |
| 3173 | (cur_state == IB_QPS_ERR && new_state == IB_QPS_ERR)) { | ||
| 3165 | /* Nothing */ | 3174 | /* Nothing */ |
| 3166 | ; | 3175 | ; |
| 3167 | } else { | 3176 | } else { |
| @@ -4478,7 +4487,7 @@ static int hns_roce_v2_create_eq(struct hns_roce_dev *hr_dev, | |||
| 4478 | ret = hns_roce_cmd_mbox(hr_dev, mailbox->dma, 0, eq->eqn, 0, | 4487 | ret = hns_roce_cmd_mbox(hr_dev, mailbox->dma, 0, eq->eqn, 0, |
| 4479 | eq_cmd, HNS_ROCE_CMD_TIMEOUT_MSECS); | 4488 | eq_cmd, HNS_ROCE_CMD_TIMEOUT_MSECS); |
| 4480 | if (ret) { | 4489 | if (ret) { |
| 4481 | dev_err(dev, "[mailbox cmd] creat eqc failed.\n"); | 4490 | dev_err(dev, "[mailbox cmd] create eqc failed.\n"); |
| 4482 | goto err_cmd_mbox; | 4491 | goto err_cmd_mbox; |
| 4483 | } | 4492 | } |
| 4484 | 4493 | ||
diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c index e289a924e789..d4aad34c21e2 100644 --- a/drivers/infiniband/hw/hns/hns_roce_qp.c +++ b/drivers/infiniband/hw/hns/hns_roce_qp.c | |||
| @@ -620,7 +620,7 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev, | |||
| 620 | to_hr_ucontext(ib_pd->uobject->context), | 620 | to_hr_ucontext(ib_pd->uobject->context), |
| 621 | ucmd.db_addr, &hr_qp->rdb); | 621 | ucmd.db_addr, &hr_qp->rdb); |
| 622 | if (ret) { | 622 | if (ret) { |
| 623 | dev_err(dev, "rp record doorbell map failed!\n"); | 623 | dev_err(dev, "rq record doorbell map failed!\n"); |
| 624 | goto err_mtt; | 624 | goto err_mtt; |
| 625 | } | 625 | } |
| 626 | } | 626 | } |
diff --git a/drivers/infiniband/hw/mlx4/mr.c b/drivers/infiniband/hw/mlx4/mr.c index 17f4f151a97f..61d8b06375bb 100644 --- a/drivers/infiniband/hw/mlx4/mr.c +++ b/drivers/infiniband/hw/mlx4/mr.c | |||
| @@ -346,7 +346,7 @@ int mlx4_ib_umem_calc_optimal_mtt_size(struct ib_umem *umem, u64 start_va, | |||
| 346 | /* Add to the first block the misalignment that it suffers from. */ | 346 | /* Add to the first block the misalignment that it suffers from. */ |
| 347 | total_len += (first_block_start & ((1ULL << block_shift) - 1ULL)); | 347 | total_len += (first_block_start & ((1ULL << block_shift) - 1ULL)); |
| 348 | last_block_end = current_block_start + current_block_len; | 348 | last_block_end = current_block_start + current_block_len; |
| 349 | last_block_aligned_end = round_up(last_block_end, 1 << block_shift); | 349 | last_block_aligned_end = round_up(last_block_end, 1ULL << block_shift); |
| 350 | total_len += (last_block_aligned_end - last_block_end); | 350 | total_len += (last_block_aligned_end - last_block_end); |
| 351 | 351 | ||
| 352 | if (total_len & ((1ULL << block_shift) - 1ULL)) | 352 | if (total_len & ((1ULL << block_shift) - 1ULL)) |
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index 50af8915e7ec..199648adac74 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c | |||
| @@ -673,7 +673,8 @@ static int set_qp_rss(struct mlx4_ib_dev *dev, struct mlx4_ib_rss *rss_ctx, | |||
| 673 | MLX4_IB_RX_HASH_SRC_PORT_TCP | | 673 | MLX4_IB_RX_HASH_SRC_PORT_TCP | |
| 674 | MLX4_IB_RX_HASH_DST_PORT_TCP | | 674 | MLX4_IB_RX_HASH_DST_PORT_TCP | |
| 675 | MLX4_IB_RX_HASH_SRC_PORT_UDP | | 675 | MLX4_IB_RX_HASH_SRC_PORT_UDP | |
| 676 | MLX4_IB_RX_HASH_DST_PORT_UDP)) { | 676 | MLX4_IB_RX_HASH_DST_PORT_UDP | |
| 677 | MLX4_IB_RX_HASH_INNER)) { | ||
| 677 | pr_debug("RX Hash fields_mask has unsupported mask (0x%llx)\n", | 678 | pr_debug("RX Hash fields_mask has unsupported mask (0x%llx)\n", |
| 678 | ucmd->rx_hash_fields_mask); | 679 | ucmd->rx_hash_fields_mask); |
| 679 | return (-EOPNOTSUPP); | 680 | return (-EOPNOTSUPP); |
diff --git a/drivers/infiniband/hw/mlx5/Kconfig b/drivers/infiniband/hw/mlx5/Kconfig index bce263b92821..fb4d77be019b 100644 --- a/drivers/infiniband/hw/mlx5/Kconfig +++ b/drivers/infiniband/hw/mlx5/Kconfig | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | config MLX5_INFINIBAND | 1 | config MLX5_INFINIBAND |
| 2 | tristate "Mellanox Connect-IB HCA support" | 2 | tristate "Mellanox Connect-IB HCA support" |
| 3 | depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE | 3 | depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE |
| 4 | depends on INFINIBAND_USER_ACCESS || INFINIBAND_USER_ACCESS=n | ||
| 4 | ---help--- | 5 | ---help--- |
| 5 | This driver provides low-level InfiniBand support for | 6 | This driver provides low-level InfiniBand support for |
| 6 | Mellanox Connect-IB PCI Express host channel adapters (HCAs). | 7 | Mellanox Connect-IB PCI Express host channel adapters (HCAs). |
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 241cf4ff9901..b4d8ff8ab807 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c | |||
| @@ -52,7 +52,6 @@ | |||
| 52 | #include <linux/mlx5/port.h> | 52 | #include <linux/mlx5/port.h> |
| 53 | #include <linux/mlx5/vport.h> | 53 | #include <linux/mlx5/vport.h> |
| 54 | #include <linux/mlx5/fs.h> | 54 | #include <linux/mlx5/fs.h> |
| 55 | #include <linux/mlx5/fs_helpers.h> | ||
| 56 | #include <linux/list.h> | 55 | #include <linux/list.h> |
| 57 | #include <rdma/ib_smi.h> | 56 | #include <rdma/ib_smi.h> |
| 58 | #include <rdma/ib_umem.h> | 57 | #include <rdma/ib_umem.h> |
| @@ -180,7 +179,7 @@ static int mlx5_netdev_event(struct notifier_block *this, | |||
| 180 | if (rep_ndev == ndev) | 179 | if (rep_ndev == ndev) |
| 181 | roce->netdev = (event == NETDEV_UNREGISTER) ? | 180 | roce->netdev = (event == NETDEV_UNREGISTER) ? |
| 182 | NULL : ndev; | 181 | NULL : ndev; |
| 183 | } else if (ndev->dev.parent == &ibdev->mdev->pdev->dev) { | 182 | } else if (ndev->dev.parent == &mdev->pdev->dev) { |
| 184 | roce->netdev = (event == NETDEV_UNREGISTER) ? | 183 | roce->netdev = (event == NETDEV_UNREGISTER) ? |
| 185 | NULL : ndev; | 184 | NULL : ndev; |
| 186 | } | 185 | } |
| @@ -5427,9 +5426,7 @@ static void mlx5_ib_stage_cong_debugfs_cleanup(struct mlx5_ib_dev *dev) | |||
| 5427 | static int mlx5_ib_stage_uar_init(struct mlx5_ib_dev *dev) | 5426 | static int mlx5_ib_stage_uar_init(struct mlx5_ib_dev *dev) |
| 5428 | { | 5427 | { |
| 5429 | dev->mdev->priv.uar = mlx5_get_uars_page(dev->mdev); | 5428 | dev->mdev->priv.uar = mlx5_get_uars_page(dev->mdev); |
| 5430 | if (!dev->mdev->priv.uar) | 5429 | return PTR_ERR_OR_ZERO(dev->mdev->priv.uar); |
| 5431 | return -ENOMEM; | ||
| 5432 | return 0; | ||
| 5433 | } | 5430 | } |
| 5434 | 5431 | ||
| 5435 | static void mlx5_ib_stage_uar_cleanup(struct mlx5_ib_dev *dev) | 5432 | static void mlx5_ib_stage_uar_cleanup(struct mlx5_ib_dev *dev) |
diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index 1520a2f20f98..90a9c461cedc 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c | |||
| @@ -866,25 +866,28 @@ static int mr_umem_get(struct ib_pd *pd, u64 start, u64 length, | |||
| 866 | int *order) | 866 | int *order) |
| 867 | { | 867 | { |
| 868 | struct mlx5_ib_dev *dev = to_mdev(pd->device); | 868 | struct mlx5_ib_dev *dev = to_mdev(pd->device); |
| 869 | struct ib_umem *u; | ||
| 869 | int err; | 870 | int err; |
| 870 | 871 | ||
| 871 | *umem = ib_umem_get(pd->uobject->context, start, length, | 872 | *umem = NULL; |
| 872 | access_flags, 0); | 873 | |
| 873 | err = PTR_ERR_OR_ZERO(*umem); | 874 | u = ib_umem_get(pd->uobject->context, start, length, access_flags, 0); |
| 875 | err = PTR_ERR_OR_ZERO(u); | ||
| 874 | if (err) { | 876 | if (err) { |
| 875 | *umem = NULL; | 877 | mlx5_ib_dbg(dev, "umem get failed (%d)\n", err); |
| 876 | mlx5_ib_err(dev, "umem get failed (%d)\n", err); | ||
| 877 | return err; | 878 | return err; |
| 878 | } | 879 | } |
| 879 | 880 | ||
| 880 | mlx5_ib_cont_pages(*umem, start, MLX5_MKEY_PAGE_SHIFT_MASK, npages, | 881 | mlx5_ib_cont_pages(u, start, MLX5_MKEY_PAGE_SHIFT_MASK, npages, |
| 881 | page_shift, ncont, order); | 882 | page_shift, ncont, order); |
| 882 | if (!*npages) { | 883 | if (!*npages) { |
| 883 | mlx5_ib_warn(dev, "avoid zero region\n"); | 884 | mlx5_ib_warn(dev, "avoid zero region\n"); |
| 884 | ib_umem_release(*umem); | 885 | ib_umem_release(u); |
| 885 | return -EINVAL; | 886 | return -EINVAL; |
| 886 | } | 887 | } |
| 887 | 888 | ||
| 889 | *umem = u; | ||
| 890 | |||
| 888 | mlx5_ib_dbg(dev, "npages %d, ncont %d, order %d, page_shift %d\n", | 891 | mlx5_ib_dbg(dev, "npages %d, ncont %d, order %d, page_shift %d\n", |
| 889 | *npages, *ncont, *order, *page_shift); | 892 | *npages, *ncont, *order, *page_shift); |
| 890 | 893 | ||
| @@ -1458,13 +1461,12 @@ int mlx5_ib_rereg_user_mr(struct ib_mr *ib_mr, int flags, u64 start, | |||
| 1458 | int access_flags = flags & IB_MR_REREG_ACCESS ? | 1461 | int access_flags = flags & IB_MR_REREG_ACCESS ? |
| 1459 | new_access_flags : | 1462 | new_access_flags : |
| 1460 | mr->access_flags; | 1463 | mr->access_flags; |
| 1461 | u64 addr = (flags & IB_MR_REREG_TRANS) ? virt_addr : mr->umem->address; | ||
| 1462 | u64 len = (flags & IB_MR_REREG_TRANS) ? length : mr->umem->length; | ||
| 1463 | int page_shift = 0; | 1464 | int page_shift = 0; |
| 1464 | int upd_flags = 0; | 1465 | int upd_flags = 0; |
| 1465 | int npages = 0; | 1466 | int npages = 0; |
| 1466 | int ncont = 0; | 1467 | int ncont = 0; |
| 1467 | int order = 0; | 1468 | int order = 0; |
| 1469 | u64 addr, len; | ||
| 1468 | int err; | 1470 | int err; |
| 1469 | 1471 | ||
| 1470 | mlx5_ib_dbg(dev, "start 0x%llx, virt_addr 0x%llx, length 0x%llx, access_flags 0x%x\n", | 1472 | mlx5_ib_dbg(dev, "start 0x%llx, virt_addr 0x%llx, length 0x%llx, access_flags 0x%x\n", |
| @@ -1472,6 +1474,17 @@ int mlx5_ib_rereg_user_mr(struct ib_mr *ib_mr, int flags, u64 start, | |||
| 1472 | 1474 | ||
| 1473 | atomic_sub(mr->npages, &dev->mdev->priv.reg_pages); | 1475 | atomic_sub(mr->npages, &dev->mdev->priv.reg_pages); |
| 1474 | 1476 | ||
| 1477 | if (!mr->umem) | ||
| 1478 | return -EINVAL; | ||
| 1479 | |||
| 1480 | if (flags & IB_MR_REREG_TRANS) { | ||
| 1481 | addr = virt_addr; | ||
| 1482 | len = length; | ||
| 1483 | } else { | ||
| 1484 | addr = mr->umem->address; | ||
| 1485 | len = mr->umem->length; | ||
| 1486 | } | ||
| 1487 | |||
| 1475 | if (flags != IB_MR_REREG_PD) { | 1488 | if (flags != IB_MR_REREG_PD) { |
| 1476 | /* | 1489 | /* |
| 1477 | * Replace umem. This needs to be done whether or not UMR is | 1490 | * Replace umem. This needs to be done whether or not UMR is |
| @@ -1479,6 +1492,7 @@ int mlx5_ib_rereg_user_mr(struct ib_mr *ib_mr, int flags, u64 start, | |||
| 1479 | */ | 1492 | */ |
| 1480 | flags |= IB_MR_REREG_TRANS; | 1493 | flags |= IB_MR_REREG_TRANS; |
| 1481 | ib_umem_release(mr->umem); | 1494 | ib_umem_release(mr->umem); |
| 1495 | mr->umem = NULL; | ||
| 1482 | err = mr_umem_get(pd, addr, len, access_flags, &mr->umem, | 1496 | err = mr_umem_get(pd, addr, len, access_flags, &mr->umem, |
| 1483 | &npages, &page_shift, &ncont, &order); | 1497 | &npages, &page_shift, &ncont, &order); |
| 1484 | if (err) | 1498 | if (err) |
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index 7ed4b70f6447..87b7c1be2a11 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c | |||
| @@ -259,7 +259,11 @@ static int set_rq_size(struct mlx5_ib_dev *dev, struct ib_qp_cap *cap, | |||
| 259 | } else { | 259 | } else { |
| 260 | if (ucmd) { | 260 | if (ucmd) { |
| 261 | qp->rq.wqe_cnt = ucmd->rq_wqe_count; | 261 | qp->rq.wqe_cnt = ucmd->rq_wqe_count; |
| 262 | if (ucmd->rq_wqe_shift > BITS_PER_BYTE * sizeof(ucmd->rq_wqe_shift)) | ||
| 263 | return -EINVAL; | ||
| 262 | qp->rq.wqe_shift = ucmd->rq_wqe_shift; | 264 | qp->rq.wqe_shift = ucmd->rq_wqe_shift; |
| 265 | if ((1 << qp->rq.wqe_shift) / sizeof(struct mlx5_wqe_data_seg) < qp->wq_sig) | ||
| 266 | return -EINVAL; | ||
| 263 | qp->rq.max_gs = (1 << qp->rq.wqe_shift) / sizeof(struct mlx5_wqe_data_seg) - qp->wq_sig; | 267 | qp->rq.max_gs = (1 << qp->rq.wqe_shift) / sizeof(struct mlx5_wqe_data_seg) - qp->wq_sig; |
| 264 | qp->rq.max_post = qp->rq.wqe_cnt; | 268 | qp->rq.max_post = qp->rq.wqe_cnt; |
| 265 | } else { | 269 | } else { |
| @@ -2451,18 +2455,18 @@ enum { | |||
| 2451 | 2455 | ||
| 2452 | static int ib_rate_to_mlx5(struct mlx5_ib_dev *dev, u8 rate) | 2456 | static int ib_rate_to_mlx5(struct mlx5_ib_dev *dev, u8 rate) |
| 2453 | { | 2457 | { |
| 2454 | if (rate == IB_RATE_PORT_CURRENT) { | 2458 | if (rate == IB_RATE_PORT_CURRENT) |
| 2455 | return 0; | 2459 | return 0; |
| 2456 | } else if (rate < IB_RATE_2_5_GBPS || rate > IB_RATE_300_GBPS) { | 2460 | |
| 2461 | if (rate < IB_RATE_2_5_GBPS || rate > IB_RATE_300_GBPS) | ||
| 2457 | return -EINVAL; | 2462 | return -EINVAL; |
| 2458 | } else { | ||
| 2459 | while (rate != IB_RATE_2_5_GBPS && | ||
| 2460 | !(1 << (rate + MLX5_STAT_RATE_OFFSET) & | ||
| 2461 | MLX5_CAP_GEN(dev->mdev, stat_rate_support))) | ||
| 2462 | --rate; | ||
| 2463 | } | ||
| 2464 | 2463 | ||
| 2465 | return rate + MLX5_STAT_RATE_OFFSET; | 2464 | while (rate != IB_RATE_PORT_CURRENT && |
| 2465 | !(1 << (rate + MLX5_STAT_RATE_OFFSET) & | ||
| 2466 | MLX5_CAP_GEN(dev->mdev, stat_rate_support))) | ||
| 2467 | --rate; | ||
| 2468 | |||
| 2469 | return rate ? rate + MLX5_STAT_RATE_OFFSET : rate; | ||
| 2466 | } | 2470 | } |
| 2467 | 2471 | ||
| 2468 | static int modify_raw_packet_eth_prio(struct mlx5_core_dev *dev, | 2472 | static int modify_raw_packet_eth_prio(struct mlx5_core_dev *dev, |
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c index 0a75164cedea..007d5e8a0121 100644 --- a/drivers/infiniband/hw/nes/nes_nic.c +++ b/drivers/infiniband/hw/nes/nes_nic.c | |||
| @@ -461,7 +461,7 @@ static bool nes_nic_send(struct sk_buff *skb, struct net_device *netdev) | |||
| 461 | /** | 461 | /** |
| 462 | * nes_netdev_start_xmit | 462 | * nes_netdev_start_xmit |
| 463 | */ | 463 | */ |
| 464 | static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev) | 464 | static netdev_tx_t nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev) |
| 465 | { | 465 | { |
| 466 | struct nes_vnic *nesvnic = netdev_priv(netdev); | 466 | struct nes_vnic *nesvnic = netdev_priv(netdev); |
| 467 | struct nes_device *nesdev = nesvnic->nesdev; | 467 | struct nes_device *nesdev = nesvnic->nesdev; |
diff --git a/drivers/infiniband/sw/rxe/rxe_opcode.c b/drivers/infiniband/sw/rxe/rxe_opcode.c index 61927c165b59..4cf11063e0b5 100644 --- a/drivers/infiniband/sw/rxe/rxe_opcode.c +++ b/drivers/infiniband/sw/rxe/rxe_opcode.c | |||
| @@ -390,7 +390,7 @@ struct rxe_opcode_info rxe_opcode[RXE_NUM_OPCODE] = { | |||
| 390 | .name = "IB_OPCODE_RC_SEND_ONLY_INV", | 390 | .name = "IB_OPCODE_RC_SEND_ONLY_INV", |
| 391 | .mask = RXE_IETH_MASK | RXE_PAYLOAD_MASK | RXE_REQ_MASK | 391 | .mask = RXE_IETH_MASK | RXE_PAYLOAD_MASK | RXE_REQ_MASK |
| 392 | | RXE_COMP_MASK | RXE_RWR_MASK | RXE_SEND_MASK | 392 | | RXE_COMP_MASK | RXE_RWR_MASK | RXE_SEND_MASK |
| 393 | | RXE_END_MASK, | 393 | | RXE_END_MASK | RXE_START_MASK, |
| 394 | .length = RXE_BTH_BYTES + RXE_IETH_BYTES, | 394 | .length = RXE_BTH_BYTES + RXE_IETH_BYTES, |
| 395 | .offset = { | 395 | .offset = { |
| 396 | [RXE_BTH] = 0, | 396 | [RXE_BTH] = 0, |
diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c index 7bdaf71b8221..785199990457 100644 --- a/drivers/infiniband/sw/rxe/rxe_req.c +++ b/drivers/infiniband/sw/rxe/rxe_req.c | |||
| @@ -728,7 +728,6 @@ next_wqe: | |||
| 728 | rollback_state(wqe, qp, &rollback_wqe, rollback_psn); | 728 | rollback_state(wqe, qp, &rollback_wqe, rollback_psn); |
| 729 | 729 | ||
| 730 | if (ret == -EAGAIN) { | 730 | if (ret == -EAGAIN) { |
| 731 | kfree_skb(skb); | ||
| 732 | rxe_run_task(&qp->req.task, 1); | 731 | rxe_run_task(&qp->req.task, 1); |
| 733 | goto exit; | 732 | goto exit; |
| 734 | } | 733 | } |
diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c index a65c9969f7fc..955ff3b6da9c 100644 --- a/drivers/infiniband/sw/rxe/rxe_resp.c +++ b/drivers/infiniband/sw/rxe/rxe_resp.c | |||
| @@ -742,7 +742,6 @@ static enum resp_states read_reply(struct rxe_qp *qp, | |||
| 742 | err = rxe_xmit_packet(rxe, qp, &ack_pkt, skb); | 742 | err = rxe_xmit_packet(rxe, qp, &ack_pkt, skb); |
| 743 | if (err) { | 743 | if (err) { |
| 744 | pr_err("Failed sending RDMA reply.\n"); | 744 | pr_err("Failed sending RDMA reply.\n"); |
| 745 | kfree_skb(skb); | ||
| 746 | return RESPST_ERR_RNR; | 745 | return RESPST_ERR_RNR; |
| 747 | } | 746 | } |
| 748 | 747 | ||
| @@ -954,10 +953,8 @@ static int send_ack(struct rxe_qp *qp, struct rxe_pkt_info *pkt, | |||
| 954 | } | 953 | } |
| 955 | 954 | ||
| 956 | err = rxe_xmit_packet(rxe, qp, &ack_pkt, skb); | 955 | err = rxe_xmit_packet(rxe, qp, &ack_pkt, skb); |
| 957 | if (err) { | 956 | if (err) |
| 958 | pr_err_ratelimited("Failed sending ack\n"); | 957 | pr_err_ratelimited("Failed sending ack\n"); |
| 959 | kfree_skb(skb); | ||
| 960 | } | ||
| 961 | 958 | ||
| 962 | err1: | 959 | err1: |
| 963 | return err; | 960 | return err; |
| @@ -1141,7 +1138,6 @@ static enum resp_states duplicate_request(struct rxe_qp *qp, | |||
| 1141 | if (rc) { | 1138 | if (rc) { |
| 1142 | pr_err("Failed resending result. This flow is not handled - skb ignored\n"); | 1139 | pr_err("Failed resending result. This flow is not handled - skb ignored\n"); |
| 1143 | rxe_drop_ref(qp); | 1140 | rxe_drop_ref(qp); |
| 1144 | kfree_skb(skb_copy); | ||
| 1145 | rc = RESPST_CLEANUP; | 1141 | rc = RESPST_CLEANUP; |
| 1146 | goto out; | 1142 | goto out; |
| 1147 | } | 1143 | } |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 161ba8c76285..cf291f90b58f 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
| @@ -1094,7 +1094,7 @@ drop_and_unlock: | |||
| 1094 | spin_unlock_irqrestore(&priv->lock, flags); | 1094 | spin_unlock_irqrestore(&priv->lock, flags); |
| 1095 | } | 1095 | } |
| 1096 | 1096 | ||
| 1097 | static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1097 | static netdev_tx_t ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) |
| 1098 | { | 1098 | { |
| 1099 | struct ipoib_dev_priv *priv = ipoib_priv(dev); | 1099 | struct ipoib_dev_priv *priv = ipoib_priv(dev); |
| 1100 | struct rdma_netdev *rn = netdev_priv(dev); | 1100 | struct rdma_netdev *rn = netdev_priv(dev); |
diff --git a/drivers/infiniband/ulp/srp/Kconfig b/drivers/infiniband/ulp/srp/Kconfig index c74ee9633041..99db8fe5173a 100644 --- a/drivers/infiniband/ulp/srp/Kconfig +++ b/drivers/infiniband/ulp/srp/Kconfig | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | config INFINIBAND_SRP | 1 | config INFINIBAND_SRP |
| 2 | tristate "InfiniBand SCSI RDMA Protocol" | 2 | tristate "InfiniBand SCSI RDMA Protocol" |
| 3 | depends on SCSI | 3 | depends on SCSI && INFINIBAND_ADDR_TRANS |
| 4 | select SCSI_SRP_ATTRS | 4 | select SCSI_SRP_ATTRS |
| 5 | ---help--- | 5 | ---help--- |
| 6 | Support for the SCSI RDMA Protocol over InfiniBand. This | 6 | Support for the SCSI RDMA Protocol over InfiniBand. This |
diff --git a/drivers/infiniband/ulp/srpt/Kconfig b/drivers/infiniband/ulp/srpt/Kconfig index 31ee83d528d9..fb8b7182f05e 100644 --- a/drivers/infiniband/ulp/srpt/Kconfig +++ b/drivers/infiniband/ulp/srpt/Kconfig | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | config INFINIBAND_SRPT | 1 | config INFINIBAND_SRPT |
| 2 | tristate "InfiniBand SCSI RDMA Protocol target support" | 2 | tristate "InfiniBand SCSI RDMA Protocol target support" |
| 3 | depends on INFINIBAND && TARGET_CORE | 3 | depends on INFINIBAND && INFINIBAND_ADDR_TRANS && TARGET_CORE |
| 4 | ---help--- | 4 | ---help--- |
| 5 | 5 | ||
| 6 | Support for the SCSI RDMA Protocol (SRP) Target driver. The | 6 | Support for the SCSI RDMA Protocol (SRP) Target driver. The |
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 2a99f0f14795..8fb8c737fffe 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
| @@ -83,7 +83,6 @@ | |||
| 83 | 83 | ||
| 84 | static DEFINE_SPINLOCK(amd_iommu_devtable_lock); | 84 | static DEFINE_SPINLOCK(amd_iommu_devtable_lock); |
| 85 | static DEFINE_SPINLOCK(pd_bitmap_lock); | 85 | static DEFINE_SPINLOCK(pd_bitmap_lock); |
| 86 | static DEFINE_SPINLOCK(iommu_table_lock); | ||
| 87 | 86 | ||
| 88 | /* List of all available dev_data structures */ | 87 | /* List of all available dev_data structures */ |
| 89 | static LLIST_HEAD(dev_data_list); | 88 | static LLIST_HEAD(dev_data_list); |
| @@ -3562,6 +3561,7 @@ EXPORT_SYMBOL(amd_iommu_device_info); | |||
| 3562 | *****************************************************************************/ | 3561 | *****************************************************************************/ |
| 3563 | 3562 | ||
| 3564 | static struct irq_chip amd_ir_chip; | 3563 | static struct irq_chip amd_ir_chip; |
| 3564 | static DEFINE_SPINLOCK(iommu_table_lock); | ||
| 3565 | 3565 | ||
| 3566 | static void set_dte_irq_entry(u16 devid, struct irq_remap_table *table) | 3566 | static void set_dte_irq_entry(u16 devid, struct irq_remap_table *table) |
| 3567 | { | 3567 | { |
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index f05f3cf90756..ddcbbdb5d658 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c | |||
| @@ -167,40 +167,16 @@ EXPORT_SYMBOL(iommu_put_dma_cookie); | |||
| 167 | * @list: Reserved region list from iommu_get_resv_regions() | 167 | * @list: Reserved region list from iommu_get_resv_regions() |
| 168 | * | 168 | * |
| 169 | * IOMMU drivers can use this to implement their .get_resv_regions callback | 169 | * IOMMU drivers can use this to implement their .get_resv_regions callback |
| 170 | * for general non-IOMMU-specific reservations. Currently, this covers host | 170 | * for general non-IOMMU-specific reservations. Currently, this covers GICv3 |
| 171 | * bridge windows for PCI devices and GICv3 ITS region reservation on ACPI | 171 | * ITS region reservation on ACPI based ARM platforms that may require HW MSI |
| 172 | * based ARM platforms that may require HW MSI reservation. | 172 | * reservation. |
| 173 | */ | 173 | */ |
| 174 | void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list) | 174 | void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list) |
| 175 | { | 175 | { |
| 176 | struct pci_host_bridge *bridge; | ||
| 177 | struct resource_entry *window; | ||
| 178 | |||
| 179 | if (!is_of_node(dev->iommu_fwspec->iommu_fwnode) && | ||
| 180 | iort_iommu_msi_get_resv_regions(dev, list) < 0) | ||
| 181 | return; | ||
| 182 | |||
| 183 | if (!dev_is_pci(dev)) | ||
| 184 | return; | ||
| 185 | |||
| 186 | bridge = pci_find_host_bridge(to_pci_dev(dev)->bus); | ||
| 187 | resource_list_for_each_entry(window, &bridge->windows) { | ||
| 188 | struct iommu_resv_region *region; | ||
| 189 | phys_addr_t start; | ||
| 190 | size_t length; | ||
| 191 | |||
| 192 | if (resource_type(window->res) != IORESOURCE_MEM) | ||
| 193 | continue; | ||
| 194 | 176 | ||
| 195 | start = window->res->start - window->offset; | 177 | if (!is_of_node(dev->iommu_fwspec->iommu_fwnode)) |
| 196 | length = window->res->end - window->res->start + 1; | 178 | iort_iommu_msi_get_resv_regions(dev, list); |
| 197 | region = iommu_alloc_resv_region(start, length, 0, | ||
| 198 | IOMMU_RESV_RESERVED); | ||
| 199 | if (!region) | ||
| 200 | return; | ||
| 201 | 179 | ||
| 202 | list_add_tail(®ion->list, list); | ||
| 203 | } | ||
| 204 | } | 180 | } |
| 205 | EXPORT_SYMBOL(iommu_dma_get_resv_regions); | 181 | EXPORT_SYMBOL(iommu_dma_get_resv_regions); |
| 206 | 182 | ||
| @@ -229,6 +205,23 @@ static int cookie_init_hw_msi_region(struct iommu_dma_cookie *cookie, | |||
| 229 | return 0; | 205 | return 0; |
| 230 | } | 206 | } |
| 231 | 207 | ||
| 208 | static void iova_reserve_pci_windows(struct pci_dev *dev, | ||
| 209 | struct iova_domain *iovad) | ||
| 210 | { | ||
| 211 | struct pci_host_bridge *bridge = pci_find_host_bridge(dev->bus); | ||
| 212 | struct resource_entry *window; | ||
| 213 | unsigned long lo, hi; | ||
| 214 | |||
| 215 | resource_list_for_each_entry(window, &bridge->windows) { | ||
| 216 | if (resource_type(window->res) != IORESOURCE_MEM) | ||
| 217 | continue; | ||
| 218 | |||
| 219 | lo = iova_pfn(iovad, window->res->start - window->offset); | ||
| 220 | hi = iova_pfn(iovad, window->res->end - window->offset); | ||
| 221 | reserve_iova(iovad, lo, hi); | ||
| 222 | } | ||
| 223 | } | ||
| 224 | |||
| 232 | static int iova_reserve_iommu_regions(struct device *dev, | 225 | static int iova_reserve_iommu_regions(struct device *dev, |
| 233 | struct iommu_domain *domain) | 226 | struct iommu_domain *domain) |
| 234 | { | 227 | { |
| @@ -238,6 +231,9 @@ static int iova_reserve_iommu_regions(struct device *dev, | |||
| 238 | LIST_HEAD(resv_regions); | 231 | LIST_HEAD(resv_regions); |
| 239 | int ret = 0; | 232 | int ret = 0; |
| 240 | 233 | ||
| 234 | if (dev_is_pci(dev)) | ||
| 235 | iova_reserve_pci_windows(to_pci_dev(dev), iovad); | ||
| 236 | |||
| 241 | iommu_get_resv_regions(dev, &resv_regions); | 237 | iommu_get_resv_regions(dev, &resv_regions); |
| 242 | list_for_each_entry(region, &resv_regions, list) { | 238 | list_for_each_entry(region, &resv_regions, list) { |
| 243 | unsigned long lo, hi; | 239 | unsigned long lo, hi; |
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index accf58388bdb..460bed4fc5b1 100644 --- a/drivers/iommu/dmar.c +++ b/drivers/iommu/dmar.c | |||
| @@ -1345,7 +1345,7 @@ void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep, | |||
| 1345 | struct qi_desc desc; | 1345 | struct qi_desc desc; |
| 1346 | 1346 | ||
| 1347 | if (mask) { | 1347 | if (mask) { |
| 1348 | BUG_ON(addr & ((1 << (VTD_PAGE_SHIFT + mask)) - 1)); | 1348 | WARN_ON_ONCE(addr & ((1ULL << (VTD_PAGE_SHIFT + mask)) - 1)); |
| 1349 | addr |= (1ULL << (VTD_PAGE_SHIFT + mask - 1)) - 1; | 1349 | addr |= (1ULL << (VTD_PAGE_SHIFT + mask - 1)) - 1; |
| 1350 | desc.high = QI_DEV_IOTLB_ADDR(addr) | QI_DEV_IOTLB_SIZE; | 1350 | desc.high = QI_DEV_IOTLB_ADDR(addr) | QI_DEV_IOTLB_SIZE; |
| 1351 | } else | 1351 | } else |
diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c index 66f69af2c219..3062a154a9fb 100644 --- a/drivers/iommu/intel_irq_remapping.c +++ b/drivers/iommu/intel_irq_remapping.c | |||
| @@ -1136,7 +1136,7 @@ static void intel_ir_reconfigure_irte(struct irq_data *irqd, bool force) | |||
| 1136 | irte->dest_id = IRTE_DEST(cfg->dest_apicid); | 1136 | irte->dest_id = IRTE_DEST(cfg->dest_apicid); |
| 1137 | 1137 | ||
| 1138 | /* Update the hardware only if the interrupt is in remapped mode. */ | 1138 | /* Update the hardware only if the interrupt is in remapped mode. */ |
| 1139 | if (!force || ir_data->irq_2_iommu.mode == IRQ_REMAPPING) | 1139 | if (force || ir_data->irq_2_iommu.mode == IRQ_REMAPPING) |
| 1140 | modify_irte(&ir_data->irq_2_iommu, irte); | 1140 | modify_irte(&ir_data->irq_2_iommu, irte); |
| 1141 | } | 1141 | } |
| 1142 | 1142 | ||
diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 5fc8656c60f9..0468acfa131f 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c | |||
| @@ -1098,7 +1098,7 @@ static int rk_iommu_of_xlate(struct device *dev, | |||
| 1098 | data->iommu = platform_get_drvdata(iommu_dev); | 1098 | data->iommu = platform_get_drvdata(iommu_dev); |
| 1099 | dev->archdata.iommu = data; | 1099 | dev->archdata.iommu = data; |
| 1100 | 1100 | ||
| 1101 | of_dev_put(iommu_dev); | 1101 | platform_device_put(iommu_dev); |
| 1102 | 1102 | ||
| 1103 | return 0; | 1103 | return 0; |
| 1104 | } | 1104 | } |
| @@ -1175,8 +1175,15 @@ static int rk_iommu_probe(struct platform_device *pdev) | |||
| 1175 | for (i = 0; i < iommu->num_clocks; ++i) | 1175 | for (i = 0; i < iommu->num_clocks; ++i) |
| 1176 | iommu->clocks[i].id = rk_iommu_clocks[i]; | 1176 | iommu->clocks[i].id = rk_iommu_clocks[i]; |
| 1177 | 1177 | ||
| 1178 | /* | ||
| 1179 | * iommu clocks should be present for all new devices and devicetrees | ||
| 1180 | * but there are older devicetrees without clocks out in the wild. | ||
| 1181 | * So clocks as optional for the time being. | ||
| 1182 | */ | ||
| 1178 | err = devm_clk_bulk_get(iommu->dev, iommu->num_clocks, iommu->clocks); | 1183 | err = devm_clk_bulk_get(iommu->dev, iommu->num_clocks, iommu->clocks); |
| 1179 | if (err) | 1184 | if (err == -ENOENT) |
| 1185 | iommu->num_clocks = 0; | ||
| 1186 | else if (err) | ||
| 1180 | return err; | 1187 | return err; |
| 1181 | 1188 | ||
| 1182 | err = clk_bulk_prepare(iommu->num_clocks, iommu->clocks); | 1189 | err = clk_bulk_prepare(iommu->num_clocks, iommu->clocks); |
diff --git a/drivers/irqchip/qcom-irq-combiner.c b/drivers/irqchip/qcom-irq-combiner.c index f31265937439..7f0c0be322e0 100644 --- a/drivers/irqchip/qcom-irq-combiner.c +++ b/drivers/irqchip/qcom-irq-combiner.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. | 1 | /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. |
| 2 | * | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify | 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and | 4 | * it under the terms of the GNU General Public License version 2 and |
| @@ -68,7 +68,7 @@ static void combiner_handle_irq(struct irq_desc *desc) | |||
| 68 | 68 | ||
| 69 | bit = readl_relaxed(combiner->regs[reg].addr); | 69 | bit = readl_relaxed(combiner->regs[reg].addr); |
| 70 | status = bit & combiner->regs[reg].enabled; | 70 | status = bit & combiner->regs[reg].enabled; |
| 71 | if (!status) | 71 | if (bit && !status) |
| 72 | pr_warn_ratelimited("Unexpected IRQ on CPU%d: (%08x %08lx %p)\n", | 72 | pr_warn_ratelimited("Unexpected IRQ on CPU%d: (%08x %08lx %p)\n", |
| 73 | smp_processor_id(), bit, | 73 | smp_processor_id(), bit, |
| 74 | combiner->regs[reg].enabled, | 74 | combiner->regs[reg].enabled, |
diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c index 004cc3cc6123..7fa2631b422c 100644 --- a/drivers/md/bcache/alloc.c +++ b/drivers/md/bcache/alloc.c | |||
| @@ -290,7 +290,7 @@ do { \ | |||
| 290 | if (kthread_should_stop() || \ | 290 | if (kthread_should_stop() || \ |
| 291 | test_bit(CACHE_SET_IO_DISABLE, &ca->set->flags)) { \ | 291 | test_bit(CACHE_SET_IO_DISABLE, &ca->set->flags)) { \ |
| 292 | set_current_state(TASK_RUNNING); \ | 292 | set_current_state(TASK_RUNNING); \ |
| 293 | return 0; \ | 293 | goto out; \ |
| 294 | } \ | 294 | } \ |
| 295 | \ | 295 | \ |
| 296 | schedule(); \ | 296 | schedule(); \ |
| @@ -378,6 +378,9 @@ retry_invalidate: | |||
| 378 | bch_prio_write(ca); | 378 | bch_prio_write(ca); |
| 379 | } | 379 | } |
| 380 | } | 380 | } |
| 381 | out: | ||
| 382 | wait_for_kthread_stop(); | ||
| 383 | return 0; | ||
| 381 | } | 384 | } |
| 382 | 385 | ||
| 383 | /* Allocation */ | 386 | /* Allocation */ |
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h index d338b7086013..3a0cfb237af9 100644 --- a/drivers/md/bcache/bcache.h +++ b/drivers/md/bcache/bcache.h | |||
| @@ -392,6 +392,8 @@ struct cached_dev { | |||
| 392 | #define DEFAULT_CACHED_DEV_ERROR_LIMIT 64 | 392 | #define DEFAULT_CACHED_DEV_ERROR_LIMIT 64 |
| 393 | atomic_t io_errors; | 393 | atomic_t io_errors; |
| 394 | unsigned error_limit; | 394 | unsigned error_limit; |
| 395 | |||
| 396 | char backing_dev_name[BDEVNAME_SIZE]; | ||
| 395 | }; | 397 | }; |
| 396 | 398 | ||
| 397 | enum alloc_reserve { | 399 | enum alloc_reserve { |
| @@ -464,6 +466,8 @@ struct cache { | |||
| 464 | atomic_long_t meta_sectors_written; | 466 | atomic_long_t meta_sectors_written; |
| 465 | atomic_long_t btree_sectors_written; | 467 | atomic_long_t btree_sectors_written; |
| 466 | atomic_long_t sectors_written; | 468 | atomic_long_t sectors_written; |
| 469 | |||
| 470 | char cache_dev_name[BDEVNAME_SIZE]; | ||
| 467 | }; | 471 | }; |
| 468 | 472 | ||
| 469 | struct gc_stat { | 473 | struct gc_stat { |
diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c index 028f7b386e01..4e63c6f6c04d 100644 --- a/drivers/md/bcache/debug.c +++ b/drivers/md/bcache/debug.c | |||
| @@ -106,7 +106,6 @@ void bch_btree_verify(struct btree *b) | |||
| 106 | 106 | ||
| 107 | void bch_data_verify(struct cached_dev *dc, struct bio *bio) | 107 | void bch_data_verify(struct cached_dev *dc, struct bio *bio) |
| 108 | { | 108 | { |
| 109 | char name[BDEVNAME_SIZE]; | ||
| 110 | struct bio *check; | 109 | struct bio *check; |
| 111 | struct bio_vec bv, cbv; | 110 | struct bio_vec bv, cbv; |
| 112 | struct bvec_iter iter, citer = { 0 }; | 111 | struct bvec_iter iter, citer = { 0 }; |
| @@ -134,7 +133,7 @@ void bch_data_verify(struct cached_dev *dc, struct bio *bio) | |||
| 134 | bv.bv_len), | 133 | bv.bv_len), |
| 135 | dc->disk.c, | 134 | dc->disk.c, |
| 136 | "verify failed at dev %s sector %llu", | 135 | "verify failed at dev %s sector %llu", |
| 137 | bdevname(dc->bdev, name), | 136 | dc->backing_dev_name, |
| 138 | (uint64_t) bio->bi_iter.bi_sector); | 137 | (uint64_t) bio->bi_iter.bi_sector); |
| 139 | 138 | ||
| 140 | kunmap_atomic(p1); | 139 | kunmap_atomic(p1); |
diff --git a/drivers/md/bcache/io.c b/drivers/md/bcache/io.c index 7fac97ae036e..2ddf8515e6a5 100644 --- a/drivers/md/bcache/io.c +++ b/drivers/md/bcache/io.c | |||
| @@ -52,7 +52,6 @@ void bch_submit_bbio(struct bio *bio, struct cache_set *c, | |||
| 52 | /* IO errors */ | 52 | /* IO errors */ |
| 53 | void bch_count_backing_io_errors(struct cached_dev *dc, struct bio *bio) | 53 | void bch_count_backing_io_errors(struct cached_dev *dc, struct bio *bio) |
| 54 | { | 54 | { |
| 55 | char buf[BDEVNAME_SIZE]; | ||
| 56 | unsigned errors; | 55 | unsigned errors; |
| 57 | 56 | ||
| 58 | WARN_ONCE(!dc, "NULL pointer of struct cached_dev"); | 57 | WARN_ONCE(!dc, "NULL pointer of struct cached_dev"); |
| @@ -60,7 +59,7 @@ void bch_count_backing_io_errors(struct cached_dev *dc, struct bio *bio) | |||
| 60 | errors = atomic_add_return(1, &dc->io_errors); | 59 | errors = atomic_add_return(1, &dc->io_errors); |
| 61 | if (errors < dc->error_limit) | 60 | if (errors < dc->error_limit) |
| 62 | pr_err("%s: IO error on backing device, unrecoverable", | 61 | pr_err("%s: IO error on backing device, unrecoverable", |
| 63 | bio_devname(bio, buf)); | 62 | dc->backing_dev_name); |
| 64 | else | 63 | else |
| 65 | bch_cached_dev_error(dc); | 64 | bch_cached_dev_error(dc); |
| 66 | } | 65 | } |
| @@ -105,19 +104,18 @@ void bch_count_io_errors(struct cache *ca, | |||
| 105 | } | 104 | } |
| 106 | 105 | ||
| 107 | if (error) { | 106 | if (error) { |
| 108 | char buf[BDEVNAME_SIZE]; | ||
| 109 | unsigned errors = atomic_add_return(1 << IO_ERROR_SHIFT, | 107 | unsigned errors = atomic_add_return(1 << IO_ERROR_SHIFT, |
| 110 | &ca->io_errors); | 108 | &ca->io_errors); |
| 111 | errors >>= IO_ERROR_SHIFT; | 109 | errors >>= IO_ERROR_SHIFT; |
| 112 | 110 | ||
| 113 | if (errors < ca->set->error_limit) | 111 | if (errors < ca->set->error_limit) |
| 114 | pr_err("%s: IO error on %s%s", | 112 | pr_err("%s: IO error on %s%s", |
| 115 | bdevname(ca->bdev, buf), m, | 113 | ca->cache_dev_name, m, |
| 116 | is_read ? ", recovering." : "."); | 114 | is_read ? ", recovering." : "."); |
| 117 | else | 115 | else |
| 118 | bch_cache_set_error(ca->set, | 116 | bch_cache_set_error(ca->set, |
| 119 | "%s: too many IO errors %s", | 117 | "%s: too many IO errors %s", |
| 120 | bdevname(ca->bdev, buf), m); | 118 | ca->cache_dev_name, m); |
| 121 | } | 119 | } |
| 122 | } | 120 | } |
| 123 | 121 | ||
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index a65e3365eeb9..8e3e8655ed63 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c | |||
| @@ -649,11 +649,8 @@ static void backing_request_endio(struct bio *bio) | |||
| 649 | */ | 649 | */ |
| 650 | if (unlikely(s->iop.writeback && | 650 | if (unlikely(s->iop.writeback && |
| 651 | bio->bi_opf & REQ_PREFLUSH)) { | 651 | bio->bi_opf & REQ_PREFLUSH)) { |
| 652 | char buf[BDEVNAME_SIZE]; | ||
| 653 | |||
| 654 | bio_devname(bio, buf); | ||
| 655 | pr_err("Can't flush %s: returned bi_status %i", | 652 | pr_err("Can't flush %s: returned bi_status %i", |
| 656 | buf, bio->bi_status); | 653 | dc->backing_dev_name, bio->bi_status); |
| 657 | } else { | 654 | } else { |
| 658 | /* set to orig_bio->bi_status in bio_complete() */ | 655 | /* set to orig_bio->bi_status in bio_complete() */ |
| 659 | s->iop.status = bio->bi_status; | 656 | s->iop.status = bio->bi_status; |
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index d90d9e59ca00..3dea06b41d43 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c | |||
| @@ -936,7 +936,6 @@ static void cancel_writeback_rate_update_dwork(struct cached_dev *dc) | |||
| 936 | static void cached_dev_detach_finish(struct work_struct *w) | 936 | static void cached_dev_detach_finish(struct work_struct *w) |
| 937 | { | 937 | { |
| 938 | struct cached_dev *dc = container_of(w, struct cached_dev, detach); | 938 | struct cached_dev *dc = container_of(w, struct cached_dev, detach); |
| 939 | char buf[BDEVNAME_SIZE]; | ||
| 940 | struct closure cl; | 939 | struct closure cl; |
| 941 | closure_init_stack(&cl); | 940 | closure_init_stack(&cl); |
| 942 | 941 | ||
| @@ -967,7 +966,7 @@ static void cached_dev_detach_finish(struct work_struct *w) | |||
| 967 | 966 | ||
| 968 | mutex_unlock(&bch_register_lock); | 967 | mutex_unlock(&bch_register_lock); |
| 969 | 968 | ||
| 970 | pr_info("Caching disabled for %s", bdevname(dc->bdev, buf)); | 969 | pr_info("Caching disabled for %s", dc->backing_dev_name); |
| 971 | 970 | ||
| 972 | /* Drop ref we took in cached_dev_detach() */ | 971 | /* Drop ref we took in cached_dev_detach() */ |
| 973 | closure_put(&dc->disk.cl); | 972 | closure_put(&dc->disk.cl); |
| @@ -999,29 +998,28 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c, | |||
| 999 | { | 998 | { |
| 1000 | uint32_t rtime = cpu_to_le32(get_seconds()); | 999 | uint32_t rtime = cpu_to_le32(get_seconds()); |
| 1001 | struct uuid_entry *u; | 1000 | struct uuid_entry *u; |
| 1002 | char buf[BDEVNAME_SIZE]; | ||
| 1003 | struct cached_dev *exist_dc, *t; | 1001 | struct cached_dev *exist_dc, *t; |
| 1004 | 1002 | ||
| 1005 | bdevname(dc->bdev, buf); | ||
| 1006 | |||
| 1007 | if ((set_uuid && memcmp(set_uuid, c->sb.set_uuid, 16)) || | 1003 | if ((set_uuid && memcmp(set_uuid, c->sb.set_uuid, 16)) || |
| 1008 | (!set_uuid && memcmp(dc->sb.set_uuid, c->sb.set_uuid, 16))) | 1004 | (!set_uuid && memcmp(dc->sb.set_uuid, c->sb.set_uuid, 16))) |
| 1009 | return -ENOENT; | 1005 | return -ENOENT; |
| 1010 | 1006 | ||
| 1011 | if (dc->disk.c) { | 1007 | if (dc->disk.c) { |
| 1012 | pr_err("Can't attach %s: already attached", buf); | 1008 | pr_err("Can't attach %s: already attached", |
| 1009 | dc->backing_dev_name); | ||
| 1013 | return -EINVAL; | 1010 | return -EINVAL; |
| 1014 | } | 1011 | } |
| 1015 | 1012 | ||
| 1016 | if (test_bit(CACHE_SET_STOPPING, &c->flags)) { | 1013 | if (test_bit(CACHE_SET_STOPPING, &c->flags)) { |
| 1017 | pr_err("Can't attach %s: shutting down", buf); | 1014 | pr_err("Can't attach %s: shutting down", |
| 1015 | dc->backing_dev_name); | ||
| 1018 | return -EINVAL; | 1016 | return -EINVAL; |
| 1019 | } | 1017 | } |
| 1020 | 1018 | ||
| 1021 | if (dc->sb.block_size < c->sb.block_size) { | 1019 | if (dc->sb.block_size < c->sb.block_size) { |
| 1022 | /* Will die */ | 1020 | /* Will die */ |
| 1023 | pr_err("Couldn't attach %s: block size less than set's block size", | 1021 | pr_err("Couldn't attach %s: block size less than set's block size", |
| 1024 | buf); | 1022 | dc->backing_dev_name); |
| 1025 | return -EINVAL; | 1023 | return -EINVAL; |
| 1026 | } | 1024 | } |
| 1027 | 1025 | ||
| @@ -1029,7 +1027,7 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c, | |||
| 1029 | list_for_each_entry_safe(exist_dc, t, &c->cached_devs, list) { | 1027 | list_for_each_entry_safe(exist_dc, t, &c->cached_devs, list) { |
| 1030 | if (!memcmp(dc->sb.uuid, exist_dc->sb.uuid, 16)) { | 1028 | if (!memcmp(dc->sb.uuid, exist_dc->sb.uuid, 16)) { |
| 1031 | pr_err("Tried to attach %s but duplicate UUID already attached", | 1029 | pr_err("Tried to attach %s but duplicate UUID already attached", |
| 1032 | buf); | 1030 | dc->backing_dev_name); |
| 1033 | 1031 | ||
| 1034 | return -EINVAL; | 1032 | return -EINVAL; |
| 1035 | } | 1033 | } |
| @@ -1047,13 +1045,15 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c, | |||
| 1047 | 1045 | ||
| 1048 | if (!u) { | 1046 | if (!u) { |
| 1049 | if (BDEV_STATE(&dc->sb) == BDEV_STATE_DIRTY) { | 1047 | if (BDEV_STATE(&dc->sb) == BDEV_STATE_DIRTY) { |
| 1050 | pr_err("Couldn't find uuid for %s in set", buf); | 1048 | pr_err("Couldn't find uuid for %s in set", |
| 1049 | dc->backing_dev_name); | ||
| 1051 | return -ENOENT; | 1050 | return -ENOENT; |
| 1052 | } | 1051 | } |
| 1053 | 1052 | ||
| 1054 | u = uuid_find_empty(c); | 1053 | u = uuid_find_empty(c); |
| 1055 | if (!u) { | 1054 | if (!u) { |
| 1056 | pr_err("Not caching %s, no room for UUID", buf); | 1055 | pr_err("Not caching %s, no room for UUID", |
| 1056 | dc->backing_dev_name); | ||
| 1057 | return -EINVAL; | 1057 | return -EINVAL; |
| 1058 | } | 1058 | } |
| 1059 | } | 1059 | } |
| @@ -1112,7 +1112,8 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c, | |||
| 1112 | up_write(&dc->writeback_lock); | 1112 | up_write(&dc->writeback_lock); |
| 1113 | 1113 | ||
| 1114 | pr_info("Caching %s as %s on set %pU", | 1114 | pr_info("Caching %s as %s on set %pU", |
| 1115 | bdevname(dc->bdev, buf), dc->disk.disk->disk_name, | 1115 | dc->backing_dev_name, |
| 1116 | dc->disk.disk->disk_name, | ||
| 1116 | dc->disk.c->sb.set_uuid); | 1117 | dc->disk.c->sb.set_uuid); |
| 1117 | return 0; | 1118 | return 0; |
| 1118 | } | 1119 | } |
| @@ -1225,10 +1226,10 @@ static void register_bdev(struct cache_sb *sb, struct page *sb_page, | |||
| 1225 | struct block_device *bdev, | 1226 | struct block_device *bdev, |
| 1226 | struct cached_dev *dc) | 1227 | struct cached_dev *dc) |
| 1227 | { | 1228 | { |
| 1228 | char name[BDEVNAME_SIZE]; | ||
| 1229 | const char *err = "cannot allocate memory"; | 1229 | const char *err = "cannot allocate memory"; |
| 1230 | struct cache_set *c; | 1230 | struct cache_set *c; |
| 1231 | 1231 | ||
| 1232 | bdevname(bdev, dc->backing_dev_name); | ||
| 1232 | memcpy(&dc->sb, sb, sizeof(struct cache_sb)); | 1233 | memcpy(&dc->sb, sb, sizeof(struct cache_sb)); |
| 1233 | dc->bdev = bdev; | 1234 | dc->bdev = bdev; |
| 1234 | dc->bdev->bd_holder = dc; | 1235 | dc->bdev->bd_holder = dc; |
| @@ -1237,6 +1238,7 @@ static void register_bdev(struct cache_sb *sb, struct page *sb_page, | |||
| 1237 | bio_first_bvec_all(&dc->sb_bio)->bv_page = sb_page; | 1238 | bio_first_bvec_all(&dc->sb_bio)->bv_page = sb_page; |
| 1238 | get_page(sb_page); | 1239 | get_page(sb_page); |
| 1239 | 1240 | ||
| 1241 | |||
| 1240 | if (cached_dev_init(dc, sb->block_size << 9)) | 1242 | if (cached_dev_init(dc, sb->block_size << 9)) |
| 1241 | goto err; | 1243 | goto err; |
| 1242 | 1244 | ||
| @@ -1247,7 +1249,7 @@ static void register_bdev(struct cache_sb *sb, struct page *sb_page, | |||
| 1247 | if (bch_cache_accounting_add_kobjs(&dc->accounting, &dc->disk.kobj)) | 1249 | if (bch_cache_accounting_add_kobjs(&dc->accounting, &dc->disk.kobj)) |
| 1248 | goto err; | 1250 | goto err; |
| 1249 | 1251 | ||
| 1250 | pr_info("registered backing device %s", bdevname(bdev, name)); | 1252 | pr_info("registered backing device %s", dc->backing_dev_name); |
| 1251 | 1253 | ||
| 1252 | list_add(&dc->list, &uncached_devices); | 1254 | list_add(&dc->list, &uncached_devices); |
| 1253 | list_for_each_entry(c, &bch_cache_sets, list) | 1255 | list_for_each_entry(c, &bch_cache_sets, list) |
| @@ -1259,7 +1261,7 @@ static void register_bdev(struct cache_sb *sb, struct page *sb_page, | |||
| 1259 | 1261 | ||
| 1260 | return; | 1262 | return; |
| 1261 | err: | 1263 | err: |
| 1262 | pr_notice("error %s: %s", bdevname(bdev, name), err); | 1264 | pr_notice("error %s: %s", dc->backing_dev_name, err); |
| 1263 | bcache_device_stop(&dc->disk); | 1265 | bcache_device_stop(&dc->disk); |
| 1264 | } | 1266 | } |
| 1265 | 1267 | ||
| @@ -1367,7 +1369,7 @@ int bch_flash_dev_create(struct cache_set *c, uint64_t size) | |||
| 1367 | 1369 | ||
| 1368 | bool bch_cached_dev_error(struct cached_dev *dc) | 1370 | bool bch_cached_dev_error(struct cached_dev *dc) |
| 1369 | { | 1371 | { |
| 1370 | char name[BDEVNAME_SIZE]; | 1372 | struct cache_set *c; |
| 1371 | 1373 | ||
| 1372 | if (!dc || test_bit(BCACHE_DEV_CLOSING, &dc->disk.flags)) | 1374 | if (!dc || test_bit(BCACHE_DEV_CLOSING, &dc->disk.flags)) |
| 1373 | return false; | 1375 | return false; |
| @@ -1377,7 +1379,22 @@ bool bch_cached_dev_error(struct cached_dev *dc) | |||
| 1377 | smp_mb(); | 1379 | smp_mb(); |
| 1378 | 1380 | ||
| 1379 | pr_err("stop %s: too many IO errors on backing device %s\n", | 1381 | pr_err("stop %s: too many IO errors on backing device %s\n", |
| 1380 | dc->disk.disk->disk_name, bdevname(dc->bdev, name)); | 1382 | dc->disk.disk->disk_name, dc->backing_dev_name); |
| 1383 | |||
| 1384 | /* | ||
| 1385 | * If the cached device is still attached to a cache set, | ||
| 1386 | * even dc->io_disable is true and no more I/O requests | ||
| 1387 | * accepted, cache device internal I/O (writeback scan or | ||
| 1388 | * garbage collection) may still prevent bcache device from | ||
| 1389 | * being stopped. So here CACHE_SET_IO_DISABLE should be | ||
| 1390 | * set to c->flags too, to make the internal I/O to cache | ||
| 1391 | * device rejected and stopped immediately. | ||
| 1392 | * If c is NULL, that means the bcache device is not attached | ||
| 1393 | * to any cache set, then no CACHE_SET_IO_DISABLE bit to set. | ||
| 1394 | */ | ||
| 1395 | c = dc->disk.c; | ||
| 1396 | if (c && test_and_set_bit(CACHE_SET_IO_DISABLE, &c->flags)) | ||
| 1397 | pr_info("CACHE_SET_IO_DISABLE already set"); | ||
| 1381 | 1398 | ||
| 1382 | bcache_device_stop(&dc->disk); | 1399 | bcache_device_stop(&dc->disk); |
| 1383 | return true; | 1400 | return true; |
| @@ -1395,7 +1412,7 @@ bool bch_cache_set_error(struct cache_set *c, const char *fmt, ...) | |||
| 1395 | return false; | 1412 | return false; |
| 1396 | 1413 | ||
| 1397 | if (test_and_set_bit(CACHE_SET_IO_DISABLE, &c->flags)) | 1414 | if (test_and_set_bit(CACHE_SET_IO_DISABLE, &c->flags)) |
| 1398 | pr_warn("CACHE_SET_IO_DISABLE already set"); | 1415 | pr_info("CACHE_SET_IO_DISABLE already set"); |
| 1399 | 1416 | ||
| 1400 | /* XXX: we can be called from atomic context | 1417 | /* XXX: we can be called from atomic context |
| 1401 | acquire_console_sem(); | 1418 | acquire_console_sem(); |
| @@ -1539,6 +1556,20 @@ static void conditional_stop_bcache_device(struct cache_set *c, | |||
| 1539 | */ | 1556 | */ |
| 1540 | pr_warn("stop_when_cache_set_failed of %s is \"auto\" and cache is dirty, stop it to avoid potential data corruption.", | 1557 | pr_warn("stop_when_cache_set_failed of %s is \"auto\" and cache is dirty, stop it to avoid potential data corruption.", |
| 1541 | d->disk->disk_name); | 1558 | d->disk->disk_name); |
| 1559 | /* | ||
| 1560 | * There might be a small time gap that cache set is | ||
| 1561 | * released but bcache device is not. Inside this time | ||
| 1562 | * gap, regular I/O requests will directly go into | ||
| 1563 | * backing device as no cache set attached to. This | ||
| 1564 | * behavior may also introduce potential inconsistence | ||
| 1565 | * data in writeback mode while cache is dirty. | ||
| 1566 | * Therefore before calling bcache_device_stop() due | ||
| 1567 | * to a broken cache device, dc->io_disable should be | ||
| 1568 | * explicitly set to true. | ||
| 1569 | */ | ||
| 1570 | dc->io_disable = true; | ||
| 1571 | /* make others know io_disable is true earlier */ | ||
| 1572 | smp_mb(); | ||
| 1542 | bcache_device_stop(d); | 1573 | bcache_device_stop(d); |
| 1543 | } else { | 1574 | } else { |
| 1544 | /* | 1575 | /* |
| @@ -2003,12 +2034,10 @@ static int cache_alloc(struct cache *ca) | |||
| 2003 | static int register_cache(struct cache_sb *sb, struct page *sb_page, | 2034 | static int register_cache(struct cache_sb *sb, struct page *sb_page, |
| 2004 | struct block_device *bdev, struct cache *ca) | 2035 | struct block_device *bdev, struct cache *ca) |
| 2005 | { | 2036 | { |
| 2006 | char name[BDEVNAME_SIZE]; | ||
| 2007 | const char *err = NULL; /* must be set for any error case */ | 2037 | const char *err = NULL; /* must be set for any error case */ |
| 2008 | int ret = 0; | 2038 | int ret = 0; |
| 2009 | 2039 | ||
| 2010 | bdevname(bdev, name); | 2040 | bdevname(bdev, ca->cache_dev_name); |
| 2011 | |||
| 2012 | memcpy(&ca->sb, sb, sizeof(struct cache_sb)); | 2041 | memcpy(&ca->sb, sb, sizeof(struct cache_sb)); |
| 2013 | ca->bdev = bdev; | 2042 | ca->bdev = bdev; |
| 2014 | ca->bdev->bd_holder = ca; | 2043 | ca->bdev->bd_holder = ca; |
| @@ -2045,14 +2074,14 @@ static int register_cache(struct cache_sb *sb, struct page *sb_page, | |||
| 2045 | goto out; | 2074 | goto out; |
| 2046 | } | 2075 | } |
| 2047 | 2076 | ||
| 2048 | pr_info("registered cache device %s", name); | 2077 | pr_info("registered cache device %s", ca->cache_dev_name); |
| 2049 | 2078 | ||
| 2050 | out: | 2079 | out: |
| 2051 | kobject_put(&ca->kobj); | 2080 | kobject_put(&ca->kobj); |
| 2052 | 2081 | ||
| 2053 | err: | 2082 | err: |
| 2054 | if (err) | 2083 | if (err) |
| 2055 | pr_notice("error %s: %s", name, err); | 2084 | pr_notice("error %s: %s", ca->cache_dev_name, err); |
| 2056 | 2085 | ||
| 2057 | return ret; | 2086 | return ret; |
| 2058 | } | 2087 | } |
diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c index 4a9547cdcdc5..ad45ebe1a74b 100644 --- a/drivers/md/bcache/writeback.c +++ b/drivers/md/bcache/writeback.c | |||
| @@ -244,8 +244,10 @@ static void dirty_endio(struct bio *bio) | |||
| 244 | struct keybuf_key *w = bio->bi_private; | 244 | struct keybuf_key *w = bio->bi_private; |
| 245 | struct dirty_io *io = w->private; | 245 | struct dirty_io *io = w->private; |
| 246 | 246 | ||
| 247 | if (bio->bi_status) | 247 | if (bio->bi_status) { |
| 248 | SET_KEY_DIRTY(&w->key, false); | 248 | SET_KEY_DIRTY(&w->key, false); |
| 249 | bch_count_backing_io_errors(io->dc, bio); | ||
| 250 | } | ||
| 249 | 251 | ||
| 250 | closure_put(&io->cl); | 252 | closure_put(&io->cl); |
| 251 | } | 253 | } |
diff --git a/drivers/media/i2c/saa7115.c b/drivers/media/i2c/saa7115.c index e216cd768409..b07114b5efb2 100644 --- a/drivers/media/i2c/saa7115.c +++ b/drivers/media/i2c/saa7115.c | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | // | 20 | // |
| 21 | // VBI support (2004) and cleanups (2005) by Hans Verkuil <hverkuil@xs4all.nl> | 21 | // VBI support (2004) and cleanups (2005) by Hans Verkuil <hverkuil@xs4all.nl> |
| 22 | // | 22 | // |
| 23 | // Copyright (c) 2005-2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 23 | // Copyright (c) 2005-2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 24 | // SAA7111, SAA7113 and SAA7118 support | 24 | // SAA7111, SAA7113 and SAA7118 support |
| 25 | 25 | ||
| 26 | #include "saa711x_regs.h" | 26 | #include "saa711x_regs.h" |
diff --git a/drivers/media/i2c/saa711x_regs.h b/drivers/media/i2c/saa711x_regs.h index a50d480e101a..44fabe08234d 100644 --- a/drivers/media/i2c/saa711x_regs.h +++ b/drivers/media/i2c/saa711x_regs.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * SPDX-License-Identifier: GPL-2.0+ | 2 | * SPDX-License-Identifier: GPL-2.0+ |
| 3 | * saa711x - Philips SAA711x video decoder register specifications | 3 | * saa711x - Philips SAA711x video decoder register specifications |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 5 | * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #define R_00_CHIP_VERSION 0x00 | 8 | #define R_00_CHIP_VERSION 0x00 |
diff --git a/drivers/media/i2c/tda7432.c b/drivers/media/i2c/tda7432.c index 1c5c61d829d6..9b4f21237810 100644 --- a/drivers/media/i2c/tda7432.c +++ b/drivers/media/i2c/tda7432.c | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | * Muting and tone control by Jonathan Isom <jisom@ematic.com> | 8 | * Muting and tone control by Jonathan Isom <jisom@ematic.com> |
| 9 | * | 9 | * |
| 10 | * Copyright (c) 2000 Eric Sandeen <eric_sandeen@bigfoot.com> | 10 | * Copyright (c) 2000 Eric Sandeen <eric_sandeen@bigfoot.com> |
| 11 | * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 11 | * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 12 | * This code is placed under the terms of the GNU General Public License | 12 | * This code is placed under the terms of the GNU General Public License |
| 13 | * Based on tda9855.c by Steve VanDeBogart (vandebo@uclink.berkeley.edu) | 13 | * Based on tda9855.c by Steve VanDeBogart (vandebo@uclink.berkeley.edu) |
| 14 | * Which was based on tda8425.c by Greg Alexander (c) 1998 | 14 | * Which was based on tda8425.c by Greg Alexander (c) 1998 |
diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index 2476d812f669..1734ed4ede33 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | // | 2 | // |
| 3 | // tvp5150 - Texas Instruments TVP5150A/AM1 and TVP5151 video decoder driver | 3 | // tvp5150 - Texas Instruments TVP5150A/AM1 and TVP5151 video decoder driver |
| 4 | // | 4 | // |
| 5 | // Copyright (c) 2005,2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 5 | // Copyright (c) 2005,2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | 6 | ||
| 7 | #include <dt-bindings/media/tvp5150.h> | 7 | #include <dt-bindings/media/tvp5150.h> |
| 8 | #include <linux/i2c.h> | 8 | #include <linux/i2c.h> |
diff --git a/drivers/media/i2c/tvp5150_reg.h b/drivers/media/i2c/tvp5150_reg.h index c43b7b844021..d3a764cae1a0 100644 --- a/drivers/media/i2c/tvp5150_reg.h +++ b/drivers/media/i2c/tvp5150_reg.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | * | 3 | * |
| 4 | * tvp5150 - Texas Instruments TVP5150A/AM1 video decoder registers | 4 | * tvp5150 - Texas Instruments TVP5150A/AM1 video decoder registers |
| 5 | * | 5 | * |
| 6 | * Copyright (c) 2005,2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 6 | * Copyright (c) 2005,2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #define TVP5150_VD_IN_SRC_SEL_1 0x00 /* Video input source selection #1 */ | 9 | #define TVP5150_VD_IN_SRC_SEL_1 0x00 /* Video input source selection #1 */ |
diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c index a26c1a3f7183..4599b7e28a8d 100644 --- a/drivers/media/i2c/tvp7002.c +++ b/drivers/media/i2c/tvp7002.c | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * Author: Santiago Nunez-Corrales <santiago.nunez@ridgerun.com> | 5 | * Author: Santiago Nunez-Corrales <santiago.nunez@ridgerun.com> |
| 6 | * | 6 | * |
| 7 | * This code is partially based upon the TVP5150 driver | 7 | * This code is partially based upon the TVP5150 driver |
| 8 | * written by Mauro Carvalho Chehab (mchehab@infradead.org), | 8 | * written by Mauro Carvalho Chehab <mchehab@kernel.org>, |
| 9 | * the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com> | 9 | * the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com> |
| 10 | * and the TVP7002 driver in the TI LSP 2.10.00.14. Revisions by | 10 | * and the TVP7002 driver in the TI LSP 2.10.00.14. Revisions by |
| 11 | * Muralidharan Karicheri and Snehaprabha Narnakaje (TI). | 11 | * Muralidharan Karicheri and Snehaprabha Narnakaje (TI). |
diff --git a/drivers/media/i2c/tvp7002_reg.h b/drivers/media/i2c/tvp7002_reg.h index 3c8c8b0a6a4c..7f56ba689dfe 100644 --- a/drivers/media/i2c/tvp7002_reg.h +++ b/drivers/media/i2c/tvp7002_reg.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * Author: Santiago Nunez-Corrales <santiago.nunez@ridgerun.com> | 5 | * Author: Santiago Nunez-Corrales <santiago.nunez@ridgerun.com> |
| 6 | * | 6 | * |
| 7 | * This code is partially based upon the TVP5150 driver | 7 | * This code is partially based upon the TVP5150 driver |
| 8 | * written by Mauro Carvalho Chehab (mchehab@infradead.org), | 8 | * written by Mauro Carvalho Chehab <mchehab@kernel.org>, |
| 9 | * the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com> | 9 | * the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com> |
| 10 | * and the TVP7002 driver in the TI LSP 2.10.00.14 | 10 | * and the TVP7002 driver in the TI LSP 2.10.00.14 |
| 11 | * | 11 | * |
diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c index 67ac51eff15c..6b87a721dc49 100644 --- a/drivers/media/media-devnode.c +++ b/drivers/media/media-devnode.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * Copyright (C) 2010 Nokia Corporation | 4 | * Copyright (C) 2010 Nokia Corporation |
| 5 | * | 5 | * |
| 6 | * Based on drivers/media/video/v4l2_dev.c code authored by | 6 | * Based on drivers/media/video/v4l2_dev.c code authored by |
| 7 | * Mauro Carvalho Chehab <mchehab@infradead.org> (version 2) | 7 | * Mauro Carvalho Chehab <mchehab@kernel.org> (version 2) |
| 8 | * Alan Cox, <alan@lxorguk.ukuu.org.uk> (version 1) | 8 | * Alan Cox, <alan@lxorguk.ukuu.org.uk> (version 1) |
| 9 | * | 9 | * |
| 10 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 10 | * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
diff --git a/drivers/media/pci/bt8xx/bttv-audio-hook.c b/drivers/media/pci/bt8xx/bttv-audio-hook.c index 9f1f9169fb5b..346fc7f58839 100644 --- a/drivers/media/pci/bt8xx/bttv-audio-hook.c +++ b/drivers/media/pci/bt8xx/bttv-audio-hook.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Handlers for board audio hooks, splitted from bttv-cards | 2 | * Handlers for board audio hooks, splitted from bttv-cards |
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2006 Mauro Carvalho Chehab (mchehab@infradead.org) | 4 | * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5 | * This code is placed under the terms of the GNU General Public License | 5 | * This code is placed under the terms of the GNU General Public License |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
diff --git a/drivers/media/pci/bt8xx/bttv-audio-hook.h b/drivers/media/pci/bt8xx/bttv-audio-hook.h index 159d07adeff8..be16a537a03a 100644 --- a/drivers/media/pci/bt8xx/bttv-audio-hook.h +++ b/drivers/media/pci/bt8xx/bttv-audio-hook.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Handlers for board audio hooks, splitted from bttv-cards | 2 | * Handlers for board audio hooks, splitted from bttv-cards |
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2006 Mauro Carvalho Chehab (mchehab@infradead.org) | 4 | * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5 | * This code is placed under the terms of the GNU General Public License | 5 | * This code is placed under the terms of the GNU General Public License |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
diff --git a/drivers/media/pci/bt8xx/bttv-cards.c b/drivers/media/pci/bt8xx/bttv-cards.c index 1902732f90e1..2616243b2c49 100644 --- a/drivers/media/pci/bt8xx/bttv-cards.c +++ b/drivers/media/pci/bt8xx/bttv-cards.c | |||
| @@ -2447,7 +2447,7 @@ struct tvcard bttv_tvcards[] = { | |||
| 2447 | }, | 2447 | }, |
| 2448 | /* ---- card 0x88---------------------------------- */ | 2448 | /* ---- card 0x88---------------------------------- */ |
| 2449 | [BTTV_BOARD_ACORP_Y878F] = { | 2449 | [BTTV_BOARD_ACORP_Y878F] = { |
| 2450 | /* Mauro Carvalho Chehab <mchehab@infradead.org> */ | 2450 | /* Mauro Carvalho Chehab <mchehab@kernel.org> */ |
| 2451 | .name = "Acorp Y878F", | 2451 | .name = "Acorp Y878F", |
| 2452 | .video_inputs = 3, | 2452 | .video_inputs = 3, |
| 2453 | /* .audio_inputs= 1, */ | 2453 | /* .audio_inputs= 1, */ |
| @@ -2688,7 +2688,7 @@ struct tvcard bttv_tvcards[] = { | |||
| 2688 | }, | 2688 | }, |
| 2689 | [BTTV_BOARD_ENLTV_FM_2] = { | 2689 | [BTTV_BOARD_ENLTV_FM_2] = { |
| 2690 | /* Encore TV Tuner Pro ENL TV-FM-2 | 2690 | /* Encore TV Tuner Pro ENL TV-FM-2 |
| 2691 | Mauro Carvalho Chehab <mchehab@infradead.org */ | 2691 | Mauro Carvalho Chehab <mchehab@kernel.org> */ |
| 2692 | .name = "Encore ENL TV-FM-2", | 2692 | .name = "Encore ENL TV-FM-2", |
| 2693 | .video_inputs = 3, | 2693 | .video_inputs = 3, |
| 2694 | /* .audio_inputs= 1, */ | 2694 | /* .audio_inputs= 1, */ |
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 707f57a9f940..de3f44b8dec6 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | (c) 2005-2006 Nickolay V. Shmyrev <nshmyrev@yandex.ru> | 13 | (c) 2005-2006 Nickolay V. Shmyrev <nshmyrev@yandex.ru> |
| 14 | 14 | ||
| 15 | Fixes to be fully V4L2 compliant by | 15 | Fixes to be fully V4L2 compliant by |
| 16 | (c) 2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 16 | (c) 2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 17 | 17 | ||
| 18 | Cropping and overscan support | 18 | Cropping and overscan support |
| 19 | Copyright (C) 2005, 2006 Michael H. Schimek <mschimek@gmx.at> | 19 | Copyright (C) 2005, 2006 Michael H. Schimek <mschimek@gmx.at> |
diff --git a/drivers/media/pci/bt8xx/bttv-i2c.c b/drivers/media/pci/bt8xx/bttv-i2c.c index eccd1e3d717a..c76823eb399d 100644 --- a/drivers/media/pci/bt8xx/bttv-i2c.c +++ b/drivers/media/pci/bt8xx/bttv-i2c.c | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | & Marcus Metzler (mocm@thp.uni-koeln.de) | 8 | & Marcus Metzler (mocm@thp.uni-koeln.de) |
| 9 | (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> | 9 | (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> |
| 10 | 10 | ||
| 11 | (c) 2005 Mauro Carvalho Chehab <mchehab@infradead.org> | 11 | (c) 2005 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 12 | - Multituner support and i2c address binding | 12 | - Multituner support and i2c address binding |
| 13 | 13 | ||
| 14 | This program is free software; you can redistribute it and/or modify | 14 | This program is free software; you can redistribute it and/or modify |
diff --git a/drivers/media/pci/cx23885/cx23885-input.c b/drivers/media/pci/cx23885/cx23885-input.c index be49589a61d2..395ff9bba759 100644 --- a/drivers/media/pci/cx23885/cx23885-input.c +++ b/drivers/media/pci/cx23885/cx23885-input.c | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | * Copyright (C) 2008 <srinivasa.deevi at conexant dot com> | 13 | * Copyright (C) 2008 <srinivasa.deevi at conexant dot com> |
| 14 | * Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> | 14 | * Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> |
| 15 | * Markus Rechberger <mrechberger@gmail.com> | 15 | * Markus Rechberger <mrechberger@gmail.com> |
| 16 | * Mauro Carvalho Chehab <mchehab@infradead.org> | 16 | * Mauro Carvalho Chehab <mchehab@kernel.org> |
| 17 | * Sascha Sommer <saschasommer@freenet.de> | 17 | * Sascha Sommer <saschasommer@freenet.de> |
| 18 | * Copyright (C) 2004, 2005 Chris Pascoe | 18 | * Copyright (C) 2004, 2005 Chris Pascoe |
| 19 | * Copyright (C) 2003, 2004 Gerd Knorr | 19 | * Copyright (C) 2003, 2004 Gerd Knorr |
diff --git a/drivers/media/pci/cx88/cx88-alsa.c b/drivers/media/pci/cx88/cx88-alsa.c index ab09bb55cf45..8a28fda703a2 100644 --- a/drivers/media/pci/cx88/cx88-alsa.c +++ b/drivers/media/pci/cx88/cx88-alsa.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * | 4 | * |
| 5 | * (c) 2007 Trent Piepho <xyzzy@speakeasy.org> | 5 | * (c) 2007 Trent Piepho <xyzzy@speakeasy.org> |
| 6 | * (c) 2005,2006 Ricardo Cerqueira <v4l@cerqueira.org> | 6 | * (c) 2005,2006 Ricardo Cerqueira <v4l@cerqueira.org> |
| 7 | * (c) 2005 Mauro Carvalho Chehab <mchehab@infradead.org> | 7 | * (c) 2005 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 8 | * Based on a dummy cx88 module by Gerd Knorr <kraxel@bytesex.org> | 8 | * Based on a dummy cx88 module by Gerd Knorr <kraxel@bytesex.org> |
| 9 | * Based on dummy.c by Jaroslav Kysela <perex@perex.cz> | 9 | * Based on dummy.c by Jaroslav Kysela <perex@perex.cz> |
| 10 | * | 10 | * |
| @@ -103,7 +103,7 @@ MODULE_PARM_DESC(index, "Index value for cx88x capture interface(s)."); | |||
| 103 | 103 | ||
| 104 | MODULE_DESCRIPTION("ALSA driver module for cx2388x based TV cards"); | 104 | MODULE_DESCRIPTION("ALSA driver module for cx2388x based TV cards"); |
| 105 | MODULE_AUTHOR("Ricardo Cerqueira"); | 105 | MODULE_AUTHOR("Ricardo Cerqueira"); |
| 106 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 106 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 107 | MODULE_LICENSE("GPL"); | 107 | MODULE_LICENSE("GPL"); |
| 108 | MODULE_VERSION(CX88_VERSION); | 108 | MODULE_VERSION(CX88_VERSION); |
| 109 | 109 | ||
diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c index 0e0952e60795..7a4876cf9f08 100644 --- a/drivers/media/pci/cx88/cx88-blackbird.c +++ b/drivers/media/pci/cx88/cx88-blackbird.c | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * (c) 2004 Jelle Foks <jelle@foks.us> | 5 | * (c) 2004 Jelle Foks <jelle@foks.us> |
| 6 | * (c) 2004 Gerd Knorr <kraxel@bytesex.org> | 6 | * (c) 2004 Gerd Knorr <kraxel@bytesex.org> |
| 7 | * | 7 | * |
| 8 | * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 8 | * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 9 | * - video_ioctl2 conversion | 9 | * - video_ioctl2 conversion |
| 10 | * | 10 | * |
| 11 | * Includes parts from the ivtv driver <http://sourceforge.net/projects/ivtv/> | 11 | * Includes parts from the ivtv driver <http://sourceforge.net/projects/ivtv/> |
diff --git a/drivers/media/pci/cx88/cx88-core.c b/drivers/media/pci/cx88/cx88-core.c index 8bfa5b7ed91b..60988e95b637 100644 --- a/drivers/media/pci/cx88/cx88-core.c +++ b/drivers/media/pci/cx88/cx88-core.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * | 4 | * |
| 5 | * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] | 5 | * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] |
| 6 | * | 6 | * |
| 7 | * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 7 | * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 8 | * - Multituner support | 8 | * - Multituner support |
| 9 | * - video_ioctl2 conversion | 9 | * - video_ioctl2 conversion |
| 10 | * - PAL/M fixes | 10 | * - PAL/M fixes |
diff --git a/drivers/media/pci/cx88/cx88-i2c.c b/drivers/media/pci/cx88/cx88-i2c.c index f7692775fb5a..99f88a05a7c9 100644 --- a/drivers/media/pci/cx88/cx88-i2c.c +++ b/drivers/media/pci/cx88/cx88-i2c.c | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | * (c) 2002 Yurij Sysoev <yurij@naturesoft.net> | 8 | * (c) 2002 Yurij Sysoev <yurij@naturesoft.net> |
| 9 | * (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> | 9 | * (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> |
| 10 | * | 10 | * |
| 11 | * (c) 2005 Mauro Carvalho Chehab <mchehab@infradead.org> | 11 | * (c) 2005 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 12 | * - Multituner support and i2c address binding | 12 | * - Multituner support and i2c address binding |
| 13 | * | 13 | * |
| 14 | * This program is free software; you can redistribute it and/or modify | 14 | * This program is free software; you can redistribute it and/or modify |
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c index 9be682cdb644..7b113bad70d2 100644 --- a/drivers/media/pci/cx88/cx88-video.c +++ b/drivers/media/pci/cx88/cx88-video.c | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * | 5 | * |
| 6 | * (c) 2003-04 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] | 6 | * (c) 2003-04 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] |
| 7 | * | 7 | * |
| 8 | * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@infradead.org> | 8 | * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 9 | * - Multituner support | 9 | * - Multituner support |
| 10 | * - video_ioctl2 conversion | 10 | * - video_ioctl2 conversion |
| 11 | * - PAL/M fixes | 11 | * - PAL/M fixes |
diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c index 5ef635e72e10..4c52ac6d8bc5 100644 --- a/drivers/media/radio/radio-aimslab.c +++ b/drivers/media/radio/radio-aimslab.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * Copyright 1997 M. Kirkwood | 4 | * Copyright 1997 M. Kirkwood |
| 5 | * | 5 | * |
| 6 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> | 6 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> |
| 7 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> | 7 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 8 | * Converted to new API by Alan Cox <alan@lxorguk.ukuu.org.uk> | 8 | * Converted to new API by Alan Cox <alan@lxorguk.ukuu.org.uk> |
| 9 | * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org> | 9 | * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org> |
| 10 | * | 10 | * |
diff --git a/drivers/media/radio/radio-aztech.c b/drivers/media/radio/radio-aztech.c index 9e12c6027359..840b7d60462b 100644 --- a/drivers/media/radio/radio-aztech.c +++ b/drivers/media/radio/radio-aztech.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * radio-aztech.c - Aztech radio card driver | 2 | * radio-aztech.c - Aztech radio card driver |
| 3 | * | 3 | * |
| 4 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@xs4all.nl> | 4 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@xs4all.nl> |
| 5 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> | 5 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | * Adapted to support the Video for Linux API by | 6 | * Adapted to support the Video for Linux API by |
| 7 | * Russell Kroll <rkroll@exploits.org>. Based on original tuner code by: | 7 | * Russell Kroll <rkroll@exploits.org>. Based on original tuner code by: |
| 8 | * | 8 | * |
diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c index 3ff4c4e1435f..f051f8694ab9 100644 --- a/drivers/media/radio/radio-gemtek.c +++ b/drivers/media/radio/radio-gemtek.c | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org> | 15 | * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org> |
| 16 | * | 16 | * |
| 17 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> | 17 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> |
| 18 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> | 18 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 19 | * | 19 | * |
| 20 | * Note: this card seems to swap the left and right audio channels! | 20 | * Note: this card seems to swap the left and right audio channels! |
| 21 | * | 21 | * |
diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c index 95f06f3b35dc..e4e758739246 100644 --- a/drivers/media/radio/radio-maxiradio.c +++ b/drivers/media/radio/radio-maxiradio.c | |||
| @@ -27,7 +27,7 @@ | |||
| 27 | * BUGS: | 27 | * BUGS: |
| 28 | * - card unmutes if you change frequency | 28 | * - card unmutes if you change frequency |
| 29 | * | 29 | * |
| 30 | * (c) 2006, 2007 by Mauro Carvalho Chehab <mchehab@infradead.org>: | 30 | * (c) 2006, 2007 by Mauro Carvalho Chehab <mchehab@kernel.org>: |
| 31 | * - Conversion to V4L2 API | 31 | * - Conversion to V4L2 API |
| 32 | * - Uses video_ioctl2 for parsing and to add debug support | 32 | * - Uses video_ioctl2 for parsing and to add debug support |
| 33 | */ | 33 | */ |
diff --git a/drivers/media/radio/radio-rtrack2.c b/drivers/media/radio/radio-rtrack2.c index abeaedd8d437..5a1470eb753e 100644 --- a/drivers/media/radio/radio-rtrack2.c +++ b/drivers/media/radio/radio-rtrack2.c | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org> | 7 | * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org> |
| 8 | * | 8 | * |
| 9 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> | 9 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> |
| 10 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> | 10 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 11 | * | 11 | * |
| 12 | * Fully tested with actual hardware and the v4l2-compliance tool. | 12 | * Fully tested with actual hardware and the v4l2-compliance tool. |
| 13 | */ | 13 | */ |
diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c index fc4e63d36e4c..4f9b97edd9eb 100644 --- a/drivers/media/radio/radio-sf16fmi.c +++ b/drivers/media/radio/radio-sf16fmi.c | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | * No volume control - only mute/unmute - you have to use line volume | 13 | * No volume control - only mute/unmute - you have to use line volume |
| 14 | * control on SB-part of SF16-FMI/SF16-FMP/SF16-FMD | 14 | * control on SB-part of SF16-FMI/SF16-FMP/SF16-FMD |
| 15 | * | 15 | * |
| 16 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> | 16 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | #include <linux/kernel.h> /* __setup */ | 19 | #include <linux/kernel.h> /* __setup */ |
diff --git a/drivers/media/radio/radio-terratec.c b/drivers/media/radio/radio-terratec.c index 4f116ea294fb..1af8f29cc7d1 100644 --- a/drivers/media/radio/radio-terratec.c +++ b/drivers/media/radio/radio-terratec.c | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | * Volume Control is done digitally | 17 | * Volume Control is done digitally |
| 18 | * | 18 | * |
| 19 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> | 19 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> |
| 20 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> | 20 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | #include <linux/module.h> /* Modules */ | 23 | #include <linux/module.h> /* Modules */ |
diff --git a/drivers/media/radio/radio-trust.c b/drivers/media/radio/radio-trust.c index 26a8c6002121..a4bad322ffff 100644 --- a/drivers/media/radio/radio-trust.c +++ b/drivers/media/radio/radio-trust.c | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | * Scott McGrath (smcgrath@twilight.vtc.vsc.edu) | 12 | * Scott McGrath (smcgrath@twilight.vtc.vsc.edu) |
| 13 | * William McGrath (wmcgrath@twilight.vtc.vsc.edu) | 13 | * William McGrath (wmcgrath@twilight.vtc.vsc.edu) |
| 14 | * | 14 | * |
| 15 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> | 15 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include <stdarg.h> | 18 | #include <stdarg.h> |
diff --git a/drivers/media/radio/radio-typhoon.c b/drivers/media/radio/radio-typhoon.c index eb72a4d13758..d0d67ad85b8f 100644 --- a/drivers/media/radio/radio-typhoon.c +++ b/drivers/media/radio/radio-typhoon.c | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | * The frequency change is necessary since the card never seems to be | 25 | * The frequency change is necessary since the card never seems to be |
| 26 | * completely silent. | 26 | * completely silent. |
| 27 | * | 27 | * |
| 28 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org> | 28 | * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 29 | */ | 29 | */ |
| 30 | 30 | ||
| 31 | #include <linux/module.h> /* Modules */ | 31 | #include <linux/module.h> /* Modules */ |
diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c index 026e88eef29c..6007cd09b328 100644 --- a/drivers/media/radio/radio-zoltrix.c +++ b/drivers/media/radio/radio-zoltrix.c | |||
| @@ -27,7 +27,7 @@ | |||
| 27 | * 2002-07-15 - Fix Stereo typo | 27 | * 2002-07-15 - Fix Stereo typo |
| 28 | * | 28 | * |
| 29 | * 2006-07-24 - Converted to V4L2 API | 29 | * 2006-07-24 - Converted to V4L2 API |
| 30 | * by Mauro Carvalho Chehab <mchehab@infradead.org> | 30 | * by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 31 | * | 31 | * |
| 32 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> | 32 | * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com> |
| 33 | * | 33 | * |
diff --git a/drivers/media/rc/keymaps/rc-avermedia-m135a.c b/drivers/media/rc/keymaps/rc-avermedia-m135a.c index f6977df1a75b..d275d98d066a 100644 --- a/drivers/media/rc/keymaps/rc-avermedia-m135a.c +++ b/drivers/media/rc/keymaps/rc-avermedia-m135a.c | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | * | 12 | * |
| 13 | * On Avermedia M135A with IR model RM-JX, the same codes exist on both | 13 | * On Avermedia M135A with IR model RM-JX, the same codes exist on both |
| 14 | * Positivo (BR) and original IR, initial version and remote control codes | 14 | * Positivo (BR) and original IR, initial version and remote control codes |
| 15 | * added by Mauro Carvalho Chehab <mchehab@infradead.org> | 15 | * added by Mauro Carvalho Chehab <mchehab@kernel.org> |
| 16 | * | 16 | * |
| 17 | * Positivo also ships Avermedia M135A with model RM-K6, extra control | 17 | * Positivo also ships Avermedia M135A with model RM-K6, extra control |
| 18 | * codes added by Herton Ronaldo Krzesinski <herton@mandriva.com.br> | 18 | * codes added by Herton Ronaldo Krzesinski <herton@mandriva.com.br> |
diff --git a/drivers/media/rc/keymaps/rc-encore-enltv-fm53.c b/drivers/media/rc/keymaps/rc-encore-enltv-fm53.c index e4e78c1f4123..057c13b765ef 100644 --- a/drivers/media/rc/keymaps/rc-encore-enltv-fm53.c +++ b/drivers/media/rc/keymaps/rc-encore-enltv-fm53.c | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | 10 | ||
| 11 | /* Encore ENLTV-FM v5.3 | 11 | /* Encore ENLTV-FM v5.3 |
| 12 | Mauro Carvalho Chehab <mchehab@infradead.org> | 12 | Mauro Carvalho Chehab <mchehab@kernel.org> |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | static struct rc_map_table encore_enltv_fm53[] = { | 15 | static struct rc_map_table encore_enltv_fm53[] = { |
diff --git a/drivers/media/rc/keymaps/rc-encore-enltv2.c b/drivers/media/rc/keymaps/rc-encore-enltv2.c index c3d4437a6fda..cd0555924456 100644 --- a/drivers/media/rc/keymaps/rc-encore-enltv2.c +++ b/drivers/media/rc/keymaps/rc-encore-enltv2.c | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | 10 | ||
| 11 | /* Encore ENLTV2-FM - silver plastic - "Wand Media" written at the botton | 11 | /* Encore ENLTV2-FM - silver plastic - "Wand Media" written at the botton |
| 12 | Mauro Carvalho Chehab <mchehab@infradead.org> */ | 12 | Mauro Carvalho Chehab <mchehab@kernel.org> */ |
| 13 | 13 | ||
| 14 | static struct rc_map_table encore_enltv2[] = { | 14 | static struct rc_map_table encore_enltv2[] = { |
| 15 | { 0x4c, KEY_POWER2 }, | 15 | { 0x4c, KEY_POWER2 }, |
diff --git a/drivers/media/rc/keymaps/rc-kaiomy.c b/drivers/media/rc/keymaps/rc-kaiomy.c index f0f88df18606..a00051339842 100644 --- a/drivers/media/rc/keymaps/rc-kaiomy.c +++ b/drivers/media/rc/keymaps/rc-kaiomy.c | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | 10 | ||
| 11 | /* Kaiomy TVnPC U2 | 11 | /* Kaiomy TVnPC U2 |
| 12 | Mauro Carvalho Chehab <mchehab@infradead.org> | 12 | Mauro Carvalho Chehab <mchehab@kernel.org> |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | static struct rc_map_table kaiomy[] = { | 15 | static struct rc_map_table kaiomy[] = { |
diff --git a/drivers/media/rc/keymaps/rc-kworld-plus-tv-analog.c b/drivers/media/rc/keymaps/rc-kworld-plus-tv-analog.c index 453e04377de7..db5edde3eeb1 100644 --- a/drivers/media/rc/keymaps/rc-kworld-plus-tv-analog.c +++ b/drivers/media/rc/keymaps/rc-kworld-plus-tv-analog.c | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | 10 | ||
| 11 | /* Kworld Plus TV Analog Lite PCI IR | 11 | /* Kworld Plus TV Analog Lite PCI IR |
| 12 | Mauro Carvalho Chehab <mchehab@infradead.org> | 12 | Mauro Carvalho Chehab <mchehab@kernel.org> |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | static struct rc_map_table kworld_plus_tv_analog[] = { | 15 | static struct rc_map_table kworld_plus_tv_analog[] = { |
diff --git a/drivers/media/rc/keymaps/rc-pixelview-new.c b/drivers/media/rc/keymaps/rc-pixelview-new.c index 791130f108ff..e4e34f2ccf74 100644 --- a/drivers/media/rc/keymaps/rc-pixelview-new.c +++ b/drivers/media/rc/keymaps/rc-pixelview-new.c | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| 10 | 10 | ||
| 11 | /* | 11 | /* |
| 12 | Mauro Carvalho Chehab <mchehab@infradead.org> | 12 | Mauro Carvalho Chehab <mchehab@kernel.org> |
| 13 | present on PV MPEG 8000GT | 13 | present on PV MPEG 8000GT |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
diff --git a/drivers/media/tuners/tea5761.c b/drivers/media/tuners/tea5761.c index 88b3e80c38ad..d78a2bdb3e36 100644 --- a/drivers/media/tuners/tea5761.c +++ b/drivers/media/tuners/tea5761.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | // For Philips TEA5761 FM Chip | 2 | // For Philips TEA5761 FM Chip |
| 3 | // I2C address is always 0x20 (0x10 at 7-bit mode). | 3 | // I2C address is always 0x20 (0x10 at 7-bit mode). |
| 4 | // | 4 | // |
| 5 | // Copyright (c) 2005-2007 Mauro Carvalho Chehab (mchehab@infradead.org) | 5 | // Copyright (c) 2005-2007 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | 6 | ||
| 7 | #include <linux/i2c.h> | 7 | #include <linux/i2c.h> |
| 8 | #include <linux/slab.h> | 8 | #include <linux/slab.h> |
| @@ -337,5 +337,5 @@ EXPORT_SYMBOL_GPL(tea5761_attach); | |||
| 337 | EXPORT_SYMBOL_GPL(tea5761_autodetection); | 337 | EXPORT_SYMBOL_GPL(tea5761_autodetection); |
| 338 | 338 | ||
| 339 | MODULE_DESCRIPTION("Philips TEA5761 FM tuner driver"); | 339 | MODULE_DESCRIPTION("Philips TEA5761 FM tuner driver"); |
| 340 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 340 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 341 | MODULE_LICENSE("GPL v2"); | 341 | MODULE_LICENSE("GPL v2"); |
diff --git a/drivers/media/tuners/tea5767.c b/drivers/media/tuners/tea5767.c index 2b2c064d7dc3..016d0d5ec50b 100644 --- a/drivers/media/tuners/tea5767.c +++ b/drivers/media/tuners/tea5767.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | // For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview | 2 | // For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview |
| 3 | // I2C address is always 0xC0. | 3 | // I2C address is always 0xC0. |
| 4 | // | 4 | // |
| 5 | // Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@infradead.org) | 5 | // Copyright (c) 2005 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | // | 6 | // |
| 7 | // tea5767 autodetection thanks to Torsten Seeboth and Atsushi Nakagawa | 7 | // tea5767 autodetection thanks to Torsten Seeboth and Atsushi Nakagawa |
| 8 | // from their contributions on DScaler. | 8 | // from their contributions on DScaler. |
| @@ -469,5 +469,5 @@ EXPORT_SYMBOL_GPL(tea5767_attach); | |||
| 469 | EXPORT_SYMBOL_GPL(tea5767_autodetection); | 469 | EXPORT_SYMBOL_GPL(tea5767_autodetection); |
| 470 | 470 | ||
| 471 | MODULE_DESCRIPTION("Philips TEA5767 FM tuner driver"); | 471 | MODULE_DESCRIPTION("Philips TEA5767 FM tuner driver"); |
| 472 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 472 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 473 | MODULE_LICENSE("GPL v2"); | 473 | MODULE_LICENSE("GPL v2"); |
diff --git a/drivers/media/tuners/tuner-xc2028-types.h b/drivers/media/tuners/tuner-xc2028-types.h index bb0437c36c03..50d017a4822a 100644 --- a/drivers/media/tuners/tuner-xc2028-types.h +++ b/drivers/media/tuners/tuner-xc2028-types.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * This file includes internal tipes to be used inside tuner-xc2028. | 5 | * This file includes internal tipes to be used inside tuner-xc2028. |
| 6 | * Shouldn't be included outside tuner-xc2028 | 6 | * Shouldn't be included outside tuner-xc2028 |
| 7 | * | 7 | * |
| 8 | * Copyright (c) 2007-2008 Mauro Carvalho Chehab (mchehab@infradead.org) | 8 | * Copyright (c) 2007-2008 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | /* xc3028 firmware types */ | 11 | /* xc3028 firmware types */ |
diff --git a/drivers/media/tuners/tuner-xc2028.c b/drivers/media/tuners/tuner-xc2028.c index fca85e08ebd7..84744e138982 100644 --- a/drivers/media/tuners/tuner-xc2028.c +++ b/drivers/media/tuners/tuner-xc2028.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | // tuner-xc2028 | 2 | // tuner-xc2028 |
| 3 | // | 3 | // |
| 4 | // Copyright (c) 2007-2008 Mauro Carvalho Chehab (mchehab@infradead.org) | 4 | // Copyright (c) 2007-2008 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5 | // | 5 | // |
| 6 | // Copyright (c) 2007 Michel Ludwig (michel.ludwig@gmail.com) | 6 | // Copyright (c) 2007 Michel Ludwig (michel.ludwig@gmail.com) |
| 7 | // - frontend interface | 7 | // - frontend interface |
| @@ -1518,7 +1518,7 @@ EXPORT_SYMBOL(xc2028_attach); | |||
| 1518 | 1518 | ||
| 1519 | MODULE_DESCRIPTION("Xceive xc2028/xc3028 tuner driver"); | 1519 | MODULE_DESCRIPTION("Xceive xc2028/xc3028 tuner driver"); |
| 1520 | MODULE_AUTHOR("Michel Ludwig <michel.ludwig@gmail.com>"); | 1520 | MODULE_AUTHOR("Michel Ludwig <michel.ludwig@gmail.com>"); |
| 1521 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 1521 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 1522 | MODULE_LICENSE("GPL v2"); | 1522 | MODULE_LICENSE("GPL v2"); |
| 1523 | MODULE_FIRMWARE(XC2028_DEFAULT_FIRMWARE); | 1523 | MODULE_FIRMWARE(XC2028_DEFAULT_FIRMWARE); |
| 1524 | MODULE_FIRMWARE(XC3028L_DEFAULT_FIRMWARE); | 1524 | MODULE_FIRMWARE(XC3028L_DEFAULT_FIRMWARE); |
diff --git a/drivers/media/tuners/tuner-xc2028.h b/drivers/media/tuners/tuner-xc2028.h index 03fd6d4233a4..7b58bc06e35c 100644 --- a/drivers/media/tuners/tuner-xc2028.h +++ b/drivers/media/tuners/tuner-xc2028.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * SPDX-License-Identifier: GPL-2.0 | 2 | * SPDX-License-Identifier: GPL-2.0 |
| 3 | * tuner-xc2028 | 3 | * tuner-xc2028 |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2007-2008 Mauro Carvalho Chehab (mchehab@infradead.org) | 5 | * Copyright (c) 2007-2008 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #ifndef __TUNER_XC2028_H__ | 8 | #ifndef __TUNER_XC2028_H__ |
diff --git a/drivers/media/usb/em28xx/em28xx-camera.c b/drivers/media/usb/em28xx/em28xx-camera.c index 3c2694a16ed1..d1e66b503f4d 100644 --- a/drivers/media/usb/em28xx/em28xx-camera.c +++ b/drivers/media/usb/em28xx/em28xx-camera.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | // | 2 | // |
| 3 | // em28xx-camera.c - driver for Empia EM25xx/27xx/28xx USB video capture devices | 3 | // em28xx-camera.c - driver for Empia EM25xx/27xx/28xx USB video capture devices |
| 4 | // | 4 | // |
| 5 | // Copyright (C) 2009 Mauro Carvalho Chehab <mchehab@infradead.org> | 5 | // Copyright (C) 2009 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | // Copyright (C) 2013 Frank Schäfer <fschaefer.oss@googlemail.com> | 6 | // Copyright (C) 2013 Frank Schäfer <fschaefer.oss@googlemail.com> |
| 7 | // | 7 | // |
| 8 | // This program is free software; you can redistribute it and/or modify | 8 | // This program is free software; you can redistribute it and/or modify |
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index 6e0e67d23876..7c3203d7044b 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | // | 5 | // |
| 6 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> | 6 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> |
| 7 | // Markus Rechberger <mrechberger@gmail.com> | 7 | // Markus Rechberger <mrechberger@gmail.com> |
| 8 | // Mauro Carvalho Chehab <mchehab@infradead.org> | 8 | // Mauro Carvalho Chehab <mchehab@kernel.org> |
| 9 | // Sascha Sommer <saschasommer@freenet.de> | 9 | // Sascha Sommer <saschasommer@freenet.de> |
| 10 | // Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> | 10 | // Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> |
| 11 | // | 11 | // |
diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index 36d341fb65dd..f28995383090 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | // | 4 | // |
| 5 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> | 5 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> |
| 6 | // Markus Rechberger <mrechberger@gmail.com> | 6 | // Markus Rechberger <mrechberger@gmail.com> |
| 7 | // Mauro Carvalho Chehab <mchehab@infradead.org> | 7 | // Mauro Carvalho Chehab <mchehab@kernel.org> |
| 8 | // Sascha Sommer <saschasommer@freenet.de> | 8 | // Sascha Sommer <saschasommer@freenet.de> |
| 9 | // Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> | 9 | // Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> |
| 10 | // | 10 | // |
| @@ -32,7 +32,7 @@ | |||
| 32 | 32 | ||
| 33 | #define DRIVER_AUTHOR "Ludovico Cavedon <cavedon@sssup.it>, " \ | 33 | #define DRIVER_AUTHOR "Ludovico Cavedon <cavedon@sssup.it>, " \ |
| 34 | "Markus Rechberger <mrechberger@gmail.com>, " \ | 34 | "Markus Rechberger <mrechberger@gmail.com>, " \ |
| 35 | "Mauro Carvalho Chehab <mchehab@infradead.org>, " \ | 35 | "Mauro Carvalho Chehab <mchehab@kernel.org>, " \ |
| 36 | "Sascha Sommer <saschasommer@freenet.de>" | 36 | "Sascha Sommer <saschasommer@freenet.de>" |
| 37 | 37 | ||
| 38 | MODULE_AUTHOR(DRIVER_AUTHOR); | 38 | MODULE_AUTHOR(DRIVER_AUTHOR); |
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index a54cb8dc52c9..3f493e0b0716 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | // | 2 | // |
| 3 | // DVB device driver for em28xx | 3 | // DVB device driver for em28xx |
| 4 | // | 4 | // |
| 5 | // (c) 2008-2011 Mauro Carvalho Chehab <mchehab@infradead.org> | 5 | // (c) 2008-2011 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | // | 6 | // |
| 7 | // (c) 2008 Devin Heitmueller <devin.heitmueller@gmail.com> | 7 | // (c) 2008 Devin Heitmueller <devin.heitmueller@gmail.com> |
| 8 | // - Fixes for the driver to properly work with HVR-950 | 8 | // - Fixes for the driver to properly work with HVR-950 |
| @@ -63,7 +63,7 @@ | |||
| 63 | #include "tc90522.h" | 63 | #include "tc90522.h" |
| 64 | #include "qm1d1c0042.h" | 64 | #include "qm1d1c0042.h" |
| 65 | 65 | ||
| 66 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 66 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 67 | MODULE_LICENSE("GPL v2"); | 67 | MODULE_LICENSE("GPL v2"); |
| 68 | MODULE_DESCRIPTION(DRIVER_DESC " - digital TV interface"); | 68 | MODULE_DESCRIPTION(DRIVER_DESC " - digital TV interface"); |
| 69 | MODULE_VERSION(EM28XX_VERSION); | 69 | MODULE_VERSION(EM28XX_VERSION); |
diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c index 9151bccd859a..6458682bc6e2 100644 --- a/drivers/media/usb/em28xx/em28xx-i2c.c +++ b/drivers/media/usb/em28xx/em28xx-i2c.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | // | 4 | // |
| 5 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> | 5 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> |
| 6 | // Markus Rechberger <mrechberger@gmail.com> | 6 | // Markus Rechberger <mrechberger@gmail.com> |
| 7 | // Mauro Carvalho Chehab <mchehab@infradead.org> | 7 | // Mauro Carvalho Chehab <mchehab@kernel.org> |
| 8 | // Sascha Sommer <saschasommer@freenet.de> | 8 | // Sascha Sommer <saschasommer@freenet.de> |
| 9 | // Copyright (C) 2013 Frank Schäfer <fschaefer.oss@googlemail.com> | 9 | // Copyright (C) 2013 Frank Schäfer <fschaefer.oss@googlemail.com> |
| 10 | // | 10 | // |
diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c index 2dc1be00b8b8..f84a1208d5d3 100644 --- a/drivers/media/usb/em28xx/em28xx-input.c +++ b/drivers/media/usb/em28xx/em28xx-input.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | // | 4 | // |
| 5 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> | 5 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> |
| 6 | // Markus Rechberger <mrechberger@gmail.com> | 6 | // Markus Rechberger <mrechberger@gmail.com> |
| 7 | // Mauro Carvalho Chehab <mchehab@infradead.org> | 7 | // Mauro Carvalho Chehab <mchehab@kernel.org> |
| 8 | // Sascha Sommer <saschasommer@freenet.de> | 8 | // Sascha Sommer <saschasommer@freenet.de> |
| 9 | // | 9 | // |
| 10 | // This program is free software; you can redistribute it and/or modify | 10 | // This program is free software; you can redistribute it and/or modify |
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index d70ee13cc52e..68571bf36d28 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | // | 5 | // |
| 6 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> | 6 | // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it> |
| 7 | // Markus Rechberger <mrechberger@gmail.com> | 7 | // Markus Rechberger <mrechberger@gmail.com> |
| 8 | // Mauro Carvalho Chehab <mchehab@infradead.org> | 8 | // Mauro Carvalho Chehab <mchehab@kernel.org> |
| 9 | // Sascha Sommer <saschasommer@freenet.de> | 9 | // Sascha Sommer <saschasommer@freenet.de> |
| 10 | // Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> | 10 | // Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> |
| 11 | // | 11 | // |
| @@ -44,7 +44,7 @@ | |||
| 44 | 44 | ||
| 45 | #define DRIVER_AUTHOR "Ludovico Cavedon <cavedon@sssup.it>, " \ | 45 | #define DRIVER_AUTHOR "Ludovico Cavedon <cavedon@sssup.it>, " \ |
| 46 | "Markus Rechberger <mrechberger@gmail.com>, " \ | 46 | "Markus Rechberger <mrechberger@gmail.com>, " \ |
| 47 | "Mauro Carvalho Chehab <mchehab@infradead.org>, " \ | 47 | "Mauro Carvalho Chehab <mchehab@kernel.org>, " \ |
| 48 | "Sascha Sommer <saschasommer@freenet.de>" | 48 | "Sascha Sommer <saschasommer@freenet.de>" |
| 49 | 49 | ||
| 50 | static unsigned int isoc_debug; | 50 | static unsigned int isoc_debug; |
diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h index 63c7c6124707..b0378e77ddff 100644 --- a/drivers/media/usb/em28xx/em28xx.h +++ b/drivers/media/usb/em28xx/em28xx.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * | 4 | * |
| 5 | * Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com> | 5 | * Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com> |
| 6 | * Ludovico Cavedon <cavedon@sssup.it> | 6 | * Ludovico Cavedon <cavedon@sssup.it> |
| 7 | * Mauro Carvalho Chehab <mchehab@infradead.org> | 7 | * Mauro Carvalho Chehab <mchehab@kernel.org> |
| 8 | * Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> | 8 | * Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com> |
| 9 | * | 9 | * |
| 10 | * Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de> | 10 | * Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de> |
diff --git a/drivers/media/usb/gspca/zc3xx-reg.h b/drivers/media/usb/gspca/zc3xx-reg.h index a1bd94e8ce52..71fda38e85e0 100644 --- a/drivers/media/usb/gspca/zc3xx-reg.h +++ b/drivers/media/usb/gspca/zc3xx-reg.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * zc030x registers | 2 | * zc030x registers |
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2008 Mauro Carvalho Chehab <mchehab@infradead.org> | 4 | * Copyright (c) 2008 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5 | * | 5 | * |
| 6 | * The register aliases used here came from this driver: | 6 | * The register aliases used here came from this driver: |
| 7 | * http://zc0302.sourceforge.net/zc0302.php | 7 | * http://zc0302.sourceforge.net/zc0302.php |
diff --git a/drivers/media/usb/tm6000/tm6000-cards.c b/drivers/media/usb/tm6000/tm6000-cards.c index 70939e96b856..23df50aa0a4a 100644 --- a/drivers/media/usb/tm6000/tm6000-cards.c +++ b/drivers/media/usb/tm6000/tm6000-cards.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | // tm6000-cards.c - driver for TM5600/TM6000/TM6010 USB video capture devices | 2 | // tm6000-cards.c - driver for TM5600/TM6000/TM6010 USB video capture devices |
| 3 | // | 3 | // |
| 4 | // Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org> | 4 | // Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5 | 5 | ||
| 6 | #include <linux/init.h> | 6 | #include <linux/init.h> |
| 7 | #include <linux/module.h> | 7 | #include <linux/module.h> |
diff --git a/drivers/media/usb/tm6000/tm6000-core.c b/drivers/media/usb/tm6000/tm6000-core.c index 23a1332d98e6..d3229aa45fcb 100644 --- a/drivers/media/usb/tm6000/tm6000-core.c +++ b/drivers/media/usb/tm6000/tm6000-core.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | // tm6000-core.c - driver for TM5600/TM6000/TM6010 USB video capture devices | 2 | // tm6000-core.c - driver for TM5600/TM6000/TM6010 USB video capture devices |
| 3 | // | 3 | // |
| 4 | // Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org> | 4 | // Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5 | // | 5 | // |
| 6 | // Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com> | 6 | // Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com> |
| 7 | // - DVB-T support | 7 | // - DVB-T support |
diff --git a/drivers/media/usb/tm6000/tm6000-i2c.c b/drivers/media/usb/tm6000/tm6000-i2c.c index c9a62bbff27a..659b63febf85 100644 --- a/drivers/media/usb/tm6000/tm6000-i2c.c +++ b/drivers/media/usb/tm6000/tm6000-i2c.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | // tm6000-i2c.c - driver for TM5600/TM6000/TM6010 USB video capture devices | 2 | // tm6000-i2c.c - driver for TM5600/TM6000/TM6010 USB video capture devices |
| 3 | // | 3 | // |
| 4 | // Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org> | 4 | // Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5 | // | 5 | // |
| 6 | // Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com> | 6 | // Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com> |
| 7 | // - Fix SMBus Read Byte command | 7 | // - Fix SMBus Read Byte command |
diff --git a/drivers/media/usb/tm6000/tm6000-regs.h b/drivers/media/usb/tm6000/tm6000-regs.h index 21587fcf11e3..d10424673db9 100644 --- a/drivers/media/usb/tm6000/tm6000-regs.h +++ b/drivers/media/usb/tm6000/tm6000-regs.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * SPDX-License-Identifier: GPL-2.0 | 2 | * SPDX-License-Identifier: GPL-2.0 |
| 3 | * tm6000-regs.h - driver for TM5600/TM6000/TM6010 USB video capture devices | 3 | * tm6000-regs.h - driver for TM5600/TM6000/TM6010 USB video capture devices |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org> | 5 | * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | /* | 8 | /* |
diff --git a/drivers/media/usb/tm6000/tm6000-usb-isoc.h b/drivers/media/usb/tm6000/tm6000-usb-isoc.h index 5c615b0a7a46..b275dbce3a1b 100644 --- a/drivers/media/usb/tm6000/tm6000-usb-isoc.h +++ b/drivers/media/usb/tm6000/tm6000-usb-isoc.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * SPDX-License-Identifier: GPL-2.0 | 2 | * SPDX-License-Identifier: GPL-2.0 |
| 3 | * tm6000-buf.c - driver for TM5600/TM6000/TM6010 USB video capture devices | 3 | * tm6000-buf.c - driver for TM5600/TM6000/TM6010 USB video capture devices |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org> | 5 | * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #include <linux/videodev2.h> | 8 | #include <linux/videodev2.h> |
diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c index b2399d4266da..aa85fe31c835 100644 --- a/drivers/media/usb/tm6000/tm6000-video.c +++ b/drivers/media/usb/tm6000/tm6000-video.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | // tm6000-video.c - driver for TM5600/TM6000/TM6010 USB video capture devices | 2 | // tm6000-video.c - driver for TM5600/TM6000/TM6010 USB video capture devices |
| 3 | // | 3 | // |
| 4 | // Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org> | 4 | // Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 5 | // | 5 | // |
| 6 | // Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com> | 6 | // Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com> |
| 7 | // - Fixed module load/unload | 7 | // - Fixed module load/unload |
diff --git a/drivers/media/usb/tm6000/tm6000.h b/drivers/media/usb/tm6000/tm6000.h index e1e45770e28d..0864ed7314eb 100644 --- a/drivers/media/usb/tm6000/tm6000.h +++ b/drivers/media/usb/tm6000/tm6000.h | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * SPDX-License-Identifier: GPL-2.0 | 2 | * SPDX-License-Identifier: GPL-2.0 |
| 3 | * tm6000.h - driver for TM5600/TM6000/TM6010 USB video capture devices | 3 | * tm6000.h - driver for TM5600/TM6000/TM6010 USB video capture devices |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org> | 5 | * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org> |
| 6 | * | 6 | * |
| 7 | * Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com> | 7 | * Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com> |
| 8 | * - DVB-T support | 8 | * - DVB-T support |
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c index 1d0b2208e8fb..c080dcc75393 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | * 2 of the License, or (at your option) any later version. | 10 | * 2 of the License, or (at your option) any later version. |
| 11 | * | 11 | * |
| 12 | * Authors: Alan Cox, <alan@lxorguk.ukuu.org.uk> (version 1) | 12 | * Authors: Alan Cox, <alan@lxorguk.ukuu.org.uk> (version 1) |
| 13 | * Mauro Carvalho Chehab <mchehab@infradead.org> (version 2) | 13 | * Mauro Carvalho Chehab <mchehab@kernel.org> (version 2) |
| 14 | * | 14 | * |
| 15 | * Fixes: 20000516 Claudio Matsuoka <claudio@conectiva.com> | 15 | * Fixes: 20000516 Claudio Matsuoka <claudio@conectiva.com> |
| 16 | * - Added procfs support | 16 | * - Added procfs support |
| @@ -1072,7 +1072,7 @@ static void __exit videodev_exit(void) | |||
| 1072 | subsys_initcall(videodev_init); | 1072 | subsys_initcall(videodev_init); |
| 1073 | module_exit(videodev_exit) | 1073 | module_exit(videodev_exit) |
| 1074 | 1074 | ||
| 1075 | MODULE_AUTHOR("Alan Cox, Mauro Carvalho Chehab <mchehab@infradead.org>"); | 1075 | MODULE_AUTHOR("Alan Cox, Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 1076 | MODULE_DESCRIPTION("Device registrar for Video4Linux drivers v2"); | 1076 | MODULE_DESCRIPTION("Device registrar for Video4Linux drivers v2"); |
| 1077 | MODULE_LICENSE("GPL"); | 1077 | MODULE_LICENSE("GPL"); |
| 1078 | MODULE_ALIAS_CHARDEV_MAJOR(VIDEO_MAJOR); | 1078 | MODULE_ALIAS_CHARDEV_MAJOR(VIDEO_MAJOR); |
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index f48c505550e0..de5d96dbe69e 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
| 10 | * | 10 | * |
| 11 | * Authors: Alan Cox, <alan@lxorguk.ukuu.org.uk> (version 1) | 11 | * Authors: Alan Cox, <alan@lxorguk.ukuu.org.uk> (version 1) |
| 12 | * Mauro Carvalho Chehab <mchehab@infradead.org> (version 2) | 12 | * Mauro Carvalho Chehab <mchehab@kernel.org> (version 2) |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
diff --git a/drivers/media/v4l2-core/videobuf-core.c b/drivers/media/v4l2-core/videobuf-core.c index 2b3981842b4b..7491b337002c 100644 --- a/drivers/media/v4l2-core/videobuf-core.c +++ b/drivers/media/v4l2-core/videobuf-core.c | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * generic helper functions for handling video4linux capture buffers | 2 | * generic helper functions for handling video4linux capture buffers |
| 3 | * | 3 | * |
| 4 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@infradead.org> | 4 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 5 | * | 5 | * |
| 6 | * Highly based on video-buf written originally by: | 6 | * Highly based on video-buf written originally by: |
| 7 | * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> | 7 | * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> |
| 8 | * (c) 2006 Mauro Carvalho Chehab, <mchehab@infradead.org> | 8 | * (c) 2006 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 9 | * (c) 2006 Ted Walther and John Sokol | 9 | * (c) 2006 Ted Walther and John Sokol |
| 10 | * | 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
| @@ -38,7 +38,7 @@ static int debug; | |||
| 38 | module_param(debug, int, 0644); | 38 | module_param(debug, int, 0644); |
| 39 | 39 | ||
| 40 | MODULE_DESCRIPTION("helper module to manage video4linux buffers"); | 40 | MODULE_DESCRIPTION("helper module to manage video4linux buffers"); |
| 41 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 41 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 42 | MODULE_LICENSE("GPL"); | 42 | MODULE_LICENSE("GPL"); |
| 43 | 43 | ||
| 44 | #define dprintk(level, fmt, arg...) \ | 44 | #define dprintk(level, fmt, arg...) \ |
diff --git a/drivers/media/v4l2-core/videobuf-dma-contig.c b/drivers/media/v4l2-core/videobuf-dma-contig.c index e02353e340dd..f46132504d88 100644 --- a/drivers/media/v4l2-core/videobuf-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf-dma-contig.c | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | * Copyright (c) 2008 Magnus Damm | 7 | * Copyright (c) 2008 Magnus Damm |
| 8 | * | 8 | * |
| 9 | * Based on videobuf-vmalloc.c, | 9 | * Based on videobuf-vmalloc.c, |
| 10 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@infradead.org> | 10 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 11 | * | 11 | * |
| 12 | * This program is free software; you can redistribute it and/or modify | 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by | 13 | * it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c index add2edb23eac..7770034aae28 100644 --- a/drivers/media/v4l2-core/videobuf-dma-sg.c +++ b/drivers/media/v4l2-core/videobuf-dma-sg.c | |||
| @@ -6,11 +6,11 @@ | |||
| 6 | * into PAGE_SIZE chunks). They also assume the driver does not need | 6 | * into PAGE_SIZE chunks). They also assume the driver does not need |
| 7 | * to touch the video data. | 7 | * to touch the video data. |
| 8 | * | 8 | * |
| 9 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@infradead.org> | 9 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 10 | * | 10 | * |
| 11 | * Highly based on video-buf written originally by: | 11 | * Highly based on video-buf written originally by: |
| 12 | * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> | 12 | * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> |
| 13 | * (c) 2006 Mauro Carvalho Chehab, <mchehab@infradead.org> | 13 | * (c) 2006 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 14 | * (c) 2006 Ted Walther and John Sokol | 14 | * (c) 2006 Ted Walther and John Sokol |
| 15 | * | 15 | * |
| 16 | * This program is free software; you can redistribute it and/or modify | 16 | * This program is free software; you can redistribute it and/or modify |
| @@ -48,7 +48,7 @@ static int debug; | |||
| 48 | module_param(debug, int, 0644); | 48 | module_param(debug, int, 0644); |
| 49 | 49 | ||
| 50 | MODULE_DESCRIPTION("helper module to manage video4linux dma sg buffers"); | 50 | MODULE_DESCRIPTION("helper module to manage video4linux dma sg buffers"); |
| 51 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 51 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 52 | MODULE_LICENSE("GPL"); | 52 | MODULE_LICENSE("GPL"); |
| 53 | 53 | ||
| 54 | #define dprintk(level, fmt, arg...) \ | 54 | #define dprintk(level, fmt, arg...) \ |
diff --git a/drivers/media/v4l2-core/videobuf-vmalloc.c b/drivers/media/v4l2-core/videobuf-vmalloc.c index 2ff7fcc77b11..45fe781aeeec 100644 --- a/drivers/media/v4l2-core/videobuf-vmalloc.c +++ b/drivers/media/v4l2-core/videobuf-vmalloc.c | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | * into PAGE_SIZE chunks). They also assume the driver does not need | 6 | * into PAGE_SIZE chunks). They also assume the driver does not need |
| 7 | * to touch the video data. | 7 | * to touch the video data. |
| 8 | * | 8 | * |
| 9 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@infradead.org> | 9 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 10 | * | 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by | 12 | * it under the terms of the GNU General Public License as published by |
| @@ -41,7 +41,7 @@ static int debug; | |||
| 41 | module_param(debug, int, 0644); | 41 | module_param(debug, int, 0644); |
| 42 | 42 | ||
| 43 | MODULE_DESCRIPTION("helper module to manage video4linux vmalloc buffers"); | 43 | MODULE_DESCRIPTION("helper module to manage video4linux vmalloc buffers"); |
| 44 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); | 44 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); |
| 45 | MODULE_LICENSE("GPL"); | 45 | MODULE_LICENSE("GPL"); |
| 46 | 46 | ||
| 47 | #define dprintk(level, fmt, arg...) \ | 47 | #define dprintk(level, fmt, arg...) \ |
diff --git a/drivers/nvme/host/Kconfig b/drivers/nvme/host/Kconfig index b979cf3bce65..88a8b5916624 100644 --- a/drivers/nvme/host/Kconfig +++ b/drivers/nvme/host/Kconfig | |||
| @@ -27,7 +27,7 @@ config NVME_FABRICS | |||
| 27 | 27 | ||
| 28 | config NVME_RDMA | 28 | config NVME_RDMA |
| 29 | tristate "NVM Express over Fabrics RDMA host driver" | 29 | tristate "NVM Express over Fabrics RDMA host driver" |
| 30 | depends on INFINIBAND && BLOCK | 30 | depends on INFINIBAND && INFINIBAND_ADDR_TRANS && BLOCK |
| 31 | select NVME_CORE | 31 | select NVME_CORE |
| 32 | select NVME_FABRICS | 32 | select NVME_FABRICS |
| 33 | select SG_POOL | 33 | select SG_POOL |
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 9df4f71e58ca..a3771c5729f5 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c | |||
| @@ -764,6 +764,7 @@ static int nvme_submit_user_cmd(struct request_queue *q, | |||
| 764 | ret = PTR_ERR(meta); | 764 | ret = PTR_ERR(meta); |
| 765 | goto out_unmap; | 765 | goto out_unmap; |
| 766 | } | 766 | } |
| 767 | req->cmd_flags |= REQ_INTEGRITY; | ||
| 767 | } | 768 | } |
| 768 | } | 769 | } |
| 769 | 770 | ||
| @@ -2997,31 +2998,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) | |||
| 2997 | if (nvme_init_ns_head(ns, nsid, id)) | 2998 | if (nvme_init_ns_head(ns, nsid, id)) |
| 2998 | goto out_free_id; | 2999 | goto out_free_id; |
| 2999 | nvme_setup_streams_ns(ctrl, ns); | 3000 | nvme_setup_streams_ns(ctrl, ns); |
| 3000 | 3001 | nvme_set_disk_name(disk_name, ns, ctrl, &flags); | |
| 3001 | #ifdef CONFIG_NVME_MULTIPATH | ||
| 3002 | /* | ||
| 3003 | * If multipathing is enabled we need to always use the subsystem | ||
| 3004 | * instance number for numbering our devices to avoid conflicts | ||
| 3005 | * between subsystems that have multiple controllers and thus use | ||
| 3006 | * the multipath-aware subsystem node and those that have a single | ||
| 3007 | * controller and use the controller node directly. | ||
| 3008 | */ | ||
| 3009 | if (ns->head->disk) { | ||
| 3010 | sprintf(disk_name, "nvme%dc%dn%d", ctrl->subsys->instance, | ||
| 3011 | ctrl->cntlid, ns->head->instance); | ||
| 3012 | flags = GENHD_FL_HIDDEN; | ||
| 3013 | } else { | ||
| 3014 | sprintf(disk_name, "nvme%dn%d", ctrl->subsys->instance, | ||
| 3015 | ns->head->instance); | ||
| 3016 | } | ||
| 3017 | #else | ||
| 3018 | /* | ||
| 3019 | * But without the multipath code enabled, multiple controller per | ||
| 3020 | * subsystems are visible as devices and thus we cannot use the | ||
| 3021 | * subsystem instance. | ||
| 3022 | */ | ||
| 3023 | sprintf(disk_name, "nvme%dn%d", ctrl->instance, ns->head->instance); | ||
| 3024 | #endif | ||
| 3025 | 3002 | ||
| 3026 | if ((ctrl->quirks & NVME_QUIRK_LIGHTNVM) && id->vs[0] == 0x1) { | 3003 | if ((ctrl->quirks & NVME_QUIRK_LIGHTNVM) && id->vs[0] == 0x1) { |
| 3027 | if (nvme_nvm_register(ns, disk_name, node)) { | 3004 | if (nvme_nvm_register(ns, disk_name, node)) { |
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c index 124c458806df..7ae732a77fe8 100644 --- a/drivers/nvme/host/fabrics.c +++ b/drivers/nvme/host/fabrics.c | |||
| @@ -668,6 +668,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, | |||
| 668 | ret = -ENOMEM; | 668 | ret = -ENOMEM; |
| 669 | goto out; | 669 | goto out; |
| 670 | } | 670 | } |
| 671 | kfree(opts->transport); | ||
| 671 | opts->transport = p; | 672 | opts->transport = p; |
| 672 | break; | 673 | break; |
| 673 | case NVMF_OPT_NQN: | 674 | case NVMF_OPT_NQN: |
| @@ -676,6 +677,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, | |||
| 676 | ret = -ENOMEM; | 677 | ret = -ENOMEM; |
| 677 | goto out; | 678 | goto out; |
| 678 | } | 679 | } |
| 680 | kfree(opts->subsysnqn); | ||
| 679 | opts->subsysnqn = p; | 681 | opts->subsysnqn = p; |
| 680 | nqnlen = strlen(opts->subsysnqn); | 682 | nqnlen = strlen(opts->subsysnqn); |
| 681 | if (nqnlen >= NVMF_NQN_SIZE) { | 683 | if (nqnlen >= NVMF_NQN_SIZE) { |
| @@ -698,6 +700,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, | |||
| 698 | ret = -ENOMEM; | 700 | ret = -ENOMEM; |
| 699 | goto out; | 701 | goto out; |
| 700 | } | 702 | } |
| 703 | kfree(opts->traddr); | ||
| 701 | opts->traddr = p; | 704 | opts->traddr = p; |
| 702 | break; | 705 | break; |
| 703 | case NVMF_OPT_TRSVCID: | 706 | case NVMF_OPT_TRSVCID: |
| @@ -706,6 +709,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, | |||
| 706 | ret = -ENOMEM; | 709 | ret = -ENOMEM; |
| 707 | goto out; | 710 | goto out; |
| 708 | } | 711 | } |
| 712 | kfree(opts->trsvcid); | ||
| 709 | opts->trsvcid = p; | 713 | opts->trsvcid = p; |
| 710 | break; | 714 | break; |
| 711 | case NVMF_OPT_QUEUE_SIZE: | 715 | case NVMF_OPT_QUEUE_SIZE: |
| @@ -792,6 +796,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, | |||
| 792 | ret = -EINVAL; | 796 | ret = -EINVAL; |
| 793 | goto out; | 797 | goto out; |
| 794 | } | 798 | } |
| 799 | nvmf_host_put(opts->host); | ||
| 795 | opts->host = nvmf_host_add(p); | 800 | opts->host = nvmf_host_add(p); |
| 796 | kfree(p); | 801 | kfree(p); |
| 797 | if (!opts->host) { | 802 | if (!opts->host) { |
| @@ -817,6 +822,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, | |||
| 817 | ret = -ENOMEM; | 822 | ret = -ENOMEM; |
| 818 | goto out; | 823 | goto out; |
| 819 | } | 824 | } |
| 825 | kfree(opts->host_traddr); | ||
| 820 | opts->host_traddr = p; | 826 | opts->host_traddr = p; |
| 821 | break; | 827 | break; |
| 822 | case NVMF_OPT_HOST_ID: | 828 | case NVMF_OPT_HOST_ID: |
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index 956e0b8e9c4d..d7b664ae5923 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c | |||
| @@ -15,10 +15,32 @@ | |||
| 15 | #include "nvme.h" | 15 | #include "nvme.h" |
| 16 | 16 | ||
| 17 | static bool multipath = true; | 17 | static bool multipath = true; |
| 18 | module_param(multipath, bool, 0644); | 18 | module_param(multipath, bool, 0444); |
| 19 | MODULE_PARM_DESC(multipath, | 19 | MODULE_PARM_DESC(multipath, |
| 20 | "turn on native support for multiple controllers per subsystem"); | 20 | "turn on native support for multiple controllers per subsystem"); |
| 21 | 21 | ||
| 22 | /* | ||
| 23 | * If multipathing is enabled we need to always use the subsystem instance | ||
| 24 | * number for numbering our devices to avoid conflicts between subsystems that | ||
| 25 | * have multiple controllers and thus use the multipath-aware subsystem node | ||
| 26 | * and those that have a single controller and use the controller node | ||
| 27 | * directly. | ||
| 28 | */ | ||
| 29 | void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns, | ||
| 30 | struct nvme_ctrl *ctrl, int *flags) | ||
| 31 | { | ||
| 32 | if (!multipath) { | ||
| 33 | sprintf(disk_name, "nvme%dn%d", ctrl->instance, ns->head->instance); | ||
| 34 | } else if (ns->head->disk) { | ||
| 35 | sprintf(disk_name, "nvme%dc%dn%d", ctrl->subsys->instance, | ||
| 36 | ctrl->cntlid, ns->head->instance); | ||
| 37 | *flags = GENHD_FL_HIDDEN; | ||
| 38 | } else { | ||
| 39 | sprintf(disk_name, "nvme%dn%d", ctrl->subsys->instance, | ||
| 40 | ns->head->instance); | ||
| 41 | } | ||
| 42 | } | ||
| 43 | |||
| 22 | void nvme_failover_req(struct request *req) | 44 | void nvme_failover_req(struct request *req) |
| 23 | { | 45 | { |
| 24 | struct nvme_ns *ns = req->q->queuedata; | 46 | struct nvme_ns *ns = req->q->queuedata; |
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index 061fecfd44f5..7ded7a51c430 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h | |||
| @@ -436,6 +436,8 @@ extern const struct attribute_group nvme_ns_id_attr_group; | |||
| 436 | extern const struct block_device_operations nvme_ns_head_ops; | 436 | extern const struct block_device_operations nvme_ns_head_ops; |
| 437 | 437 | ||
| 438 | #ifdef CONFIG_NVME_MULTIPATH | 438 | #ifdef CONFIG_NVME_MULTIPATH |
| 439 | void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns, | ||
| 440 | struct nvme_ctrl *ctrl, int *flags); | ||
| 439 | void nvme_failover_req(struct request *req); | 441 | void nvme_failover_req(struct request *req); |
| 440 | bool nvme_req_needs_failover(struct request *req, blk_status_t error); | 442 | bool nvme_req_needs_failover(struct request *req, blk_status_t error); |
| 441 | void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl); | 443 | void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl); |
| @@ -461,6 +463,16 @@ static inline void nvme_mpath_check_last_path(struct nvme_ns *ns) | |||
| 461 | } | 463 | } |
| 462 | 464 | ||
| 463 | #else | 465 | #else |
| 466 | /* | ||
| 467 | * Without the multipath code enabled, multiple controller per subsystems are | ||
| 468 | * visible as devices and thus we cannot use the subsystem instance. | ||
| 469 | */ | ||
| 470 | static inline void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns, | ||
| 471 | struct nvme_ctrl *ctrl, int *flags) | ||
| 472 | { | ||
| 473 | sprintf(disk_name, "nvme%dn%d", ctrl->instance, ns->head->instance); | ||
| 474 | } | ||
| 475 | |||
| 464 | static inline void nvme_failover_req(struct request *req) | 476 | static inline void nvme_failover_req(struct request *req) |
| 465 | { | 477 | { |
| 466 | } | 478 | } |
diff --git a/drivers/nvme/target/Kconfig b/drivers/nvme/target/Kconfig index 5f4f8b16685f..3c7b61ddb0d1 100644 --- a/drivers/nvme/target/Kconfig +++ b/drivers/nvme/target/Kconfig | |||
| @@ -27,7 +27,7 @@ config NVME_TARGET_LOOP | |||
| 27 | 27 | ||
| 28 | config NVME_TARGET_RDMA | 28 | config NVME_TARGET_RDMA |
| 29 | tristate "NVMe over Fabrics RDMA target support" | 29 | tristate "NVMe over Fabrics RDMA target support" |
| 30 | depends on INFINIBAND | 30 | depends on INFINIBAND && INFINIBAND_ADDR_TRANS |
| 31 | depends on NVME_TARGET | 31 | depends on NVME_TARGET |
| 32 | select SGL_ALLOC | 32 | select SGL_ALLOC |
| 33 | help | 33 | help |
diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c index 31fdfba556a8..27a8561c0cb9 100644 --- a/drivers/nvme/target/loop.c +++ b/drivers/nvme/target/loop.c | |||
| @@ -469,6 +469,12 @@ static void nvme_loop_reset_ctrl_work(struct work_struct *work) | |||
| 469 | nvme_stop_ctrl(&ctrl->ctrl); | 469 | nvme_stop_ctrl(&ctrl->ctrl); |
| 470 | nvme_loop_shutdown_ctrl(ctrl); | 470 | nvme_loop_shutdown_ctrl(ctrl); |
| 471 | 471 | ||
| 472 | if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) { | ||
| 473 | /* state change failure should never happen */ | ||
| 474 | WARN_ON_ONCE(1); | ||
| 475 | return; | ||
| 476 | } | ||
| 477 | |||
| 472 | ret = nvme_loop_configure_admin_queue(ctrl); | 478 | ret = nvme_loop_configure_admin_queue(ctrl); |
| 473 | if (ret) | 479 | if (ret) |
| 474 | goto out_disable; | 480 | goto out_disable; |
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 39d06dd1f63a..bc309c5327ff 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig | |||
| @@ -154,7 +154,7 @@ config DELL_LAPTOP | |||
| 154 | depends on ACPI_VIDEO || ACPI_VIDEO = n | 154 | depends on ACPI_VIDEO || ACPI_VIDEO = n |
| 155 | depends on RFKILL || RFKILL = n | 155 | depends on RFKILL || RFKILL = n |
| 156 | depends on SERIO_I8042 | 156 | depends on SERIO_I8042 |
| 157 | select DELL_SMBIOS | 157 | depends on DELL_SMBIOS |
| 158 | select POWER_SUPPLY | 158 | select POWER_SUPPLY |
| 159 | select LEDS_CLASS | 159 | select LEDS_CLASS |
| 160 | select NEW_LEDS | 160 | select NEW_LEDS |
diff --git a/drivers/platform/x86/asus-wireless.c b/drivers/platform/x86/asus-wireless.c index d4aeac3477f5..f086469ea740 100644 --- a/drivers/platform/x86/asus-wireless.c +++ b/drivers/platform/x86/asus-wireless.c | |||
| @@ -178,8 +178,10 @@ static int asus_wireless_remove(struct acpi_device *adev) | |||
| 178 | { | 178 | { |
| 179 | struct asus_wireless_data *data = acpi_driver_data(adev); | 179 | struct asus_wireless_data *data = acpi_driver_data(adev); |
| 180 | 180 | ||
| 181 | if (data->wq) | 181 | if (data->wq) { |
| 182 | devm_led_classdev_unregister(&adev->dev, &data->led); | ||
| 182 | destroy_workqueue(data->wq); | 183 | destroy_workqueue(data->wq); |
| 184 | } | ||
| 183 | return 0; | 185 | return 0; |
| 184 | } | 186 | } |
| 185 | 187 | ||
diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index 8e70a627e0bb..cbbafdcaaecb 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c | |||
| @@ -1083,6 +1083,7 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc) | |||
| 1083 | dev_err(qproc->dev, "unable to resolve mba region\n"); | 1083 | dev_err(qproc->dev, "unable to resolve mba region\n"); |
| 1084 | return ret; | 1084 | return ret; |
| 1085 | } | 1085 | } |
| 1086 | of_node_put(node); | ||
| 1086 | 1087 | ||
| 1087 | qproc->mba_phys = r.start; | 1088 | qproc->mba_phys = r.start; |
| 1088 | qproc->mba_size = resource_size(&r); | 1089 | qproc->mba_size = resource_size(&r); |
| @@ -1100,6 +1101,7 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc) | |||
| 1100 | dev_err(qproc->dev, "unable to resolve mpss region\n"); | 1101 | dev_err(qproc->dev, "unable to resolve mpss region\n"); |
| 1101 | return ret; | 1102 | return ret; |
| 1102 | } | 1103 | } |
| 1104 | of_node_put(node); | ||
| 1103 | 1105 | ||
| 1104 | qproc->mpss_phys = qproc->mpss_reloc = r.start; | 1106 | qproc->mpss_phys = qproc->mpss_reloc = r.start; |
| 1105 | qproc->mpss_size = resource_size(&r); | 1107 | qproc->mpss_size = resource_size(&r); |
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 6d9c5832ce47..a9609d971f7f 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c | |||
| @@ -1163,7 +1163,7 @@ int rproc_trigger_recovery(struct rproc *rproc) | |||
| 1163 | if (ret) | 1163 | if (ret) |
| 1164 | return ret; | 1164 | return ret; |
| 1165 | 1165 | ||
| 1166 | ret = rproc_stop(rproc, false); | 1166 | ret = rproc_stop(rproc, true); |
| 1167 | if (ret) | 1167 | if (ret) |
| 1168 | goto unlock_mutex; | 1168 | goto unlock_mutex; |
| 1169 | 1169 | ||
| @@ -1316,7 +1316,7 @@ void rproc_shutdown(struct rproc *rproc) | |||
| 1316 | if (!atomic_dec_and_test(&rproc->power)) | 1316 | if (!atomic_dec_and_test(&rproc->power)) |
| 1317 | goto out; | 1317 | goto out; |
| 1318 | 1318 | ||
| 1319 | ret = rproc_stop(rproc, true); | 1319 | ret = rproc_stop(rproc, false); |
| 1320 | if (ret) { | 1320 | if (ret) { |
| 1321 | atomic_inc(&rproc->power); | 1321 | atomic_inc(&rproc->power); |
| 1322 | goto out; | 1322 | goto out; |
diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c index 64b6de9763ee..1efdf9ff8679 100644 --- a/drivers/rpmsg/rpmsg_char.c +++ b/drivers/rpmsg/rpmsg_char.c | |||
| @@ -581,4 +581,6 @@ static void rpmsg_chrdev_exit(void) | |||
| 581 | unregister_chrdev_region(rpmsg_major, RPMSG_DEV_MAX); | 581 | unregister_chrdev_region(rpmsg_major, RPMSG_DEV_MAX); |
| 582 | } | 582 | } |
| 583 | module_exit(rpmsg_chrdev_exit); | 583 | module_exit(rpmsg_chrdev_exit); |
| 584 | |||
| 585 | MODULE_ALIAS("rpmsg:rpmsg_chrdev"); | ||
| 584 | MODULE_LICENSE("GPL v2"); | 586 | MODULE_LICENSE("GPL v2"); |
diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index 16cab40156ca..aeab05f682d9 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c | |||
| @@ -1799,7 +1799,7 @@ static int imx_csi_probe(struct platform_device *pdev) | |||
| 1799 | priv->dev->of_node = pdata->of_node; | 1799 | priv->dev->of_node = pdata->of_node; |
| 1800 | pinctrl = devm_pinctrl_get_select_default(priv->dev); | 1800 | pinctrl = devm_pinctrl_get_select_default(priv->dev); |
| 1801 | if (IS_ERR(pinctrl)) { | 1801 | if (IS_ERR(pinctrl)) { |
| 1802 | ret = PTR_ERR(priv->vdev); | 1802 | ret = PTR_ERR(pinctrl); |
| 1803 | dev_dbg(priv->dev, | 1803 | dev_dbg(priv->dev, |
| 1804 | "devm_pinctrl_get_select_default() failed: %d\n", ret); | 1804 | "devm_pinctrl_get_select_default() failed: %d\n", ret); |
| 1805 | if (ret != -ENODEV) | 1805 | if (ret != -ENODEV) |
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index c821b4b9647e..7b5cb28ffb35 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c | |||
| @@ -191,7 +191,9 @@ static const unsigned short full_speed_maxpacket_maxes[4] = { | |||
| 191 | static const unsigned short high_speed_maxpacket_maxes[4] = { | 191 | static const unsigned short high_speed_maxpacket_maxes[4] = { |
| 192 | [USB_ENDPOINT_XFER_CONTROL] = 64, | 192 | [USB_ENDPOINT_XFER_CONTROL] = 64, |
| 193 | [USB_ENDPOINT_XFER_ISOC] = 1024, | 193 | [USB_ENDPOINT_XFER_ISOC] = 1024, |
| 194 | [USB_ENDPOINT_XFER_BULK] = 512, | 194 | |
| 195 | /* Bulk should be 512, but some devices use 1024: we will warn below */ | ||
| 196 | [USB_ENDPOINT_XFER_BULK] = 1024, | ||
| 195 | [USB_ENDPOINT_XFER_INT] = 1024, | 197 | [USB_ENDPOINT_XFER_INT] = 1024, |
| 196 | }; | 198 | }; |
| 197 | static const unsigned short super_speed_maxpacket_maxes[4] = { | 199 | static const unsigned short super_speed_maxpacket_maxes[4] = { |
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h index d83be5651f87..a666e0758a99 100644 --- a/drivers/usb/dwc2/core.h +++ b/drivers/usb/dwc2/core.h | |||
| @@ -985,6 +985,7 @@ struct dwc2_hsotg { | |||
| 985 | 985 | ||
| 986 | /* DWC OTG HW Release versions */ | 986 | /* DWC OTG HW Release versions */ |
| 987 | #define DWC2_CORE_REV_2_71a 0x4f54271a | 987 | #define DWC2_CORE_REV_2_71a 0x4f54271a |
| 988 | #define DWC2_CORE_REV_2_72a 0x4f54272a | ||
| 988 | #define DWC2_CORE_REV_2_80a 0x4f54280a | 989 | #define DWC2_CORE_REV_2_80a 0x4f54280a |
| 989 | #define DWC2_CORE_REV_2_90a 0x4f54290a | 990 | #define DWC2_CORE_REV_2_90a 0x4f54290a |
| 990 | #define DWC2_CORE_REV_2_91a 0x4f54291a | 991 | #define DWC2_CORE_REV_2_91a 0x4f54291a |
| @@ -992,6 +993,7 @@ struct dwc2_hsotg { | |||
| 992 | #define DWC2_CORE_REV_2_94a 0x4f54294a | 993 | #define DWC2_CORE_REV_2_94a 0x4f54294a |
| 993 | #define DWC2_CORE_REV_3_00a 0x4f54300a | 994 | #define DWC2_CORE_REV_3_00a 0x4f54300a |
| 994 | #define DWC2_CORE_REV_3_10a 0x4f54310a | 995 | #define DWC2_CORE_REV_3_10a 0x4f54310a |
| 996 | #define DWC2_CORE_REV_4_00a 0x4f54400a | ||
| 995 | #define DWC2_FS_IOT_REV_1_00a 0x5531100a | 997 | #define DWC2_FS_IOT_REV_1_00a 0x5531100a |
| 996 | #define DWC2_HS_IOT_REV_1_00a 0x5532100a | 998 | #define DWC2_HS_IOT_REV_1_00a 0x5532100a |
| 997 | 999 | ||
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 6c32bf26e48e..83cb5577a52f 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c | |||
| @@ -3928,6 +3928,27 @@ static int dwc2_hsotg_ep_enable(struct usb_ep *ep, | |||
| 3928 | if (index && !hs_ep->isochronous) | 3928 | if (index && !hs_ep->isochronous) |
| 3929 | epctrl |= DXEPCTL_SETD0PID; | 3929 | epctrl |= DXEPCTL_SETD0PID; |
| 3930 | 3930 | ||
| 3931 | /* WA for Full speed ISOC IN in DDMA mode. | ||
| 3932 | * By Clear NAK status of EP, core will send ZLP | ||
| 3933 | * to IN token and assert NAK interrupt relying | ||
| 3934 | * on TxFIFO status only | ||
| 3935 | */ | ||
| 3936 | |||
| 3937 | if (hsotg->gadget.speed == USB_SPEED_FULL && | ||
| 3938 | hs_ep->isochronous && dir_in) { | ||
| 3939 | /* The WA applies only to core versions from 2.72a | ||
| 3940 | * to 4.00a (including both). Also for FS_IOT_1.00a | ||
| 3941 | * and HS_IOT_1.00a. | ||
| 3942 | */ | ||
| 3943 | u32 gsnpsid = dwc2_readl(hsotg->regs + GSNPSID); | ||
| 3944 | |||
| 3945 | if ((gsnpsid >= DWC2_CORE_REV_2_72a && | ||
| 3946 | gsnpsid <= DWC2_CORE_REV_4_00a) || | ||
| 3947 | gsnpsid == DWC2_FS_IOT_REV_1_00a || | ||
| 3948 | gsnpsid == DWC2_HS_IOT_REV_1_00a) | ||
| 3949 | epctrl |= DXEPCTL_CNAK; | ||
| 3950 | } | ||
| 3951 | |||
| 3931 | dev_dbg(hsotg->dev, "%s: write DxEPCTL=0x%08x\n", | 3952 | dev_dbg(hsotg->dev, "%s: write DxEPCTL=0x%08x\n", |
| 3932 | __func__, epctrl); | 3953 | __func__, epctrl); |
| 3933 | 3954 | ||
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 190f95964000..c51b73b3e048 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c | |||
| @@ -358,9 +358,14 @@ static void dwc2_gusbcfg_init(struct dwc2_hsotg *hsotg) | |||
| 358 | 358 | ||
| 359 | static int dwc2_vbus_supply_init(struct dwc2_hsotg *hsotg) | 359 | static int dwc2_vbus_supply_init(struct dwc2_hsotg *hsotg) |
| 360 | { | 360 | { |
| 361 | int ret; | ||
| 362 | |||
| 361 | hsotg->vbus_supply = devm_regulator_get_optional(hsotg->dev, "vbus"); | 363 | hsotg->vbus_supply = devm_regulator_get_optional(hsotg->dev, "vbus"); |
| 362 | if (IS_ERR(hsotg->vbus_supply)) | 364 | if (IS_ERR(hsotg->vbus_supply)) { |
| 363 | return 0; | 365 | ret = PTR_ERR(hsotg->vbus_supply); |
| 366 | hsotg->vbus_supply = NULL; | ||
| 367 | return ret == -ENODEV ? 0 : ret; | ||
| 368 | } | ||
| 364 | 369 | ||
| 365 | return regulator_enable(hsotg->vbus_supply); | 370 | return regulator_enable(hsotg->vbus_supply); |
| 366 | } | 371 | } |
| @@ -4342,9 +4347,7 @@ static int _dwc2_hcd_start(struct usb_hcd *hcd) | |||
| 4342 | 4347 | ||
| 4343 | spin_unlock_irqrestore(&hsotg->lock, flags); | 4348 | spin_unlock_irqrestore(&hsotg->lock, flags); |
| 4344 | 4349 | ||
| 4345 | dwc2_vbus_supply_init(hsotg); | 4350 | return dwc2_vbus_supply_init(hsotg); |
| 4346 | |||
| 4347 | return 0; | ||
| 4348 | } | 4351 | } |
| 4349 | 4352 | ||
| 4350 | /* | 4353 | /* |
diff --git a/drivers/usb/dwc2/pci.c b/drivers/usb/dwc2/pci.c index 7f21747007f1..bea2e8ec0369 100644 --- a/drivers/usb/dwc2/pci.c +++ b/drivers/usb/dwc2/pci.c | |||
| @@ -141,8 +141,10 @@ static int dwc2_pci_probe(struct pci_dev *pci, | |||
| 141 | goto err; | 141 | goto err; |
| 142 | 142 | ||
| 143 | glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL); | 143 | glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL); |
| 144 | if (!glue) | 144 | if (!glue) { |
| 145 | ret = -ENOMEM; | ||
| 145 | goto err; | 146 | goto err; |
| 147 | } | ||
| 146 | 148 | ||
| 147 | ret = platform_device_add(dwc2); | 149 | ret = platform_device_add(dwc2); |
| 148 | if (ret) { | 150 | if (ret) { |
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 8796a5ee9bb9..0dedf8a799f4 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c | |||
| @@ -166,7 +166,7 @@ static void dwc3_ep_inc_deq(struct dwc3_ep *dep) | |||
| 166 | dwc3_ep_inc_trb(&dep->trb_dequeue); | 166 | dwc3_ep_inc_trb(&dep->trb_dequeue); |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | void dwc3_gadget_del_and_unmap_request(struct dwc3_ep *dep, | 169 | static void dwc3_gadget_del_and_unmap_request(struct dwc3_ep *dep, |
| 170 | struct dwc3_request *req, int status) | 170 | struct dwc3_request *req, int status) |
| 171 | { | 171 | { |
| 172 | struct dwc3 *dwc = dep->dwc; | 172 | struct dwc3 *dwc = dep->dwc; |
| @@ -1424,7 +1424,7 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep, | |||
| 1424 | dwc->lock); | 1424 | dwc->lock); |
| 1425 | 1425 | ||
| 1426 | if (!r->trb) | 1426 | if (!r->trb) |
| 1427 | goto out1; | 1427 | goto out0; |
| 1428 | 1428 | ||
| 1429 | if (r->num_pending_sgs) { | 1429 | if (r->num_pending_sgs) { |
| 1430 | struct dwc3_trb *trb; | 1430 | struct dwc3_trb *trb; |
diff --git a/drivers/usb/gadget/function/f_phonet.c b/drivers/usb/gadget/function/f_phonet.c index 7889bcc0509a..8b72b192c747 100644 --- a/drivers/usb/gadget/function/f_phonet.c +++ b/drivers/usb/gadget/function/f_phonet.c | |||
| @@ -221,7 +221,7 @@ static void pn_tx_complete(struct usb_ep *ep, struct usb_request *req) | |||
| 221 | netif_wake_queue(dev); | 221 | netif_wake_queue(dev); |
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | static int pn_net_xmit(struct sk_buff *skb, struct net_device *dev) | 224 | static netdev_tx_t pn_net_xmit(struct sk_buff *skb, struct net_device *dev) |
| 225 | { | 225 | { |
| 226 | struct phonet_port *port = netdev_priv(dev); | 226 | struct phonet_port *port = netdev_priv(dev); |
| 227 | struct f_phonet *fp; | 227 | struct f_phonet *fp; |
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c index 4c6c08b675b5..21307d862af6 100644 --- a/drivers/usb/host/ehci-mem.c +++ b/drivers/usb/host/ehci-mem.c | |||
| @@ -73,9 +73,10 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags) | |||
| 73 | if (!qh) | 73 | if (!qh) |
| 74 | goto done; | 74 | goto done; |
| 75 | qh->hw = (struct ehci_qh_hw *) | 75 | qh->hw = (struct ehci_qh_hw *) |
| 76 | dma_pool_zalloc(ehci->qh_pool, flags, &dma); | 76 | dma_pool_alloc(ehci->qh_pool, flags, &dma); |
| 77 | if (!qh->hw) | 77 | if (!qh->hw) |
| 78 | goto fail; | 78 | goto fail; |
| 79 | memset(qh->hw, 0, sizeof *qh->hw); | ||
| 79 | qh->qh_dma = dma; | 80 | qh->qh_dma = dma; |
| 80 | // INIT_LIST_HEAD (&qh->qh_list); | 81 | // INIT_LIST_HEAD (&qh->qh_list); |
| 81 | INIT_LIST_HEAD (&qh->qtd_list); | 82 | INIT_LIST_HEAD (&qh->qtd_list); |
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 28e2a338b481..e56db44708bc 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
| @@ -1287,7 +1287,7 @@ itd_urb_transaction( | |||
| 1287 | } else { | 1287 | } else { |
| 1288 | alloc_itd: | 1288 | alloc_itd: |
| 1289 | spin_unlock_irqrestore(&ehci->lock, flags); | 1289 | spin_unlock_irqrestore(&ehci->lock, flags); |
| 1290 | itd = dma_pool_zalloc(ehci->itd_pool, mem_flags, | 1290 | itd = dma_pool_alloc(ehci->itd_pool, mem_flags, |
| 1291 | &itd_dma); | 1291 | &itd_dma); |
| 1292 | spin_lock_irqsave(&ehci->lock, flags); | 1292 | spin_lock_irqsave(&ehci->lock, flags); |
| 1293 | if (!itd) { | 1293 | if (!itd) { |
| @@ -1297,6 +1297,7 @@ itd_urb_transaction( | |||
| 1297 | } | 1297 | } |
| 1298 | } | 1298 | } |
| 1299 | 1299 | ||
| 1300 | memset(itd, 0, sizeof(*itd)); | ||
| 1300 | itd->itd_dma = itd_dma; | 1301 | itd->itd_dma = itd_dma; |
| 1301 | itd->frame = NO_FRAME; | 1302 | itd->frame = NO_FRAME; |
| 1302 | list_add(&itd->itd_list, &sched->td_list); | 1303 | list_add(&itd->itd_list, &sched->td_list); |
| @@ -2080,7 +2081,7 @@ sitd_urb_transaction( | |||
| 2080 | } else { | 2081 | } else { |
| 2081 | alloc_sitd: | 2082 | alloc_sitd: |
| 2082 | spin_unlock_irqrestore(&ehci->lock, flags); | 2083 | spin_unlock_irqrestore(&ehci->lock, flags); |
| 2083 | sitd = dma_pool_zalloc(ehci->sitd_pool, mem_flags, | 2084 | sitd = dma_pool_alloc(ehci->sitd_pool, mem_flags, |
| 2084 | &sitd_dma); | 2085 | &sitd_dma); |
| 2085 | spin_lock_irqsave(&ehci->lock, flags); | 2086 | spin_lock_irqsave(&ehci->lock, flags); |
| 2086 | if (!sitd) { | 2087 | if (!sitd) { |
| @@ -2090,6 +2091,7 @@ sitd_urb_transaction( | |||
| 2090 | } | 2091 | } |
| 2091 | } | 2092 | } |
| 2092 | 2093 | ||
| 2094 | memset(sitd, 0, sizeof(*sitd)); | ||
| 2093 | sitd->sitd_dma = sitd_dma; | 2095 | sitd->sitd_dma = sitd_dma; |
| 2094 | sitd->frame = NO_FRAME; | 2096 | sitd->frame = NO_FRAME; |
| 2095 | list_add(&sitd->sitd_list, &iso_sched->td_list); | 2097 | list_add(&sitd->sitd_list, &iso_sched->td_list); |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 9b27798ecce5..711da3306b14 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
| @@ -3621,6 +3621,7 @@ static void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev) | |||
| 3621 | del_timer_sync(&virt_dev->eps[i].stop_cmd_timer); | 3621 | del_timer_sync(&virt_dev->eps[i].stop_cmd_timer); |
| 3622 | } | 3622 | } |
| 3623 | xhci_debugfs_remove_slot(xhci, udev->slot_id); | 3623 | xhci_debugfs_remove_slot(xhci, udev->slot_id); |
| 3624 | virt_dev->udev = NULL; | ||
| 3624 | ret = xhci_disable_slot(xhci, udev->slot_id); | 3625 | ret = xhci_disable_slot(xhci, udev->slot_id); |
| 3625 | if (ret) | 3626 | if (ret) |
| 3626 | xhci_free_virt_device(xhci, udev->slot_id); | 3627 | xhci_free_virt_device(xhci, udev->slot_id); |
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index e564695c6c8d..71c5835ea9cd 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
| @@ -417,7 +417,6 @@ void musb_g_tx(struct musb *musb, u8 epnum) | |||
| 417 | req = next_request(musb_ep); | 417 | req = next_request(musb_ep); |
| 418 | request = &req->request; | 418 | request = &req->request; |
| 419 | 419 | ||
| 420 | trace_musb_req_tx(req); | ||
| 421 | csr = musb_readw(epio, MUSB_TXCSR); | 420 | csr = musb_readw(epio, MUSB_TXCSR); |
| 422 | musb_dbg(musb, "<== %s, txcsr %04x", musb_ep->end_point.name, csr); | 421 | musb_dbg(musb, "<== %s, txcsr %04x", musb_ep->end_point.name, csr); |
| 423 | 422 | ||
| @@ -456,6 +455,8 @@ void musb_g_tx(struct musb *musb, u8 epnum) | |||
| 456 | u8 is_dma = 0; | 455 | u8 is_dma = 0; |
| 457 | bool short_packet = false; | 456 | bool short_packet = false; |
| 458 | 457 | ||
| 458 | trace_musb_req_tx(req); | ||
| 459 | |||
| 459 | if (dma && (csr & MUSB_TXCSR_DMAENAB)) { | 460 | if (dma && (csr & MUSB_TXCSR_DMAENAB)) { |
| 460 | is_dma = 1; | 461 | is_dma = 1; |
| 461 | csr |= MUSB_TXCSR_P_WZC_BITS; | 462 | csr |= MUSB_TXCSR_P_WZC_BITS; |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 4fa372c845e1..e7f99d55922a 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
| @@ -990,7 +990,9 @@ static void musb_bulk_nak_timeout(struct musb *musb, struct musb_hw_ep *ep, | |||
| 990 | /* set tx_reinit and schedule the next qh */ | 990 | /* set tx_reinit and schedule the next qh */ |
| 991 | ep->tx_reinit = 1; | 991 | ep->tx_reinit = 1; |
| 992 | } | 992 | } |
| 993 | musb_start_urb(musb, is_in, next_qh); | 993 | |
| 994 | if (next_qh) | ||
| 995 | musb_start_urb(musb, is_in, next_qh); | ||
| 994 | } | 996 | } |
| 995 | } | 997 | } |
| 996 | 998 | ||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index c3f252283ab9..2058852a87fa 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -233,6 +233,8 @@ static void option_instat_callback(struct urb *urb); | |||
| 233 | /* These Quectel products use Qualcomm's vendor ID */ | 233 | /* These Quectel products use Qualcomm's vendor ID */ |
| 234 | #define QUECTEL_PRODUCT_UC20 0x9003 | 234 | #define QUECTEL_PRODUCT_UC20 0x9003 |
| 235 | #define QUECTEL_PRODUCT_UC15 0x9090 | 235 | #define QUECTEL_PRODUCT_UC15 0x9090 |
| 236 | /* These u-blox products use Qualcomm's vendor ID */ | ||
| 237 | #define UBLOX_PRODUCT_R410M 0x90b2 | ||
| 236 | /* These Yuga products use Qualcomm's vendor ID */ | 238 | /* These Yuga products use Qualcomm's vendor ID */ |
| 237 | #define YUGA_PRODUCT_CLM920_NC5 0x9625 | 239 | #define YUGA_PRODUCT_CLM920_NC5 0x9625 |
| 238 | 240 | ||
| @@ -1065,6 +1067,9 @@ static const struct usb_device_id option_ids[] = { | |||
| 1065 | /* Yuga products use Qualcomm vendor ID */ | 1067 | /* Yuga products use Qualcomm vendor ID */ |
| 1066 | { USB_DEVICE(QUALCOMM_VENDOR_ID, YUGA_PRODUCT_CLM920_NC5), | 1068 | { USB_DEVICE(QUALCOMM_VENDOR_ID, YUGA_PRODUCT_CLM920_NC5), |
| 1067 | .driver_info = RSVD(1) | RSVD(4) }, | 1069 | .driver_info = RSVD(1) | RSVD(4) }, |
| 1070 | /* u-blox products using Qualcomm vendor ID */ | ||
| 1071 | { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M), | ||
| 1072 | .driver_info = RSVD(1) | RSVD(3) }, | ||
| 1068 | /* Quectel products using Quectel vendor ID */ | 1073 | /* Quectel products using Quectel vendor ID */ |
| 1069 | { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21), | 1074 | { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21), |
| 1070 | .driver_info = RSVD(4) }, | 1075 | .driver_info = RSVD(4) }, |
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index f5373ed2cd45..8ddbecc25d89 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c | |||
| @@ -335,47 +335,48 @@ static int palm_os_3_probe(struct usb_serial *serial, | |||
| 335 | goto exit; | 335 | goto exit; |
| 336 | } | 336 | } |
| 337 | 337 | ||
| 338 | if (retval == sizeof(*connection_info)) { | 338 | if (retval != sizeof(*connection_info)) { |
| 339 | connection_info = (struct visor_connection_info *) | 339 | dev_err(dev, "Invalid connection information received from device\n"); |
| 340 | transfer_buffer; | 340 | retval = -ENODEV; |
| 341 | 341 | goto exit; | |
| 342 | num_ports = le16_to_cpu(connection_info->num_ports); | ||
| 343 | for (i = 0; i < num_ports; ++i) { | ||
| 344 | switch ( | ||
| 345 | connection_info->connections[i].port_function_id) { | ||
| 346 | case VISOR_FUNCTION_GENERIC: | ||
| 347 | string = "Generic"; | ||
| 348 | break; | ||
| 349 | case VISOR_FUNCTION_DEBUGGER: | ||
| 350 | string = "Debugger"; | ||
| 351 | break; | ||
| 352 | case VISOR_FUNCTION_HOTSYNC: | ||
| 353 | string = "HotSync"; | ||
| 354 | break; | ||
| 355 | case VISOR_FUNCTION_CONSOLE: | ||
| 356 | string = "Console"; | ||
| 357 | break; | ||
| 358 | case VISOR_FUNCTION_REMOTE_FILE_SYS: | ||
| 359 | string = "Remote File System"; | ||
| 360 | break; | ||
| 361 | default: | ||
| 362 | string = "unknown"; | ||
| 363 | break; | ||
| 364 | } | ||
| 365 | dev_info(dev, "%s: port %d, is for %s use\n", | ||
| 366 | serial->type->description, | ||
| 367 | connection_info->connections[i].port, string); | ||
| 368 | } | ||
| 369 | } | 342 | } |
| 370 | /* | 343 | |
| 371 | * Handle devices that report invalid stuff here. | 344 | connection_info = (struct visor_connection_info *)transfer_buffer; |
| 372 | */ | 345 | |
| 346 | num_ports = le16_to_cpu(connection_info->num_ports); | ||
| 347 | |||
| 348 | /* Handle devices that report invalid stuff here. */ | ||
| 373 | if (num_ports == 0 || num_ports > 2) { | 349 | if (num_ports == 0 || num_ports > 2) { |
| 374 | dev_warn(dev, "%s: No valid connect info available\n", | 350 | dev_warn(dev, "%s: No valid connect info available\n", |
| 375 | serial->type->description); | 351 | serial->type->description); |
| 376 | num_ports = 2; | 352 | num_ports = 2; |
| 377 | } | 353 | } |
| 378 | 354 | ||
| 355 | for (i = 0; i < num_ports; ++i) { | ||
| 356 | switch (connection_info->connections[i].port_function_id) { | ||
| 357 | case VISOR_FUNCTION_GENERIC: | ||
| 358 | string = "Generic"; | ||
| 359 | break; | ||
| 360 | case VISOR_FUNCTION_DEBUGGER: | ||
| 361 | string = "Debugger"; | ||
| 362 | break; | ||
| 363 | case VISOR_FUNCTION_HOTSYNC: | ||
| 364 | string = "HotSync"; | ||
| 365 | break; | ||
| 366 | case VISOR_FUNCTION_CONSOLE: | ||
| 367 | string = "Console"; | ||
| 368 | break; | ||
| 369 | case VISOR_FUNCTION_REMOTE_FILE_SYS: | ||
| 370 | string = "Remote File System"; | ||
| 371 | break; | ||
| 372 | default: | ||
| 373 | string = "unknown"; | ||
| 374 | break; | ||
| 375 | } | ||
| 376 | dev_info(dev, "%s: port %d, is for %s use\n", | ||
| 377 | serial->type->description, | ||
| 378 | connection_info->connections[i].port, string); | ||
| 379 | } | ||
| 379 | dev_info(dev, "%s: Number of ports: %d\n", serial->type->description, | 380 | dev_info(dev, "%s: Number of ports: %d\n", serial->type->description, |
| 380 | num_ports); | 381 | num_ports); |
| 381 | 382 | ||
diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c index 677d12138dbd..ded49e3bf2b0 100644 --- a/drivers/usb/typec/tcpm.c +++ b/drivers/usb/typec/tcpm.c | |||
| @@ -3725,6 +3725,7 @@ void tcpm_unregister_port(struct tcpm_port *port) | |||
| 3725 | for (i = 0; i < ARRAY_SIZE(port->port_altmode); i++) | 3725 | for (i = 0; i < ARRAY_SIZE(port->port_altmode); i++) |
| 3726 | typec_unregister_altmode(port->port_altmode[i]); | 3726 | typec_unregister_altmode(port->port_altmode[i]); |
| 3727 | typec_unregister_port(port->typec_port); | 3727 | typec_unregister_port(port->typec_port); |
| 3728 | usb_role_switch_put(port->role_sw); | ||
| 3728 | tcpm_debugfs_exit(port); | 3729 | tcpm_debugfs_exit(port); |
| 3729 | destroy_workqueue(port->wq); | 3730 | destroy_workqueue(port->wq); |
| 3730 | } | 3731 | } |
diff --git a/drivers/usb/typec/tps6598x.c b/drivers/usb/typec/tps6598x.c index 8b8406867c02..4b4c8d271b27 100644 --- a/drivers/usb/typec/tps6598x.c +++ b/drivers/usb/typec/tps6598x.c | |||
| @@ -73,6 +73,7 @@ struct tps6598x { | |||
| 73 | struct device *dev; | 73 | struct device *dev; |
| 74 | struct regmap *regmap; | 74 | struct regmap *regmap; |
| 75 | struct mutex lock; /* device lock */ | 75 | struct mutex lock; /* device lock */ |
| 76 | u8 i2c_protocol:1; | ||
| 76 | 77 | ||
| 77 | struct typec_port *port; | 78 | struct typec_port *port; |
| 78 | struct typec_partner *partner; | 79 | struct typec_partner *partner; |
| @@ -80,19 +81,39 @@ struct tps6598x { | |||
| 80 | struct typec_capability typec_cap; | 81 | struct typec_capability typec_cap; |
| 81 | }; | 82 | }; |
| 82 | 83 | ||
| 84 | static int | ||
| 85 | tps6598x_block_read(struct tps6598x *tps, u8 reg, void *val, size_t len) | ||
| 86 | { | ||
| 87 | u8 data[len + 1]; | ||
| 88 | int ret; | ||
| 89 | |||
| 90 | if (!tps->i2c_protocol) | ||
| 91 | return regmap_raw_read(tps->regmap, reg, val, len); | ||
| 92 | |||
| 93 | ret = regmap_raw_read(tps->regmap, reg, data, sizeof(data)); | ||
| 94 | if (ret) | ||
| 95 | return ret; | ||
| 96 | |||
| 97 | if (data[0] < len) | ||
| 98 | return -EIO; | ||
| 99 | |||
| 100 | memcpy(val, &data[1], len); | ||
| 101 | return 0; | ||
| 102 | } | ||
| 103 | |||
| 83 | static inline int tps6598x_read16(struct tps6598x *tps, u8 reg, u16 *val) | 104 | static inline int tps6598x_read16(struct tps6598x *tps, u8 reg, u16 *val) |
| 84 | { | 105 | { |
| 85 | return regmap_raw_read(tps->regmap, reg, val, sizeof(u16)); | 106 | return tps6598x_block_read(tps, reg, val, sizeof(u16)); |
| 86 | } | 107 | } |
| 87 | 108 | ||
| 88 | static inline int tps6598x_read32(struct tps6598x *tps, u8 reg, u32 *val) | 109 | static inline int tps6598x_read32(struct tps6598x *tps, u8 reg, u32 *val) |
| 89 | { | 110 | { |
| 90 | return regmap_raw_read(tps->regmap, reg, val, sizeof(u32)); | 111 | return tps6598x_block_read(tps, reg, val, sizeof(u32)); |
| 91 | } | 112 | } |
| 92 | 113 | ||
| 93 | static inline int tps6598x_read64(struct tps6598x *tps, u8 reg, u64 *val) | 114 | static inline int tps6598x_read64(struct tps6598x *tps, u8 reg, u64 *val) |
| 94 | { | 115 | { |
| 95 | return regmap_raw_read(tps->regmap, reg, val, sizeof(u64)); | 116 | return tps6598x_block_read(tps, reg, val, sizeof(u64)); |
| 96 | } | 117 | } |
| 97 | 118 | ||
| 98 | static inline int tps6598x_write16(struct tps6598x *tps, u8 reg, u16 val) | 119 | static inline int tps6598x_write16(struct tps6598x *tps, u8 reg, u16 val) |
| @@ -121,8 +142,8 @@ static int tps6598x_read_partner_identity(struct tps6598x *tps) | |||
| 121 | struct tps6598x_rx_identity_reg id; | 142 | struct tps6598x_rx_identity_reg id; |
| 122 | int ret; | 143 | int ret; |
| 123 | 144 | ||
| 124 | ret = regmap_raw_read(tps->regmap, TPS_REG_RX_IDENTITY_SOP, | 145 | ret = tps6598x_block_read(tps, TPS_REG_RX_IDENTITY_SOP, |
| 125 | &id, sizeof(id)); | 146 | &id, sizeof(id)); |
| 126 | if (ret) | 147 | if (ret) |
| 127 | return ret; | 148 | return ret; |
| 128 | 149 | ||
| @@ -224,13 +245,13 @@ static int tps6598x_exec_cmd(struct tps6598x *tps, const char *cmd, | |||
| 224 | } while (val); | 245 | } while (val); |
| 225 | 246 | ||
| 226 | if (out_len) { | 247 | if (out_len) { |
| 227 | ret = regmap_raw_read(tps->regmap, TPS_REG_DATA1, | 248 | ret = tps6598x_block_read(tps, TPS_REG_DATA1, |
| 228 | out_data, out_len); | 249 | out_data, out_len); |
| 229 | if (ret) | 250 | if (ret) |
| 230 | return ret; | 251 | return ret; |
| 231 | val = out_data[0]; | 252 | val = out_data[0]; |
| 232 | } else { | 253 | } else { |
| 233 | ret = regmap_read(tps->regmap, TPS_REG_DATA1, &val); | 254 | ret = tps6598x_block_read(tps, TPS_REG_DATA1, &val, sizeof(u8)); |
| 234 | if (ret) | 255 | if (ret) |
| 235 | return ret; | 256 | return ret; |
| 236 | } | 257 | } |
| @@ -385,6 +406,16 @@ static int tps6598x_probe(struct i2c_client *client) | |||
| 385 | if (!vid) | 406 | if (!vid) |
| 386 | return -ENODEV; | 407 | return -ENODEV; |
| 387 | 408 | ||
| 409 | /* | ||
| 410 | * Checking can the adapter handle SMBus protocol. If it can not, the | ||
| 411 | * driver needs to take care of block reads separately. | ||
| 412 | * | ||
| 413 | * FIXME: Testing with I2C_FUNC_I2C. regmap-i2c uses I2C protocol | ||
| 414 | * unconditionally if the adapter has I2C_FUNC_I2C set. | ||
| 415 | */ | ||
| 416 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) | ||
| 417 | tps->i2c_protocol = true; | ||
| 418 | |||
| 388 | ret = tps6598x_read32(tps, TPS_REG_STATUS, &status); | 419 | ret = tps6598x_read32(tps, TPS_REG_STATUS, &status); |
| 389 | if (ret < 0) | 420 | if (ret < 0) |
| 390 | return ret; | 421 | return ret; |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index e2f16b68fcbf..51b5e2da708c 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
| @@ -3142,7 +3142,11 @@ static noinline int check_delayed_ref(struct btrfs_root *root, | |||
| 3142 | struct rb_node *node; | 3142 | struct rb_node *node; |
| 3143 | int ret = 0; | 3143 | int ret = 0; |
| 3144 | 3144 | ||
| 3145 | spin_lock(&root->fs_info->trans_lock); | ||
| 3145 | cur_trans = root->fs_info->running_transaction; | 3146 | cur_trans = root->fs_info->running_transaction; |
| 3147 | if (cur_trans) | ||
| 3148 | refcount_inc(&cur_trans->use_count); | ||
| 3149 | spin_unlock(&root->fs_info->trans_lock); | ||
| 3146 | if (!cur_trans) | 3150 | if (!cur_trans) |
| 3147 | return 0; | 3151 | return 0; |
| 3148 | 3152 | ||
| @@ -3151,6 +3155,7 @@ static noinline int check_delayed_ref(struct btrfs_root *root, | |||
| 3151 | head = btrfs_find_delayed_ref_head(delayed_refs, bytenr); | 3155 | head = btrfs_find_delayed_ref_head(delayed_refs, bytenr); |
| 3152 | if (!head) { | 3156 | if (!head) { |
| 3153 | spin_unlock(&delayed_refs->lock); | 3157 | spin_unlock(&delayed_refs->lock); |
| 3158 | btrfs_put_transaction(cur_trans); | ||
| 3154 | return 0; | 3159 | return 0; |
| 3155 | } | 3160 | } |
| 3156 | 3161 | ||
| @@ -3167,6 +3172,7 @@ static noinline int check_delayed_ref(struct btrfs_root *root, | |||
| 3167 | mutex_lock(&head->mutex); | 3172 | mutex_lock(&head->mutex); |
| 3168 | mutex_unlock(&head->mutex); | 3173 | mutex_unlock(&head->mutex); |
| 3169 | btrfs_put_delayed_ref_head(head); | 3174 | btrfs_put_delayed_ref_head(head); |
| 3175 | btrfs_put_transaction(cur_trans); | ||
| 3170 | return -EAGAIN; | 3176 | return -EAGAIN; |
| 3171 | } | 3177 | } |
| 3172 | spin_unlock(&delayed_refs->lock); | 3178 | spin_unlock(&delayed_refs->lock); |
| @@ -3199,6 +3205,7 @@ static noinline int check_delayed_ref(struct btrfs_root *root, | |||
| 3199 | } | 3205 | } |
| 3200 | spin_unlock(&head->lock); | 3206 | spin_unlock(&head->lock); |
| 3201 | mutex_unlock(&head->mutex); | 3207 | mutex_unlock(&head->mutex); |
| 3208 | btrfs_put_transaction(cur_trans); | ||
| 3202 | return ret; | 3209 | return ret; |
| 3203 | } | 3210 | } |
| 3204 | 3211 | ||
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 00b7d3231821..b041b945a7ae 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
| @@ -1841,7 +1841,7 @@ again: | |||
| 1841 | old_bytenr = btrfs_node_blockptr(parent, slot); | 1841 | old_bytenr = btrfs_node_blockptr(parent, slot); |
| 1842 | blocksize = fs_info->nodesize; | 1842 | blocksize = fs_info->nodesize; |
| 1843 | old_ptr_gen = btrfs_node_ptr_generation(parent, slot); | 1843 | old_ptr_gen = btrfs_node_ptr_generation(parent, slot); |
| 1844 | btrfs_node_key_to_cpu(parent, &key, slot); | 1844 | btrfs_node_key_to_cpu(parent, &first_key, slot); |
| 1845 | 1845 | ||
| 1846 | if (level <= max_level) { | 1846 | if (level <= max_level) { |
| 1847 | eb = path->nodes[level]; | 1847 | eb = path->nodes[level]; |
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 221e5cdb060b..c0074d2d7d6d 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c | |||
| @@ -5236,6 +5236,10 @@ static int send_write_or_clone(struct send_ctx *sctx, | |||
| 5236 | len = btrfs_file_extent_num_bytes(path->nodes[0], ei); | 5236 | len = btrfs_file_extent_num_bytes(path->nodes[0], ei); |
| 5237 | } | 5237 | } |
| 5238 | 5238 | ||
| 5239 | if (offset >= sctx->cur_inode_size) { | ||
| 5240 | ret = 0; | ||
| 5241 | goto out; | ||
| 5242 | } | ||
| 5239 | if (offset + len > sctx->cur_inode_size) | 5243 | if (offset + len > sctx->cur_inode_size) |
| 5240 | len = sctx->cur_inode_size - offset; | 5244 | len = sctx->cur_inode_size - offset; |
| 5241 | if (len == 0) { | 5245 | if (len == 0) { |
diff --git a/fs/cifs/Kconfig b/fs/cifs/Kconfig index 741749a98614..5f132d59dfc2 100644 --- a/fs/cifs/Kconfig +++ b/fs/cifs/Kconfig | |||
| @@ -197,7 +197,7 @@ config CIFS_SMB311 | |||
| 197 | 197 | ||
| 198 | config CIFS_SMB_DIRECT | 198 | config CIFS_SMB_DIRECT |
| 199 | bool "SMB Direct support (Experimental)" | 199 | bool "SMB Direct support (Experimental)" |
| 200 | depends on CIFS=m && INFINIBAND || CIFS=y && INFINIBAND=y | 200 | depends on CIFS=m && INFINIBAND && INFINIBAND_ADDR_TRANS || CIFS=y && INFINIBAND=y && INFINIBAND_ADDR_TRANS=y |
| 201 | help | 201 | help |
| 202 | Enables SMB Direct experimental support for SMB 3.0, 3.02 and 3.1.1. | 202 | Enables SMB Direct experimental support for SMB 3.0, 3.02 and 3.1.1. |
| 203 | SMB Direct allows transferring SMB packets over RDMA. If unsure, | 203 | SMB Direct allows transferring SMB packets over RDMA. If unsure, |
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 47d7c151fcba..471d863958bc 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
| @@ -1961,7 +1961,7 @@ void wb_workfn(struct work_struct *work) | |||
| 1961 | } | 1961 | } |
| 1962 | 1962 | ||
| 1963 | if (!list_empty(&wb->work_list)) | 1963 | if (!list_empty(&wb->work_list)) |
| 1964 | mod_delayed_work(bdi_wq, &wb->dwork, 0); | 1964 | wb_wakeup(wb); |
| 1965 | else if (wb_has_dirty_io(wb) && dirty_writeback_interval) | 1965 | else if (wb_has_dirty_io(wb) && dirty_writeback_interval) |
| 1966 | wb_wakeup_delayed(wb); | 1966 | wb_wakeup_delayed(wb); |
| 1967 | 1967 | ||
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index eed073cc4778..e70fb8ccecea 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c | |||
| @@ -880,8 +880,18 @@ xfs_file_dedupe_range( | |||
| 880 | struct file *dst_file, | 880 | struct file *dst_file, |
| 881 | u64 dst_loff) | 881 | u64 dst_loff) |
| 882 | { | 882 | { |
| 883 | struct inode *srci = file_inode(src_file); | ||
| 884 | u64 max_dedupe; | ||
| 883 | int error; | 885 | int error; |
| 884 | 886 | ||
| 887 | /* | ||
| 888 | * Since we have to read all these pages in to compare them, cut | ||
| 889 | * it off at MAX_RW_COUNT/2 rounded down to the nearest block. | ||
| 890 | * That means we won't do more than MAX_RW_COUNT IO per request. | ||
| 891 | */ | ||
| 892 | max_dedupe = (MAX_RW_COUNT >> 1) & ~(i_blocksize(srci) - 1); | ||
| 893 | if (len > max_dedupe) | ||
| 894 | len = max_dedupe; | ||
| 885 | error = xfs_reflink_remap_range(src_file, loff, dst_file, dst_loff, | 895 | error = xfs_reflink_remap_range(src_file, loff, dst_file, dst_loff, |
| 886 | len, true); | 896 | len, true); |
| 887 | if (error) | 897 | if (error) |
diff --git a/include/dt-bindings/clock/stm32mp1-clks.h b/include/dt-bindings/clock/stm32mp1-clks.h index 86e3ec662ef4..90ec780bfc68 100644 --- a/include/dt-bindings/clock/stm32mp1-clks.h +++ b/include/dt-bindings/clock/stm32mp1-clks.h | |||
| @@ -76,7 +76,7 @@ | |||
| 76 | #define I2C6 63 | 76 | #define I2C6 63 |
| 77 | #define USART1 64 | 77 | #define USART1 64 |
| 78 | #define RTCAPB 65 | 78 | #define RTCAPB 65 |
| 79 | #define TZC 66 | 79 | #define TZC1 66 |
| 80 | #define TZPC 67 | 80 | #define TZPC 67 |
| 81 | #define IWDG1 68 | 81 | #define IWDG1 68 |
| 82 | #define BSEC 69 | 82 | #define BSEC 69 |
| @@ -123,6 +123,7 @@ | |||
| 123 | #define CRC1 110 | 123 | #define CRC1 110 |
| 124 | #define USBH 111 | 124 | #define USBH 111 |
| 125 | #define ETHSTP 112 | 125 | #define ETHSTP 112 |
| 126 | #define TZC2 113 | ||
| 126 | 127 | ||
| 127 | /* Kernel clocks */ | 128 | /* Kernel clocks */ |
| 128 | #define SDMMC1_K 118 | 129 | #define SDMMC1_K 118 |
| @@ -228,7 +229,6 @@ | |||
| 228 | #define CK_MCO2 212 | 229 | #define CK_MCO2 212 |
| 229 | 230 | ||
| 230 | /* TRACE & DEBUG clocks */ | 231 | /* TRACE & DEBUG clocks */ |
| 231 | #define DBG 213 | ||
| 232 | #define CK_DBG 214 | 232 | #define CK_DBG 214 |
| 233 | #define CK_TRACE 215 | 233 | #define CK_TRACE 215 |
| 234 | 234 | ||
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index 24f03941ada8..e7efe12a81bd 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h | |||
| @@ -131,6 +131,7 @@ struct vgic_irq { | |||
| 131 | u32 mpidr; /* GICv3 target VCPU */ | 131 | u32 mpidr; /* GICv3 target VCPU */ |
| 132 | }; | 132 | }; |
| 133 | u8 source; /* GICv2 SGIs only */ | 133 | u8 source; /* GICv2 SGIs only */ |
| 134 | u8 active_source; /* GICv2 SGIs only */ | ||
| 134 | u8 priority; | 135 | u8 priority; |
| 135 | enum vgic_irq_config config; /* Level or edge */ | 136 | enum vgic_irq_config config; /* Level or edge */ |
| 136 | 137 | ||
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 210a890008f9..1d25e149c1c5 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
| @@ -765,6 +765,9 @@ int __clk_mux_determine_rate(struct clk_hw *hw, | |||
| 765 | int __clk_determine_rate(struct clk_hw *core, struct clk_rate_request *req); | 765 | int __clk_determine_rate(struct clk_hw *core, struct clk_rate_request *req); |
| 766 | int __clk_mux_determine_rate_closest(struct clk_hw *hw, | 766 | int __clk_mux_determine_rate_closest(struct clk_hw *hw, |
| 767 | struct clk_rate_request *req); | 767 | struct clk_rate_request *req); |
| 768 | int clk_mux_determine_rate_flags(struct clk_hw *hw, | ||
| 769 | struct clk_rate_request *req, | ||
| 770 | unsigned long flags); | ||
| 768 | void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent); | 771 | void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent); |
| 769 | void clk_hw_set_rate_range(struct clk_hw *hw, unsigned long min_rate, | 772 | void clk_hw_set_rate_range(struct clk_hw *hw, unsigned long min_rate, |
| 770 | unsigned long max_rate); | 773 | unsigned long max_rate); |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index c826b0b5232a..6cb8a5789668 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
| @@ -368,7 +368,9 @@ static inline void free_part_stats(struct hd_struct *part) | |||
| 368 | part_stat_add(cpu, gendiskp, field, -subnd) | 368 | part_stat_add(cpu, gendiskp, field, -subnd) |
| 369 | 369 | ||
| 370 | void part_in_flight(struct request_queue *q, struct hd_struct *part, | 370 | void part_in_flight(struct request_queue *q, struct hd_struct *part, |
| 371 | unsigned int inflight[2]); | 371 | unsigned int inflight[2]); |
| 372 | void part_in_flight_rw(struct request_queue *q, struct hd_struct *part, | ||
| 373 | unsigned int inflight[2]); | ||
| 372 | void part_dec_in_flight(struct request_queue *q, struct hd_struct *part, | 374 | void part_dec_in_flight(struct request_queue *q, struct hd_struct *part, |
| 373 | int rw); | 375 | int rw); |
| 374 | void part_inc_in_flight(struct request_queue *q, struct hd_struct *part, | 376 | void part_inc_in_flight(struct request_queue *q, struct hd_struct *part, |
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index d09a9c7af109..dfdaede9139e 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h | |||
| @@ -569,7 +569,7 @@ static inline struct rproc *vdev_to_rproc(struct virtio_device *vdev) | |||
| 569 | void rproc_add_subdev(struct rproc *rproc, | 569 | void rproc_add_subdev(struct rproc *rproc, |
| 570 | struct rproc_subdev *subdev, | 570 | struct rproc_subdev *subdev, |
| 571 | int (*probe)(struct rproc_subdev *subdev), | 571 | int (*probe)(struct rproc_subdev *subdev), |
| 572 | void (*remove)(struct rproc_subdev *subdev, bool graceful)); | 572 | void (*remove)(struct rproc_subdev *subdev, bool crashed)); |
| 573 | 573 | ||
| 574 | void rproc_remove_subdev(struct rproc *rproc, struct rproc_subdev *subdev); | 574 | void rproc_remove_subdev(struct rproc *rproc, struct rproc_subdev *subdev); |
| 575 | 575 | ||
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 4b6b9283fa7b..8675e145ea8b 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
| @@ -52,7 +52,7 @@ | |||
| 52 | #define USB_GADGET_DELAYED_STATUS 0x7fff /* Impossibly large value */ | 52 | #define USB_GADGET_DELAYED_STATUS 0x7fff /* Impossibly large value */ |
| 53 | 53 | ||
| 54 | /* big enough to hold our biggest descriptor */ | 54 | /* big enough to hold our biggest descriptor */ |
| 55 | #define USB_COMP_EP0_BUFSIZ 1024 | 55 | #define USB_COMP_EP0_BUFSIZ 4096 |
| 56 | 56 | ||
| 57 | /* OS feature descriptor length <= 4kB */ | 57 | /* OS feature descriptor length <= 4kB */ |
| 58 | #define USB_COMP_EP0_OS_DESC_BUFSIZ 4096 | 58 | #define USB_COMP_EP0_OS_DESC_BUFSIZ 4096 |
diff --git a/include/linux/wait_bit.h b/include/linux/wait_bit.h index 9318b2166439..2b0072fa5e92 100644 --- a/include/linux/wait_bit.h +++ b/include/linux/wait_bit.h | |||
| @@ -305,4 +305,21 @@ do { \ | |||
| 305 | __ret; \ | 305 | __ret; \ |
| 306 | }) | 306 | }) |
| 307 | 307 | ||
| 308 | /** | ||
| 309 | * clear_and_wake_up_bit - clear a bit and wake up anyone waiting on that bit | ||
| 310 | * | ||
| 311 | * @bit: the bit of the word being waited on | ||
| 312 | * @word: the word being waited on, a kernel virtual address | ||
| 313 | * | ||
| 314 | * You can use this helper if bitflags are manipulated atomically rather than | ||
| 315 | * non-atomically under a lock. | ||
| 316 | */ | ||
| 317 | static inline void clear_and_wake_up_bit(int bit, void *word) | ||
| 318 | { | ||
| 319 | clear_bit_unlock(bit, word); | ||
| 320 | /* See wake_up_bit() for which memory barrier you need to use. */ | ||
| 321 | smp_mb__after_atomic(); | ||
| 322 | wake_up_bit(word, bit); | ||
| 323 | } | ||
| 324 | |||
| 308 | #endif /* _LINUX_WAIT_BIT_H */ | 325 | #endif /* _LINUX_WAIT_BIT_H */ |
diff --git a/include/media/i2c/tvp7002.h b/include/media/i2c/tvp7002.h index 5ee007c1cead..cb213c136089 100644 --- a/include/media/i2c/tvp7002.h +++ b/include/media/i2c/tvp7002.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * Author: Santiago Nunez-Corrales <santiago.nunez@ridgerun.com> | 5 | * Author: Santiago Nunez-Corrales <santiago.nunez@ridgerun.com> |
| 6 | * | 6 | * |
| 7 | * This code is partially based upon the TVP5150 driver | 7 | * This code is partially based upon the TVP5150 driver |
| 8 | * written by Mauro Carvalho Chehab (mchehab@infradead.org), | 8 | * written by Mauro Carvalho Chehab <mchehab@kernel.org>, |
| 9 | * the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com> | 9 | * the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com> |
| 10 | * and the TVP7002 driver in the TI LSP 2.10.00.14 | 10 | * and the TVP7002 driver in the TI LSP 2.10.00.14 |
| 11 | * | 11 | * |
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h index 0bda0adc744f..60a664febba0 100644 --- a/include/media/videobuf-core.h +++ b/include/media/videobuf-core.h | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * generic helper functions for handling video4linux capture buffers | 2 | * generic helper functions for handling video4linux capture buffers |
| 3 | * | 3 | * |
| 4 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@infradead.org> | 4 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 5 | * | 5 | * |
| 6 | * Highly based on video-buf written originally by: | 6 | * Highly based on video-buf written originally by: |
| 7 | * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> | 7 | * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> |
| 8 | * (c) 2006 Mauro Carvalho Chehab, <mchehab@infradead.org> | 8 | * (c) 2006 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 9 | * (c) 2006 Ted Walther and John Sokol | 9 | * (c) 2006 Ted Walther and John Sokol |
| 10 | * | 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h index d8b27854e3bf..01bd142b979d 100644 --- a/include/media/videobuf-dma-sg.h +++ b/include/media/videobuf-dma-sg.h | |||
| @@ -6,11 +6,11 @@ | |||
| 6 | * into PAGE_SIZE chunks). They also assume the driver does not need | 6 | * into PAGE_SIZE chunks). They also assume the driver does not need |
| 7 | * to touch the video data. | 7 | * to touch the video data. |
| 8 | * | 8 | * |
| 9 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@infradead.org> | 9 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 10 | * | 10 | * |
| 11 | * Highly based on video-buf written originally by: | 11 | * Highly based on video-buf written originally by: |
| 12 | * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> | 12 | * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> |
| 13 | * (c) 2006 Mauro Carvalho Chehab, <mchehab@infradead.org> | 13 | * (c) 2006 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 14 | * (c) 2006 Ted Walther and John Sokol | 14 | * (c) 2006 Ted Walther and John Sokol |
| 15 | * | 15 | * |
| 16 | * This program is free software; you can redistribute it and/or modify | 16 | * This program is free software; you can redistribute it and/or modify |
diff --git a/include/media/videobuf-vmalloc.h b/include/media/videobuf-vmalloc.h index 486a97efdb56..36c6a4ad3504 100644 --- a/include/media/videobuf-vmalloc.h +++ b/include/media/videobuf-vmalloc.h | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | * into PAGE_SIZE chunks). They also assume the driver does not need | 6 | * into PAGE_SIZE chunks). They also assume the driver does not need |
| 7 | * to touch the video data. | 7 | * to touch the video data. |
| 8 | * | 8 | * |
| 9 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@infradead.org> | 9 | * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org> |
| 10 | * | 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify | 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by | 12 | * it under the terms of the GNU General Public License as published by |
diff --git a/include/uapi/linux/if_infiniband.h b/include/uapi/linux/if_infiniband.h index 050b92dcf8cf..0fc33bf30e45 100644 --- a/include/uapi/linux/if_infiniband.h +++ b/include/uapi/linux/if_infiniband.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ |
| 2 | /* | 2 | /* |
| 3 | * This software is available to you under a choice of one of two | 3 | * This software is available to you under a choice of one of two |
| 4 | * licenses. You may choose to be licensed under the terms of the GNU | 4 | * licenses. You may choose to be licensed under the terms of the GNU |
diff --git a/include/uapi/linux/rds.h b/include/uapi/linux/rds.h index a66b213de3d7..20c6bd0b0007 100644 --- a/include/uapi/linux/rds.h +++ b/include/uapi/linux/rds.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2008 Oracle. All rights reserved. | 3 | * Copyright (c) 2008 Oracle. All rights reserved. |
| 4 | * | 4 | * |
diff --git a/include/uapi/linux/tls.h b/include/uapi/linux/tls.h index c6633e97eca4..ff02287495ac 100644 --- a/include/uapi/linux/tls.h +++ b/include/uapi/linux/tls.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2016-2017, Mellanox Technologies. All rights reserved. | 3 | * Copyright (c) 2016-2017, Mellanox Technologies. All rights reserved. |
| 4 | * | 4 | * |
diff --git a/include/uapi/rdma/cxgb3-abi.h b/include/uapi/rdma/cxgb3-abi.h index 9acb4b7a6246..85aed672f43e 100644 --- a/include/uapi/rdma/cxgb3-abi.h +++ b/include/uapi/rdma/cxgb3-abi.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2006 Chelsio, Inc. All rights reserved. | 3 | * Copyright (c) 2006 Chelsio, Inc. All rights reserved. |
| 4 | * | 4 | * |
diff --git a/include/uapi/rdma/cxgb4-abi.h b/include/uapi/rdma/cxgb4-abi.h index 1fefd0140c26..a159ba8dcf8f 100644 --- a/include/uapi/rdma/cxgb4-abi.h +++ b/include/uapi/rdma/cxgb4-abi.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2009-2010 Chelsio, Inc. All rights reserved. | 3 | * Copyright (c) 2009-2010 Chelsio, Inc. All rights reserved. |
| 4 | * | 4 | * |
diff --git a/include/uapi/rdma/hns-abi.h b/include/uapi/rdma/hns-abi.h index 7092c8de4bd8..78613b609fa8 100644 --- a/include/uapi/rdma/hns-abi.h +++ b/include/uapi/rdma/hns-abi.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2016 Hisilicon Limited. | 3 | * Copyright (c) 2016 Hisilicon Limited. |
| 4 | * | 4 | * |
diff --git a/include/uapi/rdma/ib_user_cm.h b/include/uapi/rdma/ib_user_cm.h index 4a8f9562f7cd..e2709bb8cb18 100644 --- a/include/uapi/rdma/ib_user_cm.h +++ b/include/uapi/rdma/ib_user_cm.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2005 Topspin Communications. All rights reserved. | 3 | * Copyright (c) 2005 Topspin Communications. All rights reserved. |
| 4 | * Copyright (c) 2005 Intel Corporation. All rights reserved. | 4 | * Copyright (c) 2005 Intel Corporation. All rights reserved. |
diff --git a/include/uapi/rdma/ib_user_ioctl_verbs.h b/include/uapi/rdma/ib_user_ioctl_verbs.h index 04e46ea517d3..625545d862d7 100644 --- a/include/uapi/rdma/ib_user_ioctl_verbs.h +++ b/include/uapi/rdma/ib_user_ioctl_verbs.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2017-2018, Mellanox Technologies inc. All rights reserved. | 3 | * Copyright (c) 2017-2018, Mellanox Technologies inc. All rights reserved. |
| 4 | * | 4 | * |
diff --git a/include/uapi/rdma/ib_user_mad.h b/include/uapi/rdma/ib_user_mad.h index ef92118dad97..90c0cf228020 100644 --- a/include/uapi/rdma/ib_user_mad.h +++ b/include/uapi/rdma/ib_user_mad.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2004 Topspin Communications. All rights reserved. | 3 | * Copyright (c) 2004 Topspin Communications. All rights reserved. |
| 4 | * Copyright (c) 2005 Voltaire, Inc. All rights reserved. | 4 | * Copyright (c) 2005 Voltaire, Inc. All rights reserved. |
diff --git a/include/uapi/rdma/ib_user_sa.h b/include/uapi/rdma/ib_user_sa.h index 0d2607f0cd20..435155d6e1c6 100644 --- a/include/uapi/rdma/ib_user_sa.h +++ b/include/uapi/rdma/ib_user_sa.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2005 Intel Corporation. All rights reserved. | 3 | * Copyright (c) 2005 Intel Corporation. All rights reserved. |
| 4 | * | 4 | * |
diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h index 9be07394fdbe..6aeb03315b0b 100644 --- a/include/uapi/rdma/ib_user_verbs.h +++ b/include/uapi/rdma/ib_user_verbs.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2005 Topspin Communications. All rights reserved. | 3 | * Copyright (c) 2005 Topspin Communications. All rights reserved. |
| 4 | * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. | 4 | * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. |
diff --git a/include/uapi/rdma/mlx4-abi.h b/include/uapi/rdma/mlx4-abi.h index 04f64bc4045f..f74557528175 100644 --- a/include/uapi/rdma/mlx4-abi.h +++ b/include/uapi/rdma/mlx4-abi.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. | 3 | * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. |
| 4 | * Copyright (c) 2007, 2008 Mellanox Technologies. All rights reserved. | 4 | * Copyright (c) 2007, 2008 Mellanox Technologies. All rights reserved. |
diff --git a/include/uapi/rdma/mlx5-abi.h b/include/uapi/rdma/mlx5-abi.h index cb4a02c4a1ce..fdaf00e20649 100644 --- a/include/uapi/rdma/mlx5-abi.h +++ b/include/uapi/rdma/mlx5-abi.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved. | 3 | * Copyright (c) 2013-2015, Mellanox Technologies. All rights reserved. |
| 4 | * | 4 | * |
diff --git a/include/uapi/rdma/mthca-abi.h b/include/uapi/rdma/mthca-abi.h index ac756cd9e807..91b12e1a6f43 100644 --- a/include/uapi/rdma/mthca-abi.h +++ b/include/uapi/rdma/mthca-abi.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2005 Topspin Communications. All rights reserved. | 3 | * Copyright (c) 2005 Topspin Communications. All rights reserved. |
| 4 | * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. | 4 | * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. |
diff --git a/include/uapi/rdma/nes-abi.h b/include/uapi/rdma/nes-abi.h index 35bfd4015d07..f80495baa969 100644 --- a/include/uapi/rdma/nes-abi.h +++ b/include/uapi/rdma/nes-abi.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved. | 3 | * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved. |
| 4 | * Copyright (c) 2005 Topspin Communications. All rights reserved. | 4 | * Copyright (c) 2005 Topspin Communications. All rights reserved. |
diff --git a/include/uapi/rdma/qedr-abi.h b/include/uapi/rdma/qedr-abi.h index 8ba098900e9a..24c658b3c790 100644 --- a/include/uapi/rdma/qedr-abi.h +++ b/include/uapi/rdma/qedr-abi.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* QLogic qedr NIC Driver | 2 | /* QLogic qedr NIC Driver |
| 3 | * Copyright (c) 2015-2016 QLogic Corporation | 3 | * Copyright (c) 2015-2016 QLogic Corporation |
| 4 | * | 4 | * |
diff --git a/include/uapi/rdma/rdma_user_cm.h b/include/uapi/rdma/rdma_user_cm.h index e1269024af47..0d1e78ebad05 100644 --- a/include/uapi/rdma/rdma_user_cm.h +++ b/include/uapi/rdma/rdma_user_cm.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2005-2006 Intel Corporation. All rights reserved. | 3 | * Copyright (c) 2005-2006 Intel Corporation. All rights reserved. |
| 4 | * | 4 | * |
diff --git a/include/uapi/rdma/rdma_user_ioctl.h b/include/uapi/rdma/rdma_user_ioctl.h index d223f4164a0f..d92d2721b28c 100644 --- a/include/uapi/rdma/rdma_user_ioctl.h +++ b/include/uapi/rdma/rdma_user_ioctl.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2016 Mellanox Technologies, LTD. All rights reserved. | 3 | * Copyright (c) 2016 Mellanox Technologies, LTD. All rights reserved. |
| 4 | * | 4 | * |
diff --git a/include/uapi/rdma/rdma_user_rxe.h b/include/uapi/rdma/rdma_user_rxe.h index 1f8a9e7daea4..44ef6a3b7afc 100644 --- a/include/uapi/rdma/rdma_user_rxe.h +++ b/include/uapi/rdma/rdma_user_rxe.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ | 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved. | 3 | * Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved. |
| 4 | * | 4 | * |
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 0e974cface0b..84f37420fcf5 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c | |||
| @@ -119,6 +119,16 @@ static DEFINE_SPINLOCK(watchdog_lock); | |||
| 119 | static int watchdog_running; | 119 | static int watchdog_running; |
| 120 | static atomic_t watchdog_reset_pending; | 120 | static atomic_t watchdog_reset_pending; |
| 121 | 121 | ||
| 122 | static void inline clocksource_watchdog_lock(unsigned long *flags) | ||
| 123 | { | ||
| 124 | spin_lock_irqsave(&watchdog_lock, *flags); | ||
| 125 | } | ||
| 126 | |||
| 127 | static void inline clocksource_watchdog_unlock(unsigned long *flags) | ||
| 128 | { | ||
| 129 | spin_unlock_irqrestore(&watchdog_lock, *flags); | ||
| 130 | } | ||
| 131 | |||
| 122 | static int clocksource_watchdog_kthread(void *data); | 132 | static int clocksource_watchdog_kthread(void *data); |
| 123 | static void __clocksource_change_rating(struct clocksource *cs, int rating); | 133 | static void __clocksource_change_rating(struct clocksource *cs, int rating); |
| 124 | 134 | ||
| @@ -142,9 +152,19 @@ static void __clocksource_unstable(struct clocksource *cs) | |||
| 142 | cs->flags &= ~(CLOCK_SOURCE_VALID_FOR_HRES | CLOCK_SOURCE_WATCHDOG); | 152 | cs->flags &= ~(CLOCK_SOURCE_VALID_FOR_HRES | CLOCK_SOURCE_WATCHDOG); |
| 143 | cs->flags |= CLOCK_SOURCE_UNSTABLE; | 153 | cs->flags |= CLOCK_SOURCE_UNSTABLE; |
| 144 | 154 | ||
| 155 | /* | ||
| 156 | * If the clocksource is registered clocksource_watchdog_kthread() will | ||
| 157 | * re-rate and re-select. | ||
| 158 | */ | ||
| 159 | if (list_empty(&cs->list)) { | ||
| 160 | cs->rating = 0; | ||
| 161 | return; | ||
| 162 | } | ||
| 163 | |||
| 145 | if (cs->mark_unstable) | 164 | if (cs->mark_unstable) |
| 146 | cs->mark_unstable(cs); | 165 | cs->mark_unstable(cs); |
| 147 | 166 | ||
| 167 | /* kick clocksource_watchdog_kthread() */ | ||
| 148 | if (finished_booting) | 168 | if (finished_booting) |
| 149 | schedule_work(&watchdog_work); | 169 | schedule_work(&watchdog_work); |
| 150 | } | 170 | } |
| @@ -153,10 +173,8 @@ static void __clocksource_unstable(struct clocksource *cs) | |||
| 153 | * clocksource_mark_unstable - mark clocksource unstable via watchdog | 173 | * clocksource_mark_unstable - mark clocksource unstable via watchdog |
| 154 | * @cs: clocksource to be marked unstable | 174 | * @cs: clocksource to be marked unstable |
| 155 | * | 175 | * |
| 156 | * This function is called instead of clocksource_change_rating from | 176 | * This function is called by the x86 TSC code to mark clocksources as unstable; |
| 157 | * cpu hotplug code to avoid a deadlock between the clocksource mutex | 177 | * it defers demotion and re-selection to a kthread. |
| 158 | * and the cpu hotplug mutex. It defers the update of the clocksource | ||
| 159 | * to the watchdog thread. | ||
| 160 | */ | 178 | */ |
| 161 | void clocksource_mark_unstable(struct clocksource *cs) | 179 | void clocksource_mark_unstable(struct clocksource *cs) |
| 162 | { | 180 | { |
| @@ -164,7 +182,7 @@ void clocksource_mark_unstable(struct clocksource *cs) | |||
| 164 | 182 | ||
| 165 | spin_lock_irqsave(&watchdog_lock, flags); | 183 | spin_lock_irqsave(&watchdog_lock, flags); |
| 166 | if (!(cs->flags & CLOCK_SOURCE_UNSTABLE)) { | 184 | if (!(cs->flags & CLOCK_SOURCE_UNSTABLE)) { |
| 167 | if (list_empty(&cs->wd_list)) | 185 | if (!list_empty(&cs->list) && list_empty(&cs->wd_list)) |
| 168 | list_add(&cs->wd_list, &watchdog_list); | 186 | list_add(&cs->wd_list, &watchdog_list); |
| 169 | __clocksource_unstable(cs); | 187 | __clocksource_unstable(cs); |
| 170 | } | 188 | } |
| @@ -319,9 +337,8 @@ static void clocksource_resume_watchdog(void) | |||
| 319 | 337 | ||
| 320 | static void clocksource_enqueue_watchdog(struct clocksource *cs) | 338 | static void clocksource_enqueue_watchdog(struct clocksource *cs) |
| 321 | { | 339 | { |
| 322 | unsigned long flags; | 340 | INIT_LIST_HEAD(&cs->wd_list); |
| 323 | 341 | ||
| 324 | spin_lock_irqsave(&watchdog_lock, flags); | ||
| 325 | if (cs->flags & CLOCK_SOURCE_MUST_VERIFY) { | 342 | if (cs->flags & CLOCK_SOURCE_MUST_VERIFY) { |
| 326 | /* cs is a clocksource to be watched. */ | 343 | /* cs is a clocksource to be watched. */ |
| 327 | list_add(&cs->wd_list, &watchdog_list); | 344 | list_add(&cs->wd_list, &watchdog_list); |
| @@ -331,7 +348,6 @@ static void clocksource_enqueue_watchdog(struct clocksource *cs) | |||
| 331 | if (cs->flags & CLOCK_SOURCE_IS_CONTINUOUS) | 348 | if (cs->flags & CLOCK_SOURCE_IS_CONTINUOUS) |
| 332 | cs->flags |= CLOCK_SOURCE_VALID_FOR_HRES; | 349 | cs->flags |= CLOCK_SOURCE_VALID_FOR_HRES; |
| 333 | } | 350 | } |
| 334 | spin_unlock_irqrestore(&watchdog_lock, flags); | ||
| 335 | } | 351 | } |
| 336 | 352 | ||
| 337 | static void clocksource_select_watchdog(bool fallback) | 353 | static void clocksource_select_watchdog(bool fallback) |
| @@ -373,9 +389,6 @@ static void clocksource_select_watchdog(bool fallback) | |||
| 373 | 389 | ||
| 374 | static void clocksource_dequeue_watchdog(struct clocksource *cs) | 390 | static void clocksource_dequeue_watchdog(struct clocksource *cs) |
| 375 | { | 391 | { |
| 376 | unsigned long flags; | ||
| 377 | |||
| 378 | spin_lock_irqsave(&watchdog_lock, flags); | ||
| 379 | if (cs != watchdog) { | 392 | if (cs != watchdog) { |
| 380 | if (cs->flags & CLOCK_SOURCE_MUST_VERIFY) { | 393 | if (cs->flags & CLOCK_SOURCE_MUST_VERIFY) { |
| 381 | /* cs is a watched clocksource. */ | 394 | /* cs is a watched clocksource. */ |
| @@ -384,21 +397,19 @@ static void clocksource_dequeue_watchdog(struct clocksource *cs) | |||
| 384 | clocksource_stop_watchdog(); | 397 | clocksource_stop_watchdog(); |
| 385 | } | 398 | } |
| 386 | } | 399 | } |
| 387 | spin_unlock_irqrestore(&watchdog_lock, flags); | ||
| 388 | } | 400 | } |
| 389 | 401 | ||
| 390 | static int __clocksource_watchdog_kthread(void) | 402 | static int __clocksource_watchdog_kthread(void) |
| 391 | { | 403 | { |
| 392 | struct clocksource *cs, *tmp; | 404 | struct clocksource *cs, *tmp; |
| 393 | unsigned long flags; | 405 | unsigned long flags; |
| 394 | LIST_HEAD(unstable); | ||
| 395 | int select = 0; | 406 | int select = 0; |
| 396 | 407 | ||
| 397 | spin_lock_irqsave(&watchdog_lock, flags); | 408 | spin_lock_irqsave(&watchdog_lock, flags); |
| 398 | list_for_each_entry_safe(cs, tmp, &watchdog_list, wd_list) { | 409 | list_for_each_entry_safe(cs, tmp, &watchdog_list, wd_list) { |
| 399 | if (cs->flags & CLOCK_SOURCE_UNSTABLE) { | 410 | if (cs->flags & CLOCK_SOURCE_UNSTABLE) { |
| 400 | list_del_init(&cs->wd_list); | 411 | list_del_init(&cs->wd_list); |
| 401 | list_add(&cs->wd_list, &unstable); | 412 | __clocksource_change_rating(cs, 0); |
| 402 | select = 1; | 413 | select = 1; |
| 403 | } | 414 | } |
| 404 | if (cs->flags & CLOCK_SOURCE_RESELECT) { | 415 | if (cs->flags & CLOCK_SOURCE_RESELECT) { |
| @@ -410,11 +421,6 @@ static int __clocksource_watchdog_kthread(void) | |||
| 410 | clocksource_stop_watchdog(); | 421 | clocksource_stop_watchdog(); |
| 411 | spin_unlock_irqrestore(&watchdog_lock, flags); | 422 | spin_unlock_irqrestore(&watchdog_lock, flags); |
| 412 | 423 | ||
| 413 | /* Needs to be done outside of watchdog lock */ | ||
| 414 | list_for_each_entry_safe(cs, tmp, &unstable, wd_list) { | ||
| 415 | list_del_init(&cs->wd_list); | ||
| 416 | __clocksource_change_rating(cs, 0); | ||
| 417 | } | ||
| 418 | return select; | 424 | return select; |
| 419 | } | 425 | } |
| 420 | 426 | ||
| @@ -447,6 +453,9 @@ static inline int __clocksource_watchdog_kthread(void) { return 0; } | |||
| 447 | static bool clocksource_is_watchdog(struct clocksource *cs) { return false; } | 453 | static bool clocksource_is_watchdog(struct clocksource *cs) { return false; } |
| 448 | void clocksource_mark_unstable(struct clocksource *cs) { } | 454 | void clocksource_mark_unstable(struct clocksource *cs) { } |
| 449 | 455 | ||
| 456 | static void inline clocksource_watchdog_lock(unsigned long *flags) { } | ||
| 457 | static void inline clocksource_watchdog_unlock(unsigned long *flags) { } | ||
| 458 | |||
| 450 | #endif /* CONFIG_CLOCKSOURCE_WATCHDOG */ | 459 | #endif /* CONFIG_CLOCKSOURCE_WATCHDOG */ |
| 451 | 460 | ||
| 452 | /** | 461 | /** |
| @@ -779,14 +788,19 @@ EXPORT_SYMBOL_GPL(__clocksource_update_freq_scale); | |||
| 779 | */ | 788 | */ |
| 780 | int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq) | 789 | int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq) |
| 781 | { | 790 | { |
| 791 | unsigned long flags; | ||
| 782 | 792 | ||
| 783 | /* Initialize mult/shift and max_idle_ns */ | 793 | /* Initialize mult/shift and max_idle_ns */ |
| 784 | __clocksource_update_freq_scale(cs, scale, freq); | 794 | __clocksource_update_freq_scale(cs, scale, freq); |
| 785 | 795 | ||
| 786 | /* Add clocksource to the clocksource list */ | 796 | /* Add clocksource to the clocksource list */ |
| 787 | mutex_lock(&clocksource_mutex); | 797 | mutex_lock(&clocksource_mutex); |
| 798 | |||
| 799 | clocksource_watchdog_lock(&flags); | ||
| 788 | clocksource_enqueue(cs); | 800 | clocksource_enqueue(cs); |
| 789 | clocksource_enqueue_watchdog(cs); | 801 | clocksource_enqueue_watchdog(cs); |
| 802 | clocksource_watchdog_unlock(&flags); | ||
| 803 | |||
| 790 | clocksource_select(); | 804 | clocksource_select(); |
| 791 | clocksource_select_watchdog(false); | 805 | clocksource_select_watchdog(false); |
| 792 | mutex_unlock(&clocksource_mutex); | 806 | mutex_unlock(&clocksource_mutex); |
| @@ -808,8 +822,13 @@ static void __clocksource_change_rating(struct clocksource *cs, int rating) | |||
| 808 | */ | 822 | */ |
| 809 | void clocksource_change_rating(struct clocksource *cs, int rating) | 823 | void clocksource_change_rating(struct clocksource *cs, int rating) |
| 810 | { | 824 | { |
| 825 | unsigned long flags; | ||
| 826 | |||
| 811 | mutex_lock(&clocksource_mutex); | 827 | mutex_lock(&clocksource_mutex); |
| 828 | clocksource_watchdog_lock(&flags); | ||
| 812 | __clocksource_change_rating(cs, rating); | 829 | __clocksource_change_rating(cs, rating); |
| 830 | clocksource_watchdog_unlock(&flags); | ||
| 831 | |||
| 813 | clocksource_select(); | 832 | clocksource_select(); |
| 814 | clocksource_select_watchdog(false); | 833 | clocksource_select_watchdog(false); |
| 815 | mutex_unlock(&clocksource_mutex); | 834 | mutex_unlock(&clocksource_mutex); |
| @@ -821,6 +840,8 @@ EXPORT_SYMBOL(clocksource_change_rating); | |||
| 821 | */ | 840 | */ |
| 822 | static int clocksource_unbind(struct clocksource *cs) | 841 | static int clocksource_unbind(struct clocksource *cs) |
| 823 | { | 842 | { |
| 843 | unsigned long flags; | ||
| 844 | |||
| 824 | if (clocksource_is_watchdog(cs)) { | 845 | if (clocksource_is_watchdog(cs)) { |
| 825 | /* Select and try to install a replacement watchdog. */ | 846 | /* Select and try to install a replacement watchdog. */ |
| 826 | clocksource_select_watchdog(true); | 847 | clocksource_select_watchdog(true); |
| @@ -834,8 +855,12 @@ static int clocksource_unbind(struct clocksource *cs) | |||
| 834 | if (curr_clocksource == cs) | 855 | if (curr_clocksource == cs) |
| 835 | return -EBUSY; | 856 | return -EBUSY; |
| 836 | } | 857 | } |
| 858 | |||
| 859 | clocksource_watchdog_lock(&flags); | ||
| 837 | clocksource_dequeue_watchdog(cs); | 860 | clocksource_dequeue_watchdog(cs); |
| 838 | list_del_init(&cs->list); | 861 | list_del_init(&cs->list); |
| 862 | clocksource_watchdog_unlock(&flags); | ||
| 863 | |||
| 839 | return 0; | 864 | return 0; |
| 840 | } | 865 | } |
| 841 | 866 | ||
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 16bbf062018f..8d83bcf9ef69 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
| @@ -5514,10 +5514,10 @@ static __init int ftrace_init_dyn_tracefs(struct dentry *d_tracer) | |||
| 5514 | ftrace_create_filter_files(&global_ops, d_tracer); | 5514 | ftrace_create_filter_files(&global_ops, d_tracer); |
| 5515 | 5515 | ||
| 5516 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 5516 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
| 5517 | trace_create_file("set_graph_function", 0444, d_tracer, | 5517 | trace_create_file("set_graph_function", 0644, d_tracer, |
| 5518 | NULL, | 5518 | NULL, |
| 5519 | &ftrace_graph_fops); | 5519 | &ftrace_graph_fops); |
| 5520 | trace_create_file("set_graph_notrace", 0444, d_tracer, | 5520 | trace_create_file("set_graph_notrace", 0644, d_tracer, |
| 5521 | NULL, | 5521 | NULL, |
| 5522 | &ftrace_graph_notrace_fops); | 5522 | &ftrace_graph_notrace_fops); |
| 5523 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | 5523 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ |
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c index 3c7bfc4bf5e9..4237eba4ef20 100644 --- a/kernel/trace/trace_stack.c +++ b/kernel/trace/trace_stack.c | |||
| @@ -472,7 +472,7 @@ static __init int stack_trace_init(void) | |||
| 472 | NULL, &stack_trace_fops); | 472 | NULL, &stack_trace_fops); |
| 473 | 473 | ||
| 474 | #ifdef CONFIG_DYNAMIC_FTRACE | 474 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 475 | trace_create_file("stack_trace_filter", 0444, d_tracer, | 475 | trace_create_file("stack_trace_filter", 0644, d_tracer, |
| 476 | &trace_ops, &stack_trace_filter_fops); | 476 | &trace_ops, &stack_trace_filter_fops); |
| 477 | #endif | 477 | #endif |
| 478 | 478 | ||
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 023190c69dce..7441bd93b732 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c | |||
| @@ -115,6 +115,7 @@ static int bdi_debug_register(struct backing_dev_info *bdi, const char *name) | |||
| 115 | bdi, &bdi_debug_stats_fops); | 115 | bdi, &bdi_debug_stats_fops); |
| 116 | if (!bdi->debug_stats) { | 116 | if (!bdi->debug_stats) { |
| 117 | debugfs_remove(bdi->debug_dir); | 117 | debugfs_remove(bdi->debug_dir); |
| 118 | bdi->debug_dir = NULL; | ||
| 118 | return -ENOMEM; | 119 | return -ENOMEM; |
| 119 | } | 120 | } |
| 120 | 121 | ||
| @@ -383,7 +384,7 @@ static void wb_shutdown(struct bdi_writeback *wb) | |||
| 383 | * the barrier provided by test_and_clear_bit() above. | 384 | * the barrier provided by test_and_clear_bit() above. |
| 384 | */ | 385 | */ |
| 385 | smp_wmb(); | 386 | smp_wmb(); |
| 386 | clear_bit(WB_shutting_down, &wb->state); | 387 | clear_and_wake_up_bit(WB_shutting_down, &wb->state); |
| 387 | } | 388 | } |
| 388 | 389 | ||
| 389 | static void wb_exit(struct bdi_writeback *wb) | 390 | static void wb_exit(struct bdi_writeback *wb) |
diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins index b2a95af7df18..7f5c86246138 100644 --- a/scripts/Makefile.gcc-plugins +++ b/scripts/Makefile.gcc-plugins | |||
| @@ -14,7 +14,7 @@ ifdef CONFIG_GCC_PLUGINS | |||
| 14 | endif | 14 | endif |
| 15 | 15 | ||
| 16 | ifdef CONFIG_GCC_PLUGIN_SANCOV | 16 | ifdef CONFIG_GCC_PLUGIN_SANCOV |
| 17 | ifeq ($(CFLAGS_KCOV),) | 17 | ifeq ($(strip $(CFLAGS_KCOV)),) |
| 18 | # It is needed because of the gcc-plugin.sh and gcc version checks. | 18 | # It is needed because of the gcc-plugin.sh and gcc version checks. |
| 19 | gcc-plugin-$(CONFIG_GCC_PLUGIN_SANCOV) += sancov_plugin.so | 19 | gcc-plugin-$(CONFIG_GCC_PLUGIN_SANCOV) += sancov_plugin.so |
| 20 | 20 | ||
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 07d07409f16f..5af34a2b0cd9 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
| @@ -196,7 +196,7 @@ $(obj)/%.tab.c: $(src)/%.y FORCE | |||
| 196 | $(call if_changed,bison) | 196 | $(call if_changed,bison) |
| 197 | 197 | ||
| 198 | quiet_cmd_bison_h = YACC $@ | 198 | quiet_cmd_bison_h = YACC $@ |
| 199 | cmd_bison_h = bison -o/dev/null --defines=$@ -t -l $< | 199 | cmd_bison_h = $(YACC) -o/dev/null --defines=$@ -t -l $< |
| 200 | 200 | ||
| 201 | $(obj)/%.tab.h: $(src)/%.y FORCE | 201 | $(obj)/%.tab.h: $(src)/%.y FORCE |
| 202 | $(call if_changed,bison_h) | 202 | $(call if_changed,bison_h) |
diff --git a/scripts/extract_xc3028.pl b/scripts/extract_xc3028.pl index 61d9b256c658..a1c51b7e4baf 100755 --- a/scripts/extract_xc3028.pl +++ b/scripts/extract_xc3028.pl | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #!/usr/bin/env perl | 1 | #!/usr/bin/env perl |
| 2 | 2 | ||
| 3 | # Copyright (c) Mauro Carvalho Chehab <mchehab@infradead.org> | 3 | # Copyright (c) Mauro Carvalho Chehab <mchehab@kernel.org> |
| 4 | # Released under GPLv2 | 4 | # Released under GPLv2 |
| 5 | # | 5 | # |
| 6 | # In order to use, you need to: | 6 | # In order to use, you need to: |
diff --git a/scripts/genksyms/Makefile b/scripts/genksyms/Makefile index ef0287e42957..03b7ce97de14 100644 --- a/scripts/genksyms/Makefile +++ b/scripts/genksyms/Makefile | |||
| @@ -14,14 +14,14 @@ genksyms-objs := genksyms.o parse.tab.o lex.lex.o | |||
| 14 | # so that 'bison: not found' will be displayed if it is missing. | 14 | # so that 'bison: not found' will be displayed if it is missing. |
| 15 | ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),) | 15 | ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),) |
| 16 | 16 | ||
| 17 | quiet_cmd_bison_no_warn = $(quet_cmd_bison) | 17 | quiet_cmd_bison_no_warn = $(quiet_cmd_bison) |
| 18 | cmd_bison_no_warn = $(YACC) --version >/dev/null; \ | 18 | cmd_bison_no_warn = $(YACC) --version >/dev/null; \ |
| 19 | $(cmd_bison) 2>/dev/null | 19 | $(cmd_bison) 2>/dev/null |
| 20 | 20 | ||
| 21 | $(obj)/parse.tab.c: $(src)/parse.y FORCE | 21 | $(obj)/parse.tab.c: $(src)/parse.y FORCE |
| 22 | $(call if_changed,bison_no_warn) | 22 | $(call if_changed,bison_no_warn) |
| 23 | 23 | ||
| 24 | quiet_cmd_bison_h_no_warn = $(quet_cmd_bison_h) | 24 | quiet_cmd_bison_h_no_warn = $(quiet_cmd_bison_h) |
| 25 | cmd_bison_h_no_warn = $(YACC) --version >/dev/null; \ | 25 | cmd_bison_h_no_warn = $(YACC) --version >/dev/null; \ |
| 26 | $(cmd_bison_h) 2>/dev/null | 26 | $(cmd_bison_h) 2>/dev/null |
| 27 | 27 | ||
diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c index 944418da9fe3..0f6dcb4011a8 100644 --- a/scripts/mod/sumversion.c +++ b/scripts/mod/sumversion.c | |||
| @@ -330,14 +330,7 @@ static int parse_source_files(const char *objfile, struct md4_ctx *md) | |||
| 330 | goto out; | 330 | goto out; |
| 331 | } | 331 | } |
| 332 | 332 | ||
| 333 | /* There will be a line like so: | 333 | /* Sum all files in the same dir or subdirs. */ |
| 334 | deps_drivers/net/dummy.o := \ | ||
| 335 | drivers/net/dummy.c \ | ||
| 336 | $(wildcard include/config/net/fastroute.h) \ | ||
| 337 | include/linux/module.h \ | ||
| 338 | |||
| 339 | Sum all files in the same dir or subdirs. | ||
| 340 | */ | ||
| 341 | while ((line = get_next_line(&pos, file, flen)) != NULL) { | 334 | while ((line = get_next_line(&pos, file, flen)) != NULL) { |
| 342 | char* p = line; | 335 | char* p = line; |
| 343 | 336 | ||
diff --git a/scripts/split-man.pl b/scripts/split-man.pl index bfe16cbe42df..c3db607ee9ec 100755 --- a/scripts/split-man.pl +++ b/scripts/split-man.pl | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #!/usr/bin/perl | 1 | #!/usr/bin/perl |
| 2 | # SPDX-License-Identifier: GPL-2.0 | 2 | # SPDX-License-Identifier: GPL-2.0 |
| 3 | # | 3 | # |
| 4 | # Author: Mauro Carvalho Chehab <mchehab@s-opensource.com> | 4 | # Author: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> |
| 5 | # | 5 | # |
| 6 | # Produce manpages from kernel-doc. | 6 | # Produce manpages from kernel-doc. |
| 7 | # See Documentation/doc-guide/kernel-doc.rst for instructions | 7 | # See Documentation/doc-guide/kernel-doc.rst for instructions |
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c index 06d7c40af570..6491afbb5fd5 100644 --- a/sound/core/pcm_compat.c +++ b/sound/core/pcm_compat.c | |||
| @@ -423,6 +423,8 @@ static int snd_pcm_ioctl_xfern_compat(struct snd_pcm_substream *substream, | |||
| 423 | return -ENOTTY; | 423 | return -ENOTTY; |
| 424 | if (substream->stream != dir) | 424 | if (substream->stream != dir) |
| 425 | return -EINVAL; | 425 | return -EINVAL; |
| 426 | if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) | ||
| 427 | return -EBADFD; | ||
| 426 | 428 | ||
| 427 | if ((ch = substream->runtime->channels) > 128) | 429 | if ((ch = substream->runtime->channels) > 128) |
| 428 | return -EINVAL; | 430 | return -EINVAL; |
diff --git a/sound/core/seq/seq_virmidi.c b/sound/core/seq/seq_virmidi.c index f48a4cd24ffc..289ae6bb81d9 100644 --- a/sound/core/seq/seq_virmidi.c +++ b/sound/core/seq/seq_virmidi.c | |||
| @@ -174,12 +174,12 @@ static void snd_virmidi_output_trigger(struct snd_rawmidi_substream *substream, | |||
| 174 | } | 174 | } |
| 175 | return; | 175 | return; |
| 176 | } | 176 | } |
| 177 | spin_lock_irqsave(&substream->runtime->lock, flags); | ||
| 177 | if (vmidi->event.type != SNDRV_SEQ_EVENT_NONE) { | 178 | if (vmidi->event.type != SNDRV_SEQ_EVENT_NONE) { |
| 178 | if (snd_seq_kernel_client_dispatch(vmidi->client, &vmidi->event, in_atomic(), 0) < 0) | 179 | if (snd_seq_kernel_client_dispatch(vmidi->client, &vmidi->event, in_atomic(), 0) < 0) |
| 179 | return; | 180 | goto out; |
| 180 | vmidi->event.type = SNDRV_SEQ_EVENT_NONE; | 181 | vmidi->event.type = SNDRV_SEQ_EVENT_NONE; |
| 181 | } | 182 | } |
| 182 | spin_lock_irqsave(&substream->runtime->lock, flags); | ||
| 183 | while (1) { | 183 | while (1) { |
| 184 | count = __snd_rawmidi_transmit_peek(substream, buf, sizeof(buf)); | 184 | count = __snd_rawmidi_transmit_peek(substream, buf, sizeof(buf)); |
| 185 | if (count <= 0) | 185 | if (count <= 0) |
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c index 58e349fc893f..eab7f594ebe7 100644 --- a/sound/drivers/aloop.c +++ b/sound/drivers/aloop.c | |||
| @@ -831,9 +831,11 @@ static int loopback_rate_shift_get(struct snd_kcontrol *kcontrol, | |||
| 831 | { | 831 | { |
| 832 | struct loopback *loopback = snd_kcontrol_chip(kcontrol); | 832 | struct loopback *loopback = snd_kcontrol_chip(kcontrol); |
| 833 | 833 | ||
| 834 | mutex_lock(&loopback->cable_lock); | ||
| 834 | ucontrol->value.integer.value[0] = | 835 | ucontrol->value.integer.value[0] = |
| 835 | loopback->setup[kcontrol->id.subdevice] | 836 | loopback->setup[kcontrol->id.subdevice] |
| 836 | [kcontrol->id.device].rate_shift; | 837 | [kcontrol->id.device].rate_shift; |
| 838 | mutex_unlock(&loopback->cable_lock); | ||
| 837 | return 0; | 839 | return 0; |
| 838 | } | 840 | } |
| 839 | 841 | ||
| @@ -865,9 +867,11 @@ static int loopback_notify_get(struct snd_kcontrol *kcontrol, | |||
| 865 | { | 867 | { |
| 866 | struct loopback *loopback = snd_kcontrol_chip(kcontrol); | 868 | struct loopback *loopback = snd_kcontrol_chip(kcontrol); |
| 867 | 869 | ||
| 870 | mutex_lock(&loopback->cable_lock); | ||
| 868 | ucontrol->value.integer.value[0] = | 871 | ucontrol->value.integer.value[0] = |
| 869 | loopback->setup[kcontrol->id.subdevice] | 872 | loopback->setup[kcontrol->id.subdevice] |
| 870 | [kcontrol->id.device].notify; | 873 | [kcontrol->id.device].notify; |
| 874 | mutex_unlock(&loopback->cable_lock); | ||
| 871 | return 0; | 875 | return 0; |
| 872 | } | 876 | } |
| 873 | 877 | ||
| @@ -879,12 +883,14 @@ static int loopback_notify_put(struct snd_kcontrol *kcontrol, | |||
| 879 | int change = 0; | 883 | int change = 0; |
| 880 | 884 | ||
| 881 | val = ucontrol->value.integer.value[0] ? 1 : 0; | 885 | val = ucontrol->value.integer.value[0] ? 1 : 0; |
| 886 | mutex_lock(&loopback->cable_lock); | ||
| 882 | if (val != loopback->setup[kcontrol->id.subdevice] | 887 | if (val != loopback->setup[kcontrol->id.subdevice] |
| 883 | [kcontrol->id.device].notify) { | 888 | [kcontrol->id.device].notify) { |
| 884 | loopback->setup[kcontrol->id.subdevice] | 889 | loopback->setup[kcontrol->id.subdevice] |
| 885 | [kcontrol->id.device].notify = val; | 890 | [kcontrol->id.device].notify = val; |
| 886 | change = 1; | 891 | change = 1; |
| 887 | } | 892 | } |
| 893 | mutex_unlock(&loopback->cable_lock); | ||
| 888 | return change; | 894 | return change; |
| 889 | } | 895 | } |
| 890 | 896 | ||
| @@ -892,15 +898,18 @@ static int loopback_active_get(struct snd_kcontrol *kcontrol, | |||
| 892 | struct snd_ctl_elem_value *ucontrol) | 898 | struct snd_ctl_elem_value *ucontrol) |
| 893 | { | 899 | { |
| 894 | struct loopback *loopback = snd_kcontrol_chip(kcontrol); | 900 | struct loopback *loopback = snd_kcontrol_chip(kcontrol); |
| 895 | struct loopback_cable *cable = loopback->cables | 901 | struct loopback_cable *cable; |
| 896 | [kcontrol->id.subdevice][kcontrol->id.device ^ 1]; | 902 | |
| 897 | unsigned int val = 0; | 903 | unsigned int val = 0; |
| 898 | 904 | ||
| 905 | mutex_lock(&loopback->cable_lock); | ||
| 906 | cable = loopback->cables[kcontrol->id.subdevice][kcontrol->id.device ^ 1]; | ||
| 899 | if (cable != NULL) { | 907 | if (cable != NULL) { |
| 900 | unsigned int running = cable->running ^ cable->pause; | 908 | unsigned int running = cable->running ^ cable->pause; |
| 901 | 909 | ||
| 902 | val = (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) ? 1 : 0; | 910 | val = (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) ? 1 : 0; |
| 903 | } | 911 | } |
| 912 | mutex_unlock(&loopback->cable_lock); | ||
| 904 | ucontrol->value.integer.value[0] = val; | 913 | ucontrol->value.integer.value[0] = val; |
| 905 | return 0; | 914 | return 0; |
| 906 | } | 915 | } |
| @@ -943,9 +952,11 @@ static int loopback_rate_get(struct snd_kcontrol *kcontrol, | |||
| 943 | { | 952 | { |
| 944 | struct loopback *loopback = snd_kcontrol_chip(kcontrol); | 953 | struct loopback *loopback = snd_kcontrol_chip(kcontrol); |
| 945 | 954 | ||
| 955 | mutex_lock(&loopback->cable_lock); | ||
| 946 | ucontrol->value.integer.value[0] = | 956 | ucontrol->value.integer.value[0] = |
| 947 | loopback->setup[kcontrol->id.subdevice] | 957 | loopback->setup[kcontrol->id.subdevice] |
| 948 | [kcontrol->id.device].rate; | 958 | [kcontrol->id.device].rate; |
| 959 | mutex_unlock(&loopback->cable_lock); | ||
| 949 | return 0; | 960 | return 0; |
| 950 | } | 961 | } |
| 951 | 962 | ||
| @@ -965,9 +976,11 @@ static int loopback_channels_get(struct snd_kcontrol *kcontrol, | |||
| 965 | { | 976 | { |
| 966 | struct loopback *loopback = snd_kcontrol_chip(kcontrol); | 977 | struct loopback *loopback = snd_kcontrol_chip(kcontrol); |
| 967 | 978 | ||
| 979 | mutex_lock(&loopback->cable_lock); | ||
| 968 | ucontrol->value.integer.value[0] = | 980 | ucontrol->value.integer.value[0] = |
| 969 | loopback->setup[kcontrol->id.subdevice] | 981 | loopback->setup[kcontrol->id.subdevice] |
| 970 | [kcontrol->id.device].channels; | 982 | [kcontrol->id.device].channels; |
| 983 | mutex_unlock(&loopback->cable_lock); | ||
| 971 | return 0; | 984 | return 0; |
| 972 | } | 985 | } |
| 973 | 986 | ||
diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index 4a1dc145327b..cb9acfe60f6a 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c | |||
| @@ -773,8 +773,6 @@ static void amdtp_stream_first_callback(struct fw_iso_context *context, | |||
| 773 | u32 cycle; | 773 | u32 cycle; |
| 774 | unsigned int packets; | 774 | unsigned int packets; |
| 775 | 775 | ||
| 776 | s->max_payload_length = amdtp_stream_get_max_payload(s); | ||
| 777 | |||
| 778 | /* | 776 | /* |
| 779 | * For in-stream, first packet has come. | 777 | * For in-stream, first packet has come. |
| 780 | * For out-stream, prepared to transmit first packet | 778 | * For out-stream, prepared to transmit first packet |
| @@ -879,6 +877,9 @@ int amdtp_stream_start(struct amdtp_stream *s, int channel, int speed) | |||
| 879 | 877 | ||
| 880 | amdtp_stream_update(s); | 878 | amdtp_stream_update(s); |
| 881 | 879 | ||
| 880 | if (s->direction == AMDTP_IN_STREAM) | ||
| 881 | s->max_payload_length = amdtp_stream_get_max_payload(s); | ||
| 882 | |||
| 882 | if (s->flags & CIP_NO_HEADER) | 883 | if (s->flags & CIP_NO_HEADER) |
| 883 | s->tag = TAG_NO_CIP_HEADER; | 884 | s->tag = TAG_NO_CIP_HEADER; |
| 884 | else | 885 | else |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 8c238e51bb5a..2dd34dd77447 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -3832,7 +3832,7 @@ static void alc280_fixup_hp_gpio4(struct hda_codec *codec, | |||
| 3832 | } | 3832 | } |
| 3833 | } | 3833 | } |
| 3834 | 3834 | ||
| 3835 | #if IS_REACHABLE(INPUT) | 3835 | #if IS_REACHABLE(CONFIG_INPUT) |
| 3836 | static void gpio2_mic_hotkey_event(struct hda_codec *codec, | 3836 | static void gpio2_mic_hotkey_event(struct hda_codec *codec, |
| 3837 | struct hda_jack_callback *event) | 3837 | struct hda_jack_callback *event) |
| 3838 | { | 3838 | { |
diff --git a/tools/power/acpi/Makefile.config b/tools/power/acpi/Makefile.config index 2cccbba64418..f304be71c278 100644 --- a/tools/power/acpi/Makefile.config +++ b/tools/power/acpi/Makefile.config | |||
| @@ -56,6 +56,7 @@ INSTALL_SCRIPT = ${INSTALL_PROGRAM} | |||
| 56 | # to compile vs uClibc, that can be done here as well. | 56 | # to compile vs uClibc, that can be done here as well. |
| 57 | CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc- | 57 | CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc- |
| 58 | CROSS_COMPILE ?= $(CROSS) | 58 | CROSS_COMPILE ?= $(CROSS) |
| 59 | LD = $(CC) | ||
| 59 | HOSTCC = gcc | 60 | HOSTCC = gcc |
| 60 | 61 | ||
| 61 | # check if compiler option is supported | 62 | # check if compiler option is supported |
diff --git a/virt/kvm/arm/vgic/vgic-init.c b/virt/kvm/arm/vgic/vgic-init.c index 68378fe17a0e..e07156c30323 100644 --- a/virt/kvm/arm/vgic/vgic-init.c +++ b/virt/kvm/arm/vgic/vgic-init.c | |||
| @@ -423,7 +423,7 @@ static irqreturn_t vgic_maintenance_handler(int irq, void *data) | |||
| 423 | * We cannot rely on the vgic maintenance interrupt to be | 423 | * We cannot rely on the vgic maintenance interrupt to be |
| 424 | * delivered synchronously. This means we can only use it to | 424 | * delivered synchronously. This means we can only use it to |
| 425 | * exit the VM, and we perform the handling of EOIed | 425 | * exit the VM, and we perform the handling of EOIed |
| 426 | * interrupts on the exit path (see vgic_process_maintenance). | 426 | * interrupts on the exit path (see vgic_fold_lr_state). |
| 427 | */ | 427 | */ |
| 428 | return IRQ_HANDLED; | 428 | return IRQ_HANDLED; |
| 429 | } | 429 | } |
diff --git a/virt/kvm/arm/vgic/vgic-mmio.c b/virt/kvm/arm/vgic/vgic-mmio.c index dbe99d635c80..ff9655cfeb2f 100644 --- a/virt/kvm/arm/vgic/vgic-mmio.c +++ b/virt/kvm/arm/vgic/vgic-mmio.c | |||
| @@ -289,10 +289,16 @@ static void vgic_mmio_change_active(struct kvm_vcpu *vcpu, struct vgic_irq *irq, | |||
| 289 | irq->vcpu->cpu != -1) /* VCPU thread is running */ | 289 | irq->vcpu->cpu != -1) /* VCPU thread is running */ |
| 290 | cond_resched_lock(&irq->irq_lock); | 290 | cond_resched_lock(&irq->irq_lock); |
| 291 | 291 | ||
| 292 | if (irq->hw) | 292 | if (irq->hw) { |
| 293 | vgic_hw_irq_change_active(vcpu, irq, active, !requester_vcpu); | 293 | vgic_hw_irq_change_active(vcpu, irq, active, !requester_vcpu); |
| 294 | else | 294 | } else { |
| 295 | u32 model = vcpu->kvm->arch.vgic.vgic_model; | ||
| 296 | |||
| 295 | irq->active = active; | 297 | irq->active = active; |
| 298 | if (model == KVM_DEV_TYPE_ARM_VGIC_V2 && | ||
| 299 | active && vgic_irq_is_sgi(irq->intid)) | ||
| 300 | irq->active_source = requester_vcpu->vcpu_id; | ||
| 301 | } | ||
| 296 | 302 | ||
| 297 | if (irq->active) | 303 | if (irq->active) |
| 298 | vgic_queue_irq_unlock(vcpu->kvm, irq, flags); | 304 | vgic_queue_irq_unlock(vcpu->kvm, irq, flags); |
diff --git a/virt/kvm/arm/vgic/vgic-v2.c b/virt/kvm/arm/vgic/vgic-v2.c index 45aa433f018f..a5f2e44f1c33 100644 --- a/virt/kvm/arm/vgic/vgic-v2.c +++ b/virt/kvm/arm/vgic/vgic-v2.c | |||
| @@ -37,13 +37,6 @@ void vgic_v2_init_lrs(void) | |||
| 37 | vgic_v2_write_lr(i, 0); | 37 | vgic_v2_write_lr(i, 0); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | void vgic_v2_set_npie(struct kvm_vcpu *vcpu) | ||
| 41 | { | ||
| 42 | struct vgic_v2_cpu_if *cpuif = &vcpu->arch.vgic_cpu.vgic_v2; | ||
| 43 | |||
| 44 | cpuif->vgic_hcr |= GICH_HCR_NPIE; | ||
| 45 | } | ||
| 46 | |||
| 47 | void vgic_v2_set_underflow(struct kvm_vcpu *vcpu) | 40 | void vgic_v2_set_underflow(struct kvm_vcpu *vcpu) |
| 48 | { | 41 | { |
| 49 | struct vgic_v2_cpu_if *cpuif = &vcpu->arch.vgic_cpu.vgic_v2; | 42 | struct vgic_v2_cpu_if *cpuif = &vcpu->arch.vgic_cpu.vgic_v2; |
| @@ -71,13 +64,18 @@ void vgic_v2_fold_lr_state(struct kvm_vcpu *vcpu) | |||
| 71 | int lr; | 64 | int lr; |
| 72 | unsigned long flags; | 65 | unsigned long flags; |
| 73 | 66 | ||
| 74 | cpuif->vgic_hcr &= ~(GICH_HCR_UIE | GICH_HCR_NPIE); | 67 | cpuif->vgic_hcr &= ~GICH_HCR_UIE; |
| 75 | 68 | ||
| 76 | for (lr = 0; lr < vgic_cpu->used_lrs; lr++) { | 69 | for (lr = 0; lr < vgic_cpu->used_lrs; lr++) { |
| 77 | u32 val = cpuif->vgic_lr[lr]; | 70 | u32 val = cpuif->vgic_lr[lr]; |
| 78 | u32 intid = val & GICH_LR_VIRTUALID; | 71 | u32 cpuid, intid = val & GICH_LR_VIRTUALID; |
| 79 | struct vgic_irq *irq; | 72 | struct vgic_irq *irq; |
| 80 | 73 | ||
| 74 | /* Extract the source vCPU id from the LR */ | ||
| 75 | cpuid = val & GICH_LR_PHYSID_CPUID; | ||
| 76 | cpuid >>= GICH_LR_PHYSID_CPUID_SHIFT; | ||
| 77 | cpuid &= 7; | ||
| 78 | |||
| 81 | /* Notify fds when the guest EOI'ed a level-triggered SPI */ | 79 | /* Notify fds when the guest EOI'ed a level-triggered SPI */ |
| 82 | if (lr_signals_eoi_mi(val) && vgic_valid_spi(vcpu->kvm, intid)) | 80 | if (lr_signals_eoi_mi(val) && vgic_valid_spi(vcpu->kvm, intid)) |
| 83 | kvm_notify_acked_irq(vcpu->kvm, 0, | 81 | kvm_notify_acked_irq(vcpu->kvm, 0, |
| @@ -90,17 +88,16 @@ void vgic_v2_fold_lr_state(struct kvm_vcpu *vcpu) | |||
| 90 | /* Always preserve the active bit */ | 88 | /* Always preserve the active bit */ |
| 91 | irq->active = !!(val & GICH_LR_ACTIVE_BIT); | 89 | irq->active = !!(val & GICH_LR_ACTIVE_BIT); |
| 92 | 90 | ||
| 91 | if (irq->active && vgic_irq_is_sgi(intid)) | ||
| 92 | irq->active_source = cpuid; | ||
| 93 | |||
| 93 | /* Edge is the only case where we preserve the pending bit */ | 94 | /* Edge is the only case where we preserve the pending bit */ |
| 94 | if (irq->config == VGIC_CONFIG_EDGE && | 95 | if (irq->config == VGIC_CONFIG_EDGE && |
| 95 | (val & GICH_LR_PENDING_BIT)) { | 96 | (val & GICH_LR_PENDING_BIT)) { |
| 96 | irq->pending_latch = true; | 97 | irq->pending_latch = true; |
| 97 | 98 | ||
| 98 | if (vgic_irq_is_sgi(intid)) { | 99 | if (vgic_irq_is_sgi(intid)) |
| 99 | u32 cpuid = val & GICH_LR_PHYSID_CPUID; | ||
| 100 | |||
| 101 | cpuid >>= GICH_LR_PHYSID_CPUID_SHIFT; | ||
| 102 | irq->source |= (1 << cpuid); | 100 | irq->source |= (1 << cpuid); |
| 103 | } | ||
| 104 | } | 101 | } |
| 105 | 102 | ||
| 106 | /* | 103 | /* |
| @@ -152,8 +149,15 @@ void vgic_v2_populate_lr(struct kvm_vcpu *vcpu, struct vgic_irq *irq, int lr) | |||
| 152 | u32 val = irq->intid; | 149 | u32 val = irq->intid; |
| 153 | bool allow_pending = true; | 150 | bool allow_pending = true; |
| 154 | 151 | ||
| 155 | if (irq->active) | 152 | if (irq->active) { |
| 156 | val |= GICH_LR_ACTIVE_BIT; | 153 | val |= GICH_LR_ACTIVE_BIT; |
| 154 | if (vgic_irq_is_sgi(irq->intid)) | ||
| 155 | val |= irq->active_source << GICH_LR_PHYSID_CPUID_SHIFT; | ||
| 156 | if (vgic_irq_is_multi_sgi(irq)) { | ||
| 157 | allow_pending = false; | ||
| 158 | val |= GICH_LR_EOI; | ||
| 159 | } | ||
| 160 | } | ||
| 157 | 161 | ||
| 158 | if (irq->hw) { | 162 | if (irq->hw) { |
| 159 | val |= GICH_LR_HW; | 163 | val |= GICH_LR_HW; |
| @@ -190,8 +194,10 @@ void vgic_v2_populate_lr(struct kvm_vcpu *vcpu, struct vgic_irq *irq, int lr) | |||
| 190 | BUG_ON(!src); | 194 | BUG_ON(!src); |
| 191 | val |= (src - 1) << GICH_LR_PHYSID_CPUID_SHIFT; | 195 | val |= (src - 1) << GICH_LR_PHYSID_CPUID_SHIFT; |
| 192 | irq->source &= ~(1 << (src - 1)); | 196 | irq->source &= ~(1 << (src - 1)); |
| 193 | if (irq->source) | 197 | if (irq->source) { |
| 194 | irq->pending_latch = true; | 198 | irq->pending_latch = true; |
| 199 | val |= GICH_LR_EOI; | ||
| 200 | } | ||
| 195 | } | 201 | } |
| 196 | } | 202 | } |
| 197 | 203 | ||
diff --git a/virt/kvm/arm/vgic/vgic-v3.c b/virt/kvm/arm/vgic/vgic-v3.c index 8195f52ae6f0..c7423f3768e5 100644 --- a/virt/kvm/arm/vgic/vgic-v3.c +++ b/virt/kvm/arm/vgic/vgic-v3.c | |||
| @@ -27,13 +27,6 @@ static bool group1_trap; | |||
| 27 | static bool common_trap; | 27 | static bool common_trap; |
| 28 | static bool gicv4_enable; | 28 | static bool gicv4_enable; |
| 29 | 29 | ||
| 30 | void vgic_v3_set_npie(struct kvm_vcpu *vcpu) | ||
| 31 | { | ||
| 32 | struct vgic_v3_cpu_if *cpuif = &vcpu->arch.vgic_cpu.vgic_v3; | ||
| 33 | |||
| 34 | cpuif->vgic_hcr |= ICH_HCR_NPIE; | ||
| 35 | } | ||
| 36 | |||
| 37 | void vgic_v3_set_underflow(struct kvm_vcpu *vcpu) | 30 | void vgic_v3_set_underflow(struct kvm_vcpu *vcpu) |
| 38 | { | 31 | { |
| 39 | struct vgic_v3_cpu_if *cpuif = &vcpu->arch.vgic_cpu.vgic_v3; | 32 | struct vgic_v3_cpu_if *cpuif = &vcpu->arch.vgic_cpu.vgic_v3; |
| @@ -55,17 +48,23 @@ void vgic_v3_fold_lr_state(struct kvm_vcpu *vcpu) | |||
| 55 | int lr; | 48 | int lr; |
| 56 | unsigned long flags; | 49 | unsigned long flags; |
| 57 | 50 | ||
| 58 | cpuif->vgic_hcr &= ~(ICH_HCR_UIE | ICH_HCR_NPIE); | 51 | cpuif->vgic_hcr &= ~ICH_HCR_UIE; |
| 59 | 52 | ||
| 60 | for (lr = 0; lr < vgic_cpu->used_lrs; lr++) { | 53 | for (lr = 0; lr < vgic_cpu->used_lrs; lr++) { |
| 61 | u64 val = cpuif->vgic_lr[lr]; | 54 | u64 val = cpuif->vgic_lr[lr]; |
| 62 | u32 intid; | 55 | u32 intid, cpuid; |
| 63 | struct vgic_irq *irq; | 56 | struct vgic_irq *irq; |
| 57 | bool is_v2_sgi = false; | ||
| 64 | 58 | ||
| 65 | if (model == KVM_DEV_TYPE_ARM_VGIC_V3) | 59 | cpuid = val & GICH_LR_PHYSID_CPUID; |
| 60 | cpuid >>= GICH_LR_PHYSID_CPUID_SHIFT; | ||
| 61 | |||
| 62 | if (model == KVM_DEV_TYPE_ARM_VGIC_V3) { | ||
| 66 | intid = val & ICH_LR_VIRTUAL_ID_MASK; | 63 | intid = val & ICH_LR_VIRTUAL_ID_MASK; |
| 67 | else | 64 | } else { |
| 68 | intid = val & GICH_LR_VIRTUALID; | 65 | intid = val & GICH_LR_VIRTUALID; |
| 66 | is_v2_sgi = vgic_irq_is_sgi(intid); | ||
| 67 | } | ||
| 69 | 68 | ||
| 70 | /* Notify fds when the guest EOI'ed a level-triggered IRQ */ | 69 | /* Notify fds when the guest EOI'ed a level-triggered IRQ */ |
| 71 | if (lr_signals_eoi_mi(val) && vgic_valid_spi(vcpu->kvm, intid)) | 70 | if (lr_signals_eoi_mi(val) && vgic_valid_spi(vcpu->kvm, intid)) |
| @@ -81,18 +80,16 @@ void vgic_v3_fold_lr_state(struct kvm_vcpu *vcpu) | |||
| 81 | /* Always preserve the active bit */ | 80 | /* Always preserve the active bit */ |
| 82 | irq->active = !!(val & ICH_LR_ACTIVE_BIT); | 81 | irq->active = !!(val & ICH_LR_ACTIVE_BIT); |
| 83 | 82 | ||
| 83 | if (irq->active && is_v2_sgi) | ||
| 84 | irq->active_source = cpuid; | ||
| 85 | |||
| 84 | /* Edge is the only case where we preserve the pending bit */ | 86 | /* Edge is the only case where we preserve the pending bit */ |
| 85 | if (irq->config == VGIC_CONFIG_EDGE && | 87 | if (irq->config == VGIC_CONFIG_EDGE && |
| 86 | (val & ICH_LR_PENDING_BIT)) { | 88 | (val & ICH_LR_PENDING_BIT)) { |
| 87 | irq->pending_latch = true; | 89 | irq->pending_latch = true; |
| 88 | 90 | ||
| 89 | if (vgic_irq_is_sgi(intid) && | 91 | if (is_v2_sgi) |
| 90 | model == KVM_DEV_TYPE_ARM_VGIC_V2) { | ||
| 91 | u32 cpuid = val & GICH_LR_PHYSID_CPUID; | ||
| 92 | |||
| 93 | cpuid >>= GICH_LR_PHYSID_CPUID_SHIFT; | ||
| 94 | irq->source |= (1 << cpuid); | 92 | irq->source |= (1 << cpuid); |
| 95 | } | ||
| 96 | } | 93 | } |
| 97 | 94 | ||
| 98 | /* | 95 | /* |
| @@ -133,10 +130,20 @@ void vgic_v3_populate_lr(struct kvm_vcpu *vcpu, struct vgic_irq *irq, int lr) | |||
| 133 | { | 130 | { |
| 134 | u32 model = vcpu->kvm->arch.vgic.vgic_model; | 131 | u32 model = vcpu->kvm->arch.vgic.vgic_model; |
| 135 | u64 val = irq->intid; | 132 | u64 val = irq->intid; |
| 136 | bool allow_pending = true; | 133 | bool allow_pending = true, is_v2_sgi; |
| 137 | 134 | ||
| 138 | if (irq->active) | 135 | is_v2_sgi = (vgic_irq_is_sgi(irq->intid) && |
| 136 | model == KVM_DEV_TYPE_ARM_VGIC_V2); | ||
| 137 | |||
| 138 | if (irq->active) { | ||
| 139 | val |= ICH_LR_ACTIVE_BIT; | 139 | val |= ICH_LR_ACTIVE_BIT; |
| 140 | if (is_v2_sgi) | ||
| 141 | val |= irq->active_source << GICH_LR_PHYSID_CPUID_SHIFT; | ||
| 142 | if (vgic_irq_is_multi_sgi(irq)) { | ||
| 143 | allow_pending = false; | ||
| 144 | val |= ICH_LR_EOI; | ||
| 145 | } | ||
| 146 | } | ||
| 140 | 147 | ||
| 141 | if (irq->hw) { | 148 | if (irq->hw) { |
| 142 | val |= ICH_LR_HW; | 149 | val |= ICH_LR_HW; |
| @@ -174,8 +181,10 @@ void vgic_v3_populate_lr(struct kvm_vcpu *vcpu, struct vgic_irq *irq, int lr) | |||
| 174 | BUG_ON(!src); | 181 | BUG_ON(!src); |
| 175 | val |= (src - 1) << GICH_LR_PHYSID_CPUID_SHIFT; | 182 | val |= (src - 1) << GICH_LR_PHYSID_CPUID_SHIFT; |
| 176 | irq->source &= ~(1 << (src - 1)); | 183 | irq->source &= ~(1 << (src - 1)); |
| 177 | if (irq->source) | 184 | if (irq->source) { |
| 178 | irq->pending_latch = true; | 185 | irq->pending_latch = true; |
| 186 | val |= ICH_LR_EOI; | ||
| 187 | } | ||
| 179 | } | 188 | } |
| 180 | } | 189 | } |
| 181 | 190 | ||
diff --git a/virt/kvm/arm/vgic/vgic.c b/virt/kvm/arm/vgic/vgic.c index 702936cbe173..97bfba8d9a59 100644 --- a/virt/kvm/arm/vgic/vgic.c +++ b/virt/kvm/arm/vgic/vgic.c | |||
| @@ -725,14 +725,6 @@ static inline void vgic_set_underflow(struct kvm_vcpu *vcpu) | |||
| 725 | vgic_v3_set_underflow(vcpu); | 725 | vgic_v3_set_underflow(vcpu); |
| 726 | } | 726 | } |
| 727 | 727 | ||
| 728 | static inline void vgic_set_npie(struct kvm_vcpu *vcpu) | ||
| 729 | { | ||
| 730 | if (kvm_vgic_global_state.type == VGIC_V2) | ||
| 731 | vgic_v2_set_npie(vcpu); | ||
| 732 | else | ||
| 733 | vgic_v3_set_npie(vcpu); | ||
| 734 | } | ||
| 735 | |||
| 736 | /* Requires the ap_list_lock to be held. */ | 728 | /* Requires the ap_list_lock to be held. */ |
| 737 | static int compute_ap_list_depth(struct kvm_vcpu *vcpu, | 729 | static int compute_ap_list_depth(struct kvm_vcpu *vcpu, |
| 738 | bool *multi_sgi) | 730 | bool *multi_sgi) |
| @@ -746,17 +738,15 @@ static int compute_ap_list_depth(struct kvm_vcpu *vcpu, | |||
| 746 | DEBUG_SPINLOCK_BUG_ON(!spin_is_locked(&vgic_cpu->ap_list_lock)); | 738 | DEBUG_SPINLOCK_BUG_ON(!spin_is_locked(&vgic_cpu->ap_list_lock)); |
| 747 | 739 | ||
| 748 | list_for_each_entry(irq, &vgic_cpu->ap_list_head, ap_list) { | 740 | list_for_each_entry(irq, &vgic_cpu->ap_list_head, ap_list) { |
| 741 | int w; | ||
| 742 | |||
| 749 | spin_lock(&irq->irq_lock); | 743 | spin_lock(&irq->irq_lock); |
| 750 | /* GICv2 SGIs can count for more than one... */ | 744 | /* GICv2 SGIs can count for more than one... */ |
| 751 | if (vgic_irq_is_sgi(irq->intid) && irq->source) { | 745 | w = vgic_irq_get_lr_count(irq); |
| 752 | int w = hweight8(irq->source); | ||
| 753 | |||
| 754 | count += w; | ||
| 755 | *multi_sgi |= (w > 1); | ||
| 756 | } else { | ||
| 757 | count++; | ||
| 758 | } | ||
| 759 | spin_unlock(&irq->irq_lock); | 746 | spin_unlock(&irq->irq_lock); |
| 747 | |||
| 748 | count += w; | ||
| 749 | *multi_sgi |= (w > 1); | ||
| 760 | } | 750 | } |
| 761 | return count; | 751 | return count; |
| 762 | } | 752 | } |
| @@ -767,7 +757,6 @@ static void vgic_flush_lr_state(struct kvm_vcpu *vcpu) | |||
| 767 | struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu; | 757 | struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu; |
| 768 | struct vgic_irq *irq; | 758 | struct vgic_irq *irq; |
| 769 | int count; | 759 | int count; |
| 770 | bool npie = false; | ||
| 771 | bool multi_sgi; | 760 | bool multi_sgi; |
| 772 | u8 prio = 0xff; | 761 | u8 prio = 0xff; |
| 773 | 762 | ||
| @@ -797,10 +786,8 @@ static void vgic_flush_lr_state(struct kvm_vcpu *vcpu) | |||
| 797 | if (likely(vgic_target_oracle(irq) == vcpu)) { | 786 | if (likely(vgic_target_oracle(irq) == vcpu)) { |
| 798 | vgic_populate_lr(vcpu, irq, count++); | 787 | vgic_populate_lr(vcpu, irq, count++); |
| 799 | 788 | ||
| 800 | if (irq->source) { | 789 | if (irq->source) |
| 801 | npie = true; | ||
| 802 | prio = irq->priority; | 790 | prio = irq->priority; |
| 803 | } | ||
| 804 | } | 791 | } |
| 805 | 792 | ||
| 806 | spin_unlock(&irq->irq_lock); | 793 | spin_unlock(&irq->irq_lock); |
| @@ -813,9 +800,6 @@ static void vgic_flush_lr_state(struct kvm_vcpu *vcpu) | |||
| 813 | } | 800 | } |
| 814 | } | 801 | } |
| 815 | 802 | ||
| 816 | if (npie) | ||
| 817 | vgic_set_npie(vcpu); | ||
| 818 | |||
| 819 | vcpu->arch.vgic_cpu.used_lrs = count; | 803 | vcpu->arch.vgic_cpu.used_lrs = count; |
| 820 | 804 | ||
| 821 | /* Nuke remaining LRs */ | 805 | /* Nuke remaining LRs */ |
diff --git a/virt/kvm/arm/vgic/vgic.h b/virt/kvm/arm/vgic/vgic.h index 830e815748a0..32c25d42c93f 100644 --- a/virt/kvm/arm/vgic/vgic.h +++ b/virt/kvm/arm/vgic/vgic.h | |||
| @@ -110,6 +110,20 @@ static inline bool vgic_irq_is_mapped_level(struct vgic_irq *irq) | |||
| 110 | return irq->config == VGIC_CONFIG_LEVEL && irq->hw; | 110 | return irq->config == VGIC_CONFIG_LEVEL && irq->hw; |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | static inline int vgic_irq_get_lr_count(struct vgic_irq *irq) | ||
| 114 | { | ||
| 115 | /* Account for the active state as an interrupt */ | ||
| 116 | if (vgic_irq_is_sgi(irq->intid) && irq->source) | ||
| 117 | return hweight8(irq->source) + irq->active; | ||
| 118 | |||
| 119 | return irq_is_pending(irq) || irq->active; | ||
| 120 | } | ||
| 121 | |||
| 122 | static inline bool vgic_irq_is_multi_sgi(struct vgic_irq *irq) | ||
| 123 | { | ||
| 124 | return vgic_irq_get_lr_count(irq) > 1; | ||
| 125 | } | ||
| 126 | |||
| 113 | /* | 127 | /* |
| 114 | * This struct provides an intermediate representation of the fields contained | 128 | * This struct provides an intermediate representation of the fields contained |
| 115 | * in the GICH_VMCR and ICH_VMCR registers, such that code exporting the GIC | 129 | * in the GICH_VMCR and ICH_VMCR registers, such that code exporting the GIC |
