We need the USB fixes in here as well.
Unified · Split
| @@ -99,6 +99,7 @@ Jacob Shin <Jacob.Shin@amd.com> · 98 unmodified lines | ||
| 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> |
| @@ -29,13 +29,13 @@ Description: This file shows the system fans direction: · 28 unmodified lines | ||
| 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 | |
| @@ -121,6 +121,15 @@ Description: These files show the system reset cause, as following: ComEx · 79 unmodified lines | ||
| 121 | 121 | |
| 122 | 122 | The files are read only. |
| 123 | 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. | |
| 130 | + | |
| 131 | + The files are read only. | |
| 132 | + | |
| 124 | 133 | Date: June 2019 |
| 125 | 134 | KernelVersion: 5.3 |
| 126 | 135 | Contact: Vadim Pasternak <vadimpmellanox.com> |
| @@ -319,7 +319,7 @@ · 318 unmodified lines | ||
| 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 |
| @@ -95,7 +95,7 @@ so all video4linux tools (like xawtv) should work with this driver. · 94 unmodified lines | ||
| 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): |
| @@ -255,7 +255,7 @@ an involved disclosed party. The current ambassadors list: · 254 unmodified lines | ||
| 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 | |
| @@ -720,7 +720,7 @@ F: Documentation/devicetree/bindings/i2c/i2c-altera.txt · 719 unmodified lines | ||
| 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,7 +1407,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git · 680 unmodified lines | ||
| 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,7 +3150,7 @@ S: Maintained · 1736 unmodified lines | ||
| 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,7 +11431,7 @@ F: include/uapi/linux/netrom.h · 8274 unmodified lines | ||
| 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,7 +11591,7 @@ M: Boris Pismenny <borisp@mellanox.com> · 153 unmodified lines | ||
| 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,7 +11603,7 @@ L: linux-wireless@vger.kernel.org · 5 unmodified lines | ||
| 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,7 +11680,7 @@ F: Documentation/scsi/NinjaSCSI.txt · 70 unmodified lines | ||
| 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,7 +12564,7 @@ F: Documentation/devicetree/bindings/pci/aardvark-pci.txt · 877 unmodified lines | ||
| 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,7 +12743,7 @@ S: Supported · 172 unmodified lines | ||
| 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,7 +18043,7 @@ XDP (eXpress Data Path) · 5293 unmodified lines | ||
| 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 |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 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* |
| @@ -167,11 +167,7 @@ · 166 unmodified lines | ||
| 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 { |
| @@ -147,10 +147,6 @@ · 146 unmodified lines | ||
| 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 { |
| @@ -29,6 +29,27 @@ · 28 unmodified lines | ||
| 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"; |
| @@ -547,10 +568,6 @@ · 512 unmodified lines | ||
| 547 | 568 | gpios = <&gpio2 8 GPIO_ACTIVE_LOW>; |
| 548 | 569 | }; |
| 549 | 570 | |
| 550 | −&pcie1_ep { | |
| 551 | − gpios = <&gpio2 8 GPIO_ACTIVE_LOW>; | |
| 552 | −}; | |
| 553 | − | |
| 554 | 571 | &mcasp3 { |
| 555 | 572 | #sound-dai-cells = <0>; |
| 556 | 573 | assigned-clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP3_CLKCTRL 24>; |
| @@ -258,9 +258,9 @@ · 257 unmodified lines | ||
| 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 | |
| @@ -519,371 +519,6 @@ · 252 unmodified lines | ||
| 519 | 519 | status = "okay"; |
| 520 | 520 | }; |
| 521 | 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 | − }; | |
| 881 | −}; | |
| 882 | − | |
| 883 | −&i2c12 { | |
| 884 | − status = "okay"; | |
| 885 | −}; | |
| 886 | − | |
| 887 | 522 | &i2c13 { |
| 888 | 523 | status = "okay"; |
| 889 | 524 | |
| @@ -122,37 +122,6 @@ · 121 unmodified lines | ||
| 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"; |
| @@ -165,6 +134,11 @@ · 6 unmodified lines | ||
| 165 | 134 | |
| 166 | 135 | &emmc { |
| 167 | 136 | status = "okay"; |
| 137 | +}; | |
| 138 | + | |
| 139 | +&fsim0 { | |
| 140 | + status = "okay"; | |
| 141 | + | |
| 168 | 142 | #address-cells = <2>; |
| 169 | 143 | #size-cells = <0>; |
| 170 | 144 | |
| @@ -820,373 +794,6 @@ · 649 unmodified lines | ||
| 820 | 794 | status = "okay"; |
| 821 | 795 | }; |
| 822 | 796 | |
| 823 | −&i2c0 { | |
| 824 | − status = "okay"; | |
| 825 | −}; | |
| 826 | − | |
| 827 | −&i2c1 { | |
| 828 | − status = "okay"; | |
| 829 | −}; | |
| 830 | − | |
| 831 | −&i2c2 { | |
| 832 | − status = "okay"; | |
| 833 | −}; | |
| 834 | − | |
| 835 | −&i2c3 { | |
| 836 | − status = "okay"; | |
| 837 | − | |
| 838 | − bmp: bmp280@77 { | |
| 839 | − compatible = "bosch,bmp280"; | |
| 840 | − reg = <0x77>; | |
| 841 | − #io-channel-cells = <1>; | |
| 842 | − }; | |
| 843 | − | |
| 844 | − max31785@52 { | |
| 845 | − compatible = "maxim,max31785a"; | |
| 846 | − reg = <0x52>; | |
| 847 | − #address-cells = <1>; | |
| 848 | − #size-cells = <0>; | |
| 849 | − | |
| 850 | − fan@0 { | |
| 851 | − compatible = "pmbus-fan"; | |
| 852 | − reg = <0>; | |
| 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@1 { | |
| 864 | − compatible = "pmbus-fan"; | |
| 865 | − reg = <1>; | |
| 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 | − fan@2 { | |
| 877 | − compatible = "pmbus-fan"; | |
| 878 | − reg = <2>; | |
| 879 | − tach-pulses = <2>; | |
| 880 | − maxim,fan-rotor-input = "tach"; | |
| 881 | − maxim,fan-pwm-freq = <25000>; | |
| 882 | − maxim,fan-dual-tach; | |
| 883 | − maxim,fan-no-watchdog; | |
| 884 | − maxim,fan-no-fault-ramp; | |
| 885 | − maxim,fan-ramp = <2>; | |
| 886 | − maxim,fan-fault-pin-mon; | |
| 887 | − }; | |
| 888 | − | |
| 889 | − fan@3 { | |
| 890 | − compatible = "pmbus-fan"; | |
| 891 | − reg = <3>; | |
| 892 | − tach-pulses = <2>; | |
| 893 | − maxim,fan-rotor-input = "tach"; | |
| 894 | − maxim,fan-pwm-freq = <25000>; | |
| 895 | − maxim,fan-dual-tach; | |
| 896 | − maxim,fan-no-watchdog; | |
| 897 | − maxim,fan-no-fault-ramp; | |
| 898 | − maxim,fan-ramp = <2>; | |
| 899 | − maxim,fan-fault-pin-mon; | |
| 900 | − }; | |
| 901 | − }; | |
| 902 | − | |
| 903 | − dps: dps310@76 { | |
| 904 | − compatible = "infineon,dps310"; | |
| 905 | − reg = <0x76>; | |
| 906 | − #io-channel-cells = <0>; | |
| 907 | − }; | |
| 908 | − | |
| 909 | − pca0: pca9552@60 { | |
| 910 | − compatible = "nxp,pca9552"; | |
| 911 | − reg = <0x60>; | |
| 912 | − #address-cells = <1>; | |
| 913 | − #size-cells = <0>; | |
| 914 | − | |
| 915 | − gpio-controller; | |
| 916 | − #gpio-cells = <2>; | |
| 917 | − | |
| 918 | − gpio@0 { | |
| 919 | − reg = <0>; | |
| 920 | − type = <PCA955X_TYPE_GPIO>; | |
| 921 | − }; | |
| 922 | − | |
| 923 | − gpio@1 { | |
| 924 | − reg = <1>; | |
| 925 | − type = <PCA955X_TYPE_GPIO>; | |
| 926 | − }; | |
| 927 | − | |
| 928 | − gpio@2 { | |
| 929 | − reg = <2>; | |
| 930 | − type = <PCA955X_TYPE_GPIO>; | |
| 931 | − }; | |
| 932 | − | |
| 933 | − gpio@3 { | |
| 934 | − reg = <3>; | |
| 935 | − type = <PCA955X_TYPE_GPIO>; | |
| 936 | − }; | |
| 937 | − | |
| 938 | − gpio@4 { | |
| 939 | − reg = <4>; | |
| 940 | − type = <PCA955X_TYPE_GPIO>; | |
| 941 | − }; | |
| 942 | − | |
| 943 | − gpio@5 { | |
| 944 | − reg = <5>; | |
| 945 | − type = <PCA955X_TYPE_GPIO>; | |
| 946 | − }; | |
| 947 | − | |
| 948 | − gpio@6 { | |
| 949 | − reg = <6>; | |
| 950 | − type = <PCA955X_TYPE_GPIO>; | |
| 951 | − }; | |
| 952 | − | |
| 953 | − gpio@7 { | |
| 954 | − reg = <7>; | |
| 955 | − type = <PCA955X_TYPE_GPIO>; | |
| 956 | − }; | |
| 957 | − | |
| 958 | − gpio@8 { | |
| 959 | − reg = <8>; | |
| 960 | − type = <PCA955X_TYPE_GPIO>; | |
| 961 | − }; | |
| 962 | − | |
| 963 | − gpio@9 { | |
| 964 | − reg = <9>; | |
| 965 | − type = <PCA955X_TYPE_GPIO>; | |
| 966 | − }; | |
| 967 | − | |
| 968 | − gpio@10 { | |
| 969 | − reg = <10>; | |
| 970 | − type = <PCA955X_TYPE_GPIO>; | |
| 971 | − }; | |
| 972 | − | |
| 973 | − gpio@11 { | |
| 974 | − reg = <11>; | |
| 975 | − type = <PCA955X_TYPE_GPIO>; | |
| 976 | − }; | |
| 977 | − | |
| 978 | − gpio@12 { | |
| 979 | − reg = <12>; | |
| 980 | − type = <PCA955X_TYPE_GPIO>; | |
| 981 | − }; | |
| 982 | − | |
| 983 | − gpio@13 { | |
| 984 | − reg = <13>; | |
| 985 | − type = <PCA955X_TYPE_GPIO>; | |
| 986 | − }; | |
| 987 | − | |
| 988 | − gpio@14 { | |
| 989 | − reg = <14>; | |
| 990 | − type = <PCA955X_TYPE_GPIO>; | |
| 991 | − }; | |
| 992 | − | |
| 993 | − gpio@15 { | |
| 994 | − reg = <15>; | |
| 995 | − type = <PCA955X_TYPE_GPIO>; | |
| 996 | − }; | |
| 997 | − }; | |
| 998 | − | |
| 999 | − power-supply@68 { | |
| 1000 | − compatible = "ibm,cffps1"; | |
| 1001 | − reg = <0x68>; | |
| 1002 | − }; | |
| 1003 | − | |
| 1004 | − power-supply@69 { | |
| 1005 | − compatible = "ibm,cffps1"; | |
| 1006 | − reg = <0x69>; | |
| 1007 | − }; | |
| 1008 | −}; | |
| 1009 | − | |
| 1010 | −&i2c4 { | |
| 1011 | − status = "okay"; | |
| 1012 | − | |
| 1013 | − tmp423a@4c { | |
| 1014 | − compatible = "ti,tmp423"; | |
| 1015 | − reg = <0x4c>; | |
| 1016 | − }; | |
| 1017 | − | |
| 1018 | − ir35221@70 { | |
| 1019 | − compatible = "infineon,ir35221"; | |
| 1020 | − reg = <0x70>; | |
| 1021 | − }; | |
| 1022 | − | |
| 1023 | − ir35221@71 { | |
| 1024 | − compatible = "infineon,ir35221"; | |
| 1025 | − reg = <0x71>; | |
| 1026 | − }; | |
| 1027 | −}; | |
| 1028 | − | |
| 1029 | −&i2c5 { | |
| 1030 | − status = "okay"; | |
| 1031 | − | |
| 1032 | − tmp423a@4c { | |
| 1033 | − compatible = "ti,tmp423"; | |
| 1034 | − reg = <0x4c>; | |
| 1035 | − }; | |
| 1036 | − | |
| 1037 | − ir35221@70 { | |
| 1038 | − compatible = "infineon,ir35221"; | |
| 1039 | − reg = <0x70>; | |
| 1040 | − }; | |
| 1041 | − | |
| 1042 | − ir35221@71 { | |
| 1043 | − compatible = "infineon,ir35221"; | |
| 1044 | − reg = <0x71>; | |
| 1045 | − }; | |
| 1046 | −}; | |
| 1047 | − | |
| 1048 | −&i2c7 { | |
| 1049 | − status = "okay"; | |
| 1050 | −}; | |
| 1051 | − | |
| 1052 | −&i2c9 { | |
| 1053 | − status = "okay"; | |
| 1054 | − | |
| 1055 | − tmp275@4a { | |
| 1056 | − compatible = "ti,tmp275"; | |
| 1057 | − reg = <0x4a>; | |
| 1058 | − }; | |
| 1059 | −}; | |
| 1060 | − | |
| 1061 | −&i2c10 { | |
| 1062 | − status = "okay"; | |
| 1063 | −}; | |
| 1064 | − | |
| 1065 | −&i2c11 { | |
| 1066 | − status = "okay"; | |
| 1067 | − | |
| 1068 | − pca9552: pca9552@60 { | |
| 1069 | − compatible = "nxp,pca9552"; | |
| 1070 | − reg = <0x60>; | |
| 1071 | − #address-cells = <1>; | |
| 1072 | − #size-cells = <0>; | |
| 1073 | − gpio-controller; | |
| 1074 | − #gpio-cells = <2>; | |
| 1075 | − | |
| 1076 | − gpio-line-names = "PS_SMBUS_RESET_N", "APSS_RESET_N", | |
| 1077 | − "GPU0_TH_OVERT_N_BUFF", "GPU1_TH_OVERT_N_BUFF", | |
| 1078 | − "GPU2_TH_OVERT_N_BUFF", "GPU3_TH_OVERT_N_BUFF", | |
| 1079 | − "GPU4_TH_OVERT_N_BUFF", "GPU5_TH_OVERT_N_BUFF", | |
| 1080 | − "GPU0_PWR_GOOD_BUFF", "GPU1_PWR_GOOD_BUFF", | |
| 1081 | − "GPU2_PWR_GOOD_BUFF", "GPU3_PWR_GOOD_BUFF", | |
| 1082 | − "GPU4_PWR_GOOD_BUFF", "GPU5_PWR_GOOD_BUFF", | |
| 1083 | − "12V_BREAKER_FLT_N", "THROTTLE_UNLATCHED_N"; | |
| 1084 | − | |
| 1085 | − gpio@0 { | |
| 1086 | − reg = <0>; | |
| 1087 | − type = <PCA955X_TYPE_GPIO>; | |
| 1088 | − }; | |
| 1089 | − | |
| 1090 | − gpio@1 { | |
| 1091 | − reg = <1>; | |
| 1092 | − type = <PCA955X_TYPE_GPIO>; | |
| 1093 | − }; | |
| 1094 | − | |
| 1095 | − gpio@2 { | |
| 1096 | − reg = <2>; | |
| 1097 | − type = <PCA955X_TYPE_GPIO>; | |
| 1098 | − }; | |
| 1099 | − | |
| 1100 | − gpio@3 { | |
| 1101 | − reg = <3>; | |
| 1102 | − type = <PCA955X_TYPE_GPIO>; | |
| 1103 | − }; | |
| 1104 | − | |
| 1105 | − gpio@4 { | |
| 1106 | − reg = <4>; | |
| 1107 | − type = <PCA955X_TYPE_GPIO>; | |
| 1108 | − }; | |
| 1109 | − | |
| 1110 | − gpio@5 { | |
| 1111 | − reg = <5>; | |
| 1112 | − type = <PCA955X_TYPE_GPIO>; | |
| 1113 | − }; | |
| 1114 | − | |
| 1115 | − gpio@6 { | |
| 1116 | − reg = <6>; | |
| 1117 | − type = <PCA955X_TYPE_GPIO>; | |
| 1118 | − }; | |
| 1119 | − | |
| 1120 | − gpio@7 { | |
| 1121 | − reg = <7>; | |
| 1122 | − type = <PCA955X_TYPE_GPIO>; | |
| 1123 | − }; | |
| 1124 | − | |
| 1125 | − gpio@8 { | |
| 1126 | − reg = <8>; | |
| 1127 | − type = <PCA955X_TYPE_GPIO>; | |
| 1128 | − }; | |
| 1129 | − | |
| 1130 | − gpio@9 { | |
| 1131 | − reg = <9>; | |
| 1132 | − type = <PCA955X_TYPE_GPIO>; | |
| 1133 | − }; | |
| 1134 | − | |
| 1135 | − gpio@10 { | |
| 1136 | − reg = <10>; | |
| 1137 | − type = <PCA955X_TYPE_GPIO>; | |
| 1138 | − }; | |
| 1139 | − | |
| 1140 | − gpio@11 { | |
| 1141 | − reg = <11>; | |
| 1142 | − type = <PCA955X_TYPE_GPIO>; | |
| 1143 | − }; | |
| 1144 | − | |
| 1145 | − gpio@12 { | |
| 1146 | − reg = <12>; | |
| 1147 | − type = <PCA955X_TYPE_GPIO>; | |
| 1148 | − }; | |
| 1149 | − | |
| 1150 | − gpio@13 { | |
| 1151 | − reg = <13>; | |
| 1152 | − type = <PCA955X_TYPE_GPIO>; | |
| 1153 | − }; | |
| 1154 | − | |
| 1155 | − gpio@14 { | |
| 1156 | − reg = <14>; | |
| 1157 | − type = <PCA955X_TYPE_GPIO>; | |
| 1158 | − }; | |
| 1159 | − | |
| 1160 | − gpio@15 { | |
| 1161 | − reg = <15>; | |
| 1162 | − type = <PCA955X_TYPE_GPIO>; | |
| 1163 | − }; | |
| 1164 | − }; | |
| 1165 | − | |
| 1166 | − rtc@32 { | |
| 1167 | − compatible = "epson,rx8900"; | |
| 1168 | − reg = <0x32>; | |
| 1169 | − }; | |
| 1170 | − | |
| 1171 | − eeprom@51 { | |
| 1172 | − compatible = "atmel,24c64"; | |
| 1173 | − reg = <0x51>; | |
| 1174 | − }; | |
| 1175 | − | |
| 1176 | − ucd90160@64 { | |
| 1177 | − compatible = "ti,ucd90160"; | |
| 1178 | − reg = <0x64>; | |
| 1179 | − }; | |
| 1180 | −}; | |
| 1181 | − | |
| 1182 | −&i2c12 { | |
| 1183 | − status = "okay"; | |
| 1184 | −}; | |
| 1185 | − | |
| 1186 | −&i2c13 { | |
| 1187 | − status = "okay"; | |
| 1188 | −}; | |
| 1189 | − | |
| 1190 | 797 | &pinctrl { |
| 1191 | 798 | /* Hog these as no driver is probed for the entire LPC block */ |
| 1192 | 799 | pinctrl-names = "default"; |
| @@ -163,26 +163,6 @@ · 162 unmodified lines | ||
| 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 { |
| @@ -595,6 +575,25 @@ · 406 unmodified lines | ||
| 595 | 575 | ranges = <0 0x1e78a000 0x1000>; |
| 596 | 576 | }; |
| 597 | 577 | |
| 578 | + fsim0: fsi@1e79b000 { | |
| 579 | + compatible = "aspeed,ast2600-fsi-master", "fsi-master"; | |
| 580 | + reg = <0x1e79b000 0x94>; | |
| 581 | + interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>; | |
| 582 | + pinctrl-names = "default"; | |
| 583 | + pinctrl-0 = <&pinctrl_fsi1_default>; | |
| 584 | + clocks = <&syscon ASPEED_CLK_GATE_FSICLK>; | |
| 585 | + status = "disabled"; | |
| 586 | + }; | |
| 587 | + | |
| 588 | + fsim1: fsi@1e79b100 { | |
| 589 | + compatible = "aspeed,ast2600-fsi-master", "fsi-master"; | |
| 590 | + reg = <0x1e79b100 0x94>; | |
| 591 | + interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>; | |
| 592 | + pinctrl-names = "default"; | |
| 593 | + pinctrl-0 = <&pinctrl_fsi2_default>; | |
| 594 | + clocks = <&syscon ASPEED_CLK_GATE_FSICLK>; | |
| 595 | + status = "disabled"; | |
| 596 | + }; | |
| 598 | 597 | }; |
| 599 | 598 | }; |
| 600 | 599 | }; |
| @@ -8,7 +8,7 @@ · 7 unmodified lines | ||
| 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"; |
| @@ -63,7 +63,7 @@ · 62 unmodified lines | ||
| 63 | 63 | #sound-dai-cells = <0>; |
| 64 | 64 | clocks = <&clk_ext_audio_codec>; |
| 65 | 65 | VDDA-supply = <®_3p3v>; |
| 66 | − VDDIO-supply = <®_3p3v>; | |
| 66 | + VDDIO-supply = <&sw2_reg>; | |
| 67 | 67 | }; |
| 68 | 68 | }; |
| 69 | 69 | |
| @@ -204,7 +204,7 @@ · 203 unmodified lines | ||
| 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>; |
| @@ -749,10 +749,6 @@ · 748 unmodified lines | ||
| 749 | 749 | vin-supply = <&vgen5_reg>; |
| 750 | 750 | }; |
| 751 | 751 | |
| 752 | −®_vdd3p0 { | |
| 753 | − vin-supply = <&sw2_reg>; | |
| 754 | −}; | |
| 755 | − | |
| 756 | 752 | ®_vdd2p5 { |
| 757 | 753 | vin-supply = <&vgen5_reg>; |
| 758 | 754 | }; |
| @@ -584,10 +584,6 @@ · 583 unmodified lines | ||
| 584 | 584 | vin-supply = <&sw2_reg>; |
| 585 | 585 | }; |
| 586 | 586 | |
| 587 | −®_vdd3p0 { | |
| 588 | − vin-supply = <&sw2_reg>; | |
| 589 | −}; | |
| 590 | − | |
| 591 | 587 | ®_vdd2p5 { |
| 592 | 588 | vin-supply = <&sw2_reg>; |
| 593 | 589 | }; |
| @@ -265,10 +265,6 @@ · 264 unmodified lines | ||
| 265 | 265 | status = "okay"; |
| 266 | 266 | }; |
| 267 | 267 | |
| 268 | −®_3p0 { | |
| 269 | − vin-supply = <&sw2_reg>; | |
| 270 | −}; | |
| 271 | − | |
| 272 | 268 | &snvs_poweroff { |
| 273 | 269 | status = "okay"; |
| 274 | 270 | }; |
| @@ -159,10 +159,6 @@ · 158 unmodified lines | ||
| 159 | 159 | vin-supply = <&vgen6_reg>; |
| 160 | 160 | }; |
| 161 | 161 | |
| 162 | −®_vdd3p0 { | |
| 163 | − vin-supply = <&sw2_reg>; | |
| 164 | −}; | |
| 165 | − | |
| 166 | 162 | ®_vdd2p5 { |
| 167 | 163 | vin-supply = <&vgen6_reg>; |
| 168 | 164 | }; |
| @@ -141,10 +141,6 @@ · 140 unmodified lines | ||
| 141 | 141 | vin-supply = <&vgen6_reg>; |
| 142 | 142 | }; |
| 143 | 143 | |
| 144 | −®_vdd3p0 { | |
| 145 | − vin-supply = <&sw2_reg>; | |
| 146 | −}; | |
| 147 | − | |
| 148 | 144 | ®_vdd2p5 { |
| 149 | 145 | vin-supply = <&vgen6_reg>; |
| 150 | 146 | }; |
| @@ -49,3 +49,7 @@ · 48 unmodified lines | ||
| 49 | 49 | reg = <0x80000000 0x10000000>; |
| 50 | 50 | }; |
| 51 | 51 | }; |
| 52 | + | |
| 53 | +&gpmi { | |
| 54 | + status = "okay"; | |
| 55 | +}; | |
| @@ -37,10 +37,10 @@ · 36 unmodified lines | ||
| 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 | |
| @@ -253,7 +253,7 @@ · 252 unmodified lines | ||
| 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 { |
| @@ -356,7 +356,7 @@ · 355 unmodified lines | ||
| 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,7 +368,7 @@ · 5 unmodified lines | ||
| 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,7 +380,7 @@ · 5 unmodified lines | ||
| 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,7 +392,7 @@ · 5 unmodified lines | ||
| 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,7 +405,7 @@ · 6 unmodified lines | ||
| 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,7 +417,7 @@ · 5 unmodified lines | ||
| 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>; |
| @@ -101,7 +101,7 @@ · 100 unmodified lines | ||
| 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 | }; |
| @@ -9,6 +9,7 @@ menuconfig ARCH_DAVINCI · 8 unmodified lines | ||
| 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 | |
| @@ -207,7 +207,7 @@ static int __init mmp_dt_init_timer(struct device_node *np) · 206 unmodified lines | ||
| 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 { |
| @@ -95,6 +95,7 @@ config ARCH_OMAP2PLUS · 94 unmodified lines | ||
| 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 |
| @@ -105,11 +106,11 @@ config ARCH_OMAP2PLUS · 4 unmodified lines | ||
| 105 | 106 | select OMAP_DM_TIMER |
| 106 | 107 | select OMAP_GPMC |
| 107 | 108 | select PINCTRL |
| 109 | + select RESET_CONTROLLER | |
| 108 | 110 | select SOC_BUS |
| 109 | 111 | select TI_SYSC |
| 110 | 112 | select OMAP_IRQCHIP |
| 111 | 113 | select CLKSRC_TI_32K |
| 112 | − select ARCH_HAS_RESET_CONTROLLER | |
| 113 | 114 | help |
| 114 | 115 | Systems based on OMAP2, OMAP3, OMAP4 or OMAP5 |
| 115 | 116 | |
| @@ -306,10 +306,14 @@ static void __init dra7x_evm_mmc_quirk(void) · 305 unmodified lines | ||
| 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 | |
| @@ -15,7 +15,7 @@ · 14 unmodified lines | ||
| 15 | 15 | pinctrl-names = "default"; |
| 16 | 16 | pinctrl-0 = <&mmc2_pins>; |
| 17 | 17 | vmmc-supply = <®_dcdc1>; |
| 18 | − vqmmc-supply = <®_dcdc1>; | |
| 18 | + vqmmc-supply = <®_eldo1>; | |
| 19 | 19 | bus-width = <8>; |
| 20 | 20 | non-removable; |
| 21 | 21 | cap-mmc-hw-reset; |
| @@ -140,7 +140,7 @@ · 139 unmodified lines | ||
| 140 | 140 | &mmc1 { |
| 141 | 141 | pinctrl-names = "default"; |
| 142 | 142 | pinctrl-0 = <&mmc1_pins>; |
| 143 | − vmmc-supply = <®_aldo2>; | |
| 143 | + vmmc-supply = <®_dcdc1>; | |
| 144 | 144 | vqmmc-supply = <®_dldo4>; |
| 145 | 145 | mmc-pwrseq = <&wifi_pwrseq>; |
| 146 | 146 | bus-width = <4>; |
| @@ -61,10 +61,10 @@ · 60 unmodified lines | ||
| 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>, |
| @@ -46,25 +46,47 @@ · 45 unmodified lines | ||
| 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 | |
| @@ -569,6 +591,8 @@ · 498 unmodified lines | ||
| 569 | 591 | |
| 570 | 592 | bluetooth { |
| 571 | 593 | compatible = "brcm,bcm43438-bt"; |
| 594 | + interrupt-parent = <&gpio_intc>; | |
| 595 | + interrupts = <95 IRQ_TYPE_LEVEL_HIGH>; | |
| 572 | 596 | shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; |
| 573 | 597 | max-speed = <2000000>; |
| 574 | 598 | clocks = <&wifi32k>; |
| @@ -175,7 +175,7 @@ · 174 unmodified lines | ||
| 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 { |
| @@ -740,7 +740,7 @@ · 739 unmodified lines | ||
| 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"; |
| @@ -421,7 +421,7 @@ · 420 unmodified lines | ||
| 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 = <®_3v3_p>; |
| 426 | 426 | vddio-supply = <®_3v3_p>; |
| 427 | 427 | }; |
| @@ -60,10 +60,10 @@ · 59 unmodified lines | ||
| 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>, |
| @@ -49,7 +49,8 @@ · 48 unmodified lines | ||
| 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 | |
| @@ -9,7 +9,11 @@ · 8 unmodified lines | ||
| 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); |
| @@ -40,12 +44,11 @@ void invalidate_kernel_vmap_range(void *addr, int size); · 24 unmodified lines | ||
| 40 | 44 | #define flush_dcache_mmap_unlock(mapping) xa_unlock_irq(&(mapping)->i_pages) |
| 41 | 45 | |
| 42 | 46 | #else |
| 43 | −#include <asm-generic/cacheflush.h> | |
| 44 | −#undef flush_icache_range | |
| 45 | −#undef flush_icache_page | |
| 46 | −#undef flush_icache_user_range | |
| 47 | 47 | void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, |
| 48 | 48 | unsigned long addr, int len); |
| 49 | +#define flush_icache_user_range flush_icache_user_range | |
| 50 | + | |
| 51 | +#include <asm-generic/cacheflush.h> | |
| 49 | 52 | #endif |
| 50 | 53 | |
| 51 | 54 | #endif /* __NDS32_CACHEFLUSH_H__ */ |
| @@ -195,7 +195,7 @@ extern void paging_init(void); · 194 unmodified lines | ||
| 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 | /* |
| @@ -889,8 +889,8 @@ static void print_parisc_device(struct parisc_device *dev) · 888 unmodified lines | ||
| 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) { |
| @@ -401,7 +401,7 @@ static void __init map_pages(unsigned long start_vaddr, · 400 unmodified lines | ||
| 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 | |
| @@ -5,4 +5,8 @@ · 4 unmodified lines | ||
| 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 */ |
| @@ -80,7 +80,9 @@ _start_kernel: · 79 unmodified lines | ||
| 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 */ |
| @@ -209,11 +211,6 @@ relocate: · 122 unmodified lines | ||
| 209 | 211 | tail smp_callin |
| 210 | 212 | #endif |
| 211 | 213 | |
| 212 | −.align 2 | |
| 213 | −.Lsecondary_park: | |
| 214 | − /* We lack SMP support or have too many harts, so park this hart */ | |
| 215 | − wfi | |
| 216 | − j .Lsecondary_park | |
| 217 | 214 | END(_start) |
| 218 | 215 | |
| 219 | 216 | #ifdef CONFIG_RISCV_M_MODE |
| @@ -295,6 +292,13 @@ ENTRY(reset_regs) · 75 unmodified lines | ||
| 295 | 292 | END(reset_regs) |
| 296 | 293 | #endif /* CONFIG_RISCV_M_MODE */ |
| 297 | 294 | |
| 295 | +.section ".text", "ax",@progbits | |
| 296 | +.align 2 | |
| 297 | +.Lsecondary_park: | |
| 298 | + /* We lack SMP support or have too many harts, so park this hart */ | |
| 299 | + wfi | |
| 300 | + j .Lsecondary_park | |
| 301 | + | |
| 298 | 302 | __PAGE_ALIGNED_BSS |
| 299 | 303 | /* Empty zero page */ |
| 300 | 304 | .balign PAGE_SIZE |
| @@ -58,7 +58,8 @@ quiet_cmd_vdsold = VDSOLD $@ · 57 unmodified lines | ||
| 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 $@ |
| @@ -4,34 +4,73 @@ · 3 unmodified lines | ||
| 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 | |
| 28 | + ret | |
| 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 | |
| 36 | 74 | ret |
| 37 | −ENDPROC(__lshrti3) | |
| 75 | +SYM_FUNC_END(__ashlti3) | |
| 76 | +EXPORT_SYMBOL(__ashlti3) | |
| @@ -1052,7 +1052,7 @@ static void __init log_component_list(void) · 1051 unmodified lines | ||
| 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"); |
| @@ -244,6 +244,11 @@ SYM_FUNC_START(efi32_stub_entry) · 243 unmodified lines | ||
| 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 |
| @@ -15,6 +15,7 @@ · 14 unmodified lines | ||
| 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 |
| @@ -657,6 +658,10 @@ static const struct pci_device_id skl_uncore_pci_ids[] = { · 636 unmodified lines | ||
| 657 | 658 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_SQ_IMC), |
| 658 | 659 | .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), |
| 659 | 660 | }, |
| 661 | + { /* IMC */ | |
| 662 | + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_E3_IMC), | |
| 663 | + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), | |
| 664 | + }, | |
| 660 | 665 | { /* IMC */ |
| 661 | 666 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBL_Y_IMC), |
| 662 | 667 | .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), |
| @@ -826,6 +831,7 @@ static const struct imc_uncore_pci_dev desktop_imc_pci_ids[] = { · 163 unmodified lines | ||
| 826 | 831 | IMC_DEV(SKL_HQ_IMC, &skl_uncore_pci_driver), /* 6th Gen Core H Quad Core */ |
| 827 | 832 | IMC_DEV(SKL_SD_IMC, &skl_uncore_pci_driver), /* 6th Gen Core S Dual Core */ |
| 828 | 833 | IMC_DEV(SKL_SQ_IMC, &skl_uncore_pci_driver), /* 6th Gen Core S Quad Core */ |
| 834 | + IMC_DEV(SKL_E3_IMC, &skl_uncore_pci_driver), /* Xeon E3 V5 Gen Core processor */ | |
| 829 | 835 | IMC_DEV(KBL_Y_IMC, &skl_uncore_pci_driver), /* 7th Gen Core Y */ |
| 830 | 836 | IMC_DEV(KBL_U_IMC, &skl_uncore_pci_driver), /* 7th Gen Core U */ |
| 831 | 837 | IMC_DEV(KBL_UQ_IMC, &skl_uncore_pci_driver), /* 7th Gen Core U Quad Core */ |
| @@ -369,11 +369,6 @@ · 368 unmodified lines | ||
| 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 |
| @@ -4328,27 +4323,12 @@ static struct intel_uncore_type snr_uncore_m2m = { · 3948 unmodified lines | ||
| 4328 | 4323 | .format_group = &snr_m2m_uncore_format_group, |
| 4329 | 4324 | }; |
| 4330 | 4325 | |
| 4331 | −static struct intel_uncore_type snr_uncore_pcie3 = { | |
| 4332 | − .name = "pcie3", | |
| 4333 | − .num_counters = 4, | |
| 4334 | − .num_boxes = 1, | |
| 4335 | − .perf_ctr_bits = 48, | |
| 4336 | − .perf_ctr = SNR_PCIE3_PCI_PMON_CTR0, | |
| 4337 | − .event_ctl = SNR_PCIE3_PCI_PMON_CTL0, | |
| 4338 | − .event_mask = SNBEP_PMON_RAW_EVENT_MASK, | |
| 4339 | − .box_ctl = SNR_PCIE3_PCI_PMON_BOX_CTL, | |
| 4340 | − .ops = &ivbep_uncore_pci_ops, | |
| 4341 | − .format_group = &ivbep_uncore_format_group, | |
| 4342 | −}; | |
| 4343 | − | |
| 4344 | 4326 | enum { |
| 4345 | 4327 | SNR_PCI_UNCORE_M2M, |
| 4346 | − SNR_PCI_UNCORE_PCIE3, | |
| 4347 | 4328 | }; |
| 4348 | 4329 | |
| 4349 | 4330 | static struct intel_uncore_type *snr_pci_uncores[] = { |
| 4350 | 4331 | [SNR_PCI_UNCORE_M2M] = &snr_uncore_m2m, |
| 4351 | − [SNR_PCI_UNCORE_PCIE3] = &snr_uncore_pcie3, | |
| 4352 | 4332 | NULL, |
| 4353 | 4333 | }; |
| 4354 | 4334 | |
| @@ -4357,10 +4337,6 @@ static const struct pci_device_id snr_uncore_pci_ids[] = { · 2 unmodified lines | ||
| 4357 | 4337 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x344a), |
| 4358 | 4338 | .driver_data = UNCORE_PCI_DEV_FULL_DATA(12, 0, SNR_PCI_UNCORE_M2M, 0), |
| 4359 | 4339 | }, |
| 4360 | − { /* PCIe3 */ | |
| 4361 | − PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x334a), | |
| 4362 | − .driver_data = UNCORE_PCI_DEV_FULL_DATA(4, 0, SNR_PCI_UNCORE_PCIE3, 0), | |
| 4363 | − }, | |
| 4364 | 4340 | { /* end: all zeroes */ } |
| 4365 | 4341 | }; |
| 4366 | 4342 | |
| @@ -4536,6 +4512,7 @@ static struct uncore_event_desc snr_uncore_imc_freerunning_events[] = { · 169 unmodified lines | ||
| 4536 | 4512 | INTEL_UNCORE_EVENT_DESC(write, "event=0xff,umask=0x21"), |
| 4537 | 4513 | INTEL_UNCORE_EVENT_DESC(write.scale, "3.814697266e-6"), |
| 4538 | 4514 | INTEL_UNCORE_EVENT_DESC(write.unit, "MiB"), |
| 4515 | + { /* end: all zeroes */ }, | |
| 4539 | 4516 | }; |
| 4540 | 4517 | |
| 4541 | 4518 | static struct intel_uncore_ops snr_uncore_imc_freerunning_ops = { |
| @@ -615,9 +615,9 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c) · 614 unmodified lines | ||
| 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 | |
| @@ -467,6 +467,7 @@ static int thermal_throttle_online(unsigned int cpu) · 466 unmodified lines | ||
| 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; |
| @@ -474,6 +475,10 @@ static int thermal_throttle_online(unsigned int cpu) · 1 unmodified line | ||
| 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); |
| 476 | 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); | |
| 481 | + | |
| 477 | 482 | return thermal_throttle_add_dev(dev, cpu); |
| 478 | 483 | } |
| 479 | 484 | |
| @@ -722,10 +727,6 @@ void intel_init_thermal(struct cpuinfo_x86 *c) · 242 unmodified lines | ||
| 722 | 727 | rdmsr(MSR_IA32_MISC_ENABLE, l, h); |
| 723 | 728 | wrmsr(MSR_IA32_MISC_ENABLE, l | MSR_IA32_MISC_ENABLE_TM1, h); |
| 724 | 729 | |
| 725 | − /* Unmask the thermal vector: */ | |
| 726 | − l = apic_read(APIC_LVTTHMR); | |
| 727 | − apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED); | |
| 728 | − | |
| 729 | 730 | pr_info_once("CPU0: Thermal monitoring enabled (%s)\n", |
| 730 | 731 | tm2 ? "TM2" : "TM1"); |
| 731 | 732 | |
| @@ -618,7 +618,7 @@ static void domain_remove_cpu(int cpu, struct rdt_resource *r) · 617 unmodified lines | ||
| 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 | /* |
| @@ -1741,9 +1741,6 @@ static int set_cache_qos_cfg(int level, bool enable) · 1740 unmodified lines | ||
| 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) |
| @@ -1751,6 +1748,9 @@ static int set_cache_qos_cfg(int level, bool enable) · 1 unmodified line | ||
| 1751 | 1748 | else |
| 1752 | 1749 | return -EINVAL; |
| 1753 | 1750 | |
| 1751 | + if (!zalloc_cpumask_var(&cpu_mask, GFP_KERNEL)) | |
| 1752 | + return -ENOMEM; | |
| 1753 | + | |
| 1754 | 1754 | r_l = &rdt_resources_all[level]; |
| 1755 | 1755 | list_for_each_entry(d, &r_l->domains, list) { |
| 1756 | 1756 | /* Pick one CPU from each domain instance to update MSR */ |
| @@ -164,8 +164,13 @@ static inline unsigned get_max_segment_size(const struct request_queue *q, · 163 unmodified lines | ||
| 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 | /** |
| @@ -328,7 +328,7 @@ EXPORT_SYMBOL(blk_queue_max_segment_size); · 327 unmodified lines | ||
| 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 | |
| @@ -17,7 +17,7 @@ PROGBITS = $(if $(CONFIG_ARM),%,@)progbits · 16 unmodified lines | ||
| 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:" ;\ |
| @@ -129,11 +129,13 @@ static blk_status_t null_zone_write(struct nullb_cmd *cmd, sector_t sector, · 128 unmodified lines | ||
| 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; |
| @@ -343,6 +343,12 @@ static int sysc_get_clocks(struct sysc *ddata) · 342 unmodified lines | ||
| 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); |
| @@ -421,7 +427,7 @@ static int sysc_enable_opt_clocks(struct sysc *ddata) · 72 unmodified lines | ||
| 421 | 427 | struct clk *clock; |
| 422 | 428 | int i, error; |
| 423 | 429 | |
| 424 | − if (!ddata->clocks) | |
| 430 | + if (!ddata->clocks || ddata->nr_clocks < SYSC_OPTFCK0 + 1) | |
| 425 | 431 | return 0; |
| 426 | 432 | |
| 427 | 433 | for (i = SYSC_OPTFCK0; i < SYSC_MAX_CLOCKS; i++) { |
| @@ -455,7 +461,7 @@ static void sysc_disable_opt_clocks(struct sysc *ddata) · 27 unmodified lines | ||
| 455 | 461 | struct clk *clock; |
| 456 | 462 | int i; |
| 457 | 463 | |
| 458 | − if (!ddata->clocks) | |
| 464 | + if (!ddata->clocks || ddata->nr_clocks < SYSC_OPTFCK0 + 1) | |
| 459 | 465 | return; |
| 460 | 466 | |
| 461 | 467 | for (i = SYSC_OPTFCK0; i < SYSC_MAX_CLOCKS; i++) { |
| @@ -3426,11 +3426,17 @@ static int __clk_core_init(struct clk_core *core) · 3425 unmodified lines | ||
| 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(); |
| @@ -134,7 +134,7 @@ static DEFINE_SPINLOCK(ssp3_lock); · 133 unmodified lines | ||
| 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 | |
| @@ -3255,6 +3255,7 @@ static struct gdsc hlos1_vote_aggre_noc_mmu_audio_tbu_gdsc = { · 3254 unmodified lines | ||
| 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 = { |
| @@ -3263,6 +3264,7 @@ static struct gdsc hlos1_vote_aggre_noc_mmu_pcie_tbu_gdsc = { · 2 unmodified lines | ||
| 3263 | 3264 | .name = "hlos1_vote_aggre_noc_mmu_pcie_tbu_gdsc", |
| 3264 | 3265 | }, |
| 3265 | 3266 | .pwrsts = PWRSTS_OFF_ON, |
| 3267 | + .flags = VOTABLE, | |
| 3266 | 3268 | }; |
| 3267 | 3269 | |
| 3268 | 3270 | static struct gdsc hlos1_vote_aggre_noc_mmu_tbu1_gdsc = { |
| @@ -3271,6 +3273,7 @@ static struct gdsc hlos1_vote_aggre_noc_mmu_tbu1_gdsc = { · 2 unmodified lines | ||
| 3271 | 3273 | .name = "hlos1_vote_aggre_noc_mmu_tbu1_gdsc", |
| 3272 | 3274 | }, |
| 3273 | 3275 | .pwrsts = PWRSTS_OFF_ON, |
| 3276 | + .flags = VOTABLE, | |
| 3274 | 3277 | }; |
| 3275 | 3278 | |
| 3276 | 3279 | static struct gdsc hlos1_vote_aggre_noc_mmu_tbu2_gdsc = { |
| @@ -3279,6 +3282,7 @@ static struct gdsc hlos1_vote_aggre_noc_mmu_tbu2_gdsc = { · 2 unmodified lines | ||
| 3279 | 3282 | .name = "hlos1_vote_aggre_noc_mmu_tbu2_gdsc", |
| 3280 | 3283 | }, |
| 3281 | 3284 | .pwrsts = PWRSTS_OFF_ON, |
| 3285 | + .flags = VOTABLE, | |
| 3282 | 3286 | }; |
| 3283 | 3287 | |
| 3284 | 3288 | static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc = { |
| @@ -3287,6 +3291,7 @@ static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc = { · 2 unmodified lines | ||
| 3287 | 3291 | .name = "hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc", |
| 3288 | 3292 | }, |
| 3289 | 3293 | .pwrsts = PWRSTS_OFF_ON, |
| 3294 | + .flags = VOTABLE, | |
| 3290 | 3295 | }; |
| 3291 | 3296 | |
| 3292 | 3297 | static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc = { |
| @@ -3295,6 +3300,7 @@ static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc = { · 2 unmodified lines | ||
| 3295 | 3300 | .name = "hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc", |
| 3296 | 3301 | }, |
| 3297 | 3302 | .pwrsts = PWRSTS_OFF_ON, |
| 3303 | + .flags = VOTABLE, | |
| 3298 | 3304 | }; |
| 3299 | 3305 | |
| 3300 | 3306 | static struct gdsc hlos1_vote_mmnoc_mmu_tbu_sf_gdsc = { |
| @@ -3303,6 +3309,7 @@ static struct gdsc hlos1_vote_mmnoc_mmu_tbu_sf_gdsc = { · 2 unmodified lines | ||
| 3303 | 3309 | .name = "hlos1_vote_mmnoc_mmu_tbu_sf_gdsc", |
| 3304 | 3310 | }, |
| 3305 | 3311 | .pwrsts = PWRSTS_OFF_ON, |
| 3312 | + .flags = VOTABLE, | |
| 3306 | 3313 | }; |
| 3307 | 3314 | |
| 3308 | 3315 | static struct clk_regmap *gcc_sdm845_clocks[] = { |
| @@ -12,6 +12,7 @@ · 11 unmodified lines | ||
| 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,6 +1647,13 @@ static void __init exynos5x_clk_init(struct device_node *np, · 1628 unmodified lines | ||
| 1646 | 1647 | exynos5x_subcmus); |
| 1647 | 1648 | } |
| 1648 | 1649 | |
| 1650 | + /* | |
| 1651 | + * Keep top part of G3D clock path enabled permanently to ensure | |
| 1652 | + * that the internal busses get their clock regardless of the | |
| 1653 | + * main G3D clock enablement status. | |
| 1654 | + */ | |
| 1655 | + clk_prepare_enable(__clk_lookup("mout_sw_aclk_g3d")); | |
| 1656 | + | |
| 1649 | 1657 | samsung_clk_of_add_provider(np, ctx); |
| 1650 | 1658 | } |
| 1651 | 1659 | |
| @@ -23,9 +23,9 @@ · 22 unmodified lines | ||
| 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,17 +51,7 @@ static struct ccu_div ar100_clk = { · 19 unmodified lines | ||
| 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), |
| @@ -51,19 +51,7 @@ static struct ccu_div ar100_clk = { · 50 unmodified lines | ||
| 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 |
| @@ -127,7 +115,7 @@ static struct ccu_mp a83t_ir_clk = { · 57 unmodified lines | ||
| 127 | 115 | |
| 128 | 116 | static struct ccu_common *sun8i_a83t_r_ccu_clks[] = { |
| 129 | 117 | &ar100_clk.common, |
| 130 | − &a83t_apb0_clk.common, | |
| 118 | + &apb0_clk.common, | |
| 131 | 119 | &apb0_pio_clk.common, |
| 132 | 120 | &apb0_ir_clk.common, |
| 133 | 121 | &apb0_timer_clk.common, |
| @@ -167,7 +155,7 @@ static struct clk_hw_onecell_data sun8i_a83t_r_hw_clks = { · 33 unmodified lines | ||
| 167 | 155 | .hws = { |
| 168 | 156 | [CLK_AR100] = &ar100_clk.common.hw, |
| 169 | 157 | [CLK_AHB0] = &ahb0_clk.hw, |
| 170 | − [CLK_APB0] = &a83t_apb0_clk.common.hw, | |
| 158 | + [CLK_APB0] = &apb0_clk.common.hw, | |
| 171 | 159 | [CLK_APB0_PIO] = &apb0_pio_clk.common.hw, |
| 172 | 160 | [CLK_APB0_IR] = &apb0_ir_clk.common.hw, |
| 173 | 161 | [CLK_APB0_TIMER] = &apb0_timer_clk.common.hw, |
| @@ -282,9 +270,6 @@ static void __init sunxi_r_ccu_init(struct device_node *node, · 108 unmodified lines | ||
| 282 | 270 | |
| 283 | 271 | static void __init sun8i_a83t_r_ccu_setup(struct device_node *node) |
| 284 | 272 | { |
| 285 | − /* Fix apb0 bus gate parents here */ | |
| 286 | − apb0_gate_parent[0] = &a83t_apb0_clk.common.hw; | |
| 287 | − | |
| 288 | 273 | sunxi_r_ccu_init(node, &sun8i_a83t_r_ccu_desc); |
| 289 | 274 | } |
| 290 | 275 | CLK_OF_DECLARE(sun8i_a83t_r_ccu, "allwinner,sun8i-a83t-r-ccu", |
| @@ -761,7 +761,8 @@ static struct ccu_mp outa_clk = { · 760 unmodified lines | ||
| 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 | |
| @@ -779,7 +780,8 @@ static struct ccu_mp outb_clk = { · 11 unmodified lines | ||
| 779 | 780 | .reg = 0x1f4, |
| 780 | 781 | .features = CCU_FEATURE_FIXED_PREDIV, |
| 781 | 782 | .hw.init = CLK_HW_INIT_PARENTS("outb", out_parents, |
| 782 | − &ccu_mp_ops, 0), | |
| 783 | + &ccu_mp_ops, | |
| 784 | + CLK_SET_RATE_PARENT), | |
| 783 | 785 | } |
| 784 | 786 | }; |
| 785 | 787 | |
| @@ -618,7 +618,7 @@ static struct clk_hw_onecell_data sun8i_v3s_hw_clks = { · 617 unmodified lines | ||
| 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,7 +700,7 @@ static struct clk_hw_onecell_data sun8i_v3_hw_clks = { · 75 unmodified lines | ||
| 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[] = { |
| @@ -51,6 +51,4 @@ · 50 unmodified lines | ||
| 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_ */ |
| @@ -231,8 +231,10 @@ struct clk ** __init tegra_clk_init(void __iomem *regs, int num, int banks) · 230 unmodified lines | ||
| 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 | |
| @@ -233,7 +233,6 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev) · 232 unmodified lines | ||
| 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); |
| @@ -198,7 +198,7 @@ static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev) · 197 unmodified lines | ||
| 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 | |
| @@ -40,7 +40,7 @@ struct sec_req { · 39 unmodified lines | ||
| 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,8 +132,8 @@ struct sec_debug_file { · 85 unmodified lines | ||
| 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 { |
| @@ -120,7 +120,7 @@ static void sec_req_cb(struct hisi_qp *qp, void *resp) · 119 unmodified lines | ||
| 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,13 +135,13 @@ static int sec_bd_send(struct sec_ctx *ctx, struct sec_req *req) · 8 unmodified lines | ||
| 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,7 +641,7 @@ static void sec_skcipher_callback(struct sec_ctx *ctx, struct sec_req *req) · 493 unmodified lines | ||
| 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,9 +672,9 @@ static int sec_request_init(struct sec_ctx *ctx, struct sec_req *req) · 24 unmodified lines | ||
| 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) { |
| @@ -608,6 +608,14 @@ static const struct file_operations sec_dbg_fops = { · 607 unmodified lines | ||
| 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; |
| @@ -628,9 +636,11 @@ static int sec_core_debug_init(struct sec_dev *sec) · 14 unmodified lines | ||
| 628 | 636 | |
| 629 | 637 | debugfs_create_regset32("regs", 0444, tmp_d, regset); |
| 630 | 638 | |
| 631 | − debugfs_create_u64("send_cnt", 0444, tmp_d, &dfx->send_cnt); | |
| 639 | + debugfs_create_file("send_cnt", 0444, tmp_d, &dfx->send_cnt, | |
| 640 | + &fops_atomic64_t_ro); | |
| 632 | 641 | |
| 633 | − debugfs_create_u64("recv_cnt", 0444, tmp_d, &dfx->recv_cnt); | |
| 642 | + debugfs_create_file("recv_cnt", 0444, tmp_d, &dfx->recv_cnt, | |
| 643 | + &fops_atomic64_t_ro); | |
| 634 | 644 | |
| 635 | 645 | return 0; |
| 636 | 646 | } |
| @@ -17,7 +17,7 @@ static const struct console *earlycon_console __initdata; · 16 unmodified lines | ||
| 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,10 +33,8 @@ static int __init efi_earlycon_remap_fb(void) · 9 unmodified lines | ||
| 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 | } |
| @@ -53,9 +51,12 @@ late_initcall(efi_earlycon_unmap_fb); · 10 unmodified lines | ||
| 53 | 51 | |
| 54 | 52 | static __ref void *efi_earlycon_map(unsigned long start, unsigned long len) |
| 55 | 53 | { |
| 54 | + pgprot_t fb_prot; | |
| 55 | + | |
| 56 | 56 | if (efi_fb) |
| 57 | 57 | return efi_fb + start; |
| 58 | 58 | |
| 59 | + fb_prot = fb_wb ? PAGE_KERNEL : pgprot_writecombine(PAGE_KERNEL); | |
| 59 | 60 | return early_memremap_prot(fb_base + start, len, pgprot_val(fb_prot)); |
| 60 | 61 | } |
| 61 | 62 | |
| @@ -215,10 +216,7 @@ static int __init efi_earlycon_setup(struct earlycon_device *device, · 153 unmodified lines | ||
| 215 | 216 | if (screen_info.capabilities & VIDEO_CAPABILITY_64BIT_BASE) |
| 216 | 217 | fb_base |= (u64)screen_info.ext_lfb_base << 32; |
| 217 | 218 | |
| 218 | − if (opt && !strcmp(opt, "ram")) | |
| 219 | − fb_prot = PAGE_KERNEL; | |
| 220 | − else | |
| 221 | − fb_prot = pgprot_writecombine(PAGE_KERNEL); | |
| 219 | + fb_wb = opt && !strcmp(opt, "ram"); | |
| 222 | 220 | |
| 223 | 221 | si = &screen_info; |
| 224 | 222 | xres = si->lfb_width; |
| @@ -33,7 +33,7 @@ efi_status_t efi_get_random_bytes(efi_system_table_t *sys_table_arg, · 32 unmodified lines | ||
| 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,8 +162,8 @@ efi_status_t efi_random_get_seed(efi_system_table_t *sys_table_arg) · 122 unmodified lines | ||
| 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, |
| @@ -573,7 +573,6 @@ config GPIO_THUNDERX · 572 unmodified lines | ||
| 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 |
| @@ -53,6 +53,7 @@ struct thunderx_line { · 52 unmodified lines | ||
| 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; |
| @@ -285,60 +286,54 @@ static void thunderx_gpio_set_multiple(struct gpio_chip *chip, · 226 unmodified lines | ||
| 285 | 286 | } |
| 286 | 287 | } |
| 287 | 288 | |
| 288 | −static void thunderx_gpio_irq_ack(struct irq_data *d) | |
| 289 | +static void thunderx_gpio_irq_ack(struct irq_data *data) | |
| 289 | 290 | { |
| 290 | − struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | |
| 291 | − struct thunderx_gpio *txgpio = gpiochip_get_data(gc); | |
| 291 | + struct thunderx_line *txline = irq_data_get_irq_chip_data(data); | |
| 292 | 292 | |
| 293 | 293 | writeq(GPIO_INTR_INTR, |
| 294 | − txgpio->register_base + intr_reg(irqd_to_hwirq(d))); | |
| 294 | + txline->txgpio->register_base + intr_reg(txline->line)); | |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | −static void thunderx_gpio_irq_mask(struct irq_data *d) | |
| 297 | +static void thunderx_gpio_irq_mask(struct irq_data *data) | |
| 298 | 298 | { |
| 299 | − struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | |
| 300 | − struct thunderx_gpio *txgpio = gpiochip_get_data(gc); | |
| 299 | + struct thunderx_line *txline = irq_data_get_irq_chip_data(data); | |
| 301 | 300 | |
| 302 | 301 | writeq(GPIO_INTR_ENA_W1C, |
| 303 | − txgpio->register_base + intr_reg(irqd_to_hwirq(d))); | |
| 302 | + txline->txgpio->register_base + intr_reg(txline->line)); | |
| 304 | 303 | } |
| 305 | 304 | |
| 306 | −static void thunderx_gpio_irq_mask_ack(struct irq_data *d) | |
| 305 | +static void thunderx_gpio_irq_mask_ack(struct irq_data *data) | |
| 307 | 306 | { |
| 308 | − struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | |
| 309 | − struct thunderx_gpio *txgpio = gpiochip_get_data(gc); | |
| 307 | + struct thunderx_line *txline = irq_data_get_irq_chip_data(data); | |
| 310 | 308 | |
| 311 | 309 | writeq(GPIO_INTR_ENA_W1C | GPIO_INTR_INTR, |
| 312 | − txgpio->register_base + intr_reg(irqd_to_hwirq(d))); | |
| 310 | + txline->txgpio->register_base + intr_reg(txline->line)); | |
| 313 | 311 | } |
| 314 | 312 | |
| 315 | −static void thunderx_gpio_irq_unmask(struct irq_data *d) | |
| 313 | +static void thunderx_gpio_irq_unmask(struct irq_data *data) | |
| 316 | 314 | { |
| 317 | − struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | |
| 318 | − struct thunderx_gpio *txgpio = gpiochip_get_data(gc); | |
| 315 | + struct thunderx_line *txline = irq_data_get_irq_chip_data(data); | |
| 319 | 316 | |
| 320 | 317 | writeq(GPIO_INTR_ENA_W1S, |
| 321 | − txgpio->register_base + intr_reg(irqd_to_hwirq(d))); | |
| 318 | + txline->txgpio->register_base + intr_reg(txline->line)); | |
| 322 | 319 | } |
| 323 | 320 | |
| 324 | −static int thunderx_gpio_irq_set_type(struct irq_data *d, | |
| 321 | +static int thunderx_gpio_irq_set_type(struct irq_data *data, | |
| 325 | 322 | unsigned int flow_type) |
| 326 | 323 | { |
| 327 | − struct gpio_chip *gc = irq_data_get_irq_chip_data(d); | |
| 328 | − struct thunderx_gpio *txgpio = gpiochip_get_data(gc); | |
| 329 | − struct thunderx_line *txline = | |
| 330 | − &txgpio->line_entries[irqd_to_hwirq(d)]; | |
| 324 | + struct thunderx_line *txline = irq_data_get_irq_chip_data(data); | |
| 325 | + struct thunderx_gpio *txgpio = txline->txgpio; | |
| 331 | 326 | u64 bit_cfg; |
| 332 | 327 | |
| 333 | − irqd_set_trigger_type(d, flow_type); | |
| 328 | + irqd_set_trigger_type(data, flow_type); | |
| 334 | 329 | |
| 335 | 330 | bit_cfg = txline->fil_bits | GPIO_BIT_CFG_INT_EN; |
| 336 | 331 | |
| 337 | 332 | if (flow_type & IRQ_TYPE_EDGE_BOTH) { |
| 338 | − irq_set_handler_locked(d, handle_fasteoi_ack_irq); | |
| 333 | + irq_set_handler_locked(data, handle_fasteoi_ack_irq); | |
| 339 | 334 | bit_cfg |= GPIO_BIT_CFG_INT_TYPE; |
| 340 | 335 | } else { |
| 341 | − irq_set_handler_locked(d, handle_fasteoi_mask_irq); | |
| 336 | + irq_set_handler_locked(data, handle_fasteoi_mask_irq); | |
| 342 | 337 | } |
| 343 | 338 | |
| 344 | 339 | raw_spin_lock(&txgpio->lock); |
| @@ -367,6 +362,33 @@ static void thunderx_gpio_irq_disable(struct irq_data *data) · 22 unmodified lines | ||
| 367 | 362 | irq_chip_disable_parent(data); |
| 368 | 363 | } |
| 369 | 364 | |
| 365 | +static int thunderx_gpio_irq_request_resources(struct irq_data *data) | |
| 366 | +{ | |
| 367 | + struct thunderx_line *txline = irq_data_get_irq_chip_data(data); | |
| 368 | + struct thunderx_gpio *txgpio = txline->txgpio; | |
| 369 | + int r; | |
| 370 | + | |
| 371 | + r = gpiochip_lock_as_irq(&txgpio->chip, txline->line); | |
| 372 | + if (r) | |
| 373 | + return r; | |
| 374 | + | |
| 375 | + r = irq_chip_request_resources_parent(data); | |
| 376 | + if (r) | |
| 377 | + gpiochip_unlock_as_irq(&txgpio->chip, txline->line); | |
| 378 | + | |
| 379 | + return r; | |
| 380 | +} | |
| 381 | + | |
| 382 | +static void thunderx_gpio_irq_release_resources(struct irq_data *data) | |
| 383 | +{ | |
| 384 | + struct thunderx_line *txline = irq_data_get_irq_chip_data(data); | |
| 385 | + struct thunderx_gpio *txgpio = txline->txgpio; | |
| 386 | + | |
| 387 | + irq_chip_release_resources_parent(data); | |
| 388 | + | |
| 389 | + gpiochip_unlock_as_irq(&txgpio->chip, txline->line); | |
| 390 | +} | |
| 391 | + | |
| 370 | 392 | /* |
| 371 | 393 | * Interrupts are chained from underlying MSI-X vectors. We have |
| 372 | 394 | * these irq_chip functions to be able to handle level triggering |
| @@ -383,24 +405,50 @@ static struct irq_chip thunderx_gpio_irq_chip = { · 10 unmodified lines | ||
| 383 | 405 | .irq_unmask = thunderx_gpio_irq_unmask, |
| 384 | 406 | .irq_eoi = irq_chip_eoi_parent, |
| 385 | 407 | .irq_set_affinity = irq_chip_set_affinity_parent, |
| 408 | + .irq_request_resources = thunderx_gpio_irq_request_resources, | |
| 409 | + .irq_release_resources = thunderx_gpio_irq_release_resources, | |
| 386 | 410 | .irq_set_type = thunderx_gpio_irq_set_type, |
| 387 | 411 | |
| 388 | 412 | .flags = IRQCHIP_SET_TYPE_MASKED |
| 389 | 413 | }; |
| 390 | 414 | |
| 391 | −static int thunderx_gpio_child_to_parent_hwirq(struct gpio_chip *gc, | |
| 392 | − unsigned int child, | |
| 393 | − unsigned int child_type, | |
| 394 | − unsigned int *parent, | |
| 395 | − unsigned int *parent_type) | |
| 415 | +static int thunderx_gpio_irq_translate(struct irq_domain *d, | |
| 416 | + struct irq_fwspec *fwspec, | |
| 417 | + irq_hw_number_t *hwirq, | |
| 418 | + unsigned int *type) | |
| 396 | 419 | { |
| 397 | − struct thunderx_gpio *txgpio = gpiochip_get_data(gc); | |
| 398 | − | |
| 399 | − *parent = txgpio->base_msi + (2 * child); | |
| 400 | − *parent_type = IRQ_TYPE_LEVEL_HIGH; | |
| 420 | + struct thunderx_gpio *txgpio = d->host_data; | |
| 421 | + | |
| 422 | + if (WARN_ON(fwspec->param_count < 2)) | |
| 423 | + return -EINVAL; | |
| 424 | + if (fwspec->param[0] >= txgpio->chip.ngpio) | |
| 425 | + return -EINVAL; | |
| 426 | + *hwirq = fwspec->param[0]; | |
| 427 | + *type = fwspec->param[1] & IRQ_TYPE_SENSE_MASK; | |
| 401 | 428 | return 0; |
| 402 | 429 | } |
| 403 | 430 | |
| 431 | +static int thunderx_gpio_irq_alloc(struct irq_domain *d, unsigned int virq, | |
| 432 | + unsigned int nr_irqs, void *arg) | |
| 433 | +{ | |
| 434 | + struct thunderx_line *txline = arg; | |
| 435 | + | |
| 436 | + return irq_domain_set_hwirq_and_chip(d, virq, txline->line, | |
| 437 | + &thunderx_gpio_irq_chip, txline); | |
| 438 | +} | |
| 439 | + | |
| 440 | +static const struct irq_domain_ops thunderx_gpio_irqd_ops = { | |
| 441 | + .alloc = thunderx_gpio_irq_alloc, | |
| 442 | + .translate = thunderx_gpio_irq_translate | |
| 443 | +}; | |
| 444 | + | |
| 445 | +static int thunderx_gpio_to_irq(struct gpio_chip *chip, unsigned int offset) | |
| 446 | +{ | |
| 447 | + struct thunderx_gpio *txgpio = gpiochip_get_data(chip); | |
| 448 | + | |
| 449 | + return irq_find_mapping(txgpio->irqd, offset); | |
| 450 | +} | |
| 451 | + | |
| 404 | 452 | static int thunderx_gpio_probe(struct pci_dev *pdev, |
| 405 | 453 | const struct pci_device_id *id) |
| 406 | 454 | { |
| @@ -408,7 +456,6 @@ static int thunderx_gpio_probe(struct pci_dev *pdev, · 1 unmodified line | ||
| 408 | 456 | struct device *dev = &pdev->dev; |
| 409 | 457 | struct thunderx_gpio *txgpio; |
| 410 | 458 | struct gpio_chip *chip; |
| 411 | − struct gpio_irq_chip *girq; | |
| 412 | 459 | int ngpio, i; |
| 413 | 460 | int err = 0; |
| 414 | 461 | |
| @@ -453,8 +500,8 @@ static int thunderx_gpio_probe(struct pci_dev *pdev, · 38 unmodified lines | ||
| 453 | 500 | } |
| 454 | 501 | |
| 455 | 502 | txgpio->msix_entries = devm_kcalloc(dev, |
| 456 | − ngpio, sizeof(struct msix_entry), | |
| 457 | − GFP_KERNEL); | |
| 503 | + ngpio, sizeof(struct msix_entry), | |
| 504 | + GFP_KERNEL); | |
| 458 | 505 | if (!txgpio->msix_entries) { |
| 459 | 506 | err = -ENOMEM; |
| 460 | 507 | goto out; |
| @@ -495,6 +542,27 @@ static int thunderx_gpio_probe(struct pci_dev *pdev, · 34 unmodified lines | ||
| 495 | 542 | if (err < 0) |
| 496 | 543 | goto out; |
| 497 | 544 | |
| 545 | + /* | |
| 546 | + * Push GPIO specific irqdomain on hierarchy created as a side | |
| 547 | + * effect of the pci_enable_msix() | |
| 548 | + */ | |
| 549 | + txgpio->irqd = irq_domain_create_hierarchy(irq_get_irq_data(txgpio->msix_entries[0].vector)->domain, | |
| 550 | + 0, 0, of_node_to_fwnode(dev->of_node), | |
| 551 | + &thunderx_gpio_irqd_ops, txgpio); | |
| 552 | + if (!txgpio->irqd) { | |
| 553 | + err = -ENOMEM; | |
| 554 | + goto out; | |
| 555 | + } | |
| 556 | + | |
| 557 | + /* Push on irq_data and the domain for each line. */ | |
| 558 | + for (i = 0; i < ngpio; i++) { | |
| 559 | + err = irq_domain_push_irq(txgpio->irqd, | |
| 560 | + txgpio->msix_entries[i].vector, | |
| 561 | + &txgpio->line_entries[i]); | |
| 562 | + if (err < 0) | |
| 563 | + dev_err(dev, "irq_domain_push_irq: %d\n", err); | |
| 564 | + } | |
| 565 | + | |
| 498 | 566 | chip->label = KBUILD_MODNAME; |
| 499 | 567 | chip->parent = dev; |
| 500 | 568 | chip->owner = THIS_MODULE; |
| @@ -509,28 +577,11 @@ static int thunderx_gpio_probe(struct pci_dev *pdev, · 8 unmodified lines | ||
| 509 | 577 | chip->set = thunderx_gpio_set; |
| 510 | 578 | chip->set_multiple = thunderx_gpio_set_multiple; |
| 511 | 579 | chip->set_config = thunderx_gpio_set_config; |
| 512 | − girq = &chip->irq; | |
| 513 | − girq->chip = &thunderx_gpio_irq_chip; | |
| 514 | − girq->fwnode = of_node_to_fwnode(dev->of_node); | |
| 515 | − girq->parent_domain = | |
| 516 | − irq_get_irq_data(txgpio->msix_entries[0].vector)->domain; | |
| 517 | − girq->child_to_parent_hwirq = thunderx_gpio_child_to_parent_hwirq; | |
| 518 | − girq->handler = handle_bad_irq; | |
| 519 | − girq->default_type = IRQ_TYPE_NONE; | |
| 520 | − | |
| 580 | + chip->to_irq = thunderx_gpio_to_irq; | |
| 521 | 581 | err = devm_gpiochip_add_data(dev, chip, txgpio); |
| 522 | 582 | if (err) |
| 523 | 583 | goto out; |
| 524 | 584 | |
| 525 | − /* Push on irq_data and the domain for each line. */ | |
| 526 | − for (i = 0; i < ngpio; i++) { | |
| 527 | − err = irq_domain_push_irq(chip->irq.domain, | |
| 528 | − txgpio->msix_entries[i].vector, | |
| 529 | − chip); | |
| 530 | − if (err < 0) | |
| 531 | − dev_err(dev, "irq_domain_push_irq: %d\n", err); | |
| 532 | − } | |
| 533 | − | |
| 534 | 585 | dev_info(dev, "ThunderX GPIO: %d lines with base %d.\n", |
| 535 | 586 | ngpio, chip->base); |
| 536 | 587 | return 0; |
| @@ -545,10 +596,10 @@ static void thunderx_gpio_remove(struct pci_dev *pdev) · 8 unmodified lines | ||
| 545 | 596 | struct thunderx_gpio *txgpio = pci_get_drvdata(pdev); |
| 546 | 597 | |
| 547 | 598 | for (i = 0; i < txgpio->chip.ngpio; i++) |
| 548 | − irq_domain_pop_irq(txgpio->chip.irq.domain, | |
| 599 | + irq_domain_pop_irq(txgpio->irqd, | |
| 549 | 600 | txgpio->msix_entries[i].vector); |
| 550 | 601 | |
| 551 | − irq_domain_remove(txgpio->chip.irq.domain); | |
| 602 | + irq_domain_remove(txgpio->irqd); | |
| 552 | 603 | |
| 553 | 604 | pci_set_drvdata(pdev, NULL); |
| 554 | 605 | } |
| @@ -254,7 +254,7 @@ static const struct soc15_reg_golden golden_settings_sdma_4_3[] = { · 253 unmodified lines | ||
| 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, |
| @@ -817,8 +817,8 @@ static bool dc_link_detect_helper(struct dc_link *link, · 816 unmodified lines | ||
| 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; |
| @@ -1190,6 +1190,8 @@ static int drm_dp_mst_wait_tx_reply(struct drm_dp_mst_branch *mstb, · 1189 unmodified lines | ||
| 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)) { |
| @@ -1199,6 +1201,7 @@ out: · 3 unmodified lines | ||
| 1199 | 1201 | } |
| 1200 | 1202 | mutex_unlock(&mgr->qlock); |
| 1201 | 1203 | |
| 1204 | + drm_dp_mst_kick_tx(mgr); | |
| 1202 | 1205 | return ret; |
| 1203 | 1206 | } |
| 1204 | 1207 | |
| @@ -2318,7 +2321,7 @@ drm_dp_mst_handle_conn_stat(struct drm_dp_mst_branch *mstb, · 1113 unmodified lines | ||
| 2318 | 2321 | { |
| 2319 | 2322 | struct drm_dp_mst_topology_mgr *mgr = mstb->mgr; |
| 2320 | 2323 | struct drm_dp_mst_port *port; |
| 2321 | − int old_ddps, ret; | |
| 2324 | + int old_ddps, old_input, ret, i; | |
| 2322 | 2325 | u8 new_pdt; |
| 2323 | 2326 | bool dowork = false, create_connector = false; |
| 2324 | 2327 | |
| @@ -2349,6 +2352,7 @@ drm_dp_mst_handle_conn_stat(struct drm_dp_mst_branch *mstb, · 24 unmodified lines | ||
| 2349 | 2352 | } |
| 2350 | 2353 | |
| 2351 | 2354 | old_ddps = port->ddps; |
| 2355 | + old_input = port->input; | |
| 2352 | 2356 | port->input = conn_stat->input_port; |
| 2353 | 2357 | port->mcs = conn_stat->message_capability_status; |
| 2354 | 2358 | port->ldps = conn_stat->legacy_device_plug_status; |
| @@ -2373,6 +2377,28 @@ drm_dp_mst_handle_conn_stat(struct drm_dp_mst_branch *mstb, · 18 unmodified lines | ||
| 2373 | 2377 | dowork = false; |
| 2374 | 2378 | } |
| 2375 | 2379 | |
| 2380 | + if (!old_input && old_ddps != port->ddps && !port->ddps) { | |
| 2381 | + for (i = 0; i < mgr->max_payloads; i++) { | |
| 2382 | + struct drm_dp_vcpi *vcpi = mgr->proposed_vcpis[i]; | |
| 2383 | + struct drm_dp_mst_port *port_validated; | |
| 2384 | + | |
| 2385 | + if (!vcpi) | |
| 2386 | + continue; | |
| 2387 | + | |
| 2388 | + port_validated = | |
| 2389 | + container_of(vcpi, struct drm_dp_mst_port, vcpi); | |
| 2390 | + port_validated = | |
| 2391 | + drm_dp_mst_topology_get_port_validated(mgr, port_validated); | |
| 2392 | + if (!port_validated) { | |
| 2393 | + mutex_lock(&mgr->payload_lock); | |
| 2394 | + vcpi->num_slots = 0; | |
| 2395 | + mutex_unlock(&mgr->payload_lock); | |
| 2396 | + } else { | |
| 2397 | + drm_dp_mst_topology_put_port(port_validated); | |
| 2398 | + } | |
| 2399 | + } | |
| 2400 | + } | |
| 2401 | + | |
| 2376 | 2402 | if (port->connector) |
| 2377 | 2403 | drm_modeset_unlock(&mgr->base.lock); |
| 2378 | 2404 | else if (create_connector) |
| @@ -2718,9 +2744,11 @@ static void process_single_down_tx_qlock(struct drm_dp_mst_topology_mgr *mgr) · 339 unmodified lines | ||
| 2718 | 2744 | ret = process_single_tx_qlock(mgr, txmsg, false); |
| 2719 | 2745 | if (ret == 1) { |
| 2720 | 2746 | /* txmsg is sent it should be in the slots now */ |
| 2747 | + mgr->is_waiting_for_dwn_reply = true; | |
| 2721 | 2748 | list_del(&txmsg->next); |
| 2722 | 2749 | } else if (ret) { |
| 2723 | 2750 | DRM_DEBUG_KMS("failed to send msg in q %d\n", ret); |
| 2751 | + mgr->is_waiting_for_dwn_reply = false; | |
| 2724 | 2752 | list_del(&txmsg->next); |
| 2725 | 2753 | if (txmsg->seqno != -1) |
| 2726 | 2754 | txmsg->dst->tx_slots[txmsg->seqno] = NULL; |
| @@ -2760,7 +2788,8 @@ static void drm_dp_queue_down_tx(struct drm_dp_mst_topology_mgr *mgr, · 33 unmodified lines | ||
| 2760 | 2788 | drm_dp_mst_dump_sideband_msg_tx(&p, txmsg); |
| 2761 | 2789 | } |
| 2762 | 2790 | |
| 2763 | − if (list_is_singular(&mgr->tx_msg_downq)) | |
| 2791 | + if (list_is_singular(&mgr->tx_msg_downq) && | |
| 2792 | + !mgr->is_waiting_for_dwn_reply) | |
| 2764 | 2793 | process_single_down_tx_qlock(mgr); |
| 2765 | 2794 | mutex_unlock(&mgr->qlock); |
| 2766 | 2795 | } |
| @@ -3678,6 +3707,7 @@ static int drm_dp_mst_handle_down_rep(struct drm_dp_mst_topology_mgr *mgr) · 911 unmodified lines | ||
| 3678 | 3707 | mutex_lock(&mgr->qlock); |
| 3679 | 3708 | txmsg->state = DRM_DP_SIDEBAND_TX_RX; |
| 3680 | 3709 | mstb->tx_slots[slot] = NULL; |
| 3710 | + mgr->is_waiting_for_dwn_reply = false; | |
| 3681 | 3711 | mutex_unlock(&mgr->qlock); |
| 3682 | 3712 | |
| 3683 | 3713 | wake_up_all(&mgr->tx_waitq); |
| @@ -3687,6 +3717,9 @@ static int drm_dp_mst_handle_down_rep(struct drm_dp_mst_topology_mgr *mgr) · 3 unmodified lines | ||
| 3687 | 3717 | no_msg: |
| 3688 | 3718 | drm_dp_mst_topology_put_mstb(mstb); |
| 3689 | 3719 | clear_down_rep_recv: |
| 3720 | + mutex_lock(&mgr->qlock); | |
| 3721 | + mgr->is_waiting_for_dwn_reply = false; | |
| 3722 | + mutex_unlock(&mgr->qlock); | |
| 3690 | 3723 | memset(&mgr->down_rep_recv, 0, sizeof(struct drm_dp_sideband_msg_rx)); |
| 3691 | 3724 | |
| 3692 | 3725 | return 0; |
| @@ -4497,7 +4530,7 @@ static void drm_dp_tx_work(struct work_struct *work) · 804 unmodified lines | ||
| 4497 | 4530 | struct drm_dp_mst_topology_mgr *mgr = container_of(work, struct drm_dp_mst_topology_mgr, tx_work); |
| 4498 | 4531 | |
| 4499 | 4532 | mutex_lock(&mgr->qlock); |
| 4500 | − if (!list_empty(&mgr->tx_msg_downq)) | |
| 4533 | + if (!list_empty(&mgr->tx_msg_downq) && !mgr->is_waiting_for_dwn_reply) | |
| 4501 | 4534 | process_single_down_tx_qlock(mgr); |
| 4502 | 4535 | mutex_unlock(&mgr->qlock); |
| 4503 | 4536 | } |
| @@ -123,6 +123,10 @@ static int __context_pin_state(struct i915_vma *vma) · 122 unmodified lines | ||
| 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. |
| @@ -131,14 +135,44 @@ static int __context_pin_state(struct i915_vma *vma) · 2 unmodified lines | ||
| 131 | 135 | vma->obj->mm.dirty = true; |
| 132 | 136 | |
| 133 | 137 | return 0; |
| 138 | + | |
| 139 | +err_unpin: | |
| 140 | + i915_vma_unpin(vma); | |
| 141 | + return err; | |
| 134 | 142 | } |
| 135 | 143 | |
| 136 | 144 | static void __context_unpin_state(struct i915_vma *vma) |
| 137 | 145 | { |
| 138 | 146 | i915_vma_make_shrinkable(vma); |
| 147 | + i915_active_release(&vma->active); | |
| 139 | 148 | __i915_vma_unpin(vma); |
| 140 | 149 | } |
| 141 | 150 | |
| 151 | +static int __ring_active(struct intel_ring *ring) | |
| 152 | +{ | |
| 153 | + int err; | |
| 154 | + | |
| 155 | + err = i915_active_acquire(&ring->vma->active); | |
| 156 | + if (err) | |
| 157 | + return err; | |
| 158 | + | |
| 159 | + err = intel_ring_pin(ring); | |
| 160 | + if (err) | |
| 161 | + goto err_active; | |
| 162 | + | |
| 163 | + return 0; | |
| 164 | + | |
| 165 | +err_active: | |
| 166 | + i915_active_release(&ring->vma->active); | |
| 167 | + return err; | |
| 168 | +} | |
| 169 | + | |
| 170 | +static void __ring_retire(struct intel_ring *ring) | |
| 171 | +{ | |
| 172 | + intel_ring_unpin(ring); | |
| 173 | + i915_active_release(&ring->vma->active); | |
| 174 | +} | |
| 175 | + | |
| 142 | 176 | __i915_active_call |
| 143 | 177 | static void __intel_context_retire(struct i915_active *active) |
| 144 | 178 | { |
| @@ -151,7 +185,7 @@ static void __intel_context_retire(struct i915_active *active) · 6 unmodified lines | ||
| 151 | 185 | __context_unpin_state(ce->state); |
| 152 | 186 | |
| 153 | 187 | intel_timeline_unpin(ce->timeline); |
| 154 | − intel_ring_unpin(ce->ring); | |
| 188 | + __ring_retire(ce->ring); | |
| 155 | 189 | |
| 156 | 190 | intel_context_put(ce); |
| 157 | 191 | } |
| @@ -163,7 +197,7 @@ static int __intel_context_active(struct i915_active *active) · 5 unmodified lines | ||
| 163 | 197 | |
| 164 | 198 | intel_context_get(ce); |
| 165 | 199 | |
| 166 | − err = intel_ring_pin(ce->ring); | |
| 200 | + err = __ring_active(ce->ring); | |
| 167 | 201 | if (err) |
| 168 | 202 | goto err_put; |
| 169 | 203 | |
| @@ -183,7 +217,7 @@ static int __intel_context_active(struct i915_active *active) · 13 unmodified lines | ||
| 183 | 217 | err_timeline: |
| 184 | 218 | intel_timeline_unpin(ce->timeline); |
| 185 | 219 | err_ring: |
| 186 | − intel_ring_unpin(ce->ring); | |
| 220 | + __ring_retire(ce->ring); | |
| 187 | 221 | err_put: |
| 188 | 222 | intel_context_put(ce); |
| 189 | 223 | return err; |
| @@ -2664,6 +2664,14 @@ static u32 *gen9_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch) · 2663 unmodified lines | ||
| 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 */ |
| @@ -3304,7 +3304,7 @@ void i915_ggtt_disable_guc(struct i915_ggtt *ggtt) · 3303 unmodified lines | ||
| 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,15 +3319,12 @@ static void ggtt_restore_mappings(struct i915_ggtt *ggtt) · 8 unmodified lines | ||
| 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 | 3326 | continue; |
| 3327 | 3327 | |
| 3328 | − if (!__i915_vma_unbind(vma)) | |
| 3329 | − continue; | |
| 3330 | − | |
| 3331 | 3328 | clear_bit(I915_VMA_GLOBAL_BIND_BIT, __i915_vma_flags(vma)); |
| 3332 | 3329 | WARN_ON(i915_vma_bind(vma, |
| 3333 | 3330 | obj ? obj->cache_level : 0, |
| @@ -1074,12 +1074,17 @@ void i915_pmu_register(struct drm_i915_private *i915) · 1073 unmodified lines | ||
| 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 | |
| @@ -25,6 +25,7 @@ · 24 unmodified lines | ||
| 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" |
| @@ -95,7 +95,7 @@ struct cdn_dp_device { · 94 unmodified lines | ||
| 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 | |
| @@ -232,6 +232,7 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, · 231 unmodified lines | ||
| 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, |
| @@ -1132,7 +1132,6 @@ static void etm4_init_trace_id(struct etmv4_drvdata *drvdata) · 1131 unmodified lines | ||
| 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; |
| @@ -1402,17 +1401,17 @@ static struct notifier_block etm4_cpu_pm_nb = { · 263 unmodified lines | ||
| 1402 | 1401 | |
| 1403 | 1402 | static int etm4_cpu_pm_register(void) |
| 1404 | 1403 | { |
| 1405 | − return cpu_pm_register_notifier(&etm4_cpu_pm_nb); | |
| 1404 | + if (IS_ENABLED(CONFIG_CPU_PM)) | |
| 1405 | + return cpu_pm_register_notifier(&etm4_cpu_pm_nb); | |
| 1406 | + | |
| 1407 | + return 0; | |
| 1406 | 1408 | } |
| 1407 | 1409 | |
| 1408 | 1410 | static void etm4_cpu_pm_unregister(void) |
| 1409 | 1411 | { |
| 1410 | − cpu_pm_unregister_notifier(&etm4_cpu_pm_nb); | |
| 1412 | + if (IS_ENABLED(CONFIG_CPU_PM)) | |
| 1413 | + cpu_pm_unregister_notifier(&etm4_cpu_pm_nb); | |
| 1411 | 1414 | } |
| 1412 | −#else | |
| 1413 | −static int etm4_cpu_pm_register(void) { return 0; } | |
| 1414 | −static void etm4_cpu_pm_unregister(void) { } | |
| 1415 | −#endif | |
| 1416 | 1415 | |
| 1417 | 1416 | static int etm4_probe(struct amba_device *adev, const struct amba_id *id) |
| 1418 | 1417 | { |
| @@ -433,13 +433,17 @@ iop3xx_i2c_probe(struct platform_device *pdev) · 432 unmodified lines | ||
| 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) { |
| @@ -1608,14 +1608,18 @@ static int tegra_i2c_probe(struct platform_device *pdev) · 1607 unmodified lines | ||
| 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) { |
| @@ -1623,7 +1627,7 @@ static int tegra_i2c_probe(struct platform_device *pdev) · 1 unmodified line | ||
| 1623 | 1627 | if (ret < 0) { |
| 1624 | 1628 | dev_err(i2c_dev->dev, "div_clk enable failed %d\n", |
| 1625 | 1629 | ret); |
| 1626 | − goto disable_rpm; | |
| 1630 | + goto put_rpm; | |
| 1627 | 1631 | } |
| 1628 | 1632 | } |
| 1629 | 1633 | |
| @@ -1671,11 +1675,16 @@ disable_div_clk: · 41 unmodified lines | ||
| 1671 | 1675 | if (i2c_dev->is_multimaster_mode) |
| 1672 | 1676 | clk_disable(i2c_dev->div_clk); |
| 1673 | 1677 | |
| 1674 | −disable_rpm: | |
| 1675 | − pm_runtime_disable(&pdev->dev); | |
| 1676 | − if (!pm_runtime_status_suspended(&pdev->dev)) | |
| 1678 | +put_rpm: | |
| 1679 | + if (pm_runtime_enabled(&pdev->dev)) | |
| 1680 | + pm_runtime_put_sync(&pdev->dev); | |
| 1681 | + else | |
| 1677 | 1682 | tegra_i2c_runtime_suspend(&pdev->dev); |
| 1678 | 1683 | |
| 1684 | +disable_rpm: | |
| 1685 | + if (pm_runtime_enabled(&pdev->dev)) | |
| 1686 | + pm_runtime_disable(&pdev->dev); | |
| 1687 | + | |
| 1679 | 1688 | unprepare_div_clk: |
| 1680 | 1689 | clk_unprepare(i2c_dev->div_clk); |
| 1681 | 1690 | |
| @@ -1710,9 +1719,14 @@ static int tegra_i2c_remove(struct platform_device *pdev) · 28 unmodified lines | ||
| 1710 | 1719 | static int __maybe_unused tegra_i2c_suspend(struct device *dev) |
| 1711 | 1720 | { |
| 1712 | 1721 | struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev); |
| 1722 | + int err; | |
| 1713 | 1723 | |
| 1714 | 1724 | i2c_mark_adapter_suspended(&i2c_dev->adapter); |
| 1715 | 1725 | |
| 1726 | + err = pm_runtime_force_suspend(dev); | |
| 1727 | + if (err < 0) | |
| 1728 | + return err; | |
| 1729 | + | |
| 1716 | 1730 | return 0; |
| 1717 | 1731 | } |
| 1718 | 1732 | |
| @@ -1733,6 +1747,10 @@ static int __maybe_unused tegra_i2c_resume(struct device *dev) · 14 unmodified lines | ||
| 1733 | 1747 | if (err) |
| 1734 | 1748 | return err; |
| 1735 | 1749 | |
| 1750 | + err = pm_runtime_force_resume(dev); | |
| 1751 | + if (err < 0) | |
| 1752 | + return err; | |
| 1753 | + | |
| 1736 | 1754 | i2c_mark_adapter_resumed(&i2c_dev->adapter); |
| 1737 | 1755 | |
| 1738 | 1756 | return 0; |
| @@ -494,13 +494,11 @@ static int ad7124_of_parse_channel_config(struct iio_dev *indio_dev, · 493 unmodified lines | ||
| 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; |
| @@ -65,6 +65,7 @@ config IAQCORE · 64 unmodified lines | ||
| 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 |
| @@ -1301,7 +1301,8 @@ static int st_lsm6dsx_check_whoami(struct st_lsm6dsx_hw *hw, int id, · 1300 unmodified lines | ||
| 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) |
| @@ -566,7 +566,7 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, · 565 unmodified lines | ||
| 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,13 +574,17 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, · 1 unmodified line | ||
| 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 | |
| @@ -163,7 +163,6 @@ static int vcnl4200_init(struct vcnl4000_data *data) · 162 unmodified lines | ||
| 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) { |
| @@ -172,11 +171,13 @@ static int vcnl4200_init(struct vcnl4000_data *data) · 2 unmodified lines | ||
| 172 | 171 | /* show 54ms in total. */ |
| 173 | 172 | data->vcnl4200_al.sampling_rate = ktime_set(0, 54000 * 1000); |
| 174 | 173 | data->vcnl4200_ps.sampling_rate = ktime_set(0, 4200 * 1000); |
| 174 | + data->al_scale = 24000; | |
| 175 | 175 | break; |
| 176 | 176 | case VCNL4040_PROD_ID: |
| 177 | 177 | /* Integration time is 80ms, add 10ms. */ |
| 178 | 178 | data->vcnl4200_al.sampling_rate = ktime_set(0, 100000 * 1000); |
| 179 | 179 | data->vcnl4200_ps.sampling_rate = ktime_set(0, 100000 * 1000); |
| 180 | + data->al_scale = 120000; | |
| 180 | 181 | break; |
| 181 | 182 | } |
| 182 | 183 | data->vcnl4200_al.last_measurement = ktime_set(0, 0); |
| @@ -17,7 +17,6 @@ · 16 unmodified lines | ||
| 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; |
| @@ -50,7 +49,7 @@ static irqreturn_t intc_cascade(int irq, void *data) · 26 unmodified lines | ||
| 50 | 49 | while (pending) { |
| 51 | 50 | int bit = __fls(pending); |
| 52 | 51 | |
| 53 | − irq = irq_find_mapping(domain, bit + (i * 32)); | |
| 52 | + irq = irq_linear_revmap(domain, bit + (i * 32)); | |
| 54 | 53 | generic_handle_irq(irq); |
| 55 | 54 | pending &= ~BIT(bit); |
| 56 | 55 | } |
| @@ -97,8 +96,7 @@ static int __init ingenic_intc_of_init(struct device_node *node, · 40 unmodified lines | ||
| 97 | 96 | goto out_unmap_irq; |
| 98 | 97 | } |
| 99 | 98 | |
| 100 | − domain = irq_domain_add_legacy(node, num_chips * 32, | |
| 101 | − JZ4740_IRQ_BASE, 0, | |
| 99 | + domain = irq_domain_add_linear(node, num_chips * 32, | |
| 102 | 100 | &irq_generic_chip_ops, NULL); |
| 103 | 101 | if (!domain) { |
| 104 | 102 | err = -ENOMEM; |
| @@ -17,7 +17,7 @@ · 16 unmodified lines | ||
| 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 | |
| @@ -87,7 +87,7 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf) · 86 unmodified lines | ||
| 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) |
| @@ -100,19 +100,19 @@ struct buflist { · 99 unmodified lines | ||
| 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); | |
| 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); | |
| 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 | + | |
| 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,8 +123,8 @@ static long compat_mpctl_ioctl(struct file *f, unsigned cmd, unsigned long arg); · 4 unmodified lines | ||
| 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,19 +656,19 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 525 unmodified lines | ||
| 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,15 +678,15 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 3 unmodified lines | ||
| 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,11 +705,10 @@ mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 12 unmodified lines | ||
| 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 - " |
| @@ -718,12 +717,6 @@ static int mptctl_do_reset(unsigned long arg) · 2 unmodified lines | ||
| 718 | 717 | return -EFAULT; |
| 719 | 718 | } |
| 720 | 719 | |
| 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 | − } | |
| 726 | − | |
| 727 | 720 | dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "mptctl_do_reset called.\n", |
| 728 | 721 | iocp->name)); |
| 729 | 722 | |
| @@ -754,7 +747,7 @@ static int mptctl_do_reset(unsigned long arg) · 24 unmodified lines | ||
| 754 | 747 | * -ENOMSG if FW upload returned bad status |
| 755 | 748 | */ |
| 756 | 749 | static int |
| 757 | −mptctl_fw_download(unsigned long arg) | |
| 750 | +mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg) | |
| 758 | 751 | { |
| 759 | 752 | struct mpt_fw_xfer __user *ufwdl = (void __user *) arg; |
| 760 | 753 | struct mpt_fw_xfer kfwdl; |
| @@ -766,7 +759,7 @@ mptctl_fw_download(unsigned long arg) · 5 unmodified lines | ||
| 766 | 759 | return -EFAULT; |
| 767 | 760 | } |
| 768 | 761 | |
| 769 | − return mptctl_do_fw_download(kfwdl.iocnum, kfwdl.bufp, kfwdl.fwlen); | |
| 762 | + return mptctl_do_fw_download(iocp, kfwdl.bufp, kfwdl.fwlen); | |
| 770 | 763 | } |
| 771 | 764 | |
| 772 | 765 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| @@ -784,11 +777,10 @@ mptctl_fw_download(unsigned long arg) · 11 unmodified lines | ||
| 784 | 777 | * -ENOMSG if FW upload returned bad status |
| 785 | 778 | */ |
| 786 | 779 | static int |
| 787 | −mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) | |
| 780 | +mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen) | |
| 788 | 781 | { |
| 789 | 782 | FWDownload_t *dlmsg; |
| 790 | 783 | MPT_FRAME_HDR *mf; |
| 791 | − MPT_ADAPTER *iocp; | |
| 792 | 784 | FWDownloadTCSGE_t *ptsge; |
| 793 | 785 | MptSge_t *sgl, *sgIn; |
| 794 | 786 | char *sgOut; |
| @@ -808,17 +800,10 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) · 13 unmodified lines | ||
| 808 | 800 | pFWDownloadReply_t ReplyMsg = NULL; |
| 809 | 801 | unsigned long timeleft; |
| 810 | 802 | |
| 811 | − if (mpt_verify_adapter(ioc, &iocp) < 0) { | |
| 812 | − printk(KERN_DEBUG MYNAM "ioctl_fwdl - ioc%d not found!\n", | |
| 813 | − ioc); | |
| 814 | − return -ENODEV; /* (-6) No such device or address */ | |
| 815 | − } else { | |
| 816 | − | |
| 817 | − /* Valid device. Get a message frame and construct the FW download message. | |
| 818 | − */ | |
| 819 | − if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL) | |
| 820 | − return -EAGAIN; | |
| 821 | − } | |
| 803 | + /* Valid device. Get a message frame and construct the FW download message. | |
| 804 | + */ | |
| 805 | + if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL) | |
| 806 | + return -EAGAIN; | |
| 822 | 807 | |
| 823 | 808 | dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT |
| 824 | 809 | "mptctl_do_fwdl called. mptctl_id = %xh.\n", iocp->name, mptctl_id)); |
| @@ -826,8 +811,6 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) · 1 unmodified line | ||
| 826 | 811 | iocp->name, ufwbuf)); |
| 827 | 812 | dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.fwlen = %d\n", |
| 828 | 813 | iocp->name, (int)fwlen)); |
| 829 | − dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.ioc = %04xh\n", | |
| 830 | − iocp->name, ioc)); | |
| 831 | 814 | |
| 832 | 815 | dlmsg = (FWDownload_t*) mf; |
| 833 | 816 | ptsge = (FWDownloadTCSGE_t *) &dlmsg->SGL; |
| @@ -1238,13 +1221,11 @@ kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma, struct buflist *buflist, MPT_ADAPTE · 404 unmodified lines | ||
| 1238 | 1221 | * -ENODEV if no such device/adapter |
| 1239 | 1222 | */ |
| 1240 | 1223 | static int |
| 1241 | −mptctl_getiocinfo (unsigned long arg, unsigned int data_size) | |
| 1224 | +mptctl_getiocinfo (MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size) | |
| 1242 | 1225 | { |
| 1243 | 1226 | struct mpt_ioctl_iocinfo __user *uarg = (void __user *) arg; |
| 1244 | 1227 | struct mpt_ioctl_iocinfo *karg; |
| 1245 | − MPT_ADAPTER *ioc; | |
| 1246 | 1228 | struct pci_dev *pdev; |
| 1247 | − int iocnum; | |
| 1248 | 1229 | unsigned int port; |
| 1249 | 1230 | int cim_rev; |
| 1250 | 1231 | struct scsi_device *sdev; |
| @@ -1272,14 +1253,6 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size) · 21 unmodified lines | ||
| 1272 | 1253 | return PTR_ERR(karg); |
| 1273 | 1254 | } |
| 1274 | 1255 | |
| 1275 | − if (((iocnum = mpt_verify_adapter(karg->hdr.iocnum, &ioc)) < 0) || | |
| 1276 | − (ioc == NULL)) { | |
| 1277 | − printk(KERN_DEBUG MYNAM "%s::mptctl_getiocinfo() @%d - ioc%d not found!\n", | |
| 1278 | − __FILE__, __LINE__, iocnum); | |
| 1279 | − kfree(karg); | |
| 1280 | − return -ENODEV; | |
| 1281 | − } | |
| 1282 | − | |
| 1283 | 1256 | /* Verify the data transfer size is correct. */ |
| 1284 | 1257 | if (karg->hdr.maxDataSize != data_size) { |
| 1285 | 1258 | printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_getiocinfo - " |
| @@ -1385,15 +1358,13 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size) · 99 unmodified lines | ||
| 1385 | 1358 | * -ENODEV if no such device/adapter |
| 1386 | 1359 | */ |
| 1387 | 1360 | static int |
| 1388 | −mptctl_gettargetinfo (unsigned long arg) | |
| 1361 | +mptctl_gettargetinfo (MPT_ADAPTER *ioc, unsigned long arg) | |
| 1389 | 1362 | { |
| 1390 | 1363 | struct mpt_ioctl_targetinfo __user *uarg = (void __user *) arg; |
| 1391 | 1364 | struct mpt_ioctl_targetinfo karg; |
| 1392 | − MPT_ADAPTER *ioc; | |
| 1393 | 1365 | VirtDevice *vdevice; |
| 1394 | 1366 | char *pmem; |
| 1395 | 1367 | int *pdata; |
| 1396 | − int iocnum; | |
| 1397 | 1368 | int numDevices = 0; |
| 1398 | 1369 | int lun; |
| 1399 | 1370 | int maxWordsLeft; |
| @@ -1408,13 +1379,6 @@ mptctl_gettargetinfo (unsigned long arg) · 8 unmodified lines | ||
| 1408 | 1379 | return -EFAULT; |
| 1409 | 1380 | } |
| 1410 | 1381 | |
| 1411 | − if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || | |
| 1412 | − (ioc == NULL)) { | |
| 1413 | − printk(KERN_DEBUG MYNAM "%s::mptctl_gettargetinfo() @%d - ioc%d not found!\n", | |
| 1414 | − __FILE__, __LINE__, iocnum); | |
| 1415 | − return -ENODEV; | |
| 1416 | − } | |
| 1417 | − | |
| 1418 | 1382 | dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_gettargetinfo called.\n", |
| 1419 | 1383 | ioc->name)); |
| 1420 | 1384 | /* Get the port number and set the maximum number of bytes |
| @@ -1510,12 +1474,10 @@ mptctl_gettargetinfo (unsigned long arg) · 89 unmodified lines | ||
| 1510 | 1474 | * -ENODEV if no such device/adapter |
| 1511 | 1475 | */ |
| 1512 | 1476 | static int |
| 1513 | −mptctl_readtest (unsigned long arg) | |
| 1477 | +mptctl_readtest (MPT_ADAPTER *ioc, unsigned long arg) | |
| 1514 | 1478 | { |
| 1515 | 1479 | struct mpt_ioctl_test __user *uarg = (void __user *) arg; |
| 1516 | 1480 | struct mpt_ioctl_test karg; |
| 1517 | − MPT_ADAPTER *ioc; | |
| 1518 | − int iocnum; | |
| 1519 | 1481 | |
| 1520 | 1482 | if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) { |
| 1521 | 1483 | printk(KERN_ERR MYNAM "%s@%d::mptctl_readtest - " |
| @@ -1524,13 +1486,6 @@ mptctl_readtest (unsigned long arg) · 2 unmodified lines | ||
| 1524 | 1486 | return -EFAULT; |
| 1525 | 1487 | } |
| 1526 | 1488 | |
| 1527 | − if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || | |
| 1528 | − (ioc == NULL)) { | |
| 1529 | − printk(KERN_DEBUG MYNAM "%s::mptctl_readtest() @%d - ioc%d not found!\n", | |
| 1530 | − __FILE__, __LINE__, iocnum); | |
| 1531 | − return -ENODEV; | |
| 1532 | − } | |
| 1533 | − | |
| 1534 | 1489 | dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_readtest called.\n", |
| 1535 | 1490 | ioc->name)); |
| 1536 | 1491 | /* Fill in the data and return the structure to the calling |
| @@ -1571,12 +1526,10 @@ mptctl_readtest (unsigned long arg) · 34 unmodified lines | ||
| 1571 | 1526 | * -ENODEV if no such device/adapter |
| 1572 | 1527 | */ |
| 1573 | 1528 | static int |
| 1574 | −mptctl_eventquery (unsigned long arg) | |
| 1529 | +mptctl_eventquery (MPT_ADAPTER *ioc, unsigned long arg) | |
| 1575 | 1530 | { |
| 1576 | 1531 | struct mpt_ioctl_eventquery __user *uarg = (void __user *) arg; |
| 1577 | 1532 | struct mpt_ioctl_eventquery karg; |
| 1578 | − MPT_ADAPTER *ioc; | |
| 1579 | − int iocnum; | |
| 1580 | 1533 | |
| 1581 | 1534 | if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) { |
| 1582 | 1535 | printk(KERN_ERR MYNAM "%s@%d::mptctl_eventquery - " |
| @@ -1585,13 +1538,6 @@ mptctl_eventquery (unsigned long arg) · 2 unmodified lines | ||
| 1585 | 1538 | return -EFAULT; |
| 1586 | 1539 | } |
| 1587 | 1540 | |
| 1588 | − if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || | |
| 1589 | − (ioc == NULL)) { | |
| 1590 | − printk(KERN_DEBUG MYNAM "%s::mptctl_eventquery() @%d - ioc%d not found!\n", | |
| 1591 | − __FILE__, __LINE__, iocnum); | |
| 1592 | − return -ENODEV; | |
| 1593 | − } | |
| 1594 | − | |
| 1595 | 1541 | dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventquery called.\n", |
| 1596 | 1542 | ioc->name)); |
| 1597 | 1543 | karg.eventEntries = MPTCTL_EVENT_LOG_SIZE; |
| @@ -1610,12 +1556,10 @@ mptctl_eventquery (unsigned long arg) · 12 unmodified lines | ||
| 1610 | 1556 | |
| 1611 | 1557 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| 1612 | 1558 | static int |
| 1613 | −mptctl_eventenable (unsigned long arg) | |
| 1559 | +mptctl_eventenable (MPT_ADAPTER *ioc, unsigned long arg) | |
| 1614 | 1560 | { |
| 1615 | 1561 | struct mpt_ioctl_eventenable __user *uarg = (void __user *) arg; |
| 1616 | 1562 | struct mpt_ioctl_eventenable karg; |
| 1617 | − MPT_ADAPTER *ioc; | |
| 1618 | − int iocnum; | |
| 1619 | 1563 | |
| 1620 | 1564 | if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) { |
| 1621 | 1565 | printk(KERN_ERR MYNAM "%s@%d::mptctl_eventenable - " |
| @@ -1624,13 +1568,6 @@ mptctl_eventenable (unsigned long arg) · 2 unmodified lines | ||
| 1624 | 1568 | return -EFAULT; |
| 1625 | 1569 | } |
| 1626 | 1570 | |
| 1627 | − if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || | |
| 1628 | − (ioc == NULL)) { | |
| 1629 | − printk(KERN_DEBUG MYNAM "%s::mptctl_eventenable() @%d - ioc%d not found!\n", | |
| 1630 | − __FILE__, __LINE__, iocnum); | |
| 1631 | − return -ENODEV; | |
| 1632 | − } | |
| 1633 | − | |
| 1634 | 1571 | dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventenable called.\n", |
| 1635 | 1572 | ioc->name)); |
| 1636 | 1573 | if (ioc->events == NULL) { |
| @@ -1658,12 +1595,10 @@ mptctl_eventenable (unsigned long arg) · 21 unmodified lines | ||
| 1658 | 1595 | |
| 1659 | 1596 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| 1660 | 1597 | static int |
| 1661 | −mptctl_eventreport (unsigned long arg) | |
| 1598 | +mptctl_eventreport (MPT_ADAPTER *ioc, unsigned long arg) | |
| 1662 | 1599 | { |
| 1663 | 1600 | struct mpt_ioctl_eventreport __user *uarg = (void __user *) arg; |
| 1664 | 1601 | struct mpt_ioctl_eventreport karg; |
| 1665 | − MPT_ADAPTER *ioc; | |
| 1666 | − int iocnum; | |
| 1667 | 1602 | int numBytes, maxEvents, max; |
| 1668 | 1603 | |
| 1669 | 1604 | if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) { |
| @@ -1673,12 +1608,6 @@ mptctl_eventreport (unsigned long arg) · 3 unmodified lines | ||
| 1673 | 1608 | return -EFAULT; |
| 1674 | 1609 | } |
| 1675 | 1610 | |
| 1676 | − if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || | |
| 1677 | − (ioc == NULL)) { | |
| 1678 | − printk(KERN_DEBUG MYNAM "%s::mptctl_eventreport() @%d - ioc%d not found!\n", | |
| 1679 | − __FILE__, __LINE__, iocnum); | |
| 1680 | − return -ENODEV; | |
| 1681 | − } | |
| 1682 | 1611 | dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventreport called.\n", |
| 1683 | 1612 | ioc->name)); |
| 1684 | 1613 | |
| @@ -1712,12 +1641,10 @@ mptctl_eventreport (unsigned long arg) · 27 unmodified lines | ||
| 1712 | 1641 | |
| 1713 | 1642 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| 1714 | 1643 | static int |
| 1715 | −mptctl_replace_fw (unsigned long arg) | |
| 1644 | +mptctl_replace_fw (MPT_ADAPTER *ioc, unsigned long arg) | |
| 1716 | 1645 | { |
| 1717 | 1646 | struct mpt_ioctl_replace_fw __user *uarg = (void __user *) arg; |
| 1718 | 1647 | struct mpt_ioctl_replace_fw karg; |
| 1719 | − MPT_ADAPTER *ioc; | |
| 1720 | − int iocnum; | |
| 1721 | 1648 | int newFwSize; |
| 1722 | 1649 | |
| 1723 | 1650 | if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) { |
| @@ -1727,13 +1654,6 @@ mptctl_replace_fw (unsigned long arg) · 3 unmodified lines | ||
| 1727 | 1654 | return -EFAULT; |
| 1728 | 1655 | } |
| 1729 | 1656 | |
| 1730 | − if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || | |
| 1731 | − (ioc == NULL)) { | |
| 1732 | − printk(KERN_DEBUG MYNAM "%s::mptctl_replace_fw() @%d - ioc%d not found!\n", | |
| 1733 | − __FILE__, __LINE__, iocnum); | |
| 1734 | − return -ENODEV; | |
| 1735 | − } | |
| 1736 | − | |
| 1737 | 1657 | dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_replace_fw called.\n", |
| 1738 | 1658 | ioc->name)); |
| 1739 | 1659 | /* If caching FW, Free the old FW image |
| @@ -1780,12 +1700,10 @@ mptctl_replace_fw (unsigned long arg) · 40 unmodified lines | ||
| 1780 | 1700 | * -ENOMEM if memory allocation error |
| 1781 | 1701 | */ |
| 1782 | 1702 | static int |
| 1783 | −mptctl_mpt_command (unsigned long arg) | |
| 1703 | +mptctl_mpt_command (MPT_ADAPTER *ioc, unsigned long arg) | |
| 1784 | 1704 | { |
| 1785 | 1705 | struct mpt_ioctl_command __user *uarg = (void __user *) arg; |
| 1786 | 1706 | struct mpt_ioctl_command karg; |
| 1787 | − MPT_ADAPTER *ioc; | |
| 1788 | − int iocnum; | |
| 1789 | 1707 | int rc; |
| 1790 | 1708 | |
| 1791 | 1709 | |
| @@ -1796,14 +1714,7 @@ mptctl_mpt_command (unsigned long arg) · 4 unmodified lines | ||
| 1796 | 1714 | return -EFAULT; |
| 1797 | 1715 | } |
| 1798 | 1716 | |
| 1799 | − if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || | |
| 1800 | − (ioc == NULL)) { | |
| 1801 | − printk(KERN_DEBUG MYNAM "%s::mptctl_mpt_command() @%d - ioc%d not found!\n", | |
| 1802 | − __FILE__, __LINE__, iocnum); | |
| 1803 | − return -ENODEV; | |
| 1804 | − } | |
| 1805 | − | |
| 1806 | − rc = mptctl_do_mpt_command (karg, &uarg->MF); | |
| 1717 | + rc = mptctl_do_mpt_command (ioc, karg, &uarg->MF); | |
| 1807 | 1718 | |
| 1808 | 1719 | return rc; |
| 1809 | 1720 | } |
| @@ -1821,9 +1732,8 @@ mptctl_mpt_command (unsigned long arg) · 11 unmodified lines | ||
| 1821 | 1732 | * -EPERM if SCSI I/O and target is untagged |
| 1822 | 1733 | */ |
| 1823 | 1734 | static int |
| 1824 | −mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) | |
| 1735 | +mptctl_do_mpt_command (MPT_ADAPTER *ioc, struct mpt_ioctl_command karg, void __user *mfPtr) | |
| 1825 | 1736 | { |
| 1826 | − MPT_ADAPTER *ioc; | |
| 1827 | 1737 | MPT_FRAME_HDR *mf = NULL; |
| 1828 | 1738 | MPIHeader_t *hdr; |
| 1829 | 1739 | char *psge; |
| @@ -1832,7 +1742,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) · 2 unmodified lines | ||
| 1832 | 1742 | dma_addr_t dma_addr_in; |
| 1833 | 1743 | dma_addr_t dma_addr_out; |
| 1834 | 1744 | int sgSize = 0; /* Num SG elements */ |
| 1835 | − int iocnum, flagsLength; | |
| 1745 | + int flagsLength; | |
| 1836 | 1746 | int sz, rc = 0; |
| 1837 | 1747 | int msgContext; |
| 1838 | 1748 | u16 req_idx; |
| @@ -1847,13 +1757,6 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) · 8 unmodified lines | ||
| 1847 | 1757 | bufIn.kptr = bufOut.kptr = NULL; |
| 1848 | 1758 | bufIn.len = bufOut.len = 0; |
| 1849 | 1759 | |
| 1850 | − if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || | |
| 1851 | − (ioc == NULL)) { | |
| 1852 | − printk(KERN_DEBUG MYNAM "%s::mptctl_do_mpt_command() @%d - ioc%d not found!\n", | |
| 1853 | − __FILE__, __LINE__, iocnum); | |
| 1854 | − return -ENODEV; | |
| 1855 | − } | |
| 1856 | − | |
| 1857 | 1760 | spin_lock_irqsave(&ioc->taskmgmt_lock, flags); |
| 1858 | 1761 | if (ioc->ioc_reset_in_progress) { |
| 1859 | 1762 | spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags); |
| @@ -2418,17 +2321,15 @@ done_free_mem: · 558 unmodified lines | ||
| 2418 | 2321 | * -ENOMEM if memory allocation error |
| 2419 | 2322 | */ |
| 2420 | 2323 | static int |
| 2421 | −mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size) | |
| 2324 | +mptctl_hp_hostinfo(MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size) | |
| 2422 | 2325 | { |
| 2423 | 2326 | hp_host_info_t __user *uarg = (void __user *) arg; |
| 2424 | − MPT_ADAPTER *ioc; | |
| 2425 | 2327 | struct pci_dev *pdev; |
| 2426 | 2328 | char *pbuf=NULL; |
| 2427 | 2329 | dma_addr_t buf_dma; |
| 2428 | 2330 | hp_host_info_t karg; |
| 2429 | 2331 | CONFIGPARMS cfg; |
| 2430 | 2332 | ConfigPageHeader_t hdr; |
| 2431 | − int iocnum; | |
| 2432 | 2333 | int rc, cim_rev; |
| 2433 | 2334 | ToolboxIstwiReadWriteRequest_t *IstwiRWRequest; |
| 2434 | 2335 | MPT_FRAME_HDR *mf = NULL; |
| @@ -2452,12 +2353,6 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size) · 17 unmodified lines | ||
| 2452 | 2353 | return -EFAULT; |
| 2453 | 2354 | } |
| 2454 | 2355 | |
| 2455 | − if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || | |
| 2456 | − (ioc == NULL)) { | |
| 2457 | − printk(KERN_DEBUG MYNAM "%s::mptctl_hp_hostinfo() @%d - ioc%d not found!\n", | |
| 2458 | − __FILE__, __LINE__, iocnum); | |
| 2459 | − return -ENODEV; | |
| 2460 | − } | |
| 2461 | 2356 | dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT ": mptctl_hp_hostinfo called.\n", |
| 2462 | 2357 | ioc->name)); |
| 2463 | 2358 | |
| @@ -2659,15 +2554,13 @@ retry_wait: · 195 unmodified lines | ||
| 2659 | 2554 | * -ENOMEM if memory allocation error |
| 2660 | 2555 | */ |
| 2661 | 2556 | static int |
| 2662 | −mptctl_hp_targetinfo(unsigned long arg) | |
| 2557 | +mptctl_hp_targetinfo(MPT_ADAPTER *ioc, unsigned long arg) | |
| 2663 | 2558 | { |
| 2664 | 2559 | hp_target_info_t __user *uarg = (void __user *) arg; |
| 2665 | 2560 | SCSIDevicePage0_t *pg0_alloc; |
| 2666 | 2561 | SCSIDevicePage3_t *pg3_alloc; |
| 2667 | − MPT_ADAPTER *ioc; | |
| 2668 | 2562 | MPT_SCSI_HOST *hd = NULL; |
| 2669 | 2563 | hp_target_info_t karg; |
| 2670 | − int iocnum; | |
| 2671 | 2564 | int data_sz; |
| 2672 | 2565 | dma_addr_t page_dma; |
| 2673 | 2566 | CONFIGPARMS cfg; |
| @@ -2681,12 +2574,6 @@ mptctl_hp_targetinfo(unsigned long arg) · 7 unmodified lines | ||
| 2681 | 2574 | return -EFAULT; |
| 2682 | 2575 | } |
| 2683 | 2576 | |
| 2684 | − if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) || | |
| 2685 | − (ioc == NULL)) { | |
| 2686 | − printk(KERN_DEBUG MYNAM "%s::mptctl_hp_targetinfo() @%d - ioc%d not found!\n", | |
| 2687 | − __FILE__, __LINE__, iocnum); | |
| 2688 | − return -ENODEV; | |
| 2689 | − } | |
| 2690 | 2577 | if (karg.hdr.id >= MPT_MAX_FC_DEVICES) |
| 2691 | 2578 | return -EINVAL; |
| 2692 | 2579 | dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_hp_targetinfo called.\n", |
| @@ -2854,7 +2741,7 @@ compat_mptfwxfer_ioctl(struct file *filp, unsigned int cmd, · 161 unmodified lines | ||
| 2854 | 2741 | kfw.fwlen = kfw32.fwlen; |
| 2855 | 2742 | kfw.bufp = compat_ptr(kfw32.bufp); |
| 2856 | 2743 | |
| 2857 | − ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen); | |
| 2744 | + ret = mptctl_do_fw_download(iocp, kfw.bufp, kfw.fwlen); | |
| 2858 | 2745 | |
| 2859 | 2746 | mutex_unlock(&iocp->ioctl_cmds.mutex); |
| 2860 | 2747 | |
| @@ -2908,7 +2795,7 @@ compat_mpt_command(struct file *filp, unsigned int cmd, · 47 unmodified lines | ||
| 2908 | 2795 | |
| 2909 | 2796 | /* Pass new structure to do_mpt_command |
| 2910 | 2797 | */ |
| 2911 | − ret = mptctl_do_mpt_command (karg, &uarg->MF); | |
| 2798 | + ret = mptctl_do_mpt_command (iocp, karg, &uarg->MF); | |
| 2912 | 2799 | |
| 2913 | 2800 | mutex_unlock(&iocp->ioctl_cmds.mutex); |
| 2914 | 2801 | |
| @@ -406,10 +406,9 @@ int enclosure_remove_device(struct enclosure_device *edev, struct device *dev) · 405 unmodified lines | ||
| 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; |
| @@ -278,7 +278,7 @@ void lkdtm_STACK_GUARD_PAGE_TRAILING(void) · 277 unmodified lines | ||
| 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,13 +338,13 @@ void lkdtm_UNSET_SMEP(void) · 53 unmodified lines | ||
| 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,6 +373,8 @@ void lkdtm_DOUBLE_FAULT(void) · 22 unmodified lines | ||
| 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 | +} | |
| @@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_data *this) · 147 unmodified lines | ||
| 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; |
| @@ -179,8 +183,9 @@ static int gpmi_init(struct gpmi_nand_data *this) · 25 unmodified lines | ||
| 179 | 183 | */ |
| 180 | 184 | writel(BM_GPMI_CTRL1_DECOUPLE_CS, r->gpmi_regs + HW_GPMI_CTRL1_SET); |
| 181 | 185 | |
| 182 | − return 0; | |
| 183 | 186 | err_out: |
| 187 | + pm_runtime_mark_last_busy(this->dev); | |
| 188 | + pm_runtime_put_autosuspend(this->dev); | |
| 184 | 189 | return ret; |
| 185 | 190 | } |
| 186 | 191 | |
| @@ -2722,6 +2727,10 @@ static int gpmi_pm_resume(struct device *dev) · 2535 unmodified lines | ||
| 2722 | 2727 | return ret; |
| 2723 | 2728 | } |
| 2724 | 2729 | |
| 2730 | + /* Set flag to get timing setup restored for next exec_op */ | |
| 2731 | + if (this->hw.clk_rate) | |
| 2732 | + this->hw.must_apply_timings = true; | |
| 2733 | + | |
| 2725 | 2734 | /* re-init the BCH registers */ |
| 2726 | 2735 | ret = bch_set_geometry(this); |
| 2727 | 2736 | if (ret) { |
| @@ -2124,6 +2124,8 @@ static int spi_nor_sr2_bit1_quad_enable(struct spi_nor *nor) · 2123 unmodified lines | ||
| 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 | |
| @@ -4769,9 +4771,7 @@ static void spi_nor_info_init_params(struct spi_nor *nor) · 2639 unmodified lines | ||
| 4769 | 4771 | |
| 4770 | 4772 | static void spansion_post_sfdp_fixups(struct spi_nor *nor) |
| 4771 | 4773 | { |
| 4772 | − struct mtd_info *mtd = &nor->mtd; | |
| 4773 | − | |
| 4774 | − if (mtd->size <= SZ_16M) | |
| 4774 | + if (nor->params.size <= SZ_16M) | |
| 4775 | 4775 | return; |
| 4776 | 4776 | |
| 4777 | 4777 | nor->flags |= SNOR_F_4B_OPCODES; |
| @@ -68,7 +68,7 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port) · 67 unmodified lines | ||
| 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 */ |
| @@ -582,7 +582,7 @@ static int sja1105_parse_ports_node(struct sja1105_private *priv, · 581 unmodified lines | ||
| 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; |
| @@ -2323,7 +2323,7 @@ static int bcm_sysport_map_queues(struct notifier_block *nb, · 2322 unmodified lines | ||
| 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,7 +2338,7 @@ static int bcm_sysport_unmap_queues(struct notifier_block *nb, · 8 unmodified lines | ||
| 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,7 +2364,8 @@ static int bcm_sysport_unmap_queues(struct notifier_block *nb, · 19 unmodified lines | ||
| 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; |
| @@ -11065,11 +11065,23 @@ static bool bnxt_fltr_match(struct bnxt_ntuple_filter *f1, · 11064 unmodified lines | ||
| 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)) |
| @@ -11361,7 +11373,7 @@ int bnxt_get_port_parent_id(struct net_device *dev, · 285 unmodified lines | ||
| 11361 | 11373 | return -EOPNOTSUPP; |
| 11362 | 11374 | |
| 11363 | 11375 | /* The PF and it's VF-reps only support the switchdev framework */ |
| 11364 | − if (!BNXT_PF(bp)) | |
| 11376 | + if (!BNXT_PF(bp) || !(bp->flags & BNXT_FLAG_DSN_VALID)) | |
| 11365 | 11377 | return -EOPNOTSUPP; |
| 11366 | 11378 | |
| 11367 | 11379 | ppid->id_len = sizeof(bp->switch_id); |
| @@ -11734,6 +11746,7 @@ static int bnxt_pcie_dsn_get(struct bnxt *bp, u8 dsn[]) · 366 unmodified lines | ||
| 11734 | 11746 | put_unaligned_le32(dw, &dsn[0]); |
| 11735 | 11747 | pci_read_config_dword(pdev, pos + 4, &dw); |
| 11736 | 11748 | put_unaligned_le32(dw, &dsn[4]); |
| 11749 | + bp->flags |= BNXT_FLAG_DSN_VALID; | |
| 11737 | 11750 | return 0; |
| 11738 | 11751 | } |
| 11739 | 11752 | |
| @@ -11845,9 +11858,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 105 unmodified lines | ||
| 11845 | 11858 | |
| 11846 | 11859 | if (BNXT_PF(bp)) { |
| 11847 | 11860 | /* Read the adapter's DSN to use as the eswitch switch_id */ |
| 11848 | − rc = bnxt_pcie_dsn_get(bp, bp->switch_id); | |
| 11849 | − if (rc) | |
| 11850 | − goto init_err_pci_clean; | |
| 11861 | + bnxt_pcie_dsn_get(bp, bp->switch_id); | |
| 11851 | 11862 | } |
| 11852 | 11863 | |
| 11853 | 11864 | /* MTU range: 60 - FW defined max */ |
| @@ -1532,6 +1532,7 @@ struct bnxt { · 1531 unmodified lines | ||
| 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 |
| @@ -1936,9 +1937,6 @@ static inline bool bnxt_cfa_hwrm_message(u16 req_type) · 398 unmodified lines | ||
| 1936 | 1937 | case HWRM_CFA_ENCAP_RECORD_FREE: |
| 1937 | 1938 | case HWRM_CFA_DECAP_FILTER_ALLOC: |
| 1938 | 1939 | case HWRM_CFA_DECAP_FILTER_FREE: |
| 1939 | − case HWRM_CFA_NTUPLE_FILTER_ALLOC: | |
| 1940 | − case HWRM_CFA_NTUPLE_FILTER_FREE: | |
| 1941 | − case HWRM_CFA_NTUPLE_FILTER_CFG: | |
| 1942 | 1940 | case HWRM_CFA_EM_FLOW_ALLOC: |
| 1943 | 1941 | case HWRM_CFA_EM_FLOW_FREE: |
| 1944 | 1942 | case HWRM_CFA_EM_FLOW_CFG: |
| @@ -398,6 +398,9 @@ static int bnxt_vf_reps_create(struct bnxt *bp) · 397 unmodified lines | ||
| 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; |
| @@ -611,21 +611,24 @@ static const struct phylink_mac_ops macb_phylink_ops = { · 610 unmodified lines | ||
| 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"); |
| @@ -634,10 +637,11 @@ static int macb_phylink_connect(struct macb *bp) · 2 unmodified lines | ||
| 634 | 637 | |
| 635 | 638 | /* attach the mac to the phy */ |
| 636 | 639 | ret = phylink_connect_phy(bp->phylink, phydev); |
| 637 | − if (ret) { | |
| 638 | − netdev_err(dev, "Could not attach to PHY (%d)\n", ret); | |
| 639 | − return ret; | |
| 640 | − } | |
| 640 | + } | |
| 641 | + | |
| 642 | + if (ret) { | |
| 643 | + netdev_err(dev, "Could not attach PHY (%d)\n", ret); | |
| 644 | + return ret; | |
| 641 | 645 | } |
| 642 | 646 | |
| 643 | 647 | phylink_start(bp->phylink); |
| @@ -3135,9 +3135,9 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate) · 3134 unmodified lines | ||
| 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 | |
| @@ -3154,6 +3154,15 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate) · 10 unmodified lines | ||
| 3154 | 3154 | return -EINVAL; |
| 3155 | 3155 | } |
| 3156 | 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; | |
| 3164 | + } | |
| 3165 | + | |
| 3157 | 3166 | /* Convert from Mbps to Kbps */ |
| 3158 | 3167 | req_rate = rate * 1000; |
| 3159 | 3168 | |
| @@ -3183,7 +3192,6 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate) · 23 unmodified lines | ||
| 3183 | 3192 | return 0; |
| 3184 | 3193 | |
| 3185 | 3194 | /* Fetch any available unused or matching scheduling class */ |
| 3186 | − memset(&p, 0, sizeof(p)); | |
| 3187 | 3195 | p.type = SCHED_CLASS_TYPE_PACKET; |
| 3188 | 3196 | p.u.params.level = SCHED_CLASS_LEVEL_CL_RL; |
| 3189 | 3197 | p.u.params.mode = SCHED_CLASS_MODE_CLASS; |
| @@ -15,6 +15,8 @@ static int cxgb4_matchall_egress_validate(struct net_device *dev, · 14 unmodified lines | ||
| 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; |
| @@ -60,9 +62,61 @@ static int cxgb4_matchall_egress_validate(struct net_device *dev, · 39 unmodified lines | ||
| 60 | 62 | } |
| 61 | 63 | } |
| 62 | 64 | |
| 65 | + for (i = 0; i < pi->nqsets; i++) { | |
| 66 | + memset(&qe, 0, sizeof(qe)); | |
| 67 | + qe.queue = i; | |
| 68 | + | |
| 69 | + e = cxgb4_sched_queue_lookup(dev, &qe); | |
| 70 | + if (e && e->info.u.params.level != SCHED_CLASS_LEVEL_CH_RL) { | |
| 71 | + NL_SET_ERR_MSG_MOD(extack, | |
| 72 | + "Some queues are already bound to different class"); | |
| 73 | + return -EBUSY; | |
| 74 | + } | |
| 75 | + } | |
| 76 | + | |
| 63 | 77 | return 0; |
| 64 | 78 | } |
| 65 | 79 | |
| 80 | +static int cxgb4_matchall_tc_bind_queues(struct net_device *dev, u32 tc) | |
| 81 | +{ | |
| 82 | + struct port_info *pi = netdev2pinfo(dev); | |
| 83 | + struct ch_sched_queue qe; | |
| 84 | + int ret; | |
| 85 | + u32 i; | |
| 86 | + | |
| 87 | + for (i = 0; i < pi->nqsets; i++) { | |
| 88 | + qe.queue = i; | |
| 89 | + qe.class = tc; | |
| 90 | + ret = cxgb4_sched_class_bind(dev, &qe, SCHED_QUEUE); | |
| 91 | + if (ret) | |
| 92 | + goto out_free; | |
| 93 | + } | |
| 94 | + | |
| 95 | + return 0; | |
| 96 | + | |
| 97 | +out_free: | |
| 98 | + while (i--) { | |
| 99 | + qe.queue = i; | |
| 100 | + qe.class = SCHED_CLS_NONE; | |
| 101 | + cxgb4_sched_class_unbind(dev, &qe, SCHED_QUEUE); | |
| 102 | + } | |
| 103 | + | |
| 104 | + return ret; | |
| 105 | +} | |
| 106 | + | |
| 107 | +static void cxgb4_matchall_tc_unbind_queues(struct net_device *dev) | |
| 108 | +{ | |
| 109 | + struct port_info *pi = netdev2pinfo(dev); | |
| 110 | + struct ch_sched_queue qe; | |
| 111 | + u32 i; | |
| 112 | + | |
| 113 | + for (i = 0; i < pi->nqsets; i++) { | |
| 114 | + qe.queue = i; | |
| 115 | + qe.class = SCHED_CLS_NONE; | |
| 116 | + cxgb4_sched_class_unbind(dev, &qe, SCHED_QUEUE); | |
| 117 | + } | |
| 118 | +} | |
| 119 | + | |
| 66 | 120 | static int cxgb4_matchall_alloc_tc(struct net_device *dev, |
| 67 | 121 | struct tc_cls_matchall_offload *cls) |
| 68 | 122 | { |
| @@ -83,6 +137,7 @@ static int cxgb4_matchall_alloc_tc(struct net_device *dev, · 14 unmodified lines | ||
| 83 | 137 | struct adapter *adap = netdev2adap(dev); |
| 84 | 138 | struct flow_action_entry *entry; |
| 85 | 139 | struct sched_class *e; |
| 140 | + int ret; | |
| 86 | 141 | u32 i; |
| 87 | 142 | |
| 88 | 143 | tc_port_matchall = &adap->tc_matchall->port_matchall[pi->port_id]; |
| @@ -101,10 +156,21 @@ static int cxgb4_matchall_alloc_tc(struct net_device *dev, · 12 unmodified lines | ||
| 101 | 156 | return -ENOMEM; |
| 102 | 157 | } |
| 103 | 158 | |
| 159 | + ret = cxgb4_matchall_tc_bind_queues(dev, e->idx); | |
| 160 | + if (ret) { | |
| 161 | + NL_SET_ERR_MSG_MOD(extack, | |
| 162 | + "Could not bind queues to traffic class"); | |
| 163 | + goto out_free; | |
| 164 | + } | |
| 165 | + | |
| 104 | 166 | tc_port_matchall->egress.hwtc = e->idx; |
| 105 | 167 | tc_port_matchall->egress.cookie = cls->cookie; |
| 106 | 168 | tc_port_matchall->egress.state = CXGB4_MATCHALL_STATE_ENABLED; |
| 107 | 169 | return 0; |
| 170 | + | |
| 171 | +out_free: | |
| 172 | + cxgb4_sched_class_free(dev, e->idx); | |
| 173 | + return ret; | |
| 108 | 174 | } |
| 109 | 175 | |
| 110 | 176 | static void cxgb4_matchall_free_tc(struct net_device *dev) |
| @@ -114,6 +180,7 @@ static void cxgb4_matchall_free_tc(struct net_device *dev) · 3 unmodified lines | ||
| 114 | 180 | struct adapter *adap = netdev2adap(dev); |
| 115 | 181 | |
| 116 | 182 | tc_port_matchall = &adap->tc_matchall->port_matchall[pi->port_id]; |
| 183 | + cxgb4_matchall_tc_unbind_queues(dev); | |
| 117 | 184 | cxgb4_sched_class_free(dev, tc_port_matchall->egress.hwtc); |
| 118 | 185 | |
| 119 | 186 | tc_port_matchall->egress.hwtc = SCHED_CLS_NONE; |
| @@ -12,8 +12,9 @@ static int cxgb4_mqprio_validate(struct net_device *dev, · 11 unmodified lines | ||
| 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,6 +48,31 @@ static int cxgb4_mqprio_validate(struct net_device *dev, · 27 unmodified lines | ||
| 47 | 48 | qoffset = max_t(u16, mqprio->qopt.offset[i], qoffset); |
| 48 | 49 | qcount += mqprio->qopt.count[i]; |
| 49 | 50 | |
| 51 | + start_a = mqprio->qopt.offset[i]; | |
| 52 | + end_a = start_a + mqprio->qopt.count[i] - 1; | |
| 53 | + for (j = i + 1; j < mqprio->qopt.num_tc; j++) { | |
| 54 | + start_b = mqprio->qopt.offset[j]; | |
| 55 | + end_b = start_b + mqprio->qopt.count[j] - 1; | |
| 56 | + | |
| 57 | + /* If queue count is 0, then the traffic | |
| 58 | + * belonging to this class will not use | |
| 59 | + * ETHOFLD queues. So, no need to validate | |
| 60 | + * further. | |
| 61 | + */ | |
| 62 | + if (!mqprio->qopt.count[i]) | |
| 63 | + break; | |
| 64 | + | |
| 65 | + if (!mqprio->qopt.count[j]) | |
| 66 | + continue; | |
| 67 | + | |
| 68 | + if (max_t(u32, start_a, start_b) <= | |
| 69 | + min_t(u32, end_a, end_b)) { | |
| 70 | + netdev_err(dev, | |
| 71 | + "Queues can't overlap across tc\n"); | |
| 72 | + return -EINVAL; | |
| 73 | + } | |
| 74 | + } | |
| 75 | + | |
| 50 | 76 | /* Convert byte per second to bits per second */ |
| 51 | 77 | min_rate += (mqprio->min_rate[i] * 8); |
| 52 | 78 | max_rate += (mqprio->max_rate[i] * 8); |
| @@ -165,6 +165,22 @@ static void *t4_sched_entry_lookup(struct port_info *pi, · 164 unmodified lines | ||
| 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; |
| @@ -103,6 +103,8 @@ static inline bool valid_class_id(struct net_device *dev, u8 class_id) · 102 unmodified lines | ||
| 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, |
| @@ -565,7 +565,6 @@ static int hns_nic_poll_rx_skb(struct hns_nic_ring_data *ring_data, · 564 unmodified lines | ||
| 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 | } |
| @@ -1056,7 +1055,6 @@ static int hns_nic_common_poll(struct napi_struct *napi, int budget) · 484 unmodified lines | ||
| 1056 | 1055 | container_of(napi, struct hns_nic_ring_data, napi); |
| 1057 | 1056 | struct hnae_ring *ring = ring_data->ring; |
| 1058 | 1057 | |
| 1059 | −try_again: | |
| 1060 | 1058 | clean_complete += ring_data->poll_one( |
| 1061 | 1059 | ring_data, budget - clean_complete, |
| 1062 | 1060 | ring_data->ex_process); |
| @@ -1066,7 +1064,7 @@ try_again: · 3 unmodified lines | ||
| 1066 | 1064 | napi_complete(napi); |
| 1067 | 1065 | ring->q->handle->dev->ops->toggle_ring_irq(ring, 0); |
| 1068 | 1066 | } else { |
| 1069 | − goto try_again; | |
| 1067 | + return budget; | |
| 1070 | 1068 | } |
| 1071 | 1069 | } |
| 1072 | 1070 | |
| @@ -54,6 +54,8 @@ MODULE_PARM_DESC(debug, " Network interface message level setting"); · 53 unmodified lines | ||
| 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 |
| @@ -1405,6 +1407,10 @@ netdev_tx_t hns3_nic_net_xmit(struct sk_buff *skb, struct net_device *netdev) · 1345 unmodified lines | ||
| 1405 | 1407 | int bd_num = 0; |
| 1406 | 1408 | int ret; |
| 1407 | 1409 | |
| 1410 | + /* Hardware can only handle short frames above 32 bytes */ | |
| 1411 | + if (skb_put_padto(skb, HNS3_MIN_TX_LEN)) | |
| 1412 | + return NETDEV_TX_OK; | |
| 1413 | + | |
| 1408 | 1414 | /* Prefetch the data used later */ |
| 1409 | 1415 | prefetch(skb->data); |
| 1410 | 1416 | |
| @@ -185,13 +185,12 @@ struct e1000_phy_regs { · 184 unmodified lines | ||
| 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 | |
| @@ -1780,8 +1780,7 @@ static irqreturn_t e1000_intr_msi(int __always_unused irq, void *data) · 1779 unmodified lines | ||
| 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 */ |
| @@ -1861,8 +1860,7 @@ static irqreturn_t e1000_intr(int __always_unused irq, void *data) · 73 unmodified lines | ||
| 1861 | 1860 | } |
| 1862 | 1861 | /* guard against interrupt when we're going down */ |
| 1863 | 1862 | if (!test_bit(__E1000_DOWN, &adapter->state)) |
| 1864 | − mod_delayed_work(adapter->e1000_workqueue, | |
| 1865 | − &adapter->watchdog_task, HZ); | |
| 1863 | + mod_timer(&adapter->watchdog_timer, jiffies + 1); | |
| 1866 | 1864 | } |
| 1867 | 1865 | |
| 1868 | 1866 | /* Reset on uncorrectable ECC error */ |
| @@ -1907,8 +1905,7 @@ static irqreturn_t e1000_msix_other(int __always_unused irq, void *data) · 38 unmodified lines | ||
| 1907 | 1905 | hw->mac.get_link_status = true; |
| 1908 | 1906 | /* guard against interrupt when we're going down */ |
| 1909 | 1907 | if (!test_bit(__E1000_DOWN, &adapter->state)) |
| 1910 | − mod_delayed_work(adapter->e1000_workqueue, | |
| 1911 | − &adapter->watchdog_task, HZ); | |
| 1908 | + mod_timer(&adapter->watchdog_timer, jiffies + 1); | |
| 1912 | 1909 | } |
| 1913 | 1910 | |
| 1914 | 1911 | if (!test_bit(__E1000_DOWN, &adapter->state)) |
| @@ -4284,6 +4281,7 @@ void e1000e_down(struct e1000_adapter *adapter, bool reset) · 2369 unmodified lines | ||
| 4284 | 4281 | |
| 4285 | 4282 | napi_synchronize(&adapter->napi); |
| 4286 | 4283 | |
| 4284 | + del_timer_sync(&adapter->watchdog_timer); | |
| 4287 | 4285 | del_timer_sync(&adapter->phy_info_timer); |
| 4288 | 4286 | |
| 4289 | 4287 | spin_lock(&adapter->stats64_lock); |
| @@ -5155,11 +5153,25 @@ static void e1000e_check_82574_phy_workaround(struct e1000_adapter *adapter) · 865 unmodified lines | ||
| 5155 | 5153 | } |
| 5156 | 5154 | } |
| 5157 | 5155 | |
| 5156 | +/** | |
| 5157 | + * e1000_watchdog - Timer Call-back | |
| 5158 | + * @data: pointer to adapter cast into an unsigned long | |
| 5159 | + **/ | |
| 5160 | +static void e1000_watchdog(struct timer_list *t) | |
| 5161 | +{ | |
| 5162 | + struct e1000_adapter *adapter = from_timer(adapter, t, watchdog_timer); | |
| 5163 | + | |
| 5164 | + /* Do the rest outside of interrupt context */ | |
| 5165 | + schedule_work(&adapter->watchdog_task); | |
| 5166 | + | |
| 5167 | + /* TODO: make this use queue_delayed_work() */ | |
| 5168 | +} | |
| 5169 | + | |
| 5158 | 5170 | static void e1000_watchdog_task(struct work_struct *work) |
| 5159 | 5171 | { |
| 5160 | 5172 | struct e1000_adapter *adapter = container_of(work, |
| 5161 | 5173 | struct e1000_adapter, |
| 5162 | − watchdog_task.work); | |
| 5174 | + watchdog_task); | |
| 5163 | 5175 | struct net_device *netdev = adapter->netdev; |
| 5164 | 5176 | struct e1000_mac_info *mac = &adapter->hw.mac; |
| 5165 | 5177 | struct e1000_phy_info *phy = &adapter->hw.phy; |
| @@ -5407,9 +5419,8 @@ link_up: · 241 unmodified lines | ||
| 5407 | 5419 | |
| 5408 | 5420 | /* Reset the timer */ |
| 5409 | 5421 | if (!test_bit(__E1000_DOWN, &adapter->state)) |
| 5410 | − queue_delayed_work(adapter->e1000_workqueue, | |
| 5411 | − &adapter->watchdog_task, | |
| 5412 | − round_jiffies(2 * HZ)); | |
| 5422 | + mod_timer(&adapter->watchdog_timer, | |
| 5423 | + round_jiffies(jiffies + 2 * HZ)); | |
| 5413 | 5424 | } |
| 5414 | 5425 | |
| 5415 | 5426 | #define E1000_TX_FLAGS_CSUM 0x00000001 |
| @@ -7449,21 +7460,11 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 2033 unmodified lines | ||
| 7449 | 7460 | goto err_eeprom; |
| 7450 | 7461 | } |
| 7451 | 7462 | |
| 7452 | − adapter->e1000_workqueue = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, | |
| 7453 | − e1000e_driver_name); | |
| 7454 | − | |
| 7455 | − if (!adapter->e1000_workqueue) { | |
| 7456 | − err = -ENOMEM; | |
| 7457 | − goto err_workqueue; | |
| 7458 | − } | |
| 7459 | − | |
| 7460 | − INIT_DELAYED_WORK(&adapter->watchdog_task, e1000_watchdog_task); | |
| 7461 | − queue_delayed_work(adapter->e1000_workqueue, &adapter->watchdog_task, | |
| 7462 | − 0); | |
| 7463 | − | |
| 7463 | + timer_setup(&adapter->watchdog_timer, e1000_watchdog, 0); | |
| 7464 | 7464 | timer_setup(&adapter->phy_info_timer, e1000_update_phy_info, 0); |
| 7465 | 7465 | |
| 7466 | 7466 | INIT_WORK(&adapter->reset_task, e1000_reset_task); |
| 7467 | + INIT_WORK(&adapter->watchdog_task, e1000_watchdog_task); | |
| 7467 | 7468 | INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround); |
| 7468 | 7469 | INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task); |
| 7469 | 7470 | INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang); |
| @@ -7557,9 +7558,6 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 87 unmodified lines | ||
| 7557 | 7558 | return 0; |
| 7558 | 7559 | |
| 7559 | 7560 | err_register: |
| 7560 | − flush_workqueue(adapter->e1000_workqueue); | |
| 7561 | − destroy_workqueue(adapter->e1000_workqueue); | |
| 7562 | −err_workqueue: | |
| 7563 | 7561 | if (!(adapter->flags & FLAG_HAS_AMT)) |
| 7564 | 7562 | e1000e_release_hw_control(adapter); |
| 7565 | 7563 | err_eeprom: |
| @@ -7604,17 +7602,15 @@ static void e1000_remove(struct pci_dev *pdev) · 38 unmodified lines | ||
| 7604 | 7602 | * from being rescheduled. |
| 7605 | 7603 | */ |
| 7606 | 7604 | set_bit(__E1000_DOWN, &adapter->state); |
| 7605 | + del_timer_sync(&adapter->watchdog_timer); | |
| 7607 | 7606 | del_timer_sync(&adapter->phy_info_timer); |
| 7608 | 7607 | |
| 7609 | 7608 | cancel_work_sync(&adapter->reset_task); |
| 7609 | + cancel_work_sync(&adapter->watchdog_task); | |
| 7610 | 7610 | cancel_work_sync(&adapter->downshift_task); |
| 7611 | 7611 | cancel_work_sync(&adapter->update_phy_task); |
| 7612 | 7612 | cancel_work_sync(&adapter->print_hang_task); |
| 7613 | 7613 | |
| 7614 | − cancel_delayed_work(&adapter->watchdog_task); | |
| 7615 | − flush_workqueue(adapter->e1000_workqueue); | |
| 7616 | − destroy_workqueue(adapter->e1000_workqueue); | |
| 7617 | − | |
| 7618 | 7614 | if (adapter->flags & FLAG_HAS_HW_TIMESTAMP) { |
| 7619 | 7615 | cancel_work_sync(&adapter->tx_hwtstamp_work); |
| 7620 | 7616 | if (adapter->tx_hwtstamp_skb) { |
| @@ -536,6 +536,11 @@ static void i40e_set_hw_flags(struct i40e_hw *hw) · 535 unmodified lines | ||
| 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; |
| @@ -2321,6 +2321,22 @@ static int i40e_ctrl_vf_rx_rings(struct i40e_vsi *vsi, unsigned long q_map, · 2320 unmodified lines | ||
| 2321 | 2321 | return ret; |
| 2322 | 2322 | } |
| 2323 | 2323 | |
| 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 | + | |
| 2324 | 2340 | /** |
| 2325 | 2341 | * i40e_vc_enable_queues_msg |
| 2326 | 2342 | * @vf: pointer to the VF info |
| @@ -2346,7 +2362,7 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg) · 19 unmodified lines | ||
| 2346 | 2362 | goto error_param; |
| 2347 | 2363 | } |
| 2348 | 2364 | |
| 2349 | − if ((0 == vqs->rx_queues) && (0 == vqs->tx_queues)) { | |
| 2365 | + if (i40e_vc_validate_vqs_bitmaps(vqs)) { | |
| 2350 | 2366 | aq_ret = I40E_ERR_PARAM; |
| 2351 | 2367 | goto error_param; |
| 2352 | 2368 | } |
| @@ -2408,9 +2424,7 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg) · 55 unmodified lines | ||
| 2408 | 2424 | goto error_param; |
| 2409 | 2425 | } |
| 2410 | 2426 | |
| 2411 | − if ((vqs->rx_queues == 0 && vqs->tx_queues == 0) || | |
| 2412 | − vqs->rx_queues > I40E_MAX_VF_QUEUES || | |
| 2413 | − vqs->tx_queues > I40E_MAX_VF_QUEUES) { | |
| 2427 | + if (i40e_vc_validate_vqs_bitmaps(vqs)) { | |
| 2414 | 2428 | aq_ret = I40E_ERR_PARAM; |
| 2415 | 2429 | goto error_param; |
| 2416 | 2430 | } |
| @@ -415,4 +415,6 @@ void iavf_enable_channels(struct iavf_adapter *adapter); · 414 unmodified lines | ||
| 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_ */ |
| @@ -743,9 +743,8 @@ iavf_mac_filter *iavf_find_filter(struct iavf_adapter *adapter, · 742 unmodified lines | ||
| 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 | |
| @@ -2065,9 +2064,9 @@ static void iavf_reset_task(struct work_struct *work) · 1313 unmodified lines | ||
| 2065 | 2064 | struct virtchnl_vf_resource *vfres = adapter->vf_res; |
| 2066 | 2065 | struct net_device *netdev = adapter->netdev; |
| 2067 | 2066 | struct iavf_hw *hw = &adapter->hw; |
| 2067 | + struct iavf_mac_filter *f, *ftmp; | |
| 2068 | 2068 | struct iavf_vlan_filter *vlf; |
| 2069 | 2069 | struct iavf_cloud_filter *cf; |
| 2070 | − struct iavf_mac_filter *f; | |
| 2071 | 2070 | u32 reg_val; |
| 2072 | 2071 | int i = 0, err; |
| 2073 | 2072 | bool running; |
| @@ -2181,6 +2180,16 @@ continue_reset: · 107 unmodified lines | ||
| 2181 | 2180 | |
| 2182 | 2181 | spin_lock_bh(&adapter->mac_vlan_list_lock); |
| 2183 | 2182 | |
| 2183 | + /* Delete filter for the current MAC address, it could have | |
| 2184 | + * been changed by the PF via administratively set MAC. | |
| 2185 | + * Will be re-added via VIRTCHNL_OP_GET_VF_RESOURCES. | |
| 2186 | + */ | |
| 2187 | + list_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) { | |
| 2188 | + if (ether_addr_equal(f->macaddr, adapter->hw.mac.addr)) { | |
| 2189 | + list_del(&f->list); | |
| 2190 | + kfree(f); | |
| 2191 | + } | |
| 2192 | + } | |
| 2184 | 2193 | /* re-add all MAC filters */ |
| 2185 | 2194 | list_for_each_entry(f, &adapter->mac_filter_list, list) { |
| 2186 | 2195 | f->add = true; |
| @@ -1359,6 +1359,9 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter, · 1358 unmodified lines | ||
| 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; |
| @@ -530,7 +530,7 @@ static s32 igb_set_sfp_media_type_82575(struct e1000_hw *hw) · 529 unmodified lines | ||
| 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,14 +657,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) · 120 unmodified lines | ||
| 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; |
| @@ -181,7 +181,7 @@ static int igb_get_link_ksettings(struct net_device *netdev, · 180 unmodified lines | ||
| 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 | } |
| @@ -5239,7 +5239,7 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter) · 5238 unmodified lines | ||
| 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,17 +5248,34 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter) · 2 unmodified lines | ||
| 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); |
| @@ -2081,11 +2081,6 @@ static int ixgbevf_write_uc_addr_list(struct net_device *netdev) · 2080 unmodified lines | ||
| 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 | |
| @@ -2081,7 +2081,11 @@ static int · 2080 unmodified lines | ||
| 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: |
| @@ -2094,9 +2098,8 @@ mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, · 6 unmodified lines | ||
| 2094 | 2098 | if (err) { |
| 2095 | 2099 | ret = MVNETA_XDP_DROPPED; |
| 2096 | 2100 | __page_pool_put_page(rxq->page_pool, |
| 2097 | − virt_to_head_page(xdp->data), | |
| 2098 | − xdp->data_end - xdp->data_hard_start, | |
| 2099 | − true); | |
| 2101 | + virt_to_head_page(xdp->data), | |
| 2102 | + len, true); | |
| 2100 | 2103 | } else { |
| 2101 | 2104 | ret = MVNETA_XDP_REDIR; |
| 2102 | 2105 | } |
| @@ -2106,9 +2109,8 @@ mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, · 3 unmodified lines | ||
| 2106 | 2109 | ret = mvneta_xdp_xmit_back(pp, xdp); |
| 2107 | 2110 | if (ret != MVNETA_XDP_TX) |
| 2108 | 2111 | __page_pool_put_page(rxq->page_pool, |
| 2109 | − virt_to_head_page(xdp->data), | |
| 2110 | − xdp->data_end - xdp->data_hard_start, | |
| 2111 | − true); | |
| 2112 | + virt_to_head_page(xdp->data), | |
| 2113 | + len, true); | |
| 2112 | 2114 | break; |
| 2113 | 2115 | default: |
| 2114 | 2116 | bpf_warn_invalid_xdp_action(act); |
| @@ -2119,8 +2121,7 @@ mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, · 4 unmodified lines | ||
| 2119 | 2121 | case XDP_DROP: |
| 2120 | 2122 | __page_pool_put_page(rxq->page_pool, |
| 2121 | 2123 | virt_to_head_page(xdp->data), |
| 2122 | − xdp->data_end - xdp->data_hard_start, | |
| 2123 | − true); | |
| 2124 | + len, true); | |
| 2124 | 2125 | ret = MVNETA_XDP_DROPPED; |
| 2125 | 2126 | break; |
| 2126 | 2127 | } |
| @@ -182,7 +182,7 @@ int mlx4_crdump_collect(struct mlx4_dev *dev) · 181 unmodified lines | ||
| 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); |
| @@ -860,23 +860,17 @@ static netdev_tx_t mlxsw_sp_port_xmit(struct sk_buff *skb, · 859 unmodified lines | ||
| 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 | 873 | |
| 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 | − | |
| 880 | 874 | if (eth_skb_pad(skb)) { |
| 881 | 875 | this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped); |
| 882 | 876 | return NETDEV_TX_OK; |
| @@ -1215,6 +1209,9 @@ static void update_stats_cache(struct work_struct *work) · 332 unmodified lines | ||
| 1215 | 1209 | periodic_hw_stats.update_dw.work); |
| 1216 | 1210 | |
| 1217 | 1211 | if (!netif_carrier_ok(mlxsw_sp_port->dev)) |
| 1212 | + /* Note: mlxsw_sp_port_down_wipe_counters() clears the cache as | |
| 1213 | + * necessary when port goes down. | |
| 1214 | + */ | |
| 1218 | 1215 | goto out; |
| 1219 | 1216 | |
| 1220 | 1217 | mlxsw_sp_port_get_hw_stats(mlxsw_sp_port->dev, |
| @@ -4324,6 +4321,15 @@ static int mlxsw_sp_port_unsplit(struct mlxsw_core *mlxsw_core, u8 local_port, · 3103 unmodified lines | ||
| 4324 | 4321 | return 0; |
| 4325 | 4322 | } |
| 4326 | 4323 | |
| 4324 | +static void | |
| 4325 | +mlxsw_sp_port_down_wipe_counters(struct mlxsw_sp_port *mlxsw_sp_port) | |
| 4326 | +{ | |
| 4327 | + int i; | |
| 4328 | + | |
| 4329 | + for (i = 0; i < TC_MAX_QUEUE; i++) | |
| 4330 | + mlxsw_sp_port->periodic_hw_stats.xstats.backlog[i] = 0; | |
| 4331 | +} | |
| 4332 | + | |
| 4327 | 4333 | static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg, |
| 4328 | 4334 | char *pude_pl, void *priv) |
| 4329 | 4335 | { |
| @@ -4345,6 +4351,7 @@ static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg, · 15 unmodified lines | ||
| 4345 | 4351 | } else { |
| 4346 | 4352 | netdev_info(mlxsw_sp_port->dev, "link down\n"); |
| 4347 | 4353 | netif_carrier_off(mlxsw_sp_port->dev); |
| 4354 | + mlxsw_sp_port_down_wipe_counters(mlxsw_sp_port); | |
| 4348 | 4355 | } |
| 4349 | 4356 | } |
| 4350 | 4357 | |
| @@ -5132,6 +5139,27 @@ static int mlxsw_sp2_init(struct mlxsw_core *mlxsw_core, · 781 unmodified lines | ||
| 5132 | 5139 | return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info, extack); |
| 5133 | 5140 | } |
| 5134 | 5141 | |
| 5142 | +static int mlxsw_sp3_init(struct mlxsw_core *mlxsw_core, | |
| 5143 | + const struct mlxsw_bus_info *mlxsw_bus_info, | |
| 5144 | + struct netlink_ext_ack *extack) | |
| 5145 | +{ | |
| 5146 | + struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); | |
| 5147 | + | |
| 5148 | + mlxsw_sp->kvdl_ops = &mlxsw_sp2_kvdl_ops; | |
| 5149 | + mlxsw_sp->afa_ops = &mlxsw_sp2_act_afa_ops; | |
| 5150 | + mlxsw_sp->afk_ops = &mlxsw_sp2_afk_ops; | |
| 5151 | + mlxsw_sp->mr_tcam_ops = &mlxsw_sp2_mr_tcam_ops; | |
| 5152 | + mlxsw_sp->acl_tcam_ops = &mlxsw_sp2_acl_tcam_ops; | |
| 5153 | + mlxsw_sp->nve_ops_arr = mlxsw_sp2_nve_ops_arr; | |
| 5154 | + mlxsw_sp->mac_mask = mlxsw_sp2_mac_mask; | |
| 5155 | + mlxsw_sp->rif_ops_arr = mlxsw_sp2_rif_ops_arr; | |
| 5156 | + mlxsw_sp->sb_vals = &mlxsw_sp2_sb_vals; | |
| 5157 | + mlxsw_sp->port_type_speed_ops = &mlxsw_sp2_port_type_speed_ops; | |
| 5158 | + mlxsw_sp->ptp_ops = &mlxsw_sp2_ptp_ops; | |
| 5159 | + | |
| 5160 | + return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info, extack); | |
| 5161 | +} | |
| 5162 | + | |
| 5135 | 5163 | static void mlxsw_sp_fini(struct mlxsw_core *mlxsw_core) |
| 5136 | 5164 | { |
| 5137 | 5165 | struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); |
| @@ -5634,7 +5662,7 @@ static struct mlxsw_driver mlxsw_sp2_driver = { · 496 unmodified lines | ||
| 5634 | 5662 | static struct mlxsw_driver mlxsw_sp3_driver = { |
| 5635 | 5663 | .kind = mlxsw_sp3_driver_name, |
| 5636 | 5664 | .priv_size = sizeof(struct mlxsw_sp), |
| 5637 | − .init = mlxsw_sp2_init, | |
| 5665 | + .init = mlxsw_sp3_init, | |
| 5638 | 5666 | .fini = mlxsw_sp_fini, |
| 5639 | 5667 | .basic_trap_groups_set = mlxsw_sp_basic_trap_groups_set, |
| 5640 | 5668 | .port_split = mlxsw_sp_port_split, |
| @@ -195,6 +195,20 @@ mlxsw_sp_qdisc_get_xstats(struct mlxsw_sp_port *mlxsw_sp_port, · 194 unmodified lines | ||
| 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, |
| @@ -269,7 +283,7 @@ mlxsw_sp_setup_tc_qdisc_red_clean_stats(struct mlxsw_sp_port *mlxsw_sp_port, · 68 unmodified lines | ||
| 269 | 283 | &stats_base->tx_bytes); |
| 270 | 284 | red_base->prob_mark = xstats->ecn; |
| 271 | 285 | red_base->prob_drop = xstats->wred_drop[tclass_num]; |
| 272 | − red_base->pdrop = xstats->tail_drop[tclass_num]; | |
| 286 | + red_base->pdrop = mlxsw_sp_xstats_tail_drop(xstats, tclass_num); | |
| 273 | 287 | |
| 274 | 288 | stats_base->overlimits = red_base->prob_drop + red_base->prob_mark; |
| 275 | 289 | stats_base->drops = red_base->prob_drop + red_base->pdrop; |
| @@ -370,7 +384,8 @@ mlxsw_sp_qdisc_get_red_xstats(struct mlxsw_sp_port *mlxsw_sp_port, · 94 unmodified lines | ||
| 370 | 384 | |
| 371 | 385 | early_drops = xstats->wred_drop[tclass_num] - xstats_base->prob_drop; |
| 372 | 386 | marks = xstats->ecn - xstats_base->prob_mark; |
| 373 | − pdrops = xstats->tail_drop[tclass_num] - xstats_base->pdrop; | |
| 387 | + pdrops = mlxsw_sp_xstats_tail_drop(xstats, tclass_num) - | |
| 388 | + xstats_base->pdrop; | |
| 374 | 389 | |
| 375 | 390 | res->pdrop += pdrops; |
| 376 | 391 | res->prob_drop += early_drops; |
| @@ -403,9 +418,10 @@ mlxsw_sp_qdisc_get_red_stats(struct mlxsw_sp_port *mlxsw_sp_port, · 26 unmodified lines | ||
| 403 | 418 | |
| 404 | 419 | overlimits = xstats->wred_drop[tclass_num] + xstats->ecn - |
| 405 | 420 | stats_base->overlimits; |
| 406 | − drops = xstats->wred_drop[tclass_num] + xstats->tail_drop[tclass_num] - | |
| 421 | + drops = xstats->wred_drop[tclass_num] + | |
| 422 | + mlxsw_sp_xstats_tail_drop(xstats, tclass_num) - | |
| 407 | 423 | stats_base->drops; |
| 408 | − backlog = xstats->backlog[tclass_num]; | |
| 424 | + backlog = mlxsw_sp_xstats_backlog(xstats, tclass_num); | |
| 409 | 425 | |
| 410 | 426 | _bstats_update(stats_ptr->bstats, tx_bytes, tx_packets); |
| 411 | 427 | stats_ptr->qstats->overlimits += overlimits; |
| @@ -576,9 +592,9 @@ mlxsw_sp_qdisc_get_prio_stats(struct mlxsw_sp_port *mlxsw_sp_port, · 164 unmodified lines | ||
| 576 | 592 | tx_packets = stats->tx_packets - stats_base->tx_packets; |
| 577 | 593 | |
| 578 | 594 | for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) { |
| 579 | − drops += xstats->tail_drop[i]; | |
| 595 | + drops += mlxsw_sp_xstats_tail_drop(xstats, i); | |
| 580 | 596 | drops += xstats->wred_drop[i]; |
| 581 | − backlog += xstats->backlog[i]; | |
| 597 | + backlog += mlxsw_sp_xstats_backlog(xstats, i); | |
| 582 | 598 | } |
| 583 | 599 | drops = drops - stats_base->drops; |
| 584 | 600 | |
| @@ -614,7 +630,7 @@ mlxsw_sp_setup_tc_qdisc_prio_clean_stats(struct mlxsw_sp_port *mlxsw_sp_port, · 29 unmodified lines | ||
| 614 | 630 | |
| 615 | 631 | stats_base->drops = 0; |
| 616 | 632 | for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) { |
| 617 | − stats_base->drops += xstats->tail_drop[i]; | |
| 633 | + stats_base->drops += mlxsw_sp_xstats_tail_drop(xstats, i); | |
| 618 | 634 | stats_base->drops += xstats->wred_drop[i]; |
| 619 | 635 | } |
| 620 | 636 | |
| @@ -299,22 +299,17 @@ static netdev_tx_t mlxsw_sx_port_xmit(struct sk_buff *skb, · 298 unmodified lines | ||
| 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. |
| @@ -2204,24 +2204,28 @@ static size_t __sh_eth_get_regs(struct net_device *ndev, u32 *buf) · 2203 unmodified lines | ||
| 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); |
| @@ -424,16 +424,22 @@ static void ave_ethtool_get_wol(struct net_device *ndev, · 423 unmodified lines | ||
| 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) | |
| 427 | +static int __ave_ethtool_set_wol(struct net_device *ndev, | |
| 428 | + struct ethtool_wolinfo *wol) | |
| 429 | 429 | { |
| 430 | − int ret; | |
| 431 | − | |
| 432 | 430 | if (!ndev->phydev || |
| 433 | 431 | (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE))) |
| 434 | 432 | return -EOPNOTSUPP; |
| 435 | 433 | |
| 436 | − ret = phy_ethtool_set_wol(ndev->phydev, wol); | |
| 434 | + return phy_ethtool_set_wol(ndev->phydev, wol); | |
| 435 | +} | |
| 436 | + | |
| 437 | +static int ave_ethtool_set_wol(struct net_device *ndev, | |
| 438 | + struct ethtool_wolinfo *wol) | |
| 439 | +{ | |
| 440 | + int ret; | |
| 441 | + | |
| 442 | + ret = __ave_ethtool_set_wol(ndev, wol); | |
| 437 | 443 | if (!ret) |
| 438 | 444 | device_set_wakeup_enable(&ndev->dev, !!wol->wolopts); |
| 439 | 445 | |
| @@ -1216,7 +1222,7 @@ static int ave_init(struct net_device *ndev) · 776 unmodified lines | ||
| 1216 | 1222 | |
| 1217 | 1223 | /* set wol initial state disabled */ |
| 1218 | 1224 | wol.wolopts = 0; |
| 1219 | − ave_ethtool_set_wol(ndev, &wol); | |
| 1225 | + __ave_ethtool_set_wol(ndev, &wol); | |
| 1220 | 1226 | |
| 1221 | 1227 | if (!phy_interface_is_rgmii(phydev)) |
| 1222 | 1228 | phy_set_max_speed(phydev, SPEED_100); |
| @@ -1768,7 +1774,7 @@ static int ave_resume(struct device *dev) · 545 unmodified lines | ||
| 1768 | 1774 | |
| 1769 | 1775 | ave_ethtool_get_wol(ndev, &wol); |
| 1770 | 1776 | wol.wolopts = priv->wolopts; |
| 1771 | − ave_ethtool_set_wol(ndev, &wol); | |
| 1777 | + __ave_ethtool_set_wol(ndev, &wol); | |
| 1772 | 1778 | |
| 1773 | 1779 | if (ndev->phydev) { |
| 1774 | 1780 | ret = phy_resume(ndev->phydev); |
| @@ -80,7 +80,7 @@ static struct sk_buff *stmmac_test_get_udp_skb(struct stmmac_priv *priv, · 79 unmodified lines | ||
| 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,6 +244,8 @@ static int stmmac_test_loopback_validate(struct sk_buff *skb, · 157 unmodified lines | ||
| 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; |
| @@ -260,15 +262,15 @@ static int stmmac_test_loopback_validate(struct sk_buff *skb, · 10 unmodified lines | ||
| 260 | 262 | goto out; |
| 261 | 263 | |
| 262 | 264 | ehdr = (struct ethhdr *)skb_mac_header(skb); |
| 263 | − if (tpriv->packet->dst) { | |
| 264 | − if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->dst)) | |
| 265 | + if (dst) { | |
| 266 | + if (!ether_addr_equal_unaligned(ehdr->h_dest, dst)) | |
| 265 | 267 | goto out; |
| 266 | 268 | } |
| 267 | 269 | if (tpriv->packet->sarc) { |
| 268 | − if (!ether_addr_equal(ehdr->h_source, ehdr->h_dest)) | |
| 270 | + if (!ether_addr_equal_unaligned(ehdr->h_source, ehdr->h_dest)) | |
| 269 | 271 | goto out; |
| 270 | − } else if (tpriv->packet->src) { | |
| 271 | − if (!ether_addr_equal(ehdr->h_source, tpriv->packet->src)) | |
| 272 | + } else if (src) { | |
| 273 | + if (!ether_addr_equal_unaligned(ehdr->h_source, src)) | |
| 272 | 274 | goto out; |
| 273 | 275 | } |
| 274 | 276 | |
| @@ -714,7 +716,7 @@ static int stmmac_test_flowctrl_validate(struct sk_buff *skb, · 439 unmodified lines | ||
| 714 | 716 | struct ethhdr *ehdr; |
| 715 | 717 | |
| 716 | 718 | ehdr = (struct ethhdr *)skb_mac_header(skb); |
| 717 | − if (!ether_addr_equal(ehdr->h_source, orig_ndev->dev_addr)) | |
| 719 | + if (!ether_addr_equal_unaligned(ehdr->h_source, orig_ndev->dev_addr)) | |
| 718 | 720 | goto out; |
| 719 | 721 | if (ehdr->h_proto != htons(ETH_P_PAUSE)) |
| 720 | 722 | goto out; |
| @@ -851,12 +853,16 @@ static int stmmac_test_vlan_validate(struct sk_buff *skb, · 130 unmodified lines | ||
| 851 | 853 | if (tpriv->vlan_id) { |
| 852 | 854 | if (skb->vlan_proto != htons(proto)) |
| 853 | 855 | goto out; |
| 854 | − if (skb->vlan_tci != tpriv->vlan_id) | |
| 856 | + if (skb->vlan_tci != tpriv->vlan_id) { | |
| 857 | + /* Means filter did not work. */ | |
| 858 | + tpriv->ok = false; | |
| 859 | + complete(&tpriv->comp); | |
| 855 | 860 | goto out; |
| 861 | + } | |
| 856 | 862 | } |
| 857 | 863 | |
| 858 | 864 | ehdr = (struct ethhdr *)skb_mac_header(skb); |
| 859 | − if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->dst)) | |
| 865 | + if (!ether_addr_equal_unaligned(ehdr->h_dest, tpriv->packet->dst)) | |
| 860 | 866 | goto out; |
| 861 | 867 | |
| 862 | 868 | ihdr = ip_hdr(skb); |
| @@ -965,6 +971,9 @@ static int stmmac_test_vlanfilt_perfect(struct stmmac_priv *priv) · 102 unmodified lines | ||
| 965 | 971 | { |
| 966 | 972 | int ret, prev_cap = priv->dma_cap.vlhash; |
| 967 | 973 | |
| 974 | + if (!(priv->dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) | |
| 975 | + return -EOPNOTSUPP; | |
| 976 | + | |
| 968 | 977 | priv->dma_cap.vlhash = 0; |
| 969 | 978 | ret = __stmmac_test_vlanfilt(priv); |
| 970 | 979 | priv->dma_cap.vlhash = prev_cap; |
| @@ -1057,6 +1066,9 @@ static int stmmac_test_dvlanfilt_perfect(struct stmmac_priv *priv) · 86 unmodified lines | ||
| 1057 | 1066 | { |
| 1058 | 1067 | int ret, prev_cap = priv->dma_cap.vlhash; |
| 1059 | 1068 | |
| 1069 | + if (!(priv->dev->features & NETIF_F_HW_VLAN_STAG_FILTER)) | |
| 1070 | + return -EOPNOTSUPP; | |
| 1071 | + | |
| 1060 | 1072 | priv->dma_cap.vlhash = 0; |
| 1061 | 1073 | ret = __stmmac_test_dvlanfilt(priv); |
| 1062 | 1074 | priv->dma_cap.vlhash = prev_cap; |
| @@ -1323,16 +1335,19 @@ static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src, · 260 unmodified lines | ||
| 1323 | 1335 | struct stmmac_packet_attrs attr = { }; |
| 1324 | 1336 | struct flow_dissector *dissector; |
| 1325 | 1337 | struct flow_cls_offload *cls; |
| 1338 | + int ret, old_enable = 0; | |
| 1326 | 1339 | struct flow_rule *rule; |
| 1327 | − int ret; | |
| 1328 | 1340 | |
| 1329 | 1341 | if (!tc_can_offload(priv->dev)) |
| 1330 | 1342 | return -EOPNOTSUPP; |
| 1331 | 1343 | if (!priv->dma_cap.l3l4fnum) |
| 1332 | 1344 | return -EOPNOTSUPP; |
| 1333 | − if (priv->rss.enable) | |
| 1345 | + if (priv->rss.enable) { | |
| 1346 | + old_enable = priv->rss.enable; | |
| 1347 | + priv->rss.enable = false; | |
| 1334 | 1348 | stmmac_rss_configure(priv, priv->hw, NULL, |
| 1335 | 1349 | priv->plat->rx_queues_to_use); |
| 1350 | + } | |
| 1336 | 1351 | |
| 1337 | 1352 | dissector = kzalloc(sizeof(*dissector), GFP_KERNEL); |
| 1338 | 1353 | if (!dissector) { |
| @@ -1399,7 +1414,8 @@ cleanup_cls: · 60 unmodified lines | ||
| 1399 | 1414 | cleanup_dissector: |
| 1400 | 1415 | kfree(dissector); |
| 1401 | 1416 | cleanup_rss: |
| 1402 | − if (priv->rss.enable) { | |
| 1417 | + if (old_enable) { | |
| 1418 | + priv->rss.enable = old_enable; | |
| 1403 | 1419 | stmmac_rss_configure(priv, priv->hw, &priv->rss, |
| 1404 | 1420 | priv->plat->rx_queues_to_use); |
| 1405 | 1421 | } |
| @@ -1444,16 +1460,19 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src, · 38 unmodified lines | ||
| 1444 | 1460 | struct stmmac_packet_attrs attr = { }; |
| 1445 | 1461 | struct flow_dissector *dissector; |
| 1446 | 1462 | struct flow_cls_offload *cls; |
| 1463 | + int ret, old_enable = 0; | |
| 1447 | 1464 | struct flow_rule *rule; |
| 1448 | − int ret; | |
| 1449 | 1465 | |
| 1450 | 1466 | if (!tc_can_offload(priv->dev)) |
| 1451 | 1467 | return -EOPNOTSUPP; |
| 1452 | 1468 | if (!priv->dma_cap.l3l4fnum) |
| 1453 | 1469 | return -EOPNOTSUPP; |
| 1454 | − if (priv->rss.enable) | |
| 1470 | + if (priv->rss.enable) { | |
| 1471 | + old_enable = priv->rss.enable; | |
| 1472 | + priv->rss.enable = false; | |
| 1455 | 1473 | stmmac_rss_configure(priv, priv->hw, NULL, |
| 1456 | 1474 | priv->plat->rx_queues_to_use); |
| 1475 | + } | |
| 1457 | 1476 | |
| 1458 | 1477 | dissector = kzalloc(sizeof(*dissector), GFP_KERNEL); |
| 1459 | 1478 | if (!dissector) { |
| @@ -1525,7 +1544,8 @@ cleanup_cls: · 65 unmodified lines | ||
| 1525 | 1544 | cleanup_dissector: |
| 1526 | 1545 | kfree(dissector); |
| 1527 | 1546 | cleanup_rss: |
| 1528 | − if (priv->rss.enable) { | |
| 1547 | + if (old_enable) { | |
| 1548 | + priv->rss.enable = old_enable; | |
| 1529 | 1549 | stmmac_rss_configure(priv, priv->hw, &priv->rss, |
| 1530 | 1550 | priv->plat->rx_queues_to_use); |
| 1531 | 1551 | } |
| @@ -1578,7 +1598,7 @@ static int stmmac_test_arp_validate(struct sk_buff *skb, · 46 unmodified lines | ||
| 1578 | 1598 | struct arphdr *ahdr; |
| 1579 | 1599 | |
| 1580 | 1600 | ehdr = (struct ethhdr *)skb_mac_header(skb); |
| 1581 | − if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->src)) | |
| 1601 | + if (!ether_addr_equal_unaligned(ehdr->h_dest, tpriv->packet->src)) | |
| 1582 | 1602 | goto out; |
| 1583 | 1603 | |
| 1584 | 1604 | ahdr = arp_hdr(skb); |
| @@ -577,6 +577,10 @@ static int tc_setup_cls(struct stmmac_priv *priv, · 576 unmodified lines | ||
| 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); |
| @@ -1443,8 +1443,6 @@ void rndis_filter_device_remove(struct hv_device *dev, · 1442 unmodified lines | ||
| 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 | |
| @@ -259,7 +259,7 @@ static void macvlan_broadcast(struct sk_buff *skb, · 258 unmodified lines | ||
| 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,10 +513,11 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev) · 247 unmodified lines | ||
| 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 | } |
| @@ -53,7 +53,7 @@ static ssize_t nsim_dev_take_snapshot_write(struct file *file, · 52 unmodified lines | ||
| 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) { |
| @@ -340,14 +340,14 @@ config DAVICOM_PHY · 339 unmodified lines | ||
| 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" |
| @@ -97,6 +97,7 @@ · 96 unmodified lines | ||
| 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 |
| @@ -599,7 +600,12 @@ static int dp83867_phy_reset(struct phy_device *phydev) · 496 unmodified lines | ||
| 599 | 600 | |
| 600 | 601 | usleep_range(10, 20); |
| 601 | 602 | |
| 602 | − return 0; | |
| 603 | + /* After reset FORCE_LINK_GOOD bit is set. Although the | |
| 604 | + * default value should be unset. Disable FORCE_LINK_GOOD | |
| 605 | + * for the phy to work properly. | |
| 606 | + */ | |
| 607 | + return phy_modify(phydev, MII_DP83867_PHYCTRL, | |
| 608 | + DP83867_PHYCR_FORCE_LINK_GOOD, 0); | |
| 603 | 609 | } |
| 604 | 610 | |
| 605 | 611 | static struct phy_driver dp83867_driver[] = { |
| @@ -3750,6 +3750,7 @@ static int lan78xx_probe(struct usb_interface *intf, · 3749 unmodified lines | ||
| 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; |
| @@ -1062,6 +1062,7 @@ static const struct usb_device_id products[] = { · 1061 unmodified lines | ||
| 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 */ |
| @@ -6597,6 +6597,9 @@ static int rtl8152_probe(struct usb_interface *intf, · 6596 unmodified lines | ||
| 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) { |
| @@ -73,7 +73,7 @@ static struct ucc_tdm_info utdm_primary_info = { · 72 unmodified lines | ||
| 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 | { |
| @@ -64,7 +64,7 @@ static struct lapbethdev *lapbeth_get_x25_dev(struct net_device *dev) · 63 unmodified lines | ||
| 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 | } |
| @@ -391,7 +391,7 @@ static int pn533_acr122_poweron_rdr(struct pn533_usb_phy *phy) · 390 unmodified lines | ||
| 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, |
| @@ -73,13 +73,6 @@ static int send_kbbl_msg(struct wilco_ec_device *ec, · 72 unmodified lines | ||
| 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 | |
| @@ -87,6 +80,7 @@ static int set_kbbl(struct wilco_ec_device *ec, enum led_brightness brightness) · 1 unmodified line | ||
| 87 | 80 | { |
| 88 | 81 | struct wilco_keyboard_leds_msg request; |
| 89 | 82 | struct wilco_keyboard_leds_msg response; |
| 83 | + int ret; | |
| 90 | 84 | |
| 91 | 85 | memset(&request, 0, sizeof(request)); |
| 92 | 86 | request.command = WILCO_EC_COMMAND_KBBL; |
| @@ -94,7 +88,18 @@ static int set_kbbl(struct wilco_ec_device *ec, enum led_brightness brightness) · 1 unmodified line | ||
| 94 | 88 | request.mode = WILCO_KBBL_MODE_FLAG_PWM; |
| 95 | 89 | request.percent = brightness; |
| 96 | 90 | |
| 97 | − return send_kbbl_msg(ec, &request, &response); | |
| 91 | + ret = send_kbbl_msg(ec, &request, &response); | |
| 92 | + if (ret < 0) | |
| 93 | + return ret; | |
| 94 | + | |
| 95 | + if (response.status) { | |
| 96 | + dev_err(ec->dev, | |
| 97 | + "EC reported failure sending keyboard LEDs command: %d", | |
| 98 | + response.status); | |
| 99 | + return -EIO; | |
| 100 | + } | |
| 101 | + | |
| 102 | + return 0; | |
| 98 | 103 | } |
| 99 | 104 | |
| 100 | 105 | static int kbbl_exist(struct wilco_ec_device *ec, bool *exists) |
| @@ -140,6 +145,13 @@ static int kbbl_init(struct wilco_ec_device *ec) · 39 unmodified lines | ||
| 140 | 145 | if (ret < 0) |
| 141 | 146 | return ret; |
| 142 | 147 | |
| 148 | + if (response.status) { | |
| 149 | + dev_err(ec->dev, | |
| 150 | + "EC reported failure sending keyboard LEDs command: %d", | |
| 151 | + response.status); | |
| 152 | + return -EIO; | |
| 153 | + } | |
| 154 | + | |
| 143 | 155 | if (response.mode & WILCO_KBBL_MODE_FLAG_PWM) |
| 144 | 156 | return response.percent; |
| 145 | 157 | |
| @@ -149,7 +149,7 @@ struct mlxbf_tmfifo_irq_info { · 148 unmodified lines | ||
| 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,7 +164,7 @@ struct mlxbf_tmfifo { · 8 unmodified lines | ||
| 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,7 +525,7 @@ static void mlxbf_tmfifo_console_tx(struct mlxbf_tmfifo *fifo, int avail) · 354 unmodified lines | ||
| 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,7 +552,7 @@ static void mlxbf_tmfifo_console_tx(struct mlxbf_tmfifo *fifo, int avail) · 20 unmodified lines | ||
| 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,9 +731,9 @@ static bool mlxbf_tmfifo_rxtx_one_desc(struct mlxbf_tmfifo_vring *vring, · 172 unmodified lines | ||
| 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,10 +852,10 @@ static bool mlxbf_tmfifo_virtio_notify(struct virtqueue *vq) · 112 unmodified lines | ||
| 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,7 +1189,8 @@ static int mlxbf_tmfifo_probe(struct platform_device *pdev) · 327 unmodified lines | ||
| 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 | |
| @@ -512,13 +512,7 @@ static void kbd_led_update(struct asus_wmi *asus) · 511 unmodified lines | ||
| 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 | |
| @@ -16,17 +16,27 @@ · 15 unmodified lines | ||
| 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"); |
| @@ -117,21 +127,24 @@ static int gpd_pocket_fan_probe(struct platform_device *pdev) · 84 unmodified lines | ||
| 117 | 127 | int i; |
| 118 | 128 | |
| 119 | 129 | for (i = 0; i < ARRAY_SIZE(temp_limits); i++) { |
| 120 | − if (temp_limits[i] < 40000 || temp_limits[i] > 70000) { | |
| 130 | + if (temp_limits[i] < 20000 || temp_limits[i] > 90000) { | |
| 121 | 131 | dev_err(&pdev->dev, "Invalid temp-limit %d (must be between 40000 and 70000)\n", |
| 122 | 132 | temp_limits[i]); |
| 123 | − return -EINVAL; | |
| 133 | + temp_limits[0] = TEMP_LIMIT0_DEFAULT; | |
| 134 | + temp_limits[1] = TEMP_LIMIT1_DEFAULT; | |
| 135 | + temp_limits[2] = TEMP_LIMIT2_DEFAULT; | |
| 136 | + break; | |
| 124 | 137 | } |
| 125 | 138 | } |
| 126 | 139 | if (hysteresis < 1000 || hysteresis > 10000) { |
| 127 | 140 | dev_err(&pdev->dev, "Invalid hysteresis %d (must be between 1000 and 10000)\n", |
| 128 | 141 | hysteresis); |
| 129 | − return -EINVAL; | |
| 142 | + hysteresis = HYSTERESIS_DEFAULT; | |
| 130 | 143 | } |
| 131 | 144 | if (speed_on_ac < 0 || speed_on_ac > MAX_SPEED) { |
| 132 | 145 | dev_err(&pdev->dev, "Invalid speed_on_ac %d (must be between 0 and 3)\n", |
| 133 | 146 | speed_on_ac); |
| 134 | − return -EINVAL; | |
| 147 | + speed_on_ac = SPEED_ON_AC_DEFAULT; | |
| 135 | 148 | } |
| 136 | 149 | |
| 137 | 150 | fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL); |
| @@ -1,4 +1,4 @@ | ||
| 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,4 +1,4 @@ | ||
| 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 | * |
| @@ -44,6 +44,8 @@ static const struct x86_cpu_id intel_pmc_core_platform_ids[] = { · 43 unmodified lines | ||
| 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); |
| @@ -170,6 +170,7 @@ static void ptp_clock_release(struct device *dev) · 169 unmodified lines | ||
| 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); |
| @@ -302,9 +303,8 @@ int ptp_clock_unregister(struct ptp_clock *ptp) · 126 unmodified lines | ||
| 302 | 303 | if (ptp->pps_source) |
| 303 | 304 | pps_unregister_source(ptp->pps_source); |
| 304 | 305 | |
| 305 | − ptp_cleanup_pin_groups(ptp); | |
| 306 | − | |
| 307 | 306 | posix_clock_unregister(&ptp->clock); |
| 307 | + | |
| 308 | 308 | return 0; |
| 309 | 309 | } |
| 310 | 310 | EXPORT_SYMBOL(ptp_clock_unregister); |
| @@ -793,8 +793,6 @@ static int ap_device_probe(struct device *dev) · 792 unmodified lines | ||
| 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 */ |
| @@ -261,7 +261,7 @@ void ap_queue_prepare_remove(struct ap_queue *aq); · 260 unmodified lines | ||
| 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); |
| @@ -638,7 +638,7 @@ struct ap_queue *ap_queue_create(ap_qid_t qid, int device_type) · 637 unmodified lines | ||
| 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,10 +771,11 @@ void ap_queue_remove(struct ap_queue *aq) · 126 unmodified lines | ||
| 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); | |
| @@ -1037,8 +1037,8 @@ static int _ip_cprb_helper(u16 cardnr, u16 domain, · 1036 unmodified lines | ||
| 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; |
| @@ -175,6 +175,7 @@ static int zcrypt_cex2a_queue_probe(struct ap_device *ap_dev) · 174 unmodified lines | ||
| 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; |
| @@ -220,6 +220,7 @@ static int zcrypt_cex2c_queue_probe(struct ap_device *ap_dev) · 219 unmodified lines | ||
| 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); |
| @@ -231,6 +232,7 @@ static int zcrypt_cex2c_queue_probe(struct ap_device *ap_dev) · 5 unmodified lines | ||
| 231 | 232 | else |
| 232 | 233 | zq->ops = zcrypt_msgtype(MSGTYPE06_NAME, |
| 233 | 234 | MSGTYPE06_VARIANT_NORNG); |
| 235 | + ap_queue_init_state(aq); | |
| 234 | 236 | ap_queue_init_reply(aq, &zq->reply); |
| 235 | 237 | aq->request_timeout = CEX2C_CLEANUP_TIME; |
| 236 | 238 | aq->private = zq; |
| @@ -381,6 +381,7 @@ static int zcrypt_cex4_queue_probe(struct ap_device *ap_dev) · 380 unmodified lines | ||
| 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; |
| @@ -688,26 +688,26 @@ int vnic_dev_soft_reset_done(struct vnic_dev *vdev, int *done) · 687 unmodified lines | ||
| 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,30 +732,30 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast, · 18 unmodified lines | ||
| 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 | } |
| @@ -2211,8 +2211,10 @@ static int sd_read_protection_type(struct scsi_disk *sdkp, unsigned char *buffer · 2210 unmodified lines | ||
| 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 | |
| @@ -1842,9 +1842,11 @@ static int storvsc_probe(struct hv_device *device, · 1841 unmodified lines | ||
| 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. |
| @@ -323,6 +323,8 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev, · 322 unmodified lines | ||
| 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; |
| @@ -368,15 +370,21 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev, · 39 unmodified lines | ||
| 368 | 370 | * prepare/enable counters won't be in sync. |
| 369 | 371 | */ |
| 370 | 372 | if (dom->num_clks && dom->desc.get_power && !dom->desc.get_power(dom)) { |
| 371 | − int ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks); | |
| 373 | + ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks); | |
| 372 | 374 | if (ret) |
| 373 | 375 | return ret; |
| 374 | 376 | |
| 375 | − pm_genpd_init(&dom->base, &pm_domain_always_on_gov, false); | |
| 376 | − } else | |
| 377 | − pm_genpd_init(&dom->base, NULL, | |
| 378 | − (dom->desc.get_power ? | |
| 379 | − dom->desc.get_power(dom) : true)); | |
| 377 | + ret = pm_genpd_init(&dom->base, &pm_domain_always_on_gov, | |
| 378 | + false); | |
| 379 | + if (ret) | |
| 380 | + return ret; | |
| 381 | + } else { | |
| 382 | + ret = pm_genpd_init(&dom->base, NULL, | |
| 383 | + (dom->desc.get_power ? | |
| 384 | + dom->desc.get_power(dom) : true)); | |
| 385 | + if (ret) | |
| 386 | + return ret; | |
| 387 | + } | |
| 380 | 388 | |
| 381 | 389 | return 0; |
| 382 | 390 | } |
| @@ -441,9 +449,7 @@ static int meson_ee_pwrc_probe(struct platform_device *pdev) · 58 unmodified lines | ||
| 441 | 449 | pwrc->xlate.domains[i] = &dom->base; |
| 442 | 450 | } |
| 443 | 451 | |
| 444 | − of_genpd_add_provider_onecell(pdev->dev.of_node, &pwrc->xlate); | |
| 445 | − | |
| 446 | − return 0; | |
| 452 | + return of_genpd_add_provider_onecell(pdev->dev.of_node, &pwrc->xlate); | |
| 447 | 453 | } |
| 448 | 454 | |
| 449 | 455 | static void meson_ee_pwrc_shutdown(struct platform_device *pdev) |
| @@ -419,6 +419,8 @@ static void wkup_m3_rproc_boot_thread(struct wkup_m3_ipc *m3_ipc) · 418 unmodified lines | ||
| 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 | } |
| @@ -505,8 +507,6 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev) · 80 unmodified lines | ||
| 505 | 507 | goto err_put_rproc; |
| 506 | 508 | } |
| 507 | 509 | |
| 508 | − m3_ipc_state = m3_ipc; | |
| 509 | − | |
| 510 | 510 | return 0; |
| 511 | 511 | |
| 512 | 512 | err_put_rproc: |
| @@ -72,9 +72,6 @@ static int ni_find_device_routes(const char *device_family, · 71 unmodified lines | ||
| 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, |
| @@ -84,12 +81,12 @@ static int ni_find_device_routes(const char *device_family, · 3 unmodified lines | ||
| 84 | 81 | } |
| 85 | 82 | } |
| 86 | 83 | |
| 87 | − if (!dr) | |
| 88 | − return -ENODATA; | |
| 89 | − | |
| 90 | 84 | tables->route_values = rv; |
| 91 | 85 | tables->valid_routes = dr; |
| 92 | 86 | |
| 87 | + if (!rv || !dr) | |
| 88 | + return -ENODATA; | |
| 89 | + | |
| 93 | 90 | return 0; |
| 94 | 91 | } |
| 95 | 92 | |
| @@ -487,6 +484,9 @@ int ni_find_route_source(const u8 src_sel_reg_value, int dest, · 391 unmodified lines | ||
| 487 | 484 | { |
| 488 | 485 | int src; |
| 489 | 486 | |
| 487 | + if (!tables->route_values) | |
| 488 | + return -EINVAL; | |
| 489 | + | |
| 490 | 490 | dest = B(dest); /* subtract NI names offset */ |
| 491 | 491 | /* ensure we are not going to under/over run the route value table */ |
| 492 | 492 | if (dest < 0 || dest >= NI_NUM_NAMES) |
| @@ -28,9 +28,22 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm, · 27 unmodified lines | ||
| 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; |
| @@ -1192,6 +1192,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) · 1191 unmodified lines | ||
| 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); |
| @@ -642,9 +642,13 @@ static int ch341_tiocmget(struct tty_struct *tty) · 641 unmodified lines | ||
| 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 | 647 | |
| 648 | + priv = usb_get_serial_port_data(port); | |
| 649 | + if (!priv) | |
| 650 | + return 0; | |
| 651 | + | |
| 648 | 652 | /* reconfigure ch341 serial port after bus-reset */ |
| 649 | 653 | ch341_configure(serial->dev, priv); |
| 650 | 654 | |
| @@ -716,7 +716,7 @@ static void edge_interrupt_callback(struct urb *urb) · 715 unmodified lines | ||
| 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,7 +1725,8 @@ static void edge_break(struct tty_struct *tty, int break_state) · 1002 unmodified lines | ||
| 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; |
| @@ -1821,11 +1822,10 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial, · 89 unmodified lines | ||
| 1821 | 1822 | |
| 1822 | 1823 | /* spit this data back into the tty driver if this |
| 1823 | 1824 | port is open */ |
| 1824 | − if (rxLen) { | |
| 1825 | − port = edge_serial->serial->port[ | |
| 1826 | − edge_serial->rxPort]; | |
| 1825 | + if (rxLen && edge_serial->rxPort < serial->num_ports) { | |
| 1826 | + port = serial->port[edge_serial->rxPort]; | |
| 1827 | 1827 | edge_port = usb_get_serial_port_data(port); |
| 1828 | − if (edge_port->open) { | |
| 1828 | + if (edge_port && edge_port->open) { | |
| 1829 | 1829 | dev_dbg(dev, "%s - Sending %d bytes to TTY for port %d\n", |
| 1830 | 1830 | __func__, rxLen, |
| 1831 | 1831 | edge_serial->rxPort); |
| @@ -1833,8 +1833,8 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial, · 1 unmodified line | ||
| 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,6 +1869,8 @@ static void process_rcvd_status(struct edgeport_serial *edge_serial, · 28 unmodified lines | ||
| 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) { |
| @@ -1058,6 +1058,8 @@ static void usa49_glocont_callback(struct urb *urb) · 1057 unmodified lines | ||
| 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__); |
| @@ -1459,6 +1461,8 @@ static void usa67_glocont_callback(struct urb *urb) · 395 unmodified lines | ||
| 1459 | 1461 | for (i = 0; i < serial->num_ports; ++i) { |
| 1460 | 1462 | port = serial->port[i]; |
| 1461 | 1463 | p_priv = usb_get_serial_port_data(port); |
| 1464 | + if (!p_priv) | |
| 1465 | + continue; | |
| 1462 | 1466 | |
| 1463 | 1467 | if (p_priv->resend_cont) { |
| 1464 | 1468 | dev_dbg(&port->dev, "%s - sending setup\n", __func__); |
| @@ -113,7 +113,7 @@ static int send_control_msg(struct usb_serial_port *port, u8 requesttype, · 112 unmodified lines | ||
| 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) |
| @@ -248,6 +248,7 @@ static void option_instat_callback(struct urb *urb); · 247 unmodified lines | ||
| 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 |
| @@ -1104,6 +1105,11 @@ static const struct usb_device_id option_ids[] = { · 850 unmodified lines | ||
| 1104 | 1105 | { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff), |
| 1105 | 1106 | .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 }, |
| 1106 | 1107 | { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) }, |
| 1108 | + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x30) }, | |
| 1109 | + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) }, | |
| 1110 | + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10), | |
| 1111 | + .driver_info = ZLP }, | |
| 1112 | + | |
| 1107 | 1113 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, |
| 1108 | 1114 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) }, |
| 1109 | 1115 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003), |
| @@ -841,7 +841,10 @@ static void qt2_update_msr(struct usb_serial_port *port, unsigned char *ch) · 840 unmodified lines | ||
| 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; |
| @@ -869,7 +872,10 @@ static void qt2_update_lsr(struct usb_serial_port *port, unsigned char *ch) · 21 unmodified lines | ||
| 869 | 872 | unsigned long flags; |
| 870 | 873 | u8 newLSR = (u8) *ch; |
| 871 | 874 | |
| 875 | + /* May be called from qt2_process_read_urb() for an unbound port. */ | |
| 872 | 876 | port_priv = usb_get_serial_port_data(port); |
| 877 | + if (!port_priv) | |
| 878 | + return; | |
| 873 | 879 | |
| 874 | 880 | if (newLSR & UART_LSR_BI) |
| 875 | 881 | newLSR &= (u8) (UART_LSR_OE | UART_LSR_BI); |
| @@ -86,6 +86,8 @@ DEVICE(moto_modem, MOTO_IDS); · 85 unmodified lines | ||
| 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 | |
| @@ -1317,6 +1317,9 @@ static int usb_serial_register(struct usb_serial_driver *driver) · 1316 unmodified lines | ||
| 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 */ |
| @@ -908,6 +908,7 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry, · 907 unmodified lines | ||
| 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; |
| @@ -951,21 +952,18 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry, · 37 unmodified lines | ||
| 951 | 952 | afs_stat_v(dvnode, n_lookup); |
| 952 | 953 | inode = afs_do_lookup(dir, dentry, key); |
| 953 | 954 | key_put(key); |
| 954 | − if (inode == ERR_PTR(-ENOENT)) { | |
| 955 | + if (inode == ERR_PTR(-ENOENT)) | |
| 955 | 956 | inode = afs_try_auto_mntpt(dentry, dir); |
| 956 | − } else { | |
| 957 | − dentry->d_fsdata = | |
| 958 | − (void *)(unsigned long)dvnode->status.data_version; | |
| 959 | − } | |
| 957 | + | |
| 958 | + if (!IS_ERR_OR_NULL(inode)) | |
| 959 | + fid = AFS_FS_I(inode)->fid; | |
| 960 | + | |
| 960 | 961 | d = d_splice_alias(inode, dentry); |
| 961 | 962 | if (!IS_ERR_OR_NULL(d)) { |
| 962 | 963 | d->d_fsdata = dentry->d_fsdata; |
| 963 | − trace_afs_lookup(dvnode, &d->d_name, | |
| 964 | − inode ? AFS_FS_I(inode) : NULL); | |
| 964 | + trace_afs_lookup(dvnode, &d->d_name, &fid); | |
| 965 | 965 | } else { |
| 966 | − trace_afs_lookup(dvnode, &dentry->d_name, | |
| 967 | − IS_ERR_OR_NULL(inode) ? NULL | |
| 968 | − : AFS_FS_I(inode)); | |
| 966 | + trace_afs_lookup(dvnode, &dentry->d_name, &fid); | |
| 969 | 967 | } |
| 970 | 968 | return d; |
| 971 | 969 | } |
| @@ -4238,18 +4238,30 @@ out: · 4237 unmodified lines | ||
| 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)); |
| 4252 | 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 | + } | |
| 4264 | + | |
| 4253 | 4265 | path = btrfs_alloc_path(); |
| 4254 | 4266 | if (!path) |
| 4255 | 4267 | return -ENOMEM; |
| @@ -4271,13 +4283,16 @@ static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, · 15 unmodified lines | ||
| 4271 | 4283 | } |
| 4272 | 4284 | btrfs_release_path(path); |
| 4273 | 4285 | |
| 4274 | − ret = btrfs_del_root_ref(trans, objectid, root->root_key.objectid, | |
| 4275 | − dir_ino, &index, name, name_len); | |
| 4276 | − if (ret < 0) { | |
| 4277 | − if (ret != -ENOENT) { | |
| 4278 | − btrfs_abort_transaction(trans, ret); | |
| 4279 | − goto out; | |
| 4280 | − } | |
| 4286 | + /* | |
| 4287 | + * This is a placeholder inode for a subvolume we didn't have a | |
| 4288 | + * reference to at the time of the snapshot creation. In the meantime | |
| 4289 | + * we could have renamed the real subvol link into our snapshot, so | |
| 4290 | + * depending on btrfs_del_root_ref to return -ENOENT here is incorret. | |
| 4291 | + * Instead simply lookup the dir_index_item for this entry so we can | |
| 4292 | + * remove it. Otherwise we know we have a ref to the root and we can | |
| 4293 | + * call btrfs_del_root_ref, and it _shouldn't_ fail. | |
| 4294 | + */ | |
| 4295 | + if (btrfs_ino(inode) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) { | |
| 4281 | 4296 | di = btrfs_search_dir_index_item(root, path, dir_ino, |
| 4282 | 4297 | name, name_len); |
| 4283 | 4298 | if (IS_ERR_OR_NULL(di)) { |
| @@ -4292,8 +4307,16 @@ static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, · 8 unmodified lines | ||
| 4292 | 4307 | leaf = path->nodes[0]; |
| 4293 | 4308 | btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); |
| 4294 | 4309 | index = key.offset; |
| 4310 | + btrfs_release_path(path); | |
| 4311 | + } else { | |
| 4312 | + ret = btrfs_del_root_ref(trans, objectid, | |
| 4313 | + root->root_key.objectid, dir_ino, | |
| 4314 | + &index, name, name_len); | |
| 4315 | + if (ret) { | |
| 4316 | + btrfs_abort_transaction(trans, ret); | |
| 4317 | + goto out; | |
| 4318 | + } | |
| 4295 | 4319 | } |
| 4296 | − btrfs_release_path(path); | |
| 4297 | 4320 | |
| 4298 | 4321 | ret = btrfs_delete_delayed_dir_index(trans, BTRFS_I(dir), index); |
| 4299 | 4322 | if (ret) { |
| @@ -4487,8 +4510,7 @@ int btrfs_delete_subvolume(struct inode *dir, struct dentry *dentry) · 187 unmodified lines | ||
| 4487 | 4510 | |
| 4488 | 4511 | btrfs_record_snapshot_destroy(trans, BTRFS_I(dir)); |
| 4489 | 4512 | |
| 4490 | − ret = btrfs_unlink_subvol(trans, dir, dest->root_key.objectid, | |
| 4491 | − dentry->d_name.name, dentry->d_name.len); | |
| 4513 | + ret = btrfs_unlink_subvol(trans, dir, dentry); | |
| 4492 | 4514 | if (ret) { |
| 4493 | 4515 | err = ret; |
| 4494 | 4516 | btrfs_abort_transaction(trans, ret); |
| @@ -4583,10 +4605,7 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry) · 88 unmodified lines | ||
| 4583 | 4605 | return PTR_ERR(trans); |
| 4584 | 4606 | |
| 4585 | 4607 | if (unlikely(btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { |
| 4586 | − err = btrfs_unlink_subvol(trans, dir, | |
| 4587 | − BTRFS_I(inode)->location.objectid, | |
| 4588 | − dentry->d_name.name, | |
| 4589 | − dentry->d_name.len); | |
| 4608 | + err = btrfs_unlink_subvol(trans, dir, dentry); | |
| 4590 | 4609 | goto out; |
| 4591 | 4610 | } |
| 4592 | 4611 | |
| @@ -9536,7 +9555,6 @@ static int btrfs_rename_exchange(struct inode *old_dir, · 4943 unmodified lines | ||
| 9536 | 9555 | u64 new_ino = btrfs_ino(BTRFS_I(new_inode)); |
| 9537 | 9556 | u64 old_idx = 0; |
| 9538 | 9557 | u64 new_idx = 0; |
| 9539 | − u64 root_objectid; | |
| 9540 | 9558 | int ret; |
| 9541 | 9559 | bool root_log_pinned = false; |
| 9542 | 9560 | bool dest_log_pinned = false; |
| @@ -9642,10 +9660,7 @@ static int btrfs_rename_exchange(struct inode *old_dir, · 99 unmodified lines | ||
| 9642 | 9660 | |
| 9643 | 9661 | /* src is a subvolume */ |
| 9644 | 9662 | if (old_ino == BTRFS_FIRST_FREE_OBJECTID) { |
| 9645 | − root_objectid = BTRFS_I(old_inode)->root->root_key.objectid; | |
| 9646 | − ret = btrfs_unlink_subvol(trans, old_dir, root_objectid, | |
| 9647 | − old_dentry->d_name.name, | |
| 9648 | − old_dentry->d_name.len); | |
| 9663 | + ret = btrfs_unlink_subvol(trans, old_dir, old_dentry); | |
| 9649 | 9664 | } else { /* src is an inode */ |
| 9650 | 9665 | ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir), |
| 9651 | 9666 | BTRFS_I(old_dentry->d_inode), |
| @@ -9661,10 +9676,7 @@ static int btrfs_rename_exchange(struct inode *old_dir, · 9 unmodified lines | ||
| 9661 | 9676 | |
| 9662 | 9677 | /* dest is a subvolume */ |
| 9663 | 9678 | if (new_ino == BTRFS_FIRST_FREE_OBJECTID) { |
| 9664 | − root_objectid = BTRFS_I(new_inode)->root->root_key.objectid; | |
| 9665 | − ret = btrfs_unlink_subvol(trans, new_dir, root_objectid, | |
| 9666 | − new_dentry->d_name.name, | |
| 9667 | − new_dentry->d_name.len); | |
| 9679 | + ret = btrfs_unlink_subvol(trans, new_dir, new_dentry); | |
| 9668 | 9680 | } else { /* dest is an inode */ |
| 9669 | 9681 | ret = __btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir), |
| 9670 | 9682 | BTRFS_I(new_dentry->d_inode), |
| @@ -9862,7 +9874,6 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 191 unmodified lines | ||
| 9862 | 9874 | struct inode *new_inode = d_inode(new_dentry); |
| 9863 | 9875 | struct inode *old_inode = d_inode(old_dentry); |
| 9864 | 9876 | u64 index = 0; |
| 9865 | − u64 root_objectid; | |
| 9866 | 9877 | int ret; |
| 9867 | 9878 | u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); |
| 9868 | 9879 | bool log_pinned = false; |
| @@ -9970,10 +9981,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 101 unmodified lines | ||
| 9970 | 9981 | BTRFS_I(old_inode), 1); |
| 9971 | 9982 | |
| 9972 | 9983 | if (unlikely(old_ino == BTRFS_FIRST_FREE_OBJECTID)) { |
| 9973 | − root_objectid = BTRFS_I(old_inode)->root->root_key.objectid; | |
| 9974 | − ret = btrfs_unlink_subvol(trans, old_dir, root_objectid, | |
| 9975 | − old_dentry->d_name.name, | |
| 9976 | − old_dentry->d_name.len); | |
| 9984 | + ret = btrfs_unlink_subvol(trans, old_dir, old_dentry); | |
| 9977 | 9985 | } else { |
| 9978 | 9986 | ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir), |
| 9979 | 9987 | BTRFS_I(d_inode(old_dentry)), |
| @@ -9992,10 +10000,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 12 unmodified lines | ||
| 9992 | 10000 | new_inode->i_ctime = current_time(new_inode); |
| 9993 | 10001 | if (unlikely(btrfs_ino(BTRFS_I(new_inode)) == |
| 9994 | 10002 | BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { |
| 9995 | − root_objectid = BTRFS_I(new_inode)->location.objectid; | |
| 9996 | − ret = btrfs_unlink_subvol(trans, new_dir, root_objectid, | |
| 9997 | − new_dentry->d_name.name, | |
| 9998 | − new_dentry->d_name.len); | |
| 10003 | + ret = btrfs_unlink_subvol(trans, new_dir, new_dentry); | |
| 9999 | 10004 | BUG_ON(new_inode->i_nlink == 0); |
| 10000 | 10005 | } else { |
| 10001 | 10006 | ret = btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir), |
| @@ -4252,7 +4252,19 @@ static long btrfs_ioctl_scrub(struct file *file, void __user *arg) · 4251 unmodified lines | ||
| 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)) |
| @@ -2423,8 +2423,12 @@ int btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans, u64 bytenr, · 2422 unmodified lines | ||
| 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)) |
| @@ -517,6 +517,34 @@ static int update_backref_cache(struct btrfs_trans_handle *trans, · 516 unmodified lines | ||
| 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 | { |
| @@ -525,6 +553,10 @@ static int should_ignore_root(struct btrfs_root *root) · 2 unmodified lines | ||
| 525 | 553 | if (!test_bit(BTRFS_ROOT_REF_COWS, &root->state)) |
| 526 | 554 | return 0; |
| 527 | 555 | |
| 556 | + /* This root has been merged with its reloc tree, we can ignore it */ | |
| 557 | + if (reloc_root_is_dead(root)) | |
| 558 | + return 1; | |
| 559 | + | |
| 528 | 560 | reloc_root = root->reloc_root; |
| 529 | 561 | if (!reloc_root) |
| 530 | 562 | return 0; |
| @@ -1439,7 +1471,7 @@ int btrfs_init_reloc_root(struct btrfs_trans_handle *trans, · 908 unmodified lines | ||
| 1439 | 1471 | * The subvolume has reloc tree but the swap is finished, no need to |
| 1440 | 1472 | * create/update the dead reloc tree |
| 1441 | 1473 | */ |
| 1442 | − if (test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state)) | |
| 1474 | + if (reloc_root_is_dead(root)) | |
| 1443 | 1475 | return 0; |
| 1444 | 1476 | |
| 1445 | 1477 | if (root->reloc_root) { |
| @@ -1478,8 +1510,7 @@ int btrfs_update_reloc_root(struct btrfs_trans_handle *trans, · 32 unmodified lines | ||
| 1478 | 1510 | struct btrfs_root_item *root_item; |
| 1479 | 1511 | int ret; |
| 1480 | 1512 | |
| 1481 | − if (test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state) || | |
| 1482 | − !root->reloc_root) | |
| 1513 | + if (!have_reloc_root(root)) | |
| 1483 | 1514 | goto out; |
| 1484 | 1515 | |
| 1485 | 1516 | reloc_root = root->reloc_root; |
| @@ -1489,6 +1520,11 @@ int btrfs_update_reloc_root(struct btrfs_trans_handle *trans, · 3 unmodified lines | ||
| 1489 | 1520 | if (fs_info->reloc_ctl->merge_reloc_tree && |
| 1490 | 1521 | btrfs_root_refs(root_item) == 0) { |
| 1491 | 1522 | set_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state); |
| 1523 | + /* | |
| 1524 | + * Mark the tree as dead before we change reloc_root so | |
| 1525 | + * have_reloc_root will not touch it from now on. | |
| 1526 | + */ | |
| 1527 | + smp_wmb(); | |
| 1492 | 1528 | __del_reloc_root(reloc_root); |
| 1493 | 1529 | } |
| 1494 | 1530 | |
| @@ -2201,6 +2237,11 @@ static int clean_dirty_subvols(struct reloc_control *rc) · 706 unmodified lines | ||
| 2201 | 2237 | if (ret2 < 0 && !ret) |
| 2202 | 2238 | ret = ret2; |
| 2203 | 2239 | } |
| 2240 | + /* | |
| 2241 | + * Need barrier to ensure clear_bit() only happens after | |
| 2242 | + * root->reloc_root = NULL. Pairs with have_reloc_root. | |
| 2243 | + */ | |
| 2244 | + smp_wmb(); | |
| 2204 | 2245 | clear_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state); |
| 2205 | 2246 | btrfs_put_fs_root(root); |
| 2206 | 2247 | } else { |
| @@ -4718,7 +4759,7 @@ void btrfs_reloc_pre_snapshot(struct btrfs_pending_snapshot *pending, · 2511 unmodified lines | ||
| 4718 | 4759 | struct btrfs_root *root = pending->root; |
| 4719 | 4760 | struct reloc_control *rc = root->fs_info->reloc_ctl; |
| 4720 | 4761 | |
| 4721 | − if (!root->reloc_root || !rc) | |
| 4762 | + if (!rc || !have_reloc_root(root)) | |
| 4722 | 4763 | return; |
| 4723 | 4764 | |
| 4724 | 4765 | if (!rc->merge_reloc_tree) |
| @@ -4752,7 +4793,7 @@ int btrfs_reloc_post_snapshot(struct btrfs_trans_handle *trans, · 27 unmodified lines | ||
| 4752 | 4793 | struct reloc_control *rc = root->fs_info->reloc_ctl; |
| 4753 | 4794 | int ret; |
| 4754 | 4795 | |
| 4755 | − if (!root->reloc_root || !rc) | |
| 4796 | + if (!rc || !have_reloc_root(root)) | |
| 4756 | 4797 | return 0; |
| 4757 | 4798 | |
| 4758 | 4799 | rc = root->fs_info->reloc_ctl; |
| @@ -376,11 +376,13 @@ again: · 375 unmodified lines | ||
| 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); |
| @@ -3881,7 +3881,11 @@ int btrfs_balance(struct btrfs_fs_info *fs_info, · 3880 unmodified lines | ||
| 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 |
| @@ -882,6 +882,7 @@ static void fuse_send_readpages(struct fuse_io_args *ia, struct file *file) · 881 unmodified lines | ||
| 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; |
| @@ -896,7 +897,8 @@ static void fuse_send_readpages(struct fuse_io_args *ia, struct file *file) · 8 unmodified lines | ||
| 896 | 897 | if (!err) |
| 897 | 898 | return; |
| 898 | 899 | } else { |
| 899 | − err = fuse_simple_request(fc, &ap->args); | |
| 900 | + res = fuse_simple_request(fc, &ap->args); | |
| 901 | + err = res < 0 ? res : 0; | |
| 900 | 902 | } |
| 901 | 903 | fuse_readpages_end(fc, &ap->args, err); |
| 902 | 904 | } |
| @@ -445,10 +445,14 @@ next: · 444 unmodified lines | ||
| 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); |
| @@ -1786,6 +1786,9 @@ static int io_setup_async_rw(struct io_kiocb *req, ssize_t io_size, · 1785 unmodified lines | ||
| 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 | |
| @@ -1840,6 +1843,7 @@ static int io_read(struct io_kiocb *req, struct io_kiocb **nxt, · 48 unmodified lines | ||
| 1840 | 1843 | if (!force_nonblock) |
| 1841 | 1844 | req->rw.kiocb.ki_flags &= ~IOCB_NOWAIT; |
| 1842 | 1845 | |
| 1846 | + req->result = 0; | |
| 1843 | 1847 | io_size = ret; |
| 1844 | 1848 | if (req->flags & REQ_F_LINK) |
| 1845 | 1849 | req->result = io_size; |
| @@ -1927,6 +1931,7 @@ static int io_write(struct io_kiocb *req, struct io_kiocb **nxt, · 81 unmodified lines | ||
| 1927 | 1931 | if (!force_nonblock) |
| 1928 | 1932 | req->rw.kiocb.ki_flags &= ~IOCB_NOWAIT; |
| 1929 | 1933 | |
| 1934 | + req->result = 0; | |
| 1930 | 1935 | io_size = ret; |
| 1931 | 1936 | if (req->flags & REQ_F_LINK) |
| 1932 | 1937 | req->result = io_size; |
| @@ -2034,6 +2039,28 @@ static bool io_req_cancelled(struct io_kiocb *req) · 101 unmodified lines | ||
| 2034 | 2039 | return false; |
| 2035 | 2040 | } |
| 2036 | 2041 | |
| 2042 | +static void io_link_work_cb(struct io_wq_work **workptr) | |
| 2043 | +{ | |
| 2044 | + struct io_wq_work *work = *workptr; | |
| 2045 | + struct io_kiocb *link = work->data; | |
| 2046 | + | |
| 2047 | + io_queue_linked_timeout(link); | |
| 2048 | + work->func = io_wq_submit_work; | |
| 2049 | +} | |
| 2050 | + | |
| 2051 | +static void io_wq_assign_next(struct io_wq_work **workptr, struct io_kiocb *nxt) | |
| 2052 | +{ | |
| 2053 | + struct io_kiocb *link; | |
| 2054 | + | |
| 2055 | + io_prep_async_work(nxt, &link); | |
| 2056 | + *workptr = &nxt->work; | |
| 2057 | + if (link) { | |
| 2058 | + nxt->work.flags |= IO_WQ_WORK_CB; | |
| 2059 | + nxt->work.func = io_link_work_cb; | |
| 2060 | + nxt->work.data = link; | |
| 2061 | + } | |
| 2062 | +} | |
| 2063 | + | |
| 2037 | 2064 | static void io_fsync_finish(struct io_wq_work **workptr) |
| 2038 | 2065 | { |
| 2039 | 2066 | struct io_kiocb *req = container_of(*workptr, struct io_kiocb, work); |
| @@ -2052,7 +2079,7 @@ static void io_fsync_finish(struct io_wq_work **workptr) · 12 unmodified lines | ||
| 2052 | 2079 | io_cqring_add_event(req, ret); |
| 2053 | 2080 | io_put_req_find_next(req, &nxt); |
| 2054 | 2081 | if (nxt) |
| 2055 | − *workptr = &nxt->work; | |
| 2082 | + io_wq_assign_next(workptr, nxt); | |
| 2056 | 2083 | } |
| 2057 | 2084 | |
| 2058 | 2085 | static int io_fsync(struct io_kiocb *req, struct io_kiocb **nxt, |
| @@ -2108,7 +2135,7 @@ static void io_sync_file_range_finish(struct io_wq_work **workptr) · 49 unmodified lines | ||
| 2108 | 2135 | io_cqring_add_event(req, ret); |
| 2109 | 2136 | io_put_req_find_next(req, &nxt); |
| 2110 | 2137 | if (nxt) |
| 2111 | − *workptr = &nxt->work; | |
| 2138 | + io_wq_assign_next(workptr, nxt); | |
| 2112 | 2139 | } |
| 2113 | 2140 | |
| 2114 | 2141 | static int io_sync_file_range(struct io_kiocb *req, struct io_kiocb **nxt, |
| @@ -2374,7 +2401,7 @@ static void io_accept_finish(struct io_wq_work **workptr) · 259 unmodified lines | ||
| 2374 | 2401 | return; |
| 2375 | 2402 | __io_accept(req, &nxt, false); |
| 2376 | 2403 | if (nxt) |
| 2377 | − *workptr = &nxt->work; | |
| 2404 | + io_wq_assign_next(workptr, nxt); | |
| 2378 | 2405 | } |
| 2379 | 2406 | #endif |
| 2380 | 2407 | |
| @@ -2605,7 +2632,7 @@ static void io_poll_complete_work(struct io_wq_work **workptr) · 224 unmodified lines | ||
| 2605 | 2632 | req_set_fail_links(req); |
| 2606 | 2633 | io_put_req_find_next(req, &nxt); |
| 2607 | 2634 | if (nxt) |
| 2608 | − *workptr = &nxt->work; | |
| 2635 | + io_wq_assign_next(workptr, nxt); | |
| 2609 | 2636 | } |
| 2610 | 2637 | |
| 2611 | 2638 | static int io_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync, |
| @@ -3259,24 +3286,24 @@ static int io_issue_sqe(struct io_kiocb *req, const struct io_uring_sqe *sqe, · 647 unmodified lines | ||
| 3259 | 3286 | return ret; |
| 3260 | 3287 | |
| 3261 | 3288 | if (ctx->flags & IORING_SETUP_IOPOLL) { |
| 3289 | + const bool in_async = io_wq_current_is_worker(); | |
| 3290 | + | |
| 3262 | 3291 | if (req->result == -EAGAIN) |
| 3263 | 3292 | return -EAGAIN; |
| 3264 | 3293 | |
| 3294 | + /* workqueue context doesn't hold uring_lock, grab it now */ | |
| 3295 | + if (in_async) | |
| 3296 | + mutex_lock(&ctx->uring_lock); | |
| 3297 | + | |
| 3265 | 3298 | io_iopoll_req_issued(req); |
| 3299 | + | |
| 3300 | + if (in_async) | |
| 3301 | + mutex_unlock(&ctx->uring_lock); | |
| 3266 | 3302 | } |
| 3267 | 3303 | |
| 3268 | 3304 | return 0; |
| 3269 | 3305 | } |
| 3270 | 3306 | |
| 3271 | −static void io_link_work_cb(struct io_wq_work **workptr) | |
| 3272 | −{ | |
| 3273 | − struct io_wq_work *work = *workptr; | |
| 3274 | − struct io_kiocb *link = work->data; | |
| 3275 | − | |
| 3276 | − io_queue_linked_timeout(link); | |
| 3277 | − work->func = io_wq_submit_work; | |
| 3278 | −} | |
| 3279 | − | |
| 3280 | 3307 | static void io_wq_submit_work(struct io_wq_work **workptr) |
| 3281 | 3308 | { |
| 3282 | 3309 | struct io_wq_work *work = *workptr; |
| @@ -3313,17 +3340,8 @@ static void io_wq_submit_work(struct io_wq_work **workptr) · 30 unmodified lines | ||
| 3313 | 3340 | } |
| 3314 | 3341 | |
| 3315 | 3342 | /* if a dependent link is ready, pass it back */ |
| 3316 | − if (!ret && nxt) { | |
| 3317 | − struct io_kiocb *link; | |
| 3318 | − | |
| 3319 | − io_prep_async_work(nxt, &link); | |
| 3320 | − *workptr = &nxt->work; | |
| 3321 | − if (link) { | |
| 3322 | − nxt->work.flags |= IO_WQ_WORK_CB; | |
| 3323 | − nxt->work.func = io_link_work_cb; | |
| 3324 | − nxt->work.data = link; | |
| 3325 | − } | |
| 3326 | − } | |
| 3343 | + if (!ret && nxt) | |
| 3344 | + io_wq_assign_next(workptr, nxt); | |
| 3327 | 3345 | } |
| 3328 | 3346 | |
| 3329 | 3347 | static bool io_req_op_valid(int op) |
| @@ -5141,6 +5159,12 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit, · 1811 unmodified lines | ||
| 5141 | 5159 | } else if (to_submit) { |
| 5142 | 5160 | struct mm_struct *cur_mm; |
| 5143 | 5161 | |
| 5162 | + if (current->mm != ctx->sqo_mm || | |
| 5163 | + current_cred() != ctx->creds) { | |
| 5164 | + ret = -EPERM; | |
| 5165 | + goto out; | |
| 5166 | + } | |
| 5167 | + | |
| 5144 | 5168 | to_submit = min(to_submit, ctx->sq_entries); |
| 5145 | 5169 | mutex_lock(&ctx->uring_lock); |
| 5146 | 5170 | /* already have mm, so io_submit_sqes() won't try to grab it */ |
| @@ -1232,6 +1232,7 @@ static int follow_managed(struct path *path, struct nameidata *nd) · 1231 unmodified lines | ||
| 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 | } |
| @@ -1649,17 +1650,15 @@ again: · 411 unmodified lines | ||
| 1649 | 1650 | if (IS_ERR(dentry)) |
| 1650 | 1651 | return dentry; |
| 1651 | 1652 | if (unlikely(!d_in_lookup(dentry))) { |
| 1652 | − if (!(flags & LOOKUP_NO_REVAL)) { | |
| 1653 | − int error = d_revalidate(dentry, flags); | |
| 1654 | − if (unlikely(error <= 0)) { | |
| 1655 | − if (!error) { | |
| 1656 | − d_invalidate(dentry); | |
| 1657 | − dput(dentry); | |
| 1658 | − goto again; | |
| 1659 | − } | |
| 1653 | + int error = d_revalidate(dentry, flags); | |
| 1654 | + if (unlikely(error <= 0)) { | |
| 1655 | + if (!error) { | |
| 1656 | + d_invalidate(dentry); | |
| 1660 | 1657 | dput(dentry); |
| 1661 | − dentry = ERR_PTR(error); | |
| 1658 | + goto again; | |
| 1662 | 1659 | } |
| 1660 | + dput(dentry); | |
| 1661 | + dentry = ERR_PTR(error); | |
| 1663 | 1662 | } |
| 1664 | 1663 | } else { |
| 1665 | 1664 | old = inode->i_op->lookup(inode, dentry, flags); |
| @@ -2617,72 +2616,6 @@ int user_path_at_empty(int dfd, const char __user *name, unsigned flags, · 951 unmodified lines | ||
| 2617 | 2616 | } |
| 2618 | 2617 | EXPORT_SYMBOL(user_path_at_empty); |
| 2619 | 2618 | |
| 2620 | −/** | |
| 2621 | − * mountpoint_last - look up last component for umount | |
| 2622 | − * @nd: pathwalk nameidata - currently pointing at parent directory of "last" | |
| 2623 | − * | |
| 2624 | − * This is a special lookup_last function just for umount. In this case, we | |
| 2625 | − * need to resolve the path without doing any revalidation. | |
| 2626 | − * | |
| 2627 | − * The nameidata should be the result of doing a LOOKUP_PARENT pathwalk. Since | |
| 2628 | − * mountpoints are always pinned in the dcache, their ancestors are too. Thus, | |
| 2629 | − * in almost all cases, this lookup will be served out of the dcache. The only | |
| 2630 | − * cases where it won't are if nd->last refers to a symlink or the path is | |
| 2631 | − * bogus and it doesn't exist. | |
| 2632 | − * | |
| 2633 | − * Returns: | |
| 2634 | − * -error: if there was an error during lookup. This includes -ENOENT if the | |
| 2635 | − * lookup found a negative dentry. | |
| 2636 | − * | |
| 2637 | − * 0: if we successfully resolved nd->last and found it to not to be a | |
| 2638 | − * symlink that needs to be followed. | |
| 2639 | − * | |
| 2640 | − * 1: if we successfully resolved nd->last and found it to be a symlink | |
| 2641 | − * that needs to be followed. | |
| 2642 | − */ | |
| 2643 | −static int | |
| 2644 | −mountpoint_last(struct nameidata *nd) | |
| 2645 | −{ | |
| 2646 | − int error = 0; | |
| 2647 | − struct dentry *dir = nd->path.dentry; | |
| 2648 | − struct path path; | |
| 2649 | − | |
| 2650 | − /* If we're in rcuwalk, drop out of it to handle last component */ | |
| 2651 | − if (nd->flags & LOOKUP_RCU) { | |
| 2652 | − if (unlazy_walk(nd)) | |
| 2653 | − return -ECHILD; | |
| 2654 | − } | |
| 2655 | − | |
| 2656 | − nd->flags &= ~LOOKUP_PARENT; | |
| 2657 | − | |
| 2658 | − if (unlikely(nd->last_type != LAST_NORM)) { | |
| 2659 | − error = handle_dots(nd, nd->last_type); | |
| 2660 | − if (error) | |
| 2661 | − return error; | |
| 2662 | − path.dentry = dget(nd->path.dentry); | |
| 2663 | − } else { | |
| 2664 | − path.dentry = d_lookup(dir, &nd->last); | |
| 2665 | − if (!path.dentry) { | |
| 2666 | − /* | |
| 2667 | − * No cached dentry. Mounted dentries are pinned in the | |
| 2668 | − * cache, so that means that this dentry is probably | |
| 2669 | − * a symlink or the path doesn't actually point | |
| 2670 | − * to a mounted dentry. | |
| 2671 | − */ | |
| 2672 | − path.dentry = lookup_slow(&nd->last, dir, | |
| 2673 | − nd->flags | LOOKUP_NO_REVAL); | |
| 2674 | − if (IS_ERR(path.dentry)) | |
| 2675 | − return PTR_ERR(path.dentry); | |
| 2676 | − } | |
| 2677 | − } | |
| 2678 | − if (d_flags_negative(smp_load_acquire(&path.dentry->d_flags))) { | |
| 2679 | − dput(path.dentry); | |
| 2680 | − return -ENOENT; | |
| 2681 | − } | |
| 2682 | − path.mnt = nd->path.mnt; | |
| 2683 | − return step_into(nd, &path, 0, d_backing_inode(path.dentry), 0); | |
| 2684 | −} | |
| 2685 | − | |
| 2686 | 2619 | /** |
| 2687 | 2620 | * path_mountpoint - look up a path to be umounted |
| 2688 | 2621 | * @nd: lookup context |
| @@ -2699,14 +2632,17 @@ path_mountpoint(struct nameidata *nd, unsigned flags, struct path *path) · 10 unmodified lines | ||
| 2699 | 2632 | int err; |
| 2700 | 2633 | |
| 2701 | 2634 | while (!(err = link_path_walk(s, nd)) && |
| 2702 | − (err = mountpoint_last(nd)) > 0) { | |
| 2635 | + (err = lookup_last(nd)) > 0) { | |
| 2703 | 2636 | s = trailing_symlink(nd); |
| 2704 | 2637 | } |
| 2638 | + if (!err && (nd->flags & LOOKUP_RCU)) | |
| 2639 | + err = unlazy_walk(nd); | |
| 2640 | + if (!err) | |
| 2641 | + err = handle_lookup_down(nd); | |
| 2705 | 2642 | if (!err) { |
| 2706 | 2643 | *path = nd->path; |
| 2707 | 2644 | nd->path.mnt = NULL; |
| 2708 | 2645 | nd->path.dentry = NULL; |
| 2709 | − follow_mount(path); | |
| 2710 | 2646 | } |
| 2711 | 2647 | terminate_walk(nd); |
| 2712 | 2648 | return err; |
| @@ -206,7 +206,6 @@ TRACE_DEFINE_ENUM(LOOKUP_AUTOMOUNT); · 205 unmodified lines | ||
| 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); |
| @@ -224,7 +223,6 @@ TRACE_DEFINE_ENUM(LOOKUP_DOWN); · 11 unmodified lines | ||
| 224 | 223 | { LOOKUP_PARENT, "PARENT" }, \ |
| 225 | 224 | { LOOKUP_REVAL, "REVAL" }, \ |
| 226 | 225 | { LOOKUP_RCU, "RCU" }, \ |
| 227 | − { LOOKUP_NO_REVAL, "NO_REVAL" }, \ | |
| 228 | 226 | { LOOKUP_OPEN, "OPEN" }, \ |
| 229 | 227 | { LOOKUP_CREATE, "CREATE" }, \ |
| 230 | 228 | { LOOKUP_EXCL, "EXCL" }, \ |
| @@ -11,71 +11,102 @@ · 10 unmodified lines | ||
| 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 */ |
| @@ -605,6 +605,12 @@ struct drm_dp_mst_topology_mgr { · 604 unmodified lines | ||
| 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 | */ |
| @@ -46,9 +46,9 @@ · 45 unmodified lines | ||
| 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 |
| @@ -328,6 +328,7 @@ struct queue_limits { · 327 unmodified lines | ||
| 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; |
| @@ -338,7 +339,6 @@ struct queue_limits { · 4 unmodified lines | ||
| 338 | 339 | unsigned int discard_granularity; |
| 339 | 340 | unsigned int discard_alignment; |
| 340 | 341 | |
| 341 | − unsigned short logical_block_size; | |
| 342 | 342 | unsigned short max_segments; |
| 343 | 343 | unsigned short max_integrity_segments; |
| 344 | 344 | unsigned short max_discard_segments; |
| @@ -1077,7 +1077,7 @@ extern void blk_queue_max_write_same_sectors(struct request_queue *q, · 732 unmodified lines | ||
| 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,7 +1291,7 @@ static inline unsigned int queue_max_segment_size(const struct request_queue *q) · 207 unmodified lines | ||
| 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,7 +1301,7 @@ static inline unsigned short queue_logical_block_size(const struct request_queue · 3 unmodified lines | ||
| 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 | } |
| @@ -2658,13 +2658,25 @@ static inline bool want_init_on_free(void) · 2657 unmodified lines | ||
| 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; |
| @@ -215,9 +215,8 @@ enum node_stat_item { · 214 unmodified lines | ||
| 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, |
| @@ -34,7 +34,6 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; · 33 unmodified lines | ||
| 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 |
| @@ -1929,11 +1929,11 @@ static inline void rseq_migrate(struct task_struct *t) · 1928 unmodified lines | ||
| 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; |
| @@ -358,17 +358,22 @@ static inline void sk_psock_update_proto(struct sock *sk, · 357 unmodified lines | ||
| 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 | |
| @@ -30,7 +30,7 @@ struct tnum tnum_lshift(struct tnum a, u8 shift); · 29 unmodified lines | ||
| 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 */ |
| @@ -3548,6 +3548,9 @@ struct cfg80211_update_owe_info { · 3547 unmodified lines | ||
| 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. |
| @@ -3874,6 +3877,8 @@ struct cfg80211_ops { · 320 unmodified lines | ||
| 3874 | 3877 | struct net_device *dev, |
| 3875 | 3878 | struct cfg80211_chan_def *chandef, |
| 3876 | 3879 | u32 cac_time_ms); |
| 3880 | + void (*end_cac)(struct wiphy *wiphy, | |
| 3881 | + struct net_device *dev); | |
| 3877 | 3882 | int (*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev, |
| 3878 | 3883 | struct cfg80211_update_ft_ies_params *ftie); |
| 3879 | 3884 | int (*crit_proto_start)(struct wiphy *wiphy, |
| @@ -938,7 +938,7 @@ struct devlink_region *devlink_region_create(struct devlink *devlink, · 937 unmodified lines | ||
| 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); |
| @@ -2147,7 +2147,8 @@ struct tcp_ulp_ops { · 2146 unmodified lines | ||
| 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 */ |
| @@ -2162,7 +2163,8 @@ void tcp_unregister_ulp(struct tcp_ulp_ops *type); · 8 unmodified lines | ||
| 2162 | 2163 | int tcp_set_ulp(struct sock *sk, const char *name); |
| 2163 | 2164 | void tcp_get_available_ulp(char *buf, size_t len); |
| 2164 | 2165 | void tcp_cleanup_ulp(struct sock *sk); |
| 2165 | −void tcp_update_ulp(struct sock *sk, struct proto *p); | |
| 2166 | +void tcp_update_ulp(struct sock *sk, struct proto *p, | |
| 2167 | + void (*write_space)(struct sock *sk)); | |
| 2166 | 2168 | |
| 2167 | 2169 | #define MODULE_ALIAS_TCP_ULP(name) \ |
| 2168 | 2170 | __MODULE_INFO(alias, alias_userspace, name); \ |
| @@ -915,9 +915,9 @@ TRACE_EVENT(afs_call_state, · 914 unmodified lines | ||
| 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,13 +928,7 @@ TRACE_EVENT(afs_lookup, · 4 unmodified lines | ||
| 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 | ), |
| @@ -31,7 +31,8 @@ · 30 unmodified lines | ||
| 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 |
| @@ -553,6 +553,7 @@ static void __init mm_init(void) · 552 unmodified lines | ||
| 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(); |
| @@ -44,14 +44,19 @@ struct tnum tnum_rshift(struct tnum a, u8 shift) · 43 unmodified lines | ||
| 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) |
| @@ -5049,9 +5049,16 @@ static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, · 5048 unmodified lines | ||
| 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. |
| @@ -1909,6 +1909,78 @@ void __cpuhp_remove_state(enum cpuhp_state state, bool invoke) · 1908 unmodified lines | ||
| 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) |
| @@ -2063,77 +2135,6 @@ static const struct attribute_group cpuhp_cpu_root_attr_group = { · 148 unmodified lines | ||
| 2063 | 2135 | |
| 2064 | 2136 | #ifdef CONFIG_HOTPLUG_SMT |
| 2065 | 2137 | |
| 2066 | −static void cpuhp_offline_cpu_device(unsigned int cpu) | |
| 2067 | −{ | |
| 2068 | − struct device *dev = get_cpu_device(cpu); | |
| 2069 | − | |
| 2070 | − dev->offline = true; | |
| 2071 | − /* Tell user space about the state change */ | |
| 2072 | − kobject_uevent(&dev->kobj, KOBJ_OFFLINE); | |
| 2073 | −} | |
| 2074 | − | |
| 2075 | −static void cpuhp_online_cpu_device(unsigned int cpu) | |
| 2076 | −{ | |
| 2077 | − struct device *dev = get_cpu_device(cpu); | |
| 2078 | − | |
| 2079 | − dev->offline = false; | |
| 2080 | − /* Tell user space about the state change */ | |
| 2081 | − kobject_uevent(&dev->kobj, KOBJ_ONLINE); | |
| 2082 | −} | |
| 2083 | − | |
| 2084 | −int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval) | |
| 2085 | −{ | |
| 2086 | − int cpu, ret = 0; | |
| 2087 | − | |
| 2088 | − cpu_maps_update_begin(); | |
| 2089 | − for_each_online_cpu(cpu) { | |
| 2090 | − if (topology_is_primary_thread(cpu)) | |
| 2091 | − continue; | |
| 2092 | − ret = cpu_down_maps_locked(cpu, CPUHP_OFFLINE); | |
| 2093 | − if (ret) | |
| 2094 | − break; | |
| 2095 | − /* | |
| 2096 | − * As this needs to hold the cpu maps lock it's impossible | |
| 2097 | − * to call device_offline() because that ends up calling | |
| 2098 | − * cpu_down() which takes cpu maps lock. cpu maps lock | |
| 2099 | − * needs to be held as this might race against in kernel | |
| 2100 | − * abusers of the hotplug machinery (thermal management). | |
| 2101 | − * | |
| 2102 | − * So nothing would update device:offline state. That would | |
| 2103 | − * leave the sysfs entry stale and prevent onlining after | |
| 2104 | − * smt control has been changed to 'off' again. This is | |
| 2105 | − * called under the sysfs hotplug lock, so it is properly | |
| 2106 | − * serialized against the regular offline usage. | |
| 2107 | − */ | |
| 2108 | − cpuhp_offline_cpu_device(cpu); | |
| 2109 | − } | |
| 2110 | − if (!ret) | |
| 2111 | − cpu_smt_control = ctrlval; | |
| 2112 | − cpu_maps_update_done(); | |
| 2113 | − return ret; | |
| 2114 | −} | |
| 2115 | − | |
| 2116 | −int cpuhp_smt_enable(void) | |
| 2117 | −{ | |
| 2118 | − int cpu, ret = 0; | |
| 2119 | − | |
| 2120 | − cpu_maps_update_begin(); | |
| 2121 | − cpu_smt_control = CPU_SMT_ENABLED; | |
| 2122 | − for_each_present_cpu(cpu) { | |
| 2123 | − /* Skip online CPUs and CPUs on offline nodes */ | |
| 2124 | − if (cpu_online(cpu) || !node_online(cpu_to_node(cpu))) | |
| 2125 | − continue; | |
| 2126 | − ret = _cpu_up(cpu, 0, CPUHP_ONLINE); | |
| 2127 | − if (ret) | |
| 2128 | − break; | |
| 2129 | − /* See comment in cpuhp_smt_disable() */ | |
| 2130 | − cpuhp_online_cpu_device(cpu); | |
| 2131 | − } | |
| 2132 | − cpu_maps_update_done(); | |
| 2133 | − return ret; | |
| 2134 | −} | |
| 2135 | − | |
| 2136 | − | |
| 2137 | 2138 | static ssize_t |
| 2138 | 2139 | __store_smt_control(struct device *dev, struct device_attribute *attr, |
| 2139 | 2140 | const char *buf, size_t count) |
| @@ -175,8 +175,8 @@ void exit_creds(struct task_struct *tsk) · 174 unmodified lines | ||
| 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 | |
| @@ -11465,8 +11465,10 @@ SYSCALL_DEFINE5(perf_event_open, · 11464 unmodified lines | ||
| 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(), |
| @@ -1178,6 +1178,7 @@ out_error: · 1177 unmodified lines | ||
| 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. |
| @@ -482,7 +482,7 @@ static struct lock_trace *save_trace(void) · 481 unmodified lines | ||
| 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,10 +490,8 @@ static struct lock_trace *save_trace(void) · 1 unmodified line | ||
| 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 | |
| @@ -502,6 +500,7 @@ static struct lock_trace *save_trace(void) · 2 unmodified lines | ||
| 502 | 500 | |
| 503 | 501 | return NULL; |
| 504 | 502 | } |
| 503 | + trace->nr_entries = stack_trace_save(trace->entries, max_entries, 3); | |
| 505 | 504 | |
| 506 | 505 | hash = jhash(trace->entries, trace->nr_entries * |
| 507 | 506 | sizeof(trace->entries[0]), 0); |
| @@ -1226,8 +1226,8 @@ wait: · 1225 unmodified lines | ||
| 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. */ |
| @@ -264,12 +264,17 @@ static int ptrace_check_attach(struct task_struct *child, bool ignore_state) · 263 unmodified lines | ||
| 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. */ |
| @@ -321,7 +326,7 @@ static int __ptrace_may_access(struct task_struct *task, unsigned int mode) · 45 unmodified lines | ||
| 321 | 326 | gid_eq(caller_gid, tcred->sgid) && |
| 322 | 327 | gid_eq(caller_gid, tcred->gid)) |
| 323 | 328 | goto ok; |
| 324 | − if (ptrace_has_cap(tcred->user_ns, mode)) | |
| 329 | + if (ptrace_has_cap(cred, tcred->user_ns, mode)) | |
| 325 | 330 | goto ok; |
| 326 | 331 | rcu_read_unlock(); |
| 327 | 332 | return -EPERM; |
| @@ -340,7 +345,7 @@ ok: · 12 unmodified lines | ||
| 340 | 345 | mm = task->mm; |
| 341 | 346 | if (mm && |
| 342 | 347 | ((get_dumpable(mm) != SUID_DUMP_USER) && |
| 343 | − !ptrace_has_cap(mm->user_ns, mode))) | |
| 348 | + !ptrace_has_cap(cred, mm->user_ns, mode))) | |
| 344 | 349 | return -EPERM; |
| 345 | 350 | |
| 346 | 351 | return security_ptrace_access_check(task, mode); |
| @@ -310,6 +310,8 @@ SYSCALL_DEFINE4(rseq, struct rseq __user *, rseq, u32, rseq_len, · 309 unmodified lines | ||
| 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; |
| @@ -151,6 +151,9 @@ SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags, · 150 unmodified lines | ||
| 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 |
| @@ -58,8 +58,9 @@ static void tick_do_update_jiffies64(ktime_t now) · 57 unmodified lines | ||
| 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 | |
| @@ -70,8 +71,9 @@ static void tick_do_update_jiffies64(ktime_t now) · 4 unmodified lines | ||
| 70 | 71 | if (delta >= tick_period) { |
| 71 | 72 | |
| 72 | 73 | delta = ktime_sub(delta, tick_period); |
| 73 | − last_jiffies_update = ktime_add(last_jiffies_update, | |
| 74 | − tick_period); | |
| 74 | + /* Pairs with the lockless read in this function. */ | |
| 75 | + WRITE_ONCE(last_jiffies_update, | |
| 76 | + ktime_add(last_jiffies_update, tick_period)); | |
| 75 | 77 | |
| 76 | 78 | /* Slow path for long timeouts */ |
| 77 | 79 | if (unlikely(delta >= tick_period)) { |
| @@ -79,8 +81,10 @@ static void tick_do_update_jiffies64(ktime_t now) · 1 unmodified line | ||
| 79 | 81 | |
| 80 | 82 | ticks = ktime_divns(delta, incr); |
| 81 | 83 | |
| 82 | − last_jiffies_update = ktime_add_ns(last_jiffies_update, | |
| 83 | − incr * ticks); | |
| 84 | + /* Pairs with the lockless read in this function. */ | |
| 85 | + WRITE_ONCE(last_jiffies_update, | |
| 86 | + ktime_add_ns(last_jiffies_update, | |
| 87 | + incr * ticks)); | |
| 84 | 88 | } |
| 85 | 89 | do_timer(++ticks); |
| 86 | 90 | |
| @@ -221,6 +221,7 @@ int __cvdso_clock_getres_common(clockid_t clock, struct __kernel_timespec *res) · 220 unmodified lines | ||
| 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); |
| @@ -527,13 +527,13 @@ void prep_transhuge_page(struct page *page) · 526 unmodified lines | ||
| 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,30 +542,40 @@ static unsigned long __thp_get_unmapped_area(struct file *filp, unsigned long le · 2 unmodified lines | ||
| 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); |
| @@ -3287,49 +3287,34 @@ static u64 mem_cgroup_read_u64(struct cgroup_subsys_state *css, · 3286 unmodified lines | ||
| 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 | 3303 | |
| 3316 | − if (!slab_only) | |
| 3317 | − max_idx = NR_VM_NODE_STAT_ITEMS; | |
| 3318 | − | |
| 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 | } |
| @@ -3403,13 +3388,9 @@ static void memcg_offline_kmem(struct mem_cgroup *memcg) · 67 unmodified lines | ||
| 3403 | 3388 | parent = root_mem_cgroup; |
| 3404 | 3389 | |
| 3405 | 3390 | /* |
| 3406 | − * Deactivate and reparent kmem_caches. Then flush percpu | |
| 3407 | − * slab statistics to have precise values at the parent and | |
| 3408 | − * all ancestor levels. It's required to keep slab stats | |
| 3409 | − * accurate after the reparenting of kmem_caches. | |
| 3391 | + * Deactivate and reparent kmem_caches. | |
| 3410 | 3392 | */ |
| 3411 | 3393 | memcg_deactivate_kmem_caches(memcg, parent); |
| 3412 | − memcg_flush_percpu_vmstats(memcg, true); | |
| 3413 | 3394 | |
| 3414 | 3395 | kmemcg_id = memcg->kmemcg_id; |
| 3415 | 3396 | BUG_ON(kmemcg_id < 0); |
| @@ -4913,7 +4894,7 @@ static void mem_cgroup_free(struct mem_cgroup *memcg) · 1497 unmodified lines | ||
| 4913 | 4894 | * Flush percpu vmstats and vmevents to guarantee the value correctness |
| 4914 | 4895 | * on parent's and all ancestor levels. |
| 4915 | 4896 | */ |
| 4916 | − memcg_flush_percpu_vmstats(memcg, false); | |
| 4897 | + memcg_flush_percpu_vmstats(memcg); | |
| 4917 | 4898 | memcg_flush_percpu_vmevents(memcg); |
| 4918 | 4899 | __mem_cgroup_free(memcg); |
| 4919 | 4900 | } |
| @@ -2148,18 +2148,22 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, · 2147 unmodified lines | ||
| 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 | } |
| @@ -201,11 +201,11 @@ static void wb_min_max_ratio(struct bdi_writeback *wb, · 200 unmodified lines | ||
| 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,7 +766,7 @@ static unsigned long __wb_calc_thresh(struct dirty_throttle_control *dtc) · 554 unmodified lines | ||
| 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,7 +777,7 @@ static unsigned long __wb_calc_thresh(struct dirty_throttle_control *dtc) · 4 unmodified lines | ||
| 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,7 +1102,7 @@ static void wb_update_write_bandwidth(struct bdi_writeback *wb, · 318 unmodified lines | ||
| 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 | } |
| @@ -694,34 +694,27 @@ void prep_compound_page(struct page *page, unsigned int order) · 693 unmodified lines | ||
| 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; |
| 724 | 715 | |
| 716 | + static_branch_enable(&_debug_pagealloc_enabled); | |
| 717 | + | |
| 725 | 718 | if (!debug_guardpage_minorder()) |
| 726 | 719 | return; |
| 727 | 720 | |
| @@ -1186,7 +1179,7 @@ static __always_inline bool free_pages_prepare(struct page *page, · 458 unmodified lines | ||
| 1186 | 1179 | */ |
| 1187 | 1180 | arch_free_page(page, order); |
| 1188 | 1181 | |
| 1189 | − if (debug_pagealloc_enabled()) | |
| 1182 | + if (debug_pagealloc_enabled_static()) | |
| 1190 | 1183 | kernel_map_pages(page, 1 << order, 0); |
| 1191 | 1184 | |
| 1192 | 1185 | kasan_free_nondeferred_pages(page, order); |
| @@ -1207,7 +1200,7 @@ static bool free_pcp_prepare(struct page *page) · 14 unmodified lines | ||
| 1207 | 1200 | |
| 1208 | 1201 | static bool bulkfree_pcp_prepare(struct page *page) |
| 1209 | 1202 | { |
| 1210 | − if (debug_pagealloc_enabled()) | |
| 1203 | + if (debug_pagealloc_enabled_static()) | |
| 1211 | 1204 | return free_pages_check(page); |
| 1212 | 1205 | else |
| 1213 | 1206 | return false; |
| @@ -1221,7 +1214,7 @@ static bool bulkfree_pcp_prepare(struct page *page) · 7 unmodified lines | ||
| 1221 | 1214 | */ |
| 1222 | 1215 | static bool free_pcp_prepare(struct page *page) |
| 1223 | 1216 | { |
| 1224 | − if (debug_pagealloc_enabled()) | |
| 1217 | + if (debug_pagealloc_enabled_static()) | |
| 1225 | 1218 | return free_pages_prepare(page, 0, true); |
| 1226 | 1219 | else |
| 1227 | 1220 | return free_pages_prepare(page, 0, false); |
| @@ -1973,10 +1966,6 @@ void __init page_alloc_init_late(void) · 745 unmodified lines | ||
| 1973 | 1966 | |
| 1974 | 1967 | for_each_populated_zone(zone) |
| 1975 | 1968 | set_zone_contiguous(zone); |
| 1976 | − | |
| 1977 | −#ifdef CONFIG_DEBUG_PAGEALLOC | |
| 1978 | − init_debug_guardpage(); | |
| 1979 | −#endif | |
| 1980 | 1969 | } |
| 1981 | 1970 | |
| 1982 | 1971 | #ifdef CONFIG_CMA |
| @@ -2106,7 +2095,7 @@ static inline bool free_pages_prezeroed(void) · 123 unmodified lines | ||
| 2106 | 2095 | */ |
| 2107 | 2096 | static inline bool check_pcp_refill(struct page *page) |
| 2108 | 2097 | { |
| 2109 | − if (debug_pagealloc_enabled()) | |
| 2098 | + if (debug_pagealloc_enabled_static()) | |
| 2110 | 2099 | return check_new_page(page); |
| 2111 | 2100 | else |
| 2112 | 2101 | return false; |
| @@ -2128,7 +2117,7 @@ static inline bool check_pcp_refill(struct page *page) · 15 unmodified lines | ||
| 2128 | 2117 | } |
| 2129 | 2118 | static inline bool check_new_pcp(struct page *page) |
| 2130 | 2119 | { |
| 2131 | − if (debug_pagealloc_enabled()) | |
| 2120 | + if (debug_pagealloc_enabled_static()) | |
| 2132 | 2121 | return check_new_page(page); |
| 2133 | 2122 | else |
| 2134 | 2123 | return false; |
| @@ -2155,7 +2144,7 @@ inline void post_alloc_hook(struct page *page, unsigned int order, · 20 unmodified lines | ||
| 2155 | 2144 | set_page_refcounted(page); |
| 2156 | 2145 | |
| 2157 | 2146 | arch_alloc_page(page, order); |
| 2158 | − if (debug_pagealloc_enabled()) | |
| 2147 | + if (debug_pagealloc_enabled_static()) | |
| 2159 | 2148 | kernel_map_pages(page, 1 << order, 1); |
| 2160 | 2149 | kasan_alloc_pages(page, order); |
| 2161 | 2150 | kernel_poison_pages(page, 1 << order, 1); |
| @@ -4476,8 +4465,11 @@ retry_cpuset: · 2314 unmodified lines | ||
| 4476 | 4465 | if (page) |
| 4477 | 4466 | goto got_pg; |
| 4478 | 4467 | |
| 4479 | − if (order >= pageblock_order && (gfp_mask & __GFP_IO) && | |
| 4480 | − !(gfp_mask & __GFP_RETRY_MAYFAIL)) { | |
| 4468 | + /* | |
| 4469 | + * Checks for costly allocations with __GFP_NORETRY, which | |
| 4470 | + * includes some THP page fault allocations | |
| 4471 | + */ | |
| 4472 | + if (costly_order && (gfp_mask & __GFP_NORETRY)) { | |
| 4481 | 4473 | /* |
| 4482 | 4474 | * If allocating entire pageblock(s) and compaction |
| 4483 | 4475 | * failed because all zones are below low watermarks |
| @@ -4498,23 +4490,6 @@ retry_cpuset: · 14 unmodified lines | ||
| 4498 | 4490 | if (compact_result == COMPACT_SKIPPED || |
| 4499 | 4491 | compact_result == COMPACT_DEFERRED) |
| 4500 | 4492 | goto nopage; |
| 4501 | − } | |
| 4502 | − | |
| 4503 | − /* | |
| 4504 | − * Checks for costly allocations with __GFP_NORETRY, which | |
| 4505 | − * includes THP page fault allocations | |
| 4506 | − */ | |
| 4507 | − if (costly_order && (gfp_mask & __GFP_NORETRY)) { | |
| 4508 | − /* | |
| 4509 | − * If compaction is deferred for high-order allocations, | |
| 4510 | − * it is because sync compaction recently failed. If | |
| 4511 | − * this is the case and the caller requested a THP | |
| 4512 | − * allocation, we do not want to heavily disrupt the | |
| 4513 | − * system, so we fail the allocation instead of entering | |
| 4514 | − * direct reclaim. | |
| 4515 | − */ | |
| 4516 | − if (compact_result == COMPACT_DEFERRED) | |
| 4517 | − goto nopage; | |
| 4518 | 4493 | |
| 4519 | 4494 | /* |
| 4520 | 4495 | * Looks like reclaim/compaction is worth trying, but |
| @@ -2107,9 +2107,10 @@ unsigned long shmem_get_unmapped_area(struct file *file, · 2106 unmodified lines | ||
| 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) { |
| @@ -2143,7 +2144,7 @@ unsigned long shmem_get_unmapped_area(struct file *file, · 27 unmodified lines | ||
| 2143 | 2144 | if (inflated_len < len) |
| 2144 | 2145 | return addr; |
| 2145 | 2146 | |
| 2146 | − inflated_addr = get_area(NULL, 0, inflated_len, 0, flags); | |
| 2147 | + inflated_addr = get_area(NULL, uaddr, inflated_len, 0, flags); | |
| 2147 | 2148 | if (IS_ERR_VALUE(inflated_addr)) |
| 2148 | 2149 | return addr; |
| 2149 | 2150 | if (inflated_addr & ~PAGE_MASK) |
| @@ -1416,7 +1416,7 @@ static void kmem_rcu_free(struct rcu_head *head) · 1415 unmodified lines | ||
| 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,7 +2008,7 @@ int __kmem_cache_create(struct kmem_cache *cachep, slab_flags_t flags) · 585 unmodified lines | ||
| 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); |
| @@ -903,7 +903,8 @@ static void flush_memcg_workqueue(struct kmem_cache *s) · 902 unmodified lines | ||
| 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 |
| @@ -288,7 +288,7 @@ static inline void *get_freepointer_safe(struct kmem_cache *s, void *object) · 287 unmodified lines | ||
| 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; |
| @@ -777,7 +777,14 @@ static void section_deactivate(unsigned long pfn, unsigned long nr_pages, · 776 unmodified lines | ||
| 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 | } |
| @@ -1383,7 +1383,7 @@ static void free_unmap_vmap_area(struct vmap_area *va) · 1382 unmodified lines | ||
| 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,7 +1681,7 @@ static void vb_free(const void *addr, unsigned long size) · 291 unmodified lines | ||
| 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 | |
| @@ -285,6 +285,7 @@ static u32 batadv_hash_dat(const void *data, u32 size) · 284 unmodified lines | ||
| 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; |
| @@ -294,7 +295,8 @@ static u32 batadv_hash_dat(const void *data, u32 size) · 3 unmodified lines | ||
| 294 | 295 | hash ^= (hash >> 6); |
| 295 | 296 | } |
| 296 | 297 | |
| 297 | − key = (const unsigned char *)&dat->vid; | |
| 298 | + vid = htons(dat->vid); | |
| 299 | + key = (__force const unsigned char *)&vid; | |
| 298 | 300 | for (i = 0; i < sizeof(dat->vid); i++) { |
| 299 | 301 | hash += key[i]; |
| 300 | 302 | hash += (hash << 10); |
| @@ -9177,22 +9177,10 @@ static void netdev_unregister_lockdep_key(struct net_device *dev) · 9176 unmodified lines | ||
| 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 | |
| @@ -6406,7 +6406,7 @@ static bool devlink_port_type_should_warn(struct devlink_port *devlink_port) · 6405 unmodified lines | ||
| 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,7 +7563,7 @@ void devlink_region_destroy(struct devlink_region *region) · 1150 unmodified lines | ||
| 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,7 +7571,7 @@ EXPORT_SYMBOL_GPL(devlink_region_destroy); · 1 unmodified line | ||
| 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,7 +7581,7 @@ u32 devlink_region_shapshot_id_get(struct devlink *devlink) · 3 unmodified lines | ||
| 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 |
| @@ -2231,10 +2231,10 @@ BPF_CALL_4(bpf_msg_pull_data, struct sk_msg *, msg, u32, start, · 2230 unmodified lines | ||
| 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,7 +2346,7 @@ BPF_CALL_4(bpf_msg_push_data, struct sk_msg *, msg, u32, start, · 105 unmodified lines | ||
| 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,11 +2356,11 @@ BPF_CALL_4(bpf_msg_push_data, struct sk_msg *, msg, u32, start, · 3 unmodified lines | ||
| 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,6 +2415,7 @@ BPF_CALL_4(bpf_msg_push_data, struct sk_msg *, msg, u32, start, · 48 unmodified lines | ||
| 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 | |
| @@ -2506,7 +2507,7 @@ static void sk_msg_shift_right(struct sk_msg *msg, int i) · 85 unmodified lines | ||
| 2506 | 2507 | BPF_CALL_4(bpf_msg_pop_data, struct sk_msg *, msg, u32, start, |
| 2507 | 2508 | u32, len, u64, flags) |
| 2508 | 2509 | { |
| 2509 | − u32 i = 0, l, space, offset = 0; | |
| 2510 | + u32 i = 0, l = 0, space, offset = 0; | |
| 2510 | 2511 | u64 last = start + len; |
| 2511 | 2512 | int pop; |
| 2512 | 2513 | |
| @@ -2516,11 +2517,11 @@ BPF_CALL_4(bpf_msg_pop_data, struct sk_msg *, msg, u32, start, · 3 unmodified lines | ||
| 2516 | 2517 | /* First find the starting scatterlist element */ |
| 2517 | 2518 | i = msg->sg.start; |
| 2518 | 2519 | do { |
| 2520 | + offset += l; | |
| 2519 | 2521 | l = sk_msg_elem(msg, i)->length; |
| 2520 | 2522 | |
| 2521 | 2523 | if (start < offset + l) |
| 2522 | 2524 | break; |
| 2523 | − offset += l; | |
| 2524 | 2525 | sk_msg_iter_var_next(i); |
| 2525 | 2526 | } while (i != msg->sg.end); |
| 2526 | 2527 | |
| @@ -5318,8 +5319,7 @@ __bpf_sk_lookup(struct sk_buff *skb, struct bpf_sock_tuple *tuple, u32 len, · 2791 unmodified lines | ||
| 5318 | 5319 | if (sk) { |
| 5319 | 5320 | sk = sk_to_full_sk(sk); |
| 5320 | 5321 | if (!sk_fullsock(sk)) { |
| 5321 | − if (!sock_flag(sk, SOCK_RCU_FREE)) | |
| 5322 | − sock_gen_put(sk); | |
| 5322 | + sock_gen_put(sk); | |
| 5323 | 5323 | return NULL; |
| 5324 | 5324 | } |
| 5325 | 5325 | } |
| @@ -5356,8 +5356,7 @@ bpf_sk_lookup(struct sk_buff *skb, struct bpf_sock_tuple *tuple, u32 len, · 30 unmodified lines | ||
| 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 | } |
| @@ -5424,7 +5423,8 @@ static const struct bpf_func_proto bpf_sk_lookup_udp_proto = { · 60 unmodified lines | ||
| 5424 | 5423 | |
| 5425 | 5424 | BPF_CALL_1(bpf_sk_release, struct sock *, sk) |
| 5426 | 5425 | { |
| 5427 | − if (!sock_flag(sk, SOCK_RCU_FREE)) | |
| 5426 | + /* Only full sockets have sk->sk_flags. */ | |
| 5427 | + if (!sk_fullsock(sk) || !sock_flag(sk, SOCK_RCU_FREE)) | |
| 5428 | 5428 | sock_gen_put(sk); |
| 5429 | 5429 | return 0; |
| 5430 | 5430 | } |
| @@ -594,6 +594,8 @@ EXPORT_SYMBOL_GPL(sk_psock_destroy); · 593 unmodified lines | ||
| 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 | |
| @@ -241,8 +241,11 @@ static void sock_map_free(struct bpf_map *map) · 240 unmodified lines | ||
| 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(); |
| @@ -862,7 +865,9 @@ static void sock_hash_free(struct bpf_map *map) · 613 unmodified lines | ||
| 862 | 865 | raw_spin_lock_bh(&bucket->lock); |
| 863 | 866 | hlist_for_each_entry_safe(elem, node, &bucket->head, node) { |
| 864 | 867 | hlist_del_rcu(&elem->node); |
| 868 | + lock_sock(elem->sk); | |
| 865 | 869 | sock_map_unref(elem->sk, elem); |
| 870 | + release_sock(elem->sk); | |
| 866 | 871 | } |
| 867 | 872 | raw_spin_unlock_bh(&bucket->lock); |
| 868 | 873 | } |
| @@ -104,7 +104,7 @@ static struct sk_buff *gswip_tag_rcv(struct sk_buff *skb, · 103 unmodified lines | ||
| 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, |
| @@ -33,9 +33,6 @@ static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev) · 32 unmodified lines | ||
| 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 | |
| @@ -2193,6 +2193,12 @@ int fib_table_dump(struct fib_table *tb, struct sk_buff *skb, · 2192 unmodified lines | ||
| 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 | |
| @@ -496,12 +496,13 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e, · 495 unmodified lines | ||
| 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; |
| @@ -584,7 +585,7 @@ static int translate_table(struct net *net, · 76 unmodified lines | ||
| 584 | 585 | xt_entry_foreach(iter, entry0, newinfo->size) { |
| 585 | 586 | if (i-- == 0) |
| 586 | 587 | break; |
| 587 | − cleanup_entry(iter); | |
| 588 | + cleanup_entry(iter, net); | |
| 588 | 589 | } |
| 589 | 590 | return ret; |
| 590 | 591 | } |
| @@ -927,7 +928,7 @@ static int __do_replace(struct net *net, const char *name, · 336 unmodified lines | ||
| 927 | 928 | /* Decrease module usage counts and free resource */ |
| 928 | 929 | loc_cpu_old_entry = oldinfo->entries; |
| 929 | 930 | xt_entry_foreach(iter, loc_cpu_old_entry, oldinfo->size) |
| 930 | − cleanup_entry(iter); | |
| 931 | + cleanup_entry(iter, net); | |
| 931 | 932 | |
| 932 | 933 | xt_free_table_info(oldinfo); |
| 933 | 934 | if (copy_to_user(counters_ptr, counters, |
| @@ -990,7 +991,7 @@ static int do_replace(struct net *net, const void __user *user, · 56 unmodified lines | ||
| 990 | 991 | |
| 991 | 992 | free_newinfo_untrans: |
| 992 | 993 | xt_entry_foreach(iter, loc_cpu_entry, newinfo->size) |
| 993 | − cleanup_entry(iter); | |
| 994 | + cleanup_entry(iter, net); | |
| 994 | 995 | free_newinfo: |
| 995 | 996 | xt_free_table_info(newinfo); |
| 996 | 997 | return ret; |
| @@ -1287,7 +1288,7 @@ static int compat_do_replace(struct net *net, void __user *user, · 290 unmodified lines | ||
| 1287 | 1288 | |
| 1288 | 1289 | free_newinfo_untrans: |
| 1289 | 1290 | xt_entry_foreach(iter, loc_cpu_entry, newinfo->size) |
| 1290 | − cleanup_entry(iter); | |
| 1291 | + cleanup_entry(iter, net); | |
| 1291 | 1292 | free_newinfo: |
| 1292 | 1293 | xt_free_table_info(newinfo); |
| 1293 | 1294 | return ret; |
| @@ -1514,7 +1515,7 @@ static int do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len · 220 unmodified lines | ||
| 1514 | 1515 | return ret; |
| 1515 | 1516 | } |
| 1516 | 1517 | |
| 1517 | −static void __arpt_unregister_table(struct xt_table *table) | |
| 1518 | +static void __arpt_unregister_table(struct net *net, struct xt_table *table) | |
| 1518 | 1519 | { |
| 1519 | 1520 | struct xt_table_info *private; |
| 1520 | 1521 | void *loc_cpu_entry; |
| @@ -1526,7 +1527,7 @@ static void __arpt_unregister_table(struct xt_table *table) · 5 unmodified lines | ||
| 1526 | 1527 | /* Decrease module usage counts and free resources */ |
| 1527 | 1528 | loc_cpu_entry = private->entries; |
| 1528 | 1529 | xt_entry_foreach(iter, loc_cpu_entry, private->size) |
| 1529 | − cleanup_entry(iter); | |
| 1530 | + cleanup_entry(iter, net); | |
| 1530 | 1531 | if (private->number > private->initial_entries) |
| 1531 | 1532 | module_put(table_owner); |
| 1532 | 1533 | xt_free_table_info(private); |
| @@ -1566,7 +1567,7 @@ int arpt_register_table(struct net *net, · 33 unmodified lines | ||
| 1566 | 1567 | |
| 1567 | 1568 | ret = nf_register_net_hooks(net, ops, hweight32(table->valid_hooks)); |
| 1568 | 1569 | if (ret != 0) { |
| 1569 | − __arpt_unregister_table(new_table); | |
| 1570 | + __arpt_unregister_table(net, new_table); | |
| 1570 | 1571 | *res = NULL; |
| 1571 | 1572 | } |
| 1572 | 1573 | |
| @@ -1581,7 +1582,7 @@ void arpt_unregister_table(struct net *net, struct xt_table *table, · 8 unmodified lines | ||
| 1581 | 1582 | const struct nf_hook_ops *ops) |
| 1582 | 1583 | { |
| 1583 | 1584 | nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks)); |
| 1584 | − __arpt_unregister_table(table); | |
| 1585 | + __arpt_unregister_table(net, table); | |
| 1585 | 1586 | } |
| 1586 | 1587 | |
| 1587 | 1588 | /* The built-in targets: standard (NULL) and error. */ |
| @@ -121,14 +121,14 @@ int tcp_bpf_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, · 120 unmodified lines | ||
| 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)) |
| 131 | 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 | + return tcp_recvmsg(sk, msg, len, nonblock, flags, addr_len); | |
| 132 | 132 | lock_sock(sk); |
| 133 | 133 | msg_bytes_ready: |
| 134 | 134 | copied = __tcp_bpf_recvmsg(sk, psock, msg, len, flags); |
| @@ -139,7 +139,7 @@ msg_bytes_ready: · 4 unmodified lines | ||
| 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,10 +315,7 @@ more_data: · 169 unmodified lines | ||
| 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 && |
| @@ -915,9 +915,10 @@ static void tcp_check_sack_reordering(struct sock *sk, const u32 low_seq, · 914 unmodified lines | ||
| 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 | |
| @@ -99,17 +99,19 @@ void tcp_get_available_ulp(char *buf, size_t maxlen) · 98 unmodified lines | ||
| 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) |
| @@ -2954,6 +2954,28 @@ static int ieee80211_start_radar_detection(struct wiphy *wiphy, · 2953 unmodified lines | ||
| 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 | { |
| @@ -4023,6 +4045,7 @@ const struct cfg80211_ops mac80211_config_ops = { · 1063 unmodified lines | ||
| 4023 | 4045 | #endif |
| 4024 | 4046 | .get_channel = ieee80211_cfg_get_channel, |
| 4025 | 4047 | .start_radar_detection = ieee80211_start_radar_detection, |
| 4048 | + .end_cac = ieee80211_end_cac, | |
| 4026 | 4049 | .channel_switch = ieee80211_channel_switch, |
| 4027 | 4050 | .set_qos_map = ieee80211_set_qos_map, |
| 4028 | 4051 | .set_ap_chanwidth = ieee80211_set_ap_chanwidth, |
| @@ -328,6 +328,9 @@ u32 airtime_link_metric_get(struct ieee80211_local *local, · 327 unmodified lines | ||
| 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 |
| @@ -263,9 +263,21 @@ int ieee80211_tkip_decrypt_data(struct arc4_ctx *ctx, · 262 unmodified lines | ||
| 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) { |
| @@ -60,9 +60,9 @@ mtype_destroy(struct ip_set *set) · 59 unmodified lines | ||
| 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; |
| @@ -233,6 +233,19 @@ icmp_manip_pkt(struct sk_buff *skb, · 232 unmodified lines | ||
| 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; |
| @@ -22,6 +22,8 @@ · 21 unmodified lines | ||
| 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); |
| @@ -564,33 +566,34 @@ __nf_tables_chain_type_lookup(const struct nlattr *nla, u8 family) · 536 unmodified lines | ||
| 564 | 566 | } |
| 565 | 567 | |
| 566 | 568 | /* |
| 567 | − * Loading a module requires dropping mutex that guards the | |
| 568 | − * transaction. | |
| 569 | − * We first need to abort any pending transactions as once | |
| 570 | − * mutex is unlocked a different client could start a new | |
| 571 | − * transaction. It must not see any 'future generation' | |
| 572 | − * changes * as these changes will never happen. | |
| 569 | + * Loading a module requires dropping mutex that guards the transaction. | |
| 570 | + * A different client might race to start a new transaction meanwhile. Zap the | |
| 571 | + * list of pending transaction and then restore it once the mutex is grabbed | |
| 572 | + * again. Users of this function return EAGAIN which implicitly triggers the | |
| 573 | + * transaction abort path to clean up the list of pending transactions. | |
| 573 | 574 | */ |
| 574 | 575 | #ifdef CONFIG_MODULES |
| 575 | −static int __nf_tables_abort(struct net *net); | |
| 576 | − | |
| 577 | 576 | static void nft_request_module(struct net *net, const char *fmt, ...) |
| 578 | 577 | { |
| 579 | 578 | char module_name[MODULE_NAME_LEN]; |
| 579 | + LIST_HEAD(commit_list); | |
| 580 | 580 | va_list args; |
| 581 | 581 | int ret; |
| 582 | 582 | |
| 583 | − __nf_tables_abort(net); | |
| 583 | + list_splice_init(&net->nft.commit_list, &commit_list); | |
| 584 | 584 | |
| 585 | 585 | va_start(args, fmt); |
| 586 | 586 | ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args); |
| 587 | 587 | va_end(args); |
| 588 | − if (WARN(ret >= MODULE_NAME_LEN, "truncated: '%s' (len %d)", module_name, ret)) | |
| 588 | + if (ret >= MODULE_NAME_LEN) | |
| 589 | 589 | return; |
| 590 | 590 | |
| 591 | 591 | mutex_unlock(&net->nft.commit_mutex); |
| 592 | 592 | request_module("%s", module_name); |
| 593 | 593 | mutex_lock(&net->nft.commit_mutex); |
| 594 | + | |
| 595 | + WARN_ON_ONCE(!list_empty(&net->nft.commit_list)); | |
| 596 | + list_splice(&commit_list, &net->nft.commit_list); | |
| 594 | 597 | } |
| 595 | 598 | #endif |
| 596 | 599 | |
| @@ -1045,12 +1048,18 @@ static int nft_flush_table(struct nft_ctx *ctx) · 448 unmodified lines | ||
| 1045 | 1048 | } |
| 1046 | 1049 | |
| 1047 | 1050 | list_for_each_entry_safe(flowtable, nft, &ctx->table->flowtables, list) { |
| 1051 | + if (!nft_is_active_next(ctx->net, flowtable)) | |
| 1052 | + continue; | |
| 1053 | + | |
| 1048 | 1054 | err = nft_delflowtable(ctx, flowtable); |
| 1049 | 1055 | if (err < 0) |
| 1050 | 1056 | goto out; |
| 1051 | 1057 | } |
| 1052 | 1058 | |
| 1053 | 1059 | list_for_each_entry_safe(obj, ne, &ctx->table->objects, list) { |
| 1060 | + if (!nft_is_active_next(ctx->net, obj)) | |
| 1061 | + continue; | |
| 1062 | + | |
| 1054 | 1063 | err = nft_delobj(ctx, obj); |
| 1055 | 1064 | if (err < 0) |
| 1056 | 1065 | goto out; |
| @@ -1241,7 +1250,8 @@ static const struct nla_policy nft_chain_policy[NFTA_CHAIN_MAX + 1] = { · 184 unmodified lines | ||
| 1241 | 1250 | .len = NFT_CHAIN_MAXNAMELEN - 1 }, |
| 1242 | 1251 | [NFTA_CHAIN_HOOK] = { .type = NLA_NESTED }, |
| 1243 | 1252 | [NFTA_CHAIN_POLICY] = { .type = NLA_U32 }, |
| 1244 | − [NFTA_CHAIN_TYPE] = { .type = NLA_STRING }, | |
| 1253 | + [NFTA_CHAIN_TYPE] = { .type = NLA_STRING, | |
| 1254 | + .len = NFT_MODULE_AUTOLOAD_LIMIT }, | |
| 1245 | 1255 | [NFTA_CHAIN_COUNTERS] = { .type = NLA_NESTED }, |
| 1246 | 1256 | [NFTA_CHAIN_FLAGS] = { .type = NLA_U32 }, |
| 1247 | 1257 | }; |
| @@ -1676,6 +1686,7 @@ static int nf_tables_parse_netdev_hooks(struct net *net, · 428 unmodified lines | ||
| 1676 | 1686 | goto err_hook; |
| 1677 | 1687 | } |
| 1678 | 1688 | if (nft_hook_list_find(hook_list, hook)) { |
| 1689 | + kfree(hook); | |
| 1679 | 1690 | err = -EEXIST; |
| 1680 | 1691 | goto err_hook; |
| 1681 | 1692 | } |
| @@ -2355,7 +2366,8 @@ static const struct nft_expr_type *nft_expr_type_get(struct net *net, · 673 unmodified lines | ||
| 2355 | 2366 | } |
| 2356 | 2367 | |
| 2357 | 2368 | static const struct nla_policy nft_expr_policy[NFTA_EXPR_MAX + 1] = { |
| 2358 | − [NFTA_EXPR_NAME] = { .type = NLA_STRING }, | |
| 2369 | + [NFTA_EXPR_NAME] = { .type = NLA_STRING, | |
| 2370 | + .len = NFT_MODULE_AUTOLOAD_LIMIT }, | |
| 2359 | 2371 | [NFTA_EXPR_DATA] = { .type = NLA_NESTED }, |
| 2360 | 2372 | }; |
| 2361 | 2373 | |
| @@ -4198,7 +4210,8 @@ static const struct nla_policy nft_set_elem_policy[NFTA_SET_ELEM_MAX + 1] = { · 1836 unmodified lines | ||
| 4198 | 4210 | [NFTA_SET_ELEM_USERDATA] = { .type = NLA_BINARY, |
| 4199 | 4211 | .len = NFT_USERDATA_MAXLEN }, |
| 4200 | 4212 | [NFTA_SET_ELEM_EXPR] = { .type = NLA_NESTED }, |
| 4201 | − [NFTA_SET_ELEM_OBJREF] = { .type = NLA_STRING }, | |
| 4213 | + [NFTA_SET_ELEM_OBJREF] = { .type = NLA_STRING, | |
| 4214 | + .len = NFT_OBJ_MAXNAMELEN - 1 }, | |
| 4202 | 4215 | }; |
| 4203 | 4216 | |
| 4204 | 4217 | static const struct nla_policy nft_set_elem_list_policy[NFTA_SET_ELEM_LIST_MAX + 1] = { |
| @@ -76,7 +76,7 @@ static int nft_tunnel_get_init(const struct nft_ctx *ctx, · 75 unmodified lines | ||
| 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 | |
| @@ -266,6 +266,9 @@ static int nft_tunnel_obj_erspan_init(const struct nlattr *attr, · 183 unmodified lines | ||
| 266 | 266 | if (err < 0) |
| 267 | 267 | return err; |
| 268 | 268 | |
| 269 | + if (!tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION]) | |
| 270 | + return -EINVAL; | |
| 271 | + | |
| 269 | 272 | version = ntohl(nla_get_be32(tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION])); |
| 270 | 273 | switch (version) { |
| 271 | 274 | case ERSPAN_VERSION: |
| @@ -360,6 +360,16 @@ static int tcf_ctinfo_search(struct net *net, struct tc_action **a, u32 index) · 359 unmodified lines | ||
| 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, |
| @@ -367,6 +377,7 @@ static struct tc_action_ops act_ctinfo_ops = { · 1 unmodified line | ||
| 367 | 377 | .act = tcf_ctinfo_act, |
| 368 | 378 | .dump = tcf_ctinfo_dump, |
| 369 | 379 | .init = tcf_ctinfo_init, |
| 380 | + .cleanup= tcf_ctinfo_cleanup, | |
| 370 | 381 | .walk = tcf_ctinfo_walker, |
| 371 | 382 | .lookup = tcf_ctinfo_search, |
| 372 | 383 | .size = sizeof(struct tcf_ctinfo), |
| @@ -537,6 +537,9 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, · 536 unmodified lines | ||
| 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; |
| @@ -566,10 +569,6 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, · 23 unmodified lines | ||
| 566 | 569 | p->eth_type = ife_type; |
| 567 | 570 | } |
| 568 | 571 | |
| 569 | − | |
| 570 | − if (ret == ACT_P_CREATED) | |
| 571 | − INIT_LIST_HEAD(&ife->metalist); | |
| 572 | − | |
| 573 | 572 | if (tb[TCA_IFE_METALST]) { |
| 574 | 573 | err = nla_parse_nested_deprecated(tb2, IFE_META_MAX, |
| 575 | 574 | tb[TCA_IFE_METALST], NULL, |
| @@ -77,7 +77,7 @@ · 76 unmodified lines | ||
| 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,6 +244,7 @@ rpcrdma_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event) · 160 unmodified lines | ||
| 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); |
| @@ -297,7 +298,6 @@ rpcrdma_create_id(struct rpcrdma_xprt *xprt, struct rpcrdma_ia *ia) · 47 unmodified lines | ||
| 297 | 298 | int rc; |
| 298 | 299 | |
| 299 | 300 | init_completion(&ia->ri_done); |
| 300 | − init_completion(&ia->ri_remove_done); | |
| 301 | 301 | |
| 302 | 302 | id = rdma_create_id(xprt->rx_xprt.xprt_net, rpcrdma_cm_event_handler, |
| 303 | 303 | xprt, RDMA_PS_TCP, IB_QPT_RC); |
| @@ -421,7 +421,7 @@ rpcrdma_ia_remove(struct rpcrdma_ia *ia) · 117 unmodified lines | ||
| 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,6 +599,7 @@ static int rpcrdma_ep_recreate_xprt(struct rpcrdma_xprt *r_xprt, · 171 unmodified lines | ||
| 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); |
| @@ -613,6 +614,7 @@ static int rpcrdma_ep_recreate_xprt(struct rpcrdma_xprt *r_xprt, · 8 unmodified lines | ||
| 613 | 614 | pr_err("rpcrdma: rpcrdma_ep_create returned %d\n", err); |
| 614 | 615 | goto out2; |
| 615 | 616 | } |
| 617 | + memcpy(qp_init_attr, &ep->rep_attr, sizeof(*qp_init_attr)); | |
| 616 | 618 | |
| 617 | 619 | rc = -ENETUNREACH; |
| 618 | 620 | err = rdma_create_qp(ia->ri_id, ia->ri_pd, qp_init_attr); |
| @@ -1090,6 +1092,7 @@ static struct rpcrdma_rep *rpcrdma_rep_create(struct rpcrdma_xprt *r_xprt, · 471 unmodified lines | ||
| 1090 | 1092 | rep->rr_recv_wr.sg_list = &rep->rr_rdmabuf->rg_iov; |
| 1091 | 1093 | rep->rr_recv_wr.num_sge = 1; |
| 1092 | 1094 | rep->rr_temp = temp; |
| 1095 | + list_add(&rep->rr_all, &r_xprt->rx_buf.rb_all_reps); | |
| 1093 | 1096 | return rep; |
| 1094 | 1097 | |
| 1095 | 1098 | out_free: |
| @@ -1100,6 +1103,7 @@ out: · 4 unmodified lines | ||
| 1100 | 1103 | |
| 1101 | 1104 | static void rpcrdma_rep_destroy(struct rpcrdma_rep *rep) |
| 1102 | 1105 | { |
| 1106 | + list_del(&rep->rr_all); | |
| 1103 | 1107 | rpcrdma_regbuf_free(rep->rr_rdmabuf); |
| 1104 | 1108 | kfree(rep); |
| 1105 | 1109 | } |
| @@ -1118,10 +1122,16 @@ static struct rpcrdma_rep *rpcrdma_rep_get_locked(struct rpcrdma_buffer *buf) · 12 unmodified lines | ||
| 1118 | 1122 | static void rpcrdma_rep_put(struct rpcrdma_buffer *buf, |
| 1119 | 1123 | struct rpcrdma_rep *rep) |
| 1120 | 1124 | { |
| 1121 | − if (!rep->rr_temp) | |
| 1122 | − llist_add(&rep->rr_node, &buf->rb_free_reps); | |
| 1123 | − else | |
| 1124 | − rpcrdma_rep_destroy(rep); | |
| 1125 | + llist_add(&rep->rr_node, &buf->rb_free_reps); | |
| 1126 | +} | |
| 1127 | + | |
| 1128 | +static void rpcrdma_reps_unmap(struct rpcrdma_xprt *r_xprt) | |
| 1129 | +{ | |
| 1130 | + struct rpcrdma_buffer *buf = &r_xprt->rx_buf; | |
| 1131 | + struct rpcrdma_rep *rep; | |
| 1132 | + | |
| 1133 | + list_for_each_entry(rep, &buf->rb_all_reps, rr_all) | |
| 1134 | + rpcrdma_regbuf_dma_unmap(rep->rr_rdmabuf); | |
| 1125 | 1135 | } |
| 1126 | 1136 | |
| 1127 | 1137 | static void rpcrdma_reps_destroy(struct rpcrdma_buffer *buf) |
| @@ -1152,6 +1162,7 @@ int rpcrdma_buffer_create(struct rpcrdma_xprt *r_xprt) · 24 unmodified lines | ||
| 1152 | 1162 | |
| 1153 | 1163 | INIT_LIST_HEAD(&buf->rb_send_bufs); |
| 1154 | 1164 | INIT_LIST_HEAD(&buf->rb_allreqs); |
| 1165 | + INIT_LIST_HEAD(&buf->rb_all_reps); | |
| 1155 | 1166 | |
| 1156 | 1167 | rc = -ENOMEM; |
| 1157 | 1168 | for (i = 0; i < buf->rb_max_requests; i++) { |
| @@ -1504,6 +1515,10 @@ void rpcrdma_post_recvs(struct rpcrdma_xprt *r_xprt, bool temp) · 346 unmodified lines | ||
| 1504 | 1515 | wr = NULL; |
| 1505 | 1516 | while (needed) { |
| 1506 | 1517 | rep = rpcrdma_rep_get_locked(buf); |
| 1518 | + if (rep && rep->rr_temp) { | |
| 1519 | + rpcrdma_rep_destroy(rep); | |
| 1520 | + continue; | |
| 1521 | + } | |
| 1507 | 1522 | if (!rep) |
| 1508 | 1523 | rep = rpcrdma_rep_create(r_xprt, temp); |
| 1509 | 1524 | if (!rep) |
| @@ -203,6 +203,7 @@ struct rpcrdma_rep { · 202 unmodified lines | ||
| 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 |
| @@ -368,6 +369,7 @@ struct rpcrdma_buffer { · 159 unmodified lines | ||
| 368 | 369 | |
| 369 | 370 | struct list_head rb_allreqs; |
| 370 | 371 | struct list_head rb_all_mrs; |
| 372 | + struct list_head rb_all_reps; | |
| 371 | 373 | |
| 372 | 374 | struct llist_head rb_free_reps; |
| 373 | 375 | |
| @@ -732,15 +732,19 @@ out: · 731 unmodified lines | ||
| 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) |
| @@ -256,8 +256,6 @@ static int tls_do_decryption(struct sock *sk, · 255 unmodified lines | ||
| 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) |
| @@ -682,12 +680,32 @@ static int tls_push_record(struct sock *sk, int flags, · 418 unmodified lines | ||
| 682 | 680 | |
| 683 | 681 | split_point = msg_pl->apply_bytes; |
| 684 | 682 | split = split_point && split_point < msg_pl->sg.size; |
| 683 | + if (unlikely((!split && | |
| 684 | + msg_pl->sg.size + | |
| 685 | + prot->overhead_size > msg_en->sg.size) || | |
| 686 | + (split && | |
| 687 | + split_point + | |
| 688 | + prot->overhead_size > msg_en->sg.size))) { | |
| 689 | + split = true; | |
| 690 | + split_point = msg_en->sg.size; | |
| 691 | + } | |
| 685 | 692 | if (split) { |
| 686 | 693 | rc = tls_split_open_record(sk, rec, &tmp, msg_pl, msg_en, |
| 687 | 694 | split_point, prot->overhead_size, |
| 688 | 695 | &orig_end); |
| 689 | 696 | if (rc < 0) |
| 690 | 697 | return rc; |
| 698 | + /* This can happen if above tls_split_open_record allocates | |
| 699 | + * a single large encryption buffer instead of two smaller | |
| 700 | + * ones. In this case adjust pointers and continue without | |
| 701 | + * split. | |
| 702 | + */ | |
| 703 | + if (!msg_pl->sg.size) { | |
| 704 | + tls_merge_open_record(sk, rec, tmp, orig_end); | |
| 705 | + msg_pl = &rec->msg_plaintext; | |
| 706 | + msg_en = &rec->msg_encrypted; | |
| 707 | + split = false; | |
| 708 | + } | |
| 691 | 709 | sk_msg_trim(sk, msg_en, msg_pl->sg.size + |
| 692 | 710 | prot->overhead_size); |
| 693 | 711 | } |
| @@ -709,6 +727,12 @@ static int tls_push_record(struct sock *sk, int flags, · 15 unmodified lines | ||
| 709 | 727 | sg_mark_end(sk_msg_elem(msg_pl, i)); |
| 710 | 728 | } |
| 711 | 729 | |
| 730 | + if (msg_pl->sg.end < msg_pl->sg.start) { | |
| 731 | + sg_chain(&msg_pl->sg.data[msg_pl->sg.start], | |
| 732 | + MAX_SKB_FRAGS - msg_pl->sg.start + 1, | |
| 733 | + msg_pl->sg.data); | |
| 734 | + } | |
| 735 | + | |
| 712 | 736 | i = msg_pl->sg.start; |
| 713 | 737 | sg_chain(rec->sg_aead_in, 2, &msg_pl->sg.data[i]); |
| 714 | 738 | |
| @@ -772,7 +796,7 @@ static int bpf_exec_tx_verdict(struct sk_msg *msg, struct sock *sk, · 57 unmodified lines | ||
| 772 | 796 | psock = sk_psock_get(sk); |
| 773 | 797 | if (!psock || !policy) { |
| 774 | 798 | err = tls_push_record(sk, flags, record_type); |
| 775 | − if (err) { | |
| 799 | + if (err && err != -EINPROGRESS) { | |
| 776 | 800 | *copied -= sk_msg_free(sk, msg); |
| 777 | 801 | tls_free_open_rec(sk); |
| 778 | 802 | } |
| @@ -783,10 +807,7 @@ more_data: · 4 unmodified lines | ||
| 783 | 807 | if (psock->eval == __SK_NONE) { |
| 784 | 808 | delta = msg->sg.size; |
| 785 | 809 | psock->eval = sk_psock_msg_verdict(sk, psock, msg); |
| 786 | − if (delta < msg->sg.size) | |
| 787 | − delta -= msg->sg.size; | |
| 788 | − else | |
| 789 | − delta = 0; | |
| 810 | + delta -= msg->sg.size; | |
| 790 | 811 | } |
| 791 | 812 | if (msg->cork_bytes && msg->cork_bytes > msg->sg.size && |
| 792 | 813 | !enospc && !full_record) { |
| @@ -801,7 +822,7 @@ more_data: · 8 unmodified lines | ||
| 801 | 822 | switch (psock->eval) { |
| 802 | 823 | case __SK_PASS: |
| 803 | 824 | err = tls_push_record(sk, flags, record_type); |
| 804 | − if (err < 0) { | |
| 825 | + if (err && err != -EINPROGRESS) { | |
| 805 | 826 | *copied -= sk_msg_free(sk, msg); |
| 806 | 827 | tls_free_open_rec(sk); |
| 807 | 828 | goto out_err; |
| @@ -1515,7 +1536,9 @@ static int decrypt_skb_update(struct sock *sk, struct sk_buff *skb, · 707 unmodified lines | ||
| 1515 | 1536 | if (err == -EINPROGRESS) |
| 1516 | 1537 | tls_advance_record_sn(sk, prot, |
| 1517 | 1538 | &tls_ctx->rx); |
| 1518 | − | |
| 1539 | + else if (err == -EBADMSG) | |
| 1540 | + TLS_INC_STATS(sock_net(sk), | |
| 1541 | + LINUX_MIB_TLSDECRYPTERROR); | |
| 1519 | 1542 | return err; |
| 1520 | 1543 | } |
| 1521 | 1544 | } else { |
| @@ -138,28 +138,15 @@ struct hvsock { · 137 unmodified lines | ||
| 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 | 149 | |
| 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 | − | |
| 163 | 150 | /* 00000000-facb-11e6-bd58-64006a7986d3 */ |
| 164 | 151 | static const guid_t srv_id_template = |
| 165 | 152 | GUID_INIT(0x00000000, 0xfacb, 0x11e6, 0xbd, 0x58, |
| @@ -184,34 +171,6 @@ static void hvs_addr_init(struct sockaddr_vm *addr, const guid_t *svr_id) · 18 unmodified lines | ||
| 184 | 171 | vsock_addr_init(addr, VMADDR_CID_ANY, port); |
| 185 | 172 | } |
| 186 | 173 | |
| 187 | −static void hvs_remote_addr_init(struct sockaddr_vm *remote, | |
| 188 | − struct sockaddr_vm *local) | |
| 189 | −{ | |
| 190 | − static u32 host_ephemeral_port = MIN_HOST_EPHEMERAL_PORT; | |
| 191 | − struct sock *sk; | |
| 192 | − | |
| 193 | − /* Remote peer is always the host */ | |
| 194 | − vsock_addr_init(remote, VMADDR_CID_HOST, VMADDR_PORT_ANY); | |
| 195 | − | |
| 196 | − while (1) { | |
| 197 | − /* Wrap around ? */ | |
| 198 | − if (host_ephemeral_port < MIN_HOST_EPHEMERAL_PORT || | |
| 199 | − host_ephemeral_port == VMADDR_PORT_ANY) | |
| 200 | − host_ephemeral_port = MIN_HOST_EPHEMERAL_PORT; | |
| 201 | − | |
| 202 | − remote->svm_port = host_ephemeral_port++; | |
| 203 | − | |
| 204 | − sk = vsock_find_connected_socket(remote, local); | |
| 205 | − if (!sk) { | |
| 206 | − /* Found an available ephemeral port */ | |
| 207 | − return; | |
| 208 | − } | |
| 209 | − | |
| 210 | − /* Release refcnt got in vsock_find_connected_socket */ | |
| 211 | − sock_put(sk); | |
| 212 | − } | |
| 213 | −} | |
| 214 | − | |
| 215 | 174 | static void hvs_set_channel_pending_send_size(struct vmbus_channel *chan) |
| 216 | 175 | { |
| 217 | 176 | set_channel_pending_send_size(chan, |
| @@ -341,12 +300,7 @@ static void hvs_open_connection(struct vmbus_channel *chan) · 123 unmodified lines | ||
| 341 | 300 | if_type = &chan->offermsg.offer.if_type; |
| 342 | 301 | if_instance = &chan->offermsg.offer.if_instance; |
| 343 | 302 | conn_from_host = chan->offermsg.offer.u.pipe.user_def[0]; |
| 344 | − | |
| 345 | − /* The host or the VM should only listen on a port in | |
| 346 | − * [0, MAX_LISTEN_PORT] | |
| 347 | − */ | |
| 348 | − if (!is_valid_srv_id(if_type) || | |
| 349 | − get_port_by_srv_id(if_type) > MAX_LISTEN_PORT) | |
| 303 | + if (!is_valid_srv_id(if_type)) | |
| 350 | 304 | return; |
| 351 | 305 | |
| 352 | 306 | hvs_addr_init(&addr, conn_from_host ? if_type : if_instance); |
| @@ -371,8 +325,11 @@ static void hvs_open_connection(struct vmbus_channel *chan) · 18 unmodified lines | ||
| 371 | 325 | vnew = vsock_sk(new); |
| 372 | 326 | |
| 373 | 327 | hvs_addr_init(&vnew->local_addr, if_type); |
| 374 | − hvs_remote_addr_init(&vnew->remote_addr, &vnew->local_addr); | |
| 375 | 328 | |
| 329 | + /* Remote peer is always the host */ | |
| 330 | + vsock_addr_init(&vnew->remote_addr, | |
| 331 | + VMADDR_CID_HOST, VMADDR_PORT_ANY); | |
| 332 | + vnew->remote_addr.svm_port = get_port_by_srv_id(if_instance); | |
| 376 | 333 | ret = vsock_assign_transport(vnew, vsock_sk(sk)); |
| 377 | 334 | /* Transport assigned (looking at remote_addr) must be the |
| 378 | 335 | * same where we received the request. |
| @@ -766,16 +723,6 @@ static bool hvs_stream_is_active(struct vsock_sock *vsk) · 387 unmodified lines | ||
| 766 | 723 | |
| 767 | 724 | static bool hvs_stream_allow(u32 cid, u32 port) |
| 768 | 725 | { |
| 769 | − /* The host's port range [MIN_HOST_EPHEMERAL_PORT, 0xFFFFFFFF) is | |
| 770 | − * reserved as ephemeral ports, which are used as the host's ports | |
| 771 | − * when the host initiates connections. | |
| 772 | − * | |
| 773 | − * Perform this check in the guest so an immediate error is produced | |
| 774 | − * instead of a timeout. | |
| 775 | − */ | |
| 776 | − if (port > MAX_HOST_LISTEN_PORT) | |
| 777 | − return false; | |
| 778 | − | |
| 779 | 726 | if (cid == VMADDR_CID_HOST) |
| 780 | 727 | return true; |
| 781 | 728 | |
| @@ -10843,6 +10843,7 @@ static int cfg80211_cqm_rssi_update(struct cfg80211_registered_device *rdev, · 10842 unmodified lines | ||
| 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,6 +13797,8 @@ static int nl80211_probe_mesh_link(struct sk_buff *skb, struct genl_info *info) · 2947 unmodified lines | ||
| 13796 | 13797 | if (err) |
| 13797 | 13798 | return err; |
| 13798 | 13799 | |
| 13800 | + cfg80211_sinfo_release_content(&sinfo); | |
| 13801 | + | |
| 13799 | 13802 | return rdev_probe_mesh_link(rdev, dev, dest, buf, len); |
| 13800 | 13803 | } |
| 13801 | 13804 | |
| @@ -538,6 +538,10 @@ static inline int · 537 unmodified lines | ||
| 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); |
| @@ -1167,6 +1171,16 @@ rdev_start_radar_detection(struct cfg80211_registered_device *rdev, · 623 unmodified lines | ||
| 1167 | 1171 | return ret; |
| 1168 | 1172 | } |
| 1169 | 1173 | |
| 1174 | +static inline void | |
| 1175 | +rdev_end_cac(struct cfg80211_registered_device *rdev, | |
| 1176 | + struct net_device *dev) | |
| 1177 | +{ | |
| 1178 | + trace_rdev_end_cac(&rdev->wiphy, dev); | |
| 1179 | + if (rdev->ops->end_cac) | |
| 1180 | + rdev->ops->end_cac(&rdev->wiphy, dev); | |
| 1181 | + trace_rdev_return_void(&rdev->wiphy); | |
| 1182 | +} | |
| 1183 | + | |
| 1170 | 1184 | static inline int |
| 1171 | 1185 | rdev_set_mcast_rate(struct cfg80211_registered_device *rdev, |
| 1172 | 1186 | struct net_device *dev, |
| @@ -2261,14 +2261,15 @@ static void update_all_wiphy_regulatory(enum nl80211_reg_initiator initiator) · 2260 unmodified lines | ||
| 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)) |
| @@ -2324,8 +2325,14 @@ static void handle_band_custom(struct wiphy *wiphy, · 49 unmodified lines | ||
| 2324 | 2325 | if (!sband) |
| 2325 | 2326 | return; |
| 2326 | 2327 | |
| 2328 | + /* | |
| 2329 | + * We currently assume that you always want at least 20 MHz, | |
| 2330 | + * otherwise channel 12 might get enabled if this rule is | |
| 2331 | + * compatible to US, which permits 2402 - 2472 MHz. | |
| 2332 | + */ | |
| 2327 | 2333 | for (i = 0; i < sband->n_channels; i++) |
| 2328 | − handle_channel_custom(wiphy, &sband->channels[i], regd); | |
| 2334 | + handle_channel_custom(wiphy, &sband->channels[i], regd, | |
| 2335 | + MHZ_TO_KHZ(20)); | |
| 2329 | 2336 | } |
| 2330 | 2337 | |
| 2331 | 2338 | /* Used by drivers prior to wiphy registration */ |
| @@ -3885,6 +3892,25 @@ bool regulatory_pre_cac_allowed(struct wiphy *wiphy) · 1553 unmodified lines | ||
| 3885 | 3892 | } |
| 3886 | 3893 | EXPORT_SYMBOL(regulatory_pre_cac_allowed); |
| 3887 | 3894 | |
| 3895 | +static void cfg80211_check_and_end_cac(struct cfg80211_registered_device *rdev) | |
| 3896 | +{ | |
| 3897 | + struct wireless_dev *wdev; | |
| 3898 | + /* If we finished CAC or received radar, we should end any | |
| 3899 | + * CAC running on the same channels. | |
| 3900 | + * the check !cfg80211_chandef_dfs_usable contain 2 options: | |
| 3901 | + * either all channels are available - those the CAC_FINISHED | |
| 3902 | + * event has effected another wdev state, or there is a channel | |
| 3903 | + * in unavailable state in wdev chandef - those the RADAR_DETECTED | |
| 3904 | + * event has effected another wdev state. | |
| 3905 | + * In both cases we should end the CAC on the wdev. | |
| 3906 | + */ | |
| 3907 | + list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { | |
| 3908 | + if (wdev->cac_started && | |
| 3909 | + !cfg80211_chandef_dfs_usable(&rdev->wiphy, &wdev->chandef)) | |
| 3910 | + rdev_end_cac(rdev, wdev->netdev); | |
| 3911 | + } | |
| 3912 | +} | |
| 3913 | + | |
| 3888 | 3914 | void regulatory_propagate_dfs_state(struct wiphy *wiphy, |
| 3889 | 3915 | struct cfg80211_chan_def *chandef, |
| 3890 | 3916 | enum nl80211_dfs_state dfs_state, |
| @@ -3911,8 +3937,10 @@ void regulatory_propagate_dfs_state(struct wiphy *wiphy, · 20 unmodified lines | ||
| 3911 | 3937 | cfg80211_set_dfs_state(&rdev->wiphy, chandef, dfs_state); |
| 3912 | 3938 | |
| 3913 | 3939 | if (event == NL80211_RADAR_DETECTED || |
| 3914 | − event == NL80211_RADAR_CAC_FINISHED) | |
| 3940 | + event == NL80211_RADAR_CAC_FINISHED) { | |
| 3915 | 3941 | cfg80211_sched_dfs_chan_update(rdev); |
| 3942 | + cfg80211_check_and_end_cac(rdev); | |
| 3943 | + } | |
| 3916 | 3944 | |
| 3917 | 3945 | nl80211_radar_notify(rdev, chandef, event, NULL, GFP_KERNEL); |
| 3918 | 3946 | } |
| @@ -1307,14 +1307,14 @@ void cfg80211_autodisconnect_wk(struct work_struct *work) · 1306 unmodified lines | ||
| 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: |
| @@ -646,6 +646,11 @@ DEFINE_EVENT(wiphy_netdev_evt, rdev_flush_pmksa, · 645 unmodified lines | ||
| 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), |
| @@ -564,7 +564,7 @@ __frame_add_frag(struct sk_buff *skb, struct page *page, · 563 unmodified lines | ||
| 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 | } |
| @@ -657,7 +657,8 @@ struct iw_statistics *get_wireless_stats(struct net_device *dev) · 656 unmodified lines | ||
| 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) |
| @@ -766,6 +766,10 @@ static int x25_connect(struct socket *sock, struct sockaddr *uaddr, · 765 unmodified lines | ||
| 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 | |
| @@ -812,7 +816,7 @@ static int x25_connect(struct socket *sock, struct sockaddr *uaddr, · 40 unmodified lines | ||
| 812 | 816 | /* Now the loop */ |
| 813 | 817 | rc = -EINPROGRESS; |
| 814 | 818 | if (sk->sk_state != TCP_ESTABLISHED && (flags & O_NONBLOCK)) |
| 815 | − goto out_put_neigh; | |
| 819 | + goto out; | |
| 816 | 820 | |
| 817 | 821 | rc = x25_wait_for_connection_establishment(sk); |
| 818 | 822 | if (rc) |
| @@ -471,15 +471,19 @@ void snd_seq_info_timer_read(struct snd_info_entry *entry, · 470 unmodified lines | ||
| 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 | } |
| @@ -159,8 +159,11 @@ int snd_dice_detect_extension_formats(struct snd_dice *dice) · 158 unmodified lines | ||
| 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 | |
| @@ -157,14 +157,15 @@ static void read_status_messages(struct amdtp_stream *s, · 156 unmodified lines | ||
| 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 | } |
| @@ -125,7 +125,7 @@ static char *patch[SNDRV_CARDS]; · 124 unmodified lines | ||
| 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,9 +160,10 @@ module_param_array(beep_mode, bool, NULL, 0444); · 28 unmodified lines | ||
| 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); |
| @@ -2099,11 +2100,13 @@ static int azx_probe(struct pci_dev *pci, · 1930 unmodified lines | ||
| 2099 | 2100 | /* |
| 2100 | 2101 | * stop probe if another Intel's DSP driver should be activated |
| 2101 | 2102 | */ |
| 2102 | − if (dsp_driver) { | |
| 2103 | + if (dmic_detect) { | |
| 2103 | 2104 | err = snd_intel_dsp_driver_probe(pci); |
| 2104 | 2105 | if (err != SND_INTEL_DSP_DRIVER_ANY && |
| 2105 | 2106 | err != SND_INTEL_DSP_DRIVER_LEGACY) |
| 2106 | 2107 | return -ENODEV; |
| 2108 | + } else { | |
| 2109 | + dev_warn(&pci->dev, "dmic_detect option is deprecated, pass snd-intel-dspcfg.dsp_driver=1 option instead\n"); | |
| 2107 | 2110 | } |
| 2108 | 2111 | |
| 2109 | 2112 | err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, |
| @@ -10,6 +10,7 @@ · 9 unmodified lines | ||
| 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> |
| @@ -1047,10 +1048,17 @@ static const struct of_device_id cros_ec_codec_of_match[] = { · 1031 unmodified lines | ||
| 1047 | 1048 | MODULE_DEVICE_TABLE(of, cros_ec_codec_of_match); |
| 1048 | 1049 | #endif |
| 1049 | 1050 | |
| 1051 | +static const struct acpi_device_id cros_ec_codec_acpi_id[] = { | |
| 1052 | + { "GOOG0013", 0 }, | |
| 1053 | + { } | |
| 1054 | +}; | |
| 1055 | +MODULE_DEVICE_TABLE(acpi, cros_ec_codec_acpi_id); | |
| 1056 | + | |
| 1050 | 1057 | static struct platform_driver cros_ec_codec_platform_driver = { |
| 1051 | 1058 | .driver = { |
| 1052 | 1059 | .name = "cros-ec-codec", |
| 1053 | 1060 | .of_match_table = of_match_ptr(cros_ec_codec_of_match), |
| 1061 | + .acpi_match_table = ACPI_PTR(cros_ec_codec_acpi_id), | |
| 1054 | 1062 | }, |
| 1055 | 1063 | .probe = cros_ec_codec_platform_probe, |
| 1056 | 1064 | }; |
| @@ -588,7 +588,9 @@ static int hdac_hda_dev_remove(struct hdac_device *hdev) · 587 unmodified lines | ||
| 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 | |
| @@ -396,9 +396,6 @@ static int pm8916_wcd_analog_enable_micbias_int(struct snd_soc_component · 395 unmodified lines | ||
| 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, |
| @@ -448,6 +445,14 @@ static int pm8916_wcd_analog_enable_micbias_int1(struct · 43 unmodified lines | ||
| 448 | 445 | struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); |
| 449 | 446 | struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component); |
| 450 | 447 | |
| 448 | + switch (event) { | |
| 449 | + case SND_SOC_DAPM_PRE_PMU: | |
| 450 | + snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS, | |
| 451 | + MICB_1_INT_TX1_INT_RBIAS_EN_MASK, | |
| 452 | + MICB_1_INT_TX1_INT_RBIAS_EN_ENABLE); | |
| 453 | + break; | |
| 454 | + } | |
| 455 | + | |
| 451 | 456 | return pm8916_wcd_analog_enable_micbias_int(component, event, w->reg, |
| 452 | 457 | wcd->micbias1_cap_mode); |
| 453 | 458 | } |
| @@ -558,6 +563,11 @@ static int pm8916_wcd_analog_enable_micbias_int2(struct · 104 unmodified lines | ||
| 558 | 563 | struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component); |
| 559 | 564 | |
| 560 | 565 | switch (event) { |
| 566 | + case SND_SOC_DAPM_PRE_PMU: | |
| 567 | + snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS, | |
| 568 | + MICB_1_INT_TX2_INT_RBIAS_EN_MASK, | |
| 569 | + MICB_1_INT_TX2_INT_RBIAS_EN_ENABLE); | |
| 570 | + break; | |
| 561 | 571 | case SND_SOC_DAPM_POST_PMU: |
| 562 | 572 | pm8916_mbhc_configure_bias(wcd, true); |
| 563 | 573 | break; |
| @@ -938,10 +948,10 @@ static const struct snd_soc_dapm_widget pm8916_wcd_analog_dapm_widgets[] = { · 374 unmodified lines | ||
| 938 | 948 | |
| 939 | 949 | SND_SOC_DAPM_SUPPLY("MIC BIAS External1", CDC_A_MICB_1_EN, 7, 0, |
| 940 | 950 | pm8916_wcd_analog_enable_micbias_ext1, |
| 941 | − SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), | |
| 951 | + SND_SOC_DAPM_POST_PMU), | |
| 942 | 952 | SND_SOC_DAPM_SUPPLY("MIC BIAS External2", CDC_A_MICB_2_EN, 7, 0, |
| 943 | 953 | pm8916_wcd_analog_enable_micbias_ext2, |
| 944 | − SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), | |
| 954 | + SND_SOC_DAPM_POST_PMU), | |
| 945 | 955 | |
| 946 | 956 | SND_SOC_DAPM_ADC_E("ADC1", NULL, CDC_A_TX_1_EN, 7, 0, |
| 947 | 957 | pm8916_wcd_analog_enable_adc, |
| @@ -586,6 +586,12 @@ static int msm8916_wcd_digital_enable_interpolator( · 585 unmodified lines | ||
| 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 | } |
| @@ -2432,6 +2432,13 @@ static void rt5640_disable_jack_detect(struct snd_soc_component *component) · 2431 unmodified lines | ||
| 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 | |
| @@ -442,7 +442,8 @@ static const struct dmi_system_id byt_cht_es8316_quirk_table[] = { · 441 unmodified lines | ||
| 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 */ |
| @@ -539,6 +539,9 @@ void snd_soc_pcm_component_free(struct snd_soc_pcm_runtime *rtd) · 538 unmodified lines | ||
| 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); |
| @@ -24,19 +24,18 @@ · 23 unmodified lines | ||
| 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) |
| @@ -129,10 +128,16 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address) · 86 unmodified lines | ||
| 129 | 128 | if ((mach_params && mach_params->common_hdmi_codec_drv) || |
| 130 | 129 | (resp & 0xFFFF0000) != IDISP_VID_INTEL) { |
| 131 | 130 | hdev->type = HDA_DEV_LEGACY; |
| 132 | − hda_codec_load_module(&hda_priv->codec); | |
| 131 | + ret = hda_codec_load_module(&hda_priv->codec); | |
| 132 | + /* | |
| 133 | + * handle ret==0 (no driver bound) as an error, but pass | |
| 134 | + * other return codes without modification | |
| 135 | + */ | |
| 136 | + if (ret == 0) | |
| 137 | + ret = -ENOENT; | |
| 133 | 138 | } |
| 134 | 139 | |
| 135 | − return 0; | |
| 140 | + return ret; | |
| 136 | 141 | #else |
| 137 | 142 | hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL); |
| 138 | 143 | if (!hdev) |
| @@ -329,13 +329,13 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev) · 328 unmodified lines | ||
| 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) { |
| @@ -226,7 +226,6 @@ static void uni_player_set_channel_status(struct uniperif *player, · 225 unmodified lines | ||
| 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: |
| @@ -303,7 +302,6 @@ static void uni_player_set_channel_status(struct uniperif *player, · 70 unmodified lines | ||
| 303 | 302 | player->stream_settings.iec958.status[3 + (n * 4)] << 24; |
| 304 | 303 | SET_UNIPERIF_CHANNEL_STA_REGN(player, n, status); |
| 305 | 304 | } |
| 306 | − mutex_unlock(&player->ctrl_lock); | |
| 307 | 305 | |
| 308 | 306 | /* Update the channel status */ |
| 309 | 307 | if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0) |
| @@ -365,8 +363,10 @@ static int uni_player_prepare_iec958(struct uniperif *player, · 55 unmodified lines | ||
| 365 | 363 | |
| 366 | 364 | SET_UNIPERIF_CTRL_ZERO_STUFF_HW(player); |
| 367 | 365 | |
| 366 | + mutex_lock(&player->ctrl_lock); | |
| 368 | 367 | /* Update the channel status */ |
| 369 | 368 | uni_player_set_channel_status(player, runtime); |
| 369 | + mutex_unlock(&player->ctrl_lock); | |
| 370 | 370 | |
| 371 | 371 | /* Clear the user validity user bits */ |
| 372 | 372 | SET_UNIPERIF_USER_VALIDITY_VALIDITY_LR(player, 0); |
| @@ -598,7 +598,6 @@ static int uni_player_ctl_iec958_put(struct snd_kcontrol *kcontrol, · 225 unmodified lines | ||
| 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) |
| @@ -608,6 +607,8 @@ static int uni_player_ctl_iec958_put(struct snd_kcontrol *kcontrol, · 3 unmodified lines | ||
| 608 | 607 | uni_player_set_channel_status(player, NULL); |
| 609 | 608 | |
| 610 | 609 | spin_unlock_irqrestore(&player->irq_lock, flags); |
| 610 | + mutex_unlock(&player->ctrl_lock); | |
| 611 | + | |
| 611 | 612 | return 0; |
| 612 | 613 | } |
| 613 | 614 | |
| @@ -153,13 +153,13 @@ static const struct snd_soc_component_driver stm32_adfsdm_dai_component = { · 152 unmodified lines | ||
| 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,8 +186,8 @@ static int stm32_afsdm_pcm_cb(const void *data, size_t size, void *private) · 20 unmodified lines | ||
| 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,8 +196,8 @@ static int stm32_afsdm_pcm_cb(const void *data, size_t size, void *private) · 2 unmodified lines | ||
| 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); |
| @@ -184,6 +184,56 @@ static bool stm32_sai_sub_writeable_reg(struct device *dev, unsigned int reg) · 183 unmodified lines | ||
| 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, |
| @@ -295,7 +345,7 @@ static int stm32_sai_set_clk_div(struct stm32_sai_sub_data *sai, · 105 unmodified lines | ||
| 295 | 345 | |
| 296 | 346 | mask = SAI_XCR1_MCKDIV_MASK(SAI_XCR1_MCKDIV_WIDTH(version)); |
| 297 | 347 | cr1 = SAI_XCR1_MCKDIV_SET(div); |
| 298 | − ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, mask, cr1); | |
| 348 | + ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, mask, cr1); | |
| 299 | 349 | if (ret < 0) |
| 300 | 350 | dev_err(&sai->pdev->dev, "Failed to update CR1 register\n"); |
| 301 | 351 | |
| @@ -372,8 +422,8 @@ static int stm32_sai_mclk_enable(struct clk_hw *hw) · 70 unmodified lines | ||
| 372 | 422 | |
| 373 | 423 | dev_dbg(&sai->pdev->dev, "Enable master clock\n"); |
| 374 | 424 | |
| 375 | − return regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, | |
| 376 | − SAI_XCR1_MCKEN, SAI_XCR1_MCKEN); | |
| 425 | + return stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, | |
| 426 | + SAI_XCR1_MCKEN, SAI_XCR1_MCKEN); | |
| 377 | 427 | } |
| 378 | 428 | |
| 379 | 429 | static void stm32_sai_mclk_disable(struct clk_hw *hw) |
| @@ -383,7 +433,7 @@ static void stm32_sai_mclk_disable(struct clk_hw *hw) · 3 unmodified lines | ||
| 383 | 433 | |
| 384 | 434 | dev_dbg(&sai->pdev->dev, "Disable master clock\n"); |
| 385 | 435 | |
| 386 | − regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, SAI_XCR1_MCKEN, 0); | |
| 436 | + stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, SAI_XCR1_MCKEN, 0); | |
| 387 | 437 | } |
| 388 | 438 | |
| 389 | 439 | static const struct clk_ops mclk_ops = { |
| @@ -446,15 +496,15 @@ static irqreturn_t stm32_sai_isr(int irq, void *devid) · 56 unmodified lines | ||
| 446 | 496 | unsigned int sr, imr, flags; |
| 447 | 497 | snd_pcm_state_t status = SNDRV_PCM_STATE_RUNNING; |
| 448 | 498 | |
| 449 | − regmap_read(sai->regmap, STM_SAI_IMR_REGX, &imr); | |
| 450 | − regmap_read(sai->regmap, STM_SAI_SR_REGX, &sr); | |
| 499 | + stm32_sai_sub_reg_rd(sai, STM_SAI_IMR_REGX, &imr); | |
| 500 | + stm32_sai_sub_reg_rd(sai, STM_SAI_SR_REGX, &sr); | |
| 451 | 501 | |
| 452 | 502 | flags = sr & imr; |
| 453 | 503 | if (!flags) |
| 454 | 504 | return IRQ_NONE; |
| 455 | 505 | |
| 456 | − regmap_write_bits(sai->regmap, STM_SAI_CLRFR_REGX, SAI_XCLRFR_MASK, | |
| 457 | − SAI_XCLRFR_MASK); | |
| 506 | + stm32_sai_sub_reg_wr(sai, STM_SAI_CLRFR_REGX, SAI_XCLRFR_MASK, | |
| 507 | + SAI_XCLRFR_MASK); | |
| 458 | 508 | |
| 459 | 509 | if (!sai->substream) { |
| 460 | 510 | dev_err(&pdev->dev, "Device stopped. Spurious IRQ 0x%x\n", sr); |
| @@ -503,8 +553,8 @@ static int stm32_sai_set_sysclk(struct snd_soc_dai *cpu_dai, · 42 unmodified lines | ||
| 503 | 553 | int ret; |
| 504 | 554 | |
| 505 | 555 | if (dir == SND_SOC_CLOCK_OUT && sai->sai_mclk) { |
| 506 | − ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, | |
| 507 | − SAI_XCR1_NODIV, | |
| 556 | + ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, | |
| 557 | + SAI_XCR1_NODIV, | |
| 508 | 558 | freq ? 0 : SAI_XCR1_NODIV); |
| 509 | 559 | if (ret < 0) |
| 510 | 560 | return ret; |
| @@ -583,7 +633,7 @@ static int stm32_sai_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai, u32 tx_mask, · 72 unmodified lines | ||
| 583 | 633 | |
| 584 | 634 | slotr_mask |= SAI_XSLOTR_SLOTEN_MASK; |
| 585 | 635 | |
| 586 | − regmap_update_bits(sai->regmap, STM_SAI_SLOTR_REGX, slotr_mask, slotr); | |
| 636 | + stm32_sai_sub_reg_up(sai, STM_SAI_SLOTR_REGX, slotr_mask, slotr); | |
| 587 | 637 | |
| 588 | 638 | sai->slot_width = slot_width; |
| 589 | 639 | sai->slots = slots; |
| @@ -665,7 +715,7 @@ static int stm32_sai_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) · 75 unmodified lines | ||
| 665 | 715 | cr1_mask |= SAI_XCR1_CKSTR; |
| 666 | 716 | frcr_mask |= SAI_XFRCR_FSPOL; |
| 667 | 717 | |
| 668 | − regmap_update_bits(sai->regmap, STM_SAI_FRCR_REGX, frcr_mask, frcr); | |
| 718 | + stm32_sai_sub_reg_up(sai, STM_SAI_FRCR_REGX, frcr_mask, frcr); | |
| 669 | 719 | |
| 670 | 720 | /* DAI clock master masks */ |
| 671 | 721 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { |
| @@ -693,7 +743,7 @@ static int stm32_sai_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) · 21 unmodified lines | ||
| 693 | 743 | cr1_mask |= SAI_XCR1_SLAVE; |
| 694 | 744 | |
| 695 | 745 | conf_update: |
| 696 | − ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, cr1_mask, cr1); | |
| 746 | + ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, cr1_mask, cr1); | |
| 697 | 747 | if (ret < 0) { |
| 698 | 748 | dev_err(cpu_dai->dev, "Failed to update CR1 register\n"); |
| 699 | 749 | return ret; |
| @@ -730,12 +780,12 @@ static int stm32_sai_startup(struct snd_pcm_substream *substream, · 30 unmodified lines | ||
| 730 | 780 | } |
| 731 | 781 | |
| 732 | 782 | /* Enable ITs */ |
| 733 | − regmap_write_bits(sai->regmap, STM_SAI_CLRFR_REGX, | |
| 734 | − SAI_XCLRFR_MASK, SAI_XCLRFR_MASK); | |
| 783 | + stm32_sai_sub_reg_wr(sai, STM_SAI_CLRFR_REGX, | |
| 784 | + SAI_XCLRFR_MASK, SAI_XCLRFR_MASK); | |
| 735 | 785 | |
| 736 | 786 | imr = SAI_XIMR_OVRUDRIE; |
| 737 | 787 | if (STM_SAI_IS_CAPTURE(sai)) { |
| 738 | − regmap_read(sai->regmap, STM_SAI_CR2_REGX, &cr2); | |
| 788 | + stm32_sai_sub_reg_rd(sai, STM_SAI_CR2_REGX, &cr2); | |
| 739 | 789 | if (cr2 & SAI_XCR2_MUTECNT_MASK) |
| 740 | 790 | imr |= SAI_XIMR_MUTEDETIE; |
| 741 | 791 | } |
| @@ -745,8 +795,8 @@ static int stm32_sai_startup(struct snd_pcm_substream *substream, · 3 unmodified lines | ||
| 745 | 795 | else |
| 746 | 796 | imr |= SAI_XIMR_AFSDETIE | SAI_XIMR_LFSDETIE; |
| 747 | 797 | |
| 748 | − regmap_update_bits(sai->regmap, STM_SAI_IMR_REGX, | |
| 749 | − SAI_XIMR_MASK, imr); | |
| 798 | + stm32_sai_sub_reg_up(sai, STM_SAI_IMR_REGX, | |
| 799 | + SAI_XIMR_MASK, imr); | |
| 750 | 800 | |
| 751 | 801 | return 0; |
| 752 | 802 | } |
| @@ -763,10 +813,10 @@ static int stm32_sai_set_config(struct snd_soc_dai *cpu_dai, · 10 unmodified lines | ||
| 763 | 813 | * SAI fifo threshold is set to half fifo, to keep enough space |
| 764 | 814 | * for DMA incoming bursts. |
| 765 | 815 | */ |
| 766 | − regmap_write_bits(sai->regmap, 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)); | |
| 816 | + stm32_sai_sub_reg_wr(sai, 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)); | |
| 770 | 820 | |
| 771 | 821 | /* DS bits in CR1 not set for SPDIF (size forced to 24 bits).*/ |
| 772 | 822 | if (STM_SAI_PROTOCOL_IS_SPDIF(sai)) { |
| @@ -795,7 +845,7 @@ static int stm32_sai_set_config(struct snd_soc_dai *cpu_dai, · 22 unmodified lines | ||
| 795 | 845 | if ((sai->slots == 2) && (params_channels(params) == 1)) |
| 796 | 846 | cr1 |= SAI_XCR1_MONO; |
| 797 | 847 | |
| 798 | − ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, cr1_mask, cr1); | |
| 848 | + ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, cr1_mask, cr1); | |
| 799 | 849 | if (ret < 0) { |
| 800 | 850 | dev_err(cpu_dai->dev, "Failed to update CR1 register\n"); |
| 801 | 851 | return ret; |
| @@ -809,7 +859,7 @@ static int stm32_sai_set_slots(struct snd_soc_dai *cpu_dai) · 7 unmodified lines | ||
| 809 | 859 | struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai); |
| 810 | 860 | int slotr, slot_sz; |
| 811 | 861 | |
| 812 | − regmap_read(sai->regmap, STM_SAI_SLOTR_REGX, &slotr); | |
| 862 | + stm32_sai_sub_reg_rd(sai, STM_SAI_SLOTR_REGX, &slotr); | |
| 813 | 863 | |
| 814 | 864 | /* |
| 815 | 865 | * If SLOTSZ is set to auto in SLOTR, align slot width on data size |
| @@ -831,16 +881,16 @@ static int stm32_sai_set_slots(struct snd_soc_dai *cpu_dai) · 15 unmodified lines | ||
| 831 | 881 | sai->slots = 2; |
| 832 | 882 | |
| 833 | 883 | /* The number of slots in the audio frame is equal to NBSLOT[3:0] + 1*/ |
| 834 | − regmap_update_bits(sai->regmap, STM_SAI_SLOTR_REGX, | |
| 835 | − SAI_XSLOTR_NBSLOT_MASK, | |
| 836 | − SAI_XSLOTR_NBSLOT_SET((sai->slots - 1))); | |
| 884 | + stm32_sai_sub_reg_up(sai, STM_SAI_SLOTR_REGX, | |
| 885 | + SAI_XSLOTR_NBSLOT_MASK, | |
| 886 | + SAI_XSLOTR_NBSLOT_SET((sai->slots - 1))); | |
| 837 | 887 | |
| 838 | 888 | /* Set default slots mask if not already set from DT */ |
| 839 | 889 | if (!(slotr & SAI_XSLOTR_SLOTEN_MASK)) { |
| 840 | 890 | sai->slot_mask = (1 << sai->slots) - 1; |
| 841 | − regmap_update_bits(sai->regmap, | |
| 842 | − STM_SAI_SLOTR_REGX, SAI_XSLOTR_SLOTEN_MASK, | |
| 843 | − SAI_XSLOTR_SLOTEN_SET(sai->slot_mask)); | |
| 891 | + stm32_sai_sub_reg_up(sai, | |
| 892 | + STM_SAI_SLOTR_REGX, SAI_XSLOTR_SLOTEN_MASK, | |
| 893 | + SAI_XSLOTR_SLOTEN_SET(sai->slot_mask)); | |
| 844 | 894 | } |
| 845 | 895 | |
| 846 | 896 | dev_dbg(cpu_dai->dev, "Slots %d, slot width %d\n", |
| @@ -870,14 +920,14 @@ static void stm32_sai_set_frame(struct snd_soc_dai *cpu_dai) · 23 unmodified lines | ||
| 870 | 920 | dev_dbg(cpu_dai->dev, "Frame length %d, frame active %d\n", |
| 871 | 921 | sai->fs_length, fs_active); |
| 872 | 922 | |
| 873 | − regmap_update_bits(sai->regmap, STM_SAI_FRCR_REGX, frcr_mask, frcr); | |
| 923 | + stm32_sai_sub_reg_up(sai, STM_SAI_FRCR_REGX, frcr_mask, frcr); | |
| 874 | 924 | |
| 875 | 925 | if ((sai->fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_LSB) { |
| 876 | 926 | offset = sai->slot_width - sai->data_size; |
| 877 | 927 | |
| 878 | − regmap_update_bits(sai->regmap, STM_SAI_SLOTR_REGX, | |
| 879 | − SAI_XSLOTR_FBOFF_MASK, | |
| 880 | − SAI_XSLOTR_FBOFF_SET(offset)); | |
| 928 | + stm32_sai_sub_reg_up(sai, STM_SAI_SLOTR_REGX, | |
| 929 | + SAI_XSLOTR_FBOFF_MASK, | |
| 930 | + SAI_XSLOTR_FBOFF_SET(offset)); | |
| 881 | 931 | } |
| 882 | 932 | } |
| 883 | 933 | |
| @@ -994,9 +1044,9 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai, · 110 unmodified lines | ||
| 994 | 1044 | return -EINVAL; |
| 995 | 1045 | } |
| 996 | 1046 | |
| 997 | − regmap_update_bits(sai->regmap, | |
| 998 | − STM_SAI_CR1_REGX, | |
| 999 | − SAI_XCR1_OSR, cr1); | |
| 1047 | + stm32_sai_sub_reg_up(sai, | |
| 1048 | + STM_SAI_CR1_REGX, | |
| 1049 | + SAI_XCR1_OSR, cr1); | |
| 1000 | 1050 | |
| 1001 | 1051 | div = stm32_sai_get_clk_div(sai, sai_clk_rate, |
| 1002 | 1052 | sai->mclk_rate); |
| @@ -1058,12 +1108,12 @@ static int stm32_sai_trigger(struct snd_pcm_substream *substream, int cmd, · 55 unmodified lines | ||
| 1058 | 1108 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
| 1059 | 1109 | dev_dbg(cpu_dai->dev, "Enable DMA and SAI\n"); |
| 1060 | 1110 | |
| 1061 | − regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, | |
| 1062 | − SAI_XCR1_DMAEN, SAI_XCR1_DMAEN); | |
| 1111 | + stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, | |
| 1112 | + SAI_XCR1_DMAEN, SAI_XCR1_DMAEN); | |
| 1063 | 1113 | |
| 1064 | 1114 | /* Enable SAI */ |
| 1065 | − ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, | |
| 1066 | − SAI_XCR1_SAIEN, SAI_XCR1_SAIEN); | |
| 1115 | + ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, | |
| 1116 | + SAI_XCR1_SAIEN, SAI_XCR1_SAIEN); | |
| 1067 | 1117 | if (ret < 0) |
| 1068 | 1118 | dev_err(cpu_dai->dev, "Failed to update CR1 register\n"); |
| 1069 | 1119 | break; |
| @@ -1072,16 +1122,16 @@ static int stm32_sai_trigger(struct snd_pcm_substream *substream, int cmd, · 2 unmodified lines | ||
| 1072 | 1122 | case SNDRV_PCM_TRIGGER_STOP: |
| 1073 | 1123 | dev_dbg(cpu_dai->dev, "Disable DMA and SAI\n"); |
| 1074 | 1124 | |
| 1075 | − regmap_update_bits(sai->regmap, STM_SAI_IMR_REGX, | |
| 1076 | − SAI_XIMR_MASK, 0); | |
| 1125 | + stm32_sai_sub_reg_up(sai, STM_SAI_IMR_REGX, | |
| 1126 | + SAI_XIMR_MASK, 0); | |
| 1077 | 1127 | |
| 1078 | − regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, | |
| 1079 | − SAI_XCR1_SAIEN, | |
| 1080 | − (unsigned int)~SAI_XCR1_SAIEN); | |
| 1128 | + stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, | |
| 1129 | + SAI_XCR1_SAIEN, | |
| 1130 | + (unsigned int)~SAI_XCR1_SAIEN); | |
| 1081 | 1131 | |
| 1082 | − ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, | |
| 1083 | − SAI_XCR1_DMAEN, | |
| 1084 | − (unsigned int)~SAI_XCR1_DMAEN); | |
| 1132 | + ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, | |
| 1133 | + SAI_XCR1_DMAEN, | |
| 1134 | + (unsigned int)~SAI_XCR1_DMAEN); | |
| 1085 | 1135 | if (ret < 0) |
| 1086 | 1136 | dev_err(cpu_dai->dev, "Failed to update CR1 register\n"); |
| 1087 | 1137 | |
| @@ -1101,7 +1151,7 @@ static void stm32_sai_shutdown(struct snd_pcm_substream *substream, · 13 unmodified lines | ||
| 1101 | 1151 | struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai); |
| 1102 | 1152 | unsigned long flags; |
| 1103 | 1153 | |
| 1104 | − regmap_update_bits(sai->regmap, STM_SAI_IMR_REGX, SAI_XIMR_MASK, 0); | |
| 1154 | + stm32_sai_sub_reg_up(sai, STM_SAI_IMR_REGX, SAI_XIMR_MASK, 0); | |
| 1105 | 1155 | |
| 1106 | 1156 | clk_disable_unprepare(sai->sai_ck); |
| 1107 | 1157 | |
| @@ -1169,7 +1219,7 @@ static int stm32_sai_dai_probe(struct snd_soc_dai *cpu_dai) · 61 unmodified lines | ||
| 1169 | 1219 | cr1_mask |= SAI_XCR1_SYNCEN_MASK; |
| 1170 | 1220 | cr1 |= SAI_XCR1_SYNCEN_SET(sai->sync); |
| 1171 | 1221 | |
| 1172 | − return regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, cr1_mask, cr1); | |
| 1222 | + return stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, cr1_mask, cr1); | |
| 1173 | 1223 | } |
| 1174 | 1224 | |
| 1175 | 1225 | static const struct snd_soc_dai_ops stm32_sai_pcm_dai_ops = { |
| @@ -1322,8 +1372,13 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev, · 146 unmodified lines | ||
| 1322 | 1372 | if (STM_SAI_HAS_PDM(sai) && STM_SAI_IS_SUB_A(sai)) |
| 1323 | 1373 | sai->regmap_config = &stm32_sai_sub_regmap_config_h7; |
| 1324 | 1374 | |
| 1325 | − sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "sai_ck", | |
| 1326 | − base, sai->regmap_config); | |
| 1375 | + /* | |
| 1376 | + * Do not manage peripheral clock through regmap framework as this | |
| 1377 | + * can lead to circular locking issue with sai master clock provider. | |
| 1378 | + * Manage peripheral clock directly in driver instead. | |
| 1379 | + */ | |
| 1380 | + sai->regmap = devm_regmap_init_mmio(&pdev->dev, base, | |
| 1381 | + sai->regmap_config); | |
| 1327 | 1382 | if (IS_ERR(sai->regmap)) { |
| 1328 | 1383 | dev_err(&pdev->dev, "Failed to initialize MMIO\n"); |
| 1329 | 1384 | return PTR_ERR(sai->regmap); |
| @@ -1420,6 +1475,10 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev, · 90 unmodified lines | ||
| 1420 | 1475 | return PTR_ERR(sai->sai_ck); |
| 1421 | 1476 | } |
| 1422 | 1477 | |
| 1478 | + ret = clk_prepare(sai->pdata->pclk); | |
| 1479 | + if (ret < 0) | |
| 1480 | + return ret; | |
| 1481 | + | |
| 1423 | 1482 | if (STM_SAI_IS_F4(sai->pdata)) |
| 1424 | 1483 | return 0; |
| 1425 | 1484 | |
| @@ -1501,22 +1560,48 @@ static int stm32_sai_sub_probe(struct platform_device *pdev) · 75 unmodified lines | ||
| 1501 | 1560 | return 0; |
| 1502 | 1561 | } |
| 1503 | 1562 | |
| 1563 | +static int stm32_sai_sub_remove(struct platform_device *pdev) | |
| 1564 | +{ | |
| 1565 | + struct stm32_sai_sub_data *sai = dev_get_drvdata(&pdev->dev); | |
| 1566 | + | |
| 1567 | + clk_unprepare(sai->pdata->pclk); | |
| 1568 | + | |
| 1569 | + return 0; | |
| 1570 | +} | |
| 1571 | + | |
| 1504 | 1572 | #ifdef CONFIG_PM_SLEEP |
| 1505 | 1573 | static int stm32_sai_sub_suspend(struct device *dev) |
| 1506 | 1574 | { |
| 1507 | 1575 | struct stm32_sai_sub_data *sai = dev_get_drvdata(dev); |
| 1576 | + int ret; | |
| 1577 | + | |
| 1578 | + ret = clk_enable(sai->pdata->pclk); | |
| 1579 | + if (ret < 0) | |
| 1580 | + return ret; | |
| 1508 | 1581 | |
| 1509 | 1582 | regcache_cache_only(sai->regmap, true); |
| 1510 | 1583 | regcache_mark_dirty(sai->regmap); |
| 1584 | + | |
| 1585 | + clk_disable(sai->pdata->pclk); | |
| 1586 | + | |
| 1511 | 1587 | return 0; |
| 1512 | 1588 | } |
| 1513 | 1589 | |
| 1514 | 1590 | static int stm32_sai_sub_resume(struct device *dev) |
| 1515 | 1591 | { |
| 1516 | 1592 | struct stm32_sai_sub_data *sai = dev_get_drvdata(dev); |
| 1593 | + int ret; | |
| 1594 | + | |
| 1595 | + ret = clk_enable(sai->pdata->pclk); | |
| 1596 | + if (ret < 0) | |
| 1597 | + return ret; | |
| 1517 | 1598 | |
| 1518 | 1599 | regcache_cache_only(sai->regmap, false); |
| 1519 | − return regcache_sync(sai->regmap); | |
| 1600 | + ret = regcache_sync(sai->regmap); | |
| 1601 | + | |
| 1602 | + clk_disable(sai->pdata->pclk); | |
| 1603 | + | |
| 1604 | + return ret; | |
| 1520 | 1605 | } |
| 1521 | 1606 | #endif /* CONFIG_PM_SLEEP */ |
| 1522 | 1607 | |
| @@ -1531,6 +1616,7 @@ static struct platform_driver stm32_sai_sub_driver = { · 8 unmodified lines | ||
| 1531 | 1616 | .pm = &stm32_sai_sub_pm_ops, |
| 1532 | 1617 | }, |
| 1533 | 1618 | .probe = stm32_sai_sub_probe, |
| 1619 | + .remove = stm32_sai_sub_remove, | |
| 1534 | 1620 | }; |
| 1535 | 1621 | |
| 1536 | 1622 | module_platform_driver(stm32_sai_sub_driver); |
| @@ -370,7 +370,7 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, · 369 unmodified lines | ||
| 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]; |
| @@ -26,7 +26,7 @@ static void btf_dumper_ptr(const void *data, json_writer_t *jw, · 25 unmodified lines | ||
| 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 | } |
| @@ -1228,8 +1228,10 @@ filter_event(struct tep_event_filter *filter, struct tep_event *event, · 1227 unmodified lines | ||
| 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); |
| @@ -1076,6 +1076,7 @@ int cmd_report(int argc, const char **argv) · 1075 unmodified lines | ||
| 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" |
| @@ -1450,7 +1451,8 @@ repeat: · 368 unmodified lines | ||
| 1450 | 1451 | sort_order = sort_tmp; |
| 1451 | 1452 | } |
| 1452 | 1453 | |
| 1453 | − if (setup_sorting(session->evlist) < 0) { | |
| 1454 | + if ((last_key != K_SWITCH_INPUT_DATA) && | |
| 1455 | + (setup_sorting(session->evlist) < 0)) { | |
| 1454 | 1456 | if (sort_order) |
| 1455 | 1457 | parse_options_usage(report_usage, options, "s", 1); |
| 1456 | 1458 | if (field_order) |
| @@ -1530,6 +1532,7 @@ repeat: · 73 unmodified lines | ||
| 1530 | 1532 | ret = __cmd_report(&report); |
| 1531 | 1533 | if (ret == K_SWITCH_INPUT_DATA) { |
| 1532 | 1534 | perf_session__delete(session); |
| 1535 | + last_key = K_SWITCH_INPUT_DATA; | |
| 1533 | 1536 | goto repeat; |
| 1534 | 1537 | } else |
| 1535 | 1538 | ret = 0; |
| @@ -339,10 +339,10 @@ static inline void perf_hpp__prepend_sort_field(struct perf_hpp_fmt *format) · 338 unmodified lines | ||
| 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 | |
| @@ -920,6 +920,9 @@ static int dso__process_kernel_symbol(struct dso *dso, struct map *map, · 919 unmodified lines | ||
| 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; |
| @@ -232,7 +232,7 @@ test_mc_aware() · 231 unmodified lines | ||
| 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,7 +254,11 @@ test_mc_aware() · 15 unmodified lines | ||
| 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) |