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

Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+2058 -780
+7 -4
.clang-format
··· 122 122 - 'drm_for_each_bridge_in_chain' 123 123 - 'drm_for_each_connector_iter' 124 124 - 'drm_for_each_crtc' 125 + - 'drm_for_each_crtc_reverse' 125 126 - 'drm_for_each_encoder' 126 127 - 'drm_for_each_encoder_mask' 127 128 - 'drm_for_each_fb' ··· 204 203 - 'for_each_matching_node' 205 204 - 'for_each_matching_node_and_match' 206 205 - 'for_each_member' 207 - - 'for_each_mem_region' 208 - - 'for_each_memblock_type' 209 206 - 'for_each_memcg_cache_index' 210 207 - 'for_each_mem_pfn_range' 211 208 - '__for_each_mem_range' 212 209 - 'for_each_mem_range' 213 210 - '__for_each_mem_range_rev' 214 211 - 'for_each_mem_range_rev' 212 + - 'for_each_mem_region' 215 213 - 'for_each_migratetype_order' 216 214 - 'for_each_msi_entry' 217 215 - 'for_each_msi_entry_safe' ··· 276 276 - 'for_each_reserved_mem_range' 277 277 - 'for_each_reserved_mem_region' 278 278 - 'for_each_rtd_codec_dais' 279 - - 'for_each_rtd_codec_dais_rollback' 280 279 - 'for_each_rtd_components' 281 280 - 'for_each_rtd_cpu_dais' 282 - - 'for_each_rtd_cpu_dais_rollback' 283 281 - 'for_each_rtd_dais' 284 282 - 'for_each_set_bit' 285 283 - 'for_each_set_bit_from' ··· 296 298 - '__for_each_thread' 297 299 - 'for_each_thread' 298 300 - 'for_each_unicast_dest_pgid' 301 + - 'for_each_vsi' 299 302 - 'for_each_wakeup_source' 300 303 - 'for_each_zone' 301 304 - 'for_each_zone_zonelist' ··· 329 330 - 'hlist_for_each_entry_rcu_bh' 330 331 - 'hlist_for_each_entry_rcu_notrace' 331 332 - 'hlist_for_each_entry_safe' 333 + - 'hlist_for_each_entry_srcu' 332 334 - '__hlist_for_each_rcu' 333 335 - 'hlist_for_each_safe' 334 336 - 'hlist_nulls_for_each_entry' ··· 378 378 - 'list_for_each_entry_safe_continue' 379 379 - 'list_for_each_entry_safe_from' 380 380 - 'list_for_each_entry_safe_reverse' 381 + - 'list_for_each_entry_srcu' 381 382 - 'list_for_each_prev' 382 383 - 'list_for_each_prev_safe' 383 384 - 'list_for_each_safe' ··· 412 411 - 'of_property_for_each_string' 413 412 - 'of_property_for_each_u32' 414 413 - 'pci_bus_for_each_resource' 414 + - 'pcl_for_each_chunk' 415 + - 'pcl_for_each_segment' 415 416 - 'pcm_for_each_format' 416 417 - 'ping_portaddr_for_each_entry' 417 418 - 'plist_for_each'
+16
Documentation/admin-guide/media/rkisp1.rst
··· 13 13 and RK3399 SoCs. The driver is located under drivers/staging/media/rkisp1 14 14 and uses the Media-Controller API. 15 15 16 + Revisions 17 + ========= 18 + 19 + There exist multiple smaller revisions to this ISP that got introduced in 20 + later SoCs. Revisions can be found in the enum :c:type:`rkisp1_cif_isp_version` 21 + in the UAPI and the revision of the ISP inside the running SoC can be read 22 + in the field hw_revision of struct media_device_info as returned by 23 + ioctl MEDIA_IOC_DEVICE_INFO. 24 + 25 + Versions in use are: 26 + 27 + - RKISP1_V10: used at least in rk3288 and rk3399 28 + - RKISP1_V11: declared in the original vendor code, but not used 29 + - RKISP1_V12: used at least in rk3326 and px30 30 + - RKISP1_V13: used at least in rk1808 31 + 16 32 Topology 17 33 ======== 18 34 .. _rkisp1_topology_graph:
+5
Documentation/asm-annotations.rst
··· 100 100 ~~~~~~~~~~~~~~~~~~ 101 101 This section covers ``SYM_FUNC_*`` and ``SYM_CODE_*`` enumerated above. 102 102 103 + ``objtool`` requires that all code must be contained in an ELF symbol. Symbol 104 + names that have a ``.L`` prefix do not emit symbol table entries. ``.L`` 105 + prefixed symbols can be used within a code region, but should be avoided for 106 + denoting a range of code via ``SYM_*_START/END`` annotations. 107 + 103 108 * ``SYM_FUNC_START`` and ``SYM_FUNC_START_LOCAL`` are supposed to be **the 104 109 most frequent markings**. They are used for functions with standard calling 105 110 conventions -- global and local. Like in C, they both align the functions to
-1
Documentation/devicetree/bindings/arm/cpus.yaml
··· 232 232 by this cpu (see ./idle-states.yaml). 233 233 234 234 capacity-dmips-mhz: 235 - $ref: '/schemas/types.yaml#/definitions/uint32' 236 235 description: 237 236 u32 value representing CPU capacity (see ./cpu-capacity.txt) in 238 237 DMIPS/MHz, relative to highest capacity-dmips-mhz
+1 -1
Documentation/devicetree/bindings/display/bridge/sii902x.txt
··· 40 40 documents on how to describe the way the sii902x device is 41 41 connected to the rest of the audio system: 42 42 Documentation/devicetree/bindings/sound/simple-card.yaml 43 - Documentation/devicetree/bindings/sound/audio-graph-card.txt 43 + Documentation/devicetree/bindings/sound/audio-graph-card.yaml 44 44 Note: In case of the audio-graph-card binding the used port 45 45 index should be 3. 46 46
+2 -2
Documentation/devicetree/bindings/display/mediatek/mediatek,disp.txt
··· 23 23 24 24 For a description of the display interface sink function blocks, see 25 25 Documentation/devicetree/bindings/display/mediatek/mediatek,dsi.txt and 26 - Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.txt. 26 + Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml. 27 27 28 28 Required properties (all function blocks): 29 29 - compatible: "mediatek,<chip>-disp-<function>", one of ··· 61 61 "mediatek,<chip>-disp-wdma" 62 62 the supported chips are mt2701, mt8167 and mt8173. 63 63 - larb: Should contain a phandle pointing to the local arbiter device as defined 64 - in Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt 64 + in Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml 65 65 - iommus: Should point to the respective IOMMU block with master port as 66 66 argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt 67 67 for details.
-1
Documentation/devicetree/bindings/extcon/wlf,arizona.yaml
··· 85 85 wlf,micd-timeout-ms: 86 86 description: 87 87 Timeout for microphone detection, specified in milliseconds. 88 - $ref: "/schemas/types.yaml#/definitions/uint32" 89 88 90 89 wlf,micd-force-micbias: 91 90 description:
-1
Documentation/devicetree/bindings/hwmon/adi,ltc2947.yaml
··· 49 49 description: 50 50 This property controls the Accumulation Dead band which allows to set the 51 51 level of current below which no accumulation takes place. 52 - $ref: /schemas/types.yaml#/definitions/uint32 53 52 maximum: 255 54 53 default: 0 55 54
+3 -5
Documentation/devicetree/bindings/hwmon/baikal,bt1-pvt.yaml
··· 73 73 description: | 74 74 Temperature sensor trimming factor. It can be used to manually adjust the 75 75 temperature measurements within 7.130 degrees Celsius. 76 - maxItems: 1 77 - items: 78 - default: 0 79 - minimum: 0 80 - maximum: 7130 76 + default: 0 77 + minimum: 0 78 + maximum: 7130 81 79 82 80 additionalProperties: false 83 81
-1
Documentation/devicetree/bindings/hwmon/ti,tmp513.yaml
··· 52 52 ti,bus-range-microvolt: 53 53 description: | 54 54 This is the operating range of the bus voltage in microvolt 55 - $ref: /schemas/types.yaml#/definitions/uint32 56 55 enum: [16000000, 32000000] 57 56 default: 32000000 58 57
-2
Documentation/devicetree/bindings/i2c/i2c-gpio.yaml
··· 39 39 40 40 i2c-gpio,delay-us: 41 41 description: delay between GPIO operations (may depend on each platform) 42 - $ref: /schemas/types.yaml#/definitions/uint32 43 42 44 43 i2c-gpio,timeout-ms: 45 44 description: timeout to get data 46 - $ref: /schemas/types.yaml#/definitions/uint32 47 45 48 46 # Deprecated properties, do not use in new device tree sources: 49 47 gpios:
-3
Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml
··· 66 66 default: 400000 67 67 68 68 i2c-sda-hold-time-ns: 69 - maxItems: 1 70 69 description: | 71 70 The property should contain the SDA hold time in nanoseconds. This option 72 71 is only supported in hardware blocks version 1.11a or newer or on 73 72 Microsemi SoCs. 74 73 75 74 i2c-scl-falling-time-ns: 76 - maxItems: 1 77 75 description: | 78 76 The property should contain the SCL falling time in nanoseconds. 79 77 This value is used to compute the tLOW period. 80 78 default: 300 81 79 82 80 i2c-sda-falling-time-ns: 83 - maxItems: 1 84 81 description: | 85 82 The property should contain the SDA falling time in nanoseconds. 86 83 This value is used to compute the tHIGH period.
+1 -1
Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml
··· 80 80 type: boolean 81 81 82 82 bipolar: 83 - description: see Documentation/devicetree/bindings/iio/adc/adc.txt 83 + description: see Documentation/devicetree/bindings/iio/adc/adc.yaml 84 84 type: boolean 85 85 86 86 required:
-1
Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml
··· 23 23 maxItems: 1 24 24 25 25 shunt-resistor-micro-ohms: 26 - $ref: /schemas/types.yaml#/definitions/uint32 27 26 description: | 28 27 Value in micro Ohms of the shunt resistor connected between the RS+ and 29 28 RS- inputs, across which the current is measured. Value needed to compute
-1
Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml
··· 246 246 Resolution (bits) to use for conversions: 247 247 - can be 6, 8, 10 or 12 on stm32f4 248 248 - can be 8, 10, 12, 14 or 16 on stm32h7 and stm32mp1 249 - $ref: /schemas/types.yaml#/definitions/uint32 250 249 251 250 st,adc-channels: 252 251 description: |
-2
Documentation/devicetree/bindings/iio/adc/ti,palmas-gpadc.yaml
··· 42 42 const: 1 43 43 44 44 ti,channel0-current-microamp: 45 - $ref: /schemas/types.yaml#/definitions/uint32 46 45 description: Channel 0 current in uA. 47 46 enum: 48 47 - 0 ··· 50 51 - 20 51 52 52 53 ti,channel3-current-microamp: 53 - $ref: /schemas/types.yaml#/definitions/uint32 54 54 description: Channel 3 current in uA. 55 55 enum: 56 56 - 0
+26 -15
Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml
··· 46 46 two properties must be present: 47 47 48 48 adi,range-microvolt: 49 - $ref: /schemas/types.yaml#/definitions/int32-array 50 49 description: | 51 50 Voltage output range specified as <minimum, maximum> 52 - enum: 53 - - [[0, 5000000]] 54 - - [[0, 10000000]] 55 - - [[-5000000, 5000000]] 56 - - [[-10000000, 10000000]] 51 + oneOf: 52 + - items: 53 + - const: 0 54 + - enum: [5000000, 10000000] 55 + - items: 56 + - const: -5000000 57 + - const: 5000000 58 + - items: 59 + - const: -10000000 60 + - const: 10000000 57 61 58 62 adi,range-microamp: 59 - $ref: /schemas/types.yaml#/definitions/int32-array 60 63 description: | 61 64 Current output range specified as <minimum, maximum> 62 - enum: 63 - - [[0, 20000]] 64 - - [[0, 24000]] 65 - - [[4, 24000]] 66 - - [[-20000, 20000]] 67 - - [[-24000, 24000]] 68 - - [[-1000, 22000]] 65 + oneOf: 66 + - items: 67 + - const: 0 68 + - enum: [20000, 24000] 69 + - items: 70 + - const: 4 71 + - const: 24000 72 + - items: 73 + - const: -20000 74 + - const: 20000 75 + - items: 76 + - const: -24000 77 + - const: 24000 78 + - items: 79 + - const: -1000 80 + - const: 22000 69 81 70 82 reset-gpios: true 71 83 72 84 adi,dc-dc-ilim-microamp: 73 - $ref: /schemas/types.yaml#/definitions/uint32 74 85 enum: [150000, 200000, 250000, 300000, 350000, 400000] 75 86 description: | 76 87 The dc-to-dc converter current limit.
-1
Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml
··· 21 21 description: Connected to ADC_RDY pin. 22 22 23 23 maxim,led-current-microamp: 24 - $ref: /schemas/types.yaml#/definitions/uint32-array 25 24 minItems: 2 26 25 maxItems: 2 27 26 description: |
-2
Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
··· 70 70 71 71 touchscreen-x-mm: 72 72 description: horizontal length in mm of the touchscreen 73 - $ref: /schemas/types.yaml#/definitions/uint32 74 73 75 74 touchscreen-y-mm: 76 75 description: vertical length in mm of the touchscreen 77 - $ref: /schemas/types.yaml#/definitions/uint32 78 76 79 77 dependencies: 80 78 touchscreen-size-x: [ touchscreen-size-y ]
+111
Documentation/devicetree/bindings/leds/richtek,rt8515.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/leds/richtek,rt8515.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Richtek RT8515 1.5A dual channel LED driver 8 + 9 + maintainers: 10 + - Linus Walleij <linus.walleij@linaro.org> 11 + 12 + description: | 13 + The Richtek RT8515 is a dual channel (two mode) LED driver that 14 + supports driving a white LED in flash or torch mode. The maximum 15 + current for each mode is defined in hardware using two resistors 16 + RFS and RTS. 17 + 18 + properties: 19 + compatible: 20 + const: richtek,rt8515 21 + 22 + enf-gpios: 23 + maxItems: 1 24 + description: A connection to the 'ENF' (enable flash) pin. 25 + 26 + ent-gpios: 27 + maxItems: 1 28 + description: A connection to the 'ENT' (enable torch) pin. 29 + 30 + richtek,rfs-ohms: 31 + minimum: 7680 32 + maximum: 367000 33 + description: The resistance value of the RFS resistor. This 34 + resistors limits the maximum flash current. This must be set 35 + for the property flash-max-microamp to work, the RFS resistor 36 + defines the range of the dimmer setting (brightness) of the 37 + flash LED. 38 + 39 + richtek,rts-ohms: 40 + minimum: 7680 41 + maximum: 367000 42 + description: The resistance value of the RTS resistor. This 43 + resistors limits the maximum torch current. This must be set 44 + for the property torch-max-microamp to work, the RTS resistor 45 + defines the range of the dimmer setting (brightness) of the 46 + torch LED. 47 + 48 + led: 49 + type: object 50 + $ref: common.yaml# 51 + properties: 52 + function: true 53 + color: true 54 + flash-max-timeout-us: true 55 + 56 + flash-max-microamp: 57 + maximum: 700000 58 + description: The maximum current for flash mode 59 + is hardwired to the component using the RFS resistor to 60 + ground. The maximum hardware current setting is calculated 61 + according to the formula Imax = 5500 / RFS. The lowest 62 + allowed resistance value is 7.86 kOhm giving an absolute 63 + maximum current of 700mA. By setting this attribute in 64 + the device tree, you can further restrict the maximum 65 + current below the hardware limit. This requires the RFS 66 + to be defined as it defines the maximum range. 67 + 68 + led-max-microamp: 69 + maximum: 700000 70 + description: The maximum current for torch mode 71 + is hardwired to the component using the RTS resistor to 72 + ground. The maximum hardware current setting is calculated 73 + according to the formula Imax = 5500 / RTS. The lowest 74 + allowed resistance value is 7.86 kOhm giving an absolute 75 + maximum current of 700mA. By setting this attribute in 76 + the device tree, you can further restrict the maximum 77 + current below the hardware limit. This requires the RTS 78 + to be defined as it defines the maximum range. 79 + 80 + additionalProperties: false 81 + 82 + required: 83 + - compatible 84 + - ent-gpios 85 + - enf-gpios 86 + - led 87 + 88 + additionalProperties: false 89 + 90 + examples: 91 + - | 92 + #include <dt-bindings/gpio/gpio.h> 93 + #include <dt-bindings/leds/common.h> 94 + 95 + led-controller { 96 + compatible = "richtek,rt8515"; 97 + enf-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>; 98 + ent-gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>; 99 + richtek,rfs-ohms = <16000>; 100 + richtek,rts-ohms = <100000>; 101 + 102 + led { 103 + function = LED_FUNCTION_FLASH; 104 + color = <LED_COLOR_ID_WHITE>; 105 + flash-max-timeout-us = <250000>; 106 + flash-max-microamp = <150000>; 107 + led-max-microamp = <25000>; 108 + }; 109 + }; 110 + 111 + ...
+1 -1
Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.txt
··· 16 16 - power-domains: a phandle to the power domain, see 17 17 Documentation/devicetree/bindings/power/power_domain.txt for details. 18 18 - mediatek,larb: must contain the local arbiters in the current Socs, see 19 - Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt 19 + Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml 20 20 for details. 21 21 - iommus: should point to the respective IOMMU block with master port as 22 22 argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt
+1 -1
Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.txt
··· 14 14 - power-domains: a phandle to the power domain, see 15 15 Documentation/devicetree/bindings/power/power_domain.txt for details. 16 16 - mediatek,larb: must contain the local arbiters in the current SoCs, see 17 - Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt 17 + Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml 18 18 for details. 19 19 - iommus: should point to the respective IOMMU block with master port as 20 20 argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt
+1 -1
Documentation/devicetree/bindings/media/mediatek-mdp.txt
··· 28 28 argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt 29 29 for details. 30 30 - mediatek,larb: must contain the local arbiters in the current Socs, see 31 - Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt 31 + Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml 32 32 for details. 33 33 34 34 Example:
-1
Documentation/devicetree/bindings/mmc/mmc-controller.yaml
··· 259 259 waiting for I/O signalling and card power supply to be stable, 260 260 regardless of whether pwrseq-simple is used. Default to 10ms if 261 261 no available. 262 - $ref: /schemas/types.yaml#/definitions/uint32 263 262 default: 10 264 263 265 264 supports-cqe:
-2
Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.yaml
··· 41 41 description: 42 42 Delay in ms after powering the card and de-asserting the 43 43 reset-gpios (if any). 44 - $ref: /schemas/types.yaml#/definitions/uint32 45 44 46 45 power-off-delay-us: 47 46 description: 48 47 Delay in us after asserting the reset-gpios (if any) 49 48 during power off of the card. 50 - $ref: /schemas/types.yaml#/definitions/uint32 51 49 52 50 required: 53 51 - compatible
-2
Documentation/devicetree/bindings/net/ethernet-controller.yaml
··· 122 122 such as flow control thresholds. 123 123 124 124 rx-internal-delay-ps: 125 - $ref: /schemas/types.yaml#/definitions/uint32 126 125 description: | 127 126 RGMII Receive Clock Delay defined in pico seconds. 128 127 This is used for controllers that have configurable RX internal delays. ··· 139 140 is used for components that can have configurable fifo sizes. 140 141 141 142 tx-internal-delay-ps: 142 - $ref: /schemas/types.yaml#/definitions/uint32 143 143 description: | 144 144 RGMII Transmit Clock Delay defined in pico seconds. 145 145 This is used for controllers that have configurable TX internal delays.
-1
Documentation/devicetree/bindings/net/snps,dwmac.yaml
··· 212 212 Triplet of delays. The 1st cell is reset pre-delay in micro 213 213 seconds. The 2nd cell is reset pulse in micro seconds. The 3rd 214 214 cell is reset post-delay in micro seconds. 215 - $ref: /schemas/types.yaml#/definitions/uint32-array 216 215 minItems: 3 217 216 maxItems: 3 218 217
-3
Documentation/devicetree/bindings/power/supply/battery.yaml
··· 83 83 for each of the battery capacity lookup table. 84 84 85 85 operating-range-celsius: 86 - $ref: /schemas/types.yaml#/definitions/uint32-array 87 86 description: operating temperature range of a battery 88 87 items: 89 88 - description: minimum temperature at which battery can operate 90 89 - description: maximum temperature at which battery can operate 91 90 92 91 ambient-celsius: 93 - $ref: /schemas/types.yaml#/definitions/uint32-array 94 92 description: safe range of ambient temperature 95 93 items: 96 94 - description: alert when ambient temperature is lower than this value 97 95 - description: alert when ambient temperature is higher than this value 98 96 99 97 alert-celsius: 100 - $ref: /schemas/types.yaml#/definitions/uint32-array 101 98 description: safe range of battery temperature 102 99 items: 103 100 - description: alert when battery temperature is lower than this value
-1
Documentation/devicetree/bindings/power/supply/bq2515x.yaml
··· 50 50 maxItems: 1 51 51 52 52 input-current-limit-microamp: 53 - $ref: /schemas/types.yaml#/definitions/uint32 54 53 description: Maximum input current in micro Amps. 55 54 minimum: 50000 56 55 maximum: 500000
-1
Documentation/devicetree/bindings/regulator/dlg,da9121.yaml
··· 62 62 description: IRQ line information. 63 63 64 64 dlg,irq-polling-delay-passive-ms: 65 - $ref: "/schemas/types.yaml#/definitions/uint32" 66 65 minimum: 1000 67 66 maximum: 10000 68 67 description: |
-2
Documentation/devicetree/bindings/regulator/fixed-regulator.yaml
··· 72 72 73 73 startup-delay-us: 74 74 description: startup time in microseconds 75 - $ref: /schemas/types.yaml#/definitions/uint32 76 75 77 76 off-on-delay-us: 78 77 description: off delay time in microseconds 79 - $ref: /schemas/types.yaml#/definitions/uint32 80 78 81 79 enable-active-high: 82 80 description:
-2
Documentation/devicetree/bindings/rtc/rtc.yaml
··· 27 27 1: chargeable 28 28 29 29 quartz-load-femtofarads: 30 - $ref: /schemas/types.yaml#/definitions/uint32 31 30 description: 32 31 The capacitive load of the quartz(x-tal), expressed in femto 33 32 Farad (fF). The default value shall be listed (if optional), ··· 46 47 deprecated: true 47 48 48 49 trickle-resistor-ohms: 49 - $ref: /schemas/types.yaml#/definitions/uint32 50 50 description: 51 51 Selected resistor for trickle charger. Should be given 52 52 if trickle charger should be enabled.
-2
Documentation/devicetree/bindings/serial/pl011.yaml
··· 88 88 description: 89 89 Rate at which poll occurs when auto-poll is set. 90 90 default 100ms. 91 - $ref: /schemas/types.yaml#/definitions/uint32 92 91 default: 100 93 92 94 93 poll-timeout-ms: 95 94 description: 96 95 Poll timeout when auto-poll is set, default 97 96 3000ms. 98 - $ref: /schemas/types.yaml#/definitions/uint32 99 97 default: 3000 100 98 101 99 required:
-2
Documentation/devicetree/bindings/sound/sgtl5000.yaml
··· 41 41 values of 2k, 4k or 8k. If set to 0 it will be off. If this node is not 42 42 mentioned or if the value is unknown, then micbias resistor is set to 43 43 4k. 44 - $ref: "/schemas/types.yaml#/definitions/uint32" 45 44 enum: [ 0, 2, 4, 8 ] 46 45 47 46 micbias-voltage-m-volts: 48 47 description: The bias voltage to be used in mVolts. The voltage can take 49 48 values from 1.25V to 3V by 250mV steps. If this node is not mentioned 50 49 or the value is unknown, then the value is set to 1.25V. 51 - $ref: "/schemas/types.yaml#/definitions/uint32" 52 50 enum: [ 1250, 1500, 1750, 2000, 2250, 2500, 2750, 3000 ] 53 51 54 52 lrclk-strength:
+4
Documentation/devicetree/bindings/usb/ti,j721e-usb.yaml
··· 21 21 reg: 22 22 description: module registers 23 23 24 + ranges: true 25 + 24 26 power-domains: 25 27 description: 26 28 PM domain provider node and an args specifier containing ··· 63 61 64 62 '#size-cells': 65 63 const: 2 64 + 65 + dma-coherent: true 66 66 67 67 patternProperties: 68 68 "^usb@":
-1
Documentation/devicetree/bindings/watchdog/watchdog.yaml
··· 19 19 pattern: "^watchdog(@.*|-[0-9a-f])?$" 20 20 21 21 timeout-sec: 22 - $ref: /schemas/types.yaml#/definitions/uint32 23 22 description: 24 23 Contains the watchdog timeout in seconds. 25 24
+1 -1
Documentation/networking/ip-sysctl.rst
··· 1196 1196 1197 1197 If non-zero, the message will be sent with the primary address of 1198 1198 the interface that received the packet that caused the icmp error. 1199 - This is the behaviour network many administrators will expect from 1199 + This is the behaviour many network administrators will expect from 1200 1200 a router. And it can make debugging complicated network layouts 1201 1201 much easier. 1202 1202
+1 -1
Makefile
··· 2 2 VERSION = 5 3 3 PATCHLEVEL = 11 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc5 5 + EXTRAVERSION = -rc6 6 6 NAME = Kleptomaniac Octopus 7 7 8 8 # *DOCUMENTATION*
+2 -1
arch/arm/boot/compressed/atags_to_fdt.c
··· 15 15 { 16 16 int offset = fdt_path_offset(fdt, node_path); 17 17 if (offset == -FDT_ERR_NOTFOUND) 18 - offset = fdt_add_subnode(fdt, 0, node_path); 18 + /* Add the node to root if not found, dropping the leading '/' */ 19 + offset = fdt_add_subnode(fdt, 0, node_path + 1); 19 20 return offset; 20 21 } 21 22
+4 -2
arch/arm64/include/asm/memory.h
··· 247 247 248 248 249 249 /* 250 - * The linear kernel range starts at the bottom of the virtual address space. 250 + * Check whether an arbitrary address is within the linear map, which 251 + * lives in the [PAGE_OFFSET, PAGE_END) interval at the bottom of the 252 + * kernel's TTBR1 address range. 251 253 */ 252 - #define __is_lm_address(addr) (((u64)(addr) & ~PAGE_OFFSET) < (PAGE_END - PAGE_OFFSET)) 254 + #define __is_lm_address(addr) (((u64)(addr) ^ PAGE_OFFSET) < (PAGE_END - PAGE_OFFSET)) 253 255 254 256 #define __lm_to_phys(addr) (((addr) & ~PAGE_OFFSET) + PHYS_OFFSET) 255 257 #define __kimg_to_phys(addr) ((addr) - kimage_voffset)
+17 -13
arch/powerpc/kernel/irq.c
··· 180 180 181 181 void replay_soft_interrupts(void) 182 182 { 183 - /* 184 - * We use local_paca rather than get_paca() to avoid all 185 - * the debug_smp_processor_id() business in this low level 186 - * function 187 - */ 188 - unsigned char happened = local_paca->irq_happened; 189 183 struct pt_regs regs; 184 + 185 + /* 186 + * Be careful here, calling these interrupt handlers can cause 187 + * softirqs to be raised, which they may run when calling irq_exit, 188 + * which will cause local_irq_enable() to be run, which can then 189 + * recurse into this function. Don't keep any state across 190 + * interrupt handler calls which may change underneath us. 191 + * 192 + * We use local_paca rather than get_paca() to avoid all the 193 + * debug_smp_processor_id() business in this low level function. 194 + */ 190 195 191 196 ppc_save_regs(&regs); 192 197 regs.softe = IRQS_ENABLED; ··· 214 209 * This is a higher priority interrupt than the others, so 215 210 * replay it first. 216 211 */ 217 - if (IS_ENABLED(CONFIG_PPC_BOOK3S) && (happened & PACA_IRQ_HMI)) { 212 + if (IS_ENABLED(CONFIG_PPC_BOOK3S) && (local_paca->irq_happened & PACA_IRQ_HMI)) { 218 213 local_paca->irq_happened &= ~PACA_IRQ_HMI; 219 214 regs.trap = 0xe60; 220 215 handle_hmi_exception(&regs); ··· 222 217 hard_irq_disable(); 223 218 } 224 219 225 - if (happened & PACA_IRQ_DEC) { 220 + if (local_paca->irq_happened & PACA_IRQ_DEC) { 226 221 local_paca->irq_happened &= ~PACA_IRQ_DEC; 227 222 regs.trap = 0x900; 228 223 timer_interrupt(&regs); ··· 230 225 hard_irq_disable(); 231 226 } 232 227 233 - if (happened & PACA_IRQ_EE) { 228 + if (local_paca->irq_happened & PACA_IRQ_EE) { 234 229 local_paca->irq_happened &= ~PACA_IRQ_EE; 235 230 regs.trap = 0x500; 236 231 do_IRQ(&regs); ··· 238 233 hard_irq_disable(); 239 234 } 240 235 241 - if (IS_ENABLED(CONFIG_PPC_DOORBELL) && (happened & PACA_IRQ_DBELL)) { 236 + if (IS_ENABLED(CONFIG_PPC_DOORBELL) && (local_paca->irq_happened & PACA_IRQ_DBELL)) { 242 237 local_paca->irq_happened &= ~PACA_IRQ_DBELL; 243 238 if (IS_ENABLED(CONFIG_PPC_BOOK3E)) 244 239 regs.trap = 0x280; ··· 250 245 } 251 246 252 247 /* Book3E does not support soft-masking PMI interrupts */ 253 - if (IS_ENABLED(CONFIG_PPC_BOOK3S) && (happened & PACA_IRQ_PMI)) { 248 + if (IS_ENABLED(CONFIG_PPC_BOOK3S) && (local_paca->irq_happened & PACA_IRQ_PMI)) { 254 249 local_paca->irq_happened &= ~PACA_IRQ_PMI; 255 250 regs.trap = 0xf00; 256 251 performance_monitor_exception(&regs); ··· 258 253 hard_irq_disable(); 259 254 } 260 255 261 - happened = local_paca->irq_happened; 262 - if (happened & ~PACA_IRQ_HARD_DIS) { 256 + if (local_paca->irq_happened & ~PACA_IRQ_HARD_DIS) { 263 257 /* 264 258 * We are responding to the next interrupt, so interrupt-off 265 259 * latencies should be reset here.
+1 -1
arch/riscv/mm/init.c
··· 196 196 max_pfn = PFN_DOWN(dram_end); 197 197 max_low_pfn = max_pfn; 198 198 dma32_phys_limit = min(4UL * SZ_1G, (unsigned long)PFN_PHYS(max_low_pfn)); 199 - set_max_mapnr(max_low_pfn); 199 + set_max_mapnr(max_low_pfn - ARCH_PFN_OFFSET); 200 200 201 201 #ifdef CONFIG_BLK_DEV_INITRD 202 202 setup_initrd();
+1 -1
arch/s390/boot/uv.c
··· 35 35 uv_info.guest_cpu_stor_len = uvcb.cpu_stor_len; 36 36 uv_info.max_sec_stor_addr = ALIGN(uvcb.max_guest_stor_addr, PAGE_SIZE); 37 37 uv_info.max_num_sec_conf = uvcb.max_num_sec_conf; 38 - uv_info.max_guest_cpus = uvcb.max_guest_cpus; 38 + uv_info.max_guest_cpu_id = uvcb.max_guest_cpu_id; 39 39 } 40 40 41 41 #ifdef CONFIG_PROTECTED_VIRTUALIZATION_GUEST
+2 -2
arch/s390/include/asm/uv.h
··· 96 96 u32 max_num_sec_conf; 97 97 u64 max_guest_stor_addr; 98 98 u8 reserved88[158 - 136]; 99 - u16 max_guest_cpus; 99 + u16 max_guest_cpu_id; 100 100 u8 reserveda0[200 - 160]; 101 101 } __packed __aligned(8); 102 102 ··· 273 273 unsigned long guest_cpu_stor_len; 274 274 unsigned long max_sec_stor_addr; 275 275 unsigned int max_num_sec_conf; 276 - unsigned short max_guest_cpus; 276 + unsigned short max_guest_cpu_id; 277 277 }; 278 278 279 279 extern struct uv_info uv_info;
+1 -1
arch/s390/kernel/uv.c
··· 368 368 struct kobj_attribute *attr, char *page) 369 369 { 370 370 return scnprintf(page, PAGE_SIZE, "%d\n", 371 - uv_info.max_guest_cpus); 371 + uv_info.max_guest_cpu_id + 1); 372 372 } 373 373 374 374 static struct kobj_attribute uv_query_max_guest_cpus_attr =
+5 -10
arch/x86/entry/thunk_64.S
··· 10 10 #include <asm/export.h> 11 11 12 12 /* rdi: arg1 ... normal C conventions. rax is saved/restored. */ 13 - .macro THUNK name, func, put_ret_addr_in_rdi=0 13 + .macro THUNK name, func 14 14 SYM_FUNC_START_NOALIGN(\name) 15 15 pushq %rbp 16 16 movq %rsp, %rbp ··· 25 25 pushq %r10 26 26 pushq %r11 27 27 28 - .if \put_ret_addr_in_rdi 29 - /* 8(%rbp) is return addr on stack */ 30 - movq 8(%rbp), %rdi 31 - .endif 32 - 33 28 call \func 34 - jmp .L_restore 29 + jmp __thunk_restore 35 30 SYM_FUNC_END(\name) 36 31 _ASM_NOKPROBE(\name) 37 32 .endm ··· 39 44 #endif 40 45 41 46 #ifdef CONFIG_PREEMPTION 42 - SYM_CODE_START_LOCAL_NOALIGN(.L_restore) 47 + SYM_CODE_START_LOCAL_NOALIGN(__thunk_restore) 43 48 popq %r11 44 49 popq %r10 45 50 popq %r9 ··· 51 56 popq %rdi 52 57 popq %rbp 53 58 ret 54 - _ASM_NOKPROBE(.L_restore) 55 - SYM_CODE_END(.L_restore) 59 + _ASM_NOKPROBE(__thunk_restore) 60 + SYM_CODE_END(__thunk_restore) 56 61 #endif
+13 -5
block/blk-cgroup.c
··· 1016 1016 */ 1017 1017 void blkcg_destroy_blkgs(struct blkcg *blkcg) 1018 1018 { 1019 + might_sleep(); 1020 + 1019 1021 spin_lock_irq(&blkcg->lock); 1020 1022 1021 1023 while (!hlist_empty(&blkcg->blkg_list)) { ··· 1025 1023 struct blkcg_gq, blkcg_node); 1026 1024 struct request_queue *q = blkg->q; 1027 1025 1028 - if (spin_trylock(&q->queue_lock)) { 1029 - blkg_destroy(blkg); 1030 - spin_unlock(&q->queue_lock); 1031 - } else { 1026 + if (need_resched() || !spin_trylock(&q->queue_lock)) { 1027 + /* 1028 + * Given that the system can accumulate a huge number 1029 + * of blkgs in pathological cases, check to see if we 1030 + * need to rescheduling to avoid softlockup. 1031 + */ 1032 1032 spin_unlock_irq(&blkcg->lock); 1033 - cpu_relax(); 1033 + cond_resched(); 1034 1034 spin_lock_irq(&blkcg->lock); 1035 + continue; 1035 1036 } 1037 + 1038 + blkg_destroy(blkg); 1039 + spin_unlock(&q->queue_lock); 1036 1040 } 1037 1041 1038 1042 spin_unlock_irq(&blkcg->lock);
+1 -1
block/blk-mq.h
··· 304 304 struct request_queue *q = hctx->queue; 305 305 struct blk_mq_tag_set *set = q->tag_set; 306 306 307 - if (!test_bit(BLK_MQ_S_TAG_ACTIVE, &q->queue_flags)) 307 + if (!test_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags)) 308 308 return true; 309 309 users = atomic_read(&set->active_queues_shared_sbitmap); 310 310 } else {
+3 -2
block/genhd.c
··· 45 45 void set_capacity(struct gendisk *disk, sector_t sectors) 46 46 { 47 47 struct block_device *bdev = disk->part0; 48 + unsigned long flags; 48 49 49 - spin_lock(&bdev->bd_size_lock); 50 + spin_lock_irqsave(&bdev->bd_size_lock, flags); 50 51 i_size_write(bdev->bd_inode, (loff_t)sectors << SECTOR_SHIFT); 51 - spin_unlock(&bdev->bd_size_lock); 52 + spin_unlock_irqrestore(&bdev->bd_size_lock, flags); 52 53 } 53 54 EXPORT_SYMBOL(set_capacity); 54 55
+5 -3
block/partitions/core.c
··· 88 88 89 89 static void bdev_set_nr_sectors(struct block_device *bdev, sector_t sectors) 90 90 { 91 - spin_lock(&bdev->bd_size_lock); 91 + unsigned long flags; 92 + 93 + spin_lock_irqsave(&bdev->bd_size_lock, flags); 92 94 i_size_write(bdev->bd_inode, (loff_t)sectors << SECTOR_SHIFT); 93 - spin_unlock(&bdev->bd_size_lock); 95 + spin_unlock_irqrestore(&bdev->bd_size_lock, flags); 94 96 } 95 97 96 98 static struct parsed_partitions *allocate_partitions(struct gendisk *hd) ··· 386 384 387 385 err = blk_alloc_devt(bdev, &devt); 388 386 if (err) 389 - goto out_bdput; 387 + goto out_put; 390 388 pdev->devt = devt; 391 389 392 390 /* delay uevent until 'holders' subdir is created */
+12 -2
drivers/acpi/arm64/iort.c
··· 1107 1107 1108 1108 ncomp = (struct acpi_iort_named_component *)node->node_data; 1109 1109 1110 + if (!ncomp->memory_address_limit) { 1111 + pr_warn(FW_BUG "Named component missing memory address limit\n"); 1112 + return -EINVAL; 1113 + } 1114 + 1110 1115 *size = ncomp->memory_address_limit >= 64 ? U64_MAX : 1111 1116 1ULL<<ncomp->memory_address_limit; 1112 1117 ··· 1130 1125 return -ENODEV; 1131 1126 1132 1127 rc = (struct acpi_iort_root_complex *)node->node_data; 1128 + 1129 + if (!rc->memory_address_limit) { 1130 + pr_warn(FW_BUG "Root complex missing memory address limit\n"); 1131 + return -EINVAL; 1132 + } 1133 1133 1134 1134 *size = rc->memory_address_limit >= 64 ? U64_MAX : 1135 1135 1ULL<<rc->memory_address_limit; ··· 1183 1173 end = dmaaddr + size - 1; 1184 1174 mask = DMA_BIT_MASK(ilog2(end) + 1); 1185 1175 dev->bus_dma_limit = end; 1186 - dev->coherent_dma_mask = mask; 1187 - *dev->dma_mask = mask; 1176 + dev->coherent_dma_mask = min(dev->coherent_dma_mask, mask); 1177 + *dev->dma_mask = min(*dev->dma_mask, mask); 1188 1178 } 1189 1179 1190 1180 *dma_addr = dmaaddr;
+6 -14
drivers/acpi/device_sysfs.c
··· 251 251 if (add_uevent_var(env, "MODALIAS=")) 252 252 return -ENOMEM; 253 253 254 - len = create_pnp_modalias(adev, &env->buf[env->buflen - 1], 255 - sizeof(env->buf) - env->buflen); 256 - if (len < 0) 257 - return len; 258 - 259 - env->buflen += len; 260 - if (!adev->data.of_compatible) 261 - return 0; 262 - 263 - if (len > 0 && add_uevent_var(env, "MODALIAS=")) 264 - return -ENOMEM; 265 - 266 - len = create_of_modalias(adev, &env->buf[env->buflen - 1], 267 - sizeof(env->buf) - env->buflen); 254 + if (adev->data.of_compatible) 255 + len = create_of_modalias(adev, &env->buf[env->buflen - 1], 256 + sizeof(env->buf) - env->buflen); 257 + else 258 + len = create_pnp_modalias(adev, &env->buf[env->buflen - 1], 259 + sizeof(env->buf) - env->buflen); 268 260 if (len < 0) 269 261 return len; 270 262
+33 -13
drivers/acpi/thermal.c
··· 174 174 struct thermal_zone_device *thermal_zone; 175 175 int kelvin_offset; /* in millidegrees */ 176 176 struct work_struct thermal_check_work; 177 + struct mutex thermal_check_lock; 178 + refcount_t thermal_check_count; 177 179 }; 178 180 179 181 /* -------------------------------------------------------------------------- ··· 495 493 return -ENODEV; 496 494 } 497 495 return 0; 498 - } 499 - 500 - static void acpi_thermal_check(void *data) 501 - { 502 - struct acpi_thermal *tz = data; 503 - 504 - thermal_zone_device_update(tz->thermal_zone, 505 - THERMAL_EVENT_UNSPECIFIED); 506 496 } 507 497 508 498 /* sys I/F for generic thermal sysfs support */ ··· 894 900 Driver Interface 895 901 -------------------------------------------------------------------------- */ 896 902 903 + static void acpi_queue_thermal_check(struct acpi_thermal *tz) 904 + { 905 + if (!work_pending(&tz->thermal_check_work)) 906 + queue_work(acpi_thermal_pm_queue, &tz->thermal_check_work); 907 + } 908 + 897 909 static void acpi_thermal_notify(struct acpi_device *device, u32 event) 898 910 { 899 911 struct acpi_thermal *tz = acpi_driver_data(device); ··· 910 910 911 911 switch (event) { 912 912 case ACPI_THERMAL_NOTIFY_TEMPERATURE: 913 - acpi_thermal_check(tz); 913 + acpi_queue_thermal_check(tz); 914 914 break; 915 915 case ACPI_THERMAL_NOTIFY_THRESHOLDS: 916 916 acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_THRESHOLDS); 917 - acpi_thermal_check(tz); 917 + acpi_queue_thermal_check(tz); 918 918 acpi_bus_generate_netlink_event(device->pnp.device_class, 919 919 dev_name(&device->dev), event, 0); 920 920 break; 921 921 case ACPI_THERMAL_NOTIFY_DEVICES: 922 922 acpi_thermal_trips_update(tz, ACPI_TRIPS_REFRESH_DEVICES); 923 - acpi_thermal_check(tz); 923 + acpi_queue_thermal_check(tz); 924 924 acpi_bus_generate_netlink_event(device->pnp.device_class, 925 925 dev_name(&device->dev), event, 0); 926 926 break; ··· 1020 1020 { 1021 1021 struct acpi_thermal *tz = container_of(work, struct acpi_thermal, 1022 1022 thermal_check_work); 1023 - acpi_thermal_check(tz); 1023 + 1024 + /* 1025 + * In general, it is not sufficient to check the pending bit, because 1026 + * subsequent instances of this function may be queued after one of them 1027 + * has started running (e.g. if _TMP sleeps). Avoid bailing out if just 1028 + * one of them is running, though, because it may have done the actual 1029 + * check some time ago, so allow at least one of them to block on the 1030 + * mutex while another one is running the update. 1031 + */ 1032 + if (!refcount_dec_not_one(&tz->thermal_check_count)) 1033 + return; 1034 + 1035 + mutex_lock(&tz->thermal_check_lock); 1036 + 1037 + thermal_zone_device_update(tz->thermal_zone, THERMAL_EVENT_UNSPECIFIED); 1038 + 1039 + refcount_inc(&tz->thermal_check_count); 1040 + 1041 + mutex_unlock(&tz->thermal_check_lock); 1024 1042 } 1025 1043 1026 1044 static int acpi_thermal_add(struct acpi_device *device) ··· 1070 1052 if (result) 1071 1053 goto free_memory; 1072 1054 1055 + refcount_set(&tz->thermal_check_count, 3); 1056 + mutex_init(&tz->thermal_check_lock); 1073 1057 INIT_WORK(&tz->thermal_check_work, acpi_thermal_check_fn); 1074 1058 1075 1059 pr_info(PREFIX "%s [%s] (%ld C)\n", acpi_device_name(device), ··· 1137 1117 tz->state.active |= tz->trips.active[i].flags.enabled; 1138 1118 } 1139 1119 1140 - queue_work(acpi_thermal_pm_queue, &tz->thermal_check_work); 1120 + acpi_queue_thermal_check(tz); 1141 1121 1142 1122 return AE_OK; 1143 1123 }
+8
drivers/block/nbd.c
··· 1022 1022 if (!sock) 1023 1023 return err; 1024 1024 1025 + /* 1026 + * We need to make sure we don't get any errant requests while we're 1027 + * reallocating the ->socks array. 1028 + */ 1029 + blk_mq_freeze_queue(nbd->disk->queue); 1030 + 1025 1031 if (!netlink && !nbd->task_setup && 1026 1032 !test_bit(NBD_RT_BOUND, &config->runtime_flags)) 1027 1033 nbd->task_setup = current; ··· 1066 1060 nsock->cookie = 0; 1067 1061 socks[config->num_connections++] = nsock; 1068 1062 atomic_inc(&config->live_connections); 1063 + blk_mq_unfreeze_queue(nbd->disk->queue); 1069 1064 1070 1065 return 0; 1071 1066 1072 1067 put_socket: 1068 + blk_mq_unfreeze_queue(nbd->disk->queue); 1073 1069 sockfd_put(sock); 1074 1070 return err; 1075 1071 }
+9 -7
drivers/block/null_blk/zoned.c
··· 6 6 #define CREATE_TRACE_POINTS 7 7 #include "trace.h" 8 8 9 - #define MB_TO_SECTS(mb) (((sector_t)mb * SZ_1M) >> SECTOR_SHIFT) 9 + static inline sector_t mb_to_sects(unsigned long mb) 10 + { 11 + return ((sector_t)mb * SZ_1M) >> SECTOR_SHIFT; 12 + } 10 13 11 14 static inline unsigned int null_zone_no(struct nullb_device *dev, sector_t sect) 12 15 { ··· 80 77 return -EINVAL; 81 78 } 82 79 83 - zone_capacity_sects = MB_TO_SECTS(dev->zone_capacity); 84 - dev_capacity_sects = MB_TO_SECTS(dev->size); 85 - dev->zone_size_sects = MB_TO_SECTS(dev->zone_size); 86 - dev->nr_zones = dev_capacity_sects >> ilog2(dev->zone_size_sects); 87 - if (dev_capacity_sects & (dev->zone_size_sects - 1)) 88 - dev->nr_zones++; 80 + zone_capacity_sects = mb_to_sects(dev->zone_capacity); 81 + dev_capacity_sects = mb_to_sects(dev->size); 82 + dev->zone_size_sects = mb_to_sects(dev->zone_size); 83 + dev->nr_zones = round_up(dev_capacity_sects, dev->zone_size_sects) 84 + >> ilog2(dev->zone_size_sects); 89 85 90 86 dev->zones = kvmalloc_array(dev->nr_zones, sizeof(struct nullb_zone), 91 87 GFP_KERNEL | __GFP_ZERO);
+9 -4
drivers/firmware/efi/apple-properties.c
··· 3 3 * apple-properties.c - EFI device properties on Macs 4 4 * Copyright (C) 2016 Lukas Wunner <lukas@wunner.de> 5 5 * 6 - * Note, all properties are considered as u8 arrays. 7 - * To get a value of any of them the caller must use device_property_read_u8_array(). 6 + * Properties are stored either as: 7 + * u8 arrays which can be retrieved with device_property_read_u8_array() or 8 + * booleans which can be queried with device_property_present(). 8 9 */ 9 10 10 11 #define pr_fmt(fmt) "apple-properties: " fmt ··· 89 88 90 89 entry_data = ptr + key_len + sizeof(val_len); 91 90 entry_len = val_len - sizeof(val_len); 92 - entry[i] = PROPERTY_ENTRY_U8_ARRAY_LEN(key, entry_data, 93 - entry_len); 91 + if (entry_len) 92 + entry[i] = PROPERTY_ENTRY_U8_ARRAY_LEN(key, entry_data, 93 + entry_len); 94 + else 95 + entry[i] = PROPERTY_ENTRY_BOOL(key); 96 + 94 97 if (dump_properties) { 95 98 dev_info(dev, "property: %s\n", key); 96 99 print_hex_dump(KERN_INFO, pr_fmt(), DUMP_PREFIX_OFFSET,
+4 -2
drivers/gpu/drm/amd/display/dc/dcn30/Makefile
··· 32 32 33 33 34 34 ifdef CONFIG_X86 35 - CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -mhard-float -msse 36 - CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -mhard-float -msse 35 + CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o := -msse 36 + CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o := -msse 37 37 endif 38 38 39 39 ifdef CONFIG_PPC64 ··· 45 45 ifeq ($(call cc-ifversion, -lt, 0701, y), y) 46 46 IS_OLD_GCC = 1 47 47 endif 48 + CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_resource.o += -mhard-float 49 + CFLAGS_$(AMDDALPATH)/dc/dcn30/dcn30_optc.o += -mhard-float 48 50 endif 49 51 50 52 ifdef CONFIG_X86
+2 -1
drivers/gpu/drm/amd/display/dc/dcn301/Makefile
··· 14 14 dcn301_dio_link_encoder.o dcn301_hwseq.o dcn301_panel_cntl.o dcn301_hubbub.o 15 15 16 16 ifdef CONFIG_X86 17 - CFLAGS_$(AMDDALPATH)/dc/dcn301/dcn301_resource.o := -mhard-float -msse 17 + CFLAGS_$(AMDDALPATH)/dc/dcn301/dcn301_resource.o := -msse 18 18 endif 19 19 20 20 ifdef CONFIG_PPC64 ··· 25 25 ifeq ($(call cc-ifversion, -lt, 0701, y), y) 26 26 IS_OLD_GCC = 1 27 27 endif 28 + CFLAGS_$(AMDDALPATH)/dc/dcn301/dcn301_resource.o += -mhard-float 28 29 endif 29 30 30 31 ifdef CONFIG_X86
+2 -1
drivers/gpu/drm/amd/display/dc/dcn302/Makefile
··· 13 13 DCN3_02 = dcn302_init.o dcn302_hwseq.o dcn302_resource.o 14 14 15 15 ifdef CONFIG_X86 16 - CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -mhard-float -msse 16 + CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o := -msse 17 17 endif 18 18 19 19 ifdef CONFIG_PPC64 ··· 24 24 ifeq ($(call cc-ifversion, -lt, 0701, y), y) 25 25 IS_OLD_GCC = 1 26 26 endif 27 + CFLAGS_$(AMDDALPATH)/dc/dcn302/dcn302_resource.o += -mhard-float 27 28 endif 28 29 29 30 ifdef CONFIG_X86
+1
drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h
··· 553 553 *clock_req); 554 554 uint32_t (*get_fan_control_mode)(struct smu_context *smu); 555 555 int (*set_fan_control_mode)(struct smu_context *smu, uint32_t mode); 556 + int (*set_fan_speed_percent)(struct smu_context *smu, uint32_t speed); 556 557 int (*set_fan_speed_rpm)(struct smu_context *smu, uint32_t speed); 557 558 int (*set_xgmi_pstate)(struct smu_context *smu, uint32_t pstate); 558 559 int (*gfx_off_control)(struct smu_context *smu, bool enable);
+3
drivers/gpu/drm/amd/pm/inc/smu_v11_0.h
··· 203 203 smu_v11_0_set_fan_control_mode(struct smu_context *smu, 204 204 uint32_t mode); 205 205 206 + int 207 + smu_v11_0_set_fan_speed_percent(struct smu_context *smu, uint32_t speed); 208 + 206 209 int smu_v11_0_set_fan_speed_rpm(struct smu_context *smu, 207 210 uint32_t speed); 208 211
+2 -7
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
··· 2151 2151 int smu_set_fan_speed_percent(struct smu_context *smu, uint32_t speed) 2152 2152 { 2153 2153 int ret = 0; 2154 - uint32_t rpm; 2155 2154 2156 2155 if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled) 2157 2156 return -EOPNOTSUPP; 2158 2157 2159 2158 mutex_lock(&smu->mutex); 2160 2159 2161 - if (smu->ppt_funcs->set_fan_speed_rpm) { 2162 - if (speed > 100) 2163 - speed = 100; 2164 - rpm = speed * smu->fan_max_rpm / 100; 2165 - ret = smu->ppt_funcs->set_fan_speed_rpm(smu, rpm); 2166 - } 2160 + if (smu->ppt_funcs->set_fan_speed_percent) 2161 + ret = smu->ppt_funcs->set_fan_speed_percent(smu, speed); 2167 2162 2168 2163 mutex_unlock(&smu->mutex); 2169 2164
+1
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
··· 2326 2326 .display_clock_voltage_request = smu_v11_0_display_clock_voltage_request, 2327 2327 .get_fan_control_mode = smu_v11_0_get_fan_control_mode, 2328 2328 .set_fan_control_mode = smu_v11_0_set_fan_control_mode, 2329 + .set_fan_speed_percent = smu_v11_0_set_fan_speed_percent, 2329 2330 .set_fan_speed_rpm = smu_v11_0_set_fan_speed_rpm, 2330 2331 .set_xgmi_pstate = smu_v11_0_set_xgmi_pstate, 2331 2332 .gfx_off_control = smu_v11_0_gfx_off_control,
+1
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
··· 2456 2456 .display_clock_voltage_request = smu_v11_0_display_clock_voltage_request, 2457 2457 .get_fan_control_mode = smu_v11_0_get_fan_control_mode, 2458 2458 .set_fan_control_mode = smu_v11_0_set_fan_control_mode, 2459 + .set_fan_speed_percent = smu_v11_0_set_fan_speed_percent, 2459 2460 .set_fan_speed_rpm = smu_v11_0_set_fan_speed_rpm, 2460 2461 .set_xgmi_pstate = smu_v11_0_set_xgmi_pstate, 2461 2462 .gfx_off_control = smu_v11_0_gfx_off_control,
+1
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c
··· 2802 2802 .display_clock_voltage_request = smu_v11_0_display_clock_voltage_request, 2803 2803 .get_fan_control_mode = smu_v11_0_get_fan_control_mode, 2804 2804 .set_fan_control_mode = smu_v11_0_set_fan_control_mode, 2805 + .set_fan_speed_percent = smu_v11_0_set_fan_speed_percent, 2805 2806 .set_fan_speed_rpm = smu_v11_0_set_fan_speed_rpm, 2806 2807 .set_xgmi_pstate = smu_v11_0_set_xgmi_pstate, 2807 2808 .gfx_off_control = smu_v11_0_gfx_off_control,
+30 -1
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
··· 1174 1174 } 1175 1175 1176 1176 int 1177 + smu_v11_0_set_fan_speed_percent(struct smu_context *smu, uint32_t speed) 1178 + { 1179 + struct amdgpu_device *adev = smu->adev; 1180 + uint32_t duty100, duty; 1181 + uint64_t tmp64; 1182 + 1183 + if (speed > 100) 1184 + speed = 100; 1185 + 1186 + if (smu_v11_0_auto_fan_control(smu, 0)) 1187 + return -EINVAL; 1188 + 1189 + duty100 = REG_GET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL1), 1190 + CG_FDO_CTRL1, FMAX_DUTY100); 1191 + if (!duty100) 1192 + return -EINVAL; 1193 + 1194 + tmp64 = (uint64_t)speed * duty100; 1195 + do_div(tmp64, 100); 1196 + duty = (uint32_t)tmp64; 1197 + 1198 + WREG32_SOC15(THM, 0, mmCG_FDO_CTRL0, 1199 + REG_SET_FIELD(RREG32_SOC15(THM, 0, mmCG_FDO_CTRL0), 1200 + CG_FDO_CTRL0, FDO_STATIC_DUTY, duty)); 1201 + 1202 + return smu_v11_0_set_fan_static_mode(smu, FDO_PWM_MODE_STATIC); 1203 + } 1204 + 1205 + int 1177 1206 smu_v11_0_set_fan_control_mode(struct smu_context *smu, 1178 1207 uint32_t mode) 1179 1208 { ··· 1210 1181 1211 1182 switch (mode) { 1212 1183 case AMD_FAN_CTRL_NONE: 1213 - ret = smu_v11_0_set_fan_speed_rpm(smu, smu->fan_max_rpm); 1184 + ret = smu_v11_0_set_fan_speed_percent(smu, 100); 1214 1185 break; 1215 1186 case AMD_FAN_CTRL_MANUAL: 1216 1187 ret = smu_v11_0_auto_fan_control(smu, 0);
+3 -4
drivers/gpu/drm/i915/display/intel_ddi.c
··· 2755 2755 u32 val; 2756 2756 2757 2757 ddi_translations = icl_get_mg_buf_trans(encoder, crtc_state, &n_entries); 2758 - /* The table does not have values for level 3 and level 9. */ 2759 - if (level >= n_entries || level == 3 || level == 9) { 2758 + if (level >= n_entries) { 2760 2759 drm_dbg_kms(&dev_priv->drm, 2761 2760 "DDI translation not found for level %d. Using %d instead.", 2762 - level, n_entries - 2); 2763 - level = n_entries - 2; 2761 + level, n_entries - 1); 2762 + level = n_entries - 1; 2764 2763 } 2765 2764 2766 2765 /* Set MG_TX_LINK_PARAMS cri_use_fs32 to 0. */
+12
drivers/gpu/drm/i915/gt/gen7_renderclear.c
··· 390 390 &cb_kernel_ivb, 391 391 desc_count); 392 392 393 + /* Reset inherited context registers */ 394 + gen7_emit_pipeline_invalidate(&cmds); 395 + batch_add(&cmds, MI_LOAD_REGISTER_IMM(2)); 396 + batch_add(&cmds, i915_mmio_reg_offset(CACHE_MODE_0_GEN7)); 397 + batch_add(&cmds, 0xffff0000); 398 + batch_add(&cmds, i915_mmio_reg_offset(CACHE_MODE_1)); 399 + batch_add(&cmds, 0xffff0000 | PIXEL_SUBSPAN_COLLECT_OPT_DISABLE); 400 + gen7_emit_pipeline_flush(&cmds); 401 + 402 + /* Switch to the media pipeline and our base address */ 393 403 gen7_emit_pipeline_invalidate(&cmds); 394 404 batch_add(&cmds, PIPELINE_SELECT | PIPELINE_SELECT_MEDIA); 395 405 batch_add(&cmds, MI_NOOP); ··· 409 399 gen7_emit_state_base_address(&cmds, descriptors); 410 400 gen7_emit_pipeline_invalidate(&cmds); 411 401 402 + /* Set the clear-residual kernel state */ 412 403 gen7_emit_vfe_state(&cmds, bv, urb_size - 1, 0, 0); 413 404 gen7_emit_interface_descriptor_load(&cmds, descriptors, desc_count); 414 405 406 + /* Execute the kernel on all HW threads */ 415 407 for (i = 0; i < num_primitives(bv); i++) 416 408 gen7_emit_media_object(&cmds, i); 417 409
+35 -12
drivers/gpu/drm/i915/gt/intel_ggtt.c
··· 526 526 527 527 mutex_init(&ggtt->error_mutex); 528 528 if (ggtt->mappable_end) { 529 - /* Reserve a mappable slot for our lockless error capture */ 530 - ret = drm_mm_insert_node_in_range(&ggtt->vm.mm, 531 - &ggtt->error_capture, 532 - PAGE_SIZE, 0, 533 - I915_COLOR_UNEVICTABLE, 534 - 0, ggtt->mappable_end, 535 - DRM_MM_INSERT_LOW); 536 - if (ret) 537 - return ret; 529 + /* 530 + * Reserve a mappable slot for our lockless error capture. 531 + * 532 + * We strongly prefer taking address 0x0 in order to protect 533 + * other critical buffers against accidental overwrites, 534 + * as writing to address 0 is a very common mistake. 535 + * 536 + * Since 0 may already be in use by the system (e.g. the BIOS 537 + * framebuffer), we let the reservation fail quietly and hope 538 + * 0 remains reserved always. 539 + * 540 + * If we fail to reserve 0, and then fail to find any space 541 + * for an error-capture, remain silent. We can afford not 542 + * to reserve an error_capture node as we have fallback 543 + * paths, and we trust that 0 will remain reserved. However, 544 + * the only likely reason for failure to insert is a driver 545 + * bug, which we expect to cause other failures... 546 + */ 547 + ggtt->error_capture.size = I915_GTT_PAGE_SIZE; 548 + ggtt->error_capture.color = I915_COLOR_UNEVICTABLE; 549 + if (drm_mm_reserve_node(&ggtt->vm.mm, &ggtt->error_capture)) 550 + drm_mm_insert_node_in_range(&ggtt->vm.mm, 551 + &ggtt->error_capture, 552 + ggtt->error_capture.size, 0, 553 + ggtt->error_capture.color, 554 + 0, ggtt->mappable_end, 555 + DRM_MM_INSERT_LOW); 538 556 } 557 + if (drm_mm_node_allocated(&ggtt->error_capture)) 558 + drm_dbg(&ggtt->vm.i915->drm, 559 + "Reserved GGTT:[%llx, %llx] for use by error capture\n", 560 + ggtt->error_capture.start, 561 + ggtt->error_capture.start + ggtt->error_capture.size); 539 562 540 563 /* 541 564 * The upper portion of the GuC address space has a sizeable hole ··· 571 548 572 549 /* Clear any non-preallocated blocks */ 573 550 drm_mm_for_each_hole(entry, &ggtt->vm.mm, hole_start, hole_end) { 574 - drm_dbg_kms(&ggtt->vm.i915->drm, 575 - "clearing unused GTT space: [%lx, %lx]\n", 576 - hole_start, hole_end); 551 + drm_dbg(&ggtt->vm.i915->drm, 552 + "clearing unused GTT space: [%lx, %lx]\n", 553 + hole_start, hole_end); 577 554 ggtt->vm.clear_range(&ggtt->vm, hole_start, 578 555 hole_end - hole_start); 579 556 }
+15 -13
drivers/gpu/drm/i915/i915_active.c
··· 631 631 632 632 int __i915_active_wait(struct i915_active *ref, int state) 633 633 { 634 - int err; 635 - 636 634 might_sleep(); 637 635 638 - if (!i915_active_acquire_if_busy(ref)) 639 - return 0; 640 - 641 636 /* Any fence added after the wait begins will not be auto-signaled */ 642 - err = flush_lazy_signals(ref); 643 - i915_active_release(ref); 644 - if (err) 645 - return err; 637 + if (i915_active_acquire_if_busy(ref)) { 638 + int err; 646 639 647 - if (!i915_active_is_idle(ref) && 648 - ___wait_var_event(ref, i915_active_is_idle(ref), 649 - state, 0, 0, schedule())) 650 - return -EINTR; 640 + err = flush_lazy_signals(ref); 641 + i915_active_release(ref); 642 + if (err) 643 + return err; 651 644 645 + if (___wait_var_event(ref, i915_active_is_idle(ref), 646 + state, 0, 0, schedule())) 647 + return -EINTR; 648 + } 649 + 650 + /* 651 + * After the wait is complete, the caller may free the active. 652 + * We have to flush any concurrent retirement before returning. 653 + */ 652 654 flush_work(&ref->work); 653 655 return 0; 654 656 }
+1 -1
drivers/gpu/drm/i915/i915_drv.h
··· 1346 1346 { 1347 1347 const unsigned int pi = __platform_mask_index(info, p); 1348 1348 1349 - return info->platform_mask[pi] & INTEL_SUBPLATFORM_BITS; 1349 + return info->platform_mask[pi] & ((1 << INTEL_SUBPLATFORM_BITS) - 1); 1350 1350 } 1351 1351 1352 1352 static __always_inline bool
+1 -1
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
··· 1880 1880 vma = i915_vma_instance(out, vm, NULL); 1881 1881 if (IS_ERR(vma)) { 1882 1882 err = PTR_ERR(vma); 1883 - goto out_put_batch; 1883 + goto out_put_out; 1884 1884 } 1885 1885 1886 1886 err = i915_vma_pin(vma, 0, 0,
+5 -1
drivers/gpu/drm/nouveau/dispnv50/base507c.c
··· 88 88 NVVAL(NV507C, SET_CONVERSION, OFS, 0x64)); 89 89 } else { 90 90 PUSH_MTHD(push, NV507C, SET_PROCESSING, 91 - NVDEF(NV507C, SET_PROCESSING, USE_GAIN_OFS, DISABLE)); 91 + NVDEF(NV507C, SET_PROCESSING, USE_GAIN_OFS, DISABLE), 92 + 93 + SET_CONVERSION, 94 + NVVAL(NV507C, SET_CONVERSION, GAIN, 0) | 95 + NVVAL(NV507C, SET_CONVERSION, OFS, 0)); 92 96 } 93 97 94 98 PUSH_MTHD(push, NV507C, SURFACE_SET_OFFSET(0, 0), asyw->image.offset[0] >> 8);
+5 -1
drivers/gpu/drm/nouveau/dispnv50/base827c.c
··· 49 49 NVVAL(NV827C, SET_CONVERSION, OFS, 0x64)); 50 50 } else { 51 51 PUSH_MTHD(push, NV827C, SET_PROCESSING, 52 - NVDEF(NV827C, SET_PROCESSING, USE_GAIN_OFS, DISABLE)); 52 + NVDEF(NV827C, SET_PROCESSING, USE_GAIN_OFS, DISABLE), 53 + 54 + SET_CONVERSION, 55 + NVVAL(NV827C, SET_CONVERSION, GAIN, 0) | 56 + NVVAL(NV827C, SET_CONVERSION, OFS, 0)); 53 57 } 54 58 55 59 PUSH_MTHD(push, NV827C, SURFACE_SET_OFFSET(0, 0), asyw->image.offset[0] >> 8,
+8
drivers/gpu/drm/nouveau/dispnv50/disp.c
··· 2663 2663 else 2664 2664 nouveau_display(dev)->format_modifiers = disp50xx_modifiers; 2665 2665 2666 + if (disp->disp->object.oclass >= GK104_DISP) { 2667 + dev->mode_config.cursor_width = 256; 2668 + dev->mode_config.cursor_height = 256; 2669 + } else { 2670 + dev->mode_config.cursor_width = 64; 2671 + dev->mode_config.cursor_height = 64; 2672 + } 2673 + 2666 2674 /* create crtc objects to represent the hw heads */ 2667 2675 if (disp->disp->object.oclass >= GV100_DISP) 2668 2676 crtcs = nvif_rd32(&device->object, 0x610060) & 0xff;
+27 -1
drivers/gpu/drm/nouveau/dispnv50/head917d.c
··· 22 22 #include "head.h" 23 23 #include "core.h" 24 24 25 + #include "nvif/push.h" 25 26 #include <nvif/push507c.h> 26 27 27 28 #include <nvhw/class/cl917d.h> ··· 74 73 return 0; 75 74 } 76 75 76 + static int 77 + head917d_curs_set(struct nv50_head *head, struct nv50_head_atom *asyh) 78 + { 79 + struct nvif_push *push = nv50_disp(head->base.base.dev)->core->chan.push; 80 + const int i = head->base.index; 81 + int ret; 82 + 83 + ret = PUSH_WAIT(push, 5); 84 + if (ret) 85 + return ret; 86 + 87 + PUSH_MTHD(push, NV917D, HEAD_SET_CONTROL_CURSOR(i), 88 + NVDEF(NV917D, HEAD_SET_CONTROL_CURSOR, ENABLE, ENABLE) | 89 + NVVAL(NV917D, HEAD_SET_CONTROL_CURSOR, FORMAT, asyh->curs.format) | 90 + NVVAL(NV917D, HEAD_SET_CONTROL_CURSOR, SIZE, asyh->curs.layout) | 91 + NVVAL(NV917D, HEAD_SET_CONTROL_CURSOR, HOT_SPOT_X, 0) | 92 + NVVAL(NV917D, HEAD_SET_CONTROL_CURSOR, HOT_SPOT_Y, 0) | 93 + NVDEF(NV917D, HEAD_SET_CONTROL_CURSOR, COMPOSITION, ALPHA_BLEND), 94 + 95 + HEAD_SET_OFFSET_CURSOR(i), asyh->curs.offset >> 8); 96 + 97 + PUSH_MTHD(push, NV917D, HEAD_SET_CONTEXT_DMA_CURSOR(i), asyh->curs.handle); 98 + return 0; 99 + } 100 + 77 101 int 78 102 head917d_curs_layout(struct nv50_head *head, struct nv50_wndw_atom *asyw, 79 103 struct nv50_head_atom *asyh) ··· 127 101 .core_clr = head907d_core_clr, 128 102 .curs_layout = head917d_curs_layout, 129 103 .curs_format = head507d_curs_format, 130 - .curs_set = head907d_curs_set, 104 + .curs_set = head917d_curs_set, 131 105 .curs_clr = head907d_curs_clr, 132 106 .base = head917d_base, 133 107 .ovly = head907d_ovly,
+13 -4
drivers/gpu/drm/nouveau/dispnv50/wndw.c
··· 702 702 nvif_notify_get(&wndw->notify); 703 703 } 704 704 705 + static const u64 nv50_cursor_format_modifiers[] = { 706 + DRM_FORMAT_MOD_LINEAR, 707 + DRM_FORMAT_MOD_INVALID, 708 + }; 709 + 705 710 int 706 711 nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev, 707 712 enum drm_plane_type type, const char *name, int index, ··· 718 713 struct nvif_mmu *mmu = &drm->client.mmu; 719 714 struct nv50_disp *disp = nv50_disp(dev); 720 715 struct nv50_wndw *wndw; 716 + const u64 *format_modifiers; 721 717 int nformat; 722 718 int ret; 723 719 ··· 734 728 735 729 for (nformat = 0; format[nformat]; nformat++); 736 730 737 - ret = drm_universal_plane_init(dev, &wndw->plane, heads, &nv50_wndw, 738 - format, nformat, 739 - nouveau_display(dev)->format_modifiers, 740 - type, "%s-%d", name, index); 731 + if (type == DRM_PLANE_TYPE_CURSOR) 732 + format_modifiers = nv50_cursor_format_modifiers; 733 + else 734 + format_modifiers = nouveau_display(dev)->format_modifiers; 735 + 736 + ret = drm_universal_plane_init(dev, &wndw->plane, heads, &nv50_wndw, format, nformat, 737 + format_modifiers, type, "%s-%d", name, index); 741 738 if (ret) { 742 739 kfree(*pwndw); 743 740 *pwndw = NULL;
+4
drivers/gpu/drm/nouveau/include/nvhw/class/cl917d.h
··· 66 66 #define NV917D_HEAD_SET_CONTROL_CURSOR_COMPOSITION_ALPHA_BLEND (0x00000000) 67 67 #define NV917D_HEAD_SET_CONTROL_CURSOR_COMPOSITION_PREMULT_ALPHA_BLEND (0x00000001) 68 68 #define NV917D_HEAD_SET_CONTROL_CURSOR_COMPOSITION_XOR (0x00000002) 69 + #define NV917D_HEAD_SET_OFFSET_CURSOR(a) (0x00000484 + (a)*0x00000300) 70 + #define NV917D_HEAD_SET_OFFSET_CURSOR_ORIGIN 31:0 71 + #define NV917D_HEAD_SET_CONTEXT_DMA_CURSOR(a) (0x0000048C + (a)*0x00000300) 72 + #define NV917D_HEAD_SET_CONTEXT_DMA_CURSOR_HANDLE 31:0 69 73 #define NV917D_HEAD_SET_DITHER_CONTROL(a) (0x000004A0 + (a)*0x00000300) 70 74 #define NV917D_HEAD_SET_DITHER_CONTROL_ENABLE 0:0 71 75 #define NV917D_HEAD_SET_DITHER_CONTROL_ENABLE_DISABLE (0x00000000)
+108 -108
drivers/gpu/drm/nouveau/include/nvif/push.h
··· 123 123 } while(0) 124 124 #endif 125 125 126 - #define PUSH_1(X,f,ds,n,c,o,p,s,mA,dA) do { \ 127 - PUSH_##o##_HDR((p), s, mA, (c)+(n)); \ 128 - PUSH_##f(X, (p), X##mA, 1, o, (dA), ds, ""); \ 126 + #define PUSH_1(X,f,ds,n,o,p,s,mA,dA) do { \ 127 + PUSH_##o##_HDR((p), s, mA, (ds)+(n)); \ 128 + PUSH_##f(X, (p), X##mA, 1, o, (dA), ds, ""); \ 129 129 } while(0) 130 - #define PUSH_2(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \ 131 - PUSH_ASSERT((mB) - (mA) == (1?PUSH_##o##_INC), "mthd1"); \ 132 - PUSH_1(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \ 133 - PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 130 + #define PUSH_2(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \ 131 + PUSH_ASSERT((mB) - (mA) == (1?PUSH_##o##_INC), "mthd1"); \ 132 + PUSH_1(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \ 133 + PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 134 134 } while(0) 135 - #define PUSH_3(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \ 136 - PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd2"); \ 137 - PUSH_2(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \ 138 - PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 135 + #define PUSH_3(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \ 136 + PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd2"); \ 137 + PUSH_2(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \ 138 + PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 139 139 } while(0) 140 - #define PUSH_4(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \ 141 - PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd3"); \ 142 - PUSH_3(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \ 143 - PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 140 + #define PUSH_4(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \ 141 + PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd3"); \ 142 + PUSH_3(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \ 143 + PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 144 144 } while(0) 145 - #define PUSH_5(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \ 146 - PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd4"); \ 147 - PUSH_4(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \ 148 - PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 145 + #define PUSH_5(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \ 146 + PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd4"); \ 147 + PUSH_4(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \ 148 + PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 149 149 } while(0) 150 - #define PUSH_6(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \ 151 - PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd5"); \ 152 - PUSH_5(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \ 153 - PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 150 + #define PUSH_6(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \ 151 + PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd5"); \ 152 + PUSH_5(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \ 153 + PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 154 154 } while(0) 155 - #define PUSH_7(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \ 156 - PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd6"); \ 157 - PUSH_6(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \ 158 - PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 155 + #define PUSH_7(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \ 156 + PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd6"); \ 157 + PUSH_6(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \ 158 + PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 159 159 } while(0) 160 - #define PUSH_8(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \ 161 - PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd7"); \ 162 - PUSH_7(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \ 163 - PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 160 + #define PUSH_8(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \ 161 + PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd7"); \ 162 + PUSH_7(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \ 163 + PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 164 164 } while(0) 165 - #define PUSH_9(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \ 166 - PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd8"); \ 167 - PUSH_8(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \ 168 - PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 165 + #define PUSH_9(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \ 166 + PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd8"); \ 167 + PUSH_8(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \ 168 + PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 169 169 } while(0) 170 - #define PUSH_10(X,f,ds,n,c,o,p,s,mB,dB,mA,dA,a...) do { \ 171 - PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd9"); \ 172 - PUSH_9(X, DATA_, 1, ds, (c)+(n), o, (p), s, X##mA, (dA), ##a); \ 173 - PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 170 + #define PUSH_10(X,f,ds,n,o,p,s,mB,dB,mA,dA,a...) do { \ 171 + PUSH_ASSERT((mB) - (mA) == (0?PUSH_##o##_INC), "mthd9"); \ 172 + PUSH_9(X, DATA_, 1, (ds) + (n), o, (p), s, X##mA, (dA), ##a); \ 173 + PUSH_##f(X, (p), X##mB, 0, o, (dB), ds, ""); \ 174 174 } while(0) 175 175 176 - #define PUSH_1D(X,o,p,s,mA,dA) \ 177 - PUSH_1(X, DATA_, 1, 1, 0, o, (p), s, X##mA, (dA)) 178 - #define PUSH_2D(X,o,p,s,mA,dA,mB,dB) \ 179 - PUSH_2(X, DATA_, 1, 1, 0, o, (p), s, X##mB, (dB), \ 180 - X##mA, (dA)) 181 - #define PUSH_3D(X,o,p,s,mA,dA,mB,dB,mC,dC) \ 182 - PUSH_3(X, DATA_, 1, 1, 0, o, (p), s, X##mC, (dC), \ 183 - X##mB, (dB), \ 184 - X##mA, (dA)) 185 - #define PUSH_4D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD) \ 186 - PUSH_4(X, DATA_, 1, 1, 0, o, (p), s, X##mD, (dD), \ 187 - X##mC, (dC), \ 188 - X##mB, (dB), \ 189 - X##mA, (dA)) 190 - #define PUSH_5D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD,mE,dE) \ 191 - PUSH_5(X, DATA_, 1, 1, 0, o, (p), s, X##mE, (dE), \ 192 - X##mD, (dD), \ 193 - X##mC, (dC), \ 194 - X##mB, (dB), \ 195 - X##mA, (dA)) 176 + #define PUSH_1D(X,o,p,s,mA,dA) \ 177 + PUSH_1(X, DATA_, 1, 0, o, (p), s, X##mA, (dA)) 178 + #define PUSH_2D(X,o,p,s,mA,dA,mB,dB) \ 179 + PUSH_2(X, DATA_, 1, 0, o, (p), s, X##mB, (dB), \ 180 + X##mA, (dA)) 181 + #define PUSH_3D(X,o,p,s,mA,dA,mB,dB,mC,dC) \ 182 + PUSH_3(X, DATA_, 1, 0, o, (p), s, X##mC, (dC), \ 183 + X##mB, (dB), \ 184 + X##mA, (dA)) 185 + #define PUSH_4D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD) \ 186 + PUSH_4(X, DATA_, 1, 0, o, (p), s, X##mD, (dD), \ 187 + X##mC, (dC), \ 188 + X##mB, (dB), \ 189 + X##mA, (dA)) 190 + #define PUSH_5D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD,mE,dE) \ 191 + PUSH_5(X, DATA_, 1, 0, o, (p), s, X##mE, (dE), \ 192 + X##mD, (dD), \ 193 + X##mC, (dC), \ 194 + X##mB, (dB), \ 195 + X##mA, (dA)) 196 196 #define PUSH_6D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD,mE,dE,mF,dF) \ 197 - PUSH_6(X, DATA_, 1, 1, 0, o, (p), s, X##mF, (dF), \ 198 - X##mE, (dE), \ 199 - X##mD, (dD), \ 200 - X##mC, (dC), \ 201 - X##mB, (dB), \ 202 - X##mA, (dA)) 197 + PUSH_6(X, DATA_, 1, 0, o, (p), s, X##mF, (dF), \ 198 + X##mE, (dE), \ 199 + X##mD, (dD), \ 200 + X##mC, (dC), \ 201 + X##mB, (dB), \ 202 + X##mA, (dA)) 203 203 #define PUSH_7D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD,mE,dE,mF,dF,mG,dG) \ 204 - PUSH_7(X, DATA_, 1, 1, 0, o, (p), s, X##mG, (dG), \ 205 - X##mF, (dF), \ 206 - X##mE, (dE), \ 207 - X##mD, (dD), \ 208 - X##mC, (dC), \ 209 - X##mB, (dB), \ 210 - X##mA, (dA)) 204 + PUSH_7(X, DATA_, 1, 0, o, (p), s, X##mG, (dG), \ 205 + X##mF, (dF), \ 206 + X##mE, (dE), \ 207 + X##mD, (dD), \ 208 + X##mC, (dC), \ 209 + X##mB, (dB), \ 210 + X##mA, (dA)) 211 211 #define PUSH_8D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD,mE,dE,mF,dF,mG,dG,mH,dH) \ 212 - PUSH_8(X, DATA_, 1, 1, 0, o, (p), s, X##mH, (dH), \ 213 - X##mG, (dG), \ 214 - X##mF, (dF), \ 215 - X##mE, (dE), \ 216 - X##mD, (dD), \ 217 - X##mC, (dC), \ 218 - X##mB, (dB), \ 219 - X##mA, (dA)) 212 + PUSH_8(X, DATA_, 1, 0, o, (p), s, X##mH, (dH), \ 213 + X##mG, (dG), \ 214 + X##mF, (dF), \ 215 + X##mE, (dE), \ 216 + X##mD, (dD), \ 217 + X##mC, (dC), \ 218 + X##mB, (dB), \ 219 + X##mA, (dA)) 220 220 #define PUSH_9D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD,mE,dE,mF,dF,mG,dG,mH,dH,mI,dI) \ 221 - PUSH_9(X, DATA_, 1, 1, 0, o, (p), s, X##mI, (dI), \ 222 - X##mH, (dH), \ 223 - X##mG, (dG), \ 224 - X##mF, (dF), \ 225 - X##mE, (dE), \ 226 - X##mD, (dD), \ 227 - X##mC, (dC), \ 228 - X##mB, (dB), \ 229 - X##mA, (dA)) 221 + PUSH_9(X, DATA_, 1, 0, o, (p), s, X##mI, (dI), \ 222 + X##mH, (dH), \ 223 + X##mG, (dG), \ 224 + X##mF, (dF), \ 225 + X##mE, (dE), \ 226 + X##mD, (dD), \ 227 + X##mC, (dC), \ 228 + X##mB, (dB), \ 229 + X##mA, (dA)) 230 230 #define PUSH_10D(X,o,p,s,mA,dA,mB,dB,mC,dC,mD,dD,mE,dE,mF,dF,mG,dG,mH,dH,mI,dI,mJ,dJ) \ 231 - PUSH_10(X, DATA_, 1, 1, 0, o, (p), s, X##mJ, (dJ), \ 232 - X##mI, (dI), \ 233 - X##mH, (dH), \ 234 - X##mG, (dG), \ 235 - X##mF, (dF), \ 236 - X##mE, (dE), \ 237 - X##mD, (dD), \ 238 - X##mC, (dC), \ 239 - X##mB, (dB), \ 240 - X##mA, (dA)) 231 + PUSH_10(X, DATA_, 1, 0, o, (p), s, X##mJ, (dJ), \ 232 + X##mI, (dI), \ 233 + X##mH, (dH), \ 234 + X##mG, (dG), \ 235 + X##mF, (dF), \ 236 + X##mE, (dE), \ 237 + X##mD, (dD), \ 238 + X##mC, (dC), \ 239 + X##mB, (dB), \ 240 + X##mA, (dA)) 241 241 242 - #define PUSH_1P(X,o,p,s,mA,dp,ds) \ 243 - PUSH_1(X, DATAp, ds, ds, 0, o, (p), s, X##mA, (dp)) 244 - #define PUSH_2P(X,o,p,s,mA,dA,mB,dp,ds) \ 245 - PUSH_2(X, DATAp, ds, ds, 0, o, (p), s, X##mB, (dp), \ 246 - X##mA, (dA)) 247 - #define PUSH_3P(X,o,p,s,mA,dA,mB,dB,mC,dp,ds) \ 248 - PUSH_3(X, DATAp, ds, ds, 0, o, (p), s, X##mC, (dp), \ 249 - X##mB, (dB), \ 250 - X##mA, (dA)) 242 + #define PUSH_1P(X,o,p,s,mA,dp,ds) \ 243 + PUSH_1(X, DATAp, ds, 0, o, (p), s, X##mA, (dp)) 244 + #define PUSH_2P(X,o,p,s,mA,dA,mB,dp,ds) \ 245 + PUSH_2(X, DATAp, ds, 0, o, (p), s, X##mB, (dp), \ 246 + X##mA, (dA)) 247 + #define PUSH_3P(X,o,p,s,mA,dA,mB,dB,mC,dp,ds) \ 248 + PUSH_3(X, DATAp, ds, 0, o, (p), s, X##mC, (dp), \ 249 + X##mB, (dB), \ 250 + X##mA, (dA)) 251 251 252 252 #define PUSH_(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,IMPL,...) IMPL 253 253 #define PUSH(A...) PUSH_(A, PUSH_10P, PUSH_10D, \
+4
drivers/gpu/drm/nouveau/nouveau_svm.c
··· 315 315 struct drm_nouveau_svm_init *args = data; 316 316 int ret; 317 317 318 + /* We need to fail if svm is disabled */ 319 + if (!cli->drm->svm) 320 + return -ENOSYS; 321 + 318 322 /* Allocate tracking for SVM-enabled VMM. */ 319 323 if (!(svmm = kzalloc(sizeof(*svmm), GFP_KERNEL))) 320 324 return -ENOMEM;
+4 -4
drivers/gpu/drm/vc4/vc4_hvs.c
··· 620 620 * for now we just allocate globally. 621 621 */ 622 622 if (!hvs->hvs5) 623 - /* 96kB */ 624 - drm_mm_init(&hvs->lbm_mm, 0, 96 * 1024); 623 + /* 48k words of 2x12-bit pixels */ 624 + drm_mm_init(&hvs->lbm_mm, 0, 48 * 1024); 625 625 else 626 - /* 70k words */ 627 - drm_mm_init(&hvs->lbm_mm, 0, 70 * 2 * 1024); 626 + /* 60k words of 4x12-bit pixels */ 627 + drm_mm_init(&hvs->lbm_mm, 0, 60 * 1024); 628 628 629 629 /* Upload filter kernels. We only have the one for now, so we 630 630 * keep it around for the lifetime of the driver.
+8 -3
drivers/gpu/drm/vc4/vc4_plane.c
··· 437 437 static u32 vc4_lbm_size(struct drm_plane_state *state) 438 438 { 439 439 struct vc4_plane_state *vc4_state = to_vc4_plane_state(state); 440 + struct vc4_dev *vc4 = to_vc4_dev(state->plane->dev); 440 441 u32 pix_per_line; 441 442 u32 lbm; 442 443 ··· 473 472 lbm = pix_per_line * 16; 474 473 } 475 474 476 - lbm = roundup(lbm, 32); 475 + /* Align it to 64 or 128 (hvs5) bytes */ 476 + lbm = roundup(lbm, vc4->hvs->hvs5 ? 128 : 64); 477 + 478 + /* Each "word" of the LBM memory contains 2 or 4 (hvs5) pixels */ 479 + lbm /= vc4->hvs->hvs5 ? 4 : 2; 477 480 478 481 return lbm; 479 482 } ··· 917 912 if (!vc4_state->is_unity) { 918 913 vc4_dlist_write(vc4_state, 919 914 VC4_SET_FIELD(vc4_state->crtc_w, 920 - SCALER_POS1_SCL_WIDTH) | 915 + SCALER5_POS1_SCL_WIDTH) | 921 916 VC4_SET_FIELD(vc4_state->crtc_h, 922 - SCALER_POS1_SCL_HEIGHT)); 917 + SCALER5_POS1_SCL_HEIGHT)); 923 918 } 924 919 925 920 /* Position Word 2: Source Image Size */
+16 -3
drivers/i2c/busses/i2c-mt65xx.c
··· 1275 1275 mtk_i2c_clock_disable(i2c); 1276 1276 1277 1277 ret = devm_request_irq(&pdev->dev, irq, mtk_i2c_irq, 1278 - IRQF_TRIGGER_NONE, I2C_DRV_NAME, i2c); 1278 + IRQF_NO_SUSPEND | IRQF_TRIGGER_NONE, 1279 + I2C_DRV_NAME, i2c); 1279 1280 if (ret < 0) { 1280 1281 dev_err(&pdev->dev, 1281 1282 "Request I2C IRQ %d fail\n", irq); ··· 1303 1302 } 1304 1303 1305 1304 #ifdef CONFIG_PM_SLEEP 1306 - static int mtk_i2c_resume(struct device *dev) 1305 + static int mtk_i2c_suspend_noirq(struct device *dev) 1306 + { 1307 + struct mtk_i2c *i2c = dev_get_drvdata(dev); 1308 + 1309 + i2c_mark_adapter_suspended(&i2c->adap); 1310 + 1311 + return 0; 1312 + } 1313 + 1314 + static int mtk_i2c_resume_noirq(struct device *dev) 1307 1315 { 1308 1316 int ret; 1309 1317 struct mtk_i2c *i2c = dev_get_drvdata(dev); ··· 1327 1317 1328 1318 mtk_i2c_clock_disable(i2c); 1329 1319 1320 + i2c_mark_adapter_resumed(&i2c->adap); 1321 + 1330 1322 return 0; 1331 1323 } 1332 1324 #endif 1333 1325 1334 1326 static const struct dev_pm_ops mtk_i2c_pm = { 1335 - SET_SYSTEM_SLEEP_PM_OPS(NULL, mtk_i2c_resume) 1327 + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mtk_i2c_suspend_noirq, 1328 + mtk_i2c_resume_noirq) 1336 1329 }; 1337 1330 1338 1331 static struct platform_driver mtk_i2c_driver = {
+2 -5
drivers/iommu/amd/amd_iommu.h
··· 84 84 (pdev->device == PCI_DEVICE_ID_RD890_IOMMU); 85 85 } 86 86 87 - static inline bool iommu_feature(struct amd_iommu *iommu, u64 f) 87 + static inline bool iommu_feature(struct amd_iommu *iommu, u64 mask) 88 88 { 89 - if (!(iommu->cap & (1 << IOMMU_CAP_EFR))) 90 - return false; 91 - 92 - return !!(iommu->features & f); 89 + return !!(iommu->features & mask); 93 90 } 94 91 95 92 static inline u64 iommu_virt_to_phys(void *vaddr)
+4
drivers/iommu/amd/amd_iommu_types.h
··· 387 387 #define IOMMU_CAP_NPCACHE 26 388 388 #define IOMMU_CAP_EFR 27 389 389 390 + /* IOMMU IVINFO */ 391 + #define IOMMU_IVINFO_OFFSET 36 392 + #define IOMMU_IVINFO_EFRSUP BIT(0) 393 + 390 394 /* IOMMU Feature Reporting Field (for IVHD type 10h */ 391 395 #define IOMMU_FEAT_GASUP_SHIFT 6 392 396
+54 -2
drivers/iommu/amd/init.c
··· 257 257 258 258 static bool amd_iommu_pre_enabled = true; 259 259 260 + static u32 amd_iommu_ivinfo __initdata; 261 + 260 262 bool translation_pre_enabled(struct amd_iommu *iommu) 261 263 { 262 264 return (iommu->flags & AMD_IOMMU_FLAG_TRANS_PRE_ENABLED); ··· 296 294 int amd_iommu_get_num_iommus(void) 297 295 { 298 296 return amd_iommus_present; 297 + } 298 + 299 + /* 300 + * For IVHD type 0x11/0x40, EFR is also available via IVHD. 301 + * Default to IVHD EFR since it is available sooner 302 + * (i.e. before PCI init). 303 + */ 304 + static void __init early_iommu_features_init(struct amd_iommu *iommu, 305 + struct ivhd_header *h) 306 + { 307 + if (amd_iommu_ivinfo & IOMMU_IVINFO_EFRSUP) 308 + iommu->features = h->efr_reg; 299 309 } 300 310 301 311 /* Access to l1 and l2 indexed register spaces */ ··· 1591 1577 1592 1578 if (h->efr_reg & BIT(IOMMU_EFR_XTSUP_SHIFT)) 1593 1579 amd_iommu_xt_mode = IRQ_REMAP_X2APIC_MODE; 1580 + 1581 + early_iommu_features_init(iommu, h); 1582 + 1594 1583 break; 1595 1584 default: 1596 1585 return -EINVAL; ··· 1787 1770 NULL, 1788 1771 }; 1789 1772 1773 + /* 1774 + * Note: IVHD 0x11 and 0x40 also contains exact copy 1775 + * of the IOMMU Extended Feature Register [MMIO Offset 0030h]. 1776 + * Default to EFR in IVHD since it is available sooner (i.e. before PCI init). 1777 + */ 1778 + static void __init late_iommu_features_init(struct amd_iommu *iommu) 1779 + { 1780 + u64 features; 1781 + 1782 + if (!(iommu->cap & (1 << IOMMU_CAP_EFR))) 1783 + return; 1784 + 1785 + /* read extended feature bits */ 1786 + features = readq(iommu->mmio_base + MMIO_EXT_FEATURES); 1787 + 1788 + if (!iommu->features) { 1789 + iommu->features = features; 1790 + return; 1791 + } 1792 + 1793 + /* 1794 + * Sanity check and warn if EFR values from 1795 + * IVHD and MMIO conflict. 1796 + */ 1797 + if (features != iommu->features) 1798 + pr_warn(FW_WARN "EFR mismatch. Use IVHD EFR (%#llx : %#llx\n).", 1799 + features, iommu->features); 1800 + } 1801 + 1790 1802 static int __init iommu_init_pci(struct amd_iommu *iommu) 1791 1803 { 1792 1804 int cap_ptr = iommu->cap_ptr; ··· 1835 1789 if (!(iommu->cap & (1 << IOMMU_CAP_IOTLB))) 1836 1790 amd_iommu_iotlb_sup = false; 1837 1791 1838 - /* read extended feature bits */ 1839 - iommu->features = readq(iommu->mmio_base + MMIO_EXT_FEATURES); 1792 + late_iommu_features_init(iommu); 1840 1793 1841 1794 if (iommu_feature(iommu, FEATURE_GT)) { 1842 1795 int glxval; ··· 2652 2607 free_unity_maps(); 2653 2608 } 2654 2609 2610 + static void __init ivinfo_init(void *ivrs) 2611 + { 2612 + amd_iommu_ivinfo = *((u32 *)(ivrs + IOMMU_IVINFO_OFFSET)); 2613 + } 2614 + 2655 2615 /* 2656 2616 * This is the hardware init function for AMD IOMMU in the system. 2657 2617 * This function is called either from amd_iommu_init or from the interrupt ··· 2710 2660 ret = check_ivrs_checksum(ivrs_base); 2711 2661 if (ret) 2712 2662 goto out; 2663 + 2664 + ivinfo_init(ivrs_base); 2713 2665 2714 2666 amd_iommu_target_ivhd_type = get_highest_supported_ivhd_type(ivrs_base); 2715 2667 DUMP_printk("Using IVHD type %#x\n", amd_iommu_target_ivhd_type);
+1 -1
drivers/iommu/intel/dmar.c
··· 1496 1496 * Max Invs Pending (MIP) is set to 0 for now until we have DIT in 1497 1497 * ECAP. 1498 1498 */ 1499 - if (addr & GENMASK_ULL(size_order + VTD_PAGE_SHIFT, 0)) 1499 + if (!IS_ALIGNED(addr, VTD_PAGE_SIZE << size_order)) 1500 1500 pr_warn_ratelimited("Invalidate non-aligned address %llx, order %d\n", 1501 1501 addr, size_order); 1502 1502
+31 -1
drivers/iommu/intel/iommu.c
··· 5440 5440 return ret; 5441 5441 } 5442 5442 5443 + static bool domain_use_flush_queue(void) 5444 + { 5445 + struct dmar_drhd_unit *drhd; 5446 + struct intel_iommu *iommu; 5447 + bool r = true; 5448 + 5449 + if (intel_iommu_strict) 5450 + return false; 5451 + 5452 + /* 5453 + * The flush queue implementation does not perform page-selective 5454 + * invalidations that are required for efficient TLB flushes in virtual 5455 + * environments. The benefit of batching is likely to be much lower than 5456 + * the overhead of synchronizing the virtual and physical IOMMU 5457 + * page-tables. 5458 + */ 5459 + rcu_read_lock(); 5460 + for_each_active_iommu(iommu, drhd) { 5461 + if (!cap_caching_mode(iommu->cap)) 5462 + continue; 5463 + 5464 + pr_warn_once("IOMMU batching is disabled due to virtualization"); 5465 + r = false; 5466 + break; 5467 + } 5468 + rcu_read_unlock(); 5469 + 5470 + return r; 5471 + } 5472 + 5443 5473 static int 5444 5474 intel_iommu_domain_get_attr(struct iommu_domain *domain, 5445 5475 enum iommu_attr attr, void *data) ··· 5480 5450 case IOMMU_DOMAIN_DMA: 5481 5451 switch (attr) { 5482 5452 case DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE: 5483 - *(int *)data = !intel_iommu_strict; 5453 + *(int *)data = domain_use_flush_queue(); 5484 5454 return 0; 5485 5455 default: 5486 5456 return -ENODEV;
+3
drivers/leds/Kconfig
··· 928 928 This option enables support for the Power Button LED of 929 929 Acer Iconia Tab A500. 930 930 931 + comment "Flash and Torch LED drivers" 932 + source "drivers/leds/flash/Kconfig" 933 + 931 934 comment "LED Triggers" 932 935 source "drivers/leds/trigger/Kconfig" 933 936
+3
drivers/leds/Makefile
··· 103 103 # LED Userspace Drivers 104 104 obj-$(CONFIG_LEDS_USER) += uleds.o 105 105 106 + # Flash and Torch LED Drivers 107 + obj-$(CONFIG_LEDS_CLASS_FLASH) += flash/ 108 + 106 109 # LED Triggers 107 110 obj-$(CONFIG_LEDS_TRIGGERS) += trigger/
+15
drivers/leds/flash/Kconfig
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + 3 + if LEDS_CLASS_FLASH 4 + 5 + config LEDS_RT8515 6 + tristate "LED support for Richtek RT8515 flash/torch LED" 7 + depends on GPIOLIB 8 + help 9 + This option enables support for the Richtek RT8515 flash 10 + and torch LEDs found on some mobile phones. 11 + 12 + To compile this driver as a module, choose M here: the module 13 + will be called leds-rt8515. 14 + 15 + endif # LEDS_CLASS_FLASH
+3
drivers/leds/flash/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + 3 + obj-$(CONFIG_LEDS_RT8515) += leds-rt8515.o
+397
drivers/leds/flash/leds-rt8515.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-or-later 2 + /* 3 + * LED driver for Richtek RT8515 flash/torch white LEDs 4 + * found on some Samsung mobile phones. 5 + * 6 + * This is a 1.5A Boost dual channel driver produced around 2011. 7 + * 8 + * The component lacks a datasheet, but in the schematic picture 9 + * from the LG P970 service manual you can see the connections 10 + * from the RT8515 to the LED, with two resistors connected 11 + * from the pins "RFS" and "RTS" to ground. 12 + * 13 + * On the LG P970: 14 + * RFS (resistance flash setting?) is 20 kOhm 15 + * RTS (resistance torch setting?) is 39 kOhm 16 + * 17 + * Some sleuthing finds us the RT9387A which we have a datasheet for: 18 + * https://static5.arrow.com/pdfs/2014/7/27/8/21/12/794/rtt_/manual/94download_ds.jspprt9387a.jspprt9387a.pdf 19 + * This apparently works the same way so in theory this driver 20 + * should cover RT9387A as well. This has not been tested, please 21 + * update the compatibles if you add RT9387A support. 22 + * 23 + * Linus Walleij <linus.walleij@linaro.org> 24 + */ 25 + #include <linux/delay.h> 26 + #include <linux/err.h> 27 + #include <linux/gpio/consumer.h> 28 + #include <linux/led-class-flash.h> 29 + #include <linux/mod_devicetable.h> 30 + #include <linux/module.h> 31 + #include <linux/platform_device.h> 32 + #include <linux/property.h> 33 + #include <linux/regulator/consumer.h> 34 + 35 + #include <media/v4l2-flash-led-class.h> 36 + 37 + /* We can provide 15-700 mA out to the LED */ 38 + #define RT8515_MIN_IOUT_MA 15 39 + #define RT8515_MAX_IOUT_MA 700 40 + /* The maximum intensity is 1-16 for flash and 1-100 for torch */ 41 + #define RT8515_FLASH_MAX 16 42 + #define RT8515_TORCH_MAX 100 43 + 44 + #define RT8515_TIMEOUT_US 250000U 45 + #define RT8515_MAX_TIMEOUT_US 300000U 46 + 47 + struct rt8515 { 48 + struct led_classdev_flash fled; 49 + struct device *dev; 50 + struct v4l2_flash *v4l2_flash; 51 + struct mutex lock; 52 + struct regulator *reg; 53 + struct gpio_desc *enable_torch; 54 + struct gpio_desc *enable_flash; 55 + struct timer_list powerdown_timer; 56 + u32 max_timeout; /* Flash max timeout */ 57 + int flash_max_intensity; 58 + int torch_max_intensity; 59 + }; 60 + 61 + static struct rt8515 *to_rt8515(struct led_classdev_flash *fled) 62 + { 63 + return container_of(fled, struct rt8515, fled); 64 + } 65 + 66 + static void rt8515_gpio_led_off(struct rt8515 *rt) 67 + { 68 + gpiod_set_value(rt->enable_flash, 0); 69 + gpiod_set_value(rt->enable_torch, 0); 70 + } 71 + 72 + static void rt8515_gpio_brightness_commit(struct gpio_desc *gpiod, 73 + int brightness) 74 + { 75 + int i; 76 + 77 + /* 78 + * Toggling a GPIO line with a small delay increases the 79 + * brightness one step at a time. 80 + */ 81 + for (i = 0; i < brightness; i++) { 82 + gpiod_set_value(gpiod, 0); 83 + udelay(1); 84 + gpiod_set_value(gpiod, 1); 85 + udelay(1); 86 + } 87 + } 88 + 89 + /* This is setting the torch light level */ 90 + static int rt8515_led_brightness_set(struct led_classdev *led, 91 + enum led_brightness brightness) 92 + { 93 + struct led_classdev_flash *fled = lcdev_to_flcdev(led); 94 + struct rt8515 *rt = to_rt8515(fled); 95 + 96 + mutex_lock(&rt->lock); 97 + 98 + if (brightness == LED_OFF) { 99 + /* Off */ 100 + rt8515_gpio_led_off(rt); 101 + } else if (brightness < RT8515_TORCH_MAX) { 102 + /* Step it up to movie mode brightness using the flash pin */ 103 + rt8515_gpio_brightness_commit(rt->enable_torch, brightness); 104 + } else { 105 + /* Max torch brightness requested */ 106 + gpiod_set_value(rt->enable_torch, 1); 107 + } 108 + 109 + mutex_unlock(&rt->lock); 110 + 111 + return 0; 112 + } 113 + 114 + static int rt8515_led_flash_strobe_set(struct led_classdev_flash *fled, 115 + bool state) 116 + { 117 + struct rt8515 *rt = to_rt8515(fled); 118 + struct led_flash_setting *timeout = &fled->timeout; 119 + int brightness = rt->flash_max_intensity; 120 + 121 + mutex_lock(&rt->lock); 122 + 123 + if (state) { 124 + /* Enable LED flash mode and set brightness */ 125 + rt8515_gpio_brightness_commit(rt->enable_flash, brightness); 126 + /* Set timeout */ 127 + mod_timer(&rt->powerdown_timer, 128 + jiffies + usecs_to_jiffies(timeout->val)); 129 + } else { 130 + del_timer_sync(&rt->powerdown_timer); 131 + /* Turn the LED off */ 132 + rt8515_gpio_led_off(rt); 133 + } 134 + 135 + fled->led_cdev.brightness = LED_OFF; 136 + /* After this the torch LED will be disabled */ 137 + 138 + mutex_unlock(&rt->lock); 139 + 140 + return 0; 141 + } 142 + 143 + static int rt8515_led_flash_strobe_get(struct led_classdev_flash *fled, 144 + bool *state) 145 + { 146 + struct rt8515 *rt = to_rt8515(fled); 147 + 148 + *state = timer_pending(&rt->powerdown_timer); 149 + 150 + return 0; 151 + } 152 + 153 + static int rt8515_led_flash_timeout_set(struct led_classdev_flash *fled, 154 + u32 timeout) 155 + { 156 + /* The timeout is stored in the led-class-flash core */ 157 + return 0; 158 + } 159 + 160 + static const struct led_flash_ops rt8515_flash_ops = { 161 + .strobe_set = rt8515_led_flash_strobe_set, 162 + .strobe_get = rt8515_led_flash_strobe_get, 163 + .timeout_set = rt8515_led_flash_timeout_set, 164 + }; 165 + 166 + static void rt8515_powerdown_timer(struct timer_list *t) 167 + { 168 + struct rt8515 *rt = from_timer(rt, t, powerdown_timer); 169 + 170 + /* Turn the LED off */ 171 + rt8515_gpio_led_off(rt); 172 + } 173 + 174 + static void rt8515_init_flash_timeout(struct rt8515 *rt) 175 + { 176 + struct led_classdev_flash *fled = &rt->fled; 177 + struct led_flash_setting *s; 178 + 179 + /* Init flash timeout setting */ 180 + s = &fled->timeout; 181 + s->min = 1; 182 + s->max = rt->max_timeout; 183 + s->step = 1; 184 + /* 185 + * Set default timeout to RT8515_TIMEOUT_US except if 186 + * max_timeout from DT is lower. 187 + */ 188 + s->val = min(rt->max_timeout, RT8515_TIMEOUT_US); 189 + } 190 + 191 + #if IS_ENABLED(CONFIG_V4L2_FLASH_LED_CLASS) 192 + /* Configure the V2L2 flash subdevice */ 193 + static void rt8515_init_v4l2_flash_config(struct rt8515 *rt, 194 + struct v4l2_flash_config *v4l2_sd_cfg) 195 + { 196 + struct led_classdev *led = &rt->fled.led_cdev; 197 + struct led_flash_setting *s; 198 + 199 + strscpy(v4l2_sd_cfg->dev_name, led->dev->kobj.name, 200 + sizeof(v4l2_sd_cfg->dev_name)); 201 + 202 + /* 203 + * Init flash intensity setting: this is a linear scale 204 + * capped from the device tree max intensity setting 205 + * 1..flash_max_intensity 206 + */ 207 + s = &v4l2_sd_cfg->intensity; 208 + s->min = 1; 209 + s->max = rt->flash_max_intensity; 210 + s->step = 1; 211 + s->val = s->max; 212 + } 213 + 214 + static void rt8515_v4l2_flash_release(struct rt8515 *rt) 215 + { 216 + v4l2_flash_release(rt->v4l2_flash); 217 + } 218 + 219 + #else 220 + static void rt8515_init_v4l2_flash_config(struct rt8515 *rt, 221 + struct v4l2_flash_config *v4l2_sd_cfg) 222 + { 223 + } 224 + 225 + static void rt8515_v4l2_flash_release(struct rt8515 *rt) 226 + { 227 + } 228 + #endif 229 + 230 + static void rt8515_determine_max_intensity(struct rt8515 *rt, 231 + struct fwnode_handle *led, 232 + const char *resistance, 233 + const char *max_ua_prop, int hw_max, 234 + int *max_intensity_setting) 235 + { 236 + u32 res = 0; /* Can't be 0 so 0 is undefined */ 237 + u32 ua; 238 + u32 max_ma; 239 + int max_intensity; 240 + int ret; 241 + 242 + fwnode_property_read_u32(rt->dev->fwnode, resistance, &res); 243 + ret = fwnode_property_read_u32(led, max_ua_prop, &ua); 244 + 245 + /* Missing info in DT, OK go with hardware maxima */ 246 + if (ret || res == 0) { 247 + dev_err(rt->dev, 248 + "either %s or %s missing from DT, using HW max\n", 249 + resistance, max_ua_prop); 250 + max_ma = RT8515_MAX_IOUT_MA; 251 + max_intensity = hw_max; 252 + goto out_assign_max; 253 + } 254 + 255 + /* 256 + * Formula from the datasheet, this is the maximum current 257 + * defined by the hardware. 258 + */ 259 + max_ma = (5500 * 1000) / res; 260 + /* 261 + * Calculate max intensity (linear scaling) 262 + * Formula is ((ua / 1000) / max_ma) * 100, then simplified 263 + */ 264 + max_intensity = (ua / 10) / max_ma; 265 + 266 + dev_info(rt->dev, 267 + "current restricted from %u to %u mA, max intensity %d/100\n", 268 + max_ma, (ua / 1000), max_intensity); 269 + 270 + out_assign_max: 271 + dev_info(rt->dev, "max intensity %d/%d = %d mA\n", 272 + max_intensity, hw_max, max_ma); 273 + *max_intensity_setting = max_intensity; 274 + } 275 + 276 + static int rt8515_probe(struct platform_device *pdev) 277 + { 278 + struct device *dev = &pdev->dev; 279 + struct fwnode_handle *child; 280 + struct rt8515 *rt; 281 + struct led_classdev *led; 282 + struct led_classdev_flash *fled; 283 + struct led_init_data init_data = {}; 284 + struct v4l2_flash_config v4l2_sd_cfg = {}; 285 + int ret; 286 + 287 + rt = devm_kzalloc(dev, sizeof(*rt), GFP_KERNEL); 288 + if (!rt) 289 + return -ENOMEM; 290 + 291 + rt->dev = dev; 292 + fled = &rt->fled; 293 + led = &fled->led_cdev; 294 + 295 + /* ENF - Enable Flash line */ 296 + rt->enable_flash = devm_gpiod_get(dev, "enf", GPIOD_OUT_LOW); 297 + if (IS_ERR(rt->enable_flash)) 298 + return dev_err_probe(dev, PTR_ERR(rt->enable_flash), 299 + "cannot get ENF (enable flash) GPIO\n"); 300 + 301 + /* ENT - Enable Torch line */ 302 + rt->enable_torch = devm_gpiod_get(dev, "ent", GPIOD_OUT_LOW); 303 + if (IS_ERR(rt->enable_torch)) 304 + return dev_err_probe(dev, PTR_ERR(rt->enable_torch), 305 + "cannot get ENT (enable torch) GPIO\n"); 306 + 307 + child = fwnode_get_next_available_child_node(dev->fwnode, NULL); 308 + if (!child) { 309 + dev_err(dev, 310 + "No fwnode child node found for connected LED.\n"); 311 + return -EINVAL; 312 + } 313 + init_data.fwnode = child; 314 + 315 + rt8515_determine_max_intensity(rt, child, "richtek,rfs-ohms", 316 + "flash-max-microamp", 317 + RT8515_FLASH_MAX, 318 + &rt->flash_max_intensity); 319 + rt8515_determine_max_intensity(rt, child, "richtek,rts-ohms", 320 + "led-max-microamp", 321 + RT8515_TORCH_MAX, 322 + &rt->torch_max_intensity); 323 + 324 + ret = fwnode_property_read_u32(child, "flash-max-timeout-us", 325 + &rt->max_timeout); 326 + if (ret) { 327 + rt->max_timeout = RT8515_MAX_TIMEOUT_US; 328 + dev_warn(dev, 329 + "flash-max-timeout-us property missing\n"); 330 + } 331 + timer_setup(&rt->powerdown_timer, rt8515_powerdown_timer, 0); 332 + rt8515_init_flash_timeout(rt); 333 + 334 + fled->ops = &rt8515_flash_ops; 335 + 336 + led->max_brightness = rt->torch_max_intensity; 337 + led->brightness_set_blocking = rt8515_led_brightness_set; 338 + led->flags |= LED_CORE_SUSPENDRESUME | LED_DEV_CAP_FLASH; 339 + 340 + mutex_init(&rt->lock); 341 + 342 + platform_set_drvdata(pdev, rt); 343 + 344 + ret = devm_led_classdev_flash_register_ext(dev, fled, &init_data); 345 + if (ret) { 346 + dev_err(dev, "can't register LED %s\n", led->name); 347 + mutex_destroy(&rt->lock); 348 + return ret; 349 + } 350 + 351 + rt8515_init_v4l2_flash_config(rt, &v4l2_sd_cfg); 352 + 353 + /* Create a V4L2 Flash device if V4L2 flash is enabled */ 354 + rt->v4l2_flash = v4l2_flash_init(dev, child, fled, NULL, &v4l2_sd_cfg); 355 + if (IS_ERR(rt->v4l2_flash)) { 356 + ret = PTR_ERR(rt->v4l2_flash); 357 + dev_err(dev, "failed to register V4L2 flash device (%d)\n", 358 + ret); 359 + /* 360 + * Continue without the V4L2 flash 361 + * (we still have the classdev) 362 + */ 363 + } 364 + 365 + return 0; 366 + } 367 + 368 + static int rt8515_remove(struct platform_device *pdev) 369 + { 370 + struct rt8515 *rt = platform_get_drvdata(pdev); 371 + 372 + rt8515_v4l2_flash_release(rt); 373 + del_timer_sync(&rt->powerdown_timer); 374 + mutex_destroy(&rt->lock); 375 + 376 + return 0; 377 + } 378 + 379 + static const struct of_device_id rt8515_match[] = { 380 + { .compatible = "richtek,rt8515", }, 381 + { /* sentinel */ } 382 + }; 383 + MODULE_DEVICE_TABLE(of, rt8515_match); 384 + 385 + static struct platform_driver rt8515_driver = { 386 + .driver = { 387 + .name = "rt8515", 388 + .of_match_table = rt8515_match, 389 + }, 390 + .probe = rt8515_probe, 391 + .remove = rt8515_remove, 392 + }; 393 + module_platform_driver(rt8515_driver); 394 + 395 + MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); 396 + MODULE_DESCRIPTION("Richtek RT8515 LED driver"); 397 + MODULE_LICENSE("GPL");
+6 -4
drivers/leds/led-triggers.c
··· 378 378 enum led_brightness brightness) 379 379 { 380 380 struct led_classdev *led_cdev; 381 + unsigned long flags; 381 382 382 383 if (!trig) 383 384 return; 384 385 385 - read_lock(&trig->leddev_list_lock); 386 + read_lock_irqsave(&trig->leddev_list_lock, flags); 386 387 list_for_each_entry(led_cdev, &trig->led_cdevs, trig_list) 387 388 led_set_brightness(led_cdev, brightness); 388 - read_unlock(&trig->leddev_list_lock); 389 + read_unlock_irqrestore(&trig->leddev_list_lock, flags); 389 390 } 390 391 EXPORT_SYMBOL_GPL(led_trigger_event); 391 392 ··· 397 396 int invert) 398 397 { 399 398 struct led_classdev *led_cdev; 399 + unsigned long flags; 400 400 401 401 if (!trig) 402 402 return; 403 403 404 - read_lock(&trig->leddev_list_lock); 404 + read_lock_irqsave(&trig->leddev_list_lock, flags); 405 405 list_for_each_entry(led_cdev, &trig->led_cdevs, trig_list) { 406 406 if (oneshot) 407 407 led_blink_set_oneshot(led_cdev, delay_on, delay_off, ··· 410 408 else 411 409 led_blink_set(led_cdev, delay_on, delay_off); 412 410 } 413 - read_unlock(&trig->leddev_list_lock); 411 + read_unlock_irqrestore(&trig->leddev_list_lock, flags); 414 412 } 415 413 416 414 void led_trigger_blink(struct led_trigger *trig,
+3 -3
drivers/leds/leds-ariel.c
··· 96 96 return -ENOMEM; 97 97 98 98 leds[0].ec_index = EC_BLUE_LED; 99 - leds[0].led_cdev.name = "blue:power", 99 + leds[0].led_cdev.name = "blue:power"; 100 100 leds[0].led_cdev.default_trigger = "default-on"; 101 101 102 102 leds[1].ec_index = EC_AMBER_LED; 103 - leds[1].led_cdev.name = "amber:status", 103 + leds[1].led_cdev.name = "amber:status"; 104 104 105 105 leds[2].ec_index = EC_GREEN_LED; 106 - leds[2].led_cdev.name = "green:status", 106 + leds[2].led_cdev.name = "green:status"; 107 107 leds[2].led_cdev.default_trigger = "default-on"; 108 108 109 109 for (i = 0; i < NLEDS; i++) {
+1 -1
drivers/leds/leds-lm3533.c
··· 679 679 led->cdev.brightness_get = lm3533_led_get; 680 680 led->cdev.blink_set = lm3533_led_blink_set; 681 681 led->cdev.brightness = LED_OFF; 682 - led->cdev.groups = lm3533_led_attribute_groups, 682 + led->cdev.groups = lm3533_led_attribute_groups; 683 683 led->id = pdev->id; 684 684 685 685 mutex_init(&led->mutex);
+6
drivers/md/bcache/features.h
··· 33 33 #define BCH_FEATURE_COMPAT_FUNCS(name, flagname) \ 34 34 static inline int bch_has_feature_##name(struct cache_sb *sb) \ 35 35 { \ 36 + if (sb->version < BCACHE_SB_VERSION_CDEV_WITH_FEATURES) \ 37 + return 0; \ 36 38 return (((sb)->feature_compat & \ 37 39 BCH##_FEATURE_COMPAT_##flagname) != 0); \ 38 40 } \ ··· 52 50 #define BCH_FEATURE_RO_COMPAT_FUNCS(name, flagname) \ 53 51 static inline int bch_has_feature_##name(struct cache_sb *sb) \ 54 52 { \ 53 + if (sb->version < BCACHE_SB_VERSION_CDEV_WITH_FEATURES) \ 54 + return 0; \ 55 55 return (((sb)->feature_ro_compat & \ 56 56 BCH##_FEATURE_RO_COMPAT_##flagname) != 0); \ 57 57 } \ ··· 71 67 #define BCH_FEATURE_INCOMPAT_FUNCS(name, flagname) \ 72 68 static inline int bch_has_feature_##name(struct cache_sb *sb) \ 73 69 { \ 70 + if (sb->version < BCACHE_SB_VERSION_CDEV_WITH_FEATURES) \ 71 + return 0; \ 74 72 return (((sb)->feature_incompat & \ 75 73 BCH##_FEATURE_INCOMPAT_##flagname) != 0); \ 76 74 } \
+12 -9
drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
··· 104 104 struct rkisp1_match_data { 105 105 const char * const *clks; 106 106 unsigned int size; 107 + enum rkisp1_cif_isp_version isp_ver; 107 108 }; 108 109 109 110 /* ---------------------------------------------------------------------------- ··· 412 411 "hclk", 413 412 }; 414 413 415 - static const struct rkisp1_match_data rk3399_isp_clk_data = { 414 + static const struct rkisp1_match_data rk3399_isp_match_data = { 416 415 .clks = rk3399_isp_clks, 417 416 .size = ARRAY_SIZE(rk3399_isp_clks), 417 + .isp_ver = RKISP1_V10, 418 418 }; 419 419 420 420 static const struct of_device_id rkisp1_of_match[] = { 421 421 { 422 422 .compatible = "rockchip,rk3399-cif-isp", 423 - .data = &rk3399_isp_clk_data, 423 + .data = &rk3399_isp_match_data, 424 424 }, 425 425 {}, 426 426 }; ··· 459 457 460 458 static int rkisp1_probe(struct platform_device *pdev) 461 459 { 462 - const struct rkisp1_match_data *clk_data; 460 + const struct rkisp1_match_data *match_data; 463 461 struct device *dev = &pdev->dev; 464 462 struct rkisp1_device *rkisp1; 465 463 struct v4l2_device *v4l2_dev; 466 464 unsigned int i; 467 465 int ret, irq; 468 466 469 - clk_data = of_device_get_match_data(&pdev->dev); 470 - if (!clk_data) 467 + match_data = of_device_get_match_data(&pdev->dev); 468 + if (!match_data) 471 469 return -ENODEV; 472 470 473 471 rkisp1 = devm_kzalloc(dev, sizeof(*rkisp1), GFP_KERNEL); ··· 496 494 497 495 rkisp1->irq = irq; 498 496 499 - for (i = 0; i < clk_data->size; i++) 500 - rkisp1->clks[i].id = clk_data->clks[i]; 501 - ret = devm_clk_bulk_get(dev, clk_data->size, rkisp1->clks); 497 + for (i = 0; i < match_data->size; i++) 498 + rkisp1->clks[i].id = match_data->clks[i]; 499 + ret = devm_clk_bulk_get(dev, match_data->size, rkisp1->clks); 502 500 if (ret) 503 501 return ret; 504 - rkisp1->clk_size = clk_data->size; 502 + rkisp1->clk_size = match_data->size; 505 503 506 504 pm_runtime_enable(&pdev->dev); 507 505 506 + rkisp1->media_dev.hw_revision = match_data->isp_ver; 508 507 strscpy(rkisp1->media_dev.model, RKISP1_DRIVER_NAME, 509 508 sizeof(rkisp1->media_dev.model)); 510 509 rkisp1->media_dev.dev = &pdev->dev;
+3 -2
drivers/media/platform/rockchip/rkisp1/rkisp1-params.c
··· 391 391 RKISP1_CIF_ISP_CTRL_ISP_GAMMA_OUT_ENA); 392 392 rkisp1_write(params->rkisp1, arg->mode, RKISP1_CIF_ISP_GAMMA_OUT_MODE); 393 393 394 - for (i = 0; i < RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES; i++) 394 + for (i = 0; i < RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10; i++) 395 395 rkisp1_write(params->rkisp1, arg->gamma_y[i], 396 396 RKISP1_CIF_ISP_GAMMA_OUT_Y_0 + i * 4); 397 397 } ··· 589 589 RKISP1_CIF_ISP_HIST_WEIGHT_22TO03, 590 590 RKISP1_CIF_ISP_HIST_WEIGHT_13TO43, 591 591 RKISP1_CIF_ISP_HIST_WEIGHT_04TO34, 592 - RKISP1_CIF_ISP_HIST_WEIGHT_44, 593 592 }; 594 593 const u8 *weight; 595 594 unsigned int i; ··· 621 622 weight[2], 622 623 weight[3]), 623 624 hist_weight_regs[i]); 625 + 626 + rkisp1_write(params->rkisp1, weight[0] & 0x1F, RKISP1_CIF_ISP_HIST_WEIGHT_44); 624 627 } 625 628 626 629 static void
+1
drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h
··· 365 365 #define RKISP1_CIF_ISP_MAX_HIST_PREDIVIDER 0x0000007F 366 366 #define RKISP1_CIF_ISP_HIST_ROW_NUM 5 367 367 #define RKISP1_CIF_ISP_HIST_COLUMN_NUM 5 368 + #define RKISP1_CIF_ISP_HIST_GET_BIN(x) ((x) & 0x000FFFFF) 368 369 369 370 /* AUTO FOCUS MEASUREMENT: ISP_AFM_CTRL */ 370 371 #define RKISP1_ISP_AFM_CTRL_ENABLE BIT(0)
+6 -5
drivers/media/platform/rockchip/rkisp1/rkisp1-stats.c
··· 203 203 unsigned int i; 204 204 205 205 pbuf->meas_type |= RKISP1_CIF_ISP_STAT_AUTOEXP; 206 - for (i = 0; i < RKISP1_CIF_ISP_AE_MEAN_MAX; i++) 206 + for (i = 0; i < RKISP1_CIF_ISP_AE_MEAN_MAX_V10; i++) 207 207 pbuf->params.ae.exp_mean[i] = 208 208 (u8)rkisp1_read(rkisp1, 209 209 RKISP1_CIF_ISP_EXP_MEAN_00 + i * 4); ··· 233 233 unsigned int i; 234 234 235 235 pbuf->meas_type |= RKISP1_CIF_ISP_STAT_HIST; 236 - for (i = 0; i < RKISP1_CIF_ISP_HIST_BIN_N_MAX; i++) 237 - pbuf->params.hist.hist_bins[i] = 238 - (u8)rkisp1_read(rkisp1, 239 - RKISP1_CIF_ISP_HIST_BIN_0 + i * 4); 236 + for (i = 0; i < RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10; i++) { 237 + u32 reg_val = rkisp1_read(rkisp1, RKISP1_CIF_ISP_HIST_BIN_0 + i * 4); 238 + 239 + pbuf->params.hist.hist_bins[i] = RKISP1_CIF_ISP_HIST_GET_BIN(reg_val); 240 + } 240 241 } 241 242 242 243 static void rkisp1_stats_get_bls_meas(struct rkisp1_stats *stats,
+2 -2
drivers/net/arcnet/arc-rimi.c
··· 332 332 dev->irq = 9; 333 333 334 334 if (arcrimi_probe(dev)) { 335 - free_netdev(dev); 335 + free_arcdev(dev); 336 336 return -EIO; 337 337 } 338 338 ··· 349 349 iounmap(lp->mem_start); 350 350 release_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1); 351 351 free_irq(dev->irq, dev); 352 - free_netdev(dev); 352 + free_arcdev(dev); 353 353 } 354 354 355 355 #ifndef MODULE
+6
drivers/net/arcnet/arcdevice.h
··· 298 298 299 299 int excnak_pending; /* We just got an excesive nak interrupt */ 300 300 301 + /* RESET flag handling */ 302 + int reset_in_progress; 303 + struct work_struct reset_work; 304 + 301 305 struct { 302 306 uint16_t sequence; /* sequence number (incs with each packet) */ 303 307 __be16 aborted_seq; ··· 354 350 355 351 void arcnet_unregister_proto(struct ArcProto *proto); 356 352 irqreturn_t arcnet_interrupt(int irq, void *dev_id); 353 + 357 354 struct net_device *alloc_arcdev(const char *name); 355 + void free_arcdev(struct net_device *dev); 358 356 359 357 int arcnet_open(struct net_device *dev); 360 358 int arcnet_close(struct net_device *dev);
+62 -4
drivers/net/arcnet/arcnet.c
··· 387 387 struct arcnet_local *lp = from_timer(lp, t, timer); 388 388 struct net_device *dev = lp->dev; 389 389 390 - if (!netif_carrier_ok(dev)) { 390 + spin_lock_irq(&lp->lock); 391 + 392 + if (!lp->reset_in_progress && !netif_carrier_ok(dev)) { 391 393 netif_carrier_on(dev); 392 394 netdev_info(dev, "link up\n"); 393 395 } 396 + 397 + spin_unlock_irq(&lp->lock); 398 + } 399 + 400 + static void reset_device_work(struct work_struct *work) 401 + { 402 + struct arcnet_local *lp; 403 + struct net_device *dev; 404 + 405 + lp = container_of(work, struct arcnet_local, reset_work); 406 + dev = lp->dev; 407 + 408 + /* Do not bring the network interface back up if an ifdown 409 + * was already done. 410 + */ 411 + if (!netif_running(dev) || !lp->reset_in_progress) 412 + return; 413 + 414 + rtnl_lock(); 415 + 416 + /* Do another check, in case of an ifdown that was triggered in 417 + * the small race window between the exit condition above and 418 + * acquiring RTNL. 419 + */ 420 + if (!netif_running(dev) || !lp->reset_in_progress) 421 + goto out; 422 + 423 + dev_close(dev); 424 + dev_open(dev, NULL); 425 + 426 + out: 427 + rtnl_unlock(); 394 428 } 395 429 396 430 static void arcnet_reply_tasklet(unsigned long data) ··· 486 452 lp->dev = dev; 487 453 spin_lock_init(&lp->lock); 488 454 timer_setup(&lp->timer, arcnet_timer, 0); 455 + INIT_WORK(&lp->reset_work, reset_device_work); 489 456 } 490 457 491 458 return dev; 492 459 } 493 460 EXPORT_SYMBOL(alloc_arcdev); 461 + 462 + void free_arcdev(struct net_device *dev) 463 + { 464 + struct arcnet_local *lp = netdev_priv(dev); 465 + 466 + /* Do not cancel this at ->ndo_close(), as the workqueue itself 467 + * indirectly calls the ifdown path through dev_close(). 468 + */ 469 + cancel_work_sync(&lp->reset_work); 470 + free_netdev(dev); 471 + } 472 + EXPORT_SYMBOL(free_arcdev); 494 473 495 474 /* Open/initialize the board. This is called sometime after booting when 496 475 * the 'ifconfig' program is run. ··· 634 587 635 588 /* shut down the card */ 636 589 lp->hw.close(dev); 590 + 591 + /* reset counters */ 592 + lp->reset_in_progress = 0; 593 + 637 594 module_put(lp->hw.owner); 638 595 return 0; 639 596 } ··· 871 820 872 821 spin_lock_irqsave(&lp->lock, flags); 873 822 823 + if (lp->reset_in_progress) 824 + goto out; 825 + 874 826 /* RESET flag was enabled - if device is not running, we must 875 827 * clear it right away (but nothing else). 876 828 */ ··· 906 852 if (status & RESETflag) { 907 853 arc_printk(D_NORMAL, dev, "spurious reset (status=%Xh)\n", 908 854 status); 909 - arcnet_close(dev); 910 - arcnet_open(dev); 855 + 856 + lp->reset_in_progress = 1; 857 + netif_stop_queue(dev); 858 + netif_carrier_off(dev); 859 + schedule_work(&lp->reset_work); 911 860 912 861 /* get out of the interrupt handler! */ 913 - break; 862 + goto out; 914 863 } 915 864 /* RX is inhibited - we must have received something. 916 865 * Prepare to receive into the next buffer. ··· 1109 1052 udelay(1); 1110 1053 lp->hw.intmask(dev, lp->intmask); 1111 1054 1055 + out: 1112 1056 spin_unlock_irqrestore(&lp->lock, flags); 1113 1057 return retval; 1114 1058 }
+2 -2
drivers/net/arcnet/com20020-isa.c
··· 169 169 dev->irq = 9; 170 170 171 171 if (com20020isa_probe(dev)) { 172 - free_netdev(dev); 172 + free_arcdev(dev); 173 173 return -EIO; 174 174 } 175 175 ··· 182 182 unregister_netdev(my_dev); 183 183 free_irq(my_dev->irq, my_dev); 184 184 release_region(my_dev->base_addr, ARCNET_TOTAL_SIZE); 185 - free_netdev(my_dev); 185 + free_arcdev(my_dev); 186 186 } 187 187 188 188 #ifndef MODULE
+1 -1
drivers/net/arcnet/com20020-pci.c
··· 291 291 292 292 unregister_netdev(dev); 293 293 free_irq(dev->irq, dev); 294 - free_netdev(dev); 294 + free_arcdev(dev); 295 295 } 296 296 } 297 297
+1 -1
drivers/net/arcnet/com20020_cs.c
··· 177 177 dev = info->dev; 178 178 if (dev) { 179 179 dev_dbg(&link->dev, "kfree...\n"); 180 - free_netdev(dev); 180 + free_arcdev(dev); 181 181 } 182 182 dev_dbg(&link->dev, "kfree2...\n"); 183 183 kfree(info);
+2 -2
drivers/net/arcnet/com90io.c
··· 396 396 err = com90io_probe(dev); 397 397 398 398 if (err) { 399 - free_netdev(dev); 399 + free_arcdev(dev); 400 400 return err; 401 401 } 402 402 ··· 419 419 420 420 free_irq(dev->irq, dev); 421 421 release_region(dev->base_addr, ARCNET_TOTAL_SIZE); 422 - free_netdev(dev); 422 + free_arcdev(dev); 423 423 } 424 424 425 425 module_init(com90io_init)
+2 -2
drivers/net/arcnet/com90xx.c
··· 554 554 err_release_mem: 555 555 release_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1); 556 556 err_free_dev: 557 - free_netdev(dev); 557 + free_arcdev(dev); 558 558 return -EIO; 559 559 } 560 560 ··· 672 672 release_region(dev->base_addr, ARCNET_TOTAL_SIZE); 673 673 release_mem_region(dev->mem_start, 674 674 dev->mem_end - dev->mem_start + 1); 675 - free_netdev(dev); 675 + free_arcdev(dev); 676 676 } 677 677 } 678 678
+5 -1
drivers/net/dsa/mv88e6xxx/chip.c
··· 1686 1686 if (!entry.portvec) 1687 1687 entry.state = 0; 1688 1688 } else { 1689 - entry.portvec |= BIT(port); 1689 + if (state == MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC) 1690 + entry.portvec = BIT(port); 1691 + else 1692 + entry.portvec |= BIT(port); 1693 + 1690 1694 entry.state = state; 1691 1695 } 1692 1696
-5
drivers/net/ethernet/ibm/ibmvnic.c
··· 5368 5368 unsigned long flags; 5369 5369 5370 5370 spin_lock_irqsave(&adapter->state_lock, flags); 5371 - if (test_bit(0, &adapter->resetting)) { 5372 - spin_unlock_irqrestore(&adapter->state_lock, flags); 5373 - return -EBUSY; 5374 - } 5375 - 5376 5371 adapter->state = VNIC_REMOVING; 5377 5372 spin_unlock_irqrestore(&adapter->state_lock, flags); 5378 5373
+1 -12
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
··· 55 55 56 56 pfe.event = VIRTCHNL_EVENT_LINK_CHANGE; 57 57 pfe.severity = PF_EVENT_SEVERITY_INFO; 58 - 59 - /* Always report link is down if the VF queues aren't enabled */ 60 - if (!vf->queues_enabled) { 61 - pfe.event_data.link_event.link_status = false; 62 - pfe.event_data.link_event.link_speed = 0; 63 - } else if (vf->link_forced) { 58 + if (vf->link_forced) { 64 59 pfe.event_data.link_event.link_status = vf->link_up; 65 60 pfe.event_data.link_event.link_speed = 66 61 (vf->link_up ? i40e_virtchnl_link_speed(ls->link_speed) : 0); ··· 65 70 pfe.event_data.link_event.link_speed = 66 71 i40e_virtchnl_link_speed(ls->link_speed); 67 72 } 68 - 69 73 i40e_aq_send_msg_to_vf(hw, abs_vf_id, VIRTCHNL_OP_EVENT, 70 74 0, (u8 *)&pfe, sizeof(pfe), NULL); 71 75 } ··· 2437 2443 } 2438 2444 } 2439 2445 2440 - vf->queues_enabled = true; 2441 - 2442 2446 error_param: 2443 2447 /* send the response to the VF */ 2444 2448 return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_ENABLE_QUEUES, ··· 2457 2465 (struct virtchnl_queue_select *)msg; 2458 2466 struct i40e_pf *pf = vf->pf; 2459 2467 i40e_status aq_ret = 0; 2460 - 2461 - /* Immediately mark queues as disabled */ 2462 - vf->queues_enabled = false; 2463 2468 2464 2469 if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) { 2465 2470 aq_ret = I40E_ERR_PARAM;
-1
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
··· 98 98 unsigned int tx_rate; /* Tx bandwidth limit in Mbps */ 99 99 bool link_forced; 100 100 bool link_up; /* only valid if VF link is forced */ 101 - bool queues_enabled; /* true if the VF queues are enabled */ 102 101 bool spoofchk; 103 102 u16 num_vlan; 104 103
+2 -1
drivers/net/ethernet/intel/igc/igc_ethtool.c
··· 1714 1714 Asym_Pause); 1715 1715 } 1716 1716 1717 - status = rd32(IGC_STATUS); 1717 + status = pm_runtime_suspended(&adapter->pdev->dev) ? 1718 + 0 : rd32(IGC_STATUS); 1718 1719 1719 1720 if (status & IGC_STATUS_LU) { 1720 1721 if (status & IGC_STATUS_SPEED_1000) {
+1 -2
drivers/net/ethernet/intel/igc/igc_i225.c
··· 219 219 u16 *data) 220 220 { 221 221 struct igc_nvm_info *nvm = &hw->nvm; 222 + s32 ret_val = -IGC_ERR_NVM; 222 223 u32 attempts = 100000; 223 224 u32 i, k, eewr = 0; 224 - s32 ret_val = 0; 225 225 226 226 /* A check for invalid values: offset too large, too many words, 227 227 * too many words for the offset, and not enough words. ··· 229 229 if (offset >= nvm->word_size || (words > (nvm->word_size - offset)) || 230 230 words == 0) { 231 231 hw_dbg("nvm parameter(s) out of bounds\n"); 232 - ret_val = -IGC_ERR_NVM; 233 232 goto out; 234 233 } 235 234
+1 -1
drivers/net/ethernet/intel/igc/igc_mac.c
··· 638 638 } 639 639 640 640 out: 641 - return 0; 641 + return ret_val; 642 642 } 643 643 644 644 /**
+5 -5
drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c
··· 29 29 /* Clear entry invalidation bit */ 30 30 pe->tcam[MVPP2_PRS_TCAM_INV_WORD] &= ~MVPP2_PRS_TCAM_INV_MASK; 31 31 32 - /* Write tcam index - indirect access */ 33 - mvpp2_write(priv, MVPP2_PRS_TCAM_IDX_REG, pe->index); 34 - for (i = 0; i < MVPP2_PRS_TCAM_WORDS; i++) 35 - mvpp2_write(priv, MVPP2_PRS_TCAM_DATA_REG(i), pe->tcam[i]); 36 - 37 32 /* Write sram index - indirect access */ 38 33 mvpp2_write(priv, MVPP2_PRS_SRAM_IDX_REG, pe->index); 39 34 for (i = 0; i < MVPP2_PRS_SRAM_WORDS; i++) 40 35 mvpp2_write(priv, MVPP2_PRS_SRAM_DATA_REG(i), pe->sram[i]); 36 + 37 + /* Write tcam index - indirect access */ 38 + mvpp2_write(priv, MVPP2_PRS_TCAM_IDX_REG, pe->index); 39 + for (i = 0; i < MVPP2_PRS_TCAM_WORDS; i++) 40 + mvpp2_write(priv, MVPP2_PRS_TCAM_DATA_REG(i), pe->tcam[i]); 41 41 42 42 return 0; 43 43 }
+2 -4
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
··· 3698 3698 3699 3699 err = mlx5e_safe_switch_channels(priv, &new_channels, 3700 3700 mlx5e_num_channels_changed_ctx, NULL); 3701 - if (err) 3702 - goto out; 3703 3701 3704 - priv->max_opened_tc = max_t(u8, priv->max_opened_tc, 3705 - new_channels.params.num_tc); 3706 3702 out: 3703 + priv->max_opened_tc = max_t(u8, priv->max_opened_tc, 3704 + priv->channels.params.num_tc); 3707 3705 mutex_unlock(&priv->state_lock); 3708 3706 return err; 3709 3707 }
+12 -4
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
··· 1259 1259 mlx5e_complete_rx_cqe(rq, cqe, cqe_bcnt, skb); 1260 1260 1261 1261 if (mlx5e_cqe_regb_chain(cqe)) 1262 - if (!mlx5e_tc_update_skb(cqe, skb)) 1262 + if (!mlx5e_tc_update_skb(cqe, skb)) { 1263 + dev_kfree_skb_any(skb); 1263 1264 goto free_wqe; 1265 + } 1264 1266 1265 1267 napi_gro_receive(rq->cq.napi, skb); 1266 1268 ··· 1315 1313 if (rep->vlan && skb_vlan_tag_present(skb)) 1316 1314 skb_vlan_pop(skb); 1317 1315 1318 - if (!mlx5e_rep_tc_update_skb(cqe, skb, &tc_priv)) 1316 + if (!mlx5e_rep_tc_update_skb(cqe, skb, &tc_priv)) { 1317 + dev_kfree_skb_any(skb); 1319 1318 goto free_wqe; 1319 + } 1320 1320 1321 1321 napi_gro_receive(rq->cq.napi, skb); 1322 1322 ··· 1372 1368 1373 1369 mlx5e_complete_rx_cqe(rq, cqe, cqe_bcnt, skb); 1374 1370 1375 - if (!mlx5e_rep_tc_update_skb(cqe, skb, &tc_priv)) 1371 + if (!mlx5e_rep_tc_update_skb(cqe, skb, &tc_priv)) { 1372 + dev_kfree_skb_any(skb); 1376 1373 goto mpwrq_cqe_out; 1374 + } 1377 1375 1378 1376 napi_gro_receive(rq->cq.napi, skb); 1379 1377 ··· 1531 1525 mlx5e_complete_rx_cqe(rq, cqe, cqe_bcnt, skb); 1532 1526 1533 1527 if (mlx5e_cqe_regb_chain(cqe)) 1534 - if (!mlx5e_tc_update_skb(cqe, skb)) 1528 + if (!mlx5e_tc_update_skb(cqe, skb)) { 1529 + dev_kfree_skb_any(skb); 1535 1530 goto mpwrq_cqe_out; 1531 + } 1536 1532 1537 1533 napi_gro_receive(rq->cq.napi, skb); 1538 1534
+5
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
··· 1760 1760 if (!fte_tmp) 1761 1761 continue; 1762 1762 rule = add_rule_fg(g, spec, flow_act, dest, dest_num, fte_tmp); 1763 + /* No error check needed here, because insert_fte() is not called */ 1763 1764 up_write_ref_node(&fte_tmp->node, false); 1764 1765 tree_put_node(&fte_tmp->node, false); 1765 1766 kmem_cache_free(steering->ftes_cache, fte); ··· 1813 1812 up_write_ref_node(&g->node, false); 1814 1813 rule = add_rule_fg(g, spec, flow_act, dest, dest_num, fte); 1815 1814 up_write_ref_node(&fte->node, false); 1815 + if (IS_ERR(rule)) 1816 + tree_put_node(&fte->node, false); 1816 1817 return rule; 1817 1818 } 1818 1819 rule = ERR_PTR(-ENOENT); ··· 1913 1910 up_write_ref_node(&g->node, false); 1914 1911 rule = add_rule_fg(g, spec, flow_act, dest, dest_num, fte); 1915 1912 up_write_ref_node(&fte->node, false); 1913 + if (IS_ERR(rule)) 1914 + tree_put_node(&fte->node, false); 1916 1915 tree_put_node(&g->node, false); 1917 1916 return rule; 1918 1917
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
··· 76 76 77 77 static u32 get_function(u16 func_id, bool ec_function) 78 78 { 79 - return func_id & (ec_function << 16); 79 + return (u32)func_id | (ec_function << 16); 80 80 } 81 81 82 82 static struct rb_root *page_root_per_function(struct mlx5_core_dev *dev, u32 function)
+67 -8
drivers/net/ethernet/realtek/r8169_main.c
··· 4007 4007 return -EIO; 4008 4008 } 4009 4009 4010 - static bool rtl_test_hw_pad_bug(struct rtl8169_private *tp) 4010 + static bool rtl_skb_is_udp(struct sk_buff *skb) 4011 4011 { 4012 + int no = skb_network_offset(skb); 4013 + struct ipv6hdr *i6h, _i6h; 4014 + struct iphdr *ih, _ih; 4015 + 4016 + switch (vlan_get_protocol(skb)) { 4017 + case htons(ETH_P_IP): 4018 + ih = skb_header_pointer(skb, no, sizeof(_ih), &_ih); 4019 + return ih && ih->protocol == IPPROTO_UDP; 4020 + case htons(ETH_P_IPV6): 4021 + i6h = skb_header_pointer(skb, no, sizeof(_i6h), &_i6h); 4022 + return i6h && i6h->nexthdr == IPPROTO_UDP; 4023 + default: 4024 + return false; 4025 + } 4026 + } 4027 + 4028 + #define RTL_MIN_PATCH_LEN 47 4029 + 4030 + /* see rtl8125_get_patch_pad_len() in r8125 vendor driver */ 4031 + static unsigned int rtl8125_quirk_udp_padto(struct rtl8169_private *tp, 4032 + struct sk_buff *skb) 4033 + { 4034 + unsigned int padto = 0, len = skb->len; 4035 + 4036 + if (rtl_is_8125(tp) && len < 128 + RTL_MIN_PATCH_LEN && 4037 + rtl_skb_is_udp(skb) && skb_transport_header_was_set(skb)) { 4038 + unsigned int trans_data_len = skb_tail_pointer(skb) - 4039 + skb_transport_header(skb); 4040 + 4041 + if (trans_data_len >= offsetof(struct udphdr, len) && 4042 + trans_data_len < RTL_MIN_PATCH_LEN) { 4043 + u16 dest = ntohs(udp_hdr(skb)->dest); 4044 + 4045 + /* dest is a standard PTP port */ 4046 + if (dest == 319 || dest == 320) 4047 + padto = len + RTL_MIN_PATCH_LEN - trans_data_len; 4048 + } 4049 + 4050 + if (trans_data_len < sizeof(struct udphdr)) 4051 + padto = max_t(unsigned int, padto, 4052 + len + sizeof(struct udphdr) - trans_data_len); 4053 + } 4054 + 4055 + return padto; 4056 + } 4057 + 4058 + static unsigned int rtl_quirk_packet_padto(struct rtl8169_private *tp, 4059 + struct sk_buff *skb) 4060 + { 4061 + unsigned int padto; 4062 + 4063 + padto = rtl8125_quirk_udp_padto(tp, skb); 4064 + 4012 4065 switch (tp->mac_version) { 4013 4066 case RTL_GIGA_MAC_VER_34: 4014 4067 case RTL_GIGA_MAC_VER_60: 4015 4068 case RTL_GIGA_MAC_VER_61: 4016 4069 case RTL_GIGA_MAC_VER_63: 4017 - return true; 4070 + padto = max_t(unsigned int, padto, ETH_ZLEN); 4018 4071 default: 4019 - return false; 4072 + break; 4020 4073 } 4074 + 4075 + return padto; 4021 4076 } 4022 4077 4023 4078 static void rtl8169_tso_csum_v1(struct sk_buff *skb, u32 *opts) ··· 4144 4089 4145 4090 opts[1] |= transport_offset << TCPHO_SHIFT; 4146 4091 } else { 4147 - if (unlikely(skb->len < ETH_ZLEN && rtl_test_hw_pad_bug(tp))) 4148 - /* eth_skb_pad would free the skb on error */ 4149 - return !__skb_put_padto(skb, ETH_ZLEN, false); 4092 + unsigned int padto = rtl_quirk_packet_padto(tp, skb); 4093 + 4094 + /* skb_padto would free the skb on error */ 4095 + return !__skb_put_padto(skb, padto, false); 4150 4096 } 4151 4097 4152 4098 return true; ··· 4322 4266 } else if (skb->ip_summed == CHECKSUM_PARTIAL) { 4323 4267 /* work around hw bug on some chip versions */ 4324 4268 if (skb->len < ETH_ZLEN) 4269 + features &= ~NETIF_F_CSUM_MASK; 4270 + 4271 + if (rtl_quirk_packet_padto(tp, skb)) 4325 4272 features &= ~NETIF_F_CSUM_MASK; 4326 4273 4327 4274 if (transport_offset > TCPHO_MAX && ··· 4664 4605 4665 4606 cancel_work_sync(&tp->wk.work); 4666 4607 4667 - phy_disconnect(tp->phydev); 4668 - 4669 4608 free_irq(pci_irq_vector(pdev, 0), tp); 4609 + 4610 + phy_disconnect(tp->phydev); 4670 4611 4671 4612 dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray, 4672 4613 tp->RxPhyAddr);
+2 -2
drivers/net/ipa/gsi.c
··· 484 484 static enum gsi_channel_state gsi_channel_state(struct gsi_channel *channel) 485 485 { 486 486 u32 channel_id = gsi_channel_id(channel); 487 - void *virt = channel->gsi->virt; 487 + void __iomem *virt = channel->gsi->virt; 488 488 u32 val; 489 489 490 490 val = ioread32(virt + GSI_CH_C_CNTXT_0_OFFSET(channel_id)); ··· 1400 1400 /* Hardware requires a 2^n ring size, with alignment equal to size */ 1401 1401 ring->virt = dma_alloc_coherent(dev, size, &addr, GFP_KERNEL); 1402 1402 if (ring->virt && addr % size) { 1403 - dma_free_coherent(dev, size, ring->virt, ring->addr); 1403 + dma_free_coherent(dev, size, ring->virt, addr); 1404 1404 dev_err(dev, "unable to alloc 0x%zx-aligned ring buffer\n", 1405 1405 size); 1406 1406 return -EINVAL; /* Not a good error value, but distinct */
+3 -3
drivers/net/ipa/ipa_endpoint.c
··· 593 593 594 594 /* Note that HDR_ENDIANNESS indicates big endian header fields */ 595 595 if (endpoint->data->qmap) 596 - val = cpu_to_be32(IPA_ENDPOINT_QMAP_METADATA_MASK); 596 + val = (__force u32)cpu_to_be32(IPA_ENDPOINT_QMAP_METADATA_MASK); 597 597 598 598 iowrite32(val, endpoint->ipa->reg_virt + offset); 599 599 } ··· 1169 1169 return true; 1170 1170 if (!status->pkt_len) 1171 1171 return true; 1172 - endpoint_id = u32_get_bits(status->endp_dst_idx, 1173 - IPA_STATUS_DST_IDX_FMASK); 1172 + endpoint_id = u8_get_bits(status->endp_dst_idx, 1173 + IPA_STATUS_DST_IDX_FMASK); 1174 1174 if (endpoint_id != endpoint->endpoint_id) 1175 1175 return true; 1176 1176
+2 -2
drivers/net/ipa/ipa_mem.c
··· 336 336 337 337 size = iommu_unmap(domain, ipa->imem_iova, ipa->imem_size); 338 338 if (size != ipa->imem_size) 339 - dev_warn(dev, "unmapped %zu IMEM bytes, expected %lu\n", 339 + dev_warn(dev, "unmapped %zu IMEM bytes, expected %zu\n", 340 340 size, ipa->imem_size); 341 341 } else { 342 342 dev_err(dev, "couldn't get IPA IOMMU domain for IMEM\n"); ··· 440 440 441 441 size = iommu_unmap(domain, ipa->smem_iova, ipa->smem_size); 442 442 if (size != ipa->smem_size) 443 - dev_warn(dev, "unmapped %zu SMEM bytes, expected %lu\n", 443 + dev_warn(dev, "unmapped %zu SMEM bytes, expected %zu\n", 444 444 size, ipa->smem_size); 445 445 446 446 } else {
+1 -1
drivers/nvme/host/core.c
··· 3829 3829 } 3830 3830 } 3831 3831 3832 - list_add_tail(&ns->siblings, &head->list); 3832 + list_add_tail_rcu(&ns->siblings, &head->list); 3833 3833 ns->head = head; 3834 3834 mutex_unlock(&ctrl->subsys->lock); 3835 3835 return 0;
+1 -1
drivers/nvme/host/multipath.c
··· 221 221 } 222 222 223 223 for (ns = nvme_next_ns(head, old); 224 - ns != old; 224 + ns && ns != old; 225 225 ns = nvme_next_ns(head, ns)) { 226 226 if (nvme_path_is_disabled(ns)) 227 227 continue;
+2
drivers/nvme/host/pci.c
··· 3257 3257 .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, 3258 3258 { PCI_DEVICE(0x15b7, 0x2001), /* Sandisk Skyhawk */ 3259 3259 .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, 3260 + { PCI_DEVICE(0x1d97, 0x2263), /* SPCC */ 3261 + .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, 3260 3262 { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001), 3261 3263 .driver_data = NVME_QUIRK_SINGLE_VECTOR }, 3262 3264 { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },
+7 -3
drivers/of/device.c
··· 162 162 mask = DMA_BIT_MASK(ilog2(end) + 1); 163 163 dev->coherent_dma_mask &= mask; 164 164 *dev->dma_mask &= mask; 165 - /* ...but only set bus limit if we found valid dma-ranges earlier */ 166 - if (!ret) 165 + /* ...but only set bus limit and range map if we found valid dma-ranges earlier */ 166 + if (!ret) { 167 167 dev->bus_dma_limit = end; 168 + dev->dma_range_map = map; 169 + } 168 170 169 171 coherent = of_dma_is_coherent(np); 170 172 dev_dbg(dev, "device is%sdma coherent\n", ··· 174 172 175 173 iommu = of_iommu_configure(dev, np, id); 176 174 if (PTR_ERR(iommu) == -EPROBE_DEFER) { 175 + /* Don't touch range map if it wasn't set from a valid dma-ranges */ 176 + if (!ret) 177 + dev->dma_range_map = NULL; 177 178 kfree(map); 178 179 return -EPROBE_DEFER; 179 180 } ··· 186 181 187 182 arch_setup_dma_ops(dev, dma_start, size, iommu, coherent); 188 183 189 - dev->dma_range_map = map; 190 184 return 0; 191 185 } 192 186 EXPORT_SYMBOL_GPL(of_dma_configure_id);
+8
drivers/rtc/rtc-cmos.c
··· 805 805 806 806 spin_lock_irq(&rtc_lock); 807 807 808 + /* Ensure that the RTC is accessible. Bit 0-6 must be 0! */ 809 + if ((CMOS_READ(RTC_VALID) & 0x7f) != 0) { 810 + spin_unlock_irq(&rtc_lock); 811 + dev_warn(dev, "not accessible\n"); 812 + retval = -ENXIO; 813 + goto cleanup1; 814 + } 815 + 808 816 if (!(flags & CMOS_RTC_FLAGS_NOFREQ)) { 809 817 /* force periodic irq to CMOS reset default of 1024Hz; 810 818 *
+7
drivers/rtc/rtc-mc146818-lib.c
··· 21 21 22 22 again: 23 23 spin_lock_irqsave(&rtc_lock, flags); 24 + /* Ensure that the RTC is accessible. Bit 0-6 must be 0! */ 25 + if (WARN_ON_ONCE((CMOS_READ(RTC_VALID) & 0x7f) != 0)) { 26 + spin_unlock_irqrestore(&rtc_lock, flags); 27 + memset(time, 0xff, sizeof(*time)); 28 + return 0; 29 + } 30 + 24 31 /* 25 32 * Check whether there is an update in progress during which the 26 33 * readout is unspecified. The maximum update time is ~2ms. Poll
+14 -6
drivers/s390/block/dasd_devmap.c
··· 1874 1874 } 1875 1875 EXPORT_SYMBOL(dasd_path_create_kobjects); 1876 1876 1877 - /* 1878 - * As we keep kobjects for the lifetime of a device, this function must not be 1879 - * called anywhere but in the context of offlining a device. 1880 - */ 1881 - void dasd_path_remove_kobj(struct dasd_device *device, int chp) 1877 + static void dasd_path_remove_kobj(struct dasd_device *device, int chp) 1882 1878 { 1883 1879 if (device->path[chp].in_sysfs) { 1884 1880 kobject_put(&device->path[chp].kobj); 1885 1881 device->path[chp].in_sysfs = false; 1886 1882 } 1887 1883 } 1888 - EXPORT_SYMBOL(dasd_path_remove_kobj); 1884 + 1885 + /* 1886 + * As we keep kobjects for the lifetime of a device, this function must not be 1887 + * called anywhere but in the context of offlining a device. 1888 + */ 1889 + void dasd_path_remove_kobjects(struct dasd_device *device) 1890 + { 1891 + int i; 1892 + 1893 + for (i = 0; i < 8; i++) 1894 + dasd_path_remove_kobj(device, i); 1895 + } 1896 + EXPORT_SYMBOL(dasd_path_remove_kobjects); 1889 1897 1890 1898 int dasd_add_sysfs_files(struct ccw_device *cdev) 1891 1899 {
+2 -1
drivers/s390/block/dasd_eckd.c
··· 1036 1036 device->path[i].ssid = 0; 1037 1037 device->path[i].chpid = 0; 1038 1038 dasd_path_notoper(device, i); 1039 - dasd_path_remove_kobj(device, i); 1040 1039 } 1041 1040 } 1042 1041 ··· 2172 2173 device->block = NULL; 2173 2174 out_err1: 2174 2175 dasd_eckd_clear_conf_data(device); 2176 + dasd_path_remove_kobjects(device); 2175 2177 kfree(device->private); 2176 2178 device->private = NULL; 2177 2179 return rc; ··· 2191 2191 private->vdsneq = NULL; 2192 2192 private->gneq = NULL; 2193 2193 dasd_eckd_clear_conf_data(device); 2194 + dasd_path_remove_kobjects(device); 2194 2195 } 2195 2196 2196 2197 static struct dasd_ccw_req *
+1 -1
drivers/s390/block/dasd_int.h
··· 858 858 void dasd_remove_sysfs_files(struct ccw_device *); 859 859 void dasd_path_create_kobj(struct dasd_device *, int); 860 860 void dasd_path_create_kobjects(struct dasd_device *); 861 - void dasd_path_remove_kobj(struct dasd_device *, int); 861 + void dasd_path_remove_kobjects(struct dasd_device *); 862 862 863 863 struct dasd_device *dasd_device_from_cdev(struct ccw_device *); 864 864 struct dasd_device *dasd_device_from_cdev_locked(struct ccw_device *);
+1 -5
drivers/s390/crypto/vfio_ap_drv.c
··· 71 71 static void vfio_ap_queue_dev_remove(struct ap_device *apdev) 72 72 { 73 73 struct vfio_ap_queue *q; 74 - int apid, apqi; 75 74 76 75 mutex_lock(&matrix_dev->lock); 77 76 q = dev_get_drvdata(&apdev->device); 77 + vfio_ap_mdev_reset_queue(q, 1); 78 78 dev_set_drvdata(&apdev->device, NULL); 79 - apid = AP_QID_CARD(q->apqn); 80 - apqi = AP_QID_QUEUE(q->apqn); 81 - vfio_ap_mdev_reset_queue(apid, apqi, 1); 82 - vfio_ap_irq_disable(q); 83 79 kfree(q); 84 80 mutex_unlock(&matrix_dev->lock); 85 81 }
+90 -59
drivers/s390/crypto/vfio_ap_ops.c
··· 25 25 #define VFIO_AP_MDEV_NAME_HWVIRT "VFIO AP Passthrough Device" 26 26 27 27 static int vfio_ap_mdev_reset_queues(struct mdev_device *mdev); 28 + static struct vfio_ap_queue *vfio_ap_find_queue(int apqn); 28 29 29 30 static int match_apqn(struct device *dev, const void *data) 30 31 { ··· 50 49 int apqn) 51 50 { 52 51 struct vfio_ap_queue *q; 53 - struct device *dev; 54 52 55 53 if (!test_bit_inv(AP_QID_CARD(apqn), matrix_mdev->matrix.apm)) 56 54 return NULL; 57 55 if (!test_bit_inv(AP_QID_QUEUE(apqn), matrix_mdev->matrix.aqm)) 58 56 return NULL; 59 57 60 - dev = driver_find_device(&matrix_dev->vfio_ap_drv->driver, NULL, 61 - &apqn, match_apqn); 62 - if (!dev) 63 - return NULL; 64 - q = dev_get_drvdata(dev); 65 - q->matrix_mdev = matrix_mdev; 66 - put_device(dev); 58 + q = vfio_ap_find_queue(apqn); 59 + if (q) 60 + q->matrix_mdev = matrix_mdev; 67 61 68 62 return q; 69 63 } ··· 115 119 */ 116 120 static void vfio_ap_free_aqic_resources(struct vfio_ap_queue *q) 117 121 { 118 - if (q->saved_isc != VFIO_AP_ISC_INVALID && q->matrix_mdev) 122 + if (!q) 123 + return; 124 + if (q->saved_isc != VFIO_AP_ISC_INVALID && 125 + !WARN_ON(!(q->matrix_mdev && q->matrix_mdev->kvm))) { 119 126 kvm_s390_gisc_unregister(q->matrix_mdev->kvm, q->saved_isc); 120 - if (q->saved_pfn && q->matrix_mdev) 127 + q->saved_isc = VFIO_AP_ISC_INVALID; 128 + } 129 + if (q->saved_pfn && !WARN_ON(!q->matrix_mdev)) { 121 130 vfio_unpin_pages(mdev_dev(q->matrix_mdev->mdev), 122 131 &q->saved_pfn, 1); 123 - q->saved_pfn = 0; 124 - q->saved_isc = VFIO_AP_ISC_INVALID; 132 + q->saved_pfn = 0; 133 + } 125 134 } 126 135 127 136 /** ··· 145 144 * Returns if ap_aqic function failed with invalid, deconfigured or 146 145 * checkstopped AP. 147 146 */ 148 - struct ap_queue_status vfio_ap_irq_disable(struct vfio_ap_queue *q) 147 + static struct ap_queue_status vfio_ap_irq_disable(struct vfio_ap_queue *q) 149 148 { 150 149 struct ap_qirq_ctrl aqic_gisa = {}; 151 150 struct ap_queue_status status; ··· 1038 1037 { 1039 1038 struct ap_matrix_mdev *m; 1040 1039 1041 - mutex_lock(&matrix_dev->lock); 1042 - 1043 1040 list_for_each_entry(m, &matrix_dev->mdev_list, node) { 1044 - if ((m != matrix_mdev) && (m->kvm == kvm)) { 1045 - mutex_unlock(&matrix_dev->lock); 1041 + if ((m != matrix_mdev) && (m->kvm == kvm)) 1046 1042 return -EPERM; 1047 - } 1048 1043 } 1049 1044 1050 1045 matrix_mdev->kvm = kvm; 1051 1046 kvm_get_kvm(kvm); 1052 1047 kvm->arch.crypto.pqap_hook = &matrix_mdev->pqap_hook; 1053 - mutex_unlock(&matrix_dev->lock); 1054 1048 1055 1049 return 0; 1056 1050 } ··· 1079 1083 return NOTIFY_DONE; 1080 1084 } 1081 1085 1086 + static void vfio_ap_mdev_unset_kvm(struct ap_matrix_mdev *matrix_mdev) 1087 + { 1088 + kvm_arch_crypto_clear_masks(matrix_mdev->kvm); 1089 + matrix_mdev->kvm->arch.crypto.pqap_hook = NULL; 1090 + vfio_ap_mdev_reset_queues(matrix_mdev->mdev); 1091 + kvm_put_kvm(matrix_mdev->kvm); 1092 + matrix_mdev->kvm = NULL; 1093 + } 1094 + 1082 1095 static int vfio_ap_mdev_group_notifier(struct notifier_block *nb, 1083 1096 unsigned long action, void *data) 1084 1097 { 1085 - int ret; 1098 + int ret, notify_rc = NOTIFY_OK; 1086 1099 struct ap_matrix_mdev *matrix_mdev; 1087 1100 1088 1101 if (action != VFIO_GROUP_NOTIFY_SET_KVM) 1089 1102 return NOTIFY_OK; 1090 1103 1091 1104 matrix_mdev = container_of(nb, struct ap_matrix_mdev, group_notifier); 1105 + mutex_lock(&matrix_dev->lock); 1092 1106 1093 1107 if (!data) { 1094 - matrix_mdev->kvm = NULL; 1095 - return NOTIFY_OK; 1108 + if (matrix_mdev->kvm) 1109 + vfio_ap_mdev_unset_kvm(matrix_mdev); 1110 + goto notify_done; 1096 1111 } 1097 1112 1098 1113 ret = vfio_ap_mdev_set_kvm(matrix_mdev, data); 1099 - if (ret) 1100 - return NOTIFY_DONE; 1114 + if (ret) { 1115 + notify_rc = NOTIFY_DONE; 1116 + goto notify_done; 1117 + } 1101 1118 1102 1119 /* If there is no CRYCB pointer, then we can't copy the masks */ 1103 - if (!matrix_mdev->kvm->arch.crypto.crycbd) 1104 - return NOTIFY_DONE; 1120 + if (!matrix_mdev->kvm->arch.crypto.crycbd) { 1121 + notify_rc = NOTIFY_DONE; 1122 + goto notify_done; 1123 + } 1105 1124 1106 1125 kvm_arch_crypto_set_masks(matrix_mdev->kvm, matrix_mdev->matrix.apm, 1107 1126 matrix_mdev->matrix.aqm, 1108 1127 matrix_mdev->matrix.adm); 1109 1128 1110 - return NOTIFY_OK; 1129 + notify_done: 1130 + mutex_unlock(&matrix_dev->lock); 1131 + return notify_rc; 1111 1132 } 1112 1133 1113 - static void vfio_ap_irq_disable_apqn(int apqn) 1134 + static struct vfio_ap_queue *vfio_ap_find_queue(int apqn) 1114 1135 { 1115 1136 struct device *dev; 1116 - struct vfio_ap_queue *q; 1137 + struct vfio_ap_queue *q = NULL; 1117 1138 1118 1139 dev = driver_find_device(&matrix_dev->vfio_ap_drv->driver, NULL, 1119 1140 &apqn, match_apqn); 1120 1141 if (dev) { 1121 1142 q = dev_get_drvdata(dev); 1122 - vfio_ap_irq_disable(q); 1123 1143 put_device(dev); 1124 1144 } 1145 + 1146 + return q; 1125 1147 } 1126 1148 1127 - int vfio_ap_mdev_reset_queue(unsigned int apid, unsigned int apqi, 1149 + int vfio_ap_mdev_reset_queue(struct vfio_ap_queue *q, 1128 1150 unsigned int retry) 1129 1151 { 1130 1152 struct ap_queue_status status; 1153 + int ret; 1131 1154 int retry2 = 2; 1132 - int apqn = AP_MKQID(apid, apqi); 1133 1155 1134 - do { 1135 - status = ap_zapq(apqn); 1136 - switch (status.response_code) { 1137 - case AP_RESPONSE_NORMAL: 1138 - while (!status.queue_empty && retry2--) { 1139 - msleep(20); 1140 - status = ap_tapq(apqn, NULL); 1141 - } 1142 - WARN_ON_ONCE(retry2 <= 0); 1143 - return 0; 1144 - case AP_RESPONSE_RESET_IN_PROGRESS: 1145 - case AP_RESPONSE_BUSY: 1156 + if (!q) 1157 + return 0; 1158 + 1159 + retry_zapq: 1160 + status = ap_zapq(q->apqn); 1161 + switch (status.response_code) { 1162 + case AP_RESPONSE_NORMAL: 1163 + ret = 0; 1164 + break; 1165 + case AP_RESPONSE_RESET_IN_PROGRESS: 1166 + if (retry--) { 1146 1167 msleep(20); 1147 - break; 1148 - default: 1149 - /* things are really broken, give up */ 1150 - return -EIO; 1168 + goto retry_zapq; 1151 1169 } 1152 - } while (retry--); 1170 + ret = -EBUSY; 1171 + break; 1172 + case AP_RESPONSE_Q_NOT_AVAIL: 1173 + case AP_RESPONSE_DECONFIGURED: 1174 + case AP_RESPONSE_CHECKSTOPPED: 1175 + WARN_ON_ONCE(status.irq_enabled); 1176 + ret = -EBUSY; 1177 + goto free_resources; 1178 + default: 1179 + /* things are really broken, give up */ 1180 + WARN(true, "PQAP/ZAPQ completed with invalid rc (%x)\n", 1181 + status.response_code); 1182 + return -EIO; 1183 + } 1153 1184 1154 - return -EBUSY; 1185 + /* wait for the reset to take effect */ 1186 + while (retry2--) { 1187 + if (status.queue_empty && !status.irq_enabled) 1188 + break; 1189 + msleep(20); 1190 + status = ap_tapq(q->apqn, NULL); 1191 + } 1192 + WARN_ON_ONCE(retry2 <= 0); 1193 + 1194 + free_resources: 1195 + vfio_ap_free_aqic_resources(q); 1196 + 1197 + return ret; 1155 1198 } 1156 1199 1157 1200 static int vfio_ap_mdev_reset_queues(struct mdev_device *mdev) ··· 1198 1163 int ret; 1199 1164 int rc = 0; 1200 1165 unsigned long apid, apqi; 1166 + struct vfio_ap_queue *q; 1201 1167 struct ap_matrix_mdev *matrix_mdev = mdev_get_drvdata(mdev); 1202 1168 1203 1169 for_each_set_bit_inv(apid, matrix_mdev->matrix.apm, 1204 1170 matrix_mdev->matrix.apm_max + 1) { 1205 1171 for_each_set_bit_inv(apqi, matrix_mdev->matrix.aqm, 1206 1172 matrix_mdev->matrix.aqm_max + 1) { 1207 - ret = vfio_ap_mdev_reset_queue(apid, apqi, 1); 1173 + q = vfio_ap_find_queue(AP_MKQID(apid, apqi)); 1174 + ret = vfio_ap_mdev_reset_queue(q, 1); 1208 1175 /* 1209 1176 * Regardless whether a queue turns out to be busy, or 1210 1177 * is not operational, we need to continue resetting ··· 1214 1177 */ 1215 1178 if (ret) 1216 1179 rc = ret; 1217 - vfio_ap_irq_disable_apqn(AP_MKQID(apid, apqi)); 1218 1180 } 1219 1181 } 1220 1182 ··· 1258 1222 struct ap_matrix_mdev *matrix_mdev = mdev_get_drvdata(mdev); 1259 1223 1260 1224 mutex_lock(&matrix_dev->lock); 1261 - if (matrix_mdev->kvm) { 1262 - kvm_arch_crypto_clear_masks(matrix_mdev->kvm); 1263 - matrix_mdev->kvm->arch.crypto.pqap_hook = NULL; 1264 - vfio_ap_mdev_reset_queues(mdev); 1265 - kvm_put_kvm(matrix_mdev->kvm); 1266 - matrix_mdev->kvm = NULL; 1267 - } 1225 + if (matrix_mdev->kvm) 1226 + vfio_ap_mdev_unset_kvm(matrix_mdev); 1268 1227 mutex_unlock(&matrix_dev->lock); 1269 1228 1270 1229 vfio_unregister_notifier(mdev_dev(mdev), VFIO_IOMMU_NOTIFY,
+6 -6
drivers/s390/crypto/vfio_ap_private.h
··· 88 88 struct mdev_device *mdev; 89 89 }; 90 90 91 - extern int vfio_ap_mdev_register(void); 92 - extern void vfio_ap_mdev_unregister(void); 93 - int vfio_ap_mdev_reset_queue(unsigned int apid, unsigned int apqi, 94 - unsigned int retry); 95 - 96 91 struct vfio_ap_queue { 97 92 struct ap_matrix_mdev *matrix_mdev; 98 93 unsigned long saved_pfn; ··· 95 100 #define VFIO_AP_ISC_INVALID 0xff 96 101 unsigned char saved_isc; 97 102 }; 98 - struct ap_queue_status vfio_ap_irq_disable(struct vfio_ap_queue *q); 103 + 104 + int vfio_ap_mdev_register(void); 105 + void vfio_ap_mdev_unregister(void); 106 + int vfio_ap_mdev_reset_queue(struct vfio_ap_queue *q, 107 + unsigned int retry); 108 + 99 109 #endif /* _VFIO_AP_PRIVATE_H_ */
+1 -1
drivers/scsi/qla2xxx/qla_os.c
··· 42 42 int ql2xenforce_iocb_limit = 1; 43 43 module_param(ql2xenforce_iocb_limit, int, S_IRUGO | S_IWUSR); 44 44 MODULE_PARM_DESC(ql2xenforce_iocb_limit, 45 - "Enforce IOCB throttling, to avoid FW congestion. (default: 0)"); 45 + "Enforce IOCB throttling, to avoid FW congestion. (default: 1)"); 46 46 47 47 /* 48 48 * CT6 CTX allocation cache
+1
drivers/soc/litex/Kconfig
··· 8 8 config LITEX_SOC_CONTROLLER 9 9 tristate "Enable LiteX SoC Controller driver" 10 10 depends on OF || COMPILE_TEST 11 + depends on HAS_IOMEM 11 12 select LITEX 12 13 help 13 14 This option enables the SoC Controller Driver which verifies
+2 -2
drivers/staging/rtl8723bs/os_dep/sdio_intf.c
··· 339 339 340 340 padapter = rtw_netdev_priv(pnetdev); 341 341 342 - rtw_wdev_alloc(padapter, dvobj_to_dev(dvobj)); 343 - 344 342 /* 3 3. init driver special setting, interface, OS and hardware relative */ 345 343 346 344 /* 4 3.1 set hardware operation functions */ ··· 375 377 ("rtw_drv_init: Initialize driver software resource Failed!\n")); 376 378 goto free_hal_data; 377 379 } 380 + 381 + rtw_wdev_alloc(padapter, dvobj_to_dev(dvobj)); 378 382 379 383 /* 3 8. get WLan MAC address */ 380 384 /* set mac addr */
+1 -1
drivers/target/iscsi/iscsi_target_login.c
··· 896 896 else 897 897 len = sizeof(struct sockaddr_in); 898 898 /* 899 - * Set SO_REUSEADDR, and disable Nagel Algorithm with TCP_NODELAY. 899 + * Set SO_REUSEADDR, and disable Nagle Algorithm with TCP_NODELAY. 900 900 */ 901 901 if (np->np_network_transport == ISCSI_TCP) 902 902 tcp_sock_set_nodelay(sock->sk);
+17 -3
drivers/tty/tty_io.c
··· 1026 1026 * write method will not be invoked in parallel for each device. 1027 1027 */ 1028 1028 1029 - static ssize_t tty_write(struct kiocb *iocb, struct iov_iter *from) 1029 + static ssize_t file_tty_write(struct file *file, struct kiocb *iocb, struct iov_iter *from) 1030 1030 { 1031 - struct file *file = iocb->ki_filp; 1032 1031 struct tty_struct *tty = file_tty(file); 1033 1032 struct tty_ldisc *ld; 1034 1033 ssize_t ret; ··· 1050 1051 return ret; 1051 1052 } 1052 1053 1054 + static ssize_t tty_write(struct kiocb *iocb, struct iov_iter *from) 1055 + { 1056 + return file_tty_write(iocb->ki_filp, iocb, from); 1057 + } 1058 + 1053 1059 ssize_t redirected_tty_write(struct kiocb *iocb, struct iov_iter *iter) 1054 1060 { 1055 1061 struct file *p = NULL; ··· 1064 1060 p = get_file(redirect); 1065 1061 spin_unlock(&redirect_lock); 1066 1062 1063 + /* 1064 + * We know the redirected tty is just another tty, we can can 1065 + * call file_tty_write() directly with that file pointer. 1066 + */ 1067 1067 if (p) { 1068 1068 ssize_t res; 1069 - res = vfs_iocb_iter_write(p, iocb, iter); 1069 + res = file_tty_write(p, iocb, iter); 1070 1070 fput(p); 1071 1071 return res; 1072 1072 } ··· 2316 2308 fput(f); 2317 2309 return 0; 2318 2310 } 2311 + if (file->f_op->write_iter != tty_write) 2312 + return -ENOTTY; 2313 + if (!(file->f_mode & FMODE_WRITE)) 2314 + return -EBADF; 2315 + if (!(file->f_mode & FMODE_CAN_WRITE)) 2316 + return -EINVAL; 2319 2317 spin_lock(&redirect_lock); 2320 2318 if (redirect) { 2321 2319 spin_unlock(&redirect_lock);
+1
drivers/vdpa/mlx5/core/mlx5_vdpa.h
··· 15 15 struct sg_table sg_head; 16 16 int log_size; 17 17 int nsg; 18 + int nent; 18 19 struct list_head list; 19 20 u64 offset; 20 21 };
+12 -16
drivers/vdpa/mlx5/core/mr.c
··· 25 25 return (npages + 1) / 2; 26 26 } 27 27 28 - static void fill_sg(struct mlx5_vdpa_direct_mr *mr, void *in) 29 - { 30 - struct scatterlist *sg; 31 - __be64 *pas; 32 - int i; 33 - 34 - pas = MLX5_ADDR_OF(create_mkey_in, in, klm_pas_mtt); 35 - for_each_sg(mr->sg_head.sgl, sg, mr->nsg, i) 36 - (*pas) = cpu_to_be64(sg_dma_address(sg)); 37 - } 38 - 39 28 static void mlx5_set_access_mode(void *mkc, int mode) 40 29 { 41 30 MLX5_SET(mkc, mkc, access_mode_1_0, mode & 0x3); ··· 34 45 static void populate_mtts(struct mlx5_vdpa_direct_mr *mr, __be64 *mtt) 35 46 { 36 47 struct scatterlist *sg; 48 + int nsg = mr->nsg; 49 + u64 dma_addr; 50 + u64 dma_len; 51 + int j = 0; 37 52 int i; 38 53 39 - for_each_sg(mr->sg_head.sgl, sg, mr->nsg, i) 40 - mtt[i] = cpu_to_be64(sg_dma_address(sg)); 54 + for_each_sg(mr->sg_head.sgl, sg, mr->nent, i) { 55 + for (dma_addr = sg_dma_address(sg), dma_len = sg_dma_len(sg); 56 + nsg && dma_len; 57 + nsg--, dma_addr += BIT(mr->log_size), dma_len -= BIT(mr->log_size)) 58 + mtt[j++] = cpu_to_be64(dma_addr); 59 + } 41 60 } 42 61 43 62 static int create_direct_mr(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_direct_mr *mr) ··· 61 64 return -ENOMEM; 62 65 63 66 MLX5_SET(create_mkey_in, in, uid, mvdev->res.uid); 64 - fill_sg(mr, in); 65 67 mkc = MLX5_ADDR_OF(create_mkey_in, in, memory_key_mkey_entry); 66 68 MLX5_SET(mkc, mkc, lw, !!(mr->perm & VHOST_MAP_WO)); 67 69 MLX5_SET(mkc, mkc, lr, !!(mr->perm & VHOST_MAP_RO)); ··· 272 276 done: 273 277 mr->log_size = log_entity_size; 274 278 mr->nsg = nsg; 275 - err = dma_map_sg_attrs(dma, mr->sg_head.sgl, mr->nsg, DMA_BIDIRECTIONAL, 0); 276 - if (!err) 279 + mr->nent = dma_map_sg_attrs(dma, mr->sg_head.sgl, mr->nsg, DMA_BIDIRECTIONAL, 0); 280 + if (!mr->nent) 277 281 goto err_map; 278 282 279 283 err = create_direct_mr(mvdev, mr);
+3 -3
fs/afs/main.c
··· 193 193 goto error_cache; 194 194 #endif 195 195 196 - ret = register_pernet_subsys(&afs_net_ops); 196 + ret = register_pernet_device(&afs_net_ops); 197 197 if (ret < 0) 198 198 goto error_net; 199 199 ··· 213 213 error_proc: 214 214 afs_fs_exit(); 215 215 error_fs: 216 - unregister_pernet_subsys(&afs_net_ops); 216 + unregister_pernet_device(&afs_net_ops); 217 217 error_net: 218 218 #ifdef CONFIG_AFS_FSCACHE 219 219 fscache_unregister_netfs(&afs_cache_netfs); ··· 244 244 245 245 proc_remove(afs_proc_symlink); 246 246 afs_fs_exit(); 247 - unregister_pernet_subsys(&afs_net_ops); 247 + unregister_pernet_device(&afs_net_ops); 248 248 #ifdef CONFIG_AFS_FSCACHE 249 249 fscache_unregister_netfs(&afs_cache_netfs); 250 250 #endif
+9 -1
fs/block_dev.c
··· 130 130 131 131 static void set_init_blocksize(struct block_device *bdev) 132 132 { 133 - bdev->bd_inode->i_blkbits = blksize_bits(bdev_logical_block_size(bdev)); 133 + unsigned int bsize = bdev_logical_block_size(bdev); 134 + loff_t size = i_size_read(bdev->bd_inode); 135 + 136 + while (bsize < PAGE_SIZE) { 137 + if (size & bsize) 138 + break; 139 + bsize <<= 1; 140 + } 141 + bdev->bd_inode->i_blkbits = blksize_bits(bsize); 134 142 } 135 143 136 144 int set_blocksize(struct block_device *bdev, int size)
+9 -1
fs/btrfs/block-group.c
··· 673 673 wake_up(&caching_ctl->wait); 674 674 } 675 675 676 - if (btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) 676 + /* 677 + * If we are in the transaction that populated the free space tree we 678 + * can't actually cache from the free space tree as our commit root and 679 + * real root are the same, so we could change the contents of the blocks 680 + * while caching. Instead do the slow caching in this case, and after 681 + * the transaction has committed we will be safe. 682 + */ 683 + if (btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE) && 684 + !(test_bit(BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED, &fs_info->flags))) 677 685 ret = load_free_space_tree(caching_ctl); 678 686 else 679 687 ret = load_extent_tree_free(caching_ctl);
+3
fs/btrfs/ctree.h
··· 563 563 564 564 /* Indicate that we need to cleanup space cache v1 */ 565 565 BTRFS_FS_CLEANUP_SPACE_CACHE_V1, 566 + 567 + /* Indicate that we can't trust the free space tree for caching yet */ 568 + BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED, 566 569 }; 567 570 568 571 /*
+18 -43
fs/btrfs/extent-tree.c
··· 2602 2602 struct btrfs_block_group *cache; 2603 2603 int ret; 2604 2604 2605 - btrfs_add_excluded_extent(trans->fs_info, bytenr, num_bytes); 2606 - 2607 2605 cache = btrfs_lookup_block_group(trans->fs_info, bytenr); 2608 2606 if (!cache) 2609 2607 return -EINVAL; ··· 2613 2615 * the pinned extents. 2614 2616 */ 2615 2617 btrfs_cache_block_group(cache, 1); 2618 + /* 2619 + * Make sure we wait until the cache is completely built in case it is 2620 + * missing or is invalid and therefore needs to be rebuilt. 2621 + */ 2622 + ret = btrfs_wait_block_group_cache_done(cache); 2623 + if (ret) 2624 + goto out; 2616 2625 2617 2626 pin_down_extent(trans, cache, bytenr, num_bytes, 0); 2618 2627 2619 2628 /* remove us from the free space cache (if we're there at all) */ 2620 2629 ret = btrfs_remove_free_space(cache, bytenr, num_bytes); 2630 + out: 2621 2631 btrfs_put_block_group(cache); 2622 2632 return ret; 2623 2633 } ··· 2635 2629 { 2636 2630 int ret; 2637 2631 struct btrfs_block_group *block_group; 2638 - struct btrfs_caching_control *caching_ctl; 2639 2632 2640 2633 block_group = btrfs_lookup_block_group(fs_info, start); 2641 2634 if (!block_group) 2642 2635 return -EINVAL; 2643 2636 2644 - btrfs_cache_block_group(block_group, 0); 2645 - caching_ctl = btrfs_get_caching_control(block_group); 2637 + btrfs_cache_block_group(block_group, 1); 2638 + /* 2639 + * Make sure we wait until the cache is completely built in case it is 2640 + * missing or is invalid and therefore needs to be rebuilt. 2641 + */ 2642 + ret = btrfs_wait_block_group_cache_done(block_group); 2643 + if (ret) 2644 + goto out; 2646 2645 2647 - if (!caching_ctl) { 2648 - /* Logic error */ 2649 - BUG_ON(!btrfs_block_group_done(block_group)); 2650 - ret = btrfs_remove_free_space(block_group, start, num_bytes); 2651 - } else { 2652 - /* 2653 - * We must wait for v1 caching to finish, otherwise we may not 2654 - * remove our space. 2655 - */ 2656 - btrfs_wait_space_cache_v1_finished(block_group, caching_ctl); 2657 - mutex_lock(&caching_ctl->mutex); 2658 - 2659 - if (start >= caching_ctl->progress) { 2660 - ret = btrfs_add_excluded_extent(fs_info, start, 2661 - num_bytes); 2662 - } else if (start + num_bytes <= caching_ctl->progress) { 2663 - ret = btrfs_remove_free_space(block_group, 2664 - start, num_bytes); 2665 - } else { 2666 - num_bytes = caching_ctl->progress - start; 2667 - ret = btrfs_remove_free_space(block_group, 2668 - start, num_bytes); 2669 - if (ret) 2670 - goto out_lock; 2671 - 2672 - num_bytes = (start + num_bytes) - 2673 - caching_ctl->progress; 2674 - start = caching_ctl->progress; 2675 - ret = btrfs_add_excluded_extent(fs_info, start, 2676 - num_bytes); 2677 - } 2678 - out_lock: 2679 - mutex_unlock(&caching_ctl->mutex); 2680 - btrfs_put_caching_control(caching_ctl); 2681 - } 2646 + ret = btrfs_remove_free_space(block_group, start, num_bytes); 2647 + out: 2682 2648 btrfs_put_block_group(block_group); 2683 2649 return ret; 2684 2650 } ··· 2841 2863 mutex_unlock(&fs_info->unused_bg_unpin_mutex); 2842 2864 break; 2843 2865 } 2844 - if (test_bit(BTRFS_FS_LOG_RECOVERING, &fs_info->flags)) 2845 - clear_extent_bits(&fs_info->excluded_extents, start, 2846 - end, EXTENT_UPTODATE); 2847 2866 2848 2867 if (btrfs_test_opt(fs_info, DISCARD_SYNC)) 2849 2868 ret = btrfs_discard_extent(fs_info, start,
+9 -1
fs/btrfs/free-space-tree.c
··· 1150 1150 return PTR_ERR(trans); 1151 1151 1152 1152 set_bit(BTRFS_FS_CREATING_FREE_SPACE_TREE, &fs_info->flags); 1153 + set_bit(BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED, &fs_info->flags); 1153 1154 free_space_root = btrfs_create_tree(trans, 1154 1155 BTRFS_FREE_SPACE_TREE_OBJECTID); 1155 1156 if (IS_ERR(free_space_root)) { ··· 1172 1171 btrfs_set_fs_compat_ro(fs_info, FREE_SPACE_TREE); 1173 1172 btrfs_set_fs_compat_ro(fs_info, FREE_SPACE_TREE_VALID); 1174 1173 clear_bit(BTRFS_FS_CREATING_FREE_SPACE_TREE, &fs_info->flags); 1174 + ret = btrfs_commit_transaction(trans); 1175 1175 1176 - return btrfs_commit_transaction(trans); 1176 + /* 1177 + * Now that we've committed the transaction any reading of our commit 1178 + * root will be safe, so we can cache from the free space tree now. 1179 + */ 1180 + clear_bit(BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED, &fs_info->flags); 1181 + return ret; 1177 1182 1178 1183 abort: 1179 1184 clear_bit(BTRFS_FS_CREATING_FREE_SPACE_TREE, &fs_info->flags); 1185 + clear_bit(BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED, &fs_info->flags); 1180 1186 btrfs_abort_transaction(trans, ret); 1181 1187 btrfs_end_transaction(trans); 1182 1188 return ret;
+1 -1
fs/btrfs/volumes.c
··· 433 433 434 434 atomic_set(&dev->reada_in_flight, 0); 435 435 atomic_set(&dev->dev_stats_ccnt, 0); 436 - btrfs_device_data_ordered_init(dev, fs_info); 436 + btrfs_device_data_ordered_init(dev); 437 437 INIT_RADIX_TREE(&dev->reada_zones, GFP_NOFS & ~__GFP_DIRECT_RECLAIM); 438 438 INIT_RADIX_TREE(&dev->reada_extents, GFP_NOFS & ~__GFP_DIRECT_RECLAIM); 439 439 extent_io_tree_init(fs_info, &dev->alloc_state,
+6 -5
fs/btrfs/volumes.h
··· 39 39 #if BITS_PER_LONG==32 && defined(CONFIG_SMP) 40 40 #include <linux/seqlock.h> 41 41 #define __BTRFS_NEED_DEVICE_DATA_ORDERED 42 - #define btrfs_device_data_ordered_init(device, info) \ 43 - seqcount_mutex_init(&device->data_seqcount, &info->chunk_mutex) 42 + #define btrfs_device_data_ordered_init(device) \ 43 + seqcount_init(&device->data_seqcount) 44 44 #else 45 - #define btrfs_device_data_ordered_init(device, info) do { } while (0) 45 + #define btrfs_device_data_ordered_init(device) do { } while (0) 46 46 #endif 47 47 48 48 #define BTRFS_DEV_STATE_WRITEABLE (0) ··· 76 76 blk_status_t last_flush_error; 77 77 78 78 #ifdef __BTRFS_NEED_DEVICE_DATA_ORDERED 79 - /* A seqcount_t with associated chunk_mutex (for lockdep) */ 80 - seqcount_mutex_t data_seqcount; 79 + seqcount_t data_seqcount; 81 80 #endif 82 81 83 82 /* the internal btrfs device id */ ··· 167 168 static inline void \ 168 169 btrfs_device_set_##name(struct btrfs_device *dev, u64 size) \ 169 170 { \ 171 + preempt_disable(); \ 170 172 write_seqcount_begin(&dev->data_seqcount); \ 171 173 dev->name = size; \ 172 174 write_seqcount_end(&dev->data_seqcount); \ 175 + preempt_enable(); \ 173 176 } 174 177 #elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPTION) 175 178 #define BTRFS_DEVICE_GETSET_FUNCS(name) \
+8 -4
fs/cifs/cifs_dfs_ref.c
··· 133 133 * Caller is responsible for freeing returned value if it is not error. 134 134 */ 135 135 char *cifs_compose_mount_options(const char *sb_mountdata, 136 - const char *fullpath, 137 - const struct dfs_info3_param *ref) 136 + const char *fullpath, 137 + const struct dfs_info3_param *ref, 138 + char **devname) 138 139 { 139 140 int rc; 140 141 char *name; ··· 232 231 strcat(mountdata, "ip="); 233 232 strcat(mountdata, srvIP); 234 233 235 - kfree(name); 234 + if (devname) 235 + *devname = name; 236 + else 237 + kfree(name); 236 238 237 239 /*cifs_dbg(FYI, "%s: parent mountdata: %s\n", __func__, sb_mountdata);*/ 238 240 /*cifs_dbg(FYI, "%s: submount mountdata: %s\n", __func__, mountdata );*/ ··· 282 278 283 279 /* strip first '\' from fullpath */ 284 280 mountdata = cifs_compose_mount_options(cifs_sb->ctx->mount_options, 285 - fullpath + 1, NULL); 281 + fullpath + 1, NULL, NULL); 286 282 if (IS_ERR(mountdata)) { 287 283 kfree(devname); 288 284 return (struct vfsmount *)mountdata;
+1 -1
fs/cifs/cifsfs.c
··· 822 822 goto out; 823 823 } 824 824 825 - rc = cifs_setup_volume_info(cifs_sb->ctx); 825 + rc = cifs_setup_volume_info(cifs_sb->ctx, NULL, old_ctx->UNC); 826 826 if (rc) { 827 827 root = ERR_PTR(rc); 828 828 goto out;
+4 -2
fs/cifs/cifsproto.h
··· 78 78 int add_treename); 79 79 extern char *build_wildcard_path_from_dentry(struct dentry *direntry); 80 80 extern char *cifs_compose_mount_options(const char *sb_mountdata, 81 - const char *fullpath, const struct dfs_info3_param *ref); 81 + const char *fullpath, const struct dfs_info3_param *ref, 82 + char **devname); 82 83 /* extern void renew_parental_timestamps(struct dentry *direntry);*/ 83 84 extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer, 84 85 struct TCP_Server_Info *server); ··· 90 89 extern int cifs_handle_standard(struct TCP_Server_Info *server, 91 90 struct mid_q_entry *mid); 92 91 extern int smb3_parse_devname(const char *devname, struct smb3_fs_context *ctx); 92 + extern int smb3_parse_opt(const char *options, const char *key, char **val); 93 93 extern bool cifs_match_ipaddr(struct sockaddr *srcaddr, struct sockaddr *rhs); 94 94 extern int cifs_discard_remaining_data(struct TCP_Server_Info *server); 95 95 extern int cifs_call_async(struct TCP_Server_Info *server, ··· 551 549 unsigned char *p24); 552 550 553 551 extern int 554 - cifs_setup_volume_info(struct smb3_fs_context *ctx); 552 + cifs_setup_volume_info(struct smb3_fs_context *ctx, const char *mntopts, const char *devname); 555 553 556 554 extern struct TCP_Server_Info * 557 555 cifs_find_tcp_session(struct smb3_fs_context *ctx);
+26 -6
fs/cifs/connect.c
··· 2972 2972 rc = dfs_cache_find(xid, ses, cifs_sb->local_nls, cifs_remap(cifs_sb), 2973 2973 ref_path, &referral, NULL); 2974 2974 if (!rc) { 2975 + char *fake_devname = NULL; 2976 + 2975 2977 mdata = cifs_compose_mount_options(cifs_sb->ctx->mount_options, 2976 - full_path + 1, &referral); 2978 + full_path + 1, &referral, 2979 + &fake_devname); 2977 2980 free_dfs_info_param(&referral); 2978 2981 2979 2982 if (IS_ERR(mdata)) { 2980 2983 rc = PTR_ERR(mdata); 2981 2984 mdata = NULL; 2982 2985 } else { 2983 - smb3_cleanup_fs_context_contents(ctx); 2984 - rc = cifs_setup_volume_info(ctx); 2986 + rc = cifs_setup_volume_info(ctx, mdata, fake_devname); 2985 2987 } 2988 + kfree(fake_devname); 2986 2989 kfree(cifs_sb->ctx->mount_options); 2987 2990 cifs_sb->ctx->mount_options = mdata; 2988 2991 } ··· 3039 3036 struct dfs_info3_param ref = {0}; 3040 3037 char *mdata = NULL; 3041 3038 struct smb3_fs_context fake_ctx = {NULL}; 3039 + char *fake_devname = NULL; 3042 3040 3043 3041 cifs_dbg(FYI, "%s: dfs path: %s\n", __func__, path); 3044 3042 ··· 3048 3044 return rc; 3049 3045 3050 3046 mdata = cifs_compose_mount_options(cifs_sb->ctx->mount_options, 3051 - full_path + 1, &ref); 3047 + full_path + 1, &ref, 3048 + &fake_devname); 3052 3049 free_dfs_info_param(&ref); 3053 3050 3054 3051 if (IS_ERR(mdata)) { 3055 3052 rc = PTR_ERR(mdata); 3056 3053 mdata = NULL; 3057 3054 } else 3058 - rc = cifs_setup_volume_info(&fake_ctx); 3055 + rc = cifs_setup_volume_info(&fake_ctx, mdata, fake_devname); 3059 3056 3060 3057 kfree(mdata); 3058 + kfree(fake_devname); 3061 3059 3062 3060 if (!rc) { 3063 3061 /* ··· 3128 3122 * we should pass a clone of the original context? 3129 3123 */ 3130 3124 int 3131 - cifs_setup_volume_info(struct smb3_fs_context *ctx) 3125 + cifs_setup_volume_info(struct smb3_fs_context *ctx, const char *mntopts, const char *devname) 3132 3126 { 3133 3127 int rc = 0; 3128 + 3129 + smb3_parse_devname(devname, ctx); 3130 + 3131 + if (mntopts) { 3132 + char *ip; 3133 + 3134 + cifs_dbg(FYI, "%s: mntopts=%s\n", __func__, mntopts); 3135 + rc = smb3_parse_opt(mntopts, "ip", &ip); 3136 + if (!rc && !cifs_convert_address((struct sockaddr *)&ctx->dstaddr, ip, 3137 + strlen(ip))) { 3138 + cifs_dbg(VFS, "%s: failed to convert ip address\n", __func__); 3139 + return -EINVAL; 3140 + } 3141 + } 3134 3142 3135 3143 if (ctx->nullauth) { 3136 3144 cifs_dbg(FYI, "Anonymous login\n");
+5 -3
fs/cifs/dfs_cache.c
··· 1417 1417 int rc; 1418 1418 struct cache_entry *ce; 1419 1419 struct dfs_info3_param ref = {0}; 1420 - char *mdata = NULL; 1420 + char *mdata = NULL, *devname = NULL; 1421 1421 struct TCP_Server_Info *server; 1422 1422 struct cifs_ses *ses; 1423 1423 struct smb3_fs_context ctx = {NULL}; ··· 1444 1444 1445 1445 up_read(&htable_rw_lock); 1446 1446 1447 - mdata = cifs_compose_mount_options(vi->mntdata, rpath, &ref); 1447 + mdata = cifs_compose_mount_options(vi->mntdata, rpath, &ref, 1448 + &devname); 1448 1449 free_dfs_info_param(&ref); 1449 1450 1450 1451 if (IS_ERR(mdata)) { ··· 1454 1453 goto out; 1455 1454 } 1456 1455 1457 - rc = cifs_setup_volume_info(&ctx); 1456 + rc = cifs_setup_volume_info(&ctx, NULL, devname); 1458 1457 1459 1458 if (rc) { 1460 1459 ses = ERR_PTR(rc); ··· 1473 1472 smb3_cleanup_fs_context_contents(&ctx); 1474 1473 kfree(mdata); 1475 1474 kfree(rpath); 1475 + kfree(devname); 1476 1476 1477 1477 return ses; 1478 1478 }
+37 -4
fs/cifs/fs_context.c
··· 175 175 fsparam_flag_no("exec", Opt_ignore), 176 176 fsparam_flag_no("dev", Opt_ignore), 177 177 fsparam_flag_no("mand", Opt_ignore), 178 + fsparam_flag_no("auto", Opt_ignore), 178 179 fsparam_string("cred", Opt_ignore), 179 180 fsparam_string("credentials", Opt_ignore), 181 + fsparam_string("prefixpath", Opt_ignore), 180 182 {} 181 183 }; 182 184 ··· 401 399 return 0; 402 400 } 403 401 402 + int smb3_parse_opt(const char *options, const char *key, char **val) 403 + { 404 + int rc = -ENOENT; 405 + char *opts, *orig, *p; 406 + 407 + orig = opts = kstrdup(options, GFP_KERNEL); 408 + if (!opts) 409 + return -ENOMEM; 410 + 411 + while ((p = strsep(&opts, ","))) { 412 + char *nval; 413 + 414 + if (!*p) 415 + continue; 416 + if (strncasecmp(p, key, strlen(key))) 417 + continue; 418 + nval = strchr(p, '='); 419 + if (nval) { 420 + if (nval == p) 421 + continue; 422 + *nval++ = 0; 423 + *val = kstrndup(nval, strlen(nval), GFP_KERNEL); 424 + rc = !*val ? -ENOMEM : 0; 425 + goto out; 426 + } 427 + } 428 + out: 429 + kfree(orig); 430 + return rc; 431 + } 432 + 404 433 /* 405 434 * Parse a devname into substrings and populate the ctx->UNC and ctx->prepath 406 435 * fields with the result. Returns 0 on success and an error otherwise ··· 564 531 565 532 if (ctx->rdma && ctx->vals->protocol_id < SMB30_PROT_ID) { 566 533 cifs_dbg(VFS, "SMB Direct requires Version >=3.0\n"); 567 - return -1; 534 + return -EOPNOTSUPP; 568 535 } 569 536 570 537 #ifndef CONFIG_KEYS ··· 587 554 /* make sure UNC has a share name */ 588 555 if (strlen(ctx->UNC) < 3 || !strchr(ctx->UNC + 3, '\\')) { 589 556 cifs_dbg(VFS, "Malformed UNC. Unable to find share name.\n"); 590 - return -1; 557 + return -ENOENT; 591 558 } 592 559 593 560 if (!ctx->got_ip) { ··· 601 568 if (!cifs_convert_address((struct sockaddr *)&ctx->dstaddr, 602 569 &ctx->UNC[2], len)) { 603 570 pr_err("Unable to determine destination address\n"); 604 - return -1; 571 + return -EHOSTUNREACH; 605 572 } 606 573 } 607 574 ··· 1296 1263 return 0; 1297 1264 1298 1265 cifs_parse_mount_err: 1299 - return 1; 1266 + return -EINVAL; 1300 1267 } 1301 1268 1302 1269 int smb3_init_fs_context(struct fs_context *fc)
+7 -3
fs/ecryptfs/inode.c
··· 1016 1016 { 1017 1017 int rc; 1018 1018 struct dentry *lower_dentry; 1019 + struct inode *lower_inode; 1019 1020 1020 1021 lower_dentry = ecryptfs_dentry_to_lower(dentry); 1021 - if (!(d_inode(lower_dentry)->i_opflags & IOP_XATTR)) { 1022 + lower_inode = d_inode(lower_dentry); 1023 + if (!(lower_inode->i_opflags & IOP_XATTR)) { 1022 1024 rc = -EOPNOTSUPP; 1023 1025 goto out; 1024 1026 } 1025 - rc = vfs_setxattr(lower_dentry, name, value, size, flags); 1027 + inode_lock(lower_inode); 1028 + rc = __vfs_setxattr_locked(lower_dentry, name, value, size, flags, NULL); 1029 + inode_unlock(lower_inode); 1026 1030 if (!rc && inode) 1027 - fsstack_copy_attr_all(inode, d_inode(lower_dentry)); 1031 + fsstack_copy_attr_all(inode, lower_inode); 1028 1032 out: 1029 1033 return rc; 1030 1034 }
+53 -42
fs/io_uring.c
··· 1026 1026 const struct iovec *fast_iov, 1027 1027 struct iov_iter *iter, bool force); 1028 1028 static void io_req_drop_files(struct io_kiocb *req); 1029 + static void io_req_task_queue(struct io_kiocb *req); 1029 1030 1030 1031 static struct kmem_cache *req_cachep; 1031 1032 ··· 1070 1069 { 1071 1070 struct io_kiocb *req; 1072 1071 1073 - if (task && head->task != task) 1072 + if (task && head->task != task) { 1073 + /* in terms of cancelation, always match if req task is dead */ 1074 + if (head->task->flags & PF_EXITING) 1075 + return true; 1074 1076 return false; 1077 + } 1075 1078 if (!files) 1076 1079 return true; 1077 1080 ··· 1635 1630 do { 1636 1631 struct io_defer_entry *de = list_first_entry(&ctx->defer_list, 1637 1632 struct io_defer_entry, list); 1638 - struct io_kiocb *link; 1639 1633 1640 1634 if (req_need_defer(de->req, de->seq)) 1641 1635 break; 1642 1636 list_del_init(&de->list); 1643 - /* punt-init is done before queueing for defer */ 1644 - link = __io_queue_async_work(de->req); 1645 - if (link) { 1646 - __io_queue_linked_timeout(link); 1647 - /* drop submission reference */ 1648 - io_put_req_deferred(link, 1); 1649 - } 1637 + io_req_task_queue(de->req); 1650 1638 kfree(de); 1651 1639 } while (!list_empty(&ctx->defer_list)); 1652 1640 } ··· 1773 1775 struct io_kiocb *req, *tmp; 1774 1776 struct io_uring_cqe *cqe; 1775 1777 unsigned long flags; 1776 - bool all_flushed; 1778 + bool all_flushed, posted; 1777 1779 LIST_HEAD(list); 1778 1780 1779 1781 if (!force && __io_cqring_events(ctx) == rings->cq_ring_entries) 1780 1782 return false; 1781 1783 1784 + posted = false; 1782 1785 spin_lock_irqsave(&ctx->completion_lock, flags); 1783 1786 list_for_each_entry_safe(req, tmp, &ctx->cq_overflow_list, compl.list) { 1784 1787 if (!io_match_task(req, tsk, files)) ··· 1799 1800 WRITE_ONCE(ctx->rings->cq_overflow, 1800 1801 ctx->cached_cq_overflow); 1801 1802 } 1803 + posted = true; 1802 1804 } 1803 1805 1804 1806 all_flushed = list_empty(&ctx->cq_overflow_list); ··· 1809 1809 ctx->rings->sq_flags &= ~IORING_SQ_CQ_OVERFLOW; 1810 1810 } 1811 1811 1812 - io_commit_cqring(ctx); 1812 + if (posted) 1813 + io_commit_cqring(ctx); 1813 1814 spin_unlock_irqrestore(&ctx->completion_lock, flags); 1814 - io_cqring_ev_posted(ctx); 1815 + if (posted) 1816 + io_cqring_ev_posted(ctx); 1815 1817 1816 1818 while (!list_empty(&list)) { 1817 1819 req = list_first_entry(&list, struct io_kiocb, compl.list); ··· 6460 6458 file = __io_file_get(state, fd); 6461 6459 } 6462 6460 6463 - if (file && file->f_op == &io_uring_fops) { 6461 + if (file && file->f_op == &io_uring_fops && 6462 + !(req->flags & REQ_F_INFLIGHT)) { 6464 6463 io_req_init_async(req); 6465 6464 req->flags |= REQ_F_INFLIGHT; 6466 6465 ··· 7269 7266 TASK_INTERRUPTIBLE); 7270 7267 /* make sure we run task_work before checking for signals */ 7271 7268 ret = io_run_task_work_sig(); 7272 - if (ret > 0) 7269 + if (ret > 0) { 7270 + finish_wait(&ctx->wait, &iowq.wq); 7273 7271 continue; 7272 + } 7274 7273 else if (ret < 0) 7275 7274 break; 7276 7275 if (io_should_wake(&iowq)) 7277 7276 break; 7278 - if (test_bit(0, &ctx->cq_check_overflow)) 7277 + if (test_bit(0, &ctx->cq_check_overflow)) { 7278 + finish_wait(&ctx->wait, &iowq.wq); 7279 7279 continue; 7280 + } 7280 7281 if (uts) { 7281 7282 timeout = schedule_timeout(timeout); 7282 7283 if (timeout == 0) { ··· 8872 8865 } 8873 8866 } 8874 8867 8868 + static int io_uring_count_inflight(struct io_ring_ctx *ctx, 8869 + struct task_struct *task, 8870 + struct files_struct *files) 8871 + { 8872 + struct io_kiocb *req; 8873 + int cnt = 0; 8874 + 8875 + spin_lock_irq(&ctx->inflight_lock); 8876 + list_for_each_entry(req, &ctx->inflight_list, inflight_entry) 8877 + cnt += io_match_task(req, task, files); 8878 + spin_unlock_irq(&ctx->inflight_lock); 8879 + return cnt; 8880 + } 8881 + 8875 8882 static void io_uring_cancel_files(struct io_ring_ctx *ctx, 8876 8883 struct task_struct *task, 8877 8884 struct files_struct *files) 8878 8885 { 8879 8886 while (!list_empty_careful(&ctx->inflight_list)) { 8880 8887 struct io_task_cancel cancel = { .task = task, .files = files }; 8881 - struct io_kiocb *req; 8882 8888 DEFINE_WAIT(wait); 8883 - bool found = false; 8889 + int inflight; 8884 8890 8885 - spin_lock_irq(&ctx->inflight_lock); 8886 - list_for_each_entry(req, &ctx->inflight_list, inflight_entry) { 8887 - if (!io_match_task(req, task, files)) 8888 - continue; 8889 - found = true; 8890 - break; 8891 - } 8892 - if (found) 8893 - prepare_to_wait(&task->io_uring->wait, &wait, 8894 - TASK_UNINTERRUPTIBLE); 8895 - spin_unlock_irq(&ctx->inflight_lock); 8896 - 8897 - /* We need to keep going until we don't find a matching req */ 8898 - if (!found) 8891 + inflight = io_uring_count_inflight(ctx, task, files); 8892 + if (!inflight) 8899 8893 break; 8900 8894 8901 8895 io_wq_cancel_cb(ctx->io_wq, io_cancel_task_cb, &cancel, true); ··· 8905 8897 io_cqring_overflow_flush(ctx, true, task, files); 8906 8898 /* cancellations _may_ trigger task work */ 8907 8899 io_run_task_work(); 8908 - schedule(); 8900 + 8901 + prepare_to_wait(&task->io_uring->wait, &wait, 8902 + TASK_UNINTERRUPTIBLE); 8903 + if (inflight == io_uring_count_inflight(ctx, task, files)) 8904 + schedule(); 8909 8905 finish_wait(&task->io_uring->wait, &wait); 8910 8906 } 8911 8907 } ··· 8967 8955 struct task_struct *task = current; 8968 8956 8969 8957 if ((ctx->flags & IORING_SETUP_SQPOLL) && ctx->sq_data) { 8970 - /* for SQPOLL only sqo_task has task notes */ 8971 - WARN_ON_ONCE(ctx->sqo_task != current); 8972 8958 io_disable_sqo_submit(ctx); 8973 8959 task = ctx->sq_data->thread; 8974 8960 atomic_inc(&task->io_uring->in_idle); ··· 8976 8966 io_cancel_defer_files(ctx, task, files); 8977 8967 io_cqring_overflow_flush(ctx, true, task, files); 8978 8968 8969 + io_uring_cancel_files(ctx, task, files); 8979 8970 if (!files) 8980 8971 __io_uring_cancel_task_requests(ctx, task); 8981 - else 8982 - io_uring_cancel_files(ctx, task, files); 8983 8972 8984 8973 if ((ctx->flags & IORING_SETUP_SQPOLL) && ctx->sq_data) { 8985 8974 atomic_dec(&task->io_uring->in_idle); ··· 9125 9116 prepare_to_wait(&tctx->wait, &wait, TASK_UNINTERRUPTIBLE); 9126 9117 9127 9118 /* 9128 - * If we've seen completions, retry. This avoids a race where 9129 - * a completion comes in before we did prepare_to_wait(). 9119 + * If we've seen completions, retry without waiting. This 9120 + * avoids a race where a completion comes in before we did 9121 + * prepare_to_wait(). 9130 9122 */ 9131 - if (inflight != tctx_inflight(tctx)) 9132 - continue; 9133 - schedule(); 9123 + if (inflight == tctx_inflight(tctx)) 9124 + schedule(); 9134 9125 finish_wait(&tctx->wait, &wait); 9135 9126 } while (1); 9136 9127 9137 - finish_wait(&tctx->wait, &wait); 9138 9128 atomic_dec(&tctx->in_idle); 9139 9129 9140 9130 io_uring_remove_task_files(tctx); ··· 9143 9135 { 9144 9136 struct io_uring_task *tctx = current->io_uring; 9145 9137 struct io_ring_ctx *ctx = file->private_data; 9138 + 9139 + if (fatal_signal_pending(current) || (current->flags & PF_EXITING)) 9140 + io_uring_cancel_task_requests(ctx, NULL); 9146 9141 9147 9142 if (!tctx) 9148 9143 return 0;
+44 -25
fs/nfs/pnfs.c
··· 324 324 return NULL; 325 325 } 326 326 327 + /* 328 + * Compare 2 layout stateid sequence ids, to see which is newer, 329 + * taking into account wraparound issues. 330 + */ 331 + static bool pnfs_seqid_is_newer(u32 s1, u32 s2) 332 + { 333 + return (s32)(s1 - s2) > 0; 334 + } 335 + 336 + static void pnfs_barrier_update(struct pnfs_layout_hdr *lo, u32 newseq) 337 + { 338 + if (pnfs_seqid_is_newer(newseq, lo->plh_barrier)) 339 + lo->plh_barrier = newseq; 340 + } 341 + 327 342 static void 328 343 pnfs_set_plh_return_info(struct pnfs_layout_hdr *lo, enum pnfs_iomode iomode, 329 344 u32 seq) ··· 350 335 if (seq != 0) { 351 336 WARN_ON_ONCE(lo->plh_return_seq != 0 && lo->plh_return_seq != seq); 352 337 lo->plh_return_seq = seq; 338 + pnfs_barrier_update(lo, seq); 353 339 } 354 340 } 355 341 ··· 653 637 rv = 1; 654 638 } 655 639 return rv; 656 - } 657 - 658 - /* 659 - * Compare 2 layout stateid sequence ids, to see which is newer, 660 - * taking into account wraparound issues. 661 - */ 662 - static bool pnfs_seqid_is_newer(u32 s1, u32 s2) 663 - { 664 - return (s32)(s1 - s2) > 0; 665 640 } 666 641 667 642 static bool ··· 991 984 new_barrier = be32_to_cpu(new->seqid); 992 985 else if (new_barrier == 0) 993 986 return; 994 - if (pnfs_seqid_is_newer(new_barrier, lo->plh_barrier)) 995 - lo->plh_barrier = new_barrier; 987 + pnfs_barrier_update(lo, new_barrier); 996 988 } 997 989 998 990 static bool ··· 1000 994 { 1001 995 u32 seqid = be32_to_cpu(stateid->seqid); 1002 996 1003 - return !pnfs_seqid_is_newer(seqid, lo->plh_barrier); 997 + return !pnfs_seqid_is_newer(seqid, lo->plh_barrier) && lo->plh_barrier; 1004 998 } 1005 999 1006 1000 /* lget is set to 1 if called from inside send_layoutget call chain */ ··· 1189 1183 return false; 1190 1184 set_bit(NFS_LAYOUT_RETURN, &lo->plh_flags); 1191 1185 pnfs_get_layout_hdr(lo); 1186 + nfs4_stateid_copy(stateid, &lo->plh_stateid); 1187 + *cred = get_cred(lo->plh_lc_cred); 1192 1188 if (test_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags)) { 1193 - nfs4_stateid_copy(stateid, &lo->plh_stateid); 1194 - *cred = get_cred(lo->plh_lc_cred); 1195 1189 if (lo->plh_return_seq != 0) 1196 1190 stateid->seqid = cpu_to_be32(lo->plh_return_seq); 1197 1191 if (iomode != NULL) 1198 1192 *iomode = lo->plh_return_iomode; 1199 1193 pnfs_clear_layoutreturn_info(lo); 1200 - return true; 1201 - } 1202 - nfs4_stateid_copy(stateid, &lo->plh_stateid); 1203 - *cred = get_cred(lo->plh_lc_cred); 1204 - if (iomode != NULL) 1194 + } else if (iomode != NULL) 1205 1195 *iomode = IOMODE_ANY; 1196 + pnfs_barrier_update(lo, be32_to_cpu(stateid->seqid)); 1206 1197 return true; 1207 1198 } 1208 1199 ··· 1912 1909 wake_up_var(&lo->plh_outstanding); 1913 1910 } 1914 1911 1912 + static bool pnfs_is_first_layoutget(struct pnfs_layout_hdr *lo) 1913 + { 1914 + return test_bit(NFS_LAYOUT_FIRST_LAYOUTGET, &lo->plh_flags); 1915 + } 1916 + 1915 1917 static void pnfs_clear_first_layoutget(struct pnfs_layout_hdr *lo) 1916 1918 { 1917 1919 unsigned long *bitlock = &lo->plh_flags; ··· 2391 2383 goto out_forget; 2392 2384 } 2393 2385 2394 - if (!pnfs_layout_is_valid(lo)) { 2395 - /* We have a completely new layout */ 2396 - pnfs_set_layout_stateid(lo, &res->stateid, lgp->cred, true); 2397 - } else if (nfs4_stateid_match_other(&lo->plh_stateid, &res->stateid)) { 2386 + if (nfs4_stateid_match_other(&lo->plh_stateid, &res->stateid)) { 2398 2387 /* existing state ID, make sure the sequence number matches. */ 2399 2388 if (pnfs_layout_stateid_blocked(lo, &res->stateid)) { 2389 + if (!pnfs_layout_is_valid(lo) && 2390 + pnfs_is_first_layoutget(lo)) 2391 + lo->plh_barrier = 0; 2400 2392 dprintk("%s forget reply due to sequence\n", __func__); 2401 2393 goto out_forget; 2402 2394 } 2403 2395 pnfs_set_layout_stateid(lo, &res->stateid, lgp->cred, false); 2404 - } else { 2396 + } else if (pnfs_layout_is_valid(lo)) { 2405 2397 /* 2406 2398 * We got an entirely new state ID. Mark all segments for the 2407 2399 * inode invalid, and retry the layoutget 2408 2400 */ 2409 - pnfs_mark_layout_stateid_invalid(lo, &free_me); 2401 + struct pnfs_layout_range range = { 2402 + .iomode = IOMODE_ANY, 2403 + .length = NFS4_MAX_UINT64, 2404 + }; 2405 + pnfs_set_plh_return_info(lo, IOMODE_ANY, 0); 2406 + pnfs_mark_matching_lsegs_return(lo, &lo->plh_return_segs, 2407 + &range, 0); 2410 2408 goto out_forget; 2409 + } else { 2410 + /* We have a completely new layout */ 2411 + if (!pnfs_is_first_layoutget(lo)) 2412 + goto out_forget; 2413 + pnfs_set_layout_stateid(lo, &res->stateid, lgp->cred, true); 2411 2414 } 2412 2415 2413 2416 pnfs_get_lseg(lseg);
+5
include/linux/linkage.h
··· 178 178 * Objtool generates debug info for both FUNC & CODE, but needs special 179 179 * annotations for each CODE's start (to describe the actual stack frame). 180 180 * 181 + * Objtool requires that all code must be contained in an ELF symbol. Symbol 182 + * names that have a .L prefix do not emit symbol table entries. .L 183 + * prefixed symbols can be used within a code region, but should be avoided for 184 + * denoting a range of code via ``SYM_*_START/END`` annotations. 185 + * 181 186 * ALIAS -- does not generate debug info -- the aliased function will 182 187 */ 183 188
+1 -2
include/linux/sunrpc/xdr.h
··· 25 25 #define XDR_QUADLEN(l) (((l) + 3) >> 2) 26 26 27 27 /* 28 - * Generic opaque `network object.' At the kernel level, this type 29 - * is used only by lockd. 28 + * Generic opaque `network object.' 30 29 */ 31 30 #define XDR_MAX_NETOBJ 1024 32 31 struct xdr_netobj {
+1 -1
include/net/sch_generic.h
··· 1151 1151 old = *pold; 1152 1152 *pold = new; 1153 1153 if (old != NULL) 1154 - qdisc_tree_flush_backlog(old); 1154 + qdisc_purge_queue(old); 1155 1155 sch_tree_unlock(sch); 1156 1156 1157 1157 return old;
+1 -1
include/net/udp.h
··· 178 178 int udp_gro_complete(struct sk_buff *skb, int nhoff, udp_lookup_t lookup); 179 179 180 180 struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb, 181 - netdev_features_t features); 181 + netdev_features_t features, bool is_ipv6); 182 182 183 183 static inline struct udphdr *udp_gro_udphdr(struct sk_buff *skb) 184 184 {
+76 -10
include/uapi/linux/rkisp1-config.h
··· 49 49 #define RKISP1_CIF_ISP_CTK_COEFF_MAX 0x100 50 50 #define RKISP1_CIF_ISP_CTK_OFFSET_MAX 0x800 51 51 52 - #define RKISP1_CIF_ISP_AE_MEAN_MAX 25 53 - #define RKISP1_CIF_ISP_HIST_BIN_N_MAX 16 52 + #define RKISP1_CIF_ISP_AE_MEAN_MAX_V10 25 53 + #define RKISP1_CIF_ISP_AE_MEAN_MAX_V12 81 54 + #define RKISP1_CIF_ISP_AE_MEAN_MAX RKISP1_CIF_ISP_AE_MEAN_MAX_V12 55 + 56 + #define RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 16 57 + #define RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 32 58 + #define RKISP1_CIF_ISP_HIST_BIN_N_MAX RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 59 + 54 60 #define RKISP1_CIF_ISP_AFM_MAX_WINDOWS 3 55 61 #define RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE 17 56 62 ··· 92 86 * Gamma out 93 87 */ 94 88 /* Maximum number of color samples supported */ 95 - #define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES 17 89 + #define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10 17 90 + #define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12 34 91 + #define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12 96 92 97 93 /* 98 94 * Lens shade correction ··· 110 102 /* 111 103 * Histogram calculation 112 104 */ 113 - /* Last 3 values unused. */ 114 - #define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE 28 105 + #define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10 25 106 + #define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12 81 107 + #define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12 115 108 116 109 /* 117 110 * Defect Pixel Cluster Correction ··· 132 123 #define RKISP1_CIF_ISP_STAT_AUTOEXP (1U << 1) 133 124 #define RKISP1_CIF_ISP_STAT_AFM (1U << 2) 134 125 #define RKISP1_CIF_ISP_STAT_HIST (1U << 3) 126 + 127 + /** 128 + * enum rkisp1_cif_isp_version - ISP variants 129 + * 130 + * @RKISP1_V10: used at least in rk3288 and rk3399 131 + * @RKISP1_V11: declared in the original vendor code, but not used 132 + * @RKISP1_V12: used at least in rk3326 and px30 133 + * @RKISP1_V13: used at least in rk1808 134 + */ 135 + enum rkisp1_cif_isp_version { 136 + RKISP1_V10 = 10, 137 + RKISP1_V11, 138 + RKISP1_V12, 139 + RKISP1_V13, 140 + }; 135 141 136 142 enum rkisp1_cif_isp_histogram_mode { 137 143 RKISP1_CIF_ISP_HISTOGRAM_MODE_DISABLE, ··· 534 510 * 535 511 * @mode: goc mode (from enum rkisp1_cif_isp_goc_mode) 536 512 * @gamma_y: gamma out curve y-axis for all color components 513 + * 514 + * The number of entries of @gamma_y depends on the hardware revision 515 + * as is reported by the hw_revision field of the struct media_device_info 516 + * that is returned by ioctl MEDIA_IOC_DEVICE_INFO. 517 + * 518 + * Versions <= V11 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10 519 + * entries, versions >= V12 have RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12 520 + * entries. RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum 521 + * of the two. 537 522 */ 538 523 struct rkisp1_cif_isp_goc_config { 539 524 __u32 mode; ··· 557 524 * skipped 558 525 * @meas_window: coordinates of the measure window 559 526 * @hist_weight: weighting factor for sub-windows 527 + * 528 + * The number of entries of @hist_weight depends on the hardware revision 529 + * as is reported by the hw_revision field of the struct media_device_info 530 + * that is returned by ioctl MEDIA_IOC_DEVICE_INFO. 531 + * 532 + * Versions <= V11 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10 533 + * entries, versions >= V12 have RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12 534 + * entries. RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum 535 + * of the two. 560 536 */ 561 537 struct rkisp1_cif_isp_hst_config { 562 538 __u32 mode; ··· 853 811 * @exp_mean: Mean luminance value of block xx 854 812 * @bls_val: BLS measured values 855 813 * 856 - * Image is divided into 5x5 blocks. 814 + * The number of entries of @exp_mean depends on the hardware revision 815 + * as is reported by the hw_revision field of the struct media_device_info 816 + * that is returned by ioctl MEDIA_IOC_DEVICE_INFO. 817 + * 818 + * Versions <= V11 have RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries, 819 + * versions >= V12 have RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries. 820 + * RKISP1_CIF_ISP_AE_MEAN_MAX is equal to the maximum of the two. 821 + * 822 + * Image is divided into 5x5 blocks on V10 and 9x9 blocks on V12. 857 823 */ 858 824 struct rkisp1_cif_isp_ae_stat { 859 825 __u8 exp_mean[RKISP1_CIF_ISP_AE_MEAN_MAX]; ··· 894 844 /** 895 845 * struct rkisp1_cif_isp_hist_stat - statistics histogram data 896 846 * 897 - * @hist_bins: measured bin counters 847 + * @hist_bins: measured bin counters. Each bin is a 20 bits unsigned fixed point 848 + * type. Bits 0-4 are the fractional part and bits 5-19 are the 849 + * integer part. 898 850 * 899 - * Measurement window divided into 25 sub-windows, set 900 - * with ISP_HIST_XXX 851 + * The window of the measurements area is divided to 5x5 sub-windows for 852 + * V10/V11 and to 9x9 sub-windows for V12. The histogram is then computed for 853 + * each sub-window independently and the final result is a weighted average of 854 + * the histogram measurements on all sub-windows. The window of the 855 + * measurements area and the weight of each sub-window are configurable using 856 + * struct @rkisp1_cif_isp_hst_config. 857 + * 858 + * The histogram contains 16 bins in V10/V11 and 32 bins in V12/V13. 859 + * 860 + * The number of entries of @hist_bins depends on the hardware revision 861 + * as is reported by the hw_revision field of the struct media_device_info 862 + * that is returned by ioctl MEDIA_IOC_DEVICE_INFO. 863 + * 864 + * Versions <= V11 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries, 865 + * versions >= V12 have RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries. 866 + * RKISP1_CIF_ISP_HIST_BIN_N_MAX is equal to the maximum of the two. 901 867 */ 902 868 struct rkisp1_cif_isp_hist_stat { 903 - __u16 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX]; 869 + __u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX]; 904 870 }; 905 871 906 872 /**
+5 -1
kernel/bpf/bpf_inode_storage.c
··· 125 125 126 126 fd = *(int *)key; 127 127 f = fget_raw(fd); 128 - if (!f || !inode_storage_ptr(f->f_inode)) 128 + if (!f) 129 129 return -EBADF; 130 + if (!inode_storage_ptr(f->f_inode)) { 131 + fput(f); 132 + return -EBADF; 133 + } 130 134 131 135 sdata = bpf_local_storage_update(f->f_inode, 132 136 (struct bpf_local_storage_map *)map,
+12
kernel/bpf/bpf_lsm.c
··· 149 149 BTF_ID(func, bpf_lsm_file_lock) 150 150 BTF_ID(func, bpf_lsm_file_open) 151 151 BTF_ID(func, bpf_lsm_file_receive) 152 + 153 + #ifdef CONFIG_SECURITY_NETWORK 152 154 BTF_ID(func, bpf_lsm_inet_conn_established) 155 + #endif /* CONFIG_SECURITY_NETWORK */ 156 + 153 157 BTF_ID(func, bpf_lsm_inode_create) 154 158 BTF_ID(func, bpf_lsm_inode_free_security) 155 159 BTF_ID(func, bpf_lsm_inode_getattr) ··· 170 166 BTF_ID(func, bpf_lsm_inode_unlink) 171 167 BTF_ID(func, bpf_lsm_kernel_module_request) 172 168 BTF_ID(func, bpf_lsm_kernfs_init_security) 169 + 170 + #ifdef CONFIG_KEYS 173 171 BTF_ID(func, bpf_lsm_key_free) 172 + #endif /* CONFIG_KEYS */ 173 + 174 174 BTF_ID(func, bpf_lsm_mmap_file) 175 175 BTF_ID(func, bpf_lsm_netlink_send) 176 176 BTF_ID(func, bpf_lsm_path_notify) ··· 189 181 BTF_ID(func, bpf_lsm_sb_statfs) 190 182 BTF_ID(func, bpf_lsm_sb_umount) 191 183 BTF_ID(func, bpf_lsm_settime) 184 + 185 + #ifdef CONFIG_SECURITY_NETWORK 192 186 BTF_ID(func, bpf_lsm_socket_accept) 193 187 BTF_ID(func, bpf_lsm_socket_bind) 194 188 BTF_ID(func, bpf_lsm_socket_connect) ··· 205 195 BTF_ID(func, bpf_lsm_socket_sendmsg) 206 196 BTF_ID(func, bpf_lsm_socket_shutdown) 207 197 BTF_ID(func, bpf_lsm_socket_socketpair) 198 + #endif /* CONFIG_SECURITY_NETWORK */ 199 + 208 200 BTF_ID(func, bpf_lsm_syslog) 209 201 BTF_ID(func, bpf_lsm_task_alloc) 210 202 BTF_ID(func, bpf_lsm_task_getsecid)
+6 -1
kernel/bpf/cgroup.c
··· 1442 1442 goto out; 1443 1443 } 1444 1444 1445 + if (ctx.optlen < 0) { 1446 + ret = -EFAULT; 1447 + goto out; 1448 + } 1449 + 1445 1450 if (copy_from_user(ctx.optval, optval, 1446 1451 min(ctx.optlen, max_optlen)) != 0) { 1447 1452 ret = -EFAULT; ··· 1464 1459 goto out; 1465 1460 } 1466 1461 1467 - if (ctx.optlen > max_optlen) { 1462 + if (ctx.optlen > max_optlen || ctx.optlen < 0) { 1468 1463 ret = -EFAULT; 1469 1464 goto out; 1470 1465 }
+4 -1
kernel/bpf/preload/Makefile
··· 4 4 LIBBPF_A = $(obj)/libbpf.a 5 5 LIBBPF_OUT = $(abspath $(obj)) 6 6 7 + # Although not in use by libbpf's Makefile, set $(O) so that the "dummy" test 8 + # in tools/scripts/Makefile.include always succeeds when building the kernel 9 + # with $(O) pointing to a relative path, as in "make O=build bindeb-pkg". 7 10 $(LIBBPF_A): 8 - $(Q)$(MAKE) -C $(LIBBPF_SRCS) OUTPUT=$(LIBBPF_OUT)/ $(LIBBPF_OUT)/libbpf.a 11 + $(Q)$(MAKE) -C $(LIBBPF_SRCS) O=$(LIBBPF_OUT)/ OUTPUT=$(LIBBPF_OUT)/ $(LIBBPF_OUT)/libbpf.a 9 12 10 13 userccflags += -I $(srctree)/tools/include/ -I $(srctree)/tools/include/uapi \ 11 14 -I $(srctree)/tools/lib/ -Wno-unused-result
+5 -1
kernel/dma/map_benchmark.c
··· 147 147 atomic64_set(&map->sum_sq_unmap, 0); 148 148 atomic64_set(&map->loops, 0); 149 149 150 - for (i = 0; i < threads; i++) 150 + for (i = 0; i < threads; i++) { 151 + get_task_struct(tsk[i]); 151 152 wake_up_process(tsk[i]); 153 + } 152 154 153 155 msleep_interruptible(map->bparam.seconds * 1000); 154 156 ··· 185 183 } 186 184 187 185 out: 186 + for (i = 0; i < threads; i++) 187 + put_task_struct(tsk[i]); 188 188 put_device(map->dev); 189 189 kfree(tsk); 190 190 return ret;
+1 -1
kernel/entry/common.c
··· 222 222 */ 223 223 static inline bool report_single_step(unsigned long work) 224 224 { 225 - if (!(work & SYSCALL_WORK_SYSCALL_EMU)) 225 + if (work & SYSCALL_WORK_SYSCALL_EMU) 226 226 return false; 227 227 228 228 return !!(current_thread_info()->flags & _TIF_SINGLESTEP);
-2
kernel/kexec_core.c
··· 1134 1134 1135 1135 #ifdef CONFIG_KEXEC_JUMP 1136 1136 if (kexec_image->preserve_context) { 1137 - lock_system_sleep(); 1138 1137 pm_prepare_console(); 1139 1138 error = freeze_processes(); 1140 1139 if (error) { ··· 1196 1197 thaw_processes(); 1197 1198 Restore_console: 1198 1199 pm_restore_console(); 1199 - unlock_system_sleep(); 1200 1200 } 1201 1201 #endif 1202 1202
+1 -1
kernel/power/swap.c
··· 497 497 unsigned int flags, int error) 498 498 { 499 499 if (!error) { 500 - flush_swap_writer(handle); 501 500 pr_info("S"); 502 501 error = mark_swapfiles(handle, flags); 503 502 pr_cont("|\n"); 503 + flush_swap_writer(handle); 504 504 } 505 505 506 506 if (error)
+5 -4
net/core/neighbour.c
··· 1244 1244 old = neigh->nud_state; 1245 1245 err = -EPERM; 1246 1246 1247 + if (neigh->dead) { 1248 + NL_SET_ERR_MSG(extack, "Neighbor entry is now dead"); 1249 + new = old; 1250 + goto out; 1251 + } 1247 1252 if (!(flags & NEIGH_UPDATE_F_ADMIN) && 1248 1253 (old & (NUD_NOARP | NUD_PERMANENT))) 1249 1254 goto out; 1250 - if (neigh->dead) { 1251 - NL_SET_ERR_MSG(extack, "Neighbor entry is now dead"); 1252 - goto out; 1253 - } 1254 1255 1255 1256 ext_learn_change = neigh_update_ext_learned(neigh, flags, &notify); 1256 1257
+4 -1
net/hsr/hsr_main.h
··· 217 217 u8 net_id; /* for PRP, it occupies most significant 3 bits 218 218 * of lan_id 219 219 */ 220 - unsigned char sup_multicast_addr[ETH_ALEN]; 220 + unsigned char sup_multicast_addr[ETH_ALEN] __aligned(sizeof(u16)); 221 + /* Align to u16 boundary to avoid unaligned access 222 + * in ether_addr_equal 223 + */ 221 224 #ifdef CONFIG_DEBUG_FS 222 225 struct dentry *node_tbl_root; 223 226 #endif
+7 -9
net/ipv4/ip_tunnel.c
··· 317 317 } 318 318 319 319 dev->needed_headroom = t_hlen + hlen; 320 - mtu -= (dev->hard_header_len + t_hlen); 320 + mtu -= t_hlen; 321 321 322 322 if (mtu < IPV4_MIN_MTU) 323 323 mtu = IPV4_MIN_MTU; ··· 347 347 nt = netdev_priv(dev); 348 348 t_hlen = nt->hlen + sizeof(struct iphdr); 349 349 dev->min_mtu = ETH_MIN_MTU; 350 - dev->max_mtu = IP_MAX_MTU - dev->hard_header_len - t_hlen; 350 + dev->max_mtu = IP_MAX_MTU - t_hlen; 351 351 ip_tunnel_add(itn, nt); 352 352 return nt; 353 353 ··· 488 488 int mtu; 489 489 490 490 tunnel_hlen = md ? tunnel_hlen : tunnel->hlen; 491 - pkt_size = skb->len - tunnel_hlen - dev->hard_header_len; 491 + pkt_size = skb->len - tunnel_hlen; 492 492 493 493 if (df) 494 - mtu = dst_mtu(&rt->dst) - dev->hard_header_len 495 - - sizeof(struct iphdr) - tunnel_hlen; 494 + mtu = dst_mtu(&rt->dst) - (sizeof(struct iphdr) + tunnel_hlen); 496 495 else 497 496 mtu = skb_valid_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu; 498 497 ··· 971 972 { 972 973 struct ip_tunnel *tunnel = netdev_priv(dev); 973 974 int t_hlen = tunnel->hlen + sizeof(struct iphdr); 974 - int max_mtu = IP_MAX_MTU - dev->hard_header_len - t_hlen; 975 + int max_mtu = IP_MAX_MTU - t_hlen; 975 976 976 977 if (new_mtu < ETH_MIN_MTU) 977 978 return -EINVAL; ··· 1148 1149 1149 1150 mtu = ip_tunnel_bind_dev(dev); 1150 1151 if (tb[IFLA_MTU]) { 1151 - unsigned int max = IP_MAX_MTU - dev->hard_header_len - nt->hlen; 1152 + unsigned int max = IP_MAX_MTU - (nt->hlen + sizeof(struct iphdr)); 1152 1153 1153 - mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU, 1154 - (unsigned int)(max - sizeof(struct iphdr))); 1154 + mtu = clamp(dev->mtu, (unsigned int)ETH_MIN_MTU, max); 1155 1155 } 1156 1156 1157 1157 err = dev_set_mtu(dev, mtu);
+64 -5
net/ipv4/udp_offload.c
··· 187 187 } 188 188 EXPORT_SYMBOL(skb_udp_tunnel_segment); 189 189 190 + static void __udpv4_gso_segment_csum(struct sk_buff *seg, 191 + __be32 *oldip, __be32 *newip, 192 + __be16 *oldport, __be16 *newport) 193 + { 194 + struct udphdr *uh; 195 + struct iphdr *iph; 196 + 197 + if (*oldip == *newip && *oldport == *newport) 198 + return; 199 + 200 + uh = udp_hdr(seg); 201 + iph = ip_hdr(seg); 202 + 203 + if (uh->check) { 204 + inet_proto_csum_replace4(&uh->check, seg, *oldip, *newip, 205 + true); 206 + inet_proto_csum_replace2(&uh->check, seg, *oldport, *newport, 207 + false); 208 + if (!uh->check) 209 + uh->check = CSUM_MANGLED_0; 210 + } 211 + *oldport = *newport; 212 + 213 + csum_replace4(&iph->check, *oldip, *newip); 214 + *oldip = *newip; 215 + } 216 + 217 + static struct sk_buff *__udpv4_gso_segment_list_csum(struct sk_buff *segs) 218 + { 219 + struct sk_buff *seg; 220 + struct udphdr *uh, *uh2; 221 + struct iphdr *iph, *iph2; 222 + 223 + seg = segs; 224 + uh = udp_hdr(seg); 225 + iph = ip_hdr(seg); 226 + 227 + if ((udp_hdr(seg)->dest == udp_hdr(seg->next)->dest) && 228 + (udp_hdr(seg)->source == udp_hdr(seg->next)->source) && 229 + (ip_hdr(seg)->daddr == ip_hdr(seg->next)->daddr) && 230 + (ip_hdr(seg)->saddr == ip_hdr(seg->next)->saddr)) 231 + return segs; 232 + 233 + while ((seg = seg->next)) { 234 + uh2 = udp_hdr(seg); 235 + iph2 = ip_hdr(seg); 236 + 237 + __udpv4_gso_segment_csum(seg, 238 + &iph2->saddr, &iph->saddr, 239 + &uh2->source, &uh->source); 240 + __udpv4_gso_segment_csum(seg, 241 + &iph2->daddr, &iph->daddr, 242 + &uh2->dest, &uh->dest); 243 + } 244 + 245 + return segs; 246 + } 247 + 190 248 static struct sk_buff *__udp_gso_segment_list(struct sk_buff *skb, 191 - netdev_features_t features) 249 + netdev_features_t features, 250 + bool is_ipv6) 192 251 { 193 252 unsigned int mss = skb_shinfo(skb)->gso_size; 194 253 ··· 257 198 258 199 udp_hdr(skb)->len = htons(sizeof(struct udphdr) + mss); 259 200 260 - return skb; 201 + return is_ipv6 ? skb : __udpv4_gso_segment_list_csum(skb); 261 202 } 262 203 263 204 struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb, 264 - netdev_features_t features) 205 + netdev_features_t features, bool is_ipv6) 265 206 { 266 207 struct sock *sk = gso_skb->sk; 267 208 unsigned int sum_truesize = 0; ··· 273 214 __be16 newlen; 274 215 275 216 if (skb_shinfo(gso_skb)->gso_type & SKB_GSO_FRAGLIST) 276 - return __udp_gso_segment_list(gso_skb, features); 217 + return __udp_gso_segment_list(gso_skb, features, is_ipv6); 277 218 278 219 mss = skb_shinfo(gso_skb)->gso_size; 279 220 if (gso_skb->len <= sizeof(*uh) + mss) ··· 387 328 goto out; 388 329 389 330 if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) 390 - return __udp_gso_segment(skb, features); 331 + return __udp_gso_segment(skb, features, false); 391 332 392 333 mss = skb_shinfo(skb)->gso_size; 393 334 if (unlikely(skb->len <= mss))
+1 -1
net/ipv6/udp_offload.c
··· 42 42 goto out; 43 43 44 44 if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) 45 - return __udp_gso_segment(skb, features); 45 + return __udp_gso_segment(skb, features, true); 46 46 47 47 mss = skb_shinfo(skb)->gso_size; 48 48 if (unlikely(skb->len <= mss))
+2 -1
net/lapb/lapb_out.c
··· 82 82 skb = skb_dequeue(&lapb->write_queue); 83 83 84 84 do { 85 - if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) { 85 + skbn = skb_copy(skb, GFP_ATOMIC); 86 + if (!skbn) { 86 87 skb_queue_head(&lapb->write_queue, skb); 87 88 break; 88 89 }
+4 -1
net/mac80211/driver-ops.c
··· 125 125 } else if (old_state == IEEE80211_STA_AUTH && 126 126 new_state == IEEE80211_STA_ASSOC) { 127 127 ret = drv_sta_add(local, sdata, &sta->sta); 128 - if (ret == 0) 128 + if (ret == 0) { 129 129 sta->uploaded = true; 130 + if (rcu_access_pointer(sta->sta.rates)) 131 + drv_sta_rate_tbl_update(local, sdata, &sta->sta); 132 + } 130 133 } else if (old_state == IEEE80211_STA_ASSOC && 131 134 new_state == IEEE80211_STA_AUTH) { 132 135 drv_sta_remove(local, sdata, &sta->sta);
+2 -1
net/mac80211/rate.c
··· 960 960 if (old) 961 961 kfree_rcu(old, rcu_head); 962 962 963 - drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta); 963 + if (sta->uploaded) 964 + drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta); 964 965 965 966 ieee80211_sta_set_expected_throughput(pubsta, sta_get_expected_throughput(sta)); 966 967
+3
net/rds/rdma.c
··· 565 565 if (args->nr_local == 0) 566 566 return -EINVAL; 567 567 568 + if (args->nr_local > UIO_MAXIOV) 569 + return -EMSGSIZE; 570 + 568 571 iov->iov = kcalloc(args->nr_local, 569 572 sizeof(struct rds_iovec), 570 573 GFP_KERNEL);
+3 -3
net/rxrpc/af_rxrpc.c
··· 990 990 goto error_security; 991 991 } 992 992 993 - ret = register_pernet_subsys(&rxrpc_net_ops); 993 + ret = register_pernet_device(&rxrpc_net_ops); 994 994 if (ret) 995 995 goto error_pernet; 996 996 ··· 1035 1035 error_sock: 1036 1036 proto_unregister(&rxrpc_proto); 1037 1037 error_proto: 1038 - unregister_pernet_subsys(&rxrpc_net_ops); 1038 + unregister_pernet_device(&rxrpc_net_ops); 1039 1039 error_pernet: 1040 1040 rxrpc_exit_security(); 1041 1041 error_security: ··· 1057 1057 unregister_key_type(&key_type_rxrpc); 1058 1058 sock_unregister(PF_RXRPC); 1059 1059 proto_unregister(&rxrpc_proto); 1060 - unregister_pernet_subsys(&rxrpc_net_ops); 1060 + unregister_pernet_device(&rxrpc_net_ops); 1061 1061 ASSERTCMP(atomic_read(&rxrpc_n_tx_skbs), ==, 0); 1062 1062 ASSERTCMP(atomic_read(&rxrpc_n_rx_skbs), ==, 0); 1063 1063
+1 -29
net/sunrpc/auth_gss/auth_gss.c
··· 29 29 #include <linux/uaccess.h> 30 30 #include <linux/hashtable.h> 31 31 32 + #include "auth_gss_internal.h" 32 33 #include "../netns.h" 33 34 34 35 #include <trace/events/rpcgss.h> ··· 124 123 set_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags); 125 124 smp_mb__before_atomic(); 126 125 clear_bit(RPCAUTH_CRED_NEW, &cred->cr_flags); 127 - } 128 - 129 - static const void * 130 - simple_get_bytes(const void *p, const void *end, void *res, size_t len) 131 - { 132 - const void *q = (const void *)((const char *)p + len); 133 - if (unlikely(q > end || q < p)) 134 - return ERR_PTR(-EFAULT); 135 - memcpy(res, p, len); 136 - return q; 137 - } 138 - 139 - static inline const void * 140 - simple_get_netobj(const void *p, const void *end, struct xdr_netobj *dest) 141 - { 142 - const void *q; 143 - unsigned int len; 144 - 145 - p = simple_get_bytes(p, end, &len, sizeof(len)); 146 - if (IS_ERR(p)) 147 - return p; 148 - q = (const void *)((const char *)p + len); 149 - if (unlikely(q > end || q < p)) 150 - return ERR_PTR(-EFAULT); 151 - dest->data = kmemdup(p, len, GFP_NOFS); 152 - if (unlikely(dest->data == NULL)) 153 - return ERR_PTR(-ENOMEM); 154 - dest->len = len; 155 - return q; 156 126 } 157 127 158 128 static struct gss_cl_ctx *
+45
net/sunrpc/auth_gss/auth_gss_internal.h
··· 1 + // SPDX-License-Identifier: BSD-3-Clause 2 + /* 3 + * linux/net/sunrpc/auth_gss/auth_gss_internal.h 4 + * 5 + * Internal definitions for RPCSEC_GSS client authentication 6 + * 7 + * Copyright (c) 2000 The Regents of the University of Michigan. 8 + * All rights reserved. 9 + * 10 + */ 11 + #include <linux/err.h> 12 + #include <linux/string.h> 13 + #include <linux/sunrpc/xdr.h> 14 + 15 + static inline const void * 16 + simple_get_bytes(const void *p, const void *end, void *res, size_t len) 17 + { 18 + const void *q = (const void *)((const char *)p + len); 19 + if (unlikely(q > end || q < p)) 20 + return ERR_PTR(-EFAULT); 21 + memcpy(res, p, len); 22 + return q; 23 + } 24 + 25 + static inline const void * 26 + simple_get_netobj(const void *p, const void *end, struct xdr_netobj *dest) 27 + { 28 + const void *q; 29 + unsigned int len; 30 + 31 + p = simple_get_bytes(p, end, &len, sizeof(len)); 32 + if (IS_ERR(p)) 33 + return p; 34 + q = (const void *)((const char *)p + len); 35 + if (unlikely(q > end || q < p)) 36 + return ERR_PTR(-EFAULT); 37 + if (len) { 38 + dest->data = kmemdup(p, len, GFP_NOFS); 39 + if (unlikely(dest->data == NULL)) 40 + return ERR_PTR(-ENOMEM); 41 + } else 42 + dest->data = NULL; 43 + dest->len = len; 44 + return q; 45 + }
+2 -29
net/sunrpc/auth_gss/gss_krb5_mech.c
··· 21 21 #include <linux/sunrpc/xdr.h> 22 22 #include <linux/sunrpc/gss_krb5_enctypes.h> 23 23 24 + #include "auth_gss_internal.h" 25 + 24 26 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) 25 27 # define RPCDBG_FACILITY RPCDBG_AUTH 26 28 #endif ··· 143 141 if (supported_gss_krb5_enctypes[i].etype == etype) 144 142 return &supported_gss_krb5_enctypes[i]; 145 143 return NULL; 146 - } 147 - 148 - static const void * 149 - simple_get_bytes(const void *p, const void *end, void *res, int len) 150 - { 151 - const void *q = (const void *)((const char *)p + len); 152 - if (unlikely(q > end || q < p)) 153 - return ERR_PTR(-EFAULT); 154 - memcpy(res, p, len); 155 - return q; 156 - } 157 - 158 - static const void * 159 - simple_get_netobj(const void *p, const void *end, struct xdr_netobj *res) 160 - { 161 - const void *q; 162 - unsigned int len; 163 - 164 - p = simple_get_bytes(p, end, &len, sizeof(len)); 165 - if (IS_ERR(p)) 166 - return p; 167 - q = (const void *)((const char *)p + len); 168 - if (unlikely(q > end || q < p)) 169 - return ERR_PTR(-EFAULT); 170 - res->data = kmemdup(p, len, GFP_NOFS); 171 - if (unlikely(res->data == NULL)) 172 - return ERR_PTR(-ENOMEM); 173 - res->len = len; 174 - return q; 175 144 } 176 145 177 146 static inline const void *
+12 -5
net/vmw_vsock/af_vsock.c
··· 1014 1014 mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND; 1015 1015 1016 1016 } else if (sock->type == SOCK_STREAM) { 1017 - const struct vsock_transport *transport = vsk->transport; 1017 + const struct vsock_transport *transport; 1018 + 1018 1019 lock_sock(sk); 1020 + 1021 + transport = vsk->transport; 1019 1022 1020 1023 /* Listening sockets that have connections in their accept 1021 1024 * queue can be read. ··· 1102 1099 err = 0; 1103 1100 sk = sock->sk; 1104 1101 vsk = vsock_sk(sk); 1105 - transport = vsk->transport; 1106 1102 1107 1103 lock_sock(sk); 1104 + 1105 + transport = vsk->transport; 1108 1106 1109 1107 err = vsock_auto_bind(vsk); 1110 1108 if (err) ··· 1565 1561 err = 0; 1566 1562 sk = sock->sk; 1567 1563 vsk = vsock_sk(sk); 1568 - transport = vsk->transport; 1569 1564 1570 1565 lock_sock(sk); 1566 + 1567 + transport = vsk->transport; 1571 1568 1572 1569 switch (optname) { 1573 1570 case SO_VM_SOCKETS_BUFFER_SIZE: ··· 1702 1697 1703 1698 sk = sock->sk; 1704 1699 vsk = vsock_sk(sk); 1705 - transport = vsk->transport; 1706 1700 total_written = 0; 1707 1701 err = 0; 1708 1702 ··· 1709 1705 return -EOPNOTSUPP; 1710 1706 1711 1707 lock_sock(sk); 1708 + 1709 + transport = vsk->transport; 1712 1710 1713 1711 /* Callers should not provide a destination with stream sockets. */ 1714 1712 if (msg->msg_namelen) { ··· 1846 1840 1847 1841 sk = sock->sk; 1848 1842 vsk = vsock_sk(sk); 1849 - transport = vsk->transport; 1850 1843 err = 0; 1851 1844 1852 1845 lock_sock(sk); 1846 + 1847 + transport = vsk->transport; 1853 1848 1854 1849 if (!transport || sk->sk_state != TCP_ESTABLISHED) { 1855 1850 /* Recvmsg is supposed to return 0 if a peer performs an