Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge 5.5-rc7 into usb-next

We need the USB fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+2317 -2228
+1
.mailmap
··· 99 99 Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk@google.com> 100 100 Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk@motorola.com> 101 101 Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk.kim@samsung.com> 102 + Jakub Kicinski <kuba@kernel.org> <jakub.kicinski@netronome.com> 102 103 James Bottomley <jejb@mulgrave.(none)> 103 104 James Bottomley <jejb@titanic.il.steeleye.com> 104 105 James E Wilson <wilson@specifix.com>
+11 -2
Documentation/ABI/stable/sysfs-driver-mlxreg-io
··· 29 29 30 30 The files are read only. 31 31 32 - What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/jtag_enable 32 + What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld3_version 33 33 34 34 Date: November 2018 35 35 KernelVersion: 5.0 36 36 Contact: Vadim Pasternak <vadimpmellanox.com> 37 37 Description: These files show with which CPLD versions have been burned 38 - on LED board. 38 + on LED or Gearbox board. 39 39 40 40 The files are read only. 41 41 ··· 118 118 Value 1 in file means this is reset cause, 0 - otherwise. 119 119 Only one bit could be 1 at the same time, representing only 120 120 the last reset cause. 121 + 122 + The files are read only. 123 + 124 + What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld4_version 125 + Date: November 2018 126 + KernelVersion: 5.0 127 + Contact: Vadim Pasternak <vadimpmellanox.com> 128 + Description: These files show with which CPLD versions have been burned 129 + on LED board. 121 130 122 131 The files are read only. 123 132
+1 -1
Documentation/admin-guide/devices.txt
··· 319 319 182 = /dev/perfctr Performance-monitoring counters 320 320 183 = /dev/hwrng Generic random number generator 321 321 184 = /dev/cpu/microcode CPU microcode update interface 322 - 186 = /dev/atomicps Atomic shapshot of process state data 322 + 186 = /dev/atomicps Atomic snapshot of process state data 323 323 187 = /dev/irnet IrNET device 324 324 188 = /dev/smbusbios SMBus BIOS 325 325 189 = /dev/ussp_ctl User space serial port control
+1 -1
Documentation/media/v4l-drivers/meye.rst
··· 95 95 96 96 Besides the video4linux interface, the driver has a private interface 97 97 for accessing the Motion Eye extended parameters (camera sharpness, 98 - agc, video framerate), the shapshot and the MJPEG capture facilities. 98 + agc, video framerate), the snapshot and the MJPEG capture facilities. 99 99 100 100 This interface consists of several ioctls (prototypes and structures 101 101 can be found in include/linux/meye.h):
+1 -1
Documentation/process/embargoed-hardware-issues.rst
··· 255 255 Red Hat Josh Poimboeuf <jpoimboe@redhat.com> 256 256 SUSE Jiri Kosina <jkosina@suse.cz> 257 257 258 - Amazon 258 + Amazon Peter Bowen <pzb@amzn.com> 259 259 Google Kees Cook <keescook@chromium.org> 260 260 ============= ======================================================== 261 261
+10 -10
MAINTAINERS
··· 720 720 F: drivers/i2c/busses/i2c-altera.c 721 721 722 722 ALTERA MAILBOX DRIVER 723 - M: Ley Foon Tan <lftan@altera.com> 723 + M: Ley Foon Tan <ley.foon.tan@intel.com> 724 724 L: nios2-dev@lists.rocketboards.org (moderated for non-subscribers) 725 725 S: Maintained 726 726 F: drivers/mailbox/mailbox-altera.c ··· 1407 1407 1408 1408 ARM/ACTIONS SEMI ARCHITECTURE 1409 1409 M: Andreas Färber <afaerber@suse.de> 1410 - R: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> 1410 + M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> 1411 1411 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1412 1412 S: Maintained 1413 1413 N: owl ··· 3150 3150 F: arch/mips/net/ 3151 3151 3152 3152 BPF JIT for NFP NICs 3153 - M: Jakub Kicinski <jakub.kicinski@netronome.com> 3153 + M: Jakub Kicinski <kuba@kernel.org> 3154 3154 L: netdev@vger.kernel.org 3155 3155 L: bpf@vger.kernel.org 3156 3156 S: Supported ··· 11431 11431 F: net/netrom/ 11432 11432 11433 11433 NETRONOME ETHERNET DRIVERS 11434 - M: Jakub Kicinski <jakub.kicinski@netronome.com> 11434 + M: Jakub Kicinski <kuba@kernel.org> 11435 11435 L: oss-drivers@netronome.com 11436 11436 S: Maintained 11437 11437 F: drivers/net/ethernet/netronome/ ··· 11591 11591 M: Aviad Yehezkel <aviadye@mellanox.com> 11592 11592 M: John Fastabend <john.fastabend@gmail.com> 11593 11593 M: Daniel Borkmann <daniel@iogearbox.net> 11594 - M: Jakub Kicinski <jakub.kicinski@netronome.com> 11594 + M: Jakub Kicinski <kuba@kernel.org> 11595 11595 L: netdev@vger.kernel.org 11596 11596 S: Maintained 11597 11597 F: net/tls/* ··· 11603 11603 Q: http://patchwork.kernel.org/project/linux-wireless/list/ 11604 11604 11605 11605 NETDEVSIM 11606 - M: Jakub Kicinski <jakub.kicinski@netronome.com> 11606 + M: Jakub Kicinski <kuba@kernel.org> 11607 11607 S: Maintained 11608 11608 F: drivers/net/netdevsim/* 11609 11609 ··· 11680 11680 F: drivers/scsi/nsp32* 11681 11681 11682 11682 NIOS2 ARCHITECTURE 11683 - M: Ley Foon Tan <lftan@altera.com> 11683 + M: Ley Foon Tan <ley.foon.tan@intel.com> 11684 11684 L: nios2-dev@lists.rocketboards.org (moderated for non-subscribers) 11685 11685 T: git git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2.git 11686 11686 S: Maintained ··· 12564 12564 F: drivers/pci/controller/pci-aardvark.c 12565 12565 12566 12566 PCI DRIVER FOR ALTERA PCIE IP 12567 - M: Ley Foon Tan <lftan@altera.com> 12567 + M: Ley Foon Tan <ley.foon.tan@intel.com> 12568 12568 L: rfi@lists.rocketboards.org (moderated for non-subscribers) 12569 12569 L: linux-pci@vger.kernel.org 12570 12570 S: Supported ··· 12743 12743 F: Documentation/PCI/pci-error-recovery.rst 12744 12744 12745 12745 PCI MSI DRIVER FOR ALTERA MSI IP 12746 - M: Ley Foon Tan <lftan@altera.com> 12746 + M: Ley Foon Tan <ley.foon.tan@intel.com> 12747 12747 L: rfi@lists.rocketboards.org (moderated for non-subscribers) 12748 12748 L: linux-pci@vger.kernel.org 12749 12749 S: Supported ··· 18043 18043 M: Alexei Starovoitov <ast@kernel.org> 18044 18044 M: Daniel Borkmann <daniel@iogearbox.net> 18045 18045 M: David S. Miller <davem@davemloft.net> 18046 - M: Jakub Kicinski <jakub.kicinski@netronome.com> 18046 + M: Jakub Kicinski <kuba@kernel.org> 18047 18047 M: Jesper Dangaard Brouer <hawk@kernel.org> 18048 18048 M: John Fastabend <john.fastabend@gmail.com> 18049 18049 L: netdev@vger.kernel.org
+1 -1
Makefile
··· 2 2 VERSION = 5 3 3 PATCHLEVEL = 5 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc6 5 + EXTRAVERSION = -rc7 6 6 NAME = Kleptomaniac Octopus 7 7 8 8 # *DOCUMENTATION*
+1 -5
arch/arm/boot/dts/am571x-idk.dts
··· 167 167 168 168 &pcie1_rc { 169 169 status = "okay"; 170 - gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>; 171 - }; 172 - 173 - &pcie1_ep { 174 - gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>; 170 + gpios = <&gpio5 18 GPIO_ACTIVE_HIGH>; 175 171 }; 176 172 177 173 &mmc1 {
-4
arch/arm/boot/dts/am572x-idk-common.dtsi
··· 147 147 gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>; 148 148 }; 149 149 150 - &pcie1_ep { 151 - gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>; 152 - }; 153 - 154 150 &mailbox5 { 155 151 status = "okay"; 156 152 mbox_ipu1_ipc3x: mbox_ipu1_ipc3x {
+21 -4
arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi
··· 29 29 reg = <0x0 0x80000000 0x0 0x80000000>; 30 30 }; 31 31 32 + main_12v0: fixedregulator-main_12v0 { 33 + /* main supply */ 34 + compatible = "regulator-fixed"; 35 + regulator-name = "main_12v0"; 36 + regulator-min-microvolt = <12000000>; 37 + regulator-max-microvolt = <12000000>; 38 + regulator-always-on; 39 + regulator-boot-on; 40 + }; 41 + 42 + evm_5v0: fixedregulator-evm_5v0 { 43 + /* Output of TPS54531D */ 44 + compatible = "regulator-fixed"; 45 + regulator-name = "evm_5v0"; 46 + regulator-min-microvolt = <5000000>; 47 + regulator-max-microvolt = <5000000>; 48 + vin-supply = <&main_12v0>; 49 + regulator-always-on; 50 + regulator-boot-on; 51 + }; 52 + 32 53 vdd_3v3: fixedregulator-vdd_3v3 { 33 54 compatible = "regulator-fixed"; 34 55 regulator-name = "vdd_3v3"; ··· 565 544 566 545 &pcie1_rc { 567 546 status = "ok"; 568 - gpios = <&gpio2 8 GPIO_ACTIVE_LOW>; 569 - }; 570 - 571 - &pcie1_ep { 572 547 gpios = <&gpio2 8 GPIO_ACTIVE_LOW>; 573 548 }; 574 549
+2 -367
arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts
··· 258 258 }; 259 259 }; 260 260 261 - pca0: pca9552@60 { 261 + pca0: pca9552@61 { 262 262 compatible = "nxp,pca9552"; 263 - reg = <0x60>; 263 + reg = <0x61>; 264 264 #address-cells = <1>; 265 265 #size-cells = <0>; 266 266 ··· 512 512 eeprom@51 { 513 513 compatible = "atmel,24c64"; 514 514 reg = <0x51>; 515 - }; 516 - }; 517 - 518 - &i2c12 { 519 - status = "okay"; 520 - }; 521 - 522 - &i2c13 { 523 - status = "okay"; 524 - }; 525 - 526 - &i2c14 { 527 - status = "okay"; 528 - }; 529 - 530 - &i2c15 { 531 - status = "okay"; 532 - }; 533 - 534 - &i2c0 { 535 - status = "okay"; 536 - }; 537 - 538 - &i2c1 { 539 - status = "okay"; 540 - }; 541 - 542 - &i2c2 { 543 - status = "okay"; 544 - }; 545 - 546 - &i2c3 { 547 - status = "okay"; 548 - 549 - power-supply@68 { 550 - compatible = "ibm,cffps2"; 551 - reg = <0x68>; 552 - }; 553 - 554 - power-supply@69 { 555 - compatible = "ibm,cffps2"; 556 - reg = <0x69>; 557 - }; 558 - 559 - power-supply@6a { 560 - compatible = "ibm,cffps2"; 561 - reg = <0x6a>; 562 - }; 563 - 564 - power-supply@6b { 565 - compatible = "ibm,cffps2"; 566 - reg = <0x6b>; 567 - }; 568 - }; 569 - 570 - &i2c4 { 571 - status = "okay"; 572 - 573 - tmp275@48 { 574 - compatible = "ti,tmp275"; 575 - reg = <0x48>; 576 - }; 577 - 578 - tmp275@49 { 579 - compatible = "ti,tmp275"; 580 - reg = <0x49>; 581 - }; 582 - 583 - tmp275@4a { 584 - compatible = "ti,tmp275"; 585 - reg = <0x4a>; 586 - }; 587 - }; 588 - 589 - &i2c5 { 590 - status = "okay"; 591 - 592 - tmp275@48 { 593 - compatible = "ti,tmp275"; 594 - reg = <0x48>; 595 - }; 596 - 597 - tmp275@49 { 598 - compatible = "ti,tmp275"; 599 - reg = <0x49>; 600 - }; 601 - }; 602 - 603 - &i2c6 { 604 - status = "okay"; 605 - 606 - tmp275@48 { 607 - compatible = "ti,tmp275"; 608 - reg = <0x48>; 609 - }; 610 - 611 - tmp275@4a { 612 - compatible = "ti,tmp275"; 613 - reg = <0x4a>; 614 - }; 615 - 616 - tmp275@4b { 617 - compatible = "ti,tmp275"; 618 - reg = <0x4b>; 619 - }; 620 - }; 621 - 622 - &i2c7 { 623 - status = "okay"; 624 - 625 - si7021-a20@20 { 626 - compatible = "silabs,si7020"; 627 - reg = <0x20>; 628 - }; 629 - 630 - tmp275@48 { 631 - compatible = "ti,tmp275"; 632 - reg = <0x48>; 633 - }; 634 - 635 - max31785@52 { 636 - compatible = "maxim,max31785a"; 637 - reg = <0x52>; 638 - #address-cells = <1>; 639 - #size-cells = <0>; 640 - 641 - fan@0 { 642 - compatible = "pmbus-fan"; 643 - reg = <0>; 644 - tach-pulses = <2>; 645 - }; 646 - 647 - fan@1 { 648 - compatible = "pmbus-fan"; 649 - reg = <1>; 650 - tach-pulses = <2>; 651 - }; 652 - 653 - fan@2 { 654 - compatible = "pmbus-fan"; 655 - reg = <2>; 656 - tach-pulses = <2>; 657 - }; 658 - 659 - fan@3 { 660 - compatible = "pmbus-fan"; 661 - reg = <3>; 662 - tach-pulses = <2>; 663 - }; 664 - }; 665 - 666 - pca0: pca9552@60 { 667 - compatible = "nxp,pca9552"; 668 - reg = <0x60>; 669 - #address-cells = <1>; 670 - #size-cells = <0>; 671 - 672 - gpio-controller; 673 - #gpio-cells = <2>; 674 - 675 - gpio@0 { 676 - reg = <0>; 677 - }; 678 - 679 - gpio@1 { 680 - reg = <1>; 681 - }; 682 - 683 - gpio@2 { 684 - reg = <2>; 685 - }; 686 - 687 - gpio@3 { 688 - reg = <3>; 689 - }; 690 - 691 - gpio@4 { 692 - reg = <4>; 693 - }; 694 - 695 - gpio@5 { 696 - reg = <5>; 697 - }; 698 - 699 - gpio@6 { 700 - reg = <6>; 701 - }; 702 - 703 - gpio@7 { 704 - reg = <7>; 705 - }; 706 - 707 - gpio@8 { 708 - reg = <8>; 709 - }; 710 - 711 - gpio@9 { 712 - reg = <9>; 713 - }; 714 - 715 - gpio@10 { 716 - reg = <10>; 717 - }; 718 - 719 - gpio@11 { 720 - reg = <11>; 721 - }; 722 - 723 - gpio@12 { 724 - reg = <12>; 725 - }; 726 - 727 - gpio@13 { 728 - reg = <13>; 729 - }; 730 - 731 - gpio@14 { 732 - reg = <14>; 733 - }; 734 - 735 - gpio@15 { 736 - reg = <15>; 737 - }; 738 - }; 739 - 740 - dps: dps310@76 { 741 - compatible = "infineon,dps310"; 742 - reg = <0x76>; 743 - #io-channel-cells = <0>; 744 - }; 745 - }; 746 - 747 - &i2c8 { 748 - status = "okay"; 749 - 750 - ucd90320@b { 751 - compatible = "ti,ucd90160"; 752 - reg = <0x0b>; 753 - }; 754 - 755 - ucd90320@c { 756 - compatible = "ti,ucd90160"; 757 - reg = <0x0c>; 758 - }; 759 - 760 - ucd90320@11 { 761 - compatible = "ti,ucd90160"; 762 - reg = <0x11>; 763 - }; 764 - 765 - rtc@32 { 766 - compatible = "epson,rx8900"; 767 - reg = <0x32>; 768 - }; 769 - 770 - tmp275@48 { 771 - compatible = "ti,tmp275"; 772 - reg = <0x48>; 773 - }; 774 - 775 - tmp275@4a { 776 - compatible = "ti,tmp275"; 777 - reg = <0x4a>; 778 - }; 779 - }; 780 - 781 - &i2c9 { 782 - status = "okay"; 783 - 784 - ir35221@42 { 785 - compatible = "infineon,ir35221"; 786 - reg = <0x42>; 787 - }; 788 - 789 - ir35221@43 { 790 - compatible = "infineon,ir35221"; 791 - reg = <0x43>; 792 - }; 793 - 794 - ir35221@44 { 795 - compatible = "infineon,ir35221"; 796 - reg = <0x44>; 797 - }; 798 - 799 - tmp423a@4c { 800 - compatible = "ti,tmp423"; 801 - reg = <0x4c>; 802 - }; 803 - 804 - tmp423b@4d { 805 - compatible = "ti,tmp423"; 806 - reg = <0x4d>; 807 - }; 808 - 809 - ir35221@72 { 810 - compatible = "infineon,ir35221"; 811 - reg = <0x72>; 812 - }; 813 - 814 - ir35221@73 { 815 - compatible = "infineon,ir35221"; 816 - reg = <0x73>; 817 - }; 818 - 819 - ir35221@74 { 820 - compatible = "infineon,ir35221"; 821 - reg = <0x74>; 822 - }; 823 - }; 824 - 825 - &i2c10 { 826 - status = "okay"; 827 - 828 - ir35221@42 { 829 - compatible = "infineon,ir35221"; 830 - reg = <0x42>; 831 - }; 832 - 833 - ir35221@43 { 834 - compatible = "infineon,ir35221"; 835 - reg = <0x43>; 836 - }; 837 - 838 - ir35221@44 { 839 - compatible = "infineon,ir35221"; 840 - reg = <0x44>; 841 - }; 842 - 843 - tmp423a@4c { 844 - compatible = "ti,tmp423"; 845 - reg = <0x4c>; 846 - }; 847 - 848 - tmp423b@4d { 849 - compatible = "ti,tmp423"; 850 - reg = <0x4d>; 851 - }; 852 - 853 - ir35221@72 { 854 - compatible = "infineon,ir35221"; 855 - reg = <0x72>; 856 - }; 857 - 858 - ir35221@73 { 859 - compatible = "infineon,ir35221"; 860 - reg = <0x73>; 861 - }; 862 - 863 - ir35221@74 { 864 - compatible = "infineon,ir35221"; 865 - reg = <0x74>; 866 - }; 867 - }; 868 - 869 - &i2c11 { 870 - status = "okay"; 871 - 872 - tmp275@48 { 873 - compatible = "ti,tmp275"; 874 - reg = <0x48>; 875 - }; 876 - 877 - tmp275@49 { 878 - compatible = "ti,tmp275"; 879 - reg = <0x49>; 880 515 }; 881 516 }; 882 517
+5 -398
arch/arm/boot/dts/aspeed-bmc-opp-tacoma.dts
··· 122 122 }; 123 123 }; 124 124 125 - &fmc { 126 - status = "okay"; 127 - flash@0 { 128 - status = "okay"; 129 - m25p,fast-read; 130 - label = "bmc"; 131 - spi-max-frequency = <50000000>; 132 - #include "openbmc-flash-layout-128.dtsi" 133 - }; 134 - 135 - flash@1 { 136 - status = "okay"; 137 - m25p,fast-read; 138 - label = "alt-bmc"; 139 - spi-max-frequency = <50000000>; 140 - }; 141 - }; 142 - 143 - &spi1 { 144 - status = "okay"; 145 - pinctrl-names = "default"; 146 - pinctrl-0 = <&pinctrl_spi1_default>; 147 - 148 - flash@0 { 149 - status = "okay"; 150 - m25p,fast-read; 151 - label = "pnor"; 152 - spi-max-frequency = <100000000>; 153 - }; 154 - }; 155 - 156 125 &mac2 { 157 126 status = "okay"; 158 127 pinctrl-names = "default"; ··· 134 165 135 166 &emmc { 136 167 status = "okay"; 168 + }; 169 + 170 + &fsim0 { 171 + status = "okay"; 172 + 137 173 #address-cells = <2>; 138 174 #size-cells = <0>; 139 175 ··· 791 817 }; 792 818 793 819 &wdt2 { 794 - status = "okay"; 795 - }; 796 - 797 - &i2c0 { 798 - status = "okay"; 799 - }; 800 - 801 - &i2c1 { 802 - status = "okay"; 803 - }; 804 - 805 - &i2c2 { 806 - status = "okay"; 807 - }; 808 - 809 - &i2c3 { 810 - status = "okay"; 811 - 812 - bmp: bmp280@77 { 813 - compatible = "bosch,bmp280"; 814 - reg = <0x77>; 815 - #io-channel-cells = <1>; 816 - }; 817 - 818 - max31785@52 { 819 - compatible = "maxim,max31785a"; 820 - reg = <0x52>; 821 - #address-cells = <1>; 822 - #size-cells = <0>; 823 - 824 - fan@0 { 825 - compatible = "pmbus-fan"; 826 - reg = <0>; 827 - tach-pulses = <2>; 828 - maxim,fan-rotor-input = "tach"; 829 - maxim,fan-pwm-freq = <25000>; 830 - maxim,fan-dual-tach; 831 - maxim,fan-no-watchdog; 832 - maxim,fan-no-fault-ramp; 833 - maxim,fan-ramp = <2>; 834 - maxim,fan-fault-pin-mon; 835 - }; 836 - 837 - fan@1 { 838 - compatible = "pmbus-fan"; 839 - reg = <1>; 840 - tach-pulses = <2>; 841 - maxim,fan-rotor-input = "tach"; 842 - maxim,fan-pwm-freq = <25000>; 843 - maxim,fan-dual-tach; 844 - maxim,fan-no-watchdog; 845 - maxim,fan-no-fault-ramp; 846 - maxim,fan-ramp = <2>; 847 - maxim,fan-fault-pin-mon; 848 - }; 849 - 850 - fan@2 { 851 - compatible = "pmbus-fan"; 852 - reg = <2>; 853 - tach-pulses = <2>; 854 - maxim,fan-rotor-input = "tach"; 855 - maxim,fan-pwm-freq = <25000>; 856 - maxim,fan-dual-tach; 857 - maxim,fan-no-watchdog; 858 - maxim,fan-no-fault-ramp; 859 - maxim,fan-ramp = <2>; 860 - maxim,fan-fault-pin-mon; 861 - }; 862 - 863 - fan@3 { 864 - compatible = "pmbus-fan"; 865 - reg = <3>; 866 - tach-pulses = <2>; 867 - maxim,fan-rotor-input = "tach"; 868 - maxim,fan-pwm-freq = <25000>; 869 - maxim,fan-dual-tach; 870 - maxim,fan-no-watchdog; 871 - maxim,fan-no-fault-ramp; 872 - maxim,fan-ramp = <2>; 873 - maxim,fan-fault-pin-mon; 874 - }; 875 - }; 876 - 877 - dps: dps310@76 { 878 - compatible = "infineon,dps310"; 879 - reg = <0x76>; 880 - #io-channel-cells = <0>; 881 - }; 882 - 883 - pca0: pca9552@60 { 884 - compatible = "nxp,pca9552"; 885 - reg = <0x60>; 886 - #address-cells = <1>; 887 - #size-cells = <0>; 888 - 889 - gpio-controller; 890 - #gpio-cells = <2>; 891 - 892 - gpio@0 { 893 - reg = <0>; 894 - type = <PCA955X_TYPE_GPIO>; 895 - }; 896 - 897 - gpio@1 { 898 - reg = <1>; 899 - type = <PCA955X_TYPE_GPIO>; 900 - }; 901 - 902 - gpio@2 { 903 - reg = <2>; 904 - type = <PCA955X_TYPE_GPIO>; 905 - }; 906 - 907 - gpio@3 { 908 - reg = <3>; 909 - type = <PCA955X_TYPE_GPIO>; 910 - }; 911 - 912 - gpio@4 { 913 - reg = <4>; 914 - type = <PCA955X_TYPE_GPIO>; 915 - }; 916 - 917 - gpio@5 { 918 - reg = <5>; 919 - type = <PCA955X_TYPE_GPIO>; 920 - }; 921 - 922 - gpio@6 { 923 - reg = <6>; 924 - type = <PCA955X_TYPE_GPIO>; 925 - }; 926 - 927 - gpio@7 { 928 - reg = <7>; 929 - type = <PCA955X_TYPE_GPIO>; 930 - }; 931 - 932 - gpio@8 { 933 - reg = <8>; 934 - type = <PCA955X_TYPE_GPIO>; 935 - }; 936 - 937 - gpio@9 { 938 - reg = <9>; 939 - type = <PCA955X_TYPE_GPIO>; 940 - }; 941 - 942 - gpio@10 { 943 - reg = <10>; 944 - type = <PCA955X_TYPE_GPIO>; 945 - }; 946 - 947 - gpio@11 { 948 - reg = <11>; 949 - type = <PCA955X_TYPE_GPIO>; 950 - }; 951 - 952 - gpio@12 { 953 - reg = <12>; 954 - type = <PCA955X_TYPE_GPIO>; 955 - }; 956 - 957 - gpio@13 { 958 - reg = <13>; 959 - type = <PCA955X_TYPE_GPIO>; 960 - }; 961 - 962 - gpio@14 { 963 - reg = <14>; 964 - type = <PCA955X_TYPE_GPIO>; 965 - }; 966 - 967 - gpio@15 { 968 - reg = <15>; 969 - type = <PCA955X_TYPE_GPIO>; 970 - }; 971 - }; 972 - 973 - power-supply@68 { 974 - compatible = "ibm,cffps1"; 975 - reg = <0x68>; 976 - }; 977 - 978 - power-supply@69 { 979 - compatible = "ibm,cffps1"; 980 - reg = <0x69>; 981 - }; 982 - }; 983 - 984 - &i2c4 { 985 - status = "okay"; 986 - 987 - tmp423a@4c { 988 - compatible = "ti,tmp423"; 989 - reg = <0x4c>; 990 - }; 991 - 992 - ir35221@70 { 993 - compatible = "infineon,ir35221"; 994 - reg = <0x70>; 995 - }; 996 - 997 - ir35221@71 { 998 - compatible = "infineon,ir35221"; 999 - reg = <0x71>; 1000 - }; 1001 - }; 1002 - 1003 - &i2c5 { 1004 - status = "okay"; 1005 - 1006 - tmp423a@4c { 1007 - compatible = "ti,tmp423"; 1008 - reg = <0x4c>; 1009 - }; 1010 - 1011 - ir35221@70 { 1012 - compatible = "infineon,ir35221"; 1013 - reg = <0x70>; 1014 - }; 1015 - 1016 - ir35221@71 { 1017 - compatible = "infineon,ir35221"; 1018 - reg = <0x71>; 1019 - }; 1020 - }; 1021 - 1022 - &i2c7 { 1023 - status = "okay"; 1024 - }; 1025 - 1026 - &i2c9 { 1027 - status = "okay"; 1028 - 1029 - tmp275@4a { 1030 - compatible = "ti,tmp275"; 1031 - reg = <0x4a>; 1032 - }; 1033 - }; 1034 - 1035 - &i2c10 { 1036 - status = "okay"; 1037 - }; 1038 - 1039 - &i2c11 { 1040 - status = "okay"; 1041 - 1042 - pca9552: pca9552@60 { 1043 - compatible = "nxp,pca9552"; 1044 - reg = <0x60>; 1045 - #address-cells = <1>; 1046 - #size-cells = <0>; 1047 - gpio-controller; 1048 - #gpio-cells = <2>; 1049 - 1050 - gpio-line-names = "PS_SMBUS_RESET_N", "APSS_RESET_N", 1051 - "GPU0_TH_OVERT_N_BUFF", "GPU1_TH_OVERT_N_BUFF", 1052 - "GPU2_TH_OVERT_N_BUFF", "GPU3_TH_OVERT_N_BUFF", 1053 - "GPU4_TH_OVERT_N_BUFF", "GPU5_TH_OVERT_N_BUFF", 1054 - "GPU0_PWR_GOOD_BUFF", "GPU1_PWR_GOOD_BUFF", 1055 - "GPU2_PWR_GOOD_BUFF", "GPU3_PWR_GOOD_BUFF", 1056 - "GPU4_PWR_GOOD_BUFF", "GPU5_PWR_GOOD_BUFF", 1057 - "12V_BREAKER_FLT_N", "THROTTLE_UNLATCHED_N"; 1058 - 1059 - gpio@0 { 1060 - reg = <0>; 1061 - type = <PCA955X_TYPE_GPIO>; 1062 - }; 1063 - 1064 - gpio@1 { 1065 - reg = <1>; 1066 - type = <PCA955X_TYPE_GPIO>; 1067 - }; 1068 - 1069 - gpio@2 { 1070 - reg = <2>; 1071 - type = <PCA955X_TYPE_GPIO>; 1072 - }; 1073 - 1074 - gpio@3 { 1075 - reg = <3>; 1076 - type = <PCA955X_TYPE_GPIO>; 1077 - }; 1078 - 1079 - gpio@4 { 1080 - reg = <4>; 1081 - type = <PCA955X_TYPE_GPIO>; 1082 - }; 1083 - 1084 - gpio@5 { 1085 - reg = <5>; 1086 - type = <PCA955X_TYPE_GPIO>; 1087 - }; 1088 - 1089 - gpio@6 { 1090 - reg = <6>; 1091 - type = <PCA955X_TYPE_GPIO>; 1092 - }; 1093 - 1094 - gpio@7 { 1095 - reg = <7>; 1096 - type = <PCA955X_TYPE_GPIO>; 1097 - }; 1098 - 1099 - gpio@8 { 1100 - reg = <8>; 1101 - type = <PCA955X_TYPE_GPIO>; 1102 - }; 1103 - 1104 - gpio@9 { 1105 - reg = <9>; 1106 - type = <PCA955X_TYPE_GPIO>; 1107 - }; 1108 - 1109 - gpio@10 { 1110 - reg = <10>; 1111 - type = <PCA955X_TYPE_GPIO>; 1112 - }; 1113 - 1114 - gpio@11 { 1115 - reg = <11>; 1116 - type = <PCA955X_TYPE_GPIO>; 1117 - }; 1118 - 1119 - gpio@12 { 1120 - reg = <12>; 1121 - type = <PCA955X_TYPE_GPIO>; 1122 - }; 1123 - 1124 - gpio@13 { 1125 - reg = <13>; 1126 - type = <PCA955X_TYPE_GPIO>; 1127 - }; 1128 - 1129 - gpio@14 { 1130 - reg = <14>; 1131 - type = <PCA955X_TYPE_GPIO>; 1132 - }; 1133 - 1134 - gpio@15 { 1135 - reg = <15>; 1136 - type = <PCA955X_TYPE_GPIO>; 1137 - }; 1138 - }; 1139 - 1140 - rtc@32 { 1141 - compatible = "epson,rx8900"; 1142 - reg = <0x32>; 1143 - }; 1144 - 1145 - eeprom@51 { 1146 - compatible = "atmel,24c64"; 1147 - reg = <0x51>; 1148 - }; 1149 - 1150 - ucd90160@64 { 1151 - compatible = "ti,ucd90160"; 1152 - reg = <0x64>; 1153 - }; 1154 - }; 1155 - 1156 - &i2c12 { 1157 - status = "okay"; 1158 - }; 1159 - 1160 - &i2c13 { 1161 820 status = "okay"; 1162 821 }; 1163 822
+19 -20
arch/arm/boot/dts/aspeed-g6.dtsi
··· 163 163 spi-max-frequency = <50000000>; 164 164 status = "disabled"; 165 165 }; 166 - 167 - fsim0: fsi@1e79b000 { 168 - compatible = "aspeed,ast2600-fsi-master", "fsi-master"; 169 - reg = <0x1e79b000 0x94>; 170 - interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>; 171 - pinctrl-names = "default"; 172 - pinctrl-0 = <&pinctrl_fsi1_default>; 173 - clocks = <&syscon ASPEED_CLK_GATE_FSICLK>; 174 - status = "disabled"; 175 - }; 176 - 177 - fsim1: fsi@1e79b100 { 178 - compatible = "aspeed,ast2600-fsi-master", "fsi-master"; 179 - reg = <0x1e79b100 0x94>; 180 - interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>; 181 - pinctrl-names = "default"; 182 - pinctrl-0 = <&pinctrl_fsi2_default>; 183 - clocks = <&syscon ASPEED_CLK_GATE_FSICLK>; 184 - status = "disabled"; 185 - }; 186 166 }; 187 167 188 168 mdio0: mdio@1e650000 { ··· 575 595 ranges = <0 0x1e78a000 0x1000>; 576 596 }; 577 597 598 + fsim0: fsi@1e79b000 { 599 + compatible = "aspeed,ast2600-fsi-master", "fsi-master"; 600 + reg = <0x1e79b000 0x94>; 601 + interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>; 602 + pinctrl-names = "default"; 603 + pinctrl-0 = <&pinctrl_fsi1_default>; 604 + clocks = <&syscon ASPEED_CLK_GATE_FSICLK>; 605 + status = "disabled"; 606 + }; 607 + 608 + fsim1: fsi@1e79b100 { 609 + compatible = "aspeed,ast2600-fsi-master", "fsi-master"; 610 + reg = <0x1e79b100 0x94>; 611 + interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>; 612 + pinctrl-names = "default"; 613 + pinctrl-0 = <&pinctrl_fsi2_default>; 614 + clocks = <&syscon ASPEED_CLK_GATE_FSICLK>; 615 + status = "disabled"; 616 + }; 578 617 }; 579 618 }; 580 619 };
+1 -1
arch/arm/boot/dts/imx6dl-icore-mipi.dts
··· 8 8 /dts-v1/; 9 9 10 10 #include "imx6dl.dtsi" 11 - #include "imx6qdl-icore.dtsi" 11 + #include "imx6qdl-icore-1.5.dtsi" 12 12 13 13 / { 14 14 model = "Engicam i.CoreM6 DualLite/Solo MIPI Starter Kit";
+1 -1
arch/arm/boot/dts/imx6q-dhcom-pdk2.dts
··· 63 63 #sound-dai-cells = <0>; 64 64 clocks = <&clk_ext_audio_codec>; 65 65 VDDA-supply = <&reg_3p3v>; 66 - VDDIO-supply = <&reg_3p3v>; 66 + VDDIO-supply = <&sw2_reg>; 67 67 }; 68 68 }; 69 69
+1 -1
arch/arm/boot/dts/imx6q-dhcom-som.dtsi
··· 204 204 }; 205 205 206 206 rtc@56 { 207 - compatible = "rv3029c2"; 207 + compatible = "microcrystal,rv3029"; 208 208 pinctrl-names = "default"; 209 209 pinctrl-0 = <&pinctrl_rtc_hw300>; 210 210 reg = <0x56>;
-4
arch/arm/boot/dts/imx6qdl-sabresd.dtsi
··· 749 749 vin-supply = <&vgen5_reg>; 750 750 }; 751 751 752 - &reg_vdd3p0 { 753 - vin-supply = <&sw2_reg>; 754 - }; 755 - 756 752 &reg_vdd2p5 { 757 753 vin-supply = <&vgen5_reg>; 758 754 };
-4
arch/arm/boot/dts/imx6sl-evk.dts
··· 584 584 vin-supply = <&sw2_reg>; 585 585 }; 586 586 587 - &reg_vdd3p0 { 588 - vin-supply = <&sw2_reg>; 589 - }; 590 - 591 587 &reg_vdd2p5 { 592 588 vin-supply = <&sw2_reg>; 593 589 };
-4
arch/arm/boot/dts/imx6sll-evk.dts
··· 265 265 status = "okay"; 266 266 }; 267 267 268 - &reg_3p0 { 269 - vin-supply = <&sw2_reg>; 270 - }; 271 - 272 268 &snvs_poweroff { 273 269 status = "okay"; 274 270 };
-4
arch/arm/boot/dts/imx6sx-sdb-reva.dts
··· 159 159 vin-supply = <&vgen6_reg>; 160 160 }; 161 161 162 - &reg_vdd3p0 { 163 - vin-supply = <&sw2_reg>; 164 - }; 165 - 166 162 &reg_vdd2p5 { 167 163 vin-supply = <&vgen6_reg>; 168 164 };
-4
arch/arm/boot/dts/imx6sx-sdb.dts
··· 141 141 vin-supply = <&vgen6_reg>; 142 142 }; 143 143 144 - &reg_vdd3p0 { 145 - vin-supply = <&sw2_reg>; 146 - }; 147 - 148 144 &reg_vdd2p5 { 149 145 vin-supply = <&vgen6_reg>; 150 146 };
+4
arch/arm/boot/dts/imx7s-colibri.dtsi
··· 49 49 reg = <0x80000000 0x10000000>; 50 50 }; 51 51 }; 52 + 53 + &gpmi { 54 + status = "okay"; 55 + };
+2 -2
arch/arm/boot/dts/imx7ulp.dtsi
··· 37 37 #address-cells = <1>; 38 38 #size-cells = <0>; 39 39 40 - cpu0: cpu@0 { 40 + cpu0: cpu@f00 { 41 41 compatible = "arm,cortex-a7"; 42 42 device_type = "cpu"; 43 - reg = <0>; 43 + reg = <0xf00>; 44 44 }; 45 45 }; 46 46
+1 -1
arch/arm/boot/dts/meson8.dtsi
··· 253 253 &aobus { 254 254 pmu: pmu@e0 { 255 255 compatible = "amlogic,meson8-pmu", "syscon"; 256 - reg = <0xe0 0x8>; 256 + reg = <0xe0 0x18>; 257 257 }; 258 258 259 259 pinctrl_aobus: pinctrl@84 {
+6 -6
arch/arm/boot/dts/mmp3.dtsi
··· 356 356 357 357 twsi1: i2c@d4011000 { 358 358 compatible = "mrvl,mmp-twsi"; 359 - reg = <0xd4011000 0x1000>; 359 + reg = <0xd4011000 0x70>; 360 360 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; 361 361 clocks = <&soc_clocks MMP2_CLK_TWSI0>; 362 362 resets = <&soc_clocks MMP2_CLK_TWSI0>; ··· 368 368 369 369 twsi2: i2c@d4031000 { 370 370 compatible = "mrvl,mmp-twsi"; 371 - reg = <0xd4031000 0x1000>; 371 + reg = <0xd4031000 0x70>; 372 372 interrupt-parent = <&twsi_mux>; 373 373 interrupts = <0>; 374 374 clocks = <&soc_clocks MMP2_CLK_TWSI1>; ··· 380 380 381 381 twsi3: i2c@d4032000 { 382 382 compatible = "mrvl,mmp-twsi"; 383 - reg = <0xd4032000 0x1000>; 383 + reg = <0xd4032000 0x70>; 384 384 interrupt-parent = <&twsi_mux>; 385 385 interrupts = <1>; 386 386 clocks = <&soc_clocks MMP2_CLK_TWSI2>; ··· 392 392 393 393 twsi4: i2c@d4033000 { 394 394 compatible = "mrvl,mmp-twsi"; 395 - reg = <0xd4033000 0x1000>; 395 + reg = <0xd4033000 0x70>; 396 396 interrupt-parent = <&twsi_mux>; 397 397 interrupts = <2>; 398 398 clocks = <&soc_clocks MMP2_CLK_TWSI3>; ··· 405 405 406 406 twsi5: i2c@d4033800 { 407 407 compatible = "mrvl,mmp-twsi"; 408 - reg = <0xd4033800 0x1000>; 408 + reg = <0xd4033800 0x70>; 409 409 interrupt-parent = <&twsi_mux>; 410 410 interrupts = <3>; 411 411 clocks = <&soc_clocks MMP2_CLK_TWSI4>; ··· 417 417 418 418 twsi6: i2c@d4034000 { 419 419 compatible = "mrvl,mmp-twsi"; 420 - reg = <0xd4034000 0x1000>; 420 + reg = <0xd4034000 0x70>; 421 421 interrupt-parent = <&twsi_mux>; 422 422 interrupts = <4>; 423 423 clocks = <&soc_clocks MMP2_CLK_TWSI5>;
+1 -1
arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts
··· 101 101 initial-mode = <1>; /* initialize in HUB mode */ 102 102 disabled-ports = <1>; 103 103 intn-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ 104 - reset-gpios = <&pio 4 16 GPIO_ACTIVE_HIGH>; /* PE16 */ 104 + reset-gpios = <&pio 4 16 GPIO_ACTIVE_LOW>; /* PE16 */ 105 105 connect-gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */ 106 106 refclk-frequency = <19200000>; 107 107 };
+1
arch/arm/mach-davinci/Kconfig
··· 9 9 select PM_GENERIC_DOMAINS if PM 10 10 select PM_GENERIC_DOMAINS_OF if PM && OF 11 11 select REGMAP_MMIO 12 + select RESET_CONTROLLER 12 13 select HAVE_IDE 13 14 select PINCTRL_SINGLE 14 15
+1 -1
arch/arm/mach-mmp/time.c
··· 207 207 ret = clk_prepare_enable(clk); 208 208 if (ret) 209 209 return ret; 210 - rate = clk_get_rate(clk) / 2; 210 + rate = clk_get_rate(clk); 211 211 } else if (cpu_is_pj4()) { 212 212 rate = 6500000; 213 213 } else {
+2 -1
arch/arm/mach-omap2/Kconfig
··· 95 95 bool 96 96 select ARCH_HAS_BANDGAP 97 97 select ARCH_HAS_HOLES_MEMORYMODEL 98 + select ARCH_HAS_RESET_CONTROLLER 98 99 select ARCH_OMAP 99 100 select CLKSRC_MMIO 100 101 select GENERIC_IRQ_CHIP ··· 106 105 select OMAP_DM_TIMER 107 106 select OMAP_GPMC 108 107 select PINCTRL 108 + select RESET_CONTROLLER 109 109 select SOC_BUS 110 110 select TI_SYSC 111 111 select OMAP_IRQCHIP 112 112 select CLKSRC_TI_32K 113 - select ARCH_HAS_RESET_CONTROLLER 114 113 help 115 114 Systems based on OMAP2, OMAP3, OMAP4 or OMAP5 116 115
+5 -1
arch/arm/mach-omap2/pdata-quirks.c
··· 306 306 307 307 static struct clockdomain *ti_sysc_find_one_clockdomain(struct clk *clk) 308 308 { 309 + struct clk_hw *hw = __clk_get_hw(clk); 309 310 struct clockdomain *clkdm = NULL; 310 311 struct clk_hw_omap *hwclk; 311 312 312 - hwclk = to_clk_hw_omap(__clk_get_hw(clk)); 313 + hwclk = to_clk_hw_omap(hw); 314 + if (!omap2_clk_is_hw_omap(hw)) 315 + return NULL; 316 + 313 317 if (hwclk && hwclk->clkdm_name) 314 318 clkdm = clkdm_lookup(hwclk->clkdm_name); 315 319
+1 -1
arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino-emmc.dts
··· 15 15 pinctrl-names = "default"; 16 16 pinctrl-0 = <&mmc2_pins>; 17 17 vmmc-supply = <&reg_dcdc1>; 18 - vqmmc-supply = <&reg_dcdc1>; 18 + vqmmc-supply = <&reg_eldo1>; 19 19 bus-width = <8>; 20 20 non-removable; 21 21 cap-mmc-hw-reset;
+1 -1
arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
··· 140 140 &mmc1 { 141 141 pinctrl-names = "default"; 142 142 pinctrl-0 = <&mmc1_pins>; 143 - vmmc-supply = <&reg_aldo2>; 143 + vmmc-supply = <&reg_dcdc1>; 144 144 vqmmc-supply = <&reg_dldo4>; 145 145 mmc-pwrseq = <&wifi_pwrseq>; 146 146 bus-width = <4>;
+4 -4
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
··· 61 61 62 62 pmu { 63 63 compatible = "arm,armv8-pmuv3"; 64 - interrupts = <0 120 8>, 65 - <0 121 8>, 66 - <0 122 8>, 67 - <0 123 8>; 64 + interrupts = <0 170 4>, 65 + <0 171 4>, 66 + <0 172 4>, 67 + <0 173 4>; 68 68 interrupt-affinity = <&cpu0>, 69 69 <&cpu1>, 70 70 <&cpu2>,
+26 -2
arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts
··· 46 46 }; 47 47 48 48 gpio-keys { 49 - compatible = "gpio-keys-polled"; 50 - poll-interval = <100>; 49 + compatible = "gpio-keys"; 51 50 52 51 key1 { 53 52 label = "A"; 54 53 linux,code = <BTN_0>; 55 54 gpios = <&gpio GPIOH_6 GPIO_ACTIVE_LOW>; 55 + interrupt-parent = <&gpio_intc>; 56 + interrupts = <34 IRQ_TYPE_EDGE_BOTH>; 56 57 }; 57 58 58 59 key2 { 59 60 label = "B"; 60 61 linux,code = <BTN_1>; 61 62 gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>; 63 + interrupt-parent = <&gpio_intc>; 64 + interrupts = <35 IRQ_TYPE_EDGE_BOTH>; 62 65 }; 63 66 64 67 key3 { 65 68 label = "C"; 66 69 linux,code = <BTN_2>; 67 70 gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>; 71 + interrupt-parent = <&gpio_intc>; 72 + interrupts = <2 IRQ_TYPE_EDGE_BOTH>; 73 + }; 74 + 75 + mic_mute { 76 + label = "MicMute"; 77 + linux,code = <SW_MUTE_DEVICE>; 78 + linux,input-type = <EV_SW>; 79 + gpios = <&gpio_ao GPIOE_2 GPIO_ACTIVE_LOW>; 80 + interrupt-parent = <&gpio_intc>; 81 + interrupts = <99 IRQ_TYPE_EDGE_BOTH>; 82 + }; 83 + 84 + power_key { 85 + label = "PowerKey"; 86 + linux,code = <KEY_POWER>; 87 + gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>; 88 + interrupt-parent = <&gpio_intc>; 89 + interrupts = <3 IRQ_TYPE_EDGE_BOTH>; 68 90 }; 69 91 }; 70 92 ··· 591 569 592 570 bluetooth { 593 571 compatible = "brcm,bcm43438-bt"; 572 + interrupt-parent = <&gpio_intc>; 573 + interrupts = <95 IRQ_TYPE_LEVEL_HIGH>; 594 574 shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; 595 575 max-speed = <2000000>; 596 576 clocks = <&wifi32k>;
+1 -1
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
··· 175 175 dcfg: syscon@1e00000 { 176 176 compatible = "fsl,ls1028a-dcfg", "syscon"; 177 177 reg = <0x0 0x1e00000 0x0 0x10000>; 178 - big-endian; 178 + little-endian; 179 179 }; 180 180 181 181 rst: syscon@1e60000 {
+1 -1
arch/arm64/boot/dts/freescale/imx8mm.dtsi
··· 740 740 reg = <0x30bd0000 0x10000>; 741 741 interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>; 742 742 clocks = <&clk IMX8MM_CLK_SDMA1_ROOT>, 743 - <&clk IMX8MM_CLK_SDMA1_ROOT>; 743 + <&clk IMX8MM_CLK_AHB>; 744 744 clock-names = "ipg", "ahb"; 745 745 #dma-cells = <3>; 746 746 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx7d.bin";
+1 -1
arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
··· 421 421 pinctrl-names = "default"; 422 422 pinctrl-0 = <&pinctrl_imu>; 423 423 interrupt-parent = <&gpio3>; 424 - interrupts = <19 IRQ_TYPE_LEVEL_LOW>; 424 + interrupts = <19 IRQ_TYPE_LEVEL_HIGH>; 425 425 vdd-supply = <&reg_3v3_p>; 426 426 vddio-supply = <&reg_3v3_p>; 427 427 };
+4 -4
arch/arm64/boot/dts/intel/socfpga_agilex.dtsi
··· 60 60 61 61 pmu { 62 62 compatible = "arm,armv8-pmuv3"; 63 - interrupts = <0 120 8>, 64 - <0 121 8>, 65 - <0 122 8>, 66 - <0 123 8>; 63 + interrupts = <0 170 4>, 64 + <0 171 4>, 65 + <0 172 4>, 66 + <0 173 4>; 67 67 interrupt-affinity = <&cpu0>, 68 68 <&cpu1>, 69 69 <&cpu2>,
+2 -1
arch/arm64/boot/dts/rockchip/rk3328-a1.dts
··· 49 49 50 50 ir-receiver { 51 51 compatible = "gpio-ir-receiver"; 52 - gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_HIGH>; 52 + gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_LOW>; 53 + linux,rc-map-name = "rc-beelink-gs1"; 53 54 }; 54 55 }; 55 56
+7 -4
arch/nds32/include/asm/cacheflush.h
··· 9 9 #define PG_dcache_dirty PG_arch_1 10 10 11 11 void flush_icache_range(unsigned long start, unsigned long end); 12 + #define flush_icache_range flush_icache_range 13 + 12 14 void flush_icache_page(struct vm_area_struct *vma, struct page *page); 15 + #define flush_icache_page flush_icache_page 16 + 13 17 #ifdef CONFIG_CPU_CACHE_ALIASING 14 18 void flush_cache_mm(struct mm_struct *mm); 15 19 void flush_cache_dup_mm(struct mm_struct *mm); ··· 44 40 #define flush_dcache_mmap_unlock(mapping) xa_unlock_irq(&(mapping)->i_pages) 45 41 46 42 #else 47 - #include <asm-generic/cacheflush.h> 48 - #undef flush_icache_range 49 - #undef flush_icache_page 50 - #undef flush_icache_user_range 51 43 void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, 52 44 unsigned long addr, int len); 45 + #define flush_icache_user_range flush_icache_user_range 46 + 47 + #include <asm-generic/cacheflush.h> 53 48 #endif 54 49 55 50 #endif /* __NDS32_CACHEFLUSH_H__ */
+1 -1
arch/nds32/include/asm/pgtable.h
··· 195 195 #define pte_unmap(pte) do { } while (0) 196 196 #define pte_unmap_nested(pte) do { } while (0) 197 197 198 - #define pmd_off_k(address) pmd_offset(pgd_offset_k(address), address) 198 + #define pmd_off_k(address) pmd_offset(pud_offset(p4d_offset(pgd_offset_k(address), (address)), (address)), (address)) 199 199 200 200 #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 201 201 /*
+2 -2
arch/parisc/kernel/drivers.c
··· 889 889 static int count; 890 890 891 891 print_pa_hwpath(dev, hw_path); 892 - pr_info("%d. %s at 0x%px [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }", 893 - ++count, dev->name, (void*) dev->hpa.start, hw_path, dev->id.hw_type, 892 + pr_info("%d. %s at %pap [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }", 893 + ++count, dev->name, &(dev->hpa.start), hw_path, dev->id.hw_type, 894 894 dev->id.hversion_rev, dev->id.hversion, dev->id.sversion); 895 895 896 896 if (dev->num_addrs) {
+1 -1
arch/parisc/mm/init.c
··· 401 401 pmd = (pmd_t *) __pa(pmd); 402 402 } 403 403 404 - pgd_populate(NULL, pg_dir, __va(pmd)); 404 + pud_populate(NULL, (pud_t *)pg_dir, __va(pmd)); 405 405 #endif 406 406 pg_dir++; 407 407
+4
arch/riscv/include/asm/asm-prototypes.h
··· 5 5 #include <linux/ftrace.h> 6 6 #include <asm-generic/asm-prototypes.h> 7 7 8 + long long __lshrti3(long long a, int b); 9 + long long __ashrti3(long long a, int b); 10 + long long __ashlti3(long long a, int b); 11 + 8 12 #endif /* _ASM_RISCV_PROTOTYPES_H */
+10 -6
arch/riscv/kernel/head.S
··· 80 80 81 81 #ifdef CONFIG_SMP 82 82 li t0, CONFIG_NR_CPUS 83 - bgeu a0, t0, .Lsecondary_park 83 + blt a0, t0, .Lgood_cores 84 + tail .Lsecondary_park 85 + .Lgood_cores: 84 86 #endif 85 87 86 88 /* Pick one hart to run the main boot sequence */ ··· 211 209 tail smp_callin 212 210 #endif 213 211 214 - .align 2 215 - .Lsecondary_park: 216 - /* We lack SMP support or have too many harts, so park this hart */ 217 - wfi 218 - j .Lsecondary_park 219 212 END(_start) 220 213 221 214 #ifdef CONFIG_RISCV_M_MODE ··· 291 294 ret 292 295 END(reset_regs) 293 296 #endif /* CONFIG_RISCV_M_MODE */ 297 + 298 + .section ".text", "ax",@progbits 299 + .align 2 300 + .Lsecondary_park: 301 + /* We lack SMP support or have too many harts, so park this hart */ 302 + wfi 303 + j .Lsecondary_park 294 304 295 305 __PAGE_ALIGNED_BSS 296 306 /* Empty zero page */
+2 -1
arch/riscv/kernel/vdso/Makefile
··· 58 58 cmd_vdsold = $(CC) $(KBUILD_CFLAGS) $(call cc-option, -no-pie) -nostdlib -nostartfiles $(SYSCFLAGS_$(@F)) \ 59 59 -Wl,-T,$(filter-out FORCE,$^) -o $@.tmp && \ 60 60 $(CROSS_COMPILE)objcopy \ 61 - $(patsubst %, -G __vdso_%, $(vdso-syms)) $@.tmp $@ 61 + $(patsubst %, -G __vdso_%, $(vdso-syms)) $@.tmp $@ && \ 62 + rm $@.tmp 62 63 63 64 # install commands for the unstripped file 64 65 quiet_cmd_vdso_install = INSTALL $@
+57 -18
arch/riscv/lib/tishift.S
··· 4 4 */ 5 5 6 6 #include <linux/linkage.h> 7 + #include <asm-generic/export.h> 7 8 8 - ENTRY(__lshrti3) 9 + SYM_FUNC_START(__lshrti3) 9 10 beqz a2, .L1 10 11 li a5,64 11 12 sub a5,a5,a2 12 - addi sp,sp,-16 13 13 sext.w a4,a5 14 14 blez a5, .L2 15 15 sext.w a2,a2 16 - sll a4,a1,a4 17 16 srl a0,a0,a2 18 - srl a1,a1,a2 17 + sll a4,a1,a4 18 + srl a2,a1,a2 19 19 or a0,a0,a4 20 - sd a1,8(sp) 21 - sd a0,0(sp) 22 - ld a0,0(sp) 23 - ld a1,8(sp) 24 - addi sp,sp,16 25 - ret 20 + mv a1,a2 26 21 .L1: 27 22 ret 28 23 .L2: 29 - negw a4,a4 30 - srl a1,a1,a4 31 - sd a1,0(sp) 32 - sd zero,8(sp) 33 - ld a0,0(sp) 34 - ld a1,8(sp) 35 - addi sp,sp,16 24 + negw a0,a4 25 + li a2,0 26 + srl a0,a1,a0 27 + mv a1,a2 36 28 ret 37 - ENDPROC(__lshrti3) 29 + SYM_FUNC_END(__lshrti3) 30 + EXPORT_SYMBOL(__lshrti3) 31 + 32 + SYM_FUNC_START(__ashrti3) 33 + beqz a2, .L3 34 + li a5,64 35 + sub a5,a5,a2 36 + sext.w a4,a5 37 + blez a5, .L4 38 + sext.w a2,a2 39 + srl a0,a0,a2 40 + sll a4,a1,a4 41 + sra a2,a1,a2 42 + or a0,a0,a4 43 + mv a1,a2 44 + .L3: 45 + ret 46 + .L4: 47 + negw a0,a4 48 + srai a2,a1,0x3f 49 + sra a0,a1,a0 50 + mv a1,a2 51 + ret 52 + SYM_FUNC_END(__ashrti3) 53 + EXPORT_SYMBOL(__ashrti3) 54 + 55 + SYM_FUNC_START(__ashlti3) 56 + beqz a2, .L5 57 + li a5,64 58 + sub a5,a5,a2 59 + sext.w a4,a5 60 + blez a5, .L6 61 + sext.w a2,a2 62 + sll a1,a1,a2 63 + srl a4,a0,a4 64 + sll a2,a0,a2 65 + or a1,a1,a4 66 + mv a0,a2 67 + .L5: 68 + ret 69 + .L6: 70 + negw a1,a4 71 + li a2,0 72 + sll a1,a0,a1 73 + mv a0,a2 74 + ret 75 + SYM_FUNC_END(__ashlti3) 76 + EXPORT_SYMBOL(__ashlti3)
+1 -1
arch/s390/kernel/setup.c
··· 1052 1052 1053 1053 if (!early_ipl_comp_list_addr) 1054 1054 return; 1055 - if (ipl_block.hdr.flags & IPL_PL_FLAG_IPLSR) 1055 + if (ipl_block.hdr.flags & IPL_PL_FLAG_SIPL) 1056 1056 pr_info("Linux is running with Secure-IPL enabled\n"); 1057 1057 else 1058 1058 pr_info("Linux is running with Secure-IPL disabled\n");
+5
arch/x86/boot/compressed/head_64.S
··· 244 244 leal efi32_config(%ebp), %eax 245 245 movl %eax, efi_config(%ebp) 246 246 247 + /* Disable paging */ 248 + movl %cr0, %eax 249 + btrl $X86_CR0_PG_BIT, %eax 250 + movl %eax, %cr0 251 + 247 252 jmp startup_32 248 253 SYM_FUNC_END(efi32_stub_entry) 249 254 #endif
+6
arch/x86/events/intel/uncore_snb.c
··· 15 15 #define PCI_DEVICE_ID_INTEL_SKL_HQ_IMC 0x1910 16 16 #define PCI_DEVICE_ID_INTEL_SKL_SD_IMC 0x190f 17 17 #define PCI_DEVICE_ID_INTEL_SKL_SQ_IMC 0x191f 18 + #define PCI_DEVICE_ID_INTEL_SKL_E3_IMC 0x1918 18 19 #define PCI_DEVICE_ID_INTEL_KBL_Y_IMC 0x590c 19 20 #define PCI_DEVICE_ID_INTEL_KBL_U_IMC 0x5904 20 21 #define PCI_DEVICE_ID_INTEL_KBL_UQ_IMC 0x5914 ··· 659 658 .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 660 659 }, 661 660 { /* IMC */ 661 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_E3_IMC), 662 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 663 + }, 664 + { /* IMC */ 662 665 PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBL_Y_IMC), 663 666 .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 664 667 }, ··· 831 826 IMC_DEV(SKL_HQ_IMC, &skl_uncore_pci_driver), /* 6th Gen Core H Quad Core */ 832 827 IMC_DEV(SKL_SD_IMC, &skl_uncore_pci_driver), /* 6th Gen Core S Dual Core */ 833 828 IMC_DEV(SKL_SQ_IMC, &skl_uncore_pci_driver), /* 6th Gen Core S Quad Core */ 829 + IMC_DEV(SKL_E3_IMC, &skl_uncore_pci_driver), /* Xeon E3 V5 Gen Core processor */ 834 830 IMC_DEV(KBL_Y_IMC, &skl_uncore_pci_driver), /* 7th Gen Core Y */ 835 831 IMC_DEV(KBL_U_IMC, &skl_uncore_pci_driver), /* 7th Gen Core U */ 836 832 IMC_DEV(KBL_UQ_IMC, &skl_uncore_pci_driver), /* 7th Gen Core U Quad Core */
+1 -24
arch/x86/events/intel/uncore_snbep.c
··· 369 369 #define SNR_M2M_PCI_PMON_BOX_CTL 0x438 370 370 #define SNR_M2M_PCI_PMON_UMASK_EXT 0xff 371 371 372 - /* SNR PCIE3 */ 373 - #define SNR_PCIE3_PCI_PMON_CTL0 0x508 374 - #define SNR_PCIE3_PCI_PMON_CTR0 0x4e8 375 - #define SNR_PCIE3_PCI_PMON_BOX_CTL 0x4e4 376 - 377 372 /* SNR IMC */ 378 373 #define SNR_IMC_MMIO_PMON_FIXED_CTL 0x54 379 374 #define SNR_IMC_MMIO_PMON_FIXED_CTR 0x38 ··· 4323 4328 .format_group = &snr_m2m_uncore_format_group, 4324 4329 }; 4325 4330 4326 - static struct intel_uncore_type snr_uncore_pcie3 = { 4327 - .name = "pcie3", 4328 - .num_counters = 4, 4329 - .num_boxes = 1, 4330 - .perf_ctr_bits = 48, 4331 - .perf_ctr = SNR_PCIE3_PCI_PMON_CTR0, 4332 - .event_ctl = SNR_PCIE3_PCI_PMON_CTL0, 4333 - .event_mask = SNBEP_PMON_RAW_EVENT_MASK, 4334 - .box_ctl = SNR_PCIE3_PCI_PMON_BOX_CTL, 4335 - .ops = &ivbep_uncore_pci_ops, 4336 - .format_group = &ivbep_uncore_format_group, 4337 - }; 4338 - 4339 4331 enum { 4340 4332 SNR_PCI_UNCORE_M2M, 4341 - SNR_PCI_UNCORE_PCIE3, 4342 4333 }; 4343 4334 4344 4335 static struct intel_uncore_type *snr_pci_uncores[] = { 4345 4336 [SNR_PCI_UNCORE_M2M] = &snr_uncore_m2m, 4346 - [SNR_PCI_UNCORE_PCIE3] = &snr_uncore_pcie3, 4347 4337 NULL, 4348 4338 }; 4349 4339 ··· 4336 4356 { /* M2M */ 4337 4357 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x344a), 4338 4358 .driver_data = UNCORE_PCI_DEV_FULL_DATA(12, 0, SNR_PCI_UNCORE_M2M, 0), 4339 - }, 4340 - { /* PCIe3 */ 4341 - PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x334a), 4342 - .driver_data = UNCORE_PCI_DEV_FULL_DATA(4, 0, SNR_PCI_UNCORE_PCIE3, 0), 4343 4359 }, 4344 4360 { /* end: all zeroes */ } 4345 4361 }; ··· 4512 4536 INTEL_UNCORE_EVENT_DESC(write, "event=0xff,umask=0x21"), 4513 4537 INTEL_UNCORE_EVENT_DESC(write.scale, "3.814697266e-6"), 4514 4538 INTEL_UNCORE_EVENT_DESC(write.unit, "MiB"), 4539 + { /* end: all zeroes */ }, 4515 4540 }; 4516 4541 4517 4542 static struct intel_uncore_ops snr_uncore_imc_freerunning_ops = {
+2 -2
arch/x86/kernel/cpu/amd.c
··· 615 615 return; 616 616 617 617 clear_all: 618 - clear_cpu_cap(c, X86_FEATURE_SME); 618 + setup_clear_cpu_cap(X86_FEATURE_SME); 619 619 clear_sev: 620 - clear_cpu_cap(c, X86_FEATURE_SEV); 620 + setup_clear_cpu_cap(X86_FEATURE_SEV); 621 621 } 622 622 } 623 623
+5 -4
arch/x86/kernel/cpu/mce/therm_throt.c
··· 467 467 { 468 468 struct thermal_state *state = &per_cpu(thermal_state, cpu); 469 469 struct device *dev = get_cpu_device(cpu); 470 + u32 l; 470 471 471 472 state->package_throttle.level = PACKAGE_LEVEL; 472 473 state->core_throttle.level = CORE_LEVEL; 473 474 474 475 INIT_DELAYED_WORK(&state->package_throttle.therm_work, throttle_active_work); 475 476 INIT_DELAYED_WORK(&state->core_throttle.therm_work, throttle_active_work); 477 + 478 + /* Unmask the thermal vector after the above workqueues are initialized. */ 479 + l = apic_read(APIC_LVTTHMR); 480 + apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED); 476 481 477 482 return thermal_throttle_add_dev(dev, cpu); 478 483 } ··· 726 721 727 722 rdmsr(MSR_IA32_MISC_ENABLE, l, h); 728 723 wrmsr(MSR_IA32_MISC_ENABLE, l | MSR_IA32_MISC_ENABLE_TM1, h); 729 - 730 - /* Unmask the thermal vector: */ 731 - l = apic_read(APIC_LVTTHMR); 732 - apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED); 733 724 734 725 pr_info_once("CPU0: Thermal monitoring enabled (%s)\n", 735 726 tm2 ? "TM2" : "TM1");
+1 -1
arch/x86/kernel/cpu/resctrl/core.c
··· 618 618 if (static_branch_unlikely(&rdt_mon_enable_key)) 619 619 rmdir_mondata_subdir_allrdtgrp(r, d->id); 620 620 list_del(&d->list); 621 - if (is_mbm_enabled()) 621 + if (r->mon_capable && is_mbm_enabled()) 622 622 cancel_delayed_work(&d->mbm_over); 623 623 if (is_llc_occupancy_enabled() && has_busy_rmid(r, d)) { 624 624 /*
+3 -3
arch/x86/kernel/cpu/resctrl/rdtgroup.c
··· 1741 1741 struct rdt_domain *d; 1742 1742 int cpu; 1743 1743 1744 - if (!zalloc_cpumask_var(&cpu_mask, GFP_KERNEL)) 1745 - return -ENOMEM; 1746 - 1747 1744 if (level == RDT_RESOURCE_L3) 1748 1745 update = l3_qos_cfg_update; 1749 1746 else if (level == RDT_RESOURCE_L2) 1750 1747 update = l2_qos_cfg_update; 1751 1748 else 1752 1749 return -EINVAL; 1750 + 1751 + if (!zalloc_cpumask_var(&cpu_mask, GFP_KERNEL)) 1752 + return -ENOMEM; 1753 1753 1754 1754 r_l = &rdt_resources_all[level]; 1755 1755 list_for_each_entry(d, &r_l->domains, list) {
+7 -2
block/blk-merge.c
··· 164 164 unsigned long mask = queue_segment_boundary(q); 165 165 166 166 offset = mask & (page_to_phys(start_page) + offset); 167 - return min_t(unsigned long, mask - offset + 1, 168 - queue_max_segment_size(q)); 167 + 168 + /* 169 + * overflow may be triggered in case of zero page physical address 170 + * on 32bit arch, use queue's max segment size when that happens. 171 + */ 172 + return min_not_zero(mask - offset + 1, 173 + (unsigned long)queue_max_segment_size(q)); 169 174 } 170 175 171 176 /**
+1 -1
block/blk-settings.c
··· 328 328 * storage device can address. The default of 512 covers most 329 329 * hardware. 330 330 **/ 331 - void blk_queue_logical_block_size(struct request_queue *q, unsigned short size) 331 + void blk_queue_logical_block_size(struct request_queue *q, unsigned int size) 332 332 { 333 333 q->limits.logical_block_size = size; 334 334
+1 -1
drivers/base/firmware_loader/builtin/Makefile
··· 17 17 filechk_fwbin = \ 18 18 echo "/* Generated by $(src)/Makefile */" ;\ 19 19 echo " .section .rodata" ;\ 20 - echo " .p2align $(ASM_ALIGN)" ;\ 20 + echo " .p2align 4" ;\ 21 21 echo "_fw_$(FWSTR)_bin:" ;\ 22 22 echo " .incbin \"$(fwdir)/$(FWNAME)\"" ;\ 23 23 echo "_fw_end:" ;\
+3 -1
drivers/block/null_blk_zoned.c
··· 129 129 return BLK_STS_IOERR; 130 130 case BLK_ZONE_COND_EMPTY: 131 131 case BLK_ZONE_COND_IMP_OPEN: 132 + case BLK_ZONE_COND_EXP_OPEN: 133 + case BLK_ZONE_COND_CLOSED: 132 134 /* Writes must be at the write pointer position */ 133 135 if (sector != zone->wp) 134 136 return BLK_STS_IOERR; 135 137 136 - if (zone->cond == BLK_ZONE_COND_EMPTY) 138 + if (zone->cond != BLK_ZONE_COND_EXP_OPEN) 137 139 zone->cond = BLK_ZONE_COND_IMP_OPEN; 138 140 139 141 zone->wp += nr_sectors;
+8 -2
drivers/bus/ti-sysc.c
··· 343 343 return -EINVAL; 344 344 } 345 345 346 + /* Always add a slot for main clocks fck and ick even if unused */ 347 + if (!nr_fck) 348 + ddata->nr_clocks++; 349 + if (!nr_ick) 350 + ddata->nr_clocks++; 351 + 346 352 ddata->clocks = devm_kcalloc(ddata->dev, 347 353 ddata->nr_clocks, sizeof(*ddata->clocks), 348 354 GFP_KERNEL); ··· 427 421 struct clk *clock; 428 422 int i, error; 429 423 430 - if (!ddata->clocks) 424 + if (!ddata->clocks || ddata->nr_clocks < SYSC_OPTFCK0 + 1) 431 425 return 0; 432 426 433 427 for (i = SYSC_OPTFCK0; i < SYSC_MAX_CLOCKS; i++) { ··· 461 455 struct clk *clock; 462 456 int i; 463 457 464 - if (!ddata->clocks) 458 + if (!ddata->clocks || ddata->nr_clocks < SYSC_OPTFCK0 + 1) 465 459 return; 466 460 467 461 for (i = SYSC_OPTFCK0; i < SYSC_MAX_CLOCKS; i++) {
+8 -2
drivers/clk/clk.c
··· 3426 3426 if (core->flags & CLK_IS_CRITICAL) { 3427 3427 unsigned long flags; 3428 3428 3429 - clk_core_prepare(core); 3429 + ret = clk_core_prepare(core); 3430 + if (ret) 3431 + goto out; 3430 3432 3431 3433 flags = clk_enable_lock(); 3432 - clk_core_enable(core); 3434 + ret = clk_core_enable(core); 3433 3435 clk_enable_unlock(flags); 3436 + if (ret) { 3437 + clk_core_unprepare(core); 3438 + goto out; 3439 + } 3434 3440 } 3435 3441 3436 3442 clk_core_reparent_orphans_nolock();
+1 -1
drivers/clk/mmp/clk-of-mmp2.c
··· 134 134 static const char *ssp_parent_names[] = {"vctcxo_4", "vctcxo_2", "vctcxo", "pll1_16"}; 135 135 136 136 static DEFINE_SPINLOCK(timer_lock); 137 - static const char *timer_parent_names[] = {"clk32", "vctcxo_2", "vctcxo_4", "vctcxo"}; 137 + static const char *timer_parent_names[] = {"clk32", "vctcxo_4", "vctcxo_2", "vctcxo"}; 138 138 139 139 static DEFINE_SPINLOCK(reset_lock); 140 140
+7
drivers/clk/qcom/gcc-sdm845.c
··· 3255 3255 .name = "hlos1_vote_aggre_noc_mmu_audio_tbu_gdsc", 3256 3256 }, 3257 3257 .pwrsts = PWRSTS_OFF_ON, 3258 + .flags = VOTABLE, 3258 3259 }; 3259 3260 3260 3261 static struct gdsc hlos1_vote_aggre_noc_mmu_pcie_tbu_gdsc = { ··· 3264 3263 .name = "hlos1_vote_aggre_noc_mmu_pcie_tbu_gdsc", 3265 3264 }, 3266 3265 .pwrsts = PWRSTS_OFF_ON, 3266 + .flags = VOTABLE, 3267 3267 }; 3268 3268 3269 3269 static struct gdsc hlos1_vote_aggre_noc_mmu_tbu1_gdsc = { ··· 3273 3271 .name = "hlos1_vote_aggre_noc_mmu_tbu1_gdsc", 3274 3272 }, 3275 3273 .pwrsts = PWRSTS_OFF_ON, 3274 + .flags = VOTABLE, 3276 3275 }; 3277 3276 3278 3277 static struct gdsc hlos1_vote_aggre_noc_mmu_tbu2_gdsc = { ··· 3282 3279 .name = "hlos1_vote_aggre_noc_mmu_tbu2_gdsc", 3283 3280 }, 3284 3281 .pwrsts = PWRSTS_OFF_ON, 3282 + .flags = VOTABLE, 3285 3283 }; 3286 3284 3287 3285 static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc = { ··· 3291 3287 .name = "hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc", 3292 3288 }, 3293 3289 .pwrsts = PWRSTS_OFF_ON, 3290 + .flags = VOTABLE, 3294 3291 }; 3295 3292 3296 3293 static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc = { ··· 3300 3295 .name = "hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc", 3301 3296 }, 3302 3297 .pwrsts = PWRSTS_OFF_ON, 3298 + .flags = VOTABLE, 3303 3299 }; 3304 3300 3305 3301 static struct gdsc hlos1_vote_mmnoc_mmu_tbu_sf_gdsc = { ··· 3309 3303 .name = "hlos1_vote_mmnoc_mmu_tbu_sf_gdsc", 3310 3304 }, 3311 3305 .pwrsts = PWRSTS_OFF_ON, 3306 + .flags = VOTABLE, 3312 3307 }; 3313 3308 3314 3309 static struct clk_regmap *gcc_sdm845_clocks[] = {
+8
drivers/clk/samsung/clk-exynos5420.c
··· 12 12 #include <linux/clk-provider.h> 13 13 #include <linux/of.h> 14 14 #include <linux/of_address.h> 15 + #include <linux/clk.h> 15 16 16 17 #include "clk.h" 17 18 #include "clk-cpu.h" ··· 1646 1645 exynos5_subcmus_init(ctx, ARRAY_SIZE(exynos5x_subcmus), 1647 1646 exynos5x_subcmus); 1648 1647 } 1648 + 1649 + /* 1650 + * Keep top part of G3D clock path enabled permanently to ensure 1651 + * that the internal busses get their clock regardless of the 1652 + * main G3D clock enablement status. 1653 + */ 1654 + clk_prepare_enable(__clk_lookup("mout_sw_aclk_g3d")); 1649 1655 1650 1656 samsung_clk_of_add_provider(np, ctx); 1651 1657 }
+3 -13
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c
··· 23 23 */ 24 24 25 25 static const char * const ar100_r_apb2_parents[] = { "osc24M", "osc32k", 26 - "pll-periph0", "iosc" }; 26 + "iosc", "pll-periph0" }; 27 27 static const struct ccu_mux_var_prediv ar100_r_apb2_predivs[] = { 28 - { .index = 2, .shift = 0, .width = 5 }, 28 + { .index = 3, .shift = 0, .width = 5 }, 29 29 }; 30 30 31 31 static struct ccu_div ar100_clk = { ··· 51 51 52 52 static CLK_FIXED_FACTOR_HW(r_ahb_clk, "r-ahb", &ar100_clk.common.hw, 1, 1, 0); 53 53 54 - static struct ccu_div r_apb1_clk = { 55 - .div = _SUNXI_CCU_DIV(0, 2), 56 - 57 - .common = { 58 - .reg = 0x00c, 59 - .hw.init = CLK_HW_INIT("r-apb1", 60 - "r-ahb", 61 - &ccu_div_ops, 62 - 0), 63 - }, 64 - }; 54 + static SUNXI_CCU_M(r_apb1_clk, "r-apb1", "r-ahb", 0x00c, 0, 2, 0); 65 55 66 56 static struct ccu_div r_apb2_clk = { 67 57 .div = _SUNXI_CCU_DIV_FLAGS(8, 2, CLK_DIVIDER_POWER_OF_TWO),
+3 -18
drivers/clk/sunxi-ng/ccu-sun8i-r.c
··· 51 51 52 52 static CLK_FIXED_FACTOR_HW(ahb0_clk, "ahb0", &ar100_clk.common.hw, 1, 1, 0); 53 53 54 - static struct ccu_div apb0_clk = { 55 - .div = _SUNXI_CCU_DIV_FLAGS(0, 2, CLK_DIVIDER_POWER_OF_TWO), 56 - 57 - .common = { 58 - .reg = 0x0c, 59 - .hw.init = CLK_HW_INIT_HW("apb0", 60 - &ahb0_clk.hw, 61 - &ccu_div_ops, 62 - 0), 63 - }, 64 - }; 65 - 66 - static SUNXI_CCU_M(a83t_apb0_clk, "apb0", "ahb0", 0x0c, 0, 2, 0); 54 + static SUNXI_CCU_M(apb0_clk, "apb0", "ahb0", 0x0c, 0, 2, 0); 67 55 68 56 /* 69 57 * Define the parent as an array that can be reused to save space ··· 115 127 116 128 static struct ccu_common *sun8i_a83t_r_ccu_clks[] = { 117 129 &ar100_clk.common, 118 - &a83t_apb0_clk.common, 130 + &apb0_clk.common, 119 131 &apb0_pio_clk.common, 120 132 &apb0_ir_clk.common, 121 133 &apb0_timer_clk.common, ··· 155 167 .hws = { 156 168 [CLK_AR100] = &ar100_clk.common.hw, 157 169 [CLK_AHB0] = &ahb0_clk.hw, 158 - [CLK_APB0] = &a83t_apb0_clk.common.hw, 170 + [CLK_APB0] = &apb0_clk.common.hw, 159 171 [CLK_APB0_PIO] = &apb0_pio_clk.common.hw, 160 172 [CLK_APB0_IR] = &apb0_ir_clk.common.hw, 161 173 [CLK_APB0_TIMER] = &apb0_timer_clk.common.hw, ··· 270 282 271 283 static void __init sun8i_a83t_r_ccu_setup(struct device_node *node) 272 284 { 273 - /* Fix apb0 bus gate parents here */ 274 - apb0_gate_parent[0] = &a83t_apb0_clk.common.hw; 275 - 276 285 sunxi_r_ccu_init(node, &sun8i_a83t_r_ccu_desc); 277 286 } 278 287 CLK_OF_DECLARE(sun8i_a83t_r_ccu, "allwinner,sun8i-a83t-r-ccu",
+4 -2
drivers/clk/sunxi-ng/ccu-sun8i-r40.c
··· 761 761 .reg = 0x1f0, 762 762 .features = CCU_FEATURE_FIXED_PREDIV, 763 763 .hw.init = CLK_HW_INIT_PARENTS("outa", out_parents, 764 - &ccu_mp_ops, 0), 764 + &ccu_mp_ops, 765 + CLK_SET_RATE_PARENT), 765 766 } 766 767 }; 767 768 ··· 780 779 .reg = 0x1f4, 781 780 .features = CCU_FEATURE_FIXED_PREDIV, 782 781 .hw.init = CLK_HW_INIT_PARENTS("outb", out_parents, 783 - &ccu_mp_ops, 0), 782 + &ccu_mp_ops, 783 + CLK_SET_RATE_PARENT), 784 784 } 785 785 }; 786 786
+2 -2
drivers/clk/sunxi-ng/ccu-sun8i-v3s.c
··· 618 618 [CLK_MBUS] = &mbus_clk.common.hw, 619 619 [CLK_MIPI_CSI] = &mipi_csi_clk.common.hw, 620 620 }, 621 - .num = CLK_NUMBER, 621 + .num = CLK_PLL_DDR1 + 1, 622 622 }; 623 623 624 624 static struct clk_hw_onecell_data sun8i_v3_hw_clks = { ··· 700 700 [CLK_MBUS] = &mbus_clk.common.hw, 701 701 [CLK_MIPI_CSI] = &mipi_csi_clk.common.hw, 702 702 }, 703 - .num = CLK_NUMBER, 703 + .num = CLK_I2S0 + 1, 704 704 }; 705 705 706 706 static struct ccu_reset_map sun8i_v3s_ccu_resets[] = {
-2
drivers/clk/sunxi-ng/ccu-sun8i-v3s.h
··· 51 51 52 52 #define CLK_PLL_DDR1 74 53 53 54 - #define CLK_NUMBER (CLK_I2S0 + 1) 55 - 56 54 #endif /* _CCU_SUN8I_H3_H_ */
+3 -1
drivers/clk/tegra/clk.c
··· 231 231 periph_banks = banks; 232 232 233 233 clks = kcalloc(num, sizeof(struct clk *), GFP_KERNEL); 234 - if (!clks) 234 + if (!clks) { 235 235 kfree(periph_clk_enb_refcnt); 236 + return NULL; 237 + } 236 238 237 239 clk_num = num; 238 240
-1
drivers/clk/ti/clk-dra7-atl.c
··· 233 233 cinfo->iobase = of_iomap(node, 0); 234 234 cinfo->dev = &pdev->dev; 235 235 pm_runtime_enable(cinfo->dev); 236 - pm_runtime_irq_safe(cinfo->dev); 237 236 238 237 pm_runtime_get_sync(cinfo->dev); 239 238 atl_write(cinfo, DRA7_ATL_PCLKMUX_REG(0), DRA7_ATL_PCLKMUX);
+1 -1
drivers/cpuidle/governors/teo.c
··· 198 198 * pattern detection. 199 199 */ 200 200 cpu_data->intervals[cpu_data->interval_idx++] = measured_ns; 201 - if (cpu_data->interval_idx > INTERVALS) 201 + if (cpu_data->interval_idx >= INTERVALS) 202 202 cpu_data->interval_idx = 0; 203 203 } 204 204
+3 -3
drivers/crypto/hisilicon/sec2/sec.h
··· 40 40 int req_id; 41 41 42 42 /* Status of the SEC request */ 43 - int fake_busy; 43 + atomic_t fake_busy; 44 44 }; 45 45 46 46 /** ··· 132 132 }; 133 133 134 134 struct sec_dfx { 135 - u64 send_cnt; 136 - u64 recv_cnt; 135 + atomic64_t send_cnt; 136 + atomic64_t recv_cnt; 137 137 }; 138 138 139 139 struct sec_debug {
+6 -6
drivers/crypto/hisilicon/sec2/sec_crypto.c
··· 120 120 return; 121 121 } 122 122 123 - __sync_add_and_fetch(&req->ctx->sec->debug.dfx.recv_cnt, 1); 123 + atomic64_inc(&req->ctx->sec->debug.dfx.recv_cnt); 124 124 125 125 req->ctx->req_op->buf_unmap(req->ctx, req); 126 126 ··· 135 135 mutex_lock(&qp_ctx->req_lock); 136 136 ret = hisi_qp_send(qp_ctx->qp, &req->sec_sqe); 137 137 mutex_unlock(&qp_ctx->req_lock); 138 - __sync_add_and_fetch(&ctx->sec->debug.dfx.send_cnt, 1); 138 + atomic64_inc(&ctx->sec->debug.dfx.send_cnt); 139 139 140 140 if (ret == -EBUSY) 141 141 return -ENOBUFS; 142 142 143 143 if (!ret) { 144 - if (req->fake_busy) 144 + if (atomic_read(&req->fake_busy)) 145 145 ret = -EBUSY; 146 146 else 147 147 ret = -EINPROGRESS; ··· 641 641 if (ctx->c_ctx.c_mode == SEC_CMODE_CBC && req->c_req.encrypt) 642 642 sec_update_iv(req); 643 643 644 - if (__sync_bool_compare_and_swap(&req->fake_busy, 1, 0)) 644 + if (atomic_cmpxchg(&req->fake_busy, 1, 0) != 1) 645 645 sk_req->base.complete(&sk_req->base, -EINPROGRESS); 646 646 647 647 sk_req->base.complete(&sk_req->base, req->err_type); ··· 672 672 } 673 673 674 674 if (ctx->fake_req_limit <= atomic_inc_return(&qp_ctx->pending_reqs)) 675 - req->fake_busy = 1; 675 + atomic_set(&req->fake_busy, 1); 676 676 else 677 - req->fake_busy = 0; 677 + atomic_set(&req->fake_busy, 0); 678 678 679 679 ret = ctx->req_op->get_res(ctx, req); 680 680 if (ret) {
+12 -2
drivers/crypto/hisilicon/sec2/sec_main.c
··· 608 608 .write = sec_debug_write, 609 609 }; 610 610 611 + static int debugfs_atomic64_t_get(void *data, u64 *val) 612 + { 613 + *val = atomic64_read((atomic64_t *)data); 614 + return 0; 615 + } 616 + DEFINE_DEBUGFS_ATTRIBUTE(fops_atomic64_t_ro, debugfs_atomic64_t_get, NULL, 617 + "%lld\n"); 618 + 611 619 static int sec_core_debug_init(struct sec_dev *sec) 612 620 { 613 621 struct hisi_qm *qm = &sec->qm; ··· 636 628 637 629 debugfs_create_regset32("regs", 0444, tmp_d, regset); 638 630 639 - debugfs_create_u64("send_cnt", 0444, tmp_d, &dfx->send_cnt); 631 + debugfs_create_file("send_cnt", 0444, tmp_d, &dfx->send_cnt, 632 + &fops_atomic64_t_ro); 640 633 641 - debugfs_create_u64("recv_cnt", 0444, tmp_d, &dfx->recv_cnt); 634 + debugfs_create_file("recv_cnt", 0444, tmp_d, &dfx->recv_cnt, 635 + &fops_atomic64_t_ro); 642 636 643 637 return 0; 644 638 }
+7 -9
drivers/firmware/efi/earlycon.c
··· 17 17 static const struct font_desc *font; 18 18 static u32 efi_x, efi_y; 19 19 static u64 fb_base; 20 - static pgprot_t fb_prot; 20 + static bool fb_wb; 21 21 static void *efi_fb; 22 22 23 23 /* ··· 33 33 if (!earlycon_console || !(earlycon_console->flags & CON_ENABLED)) 34 34 return 0; 35 35 36 - if (pgprot_val(fb_prot) == pgprot_val(PAGE_KERNEL)) 37 - efi_fb = memremap(fb_base, screen_info.lfb_size, MEMREMAP_WB); 38 - else 39 - efi_fb = memremap(fb_base, screen_info.lfb_size, MEMREMAP_WC); 36 + efi_fb = memremap(fb_base, screen_info.lfb_size, 37 + fb_wb ? MEMREMAP_WB : MEMREMAP_WC); 40 38 41 39 return efi_fb ? 0 : -ENOMEM; 42 40 } ··· 51 53 52 54 static __ref void *efi_earlycon_map(unsigned long start, unsigned long len) 53 55 { 56 + pgprot_t fb_prot; 57 + 54 58 if (efi_fb) 55 59 return efi_fb + start; 56 60 61 + fb_prot = fb_wb ? PAGE_KERNEL : pgprot_writecombine(PAGE_KERNEL); 57 62 return early_memremap_prot(fb_base + start, len, pgprot_val(fb_prot)); 58 63 } 59 64 ··· 216 215 if (screen_info.capabilities & VIDEO_CAPABILITY_64BIT_BASE) 217 216 fb_base |= (u64)screen_info.ext_lfb_base << 32; 218 217 219 - if (opt && !strcmp(opt, "ram")) 220 - fb_prot = PAGE_KERNEL; 221 - else 222 - fb_prot = pgprot_writecombine(PAGE_KERNEL); 218 + fb_wb = opt && !strcmp(opt, "ram"); 223 219 224 220 si = &screen_info; 225 221 xres = si->lfb_width;
+3 -3
drivers/firmware/efi/libstub/random.c
··· 33 33 { 34 34 efi_guid_t rng_proto = EFI_RNG_PROTOCOL_GUID; 35 35 efi_status_t status; 36 - struct efi_rng_protocol *rng; 36 + struct efi_rng_protocol *rng = NULL; 37 37 38 38 status = efi_call_early(locate_protocol, &rng_proto, NULL, 39 39 (void **)&rng); ··· 162 162 efi_guid_t rng_proto = EFI_RNG_PROTOCOL_GUID; 163 163 efi_guid_t rng_algo_raw = EFI_RNG_ALGORITHM_RAW; 164 164 efi_guid_t rng_table_guid = LINUX_EFI_RANDOM_SEED_TABLE_GUID; 165 - struct efi_rng_protocol *rng; 166 - struct linux_efi_random_seed *seed; 165 + struct efi_rng_protocol *rng = NULL; 166 + struct linux_efi_random_seed *seed = NULL; 167 167 efi_status_t status; 168 168 169 169 status = efi_call_early(locate_protocol, &rng_proto, NULL,
-1
drivers/gpio/Kconfig
··· 573 573 tristate "Cavium ThunderX/OCTEON-TX GPIO" 574 574 depends on ARCH_THUNDER || (64BIT && COMPILE_TEST) 575 575 depends on PCI_MSI 576 - select GPIOLIB_IRQCHIP 577 576 select IRQ_DOMAIN_HIERARCHY 578 577 select IRQ_FASTEOI_HIERARCHY_HANDLERS 579 578 help
+106 -55
drivers/gpio/gpio-thunderx.c
··· 53 53 struct thunderx_gpio { 54 54 struct gpio_chip chip; 55 55 u8 __iomem *register_base; 56 + struct irq_domain *irqd; 56 57 struct msix_entry *msix_entries; /* per line MSI-X */ 57 58 struct thunderx_line *line_entries; /* per line irq info */ 58 59 raw_spinlock_t lock; ··· 286 285 } 287 286 } 288 287 289 - static void thunderx_gpio_irq_ack(struct irq_data *d) 288 + static void thunderx_gpio_irq_ack(struct irq_data *data) 290 289 { 291 - struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 292 - struct thunderx_gpio *txgpio = gpiochip_get_data(gc); 290 + struct thunderx_line *txline = irq_data_get_irq_chip_data(data); 293 291 294 292 writeq(GPIO_INTR_INTR, 295 - txgpio->register_base + intr_reg(irqd_to_hwirq(d))); 293 + txline->txgpio->register_base + intr_reg(txline->line)); 296 294 } 297 295 298 - static void thunderx_gpio_irq_mask(struct irq_data *d) 296 + static void thunderx_gpio_irq_mask(struct irq_data *data) 299 297 { 300 - struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 301 - struct thunderx_gpio *txgpio = gpiochip_get_data(gc); 298 + struct thunderx_line *txline = irq_data_get_irq_chip_data(data); 302 299 303 300 writeq(GPIO_INTR_ENA_W1C, 304 - txgpio->register_base + intr_reg(irqd_to_hwirq(d))); 301 + txline->txgpio->register_base + intr_reg(txline->line)); 305 302 } 306 303 307 - static void thunderx_gpio_irq_mask_ack(struct irq_data *d) 304 + static void thunderx_gpio_irq_mask_ack(struct irq_data *data) 308 305 { 309 - struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 310 - struct thunderx_gpio *txgpio = gpiochip_get_data(gc); 306 + struct thunderx_line *txline = irq_data_get_irq_chip_data(data); 311 307 312 308 writeq(GPIO_INTR_ENA_W1C | GPIO_INTR_INTR, 313 - txgpio->register_base + intr_reg(irqd_to_hwirq(d))); 309 + txline->txgpio->register_base + intr_reg(txline->line)); 314 310 } 315 311 316 - static void thunderx_gpio_irq_unmask(struct irq_data *d) 312 + static void thunderx_gpio_irq_unmask(struct irq_data *data) 317 313 { 318 - struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 319 - struct thunderx_gpio *txgpio = gpiochip_get_data(gc); 314 + struct thunderx_line *txline = irq_data_get_irq_chip_data(data); 320 315 321 316 writeq(GPIO_INTR_ENA_W1S, 322 - txgpio->register_base + intr_reg(irqd_to_hwirq(d))); 317 + txline->txgpio->register_base + intr_reg(txline->line)); 323 318 } 324 319 325 - static int thunderx_gpio_irq_set_type(struct irq_data *d, 320 + static int thunderx_gpio_irq_set_type(struct irq_data *data, 326 321 unsigned int flow_type) 327 322 { 328 - struct gpio_chip *gc = irq_data_get_irq_chip_data(d); 329 - struct thunderx_gpio *txgpio = gpiochip_get_data(gc); 330 - struct thunderx_line *txline = 331 - &txgpio->line_entries[irqd_to_hwirq(d)]; 323 + struct thunderx_line *txline = irq_data_get_irq_chip_data(data); 324 + struct thunderx_gpio *txgpio = txline->txgpio; 332 325 u64 bit_cfg; 333 326 334 - irqd_set_trigger_type(d, flow_type); 327 + irqd_set_trigger_type(data, flow_type); 335 328 336 329 bit_cfg = txline->fil_bits | GPIO_BIT_CFG_INT_EN; 337 330 338 331 if (flow_type & IRQ_TYPE_EDGE_BOTH) { 339 - irq_set_handler_locked(d, handle_fasteoi_ack_irq); 332 + irq_set_handler_locked(data, handle_fasteoi_ack_irq); 340 333 bit_cfg |= GPIO_BIT_CFG_INT_TYPE; 341 334 } else { 342 - irq_set_handler_locked(d, handle_fasteoi_mask_irq); 335 + irq_set_handler_locked(data, handle_fasteoi_mask_irq); 343 336 } 344 337 345 338 raw_spin_lock(&txgpio->lock); ··· 362 367 irq_chip_disable_parent(data); 363 368 } 364 369 370 + static int thunderx_gpio_irq_request_resources(struct irq_data *data) 371 + { 372 + struct thunderx_line *txline = irq_data_get_irq_chip_data(data); 373 + struct thunderx_gpio *txgpio = txline->txgpio; 374 + int r; 375 + 376 + r = gpiochip_lock_as_irq(&txgpio->chip, txline->line); 377 + if (r) 378 + return r; 379 + 380 + r = irq_chip_request_resources_parent(data); 381 + if (r) 382 + gpiochip_unlock_as_irq(&txgpio->chip, txline->line); 383 + 384 + return r; 385 + } 386 + 387 + static void thunderx_gpio_irq_release_resources(struct irq_data *data) 388 + { 389 + struct thunderx_line *txline = irq_data_get_irq_chip_data(data); 390 + struct thunderx_gpio *txgpio = txline->txgpio; 391 + 392 + irq_chip_release_resources_parent(data); 393 + 394 + gpiochip_unlock_as_irq(&txgpio->chip, txline->line); 395 + } 396 + 365 397 /* 366 398 * Interrupts are chained from underlying MSI-X vectors. We have 367 399 * these irq_chip functions to be able to handle level triggering ··· 405 383 .irq_unmask = thunderx_gpio_irq_unmask, 406 384 .irq_eoi = irq_chip_eoi_parent, 407 385 .irq_set_affinity = irq_chip_set_affinity_parent, 386 + .irq_request_resources = thunderx_gpio_irq_request_resources, 387 + .irq_release_resources = thunderx_gpio_irq_release_resources, 408 388 .irq_set_type = thunderx_gpio_irq_set_type, 409 389 410 390 .flags = IRQCHIP_SET_TYPE_MASKED 411 391 }; 412 392 413 - static int thunderx_gpio_child_to_parent_hwirq(struct gpio_chip *gc, 414 - unsigned int child, 415 - unsigned int child_type, 416 - unsigned int *parent, 417 - unsigned int *parent_type) 393 + static int thunderx_gpio_irq_translate(struct irq_domain *d, 394 + struct irq_fwspec *fwspec, 395 + irq_hw_number_t *hwirq, 396 + unsigned int *type) 418 397 { 419 - struct thunderx_gpio *txgpio = gpiochip_get_data(gc); 398 + struct thunderx_gpio *txgpio = d->host_data; 420 399 421 - *parent = txgpio->base_msi + (2 * child); 422 - *parent_type = IRQ_TYPE_LEVEL_HIGH; 400 + if (WARN_ON(fwspec->param_count < 2)) 401 + return -EINVAL; 402 + if (fwspec->param[0] >= txgpio->chip.ngpio) 403 + return -EINVAL; 404 + *hwirq = fwspec->param[0]; 405 + *type = fwspec->param[1] & IRQ_TYPE_SENSE_MASK; 423 406 return 0; 407 + } 408 + 409 + static int thunderx_gpio_irq_alloc(struct irq_domain *d, unsigned int virq, 410 + unsigned int nr_irqs, void *arg) 411 + { 412 + struct thunderx_line *txline = arg; 413 + 414 + return irq_domain_set_hwirq_and_chip(d, virq, txline->line, 415 + &thunderx_gpio_irq_chip, txline); 416 + } 417 + 418 + static const struct irq_domain_ops thunderx_gpio_irqd_ops = { 419 + .alloc = thunderx_gpio_irq_alloc, 420 + .translate = thunderx_gpio_irq_translate 421 + }; 422 + 423 + static int thunderx_gpio_to_irq(struct gpio_chip *chip, unsigned int offset) 424 + { 425 + struct thunderx_gpio *txgpio = gpiochip_get_data(chip); 426 + 427 + return irq_find_mapping(txgpio->irqd, offset); 424 428 } 425 429 426 430 static int thunderx_gpio_probe(struct pci_dev *pdev, ··· 456 408 struct device *dev = &pdev->dev; 457 409 struct thunderx_gpio *txgpio; 458 410 struct gpio_chip *chip; 459 - struct gpio_irq_chip *girq; 460 411 int ngpio, i; 461 412 int err = 0; 462 413 ··· 500 453 } 501 454 502 455 txgpio->msix_entries = devm_kcalloc(dev, 503 - ngpio, sizeof(struct msix_entry), 504 - GFP_KERNEL); 456 + ngpio, sizeof(struct msix_entry), 457 + GFP_KERNEL); 505 458 if (!txgpio->msix_entries) { 506 459 err = -ENOMEM; 507 460 goto out; ··· 542 495 if (err < 0) 543 496 goto out; 544 497 498 + /* 499 + * Push GPIO specific irqdomain on hierarchy created as a side 500 + * effect of the pci_enable_msix() 501 + */ 502 + txgpio->irqd = irq_domain_create_hierarchy(irq_get_irq_data(txgpio->msix_entries[0].vector)->domain, 503 + 0, 0, of_node_to_fwnode(dev->of_node), 504 + &thunderx_gpio_irqd_ops, txgpio); 505 + if (!txgpio->irqd) { 506 + err = -ENOMEM; 507 + goto out; 508 + } 509 + 510 + /* Push on irq_data and the domain for each line. */ 511 + for (i = 0; i < ngpio; i++) { 512 + err = irq_domain_push_irq(txgpio->irqd, 513 + txgpio->msix_entries[i].vector, 514 + &txgpio->line_entries[i]); 515 + if (err < 0) 516 + dev_err(dev, "irq_domain_push_irq: %d\n", err); 517 + } 518 + 545 519 chip->label = KBUILD_MODNAME; 546 520 chip->parent = dev; 547 521 chip->owner = THIS_MODULE; ··· 577 509 chip->set = thunderx_gpio_set; 578 510 chip->set_multiple = thunderx_gpio_set_multiple; 579 511 chip->set_config = thunderx_gpio_set_config; 580 - girq = &chip->irq; 581 - girq->chip = &thunderx_gpio_irq_chip; 582 - girq->fwnode = of_node_to_fwnode(dev->of_node); 583 - girq->parent_domain = 584 - irq_get_irq_data(txgpio->msix_entries[0].vector)->domain; 585 - girq->child_to_parent_hwirq = thunderx_gpio_child_to_parent_hwirq; 586 - girq->handler = handle_bad_irq; 587 - girq->default_type = IRQ_TYPE_NONE; 588 - 512 + chip->to_irq = thunderx_gpio_to_irq; 589 513 err = devm_gpiochip_add_data(dev, chip, txgpio); 590 514 if (err) 591 515 goto out; 592 - 593 - /* Push on irq_data and the domain for each line. */ 594 - for (i = 0; i < ngpio; i++) { 595 - err = irq_domain_push_irq(chip->irq.domain, 596 - txgpio->msix_entries[i].vector, 597 - chip); 598 - if (err < 0) 599 - dev_err(dev, "irq_domain_push_irq: %d\n", err); 600 - } 601 516 602 517 dev_info(dev, "ThunderX GPIO: %d lines with base %d.\n", 603 518 ngpio, chip->base); ··· 596 545 struct thunderx_gpio *txgpio = pci_get_drvdata(pdev); 597 546 598 547 for (i = 0; i < txgpio->chip.ngpio; i++) 599 - irq_domain_pop_irq(txgpio->chip.irq.domain, 548 + irq_domain_pop_irq(txgpio->irqd, 600 549 txgpio->msix_entries[i].vector); 601 550 602 - irq_domain_remove(txgpio->chip.irq.domain); 551 + irq_domain_remove(txgpio->irqd); 603 552 604 553 pci_set_drvdata(pdev, NULL); 605 554 }
+1 -1
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
··· 254 254 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_RLC0_RB_WPTR_POLL_CNTL, 0xfffffff7, 0x00403000), 255 255 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_RLC1_RB_WPTR_POLL_CNTL, 0xfffffff7, 0x00403000), 256 256 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_UTCL1_PAGE, 0x000003ff, 0x000003c0), 257 - SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_UTCL1_WATERMK, 0xfc000000, 0x00000000) 257 + SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_UTCL1_WATERMK, 0xfc000000, 0x03fbe1fe) 258 258 }; 259 259 260 260 static u32 sdma_v4_0_get_reg_offset(struct amdgpu_device *adev,
+1 -1
drivers/gpu/drm/amd/display/dc/core/dc_link.c
··· 817 817 } 818 818 819 819 case SIGNAL_TYPE_EDP: { 820 - read_current_link_settings_on_detect(link); 821 820 detect_edp_sink_caps(link); 821 + read_current_link_settings_on_detect(link); 822 822 sink_caps.transaction_type = DDC_TRANSACTION_TYPE_I2C_OVER_AUX; 823 823 sink_caps.signal = SIGNAL_TYPE_EDP; 824 824 break;
+36 -3
drivers/gpu/drm/drm_dp_mst_topology.c
··· 1190 1190 txmsg->state == DRM_DP_SIDEBAND_TX_SENT) { 1191 1191 mstb->tx_slots[txmsg->seqno] = NULL; 1192 1192 } 1193 + mgr->is_waiting_for_dwn_reply = false; 1194 + 1193 1195 } 1194 1196 out: 1195 1197 if (unlikely(ret == -EIO) && drm_debug_enabled(DRM_UT_DP)) { ··· 1201 1199 } 1202 1200 mutex_unlock(&mgr->qlock); 1203 1201 1202 + drm_dp_mst_kick_tx(mgr); 1204 1203 return ret; 1205 1204 } 1206 1205 ··· 2321 2318 { 2322 2319 struct drm_dp_mst_topology_mgr *mgr = mstb->mgr; 2323 2320 struct drm_dp_mst_port *port; 2324 - int old_ddps, ret; 2321 + int old_ddps, old_input, ret, i; 2325 2322 u8 new_pdt; 2326 2323 bool dowork = false, create_connector = false; 2327 2324 ··· 2352 2349 } 2353 2350 2354 2351 old_ddps = port->ddps; 2352 + old_input = port->input; 2355 2353 port->input = conn_stat->input_port; 2356 2354 port->mcs = conn_stat->message_capability_status; 2357 2355 port->ldps = conn_stat->legacy_device_plug_status; ··· 2375 2371 DRM_ERROR("Failed to change PDT for port %p: %d\n", 2376 2372 port, ret); 2377 2373 dowork = false; 2374 + } 2375 + 2376 + if (!old_input && old_ddps != port->ddps && !port->ddps) { 2377 + for (i = 0; i < mgr->max_payloads; i++) { 2378 + struct drm_dp_vcpi *vcpi = mgr->proposed_vcpis[i]; 2379 + struct drm_dp_mst_port *port_validated; 2380 + 2381 + if (!vcpi) 2382 + continue; 2383 + 2384 + port_validated = 2385 + container_of(vcpi, struct drm_dp_mst_port, vcpi); 2386 + port_validated = 2387 + drm_dp_mst_topology_get_port_validated(mgr, port_validated); 2388 + if (!port_validated) { 2389 + mutex_lock(&mgr->payload_lock); 2390 + vcpi->num_slots = 0; 2391 + mutex_unlock(&mgr->payload_lock); 2392 + } else { 2393 + drm_dp_mst_topology_put_port(port_validated); 2394 + } 2395 + } 2378 2396 } 2379 2397 2380 2398 if (port->connector) ··· 2744 2718 ret = process_single_tx_qlock(mgr, txmsg, false); 2745 2719 if (ret == 1) { 2746 2720 /* txmsg is sent it should be in the slots now */ 2721 + mgr->is_waiting_for_dwn_reply = true; 2747 2722 list_del(&txmsg->next); 2748 2723 } else if (ret) { 2749 2724 DRM_DEBUG_KMS("failed to send msg in q %d\n", ret); 2725 + mgr->is_waiting_for_dwn_reply = false; 2750 2726 list_del(&txmsg->next); 2751 2727 if (txmsg->seqno != -1) 2752 2728 txmsg->dst->tx_slots[txmsg->seqno] = NULL; ··· 2788 2760 drm_dp_mst_dump_sideband_msg_tx(&p, txmsg); 2789 2761 } 2790 2762 2791 - if (list_is_singular(&mgr->tx_msg_downq)) 2763 + if (list_is_singular(&mgr->tx_msg_downq) && 2764 + !mgr->is_waiting_for_dwn_reply) 2792 2765 process_single_down_tx_qlock(mgr); 2793 2766 mutex_unlock(&mgr->qlock); 2794 2767 } ··· 3707 3678 mutex_lock(&mgr->qlock); 3708 3679 txmsg->state = DRM_DP_SIDEBAND_TX_RX; 3709 3680 mstb->tx_slots[slot] = NULL; 3681 + mgr->is_waiting_for_dwn_reply = false; 3710 3682 mutex_unlock(&mgr->qlock); 3711 3683 3712 3684 wake_up_all(&mgr->tx_waitq); ··· 3717 3687 no_msg: 3718 3688 drm_dp_mst_topology_put_mstb(mstb); 3719 3689 clear_down_rep_recv: 3690 + mutex_lock(&mgr->qlock); 3691 + mgr->is_waiting_for_dwn_reply = false; 3692 + mutex_unlock(&mgr->qlock); 3720 3693 memset(&mgr->down_rep_recv, 0, sizeof(struct drm_dp_sideband_msg_rx)); 3721 3694 3722 3695 return 0; ··· 4530 4497 struct drm_dp_mst_topology_mgr *mgr = container_of(work, struct drm_dp_mst_topology_mgr, tx_work); 4531 4498 4532 4499 mutex_lock(&mgr->qlock); 4533 - if (!list_empty(&mgr->tx_msg_downq)) 4500 + if (!list_empty(&mgr->tx_msg_downq) && !mgr->is_waiting_for_dwn_reply) 4534 4501 process_single_down_tx_qlock(mgr); 4535 4502 mutex_unlock(&mgr->qlock); 4536 4503 }
+37 -3
drivers/gpu/drm/i915/gt/intel_context.c
··· 123 123 if (err) 124 124 return err; 125 125 126 + err = i915_active_acquire(&vma->active); 127 + if (err) 128 + goto err_unpin; 129 + 126 130 /* 127 131 * And mark it as a globally pinned object to let the shrinker know 128 132 * it cannot reclaim the object until we release it. ··· 135 131 vma->obj->mm.dirty = true; 136 132 137 133 return 0; 134 + 135 + err_unpin: 136 + i915_vma_unpin(vma); 137 + return err; 138 138 } 139 139 140 140 static void __context_unpin_state(struct i915_vma *vma) 141 141 { 142 142 i915_vma_make_shrinkable(vma); 143 + i915_active_release(&vma->active); 143 144 __i915_vma_unpin(vma); 145 + } 146 + 147 + static int __ring_active(struct intel_ring *ring) 148 + { 149 + int err; 150 + 151 + err = i915_active_acquire(&ring->vma->active); 152 + if (err) 153 + return err; 154 + 155 + err = intel_ring_pin(ring); 156 + if (err) 157 + goto err_active; 158 + 159 + return 0; 160 + 161 + err_active: 162 + i915_active_release(&ring->vma->active); 163 + return err; 164 + } 165 + 166 + static void __ring_retire(struct intel_ring *ring) 167 + { 168 + intel_ring_unpin(ring); 169 + i915_active_release(&ring->vma->active); 144 170 } 145 171 146 172 __i915_active_call ··· 185 151 __context_unpin_state(ce->state); 186 152 187 153 intel_timeline_unpin(ce->timeline); 188 - intel_ring_unpin(ce->ring); 154 + __ring_retire(ce->ring); 189 155 190 156 intel_context_put(ce); 191 157 } ··· 197 163 198 164 intel_context_get(ce); 199 165 200 - err = intel_ring_pin(ce->ring); 166 + err = __ring_active(ce->ring); 201 167 if (err) 202 168 goto err_put; 203 169 ··· 217 183 err_timeline: 218 184 intel_timeline_unpin(ce->timeline); 219 185 err_ring: 220 - intel_ring_unpin(ce->ring); 186 + __ring_retire(ce->ring); 221 187 err_put: 222 188 intel_context_put(ce); 223 189 return err;
+8
drivers/gpu/drm/i915/gt/intel_lrc.c
··· 2664 2664 /* WaFlushCoherentL3CacheLinesAtContextSwitch:skl,bxt,glk */ 2665 2665 batch = gen8_emit_flush_coherentl3_wa(engine, batch); 2666 2666 2667 + /* WaClearSlmSpaceAtContextSwitch:skl,bxt,kbl,glk,cfl */ 2668 + batch = gen8_emit_pipe_control(batch, 2669 + PIPE_CONTROL_FLUSH_L3 | 2670 + PIPE_CONTROL_STORE_DATA_INDEX | 2671 + PIPE_CONTROL_CS_STALL | 2672 + PIPE_CONTROL_QW_WRITE, 2673 + LRC_PPHWSP_SCRATCH_ADDR); 2674 + 2667 2675 batch = emit_lri(batch, lri, ARRAY_SIZE(lri)); 2668 2676 2669 2677 /* WaMediaPoolStateCmdInWABB:bxt,glk */
+2 -5
drivers/gpu/drm/i915/i915_gem_gtt.c
··· 3304 3304 3305 3305 static void ggtt_restore_mappings(struct i915_ggtt *ggtt) 3306 3306 { 3307 - struct i915_vma *vma, *vn; 3307 + struct i915_vma *vma; 3308 3308 bool flush = false; 3309 3309 int open; 3310 3310 ··· 3319 3319 open = atomic_xchg(&ggtt->vm.open, 0); 3320 3320 3321 3321 /* clflush objects bound into the GGTT and rebind them. */ 3322 - list_for_each_entry_safe(vma, vn, &ggtt->vm.bound_list, vm_link) { 3322 + list_for_each_entry(vma, &ggtt->vm.bound_list, vm_link) { 3323 3323 struct drm_i915_gem_object *obj = vma->obj; 3324 3324 3325 3325 if (!i915_vma_is_bound(vma, I915_VMA_GLOBAL_BIND)) 3326 - continue; 3327 - 3328 - if (!__i915_vma_unbind(vma)) 3329 3326 continue; 3330 3327 3331 3328 clear_bit(I915_VMA_GLOBAL_BIND_BIT, __i915_vma_flags(vma));
+8 -3
drivers/gpu/drm/i915/i915_pmu.c
··· 1074 1074 hrtimer_init(&pmu->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 1075 1075 pmu->timer.function = i915_sample; 1076 1076 1077 - if (!is_igp(i915)) 1077 + if (!is_igp(i915)) { 1078 1078 pmu->name = kasprintf(GFP_KERNEL, 1079 - "i915-%s", 1079 + "i915_%s", 1080 1080 dev_name(i915->drm.dev)); 1081 - else 1081 + if (pmu->name) { 1082 + /* tools/perf reserves colons as special. */ 1083 + strreplace((char *)pmu->name, ':', '_'); 1084 + } 1085 + } else { 1082 1086 pmu->name = "i915"; 1087 + } 1083 1088 if (!pmu->name) 1084 1089 goto err; 1085 1090
+1
drivers/gpu/drm/i915/selftests/i915_random.h
··· 25 25 #ifndef __I915_SELFTESTS_RANDOM_H__ 26 26 #define __I915_SELFTESTS_RANDOM_H__ 27 27 28 + #include <linux/math64.h> 28 29 #include <linux/random.h> 29 30 30 31 #include "../i915_selftest.h"
+1 -1
drivers/gpu/drm/rockchip/cdn-dp-core.h
··· 95 95 struct cdn_dp_port *port[MAX_PHY]; 96 96 u8 ports; 97 97 u8 max_lanes; 98 - u8 max_rate; 98 + unsigned int max_rate; 99 99 u8 lanes; 100 100 int active_port; 101 101
+1
drivers/gpu/drm/virtio/virtgpu_plane.c
··· 232 232 if (!objs) 233 233 return; 234 234 virtio_gpu_array_add_obj(objs, vgfb->base.obj[0]); 235 + virtio_gpu_array_lock_resv(objs); 235 236 virtio_gpu_cmd_transfer_to_host_2d 236 237 (vgdev, 0, 237 238 plane->state->crtc_w,
+6 -7
drivers/hwtracing/coresight/coresight-etm4x.c
··· 1132 1132 drvdata->trcid = coresight_get_trace_id(drvdata->cpu); 1133 1133 } 1134 1134 1135 - #ifdef CONFIG_CPU_PM 1136 1135 static int etm4_cpu_save(struct etmv4_drvdata *drvdata) 1137 1136 { 1138 1137 int i, ret = 0; ··· 1401 1402 1402 1403 static int etm4_cpu_pm_register(void) 1403 1404 { 1404 - return cpu_pm_register_notifier(&etm4_cpu_pm_nb); 1405 + if (IS_ENABLED(CONFIG_CPU_PM)) 1406 + return cpu_pm_register_notifier(&etm4_cpu_pm_nb); 1407 + 1408 + return 0; 1405 1409 } 1406 1410 1407 1411 static void etm4_cpu_pm_unregister(void) 1408 1412 { 1409 - cpu_pm_unregister_notifier(&etm4_cpu_pm_nb); 1413 + if (IS_ENABLED(CONFIG_CPU_PM)) 1414 + cpu_pm_unregister_notifier(&etm4_cpu_pm_nb); 1410 1415 } 1411 - #else 1412 - static int etm4_cpu_pm_register(void) { return 0; } 1413 - static void etm4_cpu_pm_unregister(void) { } 1414 - #endif 1415 1416 1416 1417 static int etm4_probe(struct amba_device *adev, const struct amba_id *id) 1417 1418 {
+8 -4
drivers/i2c/busses/i2c-iop3xx.c
··· 433 433 adapter_data->gpio_scl = devm_gpiod_get_optional(&pdev->dev, 434 434 "scl", 435 435 GPIOD_ASIS); 436 - if (IS_ERR(adapter_data->gpio_scl)) 437 - return PTR_ERR(adapter_data->gpio_scl); 436 + if (IS_ERR(adapter_data->gpio_scl)) { 437 + ret = PTR_ERR(adapter_data->gpio_scl); 438 + goto free_both; 439 + } 438 440 adapter_data->gpio_sda = devm_gpiod_get_optional(&pdev->dev, 439 441 "sda", 440 442 GPIOD_ASIS); 441 - if (IS_ERR(adapter_data->gpio_sda)) 442 - return PTR_ERR(adapter_data->gpio_sda); 443 + if (IS_ERR(adapter_data->gpio_sda)) { 444 + ret = PTR_ERR(adapter_data->gpio_sda); 445 + goto free_both; 446 + } 443 447 444 448 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 445 449 if (!res) {
+28 -10
drivers/i2c/busses/i2c-tegra.c
··· 1608 1608 } 1609 1609 1610 1610 pm_runtime_enable(&pdev->dev); 1611 - if (!pm_runtime_enabled(&pdev->dev)) 1611 + if (!pm_runtime_enabled(&pdev->dev)) { 1612 1612 ret = tegra_i2c_runtime_resume(&pdev->dev); 1613 - else 1613 + if (ret < 0) { 1614 + dev_err(&pdev->dev, "runtime resume failed\n"); 1615 + goto unprepare_div_clk; 1616 + } 1617 + } else { 1614 1618 ret = pm_runtime_get_sync(i2c_dev->dev); 1615 - 1616 - if (ret < 0) { 1617 - dev_err(&pdev->dev, "runtime resume failed\n"); 1618 - goto unprepare_div_clk; 1619 + if (ret < 0) { 1620 + dev_err(&pdev->dev, "runtime resume failed\n"); 1621 + goto disable_rpm; 1622 + } 1619 1623 } 1620 1624 1621 1625 if (i2c_dev->is_multimaster_mode) { ··· 1627 1623 if (ret < 0) { 1628 1624 dev_err(i2c_dev->dev, "div_clk enable failed %d\n", 1629 1625 ret); 1630 - goto disable_rpm; 1626 + goto put_rpm; 1631 1627 } 1632 1628 } 1633 1629 ··· 1675 1671 if (i2c_dev->is_multimaster_mode) 1676 1672 clk_disable(i2c_dev->div_clk); 1677 1673 1678 - disable_rpm: 1679 - pm_runtime_disable(&pdev->dev); 1680 - if (!pm_runtime_status_suspended(&pdev->dev)) 1674 + put_rpm: 1675 + if (pm_runtime_enabled(&pdev->dev)) 1676 + pm_runtime_put_sync(&pdev->dev); 1677 + else 1681 1678 tegra_i2c_runtime_suspend(&pdev->dev); 1679 + 1680 + disable_rpm: 1681 + if (pm_runtime_enabled(&pdev->dev)) 1682 + pm_runtime_disable(&pdev->dev); 1682 1683 1683 1684 unprepare_div_clk: 1684 1685 clk_unprepare(i2c_dev->div_clk); ··· 1719 1710 static int __maybe_unused tegra_i2c_suspend(struct device *dev) 1720 1711 { 1721 1712 struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev); 1713 + int err; 1722 1714 1723 1715 i2c_mark_adapter_suspended(&i2c_dev->adapter); 1716 + 1717 + err = pm_runtime_force_suspend(dev); 1718 + if (err < 0) 1719 + return err; 1724 1720 1725 1721 return 0; 1726 1722 } ··· 1745 1731 1746 1732 err = tegra_i2c_runtime_suspend(dev); 1747 1733 if (err) 1734 + return err; 1735 + 1736 + err = pm_runtime_force_resume(dev); 1737 + if (err < 0) 1748 1738 return err; 1749 1739 1750 1740 i2c_mark_adapter_resumed(&i2c_dev->adapter);
+5 -7
drivers/iio/adc/ad7124.c
··· 494 494 st->channel_config[channel].buf_negative = 495 495 of_property_read_bool(child, "adi,buffered-negative"); 496 496 497 - *chan = ad7124_channel_template; 498 - chan->address = channel; 499 - chan->scan_index = channel; 500 - chan->channel = ain[0]; 501 - chan->channel2 = ain[1]; 502 - 503 - chan++; 497 + chan[channel] = ad7124_channel_template; 498 + chan[channel].address = channel; 499 + chan[channel].scan_index = channel; 500 + chan[channel].channel = ain[0]; 501 + chan[channel].channel2 = ain[1]; 504 502 } 505 503 506 504 return 0;
+1
drivers/iio/chemical/Kconfig
··· 65 65 config PMS7003 66 66 tristate "Plantower PMS7003 particulate matter sensor" 67 67 depends on SERIAL_DEV_BUS 68 + select IIO_BUFFER 68 69 select IIO_TRIGGERED_BUFFER 69 70 help 70 71 Say Y here to build support for the Plantower PMS7003 particulate
+2 -1
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
··· 1301 1301 1302 1302 for (i = 0; i < ARRAY_SIZE(st_lsm6dsx_sensor_settings); i++) { 1303 1303 for (j = 0; j < ST_LSM6DSX_MAX_ID; j++) { 1304 - if (id == st_lsm6dsx_sensor_settings[i].id[j].hw_id) 1304 + if (st_lsm6dsx_sensor_settings[i].id[j].name && 1305 + id == st_lsm6dsx_sensor_settings[i].id[j].hw_id) 1305 1306 break; 1306 1307 } 1307 1308 if (j < ST_LSM6DSX_MAX_ID)
+5 -1
drivers/iio/industrialio-buffer.c
··· 566 566 const unsigned long *mask, bool timestamp) 567 567 { 568 568 unsigned bytes = 0; 569 - int length, i; 569 + int length, i, largest = 0; 570 570 571 571 /* How much space will the demuxed element take? */ 572 572 for_each_set_bit(i, mask, ··· 574 574 length = iio_storage_bytes_for_si(indio_dev, i); 575 575 bytes = ALIGN(bytes, length); 576 576 bytes += length; 577 + largest = max(largest, length); 577 578 } 578 579 579 580 if (timestamp) { 580 581 length = iio_storage_bytes_for_timestamp(indio_dev); 581 582 bytes = ALIGN(bytes, length); 582 583 bytes += length; 584 + largest = max(largest, length); 583 585 } 586 + 587 + bytes = ALIGN(bytes, largest); 584 588 return bytes; 585 589 } 586 590
+2 -1
drivers/iio/light/vcnl4000.c
··· 163 163 if (ret < 0) 164 164 return ret; 165 165 166 - data->al_scale = 24000; 167 166 data->vcnl4200_al.reg = VCNL4200_AL_DATA; 168 167 data->vcnl4200_ps.reg = VCNL4200_PS_DATA; 169 168 switch (id) { ··· 171 172 /* show 54ms in total. */ 172 173 data->vcnl4200_al.sampling_rate = ktime_set(0, 54000 * 1000); 173 174 data->vcnl4200_ps.sampling_rate = ktime_set(0, 4200 * 1000); 175 + data->al_scale = 24000; 174 176 break; 175 177 case VCNL4040_PROD_ID: 176 178 /* Integration time is 80ms, add 10ms. */ 177 179 data->vcnl4200_al.sampling_rate = ktime_set(0, 100000 * 1000); 178 180 data->vcnl4200_ps.sampling_rate = ktime_set(0, 100000 * 1000); 181 + data->al_scale = 120000; 179 182 break; 180 183 } 181 184 data->vcnl4200_al.last_measurement = ktime_set(0, 0);
+2 -4
drivers/irqchip/irq-ingenic.c
··· 17 17 #include <linux/delay.h> 18 18 19 19 #include <asm/io.h> 20 - #include <asm/mach-jz4740/irq.h> 21 20 22 21 struct ingenic_intc_data { 23 22 void __iomem *base; ··· 49 50 while (pending) { 50 51 int bit = __fls(pending); 51 52 52 - irq = irq_find_mapping(domain, bit + (i * 32)); 53 + irq = irq_linear_revmap(domain, bit + (i * 32)); 53 54 generic_handle_irq(irq); 54 55 pending &= ~BIT(bit); 55 56 } ··· 96 97 goto out_unmap_irq; 97 98 } 98 99 99 - domain = irq_domain_add_legacy(node, num_chips * 32, 100 - JZ4740_IRQ_BASE, 0, 100 + domain = irq_domain_add_linear(node, num_chips * 32, 101 101 &irq_generic_chip_ops, NULL); 102 102 if (!domain) { 103 103 err = -ENOMEM;
+1 -1
drivers/md/dm-snap-persistent.c
··· 17 17 #include <linux/dm-bufio.h> 18 18 19 19 #define DM_MSG_PREFIX "persistent snapshot" 20 - #define DM_CHUNK_SIZE_DEFAULT_SECTORS 32 /* 16KB */ 20 + #define DM_CHUNK_SIZE_DEFAULT_SECTORS 32U /* 16KB */ 21 21 22 22 #define DM_PREFETCH_CHUNKS 12 23 23
+1 -1
drivers/md/raid0.c
··· 87 87 char b[BDEVNAME_SIZE]; 88 88 char b2[BDEVNAME_SIZE]; 89 89 struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL); 90 - unsigned short blksize = 512; 90 + unsigned blksize = 512; 91 91 92 92 *private_conf = ERR_PTR(-ENOMEM); 93 93 if (!conf)
+49 -162
drivers/message/fusion/mptctl.c
··· 100 100 * Function prototypes. Called from OS entry point mptctl_ioctl. 101 101 * arg contents specific to function. 102 102 */ 103 - static int mptctl_fw_download(unsigned long arg); 104 - static int mptctl_getiocinfo(unsigned long arg, unsigned int cmd); 105 - static int mptctl_gettargetinfo(unsigned long arg); 106 - static int mptctl_readtest(unsigned long arg); 107 - static int mptctl_mpt_command(unsigned long arg); 108 - static int mptctl_eventquery(unsigned long arg); 109 - static int mptctl_eventenable(unsigned long arg); 110 - static int mptctl_eventreport(unsigned long arg); 111 - static int mptctl_replace_fw(unsigned long arg); 103 + static int mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg); 104 + static int mptctl_getiocinfo(MPT_ADAPTER *iocp, unsigned long arg, unsigned int cmd); 105 + static int mptctl_gettargetinfo(MPT_ADAPTER *iocp, unsigned long arg); 106 + static int mptctl_readtest(MPT_ADAPTER *iocp, unsigned long arg); 107 + static int mptctl_mpt_command(MPT_ADAPTER *iocp, unsigned long arg); 108 + static int mptctl_eventquery(MPT_ADAPTER *iocp, unsigned long arg); 109 + static int mptctl_eventenable(MPT_ADAPTER *iocp, unsigned long arg); 110 + static int mptctl_eventreport(MPT_ADAPTER *iocp, unsigned long arg); 111 + static int mptctl_replace_fw(MPT_ADAPTER *iocp, unsigned long arg); 112 112 113 - static int mptctl_do_reset(unsigned long arg); 114 - static int mptctl_hp_hostinfo(unsigned long arg, unsigned int cmd); 115 - static int mptctl_hp_targetinfo(unsigned long arg); 113 + static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg); 114 + static int mptctl_hp_hostinfo(MPT_ADAPTER *iocp, unsigned long arg, unsigned int cmd); 115 + static int mptctl_hp_targetinfo(MPT_ADAPTER *iocp, unsigned long arg); 116 116 117 117 static int mptctl_probe(struct pci_dev *, const struct pci_device_id *); 118 118 static void mptctl_remove(struct pci_dev *); ··· 123 123 /* 124 124 * Private function calls. 125 125 */ 126 - static int mptctl_do_mpt_command(struct mpt_ioctl_command karg, void __user *mfPtr); 127 - static int mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen); 126 + static int mptctl_do_mpt_command(MPT_ADAPTER *iocp, struct mpt_ioctl_command karg, void __user *mfPtr); 127 + static int mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen); 128 128 static MptSge_t *kbuf_alloc_2_sgl(int bytes, u32 dir, int sge_offset, int *frags, 129 129 struct buflist **blp, dma_addr_t *sglbuf_dma, MPT_ADAPTER *ioc); 130 130 static void kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma, ··· 656 656 * by TM and FW reloads. 657 657 */ 658 658 if ((cmd & ~IOCSIZE_MASK) == (MPTIOCINFO & ~IOCSIZE_MASK)) { 659 - return mptctl_getiocinfo(arg, _IOC_SIZE(cmd)); 659 + return mptctl_getiocinfo(iocp, arg, _IOC_SIZE(cmd)); 660 660 } else if (cmd == MPTTARGETINFO) { 661 - return mptctl_gettargetinfo(arg); 661 + return mptctl_gettargetinfo(iocp, arg); 662 662 } else if (cmd == MPTTEST) { 663 - return mptctl_readtest(arg); 663 + return mptctl_readtest(iocp, arg); 664 664 } else if (cmd == MPTEVENTQUERY) { 665 - return mptctl_eventquery(arg); 665 + return mptctl_eventquery(iocp, arg); 666 666 } else if (cmd == MPTEVENTENABLE) { 667 - return mptctl_eventenable(arg); 667 + return mptctl_eventenable(iocp, arg); 668 668 } else if (cmd == MPTEVENTREPORT) { 669 - return mptctl_eventreport(arg); 669 + return mptctl_eventreport(iocp, arg); 670 670 } else if (cmd == MPTFWREPLACE) { 671 - return mptctl_replace_fw(arg); 671 + return mptctl_replace_fw(iocp, arg); 672 672 } 673 673 674 674 /* All of these commands require an interrupt or ··· 678 678 return ret; 679 679 680 680 if (cmd == MPTFWDOWNLOAD) 681 - ret = mptctl_fw_download(arg); 681 + ret = mptctl_fw_download(iocp, arg); 682 682 else if (cmd == MPTCOMMAND) 683 - ret = mptctl_mpt_command(arg); 683 + ret = mptctl_mpt_command(iocp, arg); 684 684 else if (cmd == MPTHARDRESET) 685 - ret = mptctl_do_reset(arg); 685 + ret = mptctl_do_reset(iocp, arg); 686 686 else if ((cmd & ~IOCSIZE_MASK) == (HP_GETHOSTINFO & ~IOCSIZE_MASK)) 687 - ret = mptctl_hp_hostinfo(arg, _IOC_SIZE(cmd)); 687 + ret = mptctl_hp_hostinfo(iocp, arg, _IOC_SIZE(cmd)); 688 688 else if (cmd == HP_GETTARGETINFO) 689 - ret = mptctl_hp_targetinfo(arg); 689 + ret = mptctl_hp_targetinfo(iocp, arg); 690 690 else 691 691 ret = -EINVAL; 692 692 ··· 705 705 return ret; 706 706 } 707 707 708 - static int mptctl_do_reset(unsigned long arg) 708 + static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg) 709 709 { 710 710 struct mpt_ioctl_diag_reset __user *urinfo = (void __user *) arg; 711 711 struct mpt_ioctl_diag_reset krinfo; 712 - MPT_ADAPTER *iocp; 713 712 714 713 if (copy_from_user(&krinfo, urinfo, sizeof(struct mpt_ioctl_diag_reset))) { 715 714 printk(KERN_ERR MYNAM "%s@%d::mptctl_do_reset - " 716 715 "Unable to copy mpt_ioctl_diag_reset struct @ %p\n", 717 716 __FILE__, __LINE__, urinfo); 718 717 return -EFAULT; 719 - } 720 - 721 - if (mpt_verify_adapter(krinfo.hdr.iocnum, &iocp) < 0) { 722 - printk(KERN_DEBUG MYNAM "%s@%d::mptctl_do_reset - ioc%d not found!\n", 723 - __FILE__, __LINE__, krinfo.hdr.iocnum); 724 - return -ENODEV; /* (-6) No such device or address */ 725 718 } 726 719 727 720 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "mptctl_do_reset called.\n", ··· 747 754 * -ENOMSG if FW upload returned bad status 748 755 */ 749 756 static int 750 - mptctl_fw_download(unsigned long arg) 757 + mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg) 751 758 { 752 759 struct mpt_fw_xfer __user *ufwdl = (void __user *) arg; 753 760 struct mpt_fw_xfer kfwdl; ··· 759 766 return -EFAULT; 760 767 } 761 768 762 - return mptctl_do_fw_download(kfwdl.iocnum, kfwdl.bufp, kfwdl.fwlen); 769 + return mptctl_do_fw_download(iocp, kfwdl.bufp, kfwdl.fwlen); 763 770 } 764 771 765 772 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ ··· 777 784 * -ENOMSG if FW upload returned bad status 778 785 */ 779 786 static int 780 - mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) 787 + mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen) 781 788 { 782 789 FWDownload_t *dlmsg; 783 790 MPT_FRAME_HDR *mf; 784 - MPT_ADAPTER *iocp; 785 791 FWDownloadTCSGE_t *ptsge; 786 792 MptSge_t *sgl, *sgIn; 787 793 char *sgOut; ··· 800 808 pFWDownloadReply_t ReplyMsg = NULL; 801 809 unsigned long timeleft; 802 810 803 - if (mpt_verify_adapter(ioc, &iocp) < 0) { 804 - printk(KERN_DEBUG MYNAM "ioctl_fwdl - ioc%d not found!\n", 805 - ioc); 806 - return -ENODEV; /* (-6) No such device or address */ 807 - } else { 808 - 809 - /* Valid device. Get a message frame and construct the FW download message. 810 - */ 811 - if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL) 812 - return -EAGAIN; 813 - } 811 + /* Valid device. Get a message frame and construct the FW download message. 812 + */ 813 + if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL) 814 + return -EAGAIN; 814 815 815 816 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT 816 817 "mptctl_do_fwdl called. mptctl_id = %xh.\n", iocp->name, mptctl_id)); ··· 811 826 iocp->name, ufwbuf)); 812 827 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.fwlen = %d\n", 813 828 iocp->name, (int)fwlen)); 814 - dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.ioc = %04xh\n", 815 - iocp->name, ioc)); 816 829 817 830 dlmsg = (FWDownload_t*) mf; 818 831 ptsge = (FWDownloadTCSGE_t *) &dlmsg->SGL; ··· 1221 1238 * -ENODEV if no such device/adapter 1222 1239 */ 1223 1240 static int 1224 - mptctl_getiocinfo (unsigned long arg, unsigned int data_size) 1241 + mptctl_getiocinfo (MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size) 1225 1242 { 1226 1243 struct mpt_ioctl_iocinfo __user *uarg = (void __user *) arg; 1227 1244 struct mpt_ioctl_iocinfo *karg; 1228 - MPT_ADAPTER *ioc; 1229 1245 struct pci_dev *pdev; 1230 - int iocnum; 1231 1246 unsigned int port; 1232 1247 int cim_rev; 1233 1248 struct scsi_device *sdev; ··· 1251 1270 printk(KERN_ERR MYNAM "%s@%d::mpt_ioctl_iocinfo() - memdup_user returned error [%ld]\n", 1252 1271 __FILE__, __LINE__, PTR_ERR(karg)); 1253 1272 return PTR_ERR(karg); 1254 - } 1255 - 1256 - if (((iocnum = mpt_verify_adapter(karg->hdr.iocnum, &ioc)) < 0) || 1257 - (ioc == NULL)) { 1258 - printk(KERN_DEBUG MYNAM "%s::mptctl_getiocinfo() @%d - ioc%d not found!\n", 1259 - __FILE__, __LINE__, iocnum); 1260 - kfree(karg); 1261 - return -ENODEV; 1262 1273 } 1263 1274 1264 1275 /* Verify the data transfer size is correct. */ ··· 1358 1385 * -ENODEV if no such device/adapter 1359 1386 */ 1360 1387 static int 1361 - mptctl_gettargetinfo (unsigned long arg) 1388 + mptctl_gettargetinfo (MPT_ADAPTER *ioc, unsigned long arg) 1362 1389 { 1363 1390 struct mpt_ioctl_targetinfo __user *uarg = (void __user *) arg; 1364 1391 struct mpt_ioctl_targetinfo karg; 1365 - MPT_ADAPTER *ioc; 1366 1392 VirtDevice *vdevice; 1367 1393 char *pmem; 1368 1394 int *pdata; 1369 - int iocnum; 1370 1395 int numDevices = 0; 1371 1396 int lun; 1372 1397 int maxWordsLeft; ··· 1377 1406 "Unable to read in mpt_ioctl_targetinfo struct @ %p\n", 1378 1407 __FILE__, __LINE__, uarg); 1379 1408 return -EFAULT; 1380 - } 1381 - 1382 - if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 1383 - (ioc == NULL)) { 1384 - printk(KERN_DEBUG MYNAM "%s::mptctl_gettargetinfo() @%d - ioc%d not found!\n", 1385 - __FILE__, __LINE__, iocnum); 1386 - return -ENODEV; 1387 1409 } 1388 1410 1389 1411 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_gettargetinfo called.\n", ··· 1474 1510 * -ENODEV if no such device/adapter 1475 1511 */ 1476 1512 static int 1477 - mptctl_readtest (unsigned long arg) 1513 + mptctl_readtest (MPT_ADAPTER *ioc, unsigned long arg) 1478 1514 { 1479 1515 struct mpt_ioctl_test __user *uarg = (void __user *) arg; 1480 1516 struct mpt_ioctl_test karg; 1481 - MPT_ADAPTER *ioc; 1482 - int iocnum; 1483 1517 1484 1518 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) { 1485 1519 printk(KERN_ERR MYNAM "%s@%d::mptctl_readtest - " 1486 1520 "Unable to read in mpt_ioctl_test struct @ %p\n", 1487 1521 __FILE__, __LINE__, uarg); 1488 1522 return -EFAULT; 1489 - } 1490 - 1491 - if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 1492 - (ioc == NULL)) { 1493 - printk(KERN_DEBUG MYNAM "%s::mptctl_readtest() @%d - ioc%d not found!\n", 1494 - __FILE__, __LINE__, iocnum); 1495 - return -ENODEV; 1496 1523 } 1497 1524 1498 1525 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_readtest called.\n", ··· 1526 1571 * -ENODEV if no such device/adapter 1527 1572 */ 1528 1573 static int 1529 - mptctl_eventquery (unsigned long arg) 1574 + mptctl_eventquery (MPT_ADAPTER *ioc, unsigned long arg) 1530 1575 { 1531 1576 struct mpt_ioctl_eventquery __user *uarg = (void __user *) arg; 1532 1577 struct mpt_ioctl_eventquery karg; 1533 - MPT_ADAPTER *ioc; 1534 - int iocnum; 1535 1578 1536 1579 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) { 1537 1580 printk(KERN_ERR MYNAM "%s@%d::mptctl_eventquery - " 1538 1581 "Unable to read in mpt_ioctl_eventquery struct @ %p\n", 1539 1582 __FILE__, __LINE__, uarg); 1540 1583 return -EFAULT; 1541 - } 1542 - 1543 - if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 1544 - (ioc == NULL)) { 1545 - printk(KERN_DEBUG MYNAM "%s::mptctl_eventquery() @%d - ioc%d not found!\n", 1546 - __FILE__, __LINE__, iocnum); 1547 - return -ENODEV; 1548 1584 } 1549 1585 1550 1586 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventquery called.\n", ··· 1556 1610 1557 1611 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1558 1612 static int 1559 - mptctl_eventenable (unsigned long arg) 1613 + mptctl_eventenable (MPT_ADAPTER *ioc, unsigned long arg) 1560 1614 { 1561 1615 struct mpt_ioctl_eventenable __user *uarg = (void __user *) arg; 1562 1616 struct mpt_ioctl_eventenable karg; 1563 - MPT_ADAPTER *ioc; 1564 - int iocnum; 1565 1617 1566 1618 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) { 1567 1619 printk(KERN_ERR MYNAM "%s@%d::mptctl_eventenable - " 1568 1620 "Unable to read in mpt_ioctl_eventenable struct @ %p\n", 1569 1621 __FILE__, __LINE__, uarg); 1570 1622 return -EFAULT; 1571 - } 1572 - 1573 - if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 1574 - (ioc == NULL)) { 1575 - printk(KERN_DEBUG MYNAM "%s::mptctl_eventenable() @%d - ioc%d not found!\n", 1576 - __FILE__, __LINE__, iocnum); 1577 - return -ENODEV; 1578 1623 } 1579 1624 1580 1625 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventenable called.\n", ··· 1595 1658 1596 1659 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1597 1660 static int 1598 - mptctl_eventreport (unsigned long arg) 1661 + mptctl_eventreport (MPT_ADAPTER *ioc, unsigned long arg) 1599 1662 { 1600 1663 struct mpt_ioctl_eventreport __user *uarg = (void __user *) arg; 1601 1664 struct mpt_ioctl_eventreport karg; 1602 - MPT_ADAPTER *ioc; 1603 - int iocnum; 1604 1665 int numBytes, maxEvents, max; 1605 1666 1606 1667 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) { ··· 1608 1673 return -EFAULT; 1609 1674 } 1610 1675 1611 - if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 1612 - (ioc == NULL)) { 1613 - printk(KERN_DEBUG MYNAM "%s::mptctl_eventreport() @%d - ioc%d not found!\n", 1614 - __FILE__, __LINE__, iocnum); 1615 - return -ENODEV; 1616 - } 1617 1676 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventreport called.\n", 1618 1677 ioc->name)); 1619 1678 ··· 1641 1712 1642 1713 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1643 1714 static int 1644 - mptctl_replace_fw (unsigned long arg) 1715 + mptctl_replace_fw (MPT_ADAPTER *ioc, unsigned long arg) 1645 1716 { 1646 1717 struct mpt_ioctl_replace_fw __user *uarg = (void __user *) arg; 1647 1718 struct mpt_ioctl_replace_fw karg; 1648 - MPT_ADAPTER *ioc; 1649 - int iocnum; 1650 1719 int newFwSize; 1651 1720 1652 1721 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) { ··· 1652 1725 "Unable to read in mpt_ioctl_replace_fw struct @ %p\n", 1653 1726 __FILE__, __LINE__, uarg); 1654 1727 return -EFAULT; 1655 - } 1656 - 1657 - if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 1658 - (ioc == NULL)) { 1659 - printk(KERN_DEBUG MYNAM "%s::mptctl_replace_fw() @%d - ioc%d not found!\n", 1660 - __FILE__, __LINE__, iocnum); 1661 - return -ENODEV; 1662 1728 } 1663 1729 1664 1730 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_replace_fw called.\n", ··· 1700 1780 * -ENOMEM if memory allocation error 1701 1781 */ 1702 1782 static int 1703 - mptctl_mpt_command (unsigned long arg) 1783 + mptctl_mpt_command (MPT_ADAPTER *ioc, unsigned long arg) 1704 1784 { 1705 1785 struct mpt_ioctl_command __user *uarg = (void __user *) arg; 1706 1786 struct mpt_ioctl_command karg; 1707 - MPT_ADAPTER *ioc; 1708 - int iocnum; 1709 1787 int rc; 1710 1788 1711 1789 ··· 1714 1796 return -EFAULT; 1715 1797 } 1716 1798 1717 - if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 1718 - (ioc == NULL)) { 1719 - printk(KERN_DEBUG MYNAM "%s::mptctl_mpt_command() @%d - ioc%d not found!\n", 1720 - __FILE__, __LINE__, iocnum); 1721 - return -ENODEV; 1722 - } 1723 - 1724 - rc = mptctl_do_mpt_command (karg, &uarg->MF); 1799 + rc = mptctl_do_mpt_command (ioc, karg, &uarg->MF); 1725 1800 1726 1801 return rc; 1727 1802 } ··· 1732 1821 * -EPERM if SCSI I/O and target is untagged 1733 1822 */ 1734 1823 static int 1735 - mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) 1824 + mptctl_do_mpt_command (MPT_ADAPTER *ioc, struct mpt_ioctl_command karg, void __user *mfPtr) 1736 1825 { 1737 - MPT_ADAPTER *ioc; 1738 1826 MPT_FRAME_HDR *mf = NULL; 1739 1827 MPIHeader_t *hdr; 1740 1828 char *psge; ··· 1742 1832 dma_addr_t dma_addr_in; 1743 1833 dma_addr_t dma_addr_out; 1744 1834 int sgSize = 0; /* Num SG elements */ 1745 - int iocnum, flagsLength; 1835 + int flagsLength; 1746 1836 int sz, rc = 0; 1747 1837 int msgContext; 1748 1838 u16 req_idx; ··· 1756 1846 */ 1757 1847 bufIn.kptr = bufOut.kptr = NULL; 1758 1848 bufIn.len = bufOut.len = 0; 1759 - 1760 - if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 1761 - (ioc == NULL)) { 1762 - printk(KERN_DEBUG MYNAM "%s::mptctl_do_mpt_command() @%d - ioc%d not found!\n", 1763 - __FILE__, __LINE__, iocnum); 1764 - return -ENODEV; 1765 - } 1766 1849 1767 1850 spin_lock_irqsave(&ioc->taskmgmt_lock, flags); 1768 1851 if (ioc->ioc_reset_in_progress) { ··· 2321 2418 * -ENOMEM if memory allocation error 2322 2419 */ 2323 2420 static int 2324 - mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size) 2421 + mptctl_hp_hostinfo(MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size) 2325 2422 { 2326 2423 hp_host_info_t __user *uarg = (void __user *) arg; 2327 - MPT_ADAPTER *ioc; 2328 2424 struct pci_dev *pdev; 2329 2425 char *pbuf=NULL; 2330 2426 dma_addr_t buf_dma; 2331 2427 hp_host_info_t karg; 2332 2428 CONFIGPARMS cfg; 2333 2429 ConfigPageHeader_t hdr; 2334 - int iocnum; 2335 2430 int rc, cim_rev; 2336 2431 ToolboxIstwiReadWriteRequest_t *IstwiRWRequest; 2337 2432 MPT_FRAME_HDR *mf = NULL; ··· 2353 2452 return -EFAULT; 2354 2453 } 2355 2454 2356 - if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 2357 - (ioc == NULL)) { 2358 - printk(KERN_DEBUG MYNAM "%s::mptctl_hp_hostinfo() @%d - ioc%d not found!\n", 2359 - __FILE__, __LINE__, iocnum); 2360 - return -ENODEV; 2361 - } 2362 2455 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT ": mptctl_hp_hostinfo called.\n", 2363 2456 ioc->name)); 2364 2457 ··· 2554 2659 * -ENOMEM if memory allocation error 2555 2660 */ 2556 2661 static int 2557 - mptctl_hp_targetinfo(unsigned long arg) 2662 + mptctl_hp_targetinfo(MPT_ADAPTER *ioc, unsigned long arg) 2558 2663 { 2559 2664 hp_target_info_t __user *uarg = (void __user *) arg; 2560 2665 SCSIDevicePage0_t *pg0_alloc; 2561 2666 SCSIDevicePage3_t *pg3_alloc; 2562 - MPT_ADAPTER *ioc; 2563 2667 MPT_SCSI_HOST *hd = NULL; 2564 2668 hp_target_info_t karg; 2565 - int iocnum; 2566 2669 int data_sz; 2567 2670 dma_addr_t page_dma; 2568 2671 CONFIGPARMS cfg; ··· 2574 2681 return -EFAULT; 2575 2682 } 2576 2683 2577 - if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || 2578 - (ioc == NULL)) { 2579 - printk(KERN_DEBUG MYNAM "%s::mptctl_hp_targetinfo() @%d - ioc%d not found!\n", 2580 - __FILE__, __LINE__, iocnum); 2581 - return -ENODEV; 2582 - } 2583 2684 if (karg.hdr.id >= MPT_MAX_FC_DEVICES) 2584 2685 return -EINVAL; 2585 2686 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_hp_targetinfo called.\n", ··· 2741 2854 kfw.fwlen = kfw32.fwlen; 2742 2855 kfw.bufp = compat_ptr(kfw32.bufp); 2743 2856 2744 - ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen); 2857 + ret = mptctl_do_fw_download(iocp, kfw.bufp, kfw.fwlen); 2745 2858 2746 2859 mutex_unlock(&iocp->ioctl_cmds.mutex); 2747 2860 ··· 2795 2908 2796 2909 /* Pass new structure to do_mpt_command 2797 2910 */ 2798 - ret = mptctl_do_mpt_command (karg, &uarg->MF); 2911 + ret = mptctl_do_mpt_command (iocp, karg, &uarg->MF); 2799 2912 2800 2913 mutex_unlock(&iocp->ioctl_cmds.mutex); 2801 2914
+1 -2
drivers/misc/enclosure.c
··· 406 406 cdev = &edev->component[i]; 407 407 if (cdev->dev == dev) { 408 408 enclosure_remove_links(cdev); 409 - device_del(&cdev->cdev); 410 409 put_device(dev); 411 410 cdev->dev = NULL; 412 - return device_add(&cdev->cdev); 411 + return 0; 413 412 } 414 413 } 415 414 return -ENODEV;
+7 -5
drivers/misc/lkdtm/bugs.c
··· 278 278 279 279 void lkdtm_UNSET_SMEP(void) 280 280 { 281 - #ifdef CONFIG_X86_64 281 + #if IS_ENABLED(CONFIG_X86_64) && !IS_ENABLED(CONFIG_UML) 282 282 #define MOV_CR4_DEPTH 64 283 283 void (*direct_write_cr4)(unsigned long val); 284 284 unsigned char *insn; ··· 338 338 native_write_cr4(cr4); 339 339 } 340 340 #else 341 - pr_err("FAIL: this test is x86_64-only\n"); 341 + pr_err("XFAIL: this test is x86_64-only\n"); 342 342 #endif 343 343 } 344 344 345 - #ifdef CONFIG_X86_32 346 345 void lkdtm_DOUBLE_FAULT(void) 347 346 { 347 + #ifdef CONFIG_X86_32 348 348 /* 349 349 * Trigger #DF by setting the stack limit to zero. This clobbers 350 350 * a GDT TLS slot, which is okay because the current task will die ··· 373 373 asm volatile ("movw %0, %%ss; addl $0, (%%esp)" :: 374 374 "r" ((unsigned short)(GDT_ENTRY_TLS_MIN << 3))); 375 375 376 - panic("tried to double fault but didn't die\n"); 377 - } 376 + pr_err("FAIL: tried to double fault but didn't die\n"); 377 + #else 378 + pr_err("XFAIL: this test is ia32-only\n"); 378 379 #endif 380 + }
+10 -1
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
··· 148 148 struct resources *r = &this->resources; 149 149 int ret; 150 150 151 + ret = pm_runtime_get_sync(this->dev); 152 + if (ret < 0) 153 + return ret; 154 + 151 155 ret = gpmi_reset_block(r->gpmi_regs, false); 152 156 if (ret) 153 157 goto err_out; ··· 183 179 */ 184 180 writel(BM_GPMI_CTRL1_DECOUPLE_CS, r->gpmi_regs + HW_GPMI_CTRL1_SET); 185 181 186 - return 0; 187 182 err_out: 183 + pm_runtime_mark_last_busy(this->dev); 184 + pm_runtime_put_autosuspend(this->dev); 188 185 return ret; 189 186 } 190 187 ··· 2726 2721 dev_err(this->dev, "Error setting GPMI : %d\n", ret); 2727 2722 return ret; 2728 2723 } 2724 + 2725 + /* Set flag to get timing setup restored for next exec_op */ 2726 + if (this->hw.clk_rate) 2727 + this->hw.must_apply_timings = true; 2729 2728 2730 2729 /* re-init the BCH registers */ 2731 2730 ret = bch_set_geometry(this);
+3 -3
drivers/mtd/spi-nor/spi-nor.c
··· 2124 2124 if (nor->bouncebuf[0] & SR2_QUAD_EN_BIT1) 2125 2125 return 0; 2126 2126 2127 + nor->bouncebuf[0] |= SR2_QUAD_EN_BIT1; 2128 + 2127 2129 return spi_nor_write_16bit_cr_and_check(nor, nor->bouncebuf[0]); 2128 2130 } 2129 2131 ··· 4771 4769 4772 4770 static void spansion_post_sfdp_fixups(struct spi_nor *nor) 4773 4771 { 4774 - struct mtd_info *mtd = &nor->mtd; 4775 - 4776 - if (mtd->size <= SZ_16M) 4772 + if (nor->params.size <= SZ_16M) 4777 4773 return; 4778 4774 4779 4775 nor->flags |= SNOR_F_4B_OPCODES;
+1 -1
drivers/net/dsa/bcm_sf2.c
··· 68 68 69 69 /* Force link status for IMP port */ 70 70 reg = core_readl(priv, offset); 71 - reg |= (MII_SW_OR | LINK_STS); 71 + reg |= (MII_SW_OR | LINK_STS | GMII_SPEED_UP_2G); 72 72 core_writel(priv, reg, offset); 73 73 74 74 /* Enable Broadcast, Multicast, Unicast forwarding to IMP port */
+1 -1
drivers/net/dsa/sja1105/sja1105_main.c
··· 582 582 struct device *dev = &priv->spidev->dev; 583 583 struct device_node *child; 584 584 585 - for_each_child_of_node(ports_node, child) { 585 + for_each_available_child_of_node(ports_node, child) { 586 586 struct device_node *phy_node; 587 587 phy_interface_t phy_mode; 588 588 u32 index;
+4 -3
drivers/net/ethernet/broadcom/bcmsysport.c
··· 2323 2323 ring->switch_queue = qp; 2324 2324 ring->switch_port = port; 2325 2325 ring->inspect = true; 2326 - priv->ring_map[q + port * num_tx_queues] = ring; 2326 + priv->ring_map[qp + port * num_tx_queues] = ring; 2327 2327 qp++; 2328 2328 } 2329 2329 ··· 2338 2338 struct net_device *slave_dev; 2339 2339 unsigned int num_tx_queues; 2340 2340 struct net_device *dev; 2341 - unsigned int q, port; 2341 + unsigned int q, qp, port; 2342 2342 2343 2343 priv = container_of(nb, struct bcm_sysport_priv, dsa_notifier); 2344 2344 if (priv->netdev != info->master) ··· 2364 2364 continue; 2365 2365 2366 2366 ring->inspect = false; 2367 - priv->ring_map[q + port * num_tx_queues] = NULL; 2367 + qp = ring->switch_queue; 2368 + priv->ring_map[qp + port * num_tx_queues] = NULL; 2368 2369 } 2369 2370 2370 2371 return 0;
+20 -9
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 11065 11065 struct flow_keys *keys1 = &f1->fkeys; 11066 11066 struct flow_keys *keys2 = &f2->fkeys; 11067 11067 11068 - if (keys1->addrs.v4addrs.src == keys2->addrs.v4addrs.src && 11069 - keys1->addrs.v4addrs.dst == keys2->addrs.v4addrs.dst && 11070 - keys1->ports.ports == keys2->ports.ports && 11071 - keys1->basic.ip_proto == keys2->basic.ip_proto && 11072 - keys1->basic.n_proto == keys2->basic.n_proto && 11068 + if (keys1->basic.n_proto != keys2->basic.n_proto || 11069 + keys1->basic.ip_proto != keys2->basic.ip_proto) 11070 + return false; 11071 + 11072 + if (keys1->basic.n_proto == htons(ETH_P_IP)) { 11073 + if (keys1->addrs.v4addrs.src != keys2->addrs.v4addrs.src || 11074 + keys1->addrs.v4addrs.dst != keys2->addrs.v4addrs.dst) 11075 + return false; 11076 + } else { 11077 + if (memcmp(&keys1->addrs.v6addrs.src, &keys2->addrs.v6addrs.src, 11078 + sizeof(keys1->addrs.v6addrs.src)) || 11079 + memcmp(&keys1->addrs.v6addrs.dst, &keys2->addrs.v6addrs.dst, 11080 + sizeof(keys1->addrs.v6addrs.dst))) 11081 + return false; 11082 + } 11083 + 11084 + if (keys1->ports.ports == keys2->ports.ports && 11073 11085 keys1->control.flags == keys2->control.flags && 11074 11086 ether_addr_equal(f1->src_mac_addr, f2->src_mac_addr) && 11075 11087 ether_addr_equal(f1->dst_mac_addr, f2->dst_mac_addr)) ··· 11373 11361 return -EOPNOTSUPP; 11374 11362 11375 11363 /* The PF and it's VF-reps only support the switchdev framework */ 11376 - if (!BNXT_PF(bp)) 11364 + if (!BNXT_PF(bp) || !(bp->flags & BNXT_FLAG_DSN_VALID)) 11377 11365 return -EOPNOTSUPP; 11378 11366 11379 11367 ppid->id_len = sizeof(bp->switch_id); ··· 11746 11734 put_unaligned_le32(dw, &dsn[0]); 11747 11735 pci_read_config_dword(pdev, pos + 4, &dw); 11748 11736 put_unaligned_le32(dw, &dsn[4]); 11737 + bp->flags |= BNXT_FLAG_DSN_VALID; 11749 11738 return 0; 11750 11739 } 11751 11740 ··· 11858 11845 11859 11846 if (BNXT_PF(bp)) { 11860 11847 /* Read the adapter's DSN to use as the eswitch switch_id */ 11861 - rc = bnxt_pcie_dsn_get(bp, bp->switch_id); 11862 - if (rc) 11863 - goto init_err_pci_clean; 11848 + bnxt_pcie_dsn_get(bp, bp->switch_id); 11864 11849 } 11865 11850 11866 11851 /* MTU range: 60 - FW defined max */
+1 -3
drivers/net/ethernet/broadcom/bnxt/bnxt.h
··· 1532 1532 #define BNXT_FLAG_NO_AGG_RINGS 0x20000 1533 1533 #define BNXT_FLAG_RX_PAGE_MODE 0x40000 1534 1534 #define BNXT_FLAG_MULTI_HOST 0x100000 1535 + #define BNXT_FLAG_DSN_VALID 0x200000 1535 1536 #define BNXT_FLAG_DOUBLE_DB 0x400000 1536 1537 #define BNXT_FLAG_CHIP_NITRO_A0 0x1000000 1537 1538 #define BNXT_FLAG_DIM 0x2000000 ··· 1937 1936 case HWRM_CFA_ENCAP_RECORD_FREE: 1938 1937 case HWRM_CFA_DECAP_FILTER_ALLOC: 1939 1938 case HWRM_CFA_DECAP_FILTER_FREE: 1940 - case HWRM_CFA_NTUPLE_FILTER_ALLOC: 1941 - case HWRM_CFA_NTUPLE_FILTER_FREE: 1942 - case HWRM_CFA_NTUPLE_FILTER_CFG: 1943 1939 case HWRM_CFA_EM_FLOW_ALLOC: 1944 1940 case HWRM_CFA_EM_FLOW_FREE: 1945 1941 case HWRM_CFA_EM_FLOW_CFG:
+3
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
··· 398 398 struct net_device *dev; 399 399 int rc, i; 400 400 401 + if (!(bp->flags & BNXT_FLAG_DSN_VALID)) 402 + return -ENODEV; 403 + 401 404 bp->vf_reps = kcalloc(num_vfs, sizeof(vf_rep), GFP_KERNEL); 402 405 if (!bp->vf_reps) 403 406 return -ENOMEM;
+17 -13
drivers/net/ethernet/cadence/macb_main.c
··· 611 611 .mac_link_up = macb_mac_link_up, 612 612 }; 613 613 614 + static bool macb_phy_handle_exists(struct device_node *dn) 615 + { 616 + dn = of_parse_phandle(dn, "phy-handle", 0); 617 + of_node_put(dn); 618 + return dn != NULL; 619 + } 620 + 614 621 static int macb_phylink_connect(struct macb *bp) 615 622 { 623 + struct device_node *dn = bp->pdev->dev.of_node; 616 624 struct net_device *dev = bp->dev; 617 625 struct phy_device *phydev; 618 626 int ret; 619 627 620 - if (bp->pdev->dev.of_node && 621 - of_parse_phandle(bp->pdev->dev.of_node, "phy-handle", 0)) { 622 - ret = phylink_of_phy_connect(bp->phylink, bp->pdev->dev.of_node, 623 - 0); 624 - if (ret) { 625 - netdev_err(dev, "Could not attach PHY (%d)\n", ret); 626 - return ret; 627 - } 628 - } else { 628 + if (dn) 629 + ret = phylink_of_phy_connect(bp->phylink, dn, 0); 630 + 631 + if (!dn || (ret && !macb_phy_handle_exists(dn))) { 629 632 phydev = phy_find_first(bp->mii_bus); 630 633 if (!phydev) { 631 634 netdev_err(dev, "no PHY found\n"); ··· 637 634 638 635 /* attach the mac to the phy */ 639 636 ret = phylink_connect_phy(bp->phylink, phydev); 640 - if (ret) { 641 - netdev_err(dev, "Could not attach to PHY (%d)\n", ret); 642 - return ret; 643 - } 637 + } 638 + 639 + if (ret) { 640 + netdev_err(dev, "Could not attach PHY (%d)\n", ret); 641 + return ret; 644 642 } 645 643 646 644 phylink_start(bp->phylink);
+11 -3
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
··· 3135 3135 { 3136 3136 struct port_info *pi = netdev_priv(dev); 3137 3137 struct adapter *adap = pi->adapter; 3138 + struct ch_sched_queue qe = { 0 }; 3139 + struct ch_sched_params p = { 0 }; 3138 3140 struct sched_class *e; 3139 - struct ch_sched_params p; 3140 - struct ch_sched_queue qe; 3141 3141 u32 req_rate; 3142 3142 int err = 0; 3143 3143 ··· 3152 3152 "Failed to rate limit on queue %d. Link Down?\n", 3153 3153 index); 3154 3154 return -EINVAL; 3155 + } 3156 + 3157 + qe.queue = index; 3158 + e = cxgb4_sched_queue_lookup(dev, &qe); 3159 + if (e && e->info.u.params.level != SCHED_CLASS_LEVEL_CL_RL) { 3160 + dev_err(adap->pdev_dev, 3161 + "Queue %u already bound to class %u of type: %u\n", 3162 + index, e->idx, e->info.u.params.level); 3163 + return -EBUSY; 3155 3164 } 3156 3165 3157 3166 /* Convert from Mbps to Kbps */ ··· 3192 3183 return 0; 3193 3184 3194 3185 /* Fetch any available unused or matching scheduling class */ 3195 - memset(&p, 0, sizeof(p)); 3196 3186 p.type = SCHED_CLASS_TYPE_PACKET; 3197 3187 p.u.params.level = SCHED_CLASS_LEVEL_CL_RL; 3198 3188 p.u.params.mode = SCHED_CLASS_MODE_CLASS;
+67
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c
··· 15 15 struct flow_action *actions = &cls->rule->action; 16 16 struct port_info *pi = netdev2pinfo(dev); 17 17 struct flow_action_entry *entry; 18 + struct ch_sched_queue qe; 19 + struct sched_class *e; 18 20 u64 max_link_rate; 19 21 u32 i, speed; 20 22 int ret; ··· 62 60 } 63 61 } 64 62 63 + for (i = 0; i < pi->nqsets; i++) { 64 + memset(&qe, 0, sizeof(qe)); 65 + qe.queue = i; 66 + 67 + e = cxgb4_sched_queue_lookup(dev, &qe); 68 + if (e && e->info.u.params.level != SCHED_CLASS_LEVEL_CH_RL) { 69 + NL_SET_ERR_MSG_MOD(extack, 70 + "Some queues are already bound to different class"); 71 + return -EBUSY; 72 + } 73 + } 74 + 65 75 return 0; 76 + } 77 + 78 + static int cxgb4_matchall_tc_bind_queues(struct net_device *dev, u32 tc) 79 + { 80 + struct port_info *pi = netdev2pinfo(dev); 81 + struct ch_sched_queue qe; 82 + int ret; 83 + u32 i; 84 + 85 + for (i = 0; i < pi->nqsets; i++) { 86 + qe.queue = i; 87 + qe.class = tc; 88 + ret = cxgb4_sched_class_bind(dev, &qe, SCHED_QUEUE); 89 + if (ret) 90 + goto out_free; 91 + } 92 + 93 + return 0; 94 + 95 + out_free: 96 + while (i--) { 97 + qe.queue = i; 98 + qe.class = SCHED_CLS_NONE; 99 + cxgb4_sched_class_unbind(dev, &qe, SCHED_QUEUE); 100 + } 101 + 102 + return ret; 103 + } 104 + 105 + static void cxgb4_matchall_tc_unbind_queues(struct net_device *dev) 106 + { 107 + struct port_info *pi = netdev2pinfo(dev); 108 + struct ch_sched_queue qe; 109 + u32 i; 110 + 111 + for (i = 0; i < pi->nqsets; i++) { 112 + qe.queue = i; 113 + qe.class = SCHED_CLS_NONE; 114 + cxgb4_sched_class_unbind(dev, &qe, SCHED_QUEUE); 115 + } 66 116 } 67 117 68 118 static int cxgb4_matchall_alloc_tc(struct net_device *dev, ··· 137 83 struct adapter *adap = netdev2adap(dev); 138 84 struct flow_action_entry *entry; 139 85 struct sched_class *e; 86 + int ret; 140 87 u32 i; 141 88 142 89 tc_port_matchall = &adap->tc_matchall->port_matchall[pi->port_id]; ··· 156 101 return -ENOMEM; 157 102 } 158 103 104 + ret = cxgb4_matchall_tc_bind_queues(dev, e->idx); 105 + if (ret) { 106 + NL_SET_ERR_MSG_MOD(extack, 107 + "Could not bind queues to traffic class"); 108 + goto out_free; 109 + } 110 + 159 111 tc_port_matchall->egress.hwtc = e->idx; 160 112 tc_port_matchall->egress.cookie = cls->cookie; 161 113 tc_port_matchall->egress.state = CXGB4_MATCHALL_STATE_ENABLED; 162 114 return 0; 115 + 116 + out_free: 117 + cxgb4_sched_class_free(dev, e->idx); 118 + return ret; 163 119 } 164 120 165 121 static void cxgb4_matchall_free_tc(struct net_device *dev) ··· 180 114 struct adapter *adap = netdev2adap(dev); 181 115 182 116 tc_port_matchall = &adap->tc_matchall->port_matchall[pi->port_id]; 117 + cxgb4_matchall_tc_unbind_queues(dev); 183 118 cxgb4_sched_class_free(dev, tc_port_matchall->egress.hwtc); 184 119 185 120 tc_port_matchall->egress.hwtc = SCHED_CLS_NONE;
+27 -1
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c
··· 12 12 struct port_info *pi = netdev2pinfo(dev); 13 13 struct adapter *adap = netdev2adap(dev); 14 14 u32 speed, qcount = 0, qoffset = 0; 15 + u32 start_a, start_b, end_a, end_b; 15 16 int ret; 16 - u8 i; 17 + u8 i, j; 17 18 18 19 if (!mqprio->qopt.num_tc) 19 20 return 0; ··· 47 46 for (i = 0; i < mqprio->qopt.num_tc; i++) { 48 47 qoffset = max_t(u16, mqprio->qopt.offset[i], qoffset); 49 48 qcount += mqprio->qopt.count[i]; 49 + 50 + start_a = mqprio->qopt.offset[i]; 51 + end_a = start_a + mqprio->qopt.count[i] - 1; 52 + for (j = i + 1; j < mqprio->qopt.num_tc; j++) { 53 + start_b = mqprio->qopt.offset[j]; 54 + end_b = start_b + mqprio->qopt.count[j] - 1; 55 + 56 + /* If queue count is 0, then the traffic 57 + * belonging to this class will not use 58 + * ETHOFLD queues. So, no need to validate 59 + * further. 60 + */ 61 + if (!mqprio->qopt.count[i]) 62 + break; 63 + 64 + if (!mqprio->qopt.count[j]) 65 + continue; 66 + 67 + if (max_t(u32, start_a, start_b) <= 68 + min_t(u32, end_a, end_b)) { 69 + netdev_err(dev, 70 + "Queues can't overlap across tc\n"); 71 + return -EINVAL; 72 + } 73 + } 50 74 51 75 /* Convert byte per second to bits per second */ 52 76 min_rate += (mqprio->min_rate[i] * 8);
+16
drivers/net/ethernet/chelsio/cxgb4/sched.c
··· 165 165 return found; 166 166 } 167 167 168 + struct sched_class *cxgb4_sched_queue_lookup(struct net_device *dev, 169 + struct ch_sched_queue *p) 170 + { 171 + struct port_info *pi = netdev2pinfo(dev); 172 + struct sched_queue_entry *qe = NULL; 173 + struct adapter *adap = pi->adapter; 174 + struct sge_eth_txq *txq; 175 + 176 + if (p->queue < 0 || p->queue >= pi->nqsets) 177 + return NULL; 178 + 179 + txq = &adap->sge.ethtxq[pi->first_qset + p->queue]; 180 + qe = t4_sched_entry_lookup(pi, SCHED_QUEUE, txq->q.cntxt_id); 181 + return qe ? &pi->sched_tbl->tab[qe->param.class] : NULL; 182 + } 183 + 168 184 static int t4_sched_queue_unbind(struct port_info *pi, struct ch_sched_queue *p) 169 185 { 170 186 struct sched_queue_entry *qe = NULL;
+2
drivers/net/ethernet/chelsio/cxgb4/sched.h
··· 103 103 return true; 104 104 } 105 105 106 + struct sched_class *cxgb4_sched_queue_lookup(struct net_device *dev, 107 + struct ch_sched_queue *p); 106 108 int cxgb4_sched_class_bind(struct net_device *dev, void *arg, 107 109 enum sched_bind_type type); 108 110 int cxgb4_sched_class_unbind(struct net_device *dev, void *arg,
+1 -3
drivers/net/ethernet/hisilicon/hns/hns_enet.c
··· 565 565 skb = *out_skb = napi_alloc_skb(&ring_data->napi, 566 566 HNS_RX_HEAD_SIZE); 567 567 if (unlikely(!skb)) { 568 - netdev_err(ndev, "alloc rx skb fail\n"); 569 568 ring->stats.sw_err_cnt++; 570 569 return -ENOMEM; 571 570 } ··· 1055 1056 container_of(napi, struct hns_nic_ring_data, napi); 1056 1057 struct hnae_ring *ring = ring_data->ring; 1057 1058 1058 - try_again: 1059 1059 clean_complete += ring_data->poll_one( 1060 1060 ring_data, budget - clean_complete, 1061 1061 ring_data->ex_process); ··· 1064 1066 napi_complete(napi); 1065 1067 ring->q->handle->dev->ops->toggle_ring_irq(ring, 0); 1066 1068 } else { 1067 - goto try_again; 1069 + return budget; 1068 1070 } 1069 1071 } 1070 1072
+6
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
··· 54 54 #define HNS3_INNER_VLAN_TAG 1 55 55 #define HNS3_OUTER_VLAN_TAG 2 56 56 57 + #define HNS3_MIN_TX_LEN 33U 58 + 57 59 /* hns3_pci_tbl - PCI Device ID Table 58 60 * 59 61 * Last entry must be all 0s ··· 1406 1404 struct sk_buff *frag_skb; 1407 1405 int bd_num = 0; 1408 1406 int ret; 1407 + 1408 + /* Hardware can only handle short frames above 32 bytes */ 1409 + if (skb_put_padto(skb, HNS3_MIN_TX_LEN)) 1410 + return NETDEV_TX_OK; 1409 1411 1410 1412 /* Prefetch the data used later */ 1411 1413 prefetch(skb->data);
+2 -3
drivers/net/ethernet/intel/e1000e/e1000.h
··· 185 185 186 186 /* board specific private data structure */ 187 187 struct e1000_adapter { 188 + struct timer_list watchdog_timer; 188 189 struct timer_list phy_info_timer; 189 190 struct timer_list blink_timer; 190 191 191 192 struct work_struct reset_task; 192 - struct delayed_work watchdog_task; 193 - 194 - struct workqueue_struct *e1000_workqueue; 193 + struct work_struct watchdog_task; 195 194 196 195 const struct e1000_info *ei; 197 196
+25 -29
drivers/net/ethernet/intel/e1000e/netdev.c
··· 1780 1780 } 1781 1781 /* guard against interrupt when we're going down */ 1782 1782 if (!test_bit(__E1000_DOWN, &adapter->state)) 1783 - mod_delayed_work(adapter->e1000_workqueue, 1784 - &adapter->watchdog_task, HZ); 1783 + mod_timer(&adapter->watchdog_timer, jiffies + 1); 1785 1784 } 1786 1785 1787 1786 /* Reset on uncorrectable ECC error */ ··· 1860 1861 } 1861 1862 /* guard against interrupt when we're going down */ 1862 1863 if (!test_bit(__E1000_DOWN, &adapter->state)) 1863 - mod_delayed_work(adapter->e1000_workqueue, 1864 - &adapter->watchdog_task, HZ); 1864 + mod_timer(&adapter->watchdog_timer, jiffies + 1); 1865 1865 } 1866 1866 1867 1867 /* Reset on uncorrectable ECC error */ ··· 1905 1907 hw->mac.get_link_status = true; 1906 1908 /* guard against interrupt when we're going down */ 1907 1909 if (!test_bit(__E1000_DOWN, &adapter->state)) 1908 - mod_delayed_work(adapter->e1000_workqueue, 1909 - &adapter->watchdog_task, HZ); 1910 + mod_timer(&adapter->watchdog_timer, jiffies + 1); 1910 1911 } 1911 1912 1912 1913 if (!test_bit(__E1000_DOWN, &adapter->state)) ··· 4281 4284 4282 4285 napi_synchronize(&adapter->napi); 4283 4286 4287 + del_timer_sync(&adapter->watchdog_timer); 4284 4288 del_timer_sync(&adapter->phy_info_timer); 4285 4289 4286 4290 spin_lock(&adapter->stats64_lock); ··· 5153 5155 } 5154 5156 } 5155 5157 5158 + /** 5159 + * e1000_watchdog - Timer Call-back 5160 + * @data: pointer to adapter cast into an unsigned long 5161 + **/ 5162 + static void e1000_watchdog(struct timer_list *t) 5163 + { 5164 + struct e1000_adapter *adapter = from_timer(adapter, t, watchdog_timer); 5165 + 5166 + /* Do the rest outside of interrupt context */ 5167 + schedule_work(&adapter->watchdog_task); 5168 + 5169 + /* TODO: make this use queue_delayed_work() */ 5170 + } 5171 + 5156 5172 static void e1000_watchdog_task(struct work_struct *work) 5157 5173 { 5158 5174 struct e1000_adapter *adapter = container_of(work, 5159 5175 struct e1000_adapter, 5160 - watchdog_task.work); 5176 + watchdog_task); 5161 5177 struct net_device *netdev = adapter->netdev; 5162 5178 struct e1000_mac_info *mac = &adapter->hw.mac; 5163 5179 struct e1000_phy_info *phy = &adapter->hw.phy; ··· 5419 5407 5420 5408 /* Reset the timer */ 5421 5409 if (!test_bit(__E1000_DOWN, &adapter->state)) 5422 - queue_delayed_work(adapter->e1000_workqueue, 5423 - &adapter->watchdog_task, 5424 - round_jiffies(2 * HZ)); 5410 + mod_timer(&adapter->watchdog_timer, 5411 + round_jiffies(jiffies + 2 * HZ)); 5425 5412 } 5426 5413 5427 5414 #define E1000_TX_FLAGS_CSUM 0x00000001 ··· 7460 7449 goto err_eeprom; 7461 7450 } 7462 7451 7463 - adapter->e1000_workqueue = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, 7464 - e1000e_driver_name); 7465 - 7466 - if (!adapter->e1000_workqueue) { 7467 - err = -ENOMEM; 7468 - goto err_workqueue; 7469 - } 7470 - 7471 - INIT_DELAYED_WORK(&adapter->watchdog_task, e1000_watchdog_task); 7472 - queue_delayed_work(adapter->e1000_workqueue, &adapter->watchdog_task, 7473 - 0); 7474 - 7452 + timer_setup(&adapter->watchdog_timer, e1000_watchdog, 0); 7475 7453 timer_setup(&adapter->phy_info_timer, e1000_update_phy_info, 0); 7476 7454 7477 7455 INIT_WORK(&adapter->reset_task, e1000_reset_task); 7456 + INIT_WORK(&adapter->watchdog_task, e1000_watchdog_task); 7478 7457 INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround); 7479 7458 INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task); 7480 7459 INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang); ··· 7558 7557 return 0; 7559 7558 7560 7559 err_register: 7561 - flush_workqueue(adapter->e1000_workqueue); 7562 - destroy_workqueue(adapter->e1000_workqueue); 7563 - err_workqueue: 7564 7560 if (!(adapter->flags & FLAG_HAS_AMT)) 7565 7561 e1000e_release_hw_control(adapter); 7566 7562 err_eeprom: ··· 7602 7604 * from being rescheduled. 7603 7605 */ 7604 7606 set_bit(__E1000_DOWN, &adapter->state); 7607 + del_timer_sync(&adapter->watchdog_timer); 7605 7608 del_timer_sync(&adapter->phy_info_timer); 7606 7609 7607 7610 cancel_work_sync(&adapter->reset_task); 7611 + cancel_work_sync(&adapter->watchdog_task); 7608 7612 cancel_work_sync(&adapter->downshift_task); 7609 7613 cancel_work_sync(&adapter->update_phy_task); 7610 7614 cancel_work_sync(&adapter->print_hang_task); 7611 - 7612 - cancel_delayed_work(&adapter->watchdog_task); 7613 - flush_workqueue(adapter->e1000_workqueue); 7614 - destroy_workqueue(adapter->e1000_workqueue); 7615 7615 7616 7616 if (adapter->flags & FLAG_HAS_HW_TIMESTAMP) { 7617 7617 cancel_work_sync(&adapter->tx_hwtstamp_work);
+5
drivers/net/ethernet/intel/i40e/i40e_adminq.c
··· 536 536 (aq->api_maj_ver == 1 && 537 537 aq->api_min_ver >= I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722)) 538 538 hw->flags |= I40E_HW_FLAG_FW_LLDP_STOPPABLE; 539 + 540 + if (aq->api_maj_ver > 1 || 541 + (aq->api_maj_ver == 1 && 542 + aq->api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_X722)) 543 + hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE; 539 544 /* fall through */ 540 545 default: 541 546 break;
+18 -4
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
··· 2322 2322 } 2323 2323 2324 2324 /** 2325 + * i40e_vc_validate_vqs_bitmaps - validate Rx/Tx queue bitmaps from VIRTHCHNL 2326 + * @vqs: virtchnl_queue_select structure containing bitmaps to validate 2327 + * 2328 + * Returns true if validation was successful, else false. 2329 + */ 2330 + static bool i40e_vc_validate_vqs_bitmaps(struct virtchnl_queue_select *vqs) 2331 + { 2332 + if ((!vqs->rx_queues && !vqs->tx_queues) || 2333 + vqs->rx_queues >= BIT(I40E_MAX_VF_QUEUES) || 2334 + vqs->tx_queues >= BIT(I40E_MAX_VF_QUEUES)) 2335 + return false; 2336 + 2337 + return true; 2338 + } 2339 + 2340 + /** 2325 2341 * i40e_vc_enable_queues_msg 2326 2342 * @vf: pointer to the VF info 2327 2343 * @msg: pointer to the msg buffer ··· 2362 2346 goto error_param; 2363 2347 } 2364 2348 2365 - if ((0 == vqs->rx_queues) && (0 == vqs->tx_queues)) { 2349 + if (i40e_vc_validate_vqs_bitmaps(vqs)) { 2366 2350 aq_ret = I40E_ERR_PARAM; 2367 2351 goto error_param; 2368 2352 } ··· 2424 2408 goto error_param; 2425 2409 } 2426 2410 2427 - if ((vqs->rx_queues == 0 && vqs->tx_queues == 0) || 2428 - vqs->rx_queues > I40E_MAX_VF_QUEUES || 2429 - vqs->tx_queues > I40E_MAX_VF_QUEUES) { 2411 + if (i40e_vc_validate_vqs_bitmaps(vqs)) { 2430 2412 aq_ret = I40E_ERR_PARAM; 2431 2413 goto error_param; 2432 2414 }
+2
drivers/net/ethernet/intel/iavf/iavf.h
··· 415 415 void iavf_disable_channels(struct iavf_adapter *adapter); 416 416 void iavf_add_cloud_filter(struct iavf_adapter *adapter); 417 417 void iavf_del_cloud_filter(struct iavf_adapter *adapter); 418 + struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter, 419 + const u8 *macaddr); 418 420 #endif /* _IAVF_H_ */
+13 -4
drivers/net/ethernet/intel/iavf/iavf_main.c
··· 743 743 * 744 744 * Returns ptr to the filter object or NULL when no memory available. 745 745 **/ 746 - static struct 747 - iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter, 748 - const u8 *macaddr) 746 + struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter, 747 + const u8 *macaddr) 749 748 { 750 749 struct iavf_mac_filter *f; 751 750 ··· 2064 2065 struct virtchnl_vf_resource *vfres = adapter->vf_res; 2065 2066 struct net_device *netdev = adapter->netdev; 2066 2067 struct iavf_hw *hw = &adapter->hw; 2068 + struct iavf_mac_filter *f, *ftmp; 2067 2069 struct iavf_vlan_filter *vlf; 2068 2070 struct iavf_cloud_filter *cf; 2069 - struct iavf_mac_filter *f; 2070 2071 u32 reg_val; 2071 2072 int i = 0, err; 2072 2073 bool running; ··· 2180 2181 2181 2182 spin_lock_bh(&adapter->mac_vlan_list_lock); 2182 2183 2184 + /* Delete filter for the current MAC address, it could have 2185 + * been changed by the PF via administratively set MAC. 2186 + * Will be re-added via VIRTCHNL_OP_GET_VF_RESOURCES. 2187 + */ 2188 + list_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) { 2189 + if (ether_addr_equal(f->macaddr, adapter->hw.mac.addr)) { 2190 + list_del(&f->list); 2191 + kfree(f); 2192 + } 2193 + } 2183 2194 /* re-add all MAC filters */ 2184 2195 list_for_each_entry(f, &adapter->mac_filter_list, list) { 2185 2196 f->add = true;
+3
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
··· 1359 1359 ether_addr_copy(netdev->perm_addr, 1360 1360 adapter->hw.mac.addr); 1361 1361 } 1362 + spin_lock_bh(&adapter->mac_vlan_list_lock); 1363 + iavf_add_filter(adapter, adapter->hw.mac.addr); 1364 + spin_unlock_bh(&adapter->mac_vlan_list_lock); 1362 1365 iavf_process_config(adapter); 1363 1366 } 1364 1367 break;
+2 -6
drivers/net/ethernet/intel/igb/e1000_82575.c
··· 530 530 dev_spec->module_plugged = true; 531 531 if (eth_flags->e1000_base_lx || eth_flags->e1000_base_sx) { 532 532 hw->phy.media_type = e1000_media_type_internal_serdes; 533 - } else if (eth_flags->e100_base_fx) { 533 + } else if (eth_flags->e100_base_fx || eth_flags->e100_base_lx) { 534 534 dev_spec->sgmii_active = true; 535 535 hw->phy.media_type = e1000_media_type_internal_serdes; 536 536 } else if (eth_flags->e1000_base_t) { ··· 657 657 break; 658 658 } 659 659 660 - /* do not change link mode for 100BaseFX */ 661 - if (dev_spec->eth_flags.e100_base_fx) 662 - break; 663 - 664 660 /* change current link mode setting */ 665 661 ctrl_ext &= ~E1000_CTRL_EXT_LINK_MODE_MASK; 666 662 667 - if (hw->phy.media_type == e1000_media_type_copper) 663 + if (dev_spec->sgmii_active) 668 664 ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_SGMII; 669 665 else 670 666 ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES;
+1 -1
drivers/net/ethernet/intel/igb/igb_ethtool.c
··· 181 181 advertising &= ~ADVERTISED_1000baseKX_Full; 182 182 } 183 183 } 184 - if (eth_flags->e100_base_fx) { 184 + if (eth_flags->e100_base_fx || eth_flags->e100_base_lx) { 185 185 supported |= SUPPORTED_100baseT_Full; 186 186 advertising |= ADVERTISED_100baseT_Full; 187 187 }
+27 -10
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
··· 5239 5239 struct ixgbe_hw *hw = &adapter->hw; 5240 5240 struct hlist_node *node2; 5241 5241 struct ixgbe_fdir_filter *filter; 5242 - u64 action; 5242 + u8 queue; 5243 5243 5244 5244 spin_lock(&adapter->fdir_perfect_lock); 5245 5245 ··· 5248 5248 5249 5249 hlist_for_each_entry_safe(filter, node2, 5250 5250 &adapter->fdir_filter_list, fdir_node) { 5251 - action = filter->action; 5252 - if (action != IXGBE_FDIR_DROP_QUEUE && action != 0) 5253 - action = 5254 - (action >> ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF) - 1; 5251 + if (filter->action == IXGBE_FDIR_DROP_QUEUE) { 5252 + queue = IXGBE_FDIR_DROP_QUEUE; 5253 + } else { 5254 + u32 ring = ethtool_get_flow_spec_ring(filter->action); 5255 + u8 vf = ethtool_get_flow_spec_ring_vf(filter->action); 5256 + 5257 + if (!vf && (ring >= adapter->num_rx_queues)) { 5258 + e_err(drv, "FDIR restore failed without VF, ring: %u\n", 5259 + ring); 5260 + continue; 5261 + } else if (vf && 5262 + ((vf > adapter->num_vfs) || 5263 + ring >= adapter->num_rx_queues_per_pool)) { 5264 + e_err(drv, "FDIR restore failed with VF, vf: %hhu, ring: %u\n", 5265 + vf, ring); 5266 + continue; 5267 + } 5268 + 5269 + /* Map the ring onto the absolute queue index */ 5270 + if (!vf) 5271 + queue = adapter->rx_ring[ring]->reg_idx; 5272 + else 5273 + queue = ((vf - 1) * 5274 + adapter->num_rx_queues_per_pool) + ring; 5275 + } 5255 5276 5256 5277 ixgbe_fdir_write_perfect_filter_82599(hw, 5257 - &filter->filter, 5258 - filter->sw_idx, 5259 - (action == IXGBE_FDIR_DROP_QUEUE) ? 5260 - IXGBE_FDIR_DROP_QUEUE : 5261 - adapter->rx_ring[action]->reg_idx); 5278 + &filter->filter, filter->sw_idx, queue); 5262 5279 } 5263 5280 5264 5281 spin_unlock(&adapter->fdir_perfect_lock);
-5
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
··· 2081 2081 struct ixgbe_hw *hw = &adapter->hw; 2082 2082 int count = 0; 2083 2083 2084 - if ((netdev_uc_count(netdev)) > 10) { 2085 - pr_err("Too many unicast filters - No Space\n"); 2086 - return -ENOSPC; 2087 - } 2088 - 2089 2084 if (!netdev_uc_empty(netdev)) { 2090 2085 struct netdev_hw_addr *ha; 2091 2086
+10 -9
drivers/net/ethernet/marvell/mvneta.c
··· 2081 2081 mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, 2082 2082 struct bpf_prog *prog, struct xdp_buff *xdp) 2083 2083 { 2084 - u32 ret, act = bpf_prog_run_xdp(prog, xdp); 2084 + unsigned int len; 2085 + u32 ret, act; 2086 + 2087 + len = xdp->data_end - xdp->data_hard_start - pp->rx_offset_correction; 2088 + act = bpf_prog_run_xdp(prog, xdp); 2085 2089 2086 2090 switch (act) { 2087 2091 case XDP_PASS: ··· 2098 2094 if (err) { 2099 2095 ret = MVNETA_XDP_DROPPED; 2100 2096 __page_pool_put_page(rxq->page_pool, 2101 - virt_to_head_page(xdp->data), 2102 - xdp->data_end - xdp->data_hard_start, 2103 - true); 2097 + virt_to_head_page(xdp->data), 2098 + len, true); 2104 2099 } else { 2105 2100 ret = MVNETA_XDP_REDIR; 2106 2101 } ··· 2109 2106 ret = mvneta_xdp_xmit_back(pp, xdp); 2110 2107 if (ret != MVNETA_XDP_TX) 2111 2108 __page_pool_put_page(rxq->page_pool, 2112 - virt_to_head_page(xdp->data), 2113 - xdp->data_end - xdp->data_hard_start, 2114 - true); 2109 + virt_to_head_page(xdp->data), 2110 + len, true); 2115 2111 break; 2116 2112 default: 2117 2113 bpf_warn_invalid_xdp_action(act); ··· 2121 2119 case XDP_DROP: 2122 2120 __page_pool_put_page(rxq->page_pool, 2123 2121 virt_to_head_page(xdp->data), 2124 - xdp->data_end - xdp->data_hard_start, 2125 - true); 2122 + len, true); 2126 2123 ret = MVNETA_XDP_DROPPED; 2127 2124 break; 2128 2125 }
+1 -1
drivers/net/ethernet/mellanox/mlx4/crdump.c
··· 182 182 crdump_enable_crspace_access(dev, cr_space); 183 183 184 184 /* Get the available snapshot ID for the dumps */ 185 - id = devlink_region_shapshot_id_get(devlink); 185 + id = devlink_region_snapshot_id_get(devlink); 186 186 187 187 /* Try to capture dumps */ 188 188 mlx4_crdump_collect_crspace(dev, cr_space, id);
+41 -13
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
··· 860 860 u64 len; 861 861 int err; 862 862 863 + if (skb_cow_head(skb, MLXSW_TXHDR_LEN)) { 864 + this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped); 865 + dev_kfree_skb_any(skb); 866 + return NETDEV_TX_OK; 867 + } 868 + 863 869 memset(skb->cb, 0, sizeof(struct mlxsw_skb_cb)); 864 870 865 871 if (mlxsw_core_skb_transmit_busy(mlxsw_sp->core, &tx_info)) 866 872 return NETDEV_TX_BUSY; 867 - 868 - if (unlikely(skb_headroom(skb) < MLXSW_TXHDR_LEN)) { 869 - struct sk_buff *skb_orig = skb; 870 - 871 - skb = skb_realloc_headroom(skb, MLXSW_TXHDR_LEN); 872 - if (!skb) { 873 - this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped); 874 - dev_kfree_skb_any(skb_orig); 875 - return NETDEV_TX_OK; 876 - } 877 - dev_consume_skb_any(skb_orig); 878 - } 879 873 880 874 if (eth_skb_pad(skb)) { 881 875 this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped); ··· 1209 1215 periodic_hw_stats.update_dw.work); 1210 1216 1211 1217 if (!netif_carrier_ok(mlxsw_sp_port->dev)) 1218 + /* Note: mlxsw_sp_port_down_wipe_counters() clears the cache as 1219 + * necessary when port goes down. 1220 + */ 1212 1221 goto out; 1213 1222 1214 1223 mlxsw_sp_port_get_hw_stats(mlxsw_sp_port->dev, ··· 4321 4324 return 0; 4322 4325 } 4323 4326 4327 + static void 4328 + mlxsw_sp_port_down_wipe_counters(struct mlxsw_sp_port *mlxsw_sp_port) 4329 + { 4330 + int i; 4331 + 4332 + for (i = 0; i < TC_MAX_QUEUE; i++) 4333 + mlxsw_sp_port->periodic_hw_stats.xstats.backlog[i] = 0; 4334 + } 4335 + 4324 4336 static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg, 4325 4337 char *pude_pl, void *priv) 4326 4338 { ··· 4351 4345 } else { 4352 4346 netdev_info(mlxsw_sp_port->dev, "link down\n"); 4353 4347 netif_carrier_off(mlxsw_sp_port->dev); 4348 + mlxsw_sp_port_down_wipe_counters(mlxsw_sp_port); 4354 4349 } 4355 4350 } 4356 4351 ··· 5139 5132 return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info, extack); 5140 5133 } 5141 5134 5135 + static int mlxsw_sp3_init(struct mlxsw_core *mlxsw_core, 5136 + const struct mlxsw_bus_info *mlxsw_bus_info, 5137 + struct netlink_ext_ack *extack) 5138 + { 5139 + struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); 5140 + 5141 + mlxsw_sp->kvdl_ops = &mlxsw_sp2_kvdl_ops; 5142 + mlxsw_sp->afa_ops = &mlxsw_sp2_act_afa_ops; 5143 + mlxsw_sp->afk_ops = &mlxsw_sp2_afk_ops; 5144 + mlxsw_sp->mr_tcam_ops = &mlxsw_sp2_mr_tcam_ops; 5145 + mlxsw_sp->acl_tcam_ops = &mlxsw_sp2_acl_tcam_ops; 5146 + mlxsw_sp->nve_ops_arr = mlxsw_sp2_nve_ops_arr; 5147 + mlxsw_sp->mac_mask = mlxsw_sp2_mac_mask; 5148 + mlxsw_sp->rif_ops_arr = mlxsw_sp2_rif_ops_arr; 5149 + mlxsw_sp->sb_vals = &mlxsw_sp2_sb_vals; 5150 + mlxsw_sp->port_type_speed_ops = &mlxsw_sp2_port_type_speed_ops; 5151 + mlxsw_sp->ptp_ops = &mlxsw_sp2_ptp_ops; 5152 + 5153 + return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info, extack); 5154 + } 5155 + 5142 5156 static void mlxsw_sp_fini(struct mlxsw_core *mlxsw_core) 5143 5157 { 5144 5158 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); ··· 5662 5634 static struct mlxsw_driver mlxsw_sp3_driver = { 5663 5635 .kind = mlxsw_sp3_driver_name, 5664 5636 .priv_size = sizeof(struct mlxsw_sp), 5665 - .init = mlxsw_sp2_init, 5637 + .init = mlxsw_sp3_init, 5666 5638 .fini = mlxsw_sp_fini, 5667 5639 .basic_trap_groups_set = mlxsw_sp_basic_trap_groups_set, 5668 5640 .port_split = mlxsw_sp_port_split,
+23 -7
drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
··· 195 195 return -EOPNOTSUPP; 196 196 } 197 197 198 + static u64 199 + mlxsw_sp_xstats_backlog(struct mlxsw_sp_port_xstats *xstats, int tclass_num) 200 + { 201 + return xstats->backlog[tclass_num] + 202 + xstats->backlog[tclass_num + 8]; 203 + } 204 + 205 + static u64 206 + mlxsw_sp_xstats_tail_drop(struct mlxsw_sp_port_xstats *xstats, int tclass_num) 207 + { 208 + return xstats->tail_drop[tclass_num] + 209 + xstats->tail_drop[tclass_num + 8]; 210 + } 211 + 198 212 static void 199 213 mlxsw_sp_qdisc_bstats_per_priority_get(struct mlxsw_sp_port_xstats *xstats, 200 214 u8 prio_bitmap, u64 *tx_packets, ··· 283 269 &stats_base->tx_bytes); 284 270 red_base->prob_mark = xstats->ecn; 285 271 red_base->prob_drop = xstats->wred_drop[tclass_num]; 286 - red_base->pdrop = xstats->tail_drop[tclass_num]; 272 + red_base->pdrop = mlxsw_sp_xstats_tail_drop(xstats, tclass_num); 287 273 288 274 stats_base->overlimits = red_base->prob_drop + red_base->prob_mark; 289 275 stats_base->drops = red_base->prob_drop + red_base->pdrop; ··· 384 370 385 371 early_drops = xstats->wred_drop[tclass_num] - xstats_base->prob_drop; 386 372 marks = xstats->ecn - xstats_base->prob_mark; 387 - pdrops = xstats->tail_drop[tclass_num] - xstats_base->pdrop; 373 + pdrops = mlxsw_sp_xstats_tail_drop(xstats, tclass_num) - 374 + xstats_base->pdrop; 388 375 389 376 res->pdrop += pdrops; 390 377 res->prob_drop += early_drops; ··· 418 403 419 404 overlimits = xstats->wred_drop[tclass_num] + xstats->ecn - 420 405 stats_base->overlimits; 421 - drops = xstats->wred_drop[tclass_num] + xstats->tail_drop[tclass_num] - 406 + drops = xstats->wred_drop[tclass_num] + 407 + mlxsw_sp_xstats_tail_drop(xstats, tclass_num) - 422 408 stats_base->drops; 423 - backlog = xstats->backlog[tclass_num]; 409 + backlog = mlxsw_sp_xstats_backlog(xstats, tclass_num); 424 410 425 411 _bstats_update(stats_ptr->bstats, tx_bytes, tx_packets); 426 412 stats_ptr->qstats->overlimits += overlimits; ··· 592 576 tx_packets = stats->tx_packets - stats_base->tx_packets; 593 577 594 578 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) { 595 - drops += xstats->tail_drop[i]; 579 + drops += mlxsw_sp_xstats_tail_drop(xstats, i); 596 580 drops += xstats->wred_drop[i]; 597 - backlog += xstats->backlog[i]; 581 + backlog += mlxsw_sp_xstats_backlog(xstats, i); 598 582 } 599 583 drops = drops - stats_base->drops; 600 584 ··· 630 614 631 615 stats_base->drops = 0; 632 616 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) { 633 - stats_base->drops += xstats->tail_drop[i]; 617 + stats_base->drops += mlxsw_sp_xstats_tail_drop(xstats, i); 634 618 stats_base->drops += xstats->wred_drop[i]; 635 619 } 636 620
+6 -11
drivers/net/ethernet/mellanox/mlxsw/switchx2.c
··· 299 299 u64 len; 300 300 int err; 301 301 302 + if (skb_cow_head(skb, MLXSW_TXHDR_LEN)) { 303 + this_cpu_inc(mlxsw_sx_port->pcpu_stats->tx_dropped); 304 + dev_kfree_skb_any(skb); 305 + return NETDEV_TX_OK; 306 + } 307 + 302 308 memset(skb->cb, 0, sizeof(struct mlxsw_skb_cb)); 303 309 304 310 if (mlxsw_core_skb_transmit_busy(mlxsw_sx->core, &tx_info)) 305 311 return NETDEV_TX_BUSY; 306 312 307 - if (unlikely(skb_headroom(skb) < MLXSW_TXHDR_LEN)) { 308 - struct sk_buff *skb_orig = skb; 309 - 310 - skb = skb_realloc_headroom(skb, MLXSW_TXHDR_LEN); 311 - if (!skb) { 312 - this_cpu_inc(mlxsw_sx_port->pcpu_stats->tx_dropped); 313 - dev_kfree_skb_any(skb_orig); 314 - return NETDEV_TX_OK; 315 - } 316 - dev_consume_skb_any(skb_orig); 317 - } 318 313 mlxsw_sx_txhdr_construct(skb, &tx_info); 319 314 /* TX header is consumed by HW on the way so we shouldn't count its 320 315 * bytes as being sent.
+21 -17
drivers/net/ethernet/renesas/sh_eth.c
··· 2204 2204 if (cd->tsu) { 2205 2205 add_tsu_reg(ARSTR); 2206 2206 add_tsu_reg(TSU_CTRST); 2207 - add_tsu_reg(TSU_FWEN0); 2208 - add_tsu_reg(TSU_FWEN1); 2209 - add_tsu_reg(TSU_FCM); 2210 - add_tsu_reg(TSU_BSYSL0); 2211 - add_tsu_reg(TSU_BSYSL1); 2212 - add_tsu_reg(TSU_PRISL0); 2213 - add_tsu_reg(TSU_PRISL1); 2214 - add_tsu_reg(TSU_FWSL0); 2215 - add_tsu_reg(TSU_FWSL1); 2207 + if (cd->dual_port) { 2208 + add_tsu_reg(TSU_FWEN0); 2209 + add_tsu_reg(TSU_FWEN1); 2210 + add_tsu_reg(TSU_FCM); 2211 + add_tsu_reg(TSU_BSYSL0); 2212 + add_tsu_reg(TSU_BSYSL1); 2213 + add_tsu_reg(TSU_PRISL0); 2214 + add_tsu_reg(TSU_PRISL1); 2215 + add_tsu_reg(TSU_FWSL0); 2216 + add_tsu_reg(TSU_FWSL1); 2217 + } 2216 2218 add_tsu_reg(TSU_FWSLC); 2217 - add_tsu_reg(TSU_QTAGM0); 2218 - add_tsu_reg(TSU_QTAGM1); 2219 - add_tsu_reg(TSU_FWSR); 2220 - add_tsu_reg(TSU_FWINMK); 2221 - add_tsu_reg(TSU_ADQT0); 2222 - add_tsu_reg(TSU_ADQT1); 2223 - add_tsu_reg(TSU_VTAG0); 2224 - add_tsu_reg(TSU_VTAG1); 2219 + if (cd->dual_port) { 2220 + add_tsu_reg(TSU_QTAGM0); 2221 + add_tsu_reg(TSU_QTAGM1); 2222 + add_tsu_reg(TSU_FWSR); 2223 + add_tsu_reg(TSU_FWINMK); 2224 + add_tsu_reg(TSU_ADQT0); 2225 + add_tsu_reg(TSU_ADQT1); 2226 + add_tsu_reg(TSU_VTAG0); 2227 + add_tsu_reg(TSU_VTAG1); 2228 + } 2225 2229 add_tsu_reg(TSU_ADSBSY); 2226 2230 add_tsu_reg(TSU_TEN); 2227 2231 add_tsu_reg(TSU_POST1);
+13 -7
drivers/net/ethernet/socionext/sni_ave.c
··· 424 424 phy_ethtool_get_wol(ndev->phydev, wol); 425 425 } 426 426 427 + static int __ave_ethtool_set_wol(struct net_device *ndev, 428 + struct ethtool_wolinfo *wol) 429 + { 430 + if (!ndev->phydev || 431 + (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE))) 432 + return -EOPNOTSUPP; 433 + 434 + return phy_ethtool_set_wol(ndev->phydev, wol); 435 + } 436 + 427 437 static int ave_ethtool_set_wol(struct net_device *ndev, 428 438 struct ethtool_wolinfo *wol) 429 439 { 430 440 int ret; 431 441 432 - if (!ndev->phydev || 433 - (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE))) 434 - return -EOPNOTSUPP; 435 - 436 - ret = phy_ethtool_set_wol(ndev->phydev, wol); 442 + ret = __ave_ethtool_set_wol(ndev, wol); 437 443 if (!ret) 438 444 device_set_wakeup_enable(&ndev->dev, !!wol->wolopts); 439 445 ··· 1222 1216 1223 1217 /* set wol initial state disabled */ 1224 1218 wol.wolopts = 0; 1225 - ave_ethtool_set_wol(ndev, &wol); 1219 + __ave_ethtool_set_wol(ndev, &wol); 1226 1220 1227 1221 if (!phy_interface_is_rgmii(phydev)) 1228 1222 phy_set_max_speed(phydev, SPEED_100); ··· 1774 1768 1775 1769 ave_ethtool_get_wol(ndev, &wol); 1776 1770 wol.wolopts = priv->wolopts; 1777 - ave_ethtool_set_wol(ndev, &wol); 1771 + __ave_ethtool_set_wol(ndev, &wol); 1778 1772 1779 1773 if (ndev->phydev) { 1780 1774 ret = phy_resume(ndev->phydev);
+36 -16
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
··· 80 80 if (attr->max_size && (attr->max_size > size)) 81 81 size = attr->max_size; 82 82 83 - skb = netdev_alloc_skb_ip_align(priv->dev, size); 83 + skb = netdev_alloc_skb(priv->dev, size); 84 84 if (!skb) 85 85 return NULL; 86 86 ··· 244 244 struct net_device *orig_ndev) 245 245 { 246 246 struct stmmac_test_priv *tpriv = pt->af_packet_priv; 247 + unsigned char *src = tpriv->packet->src; 248 + unsigned char *dst = tpriv->packet->dst; 247 249 struct stmmachdr *shdr; 248 250 struct ethhdr *ehdr; 249 251 struct udphdr *uhdr; ··· 262 260 goto out; 263 261 264 262 ehdr = (struct ethhdr *)skb_mac_header(skb); 265 - if (tpriv->packet->dst) { 266 - if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->dst)) 263 + if (dst) { 264 + if (!ether_addr_equal_unaligned(ehdr->h_dest, dst)) 267 265 goto out; 268 266 } 269 267 if (tpriv->packet->sarc) { 270 - if (!ether_addr_equal(ehdr->h_source, ehdr->h_dest)) 268 + if (!ether_addr_equal_unaligned(ehdr->h_source, ehdr->h_dest)) 271 269 goto out; 272 - } else if (tpriv->packet->src) { 273 - if (!ether_addr_equal(ehdr->h_source, tpriv->packet->src)) 270 + } else if (src) { 271 + if (!ether_addr_equal_unaligned(ehdr->h_source, src)) 274 272 goto out; 275 273 } 276 274 ··· 716 714 struct ethhdr *ehdr; 717 715 718 716 ehdr = (struct ethhdr *)skb_mac_header(skb); 719 - if (!ether_addr_equal(ehdr->h_source, orig_ndev->dev_addr)) 717 + if (!ether_addr_equal_unaligned(ehdr->h_source, orig_ndev->dev_addr)) 720 718 goto out; 721 719 if (ehdr->h_proto != htons(ETH_P_PAUSE)) 722 720 goto out; ··· 853 851 if (tpriv->vlan_id) { 854 852 if (skb->vlan_proto != htons(proto)) 855 853 goto out; 856 - if (skb->vlan_tci != tpriv->vlan_id) 854 + if (skb->vlan_tci != tpriv->vlan_id) { 855 + /* Means filter did not work. */ 856 + tpriv->ok = false; 857 + complete(&tpriv->comp); 857 858 goto out; 859 + } 858 860 } 859 861 860 862 ehdr = (struct ethhdr *)skb_mac_header(skb); 861 - if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->dst)) 863 + if (!ether_addr_equal_unaligned(ehdr->h_dest, tpriv->packet->dst)) 862 864 goto out; 863 865 864 866 ihdr = ip_hdr(skb); ··· 971 965 { 972 966 int ret, prev_cap = priv->dma_cap.vlhash; 973 967 968 + if (!(priv->dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) 969 + return -EOPNOTSUPP; 970 + 974 971 priv->dma_cap.vlhash = 0; 975 972 ret = __stmmac_test_vlanfilt(priv); 976 973 priv->dma_cap.vlhash = prev_cap; ··· 1065 1056 static int stmmac_test_dvlanfilt_perfect(struct stmmac_priv *priv) 1066 1057 { 1067 1058 int ret, prev_cap = priv->dma_cap.vlhash; 1059 + 1060 + if (!(priv->dev->features & NETIF_F_HW_VLAN_STAG_FILTER)) 1061 + return -EOPNOTSUPP; 1068 1062 1069 1063 priv->dma_cap.vlhash = 0; 1070 1064 ret = __stmmac_test_dvlanfilt(priv); ··· 1335 1323 struct stmmac_packet_attrs attr = { }; 1336 1324 struct flow_dissector *dissector; 1337 1325 struct flow_cls_offload *cls; 1326 + int ret, old_enable = 0; 1338 1327 struct flow_rule *rule; 1339 - int ret; 1340 1328 1341 1329 if (!tc_can_offload(priv->dev)) 1342 1330 return -EOPNOTSUPP; 1343 1331 if (!priv->dma_cap.l3l4fnum) 1344 1332 return -EOPNOTSUPP; 1345 - if (priv->rss.enable) 1333 + if (priv->rss.enable) { 1334 + old_enable = priv->rss.enable; 1335 + priv->rss.enable = false; 1346 1336 stmmac_rss_configure(priv, priv->hw, NULL, 1347 1337 priv->plat->rx_queues_to_use); 1338 + } 1348 1339 1349 1340 dissector = kzalloc(sizeof(*dissector), GFP_KERNEL); 1350 1341 if (!dissector) { ··· 1414 1399 cleanup_dissector: 1415 1400 kfree(dissector); 1416 1401 cleanup_rss: 1417 - if (priv->rss.enable) { 1402 + if (old_enable) { 1403 + priv->rss.enable = old_enable; 1418 1404 stmmac_rss_configure(priv, priv->hw, &priv->rss, 1419 1405 priv->plat->rx_queues_to_use); 1420 1406 } ··· 1460 1444 struct stmmac_packet_attrs attr = { }; 1461 1445 struct flow_dissector *dissector; 1462 1446 struct flow_cls_offload *cls; 1447 + int ret, old_enable = 0; 1463 1448 struct flow_rule *rule; 1464 - int ret; 1465 1449 1466 1450 if (!tc_can_offload(priv->dev)) 1467 1451 return -EOPNOTSUPP; 1468 1452 if (!priv->dma_cap.l3l4fnum) 1469 1453 return -EOPNOTSUPP; 1470 - if (priv->rss.enable) 1454 + if (priv->rss.enable) { 1455 + old_enable = priv->rss.enable; 1456 + priv->rss.enable = false; 1471 1457 stmmac_rss_configure(priv, priv->hw, NULL, 1472 1458 priv->plat->rx_queues_to_use); 1459 + } 1473 1460 1474 1461 dissector = kzalloc(sizeof(*dissector), GFP_KERNEL); 1475 1462 if (!dissector) { ··· 1544 1525 cleanup_dissector: 1545 1526 kfree(dissector); 1546 1527 cleanup_rss: 1547 - if (priv->rss.enable) { 1528 + if (old_enable) { 1529 + priv->rss.enable = old_enable; 1548 1530 stmmac_rss_configure(priv, priv->hw, &priv->rss, 1549 1531 priv->plat->rx_queues_to_use); 1550 1532 } ··· 1598 1578 struct arphdr *ahdr; 1599 1579 1600 1580 ehdr = (struct ethhdr *)skb_mac_header(skb); 1601 - if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->src)) 1581 + if (!ether_addr_equal_unaligned(ehdr->h_dest, tpriv->packet->src)) 1602 1582 goto out; 1603 1583 1604 1584 ahdr = arp_hdr(skb);
+4
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
··· 577 577 { 578 578 int ret = 0; 579 579 580 + /* When RSS is enabled, the filtering will be bypassed */ 581 + if (priv->rss.enable) 582 + return -EBUSY; 583 + 580 584 switch (cls->command) { 581 585 case FLOW_CLS_REPLACE: 582 586 ret = tc_add_flow(priv, cls);
-2
drivers/net/hyperv/rndis_filter.c
··· 1443 1443 /* Halt and release the rndis device */ 1444 1444 rndis_filter_halt_device(net_dev, rndis_dev); 1445 1445 1446 - net_dev->extension = NULL; 1447 - 1448 1446 netvsc_device_remove(dev); 1449 1447 } 1450 1448
+3 -2
drivers/net/macvlan.c
··· 259 259 struct net_device *src, 260 260 enum macvlan_mode mode) 261 261 { 262 - const struct ethhdr *eth = skb_eth_hdr(skb); 262 + const struct ethhdr *eth = eth_hdr(skb); 263 263 const struct macvlan_dev *vlan; 264 264 struct sk_buff *nskb; 265 265 unsigned int i; ··· 513 513 const struct macvlan_dev *dest; 514 514 515 515 if (vlan->mode == MACVLAN_MODE_BRIDGE) { 516 - const struct ethhdr *eth = (void *)skb->data; 516 + const struct ethhdr *eth = skb_eth_hdr(skb); 517 517 518 518 /* send to other bridge ports directly */ 519 519 if (is_multicast_ether_addr(eth->h_dest)) { 520 + skb_reset_mac_header(skb); 520 521 macvlan_broadcast(skb, port, dev, MACVLAN_MODE_BRIDGE); 521 522 goto xmit_world; 522 523 }
+1 -1
drivers/net/netdevsim/dev.c
··· 53 53 54 54 get_random_bytes(dummy_data, NSIM_DEV_DUMMY_REGION_SIZE); 55 55 56 - id = devlink_region_shapshot_id_get(priv_to_devlink(nsim_dev)); 56 + id = devlink_region_snapshot_id_get(priv_to_devlink(nsim_dev)); 57 57 err = devlink_region_snapshot_create(nsim_dev->dummy_region, 58 58 dummy_data, id, kfree); 59 59 if (err) {
+4 -4
drivers/net/phy/Kconfig
··· 340 340 Currently supports dm9161e and dm9131 341 341 342 342 config DP83822_PHY 343 - tristate "Texas Instruments DP83822 PHY" 343 + tristate "Texas Instruments DP83822/825 PHYs" 344 344 ---help--- 345 - Supports the DP83822 PHY. 345 + Supports the DP83822 and DP83825I PHYs. 346 346 347 347 config DP83TC811_PHY 348 - tristate "Texas Instruments DP83TC822 PHY" 348 + tristate "Texas Instruments DP83TC811 PHY" 349 349 ---help--- 350 - Supports the DP83TC822 PHY. 350 + Supports the DP83TC811 PHY. 351 351 352 352 config DP83848_PHY 353 353 tristate "Texas Instruments DP83848 PHY"
+7 -1
drivers/net/phy/dp83867.c
··· 97 97 #define DP83867_PHYCR_FIFO_DEPTH_MAX 0x03 98 98 #define DP83867_PHYCR_FIFO_DEPTH_MASK GENMASK(15, 14) 99 99 #define DP83867_PHYCR_RESERVED_MASK BIT(11) 100 + #define DP83867_PHYCR_FORCE_LINK_GOOD BIT(10) 100 101 101 102 /* RGMIIDCTL bits */ 102 103 #define DP83867_RGMII_TX_CLK_DELAY_MAX 0xf ··· 600 599 601 600 usleep_range(10, 20); 602 601 603 - return 0; 602 + /* After reset FORCE_LINK_GOOD bit is set. Although the 603 + * default value should be unset. Disable FORCE_LINK_GOOD 604 + * for the phy to work properly. 605 + */ 606 + return phy_modify(phydev, MII_DP83867_PHYCTRL, 607 + DP83867_PHYCR_FORCE_LINK_GOOD, 0); 604 608 } 605 609 606 610 static struct phy_driver dp83867_driver[] = {
+1
drivers/net/usb/lan78xx.c
··· 3750 3750 3751 3751 /* MTU range: 68 - 9000 */ 3752 3752 netdev->max_mtu = MAX_SINGLE_PACKET_SIZE; 3753 + netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER); 3753 3754 3754 3755 dev->ep_blkin = (intf->cur_altsetting)->endpoint + 0; 3755 3756 dev->ep_blkout = (intf->cur_altsetting)->endpoint + 1;
+1
drivers/net/usb/qmi_wwan.c
··· 1062 1062 {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ 1063 1063 {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */ 1064 1064 {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */ 1065 + {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */ 1065 1066 1066 1067 /* 3. Combined interface devices matching on interface number */ 1067 1068 {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */
+3
drivers/net/usb/r8152.c
··· 6597 6597 return -ENODEV; 6598 6598 } 6599 6599 6600 + if (intf->cur_altsetting->desc.bNumEndpoints < 3) 6601 + return -ENODEV; 6602 + 6600 6603 usb_reset_device(udev); 6601 6604 netdev = alloc_etherdev(sizeof(struct r8152)); 6602 6605 if (!netdev) {
+1 -1
drivers/net/wan/fsl_ucc_hdlc.c
··· 73 73 }, 74 74 }; 75 75 76 - static struct ucc_tdm_info utdm_info[MAX_HDLC_NUM]; 76 + static struct ucc_tdm_info utdm_info[UCC_MAX_NUM]; 77 77 78 78 static int uhdlc_init(struct ucc_hdlc_private *priv) 79 79 {
+1 -1
drivers/net/wan/lapbether.c
··· 64 64 { 65 65 struct lapbethdev *lapbeth; 66 66 67 - list_for_each_entry_rcu(lapbeth, &lapbeth_devices, node) { 67 + list_for_each_entry_rcu(lapbeth, &lapbeth_devices, node, lockdep_rtnl_is_held()) { 68 68 if (lapbeth->ethdev == dev) 69 69 return lapbeth; 70 70 }
+1 -1
drivers/nfc/pn533/usb.c
··· 391 391 cmd, sizeof(cmd), false); 392 392 393 393 rc = usb_bulk_msg(phy->udev, phy->out_urb->pipe, buffer, sizeof(cmd), 394 - &transferred, 0); 394 + &transferred, 5000); 395 395 kfree(buffer); 396 396 if (rc || (transferred != sizeof(cmd))) { 397 397 nfc_err(&phy->udev->dev,
+20 -8
drivers/platform/chrome/wilco_ec/keyboard_leds.c
··· 73 73 return ret; 74 74 } 75 75 76 - if (response->status) { 77 - dev_err(ec->dev, 78 - "EC reported failure sending keyboard LEDs command: %d", 79 - response->status); 80 - return -EIO; 81 - } 82 - 83 76 return 0; 84 77 } 85 78 ··· 80 87 { 81 88 struct wilco_keyboard_leds_msg request; 82 89 struct wilco_keyboard_leds_msg response; 90 + int ret; 83 91 84 92 memset(&request, 0, sizeof(request)); 85 93 request.command = WILCO_EC_COMMAND_KBBL; ··· 88 94 request.mode = WILCO_KBBL_MODE_FLAG_PWM; 89 95 request.percent = brightness; 90 96 91 - return send_kbbl_msg(ec, &request, &response); 97 + ret = send_kbbl_msg(ec, &request, &response); 98 + if (ret < 0) 99 + return ret; 100 + 101 + if (response.status) { 102 + dev_err(ec->dev, 103 + "EC reported failure sending keyboard LEDs command: %d", 104 + response.status); 105 + return -EIO; 106 + } 107 + 108 + return 0; 92 109 } 93 110 94 111 static int kbbl_exist(struct wilco_ec_device *ec, bool *exists) ··· 144 139 ret = send_kbbl_msg(ec, &request, &response); 145 140 if (ret < 0) 146 141 return ret; 142 + 143 + if (response.status) { 144 + dev_err(ec->dev, 145 + "EC reported failure sending keyboard LEDs command: %d", 146 + response.status); 147 + return -EIO; 148 + } 147 149 148 150 if (response.mode & WILCO_KBBL_MODE_FLAG_PWM) 149 151 return response.percent;
+10 -9
drivers/platform/mellanox/mlxbf-tmfifo.c
··· 149 149 * @work: work struct for deferred process 150 150 * @timer: background timer 151 151 * @vring: Tx/Rx ring 152 - * @spin_lock: spin lock 152 + * @spin_lock: Tx/Rx spin lock 153 153 * @is_ready: ready flag 154 154 */ 155 155 struct mlxbf_tmfifo { ··· 164 164 struct work_struct work; 165 165 struct timer_list timer; 166 166 struct mlxbf_tmfifo_vring *vring[2]; 167 - spinlock_t spin_lock; /* spin lock */ 167 + spinlock_t spin_lock[2]; /* spin lock */ 168 168 bool is_ready; 169 169 }; 170 170 ··· 525 525 writeq(*(u64 *)&hdr, fifo->tx_base + MLXBF_TMFIFO_TX_DATA); 526 526 527 527 /* Use spin-lock to protect the 'cons->tx_buf'. */ 528 - spin_lock_irqsave(&fifo->spin_lock, flags); 528 + spin_lock_irqsave(&fifo->spin_lock[0], flags); 529 529 530 530 while (size > 0) { 531 531 addr = cons->tx_buf.buf + cons->tx_buf.tail; ··· 552 552 } 553 553 } 554 554 555 - spin_unlock_irqrestore(&fifo->spin_lock, flags); 555 + spin_unlock_irqrestore(&fifo->spin_lock[0], flags); 556 556 } 557 557 558 558 /* Rx/Tx one word in the descriptor buffer. */ ··· 731 731 fifo->vring[is_rx] = NULL; 732 732 733 733 /* Notify upper layer that packet is done. */ 734 - spin_lock_irqsave(&fifo->spin_lock, flags); 734 + spin_lock_irqsave(&fifo->spin_lock[is_rx], flags); 735 735 vring_interrupt(0, vring->vq); 736 - spin_unlock_irqrestore(&fifo->spin_lock, flags); 736 + spin_unlock_irqrestore(&fifo->spin_lock[is_rx], flags); 737 737 } 738 738 739 739 mlxbf_tmfifo_desc_done: ··· 852 852 * worker handler. 853 853 */ 854 854 if (vring->vdev_id == VIRTIO_ID_CONSOLE) { 855 - spin_lock_irqsave(&fifo->spin_lock, flags); 855 + spin_lock_irqsave(&fifo->spin_lock[0], flags); 856 856 tm_vdev = fifo->vdev[VIRTIO_ID_CONSOLE]; 857 857 mlxbf_tmfifo_console_output(tm_vdev, vring); 858 - spin_unlock_irqrestore(&fifo->spin_lock, flags); 858 + spin_unlock_irqrestore(&fifo->spin_lock[0], flags); 859 859 } else if (test_and_set_bit(MLXBF_TM_TX_LWM_IRQ, 860 860 &fifo->pend_events)) { 861 861 return true; ··· 1189 1189 if (!fifo) 1190 1190 return -ENOMEM; 1191 1191 1192 - spin_lock_init(&fifo->spin_lock); 1192 + spin_lock_init(&fifo->spin_lock[0]); 1193 + spin_lock_init(&fifo->spin_lock[1]); 1193 1194 INIT_WORK(&fifo->work, mlxbf_tmfifo_work_handler); 1194 1195 mutex_init(&fifo->lock); 1195 1196
+1 -7
drivers/platform/x86/asus-wmi.c
··· 512 512 { 513 513 int ctrl_param = 0; 514 514 515 - /* 516 - * bits 0-2: level 517 - * bit 7: light on/off 518 - */ 519 - if (asus->kbd_led_wk > 0) 520 - ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F); 521 - 515 + ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F); 522 516 asus_wmi_set_devstate(ASUS_WMI_DEVID_KBD_BACKLIGHT, ctrl_param, NULL); 523 517 } 524 518
+20 -7
drivers/platform/x86/gpd-pocket-fan.c
··· 16 16 17 17 #define MAX_SPEED 3 18 18 19 - static int temp_limits[3] = { 55000, 60000, 65000 }; 19 + #define TEMP_LIMIT0_DEFAULT 55000 20 + #define TEMP_LIMIT1_DEFAULT 60000 21 + #define TEMP_LIMIT2_DEFAULT 65000 22 + 23 + #define HYSTERESIS_DEFAULT 3000 24 + 25 + #define SPEED_ON_AC_DEFAULT 2 26 + 27 + static int temp_limits[3] = { 28 + TEMP_LIMIT0_DEFAULT, TEMP_LIMIT1_DEFAULT, TEMP_LIMIT2_DEFAULT, 29 + }; 20 30 module_param_array(temp_limits, int, NULL, 0444); 21 31 MODULE_PARM_DESC(temp_limits, 22 32 "Millicelsius values above which the fan speed increases"); 23 33 24 - static int hysteresis = 3000; 34 + static int hysteresis = HYSTERESIS_DEFAULT; 25 35 module_param(hysteresis, int, 0444); 26 36 MODULE_PARM_DESC(hysteresis, 27 37 "Hysteresis in millicelsius before lowering the fan speed"); 28 38 29 - static int speed_on_ac = 2; 39 + static int speed_on_ac = SPEED_ON_AC_DEFAULT; 30 40 module_param(speed_on_ac, int, 0444); 31 41 MODULE_PARM_DESC(speed_on_ac, 32 42 "minimum fan speed to allow when system is powered by AC"); ··· 127 117 int i; 128 118 129 119 for (i = 0; i < ARRAY_SIZE(temp_limits); i++) { 130 - if (temp_limits[i] < 40000 || temp_limits[i] > 70000) { 120 + if (temp_limits[i] < 20000 || temp_limits[i] > 90000) { 131 121 dev_err(&pdev->dev, "Invalid temp-limit %d (must be between 40000 and 70000)\n", 132 122 temp_limits[i]); 133 - return -EINVAL; 123 + temp_limits[0] = TEMP_LIMIT0_DEFAULT; 124 + temp_limits[1] = TEMP_LIMIT1_DEFAULT; 125 + temp_limits[2] = TEMP_LIMIT2_DEFAULT; 126 + break; 134 127 } 135 128 } 136 129 if (hysteresis < 1000 || hysteresis > 10000) { 137 130 dev_err(&pdev->dev, "Invalid hysteresis %d (must be between 1000 and 10000)\n", 138 131 hysteresis); 139 - return -EINVAL; 132 + hysteresis = HYSTERESIS_DEFAULT; 140 133 } 141 134 if (speed_on_ac < 0 || speed_on_ac > MAX_SPEED) { 142 135 dev_err(&pdev->dev, "Invalid speed_on_ac %d (must be between 0 and 3)\n", 143 136 speed_on_ac); 144 - return -EINVAL; 137 + speed_on_ac = SPEED_ON_AC_DEFAULT; 145 138 } 146 139 147 140 fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL);
+1 -1
drivers/platform/x86/intel_ips.h
··· 1 - // SPDX-License-Identifier: GPL-2.0 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 2 /* 3 3 * Copyright (c) 2010 Intel Corporation 4 4 */
+1 -1
drivers/platform/x86/intel_pmc_core.h
··· 1 - // SPDX-License-Identifier: GPL-2.0 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 2 /* 3 3 * Intel Core SoC Power Management Controller Header File 4 4 *
+2
drivers/platform/x86/intel_pmc_core_pltdrv.c
··· 44 44 INTEL_CPU_FAM6(KABYLAKE, pmc_core_device), 45 45 INTEL_CPU_FAM6(CANNONLAKE_L, pmc_core_device), 46 46 INTEL_CPU_FAM6(ICELAKE_L, pmc_core_device), 47 + INTEL_CPU_FAM6(COMETLAKE, pmc_core_device), 48 + INTEL_CPU_FAM6(COMETLAKE_L, pmc_core_device), 47 49 {} 48 50 }; 49 51 MODULE_DEVICE_TABLE(x86cpu, intel_pmc_core_platform_ids);
+2 -2
drivers/ptp/ptp_clock.c
··· 170 170 { 171 171 struct ptp_clock *ptp = container_of(dev, struct ptp_clock, dev); 172 172 173 + ptp_cleanup_pin_groups(ptp); 173 174 mutex_destroy(&ptp->tsevq_mux); 174 175 mutex_destroy(&ptp->pincfg_mux); 175 176 ida_simple_remove(&ptp_clocks_map, ptp->index); ··· 303 302 if (ptp->pps_source) 304 303 pps_unregister_source(ptp->pps_source); 305 304 306 - ptp_cleanup_pin_groups(ptp); 307 - 308 305 posix_clock_unregister(&ptp->clock); 306 + 309 307 return 0; 310 308 } 311 309 EXPORT_SYMBOL(ptp_clock_unregister);
-2
drivers/s390/crypto/ap_bus.c
··· 793 793 drvres = ap_drv->flags & AP_DRIVER_FLAG_DEFAULT; 794 794 if (!!devres != !!drvres) 795 795 return -ENODEV; 796 - /* (re-)init queue's state machine */ 797 - ap_queue_reinit_state(to_ap_queue(dev)); 798 796 } 799 797 800 798 /* Add queue/card to list of active queues/cards */
+1 -1
drivers/s390/crypto/ap_bus.h
··· 261 261 void ap_queue_remove(struct ap_queue *aq); 262 262 void ap_queue_suspend(struct ap_device *ap_dev); 263 263 void ap_queue_resume(struct ap_device *ap_dev); 264 - void ap_queue_reinit_state(struct ap_queue *aq); 264 + void ap_queue_init_state(struct ap_queue *aq); 265 265 266 266 struct ap_card *ap_card_create(int id, int queue_depth, int raw_device_type, 267 267 int comp_device_type, unsigned int functions);
+3 -2
drivers/s390/crypto/ap_queue.c
··· 638 638 aq->ap_dev.device.type = &ap_queue_type; 639 639 aq->ap_dev.device_type = device_type; 640 640 aq->qid = qid; 641 - aq->state = AP_STATE_RESET_START; 641 + aq->state = AP_STATE_UNBOUND; 642 642 aq->interrupt = AP_INTR_DISABLED; 643 643 spin_lock_init(&aq->lock); 644 644 INIT_LIST_HEAD(&aq->list); ··· 771 771 spin_unlock_bh(&aq->lock); 772 772 } 773 773 774 - void ap_queue_reinit_state(struct ap_queue *aq) 774 + void ap_queue_init_state(struct ap_queue *aq) 775 775 { 776 776 spin_lock_bh(&aq->lock); 777 777 aq->state = AP_STATE_RESET_START; 778 778 ap_wait(ap_sm_event(aq, AP_EVENT_POLL)); 779 779 spin_unlock_bh(&aq->lock); 780 780 } 781 + EXPORT_SYMBOL(ap_queue_init_state);
+2 -2
drivers/s390/crypto/zcrypt_ccamisc.c
··· 1037 1037 prepparm = (struct iprepparm *) prepcblk->rpl_parmb; 1038 1038 1039 1039 /* do some plausibility checks on the key block */ 1040 - if (prepparm->kb.len < 120 + 5 * sizeof(uint16_t) || 1041 - prepparm->kb.len > 136 + 5 * sizeof(uint16_t)) { 1040 + if (prepparm->kb.len < 120 + 3 * sizeof(uint16_t) || 1041 + prepparm->kb.len > 136 + 3 * sizeof(uint16_t)) { 1042 1042 DEBUG_ERR("%s reply with invalid or unknown key block\n", 1043 1043 __func__); 1044 1044 rc = -EIO;
+1
drivers/s390/crypto/zcrypt_cex2a.c
··· 175 175 zq->queue = aq; 176 176 zq->online = 1; 177 177 atomic_set(&zq->load, 0); 178 + ap_queue_init_state(aq); 178 179 ap_queue_init_reply(aq, &zq->reply); 179 180 aq->request_timeout = CEX2A_CLEANUP_TIME, 180 181 aq->private = zq;
+2
drivers/s390/crypto/zcrypt_cex2c.c
··· 220 220 zq->queue = aq; 221 221 zq->online = 1; 222 222 atomic_set(&zq->load, 0); 223 + ap_rapq(aq->qid); 223 224 rc = zcrypt_cex2c_rng_supported(aq); 224 225 if (rc < 0) { 225 226 zcrypt_queue_free(zq); ··· 232 231 else 233 232 zq->ops = zcrypt_msgtype(MSGTYPE06_NAME, 234 233 MSGTYPE06_VARIANT_NORNG); 234 + ap_queue_init_state(aq); 235 235 ap_queue_init_reply(aq, &zq->reply); 236 236 aq->request_timeout = CEX2C_CLEANUP_TIME; 237 237 aq->private = zq;
+1
drivers/s390/crypto/zcrypt_cex4.c
··· 381 381 zq->queue = aq; 382 382 zq->online = 1; 383 383 atomic_set(&zq->load, 0); 384 + ap_queue_init_state(aq); 384 385 ap_queue_init_reply(aq, &zq->reply); 385 386 aq->request_timeout = CEX4_CLEANUP_TIME, 386 387 aq->private = zq;
+10 -10
drivers/scsi/fnic/vnic_dev.c
··· 688 688 689 689 int vnic_dev_hang_notify(struct vnic_dev *vdev) 690 690 { 691 - u64 a0, a1; 691 + u64 a0 = 0, a1 = 0; 692 692 int wait = 1000; 693 693 return vnic_dev_cmd(vdev, CMD_HANG_NOTIFY, &a0, &a1, wait); 694 694 } 695 695 696 696 int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr) 697 697 { 698 - u64 a0, a1; 698 + u64 a[2] = {}; 699 699 int wait = 1000; 700 700 int err, i; 701 701 702 702 for (i = 0; i < ETH_ALEN; i++) 703 703 mac_addr[i] = 0; 704 704 705 - err = vnic_dev_cmd(vdev, CMD_MAC_ADDR, &a0, &a1, wait); 705 + err = vnic_dev_cmd(vdev, CMD_MAC_ADDR, &a[0], &a[1], wait); 706 706 if (err) 707 707 return err; 708 708 709 709 for (i = 0; i < ETH_ALEN; i++) 710 - mac_addr[i] = ((u8 *)&a0)[i]; 710 + mac_addr[i] = ((u8 *)&a)[i]; 711 711 712 712 return 0; 713 713 } ··· 732 732 733 733 void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr) 734 734 { 735 - u64 a0 = 0, a1 = 0; 735 + u64 a[2] = {}; 736 736 int wait = 1000; 737 737 int err; 738 738 int i; 739 739 740 740 for (i = 0; i < ETH_ALEN; i++) 741 - ((u8 *)&a0)[i] = addr[i]; 741 + ((u8 *)&a)[i] = addr[i]; 742 742 743 - err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a0, &a1, wait); 743 + err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a[0], &a[1], wait); 744 744 if (err) 745 745 pr_err("Can't add addr [%pM], %d\n", addr, err); 746 746 } 747 747 748 748 void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr) 749 749 { 750 - u64 a0 = 0, a1 = 0; 750 + u64 a[2] = {}; 751 751 int wait = 1000; 752 752 int err; 753 753 int i; 754 754 755 755 for (i = 0; i < ETH_ALEN; i++) 756 - ((u8 *)&a0)[i] = addr[i]; 756 + ((u8 *)&a)[i] = addr[i]; 757 757 758 - err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a0, &a1, wait); 758 + err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a[0], &a[1], wait); 759 759 if (err) 760 760 pr_err("Can't del addr [%pM], %d\n", addr, err); 761 761 }
+3 -1
drivers/scsi/sd.c
··· 2211 2211 u8 type; 2212 2212 int ret = 0; 2213 2213 2214 - if (scsi_device_protection(sdp) == 0 || (buffer[12] & 1) == 0) 2214 + if (scsi_device_protection(sdp) == 0 || (buffer[12] & 1) == 0) { 2215 + sdkp->protection_type = 0; 2215 2216 return ret; 2217 + } 2216 2218 2217 2219 type = ((buffer[12] >> 1) & 7) + 1; /* P_TYPE 0 = Type 1 */ 2218 2220
+3 -1
drivers/scsi/storvsc_drv.c
··· 1842 1842 */ 1843 1843 host->sg_tablesize = (stor_device->max_transfer_bytes >> PAGE_SHIFT); 1844 1844 /* 1845 + * For non-IDE disks, the host supports multiple channels. 1845 1846 * Set the number of HW queues we are supporting. 1846 1847 */ 1847 - host->nr_hw_queues = num_present_cpus(); 1848 + if (!dev_is_ide) 1849 + host->nr_hw_queues = num_present_cpus(); 1848 1850 1849 1851 /* 1850 1852 * Set the error handler work queue.
+15 -9
drivers/soc/amlogic/meson-ee-pwrc.c
··· 323 323 struct meson_ee_pwrc *pwrc, 324 324 struct meson_ee_pwrc_domain *dom) 325 325 { 326 + int ret; 327 + 326 328 dom->pwrc = pwrc; 327 329 dom->num_rstc = dom->desc.reset_names_count; 328 330 dom->num_clks = dom->desc.clk_names_count; ··· 370 368 * prepare/enable counters won't be in sync. 371 369 */ 372 370 if (dom->num_clks && dom->desc.get_power && !dom->desc.get_power(dom)) { 373 - int ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks); 371 + ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks); 374 372 if (ret) 375 373 return ret; 376 374 377 - pm_genpd_init(&dom->base, &pm_domain_always_on_gov, false); 378 - } else 379 - pm_genpd_init(&dom->base, NULL, 380 - (dom->desc.get_power ? 381 - dom->desc.get_power(dom) : true)); 375 + ret = pm_genpd_init(&dom->base, &pm_domain_always_on_gov, 376 + false); 377 + if (ret) 378 + return ret; 379 + } else { 380 + ret = pm_genpd_init(&dom->base, NULL, 381 + (dom->desc.get_power ? 382 + dom->desc.get_power(dom) : true)); 383 + if (ret) 384 + return ret; 385 + } 382 386 383 387 return 0; 384 388 } ··· 449 441 pwrc->xlate.domains[i] = &dom->base; 450 442 } 451 443 452 - of_genpd_add_provider_onecell(pdev->dev.of_node, &pwrc->xlate); 453 - 454 - return 0; 444 + return of_genpd_add_provider_onecell(pdev->dev.of_node, &pwrc->xlate); 455 445 } 456 446 457 447 static void meson_ee_pwrc_shutdown(struct platform_device *pdev)
+2 -2
drivers/soc/ti/wkup_m3_ipc.c
··· 419 419 ret = rproc_boot(m3_ipc->rproc); 420 420 if (ret) 421 421 dev_err(dev, "rproc_boot failed\n"); 422 + else 423 + m3_ipc_state = m3_ipc; 422 424 423 425 do_exit(0); 424 426 } ··· 506 504 ret = PTR_ERR(task); 507 505 goto err_put_rproc; 508 506 } 509 - 510 - m3_ipc_state = m3_ipc; 511 507 512 508 return 0; 513 509
+6 -6
drivers/staging/comedi/drivers/ni_routes.c
··· 72 72 } 73 73 } 74 74 75 - if (!rv) 76 - return -ENODATA; 77 - 78 75 /* Second, find the set of routes valid for this device. */ 79 76 for (i = 0; ni_device_routes_list[i]; ++i) { 80 77 if (memcmp(ni_device_routes_list[i]->device, board_name, ··· 81 84 } 82 85 } 83 86 84 - if (!dr) 85 - return -ENODATA; 86 - 87 87 tables->route_values = rv; 88 88 tables->valid_routes = dr; 89 + 90 + if (!rv || !dr) 91 + return -ENODATA; 89 92 90 93 return 0; 91 94 } ··· 483 486 const struct ni_route_tables *tables) 484 487 { 485 488 int src; 489 + 490 + if (!tables->route_values) 491 + return -EINVAL; 486 492 487 493 dest = B(dest); /* subtract NI names offset */ 488 494 /* ensure we are not going to under/over run the route value table */
+14 -1
drivers/tee/optee/shm_pool.c
··· 28 28 shm->size = PAGE_SIZE << order; 29 29 30 30 if (shm->flags & TEE_SHM_DMA_BUF) { 31 + unsigned int nr_pages = 1 << order, i; 32 + struct page **pages; 33 + 34 + pages = kcalloc(nr_pages, sizeof(pages), GFP_KERNEL); 35 + if (!pages) 36 + return -ENOMEM; 37 + 38 + for (i = 0; i < nr_pages; i++) { 39 + pages[i] = page; 40 + page++; 41 + } 42 + 31 43 shm->flags |= TEE_SHM_REGISTER; 32 - rc = optee_shm_register(shm->ctx, shm, &page, 1 << order, 44 + rc = optee_shm_register(shm->ctx, shm, pages, nr_pages, 33 45 (unsigned long)shm->kaddr); 46 + kfree(pages); 34 47 } 35 48 36 49 return rc;
+1
drivers/usb/core/hub.c
··· 1192 1192 * PORT_OVER_CURRENT is not. So check for any of them. 1193 1193 */ 1194 1194 if (udev || (portstatus & USB_PORT_STAT_CONNECTION) || 1195 + (portchange & USB_PORT_STAT_C_CONNECTION) || 1195 1196 (portstatus & USB_PORT_STAT_OVERCURRENT) || 1196 1197 (portchange & USB_PORT_STAT_C_OVERCURRENT)) 1197 1198 set_bit(port1, hub->change_bits);
+5 -1
drivers/usb/serial/ch341.c
··· 642 642 static int ch341_reset_resume(struct usb_serial *serial) 643 643 { 644 644 struct usb_serial_port *port = serial->port[0]; 645 - struct ch341_private *priv = usb_get_serial_port_data(port); 645 + struct ch341_private *priv; 646 646 int ret; 647 + 648 + priv = usb_get_serial_port_data(port); 649 + if (!priv) 650 + return 0; 647 651 648 652 /* reconfigure ch341 serial port after bus-reset */ 649 653 ch341_configure(serial->dev, priv);
+9 -7
drivers/usb/serial/io_edgeport.c
··· 716 716 if (txCredits) { 717 717 port = edge_serial->serial->port[portNumber]; 718 718 edge_port = usb_get_serial_port_data(port); 719 - if (edge_port->open) { 719 + if (edge_port && edge_port->open) { 720 720 spin_lock_irqsave(&edge_port->ep_lock, 721 721 flags); 722 722 edge_port->txCredits += txCredits; ··· 1725 1725 static void process_rcvd_data(struct edgeport_serial *edge_serial, 1726 1726 unsigned char *buffer, __u16 bufferLength) 1727 1727 { 1728 - struct device *dev = &edge_serial->serial->dev->dev; 1728 + struct usb_serial *serial = edge_serial->serial; 1729 + struct device *dev = &serial->dev->dev; 1729 1730 struct usb_serial_port *port; 1730 1731 struct edgeport_port *edge_port; 1731 1732 __u16 lastBufferLength; ··· 1822 1821 1823 1822 /* spit this data back into the tty driver if this 1824 1823 port is open */ 1825 - if (rxLen) { 1826 - port = edge_serial->serial->port[ 1827 - edge_serial->rxPort]; 1824 + if (rxLen && edge_serial->rxPort < serial->num_ports) { 1825 + port = serial->port[edge_serial->rxPort]; 1828 1826 edge_port = usb_get_serial_port_data(port); 1829 - if (edge_port->open) { 1827 + if (edge_port && edge_port->open) { 1830 1828 dev_dbg(dev, "%s - Sending %d bytes to TTY for port %d\n", 1831 1829 __func__, rxLen, 1832 1830 edge_serial->rxPort); ··· 1833 1833 rxLen); 1834 1834 edge_port->port->icount.rx += rxLen; 1835 1835 } 1836 - buffer += rxLen; 1837 1836 } 1837 + buffer += rxLen; 1838 1838 break; 1839 1839 1840 1840 case EXPECT_HDR3: /* Expect 3rd byte of status header */ ··· 1869 1869 __u8 code = edge_serial->rxStatusCode; 1870 1870 1871 1871 /* switch the port pointer to the one being currently talked about */ 1872 + if (edge_serial->rxPort >= edge_serial->serial->num_ports) 1873 + return; 1872 1874 port = edge_serial->serial->port[edge_serial->rxPort]; 1873 1875 edge_port = usb_get_serial_port_data(port); 1874 1876 if (edge_port == NULL) {
+4
drivers/usb/serial/keyspan.c
··· 1058 1058 for (i = 0; i < serial->num_ports; ++i) { 1059 1059 port = serial->port[i]; 1060 1060 p_priv = usb_get_serial_port_data(port); 1061 + if (!p_priv) 1062 + continue; 1061 1063 1062 1064 if (p_priv->resend_cont) { 1063 1065 dev_dbg(&port->dev, "%s - sending setup\n", __func__); ··· 1461 1459 for (i = 0; i < serial->num_ports; ++i) { 1462 1460 port = serial->port[i]; 1463 1461 p_priv = usb_get_serial_port_data(port); 1462 + if (!p_priv) 1463 + continue; 1464 1464 1465 1465 if (p_priv->resend_cont) { 1466 1466 dev_dbg(&port->dev, "%s - sending setup\n", __func__);
+1 -1
drivers/usb/serial/opticon.c
··· 113 113 retval = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), 114 114 requesttype, 115 115 USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE, 116 - 0, 0, buffer, 1, 0); 116 + 0, 0, buffer, 1, USB_CTRL_SET_TIMEOUT); 117 117 kfree(buffer); 118 118 119 119 if (retval < 0)
+6
drivers/usb/serial/option.c
··· 248 248 #define QUECTEL_PRODUCT_BG96 0x0296 249 249 #define QUECTEL_PRODUCT_EP06 0x0306 250 250 #define QUECTEL_PRODUCT_EM12 0x0512 251 + #define QUECTEL_PRODUCT_RM500Q 0x0800 251 252 252 253 #define CMOTECH_VENDOR_ID 0x16d8 253 254 #define CMOTECH_PRODUCT_6001 0x6001 ··· 1105 1104 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff), 1106 1105 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 }, 1107 1106 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) }, 1107 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x30) }, 1108 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) }, 1109 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10), 1110 + .driver_info = ZLP }, 1111 + 1108 1112 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, 1109 1113 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) }, 1110 1114 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003),
+6
drivers/usb/serial/quatech2.c
··· 841 841 u8 newMSR = (u8) *ch; 842 842 unsigned long flags; 843 843 844 + /* May be called from qt2_process_read_urb() for an unbound port. */ 844 845 port_priv = usb_get_serial_port_data(port); 846 + if (!port_priv) 847 + return; 845 848 846 849 spin_lock_irqsave(&port_priv->lock, flags); 847 850 port_priv->shadowMSR = newMSR; ··· 872 869 unsigned long flags; 873 870 u8 newLSR = (u8) *ch; 874 871 872 + /* May be called from qt2_process_read_urb() for an unbound port. */ 875 873 port_priv = usb_get_serial_port_data(port); 874 + if (!port_priv) 875 + return; 876 876 877 877 if (newLSR & UART_LSR_BI) 878 878 newLSR &= (u8) (UART_LSR_OE | UART_LSR_BI);
+2
drivers/usb/serial/usb-serial-simple.c
··· 86 86 #define MOTOROLA_TETRA_IDS() \ 87 87 { USB_DEVICE(0x0cad, 0x9011) }, /* Motorola Solutions TETRA PEI */ \ 88 88 { USB_DEVICE(0x0cad, 0x9012) }, /* MTP6550 */ \ 89 + { USB_DEVICE(0x0cad, 0x9013) }, /* MTP3xxx */ \ 90 + { USB_DEVICE(0x0cad, 0x9015) }, /* MTP85xx */ \ 89 91 { USB_DEVICE(0x0cad, 0x9016) } /* TPG2200 */ 90 92 DEVICE(motorola_tetra, MOTOROLA_TETRA_IDS); 91 93
+3
drivers/usb/serial/usb-serial.c
··· 1317 1317 return -EINVAL; 1318 1318 } 1319 1319 1320 + /* Prevent individual ports from being unbound. */ 1321 + driver->driver.suppress_bind_attrs = true; 1322 + 1320 1323 usb_serial_operations_init(driver); 1321 1324 1322 1325 /* Add this device to our list of devices */
+8 -10
fs/afs/dir.c
··· 908 908 unsigned int flags) 909 909 { 910 910 struct afs_vnode *dvnode = AFS_FS_I(dir); 911 + struct afs_fid fid = {}; 911 912 struct inode *inode; 912 913 struct dentry *d; 913 914 struct key *key; ··· 952 951 afs_stat_v(dvnode, n_lookup); 953 952 inode = afs_do_lookup(dir, dentry, key); 954 953 key_put(key); 955 - if (inode == ERR_PTR(-ENOENT)) { 954 + if (inode == ERR_PTR(-ENOENT)) 956 955 inode = afs_try_auto_mntpt(dentry, dir); 957 - } else { 958 - dentry->d_fsdata = 959 - (void *)(unsigned long)dvnode->status.data_version; 960 - } 956 + 957 + if (!IS_ERR_OR_NULL(inode)) 958 + fid = AFS_FS_I(inode)->fid; 959 + 961 960 d = d_splice_alias(inode, dentry); 962 961 if (!IS_ERR_OR_NULL(d)) { 963 962 d->d_fsdata = dentry->d_fsdata; 964 - trace_afs_lookup(dvnode, &d->d_name, 965 - inode ? AFS_FS_I(inode) : NULL); 963 + trace_afs_lookup(dvnode, &d->d_name, &fid); 966 964 } else { 967 - trace_afs_lookup(dvnode, &dentry->d_name, 968 - IS_ERR_OR_NULL(inode) ? NULL 969 - : AFS_FS_I(inode)); 965 + trace_afs_lookup(dvnode, &dentry->d_name, &fid); 970 966 } 971 967 return d; 972 968 }
+39 -34
fs/btrfs/inode.c
··· 4238 4238 } 4239 4239 4240 4240 static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, 4241 - struct inode *dir, u64 objectid, 4242 - const char *name, int name_len) 4241 + struct inode *dir, struct dentry *dentry) 4243 4242 { 4244 4243 struct btrfs_root *root = BTRFS_I(dir)->root; 4244 + struct btrfs_inode *inode = BTRFS_I(d_inode(dentry)); 4245 4245 struct btrfs_path *path; 4246 4246 struct extent_buffer *leaf; 4247 4247 struct btrfs_dir_item *di; 4248 4248 struct btrfs_key key; 4249 + const char *name = dentry->d_name.name; 4250 + int name_len = dentry->d_name.len; 4249 4251 u64 index; 4250 4252 int ret; 4253 + u64 objectid; 4251 4254 u64 dir_ino = btrfs_ino(BTRFS_I(dir)); 4255 + 4256 + if (btrfs_ino(inode) == BTRFS_FIRST_FREE_OBJECTID) { 4257 + objectid = inode->root->root_key.objectid; 4258 + } else if (btrfs_ino(inode) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) { 4259 + objectid = inode->location.objectid; 4260 + } else { 4261 + WARN_ON(1); 4262 + return -EINVAL; 4263 + } 4252 4264 4253 4265 path = btrfs_alloc_path(); 4254 4266 if (!path) ··· 4283 4271 } 4284 4272 btrfs_release_path(path); 4285 4273 4286 - ret = btrfs_del_root_ref(trans, objectid, root->root_key.objectid, 4287 - dir_ino, &index, name, name_len); 4288 - if (ret < 0) { 4289 - if (ret != -ENOENT) { 4290 - btrfs_abort_transaction(trans, ret); 4291 - goto out; 4292 - } 4274 + /* 4275 + * This is a placeholder inode for a subvolume we didn't have a 4276 + * reference to at the time of the snapshot creation. In the meantime 4277 + * we could have renamed the real subvol link into our snapshot, so 4278 + * depending on btrfs_del_root_ref to return -ENOENT here is incorret. 4279 + * Instead simply lookup the dir_index_item for this entry so we can 4280 + * remove it. Otherwise we know we have a ref to the root and we can 4281 + * call btrfs_del_root_ref, and it _shouldn't_ fail. 4282 + */ 4283 + if (btrfs_ino(inode) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) { 4293 4284 di = btrfs_search_dir_index_item(root, path, dir_ino, 4294 4285 name, name_len); 4295 4286 if (IS_ERR_OR_NULL(di)) { ··· 4307 4292 leaf = path->nodes[0]; 4308 4293 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); 4309 4294 index = key.offset; 4295 + btrfs_release_path(path); 4296 + } else { 4297 + ret = btrfs_del_root_ref(trans, objectid, 4298 + root->root_key.objectid, dir_ino, 4299 + &index, name, name_len); 4300 + if (ret) { 4301 + btrfs_abort_transaction(trans, ret); 4302 + goto out; 4303 + } 4310 4304 } 4311 - btrfs_release_path(path); 4312 4305 4313 4306 ret = btrfs_delete_delayed_dir_index(trans, BTRFS_I(dir), index); 4314 4307 if (ret) { ··· 4510 4487 4511 4488 btrfs_record_snapshot_destroy(trans, BTRFS_I(dir)); 4512 4489 4513 - ret = btrfs_unlink_subvol(trans, dir, dest->root_key.objectid, 4514 - dentry->d_name.name, dentry->d_name.len); 4490 + ret = btrfs_unlink_subvol(trans, dir, dentry); 4515 4491 if (ret) { 4516 4492 err = ret; 4517 4493 btrfs_abort_transaction(trans, ret); ··· 4605 4583 return PTR_ERR(trans); 4606 4584 4607 4585 if (unlikely(btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { 4608 - err = btrfs_unlink_subvol(trans, dir, 4609 - BTRFS_I(inode)->location.objectid, 4610 - dentry->d_name.name, 4611 - dentry->d_name.len); 4586 + err = btrfs_unlink_subvol(trans, dir, dentry); 4612 4587 goto out; 4613 4588 } 4614 4589 ··· 9555 9536 u64 new_ino = btrfs_ino(BTRFS_I(new_inode)); 9556 9537 u64 old_idx = 0; 9557 9538 u64 new_idx = 0; 9558 - u64 root_objectid; 9559 9539 int ret; 9560 9540 bool root_log_pinned = false; 9561 9541 bool dest_log_pinned = false; ··· 9660 9642 9661 9643 /* src is a subvolume */ 9662 9644 if (old_ino == BTRFS_FIRST_FREE_OBJECTID) { 9663 - root_objectid = BTRFS_I(old_inode)->root->root_key.objectid; 9664 - ret = btrfs_unlink_subvol(trans, old_dir, root_objectid, 9665 - old_dentry->d_name.name, 9666 - old_dentry->d_name.len); 9645 + ret = btrfs_unlink_subvol(trans, old_dir, old_dentry); 9667 9646 } else { /* src is an inode */ 9668 9647 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir), 9669 9648 BTRFS_I(old_dentry->d_inode), ··· 9676 9661 9677 9662 /* dest is a subvolume */ 9678 9663 if (new_ino == BTRFS_FIRST_FREE_OBJECTID) { 9679 - root_objectid = BTRFS_I(new_inode)->root->root_key.objectid; 9680 - ret = btrfs_unlink_subvol(trans, new_dir, root_objectid, 9681 - new_dentry->d_name.name, 9682 - new_dentry->d_name.len); 9664 + ret = btrfs_unlink_subvol(trans, new_dir, new_dentry); 9683 9665 } else { /* dest is an inode */ 9684 9666 ret = __btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir), 9685 9667 BTRFS_I(new_dentry->d_inode), ··· 9874 9862 struct inode *new_inode = d_inode(new_dentry); 9875 9863 struct inode *old_inode = d_inode(old_dentry); 9876 9864 u64 index = 0; 9877 - u64 root_objectid; 9878 9865 int ret; 9879 9866 u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); 9880 9867 bool log_pinned = false; ··· 9981 9970 BTRFS_I(old_inode), 1); 9982 9971 9983 9972 if (unlikely(old_ino == BTRFS_FIRST_FREE_OBJECTID)) { 9984 - root_objectid = BTRFS_I(old_inode)->root->root_key.objectid; 9985 - ret = btrfs_unlink_subvol(trans, old_dir, root_objectid, 9986 - old_dentry->d_name.name, 9987 - old_dentry->d_name.len); 9973 + ret = btrfs_unlink_subvol(trans, old_dir, old_dentry); 9988 9974 } else { 9989 9975 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir), 9990 9976 BTRFS_I(d_inode(old_dentry)), ··· 10000 9992 new_inode->i_ctime = current_time(new_inode); 10001 9993 if (unlikely(btrfs_ino(BTRFS_I(new_inode)) == 10002 9994 BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { 10003 - root_objectid = BTRFS_I(new_inode)->location.objectid; 10004 - ret = btrfs_unlink_subvol(trans, new_dir, root_objectid, 10005 - new_dentry->d_name.name, 10006 - new_dentry->d_name.len); 9995 + ret = btrfs_unlink_subvol(trans, new_dir, new_dentry); 10007 9996 BUG_ON(new_inode->i_nlink == 0); 10008 9997 } else { 10009 9998 ret = btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir),
+13 -1
fs/btrfs/ioctl.c
··· 4252 4252 &sa->progress, sa->flags & BTRFS_SCRUB_READONLY, 4253 4253 0); 4254 4254 4255 - if (ret == 0 && copy_to_user(arg, sa, sizeof(*sa))) 4255 + /* 4256 + * Copy scrub args to user space even if btrfs_scrub_dev() returned an 4257 + * error. This is important as it allows user space to know how much 4258 + * progress scrub has done. For example, if scrub is canceled we get 4259 + * -ECANCELED from btrfs_scrub_dev() and return that error back to user 4260 + * space. Later user space can inspect the progress from the structure 4261 + * btrfs_ioctl_scrub_args and resume scrub from where it left off 4262 + * previously (btrfs-progs does this). 4263 + * If we fail to copy the btrfs_ioctl_scrub_args structure to user space 4264 + * then return -EFAULT to signal the structure was not copied or it may 4265 + * be corrupt and unreliable due to a partial copy. 4266 + */ 4267 + if (copy_to_user(arg, sa, sizeof(*sa))) 4256 4268 ret = -EFAULT; 4257 4269 4258 4270 if (!(sa->flags & BTRFS_SCRUB_READONLY))
+5 -1
fs/btrfs/qgroup.c
··· 2423 2423 u64 nr_old_roots = 0; 2424 2424 int ret = 0; 2425 2425 2426 + /* 2427 + * If quotas get disabled meanwhile, the resouces need to be freed and 2428 + * we can't just exit here. 2429 + */ 2426 2430 if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags)) 2427 - return 0; 2431 + goto out_free; 2428 2432 2429 2433 if (new_roots) { 2430 2434 if (!maybe_fs_roots(new_roots))
+46 -5
fs/btrfs/relocation.c
··· 517 517 return 1; 518 518 } 519 519 520 + static bool reloc_root_is_dead(struct btrfs_root *root) 521 + { 522 + /* 523 + * Pair with set_bit/clear_bit in clean_dirty_subvols and 524 + * btrfs_update_reloc_root. We need to see the updated bit before 525 + * trying to access reloc_root 526 + */ 527 + smp_rmb(); 528 + if (test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state)) 529 + return true; 530 + return false; 531 + } 532 + 533 + /* 534 + * Check if this subvolume tree has valid reloc tree. 535 + * 536 + * Reloc tree after swap is considered dead, thus not considered as valid. 537 + * This is enough for most callers, as they don't distinguish dead reloc root 538 + * from no reloc root. But should_ignore_root() below is a special case. 539 + */ 540 + static bool have_reloc_root(struct btrfs_root *root) 541 + { 542 + if (reloc_root_is_dead(root)) 543 + return false; 544 + if (!root->reloc_root) 545 + return false; 546 + return true; 547 + } 520 548 521 549 static int should_ignore_root(struct btrfs_root *root) 522 550 { ··· 552 524 553 525 if (!test_bit(BTRFS_ROOT_REF_COWS, &root->state)) 554 526 return 0; 527 + 528 + /* This root has been merged with its reloc tree, we can ignore it */ 529 + if (reloc_root_is_dead(root)) 530 + return 1; 555 531 556 532 reloc_root = root->reloc_root; 557 533 if (!reloc_root) ··· 1471 1439 * The subvolume has reloc tree but the swap is finished, no need to 1472 1440 * create/update the dead reloc tree 1473 1441 */ 1474 - if (test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state)) 1442 + if (reloc_root_is_dead(root)) 1475 1443 return 0; 1476 1444 1477 1445 if (root->reloc_root) { ··· 1510 1478 struct btrfs_root_item *root_item; 1511 1479 int ret; 1512 1480 1513 - if (test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state) || 1514 - !root->reloc_root) 1481 + if (!have_reloc_root(root)) 1515 1482 goto out; 1516 1483 1517 1484 reloc_root = root->reloc_root; ··· 1520 1489 if (fs_info->reloc_ctl->merge_reloc_tree && 1521 1490 btrfs_root_refs(root_item) == 0) { 1522 1491 set_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state); 1492 + /* 1493 + * Mark the tree as dead before we change reloc_root so 1494 + * have_reloc_root will not touch it from now on. 1495 + */ 1496 + smp_wmb(); 1523 1497 __del_reloc_root(reloc_root); 1524 1498 } 1525 1499 ··· 2237 2201 if (ret2 < 0 && !ret) 2238 2202 ret = ret2; 2239 2203 } 2204 + /* 2205 + * Need barrier to ensure clear_bit() only happens after 2206 + * root->reloc_root = NULL. Pairs with have_reloc_root. 2207 + */ 2208 + smp_wmb(); 2240 2209 clear_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state); 2241 2210 btrfs_put_fs_root(root); 2242 2211 } else { ··· 4759 4718 struct btrfs_root *root = pending->root; 4760 4719 struct reloc_control *rc = root->fs_info->reloc_ctl; 4761 4720 4762 - if (!root->reloc_root || !rc) 4721 + if (!rc || !have_reloc_root(root)) 4763 4722 return; 4764 4723 4765 4724 if (!rc->merge_reloc_tree) ··· 4793 4752 struct reloc_control *rc = root->fs_info->reloc_ctl; 4794 4753 int ret; 4795 4754 4796 - if (!root->reloc_root || !rc) 4755 + if (!rc || !have_reloc_root(root)) 4797 4756 return 0; 4798 4757 4799 4758 rc = root->fs_info->reloc_ctl;
+6 -4
fs/btrfs/root-tree.c
··· 376 376 leaf = path->nodes[0]; 377 377 ref = btrfs_item_ptr(leaf, path->slots[0], 378 378 struct btrfs_root_ref); 379 - 380 - WARN_ON(btrfs_root_ref_dirid(leaf, ref) != dirid); 381 - WARN_ON(btrfs_root_ref_name_len(leaf, ref) != name_len); 382 379 ptr = (unsigned long)(ref + 1); 383 - WARN_ON(memcmp_extent_buffer(leaf, name, ptr, name_len)); 380 + if ((btrfs_root_ref_dirid(leaf, ref) != dirid) || 381 + (btrfs_root_ref_name_len(leaf, ref) != name_len) || 382 + memcmp_extent_buffer(leaf, name, ptr, name_len)) { 383 + err = -ENOENT; 384 + goto out; 385 + } 384 386 *sequence = btrfs_root_ref_sequence(leaf, ref); 385 387 386 388 ret = btrfs_del_item(trans, tree_root, path);
+5 -1
fs/btrfs/volumes.c
··· 3881 3881 } 3882 3882 } 3883 3883 3884 - num_devices = btrfs_num_devices(fs_info); 3884 + /* 3885 + * rw_devices will not change at the moment, device add/delete/replace 3886 + * are excluded by EXCL_OP 3887 + */ 3888 + num_devices = fs_info->fs_devices->rw_devices; 3885 3889 3886 3890 /* 3887 3891 * SINGLE profile on-disk has no profile bit, but in-memory we have a
+3 -1
fs/fuse/file.c
··· 882 882 struct fuse_args_pages *ap = &ia->ap; 883 883 loff_t pos = page_offset(ap->pages[0]); 884 884 size_t count = ap->num_pages << PAGE_SHIFT; 885 + ssize_t res; 885 886 int err; 886 887 887 888 ap->args.out_pages = true; ··· 897 896 if (!err) 898 897 return; 899 898 } else { 900 - err = fuse_simple_request(fc, &ap->args); 899 + res = fuse_simple_request(fc, &ap->args); 900 + err = res < 0 ? res : 0; 901 901 } 902 902 fuse_readpages_end(fc, &ap->args, err); 903 903 }
+8 -4
fs/io-wq.c
··· 445 445 task_unlock(current); 446 446 } 447 447 if ((work->flags & IO_WQ_WORK_NEEDS_USER) && !worker->mm && 448 - wq->mm && mmget_not_zero(wq->mm)) { 449 - use_mm(wq->mm); 450 - set_fs(USER_DS); 451 - worker->mm = wq->mm; 448 + wq->mm) { 449 + if (mmget_not_zero(wq->mm)) { 450 + use_mm(wq->mm); 451 + set_fs(USER_DS); 452 + worker->mm = wq->mm; 453 + } else { 454 + work->flags |= IO_WQ_WORK_CANCEL; 455 + } 452 456 } 453 457 if (!worker->creds) 454 458 worker->creds = override_creds(wq->creds);
+48 -24
fs/io_uring.c
··· 1786 1786 struct iovec *iovec, struct iovec *fast_iov, 1787 1787 struct iov_iter *iter) 1788 1788 { 1789 + if (req->opcode == IORING_OP_READ_FIXED || 1790 + req->opcode == IORING_OP_WRITE_FIXED) 1791 + return 0; 1789 1792 if (!req->io && io_alloc_async_ctx(req)) 1790 1793 return -ENOMEM; 1791 1794 ··· 1843 1840 if (!force_nonblock) 1844 1841 req->rw.kiocb.ki_flags &= ~IOCB_NOWAIT; 1845 1842 1843 + req->result = 0; 1846 1844 io_size = ret; 1847 1845 if (req->flags & REQ_F_LINK) 1848 1846 req->result = io_size; ··· 1931 1927 if (!force_nonblock) 1932 1928 req->rw.kiocb.ki_flags &= ~IOCB_NOWAIT; 1933 1929 1930 + req->result = 0; 1934 1931 io_size = ret; 1935 1932 if (req->flags & REQ_F_LINK) 1936 1933 req->result = io_size; ··· 2039 2034 return false; 2040 2035 } 2041 2036 2037 + static void io_link_work_cb(struct io_wq_work **workptr) 2038 + { 2039 + struct io_wq_work *work = *workptr; 2040 + struct io_kiocb *link = work->data; 2041 + 2042 + io_queue_linked_timeout(link); 2043 + work->func = io_wq_submit_work; 2044 + } 2045 + 2046 + static void io_wq_assign_next(struct io_wq_work **workptr, struct io_kiocb *nxt) 2047 + { 2048 + struct io_kiocb *link; 2049 + 2050 + io_prep_async_work(nxt, &link); 2051 + *workptr = &nxt->work; 2052 + if (link) { 2053 + nxt->work.flags |= IO_WQ_WORK_CB; 2054 + nxt->work.func = io_link_work_cb; 2055 + nxt->work.data = link; 2056 + } 2057 + } 2058 + 2042 2059 static void io_fsync_finish(struct io_wq_work **workptr) 2043 2060 { 2044 2061 struct io_kiocb *req = container_of(*workptr, struct io_kiocb, work); ··· 2079 2052 io_cqring_add_event(req, ret); 2080 2053 io_put_req_find_next(req, &nxt); 2081 2054 if (nxt) 2082 - *workptr = &nxt->work; 2055 + io_wq_assign_next(workptr, nxt); 2083 2056 } 2084 2057 2085 2058 static int io_fsync(struct io_kiocb *req, struct io_kiocb **nxt, ··· 2135 2108 io_cqring_add_event(req, ret); 2136 2109 io_put_req_find_next(req, &nxt); 2137 2110 if (nxt) 2138 - *workptr = &nxt->work; 2111 + io_wq_assign_next(workptr, nxt); 2139 2112 } 2140 2113 2141 2114 static int io_sync_file_range(struct io_kiocb *req, struct io_kiocb **nxt, ··· 2401 2374 return; 2402 2375 __io_accept(req, &nxt, false); 2403 2376 if (nxt) 2404 - *workptr = &nxt->work; 2377 + io_wq_assign_next(workptr, nxt); 2405 2378 } 2406 2379 #endif 2407 2380 ··· 2632 2605 req_set_fail_links(req); 2633 2606 io_put_req_find_next(req, &nxt); 2634 2607 if (nxt) 2635 - *workptr = &nxt->work; 2608 + io_wq_assign_next(workptr, nxt); 2636 2609 } 2637 2610 2638 2611 static int io_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync, ··· 3286 3259 return ret; 3287 3260 3288 3261 if (ctx->flags & IORING_SETUP_IOPOLL) { 3262 + const bool in_async = io_wq_current_is_worker(); 3263 + 3289 3264 if (req->result == -EAGAIN) 3290 3265 return -EAGAIN; 3291 3266 3267 + /* workqueue context doesn't hold uring_lock, grab it now */ 3268 + if (in_async) 3269 + mutex_lock(&ctx->uring_lock); 3270 + 3292 3271 io_iopoll_req_issued(req); 3272 + 3273 + if (in_async) 3274 + mutex_unlock(&ctx->uring_lock); 3293 3275 } 3294 3276 3295 3277 return 0; 3296 - } 3297 - 3298 - static void io_link_work_cb(struct io_wq_work **workptr) 3299 - { 3300 - struct io_wq_work *work = *workptr; 3301 - struct io_kiocb *link = work->data; 3302 - 3303 - io_queue_linked_timeout(link); 3304 - work->func = io_wq_submit_work; 3305 3278 } 3306 3279 3307 3280 static void io_wq_submit_work(struct io_wq_work **workptr) ··· 3340 3313 } 3341 3314 3342 3315 /* if a dependent link is ready, pass it back */ 3343 - if (!ret && nxt) { 3344 - struct io_kiocb *link; 3345 - 3346 - io_prep_async_work(nxt, &link); 3347 - *workptr = &nxt->work; 3348 - if (link) { 3349 - nxt->work.flags |= IO_WQ_WORK_CB; 3350 - nxt->work.func = io_link_work_cb; 3351 - nxt->work.data = link; 3352 - } 3353 - } 3316 + if (!ret && nxt) 3317 + io_wq_assign_next(workptr, nxt); 3354 3318 } 3355 3319 3356 3320 static bool io_req_op_valid(int op) ··· 5158 5140 submitted = to_submit; 5159 5141 } else if (to_submit) { 5160 5142 struct mm_struct *cur_mm; 5143 + 5144 + if (current->mm != ctx->sqo_mm || 5145 + current_cred() != ctx->creds) { 5146 + ret = -EPERM; 5147 + goto out; 5148 + } 5161 5149 5162 5150 to_submit = min(to_submit, ctx->sq_entries); 5163 5151 mutex_lock(&ctx->uring_lock);
+13 -77
fs/namei.c
··· 1232 1232 BUG_ON(!path->dentry->d_op); 1233 1233 BUG_ON(!path->dentry->d_op->d_manage); 1234 1234 ret = path->dentry->d_op->d_manage(path, false); 1235 + flags = smp_load_acquire(&path->dentry->d_flags); 1235 1236 if (ret < 0) 1236 1237 break; 1237 1238 } ··· 1650 1649 if (IS_ERR(dentry)) 1651 1650 return dentry; 1652 1651 if (unlikely(!d_in_lookup(dentry))) { 1653 - if (!(flags & LOOKUP_NO_REVAL)) { 1654 - int error = d_revalidate(dentry, flags); 1655 - if (unlikely(error <= 0)) { 1656 - if (!error) { 1657 - d_invalidate(dentry); 1658 - dput(dentry); 1659 - goto again; 1660 - } 1652 + int error = d_revalidate(dentry, flags); 1653 + if (unlikely(error <= 0)) { 1654 + if (!error) { 1655 + d_invalidate(dentry); 1661 1656 dput(dentry); 1662 - dentry = ERR_PTR(error); 1657 + goto again; 1663 1658 } 1659 + dput(dentry); 1660 + dentry = ERR_PTR(error); 1664 1661 } 1665 1662 } else { 1666 1663 old = inode->i_op->lookup(inode, dentry, flags); ··· 2617 2618 EXPORT_SYMBOL(user_path_at_empty); 2618 2619 2619 2620 /** 2620 - * mountpoint_last - look up last component for umount 2621 - * @nd: pathwalk nameidata - currently pointing at parent directory of "last" 2622 - * 2623 - * This is a special lookup_last function just for umount. In this case, we 2624 - * need to resolve the path without doing any revalidation. 2625 - * 2626 - * The nameidata should be the result of doing a LOOKUP_PARENT pathwalk. Since 2627 - * mountpoints are always pinned in the dcache, their ancestors are too. Thus, 2628 - * in almost all cases, this lookup will be served out of the dcache. The only 2629 - * cases where it won't are if nd->last refers to a symlink or the path is 2630 - * bogus and it doesn't exist. 2631 - * 2632 - * Returns: 2633 - * -error: if there was an error during lookup. This includes -ENOENT if the 2634 - * lookup found a negative dentry. 2635 - * 2636 - * 0: if we successfully resolved nd->last and found it to not to be a 2637 - * symlink that needs to be followed. 2638 - * 2639 - * 1: if we successfully resolved nd->last and found it to be a symlink 2640 - * that needs to be followed. 2641 - */ 2642 - static int 2643 - mountpoint_last(struct nameidata *nd) 2644 - { 2645 - int error = 0; 2646 - struct dentry *dir = nd->path.dentry; 2647 - struct path path; 2648 - 2649 - /* If we're in rcuwalk, drop out of it to handle last component */ 2650 - if (nd->flags & LOOKUP_RCU) { 2651 - if (unlazy_walk(nd)) 2652 - return -ECHILD; 2653 - } 2654 - 2655 - nd->flags &= ~LOOKUP_PARENT; 2656 - 2657 - if (unlikely(nd->last_type != LAST_NORM)) { 2658 - error = handle_dots(nd, nd->last_type); 2659 - if (error) 2660 - return error; 2661 - path.dentry = dget(nd->path.dentry); 2662 - } else { 2663 - path.dentry = d_lookup(dir, &nd->last); 2664 - if (!path.dentry) { 2665 - /* 2666 - * No cached dentry. Mounted dentries are pinned in the 2667 - * cache, so that means that this dentry is probably 2668 - * a symlink or the path doesn't actually point 2669 - * to a mounted dentry. 2670 - */ 2671 - path.dentry = lookup_slow(&nd->last, dir, 2672 - nd->flags | LOOKUP_NO_REVAL); 2673 - if (IS_ERR(path.dentry)) 2674 - return PTR_ERR(path.dentry); 2675 - } 2676 - } 2677 - if (d_flags_negative(smp_load_acquire(&path.dentry->d_flags))) { 2678 - dput(path.dentry); 2679 - return -ENOENT; 2680 - } 2681 - path.mnt = nd->path.mnt; 2682 - return step_into(nd, &path, 0, d_backing_inode(path.dentry), 0); 2683 - } 2684 - 2685 - /** 2686 2621 * path_mountpoint - look up a path to be umounted 2687 2622 * @nd: lookup context 2688 2623 * @flags: lookup flags ··· 2632 2699 int err; 2633 2700 2634 2701 while (!(err = link_path_walk(s, nd)) && 2635 - (err = mountpoint_last(nd)) > 0) { 2702 + (err = lookup_last(nd)) > 0) { 2636 2703 s = trailing_symlink(nd); 2637 2704 } 2705 + if (!err && (nd->flags & LOOKUP_RCU)) 2706 + err = unlazy_walk(nd); 2707 + if (!err) 2708 + err = handle_lookup_down(nd); 2638 2709 if (!err) { 2639 2710 *path = nd->path; 2640 2711 nd->path.mnt = NULL; 2641 2712 nd->path.dentry = NULL; 2642 - follow_mount(path); 2643 2713 } 2644 2714 terminate_walk(nd); 2645 2715 return err;
-2
fs/nfs/nfstrace.h
··· 206 206 TRACE_DEFINE_ENUM(LOOKUP_PARENT); 207 207 TRACE_DEFINE_ENUM(LOOKUP_REVAL); 208 208 TRACE_DEFINE_ENUM(LOOKUP_RCU); 209 - TRACE_DEFINE_ENUM(LOOKUP_NO_REVAL); 210 209 TRACE_DEFINE_ENUM(LOOKUP_OPEN); 211 210 TRACE_DEFINE_ENUM(LOOKUP_CREATE); 212 211 TRACE_DEFINE_ENUM(LOOKUP_EXCL); ··· 223 224 { LOOKUP_PARENT, "PARENT" }, \ 224 225 { LOOKUP_REVAL, "REVAL" }, \ 225 226 { LOOKUP_RCU, "RCU" }, \ 226 - { LOOKUP_NO_REVAL, "NO_REVAL" }, \ 227 227 { LOOKUP_OPEN, "OPEN" }, \ 228 228 { LOOKUP_CREATE, "CREATE" }, \ 229 229 { LOOKUP_EXCL, "EXCL" }, \
+32 -1
include/asm-generic/cacheflush.h
··· 11 11 * The cache doesn't need to be flushed when TLB entries change when 12 12 * the cache is mapped to physical memory, not virtual memory 13 13 */ 14 + #ifndef flush_cache_all 14 15 static inline void flush_cache_all(void) 15 16 { 16 17 } 18 + #endif 17 19 20 + #ifndef flush_cache_mm 18 21 static inline void flush_cache_mm(struct mm_struct *mm) 19 22 { 20 23 } 24 + #endif 21 25 26 + #ifndef flush_cache_dup_mm 22 27 static inline void flush_cache_dup_mm(struct mm_struct *mm) 23 28 { 24 29 } 30 + #endif 25 31 32 + #ifndef flush_cache_range 26 33 static inline void flush_cache_range(struct vm_area_struct *vma, 27 34 unsigned long start, 28 35 unsigned long end) 29 36 { 30 37 } 38 + #endif 31 39 40 + #ifndef flush_cache_page 32 41 static inline void flush_cache_page(struct vm_area_struct *vma, 33 42 unsigned long vmaddr, 34 43 unsigned long pfn) 35 44 { 36 45 } 46 + #endif 37 47 48 + #ifndef flush_dcache_page 38 49 static inline void flush_dcache_page(struct page *page) 39 50 { 40 51 } 52 + #endif 41 53 54 + #ifndef flush_dcache_mmap_lock 42 55 static inline void flush_dcache_mmap_lock(struct address_space *mapping) 43 56 { 44 57 } 58 + #endif 45 59 60 + #ifndef flush_dcache_mmap_unlock 46 61 static inline void flush_dcache_mmap_unlock(struct address_space *mapping) 47 62 { 48 63 } 64 + #endif 49 65 66 + #ifndef flush_icache_range 50 67 static inline void flush_icache_range(unsigned long start, unsigned long end) 51 68 { 52 69 } 70 + #endif 53 71 72 + #ifndef flush_icache_page 54 73 static inline void flush_icache_page(struct vm_area_struct *vma, 55 74 struct page *page) 56 75 { 57 76 } 77 + #endif 58 78 79 + #ifndef flush_icache_user_range 59 80 static inline void flush_icache_user_range(struct vm_area_struct *vma, 60 81 struct page *page, 61 82 unsigned long addr, int len) 62 83 { 63 84 } 85 + #endif 64 86 87 + #ifndef flush_cache_vmap 65 88 static inline void flush_cache_vmap(unsigned long start, unsigned long end) 66 89 { 67 90 } 91 + #endif 68 92 93 + #ifndef flush_cache_vunmap 69 94 static inline void flush_cache_vunmap(unsigned long start, unsigned long end) 70 95 { 71 96 } 97 + #endif 72 98 73 - #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ 99 + #ifndef copy_to_user_page 100 + #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ 74 101 do { \ 75 102 memcpy(dst, src, len); \ 76 103 flush_icache_user_range(vma, page, vaddr, len); \ 77 104 } while (0) 105 + #endif 106 + 107 + #ifndef copy_from_user_page 78 108 #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ 79 109 memcpy(dst, src, len) 110 + #endif 80 111 81 112 #endif /* __ASM_CACHEFLUSH_H */
+6
include/drm/drm_dp_mst_helper.h
··· 605 605 * &drm_dp_sideband_msg_tx.state once they are queued 606 606 */ 607 607 struct mutex qlock; 608 + 609 + /** 610 + * @is_waiting_for_dwn_reply: indicate whether is waiting for down reply 611 + */ 612 + bool is_waiting_for_dwn_reply; 613 + 608 614 /** 609 615 * @tx_msg_downq: List of pending down replies. 610 616 */
+3 -3
include/dt-bindings/reset/amlogic,meson8b-reset.h
··· 46 46 #define RESET_VD_RMEM 64 47 47 #define RESET_AUDIN 65 48 48 #define RESET_DBLK 66 49 - #define RESET_PIC_DC 66 50 - #define RESET_PSC 66 51 - #define RESET_NAND 66 49 + #define RESET_PIC_DC 67 50 + #define RESET_PSC 68 51 + #define RESET_NAND 69 52 52 #define RESET_GE2D 70 53 53 #define RESET_PARSER_REG 71 54 54 #define RESET_PARSER_FETCH 72
+4 -4
include/linux/blkdev.h
··· 328 328 unsigned int max_sectors; 329 329 unsigned int max_segment_size; 330 330 unsigned int physical_block_size; 331 + unsigned int logical_block_size; 331 332 unsigned int alignment_offset; 332 333 unsigned int io_min; 333 334 unsigned int io_opt; ··· 339 338 unsigned int discard_granularity; 340 339 unsigned int discard_alignment; 341 340 342 - unsigned short logical_block_size; 343 341 unsigned short max_segments; 344 342 unsigned short max_integrity_segments; 345 343 unsigned short max_discard_segments; ··· 1077 1077 unsigned int max_write_same_sectors); 1078 1078 extern void blk_queue_max_write_zeroes_sectors(struct request_queue *q, 1079 1079 unsigned int max_write_same_sectors); 1080 - extern void blk_queue_logical_block_size(struct request_queue *, unsigned short); 1080 + extern void blk_queue_logical_block_size(struct request_queue *, unsigned int); 1081 1081 extern void blk_queue_physical_block_size(struct request_queue *, unsigned int); 1082 1082 extern void blk_queue_alignment_offset(struct request_queue *q, 1083 1083 unsigned int alignment); ··· 1291 1291 return q->limits.max_segment_size; 1292 1292 } 1293 1293 1294 - static inline unsigned short queue_logical_block_size(const struct request_queue *q) 1294 + static inline unsigned queue_logical_block_size(const struct request_queue *q) 1295 1295 { 1296 1296 int retval = 512; 1297 1297 ··· 1301 1301 return retval; 1302 1302 } 1303 1303 1304 - static inline unsigned short bdev_logical_block_size(struct block_device *bdev) 1304 + static inline unsigned int bdev_logical_block_size(struct block_device *bdev) 1305 1305 { 1306 1306 return queue_logical_block_size(bdev_get_queue(bdev)); 1307 1307 }
+15 -3
include/linux/mm.h
··· 2658 2658 !page_poisoning_enabled(); 2659 2659 } 2660 2660 2661 - #ifdef CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT 2662 - DECLARE_STATIC_KEY_TRUE(_debug_pagealloc_enabled); 2661 + #ifdef CONFIG_DEBUG_PAGEALLOC 2662 + extern void init_debug_pagealloc(void); 2663 2663 #else 2664 - DECLARE_STATIC_KEY_FALSE(_debug_pagealloc_enabled); 2664 + static inline void init_debug_pagealloc(void) {} 2665 2665 #endif 2666 + extern bool _debug_pagealloc_enabled_early; 2667 + DECLARE_STATIC_KEY_FALSE(_debug_pagealloc_enabled); 2666 2668 2667 2669 static inline bool debug_pagealloc_enabled(void) 2670 + { 2671 + return IS_ENABLED(CONFIG_DEBUG_PAGEALLOC) && 2672 + _debug_pagealloc_enabled_early; 2673 + } 2674 + 2675 + /* 2676 + * For use in fast paths after init_debug_pagealloc() has run, or when a 2677 + * false negative result is not harmful when called too early. 2678 + */ 2679 + static inline bool debug_pagealloc_enabled_static(void) 2668 2680 { 2669 2681 if (!IS_ENABLED(CONFIG_DEBUG_PAGEALLOC)) 2670 2682 return false;
+2 -3
include/linux/mmzone.h
··· 215 215 NR_INACTIVE_FILE, /* " " " " " */ 216 216 NR_ACTIVE_FILE, /* " " " " " */ 217 217 NR_UNEVICTABLE, /* " " " " " */ 218 - NR_SLAB_RECLAIMABLE, /* Please do not reorder this item */ 219 - NR_SLAB_UNRECLAIMABLE, /* and this one without looking at 220 - * memcg_flush_percpu_vmstats() first. */ 218 + NR_SLAB_RECLAIMABLE, 219 + NR_SLAB_UNRECLAIMABLE, 221 220 NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */ 222 221 NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */ 223 222 WORKINGSET_NODES,
-1
include/linux/namei.h
··· 34 34 35 35 /* internal use only */ 36 36 #define LOOKUP_PARENT 0x0010 37 - #define LOOKUP_NO_REVAL 0x0080 38 37 #define LOOKUP_JUMPED 0x1000 39 38 #define LOOKUP_ROOT 0x2000 40 39 #define LOOKUP_ROOT_GRABBED 0x0008
+2 -2
include/linux/sched.h
··· 1929 1929 1930 1930 /* 1931 1931 * If parent process has a registered restartable sequences area, the 1932 - * child inherits. Only applies when forking a process, not a thread. 1932 + * child inherits. Unregister rseq for a clone with CLONE_VM set. 1933 1933 */ 1934 1934 static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags) 1935 1935 { 1936 - if (clone_flags & CLONE_THREAD) { 1936 + if (clone_flags & CLONE_VM) { 1937 1937 t->rseq = NULL; 1938 1938 t->rseq_sig = 0; 1939 1939 t->rseq_event_mask = 0;
+9 -4
include/linux/skmsg.h
··· 358 358 static inline void sk_psock_restore_proto(struct sock *sk, 359 359 struct sk_psock *psock) 360 360 { 361 - sk->sk_write_space = psock->saved_write_space; 361 + sk->sk_prot->unhash = psock->saved_unhash; 362 362 363 363 if (psock->sk_proto) { 364 364 struct inet_connection_sock *icsk = inet_csk(sk); 365 365 bool has_ulp = !!icsk->icsk_ulp_data; 366 366 367 - if (has_ulp) 368 - tcp_update_ulp(sk, psock->sk_proto); 369 - else 367 + if (has_ulp) { 368 + tcp_update_ulp(sk, psock->sk_proto, 369 + psock->saved_write_space); 370 + } else { 370 371 sk->sk_prot = psock->sk_proto; 372 + sk->sk_write_space = psock->saved_write_space; 373 + } 371 374 psock->sk_proto = NULL; 375 + } else { 376 + sk->sk_write_space = psock->saved_write_space; 372 377 } 373 378 } 374 379
+1 -1
include/linux/tnum.h
··· 30 30 /* Shift (rsh) a tnum right (by a fixed shift) */ 31 31 struct tnum tnum_rshift(struct tnum a, u8 shift); 32 32 /* Shift (arsh) a tnum right (by a fixed min_shift) */ 33 - struct tnum tnum_arshift(struct tnum a, u8 min_shift); 33 + struct tnum tnum_arshift(struct tnum a, u8 min_shift, u8 insn_bitness); 34 34 /* Add two tnums, return @a + @b */ 35 35 struct tnum tnum_add(struct tnum a, struct tnum b); 36 36 /* Subtract two tnums, return @a - @b */
+5
include/net/cfg80211.h
··· 3548 3548 * 3549 3549 * @start_radar_detection: Start radar detection in the driver. 3550 3550 * 3551 + * @end_cac: End running CAC, probably because a related CAC 3552 + * was finished on another phy. 3553 + * 3551 3554 * @update_ft_ies: Provide updated Fast BSS Transition information to the 3552 3555 * driver. If the SME is in the driver/firmware, this information can be 3553 3556 * used in building Authentication and Reassociation Request frames. ··· 3877 3874 struct net_device *dev, 3878 3875 struct cfg80211_chan_def *chandef, 3879 3876 u32 cac_time_ms); 3877 + void (*end_cac)(struct wiphy *wiphy, 3878 + struct net_device *dev); 3880 3879 int (*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev, 3881 3880 struct cfg80211_update_ft_ies_params *ftie); 3882 3881 int (*crit_proto_start)(struct wiphy *wiphy,
+1 -1
include/net/devlink.h
··· 938 938 u32 region_max_snapshots, 939 939 u64 region_size); 940 940 void devlink_region_destroy(struct devlink_region *region); 941 - u32 devlink_region_shapshot_id_get(struct devlink *devlink); 941 + u32 devlink_region_snapshot_id_get(struct devlink *devlink); 942 942 int devlink_region_snapshot_create(struct devlink_region *region, 943 943 u8 *data, u32 snapshot_id, 944 944 devlink_snapshot_data_dest_t *data_destructor);
+4 -2
include/net/tcp.h
··· 2147 2147 /* initialize ulp */ 2148 2148 int (*init)(struct sock *sk); 2149 2149 /* update ulp */ 2150 - void (*update)(struct sock *sk, struct proto *p); 2150 + void (*update)(struct sock *sk, struct proto *p, 2151 + void (*write_space)(struct sock *sk)); 2151 2152 /* cleanup ulp */ 2152 2153 void (*release)(struct sock *sk); 2153 2154 /* diagnostic */ ··· 2163 2162 int tcp_set_ulp(struct sock *sk, const char *name); 2164 2163 void tcp_get_available_ulp(char *buf, size_t len); 2165 2164 void tcp_cleanup_ulp(struct sock *sk); 2166 - void tcp_update_ulp(struct sock *sk, struct proto *p); 2165 + void tcp_update_ulp(struct sock *sk, struct proto *p, 2166 + void (*write_space)(struct sock *sk)); 2167 2167 2168 2168 #define MODULE_ALIAS_TCP_ULP(name) \ 2169 2169 __MODULE_INFO(alias, alias_userspace, name); \
+3 -9
include/trace/events/afs.h
··· 915 915 916 916 TRACE_EVENT(afs_lookup, 917 917 TP_PROTO(struct afs_vnode *dvnode, const struct qstr *name, 918 - struct afs_vnode *vnode), 918 + struct afs_fid *fid), 919 919 920 - TP_ARGS(dvnode, name, vnode), 920 + TP_ARGS(dvnode, name, fid), 921 921 922 922 TP_STRUCT__entry( 923 923 __field_struct(struct afs_fid, dfid ) ··· 928 928 TP_fast_assign( 929 929 int __len = min_t(int, name->len, 23); 930 930 __entry->dfid = dvnode->fid; 931 - if (vnode) { 932 - __entry->fid = vnode->fid; 933 - } else { 934 - __entry->fid.vid = 0; 935 - __entry->fid.vnode = 0; 936 - __entry->fid.unique = 0; 937 - } 931 + __entry->fid = *fid; 938 932 memcpy(__entry->name, name->name, __len); 939 933 __entry->name[__len] = 0; 940 934 ),
+2 -1
include/trace/events/huge_memory.h
··· 31 31 EM( SCAN_ALLOC_HUGE_PAGE_FAIL, "alloc_huge_page_failed") \ 32 32 EM( SCAN_CGROUP_CHARGE_FAIL, "ccgroup_charge_failed") \ 33 33 EM( SCAN_EXCEED_SWAP_PTE, "exceed_swap_pte") \ 34 - EMe(SCAN_TRUNCATED, "truncated") \ 34 + EM( SCAN_TRUNCATED, "truncated") \ 35 + EMe(SCAN_PAGE_HAS_PRIVATE, "page_has_private") \ 35 36 36 37 #undef EM 37 38 #undef EMe
+1
init/main.c
··· 553 553 * bigger than MAX_ORDER unless SPARSEMEM. 554 554 */ 555 555 page_ext_init_flatmem(); 556 + init_debug_pagealloc(); 556 557 report_meminit(); 557 558 mem_init(); 558 559 kmem_cache_init();
+7 -2
kernel/bpf/tnum.c
··· 44 44 return TNUM(a.value >> shift, a.mask >> shift); 45 45 } 46 46 47 - struct tnum tnum_arshift(struct tnum a, u8 min_shift) 47 + struct tnum tnum_arshift(struct tnum a, u8 min_shift, u8 insn_bitness) 48 48 { 49 49 /* if a.value is negative, arithmetic shifting by minimum shift 50 50 * will have larger negative offset compared to more shifting. 51 51 * If a.value is nonnegative, arithmetic shifting by minimum shift 52 52 * will have larger positive offset compare to more shifting. 53 53 */ 54 - return TNUM((s64)a.value >> min_shift, (s64)a.mask >> min_shift); 54 + if (insn_bitness == 32) 55 + return TNUM((u32)(((s32)a.value) >> min_shift), 56 + (u32)(((s32)a.mask) >> min_shift)); 57 + else 58 + return TNUM((s64)a.value >> min_shift, 59 + (s64)a.mask >> min_shift); 55 60 } 56 61 57 62 struct tnum tnum_add(struct tnum a, struct tnum b)
+10 -3
kernel/bpf/verifier.c
··· 5049 5049 /* Upon reaching here, src_known is true and 5050 5050 * umax_val is equal to umin_val. 5051 5051 */ 5052 - dst_reg->smin_value >>= umin_val; 5053 - dst_reg->smax_value >>= umin_val; 5054 - dst_reg->var_off = tnum_arshift(dst_reg->var_off, umin_val); 5052 + if (insn_bitness == 32) { 5053 + dst_reg->smin_value = (u32)(((s32)dst_reg->smin_value) >> umin_val); 5054 + dst_reg->smax_value = (u32)(((s32)dst_reg->smax_value) >> umin_val); 5055 + } else { 5056 + dst_reg->smin_value >>= umin_val; 5057 + dst_reg->smax_value >>= umin_val; 5058 + } 5059 + 5060 + dst_reg->var_off = tnum_arshift(dst_reg->var_off, umin_val, 5061 + insn_bitness); 5055 5062 5056 5063 /* blow away the dst_reg umin_value/umax_value and rely on 5057 5064 * dst_reg var_off to refine the result.
+72 -71
kernel/cpu.c
··· 1909 1909 } 1910 1910 EXPORT_SYMBOL(__cpuhp_remove_state); 1911 1911 1912 + #ifdef CONFIG_HOTPLUG_SMT 1913 + static void cpuhp_offline_cpu_device(unsigned int cpu) 1914 + { 1915 + struct device *dev = get_cpu_device(cpu); 1916 + 1917 + dev->offline = true; 1918 + /* Tell user space about the state change */ 1919 + kobject_uevent(&dev->kobj, KOBJ_OFFLINE); 1920 + } 1921 + 1922 + static void cpuhp_online_cpu_device(unsigned int cpu) 1923 + { 1924 + struct device *dev = get_cpu_device(cpu); 1925 + 1926 + dev->offline = false; 1927 + /* Tell user space about the state change */ 1928 + kobject_uevent(&dev->kobj, KOBJ_ONLINE); 1929 + } 1930 + 1931 + int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval) 1932 + { 1933 + int cpu, ret = 0; 1934 + 1935 + cpu_maps_update_begin(); 1936 + for_each_online_cpu(cpu) { 1937 + if (topology_is_primary_thread(cpu)) 1938 + continue; 1939 + ret = cpu_down_maps_locked(cpu, CPUHP_OFFLINE); 1940 + if (ret) 1941 + break; 1942 + /* 1943 + * As this needs to hold the cpu maps lock it's impossible 1944 + * to call device_offline() because that ends up calling 1945 + * cpu_down() which takes cpu maps lock. cpu maps lock 1946 + * needs to be held as this might race against in kernel 1947 + * abusers of the hotplug machinery (thermal management). 1948 + * 1949 + * So nothing would update device:offline state. That would 1950 + * leave the sysfs entry stale and prevent onlining after 1951 + * smt control has been changed to 'off' again. This is 1952 + * called under the sysfs hotplug lock, so it is properly 1953 + * serialized against the regular offline usage. 1954 + */ 1955 + cpuhp_offline_cpu_device(cpu); 1956 + } 1957 + if (!ret) 1958 + cpu_smt_control = ctrlval; 1959 + cpu_maps_update_done(); 1960 + return ret; 1961 + } 1962 + 1963 + int cpuhp_smt_enable(void) 1964 + { 1965 + int cpu, ret = 0; 1966 + 1967 + cpu_maps_update_begin(); 1968 + cpu_smt_control = CPU_SMT_ENABLED; 1969 + for_each_present_cpu(cpu) { 1970 + /* Skip online CPUs and CPUs on offline nodes */ 1971 + if (cpu_online(cpu) || !node_online(cpu_to_node(cpu))) 1972 + continue; 1973 + ret = _cpu_up(cpu, 0, CPUHP_ONLINE); 1974 + if (ret) 1975 + break; 1976 + /* See comment in cpuhp_smt_disable() */ 1977 + cpuhp_online_cpu_device(cpu); 1978 + } 1979 + cpu_maps_update_done(); 1980 + return ret; 1981 + } 1982 + #endif 1983 + 1912 1984 #if defined(CONFIG_SYSFS) && defined(CONFIG_HOTPLUG_CPU) 1913 1985 static ssize_t show_cpuhp_state(struct device *dev, 1914 1986 struct device_attribute *attr, char *buf) ··· 2134 2062 }; 2135 2063 2136 2064 #ifdef CONFIG_HOTPLUG_SMT 2137 - 2138 - static void cpuhp_offline_cpu_device(unsigned int cpu) 2139 - { 2140 - struct device *dev = get_cpu_device(cpu); 2141 - 2142 - dev->offline = true; 2143 - /* Tell user space about the state change */ 2144 - kobject_uevent(&dev->kobj, KOBJ_OFFLINE); 2145 - } 2146 - 2147 - static void cpuhp_online_cpu_device(unsigned int cpu) 2148 - { 2149 - struct device *dev = get_cpu_device(cpu); 2150 - 2151 - dev->offline = false; 2152 - /* Tell user space about the state change */ 2153 - kobject_uevent(&dev->kobj, KOBJ_ONLINE); 2154 - } 2155 - 2156 - int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval) 2157 - { 2158 - int cpu, ret = 0; 2159 - 2160 - cpu_maps_update_begin(); 2161 - for_each_online_cpu(cpu) { 2162 - if (topology_is_primary_thread(cpu)) 2163 - continue; 2164 - ret = cpu_down_maps_locked(cpu, CPUHP_OFFLINE); 2165 - if (ret) 2166 - break; 2167 - /* 2168 - * As this needs to hold the cpu maps lock it's impossible 2169 - * to call device_offline() because that ends up calling 2170 - * cpu_down() which takes cpu maps lock. cpu maps lock 2171 - * needs to be held as this might race against in kernel 2172 - * abusers of the hotplug machinery (thermal management). 2173 - * 2174 - * So nothing would update device:offline state. That would 2175 - * leave the sysfs entry stale and prevent onlining after 2176 - * smt control has been changed to 'off' again. This is 2177 - * called under the sysfs hotplug lock, so it is properly 2178 - * serialized against the regular offline usage. 2179 - */ 2180 - cpuhp_offline_cpu_device(cpu); 2181 - } 2182 - if (!ret) 2183 - cpu_smt_control = ctrlval; 2184 - cpu_maps_update_done(); 2185 - return ret; 2186 - } 2187 - 2188 - int cpuhp_smt_enable(void) 2189 - { 2190 - int cpu, ret = 0; 2191 - 2192 - cpu_maps_update_begin(); 2193 - cpu_smt_control = CPU_SMT_ENABLED; 2194 - for_each_present_cpu(cpu) { 2195 - /* Skip online CPUs and CPUs on offline nodes */ 2196 - if (cpu_online(cpu) || !node_online(cpu_to_node(cpu))) 2197 - continue; 2198 - ret = _cpu_up(cpu, 0, CPUHP_ONLINE); 2199 - if (ret) 2200 - break; 2201 - /* See comment in cpuhp_smt_disable() */ 2202 - cpuhp_online_cpu_device(cpu); 2203 - } 2204 - cpu_maps_update_done(); 2205 - return ret; 2206 - } 2207 - 2208 2065 2209 2066 static ssize_t 2210 2067 __store_smt_control(struct device *dev, struct device_attribute *attr,
+2 -2
kernel/cred.c
··· 175 175 put_cred(cred); 176 176 177 177 #ifdef CONFIG_KEYS_REQUEST_CACHE 178 - key_put(current->cached_requested_key); 179 - current->cached_requested_key = NULL; 178 + key_put(tsk->cached_requested_key); 179 + tsk->cached_requested_key = NULL; 180 180 #endif 181 181 } 182 182
+3 -1
kernel/events/core.c
··· 11465 11465 } 11466 11466 } 11467 11467 11468 - if (perf_need_aux_event(event) && !perf_get_aux_event(event, group_leader)) 11468 + if (perf_need_aux_event(event) && !perf_get_aux_event(event, group_leader)) { 11469 + err = -EINVAL; 11469 11470 goto err_locked; 11471 + } 11470 11472 11471 11473 /* 11472 11474 * Must be under the same ctx::mutex as perf_install_in_context(),
+1
kernel/futex.c
··· 1178 1178 1179 1179 /** 1180 1180 * wait_for_owner_exiting - Block until the owner has exited 1181 + * @ret: owner's current futex lock status 1181 1182 * @exiting: Pointer to the exiting task 1182 1183 * 1183 1184 * Caller must hold a refcount on @exiting.
+3 -4
kernel/locking/lockdep.c
··· 482 482 struct lock_trace *trace, *t2; 483 483 struct hlist_head *hash_head; 484 484 u32 hash; 485 - unsigned int max_entries; 485 + int max_entries; 486 486 487 487 BUILD_BUG_ON_NOT_POWER_OF_2(STACK_TRACE_HASH_SIZE); 488 488 BUILD_BUG_ON(LOCK_TRACE_SIZE_IN_LONGS >= MAX_STACK_TRACE_ENTRIES); ··· 490 490 trace = (struct lock_trace *)(stack_trace + nr_stack_trace_entries); 491 491 max_entries = MAX_STACK_TRACE_ENTRIES - nr_stack_trace_entries - 492 492 LOCK_TRACE_SIZE_IN_LONGS; 493 - trace->nr_entries = stack_trace_save(trace->entries, max_entries, 3); 494 493 495 - if (nr_stack_trace_entries >= MAX_STACK_TRACE_ENTRIES - 496 - LOCK_TRACE_SIZE_IN_LONGS - 1) { 494 + if (max_entries <= 0) { 497 495 if (!debug_locks_off_graph_unlock()) 498 496 return NULL; 499 497 ··· 500 502 501 503 return NULL; 502 504 } 505 + trace->nr_entries = stack_trace_save(trace->entries, max_entries, 3); 503 506 504 507 hash = jhash(trace->entries, trace->nr_entries * 505 508 sizeof(trace->entries[0]), 0);
+2 -2
kernel/locking/rwsem.c
··· 1226 1226 * In this case, we attempt to acquire the lock again 1227 1227 * without sleeping. 1228 1228 */ 1229 - if ((wstate == WRITER_HANDOFF) && 1230 - (rwsem_spin_on_owner(sem, 0) == OWNER_NULL)) 1229 + if (wstate == WRITER_HANDOFF && 1230 + rwsem_spin_on_owner(sem, RWSEM_NONSPINNABLE) == OWNER_NULL) 1231 1231 goto trylock_again; 1232 1232 1233 1233 /* Block until there are no active lockers. */
+10 -5
kernel/ptrace.c
··· 264 264 return ret; 265 265 } 266 266 267 - static int ptrace_has_cap(struct user_namespace *ns, unsigned int mode) 267 + static bool ptrace_has_cap(const struct cred *cred, struct user_namespace *ns, 268 + unsigned int mode) 268 269 { 270 + int ret; 271 + 269 272 if (mode & PTRACE_MODE_NOAUDIT) 270 - return has_ns_capability_noaudit(current, ns, CAP_SYS_PTRACE); 273 + ret = security_capable(cred, ns, CAP_SYS_PTRACE, CAP_OPT_NOAUDIT); 271 274 else 272 - return has_ns_capability(current, ns, CAP_SYS_PTRACE); 275 + ret = security_capable(cred, ns, CAP_SYS_PTRACE, CAP_OPT_NONE); 276 + 277 + return ret == 0; 273 278 } 274 279 275 280 /* Returns 0 on success, -errno on denial. */ ··· 326 321 gid_eq(caller_gid, tcred->sgid) && 327 322 gid_eq(caller_gid, tcred->gid)) 328 323 goto ok; 329 - if (ptrace_has_cap(tcred->user_ns, mode)) 324 + if (ptrace_has_cap(cred, tcred->user_ns, mode)) 330 325 goto ok; 331 326 rcu_read_unlock(); 332 327 return -EPERM; ··· 345 340 mm = task->mm; 346 341 if (mm && 347 342 ((get_dumpable(mm) != SUID_DUMP_USER) && 348 - !ptrace_has_cap(mm->user_ns, mode))) 343 + !ptrace_has_cap(cred, mm->user_ns, mode))) 349 344 return -EPERM; 350 345 351 346 return security_ptrace_access_check(task, mode);
+2
kernel/rseq.c
··· 310 310 int ret; 311 311 312 312 if (flags & RSEQ_FLAG_UNREGISTER) { 313 + if (flags & ~RSEQ_FLAG_UNREGISTER) 314 + return -EINVAL; 313 315 /* Unregister rseq for current thread. */ 314 316 if (current->rseq != rseq || !current->rseq) 315 317 return -EINVAL;
+3
kernel/time/posix-stubs.c
··· 151 151 152 152 #ifdef CONFIG_COMPAT 153 153 COMPAT_SYS_NI(timer_create); 154 + #endif 155 + 156 + #if defined(CONFIG_COMPAT) || defined(CONFIG_ALPHA) 154 157 COMPAT_SYS_NI(getitimer); 155 158 COMPAT_SYS_NI(setitimer); 156 159 #endif
+9 -5
kernel/time/tick-sched.c
··· 58 58 59 59 /* 60 60 * Do a quick check without holding jiffies_lock: 61 + * The READ_ONCE() pairs with two updates done later in this function. 61 62 */ 62 - delta = ktime_sub(now, last_jiffies_update); 63 + delta = ktime_sub(now, READ_ONCE(last_jiffies_update)); 63 64 if (delta < tick_period) 64 65 return; 65 66 ··· 71 70 if (delta >= tick_period) { 72 71 73 72 delta = ktime_sub(delta, tick_period); 74 - last_jiffies_update = ktime_add(last_jiffies_update, 75 - tick_period); 73 + /* Pairs with the lockless read in this function. */ 74 + WRITE_ONCE(last_jiffies_update, 75 + ktime_add(last_jiffies_update, tick_period)); 76 76 77 77 /* Slow path for long timeouts */ 78 78 if (unlikely(delta >= tick_period)) { ··· 81 79 82 80 ticks = ktime_divns(delta, incr); 83 81 84 - last_jiffies_update = ktime_add_ns(last_jiffies_update, 85 - incr * ticks); 82 + /* Pairs with the lockless read in this function. */ 83 + WRITE_ONCE(last_jiffies_update, 84 + ktime_add_ns(last_jiffies_update, 85 + incr * ticks)); 86 86 } 87 87 do_timer(++ticks); 88 88
+1
lib/vdso/gettimeofday.c
··· 221 221 return 0; 222 222 } 223 223 224 + static __maybe_unused 224 225 int __cvdso_clock_getres(clockid_t clock, struct __kernel_timespec *res) 225 226 { 226 227 int ret = __cvdso_clock_getres_common(clock, res);
+24 -14
mm/huge_memory.c
··· 527 527 set_compound_page_dtor(page, TRANSHUGE_PAGE_DTOR); 528 528 } 529 529 530 - static unsigned long __thp_get_unmapped_area(struct file *filp, unsigned long len, 530 + static unsigned long __thp_get_unmapped_area(struct file *filp, 531 + unsigned long addr, unsigned long len, 531 532 loff_t off, unsigned long flags, unsigned long size) 532 533 { 533 - unsigned long addr; 534 534 loff_t off_end = off + len; 535 535 loff_t off_align = round_up(off, size); 536 - unsigned long len_pad; 536 + unsigned long len_pad, ret; 537 537 538 538 if (off_end <= off_align || (off_end - off_align) < size) 539 539 return 0; ··· 542 542 if (len_pad < len || (off + len_pad) < off) 543 543 return 0; 544 544 545 - addr = current->mm->get_unmapped_area(filp, 0, len_pad, 545 + ret = current->mm->get_unmapped_area(filp, addr, len_pad, 546 546 off >> PAGE_SHIFT, flags); 547 - if (IS_ERR_VALUE(addr)) 547 + 548 + /* 549 + * The failure might be due to length padding. The caller will retry 550 + * without the padding. 551 + */ 552 + if (IS_ERR_VALUE(ret)) 548 553 return 0; 549 554 550 - addr += (off - addr) & (size - 1); 551 - return addr; 555 + /* 556 + * Do not try to align to THP boundary if allocation at the address 557 + * hint succeeds. 558 + */ 559 + if (ret == addr) 560 + return addr; 561 + 562 + ret += (off - ret) & (size - 1); 563 + return ret; 552 564 } 553 565 554 566 unsigned long thp_get_unmapped_area(struct file *filp, unsigned long addr, 555 567 unsigned long len, unsigned long pgoff, unsigned long flags) 556 568 { 569 + unsigned long ret; 557 570 loff_t off = (loff_t)pgoff << PAGE_SHIFT; 558 571 559 - if (addr) 560 - goto out; 561 572 if (!IS_DAX(filp->f_mapping->host) || !IS_ENABLED(CONFIG_FS_DAX_PMD)) 562 573 goto out; 563 574 564 - addr = __thp_get_unmapped_area(filp, len, off, flags, PMD_SIZE); 565 - if (addr) 566 - return addr; 567 - 568 - out: 575 + ret = __thp_get_unmapped_area(filp, addr, len, off, flags, PMD_SIZE); 576 + if (ret) 577 + return ret; 578 + out: 569 579 return current->mm->get_unmapped_area(filp, addr, len, pgoff, flags); 570 580 } 571 581 EXPORT_SYMBOL_GPL(thp_get_unmapped_area);
+9 -28
mm/memcontrol.c
··· 3287 3287 } 3288 3288 } 3289 3289 3290 - static void memcg_flush_percpu_vmstats(struct mem_cgroup *memcg, bool slab_only) 3290 + static void memcg_flush_percpu_vmstats(struct mem_cgroup *memcg) 3291 3291 { 3292 - unsigned long stat[MEMCG_NR_STAT]; 3292 + unsigned long stat[MEMCG_NR_STAT] = {0}; 3293 3293 struct mem_cgroup *mi; 3294 3294 int node, cpu, i; 3295 - int min_idx, max_idx; 3296 - 3297 - if (slab_only) { 3298 - min_idx = NR_SLAB_RECLAIMABLE; 3299 - max_idx = NR_SLAB_UNRECLAIMABLE; 3300 - } else { 3301 - min_idx = 0; 3302 - max_idx = MEMCG_NR_STAT; 3303 - } 3304 - 3305 - for (i = min_idx; i < max_idx; i++) 3306 - stat[i] = 0; 3307 3295 3308 3296 for_each_online_cpu(cpu) 3309 - for (i = min_idx; i < max_idx; i++) 3297 + for (i = 0; i < MEMCG_NR_STAT; i++) 3310 3298 stat[i] += per_cpu(memcg->vmstats_percpu->stat[i], cpu); 3311 3299 3312 3300 for (mi = memcg; mi; mi = parent_mem_cgroup(mi)) 3313 - for (i = min_idx; i < max_idx; i++) 3301 + for (i = 0; i < MEMCG_NR_STAT; i++) 3314 3302 atomic_long_add(stat[i], &mi->vmstats[i]); 3315 - 3316 - if (!slab_only) 3317 - max_idx = NR_VM_NODE_STAT_ITEMS; 3318 3303 3319 3304 for_each_node(node) { 3320 3305 struct mem_cgroup_per_node *pn = memcg->nodeinfo[node]; 3321 3306 struct mem_cgroup_per_node *pi; 3322 3307 3323 - for (i = min_idx; i < max_idx; i++) 3308 + for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++) 3324 3309 stat[i] = 0; 3325 3310 3326 3311 for_each_online_cpu(cpu) 3327 - for (i = min_idx; i < max_idx; i++) 3312 + for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++) 3328 3313 stat[i] += per_cpu( 3329 3314 pn->lruvec_stat_cpu->count[i], cpu); 3330 3315 3331 3316 for (pi = pn; pi; pi = parent_nodeinfo(pi, node)) 3332 - for (i = min_idx; i < max_idx; i++) 3317 + for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++) 3333 3318 atomic_long_add(stat[i], &pi->lruvec_stat[i]); 3334 3319 } 3335 3320 } ··· 3388 3403 parent = root_mem_cgroup; 3389 3404 3390 3405 /* 3391 - * Deactivate and reparent kmem_caches. Then flush percpu 3392 - * slab statistics to have precise values at the parent and 3393 - * all ancestor levels. It's required to keep slab stats 3394 - * accurate after the reparenting of kmem_caches. 3406 + * Deactivate and reparent kmem_caches. 3395 3407 */ 3396 3408 memcg_deactivate_kmem_caches(memcg, parent); 3397 - memcg_flush_percpu_vmstats(memcg, true); 3398 3409 3399 3410 kmemcg_id = memcg->kmemcg_id; 3400 3411 BUG_ON(kmemcg_id < 0); ··· 4894 4913 * Flush percpu vmstats and vmevents to guarantee the value correctness 4895 4914 * on parent's and all ancestor levels. 4896 4915 */ 4897 - memcg_flush_percpu_vmstats(memcg, false); 4916 + memcg_flush_percpu_vmstats(memcg); 4898 4917 memcg_flush_percpu_vmevents(memcg); 4899 4918 __mem_cgroup_free(memcg); 4900 4919 }
+7 -3
mm/mempolicy.c
··· 2148 2148 nmask = policy_nodemask(gfp, pol); 2149 2149 if (!nmask || node_isset(hpage_node, *nmask)) { 2150 2150 mpol_cond_put(pol); 2151 + /* 2152 + * First, try to allocate THP only on local node, but 2153 + * don't reclaim unnecessarily, just compact. 2154 + */ 2151 2155 page = __alloc_pages_node(hpage_node, 2152 - gfp | __GFP_THISNODE, order); 2156 + gfp | __GFP_THISNODE | __GFP_NORETRY, order); 2153 2157 2154 2158 /* 2155 2159 * If hugepage allocations are configured to always 2156 2160 * synchronous compact or the vma has been madvised 2157 2161 * to prefer hugepage backing, retry allowing remote 2158 - * memory as well. 2162 + * memory with both reclaim and compact as well. 2159 2163 */ 2160 2164 if (!page && (gfp & __GFP_DIRECT_RECLAIM)) 2161 2165 page = __alloc_pages_node(hpage_node, 2162 - gfp | __GFP_NORETRY, order); 2166 + gfp, order); 2163 2167 2164 2168 goto out; 2165 2169 }
+5 -5
mm/page-writeback.c
··· 201 201 if (this_bw < tot_bw) { 202 202 if (min) { 203 203 min *= this_bw; 204 - do_div(min, tot_bw); 204 + min = div64_ul(min, tot_bw); 205 205 } 206 206 if (max < 100) { 207 207 max *= this_bw; 208 - do_div(max, tot_bw); 208 + max = div64_ul(max, tot_bw); 209 209 } 210 210 } 211 211 ··· 766 766 struct wb_domain *dom = dtc_dom(dtc); 767 767 unsigned long thresh = dtc->thresh; 768 768 u64 wb_thresh; 769 - long numerator, denominator; 769 + unsigned long numerator, denominator; 770 770 unsigned long wb_min_ratio, wb_max_ratio; 771 771 772 772 /* ··· 777 777 778 778 wb_thresh = (thresh * (100 - bdi_min_ratio)) / 100; 779 779 wb_thresh *= numerator; 780 - do_div(wb_thresh, denominator); 780 + wb_thresh = div64_ul(wb_thresh, denominator); 781 781 782 782 wb_min_max_ratio(dtc->wb, &wb_min_ratio, &wb_max_ratio); 783 783 ··· 1102 1102 bw = written - min(written, wb->written_stamp); 1103 1103 bw *= HZ; 1104 1104 if (unlikely(elapsed > period)) { 1105 - do_div(bw, elapsed); 1105 + bw = div64_ul(bw, elapsed); 1106 1106 avg = bw; 1107 1107 goto out; 1108 1108 }
+18 -43
mm/page_alloc.c
··· 694 694 #ifdef CONFIG_DEBUG_PAGEALLOC 695 695 unsigned int _debug_guardpage_minorder; 696 696 697 - #ifdef CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT 698 - DEFINE_STATIC_KEY_TRUE(_debug_pagealloc_enabled); 699 - #else 697 + bool _debug_pagealloc_enabled_early __read_mostly 698 + = IS_ENABLED(CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT); 699 + EXPORT_SYMBOL(_debug_pagealloc_enabled_early); 700 700 DEFINE_STATIC_KEY_FALSE(_debug_pagealloc_enabled); 701 - #endif 702 701 EXPORT_SYMBOL(_debug_pagealloc_enabled); 703 702 704 703 DEFINE_STATIC_KEY_FALSE(_debug_guardpage_enabled); 705 704 706 705 static int __init early_debug_pagealloc(char *buf) 707 706 { 708 - bool enable = false; 709 - 710 - if (kstrtobool(buf, &enable)) 711 - return -EINVAL; 712 - 713 - if (enable) 714 - static_branch_enable(&_debug_pagealloc_enabled); 715 - 716 - return 0; 707 + return kstrtobool(buf, &_debug_pagealloc_enabled_early); 717 708 } 718 709 early_param("debug_pagealloc", early_debug_pagealloc); 719 710 720 - static void init_debug_guardpage(void) 711 + void init_debug_pagealloc(void) 721 712 { 722 713 if (!debug_pagealloc_enabled()) 723 714 return; 715 + 716 + static_branch_enable(&_debug_pagealloc_enabled); 724 717 725 718 if (!debug_guardpage_minorder()) 726 719 return; ··· 1179 1186 */ 1180 1187 arch_free_page(page, order); 1181 1188 1182 - if (debug_pagealloc_enabled()) 1189 + if (debug_pagealloc_enabled_static()) 1183 1190 kernel_map_pages(page, 1 << order, 0); 1184 1191 1185 1192 kasan_free_nondeferred_pages(page, order); ··· 1200 1207 1201 1208 static bool bulkfree_pcp_prepare(struct page *page) 1202 1209 { 1203 - if (debug_pagealloc_enabled()) 1210 + if (debug_pagealloc_enabled_static()) 1204 1211 return free_pages_check(page); 1205 1212 else 1206 1213 return false; ··· 1214 1221 */ 1215 1222 static bool free_pcp_prepare(struct page *page) 1216 1223 { 1217 - if (debug_pagealloc_enabled()) 1224 + if (debug_pagealloc_enabled_static()) 1218 1225 return free_pages_prepare(page, 0, true); 1219 1226 else 1220 1227 return free_pages_prepare(page, 0, false); ··· 1966 1973 1967 1974 for_each_populated_zone(zone) 1968 1975 set_zone_contiguous(zone); 1969 - 1970 - #ifdef CONFIG_DEBUG_PAGEALLOC 1971 - init_debug_guardpage(); 1972 - #endif 1973 1976 } 1974 1977 1975 1978 #ifdef CONFIG_CMA ··· 2095 2106 */ 2096 2107 static inline bool check_pcp_refill(struct page *page) 2097 2108 { 2098 - if (debug_pagealloc_enabled()) 2109 + if (debug_pagealloc_enabled_static()) 2099 2110 return check_new_page(page); 2100 2111 else 2101 2112 return false; ··· 2117 2128 } 2118 2129 static inline bool check_new_pcp(struct page *page) 2119 2130 { 2120 - if (debug_pagealloc_enabled()) 2131 + if (debug_pagealloc_enabled_static()) 2121 2132 return check_new_page(page); 2122 2133 else 2123 2134 return false; ··· 2144 2155 set_page_refcounted(page); 2145 2156 2146 2157 arch_alloc_page(page, order); 2147 - if (debug_pagealloc_enabled()) 2158 + if (debug_pagealloc_enabled_static()) 2148 2159 kernel_map_pages(page, 1 << order, 1); 2149 2160 kasan_alloc_pages(page, order); 2150 2161 kernel_poison_pages(page, 1 << order, 1); ··· 4465 4476 if (page) 4466 4477 goto got_pg; 4467 4478 4468 - if (order >= pageblock_order && (gfp_mask & __GFP_IO) && 4469 - !(gfp_mask & __GFP_RETRY_MAYFAIL)) { 4479 + /* 4480 + * Checks for costly allocations with __GFP_NORETRY, which 4481 + * includes some THP page fault allocations 4482 + */ 4483 + if (costly_order && (gfp_mask & __GFP_NORETRY)) { 4470 4484 /* 4471 4485 * If allocating entire pageblock(s) and compaction 4472 4486 * failed because all zones are below low watermarks ··· 4489 4497 */ 4490 4498 if (compact_result == COMPACT_SKIPPED || 4491 4499 compact_result == COMPACT_DEFERRED) 4492 - goto nopage; 4493 - } 4494 - 4495 - /* 4496 - * Checks for costly allocations with __GFP_NORETRY, which 4497 - * includes THP page fault allocations 4498 - */ 4499 - if (costly_order && (gfp_mask & __GFP_NORETRY)) { 4500 - /* 4501 - * If compaction is deferred for high-order allocations, 4502 - * it is because sync compaction recently failed. If 4503 - * this is the case and the caller requested a THP 4504 - * allocation, we do not want to heavily disrupt the 4505 - * system, so we fail the allocation instead of entering 4506 - * direct reclaim. 4507 - */ 4508 - if (compact_result == COMPACT_DEFERRED) 4509 4500 goto nopage; 4510 4501 4511 4502 /*
+4 -3
mm/shmem.c
··· 2107 2107 /* 2108 2108 * Our priority is to support MAP_SHARED mapped hugely; 2109 2109 * and support MAP_PRIVATE mapped hugely too, until it is COWed. 2110 - * But if caller specified an address hint, respect that as before. 2110 + * But if caller specified an address hint and we allocated area there 2111 + * successfully, respect that as before. 2111 2112 */ 2112 - if (uaddr) 2113 + if (uaddr == addr) 2113 2114 return addr; 2114 2115 2115 2116 if (shmem_huge != SHMEM_HUGE_FORCE) { ··· 2144 2143 if (inflated_len < len) 2145 2144 return addr; 2146 2145 2147 - inflated_addr = get_area(NULL, 0, inflated_len, 0, flags); 2146 + inflated_addr = get_area(NULL, uaddr, inflated_len, 0, flags); 2148 2147 if (IS_ERR_VALUE(inflated_addr)) 2149 2148 return addr; 2150 2149 if (inflated_addr & ~PAGE_MASK)
+2 -2
mm/slab.c
··· 1416 1416 #if DEBUG 1417 1417 static bool is_debug_pagealloc_cache(struct kmem_cache *cachep) 1418 1418 { 1419 - if (debug_pagealloc_enabled() && OFF_SLAB(cachep) && 1419 + if (debug_pagealloc_enabled_static() && OFF_SLAB(cachep) && 1420 1420 (cachep->size % PAGE_SIZE) == 0) 1421 1421 return true; 1422 1422 ··· 2008 2008 * to check size >= 256. It guarantees that all necessary small 2009 2009 * sized slab is initialized in current slab initialization sequence. 2010 2010 */ 2011 - if (debug_pagealloc_enabled() && (flags & SLAB_POISON) && 2011 + if (debug_pagealloc_enabled_static() && (flags & SLAB_POISON) && 2012 2012 size >= 256 && cachep->object_size > cache_line_size()) { 2013 2013 if (size < PAGE_SIZE || size % PAGE_SIZE == 0) { 2014 2014 size_t tmp_size = ALIGN(size, PAGE_SIZE);
+2 -1
mm/slab_common.c
··· 903 903 * deactivates the memcg kmem_caches through workqueue. Make sure all 904 904 * previous workitems on workqueue are processed. 905 905 */ 906 - flush_workqueue(memcg_kmem_cache_wq); 906 + if (likely(memcg_kmem_cache_wq)) 907 + flush_workqueue(memcg_kmem_cache_wq); 907 908 908 909 /* 909 910 * If we're racing with children kmem_cache deactivation, it might
+1 -1
mm/slub.c
··· 288 288 unsigned long freepointer_addr; 289 289 void *p; 290 290 291 - if (!debug_pagealloc_enabled()) 291 + if (!debug_pagealloc_enabled_static()) 292 292 return get_freepointer(s, object); 293 293 294 294 freepointer_addr = (unsigned long)object + s->offset;
+8 -1
mm/sparse.c
··· 777 777 if (bitmap_empty(subsection_map, SUBSECTIONS_PER_SECTION)) { 778 778 unsigned long section_nr = pfn_to_section_nr(pfn); 779 779 780 - if (!section_is_early) { 780 + /* 781 + * When removing an early section, the usage map is kept (as the 782 + * usage maps of other sections fall into the same page). It 783 + * will be re-used when re-adding the section - which is then no 784 + * longer an early section. If the usage map is PageReserved, it 785 + * was allocated during boot. 786 + */ 787 + if (!PageReserved(virt_to_page(ms->usage))) { 781 788 kfree(ms->usage); 782 789 ms->usage = NULL; 783 790 }
+2 -2
mm/vmalloc.c
··· 1383 1383 { 1384 1384 flush_cache_vunmap(va->va_start, va->va_end); 1385 1385 unmap_vmap_area(va); 1386 - if (debug_pagealloc_enabled()) 1386 + if (debug_pagealloc_enabled_static()) 1387 1387 flush_tlb_kernel_range(va->va_start, va->va_end); 1388 1388 1389 1389 free_vmap_area_noflush(va); ··· 1681 1681 1682 1682 vunmap_page_range((unsigned long)addr, (unsigned long)addr + size); 1683 1683 1684 - if (debug_pagealloc_enabled()) 1684 + if (debug_pagealloc_enabled_static()) 1685 1685 flush_tlb_kernel_range((unsigned long)addr, 1686 1686 (unsigned long)addr + size); 1687 1687
+3 -1
net/batman-adv/distributed-arp-table.c
··· 285 285 u32 hash = 0; 286 286 const struct batadv_dat_entry *dat = data; 287 287 const unsigned char *key; 288 + __be16 vid; 288 289 u32 i; 289 290 290 291 key = (const unsigned char *)&dat->ip; ··· 295 294 hash ^= (hash >> 6); 296 295 } 297 296 298 - key = (const unsigned char *)&dat->vid; 297 + vid = htons(dat->vid); 298 + key = (__force const unsigned char *)&vid; 299 299 for (i = 0; i < sizeof(dat->vid); i++) { 300 300 hash += key[i]; 301 301 hash += (hash << 10);
-12
net/core/dev.c
··· 9177 9177 9178 9178 void netdev_update_lockdep_key(struct net_device *dev) 9179 9179 { 9180 - struct netdev_queue *queue; 9181 - int i; 9182 - 9183 - lockdep_unregister_key(&dev->qdisc_xmit_lock_key); 9184 9180 lockdep_unregister_key(&dev->addr_list_lock_key); 9185 - 9186 - lockdep_register_key(&dev->qdisc_xmit_lock_key); 9187 9181 lockdep_register_key(&dev->addr_list_lock_key); 9188 9182 9189 9183 lockdep_set_class(&dev->addr_list_lock, &dev->addr_list_lock_key); 9190 - for (i = 0; i < dev->num_tx_queues; i++) { 9191 - queue = netdev_get_tx_queue(dev, i); 9192 - 9193 - lockdep_set_class(&queue->_xmit_lock, 9194 - &dev->qdisc_xmit_lock_key); 9195 - } 9196 9184 } 9197 9185 EXPORT_SYMBOL(netdev_update_lockdep_key); 9198 9186
+4 -4
net/core/devlink.c
··· 6406 6406 devlink_port->attrs.flavour != DEVLINK_PORT_FLAVOUR_DSA; 6407 6407 } 6408 6408 6409 - #define DEVLINK_PORT_TYPE_WARN_TIMEOUT (HZ * 30) 6409 + #define DEVLINK_PORT_TYPE_WARN_TIMEOUT (HZ * 3600) 6410 6410 6411 6411 static void devlink_port_type_warn_schedule(struct devlink_port *devlink_port) 6412 6412 { ··· 7563 7563 EXPORT_SYMBOL_GPL(devlink_region_destroy); 7564 7564 7565 7565 /** 7566 - * devlink_region_shapshot_id_get - get snapshot ID 7566 + * devlink_region_snapshot_id_get - get snapshot ID 7567 7567 * 7568 7568 * This callback should be called when adding a new snapshot, 7569 7569 * Driver should use the same id for multiple snapshots taken ··· 7571 7571 * 7572 7572 * @devlink: devlink 7573 7573 */ 7574 - u32 devlink_region_shapshot_id_get(struct devlink *devlink) 7574 + u32 devlink_region_snapshot_id_get(struct devlink *devlink) 7575 7575 { 7576 7576 u32 id; 7577 7577 ··· 7581 7581 7582 7582 return id; 7583 7583 } 7584 - EXPORT_SYMBOL_GPL(devlink_region_shapshot_id_get); 7584 + EXPORT_SYMBOL_GPL(devlink_region_snapshot_id_get); 7585 7585 7586 7586 /** 7587 7587 * devlink_region_snapshot_create - create a new snapshot
+10 -10
net/core/filter.c
··· 2231 2231 /* First find the starting scatterlist element */ 2232 2232 i = msg->sg.start; 2233 2233 do { 2234 + offset += len; 2234 2235 len = sk_msg_elem(msg, i)->length; 2235 2236 if (start < offset + len) 2236 2237 break; 2237 - offset += len; 2238 2238 sk_msg_iter_var_next(i); 2239 2239 } while (i != msg->sg.end); 2240 2240 ··· 2346 2346 u32, len, u64, flags) 2347 2347 { 2348 2348 struct scatterlist sge, nsge, nnsge, rsge = {0}, *psge; 2349 - u32 new, i = 0, l, space, copy = 0, offset = 0; 2349 + u32 new, i = 0, l = 0, space, copy = 0, offset = 0; 2350 2350 u8 *raw, *to, *from; 2351 2351 struct page *page; 2352 2352 ··· 2356 2356 /* First find the starting scatterlist element */ 2357 2357 i = msg->sg.start; 2358 2358 do { 2359 + offset += l; 2359 2360 l = sk_msg_elem(msg, i)->length; 2360 2361 2361 2362 if (start < offset + l) 2362 2363 break; 2363 - offset += l; 2364 2364 sk_msg_iter_var_next(i); 2365 2365 } while (i != msg->sg.end); 2366 2366 ··· 2415 2415 2416 2416 sk_msg_iter_var_next(i); 2417 2417 sg_unmark_end(psge); 2418 + sg_unmark_end(&rsge); 2418 2419 sk_msg_iter_next(msg, end); 2419 2420 } 2420 2421 ··· 2507 2506 BPF_CALL_4(bpf_msg_pop_data, struct sk_msg *, msg, u32, start, 2508 2507 u32, len, u64, flags) 2509 2508 { 2510 - u32 i = 0, l, space, offset = 0; 2509 + u32 i = 0, l = 0, space, offset = 0; 2511 2510 u64 last = start + len; 2512 2511 int pop; 2513 2512 ··· 2517 2516 /* First find the starting scatterlist element */ 2518 2517 i = msg->sg.start; 2519 2518 do { 2519 + offset += l; 2520 2520 l = sk_msg_elem(msg, i)->length; 2521 2521 2522 2522 if (start < offset + l) 2523 2523 break; 2524 - offset += l; 2525 2524 sk_msg_iter_var_next(i); 2526 2525 } while (i != msg->sg.end); 2527 2526 ··· 5319 5318 if (sk) { 5320 5319 sk = sk_to_full_sk(sk); 5321 5320 if (!sk_fullsock(sk)) { 5322 - if (!sock_flag(sk, SOCK_RCU_FREE)) 5323 - sock_gen_put(sk); 5321 + sock_gen_put(sk); 5324 5322 return NULL; 5325 5323 } 5326 5324 } ··· 5356 5356 if (sk) { 5357 5357 sk = sk_to_full_sk(sk); 5358 5358 if (!sk_fullsock(sk)) { 5359 - if (!sock_flag(sk, SOCK_RCU_FREE)) 5360 - sock_gen_put(sk); 5359 + sock_gen_put(sk); 5361 5360 return NULL; 5362 5361 } 5363 5362 } ··· 5423 5424 5424 5425 BPF_CALL_1(bpf_sk_release, struct sock *, sk) 5425 5426 { 5426 - if (!sock_flag(sk, SOCK_RCU_FREE)) 5427 + /* Only full sockets have sk->sk_flags. */ 5428 + if (!sk_fullsock(sk) || !sock_flag(sk, SOCK_RCU_FREE)) 5427 5429 sock_gen_put(sk); 5428 5430 return 0; 5429 5431 }
+2
net/core/skmsg.c
··· 594 594 595 595 void sk_psock_drop(struct sock *sk, struct sk_psock *psock) 596 596 { 597 + sock_owned_by_me(sk); 598 + 597 599 sk_psock_cork_free(psock); 598 600 sk_psock_zap_ingress(psock); 599 601
+6 -1
net/core/sock_map.c
··· 241 241 struct sock *sk; 242 242 243 243 sk = xchg(psk, NULL); 244 - if (sk) 244 + if (sk) { 245 + lock_sock(sk); 245 246 sock_map_unref(sk, psk); 247 + release_sock(sk); 248 + } 246 249 } 247 250 raw_spin_unlock_bh(&stab->lock); 248 251 rcu_read_unlock(); ··· 865 862 raw_spin_lock_bh(&bucket->lock); 866 863 hlist_for_each_entry_safe(elem, node, &bucket->head, node) { 867 864 hlist_del_rcu(&elem->node); 865 + lock_sock(elem->sk); 868 866 sock_map_unref(elem->sk, elem); 867 + release_sock(elem->sk); 869 868 } 870 869 raw_spin_unlock_bh(&bucket->lock); 871 870 }
+1 -1
net/dsa/tag_gswip.c
··· 104 104 } 105 105 106 106 static const struct dsa_device_ops gswip_netdev_ops = { 107 - .name = "gwsip", 107 + .name = "gswip", 108 108 .proto = DSA_TAG_PROTO_GSWIP, 109 109 .xmit = gswip_tag_xmit, 110 110 .rcv = gswip_tag_rcv,
-3
net/dsa/tag_qca.c
··· 33 33 struct dsa_port *dp = dsa_slave_to_port(dev); 34 34 u16 *phdr, hdr; 35 35 36 - dev->stats.tx_packets++; 37 - dev->stats.tx_bytes += skb->len; 38 - 39 36 if (skb_cow_head(skb, 0) < 0) 40 37 return NULL; 41 38
+6
net/ipv4/fib_trie.c
··· 2193 2193 int count = cb->args[2]; 2194 2194 t_key key = cb->args[3]; 2195 2195 2196 + /* First time here, count and key are both always 0. Count > 0 2197 + * and key == 0 means the dump has wrapped around and we are done. 2198 + */ 2199 + if (count && !key) 2200 + return skb->len; 2201 + 2196 2202 while ((l = leaf_walk_rcu(&tp, key)) != NULL) { 2197 2203 int err; 2198 2204
+10 -9
net/ipv4/netfilter/arp_tables.c
··· 496 496 return 0; 497 497 } 498 498 499 - static inline void cleanup_entry(struct arpt_entry *e) 499 + static void cleanup_entry(struct arpt_entry *e, struct net *net) 500 500 { 501 501 struct xt_tgdtor_param par; 502 502 struct xt_entry_target *t; 503 503 504 504 t = arpt_get_target(e); 505 + par.net = net; 505 506 par.target = t->u.kernel.target; 506 507 par.targinfo = t->data; 507 508 par.family = NFPROTO_ARP; ··· 585 584 xt_entry_foreach(iter, entry0, newinfo->size) { 586 585 if (i-- == 0) 587 586 break; 588 - cleanup_entry(iter); 587 + cleanup_entry(iter, net); 589 588 } 590 589 return ret; 591 590 } ··· 928 927 /* Decrease module usage counts and free resource */ 929 928 loc_cpu_old_entry = oldinfo->entries; 930 929 xt_entry_foreach(iter, loc_cpu_old_entry, oldinfo->size) 931 - cleanup_entry(iter); 930 + cleanup_entry(iter, net); 932 931 933 932 xt_free_table_info(oldinfo); 934 933 if (copy_to_user(counters_ptr, counters, ··· 991 990 992 991 free_newinfo_untrans: 993 992 xt_entry_foreach(iter, loc_cpu_entry, newinfo->size) 994 - cleanup_entry(iter); 993 + cleanup_entry(iter, net); 995 994 free_newinfo: 996 995 xt_free_table_info(newinfo); 997 996 return ret; ··· 1288 1287 1289 1288 free_newinfo_untrans: 1290 1289 xt_entry_foreach(iter, loc_cpu_entry, newinfo->size) 1291 - cleanup_entry(iter); 1290 + cleanup_entry(iter, net); 1292 1291 free_newinfo: 1293 1292 xt_free_table_info(newinfo); 1294 1293 return ret; ··· 1515 1514 return ret; 1516 1515 } 1517 1516 1518 - static void __arpt_unregister_table(struct xt_table *table) 1517 + static void __arpt_unregister_table(struct net *net, struct xt_table *table) 1519 1518 { 1520 1519 struct xt_table_info *private; 1521 1520 void *loc_cpu_entry; ··· 1527 1526 /* Decrease module usage counts and free resources */ 1528 1527 loc_cpu_entry = private->entries; 1529 1528 xt_entry_foreach(iter, loc_cpu_entry, private->size) 1530 - cleanup_entry(iter); 1529 + cleanup_entry(iter, net); 1531 1530 if (private->number > private->initial_entries) 1532 1531 module_put(table_owner); 1533 1532 xt_free_table_info(private); ··· 1567 1566 1568 1567 ret = nf_register_net_hooks(net, ops, hweight32(table->valid_hooks)); 1569 1568 if (ret != 0) { 1570 - __arpt_unregister_table(new_table); 1569 + __arpt_unregister_table(net, new_table); 1571 1570 *res = NULL; 1572 1571 } 1573 1572 ··· 1582 1581 const struct nf_hook_ops *ops) 1583 1582 { 1584 1583 nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks)); 1585 - __arpt_unregister_table(table); 1584 + __arpt_unregister_table(net, table); 1586 1585 } 1587 1586 1588 1587 /* The built-in targets: standard (NULL) and error. */
+7 -10
net/ipv4/tcp_bpf.c
··· 121 121 struct sk_psock *psock; 122 122 int copied, ret; 123 123 124 - if (unlikely(flags & MSG_ERRQUEUE)) 125 - return inet_recv_error(sk, msg, len, addr_len); 126 - if (!skb_queue_empty(&sk->sk_receive_queue)) 127 - return tcp_recvmsg(sk, msg, len, nonblock, flags, addr_len); 128 - 129 124 psock = sk_psock_get(sk); 130 125 if (unlikely(!psock)) 126 + return tcp_recvmsg(sk, msg, len, nonblock, flags, addr_len); 127 + if (unlikely(flags & MSG_ERRQUEUE)) 128 + return inet_recv_error(sk, msg, len, addr_len); 129 + if (!skb_queue_empty(&sk->sk_receive_queue) && 130 + sk_psock_queue_empty(psock)) 131 131 return tcp_recvmsg(sk, msg, len, nonblock, flags, addr_len); 132 132 lock_sock(sk); 133 133 msg_bytes_ready: ··· 139 139 timeo = sock_rcvtimeo(sk, nonblock); 140 140 data = tcp_bpf_wait_data(sk, psock, flags, timeo, &err); 141 141 if (data) { 142 - if (skb_queue_empty(&sk->sk_receive_queue)) 142 + if (!sk_psock_queue_empty(psock)) 143 143 goto msg_bytes_ready; 144 144 release_sock(sk); 145 145 sk_psock_put(sk, psock); ··· 315 315 */ 316 316 delta = msg->sg.size; 317 317 psock->eval = sk_psock_msg_verdict(sk, psock, msg); 318 - if (msg->sg.size < delta) 319 - delta -= msg->sg.size; 320 - else 321 - delta = 0; 318 + delta -= msg->sg.size; 322 319 } 323 320 324 321 if (msg->cork_bytes &&
+4 -3
net/ipv4/tcp_input.c
··· 915 915 /* This must be called before lost_out is incremented */ 916 916 static void tcp_verify_retransmit_hint(struct tcp_sock *tp, struct sk_buff *skb) 917 917 { 918 - if (!tp->retransmit_skb_hint || 919 - before(TCP_SKB_CB(skb)->seq, 920 - TCP_SKB_CB(tp->retransmit_skb_hint)->seq)) 918 + if ((!tp->retransmit_skb_hint && tp->retrans_out >= tp->lost_out) || 919 + (tp->retransmit_skb_hint && 920 + before(TCP_SKB_CB(skb)->seq, 921 + TCP_SKB_CB(tp->retransmit_skb_hint)->seq))) 921 922 tp->retransmit_skb_hint = skb; 922 923 } 923 924
+4 -2
net/ipv4/tcp_ulp.c
··· 99 99 rcu_read_unlock(); 100 100 } 101 101 102 - void tcp_update_ulp(struct sock *sk, struct proto *proto) 102 + void tcp_update_ulp(struct sock *sk, struct proto *proto, 103 + void (*write_space)(struct sock *sk)) 103 104 { 104 105 struct inet_connection_sock *icsk = inet_csk(sk); 105 106 106 107 if (!icsk->icsk_ulp_ops) { 108 + sk->sk_write_space = write_space; 107 109 sk->sk_prot = proto; 108 110 return; 109 111 } 110 112 111 113 if (icsk->icsk_ulp_ops->update) 112 - icsk->icsk_ulp_ops->update(sk, proto); 114 + icsk->icsk_ulp_ops->update(sk, proto, write_space); 113 115 } 114 116 115 117 void tcp_cleanup_ulp(struct sock *sk)
+23
net/mac80211/cfg.c
··· 2954 2954 return err; 2955 2955 } 2956 2956 2957 + static void ieee80211_end_cac(struct wiphy *wiphy, 2958 + struct net_device *dev) 2959 + { 2960 + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 2961 + struct ieee80211_local *local = sdata->local; 2962 + 2963 + mutex_lock(&local->mtx); 2964 + list_for_each_entry(sdata, &local->interfaces, list) { 2965 + /* it might be waiting for the local->mtx, but then 2966 + * by the time it gets it, sdata->wdev.cac_started 2967 + * will no longer be true 2968 + */ 2969 + cancel_delayed_work(&sdata->dfs_cac_timer_work); 2970 + 2971 + if (sdata->wdev.cac_started) { 2972 + ieee80211_vif_release_channel(sdata); 2973 + sdata->wdev.cac_started = false; 2974 + } 2975 + } 2976 + mutex_unlock(&local->mtx); 2977 + } 2978 + 2957 2979 static struct cfg80211_beacon_data * 2958 2980 cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon) 2959 2981 { ··· 4045 4023 #endif 4046 4024 .get_channel = ieee80211_cfg_get_channel, 4047 4025 .start_radar_detection = ieee80211_start_radar_detection, 4026 + .end_cac = ieee80211_end_cac, 4048 4027 .channel_switch = ieee80211_channel_switch, 4049 4028 .set_qos_map = ieee80211_set_qos_map, 4050 4029 .set_ap_chanwidth = ieee80211_set_ap_chanwidth,
+3
net/mac80211/mesh_hwmp.c
··· 328 328 unsigned long fail_avg = 329 329 ewma_mesh_fail_avg_read(&sta->mesh->fail_avg); 330 330 331 + if (sta->mesh->plink_state != NL80211_PLINK_ESTAB) 332 + return MAX_METRIC; 333 + 331 334 /* Try to get rate based on HW/SW RC algorithm. 332 335 * Rate is returned in units of Kbps, correct this 333 336 * to comply with airtime calculation units
+15 -3
net/mac80211/tkip.c
··· 263 263 if ((keyid >> 6) != key->conf.keyidx) 264 264 return TKIP_DECRYPT_INVALID_KEYIDX; 265 265 266 - if (rx_ctx->ctx.state != TKIP_STATE_NOT_INIT && 267 - (iv32 < rx_ctx->iv32 || 268 - (iv32 == rx_ctx->iv32 && iv16 <= rx_ctx->iv16))) 266 + /* Reject replays if the received TSC is smaller than or equal to the 267 + * last received value in a valid message, but with an exception for 268 + * the case where a new key has been set and no valid frame using that 269 + * key has yet received and the local RSC was initialized to 0. This 270 + * exception allows the very first frame sent by the transmitter to be 271 + * accepted even if that transmitter were to use TSC 0 (IEEE 802.11 272 + * described TSC to be initialized to 1 whenever a new key is taken into 273 + * use). 274 + */ 275 + if (iv32 < rx_ctx->iv32 || 276 + (iv32 == rx_ctx->iv32 && 277 + (iv16 < rx_ctx->iv16 || 278 + (iv16 == rx_ctx->iv16 && 279 + (rx_ctx->iv32 || rx_ctx->iv16 || 280 + rx_ctx->ctx.state != TKIP_STATE_NOT_INIT))))) 269 281 return TKIP_DECRYPT_REPLAY; 270 282 271 283 if (only_iv) {
+1 -1
net/netfilter/ipset/ip_set_bitmap_gen.h
··· 60 60 if (SET_WITH_TIMEOUT(set)) 61 61 del_timer_sync(&map->gc); 62 62 63 - ip_set_free(map->members); 64 63 if (set->dsize && set->extensions & IPSET_EXT_DESTROY) 65 64 mtype_ext_cleanup(set); 65 + ip_set_free(map->members); 66 66 ip_set_free(map); 67 67 68 68 set->data = NULL;
+13
net/netfilter/nf_nat_proto.c
··· 233 233 return false; 234 234 235 235 hdr = (struct icmphdr *)(skb->data + hdroff); 236 + switch (hdr->type) { 237 + case ICMP_ECHO: 238 + case ICMP_ECHOREPLY: 239 + case ICMP_TIMESTAMP: 240 + case ICMP_TIMESTAMPREPLY: 241 + case ICMP_INFO_REQUEST: 242 + case ICMP_INFO_REPLY: 243 + case ICMP_ADDRESS: 244 + case ICMP_ADDRESSREPLY: 245 + break; 246 + default: 247 + return true; 248 + } 236 249 inet_proto_csum_replace2(&hdr->checksum, skb, 237 250 hdr->un.echo.id, tuple->src.u.icmp.id, false); 238 251 hdr->un.echo.id = tuple->src.u.icmp.id;
+26 -13
net/netfilter/nf_tables_api.c
··· 22 22 #include <net/net_namespace.h> 23 23 #include <net/sock.h> 24 24 25 + #define NFT_MODULE_AUTOLOAD_LIMIT (MODULE_NAME_LEN - sizeof("nft-expr-255-")) 26 + 25 27 static LIST_HEAD(nf_tables_expressions); 26 28 static LIST_HEAD(nf_tables_objects); 27 29 static LIST_HEAD(nf_tables_flowtables); ··· 566 564 } 567 565 568 566 /* 569 - * Loading a module requires dropping mutex that guards the 570 - * transaction. 571 - * We first need to abort any pending transactions as once 572 - * mutex is unlocked a different client could start a new 573 - * transaction. It must not see any 'future generation' 574 - * changes * as these changes will never happen. 567 + * Loading a module requires dropping mutex that guards the transaction. 568 + * A different client might race to start a new transaction meanwhile. Zap the 569 + * list of pending transaction and then restore it once the mutex is grabbed 570 + * again. Users of this function return EAGAIN which implicitly triggers the 571 + * transaction abort path to clean up the list of pending transactions. 575 572 */ 576 573 #ifdef CONFIG_MODULES 577 - static int __nf_tables_abort(struct net *net); 578 - 579 574 static void nft_request_module(struct net *net, const char *fmt, ...) 580 575 { 581 576 char module_name[MODULE_NAME_LEN]; 577 + LIST_HEAD(commit_list); 582 578 va_list args; 583 579 int ret; 584 580 585 - __nf_tables_abort(net); 581 + list_splice_init(&net->nft.commit_list, &commit_list); 586 582 587 583 va_start(args, fmt); 588 584 ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args); 589 585 va_end(args); 590 - if (WARN(ret >= MODULE_NAME_LEN, "truncated: '%s' (len %d)", module_name, ret)) 586 + if (ret >= MODULE_NAME_LEN) 591 587 return; 592 588 593 589 mutex_unlock(&net->nft.commit_mutex); 594 590 request_module("%s", module_name); 595 591 mutex_lock(&net->nft.commit_mutex); 592 + 593 + WARN_ON_ONCE(!list_empty(&net->nft.commit_list)); 594 + list_splice(&commit_list, &net->nft.commit_list); 596 595 } 597 596 #endif 598 597 ··· 1048 1045 } 1049 1046 1050 1047 list_for_each_entry_safe(flowtable, nft, &ctx->table->flowtables, list) { 1048 + if (!nft_is_active_next(ctx->net, flowtable)) 1049 + continue; 1050 + 1051 1051 err = nft_delflowtable(ctx, flowtable); 1052 1052 if (err < 0) 1053 1053 goto out; 1054 1054 } 1055 1055 1056 1056 list_for_each_entry_safe(obj, ne, &ctx->table->objects, list) { 1057 + if (!nft_is_active_next(ctx->net, obj)) 1058 + continue; 1059 + 1057 1060 err = nft_delobj(ctx, obj); 1058 1061 if (err < 0) 1059 1062 goto out; ··· 1250 1241 .len = NFT_CHAIN_MAXNAMELEN - 1 }, 1251 1242 [NFTA_CHAIN_HOOK] = { .type = NLA_NESTED }, 1252 1243 [NFTA_CHAIN_POLICY] = { .type = NLA_U32 }, 1253 - [NFTA_CHAIN_TYPE] = { .type = NLA_STRING }, 1244 + [NFTA_CHAIN_TYPE] = { .type = NLA_STRING, 1245 + .len = NFT_MODULE_AUTOLOAD_LIMIT }, 1254 1246 [NFTA_CHAIN_COUNTERS] = { .type = NLA_NESTED }, 1255 1247 [NFTA_CHAIN_FLAGS] = { .type = NLA_U32 }, 1256 1248 }; ··· 1686 1676 goto err_hook; 1687 1677 } 1688 1678 if (nft_hook_list_find(hook_list, hook)) { 1679 + kfree(hook); 1689 1680 err = -EEXIST; 1690 1681 goto err_hook; 1691 1682 } ··· 2366 2355 } 2367 2356 2368 2357 static const struct nla_policy nft_expr_policy[NFTA_EXPR_MAX + 1] = { 2369 - [NFTA_EXPR_NAME] = { .type = NLA_STRING }, 2358 + [NFTA_EXPR_NAME] = { .type = NLA_STRING, 2359 + .len = NFT_MODULE_AUTOLOAD_LIMIT }, 2370 2360 [NFTA_EXPR_DATA] = { .type = NLA_NESTED }, 2371 2361 }; 2372 2362 ··· 4210 4198 [NFTA_SET_ELEM_USERDATA] = { .type = NLA_BINARY, 4211 4199 .len = NFT_USERDATA_MAXLEN }, 4212 4200 [NFTA_SET_ELEM_EXPR] = { .type = NLA_NESTED }, 4213 - [NFTA_SET_ELEM_OBJREF] = { .type = NLA_STRING }, 4201 + [NFTA_SET_ELEM_OBJREF] = { .type = NLA_STRING, 4202 + .len = NFT_OBJ_MAXNAMELEN - 1 }, 4214 4203 }; 4215 4204 4216 4205 static const struct nla_policy nft_set_elem_list_policy[NFTA_SET_ELEM_LIST_MAX + 1] = {
+4 -1
net/netfilter/nft_tunnel.c
··· 76 76 struct nft_tunnel *priv = nft_expr_priv(expr); 77 77 u32 len; 78 78 79 - if (!tb[NFTA_TUNNEL_KEY] && 79 + if (!tb[NFTA_TUNNEL_KEY] || 80 80 !tb[NFTA_TUNNEL_DREG]) 81 81 return -EINVAL; 82 82 ··· 265 265 NULL); 266 266 if (err < 0) 267 267 return err; 268 + 269 + if (!tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION]) 270 + return -EINVAL; 268 271 269 272 version = ntohl(nla_get_be32(tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION])); 270 273 switch (version) {
+11
net/sched/act_ctinfo.c
··· 360 360 return tcf_idr_search(tn, a, index); 361 361 } 362 362 363 + static void tcf_ctinfo_cleanup(struct tc_action *a) 364 + { 365 + struct tcf_ctinfo *ci = to_ctinfo(a); 366 + struct tcf_ctinfo_params *cp; 367 + 368 + cp = rcu_dereference_protected(ci->params, 1); 369 + if (cp) 370 + kfree_rcu(cp, rcu); 371 + } 372 + 363 373 static struct tc_action_ops act_ctinfo_ops = { 364 374 .kind = "ctinfo", 365 375 .id = TCA_ID_CTINFO, ··· 377 367 .act = tcf_ctinfo_act, 378 368 .dump = tcf_ctinfo_dump, 379 369 .init = tcf_ctinfo_init, 370 + .cleanup= tcf_ctinfo_cleanup, 380 371 .walk = tcf_ctinfo_walker, 381 372 .lookup = tcf_ctinfo_search, 382 373 .size = sizeof(struct tcf_ctinfo),
+3 -4
net/sched/act_ife.c
··· 537 537 } 538 538 539 539 ife = to_ife(*a); 540 + if (ret == ACT_P_CREATED) 541 + INIT_LIST_HEAD(&ife->metalist); 542 + 540 543 err = tcf_action_check_ctrlact(parm->action, tp, &goto_ch, extack); 541 544 if (err < 0) 542 545 goto release_idr; ··· 568 565 569 566 p->eth_type = ife_type; 570 567 } 571 - 572 - 573 - if (ret == ACT_P_CREATED) 574 - INIT_LIST_HEAD(&ife->metalist); 575 568 576 569 if (tb[TCA_IFE_METALST]) { 577 570 err = nla_parse_nested_deprecated(tb2, IFE_META_MAX,
+22 -7
net/sunrpc/xprtrdma/verbs.c
··· 77 77 static void rpcrdma_sendctx_put_locked(struct rpcrdma_xprt *r_xprt, 78 78 struct rpcrdma_sendctx *sc); 79 79 static void rpcrdma_reqs_reset(struct rpcrdma_xprt *r_xprt); 80 - static void rpcrdma_reps_destroy(struct rpcrdma_buffer *buf); 80 + static void rpcrdma_reps_unmap(struct rpcrdma_xprt *r_xprt); 81 81 static void rpcrdma_mrs_create(struct rpcrdma_xprt *r_xprt); 82 82 static void rpcrdma_mrs_destroy(struct rpcrdma_xprt *r_xprt); 83 83 static struct rpcrdma_regbuf * ··· 244 244 ia->ri_id->device->name, 245 245 rpcrdma_addrstr(r_xprt), rpcrdma_portstr(r_xprt)); 246 246 #endif 247 + init_completion(&ia->ri_remove_done); 247 248 set_bit(RPCRDMA_IAF_REMOVING, &ia->ri_flags); 248 249 ep->rep_connected = -ENODEV; 249 250 xprt_force_disconnect(xprt); ··· 298 297 int rc; 299 298 300 299 init_completion(&ia->ri_done); 301 - init_completion(&ia->ri_remove_done); 302 300 303 301 id = rdma_create_id(xprt->rx_xprt.xprt_net, rpcrdma_cm_event_handler, 304 302 xprt, RDMA_PS_TCP, IB_QPT_RC); ··· 421 421 /* The ULP is responsible for ensuring all DMA 422 422 * mappings and MRs are gone. 423 423 */ 424 - rpcrdma_reps_destroy(buf); 424 + rpcrdma_reps_unmap(r_xprt); 425 425 list_for_each_entry(req, &buf->rb_allreqs, rl_all) { 426 426 rpcrdma_regbuf_dma_unmap(req->rl_rdmabuf); 427 427 rpcrdma_regbuf_dma_unmap(req->rl_sendbuf); ··· 599 599 struct ib_qp_init_attr *qp_init_attr) 600 600 { 601 601 struct rpcrdma_ia *ia = &r_xprt->rx_ia; 602 + struct rpcrdma_ep *ep = &r_xprt->rx_ep; 602 603 int rc, err; 603 604 604 605 trace_xprtrdma_reinsert(r_xprt); ··· 614 613 pr_err("rpcrdma: rpcrdma_ep_create returned %d\n", err); 615 614 goto out2; 616 615 } 616 + memcpy(qp_init_attr, &ep->rep_attr, sizeof(*qp_init_attr)); 617 617 618 618 rc = -ENETUNREACH; 619 619 err = rdma_create_qp(ia->ri_id, ia->ri_pd, qp_init_attr); ··· 1092 1090 rep->rr_recv_wr.sg_list = &rep->rr_rdmabuf->rg_iov; 1093 1091 rep->rr_recv_wr.num_sge = 1; 1094 1092 rep->rr_temp = temp; 1093 + list_add(&rep->rr_all, &r_xprt->rx_buf.rb_all_reps); 1095 1094 return rep; 1096 1095 1097 1096 out_free: ··· 1103 1100 1104 1101 static void rpcrdma_rep_destroy(struct rpcrdma_rep *rep) 1105 1102 { 1103 + list_del(&rep->rr_all); 1106 1104 rpcrdma_regbuf_free(rep->rr_rdmabuf); 1107 1105 kfree(rep); 1108 1106 } ··· 1122 1118 static void rpcrdma_rep_put(struct rpcrdma_buffer *buf, 1123 1119 struct rpcrdma_rep *rep) 1124 1120 { 1125 - if (!rep->rr_temp) 1126 - llist_add(&rep->rr_node, &buf->rb_free_reps); 1127 - else 1128 - rpcrdma_rep_destroy(rep); 1121 + llist_add(&rep->rr_node, &buf->rb_free_reps); 1122 + } 1123 + 1124 + static void rpcrdma_reps_unmap(struct rpcrdma_xprt *r_xprt) 1125 + { 1126 + struct rpcrdma_buffer *buf = &r_xprt->rx_buf; 1127 + struct rpcrdma_rep *rep; 1128 + 1129 + list_for_each_entry(rep, &buf->rb_all_reps, rr_all) 1130 + rpcrdma_regbuf_dma_unmap(rep->rr_rdmabuf); 1129 1131 } 1130 1132 1131 1133 static void rpcrdma_reps_destroy(struct rpcrdma_buffer *buf) ··· 1162 1152 1163 1153 INIT_LIST_HEAD(&buf->rb_send_bufs); 1164 1154 INIT_LIST_HEAD(&buf->rb_allreqs); 1155 + INIT_LIST_HEAD(&buf->rb_all_reps); 1165 1156 1166 1157 rc = -ENOMEM; 1167 1158 for (i = 0; i < buf->rb_max_requests; i++) { ··· 1515 1504 wr = NULL; 1516 1505 while (needed) { 1517 1506 rep = rpcrdma_rep_get_locked(buf); 1507 + if (rep && rep->rr_temp) { 1508 + rpcrdma_rep_destroy(rep); 1509 + continue; 1510 + } 1518 1511 if (!rep) 1519 1512 rep = rpcrdma_rep_create(r_xprt, temp); 1520 1513 if (!rep)
+2
net/sunrpc/xprtrdma/xprt_rdma.h
··· 203 203 struct xdr_stream rr_stream; 204 204 struct llist_node rr_node; 205 205 struct ib_recv_wr rr_recv_wr; 206 + struct list_head rr_all; 206 207 }; 207 208 208 209 /* To reduce the rate at which a transport invokes ib_post_recv ··· 369 368 370 369 struct list_head rb_allreqs; 371 370 struct list_head rb_all_mrs; 371 + struct list_head rb_all_reps; 372 372 373 373 struct llist_head rb_free_reps; 374 374
+7 -3
net/tls/tls_main.c
··· 732 732 return rc; 733 733 } 734 734 735 - static void tls_update(struct sock *sk, struct proto *p) 735 + static void tls_update(struct sock *sk, struct proto *p, 736 + void (*write_space)(struct sock *sk)) 736 737 { 737 738 struct tls_context *ctx; 738 739 739 740 ctx = tls_get_ctx(sk); 740 - if (likely(ctx)) 741 + if (likely(ctx)) { 742 + ctx->sk_write_space = write_space; 741 743 ctx->sk_proto = p; 742 - else 744 + } else { 743 745 sk->sk_prot = p; 746 + sk->sk_write_space = write_space; 747 + } 744 748 } 745 749 746 750 static int tls_get_info(const struct sock *sk, struct sk_buff *skb)
+32 -9
net/tls/tls_sw.c
··· 256 256 return ret; 257 257 258 258 ret = crypto_wait_req(ret, &ctx->async_wait); 259 - } else if (ret == -EBADMSG) { 260 - TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSDECRYPTERROR); 261 259 } 262 260 263 261 if (async) ··· 680 682 681 683 split_point = msg_pl->apply_bytes; 682 684 split = split_point && split_point < msg_pl->sg.size; 685 + if (unlikely((!split && 686 + msg_pl->sg.size + 687 + prot->overhead_size > msg_en->sg.size) || 688 + (split && 689 + split_point + 690 + prot->overhead_size > msg_en->sg.size))) { 691 + split = true; 692 + split_point = msg_en->sg.size; 693 + } 683 694 if (split) { 684 695 rc = tls_split_open_record(sk, rec, &tmp, msg_pl, msg_en, 685 696 split_point, prot->overhead_size, 686 697 &orig_end); 687 698 if (rc < 0) 688 699 return rc; 700 + /* This can happen if above tls_split_open_record allocates 701 + * a single large encryption buffer instead of two smaller 702 + * ones. In this case adjust pointers and continue without 703 + * split. 704 + */ 705 + if (!msg_pl->sg.size) { 706 + tls_merge_open_record(sk, rec, tmp, orig_end); 707 + msg_pl = &rec->msg_plaintext; 708 + msg_en = &rec->msg_encrypted; 709 + split = false; 710 + } 689 711 sk_msg_trim(sk, msg_en, msg_pl->sg.size + 690 712 prot->overhead_size); 691 713 } ··· 725 707 &rec->sg_content_type); 726 708 } else { 727 709 sg_mark_end(sk_msg_elem(msg_pl, i)); 710 + } 711 + 712 + if (msg_pl->sg.end < msg_pl->sg.start) { 713 + sg_chain(&msg_pl->sg.data[msg_pl->sg.start], 714 + MAX_SKB_FRAGS - msg_pl->sg.start + 1, 715 + msg_pl->sg.data); 728 716 } 729 717 730 718 i = msg_pl->sg.start; ··· 796 772 psock = sk_psock_get(sk); 797 773 if (!psock || !policy) { 798 774 err = tls_push_record(sk, flags, record_type); 799 - if (err) { 775 + if (err && err != -EINPROGRESS) { 800 776 *copied -= sk_msg_free(sk, msg); 801 777 tls_free_open_rec(sk); 802 778 } ··· 807 783 if (psock->eval == __SK_NONE) { 808 784 delta = msg->sg.size; 809 785 psock->eval = sk_psock_msg_verdict(sk, psock, msg); 810 - if (delta < msg->sg.size) 811 - delta -= msg->sg.size; 812 - else 813 - delta = 0; 786 + delta -= msg->sg.size; 814 787 } 815 788 if (msg->cork_bytes && msg->cork_bytes > msg->sg.size && 816 789 !enospc && !full_record) { ··· 822 801 switch (psock->eval) { 823 802 case __SK_PASS: 824 803 err = tls_push_record(sk, flags, record_type); 825 - if (err < 0) { 804 + if (err && err != -EINPROGRESS) { 826 805 *copied -= sk_msg_free(sk, msg); 827 806 tls_free_open_rec(sk); 828 807 goto out_err; ··· 1536 1515 if (err == -EINPROGRESS) 1537 1516 tls_advance_record_sn(sk, prot, 1538 1517 &tls_ctx->rx); 1539 - 1518 + else if (err == -EBADMSG) 1519 + TLS_INC_STATS(sock_net(sk), 1520 + LINUX_MIB_TLSDECRYPTERROR); 1540 1521 return err; 1541 1522 } 1542 1523 } else {
+6 -59
net/vmw_vsock/hyperv_transport.c
··· 138 138 **************************************************************************** 139 139 * The only valid Service GUIDs, from the perspectives of both the host and * 140 140 * Linux VM, that can be connected by the other end, must conform to this * 141 - * format: <port>-facb-11e6-bd58-64006a7986d3, and the "port" must be in * 142 - * this range [0, 0x7FFFFFFF]. * 141 + * format: <port>-facb-11e6-bd58-64006a7986d3. * 143 142 **************************************************************************** 144 143 * 145 144 * When we write apps on the host to connect(), the GUID ServiceID is used. 146 145 * When we write apps in Linux VM to connect(), we only need to specify the 147 146 * port and the driver will form the GUID and use that to request the host. 148 147 * 149 - * From the perspective of Linux VM: 150 - * 1. the local ephemeral port (i.e. the local auto-bound port when we call 151 - * connect() without explicit bind()) is generated by __vsock_bind_stream(), 152 - * and the range is [1024, 0xFFFFFFFF). 153 - * 2. the remote ephemeral port (i.e. the auto-generated remote port for 154 - * a connect request initiated by the host's connect()) is generated by 155 - * hvs_remote_addr_init() and the range is [0x80000000, 0xFFFFFFFF). 156 148 */ 157 - 158 - #define MAX_LISTEN_PORT ((u32)0x7FFFFFFF) 159 - #define MAX_VM_LISTEN_PORT MAX_LISTEN_PORT 160 - #define MAX_HOST_LISTEN_PORT MAX_LISTEN_PORT 161 - #define MIN_HOST_EPHEMERAL_PORT (MAX_HOST_LISTEN_PORT + 1) 162 149 163 150 /* 00000000-facb-11e6-bd58-64006a7986d3 */ 164 151 static const guid_t srv_id_template = ··· 169 182 unsigned int port = get_port_by_srv_id(svr_id); 170 183 171 184 vsock_addr_init(addr, VMADDR_CID_ANY, port); 172 - } 173 - 174 - static void hvs_remote_addr_init(struct sockaddr_vm *remote, 175 - struct sockaddr_vm *local) 176 - { 177 - static u32 host_ephemeral_port = MIN_HOST_EPHEMERAL_PORT; 178 - struct sock *sk; 179 - 180 - /* Remote peer is always the host */ 181 - vsock_addr_init(remote, VMADDR_CID_HOST, VMADDR_PORT_ANY); 182 - 183 - while (1) { 184 - /* Wrap around ? */ 185 - if (host_ephemeral_port < MIN_HOST_EPHEMERAL_PORT || 186 - host_ephemeral_port == VMADDR_PORT_ANY) 187 - host_ephemeral_port = MIN_HOST_EPHEMERAL_PORT; 188 - 189 - remote->svm_port = host_ephemeral_port++; 190 - 191 - sk = vsock_find_connected_socket(remote, local); 192 - if (!sk) { 193 - /* Found an available ephemeral port */ 194 - return; 195 - } 196 - 197 - /* Release refcnt got in vsock_find_connected_socket */ 198 - sock_put(sk); 199 - } 200 185 } 201 186 202 187 static void hvs_set_channel_pending_send_size(struct vmbus_channel *chan) ··· 300 341 if_type = &chan->offermsg.offer.if_type; 301 342 if_instance = &chan->offermsg.offer.if_instance; 302 343 conn_from_host = chan->offermsg.offer.u.pipe.user_def[0]; 303 - 304 - /* The host or the VM should only listen on a port in 305 - * [0, MAX_LISTEN_PORT] 306 - */ 307 - if (!is_valid_srv_id(if_type) || 308 - get_port_by_srv_id(if_type) > MAX_LISTEN_PORT) 344 + if (!is_valid_srv_id(if_type)) 309 345 return; 310 346 311 347 hvs_addr_init(&addr, conn_from_host ? if_type : if_instance); ··· 325 371 vnew = vsock_sk(new); 326 372 327 373 hvs_addr_init(&vnew->local_addr, if_type); 328 - hvs_remote_addr_init(&vnew->remote_addr, &vnew->local_addr); 329 374 375 + /* Remote peer is always the host */ 376 + vsock_addr_init(&vnew->remote_addr, 377 + VMADDR_CID_HOST, VMADDR_PORT_ANY); 378 + vnew->remote_addr.svm_port = get_port_by_srv_id(if_instance); 330 379 ret = vsock_assign_transport(vnew, vsock_sk(sk)); 331 380 /* Transport assigned (looking at remote_addr) must be the 332 381 * same where we received the request. ··· 723 766 724 767 static bool hvs_stream_allow(u32 cid, u32 port) 725 768 { 726 - /* The host's port range [MIN_HOST_EPHEMERAL_PORT, 0xFFFFFFFF) is 727 - * reserved as ephemeral ports, which are used as the host's ports 728 - * when the host initiates connections. 729 - * 730 - * Perform this check in the guest so an immediate error is produced 731 - * instead of a timeout. 732 - */ 733 - if (port > MAX_HOST_LISTEN_PORT) 734 - return false; 735 - 736 769 if (cid == VMADDR_CID_HOST) 737 770 return true; 738 771
+3
net/wireless/nl80211.c
··· 10843 10843 if (err) 10844 10844 return err; 10845 10845 10846 + cfg80211_sinfo_release_content(&sinfo); 10846 10847 if (sinfo.filled & BIT_ULL(NL80211_STA_INFO_BEACON_SIGNAL_AVG)) 10847 10848 wdev->cqm_config->last_rssi_event_value = 10848 10849 (s8) sinfo.rx_beacon_signal_avg; ··· 13796 13795 err = rdev_get_station(rdev, dev, dest, &sinfo); 13797 13796 if (err) 13798 13797 return err; 13798 + 13799 + cfg80211_sinfo_release_content(&sinfo); 13799 13800 13800 13801 return rdev_probe_mesh_link(rdev, dev, dest, buf, len); 13801 13802 }
+14
net/wireless/rdev-ops.h
··· 538 538 rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed) 539 539 { 540 540 int ret; 541 + 542 + if (!rdev->ops->set_wiphy_params) 543 + return -EOPNOTSUPP; 544 + 541 545 trace_rdev_set_wiphy_params(&rdev->wiphy, changed); 542 546 ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed); 543 547 trace_rdev_return_int(&rdev->wiphy, ret); ··· 1169 1165 chandef, cac_time_ms); 1170 1166 trace_rdev_return_int(&rdev->wiphy, ret); 1171 1167 return ret; 1168 + } 1169 + 1170 + static inline void 1171 + rdev_end_cac(struct cfg80211_registered_device *rdev, 1172 + struct net_device *dev) 1173 + { 1174 + trace_rdev_end_cac(&rdev->wiphy, dev); 1175 + if (rdev->ops->end_cac) 1176 + rdev->ops->end_cac(&rdev->wiphy, dev); 1177 + trace_rdev_return_void(&rdev->wiphy); 1172 1178 } 1173 1179 1174 1180 static inline int
+32 -4
net/wireless/reg.c
··· 2261 2261 2262 2262 static void handle_channel_custom(struct wiphy *wiphy, 2263 2263 struct ieee80211_channel *chan, 2264 - const struct ieee80211_regdomain *regd) 2264 + const struct ieee80211_regdomain *regd, 2265 + u32 min_bw) 2265 2266 { 2266 2267 u32 bw_flags = 0; 2267 2268 const struct ieee80211_reg_rule *reg_rule = NULL; 2268 2269 const struct ieee80211_power_rule *power_rule = NULL; 2269 2270 u32 bw; 2270 2271 2271 - for (bw = MHZ_TO_KHZ(20); bw >= MHZ_TO_KHZ(5); bw = bw / 2) { 2272 + for (bw = MHZ_TO_KHZ(20); bw >= min_bw; bw = bw / 2) { 2272 2273 reg_rule = freq_reg_info_regd(MHZ_TO_KHZ(chan->center_freq), 2273 2274 regd, bw); 2274 2275 if (!IS_ERR(reg_rule)) ··· 2325 2324 if (!sband) 2326 2325 return; 2327 2326 2327 + /* 2328 + * We currently assume that you always want at least 20 MHz, 2329 + * otherwise channel 12 might get enabled if this rule is 2330 + * compatible to US, which permits 2402 - 2472 MHz. 2331 + */ 2328 2332 for (i = 0; i < sband->n_channels; i++) 2329 - handle_channel_custom(wiphy, &sband->channels[i], regd); 2333 + handle_channel_custom(wiphy, &sband->channels[i], regd, 2334 + MHZ_TO_KHZ(20)); 2330 2335 } 2331 2336 2332 2337 /* Used by drivers prior to wiphy registration */ ··· 3892 3885 } 3893 3886 EXPORT_SYMBOL(regulatory_pre_cac_allowed); 3894 3887 3888 + static void cfg80211_check_and_end_cac(struct cfg80211_registered_device *rdev) 3889 + { 3890 + struct wireless_dev *wdev; 3891 + /* If we finished CAC or received radar, we should end any 3892 + * CAC running on the same channels. 3893 + * the check !cfg80211_chandef_dfs_usable contain 2 options: 3894 + * either all channels are available - those the CAC_FINISHED 3895 + * event has effected another wdev state, or there is a channel 3896 + * in unavailable state in wdev chandef - those the RADAR_DETECTED 3897 + * event has effected another wdev state. 3898 + * In both cases we should end the CAC on the wdev. 3899 + */ 3900 + list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { 3901 + if (wdev->cac_started && 3902 + !cfg80211_chandef_dfs_usable(&rdev->wiphy, &wdev->chandef)) 3903 + rdev_end_cac(rdev, wdev->netdev); 3904 + } 3905 + } 3906 + 3895 3907 void regulatory_propagate_dfs_state(struct wiphy *wiphy, 3896 3908 struct cfg80211_chan_def *chandef, 3897 3909 enum nl80211_dfs_state dfs_state, ··· 3937 3911 cfg80211_set_dfs_state(&rdev->wiphy, chandef, dfs_state); 3938 3912 3939 3913 if (event == NL80211_RADAR_DETECTED || 3940 - event == NL80211_RADAR_CAC_FINISHED) 3914 + event == NL80211_RADAR_CAC_FINISHED) { 3941 3915 cfg80211_sched_dfs_chan_update(rdev); 3916 + cfg80211_check_and_end_cac(rdev); 3917 + } 3942 3918 3943 3919 nl80211_radar_notify(rdev, chandef, event, NULL, GFP_KERNEL); 3944 3920 }
+3 -3
net/wireless/sme.c
··· 1307 1307 if (wdev->conn_owner_nlportid) { 1308 1308 switch (wdev->iftype) { 1309 1309 case NL80211_IFTYPE_ADHOC: 1310 - cfg80211_leave_ibss(rdev, wdev->netdev, false); 1310 + __cfg80211_leave_ibss(rdev, wdev->netdev, false); 1311 1311 break; 1312 1312 case NL80211_IFTYPE_AP: 1313 1313 case NL80211_IFTYPE_P2P_GO: 1314 - cfg80211_stop_ap(rdev, wdev->netdev, false); 1314 + __cfg80211_stop_ap(rdev, wdev->netdev, false); 1315 1315 break; 1316 1316 case NL80211_IFTYPE_MESH_POINT: 1317 - cfg80211_leave_mesh(rdev, wdev->netdev); 1317 + __cfg80211_leave_mesh(rdev, wdev->netdev); 1318 1318 break; 1319 1319 case NL80211_IFTYPE_STATION: 1320 1320 case NL80211_IFTYPE_P2P_CLIENT:
+5
net/wireless/trace.h
··· 646 646 TP_ARGS(wiphy, netdev) 647 647 ); 648 648 649 + DEFINE_EVENT(wiphy_netdev_evt, rdev_end_cac, 650 + TP_PROTO(struct wiphy *wiphy, struct net_device *netdev), 651 + TP_ARGS(wiphy, netdev) 652 + ); 653 + 649 654 DECLARE_EVENT_CLASS(station_add_change, 650 655 TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac, 651 656 struct station_parameters *params),
+1 -1
net/wireless/util.c
··· 564 564 struct skb_shared_info *sh = skb_shinfo(skb); 565 565 int page_offset; 566 566 567 - page_ref_inc(page); 567 + get_page(page); 568 568 page_offset = ptr - page_address(page); 569 569 skb_add_rx_frag(skb, sh->nr_frags, page, page_offset, len, size); 570 570 }
+2 -1
net/wireless/wext-core.c
··· 657 657 return NULL; 658 658 } 659 659 660 - static int iw_handler_get_iwstats(struct net_device * dev, 660 + /* noinline to avoid a bogus warning with -O3 */ 661 + static noinline int iw_handler_get_iwstats(struct net_device * dev, 661 662 struct iw_request_info * info, 662 663 union iwreq_data * wrqu, 663 664 char * extra)
+5 -1
net/x25/af_x25.c
··· 766 766 if (sk->sk_state == TCP_ESTABLISHED) 767 767 goto out; 768 768 769 + rc = -EALREADY; /* Do nothing if call is already in progress */ 770 + if (sk->sk_state == TCP_SYN_SENT) 771 + goto out; 772 + 769 773 sk->sk_state = TCP_CLOSE; 770 774 sock->state = SS_UNCONNECTED; 771 775 ··· 816 812 /* Now the loop */ 817 813 rc = -EINPROGRESS; 818 814 if (sk->sk_state != TCP_ESTABLISHED && (flags & O_NONBLOCK)) 819 - goto out_put_neigh; 815 + goto out; 820 816 821 817 rc = x25_wait_for_connection_establishment(sk); 822 818 if (rc)
+9 -5
sound/core/seq/seq_timer.c
··· 471 471 q = queueptr(idx); 472 472 if (q == NULL) 473 473 continue; 474 - if ((tmr = q->timer) == NULL || 475 - (ti = tmr->timeri) == NULL) { 476 - queuefree(q); 477 - continue; 478 - } 474 + mutex_lock(&q->timer_mutex); 475 + tmr = q->timer; 476 + if (!tmr) 477 + goto unlock; 478 + ti = tmr->timeri; 479 + if (!ti) 480 + goto unlock; 479 481 snd_iprintf(buffer, "Timer for queue %i : %s\n", q->queue, ti->timer->name); 480 482 resolution = snd_timer_resolution(ti) * tmr->ticks; 481 483 snd_iprintf(buffer, " Period time : %lu.%09lu\n", resolution / 1000000000, resolution % 1000000000); 482 484 snd_iprintf(buffer, " Skew : %u / %u\n", tmr->skew, tmr->skew_base); 485 + unlock: 486 + mutex_unlock(&q->timer_mutex); 483 487 queuefree(q); 484 488 } 485 489 }
+4 -1
sound/firewire/dice/dice-extension.c
··· 159 159 int j; 160 160 161 161 for (j = i + 1; j < 9; ++j) { 162 - if (pointers[i * 2] == pointers[j * 2]) 162 + if (pointers[i * 2] == pointers[j * 2]) { 163 + // Fallback to limited functionality. 164 + err = -ENXIO; 163 165 goto end; 166 + } 164 167 } 165 168 } 166 169
+3 -2
sound/firewire/tascam/amdtp-tascam.c
··· 157 157 if ((before ^ after) & mask) { 158 158 struct snd_firewire_tascam_change *entry = 159 159 &tscm->queue[tscm->push_pos]; 160 + unsigned long flag; 160 161 161 - spin_lock_irq(&tscm->lock); 162 + spin_lock_irqsave(&tscm->lock, flag); 162 163 entry->index = index; 163 164 entry->before = before; 164 165 entry->after = after; 165 166 if (++tscm->push_pos >= SND_TSCM_QUEUE_COUNT) 166 167 tscm->push_pos = 0; 167 - spin_unlock_irq(&tscm->lock); 168 + spin_unlock_irqrestore(&tscm->lock, flag); 168 169 169 170 wake_up(&tscm->hwdep_wait); 170 171 }
+8 -5
sound/pci/hda/hda_intel.c
··· 125 125 static bool beep_mode[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 126 126 CONFIG_SND_HDA_INPUT_BEEP_MODE}; 127 127 #endif 128 - static bool dsp_driver = 1; 128 + static bool dmic_detect = 1; 129 129 130 130 module_param_array(index, int, NULL, 0444); 131 131 MODULE_PARM_DESC(index, "Index value for Intel HD audio interface."); ··· 160 160 MODULE_PARM_DESC(beep_mode, "Select HDA Beep registration mode " 161 161 "(0=off, 1=on) (default=1)."); 162 162 #endif 163 - module_param(dsp_driver, bool, 0444); 164 - MODULE_PARM_DESC(dsp_driver, "Allow DSP driver selection (bypass this driver) " 165 - "(0=off, 1=on) (default=1)"); 163 + module_param(dmic_detect, bool, 0444); 164 + MODULE_PARM_DESC(dmic_detect, "Allow DSP driver selection (bypass this driver) " 165 + "(0=off, 1=on) (default=1); " 166 + "deprecated, use snd-intel-dspcfg.dsp_driver option instead"); 166 167 167 168 #ifdef CONFIG_PM 168 169 static int param_set_xint(const char *val, const struct kernel_param *kp); ··· 2100 2099 /* 2101 2100 * stop probe if another Intel's DSP driver should be activated 2102 2101 */ 2103 - if (dsp_driver) { 2102 + if (dmic_detect) { 2104 2103 err = snd_intel_dsp_driver_probe(pci); 2105 2104 if (err != SND_INTEL_DSP_DRIVER_ANY && 2106 2105 err != SND_INTEL_DSP_DRIVER_LEGACY) 2107 2106 return -ENODEV; 2107 + } else { 2108 + dev_warn(&pci->dev, "dmic_detect option is deprecated, pass snd-intel-dspcfg.dsp_driver=1 option instead\n"); 2108 2109 } 2109 2110 2110 2111 err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
+8
sound/soc/codecs/cros_ec_codec.c
··· 10 10 11 11 #include <crypto/hash.h> 12 12 #include <crypto/sha.h> 13 + #include <linux/acpi.h> 13 14 #include <linux/delay.h> 14 15 #include <linux/device.h> 15 16 #include <linux/io.h> ··· 1048 1047 MODULE_DEVICE_TABLE(of, cros_ec_codec_of_match); 1049 1048 #endif 1050 1049 1050 + static const struct acpi_device_id cros_ec_codec_acpi_id[] = { 1051 + { "GOOG0013", 0 }, 1052 + { } 1053 + }; 1054 + MODULE_DEVICE_TABLE(acpi, cros_ec_codec_acpi_id); 1055 + 1051 1056 static struct platform_driver cros_ec_codec_platform_driver = { 1052 1057 .driver = { 1053 1058 .name = "cros-ec-codec", 1054 1059 .of_match_table = of_match_ptr(cros_ec_codec_of_match), 1060 + .acpi_match_table = ACPI_PTR(cros_ec_codec_acpi_id), 1055 1061 }, 1056 1062 .probe = cros_ec_codec_platform_probe, 1057 1063 };
+3 -1
sound/soc/codecs/hdac_hda.c
··· 588 588 struct hdac_hda_priv *hda_pvt; 589 589 590 590 hda_pvt = dev_get_drvdata(&hdev->dev); 591 - cancel_delayed_work_sync(&hda_pvt->codec.jackpoll_work); 591 + if (hda_pvt && hda_pvt->codec.registered) 592 + cancel_delayed_work_sync(&hda_pvt->codec.jackpoll_work); 593 + 592 594 return 0; 593 595 } 594 596
+15 -5
sound/soc/codecs/msm8916-wcd-analog.c
··· 396 396 397 397 switch (event) { 398 398 case SND_SOC_DAPM_PRE_PMU: 399 - snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS, 400 - MICB_1_INT_TX2_INT_RBIAS_EN_MASK, 401 - MICB_1_INT_TX2_INT_RBIAS_EN_ENABLE); 402 399 snd_soc_component_update_bits(component, reg, MICB_1_EN_PULL_DOWN_EN_MASK, 0); 403 400 snd_soc_component_update_bits(component, CDC_A_MICB_1_EN, 404 401 MICB_1_EN_OPA_STG2_TAIL_CURR_MASK, ··· 444 447 { 445 448 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); 446 449 struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component); 450 + 451 + switch (event) { 452 + case SND_SOC_DAPM_PRE_PMU: 453 + snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS, 454 + MICB_1_INT_TX1_INT_RBIAS_EN_MASK, 455 + MICB_1_INT_TX1_INT_RBIAS_EN_ENABLE); 456 + break; 457 + } 447 458 448 459 return pm8916_wcd_analog_enable_micbias_int(component, event, w->reg, 449 460 wcd->micbias1_cap_mode); ··· 563 558 struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component); 564 559 565 560 switch (event) { 561 + case SND_SOC_DAPM_PRE_PMU: 562 + snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS, 563 + MICB_1_INT_TX2_INT_RBIAS_EN_MASK, 564 + MICB_1_INT_TX2_INT_RBIAS_EN_ENABLE); 565 + break; 566 566 case SND_SOC_DAPM_POST_PMU: 567 567 pm8916_mbhc_configure_bias(wcd, true); 568 568 break; ··· 948 938 949 939 SND_SOC_DAPM_SUPPLY("MIC BIAS External1", CDC_A_MICB_1_EN, 7, 0, 950 940 pm8916_wcd_analog_enable_micbias_ext1, 951 - SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), 941 + SND_SOC_DAPM_POST_PMU), 952 942 SND_SOC_DAPM_SUPPLY("MIC BIAS External2", CDC_A_MICB_2_EN, 7, 0, 953 943 pm8916_wcd_analog_enable_micbias_ext2, 954 - SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), 944 + SND_SOC_DAPM_POST_PMU), 955 945 956 946 SND_SOC_DAPM_ADC_E("ADC1", NULL, CDC_A_TX_1_EN, 7, 0, 957 947 pm8916_wcd_analog_enable_adc,
+6
sound/soc/codecs/msm8916-wcd-digital.c
··· 586 586 snd_soc_component_write(component, rx_gain_reg[w->shift], 587 587 snd_soc_component_read32(component, rx_gain_reg[w->shift])); 588 588 break; 589 + case SND_SOC_DAPM_POST_PMD: 590 + snd_soc_component_update_bits(component, LPASS_CDC_CLK_RX_RESET_CTL, 591 + 1 << w->shift, 1 << w->shift); 592 + snd_soc_component_update_bits(component, LPASS_CDC_CLK_RX_RESET_CTL, 593 + 1 << w->shift, 0x0); 594 + break; 589 595 } 590 596 return 0; 591 597 }
+7
sound/soc/codecs/rt5640.c
··· 2432 2432 { 2433 2433 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); 2434 2434 2435 + /* 2436 + * soc_remove_component() force-disables jack and thus rt5640->jack 2437 + * could be NULL at the time of driver's module unloading. 2438 + */ 2439 + if (!rt5640->jack) 2440 + return; 2441 + 2435 2442 disable_irq(rt5640->irq); 2436 2443 rt5640_cancel_work(rt5640); 2437 2444
+2 -1
sound/soc/intel/boards/bytcht_es8316.c
··· 442 442 DMI_MATCH(DMI_SYS_VENDOR, "IRBIS"), 443 443 DMI_MATCH(DMI_PRODUCT_NAME, "NB41"), 444 444 }, 445 - .driver_data = (void *)(BYT_CHT_ES8316_INTMIC_IN2_MAP 445 + .driver_data = (void *)(BYT_CHT_ES8316_SSP0 446 + | BYT_CHT_ES8316_INTMIC_IN2_MAP 446 447 | BYT_CHT_ES8316_JD_INVERTED), 447 448 }, 448 449 { /* Teclast X98 Plus II */
+3
sound/soc/soc-component.c
··· 539 539 struct snd_soc_rtdcom_list *rtdcom; 540 540 struct snd_soc_component *component; 541 541 542 + if (!rtd->pcm) 543 + return; 544 + 542 545 for_each_rtd_components(rtd, rtdcom, component) 543 546 if (component->driver->pcm_destruct) 544 547 component->driver->pcm_destruct(component, rtd->pcm);
+12 -7
sound/soc/sof/intel/hda-codec.c
··· 24 24 #define IDISP_VID_INTEL 0x80860000 25 25 26 26 /* load the legacy HDA codec driver */ 27 - #ifdef MODULE 28 - static void hda_codec_load_module(struct hda_codec *codec) 27 + static int hda_codec_load_module(struct hda_codec *codec) 29 28 { 29 + #ifdef MODULE 30 30 char alias[MODULE_NAME_LEN]; 31 31 const char *module = alias; 32 32 33 33 snd_hdac_codec_modalias(&codec->core, alias, sizeof(alias)); 34 34 dev_dbg(&codec->core.dev, "loading codec module: %s\n", module); 35 35 request_module(module); 36 - } 37 - #else 38 - static void hda_codec_load_module(struct hda_codec *codec) {} 39 36 #endif 37 + return device_attach(hda_codec_dev(codec)); 38 + } 40 39 41 40 /* enable controller wake up event for all codecs with jack connectors */ 42 41 void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) ··· 128 129 if ((mach_params && mach_params->common_hdmi_codec_drv) || 129 130 (resp & 0xFFFF0000) != IDISP_VID_INTEL) { 130 131 hdev->type = HDA_DEV_LEGACY; 131 - hda_codec_load_module(&hda_priv->codec); 132 + ret = hda_codec_load_module(&hda_priv->codec); 133 + /* 134 + * handle ret==0 (no driver bound) as an error, but pass 135 + * other return codes without modification 136 + */ 137 + if (ret == 0) 138 + ret = -ENOENT; 132 139 } 133 140 134 - return 0; 141 + return ret; 135 142 #else 136 143 hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL); 137 144 if (!hdev)
+3 -3
sound/soc/sof/intel/hda-loader.c
··· 329 329 if (!ret) 330 330 break; 331 331 332 - dev_err(sdev->dev, "error: Error code=0x%x: FW status=0x%x\n", 332 + dev_dbg(sdev->dev, "iteration %d of Core En/ROM load failed: %d\n", 333 + i, ret); 334 + dev_dbg(sdev->dev, "Error code=0x%x: FW status=0x%x\n", 333 335 snd_sof_dsp_read(sdev, HDA_DSP_BAR, 334 336 HDA_DSP_SRAM_REG_ROM_ERROR), 335 337 snd_sof_dsp_read(sdev, HDA_DSP_BAR, 336 338 HDA_DSP_SRAM_REG_ROM_STATUS)); 337 - dev_err(sdev->dev, "error: iteration %d of Core En/ROM load failed: %d\n", 338 - i, ret); 339 339 } 340 340 341 341 if (i == HDA_FW_BOOT_ATTEMPTS) {
+4 -3
sound/soc/sti/uniperif_player.c
··· 226 226 * sampling frequency. If no sample rate is already specified, then 227 227 * set one. 228 228 */ 229 - mutex_lock(&player->ctrl_lock); 230 229 if (runtime) { 231 230 switch (runtime->rate) { 232 231 case 22050: ··· 302 303 player->stream_settings.iec958.status[3 + (n * 4)] << 24; 303 304 SET_UNIPERIF_CHANNEL_STA_REGN(player, n, status); 304 305 } 305 - mutex_unlock(&player->ctrl_lock); 306 306 307 307 /* Update the channel status */ 308 308 if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0) ··· 363 365 364 366 SET_UNIPERIF_CTRL_ZERO_STUFF_HW(player); 365 367 368 + mutex_lock(&player->ctrl_lock); 366 369 /* Update the channel status */ 367 370 uni_player_set_channel_status(player, runtime); 371 + mutex_unlock(&player->ctrl_lock); 368 372 369 373 /* Clear the user validity user bits */ 370 374 SET_UNIPERIF_USER_VALIDITY_VALIDITY_LR(player, 0); ··· 598 598 iec958->status[1] = ucontrol->value.iec958.status[1]; 599 599 iec958->status[2] = ucontrol->value.iec958.status[2]; 600 600 iec958->status[3] = ucontrol->value.iec958.status[3]; 601 - mutex_unlock(&player->ctrl_lock); 602 601 603 602 spin_lock_irqsave(&player->irq_lock, flags); 604 603 if (player->substream && player->substream->runtime) ··· 607 608 uni_player_set_channel_status(player, NULL); 608 609 609 610 spin_unlock_irqrestore(&player->irq_lock, flags); 611 + mutex_unlock(&player->ctrl_lock); 612 + 610 613 return 0; 611 614 } 612 615
+6 -6
sound/soc/stm/stm32_adfsdm.c
··· 153 153 .name = "stm32_dfsdm_audio", 154 154 }; 155 155 156 - static void memcpy_32to16(void *dest, const void *src, size_t n) 156 + static void stm32_memcpy_32to16(void *dest, const void *src, size_t n) 157 157 { 158 158 unsigned int i = 0; 159 159 u16 *d = (u16 *)dest, *s = (u16 *)src; 160 160 161 161 s++; 162 - for (i = n; i > 0; i--) { 162 + for (i = n >> 1; i > 0; i--) { 163 163 *d++ = *s++; 164 164 s++; 165 165 } ··· 186 186 187 187 if ((priv->pos + src_size) > buff_size) { 188 188 if (format == SNDRV_PCM_FORMAT_S16_LE) 189 - memcpy_32to16(&pcm_buff[priv->pos], src_buff, 190 - buff_size - priv->pos); 189 + stm32_memcpy_32to16(&pcm_buff[priv->pos], src_buff, 190 + buff_size - priv->pos); 191 191 else 192 192 memcpy(&pcm_buff[priv->pos], src_buff, 193 193 buff_size - priv->pos); ··· 196 196 } 197 197 198 198 if (format == SNDRV_PCM_FORMAT_S16_LE) 199 - memcpy_32to16(&pcm_buff[priv->pos], 200 - &src_buff[src_size - cur_size], cur_size); 199 + stm32_memcpy_32to16(&pcm_buff[priv->pos], 200 + &src_buff[src_size - cur_size], cur_size); 201 201 else 202 202 memcpy(&pcm_buff[priv->pos], &src_buff[src_size - cur_size], 203 203 cur_size);
+140 -54
sound/soc/stm/stm32_sai_sub.c
··· 184 184 } 185 185 } 186 186 187 + static int stm32_sai_sub_reg_up(struct stm32_sai_sub_data *sai, 188 + unsigned int reg, unsigned int mask, 189 + unsigned int val) 190 + { 191 + int ret; 192 + 193 + ret = clk_enable(sai->pdata->pclk); 194 + if (ret < 0) 195 + return ret; 196 + 197 + ret = regmap_update_bits(sai->regmap, reg, mask, val); 198 + 199 + clk_disable(sai->pdata->pclk); 200 + 201 + return ret; 202 + } 203 + 204 + static int stm32_sai_sub_reg_wr(struct stm32_sai_sub_data *sai, 205 + unsigned int reg, unsigned int mask, 206 + unsigned int val) 207 + { 208 + int ret; 209 + 210 + ret = clk_enable(sai->pdata->pclk); 211 + if (ret < 0) 212 + return ret; 213 + 214 + ret = regmap_write_bits(sai->regmap, reg, mask, val); 215 + 216 + clk_disable(sai->pdata->pclk); 217 + 218 + return ret; 219 + } 220 + 221 + static int stm32_sai_sub_reg_rd(struct stm32_sai_sub_data *sai, 222 + unsigned int reg, unsigned int *val) 223 + { 224 + int ret; 225 + 226 + ret = clk_enable(sai->pdata->pclk); 227 + if (ret < 0) 228 + return ret; 229 + 230 + ret = regmap_read(sai->regmap, reg, val); 231 + 232 + clk_disable(sai->pdata->pclk); 233 + 234 + return ret; 235 + } 236 + 187 237 static const struct regmap_config stm32_sai_sub_regmap_config_f4 = { 188 238 .reg_bits = 32, 189 239 .reg_stride = 4, ··· 345 295 346 296 mask = SAI_XCR1_MCKDIV_MASK(SAI_XCR1_MCKDIV_WIDTH(version)); 347 297 cr1 = SAI_XCR1_MCKDIV_SET(div); 348 - ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, mask, cr1); 298 + ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, mask, cr1); 349 299 if (ret < 0) 350 300 dev_err(&sai->pdev->dev, "Failed to update CR1 register\n"); 351 301 ··· 422 372 423 373 dev_dbg(&sai->pdev->dev, "Enable master clock\n"); 424 374 425 - return regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, 426 - SAI_XCR1_MCKEN, SAI_XCR1_MCKEN); 375 + return stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, 376 + SAI_XCR1_MCKEN, SAI_XCR1_MCKEN); 427 377 } 428 378 429 379 static void stm32_sai_mclk_disable(struct clk_hw *hw) ··· 433 383 434 384 dev_dbg(&sai->pdev->dev, "Disable master clock\n"); 435 385 436 - regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, SAI_XCR1_MCKEN, 0); 386 + stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, SAI_XCR1_MCKEN, 0); 437 387 } 438 388 439 389 static const struct clk_ops mclk_ops = { ··· 496 446 unsigned int sr, imr, flags; 497 447 snd_pcm_state_t status = SNDRV_PCM_STATE_RUNNING; 498 448 499 - regmap_read(sai->regmap, STM_SAI_IMR_REGX, &imr); 500 - regmap_read(sai->regmap, STM_SAI_SR_REGX, &sr); 449 + stm32_sai_sub_reg_rd(sai, STM_SAI_IMR_REGX, &imr); 450 + stm32_sai_sub_reg_rd(sai, STM_SAI_SR_REGX, &sr); 501 451 502 452 flags = sr & imr; 503 453 if (!flags) 504 454 return IRQ_NONE; 505 455 506 - regmap_write_bits(sai->regmap, STM_SAI_CLRFR_REGX, SAI_XCLRFR_MASK, 507 - SAI_XCLRFR_MASK); 456 + stm32_sai_sub_reg_wr(sai, STM_SAI_CLRFR_REGX, SAI_XCLRFR_MASK, 457 + SAI_XCLRFR_MASK); 508 458 509 459 if (!sai->substream) { 510 460 dev_err(&pdev->dev, "Device stopped. Spurious IRQ 0x%x\n", sr); ··· 553 503 int ret; 554 504 555 505 if (dir == SND_SOC_CLOCK_OUT && sai->sai_mclk) { 556 - ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, 557 - SAI_XCR1_NODIV, 506 + ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, 507 + SAI_XCR1_NODIV, 558 508 freq ? 0 : SAI_XCR1_NODIV); 559 509 if (ret < 0) 560 510 return ret; ··· 633 583 634 584 slotr_mask |= SAI_XSLOTR_SLOTEN_MASK; 635 585 636 - regmap_update_bits(sai->regmap, STM_SAI_SLOTR_REGX, slotr_mask, slotr); 586 + stm32_sai_sub_reg_up(sai, STM_SAI_SLOTR_REGX, slotr_mask, slotr); 637 587 638 588 sai->slot_width = slot_width; 639 589 sai->slots = slots; ··· 715 665 cr1_mask |= SAI_XCR1_CKSTR; 716 666 frcr_mask |= SAI_XFRCR_FSPOL; 717 667 718 - regmap_update_bits(sai->regmap, STM_SAI_FRCR_REGX, frcr_mask, frcr); 668 + stm32_sai_sub_reg_up(sai, STM_SAI_FRCR_REGX, frcr_mask, frcr); 719 669 720 670 /* DAI clock master masks */ 721 671 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { ··· 743 693 cr1_mask |= SAI_XCR1_SLAVE; 744 694 745 695 conf_update: 746 - ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, cr1_mask, cr1); 696 + ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, cr1_mask, cr1); 747 697 if (ret < 0) { 748 698 dev_err(cpu_dai->dev, "Failed to update CR1 register\n"); 749 699 return ret; ··· 780 730 } 781 731 782 732 /* Enable ITs */ 783 - regmap_write_bits(sai->regmap, STM_SAI_CLRFR_REGX, 784 - SAI_XCLRFR_MASK, SAI_XCLRFR_MASK); 733 + stm32_sai_sub_reg_wr(sai, STM_SAI_CLRFR_REGX, 734 + SAI_XCLRFR_MASK, SAI_XCLRFR_MASK); 785 735 786 736 imr = SAI_XIMR_OVRUDRIE; 787 737 if (STM_SAI_IS_CAPTURE(sai)) { 788 - regmap_read(sai->regmap, STM_SAI_CR2_REGX, &cr2); 738 + stm32_sai_sub_reg_rd(sai, STM_SAI_CR2_REGX, &cr2); 789 739 if (cr2 & SAI_XCR2_MUTECNT_MASK) 790 740 imr |= SAI_XIMR_MUTEDETIE; 791 741 } ··· 795 745 else 796 746 imr |= SAI_XIMR_AFSDETIE | SAI_XIMR_LFSDETIE; 797 747 798 - regmap_update_bits(sai->regmap, STM_SAI_IMR_REGX, 799 - SAI_XIMR_MASK, imr); 748 + stm32_sai_sub_reg_up(sai, STM_SAI_IMR_REGX, 749 + SAI_XIMR_MASK, imr); 800 750 801 751 return 0; 802 752 } ··· 813 763 * SAI fifo threshold is set to half fifo, to keep enough space 814 764 * for DMA incoming bursts. 815 765 */ 816 - regmap_write_bits(sai->regmap, STM_SAI_CR2_REGX, 817 - SAI_XCR2_FFLUSH | SAI_XCR2_FTH_MASK, 818 - SAI_XCR2_FFLUSH | 819 - SAI_XCR2_FTH_SET(STM_SAI_FIFO_TH_HALF)); 766 + stm32_sai_sub_reg_wr(sai, STM_SAI_CR2_REGX, 767 + SAI_XCR2_FFLUSH | SAI_XCR2_FTH_MASK, 768 + SAI_XCR2_FFLUSH | 769 + SAI_XCR2_FTH_SET(STM_SAI_FIFO_TH_HALF)); 820 770 821 771 /* DS bits in CR1 not set for SPDIF (size forced to 24 bits).*/ 822 772 if (STM_SAI_PROTOCOL_IS_SPDIF(sai)) { ··· 845 795 if ((sai->slots == 2) && (params_channels(params) == 1)) 846 796 cr1 |= SAI_XCR1_MONO; 847 797 848 - ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, cr1_mask, cr1); 798 + ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, cr1_mask, cr1); 849 799 if (ret < 0) { 850 800 dev_err(cpu_dai->dev, "Failed to update CR1 register\n"); 851 801 return ret; ··· 859 809 struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai); 860 810 int slotr, slot_sz; 861 811 862 - regmap_read(sai->regmap, STM_SAI_SLOTR_REGX, &slotr); 812 + stm32_sai_sub_reg_rd(sai, STM_SAI_SLOTR_REGX, &slotr); 863 813 864 814 /* 865 815 * If SLOTSZ is set to auto in SLOTR, align slot width on data size ··· 881 831 sai->slots = 2; 882 832 883 833 /* The number of slots in the audio frame is equal to NBSLOT[3:0] + 1*/ 884 - regmap_update_bits(sai->regmap, STM_SAI_SLOTR_REGX, 885 - SAI_XSLOTR_NBSLOT_MASK, 886 - SAI_XSLOTR_NBSLOT_SET((sai->slots - 1))); 834 + stm32_sai_sub_reg_up(sai, STM_SAI_SLOTR_REGX, 835 + SAI_XSLOTR_NBSLOT_MASK, 836 + SAI_XSLOTR_NBSLOT_SET((sai->slots - 1))); 887 837 888 838 /* Set default slots mask if not already set from DT */ 889 839 if (!(slotr & SAI_XSLOTR_SLOTEN_MASK)) { 890 840 sai->slot_mask = (1 << sai->slots) - 1; 891 - regmap_update_bits(sai->regmap, 892 - STM_SAI_SLOTR_REGX, SAI_XSLOTR_SLOTEN_MASK, 893 - SAI_XSLOTR_SLOTEN_SET(sai->slot_mask)); 841 + stm32_sai_sub_reg_up(sai, 842 + STM_SAI_SLOTR_REGX, SAI_XSLOTR_SLOTEN_MASK, 843 + SAI_XSLOTR_SLOTEN_SET(sai->slot_mask)); 894 844 } 895 845 896 846 dev_dbg(cpu_dai->dev, "Slots %d, slot width %d\n", ··· 920 870 dev_dbg(cpu_dai->dev, "Frame length %d, frame active %d\n", 921 871 sai->fs_length, fs_active); 922 872 923 - regmap_update_bits(sai->regmap, STM_SAI_FRCR_REGX, frcr_mask, frcr); 873 + stm32_sai_sub_reg_up(sai, STM_SAI_FRCR_REGX, frcr_mask, frcr); 924 874 925 875 if ((sai->fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_LSB) { 926 876 offset = sai->slot_width - sai->data_size; 927 877 928 - regmap_update_bits(sai->regmap, STM_SAI_SLOTR_REGX, 929 - SAI_XSLOTR_FBOFF_MASK, 930 - SAI_XSLOTR_FBOFF_SET(offset)); 878 + stm32_sai_sub_reg_up(sai, STM_SAI_SLOTR_REGX, 879 + SAI_XSLOTR_FBOFF_MASK, 880 + SAI_XSLOTR_FBOFF_SET(offset)); 931 881 } 932 882 } 933 883 ··· 1044 994 return -EINVAL; 1045 995 } 1046 996 1047 - regmap_update_bits(sai->regmap, 1048 - STM_SAI_CR1_REGX, 1049 - SAI_XCR1_OSR, cr1); 997 + stm32_sai_sub_reg_up(sai, 998 + STM_SAI_CR1_REGX, 999 + SAI_XCR1_OSR, cr1); 1050 1000 1051 1001 div = stm32_sai_get_clk_div(sai, sai_clk_rate, 1052 1002 sai->mclk_rate); ··· 1108 1058 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 1109 1059 dev_dbg(cpu_dai->dev, "Enable DMA and SAI\n"); 1110 1060 1111 - regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, 1112 - SAI_XCR1_DMAEN, SAI_XCR1_DMAEN); 1061 + stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, 1062 + SAI_XCR1_DMAEN, SAI_XCR1_DMAEN); 1113 1063 1114 1064 /* Enable SAI */ 1115 - ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, 1116 - SAI_XCR1_SAIEN, SAI_XCR1_SAIEN); 1065 + ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, 1066 + SAI_XCR1_SAIEN, SAI_XCR1_SAIEN); 1117 1067 if (ret < 0) 1118 1068 dev_err(cpu_dai->dev, "Failed to update CR1 register\n"); 1119 1069 break; ··· 1122 1072 case SNDRV_PCM_TRIGGER_STOP: 1123 1073 dev_dbg(cpu_dai->dev, "Disable DMA and SAI\n"); 1124 1074 1125 - regmap_update_bits(sai->regmap, STM_SAI_IMR_REGX, 1126 - SAI_XIMR_MASK, 0); 1075 + stm32_sai_sub_reg_up(sai, STM_SAI_IMR_REGX, 1076 + SAI_XIMR_MASK, 0); 1127 1077 1128 - regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, 1129 - SAI_XCR1_SAIEN, 1130 - (unsigned int)~SAI_XCR1_SAIEN); 1078 + stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, 1079 + SAI_XCR1_SAIEN, 1080 + (unsigned int)~SAI_XCR1_SAIEN); 1131 1081 1132 - ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, 1133 - SAI_XCR1_DMAEN, 1134 - (unsigned int)~SAI_XCR1_DMAEN); 1082 + ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, 1083 + SAI_XCR1_DMAEN, 1084 + (unsigned int)~SAI_XCR1_DMAEN); 1135 1085 if (ret < 0) 1136 1086 dev_err(cpu_dai->dev, "Failed to update CR1 register\n"); 1137 1087 ··· 1151 1101 struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai); 1152 1102 unsigned long flags; 1153 1103 1154 - regmap_update_bits(sai->regmap, STM_SAI_IMR_REGX, SAI_XIMR_MASK, 0); 1104 + stm32_sai_sub_reg_up(sai, STM_SAI_IMR_REGX, SAI_XIMR_MASK, 0); 1155 1105 1156 1106 clk_disable_unprepare(sai->sai_ck); 1157 1107 ··· 1219 1169 cr1_mask |= SAI_XCR1_SYNCEN_MASK; 1220 1170 cr1 |= SAI_XCR1_SYNCEN_SET(sai->sync); 1221 1171 1222 - return regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, cr1_mask, cr1); 1172 + return stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, cr1_mask, cr1); 1223 1173 } 1224 1174 1225 1175 static const struct snd_soc_dai_ops stm32_sai_pcm_dai_ops = { ··· 1372 1322 if (STM_SAI_HAS_PDM(sai) && STM_SAI_IS_SUB_A(sai)) 1373 1323 sai->regmap_config = &stm32_sai_sub_regmap_config_h7; 1374 1324 1375 - sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "sai_ck", 1376 - base, sai->regmap_config); 1325 + /* 1326 + * Do not manage peripheral clock through regmap framework as this 1327 + * can lead to circular locking issue with sai master clock provider. 1328 + * Manage peripheral clock directly in driver instead. 1329 + */ 1330 + sai->regmap = devm_regmap_init_mmio(&pdev->dev, base, 1331 + sai->regmap_config); 1377 1332 if (IS_ERR(sai->regmap)) { 1378 1333 dev_err(&pdev->dev, "Failed to initialize MMIO\n"); 1379 1334 return PTR_ERR(sai->regmap); ··· 1475 1420 return PTR_ERR(sai->sai_ck); 1476 1421 } 1477 1422 1423 + ret = clk_prepare(sai->pdata->pclk); 1424 + if (ret < 0) 1425 + return ret; 1426 + 1478 1427 if (STM_SAI_IS_F4(sai->pdata)) 1479 1428 return 0; 1480 1429 ··· 1560 1501 return 0; 1561 1502 } 1562 1503 1504 + static int stm32_sai_sub_remove(struct platform_device *pdev) 1505 + { 1506 + struct stm32_sai_sub_data *sai = dev_get_drvdata(&pdev->dev); 1507 + 1508 + clk_unprepare(sai->pdata->pclk); 1509 + 1510 + return 0; 1511 + } 1512 + 1563 1513 #ifdef CONFIG_PM_SLEEP 1564 1514 static int stm32_sai_sub_suspend(struct device *dev) 1565 1515 { 1566 1516 struct stm32_sai_sub_data *sai = dev_get_drvdata(dev); 1517 + int ret; 1518 + 1519 + ret = clk_enable(sai->pdata->pclk); 1520 + if (ret < 0) 1521 + return ret; 1567 1522 1568 1523 regcache_cache_only(sai->regmap, true); 1569 1524 regcache_mark_dirty(sai->regmap); 1525 + 1526 + clk_disable(sai->pdata->pclk); 1527 + 1570 1528 return 0; 1571 1529 } 1572 1530 1573 1531 static int stm32_sai_sub_resume(struct device *dev) 1574 1532 { 1575 1533 struct stm32_sai_sub_data *sai = dev_get_drvdata(dev); 1534 + int ret; 1535 + 1536 + ret = clk_enable(sai->pdata->pclk); 1537 + if (ret < 0) 1538 + return ret; 1576 1539 1577 1540 regcache_cache_only(sai->regmap, false); 1578 - return regcache_sync(sai->regmap); 1541 + ret = regcache_sync(sai->regmap); 1542 + 1543 + clk_disable(sai->pdata->pclk); 1544 + 1545 + return ret; 1579 1546 } 1580 1547 #endif /* CONFIG_PM_SLEEP */ 1581 1548 ··· 1616 1531 .pm = &stm32_sai_sub_pm_ops, 1617 1532 }, 1618 1533 .probe = stm32_sai_sub_probe, 1534 + .remove = stm32_sai_sub_remove, 1619 1535 }; 1620 1536 1621 1537 module_platform_driver(stm32_sai_sub_driver);
+1 -1
sound/usb/pcm.c
··· 370 370 add_sync_ep_from_ifnum: 371 371 iface = usb_ifnum_to_if(dev, ifnum); 372 372 373 - if (!iface || iface->num_altsetting == 0) 373 + if (!iface || iface->num_altsetting < 2) 374 374 return -EINVAL; 375 375 376 376 alts = &iface->altsetting[1];
+1 -1
tools/bpf/bpftool/btf_dumper.c
··· 26 26 bool is_plain_text) 27 27 { 28 28 if (is_plain_text) 29 - jsonw_printf(jw, "%p", data); 29 + jsonw_printf(jw, "%p", *(void **)data); 30 30 else 31 31 jsonw_printf(jw, "%lu", *(unsigned long *)data); 32 32 }
+3 -1
tools/lib/traceevent/parse-filter.c
··· 1228 1228 } 1229 1229 1230 1230 filter_type = add_filter_type(filter, event->id); 1231 - if (filter_type == NULL) 1231 + if (filter_type == NULL) { 1232 + free_arg(arg); 1232 1233 return TEP_ERRNO__MEM_ALLOC_FAILED; 1234 + } 1233 1235 1234 1236 if (filter_type->filter) 1235 1237 free_arg(filter_type->filter);
+4 -1
tools/perf/builtin-report.c
··· 1076 1076 struct stat st; 1077 1077 bool has_br_stack = false; 1078 1078 int branch_mode = -1; 1079 + int last_key = 0; 1079 1080 bool branch_call_mode = false; 1080 1081 #define CALLCHAIN_DEFAULT_OPT "graph,0.5,caller,function,percent" 1081 1082 static const char report_callchain_help[] = "Display call graph (stack chain/backtrace):\n\n" ··· 1451 1450 sort_order = sort_tmp; 1452 1451 } 1453 1452 1454 - if (setup_sorting(session->evlist) < 0) { 1453 + if ((last_key != K_SWITCH_INPUT_DATA) && 1454 + (setup_sorting(session->evlist) < 0)) { 1455 1455 if (sort_order) 1456 1456 parse_options_usage(report_usage, options, "s", 1); 1457 1457 if (field_order) ··· 1532 1530 ret = __cmd_report(&report); 1533 1531 if (ret == K_SWITCH_INPUT_DATA) { 1534 1532 perf_session__delete(session); 1533 + last_key = K_SWITCH_INPUT_DATA; 1535 1534 goto repeat; 1536 1535 } else 1537 1536 ret = 0;
+2 -2
tools/perf/util/hist.h
··· 339 339 list_for_each_entry_safe(format, tmp, &(_list)->sorts, sort_list) 340 340 341 341 #define hists__for_each_format(hists, format) \ 342 - perf_hpp_list__for_each_format((hists)->hpp_list, fmt) 342 + perf_hpp_list__for_each_format((hists)->hpp_list, format) 343 343 344 344 #define hists__for_each_sort_list(hists, format) \ 345 - perf_hpp_list__for_each_sort_list((hists)->hpp_list, fmt) 345 + perf_hpp_list__for_each_sort_list((hists)->hpp_list, format) 346 346 347 347 extern struct perf_hpp_fmt perf_hpp__format[]; 348 348
+3
tools/perf/util/symbol-elf.c
··· 920 920 if (curr_map == NULL) 921 921 return -1; 922 922 923 + if (curr_dso->kernel) 924 + map__kmap(curr_map)->kmaps = kmaps; 925 + 923 926 if (adjust_kernel_syms) { 924 927 curr_map->start = shdr->sh_addr + ref_reloc(kmap); 925 928 curr_map->end = curr_map->start + shdr->sh_size;
+6 -2
tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh
··· 232 232 stop_traffic 233 233 local ucth1=${uc_rate[1]} 234 234 235 - start_traffic $h1 own bc bc 235 + start_traffic $h1 192.0.2.65 bc bc 236 236 237 237 local d0=$(date +%s) 238 238 local t0=$(ethtool_stats_get $h3 rx_octets_prio_0) ··· 254 254 ret = 100 * ($ucth1 - $ucth2) / $ucth1 255 255 if (ret > 0) { ret } else { 0 } 256 256 ") 257 - check_err $(bc <<< "$deg > 25") 257 + 258 + # Minimum shaper of 200Mbps on MC TCs should cause about 20% of 259 + # degradation on 1Gbps link. 260 + check_err $(bc <<< "$deg < 15") "Minimum shaper not in effect" 261 + check_err $(bc <<< "$deg > 25") "MC traffic degrades UC performance too much" 258 262 259 263 local interval=$((d1 - d0)) 260 264 local mc_ir=$(rate $u0 $u1 $interval)