Commit graph

1247958 commits

Author SHA1 Message Date
Hans de Goede
58f65f9db7 Input: atkbd - use ab83 as id when skipping the getid command
Barnabás reported that the change to skip the getid command
when the controller is in translated mode on laptops caused
the Version field of his "AT Translated Set 2 keyboard"
input device to change from ab83 to abba, breaking a custom
hwdb entry for this keyboard.

Use the standard ab83 id for keyboards when getid is skipped
(rather then that getid fails) to avoid reporting a different
Version to userspace then before skipping the getid.

Fixes: 936e4d49ec ("Input: atkbd - skip ATKBD_CMD_GETID in translated mode")
Reported-by: Barnabás Pőcze <pobrn@protonmail.com>
Closes: https://lore.kernel.org/linux-input/W1ydwoG2fYv85Z3C3yfDOJcVpilEvGge6UGa9kZh8zI2-qkHXp7WLnl2hSkFz63j-c7WupUWI5TLL6n7Lt8DjRuU-yJBwLYWrreb1hbnd6A=@protonmail.com/
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240116204325.7719-1-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-01-16 13:16:10 -08:00
Hao Sun
33772ff3b8 selftests/bpf: Add test for alu on PTR_TO_FLOW_KEYS
Add a test case for PTR_TO_FLOW_KEYS alu. Testing if alu with variable
offset on flow_keys is rejected. For the fixed offset success case, we
already have C code coverage to verify (e.g. via bpf_flow.c).

Signed-off-by: Hao Sun <sunhao.th@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/bpf/20240115082028.9992-2-sunhao.th@gmail.com
2024-01-16 17:12:48 +01:00
Hao Sun
22c7fa171a bpf: Reject variable offset alu on PTR_TO_FLOW_KEYS
For PTR_TO_FLOW_KEYS, check_flow_keys_access() only uses fixed off
for validation. However, variable offset ptr alu is not prohibited
for this ptr kind. So the variable offset is not checked.

The following prog is accepted:

  func#0 @0
  0: R1=ctx() R10=fp0
  0: (bf) r6 = r1                       ; R1=ctx() R6_w=ctx()
  1: (79) r7 = *(u64 *)(r6 +144)        ; R6_w=ctx() R7_w=flow_keys()
  2: (b7) r8 = 1024                     ; R8_w=1024
  3: (37) r8 /= 1                       ; R8_w=scalar()
  4: (57) r8 &= 1024                    ; R8_w=scalar(smin=smin32=0,
  smax=umax=smax32=umax32=1024,var_off=(0x0; 0x400))
  5: (0f) r7 += r8
  mark_precise: frame0: last_idx 5 first_idx 0 subseq_idx -1
  mark_precise: frame0: regs=r8 stack= before 4: (57) r8 &= 1024
  mark_precise: frame0: regs=r8 stack= before 3: (37) r8 /= 1
  mark_precise: frame0: regs=r8 stack= before 2: (b7) r8 = 1024
  6: R7_w=flow_keys(smin=smin32=0,smax=umax=smax32=umax32=1024,var_off
  =(0x0; 0x400)) R8_w=scalar(smin=smin32=0,smax=umax=smax32=umax32=1024,
  var_off=(0x0; 0x400))
  6: (79) r0 = *(u64 *)(r7 +0)          ; R0_w=scalar()
  7: (95) exit

This prog loads flow_keys to r7, and adds the variable offset r8
to r7, and finally causes out-of-bounds access:

  BUG: unable to handle page fault for address: ffffc90014c80038
  [...]
  Call Trace:
   <TASK>
   bpf_dispatcher_nop_func include/linux/bpf.h:1231 [inline]
   __bpf_prog_run include/linux/filter.h:651 [inline]
   bpf_prog_run include/linux/filter.h:658 [inline]
   bpf_prog_run_pin_on_cpu include/linux/filter.h:675 [inline]
   bpf_flow_dissect+0x15f/0x350 net/core/flow_dissector.c:991
   bpf_prog_test_run_flow_dissector+0x39d/0x620 net/bpf/test_run.c:1359
   bpf_prog_test_run kernel/bpf/syscall.c:4107 [inline]
   __sys_bpf+0xf8f/0x4560 kernel/bpf/syscall.c:5475
   __do_sys_bpf kernel/bpf/syscall.c:5561 [inline]
   __se_sys_bpf kernel/bpf/syscall.c:5559 [inline]
   __x64_sys_bpf+0x73/0xb0 kernel/bpf/syscall.c:5559
   do_syscall_x64 arch/x86/entry/common.c:52 [inline]
   do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:83
   entry_SYSCALL_64_after_hwframe+0x63/0x6b

Fix this by rejecting ptr alu with variable offset on flow_keys.
Applying the patch rejects the program with "R7 pointer arithmetic
on flow_keys prohibited".

Fixes: d58e468b11 ("flow_dissector: implements flow dissector BPF hook")
Signed-off-by: Hao Sun <sunhao.th@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/bpf/20240115082028.9992-1-sunhao.th@gmail.com
2024-01-16 17:12:29 +01:00
Jakub Kicinski
03fb8565c8 selftests: bonding: add missing build configs
bonding tests also try to create bridge, veth and dummy
interfaces. These are not currently listed in config.

Fixes: bbb774d921 ("net: Add tests for bonding and team address list management")
Fixes: c078290a2b ("selftests: include bonding tests into the kselftest infra")
Acked-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Link: https://lore.kernel.org/r/20240116020201.1883023-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-01-16 06:58:53 -08:00
Rafael J. Wysocki
5b5268cd49 Merge branches 'pnp', 'acpi-resource' and 'acpica'
Merge a PNP change, new ACPI IRQ management quirks and a small ACPICA
code update for 6.8-rc1:

 - Make pnp_bus_type const (Greg Kroah-Hartman).

 - Add ACPI IRQ management quirks for ASUS ExpertBook B1502CGA and ASUS
   Vivobook E1504GA and E1504GAB (Ben Mayo, Michael Maltsev).

 - Add new MADT GICC/GICR/ITS non-coherent flags and GICC online capable
   bit handling to ACPICA (Lorenzo Pieralisi).

* pnp:
  PNP: make pnp_bus_type const

* acpi-resource:
  ACPI: resource: Skip IRQ override on ASUS ExpertBook B1502CGA
  ACPI: resource: Add DMI quirks for ASUS Vivobook E1504GA and E1504GAB

* acpica:
  ACPICA: MADT: Add new MADT GICC/GICR/ITS non-coherent flags handling
  ACPICA: MADT: Add GICC online capable bit handling
2024-01-16 12:44:35 +01:00
Jakub Kicinski
4697381bd0 selftests: netdevsim: correct expected FEC strings
ethtool CLI has changed its output. Make the test compatible.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20240114224748.1210578-1-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-01-16 12:42:29 +01:00
Rafael J. Wysocki
dd75558b2d Merge branches 'thermal-core' and 'thermal-intel'
Merge additional updates for 6.8-rc1 in the thermal core and in the
Intel HFI thermal driver:

 - Add debugfs-based diagnostics support to the thermal core (Daniel
   Lezcano, Dan Carpenter).

 - Fix a power allocator thermal governor issue preventing it from
   resetting cooling devices sometimes (Di Shen).

 - Simplify the thermal netlink API and clean up related code (Rafael J.
   Wysocki).

 - Make the Intel HFI driver support hibernation and deep suspend
   properly (Ricardo Neri).

* thermal-core:
  thermal/debugfs: Unlock on error path in thermal_debug_tz_trip_up()
  thermal: gov_power_allocator: avoid inability to reset a cdev
  thermal: helpers: Rearrange thermal_cdev_set_cur_state()
  thermal: netlink: Rework notify API for cooling devices
  thermal: core: Use kstrdup_const() during cooling device registration
  thermal/debugfs: Add thermal debugfs information for mitigation episodes
  thermal/debugfs: Add thermal cooling device debugfs information
  thermal: netlink: Pass thermal zone pointer to notify routines
  thermal: netlink: Drop thermal_notify_tz_trip_add/delete()
  thermal: netlink: Pass pointers to thermal_notify_tz_trip_up/down()
  thermal: netlink: Pass pointers to thermal_notify_tz_trip_change()

* thermal-intel:
  thermal: intel: hfi: Add syscore callbacks for system-wide PM
2024-01-16 12:33:15 +01:00
Rafael J. Wysocki
9223614ea7 Merge branches 'pm-sleep', 'pm-cpufreq' and 'pm-qos' into pm
* pm-sleep:
  PM: sleep: Restore asynchronous device resume optimization

* pm-cpufreq:
  Documentation: admin-guide: PM: Fix two typos
  cpufreq: intel_pstate: Update hybrid scaling factor for Meteor Lake

* pm-qos:
  PM: QoS: Use kcalloc() instead of kzalloc()
2024-01-16 12:23:24 +01:00
Jakub Kicinski
2c4ca79772 selftests: netdevsim: sprinkle more udevadm settle
Number of tests are failing when netdev renaming is active
on the system. Add udevadm settle in logic determining
the names.

Fixes: 242aaf03dc ("selftests: add a test for ethtool pause stats")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240114224726.1210532-1-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-01-16 12:16:04 +01:00
Vincent Guittot
e37617c8e5 sched/fair: Fix frequency selection for non-invariant case
Linus reported a ~50% performance regression on single-threaded
workloads on his AMD Ryzen system, and bisected it to:

  9c0b4bb7f6 ("sched/cpufreq: Rework schedutil governor performance estimation")

When frequency invariance is not enabled, get_capacity_ref_freq(policy)
is supposed to return the current frequency and the performance margin
applied by map_util_perf(), enabling the utilization to go above the
maximum compute capacity and to select a higher frequency than the current one.

After the changes in 9c0b4bb7f6, the performance margin was applied
earlier in the path to take into account utilization clampings and
we couldn't get a utilization higher than the maximum compute capacity,
and the CPU remained 'stuck' at lower frequencies.

To fix this, we must use a frequency above the current frequency to
get a chance to select a higher OPP when the current one becomes fully used.
Apply the same margin and return a frequency 25% higher than the current
one in order to switch to the next OPP before we fully use the CPU
at the current one.

[ mingo: Clarified the changelog. ]

Fixes: 9c0b4bb7f6 ("sched/cpufreq: Rework schedutil governor performance estimation")
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Bisected-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Wyes Karny <wkarny@gmail.com>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Wyes Karny <wkarny@gmail.com>
Link: https://lore.kernel.org/r/20240114183600.135316-1-vincent.guittot@linaro.org
2024-01-16 10:41:25 +01:00
Qiang Ma
a23aa04042 net: stmmac: ethtool: Fixed calltrace caused by unbalanced disable_irq_wake calls
We found the following dmesg calltrace when testing the GMAC NIC notebook:

[9.448656] ------------[ cut here ]------------
[9.448658] Unbalanced IRQ 43 wake disable
[9.448673] WARNING: CPU: 3 PID: 1083 at kernel/irq/manage.c:688 irq_set_irq_wake+0xe0/0x128
[9.448717] CPU: 3 PID: 1083 Comm: ethtool Tainted: G           O      4.19 #1
[9.448773]         ...
[9.448774] Call Trace:
[9.448781] [<9000000000209b5c>] show_stack+0x34/0x140
[9.448788] [<9000000000d52700>] dump_stack+0x98/0xd0
[9.448794] [<9000000000228610>] __warn+0xa8/0x120
[9.448797] [<9000000000d2fb60>] report_bug+0x98/0x130
[9.448800] [<900000000020a418>] do_bp+0x248/0x2f0
[9.448805] [<90000000002035f4>] handle_bp_int+0x4c/0x78
[9.448808] [<900000000029ea40>] irq_set_irq_wake+0xe0/0x128
[9.448813] [<9000000000a96a7c>] stmmac_set_wol+0x134/0x150
[9.448819] [<9000000000be6ed0>] dev_ethtool+0x1368/0x2440
[9.448824] [<9000000000c08350>] dev_ioctl+0x1f8/0x3e0
[9.448827] [<9000000000bb2a34>] sock_ioctl+0x2a4/0x450
[9.448832] [<900000000046f044>] do_vfs_ioctl+0xa4/0x738
[9.448834] [<900000000046f778>] ksys_ioctl+0xa0/0xe8
[9.448837] [<900000000046f7d8>] sys_ioctl+0x18/0x28
[9.448840] [<9000000000211ab4>] syscall_common+0x20/0x34
[9.448842] ---[ end trace 40c18d9aec863c3e ]---

Multiple disable_irq_wake() calls will keep decreasing the IRQ
wake_depth, When wake_depth is 0, calling disable_irq_wake() again,
will report the above calltrace.

Due to the need to appear in pairs, we cannot call disable_irq_wake()
without calling enable_irq_wake(). Fix this by making sure there are
no unbalanced disable_irq_wake() calls.

Fixes: 3172d3afa9 ("stmmac: support wake up irq from external sources (v3)")
Signed-off-by: Qiang Ma <maqianga@uniontech.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240112021249.24598-1-maqianga@uniontech.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-01-16 09:37:38 +01:00
Paolo Abeni
915805b505 Merge branch 'selftests-net-small-fixes'
Benjamin Poirier says:

====================
selftests: net: Small fixes

From: Benjamin Poirier <benjamin.poirier@gmail.com>

Two small fixes for net selftests.

These patches were carved out of the following RFC series:
https://lore.kernel.org/netdev/20231222135836.992841-1-bpoirier@nvidia.com/

I'm planning to send the rest of the series to net-next after it opens up.
====================

Link: https://lore.kernel.org/r/20240110141436.157419-1-bpoirier@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-01-16 09:06:18 +01:00
Benjamin Poirier
49078c1b80 selftests: forwarding: Remove executable bits from lib.sh
The lib.sh script is meant to be sourced from other scripts, not executed
directly. Therefore, remove the executable bits from lib.sh's permissions.

Fixes: fe32dffdcd ("selftests: forwarding: add TCPDUMP_EXTRA_FLAGS to lib.sh")
Tested-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-01-16 09:06:15 +01:00
Benjamin Poirier
c2518da8e6 selftests: bonding: Change script interpreter
The tests changed by this patch, as well as the scripts they source, use
features which are not part of POSIX sh (ex. 'source' and 'local'). As a
result, these tests fail when /bin/sh is dash such as on Debian. Change the
interpreter to bash so that these tests can run successfully.

Fixes: d43eff0b85 ("selftests: bonding: up/down delay w/ slave link flapping")
Tested-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-01-16 09:06:15 +01:00
Antoniu Miclaus
dedaf03b99 rtc: max31335: add driver support
RTC driver for MAX31335 ±2ppm Automotive Real-Time Clock with
Integrated MEMS Resonator.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://lore.kernel.org/r/20231120120114.48657-2-antoniu.miclaus@analog.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2024-01-15 23:27:59 +01:00
Antoniu Miclaus
5905777847 dt-bindings: rtc: max31335: add max31335 bindings
Document the Analog Devices MAX31335 device tree bindings.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://lore.kernel.org/r/20231120120114.48657-1-antoniu.miclaus@analog.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2024-01-15 23:27:14 +01:00
Randy Dunlap
62b38f30a0 gpio: EN7523: fix kernel-doc warnings
Add "struct" keyword and explain the @dir array differently to
prevent kernel-doc warnings:

gpio-en7523.c:22: warning: cannot understand function prototype: 'struct airoha_gpio_ctrl '
gpio-en7523.c:27: warning: Function parameter or struct member 'dir' not described in 'airoha_gpio_ctrl'
gpio-en7523.c:27: warning: Excess struct member 'dir0' description in 'airoha_gpio_ctrl'
gpio-en7523.c:27: warning: Excess struct member 'dir1' description in 'airoha_gpio_ctrl'

Fixes: 0868ad385a ("gpio: Add support for Airoha EN7523 GPIO controller")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-01-15 23:15:35 +01:00
Alexandre Belloni
83c0711453 rtc: rv8803: add wakeup-source support
The RV8803 can be wired directly to a PMIC that can wake up an SoC without
the CPU getting interrupts.

Link: https://lore.kernel.org/r/20240108004357.602918-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2024-01-15 22:29:48 +01:00
Randy Dunlap
eea7615b68 rtc: ac100: remove misuses of kernel-doc
Prevent kernel-doc warnings by changing "/**" to common comment
format "/*" in non-kernel-doc comments:

drivers/rtc/rtc-ac100.c:103: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
 * Clock controls for 3 clock output pins
drivers/rtc/rtc-ac100.c:382: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
 * RTC related bits

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc:  <linux-rtc@vger.kernel.org>
Link: https://lore.kernel.org/r/20240114231320.31437-1-rdunlap@infradead.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2024-01-15 22:27:35 +01:00
Bjorn Helgaas
7119ca35ee Merge branch 'pci/misc'
- Drop unused struct pci_driver.node member (Mathias Krause)

- Fix documentation typos (Attreyee Mukherjee)

- Use a unique test pattern for each BAR in the pci_endpoint_test to make
  it easier to debug address translation issues (Niklas Cassel)

- Fix kernel-doc issues (Bjorn Helgaas)

* pci/misc:
  PCI: Fix kernel-doc issues
  misc: pci_endpoint_test: Use a unique test pattern for each BAR
  docs: PCI: Fix typos
  PCI: Remove unused 'node' member from struct pci_driver
2024-01-15 12:10:41 -06:00
Bjorn Helgaas
9946bbb3ed Merge branch 'pci/dt-bindings'
- Increase qcom iommu-map maxItems to accommodate SDX55 (five entries) and
  SDM845 (sixteen entries) (Krzysztof Kozlowski)

- Describe qcom,pcie-sc8180x clocks and resets accurately (Krzysztof
  Kozlowski)

- Describe qcom,pcie-sm8150 clocks and resets accurately (Krzysztof
  Kozlowski)

- Correct the qcom "reset-name" property, previously incorrectly called
  "reset-names" (Krzysztof Kozlowski)

- Document rockchip optional PCIe reference clock input (Heiko Stuebner)

- Document qcom,pcie-sm8650, based on qcom,pcie-sm8550 (Neil Armstrong)

* pci/dt-bindings:
  dt-bindings: PCI: qcom: Document the SM8650 PCIe Controller
  dt-bindings: PCI: dwc: rockchip: Document optional PCIe reference clock input
  dt-bindings: PCI: qcom: Correct reset-names property
  dt-bindings: PCI: qcom: Correct clocks for SM8150
  dt-bindings: PCI: qcom: Correct clocks for SC8180x
  dt-bindings: PCI: qcom: Adjust iommu-map for different SoC
2024-01-15 12:10:41 -06:00
Bjorn Helgaas
eddcaefa5f Merge branch 'pci/remove-old-api'
- In dw-xdata-pcie, pci_endpoint_test, and vmd, replace usage of deprecated
  ida_simple_*() API with ida_alloc() and ida_free() (Christophe JAILLET)

* pci/remove-old-api:
  dw-xdata: Remove usage of the deprecated ida_simple_*() API
  misc: pci_endpoint_test: Remove usage of the deprecated ida_simple_*() API
  PCI: vmd: Remove usage of the deprecated ida_simple_*() API
2024-01-15 12:10:41 -06:00
Bjorn Helgaas
d43e4239f0 Merge branch 'pci/endpoint'
- Make struct pci_epc_event_ops and struct pci_epf_ops instances const
  (Lars-Peter Clausen)

* pci/endpoint:
  PCI: endpoint: pci-epf-test: Make struct pci_epf_ops const
  PCI: endpoint: pci-epf-vntb: Make struct pci_epf_ops const
  PCI: endpoint: pci-epf-ntb: Make struct pci_epf_ops const
  PCI: endpoint: pci-epf-mhi: Make structs pci_epf_ops and pci_epf_event_ops const
  PCI: endpoint: Make struct pci_epf_ops in pci_epf_driver const
2024-01-15 12:10:40 -06:00
Bjorn Helgaas
dc14155d46 Merge branch 'pci/irq-clean-up'
- Rename PCI_IRQ_LEGACY to PCI_IRQ_INTX to be more explicit and match spec
  terminology (Bjorn Helgaas)

- Use existing PCI_IRQ_INTX, PCI_IRQ_MSI, PCI_IRQ_MSIX in artpec6, cadence,
  designware, designware-plat, dra7xx, imx6, keembay, keystone, layerscape,
  mhi, ntb, qcom, rcar, rcar-gen4, rockchip, tegra194, uniphier, vntb; drop
  the redundant pci_epc_irq_type enum with the same values (Damien Le Moal)

- Use "intx" instead of "leg" or "legacy" when describing INTx interrupts
  in endpoint core, endpoint tests, cadence, dra7xx, designware,
  dw-rockchip, dwc core, imx6, keystone, layerscape, qcom, rcar-gen4,
  rockchip, tegra194, uniphier, xilinx-nwl (Damien Le Moal)

* pci/irq-clean-up:
  PCI: xilinx-nwl: Use INTX instead of legacy
  PCI: rockchip-host: Rename rockchip_pcie_legacy_int_handler()
  PCI: rockchip-ep: Use INTX instead of legacy
  PCI: uniphier: Use INTX instead of legacy
  PCI: tegra194: Use INTX instead of legacy
  PCI: dw-rockchip: Rename rockchip_pcie_legacy_int_handler()
  PCI: keystone: Use INTX instead of legacy
  PCI: dwc: Rename dw_pcie_ep_raise_legacy_irq()
  PCI: cadence: Use INTX instead of legacy
  PCI: dra7xx: Rename dra7xx_pcie_raise_legacy_irq()
  misc: pci_endpoint_test: Use INTX instead of LEGACY
  PCI: endpoint: Rename LEGACY to INTX in test function driver
  PCI: endpoint: Use INTX instead of legacy
  PCI: endpoint: Drop PCI_EPC_IRQ_XXX definitions
  PCI: Rename PCI_IRQ_LEGACY to PCI_IRQ_INTX
2024-01-15 12:10:40 -06:00
Bjorn Helgaas
eb30ad4141 Merge branch 'pci/controller/remove-void-return'
- Convert exynos, keystone, kirin from .remove() to .remove_new(), which
  returns void instead of int (Uwe Kleine-König)

* pci/controller/remove-void-return:
  PCI: kirin: Convert to platform remove callback returning void
  PCI: keystone: Convert to platform remove callback returning void
  PCI: exynos: Convert to platform remove callback returning void
2024-01-15 12:10:40 -06:00
Bjorn Helgaas
fd286a1de5 Merge branch 'pci/controller/xilinx'
- Remove redundant dev_err(), since platform_get_irq() and
  platform_get_irq_byname() already log errors (Yang Li)

- Fix uninitialized symbols in xilinx_pl_dma_pcie_setup_irq() (Krzysztof
  Wilczyński)

- Fix xilinx_pl_dma_pcie_init_irq_domain() error return when
  irq_domain_add_linear() fails (Harshit Mogalapalli)

* pci/controller/xilinx:
  PCI: xilinx-xdma: Fix error code in xilinx_pl_dma_pcie_init_irq_domain()
  PCI: xilinx-xdma: Fix uninitialized symbols in xilinx_pl_dma_pcie_setup_irq()
  PCI: xilinx-xdma: Remove redundant dev_err()
2024-01-15 12:10:39 -06:00
Bjorn Helgaas
161d42df9a Merge branch 'pci/controller/vmd'
- Use ida_alloc() instead of deprecated ida_simple_get() (Christophe JAILLET)

* pci/controller/vmd:
  PCI: vmd: Remove usage of the deprecated ida_simple_xx() API
2024-01-15 12:10:39 -06:00
Bjorn Helgaas
67b9ef22c6 Merge branch 'pci/controller/rcar'
- Replace of_device.h with explicit of.h include to untangle header usage
  (Rob Herring)

- Add DT and driver support for optional miniPCIe 1.5v and 3.3v regulators
  on KingFisher (Wolfram Sang)

* pci/controller/rcar:
  PCI: rcar-host: Add support for optional regulators
  dt-bindings: PCI: rcar-pci-host: Add optional regulators
  PCI: rcar-gen4: Replace of_device.h with explicit of.h include
2024-01-15 12:10:38 -06:00
Bjorn Helgaas
1b6069f51e Merge branch 'pci/controller/mediatek'
- Clear MSI interrupt status before handler to avoid missing MSIs that
  occur after the handler (qizhong cheng)

- Update mediatek-gen3 translation window setup to handle MMIO space that
  is not a power of two in size (Jianjun Wang)

* pci/controller/mediatek:
  PCI: mediatek-gen3: Fix translation window size calculation
  PCI: mediatek: Clear interrupt status before dispatching handler
2024-01-15 12:10:38 -06:00
Bjorn Helgaas
1800c660b0 Merge branch 'pci/controller/layerscape'
- Add suspend/resume support for Layerscape LS1043a, including
  software-managed PME_Turn_Off and transitions between L0, L2/L3_Ready
  Link states (Frank Li)

* pci/controller/layerscape:
  PCI: layerscape: Add suspend/resume for ls1043a
  PCI: layerscape(ep): Rename pf_* as pf_lut_*
  PCI: layerscape: Add suspend/resume for ls1021a
  PCI: layerscape: Add function pointer for exit_from_l2()
2024-01-15 12:10:38 -06:00
Bjorn Helgaas
921e097ede Merge branch 'pci/controller/kirin'
- Use devm_kasprintf() to dynamically allocate clock names, removing need
  for an intermediate buffer (Christophe JAILLET)

* pci/controller/kirin:
  PCI: kirin: Use devm_kasprintf() to dynamically allocate clock names
2024-01-15 12:10:37 -06:00
Bjorn Helgaas
186ce88c90 Merge branch 'pci/controller/keystone'
- Hold power management references to all PHYs while enabling them to avoid
  a race when one provides clocks to others (Siddharth Vadapalli)

* pci/controller/keystone:
  PCI: keystone: Fix race condition when initializing PHYs
2024-01-15 12:10:37 -06:00
Bjorn Helgaas
787c72b1d4 Merge branch 'pci/controller/dwc'
- Convert fu740 CONFIG_PCIE_FU740 dependency from SOC_SIFIVE to ARCH_SIFIVE
  (Conor Dooley)

- Align iATU mapping for endpoint MSI-X (Niklas Cassel)

- Drop "host_" prefix from struct dw_pcie_host_ops members (Yoshihiro
  Shimoda)

- Drop "ep_" prefix from struct dw_pcie_ep_ops members (Yoshihiro Shimoda)

- Rename struct dw_pcie_ep_ops.func_conf_select() to .get_dbi_offset() to
  be more descriptive (Yoshihiro Shimoda)

- Add Endpoint DBI accessors to encapsulate offset lookups (Yoshihiro
  Shimoda)

- Cast iproc and rcar-gen4 of_device_get_match_data() results to uintptr_t
  to avoid clang "cast to smaller integer type" warnings (Justin Stitt,
  Yoshihiro Shimoda)

* pci/controller/dwc:
  PCI: rcar-gen4: Fix -Wvoid-pointer-to-enum-cast error
  PCI: iproc: Fix -Wvoid-pointer-to-enum-cast warning
  PCI: dwc: Add dw_pcie_ep_{read,write}_dbi[2] helpers
  PCI: dwc: Rename .func_conf_select to .get_dbi_offset in struct dw_pcie_ep_ops
  PCI: dwc: Rename .ep_init to .init in struct dw_pcie_ep_ops
  PCI: dwc: Drop host prefix from struct dw_pcie_host_ops members
  PCI: dwc: endpoint: Fix dw_pcie_ep_raise_msix_irq() alignment support
  PCI: dwc: Convert SOC_SIFIVE to ARCH_SIFIVE
2024-01-15 12:10:37 -06:00
Bjorn Helgaas
78fe51fcb4 Merge branch 'pci/controller/cadence'
- Add j721e DT and driver support for 'num-lanes' for devices that support
  x1, x2, or x4 Links (Matt Ranostay)

- Add j721e DT compatible strings and driver support for j784s4 (Matt Ranostay)

- Make TI J721E Kconfig depend on ARCH_K3 since the hardware is specific to
  those TI SoC parts (Peter Robinson)

* pci/controller/cadence:
  PCI: j721e: Make TI J721E depend on ARCH_K3
  PCI: j721e: Add TI J784S4 PCIe configuration
  PCI: j721e: Add PCIe 4x lane selection support
  PCI: j721e: Add per platform maximum lane settings
  dt-bindings: PCI: ti,j721e-pci-*: Add j784s4-pci-* compatible strings
  dt-bindings: PCI: ti,j721e-pci-*: Add checks for num-lanes
2024-01-15 12:10:36 -06:00
Bjorn Helgaas
6f77f0ac5e Merge branch 'pci/controller/broadcom'
- Add DT property "brcm,clkreq-mode" and driver support for different
  CLKREQ# modes (Jim Quinlan)

* pci/controller/broadcom:
  PCI: brcmstb: Configure HW CLKREQ# mode appropriate for downstream device
  dt-bindings: PCI: brcmstb: Add property "brcm,clkreq-mode"
2024-01-15 12:10:36 -06:00
Bjorn Helgaas
c94df62146 Merge branch 'pci/virtualization'
- Add ACS quirk for more Zhaoxin Root Ports (LeoLiuoc)

* pci/virtualization:
  PCI: Add ACS quirk for more Zhaoxin Root Ports
2024-01-15 12:10:36 -06:00
Bjorn Helgaas
d6f5bcc2d0 Merge branch 'pci/switchtec'
- Do dma_mrpc cleanup during switchtec_pci_remove() to match its devm
  ioremapping in switchtec_pci_probe().  Previously the cleanup was done in
  stdev_release(), which used stale pointers if stdev->cdev happened to be
  open when the PCI device was removed (Daniel Stodden)

* pci/switchtec:
  PCI: switchtec: Fix stdev_release() crash after surprise hot remove
2024-01-15 12:10:35 -06:00
Bjorn Helgaas
5a4af2ca48 Merge branch 'pci/resource'
- Restructure pci_dev_for_each_resource() to avoid computing the address of
  an out-of-bounds array element (the bounds check was performed later so
  the element was never actually *read*, but it's nicer to avoid even
  computing an out-of-bounds address) (Andy Shevchenko)

* pci/resource:
  PCI: Avoid potential out-of-bounds read in pci_dev_for_each_resource()
2024-01-15 12:10:35 -06:00
Bjorn Helgaas
18c3850f31 Merge branch 'pci/p2pdma'
- Remove documentation for obsolete pci_p2pdma_map_sg() (Tadeusz Struk)

* pci/p2pdma:
  PCI/P2PDMA: Remove reference to pci_p2pdma_map_sg()
2024-01-15 12:10:35 -06:00
Bjorn Helgaas
564af7a536 Merge branch 'pci/enumeration-logging'
- Log device type (Root Port, Switch Port, etc) during enumeration (Bjorn
  Helgaas)

- Log resource names (BAR 0, VF BAR 0, bridge window, etc) consistently
  instead of a mix of names and "reg 0x10" (Puranjay Mohan, Bjorn Helgaas)

- Log bridges before devices below the bridges (Bjorn Helgaas)

* pci/enumeration-logging:
  PCI: Log bridge info when first enumerating bridge
  PCI: Log bridge windows conditionally
  PCI: Supply bridge device, not secondary bus, to read window details
  PCI: Move pci_read_bridge_windows() below individual window accessors
  PCI: Use resource names in PCI log messages
  PCI: Update BAR # and window messages
  PCI: Log device type during enumeration
2024-01-15 12:10:34 -06:00
Bjorn Helgaas
78e5ad791f Merge branch 'pci/enumeration'
- Convert pci-host-common.c platform .remove() callback to .remove_new()
  returning 'void' since it's not useful to return error codes here (Uwe
  Kleine-König)

- Log a message about updating AMD USB controller class code (so dwc3, not
  xhci, claims it) only when we actually change it (Guilherme G.  Piccoli)

- Use PCI_HEADER_TYPE_* instead of literals in x86, powerpc, SCSI lpfc
  (Ilpo Järvinen)

- Clean up open-coded PCIBIOS return code mangling (Ilpo Järvinen)

- Fix 64GT/s effective data rate calculation to use 1b/1b encoding rather
  than the 8b/10b or 128b/130b used by lower rates (Ilpo Järvinen)

* pci/enumeration:
  PCI: Fix 64GT/s effective data rate calculation
  x86/pci: Clean up open-coded PCIBIOS return code mangling
  scsi: lpfc: Use PCI_HEADER_TYPE_MFD instead of literal
  powerpc/fsl-pci: Use PCI_HEADER_TYPE_MASK instead of literal
  x86/pci: Use PCI_HEADER_TYPE_* instead of literals
  PCI: Only override AMD USB controller if required
  PCI: host-generic: Convert to platform remove callback returning void
2024-01-15 12:10:34 -06:00
Bjorn Helgaas
996e337f4d Merge branch 'pci/ecam'
- Reserve ECAM if BIOS didn't include it in PNP0C02 _CRS (Bjorn Helgaas)

- Add MMCONFIG/ECAM debug logging (Bjorn Helgaas)

- Rename 'MMCONFIG' to 'ECAM' to match spec usage (Bjorn Helgaas)

* pci/ecam:
  x86/pci: Reorder pci_mmcfg_arch_map() definition before calls
  x86/pci: Return pci_mmconfig_add() failure early
  x86/pci: Comment pci_mmconfig_insert() obscure MCFG dependency
  x86/pci: Rename pci_mmcfg_check_reserved() to pci_mmcfg_reserved()
  x86/pci: Rename acpi_mcfg_check_entry() to acpi_mcfg_valid_entry()
  x86/pci: Rename 'MMCONFIG' to 'ECAM', use pr_fmt
  x86/pci: Add MCFG debug logging
  x86/pci: Reword ECAM EfiMemoryMappedIO logging to avoid 'reserved'
  x86/pci: Reserve ECAM if BIOS didn't include it in PNP0C02 _CRS
2024-01-15 12:10:34 -06:00
Bjorn Helgaas
f04e5285ef Merge branch 'pci/aer'
- Log AER errors as "Correctable" (not "Corrected") or "Uncorrectable" to
  match spec terminology (Bjorn Helgaas)

- Decode Requester ID when no error info found instead of printing the raw
  hex value (Bjorn Helgaas)

* pci/aer:
  PCI/AER: Use explicit register sizes for struct members
  PCI/AER: Decode Requester ID when no error info found
  PCI/AER: Use 'Correctable' and 'Uncorrectable' spec terms for errors
2024-01-15 12:10:33 -06:00
Bjorn Helgaas
2db6b72c98 PCI: Fix kernel-doc issues
Fix kernel-doc issues reported by
"find include -name \*pci\* | xargs scripts/kernel-doc -none":

  include/linux/pci.h:731: warning: Function parameter or member 'pdev' not described in 'pci_is_vga'
  include/linux/pci-epc.h:154: warning: Function parameter or member 'list_lock' not described in 'pci_epc'
  include/linux/pci-epf.h:83: warning: expecting prototype for struct pci_epf_event_ops. Prototype was for struct pci_epc_event_ops instead

Link: https://lore.kernel.org/r/20240111162850.2177655-1-helgaas@kernel.org
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Sui Jingfeng <suijingfeng@loongson.cn>
2024-01-15 12:09:41 -06:00
Lukas Wunner
832b371097 gpiolib: Fix scope-based gpio_device refcounting
Commit 9e4555d1e5 ("gpiolib: add support for scope-based management to
gpio_device") sought to add scope-based gpio_device refcounting, but
erroneously forgot a negation of IS_ERR_OR_NULL().

As a result, gpio_device_put() is not called if the gpio_device pointer
is valid (meaning the ref is leaked), but only called if the pointer is
NULL or an ERR_PTR().

While at it drop a superfluous trailing semicolon.

Fixes: 9e4555d1e5 ("gpiolib: add support for scope-based management to gpio_device")
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-01-15 18:41:29 +01:00
Su Hui
d460e9c207 gpio: mlxbf3: add an error code check in mlxbf3_gpio_probe
Clang static checker warning: Value stored to 'ret' is never read.
bgpio_init() returns error code if failed, it's better to add this
check.

Fixes: cd33f216d2 ("gpio: mlxbf3: Add gpio driver support")
Signed-off-by: Su Hui <suhui@nfschina.com>
[Bartosz: add the Fixes: tag]
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-01-15 11:11:29 +01:00
Michal Simek
314c020c4e dt-bindings: gpio: xilinx: Fix node address in gpio
Node address doesn't match reg property which is not correct.

Fixes: ba96b2e797 ("dt-bindings: gpio: gpio-xilinx: Convert Xilinx axi gpio binding to YAML")
Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-01-15 11:09:42 +01:00
Dan Carpenter
c8fb5a52b9 gpio: rtd: Fix signedness bug in probe
The "data->irqs[]" array holds unsigned int so this error handling will
not work correctly.

Fixes: eee636bff0 ("gpio: rtd: Add support for Realtek DHC(Digital Home Center) RTD SoCs")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-01-15 11:07:46 +01:00
Randy Dunlap
7c65aa3cc0 dma-debug: fix kernel-doc warnings
Update the kernel-doc comments to catch up with the code changes and
fix the kernel-doc warnings:

debug.c:83: warning: Excess struct member 'stacktrace' description in 'dma_debug_entry'
debug.c:83: warning: Function parameter or struct member 'stack_len' not described in 'dma_debug_entry'
debug.c:83: warning: Function parameter or struct member 'stack_entries' not described in 'dma_debug_entry'

Fixes: 746017ed8d ("dma/debug: Simplify stracktrace retrieval")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: iommu@lists.linux.dev
Signed-off-by: Christoph Hellwig <hch@lst.de>
2024-01-15 08:20:39 +01:00
Dave Airlie
205e18c135 nouveau/gsp: handle engines in runl without nonstall interrupts.
It appears on TU106 GPUs (2070), that some of the nvdec engines
are in the runlist but have no valid nonstall interrupt, nouveau
didn't handle that too well.

This should let nouveau/gsp work on those.

Cc: stable@vger.kernel.org # v6.7+
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://lore.kernel.org/all/20240110011826.3996289-1-airlied@gmail.com/
2024-01-15 16:04:48 +10:00