All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6.6 000/583] 6.6.14-rc1 review
@ 2024-01-22 23:50 Greg Kroah-Hartman
  2024-01-22 23:50 ` [PATCH 6.6 001/583] x86/lib: Fix overflow when counting digits Greg Kroah-Hartman
                   ` (589 more replies)
  0 siblings, 590 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:50 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, linux-kernel, torvalds, akpm, linux,
	shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
	sudipm.mukherjee, srw, rwarsow, conor, allen.lkml

This is the start of the stable review cycle for the 6.6.14 release.
There are 583 patches in this series, all will be posted as a response
to this one.  If anyone has any issues with these being applied, please
let me know.

Responses should be made by Wed, 24 Jan 2024 23:56:49 +0000.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.14-rc1.gz
or in the git tree and branch at:
	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.6.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Linux 6.6.14-rc1

Alexandre Ghiti <alexghiti@rivosinc.com>
    riscv: Fix wrong usage of lm_alias() when splitting a huge linear mapping

Marek Szyprowski <m.szyprowski@samsung.com>
    i2c: s3c24xx: fix transferring more than one message in polling mode

Marek Szyprowski <m.szyprowski@samsung.com>
    i2c: s3c24xx: fix read transfers in polling mode

Nikita Zhandarovich <n.zhandarovich@fintech.ru>
    ipv6: mcast: fix data-race in ipv6_mc_down / mld_ifc_work

Amit Cohen <amcohen@nvidia.com>
    selftests: mlxsw: qos_pfc: Adjust the test to support 8 lanes

Petr Machata <petrm@nvidia.com>
    mlxsw: spectrum_router: Register netdevice notifier before nexthop

Ido Schimmel <idosch@nvidia.com>
    mlxsw: spectrum_acl_tcam: Fix stack corruption

Ido Schimmel <idosch@nvidia.com>
    mlxsw: spectrum_acl_tcam: Fix NULL pointer dereference in error path

Amit Cohen <amcohen@nvidia.com>
    mlxsw: spectrum_acl_erp: Fix error flow of pool allocation failure

Christoph Hellwig <hch@lst.de>
    loop: fix the the direct I/O support check when used on top of block devices

Ludvig Pärsson <ludvig.parsson@axis.com>
    ethtool: netlink: Add missing ethnl_ops_begin/complete

Mark Brown <broonie@kernel.org>
    arm64/ptrace: Don't flush ZA/ZT storage when writing ZA via ptrace

Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    kdb: Fix a potential buffer overflow in kdb_local()

Pavel Begunkov <asml.silence@gmail.com>
    io_uring: adjust defer tw counting

Fedor Pchelkin <pchelkin@ispras.ru>
    ipvs: avoid stat macros calls from preemptible context

Pablo Neira Ayuso <pablo@netfilter.org>
    netfilter: nf_tables: reject NFT_SET_CONCAT with not field length description

Pablo Neira Ayuso <pablo@netfilter.org>
    netfilter: nf_tables: skip dead set elements in netlink dump

Pablo Neira Ayuso <pablo@netfilter.org>
    netfilter: nf_tables: do not allow mismatch field size and set key length

Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
    netfilter: bridge: replace physindev with physinif in nf_bridge_info

Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
    netfilter: propagate net to nf_bridge_get_physindev

Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
    netfilter: nf_queue: remove excess nf_bridge variable

Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
    netfilter: nfnetlink_log: use proper helper for fetching physinif

Pablo Neira Ayuso <pablo@netfilter.org>
    netfilter: nft_limit: do not ignore unsupported flags

Pablo Neira Ayuso <pablo@netfilter.org>
    netfilter: nf_tables: reject invalid set policy

Jakub Kicinski <kuba@kernel.org>
    net: netdevsim: don't try to destroy PHC on VFs

Paolo Abeni <pabeni@redhat.com>
    mptcp: relax check on MPC passive fallback

Hengqi Chen <hengqi.chen@gmail.com>
    LoongArch: BPF: Prevent out-of-bounds memory access

Kunwu Chan <chentao@kylinos.cn>
    net: dsa: vsc73xx: Add null pointer check to vsc73xx_gpio_probe

Hao Sun <sunhao.th@gmail.com>
    bpf: Reject variable offset alu on PTR_TO_FLOW_KEYS

Qiang Ma <maqianga@uniontech.com>
    net: stmmac: ethtool: Fixed calltrace caused by unbalanced disable_irq_wake calls

Benjamin Poirier <bpoirier@nvidia.com>
    selftests: bonding: Change script interpreter

Alex Deucher <alexander.deucher@amd.com>
    drm/amdgpu: fall back to INPUT power for AVG power via INFO IOCTL

Dafna Hirschfeld <dhirschfeld@habana.ai>
    drm/amdkfd: fixes for HMM mem allocation

Kai Vehmanen <kai.vehmanen@linux.intel.com>
    ASoC: SOF: ipc4-loader: remove the CPC check warnings

Su Hui <suhui@nfschina.com>
    gpio: mlxbf3: add an error code check in mlxbf3_gpio_probe

Michal Simek <michal.simek@amd.com>
    dt-bindings: gpio: xilinx: Fix node address in gpio

Nikita Yushchenko <nikita.yoush@cogentembedded.com>
    net: ravb: Fix dma_addr_t truncation in error case

John Fastabend <john.fastabend@gmail.com>
    net: tls, fix WARNIING in __sk_msg_free

Martin KaFai Lau <martin.lau@kernel.org>
    bpf: Avoid iter->offset making backward progress in bpf_iter_udp

Martin KaFai Lau <martin.lau@kernel.org>
    bpf: iter_udp: Retry with a larger batch size without going back to the previous bucket

Marc Kleine-Budde <mkl@pengutronix.de>
    net: netdev_queue: netdev_txq_completed_mb(): fix wake condition

Eric Dumazet <edumazet@google.com>
    net: add more sanity check in virtio_net_hdr_to_skb()

Gao Xiang <xiang@kernel.org>
    erofs: fix inconsistent per-file compression format

Gao Xiang <xiang@kernel.org>
    erofs: simplify compression configuration parser

Eric Dumazet <edumazet@google.com>
    udp: annotate data-races around up->pending

Sneh Shah <quic_snehshah@quicinc.com>
    net: stmmac: Fix ethool link settings ops for integrated PCS

Jens Axboe <axboe@kernel.dk>
    block: ensure we hold a queue reference when using queue limits

Eric Dumazet <edumazet@google.com>
    mptcp: refine opt_mp_capable determination

Eric Dumazet <edumazet@google.com>
    mptcp: use OPTION_MPTCP_MPJ_SYN in subflow_check_req()

Eric Dumazet <edumazet@google.com>
    mptcp: use OPTION_MPTCP_MPJ_SYNACK in subflow_finish_connect()

Eric Dumazet <edumazet@google.com>
    mptcp: strict validation before using mp_opt->hmac

Eric Dumazet <edumazet@google.com>
    mptcp: mptcp_parse_option() fix for MPTCPOPT_MP_JOIN

Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
    ALSA: hda: Properly setup HDMI stream

Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
    net: phy: micrel: populate .soft_reset for KSZ9131

Horatiu Vultur <horatiu.vultur@microchip.com>
    net: micrel: Fix PTP frame parsing for lan8841

Taehee Yoo <ap420073@gmail.com>
    amt: do not use overwrapped cb area

Sanjuán García, Jorge <Jorge.SanjuanGarcia@duagon.com>
    net: ethernet: ti: am65-cpsw: Fix max mtu to fit ethernet frames

Nithin Dabilpuram <ndabilpuram@marvell.com>
    octeontx2-af: CN10KB: Fix FIFO length calculation for RPM2

David Howells <dhowells@redhat.com>
    rxrpc: Fix use of Don't Fragment flag

Lin Ma <linma@zju.edu.cn>
    net: qualcomm: rmnet: fix global oob in rmnet_policy

Niklas Schnelle <schnelle@linux.ibm.com>
    s390/pci: fix max size calculation in zpci_memcpy_toio()

AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    ASoC: mediatek: sof-common: Add NULL check for normal_link string

Jianjun Wang <jianjun.wang@mediatek.com>
    PCI: mediatek-gen3: Fix translation window size calculation

Siddharth Vadapalli <s-vadapalli@ti.com>
    PCI: keystone: Fix race condition when initializing PHYs

Maurizio Lombardi <mlombard@redhat.com>
    nvmet-tcp: Fix the H2C expected PDU len calculation

Arnd Bergmann <arnd@arndb.de>
    nvme: trace: avoid memcpy overflow warning

Arnd Bergmann <arnd@arndb.de>
    nvmet: re-fix tracing strncpy() warning

Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
    hisi_acc_vfio_pci: Update migration data pointer correctly on saving/resume

Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    spi: coldfire-qspi: Remove an erroneous clk_disable_unprepare() from the remove function

Dan Williams <dan.j.williams@intel.com>
    cxl/port: Fix missing target list lock

Ben Gainey <ben.gainey@arm.com>
    perf db-export: Fix missing reference count get in call_path_from_sample()

Sam Ravnborg <sam@ravnborg.org>
    serial: apbuart: fix console prompt on qemu

Christoph Niedermaier <cniedermaier@dh-electronics.com>
    serial: imx: Correct clock error message in function probe()

Chunfeng Yun <chunfeng.yun@mediatek.com>
    usb: xhci-mtk: fix a short packet issue of gen1 isoc-in transfer

Fedor Pchelkin <pchelkin@ispras.ru>
    apparmor: avoid crash when parsed profile name is empty

Fedor Pchelkin <pchelkin@ispras.ru>
    apparmor: fix possible memory leak in unpack_trans_table

Jim Harris <jim.harris@samsung.com>
    cxl/region: fix x9 interleave typo

Ian Rogers <irogers@google.com>
    perf stat: Fix hard coded LL miss units

Ian Rogers <irogers@google.com>
    perf env: Avoid recursively taking env->bpf_progs.lock

Maurizio Lombardi <mlombard@redhat.com>
    nvmet-tcp: fix a crash in nvmet_req_complete()

Maurizio Lombardi <mlombard@redhat.com>
    nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length

John Johansen <john.johansen@canonical.com>
    apparmor: Fix ref count leak in task_kill

Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    vdpa: Fix an error handling path in eni_vdpa_probe()

Kunwu Chan <chentao@kylinos.cn>
    power: supply: Fix null pointer dereference in smb2_probe

Ashish Mhetre <amhetre@nvidia.com>
    iommu: Don't reserve 0-length IOVA region

Andrzej Pietrasiewicz <andrzej.p@collabora.com>
    usb: gadget: webcam: Make g_webcam loadable again

Nícolas F. R. A. Prado <nfraprado@collabora.com>
    spmi: mtk-pmif: Serialize PMIF status check and command submission

Douglas Anderson <dianders@chromium.org>
    usb: core: Fix crash w/ usb_choose_configuration() if no driver

Oliver Neukum <oneukum@suse.com>
    usb: cdc-acm: return correct error code on unsupported break

Jiri Slaby (SUSE) <jirislaby@kernel.org>
    tty: use 'if' in send_break() instead of 'goto'

Jiri Slaby (SUSE) <jirislaby@kernel.org>
    tty: don't check for signal_pending() in send_break()

Jiri Slaby (SUSE) <jirislaby@kernel.org>
    tty: early return from send_break() on TTY_DRIVER_HARDWARE_BREAK

Manivannan Sadhasivam <mani@kernel.org>
    PCI: epf-mhi: Fix the DMA data direction of dma_unmap_single()

Manivannan Sadhasivam <mani@kernel.org>
    bus: mhi: ep: Pass mhi_ep_buf_info struct to read/write APIs

Manivannan Sadhasivam <mani@kernel.org>
    bus: mhi: ep: Use slab allocator where applicable

Manivannan Sadhasivam <mani@kernel.org>
    bus: mhi: ep: Do not allocate event ring element on stack

Namhyung Kim <namhyung@kernel.org>
    perf unwind-libunwind: Fix base address for .eh_frame

Namhyung Kim <namhyung@kernel.org>
    perf unwind-libdw: Handle JIT-generated DSOs properly

Namhyung Kim <namhyung@kernel.org>
    perf genelf: Set ELF program header addresses properly

Yicong Yang <yangyicong@hisilicon.com>
    perf hisi-ptt: Fix one memory leakage in hisi_ptt_process_auxtrace_event()

Yicong Yang <yangyicong@hisilicon.com>
    perf header: Fix one memory leakage in perf_event__fprintf_event_update()

Nuno Sa <nuno.sa@analog.com>
    iio: adc: ad9467: fix scale setting

Nuno Sa <nuno.sa@analog.com>
    iio: adc: ad9467: add mutex to struct ad9467_state

Nuno Sa <nuno.sa@analog.com>
    iio: adc: ad9467: don't ignore error codes

Nuno Sa <nuno.sa@analog.com>
    iio: adc: ad9467: fix reset gpio handling

Zhao Mengmeng <zhaomengmeng@kylinos.cn>
    selftests/sgx: Skip non X86_64 platform

Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
    selftests/sgx: Include memory clobber for inline asm in test enclave

Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
    selftests/sgx: Fix uninitialized pointer dereferences in encl_get_entry

Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
    selftests/sgx: Fix uninitialized pointer dereference in error path

Paul Geurts <paul_geurts@live.nl>
    serial: imx: fix tx statemachine deadlock

Sakari Ailus <sakari.ailus@linux.intel.com>
    software node: Let args be NULL in software_node_get_reference_args

Sakari Ailus <sakari.ailus@linux.intel.com>
    acpi: property: Let args be NULL in __acpi_node_get_property_reference

Gregory Price <gourry.memverge@gmail.com>
    base/node.c: initialize the accessor list before registering

Ian Rogers <irogers@google.com>
    perf stat: Exit perf stat if parse groups fails

Kan Liang <kan.liang@linux.intel.com>
    perf mem: Fix error on hybrid related to availability of mem event in a PMU

Ilkka Koskinen <ilkka@os.amperecomputing.com>
    perf vendor events arm64 AmpereOne: Rename BPU_FLUSH_MEM_FAULT to GPC_FLUSH_MEM_FAULT

Brett Creeley <brett.creeley@amd.com>
    vfio/pds: Fix calculations in pds_vfio_dirty_sync

Veronika Molnarova <vmolnaro@redhat.com>
    perf test record user-regs: Fix mask for vg register

Douglas Anderson <dianders@chromium.org>
    r8152: Choose our USB config with choose_configuration() rather than probe()

Douglas Anderson <dianders@chromium.org>
    usb: core: Allow subclassed USB drivers to override usb_choose_configuration()

Arnaldo Carvalho de Melo <acme@redhat.com>
    libapi: Add missing linux/types.h header to get the __u64 type on io.h

Adrian Hunter <adrian.hunter@intel.com>
    perf header: Fix segfault on build_mem_topology() error path

Nick Forrington <nick.forrington@arm.com>
    perf test: Remove atomics from test_loop to avoid test failures

Laurentiu Tudor <laurentiu.tudor@nxp.com>
    iommu: Map reserved memory as cacheable if device is coherent

Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    serial: 8250: omap: Don't skip resource freeing if pm_runtime_resume_and_get() failed

Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    PCI: Avoid potential out-of-bounds read in pci_dev_for_each_resource()

Su Hui <suhui@nfschina.com>
    power: supply: bq256xx: fix some problem in bq256xx_hw_init

Jan Palus <jpalus@fastmail.com>
    power: supply: cw2015: correct time_to_empty units in sysfs

Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    MIPS: Alchemy: Fix an out-of-bound access in db1550_dev_setup()

Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    MIPS: Alchemy: Fix an out-of-bound access in db1200_dev_setup()

Frederik Haxel <haxel@fzi.de>
    riscv: Fixed wrong register in XIP_FIXUP_FLASH_OFFSET macro

Alexandre Ghiti <alexghiti@rivosinc.com>
    riscv: Fix set_direct_map_default_noflush() to reset _PAGE_EXEC

Alexandre Ghiti <alexghiti@rivosinc.com>
    riscv: Fix set_memory_XX() and set_direct_map_XX() by splitting huge linear mappings

Alexandre Ghiti <alexghiti@rivosinc.com>
    riscv: Fix module_alloc() that did not reset the linear mapping permissions

Alexandre Ghiti <alexghiti@rivosinc.com>
    riscv: Check if the code to patch lies in the exit section

Vincent Whitchurch <vincent.whitchurch@axis.com>
    um: virt-pci: fix platform map offset

Serge Semin <fancer.lancer@gmail.com>
    mips: Fix incorrect max_low_pfn adjustment

Serge Semin <fancer.lancer@gmail.com>
    mips: dmi: Fix early remap on MIPS32

Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    srcu: Use try-lock lockdep annotation for NMI-safe access.

Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    mfd: intel-lpss: Fix the fractional clock divider flags

Kunwu Chan <chentao@kylinos.cn>
    mfd: tps6594: Add null pointer check to tps6594_device_init()

Martin Kurbanov <mmkurbanov@salutedevices.com>
    leds: aw200xx: Fix write to DIM parameter

Dang Huynh <danct12@riseup.net>
    leds: aw2013: Select missing dependency REGMAP_I2C

Kunwu Chan <chentao@kylinos.cn>
    mfd: syscon: Fix null pointer dereference in of_syscon_register()

Charles Keepax <ckeepax@opensource.cirrus.com>
    mfd: cs42l43: Correct SoundWire port list

Neil Armstrong <neil.armstrong@linaro.org>
    mfd: rk8xx: fixup devices registration with PLATFORM_DEVID_AUTO

Randy Dunlap <rdunlap@infradead.org>
    ARM: 9330/1: davinci: also select PINCTRL

Hugo Villeneuve <hvilleneuve@dimonoff.com>
    serial: sc16is7xx: set safe default SPI clock frequency

Hugo Villeneuve <hvilleneuve@dimonoff.com>
    serial: sc16is7xx: add check for unsupported SPI modes during probe

Jason Gerecke <jason.gerecke@wacom.com>
    HID: wacom: Correct behavior when processing some confidence == false touches

Yauhen Kharuzhy <jekhor@gmail.com>
    HID: sensor-hub: Enable hid core report processing for all devices

Marcelo Schmitt <marcelo.schmitt@analog.com>
    iio: adc: ad7091r: Pass iio_dev to event handler

Sean Christopherson <seanjc@google.com>
    KVM: x86/pmu: Reset the PMU, i.e. stop counters, before refreshing

Sean Christopherson <seanjc@google.com>
    KVM: x86/pmu: Move PMU reset logic to common x86 code

Oliver Upton <oliver.upton@linux.dev>
    KVM: arm64: vgic-its: Avoid potential UAF in LPI translation cache

Marc Zyngier <maz@kernel.org>
    KVM: arm64: vgic-v4: Restore pending state on host userspace write

Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
    x86/kvm: Do not try to disable kvmclock if it was not enabled

qizhong cheng <qizhong.cheng@mediatek.com>
    PCI: mediatek: Clear interrupt status before dispatching handler

Niklas Cassel <niklas.cassel@wdc.com>
    PCI: dwc: endpoint: Fix dw_pcie_ep_raise_msix_irq() alignment support

Bjorn Helgaas <bhelgaas@google.com>
    x86/pci: Reserve ECAM if BIOS didn't include it in PNP0C02 _CRS

Tadeusz Struk <tstruk@gigaio.com>
    PCI/P2PDMA: Remove reference to pci_p2pdma_map_sg()

Huang Ying <ying.huang@intel.com>
    cxl/port: Fix decoder initialization when nr_targets > interleave_ways

Sean Christopherson <seanjc@google.com>
    Revert "nSVM: Check for reserved encodings of TLB_CONTROL in nested VMCB"

Nicolas Dichtel <nicolas.dichtel@6wind.com>
    Revert "net: rtnetlink: Enslave device before bringing it up"

Petr Tesarik <petr@tesarici.cz>
    net: stmmac: fix ethtool per-queue statistics

David Lin <yu-hao.lin@nxp.com>
    wifi: mwifiex: fix uninitialized firmware_stat

David Lin <yu-hao.lin@nxp.com>
    wifi: mwifiex: configure BSSID consistently when starting AP

David Lin <yu-hao.lin@nxp.com>
    wifi: mwifiex: add extra delay for firmware ready

Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    wifi: rtlwifi: Convert LNKCTL change to PCIe cap RMW accessors

Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    wifi: rtlwifi: Remove bogus and dangerous ASPM disable/enable code

Christian Marangi <ansuelsmth@gmail.com>
    wifi: mt76: fix broken precal loading from MTD for mt7915

Isaac J. Manjarres <isaacmanjarres@google.com>
    iommu/dma: Trace bounce buffer usage when mapping buffers

Rob Clark <robdclark@chromium.org>
    iommu/arm-smmu-qcom: Add missing GMU entry to match table

Jiri Olsa <olsajiri@gmail.com>
    bpf: Fix re-attachment branch in bpf_tracing_prog_attach

Gui-Dong Han <2045gemini@gmail.com>
    Bluetooth: Fix atomicity violation in {min,max}_key_size_set

Stefan Berger <stefanb@linux.ibm.com>
    rootfs: Fix support for rootfstype= when root= is given

Bart Van Assche <bvanassche@acm.org>
    md/raid1: Use blk_opf_t for read and write operations

Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    pwm: Fix out-of-bounds access in of_pwm_single_xlate()

Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    pwm: jz4740: Don't use dev_err_probe() in .request()

Pablo Neira Ayuso <pablo@netfilter.org>
    netfilter: nf_tables: check if catch-all set element is active in next generation

Matthew Wilcox (Oracle) <willy@infradead.org>
    block: Fix iterating over an empty bio with bio_for_each_folio_all

Matthew Wilcox (Oracle) <willy@infradead.org>
    block: Remove special-casing of compound pages

Min Li <min15.li@samsung.com>
    block: add check that partition length needs to be aligned with block size

Mario Limonciello <mario.limonciello@amd.com>
    drm/amd: Enable PCIe PME from D3

Junxiao Bi <junxiao.bi@oracle.com>
    md: bypass block throttle for superblock update

Chandrakanth patil <chandrakanth.patil@broadcom.com>
    scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable State

Chandrakanth patil <chandrakanth.patil@broadcom.com>
    scsi: mpi3mr: Clean up block devices post controller reset

Chandrakanth patil <chandrakanth.patil@broadcom.com>
    scsi: mpi3mr: Refresh sdev queue depth after controller reset

Amir Goldstein <amir73il@gmail.com>
    scsi: target: core: add missing file_{start,end}_write()

Bart Van Assche <bvanassche@acm.org>
    scsi: ufs: core: Simplify power management during async scan

Nam Cao <namcao@linutronix.de>
    fbdev: flush deferred IO before closing

Nam Cao <namcao@linutronix.de>
    fbdev: flush deferred work in fb_deferred_io_fsync()

Thomas Zimmermann <tzimmermann@suse.de>
    fbdev/acornfb: Fix name of fb_ops initializer macro

Jens Axboe <axboe@kernel.dk>
    io_uring: ensure local task_work is run on wait timeout

Jens Axboe <axboe@kernel.dk>
    io_uring/rw: ensure io->bytes_done is always initialized

Pavel Begunkov <asml.silence@gmail.com>
    io_uring: don't check iopoll if request completes

Xi Ruoyao <xry111@xry111.site>
    LoongArch: Fix and simplify fcsr initialization on execve()

Eric Biggers <ebiggers@google.com>
    ceph: select FS_ENCRYPTION_ALGS if FS_ENCRYPTION

Namjae Jeon <linkinjeon@kernel.org>
    ksmbd: only v2 leases handle the directory

Namjae Jeon <linkinjeon@kernel.org>
    ksmbd: fix UAF issue in ksmbd_tcp_new_connection()

Namjae Jeon <linkinjeon@kernel.org>
    ksmbd: validate mech token in session setup

Bin Li <bin.li@canonical.com>
    ALSA: hda/realtek: Enable headset mic on Lenovo M70 Gen5

Yo-Jung Lin <leo.lin@canonical.com>
    ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on HP ZBook

Çağhan Demir <caghandemir@marun.edu.tr>
    ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq2xxx

Takashi Iwai <tiwai@suse.de>
    ALSA: oxygen: Fix right channel of capture volume mixer

Lino Sanfilippo <l.sanfilippo@kunbus.com>
    serial: omap: do not override settings for RS485 support

Lino Sanfilippo <l.sanfilippo@kunbus.com>
    serial: 8250_exar: Set missing rs485_supported flag

Christoph Niedermaier <cniedermaier@dh-electronics.com>
    serial: imx: Ensure that imx_uart_rs485_config() is called with enabled clock

Lino Sanfilippo <l.sanfilippo@kunbus.com>
    serial: core, imx: do not set RS485 enabled if it is not supported

Stefan Wahren <wahrenst@gmx.net>
    serial: 8250_bcm2835aux: Restore clock error handling

Lino Sanfilippo <l.sanfilippo@kunbus.com>
    serial: core: make sure RS485 cannot be enabled when it is not supported

Lino Sanfilippo <l.sanfilippo@kunbus.com>
    serial: core: fix sanitizing check for RTS settings

Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp-phy: fix path to header

Gui-Dong Han <2045gemini@gmail.com>
    usb: mon: Fix atomicity violation in mon_bin_vma_fault

RD Babiera <rdbabiera@google.com>
    usb: typec: class: fix typec_altmode_put_partner to put plugs

Heikki Krogerus <heikki.krogerus@linux.intel.com>
    Revert "usb: typec: class: fix typec_altmode_put_partner to put plugs"

Frank Li <Frank.Li@nxp.com>
    usb: cdns3: Fix uvc fail when DMA cross 4k boundery since sg enabled

Frank Li <Frank.Li@nxp.com>
    usb: cdns3: fix iso transfer error when mult is not zero

Frank Li <Frank.Li@nxp.com>
    usb: cdns3: fix uvc failure work since sg support enabled

Xu Yang <xu.yang_2@nxp.com>
    usb: chipidea: wait controller resume finished for wakeup irq

Thinh Nguyen <Thinh.Nguyen@synopsys.com>
    Revert "usb: dwc3: don't reset device side if dwc3 was configured as host-only"

Thinh Nguyen <Thinh.Nguyen@synopsys.com>
    Revert "usb: dwc3: Soft reset phy on probe for host"

Wesley Cheng <quic_wcheng@quicinc.com>
    usb: dwc3: gadget: Queue PM runtime idle on disconnect event

Wesley Cheng <quic_wcheng@quicinc.com>
    usb: dwc3: gadget: Handle EP0 request dequeuing properly

Uttkarsh Aggarwal <quic_uaggarwa@quicinc.com>
    usb: dwc: ep0: Update request status in dwc3_ep0_stall_restart

Xu Yang <xu.yang_2@nxp.com>
    usb: phy: mxs: remove CONFIG_USB_OTG condition for mxs_phy_is_otg_host()

Frank Li <Frank.Li@nxp.com>
    Revert "usb: gadget: f_uvc: change endpoint allocation in uvc_function_bind()"

Heiko Carstens <hca@linux.ibm.com>
    tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug

Michael Ellerman <mpe@ellerman.id.au>
    powerpc/64s: Increase default stack size to 32KB

Tony Lindgren <tony@atomide.com>
    clocksource/drivers/timer-ti-dm: Fix make W=n kerneldoc warnings

Carlos Llamas <cmllamas@google.com>
    binder: fix race between mmput() and do_exit()

Jan Beulich <jbeulich@suse.com>
    xen-netback: don't produce zero-size SKB frags

Kaibo Ma <ent3rm4n@gmail.com>
    Revert "drm/amdkfd: Relocate TBA/TMA to opposite side of VM hole"

Matthew Maurer <mmaurer@google.com>
    rust: Ignore preserve-most functions

Hans de Goede <hdegoede@redhat.com>
    Input: atkbd - use ab83 as id when skipping the getid command

Stefan Wiehler <stefan.wiehler@nokia.com>
    mips/smp: Call rcutree_report_cpu_starting() earlier

Carlos Llamas <cmllamas@google.com>
    binder: fix unused alloc->free_async_space

Carlos Llamas <cmllamas@google.com>
    binder: fix async space check for 0-sized buffers

David Howells <dhowells@redhat.com>
    keys, dns: Fix size check of V1 server-list header

Jordan Rome <linux@jordanrome.com>
    selftests/bpf: Add assert for user stacks in test_task_stack

Tejun Heo <tj@kernel.org>
    Revert "kernfs: convert kernfs_idr_lock to an irq safe raw spinlock"

Andrea Righi <andrea.righi@canonical.com>
    kernfs: convert kernfs_idr_lock to an irq safe raw spinlock

Jing Xia <jing.xia@unisoc.com>
    class: fix use-after-free in class_register()

Geert Uytterhoeven <geert+renesas@glider.be>
    of: unittest: Fix of_count_phandle_with_args() expected value message

Dario Binacchi <dario.binacchi@amarulasolutions.com>
    fbdev: imxfb: fix left margin setting

Christian A. Ehrhardt <lk@c--e.de>
    of: Fix double free in of_parse_phandle_with_args_map

Li Nan <linan122@huawei.com>
    ksmbd: validate the zero field of packet header

Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
    kselftest/alsa - conf: Stringify the printed errno in sysfs_get()

Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
    kselftest/alsa - mixer-test: Fix the print format specifier warning

Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
    kselftest/alsa - mixer-test: fix the number of parameters to ksft_exit_fail_msg()

Arnd Bergmann <arnd@arndb.de>
    drm/amd/display: avoid stringop-overflow warnings for dp_decide_lane_settings()

Zhipeng Lu <alexious@zju.edu.cn>
    drm/amd/pm/smu7: fix a memleak in smu7_hwmgr_backend_init

Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
    drm/amdkfd: Confirm list is non-empty before utilizing list_first_entry in kfd_topology.c

Sergey Gorenko <sergeygo@nvidia.com>
    IB/iser: Prevent invalidating wrong MR

Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
    gpio: sysfs: drop the mention of gpiochip_find() from sysfs code

Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
    gpiolib: provide gpio_device_find()

Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
    gpiolib: make gpio_device_get() and gpio_device_put() public

Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
    drm/amdkfd: Fix type of 'dbg_flags' in 'struct kfd_process'

Peter Robinson <pbrobinson@gmail.com>
    mmc: sdhci_omap: Fix TI SoC dependencies

Peter Robinson <pbrobinson@gmail.com>
    mmc: sdhci_am654: Fix TI SoC dependencies

Geoffrey D. Bennett <g@b4.vu>
    ALSA: scarlett2: Add clamp() in scarlett2_mixer_ctl_put()

Geoffrey D. Bennett <g@b4.vu>
    ALSA: scarlett2: Add missing error checks to *_ctl_get()

Geoffrey D. Bennett <g@b4.vu>
    ALSA: scarlett2: Allow passing any output to line_out_remap()

Geoffrey D. Bennett <g@b4.vu>
    ALSA: scarlett2: Add missing error check to scarlett2_usb_set_config()

Geoffrey D. Bennett <g@b4.vu>
    ALSA: scarlett2: Add missing error check to scarlett2_config_save()

Hans de Goede <hdegoede@redhat.com>
    ASoC: rt5645: Drop double EF20 entry from dmi_platform_data[]

Philipp Zabel <p.zabel@pengutronix.de>
    pwm: stm32: Fix enable count for clk in .probe()

Philipp Zabel <p.zabel@pengutronix.de>
    pwm: stm32: Use hweight32 in stm32_pwm_detect_channels

Théo Lebrun <theo.lebrun@bootlin.com>
    clk: fixed-rate: fix clk_hw_register_fixed_rate_with_accuracy_parent_hw

Konrad Dybcio <konrad.dybcio@linaro.org>
    clk: qcom: dispcc-sm8550: Update disp PLL settings

Konrad Dybcio <konrad.dybcio@linaro.org>
    clk: qcom: gcc-sm8550: Mark RCGs shared where applicable

Konrad Dybcio <konrad.dybcio@linaro.org>
    clk: qcom: gcc-sm8550: use collapse-voting for PCIe GDSCs

Konrad Dybcio <konrad.dybcio@linaro.org>
    clk: qcom: gcc-sm8550: Mark the PCIe GDSCs votable

Konrad Dybcio <konrad.dybcio@linaro.org>
    clk: qcom: gcc-sm8550: Add the missing RETAIN_FF_ENABLE GDSC flag

Xingyuan Mo <hdthky0@gmail.com>
    accel/habanalabs: fix information leak in sec_attest_info()

Nícolas F. R. A. Prado <nfraprado@collabora.com>
    drm/mediatek: dp: Add phy_mtk_dp module as pre-dependency

Gergo Koteles <soyer@irl.hu>
    ASoC: tas2781: add support for FW version 0x0503

Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
    ASoC: amd: vangogh: Drop conflicting ACPI-based probing

Su Hui <suhui@nfschina.com>
    clk: si5341: fix an error code problem in si5341_output_clk_set_rate

Marek Vasut <marek.vasut+renesas@mailbox.org>
    clk: rs9: Fix DIF OEn bit placement on 9FGV0241

Vignesh Raghavendra <vigneshr@ti.com>
    watchdog: rti_wdt: Drop runtime pm reference count when watchdog is unused

Stefan Wahren <wahrenst@gmx.net>
    watchdog: bcm2835_wdt: Fix WDIOC_SETTIMEOUT handling

Jerry Hoemann <jerry.hoemann@hpe.com>
    watchdog/hpwdt: Only claim UNKNOWN NMI if from iLO

Curtis Klein <curtis.klein@hpe.com>
    watchdog: set cdev owner before adding

Jay Buddhabhatti <jay.buddhabhatti@amd.com>
    drivers: clk: zynqmp: update divider round rate logic

Jay Buddhabhatti <jay.buddhabhatti@amd.com>
    drivers: clk: zynqmp: calculate closest mux rate

Yang Yingliang <yangyingliang@huawei.com>
    clk: sp7021: fix return value check in sp7021_clk_probe()

Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
    clk: qcom: videocc-sm8150: Add missing PLL config property

Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
    clk: qcom: videocc-sm8150: Update the videocc resets

Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
    dt-bindings: clock: Update the videocc resets for sm8150

Zhiguo Niu <zhiguo.niu@unisoc.com>
    f2fs: fix to check return value of f2fs_recover_xattr_data

Zhipeng Lu <alexious@zju.edu.cn>
    drm/amd/pm: fix a double-free in amdgpu_parse_extended_power_table

Zhipeng Lu <alexious@zju.edu.cn>
    gpu/drm/radeon: fix two memleaks in radeon_vm_init

Zhipeng Lu <alexious@zju.edu.cn>
    drivers/amd/pm: fix a use-after-free in kv_parse_power_table

Zhipeng Lu <alexious@zju.edu.cn>
    drm/amd/pm: fix a double-free in si_dpm_init

Alex Deucher <alexander.deucher@amd.com>
    drm/amdgpu/debugfs: fix error code when smc register accessors are NULL

Hsiao Chien Sung <shawn.sung@mediatek.com>
    drm/mediatek: Fix underrun in VDO1 when switches off the layer

Hsiao Chien Sung <shawn.sung@mediatek.com>
    drm/mediatek: Remove the redundant driver data for DPI

Hsiao Chien Sung <shawn.sung@mediatek.com>
    drm/mediatek: Return error if MDP RDMA failed to enable the clock

Jessica Zhang <quic_jesszhan@quicinc.com>
    drm/msm/dpu: Drop enable and frame_count parameters from dpu_hw_setup_misr()

Jessica Zhang <quic_jesszhan@quicinc.com>
    drm/msm/dpu: Set input_sel bit for INTF

Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
    clk: renesas: rzg2l: Check reset monitor registers

Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
    clk: renesas: rzg2l-cpg: Reuse code in rzg2l_cpg_reset()

Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    media: dvb-frontends: m88ds3103: Fix a memory leak in an error handling path of m88ds3103_probe()

Dan Carpenter <dan.carpenter@linaro.org>
    media: dvbdev: drop refcount on error path in dvb_device_open()

Chao Yu <chao@kernel.org>
    f2fs: fix to update iostat correctly in f2fs_filemap_fault()

Chao Yu <chao@kernel.org>
    f2fs: fix to check compress file in f2fs_move_file_range()

Chao Yu <chao@kernel.org>
    f2fs: fix to wait on block writeback for post_read case

Chris Morgan <macromorgan@hotmail.com>
    drm/panel: st7701: Fix AVCL calculation

Bjorn Andersson <quic_bjorande@quicinc.com>
    drm/msm/adreno: Fix A680 chip id

Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
    media: rkisp1: Fix media device memory leak

Mehdi Djait <mehdi.djait@bootlin.com>
    media: dt-bindings: media: rkisp1: Fix the port description for the parallel interface

Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
    media: imx-mipi-csis: Drop extra clock enable at probe()

Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
    media: imx-mipi-csis: Fix clock handling in remove()

Hans Verkuil <hverkuil-cisco@xs4all.nl>
    media: bttv: add back vbi hack

Hans Verkuil <hverkuil-cisco@xs4all.nl>
    media: bttv: start_streaming should return a proper error code

Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
    clk: qcom: gpucc-sm8150: Update the gpu_cc_pll1 config

Chengchang Tang <tangchengchang@huawei.com>
    RDMA/hns: Fix memory leak in free_mr_init()

Zhipeng Lu <alexious@zju.edu.cn>
    media: cx231xx: fix a memleak in cx231xx_init_isoc

Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
    drm/bridge: tc358767: Fix return value on error case

Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
    drm/bridge: cdns-mhdp8546: Fix use of uninitialized variable

Zhipeng Lu <alexious@zju.edu.cn>
    drm/radeon/trinity_dpm: fix a memleak in trinity_parse_power_table

Zhipeng Lu <alexious@zju.edu.cn>
    drm/radeon/dpm: fix a memleak in sumo_parse_power_table

Yang Yingliang <yangyingliang@huawei.com>
    drm/radeon: check the alloc_workqueue return value in radeon_crtc_init()

Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    drm/msm/dpu: correct clk bit for WB2 block

AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    drm/panfrost: Ignore core_mask for poweroff and disable PWRTRANS irq

Bard Liao <yung-chuan.liao@linux.intel.com>
    ASoC: SOF: topology: Use partial match for disconnecting DAI link and DAI widget

Bard Liao <yung-chuan.liao@linux.intel.com>
    ASoC: Intel: sof_sdw_rt_sdca_jack_common: ctx->headset_codec_dev = NULL

Brent Lu <brent.lu@intel.com>
    ASoC: Intel: glk_rt5682_max98357a: fix board id mismatch

Sebastian Reichel <sre@kernel.org>
    media: v4l: async: Fix duplicated list deletion

Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    drm/drv: propagate errors from drm_modeset_register_all()

Konrad Dybcio <konrad.dybcio@linaro.org>
    drm/msm/dsi: Use pm_runtime_resume_and_get to prevent refcnt leaks

Bjorn Andersson <quic_bjorande@quicinc.com>
    drm/msm/dpu: Add missing safe_lut_tbl in sc8180x catalog

Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    drm/msm/mdp4: flush vblank event on disable

Linus Walleij <linus.walleij@linaro.org>
    ASoC: cs35l33: Fix GPIO name and drop legacy include

Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    drm/imx/lcdc: Fix double-free of driver data

Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
    drm/tidss: Fix dss reset

Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
    drm/tidss: Check for K2G in in dispc_softreset()

Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
    drm/tidss: Return error value from from softreset

Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
    drm/tidss: Move reset to the end of dispc_init()

Nikita Zhandarovich <n.zhandarovich@fintech.ru>
    drm/radeon: check return value of radeon_ring_lock()

Nikita Zhandarovich <n.zhandarovich@fintech.ru>
    drm/radeon/r100: Fix integer overflow issues in r100_cs_track_check()

Nikita Zhandarovich <n.zhandarovich@fintech.ru>
    drm/radeon/r600_cs: Fix possible int overflows in r600_cs_check_reg()

Chao Yu <chao@kernel.org>
    f2fs: fix to avoid dirent corruption

Dario Binacchi <dario.binacchi@amarulasolutions.com>
    drm/bridge: Fix typo in post_disable() description

Alexander Stein <alexander.stein@ew.tq-group.com>
    media: amphion: Fix VPU core alias name

Paul Kocialkowski <paul.kocialkowski@bootlin.com>
    media: rkvdec: Hook the (TRY_)DECODER_CMD stateless ioctls

Paul Kocialkowski <paul.kocialkowski@bootlin.com>
    media: verisilicon: Hook the (TRY_)DECODER_CMD stateless ioctls

Paul Kocialkowski <paul.kocialkowski@bootlin.com>
    media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls

Zheng Wang <zyytlz.wz@163.com>
    media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the crash of multi-core JPEG devices

Ricardo B. Marliere <ricardo@marliere.net>
    media: pvrusb2: fix use after free on context disconnection

Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
    drm/tilcdc: Fix irq free on unload

Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    drm/bridge: tpd12s015: Drop buggy __exit annotation for remove function

Abhinav Singh <singhabhinav9051571833@gmail.com>
    drm/nouveau/fence:: fix warning directly dereferencing a rcu pointer

Chris Morgan <macromorgan@hotmail.com>
    drm/panel-elida-kd35t133: hold panel in reset for unprepare

Chris Morgan <macromorgan@hotmail.com>
    drm/panel: nv3051d: Hold panel in reset for unprepare

Junxian Huang <huangjunxian6@hisilicon.com>
    RDMA/hns: Fix inappropriate err code for unsupported operations

Leon Romanovsky <leon@kernel.org>
    RDMA/usnic: Silence uninitialized symbol smatch warnings

AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off()

Ville Syrjälä <ville.syrjala@linux.intel.com>
    drm/dp_mst: Fix fractional DSC bpp handling

Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
    Revert "drm/omapdrm: Annotate dma-fence critical section in commit path"

Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
    Revert "drm/tidss: Annotate dma-fence critical section in commit path"

Arnd Bergmann <arnd@arndb.de>
    ARM: davinci: always select CONFIG_CPU_ARM926T

Eric Dumazet <edumazet@google.com>
    ip6_tunnel: fix NEXTHDR_FRAGMENT handling in ip6_tnl_parse_tlv_enc_lim()

David Howells <dhowells@redhat.com>
    rxrpc: Fix skbuff cleanup of call's recvmsg_queue and rx_oos_queue

Asmaa Mnebhi <asmaa@nvidia.com>
    mlxbf_gige: Enable the GigE port in mlxbf_gige_open

Asmaa Mnebhi <asmaa@nvidia.com>
    mlxbf_gige: Fix intermittent no ip issue

Tao Liu <taoliu828@163.com>
    net/sched: act_ct: fix skb leak and crash on ooo frags

Ming Lei <ming.lei@redhat.com>
    blk-cgroup: fix rcu lockdep warning in blkg_lookup()

Eric Dumazet <edumazet@google.com>
    sctp: fix busy polling

Eric Dumazet <edumazet@google.com>
    sctp: support MSG_ERRQUEUE flag in recvmsg()

John Fastabend <john.fastabend@gmail.com>
    bpf: sockmap, fix proto update hook to avoid dup calls

Benjamin Berg <benjamin.berg@intel.com>
    wifi: cfg80211: parse all ML elements in an ML probe response

Benjamin Berg <benjamin.berg@intel.com>
    wifi: cfg80211: correct comment about MLD ID

Andy Yan <andyshrk@163.com>
    arm64: dts: rockchip: Fix led pinctrl of lubancat 1

Christoph Hellwig <hch@lst.de>
    null_blk: don't cap max_hw_sectors to BLK_DEF_MAX_SECTORS

Francesco Dolcini <francesco.dolcini@toradex.com>
    Bluetooth: btmtkuart: fix recv_buf() return value

Francesco Dolcini <francesco.dolcini@toradex.com>
    Bluetooth: btnxpuart: fix recv_buf() return value

Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Bluetooth: Fix bogus check for re-auth no supported with non-ssp

Pablo Neira Ayuso <pablo@netfilter.org>
    netfilter: nf_tables: validate chain type update if available

Florian Westphal <fw@strlen.de>
    netfilter: nf_tables: mark newset as dead on transaction abort

Miri Korenblit <miriam.rachel.korenblit@intel.com>
    wifi: iwlwifi: assign phy_ctxt before eSR activation

Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
    wifi: iwlwifi: fix out of bound copy_from_user

Johannes Berg <johannes.berg@intel.com>
    wifi: iwlwifi: mvm: send TX path flush in rfkill

Johannes Berg <johannes.berg@intel.com>
    wifi: iwlwifi: mvm: set siso/mimo chains to 1 in FW SMPS request

Su Hui <suhui@nfschina.com>
    wifi: rtlwifi: rtl8192se: using calculate_bit_shift()

Su Hui <suhui@nfschina.com>
    wifi: rtlwifi: rtl8192ee: using calculate_bit_shift()

Su Hui <suhui@nfschina.com>
    wifi: rtlwifi: rtl8192de: using calculate_bit_shift()

Su Hui <suhui@nfschina.com>
    wifi: rtlwifi: rtl8192ce: using calculate_bit_shift()

Su Hui <suhui@nfschina.com>
    wifi: rtlwifi: rtl8192cu: using calculate_bit_shift()

Su Hui <suhui@nfschina.com>
    wifi: rtlwifi: rtl8192c: using calculate_bit_shift()

Su Hui <suhui@nfschina.com>
    wifi: rtlwifi: rtl8188ee: phy: using calculate_bit_shift()

Su Hui <suhui@nfschina.com>
    wifi: rtlwifi: add calculate_bit_shift()

Hou Tao <houtao1@huawei.com>
    bpf: Use c->unit_size to select target cache during free

Hou Tao <houtao1@huawei.com>
    bpf: Use pcpu_alloc_size() in bpf_mem_free{_rcu}()

Hou Tao <houtao1@huawei.com>
    bpf: Re-enable unit_size checking for global per-cpu allocator

Konrad Dybcio <konrad.dybcio@linaro.org>
    arm64: dts: qcom: sc8180x: Fix up PCIe nodes

Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    arm64: dts: qcom: sc8180x: switch PCIe QMP PHY to new style of bindings

Konrad Dybcio <konrad.dybcio@linaro.org>
    arm64: dts: qcom: sc8180x: Mark PCIe hosts cache-coherent

Konrad Dybcio <konrad.dybcio@linaro.org>
    arm64: dts: qcom: sm8550: Update idle state time requirements

Konrad Dybcio <konrad.dybcio@linaro.org>
    arm64: dts: qcom: sm8550: Separate out X3 idle state

Chukun Pan <amadeus@jmu.edu.cn>
    arm64: dts: qcom: ipq6018: fix clock rates for GCC_USB0_MOCK_UTMI_CLK

Konrad Dybcio <konrad.dybcio@linaro.org>
    arm64: dts: qcom: sc7280: Mark SDHCI hosts as cache-coherent

Li Nan <linan122@huawei.com>
    block: add check of 'minors' and 'first_minor' in device_add_disk()

Abel Vesa <abel.vesa@linaro.org>
    soc: qcom: llcc: Fix LLCC_TRP_ATTR2_CFGn offset

Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    arm64: dts: qcom: sm8150-hdk: fix SS USB regulators

Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    arm64: dts: qcom: sm8150: make dispcc cast minimal vote on MMCX

Konrad Dybcio <konrad.dybcio@linaro.org>
    arm64: dts: qcom: sm6375: Hook up MPM

Johan Hovold <johan+linaro@kernel.org>
    arm64: dts: qcom: sm6375: fix USB wakeup interrupt types

Atul Dhudase <quic_adhudase@quicinc.com>
    soc: qcom: llcc: Fix dis_cap_alloc and retain_on_pc configuration

Nikita Travkin <nikita@trvn.ru>
    arm64: dts: qcom: acer-aspire1: Correct audio codec definition

Hou Tao <houtao1@huawei.com>
    bpf: Limit the number of kprobes when attaching program to multiple kprobes

Hou Tao <houtao1@huawei.com>
    bpf: Limit the number of uprobes when attaching program to multiple uprobes

Joakim Zhang <joakim.zhang@cixtech.com>
    dma-mapping: clear dev->dma_mem to NULL after freeing it

Arseniy Krasnov <avkrasnov@salutedevices.com>
    virtio/vsock: send credit update during setting SO_RCVLOWAT

Arseniy Krasnov <avkrasnov@salutedevices.com>
    virtio/vsock: fix logic which reduces credit update messages

Leone Fernando <leone4fernando@gmail.com>
    ipmr: support IP_PKTINFO on cache report IGMP msg

Hangbin Liu <liuhangbin@gmail.com>
    selftests/net: fix grep checking for fib_nexthop_multiprefix

Yonghong Song <yonghong.song@linux.dev>
    bpf: Fix a race condition between btf_put() and map_free()

Ahmad Fatoum <a.fatoum@pengutronix.de>
    ARM: dts: stm32: don't mix SCMI and non-SCMI board compatibles

Yihang Li <liyihang9@huawei.com>
    scsi: hisi_sas: Correct the number of global debugfs registers

Yihang Li <liyihang9@huawei.com>
    scsi: hisi_sas: Rollback some operations if FLR failed

Yihang Li <liyihang9@huawei.com>
    scsi: hisi_sas: Check before using pointer variables

Yihang Li <liyihang9@huawei.com>
    scsi: hisi_sas: Replace with standard error code return value

Manivannan Sadhasivam <mani@kernel.org>
    scsi: ufs: qcom: Fix the return value when platform_get_resource_byname() fails

Manivannan Sadhasivam <mani@kernel.org>
    scsi: ufs: qcom: Fix the return value of ufs_qcom_ice_program_key()

Adam Ford <aford173@gmail.com>
    arm64: dts: imx8mm: Reduce GPU to nominal speed

Geert Uytterhoeven <geert+renesas@glider.be>
    arm64: dts: renesas: white-hawk-cpu: Fix missing serial console pin control

Rob Herring <robh@kernel.org>
    arm64: dts: xilinx: Apply overlays to base dtbs

Li Nan <linan122@huawei.com>
    block: Set memalloc_noio to false on device_add_disk() error path

YiFei Zhu <zhuyifei@google.com>
    selftests/bpf: Relax time_tai test for equal timestamps in tai_forward

Miri Korenblit <miriam.rachel.korenblit@intel.com>
    wifi: iwlwifi: don't support triggered EHT CQI feedback

Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
    wifi: mt76: mt7921: fix country count limitation for CLC

Eugen Hristev <eugen.hristev@collabora.com>
    arm64: dts: mediatek: mt8186: fix address warning for ADSP mailboxes

Chen-Yu Tsai <wenst@chromium.org>
    arm64: dts: mediatek: mt8186: Fix alias prefix for ovl_2l0

Moudy Ho <moudy.ho@mediatek.com>
    arm64: dts: mediatek: mt8195: revise VDOSYS RDMA node name

Moudy Ho <moudy.ho@mediatek.com>
    arm64: dts: mediatek: mt8183: correct MDP3 DMA-related nodes

Moudy Ho <moudy.ho@mediatek.com>
    dt-bindings: media: mediatek: mdp3: correct RDMA and WROT node with generic names

Andrei Matei <andreimatei1@gmail.com>
    bpf: Fix accesses to uninit stack slots

Andrei Matei <andreimatei1@gmail.com>
    bpf: Guard stack limits against 32bit overflow

Johan Hovold <johan+linaro@kernel.org>
    arm64: dts: hisilicon: hikey970-pmic: fix regulator cells properties

Andrei Matei <andreimatei1@gmail.com>
    bpf: Fix verification of indirect var-off stack access

Wang Zhao <wang.zhao@mediatek.com>
    wifi: mt76: mt7921s: fix workqueue problem causes STA association fail

StanleyYP Wang <StanleyYP.Wang@mediatek.com>
    wifi: mt76: mt7915: also MT7981 is 3T3R but nss2 on 5 GHz band

StanleyYP Wang <StanleyYP.Wang@mediatek.com>
    wifi: mt76: mt7915: fix EEPROM offset of TSSI flag on MT7981

MeiChia Chiu <meichia.chiu@mediatek.com>
    wifi: mt76: mt7996: fix rate usage of inband discovery frames

Sujuan Chen <sujuan.chen@mediatek.com>
    wifi: mt76: mt7996: fix the size of struct bss_rate_tlv

Lorenzo Bianconi <lorenzo@kernel.org>
    wifi: mt76: mt7915: fallback to non-wed mode if platform_get_resource fails in mt7915_mmio_wed_init()

Christian Marangi <ansuelsmth@gmail.com>
    wifi: mt76: fix typo in mt76_get_of_eeprom_from_nvmem function

Johan Hovold <johan+linaro@kernel.org>
    arm64: dts: qcom: sm8550: fix USB wakeup interrupt types

Johan Hovold <johan+linaro@kernel.org>
    arm64: dts: qcom: sc7280: fix usb_2 wakeup interrupt types

Johan Hovold <johan+linaro@kernel.org>
    arm64: dts: qcom: sa8775p: fix USB wakeup interrupt types

Konrad Dybcio <konrad.dybcio@linaro.org>
    arm64: dts: qcom: sc7280: Mark Adreno SMMU as DMA coherent

Konrad Dybcio <konrad.dybcio@linaro.org>
    arm64: dts: qcom: sc7280: Fix up GPU SIDs

Nia Espera <nespera@igalia.com>
    arm64: dts: qcom: sm8350: Fix DMA0 address

Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    arm64: dts: qcom: sm6125: add interrupts to DWC3 USB controller

Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    arm64: dts: qcom: sdm845-db845c: correct LED panic indicator

Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    arm64: dts: qcom: qrb5165-rb5: correct LED panic indicator

Caleb Connolly <caleb.connolly@linaro.org>
    arm64: dts: qcom: qrb2210-rb1: use USB host mode

Konrad Dybcio <konrad.dybcio@linaro.org>
    arm64: dts: qcom: qrb2210-rb1: Hook up USB3

Artem Chernyshev <artem.chernyshev@red-soft.ru>
    scsi: fnic: Return error if vmalloc() failed

Andrii Nakryiko <andrii@kernel.org>
    bpf: fix check for attempt to corrupt spilled pointer

Hangbin Liu <liuhangbin@gmail.com>
    selftests/net: specify the interface when do arping

Hou Tao <houtao1@huawei.com>
    bpf: Defer the free of inner map when necessary

Hou Tao <houtao1@huawei.com>
    bpf: Add map and need_defer parameters to .map_fd_put_ptr()

Douglas Anderson <dianders@chromium.org>
    arm64: dts: qcom: sm6350: Make watchdog bark interrupt edge triggered

Douglas Anderson <dianders@chromium.org>
    arm64: dts: qcom: sc8280xp: Make watchdog bark interrupt edge triggered

Douglas Anderson <dianders@chromium.org>
    arm64: dts: qcom: sa8775p: Make watchdog bark interrupt edge triggered

Douglas Anderson <dianders@chromium.org>
    arm64: dts: qcom: sm8250: Make watchdog bark interrupt edge triggered

Douglas Anderson <dianders@chromium.org>
    arm64: dts: qcom: sm8150: Make watchdog bark interrupt edge triggered

Douglas Anderson <dianders@chromium.org>
    arm64: dts: qcom: sdm845: Make watchdog bark interrupt edge triggered

Douglas Anderson <dianders@chromium.org>
    arm64: dts: qcom: sc7280: Make watchdog bark interrupt edge triggered

Luca Weiss <luca.weiss@fairphone.com>
    arm64: dts: qcom: sc7280: Mark some nodes as 'reserved'

Douglas Anderson <dianders@chromium.org>
    arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered

Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    arm64: dts: qcom: sm8550: correct TX Soundwire clock

Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    arm64: dts: qcom: sm8450: correct TX Soundwire clock

Bjorn Andersson <quic_bjorande@quicinc.com>
    arm64: dts: qcom: sc8180x-primus: Fix HALL_INT polarity

Stephen Boyd <swboyd@chromium.org>
    dt-bindings: arm: qcom: Fix html link

Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    ARM: dts: qcom: sdx65: correct SPMI node name

Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    ARM: dts: qcom: sdx65: correct PCIe EP phy-names

Andrii Nakryiko <andrii@kernel.org>
    bpf: enforce precision of R0 on callback return

Yu Kuai <yukuai3@huawei.com>
    md: synchronize flush io with array reconfiguration

Jeroen van Ingen Schenau <jeroen.vaningenschenau@novoserve.com>
    selftests/bpf: Fix erroneous bitmask operation

Martin Blumenstingl <martin.blumenstingl@googlemail.com>
    wifi: rtw88: sdio: Honor the host max_req_size in the RX path

Jan Kiszka <jan.kiszka@siemens.com>
    arm64: dts: ti: iot2050: Re-add aliases

Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
    arm64: dts: ti: k3-am65-main: Fix DSS irq trigger type

Nitin Yadav <n-yadav@ti.com>
    arm64: dts: ti: k3-am62a-main: Fix GPIO pin count in DT nodes

Su Hui <suhui@nfschina.com>
    wifi: rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior

Bart Van Assche <bvanassche@acm.org>
    scsi: bfa: Use the proper data type for BLIST flags

Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    firmware: ti_sci: Fix an off-by-one in ti_sci_debugfs_create()

Peter Delevoryas <peter@pjd.dev>
    net/ncsi: Fix netlink major/minor version numbers

Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
    ARM: dts: qcom: apq8064: correct XOADC register address

Arnd Bergmann <arnd@arndb.de>
    wifi: libertas: stop selecting wext

Luca Weiss <luca.weiss@fairphone.com>
    wifi: ath11k: Defer on rproc_get failure

Jordan Rome <jordalgo@meta.com>
    bpf: Add crosstask check to __bpf_get_stack

Florian Lehner <dev@der-flo.net>
    bpf, lpm: Fix check prefixlen before walking trie

Chih-Kang Chang <gary.chang@realtek.com>
    wifi: rtw88: fix RX filter in FIF_ALLMULTI flag

Dan Carpenter <dan.carpenter@linaro.org>
    wifi: plfxlc: check for allocation failure in plfxlc_usb_wreq_async()

Luca Weiss <luca@z3ntu.xyz>
    ARM: dts: qcom: msm8226: provide dsi phy clocks to mmcc

Johan Hovold <johan+linaro@kernel.org>
    arm64: dts: qcom: sc8280xp-x13s: add missing camera LED pin config

Konrad Dybcio <konrad.dybcio@linaro.org>
    arm64: dts: qcom: sc8280xp-x13s: Use the correct DP PHY compatible

Caleb Connolly <caleb.connolly@linaro.org>
    arm64: dts: qcom: qrb4210-rb2: don't force usb peripheral mode

David McKay <david.mckay@codasip.com>
    asm-generic: Fix 32 bit __generic_cmpxchg_local

Trond Myklebust <trond.myklebust@hammerspace.com>
    pNFS: Fix the pnfs block driver's calculation of layoutget size

Olga Kornievskaia <kolga@netapp.com>
    SUNRPC: fix _xprt_switch_find_current_entry logic

Trond Myklebust <trond.myklebust@hammerspace.com>
    NFSv4.1/pnfs: Ensure we handle the error NFS4ERR_RETURNCONFLICT

Scott Mayhew <smayhew@redhat.com>
    NFS: Use parent's objective cred in nfs_access_login_time()

Benjamin Coddington <bcodding@redhat.com>
    blocklayoutdriver: Fix reference leak of pnfs_device_node

Arnd Bergmann <arnd@arndb.de>
    csky: fix arch_jump_label_transform_static override

Chengming Zhou <zhouchengming@bytedance.com>
    crypto: scomp - fix req->dst buffer overflow

Ovidiu Panait <ovidiu.panait@windriver.com>
    crypto: sahara - do not resize req->src when doing hash operations

Ovidiu Panait <ovidiu.panait@windriver.com>
    crypto: sahara - fix processing hash requests with req->nbytes < sg->length

Ovidiu Panait <ovidiu.panait@windriver.com>
    crypto: sahara - improve error handling in sahara_sha_process()

Ovidiu Panait <ovidiu.panait@windriver.com>
    crypto: sahara - fix wait_for_completion_timeout() error handling

Ovidiu Panait <ovidiu.panait@windriver.com>
    crypto: sahara - fix ahash reqsize

Ovidiu Panait <ovidiu.panait@windriver.com>
    crypto: sahara - handle zero-length aes requests

Ovidiu Panait <ovidiu.panait@windriver.com>
    crypto: sahara - avoid skcipher fallback code duplication

wangyangxin <wangyangxin1@huawei.com>
    crypto: virtio - Wait for tasklet to complete on device remove

Alexander Aring <aahringo@redhat.com>
    dlm: fix format seq ops type 4

Edward Adam Davis <eadavis@qq.com>
    gfs2: fix kernel BUG in gfs2_quota_cleanup

Osama Muhammad <osmtendev@gmail.com>
    gfs2: Fix kernel NULL pointer dereference in gfs2_rgrp_dump

Christian Brauner <brauner@kernel.org>
    fs: indicate request originates from old mount API

Gao Xiang <xiang@kernel.org>
    erofs: fix memory leak on short-lived bounced pages

Sergey Shtylyov <s.shtylyov@omp.ru>
    pstore: ram_core: fix possible overflow in persistent_ram_init_ecc()

Zhiqi Song <songzhiqi1@huawei.com>
    crypto: hisilicon/zip - save capability registers in probe process

Zhiqi Song <songzhiqi1@huawei.com>
    crypto: hisilicon/sec2 - save capability registers in probe process

Zhiqi Song <songzhiqi1@huawei.com>
    crypto: hisilicon/hpre - save capability registers in probe process

Wenkai Lin <linwenkai6@hisilicon.com>
    crypto: hisilicon/qm - add a function to set qm algs

Chenghai Huang <huangchenghai2@huawei.com>
    crypto: hisilicon/zip - add zip comp high perf mode configuration

Zhiqi Song <songzhiqi1@huawei.com>
    crypto: hisilicon/qm - save capability registers in qm init process

Ovidiu Panait <ovidiu.panait@windriver.com>
    crypto: sahara - fix error handling in sahara_hw_descriptor_create()

Ovidiu Panait <ovidiu.panait@windriver.com>
    crypto: sahara - fix processing requests with cryptlen < sg->length

Ovidiu Panait <ovidiu.panait@windriver.com>
    crypto: sahara - fix ahash selftest failure

Ovidiu Panait <ovidiu.panait@windriver.com>
    crypto: sahara - fix cbc selftest failure

Ovidiu Panait <ovidiu.panait@windriver.com>
    crypto: sahara - remove FLAGS_NEW_KEY logic

Nikita Zhandarovich <n.zhandarovich@fintech.ru>
    crypto: safexcel - Add error handling for dma_map_sg() calls

Herbert Xu <herbert@gondor.apana.org.au>
    crypto: af_alg - Disallow multiple in-flight AIO requests

Dinghao Liu <dinghao.liu@zju.edu.cn>
    crypto: ccp - fix memleak in ccp_init_dm_workarea

Chen Ni <nichen@iscas.ac.cn>
    crypto: sa2ul - Return crypto_aead_setkey to transfer the error

Gonglei (Arei) <arei.gonglei@huawei.com>
    crypto: virtio - Handle dataq logic with tasklet

Chanho Park <chanho61.park@samsung.com>
    crypto: jh7110 - Correct deferred probe return

Dan Carpenter <dan.carpenter@linaro.org>
    crypto: rsa - add a check for allocation failure

Mickaël Salaün <mic@digikod.net>
    selinux: Fix error priority for bind with AF_UNSPEC on PF_INET6 socket

Binbin Zhou <zhoubinbin@loongson.cn>
    drivers/thermal/loongson2_thermal: Fix incorrect PTR_ERR() judgment

Borislav Petkov (AMD) <bp@alien8.de>
    cpuidle: haltpoll: Do not enable interrupts when entering idle

ZhaoLong Wang <wangzhaolong1@huawei.com>
    mtd: Fix gluebi NULL pointer dereference caused by ftl notifier

Richard Fitzgerald <rf@opensource.cirrus.com>
    kunit: debugfs: Fix unchecked dereference in debugfs_print_results()

Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    thermal: core: Fix NULL pointer dereference in zone registration error path

Tony Luck <tony.luck@intel.com>
    ACPI: extlog: Clear Extended Error Log status when RAS_CEC handled the error

Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    ACPI: LPSS: Fix the fractional clock divider flags

Wolfram Sang <wsa+renesas@sang-engineering.com>
    spi: sh-msiof: Enforce fixed DTDL for R-Car H3

Ard Biesheuvel <ardb@kernel.org>
    efivarfs: Free s_fs_info on unmount

Ilias Apalodimas <ilias.apalodimas@linaro.org>
    efivarfs: force RO when remounting if SetVariable is not supported

Gavrilov Ilia <Ilia.Gavrilov@infotecs.ru>
    calipso: fix memory leak in netlbl_calipso_add_pass()

Alexandra Diupina <adiupina@astralinux.ru>
    cpufreq: scmi: process the result of devm_of_clk_add_hw_provider()

David E. Box <david.e.box@linux.intel.com>
    platform/x86/intel/vsec: Fix xa_alloc memory leak

Yang Yingliang <yangyingliang@huawei.com>
    spi: cadence-quadspi: add missing clk_disable_unprepare() in cqspi_probe()

Chen Ni <nichen@iscas.ac.cn>
    KEYS: encrypted: Add check for strsep

Nikita Kiryushin <kiryushin@ancud.ru>
    ACPI: LPIT: Avoid u32 multiplication overflow

Nikita Kiryushin <kiryushin@ancud.ru>
    ACPI: video: check for error while searching for backlight device parent

Ronald Monthero <debug.penguin32@gmail.com>
    mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response

Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
    spi: spi-zynqmp-gqspi: fix driver kconfig dependencies

Alexander Antonov <alexander.antonov@linux.intel.com>
    perf/x86/intel/uncore: Fix NULL pointer dereference issue in upi_fill_topology()

Yiwei Lin <s921975628@gmail.com>
    sched/fair: Update min_vruntime for reweight_entity() correctly

Kunwu Chan <chentao@kylinos.cn>
    powerpc/imc-pmu: Add a null pointer check in update_events_in_group()

Kunwu Chan <chentao@kylinos.cn>
    powerpc/powernv: Add a null pointer check in opal_powercap_init()

Kunwu Chan <chentao@kylinos.cn>
    powerpc/powernv: Add a null pointer check in opal_event_init()

Kunwu Chan <chentao@kylinos.cn>
    powerpc/powernv: Add a null pointer check to scom_debug_init_one()

Nathan Lynch <nathanl@linux.ibm.com>
    powerpc/rtas: Avoid warning on invalid token argument to sys_rtas()

Kajol Jain <kjain@linux.ibm.com>
    powerpc/hv-gpci: Add return value check in affinity_domain_via_partition_show function

Michael Ellerman <mpe@ellerman.id.au>
    selftests/powerpc: Fix error handling in FPU/VMX preemption tests

Nicholas Piggin <npiggin@gmail.com>
    KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE

Jordan Niethe <jniethe5@gmail.com>
    KVM: PPC: Book3S HV: Introduce low level MSR accessor

Jordan Niethe <jniethe5@gmail.com>
    KVM: PPC: Book3S HV: Use accessors for VCPU registers

Junhao He <hejunhao3@huawei.com>
    drivers/perf: hisi: Fix some event id for HiSilicon UC pmu

Robin Murphy <robin.murphy@arm.com>
    perf/arm-cmn: Fix HN-F class_occup_id events

Nathan Lynch <nathanl@linux.ibm.com>
    powerpc/pseries/memhp: Fix access beyond end of drmem array

Randy Dunlap <rdunlap@infradead.org>
    powerpc/44x: select I2C for CURRITUCK

Peter Zijlstra <peterz@infradead.org>
    x86: Fix CPUIDLE_FLAG_IRQ_ENABLE leaking timer reprogram

Masahiro Yamada <masahiroy@kernel.org>
    powerpc: add crtsavres.o to always-y instead of extra-y

Arnd Bergmann <arnd@arndb.de>
    EDAC/thunderx: Fix possible out-of-bounds string access

Yazen Ghannam <yazen.ghannam@amd.com>
    x86/mce/inject: Clear test status value

Colin Ian King <colin.i.king@gmail.com>
    x86/lib: Fix overflow when counting digits


-------------

Diffstat:

 Documentation/devicetree/bindings/arm/qcom.yaml    |   2 +-
 .../devicetree/bindings/gpio/xlnx,gpio-xilinx.yaml |   2 +-
 .../bindings/media/mediatek,mdp3-rdma.yaml         |  29 +-
 .../bindings/media/mediatek,mdp3-wrot.yaml         |  23 +-
 .../devicetree/bindings/media/rockchip-isp1.yaml   |  11 +-
 .../phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml         |   4 +-
 Documentation/driver-api/pci/p2pdma.rst            |  16 +-
 Makefile                                           |   4 +-
 arch/arm/boot/dts/qcom/qcom-apq8064.dtsi           |   2 +-
 arch/arm/boot/dts/qcom/qcom-msm8226.dtsi           |   4 +-
 arch/arm/boot/dts/qcom/qcom-sdx65.dtsi             |   4 +-
 arch/arm/boot/dts/st/stm32mp157a-dk1-scmi.dts      |   2 +-
 arch/arm/boot/dts/st/stm32mp157c-dk2-scmi.dts      |   2 +-
 arch/arm/boot/dts/st/stm32mp157c-ed1-scmi.dts      |   2 +-
 arch/arm/boot/dts/st/stm32mp157c-ev1-scmi.dts      |   3 +-
 arch/arm/mach-davinci/Kconfig                      |   2 +
 arch/arm64/boot/dts/freescale/imx8mm.dtsi          |   4 +-
 arch/arm64/boot/dts/hisilicon/hikey970-pmic.dtsi   |   3 -
 arch/arm64/boot/dts/mediatek/mt8183.dtsi           |   6 +-
 arch/arm64/boot/dts/mediatek/mt8186.dtsi           |   6 +-
 arch/arm64/boot/dts/mediatek/mt8195.dtsi           |  24 +-
 arch/arm64/boot/dts/qcom/ipq6018.dtsi              |   2 +-
 arch/arm64/boot/dts/qcom/qrb2210-rb1.dts           |  10 +
 arch/arm64/boot/dts/qcom/qrb4210-rb2.dts           |   1 -
 arch/arm64/boot/dts/qcom/qrb5165-rb5.dts           |   2 +-
 arch/arm64/boot/dts/qcom/sa8775p.dtsi              |  14 +-
 arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts   |  17 +-
 arch/arm64/boot/dts/qcom/sc7180.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi |  24 ++
 arch/arm64/boot/dts/qcom/sc7280.dtsi               |  20 +-
 arch/arm64/boot/dts/qcom/sc8180x-primus.dts        |   2 +-
 arch/arm64/boot/dts/qcom/sc8180x.dtsi              | 152 ++++------
 .../dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts     |  11 +
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi             |   2 +-
 arch/arm64/boot/dts/qcom/sdm845-db845c.dts         |   2 +-
 arch/arm64/boot/dts/qcom/sdm845.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sm6125.dtsi               |   4 +
 arch/arm64/boot/dts/qcom/sm6350.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sm6375.dtsi               |  41 ++-
 arch/arm64/boot/dts/qcom/sm8150-hdk.dts            |  12 +-
 arch/arm64/boot/dts/qcom/sm8150.dtsi               |   3 +-
 arch/arm64/boot/dts/qcom/sm8250.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sm8350.dtsi               |   4 +-
 arch/arm64/boot/dts/qcom/sm8450.dtsi               |   2 +-
 arch/arm64/boot/dts/qcom/sm8550.dtsi               |  38 ++-
 .../boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi  |   3 +
 arch/arm64/boot/dts/rockchip/rk3566-lubancat-1.dts |   2 +-
 arch/arm64/boot/dts/ti/k3-am62a-main.dtsi          |   4 +-
 arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi |  10 +
 arch/arm64/boot/dts/ti/k3-am65-main.dtsi           |   2 +-
 arch/arm64/boot/dts/xilinx/Makefile                |   9 +-
 arch/arm64/kernel/ptrace.c                         |  13 +-
 arch/arm64/kvm/vgic/vgic-its.c                     |   5 +
 arch/arm64/kvm/vgic/vgic-mmio-v3.c                 |  27 +-
 arch/csky/include/asm/jump_label.h                 |   5 +
 arch/loongarch/include/asm/elf.h                   |   5 -
 arch/loongarch/kernel/elf.c                        |   5 -
 arch/loongarch/kernel/process.c                    |   1 +
 arch/loongarch/net/bpf_jit.c                       |   5 +-
 arch/mips/alchemy/devboards/db1200.c               |   2 +-
 arch/mips/alchemy/devboards/db1550.c               |   2 +-
 arch/mips/include/asm/dmi.h                        |   2 +-
 arch/mips/kernel/setup.c                           |   4 +-
 arch/mips/kernel/smp.c                             |   4 +-
 arch/powerpc/Kconfig                               |   1 +
 arch/powerpc/kernel/rtas.c                         |  19 +-
 arch/powerpc/kvm/book3s_64_mmu_hv.c                |   5 +-
 arch/powerpc/kvm/book3s_64_mmu_radix.c             |   5 +-
 arch/powerpc/kvm/book3s_hv.c                       | 198 ++++++------
 arch/powerpc/kvm/book3s_hv.h                       |  68 +++++
 arch/powerpc/kvm/book3s_hv_builtin.c               |   5 +-
 arch/powerpc/lib/Makefile                          |   2 +-
 arch/powerpc/perf/hv-gpci.c                        |   3 +
 arch/powerpc/perf/imc-pmu.c                        |   6 +
 arch/powerpc/platforms/44x/Kconfig                 |   1 +
 arch/powerpc/platforms/powernv/opal-irqchip.c      |   2 +
 arch/powerpc/platforms/powernv/opal-powercap.c     |   6 +
 arch/powerpc/platforms/powernv/opal-xscom.c        |   5 +
 arch/powerpc/platforms/pseries/hotplug-memory.c    |   9 +-
 arch/riscv/include/asm/sections.h                  |   1 +
 arch/riscv/include/asm/xip_fixup.h                 |   2 +-
 arch/riscv/kernel/module.c                         |   3 +-
 arch/riscv/kernel/patch.c                          |  11 +-
 arch/riscv/kernel/vmlinux-xip.lds.S                |   2 +
 arch/riscv/kernel/vmlinux.lds.S                    |   2 +
 arch/riscv/mm/pageattr.c                           | 275 ++++++++++++++---
 arch/s390/include/asm/pci_io.h                     |  32 +-
 arch/s390/pci/pci_mmio.c                           |  12 +-
 arch/um/drivers/virt-pci.c                         |   2 +-
 arch/x86/events/intel/uncore_snbep.c               |  10 +-
 arch/x86/include/asm/kvm-x86-pmu-ops.h             |   2 +-
 arch/x86/include/asm/mwait.h                       |  11 +-
 arch/x86/kernel/cpu/mce/inject.c                   |   1 +
 arch/x86/kernel/kvmclock.c                         |  12 +-
 arch/x86/kvm/pmu.c                                 |  63 +++-
 arch/x86/kvm/pmu.h                                 |  18 --
 arch/x86/kvm/svm/nested.c                          |  15 -
 arch/x86/kvm/svm/pmu.c                             |  16 -
 arch/x86/kvm/vmx/pmu_intel.c                       |  20 --
 arch/x86/lib/misc.c                                |   2 +-
 arch/x86/pci/mmconfig-shared.c                     |  13 +-
 block/bio.c                                        |  46 +--
 block/blk-cgroup.h                                 |   3 +-
 block/blk-mq.c                                     |  16 +-
 block/genhd.c                                      |   5 +-
 block/ioctl.c                                      |  11 +-
 crypto/af_alg.c                                    |  14 +-
 crypto/rsa.c                                       |   2 +
 crypto/scompress.c                                 |   6 +
 drivers/accel/habanalabs/common/habanalabs_ioctl.c |   2 +-
 drivers/acpi/acpi_extlog.c                         |   7 +-
 drivers/acpi/acpi_lpit.c                           |   2 +-
 drivers/acpi/acpi_lpss.c                           |   3 +-
 drivers/acpi/acpi_video.c                          |  12 +-
 drivers/acpi/property.c                            |   4 +
 drivers/android/binder_alloc.c                     |  22 +-
 drivers/base/class.c                               |   1 +
 drivers/base/node.c                                |   9 +-
 drivers/base/swnode.c                              |   3 +
 drivers/block/loop.c                               |  52 ++--
 drivers/block/null_blk/main.c                      |  12 +-
 drivers/bluetooth/btmtkuart.c                      |  11 +-
 drivers/bluetooth/btnxpuart.c                      |   7 +-
 drivers/bus/mhi/ep/main.c                          | 139 ++++++---
 drivers/bus/mhi/ep/ring.c                          |  41 +--
 drivers/clk/clk-renesas-pcie.c                     |   2 +-
 drivers/clk/clk-si5341.c                           |   4 +-
 drivers/clk/clk-sp7021.c                           |  12 +-
 drivers/clk/qcom/dispcc-sm8550.c                   |   8 +
 drivers/clk/qcom/gcc-sm8550.c                      | 110 +++----
 drivers/clk/qcom/gpucc-sm8150.c                    |   4 +-
 drivers/clk/qcom/videocc-sm8150.c                  |   5 +
 drivers/clk/renesas/rzg2l-cpg.c                    |  91 +++---
 drivers/clk/zynqmp/clk-mux-zynqmp.c                |   2 +-
 drivers/clk/zynqmp/divider.c                       |  66 +---
 drivers/clocksource/timer-ti-dm.c                  |   4 +-
 drivers/cpufreq/scmi-cpufreq.c                     |   7 +-
 drivers/cpuidle/cpuidle-haltpoll.c                 |   9 +-
 drivers/crypto/ccp/ccp-ops.c                       |   5 +-
 drivers/crypto/hisilicon/hpre/hpre_main.c          | 122 ++++----
 drivers/crypto/hisilicon/qm.c                      |  98 +++++-
 drivers/crypto/hisilicon/sec2/sec.h                |   7 +
 drivers/crypto/hisilicon/sec2/sec_crypto.c         |  13 +-
 drivers/crypto/hisilicon/sec2/sec_main.c           |  70 +++--
 drivers/crypto/hisilicon/zip/zip_main.c            | 175 ++++++++---
 drivers/crypto/inside-secure/safexcel_cipher.c     |  19 +-
 drivers/crypto/sa2ul.c                             |   3 +-
 drivers/crypto/sahara.c                            | 248 +++++++--------
 drivers/crypto/starfive/jh7110-cryp.c              |  10 +-
 drivers/crypto/virtio/virtio_crypto_common.h       |   2 +
 drivers/crypto/virtio/virtio_crypto_core.c         |  26 +-
 drivers/cxl/core/port.c                            |  24 +-
 drivers/cxl/core/region.c                          |   2 +-
 drivers/cxl/cxl.h                                  |   2 -
 drivers/edac/thunderx_edac.c                       |  10 +-
 drivers/firmware/ti_sci.c                          |  10 +-
 drivers/gpio/gpio-mlxbf3.c                         |   2 +
 drivers/gpio/gpiolib-sysfs.c                       |   2 +-
 drivers/gpio/gpiolib.c                             |  95 ++++--
 drivers/gpio/gpiolib.h                             |  10 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c        |   4 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c            |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c            |   7 +-
 drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c       |  26 +-
 drivers/gpu/drm/amd/amdkfd/kfd_migrate.c           |   6 +-
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h              |   2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c          |  21 +-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |   2 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c    |   2 +-
 .../display/dc/link/protocols/link_dp_training.c   |   2 +-
 .../display/dc/link/protocols/link_dp_training.h   |   2 +-
 drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c         |   4 +-
 drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c     |  52 +---
 drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c         |   5 +-
 .../gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c    |   6 +-
 .../gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c    |   3 +-
 drivers/gpu/drm/bridge/tc358767.c                  |   2 +-
 drivers/gpu/drm/bridge/ti-tpd12s015.c              |   4 +-
 drivers/gpu/drm/display/drm_dp_mst_topology.c      |  20 +-
 drivers/gpu/drm/drm_drv.c                          |  10 +-
 drivers/gpu/drm/i915/display/intel_dp_mst.c        |   5 +-
 drivers/gpu/drm/imx/lcdc/imx-lcdc.c                |   9 -
 drivers/gpu/drm/mediatek/mtk_disp_merge.c          |   2 +-
 drivers/gpu/drm/mediatek/mtk_dp.c                  |   1 +
 drivers/gpu/drm/mediatek/mtk_dpi.c                 |  16 +-
 drivers/gpu/drm/mediatek/mtk_mdp_rdma.c            |   3 +-
 drivers/gpu/drm/msm/adreno/adreno_device.c         |   2 +-
 .../drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h    |   1 +
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h |   2 +-
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_6_2_sc7180.h |   2 +-
 .../gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h |   2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c           |   4 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c        |   4 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c        |   6 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h        |   4 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c          |   6 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h          |   3 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c        |  20 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h        |   8 +-
 drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c          |   9 +
 drivers/gpu/drm/msm/dsi/phy/dsi_phy.c              |   4 +-
 drivers/gpu/drm/nouveau/dispnv50/disp.c            |   3 +-
 drivers/gpu/drm/nouveau/nv04_fence.c               |   2 +-
 drivers/gpu/drm/omapdrm/omap_drv.c                 |   9 +-
 drivers/gpu/drm/panel/panel-elida-kd35t133.c       |   2 +
 drivers/gpu/drm/panel/panel-newvision-nv3051d.c    |   2 +
 drivers/gpu/drm/panel/panel-sitronix-st7701.c      |   2 +-
 drivers/gpu/drm/panfrost/panfrost_gpu.c            |  70 +++--
 drivers/gpu/drm/radeon/r100.c                      |   4 +-
 drivers/gpu/drm/radeon/r600_cs.c                   |   4 +-
 drivers/gpu/drm/radeon/radeon_display.c            |   7 +-
 drivers/gpu/drm/radeon/radeon_vm.c                 |   8 +-
 drivers/gpu/drm/radeon/si.c                        |   4 +
 drivers/gpu/drm/radeon/sumo_dpm.c                  |   4 +-
 drivers/gpu/drm/radeon/trinity_dpm.c               |   4 +-
 drivers/gpu/drm/tests/drm_dp_mst_helper_test.c     |   6 +-
 drivers/gpu/drm/tidss/tidss_dispc.c                |  63 +++-
 drivers/gpu/drm/tidss/tidss_kms.c                  |   4 -
 drivers/gpu/drm/tilcdc/tilcdc_drv.c                |   2 +-
 drivers/hid/hid-sensor-hub.c                       |   2 +-
 drivers/hid/wacom_wac.c                            |  32 +-
 drivers/i2c/busses/i2c-s3c2410.c                   |  40 +--
 drivers/idle/intel_idle.c                          |  19 +-
 drivers/iio/adc/ad7091r-base.c                     |   6 +-
 drivers/iio/adc/ad9467.c                           | 112 +++++--
 drivers/iio/adc/adi-axi-adc.c                      |  74 +----
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c         |   6 +-
 drivers/infiniband/hw/hns/hns_roce_pd.c            |   2 +-
 drivers/infiniband/hw/mthca/mthca_cmd.c            |   4 +-
 drivers/infiniband/hw/mthca/mthca_main.c           |   2 +-
 drivers/infiniband/ulp/iser/iscsi_iser.h           |   2 -
 drivers/infiniband/ulp/iser/iser_initiator.c       |   5 +-
 drivers/infiniband/ulp/iser/iser_memory.c          |   8 +-
 drivers/infiniband/ulp/iser/iser_verbs.c           |   1 -
 drivers/input/keyboard/atkbd.c                     |  12 +-
 drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c         |   1 +
 drivers/iommu/dma-iommu.c                          |   3 +
 drivers/iommu/of_iommu.c                           |   7 +
 drivers/leds/Kconfig                               |   1 +
 drivers/leds/leds-aw200xx.c                        |   7 +-
 drivers/md/md.c                                    |  29 +-
 drivers/md/raid1.c                                 |  12 +-
 drivers/media/dvb-core/dvbdev.c                    |   2 +
 drivers/media/dvb-frontends/m88ds3103.c            |   7 +-
 drivers/media/pci/bt8xx/bttv-driver.c              |  27 +-
 drivers/media/pci/bt8xx/bttv-vbi.c                 |   8 +-
 drivers/media/platform/amphion/vpu_core.c          |   2 +-
 .../media/platform/mediatek/jpeg/mtk_jpeg_core.c   |   1 -
 drivers/media/platform/nxp/imx-mipi-csis.c         |  17 +-
 .../media/platform/rockchip/rkisp1/rkisp1-dev.c    |   6 +-
 drivers/media/platform/verisilicon/hantro_drv.c    |   2 +
 drivers/media/platform/verisilicon/hantro_v4l2.c   |   3 +
 drivers/media/test-drivers/visl/visl-video.c       |   3 +
 drivers/media/usb/cx231xx/cx231xx-core.c           |   2 +
 drivers/media/usb/pvrusb2/pvrusb2-context.c        |   3 +-
 drivers/media/v4l2-core/v4l2-async.c               |   1 -
 drivers/mfd/cs42l43-sdw.c                          |  74 ++---
 drivers/mfd/intel-lpss.c                           |   2 +-
 drivers/mfd/rk8xx-core.c                           |  34 +--
 drivers/mfd/syscon.c                               |   4 +
 drivers/mfd/tps6594-core.c                         |   3 +
 drivers/mmc/host/Kconfig                           |  10 +-
 drivers/mtd/mtd_blkdevs.c                          |   4 +-
 drivers/mtd/nand/raw/fsl_ifc_nand.c                |   2 +-
 drivers/net/amt.c                                  |   6 +-
 drivers/net/dsa/vitesse-vsc73xx-core.c             |   2 +
 drivers/net/ethernet/marvell/octeontx2/af/rpm.c    |   7 +-
 .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c |  26 +-
 .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c   |   6 +-
 .../net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c |   8 +-
 .../ethernet/mellanox/mlxsw/spectrum_acl_tcam.c    |   6 +-
 .../net/ethernet/mellanox/mlxsw/spectrum_router.c  |  24 +-
 drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c |   2 +-
 drivers/net/ethernet/renesas/ravb_main.c           |   2 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac.h       |   1 +
 .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c   |  29 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |   1 +
 drivers/net/ethernet/ti/am65-cpsw-nuss.c           |   5 +-
 drivers/net/netdevsim/netdev.c                     |   9 +-
 drivers/net/phy/micrel.c                           |   9 +
 drivers/net/usb/r8152.c                            |  16 +-
 drivers/net/wireless/ath/ath11k/ahb.c              |   4 +-
 drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c |   3 +-
 drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c   |   2 +-
 .../net/wireless/intel/iwlwifi/mvm/mld-mac80211.c  |   6 +-
 drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c  |  11 -
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c        |   2 +-
 drivers/net/wireless/marvell/libertas/Kconfig      |   2 -
 drivers/net/wireless/marvell/mwifiex/cfg80211.c    |   2 +
 drivers/net/wireless/marvell/mwifiex/fw.h          |   1 +
 drivers/net/wireless/marvell/mwifiex/ioctl.h       |   1 +
 drivers/net/wireless/marvell/mwifiex/sdio.c        |  21 +-
 drivers/net/wireless/marvell/mwifiex/sdio.h        |   2 +
 drivers/net/wireless/marvell/mwifiex/uap_cmd.c     |   8 +
 drivers/net/wireless/mediatek/mt76/eeprom.c        |   6 +-
 drivers/net/wireless/mediatek/mt76/mt76.h          |   3 +-
 drivers/net/wireless/mediatek/mt76/mt7615/sdio.c   |   2 +-
 drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h |   3 +-
 drivers/net/wireless/mediatek/mt76/mt7915/main.c   |   5 +-
 drivers/net/wireless/mediatek/mt76/mt7915/mmio.c   |   2 +-
 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c    |  11 +-
 drivers/net/wireless/mediatek/mt76/mt7921/sdio.c   |   4 +-
 .../net/wireless/mediatek/mt76/mt7921/sdio_mac.c   |   3 +-
 drivers/net/wireless/mediatek/mt76/mt7996/mac.c    |   4 +-
 drivers/net/wireless/mediatek/mt76/mt7996/mcu.h    |   2 +-
 drivers/net/wireless/mediatek/mt76/sdio.c          |  18 +-
 drivers/net/wireless/purelifi/plfxlc/usb.c         |   5 +-
 drivers/net/wireless/realtek/rtlwifi/pci.c         |  79 +----
 drivers/net/wireless/realtek/rtlwifi/pci.h         |   5 -
 .../net/wireless/realtek/rtlwifi/rtl8188ee/phy.c   |  14 +-
 .../wireless/realtek/rtlwifi/rtl8192c/phy_common.c |  12 +-
 .../wireless/realtek/rtlwifi/rtl8192c/phy_common.h |   1 -
 .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.c   |   6 +-
 .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.h   |   1 -
 .../net/wireless/realtek/rtlwifi/rtl8192cu/phy.c   |   6 +-
 .../net/wireless/realtek/rtlwifi/rtl8192de/phy.c   |  15 +-
 .../net/wireless/realtek/rtlwifi/rtl8192ee/phy.c   |  16 +-
 .../net/wireless/realtek/rtlwifi/rtl8192se/phy.c   |  15 +-
 .../net/wireless/realtek/rtlwifi/rtl8821ae/phy.c   |   5 +-
 drivers/net/wireless/realtek/rtlwifi/wifi.h        |   7 +
 drivers/net/wireless/realtek/rtw88/mac80211.c      |   4 +-
 drivers/net/wireless/realtek/rtw88/sdio.c          |  35 ++-
 drivers/net/xen-netback/netback.c                  |  44 ++-
 drivers/nvme/target/tcp.c                          |  20 +-
 drivers/nvme/target/trace.h                        |   5 +-
 drivers/of/base.c                                  |   1 +
 drivers/of/unittest-data/tests-phandle.dtsi        |  10 +-
 drivers/of/unittest.c                              |  74 +++--
 drivers/pci/controller/dwc/pci-keystone.c          |   9 +
 drivers/pci/controller/dwc/pcie-designware-ep.c    |   1 +
 drivers/pci/controller/pcie-mediatek-gen3.c        |  85 +++---
 drivers/pci/controller/pcie-mediatek.c             |  10 +-
 drivers/pci/endpoint/functions/pci-epf-mhi.c       |  66 ++--
 drivers/perf/arm-cmn.c                             |   2 +-
 drivers/perf/hisilicon/hisi_uncore_uc_pmu.c        |   4 +-
 drivers/platform/x86/intel/vsec.c                  |  25 +-
 drivers/platform/x86/intel/vsec.h                  |   1 +
 drivers/power/supply/bq256xx_charger.c             |   5 +-
 drivers/power/supply/cw2015_battery.c              |   2 +-
 drivers/power/supply/qcom_pmi8998_charger.c        |   4 +
 drivers/pwm/core.c                                 |   2 +-
 drivers/pwm/pwm-jz4740.c                           |   7 +-
 drivers/pwm/pwm-stm32.c                            |  31 +-
 drivers/scsi/bfa/bfad_bsg.c                        |   2 +-
 drivers/scsi/fnic/fnic_debugfs.c                   |   3 +-
 drivers/scsi/hisi_sas/hisi_sas_main.c              |  11 +-
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c             |   9 +-
 drivers/scsi/mpi3mr/mpi3mr_app.c                   |  16 +
 drivers/scsi/mpi3mr/mpi3mr_os.c                    |  19 +-
 drivers/soc/qcom/llcc-qcom.c                       |  10 +-
 drivers/spi/Kconfig                                |   3 +-
 drivers/spi/spi-cadence-quadspi.c                  |   4 +-
 drivers/spi/spi-coldfire-qspi.c                    |   1 -
 drivers/spi/spi-sh-msiof.c                         |  17 ++
 drivers/spmi/spmi-mtk-pmif.c                       |  20 +-
 drivers/staging/media/rkvdec/rkvdec.c              |   3 +
 drivers/target/target_core_file.c                  |  10 +-
 drivers/thermal/loongson2_thermal.c                |   2 +-
 drivers/thermal/thermal_core.c                     |   1 -
 drivers/tty/serial/8250/8250_bcm2835aux.c          |   2 +
 drivers/tty/serial/8250/8250_exar.c                |   5 +-
 drivers/tty/serial/8250/8250_omap.c                |   2 +-
 drivers/tty/serial/apbuart.c                       |   2 +-
 drivers/tty/serial/imx.c                           |  36 +--
 drivers/tty/serial/omap-serial.c                   |  27 +-
 drivers/tty/serial/sc16is7xx.c                     |   8 +-
 drivers/tty/serial/serial_core.c                   |  33 +-
 drivers/tty/tty_io.c                               |  31 +-
 drivers/ufs/core/ufshcd.c                          |   7 +-
 drivers/ufs/host/ufs-qcom.c                        |   4 +-
 drivers/usb/cdns3/cdns3-gadget.c                   | 142 ++++++---
 drivers/usb/cdns3/cdns3-gadget.h                   |   3 +
 drivers/usb/chipidea/core.c                        |   7 +
 drivers/usb/class/cdc-acm.c                        |   3 +
 drivers/usb/core/generic.c                         |  16 +
 drivers/usb/dwc3/core.c                            |  39 +--
 drivers/usb/dwc3/ep0.c                             |   5 +-
 drivers/usb/dwc3/gadget.c                          |  19 +-
 drivers/usb/gadget/function/f_uvc.c                |  63 ++--
 drivers/usb/gadget/function/u_uvc.h                |   6 +
 drivers/usb/gadget/legacy/webcam.c                 | 333 ++++++++++++++++-----
 drivers/usb/host/xhci-mtk.c                        |  40 ++-
 drivers/usb/host/xhci-mtk.h                        |   2 +
 drivers/usb/mon/mon_bin.c                          |   7 +-
 drivers/usb/phy/phy-mxs-usb.c                      |   3 +-
 drivers/usb/typec/class.c                          |   4 +-
 drivers/vdpa/alibaba/eni_vdpa.c                    |   6 +-
 drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c     |   7 +-
 drivers/vfio/pci/pds/dirty.c                       |   6 +-
 drivers/vhost/vsock.c                              |   1 +
 drivers/video/fbdev/acornfb.c                      |   2 +-
 drivers/video/fbdev/core/fb_defio.c                |   8 +-
 drivers/video/fbdev/imxfb.c                        |  27 +-
 drivers/watchdog/bcm2835_wdt.c                     |   3 +-
 drivers/watchdog/hpwdt.c                           |   2 +-
 drivers/watchdog/rti_wdt.c                         |  13 +-
 drivers/watchdog/watchdog_dev.c                    |   3 +-
 fs/ceph/Kconfig                                    |   1 +
 fs/dlm/debug_fs.c                                  |   2 +-
 fs/efivarfs/super.c                                |  15 +
 fs/erofs/compress.h                                |   6 +
 fs/erofs/decompressor.c                            |  62 +++-
 fs/erofs/decompressor_deflate.c                    |   5 +-
 fs/erofs/decompressor_lzma.c                       |   4 +-
 fs/erofs/internal.h                                |  38 +--
 fs/erofs/super.c                                   |  72 +----
 fs/erofs/zdata.c                                   |   5 +-
 fs/erofs/zmap.c                                    |  23 +-
 fs/f2fs/data.c                                     |   7 +-
 fs/f2fs/file.c                                     |   7 +-
 fs/f2fs/namei.c                                    |   2 +-
 fs/f2fs/node.c                                     |   6 +-
 fs/f2fs/xattr.c                                    |  11 +-
 fs/gfs2/quota.c                                    |   3 +-
 fs/gfs2/rgrp.c                                     |   2 +-
 fs/namespace.c                                     |  11 +
 fs/nfs/blocklayout/blocklayout.c                   |   7 +-
 fs/nfs/dir.c                                       |   2 +-
 fs/nfs/direct.c                                    |   5 +-
 fs/nfs/internal.h                                  |   2 +-
 fs/nfs/nfs4proc.c                                  |   3 +
 fs/nfs/pnfs.c                                      |   3 +-
 fs/pstore/ram_core.c                               |   2 +-
 fs/smb/server/asn1.c                               |   5 +
 fs/smb/server/connection.c                         |   6 -
 fs/smb/server/connection.h                         |   2 +-
 fs/smb/server/oplock.c                             |   6 +
 fs/smb/server/smb2pdu.c                            |  22 +-
 fs/smb/server/smb_common.c                         |   6 +-
 fs/smb/server/transport_rdma.c                     |  11 +-
 fs/smb/server/transport_tcp.c                      |  13 +-
 include/asm-generic/cmpxchg-local.h                |   2 +-
 include/crypto/if_alg.h                            |   3 +
 include/drm/display/drm_dp_mst_helper.h            |   2 +-
 include/drm/drm_bridge.h                           |   2 +-
 include/dt-bindings/clock/qcom,videocc-sm8150.h    |   4 +
 include/linux/bio.h                                |   9 +-
 include/linux/bpf.h                                |  13 +-
 include/linux/bpf_mem_alloc.h                      |   1 +
 include/linux/clk-provider.h                       |   4 +-
 include/linux/gpio/driver.h                        |   6 +
 include/linux/hisi_acc_qm.h                        |  20 +-
 include/linux/iio/adc/adi-axi-adc.h                |   4 +
 include/linux/mhi_ep.h                             |  19 +-
 include/linux/netfilter_bridge.h                   |   6 +-
 include/linux/pci.h                                |  12 +-
 include/linux/rcupdate.h                           |   6 +
 include/linux/skbuff.h                             |   2 +-
 include/linux/srcu.h                               |   2 +-
 include/linux/usb.h                                |   6 +
 include/linux/virtio_net.h                         |   9 +-
 include/linux/virtio_vsock.h                       |   1 +
 include/net/af_vsock.h                             |   2 +-
 include/net/bluetooth/hci_core.h                   |   1 -
 include/net/netdev_queues.h                        |   2 +-
 include/uapi/linux/bpf.h                           |   3 +
 init/do_mounts.c                                   |   9 +-
 io_uring/io_uring.c                                |  22 +-
 io_uring/rw.c                                      |  10 +-
 kernel/bpf/arraymap.c                              |  12 +-
 kernel/bpf/hashtab.c                               |   6 +-
 kernel/bpf/lpm_trie.c                              |   3 +
 kernel/bpf/map_in_map.c                            |  13 +-
 kernel/bpf/map_in_map.h                            |   2 +-
 kernel/bpf/memalloc.c                              |  94 +-----
 kernel/bpf/stackmap.c                              |  11 +-
 kernel/bpf/syscall.c                               |  47 ++-
 kernel/bpf/verifier.c                              |  96 +++---
 kernel/debug/kdb/kdb_main.c                        |   2 -
 kernel/dma/coherent.c                              |   4 +-
 kernel/sched/fair.c                                |  20 +-
 kernel/time/tick-sched.c                           |   5 +
 kernel/trace/bpf_trace.c                           |   7 +
 lib/kunit/debugfs.c                                |   4 +-
 net/bluetooth/hci_conn.c                           |   8 +-
 net/bluetooth/hci_debugfs.c                        |  12 +-
 net/bluetooth/hci_event.c                          |  11 +-
 net/bridge/br_netfilter_hooks.c                    |  42 ++-
 net/bridge/br_netfilter_ipv6.c                     |  14 +-
 net/core/rtnetlink.c                               |  14 +-
 net/dns_resolver/dns_key.c                         |   2 +-
 net/ethtool/features.c                             |   9 +-
 net/ipv4/af_inet.c                                 |   1 +
 net/ipv4/ipmr.c                                    |  13 +-
 net/ipv4/netfilter/nf_reject_ipv4.c                |   9 +-
 net/ipv4/udp.c                                     |  34 +--
 net/ipv6/ip6_tunnel.c                              |  26 +-
 net/ipv6/mcast.c                                   |   4 +
 net/ipv6/netfilter/nf_reject_ipv6.c                |  11 +-
 net/ipv6/udp.c                                     |  16 +-
 net/mptcp/options.c                                |   6 +-
 net/mptcp/subflow.c                                |  17 +-
 net/ncsi/internal.h                                |   7 +-
 net/ncsi/ncsi-netlink.c                            |   4 +-
 net/ncsi/ncsi-pkt.h                                |   7 +-
 net/ncsi/ncsi-rsp.c                                |  26 +-
 net/netfilter/ipset/ip_set_hash_netiface.c         |   8 +-
 net/netfilter/ipvs/ip_vs_xmit.c                    |   4 +-
 net/netfilter/nf_log_syslog.c                      |  13 +-
 net/netfilter/nf_queue.c                           |   6 +-
 net/netfilter/nf_tables_api.c                      |  38 ++-
 net/netfilter/nfnetlink_log.c                      |   8 +-
 net/netfilter/nft_limit.c                          |  19 +-
 net/netfilter/xt_physdev.c                         |   2 +-
 net/netlabel/netlabel_calipso.c                    |  49 +--
 net/rxrpc/ar-internal.h                            |   1 +
 net/rxrpc/call_object.c                            |   4 +-
 net/rxrpc/local_object.c                           |  13 +-
 net/rxrpc/output.c                                 |   6 +-
 net/rxrpc/rxkad.c                                  |   2 +
 net/sched/act_ct.c                                 |  12 +-
 net/sctp/socket.c                                  |  13 +-
 net/sunrpc/xprtmultipath.c                         |   2 +-
 net/tls/tls_sw.c                                   |   6 +-
 net/unix/unix_bpf.c                                |  21 +-
 net/vmw_vsock/af_vsock.c                           |   9 +-
 net/vmw_vsock/hyperv_transport.c                   |   4 +-
 net/vmw_vsock/virtio_transport.c                   |   1 +
 net/vmw_vsock/virtio_transport_common.c            |  43 ++-
 net/vmw_vsock/vsock_loopback.c                     |   1 +
 net/wireless/scan.c                                |  47 ++-
 rust/bindgen_parameters                            |   4 +
 security/apparmor/lib.c                            |   1 +
 security/apparmor/lsm.c                            |   1 -
 security/apparmor/policy_unpack.c                  |  11 +-
 security/keys/encrypted-keys/encrypted.c           |   4 +
 security/selinux/hooks.c                           |   7 +
 sound/pci/hda/patch_hdmi.c                         |   6 +
 sound/pci/hda/patch_realtek.c                      |   3 +
 sound/pci/oxygen/oxygen_mixer.c                    |   2 +-
 sound/soc/amd/vangogh/acp5x-mach.c                 |  35 +--
 sound/soc/codecs/cs35l33.c                         |   4 +-
 sound/soc/codecs/rt5645.c                          |   8 -
 sound/soc/codecs/tas2781-fmwlib.c                  |   1 +
 .../soc/intel/boards/sof_sdw_rt_sdca_jack_common.c |   1 +
 sound/soc/intel/common/soc-acpi-intel-glk-match.c  |  14 +-
 sound/soc/mediatek/common/mtk-dsp-sof-common.c     |   2 +-
 sound/soc/sof/ipc4-loader.c                        |  11 +-
 sound/soc/sof/topology.c                           |   2 +-
 sound/usb/mixer_scarlett_gen2.c                    | 223 +++++++++-----
 tools/include/uapi/linux/bpf.h                     |   3 +
 tools/lib/api/io.h                                 |   1 +
 tools/perf/builtin-stat.c                          |  18 +-
 .../arch/arm64/ampere/ampereone/core-imp-def.json  |   2 +-
 .../attr/test-record-user-regs-no-sve-aarch64      |   2 +-
 .../tests/attr/test-record-user-regs-sve-aarch64   |   2 +-
 tools/perf/tests/workloads/thloop.c                |   4 +-
 tools/perf/util/bpf-event.c                        |   8 +-
 tools/perf/util/bpf-event.h                        |  12 +-
 tools/perf/util/db-export.c                        |   4 +-
 tools/perf/util/env.c                              |  50 ++--
 tools/perf/util/env.h                              |   4 +
 tools/perf/util/genelf.c                           |   6 +-
 tools/perf/util/header.c                           |  17 +-
 tools/perf/util/hisi-ptt.c                         |   1 +
 tools/perf/util/mem-events.c                       |  25 +-
 tools/perf/util/stat-shadow.c                      |   2 +-
 tools/perf/util/unwind-libdw.c                     |  21 +-
 tools/perf/util/unwind-libunwind-local.c           |   2 +-
 tools/testing/selftests/alsa/conf.c                |   2 +-
 tools/testing/selftests/alsa/mixer-test.c          |   4 +-
 tools/testing/selftests/bpf/prog_tests/bpf_iter.c  |   2 +
 tools/testing/selftests/bpf/prog_tests/time_tai.c  |   2 +-
 .../selftests/bpf/progs/bpf_iter_task_stack.c      |   5 +
 .../selftests/bpf/progs/test_global_func16.c       |   2 +-
 .../selftests/bpf/progs/verifier_basic_stack.c     |   8 +-
 .../testing/selftests/bpf/progs/verifier_int_ptr.c |   5 +-
 .../selftests/bpf/progs/verifier_raw_stack.c       |   5 +-
 .../testing/selftests/bpf/progs/verifier_var_off.c |  62 +++-
 .../selftests/bpf/progs/xdp_synproxy_kern.c        |   4 +-
 .../selftests/bpf/verifier/atomic_cmpxchg.c        |  11 -
 tools/testing/selftests/bpf/verifier/calls.c       |   4 +-
 .../drivers/net/bonding/mode-1-recovery-updelay.sh |   2 +-
 .../drivers/net/bonding/mode-2-recovery-updelay.sh |   2 +-
 .../testing/selftests/drivers/net/mlxsw/qos_pfc.sh |  18 +-
 .../drivers/net/mlxsw/spectrum-2/tc_flower.sh      | 106 ++++++-
 .../selftests/net/arp_ndisc_untracked_subnets.sh   |   2 +-
 .../selftests/net/fib_nexthop_multiprefix.sh       |   4 +-
 tools/testing/selftests/powerpc/math/fpu_preempt.c |   9 +-
 tools/testing/selftests/powerpc/math/vmx_preempt.c |  10 +-
 tools/testing/selftests/sgx/Makefile               |   2 +-
 tools/testing/selftests/sgx/load.c                 |   9 +-
 tools/testing/selftests/sgx/sigstruct.c            |   5 +-
 tools/testing/selftests/sgx/test_encl.c            |   8 +-
 584 files changed, 5326 insertions(+), 3284 deletions(-)



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 001/583] x86/lib: Fix overflow when counting digits
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
@ 2024-01-22 23:50 ` Greg Kroah-Hartman
  2024-01-22 23:50 ` [PATCH 6.6 002/583] x86/mce/inject: Clear test status value Greg Kroah-Hartman
                   ` (588 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:50 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Colin Ian King, Dave Hansen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Colin Ian King <colin.i.king@gmail.com>

[ Upstream commit a24d61c609813963aacc9f6ec8343f4fcaac7243 ]

tl;dr: The num_digits() function has a theoretical overflow issue.
But it doesn't affect any actual in-tree users.  Fix it by using
a larger type for one of the local variables.

Long version:

There is an overflow in variable m in function num_digits when val
is >= 1410065408 which leads to the digit calculation loop to
iterate more times than required. This results in either more
digits being counted or in some cases (for example where val is
1932683193) the value of m eventually overflows to zero and the
while loop spins forever).

Currently the function num_digits is currently only being used for
small values of val in the SMP boot stage for digit counting on the
number of cpus and NUMA nodes, so the overflow is never encountered.
However it is useful to fix the overflow issue in case the function
is used for other purposes in the future. (The issue was discovered
while investigating the digit counting performance in various
kernel helper functions rather than any real-world use-case).

The simplest fix is to make m a long long, the overhead in
multiplication speed for a long long is very minor for small values
of val less than 10000 on modern processors. The alternative
fix is to replace the multiplication with a constant division
by 10 loop (this compiles down to an multiplication and shift)
without needing to make m a long long, but this is slightly slower
than the fix in this commit when measured on a range of x86
processors).

[ dhansen: subject and changelog tweaks ]

Fixes: 646e29a1789a ("x86: Improve the printout of the SMP bootup CPU table")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/all/20231102174901.2590325-1-colin.i.king%40gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/x86/lib/misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/lib/misc.c b/arch/x86/lib/misc.c
index 92cd8ecc3a2c..40b81c338ae5 100644
--- a/arch/x86/lib/misc.c
+++ b/arch/x86/lib/misc.c
@@ -8,7 +8,7 @@
  */
 int num_digits(int val)
 {
-	int m = 10;
+	long long m = 10;
 	int d = 1;
 
 	if (val < 0) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 002/583] x86/mce/inject: Clear test status value
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
  2024-01-22 23:50 ` [PATCH 6.6 001/583] x86/lib: Fix overflow when counting digits Greg Kroah-Hartman
@ 2024-01-22 23:50 ` Greg Kroah-Hartman
  2024-01-22 23:50 ` [PATCH 6.6 003/583] EDAC/thunderx: Fix possible out-of-bounds string access Greg Kroah-Hartman
                   ` (587 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:50 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yazen Ghannam, Borislav Petkov (AMD),
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yazen Ghannam <yazen.ghannam@amd.com>

[ Upstream commit 6175b407756b22e7fdc771181b7d832ebdedef5c ]

AMD systems generally allow MCA "simulation" where MCA registers can be
written with valid data and the full MCA handling flow can be tested by
software.

However, the platform on Scalable MCA systems, can prevent software from
writing data to the MCA registers. There is no architectural way to
determine this configuration. Therefore, the MCE injection module will
check for this behavior by writing and reading back a test status value.
This is done during module init, and the check can run on any CPU with
any valid MCA bank.

If MCA_STATUS writes are ignored by the platform, then there are no side
effects on the hardware state.

If the writes are not ignored, then the test status value will remain in
the hardware MCA_STATUS register. It is likely that the value will not
be overwritten by hardware or software, since the tested CPU and bank
are arbitrary. Therefore, the user may see a spurious, synthetic MCA
error reported whenever MCA is polled for this CPU.

Clear the test value immediately after writing it. It is very unlikely
that a valid MCA error is logged by hardware during the test. Errors
that cause an #MC won't be affected.

Fixes: 891e465a1bd8 ("x86/mce: Check whether writes to MCA_STATUS are getting ignored")
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20231118193248.1296798-2-yazen.ghannam@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/x86/kernel/cpu/mce/inject.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/cpu/mce/inject.c b/arch/x86/kernel/cpu/mce/inject.c
index 4d8d4bcf915d..72f0695c3dc1 100644
--- a/arch/x86/kernel/cpu/mce/inject.c
+++ b/arch/x86/kernel/cpu/mce/inject.c
@@ -746,6 +746,7 @@ static void check_hw_inj_possible(void)
 
 		wrmsrl_safe(mca_msr_reg(bank, MCA_STATUS), status);
 		rdmsrl_safe(mca_msr_reg(bank, MCA_STATUS), &status);
+		wrmsrl_safe(mca_msr_reg(bank, MCA_STATUS), 0);
 
 		if (!status) {
 			hw_injection_possible = false;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 003/583] EDAC/thunderx: Fix possible out-of-bounds string access
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
  2024-01-22 23:50 ` [PATCH 6.6 001/583] x86/lib: Fix overflow when counting digits Greg Kroah-Hartman
  2024-01-22 23:50 ` [PATCH 6.6 002/583] x86/mce/inject: Clear test status value Greg Kroah-Hartman
@ 2024-01-22 23:50 ` Greg Kroah-Hartman
  2024-01-22 23:50 ` [PATCH 6.6 004/583] powerpc: add crtsavres.o to always-y instead of extra-y Greg Kroah-Hartman
                   ` (586 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:50 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Arnd Bergmann, Borislav Petkov (AMD),
	Gustavo A. R. Silva, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnd Bergmann <arnd@arndb.de>

[ Upstream commit 475c58e1a471e9b873e3e39958c64a2d278275c8 ]

Enabling -Wstringop-overflow globally exposes a warning for a common bug
in the usage of strncat():

  drivers/edac/thunderx_edac.c: In function 'thunderx_ocx_com_threaded_isr':
  drivers/edac/thunderx_edac.c:1136:17: error: 'strncat' specified bound 1024 equals destination size [-Werror=stringop-overflow=]
   1136 |                 strncat(msg, other, OCX_MESSAGE_SIZE);
        |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ...
   1145 |                                 strncat(msg, other, OCX_MESSAGE_SIZE);
   ...
   1150 |                                 strncat(msg, other, OCX_MESSAGE_SIZE);

   ...

Apparently the author of this driver expected strncat() to behave the
way that strlcat() does, which uses the size of the destination buffer
as its third argument rather than the length of the source buffer. The
result is that there is no check on the size of the allocated buffer.

Change it to strlcat().

  [ bp: Trim compiler output, fixup commit message. ]

Fixes: 41003396f932 ("EDAC, thunderx: Add Cavium ThunderX EDAC driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20231122222007.3199885-1-arnd@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/edac/thunderx_edac.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/edac/thunderx_edac.c b/drivers/edac/thunderx_edac.c
index b9c5772da959..90d46e5c4ff0 100644
--- a/drivers/edac/thunderx_edac.c
+++ b/drivers/edac/thunderx_edac.c
@@ -1133,7 +1133,7 @@ static irqreturn_t thunderx_ocx_com_threaded_isr(int irq, void *irq_id)
 		decode_register(other, OCX_OTHER_SIZE,
 				ocx_com_errors, ctx->reg_com_int);
 
-		strncat(msg, other, OCX_MESSAGE_SIZE);
+		strlcat(msg, other, OCX_MESSAGE_SIZE);
 
 		for (lane = 0; lane < OCX_RX_LANES; lane++)
 			if (ctx->reg_com_int & BIT(lane)) {
@@ -1142,12 +1142,12 @@ static irqreturn_t thunderx_ocx_com_threaded_isr(int irq, void *irq_id)
 					 lane, ctx->reg_lane_int[lane],
 					 lane, ctx->reg_lane_stat11[lane]);
 
-				strncat(msg, other, OCX_MESSAGE_SIZE);
+				strlcat(msg, other, OCX_MESSAGE_SIZE);
 
 				decode_register(other, OCX_OTHER_SIZE,
 						ocx_lane_errors,
 						ctx->reg_lane_int[lane]);
-				strncat(msg, other, OCX_MESSAGE_SIZE);
+				strlcat(msg, other, OCX_MESSAGE_SIZE);
 			}
 
 		if (ctx->reg_com_int & OCX_COM_INT_CE)
@@ -1217,7 +1217,7 @@ static irqreturn_t thunderx_ocx_lnk_threaded_isr(int irq, void *irq_id)
 		decode_register(other, OCX_OTHER_SIZE,
 				ocx_com_link_errors, ctx->reg_com_link_int);
 
-		strncat(msg, other, OCX_MESSAGE_SIZE);
+		strlcat(msg, other, OCX_MESSAGE_SIZE);
 
 		if (ctx->reg_com_link_int & OCX_COM_LINK_INT_UE)
 			edac_device_handle_ue(ocx->edac_dev, 0, 0, msg);
@@ -1896,7 +1896,7 @@ static irqreturn_t thunderx_l2c_threaded_isr(int irq, void *irq_id)
 
 		decode_register(other, L2C_OTHER_SIZE, l2_errors, ctx->reg_int);
 
-		strncat(msg, other, L2C_MESSAGE_SIZE);
+		strlcat(msg, other, L2C_MESSAGE_SIZE);
 
 		if (ctx->reg_int & mask_ue)
 			edac_device_handle_ue(l2c->edac_dev, 0, 0, msg);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 004/583] powerpc: add crtsavres.o to always-y instead of extra-y
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (2 preceding siblings ...)
  2024-01-22 23:50 ` [PATCH 6.6 003/583] EDAC/thunderx: Fix possible out-of-bounds string access Greg Kroah-Hartman
@ 2024-01-22 23:50 ` Greg Kroah-Hartman
  2024-01-22 23:50 ` [PATCH 6.6 005/583] x86: Fix CPUIDLE_FLAG_IRQ_ENABLE leaking timer reprogram Greg Kroah-Hartman
                   ` (585 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:50 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Masahiro Yamada, Nicholas Piggin,
	Michael Ellerman, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Masahiro Yamada <masahiroy@kernel.org>

[ Upstream commit 1b1e38002648819c04773647d5242990e2824264 ]

crtsavres.o is linked to modules. However, as explained in commit
d0e628cd817f ("kbuild: doc: clarify the difference between extra-y
and always-y"), 'make modules' does not build extra-y.

For example, the following command fails:

  $ make ARCH=powerpc LLVM=1 KBUILD_MODPOST_WARN=1 mrproper ps3_defconfig modules
    [snip]
    LD [M]  arch/powerpc/platforms/cell/spufs/spufs.ko
  ld.lld: error: cannot open arch/powerpc/lib/crtsavres.o: No such file or directory
  make[3]: *** [scripts/Makefile.modfinal:56: arch/powerpc/platforms/cell/spufs/spufs.ko] Error 1
  make[2]: *** [Makefile:1844: modules] Error 2
  make[1]: *** [/home/masahiro/workspace/linux-kbuild/Makefile:350: __build_one_by_one] Error 2
  make: *** [Makefile:234: __sub-make] Error 2

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Fixes: baa25b571a16 ("powerpc/64: Do not link crtsavres.o in vmlinux")
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231120232332.4100288-1-masahiroy@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/powerpc/lib/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 51ad0397c17a..6eac63e79a89 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -45,7 +45,7 @@ obj-$(CONFIG_FUNCTION_ERROR_INJECTION)	+= error-inject.o
 # so it is only needed for modules, and only for older linkers which
 # do not support --save-restore-funcs
 ifndef CONFIG_LD_IS_BFD
-extra-$(CONFIG_PPC64)	+= crtsavres.o
+always-$(CONFIG_PPC64)	+= crtsavres.o
 endif
 
 obj-$(CONFIG_PPC_BOOK3S_64) += copyuser_power7.o copypage_power7.o \
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 005/583] x86: Fix CPUIDLE_FLAG_IRQ_ENABLE leaking timer reprogram
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (3 preceding siblings ...)
  2024-01-22 23:50 ` [PATCH 6.6 004/583] powerpc: add crtsavres.o to always-y instead of extra-y Greg Kroah-Hartman
@ 2024-01-22 23:50 ` Greg Kroah-Hartman
  2024-01-22 23:50 ` [PATCH 6.6 006/583] powerpc/44x: select I2C for CURRITUCK Greg Kroah-Hartman
                   ` (584 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:50 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Peter Zijlstra (Intel),
	Frederic Weisbecker, Rafael J. Wysocki, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Peter Zijlstra <peterz@infradead.org>

[ Upstream commit edc8fc01f608108b0b7580cb2c29dfb5135e5f0e ]

intel_idle_irq() re-enables IRQs very early. As a result, an interrupt
may fire before mwait() is eventually called. If such an interrupt queues
a timer, it may go unnoticed until mwait returns and the idle loop
handles the tick re-evaluation. And monitoring TIF_NEED_RESCHED doesn't
help because a local timer enqueue doesn't set that flag.

The issue is mitigated by the fact that this idle handler is only invoked
for shallow C-states when, presumably, the next tick is supposed to be
close enough. There may still be rare cases though when the next tick
is far away and the selected C-state is shallow, resulting in a timer
getting ignored for a while.

Fix this with using sti_mwait() whose IRQ-reenablement only triggers
upon calling mwait(), dealing with the race while keeping the interrupt
latency within acceptable bounds.

Fixes: c227233ad64c (intel_idle: enable interrupts before C1 on Xeons)
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lkml.kernel.org/r/20231115151325.6262-3-frederic@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/x86/include/asm/mwait.h | 11 +++++++++--
 drivers/idle/intel_idle.c    | 19 +++++++------------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/arch/x86/include/asm/mwait.h b/arch/x86/include/asm/mwait.h
index 778df05f8539..bae83810505b 100644
--- a/arch/x86/include/asm/mwait.h
+++ b/arch/x86/include/asm/mwait.h
@@ -115,8 +115,15 @@ static __always_inline void mwait_idle_with_hints(unsigned long eax, unsigned lo
 		}
 
 		__monitor((void *)&current_thread_info()->flags, 0, 0);
-		if (!need_resched())
-			__mwait(eax, ecx);
+
+		if (!need_resched()) {
+			if (ecx & 1) {
+				__mwait(eax, ecx);
+			} else {
+				__sti_mwait(eax, ecx);
+				raw_local_irq_disable();
+			}
+		}
 	}
 	current_clr_polling();
 }
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index ea5a6a14c553..45500d2d5b4b 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -131,11 +131,12 @@ static unsigned int mwait_substates __initdata;
 #define MWAIT2flg(eax) ((eax & 0xFF) << 24)
 
 static __always_inline int __intel_idle(struct cpuidle_device *dev,
-					struct cpuidle_driver *drv, int index)
+					struct cpuidle_driver *drv,
+					int index, bool irqoff)
 {
 	struct cpuidle_state *state = &drv->states[index];
 	unsigned long eax = flg2MWAIT(state->flags);
-	unsigned long ecx = 1; /* break on interrupt flag */
+	unsigned long ecx = 1*irqoff; /* break on interrupt flag */
 
 	mwait_idle_with_hints(eax, ecx);
 
@@ -159,19 +160,13 @@ static __always_inline int __intel_idle(struct cpuidle_device *dev,
 static __cpuidle int intel_idle(struct cpuidle_device *dev,
 				struct cpuidle_driver *drv, int index)
 {
-	return __intel_idle(dev, drv, index);
+	return __intel_idle(dev, drv, index, true);
 }
 
 static __cpuidle int intel_idle_irq(struct cpuidle_device *dev,
 				    struct cpuidle_driver *drv, int index)
 {
-	int ret;
-
-	raw_local_irq_enable();
-	ret = __intel_idle(dev, drv, index);
-	raw_local_irq_disable();
-
-	return ret;
+	return __intel_idle(dev, drv, index, false);
 }
 
 static __cpuidle int intel_idle_ibrs(struct cpuidle_device *dev,
@@ -184,7 +179,7 @@ static __cpuidle int intel_idle_ibrs(struct cpuidle_device *dev,
 	if (smt_active)
 		native_wrmsrl(MSR_IA32_SPEC_CTRL, 0);
 
-	ret = __intel_idle(dev, drv, index);
+	ret = __intel_idle(dev, drv, index, true);
 
 	if (smt_active)
 		native_wrmsrl(MSR_IA32_SPEC_CTRL, spec_ctrl);
@@ -196,7 +191,7 @@ static __cpuidle int intel_idle_xstate(struct cpuidle_device *dev,
 				       struct cpuidle_driver *drv, int index)
 {
 	fpu_idle_fpregs();
-	return __intel_idle(dev, drv, index);
+	return __intel_idle(dev, drv, index, true);
 }
 
 /**
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 006/583] powerpc/44x: select I2C for CURRITUCK
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (4 preceding siblings ...)
  2024-01-22 23:50 ` [PATCH 6.6 005/583] x86: Fix CPUIDLE_FLAG_IRQ_ENABLE leaking timer reprogram Greg Kroah-Hartman
@ 2024-01-22 23:50 ` Greg Kroah-Hartman
  2024-01-22 23:50 ` [PATCH 6.6 007/583] powerpc/pseries/memhp: Fix access beyond end of drmem array Greg Kroah-Hartman
                   ` (583 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:50 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Randy Dunlap, kernel test robot,
	Michael Ellerman, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Randy Dunlap <rdunlap@infradead.org>

[ Upstream commit 4a74197b65e69c46fe6e53f7df2f4d6ce9ffe012 ]

Fix build errors when CURRITUCK=y and I2C is not builtin (=m or is
not set). Fixes these build errors:

powerpc-linux-ld: arch/powerpc/platforms/44x/ppc476.o: in function `avr_halt_system':
ppc476.c:(.text+0x58): undefined reference to `i2c_smbus_write_byte_data'
powerpc-linux-ld: arch/powerpc/platforms/44x/ppc476.o: in function `ppc47x_device_probe':
ppc476.c:(.init.text+0x18): undefined reference to `i2c_register_driver'

Fixes: 2a2c74b2efcb ("IBM Akebono: Add the Akebono platform")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: lore.kernel.org/r/202312010820.cmdwF5X9-lkp@intel.com
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231201055159.8371-1-rdunlap@infradead.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/powerpc/platforms/44x/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 1624ebf95497..35a1f4b9f827 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -173,6 +173,7 @@ config ISS4xx
 config CURRITUCK
 	bool "IBM Currituck (476fpe) Support"
 	depends on PPC_47x
+	select I2C
 	select SWIOTLB
 	select 476FPE
 	select FORCE_PCI
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 007/583] powerpc/pseries/memhp: Fix access beyond end of drmem array
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (5 preceding siblings ...)
  2024-01-22 23:50 ` [PATCH 6.6 006/583] powerpc/44x: select I2C for CURRITUCK Greg Kroah-Hartman
@ 2024-01-22 23:50 ` Greg Kroah-Hartman
  2024-01-22 23:50 ` [PATCH 6.6 008/583] perf/arm-cmn: Fix HN-F class_occup_id events Greg Kroah-Hartman
                   ` (582 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:50 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nathan Lynch, Michael Ellerman, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nathan Lynch <nathanl@linux.ibm.com>

[ Upstream commit bd68ffce69f6cf8ddd3a3c32549d1d2275e49fc5 ]

dlpar_memory_remove_by_index() may access beyond the bounds of the
drmem lmb array when the LMB lookup fails to match an entry with the
given DRC index. When the search fails, the cursor is left pointing to
&drmem_info->lmbs[drmem_info->n_lmbs], which is one element past the
last valid entry in the array. The debug message at the end of the
function then dereferences this pointer:

        pr_debug("Failed to hot-remove memory at %llx\n",
                 lmb->base_addr);

This was found by inspection and confirmed with KASAN:

  pseries-hotplug-mem: Attempting to hot-remove LMB, drc index 1234
  ==================================================================
  BUG: KASAN: slab-out-of-bounds in dlpar_memory+0x298/0x1658
  Read of size 8 at addr c000000364e97fd0 by task bash/949

  dump_stack_lvl+0xa4/0xfc (unreliable)
  print_report+0x214/0x63c
  kasan_report+0x140/0x2e0
  __asan_load8+0xa8/0xe0
  dlpar_memory+0x298/0x1658
  handle_dlpar_errorlog+0x130/0x1d0
  dlpar_store+0x18c/0x3e0
  kobj_attr_store+0x68/0xa0
  sysfs_kf_write+0xc4/0x110
  kernfs_fop_write_iter+0x26c/0x390
  vfs_write+0x2d4/0x4e0
  ksys_write+0xac/0x1a0
  system_call_exception+0x268/0x530
  system_call_vectored_common+0x15c/0x2ec

  Allocated by task 1:
   kasan_save_stack+0x48/0x80
   kasan_set_track+0x34/0x50
   kasan_save_alloc_info+0x34/0x50
   __kasan_kmalloc+0xd0/0x120
   __kmalloc+0x8c/0x320
   kmalloc_array.constprop.0+0x48/0x5c
   drmem_init+0x2a0/0x41c
   do_one_initcall+0xe0/0x5c0
   kernel_init_freeable+0x4ec/0x5a0
   kernel_init+0x30/0x1e0
   ret_from_kernel_user_thread+0x14/0x1c

  The buggy address belongs to the object at c000000364e80000
   which belongs to the cache kmalloc-128k of size 131072
  The buggy address is located 0 bytes to the right of
   allocated 98256-byte region [c000000364e80000, c000000364e97fd0)

  ==================================================================
  pseries-hotplug-mem: Failed to hot-remove memory at 0

Log failed lookups with a separate message and dereference the
cursor only when it points to a valid entry.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Fixes: 51925fb3c5c9 ("powerpc/pseries: Implement memory hotplug remove in the kernel")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231114-pseries-memhp-fixes-v1-1-fb8f2bb7c557@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/powerpc/platforms/pseries/hotplug-memory.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index aa4042dcd6d4..4adca5b61dab 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -435,14 +435,15 @@ static int dlpar_memory_remove_by_index(u32 drc_index)
 		}
 	}
 
-	if (!lmb_found)
+	if (!lmb_found) {
+		pr_debug("Failed to look up LMB for drc index %x\n", drc_index);
 		rc = -EINVAL;
-
-	if (rc)
+	} else if (rc) {
 		pr_debug("Failed to hot-remove memory at %llx\n",
 			 lmb->base_addr);
-	else
+	} else {
 		pr_debug("Memory at %llx was hot-removed\n", lmb->base_addr);
+	}
 
 	return rc;
 }
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 008/583] perf/arm-cmn: Fix HN-F class_occup_id events
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (6 preceding siblings ...)
  2024-01-22 23:50 ` [PATCH 6.6 007/583] powerpc/pseries/memhp: Fix access beyond end of drmem array Greg Kroah-Hartman
@ 2024-01-22 23:50 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 009/583] drivers/perf: hisi: Fix some event id for HiSilicon UC pmu Greg Kroah-Hartman
                   ` (581 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:50 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jing Zhang, Robin Murphy,
	Will Deacon, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Robin Murphy <robin.murphy@arm.com>

[ Upstream commit 590f23b092401f29e410fd4ca67128fcc45192fc ]

A subtle copy-paste error managed to slip through the reorganisation
of these patches in development, and not only give some HN-F events
the wrong type, but use that wrong type before the subsequent patch
defined it. Too late to fix history, but we can at least fix the bug.

Fixes: b1b7dc38e482 ("perf/arm-cmn: Refactor HN-F event selector macros")
Reported-by: Jing Zhang <renyu.zj@linux.alibaba.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/5a22439de84ff188ef76674798052448eb03a3e1.1700740693.git.robin.murphy@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/perf/arm-cmn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index caae2d3e9d3e..6404b17d3aeb 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -811,7 +811,7 @@ static umode_t arm_cmn_event_attr_is_visible(struct kobject *kobj,
 #define CMN_EVENT_HNF_OCC(_model, _name, _event)			\
 	CMN_EVENT_HN_OCC(_model, hnf_##_name, CMN_TYPE_HNF, _event)
 #define CMN_EVENT_HNF_CLS(_model, _name, _event)			\
-	CMN_EVENT_HN_CLS(_model, hnf_##_name, CMN_TYPE_HNS, _event)
+	CMN_EVENT_HN_CLS(_model, hnf_##_name, CMN_TYPE_HNF, _event)
 #define CMN_EVENT_HNF_SNT(_model, _name, _event)			\
 	CMN_EVENT_HN_SNT(_model, hnf_##_name, CMN_TYPE_HNF, _event)
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 009/583] drivers/perf: hisi: Fix some event id for HiSilicon UC pmu
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (7 preceding siblings ...)
  2024-01-22 23:50 ` [PATCH 6.6 008/583] perf/arm-cmn: Fix HN-F class_occup_id events Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 010/583] KVM: PPC: Book3S HV: Use accessors for VCPU registers Greg Kroah-Hartman
                   ` (580 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Junhao He, Yicong Yang, Will Deacon,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Junhao He <hejunhao3@huawei.com>

[ Upstream commit 38bbef7240b8c5f2dc4493eec356e2efbf2da5f4 ]

Some event id of HiSilicon uncore UC PMU driver is incorrect, fix them.

Fixes: 312eca95e28d ("drivers/perf: hisi: Add support for HiSilicon UC PMU driver")
Signed-off-by: Junhao He <hejunhao3@huawei.com>
Reviewed-by: Yicong Yang <yangyicong@hisilicon.com>
Link: https://lore.kernel.org/r/20231204110425.20354-1-hejunhao3@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/perf/hisilicon/hisi_uncore_uc_pmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/perf/hisilicon/hisi_uncore_uc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_uc_pmu.c
index 63da05e5831c..636fb79647c8 100644
--- a/drivers/perf/hisilicon/hisi_uncore_uc_pmu.c
+++ b/drivers/perf/hisilicon/hisi_uncore_uc_pmu.c
@@ -383,8 +383,8 @@ static struct attribute *hisi_uc_pmu_events_attr[] = {
 	HISI_PMU_EVENT_ATTR(cpu_rd,		0x10),
 	HISI_PMU_EVENT_ATTR(cpu_rd64,		0x17),
 	HISI_PMU_EVENT_ATTR(cpu_rs64,		0x19),
-	HISI_PMU_EVENT_ATTR(cpu_mru,		0x1a),
-	HISI_PMU_EVENT_ATTR(cycles,		0x9c),
+	HISI_PMU_EVENT_ATTR(cpu_mru,		0x1c),
+	HISI_PMU_EVENT_ATTR(cycles,		0x95),
 	HISI_PMU_EVENT_ATTR(spipe_hit,		0xb3),
 	HISI_PMU_EVENT_ATTR(hpipe_hit,		0xdb),
 	HISI_PMU_EVENT_ATTR(cring_rxdat_cnt,	0xfa),
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 010/583] KVM: PPC: Book3S HV: Use accessors for VCPU registers
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (8 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 009/583] drivers/perf: hisi: Fix some event id for HiSilicon UC pmu Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 011/583] KVM: PPC: Book3S HV: Introduce low level MSR accessor Greg Kroah-Hartman
                   ` (579 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jordan Niethe, Michael Ellerman,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jordan Niethe <jniethe5@gmail.com>

[ Upstream commit ebc88ea7a6ad0ea349df9c765357d3aa4e662aa9 ]

Introduce accessor generator macros for Book3S HV VCPU registers. Use
the accessor functions to replace direct accesses to this registers.

This will be important later for Nested APIv2 support which requires
additional functionality for accessing and modifying VCPU state.

Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230914030600.16993-7-jniethe5@gmail.com
Stable-dep-of: ecd10702baae ("KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/powerpc/kvm/book3s_64_mmu_radix.c |   5 +-
 arch/powerpc/kvm/book3s_hv.c           | 148 +++++++++++++------------
 arch/powerpc/kvm/book3s_hv.h           |  58 ++++++++++
 3 files changed, 139 insertions(+), 72 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_64_mmu_radix.c b/arch/powerpc/kvm/book3s_64_mmu_radix.c
index 572707858d65..10aacbf92466 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_radix.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_radix.c
@@ -15,6 +15,7 @@
 
 #include <asm/kvm_ppc.h>
 #include <asm/kvm_book3s.h>
+#include "book3s_hv.h"
 #include <asm/page.h>
 #include <asm/mmu.h>
 #include <asm/pgalloc.h>
@@ -294,9 +295,9 @@ int kvmppc_mmu_radix_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
 	} else {
 		if (!(pte & _PAGE_PRIVILEGED)) {
 			/* Check AMR/IAMR to see if strict mode is in force */
-			if (vcpu->arch.amr & (1ul << 62))
+			if (kvmppc_get_amr_hv(vcpu) & (1ul << 62))
 				gpte->may_read = 0;
-			if (vcpu->arch.amr & (1ul << 63))
+			if (kvmppc_get_amr_hv(vcpu) & (1ul << 63))
 				gpte->may_write = 0;
 			if (vcpu->arch.iamr & (1ul << 62))
 				gpte->may_execute = 0;
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 130bafdb1430..7fa7fcebe8da 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -868,7 +868,7 @@ static int kvmppc_h_set_mode(struct kvm_vcpu *vcpu, unsigned long mflags,
 		/* Guests can't breakpoint the hypervisor */
 		if ((value1 & CIABR_PRIV) == CIABR_PRIV_HYPER)
 			return H_P3;
-		vcpu->arch.ciabr  = value1;
+		kvmppc_set_ciabr_hv(vcpu, value1);
 		return H_SUCCESS;
 	case H_SET_MODE_RESOURCE_SET_DAWR0:
 		if (!kvmppc_power8_compatible(vcpu))
@@ -879,8 +879,8 @@ static int kvmppc_h_set_mode(struct kvm_vcpu *vcpu, unsigned long mflags,
 			return H_UNSUPPORTED_FLAG_START;
 		if (value2 & DABRX_HYP)
 			return H_P4;
-		vcpu->arch.dawr0  = value1;
-		vcpu->arch.dawrx0 = value2;
+		kvmppc_set_dawr0_hv(vcpu, value1);
+		kvmppc_set_dawrx0_hv(vcpu, value2);
 		return H_SUCCESS;
 	case H_SET_MODE_RESOURCE_SET_DAWR1:
 		if (!kvmppc_power8_compatible(vcpu))
@@ -895,8 +895,8 @@ static int kvmppc_h_set_mode(struct kvm_vcpu *vcpu, unsigned long mflags,
 			return H_UNSUPPORTED_FLAG_START;
 		if (value2 & DABRX_HYP)
 			return H_P4;
-		vcpu->arch.dawr1  = value1;
-		vcpu->arch.dawrx1 = value2;
+		kvmppc_set_dawr1_hv(vcpu, value1);
+		kvmppc_set_dawrx1_hv(vcpu, value2);
 		return H_SUCCESS;
 	case H_SET_MODE_RESOURCE_ADDR_TRANS_MODE:
 		/*
@@ -1544,7 +1544,7 @@ static int kvmppc_pmu_unavailable(struct kvm_vcpu *vcpu)
 	if (!(vcpu->arch.hfscr_permitted & HFSCR_PM))
 		return EMULATE_FAIL;
 
-	vcpu->arch.hfscr |= HFSCR_PM;
+	kvmppc_set_hfscr_hv(vcpu, kvmppc_get_hfscr_hv(vcpu) | HFSCR_PM);
 
 	return RESUME_GUEST;
 }
@@ -1554,7 +1554,7 @@ static int kvmppc_ebb_unavailable(struct kvm_vcpu *vcpu)
 	if (!(vcpu->arch.hfscr_permitted & HFSCR_EBB))
 		return EMULATE_FAIL;
 
-	vcpu->arch.hfscr |= HFSCR_EBB;
+	kvmppc_set_hfscr_hv(vcpu, kvmppc_get_hfscr_hv(vcpu) | HFSCR_EBB);
 
 	return RESUME_GUEST;
 }
@@ -1564,7 +1564,7 @@ static int kvmppc_tm_unavailable(struct kvm_vcpu *vcpu)
 	if (!(vcpu->arch.hfscr_permitted & HFSCR_TM))
 		return EMULATE_FAIL;
 
-	vcpu->arch.hfscr |= HFSCR_TM;
+	kvmppc_set_hfscr_hv(vcpu, kvmppc_get_hfscr_hv(vcpu) | HFSCR_TM);
 
 	return RESUME_GUEST;
 }
@@ -1863,7 +1863,7 @@ static int kvmppc_handle_exit_hv(struct kvm_vcpu *vcpu,
 	 * Otherwise, we just generate a program interrupt to the guest.
 	 */
 	case BOOK3S_INTERRUPT_H_FAC_UNAVAIL: {
-		u64 cause = vcpu->arch.hfscr >> 56;
+		u64 cause = kvmppc_get_hfscr_hv(vcpu) >> 56;
 
 		r = EMULATE_FAIL;
 		if (cpu_has_feature(CPU_FTR_ARCH_300)) {
@@ -2207,64 +2207,64 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
 		*val = get_reg_val(id, vcpu->arch.dabrx);
 		break;
 	case KVM_REG_PPC_DSCR:
-		*val = get_reg_val(id, vcpu->arch.dscr);
+		*val = get_reg_val(id, kvmppc_get_dscr_hv(vcpu));
 		break;
 	case KVM_REG_PPC_PURR:
-		*val = get_reg_val(id, vcpu->arch.purr);
+		*val = get_reg_val(id, kvmppc_get_purr_hv(vcpu));
 		break;
 	case KVM_REG_PPC_SPURR:
-		*val = get_reg_val(id, vcpu->arch.spurr);
+		*val = get_reg_val(id, kvmppc_get_spurr_hv(vcpu));
 		break;
 	case KVM_REG_PPC_AMR:
-		*val = get_reg_val(id, vcpu->arch.amr);
+		*val = get_reg_val(id, kvmppc_get_amr_hv(vcpu));
 		break;
 	case KVM_REG_PPC_UAMOR:
-		*val = get_reg_val(id, vcpu->arch.uamor);
+		*val = get_reg_val(id, kvmppc_get_uamor_hv(vcpu));
 		break;
 	case KVM_REG_PPC_MMCR0 ... KVM_REG_PPC_MMCR1:
 		i = id - KVM_REG_PPC_MMCR0;
-		*val = get_reg_val(id, vcpu->arch.mmcr[i]);
+		*val = get_reg_val(id, kvmppc_get_mmcr_hv(vcpu, i));
 		break;
 	case KVM_REG_PPC_MMCR2:
-		*val = get_reg_val(id, vcpu->arch.mmcr[2]);
+		*val = get_reg_val(id, kvmppc_get_mmcr_hv(vcpu, 2));
 		break;
 	case KVM_REG_PPC_MMCRA:
-		*val = get_reg_val(id, vcpu->arch.mmcra);
+		*val = get_reg_val(id, kvmppc_get_mmcra_hv(vcpu));
 		break;
 	case KVM_REG_PPC_MMCRS:
 		*val = get_reg_val(id, vcpu->arch.mmcrs);
 		break;
 	case KVM_REG_PPC_MMCR3:
-		*val = get_reg_val(id, vcpu->arch.mmcr[3]);
+		*val = get_reg_val(id, kvmppc_get_mmcr_hv(vcpu, 3));
 		break;
 	case KVM_REG_PPC_PMC1 ... KVM_REG_PPC_PMC8:
 		i = id - KVM_REG_PPC_PMC1;
-		*val = get_reg_val(id, vcpu->arch.pmc[i]);
+		*val = get_reg_val(id, kvmppc_get_pmc_hv(vcpu, i));
 		break;
 	case KVM_REG_PPC_SPMC1 ... KVM_REG_PPC_SPMC2:
 		i = id - KVM_REG_PPC_SPMC1;
 		*val = get_reg_val(id, vcpu->arch.spmc[i]);
 		break;
 	case KVM_REG_PPC_SIAR:
-		*val = get_reg_val(id, vcpu->arch.siar);
+		*val = get_reg_val(id, kvmppc_get_siar_hv(vcpu));
 		break;
 	case KVM_REG_PPC_SDAR:
-		*val = get_reg_val(id, vcpu->arch.sdar);
+		*val = get_reg_val(id, kvmppc_get_siar_hv(vcpu));
 		break;
 	case KVM_REG_PPC_SIER:
-		*val = get_reg_val(id, vcpu->arch.sier[0]);
+		*val = get_reg_val(id, kvmppc_get_sier_hv(vcpu, 0));
 		break;
 	case KVM_REG_PPC_SIER2:
-		*val = get_reg_val(id, vcpu->arch.sier[1]);
+		*val = get_reg_val(id, kvmppc_get_sier_hv(vcpu, 1));
 		break;
 	case KVM_REG_PPC_SIER3:
-		*val = get_reg_val(id, vcpu->arch.sier[2]);
+		*val = get_reg_val(id, kvmppc_get_sier_hv(vcpu, 2));
 		break;
 	case KVM_REG_PPC_IAMR:
-		*val = get_reg_val(id, vcpu->arch.iamr);
+		*val = get_reg_val(id, kvmppc_get_iamr_hv(vcpu));
 		break;
 	case KVM_REG_PPC_PSPB:
-		*val = get_reg_val(id, vcpu->arch.pspb);
+		*val = get_reg_val(id, kvmppc_get_pspb_hv(vcpu));
 		break;
 	case KVM_REG_PPC_DPDES:
 		/*
@@ -2282,19 +2282,19 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
 		*val = get_reg_val(id, vcpu->arch.vcore->vtb);
 		break;
 	case KVM_REG_PPC_DAWR:
-		*val = get_reg_val(id, vcpu->arch.dawr0);
+		*val = get_reg_val(id, kvmppc_get_dawr0_hv(vcpu));
 		break;
 	case KVM_REG_PPC_DAWRX:
-		*val = get_reg_val(id, vcpu->arch.dawrx0);
+		*val = get_reg_val(id, kvmppc_get_dawrx0_hv(vcpu));
 		break;
 	case KVM_REG_PPC_DAWR1:
-		*val = get_reg_val(id, vcpu->arch.dawr1);
+		*val = get_reg_val(id, kvmppc_get_dawr1_hv(vcpu));
 		break;
 	case KVM_REG_PPC_DAWRX1:
-		*val = get_reg_val(id, vcpu->arch.dawrx1);
+		*val = get_reg_val(id, kvmppc_get_dawrx1_hv(vcpu));
 		break;
 	case KVM_REG_PPC_CIABR:
-		*val = get_reg_val(id, vcpu->arch.ciabr);
+		*val = get_reg_val(id, kvmppc_get_ciabr_hv(vcpu));
 		break;
 	case KVM_REG_PPC_CSIGR:
 		*val = get_reg_val(id, vcpu->arch.csigr);
@@ -2312,7 +2312,7 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
 		*val = get_reg_val(id, vcpu->arch.acop);
 		break;
 	case KVM_REG_PPC_WORT:
-		*val = get_reg_val(id, vcpu->arch.wort);
+		*val = get_reg_val(id, kvmppc_get_wort_hv(vcpu));
 		break;
 	case KVM_REG_PPC_TIDR:
 		*val = get_reg_val(id, vcpu->arch.tid);
@@ -2345,7 +2345,7 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
 		*val = get_reg_val(id, vcpu->arch.vcore->lpcr);
 		break;
 	case KVM_REG_PPC_PPR:
-		*val = get_reg_val(id, vcpu->arch.ppr);
+		*val = get_reg_val(id, kvmppc_get_ppr_hv(vcpu));
 		break;
 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
 	case KVM_REG_PPC_TFHAR:
@@ -2425,6 +2425,9 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
 	case KVM_REG_PPC_PTCR:
 		*val = get_reg_val(id, vcpu->kvm->arch.l1_ptcr);
 		break;
+	case KVM_REG_PPC_FSCR:
+		*val = get_reg_val(id, kvmppc_get_fscr_hv(vcpu));
+		break;
 	default:
 		r = -EINVAL;
 		break;
@@ -2453,29 +2456,29 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
 		vcpu->arch.dabrx = set_reg_val(id, *val) & ~DABRX_HYP;
 		break;
 	case KVM_REG_PPC_DSCR:
-		vcpu->arch.dscr = set_reg_val(id, *val);
+		kvmppc_set_dscr_hv(vcpu, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_PURR:
-		vcpu->arch.purr = set_reg_val(id, *val);
+		kvmppc_set_purr_hv(vcpu, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_SPURR:
-		vcpu->arch.spurr = set_reg_val(id, *val);
+		kvmppc_set_spurr_hv(vcpu, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_AMR:
-		vcpu->arch.amr = set_reg_val(id, *val);
+		kvmppc_set_amr_hv(vcpu, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_UAMOR:
-		vcpu->arch.uamor = set_reg_val(id, *val);
+		kvmppc_set_uamor_hv(vcpu, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_MMCR0 ... KVM_REG_PPC_MMCR1:
 		i = id - KVM_REG_PPC_MMCR0;
-		vcpu->arch.mmcr[i] = set_reg_val(id, *val);
+		kvmppc_set_mmcr_hv(vcpu, i, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_MMCR2:
-		vcpu->arch.mmcr[2] = set_reg_val(id, *val);
+		kvmppc_set_mmcr_hv(vcpu, 2, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_MMCRA:
-		vcpu->arch.mmcra = set_reg_val(id, *val);
+		kvmppc_set_mmcra_hv(vcpu, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_MMCRS:
 		vcpu->arch.mmcrs = set_reg_val(id, *val);
@@ -2485,32 +2488,32 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
 		break;
 	case KVM_REG_PPC_PMC1 ... KVM_REG_PPC_PMC8:
 		i = id - KVM_REG_PPC_PMC1;
-		vcpu->arch.pmc[i] = set_reg_val(id, *val);
+		kvmppc_set_pmc_hv(vcpu, i, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_SPMC1 ... KVM_REG_PPC_SPMC2:
 		i = id - KVM_REG_PPC_SPMC1;
 		vcpu->arch.spmc[i] = set_reg_val(id, *val);
 		break;
 	case KVM_REG_PPC_SIAR:
-		vcpu->arch.siar = set_reg_val(id, *val);
+		kvmppc_set_siar_hv(vcpu, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_SDAR:
-		vcpu->arch.sdar = set_reg_val(id, *val);
+		kvmppc_set_sdar_hv(vcpu, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_SIER:
-		vcpu->arch.sier[0] = set_reg_val(id, *val);
+		kvmppc_set_sier_hv(vcpu, 0, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_SIER2:
-		vcpu->arch.sier[1] = set_reg_val(id, *val);
+		kvmppc_set_sier_hv(vcpu, 1, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_SIER3:
-		vcpu->arch.sier[2] = set_reg_val(id, *val);
+		kvmppc_set_sier_hv(vcpu, 2, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_IAMR:
-		vcpu->arch.iamr = set_reg_val(id, *val);
+		kvmppc_set_iamr_hv(vcpu, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_PSPB:
-		vcpu->arch.pspb = set_reg_val(id, *val);
+		kvmppc_set_pspb_hv(vcpu, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_DPDES:
 		if (cpu_has_feature(CPU_FTR_ARCH_300))
@@ -2522,22 +2525,22 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
 		vcpu->arch.vcore->vtb = set_reg_val(id, *val);
 		break;
 	case KVM_REG_PPC_DAWR:
-		vcpu->arch.dawr0 = set_reg_val(id, *val);
+		kvmppc_set_dawr0_hv(vcpu, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_DAWRX:
-		vcpu->arch.dawrx0 = set_reg_val(id, *val) & ~DAWRX_HYP;
+		kvmppc_set_dawrx0_hv(vcpu, set_reg_val(id, *val) & ~DAWRX_HYP);
 		break;
 	case KVM_REG_PPC_DAWR1:
-		vcpu->arch.dawr1 = set_reg_val(id, *val);
+		kvmppc_set_dawr1_hv(vcpu, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_DAWRX1:
-		vcpu->arch.dawrx1 = set_reg_val(id, *val) & ~DAWRX_HYP;
+		kvmppc_set_dawrx1_hv(vcpu, set_reg_val(id, *val) & ~DAWRX_HYP);
 		break;
 	case KVM_REG_PPC_CIABR:
-		vcpu->arch.ciabr = set_reg_val(id, *val);
+		kvmppc_set_ciabr_hv(vcpu, set_reg_val(id, *val));
 		/* Don't allow setting breakpoints in hypervisor code */
-		if ((vcpu->arch.ciabr & CIABR_PRIV) == CIABR_PRIV_HYPER)
-			vcpu->arch.ciabr &= ~CIABR_PRIV;	/* disable */
+		if ((kvmppc_get_ciabr_hv(vcpu) & CIABR_PRIV) == CIABR_PRIV_HYPER)
+			kvmppc_set_ciabr_hv(vcpu, kvmppc_get_ciabr_hv(vcpu) & ~CIABR_PRIV);
 		break;
 	case KVM_REG_PPC_CSIGR:
 		vcpu->arch.csigr = set_reg_val(id, *val);
@@ -2555,7 +2558,7 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
 		vcpu->arch.acop = set_reg_val(id, *val);
 		break;
 	case KVM_REG_PPC_WORT:
-		vcpu->arch.wort = set_reg_val(id, *val);
+		kvmppc_set_wort_hv(vcpu, set_reg_val(id, *val));
 		break;
 	case KVM_REG_PPC_TIDR:
 		vcpu->arch.tid = set_reg_val(id, *val);
@@ -2615,7 +2618,7 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
 		kvmppc_set_lpcr(vcpu, set_reg_val(id, *val), false);
 		break;
 	case KVM_REG_PPC_PPR:
-		vcpu->arch.ppr = set_reg_val(id, *val);
+		kvmppc_set_ppr_hv(vcpu, set_reg_val(id, *val));
 		break;
 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
 	case KVM_REG_PPC_TFHAR:
@@ -2699,6 +2702,9 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
 	case KVM_REG_PPC_PTCR:
 		vcpu->kvm->arch.l1_ptcr = set_reg_val(id, *val);
 		break;
+	case KVM_REG_PPC_FSCR:
+		kvmppc_set_fscr_hv(vcpu, set_reg_val(id, *val));
+		break;
 	default:
 		r = -EINVAL;
 		break;
@@ -2916,13 +2922,14 @@ static int kvmppc_core_vcpu_create_hv(struct kvm_vcpu *vcpu)
 	vcpu->arch.shared_big_endian = false;
 #endif
 #endif
-	vcpu->arch.mmcr[0] = MMCR0_FC;
+	kvmppc_set_mmcr_hv(vcpu, 0, MMCR0_FC);
+
 	if (cpu_has_feature(CPU_FTR_ARCH_31)) {
-		vcpu->arch.mmcr[0] |= MMCR0_PMCCEXT;
-		vcpu->arch.mmcra = MMCRA_BHRB_DISABLE;
+		kvmppc_set_mmcr_hv(vcpu, 0, kvmppc_get_mmcr_hv(vcpu, 0) | MMCR0_PMCCEXT);
+		kvmppc_set_mmcra_hv(vcpu, MMCRA_BHRB_DISABLE);
 	}
 
-	vcpu->arch.ctrl = CTRL_RUNLATCH;
+	kvmppc_set_ctrl_hv(vcpu, CTRL_RUNLATCH);
 	/* default to host PVR, since we can't spoof it */
 	kvmppc_set_pvr_hv(vcpu, mfspr(SPRN_PVR));
 	spin_lock_init(&vcpu->arch.vpa_update_lock);
@@ -2938,29 +2945,30 @@ static int kvmppc_core_vcpu_create_hv(struct kvm_vcpu *vcpu)
 	 * don't set the HFSCR_MSGP bit, and that causes those instructions
 	 * to trap and then we emulate them.
 	 */
-	vcpu->arch.hfscr = HFSCR_TAR | HFSCR_EBB | HFSCR_PM | HFSCR_BHRB |
-		HFSCR_DSCR | HFSCR_VECVSX | HFSCR_FP;
+	kvmppc_set_hfscr_hv(vcpu, HFSCR_TAR | HFSCR_EBB | HFSCR_PM | HFSCR_BHRB |
+			    HFSCR_DSCR | HFSCR_VECVSX | HFSCR_FP);
 
 	/* On POWER10 and later, allow prefixed instructions */
 	if (cpu_has_feature(CPU_FTR_ARCH_31))
-		vcpu->arch.hfscr |= HFSCR_PREFIX;
+		kvmppc_set_hfscr_hv(vcpu, kvmppc_get_hfscr_hv(vcpu) | HFSCR_PREFIX);
 
 	if (cpu_has_feature(CPU_FTR_HVMODE)) {
-		vcpu->arch.hfscr &= mfspr(SPRN_HFSCR);
+		kvmppc_set_hfscr_hv(vcpu, kvmppc_get_hfscr_hv(vcpu) & mfspr(SPRN_HFSCR));
+
 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
 		if (cpu_has_feature(CPU_FTR_P9_TM_HV_ASSIST))
-			vcpu->arch.hfscr |= HFSCR_TM;
+			kvmppc_set_hfscr_hv(vcpu, kvmppc_get_hfscr_hv(vcpu) | HFSCR_TM);
 #endif
 	}
 	if (cpu_has_feature(CPU_FTR_TM_COMP))
 		vcpu->arch.hfscr |= HFSCR_TM;
 
-	vcpu->arch.hfscr_permitted = vcpu->arch.hfscr;
+	vcpu->arch.hfscr_permitted = kvmppc_get_hfscr_hv(vcpu);
 
 	/*
 	 * PM, EBB, TM are demand-faulted so start with it clear.
 	 */
-	vcpu->arch.hfscr &= ~(HFSCR_PM | HFSCR_EBB | HFSCR_TM);
+	kvmppc_set_hfscr_hv(vcpu, kvmppc_get_hfscr_hv(vcpu) & ~(HFSCR_PM | HFSCR_EBB | HFSCR_TM));
 
 	kvmppc_mmu_book3s_hv_init(vcpu);
 
@@ -4844,7 +4852,7 @@ static int kvmppc_vcpu_run_hv(struct kvm_vcpu *vcpu)
 		msr |= MSR_VSX;
 	if ((cpu_has_feature(CPU_FTR_TM) ||
 	    cpu_has_feature(CPU_FTR_P9_TM_HV_ASSIST)) &&
-			(vcpu->arch.hfscr & HFSCR_TM))
+			(kvmppc_get_hfscr_hv(vcpu) & HFSCR_TM))
 		msr |= MSR_TM;
 	msr = msr_check_and_set(msr);
 
diff --git a/arch/powerpc/kvm/book3s_hv.h b/arch/powerpc/kvm/book3s_hv.h
index 2f2e59d7d433..acd9a7a95bbf 100644
--- a/arch/powerpc/kvm/book3s_hv.h
+++ b/arch/powerpc/kvm/book3s_hv.h
@@ -50,3 +50,61 @@ void accumulate_time(struct kvm_vcpu *vcpu, struct kvmhv_tb_accumulator *next);
 #define start_timing(vcpu, next) do {} while (0)
 #define end_timing(vcpu) do {} while (0)
 #endif
+
+#define KVMPPC_BOOK3S_HV_VCPU_ACCESSOR_SET(reg, size)			\
+static inline void kvmppc_set_##reg ##_hv(struct kvm_vcpu *vcpu, u##size val)	\
+{									\
+	vcpu->arch.reg = val;						\
+}
+
+#define KVMPPC_BOOK3S_HV_VCPU_ACCESSOR_GET(reg, size)			\
+static inline u##size kvmppc_get_##reg ##_hv(struct kvm_vcpu *vcpu)	\
+{									\
+	return vcpu->arch.reg;						\
+}
+
+#define KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(reg, size)			\
+	KVMPPC_BOOK3S_HV_VCPU_ACCESSOR_SET(reg, size)			\
+	KVMPPC_BOOK3S_HV_VCPU_ACCESSOR_GET(reg, size)			\
+
+#define KVMPPC_BOOK3S_HV_VCPU_ARRAY_ACCESSOR_SET(reg, size)		\
+static inline void kvmppc_set_##reg ##_hv(struct kvm_vcpu *vcpu, int i, u##size val)	\
+{									\
+	vcpu->arch.reg[i] = val;					\
+}
+
+#define KVMPPC_BOOK3S_HV_VCPU_ARRAY_ACCESSOR_GET(reg, size)		\
+static inline u##size kvmppc_get_##reg ##_hv(struct kvm_vcpu *vcpu, int i)	\
+{									\
+	return vcpu->arch.reg[i];					\
+}
+
+#define KVMPPC_BOOK3S_HV_VCPU_ARRAY_ACCESSOR(reg, size)			\
+	KVMPPC_BOOK3S_HV_VCPU_ARRAY_ACCESSOR_SET(reg, size)		\
+	KVMPPC_BOOK3S_HV_VCPU_ARRAY_ACCESSOR_GET(reg, size)		\
+
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(mmcra, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(hfscr, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(fscr, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dscr, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(purr, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(spurr, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(amr, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(uamor, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(siar, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(sdar, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(iamr, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawr0, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawr1, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawrx0, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawrx1, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(ciabr, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(wort, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(ppr, 64)
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(ctrl, 64)
+
+KVMPPC_BOOK3S_HV_VCPU_ARRAY_ACCESSOR(mmcr, 64)
+KVMPPC_BOOK3S_HV_VCPU_ARRAY_ACCESSOR(sier, 64)
+KVMPPC_BOOK3S_HV_VCPU_ARRAY_ACCESSOR(pmc, 32)
+
+KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(pspb, 32)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 011/583] KVM: PPC: Book3S HV: Introduce low level MSR accessor
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (9 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 010/583] KVM: PPC: Book3S HV: Use accessors for VCPU registers Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 012/583] KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE Greg Kroah-Hartman
                   ` (578 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jordan Niethe, Michael Ellerman,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jordan Niethe <jniethe5@gmail.com>

[ Upstream commit 6de2e837babb411cfb3cdb570581c3a65576ddaf ]

kvmppc_get_msr() and kvmppc_set_msr_fast() serve as accessors for the
MSR. However because the MSR is kept in the shared regs they include a
conditional check for kvmppc_shared_big_endian() and endian conversion.

Within the Book3S HV specific code there are direct reads and writes of
shregs::msr. In preparation for Nested APIv2 these accesses need to be
replaced with accessor functions so it is possible to extend their
behavior. However, using the kvmppc_get_msr() and kvmppc_set_msr_fast()
functions is undesirable because it would introduce a conditional branch
and endian conversion that is not currently present.

kvmppc_set_msr_hv() already exists, it is used for the
kvmppc_ops::set_msr callback.

Introduce a low level accessor __kvmppc_{s,g}et_msr_hv() that simply
gets and sets shregs::msr. This will be extend for Nested APIv2 support.

Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230914030600.16993-8-jniethe5@gmail.com
Stable-dep-of: ecd10702baae ("KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/powerpc/kvm/book3s_64_mmu_hv.c  |  5 ++--
 arch/powerpc/kvm/book3s_hv.c         | 34 ++++++++++++++--------------
 arch/powerpc/kvm/book3s_hv.h         | 10 ++++++++
 arch/powerpc/kvm/book3s_hv_builtin.c |  5 ++--
 4 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
index efd0ebf70a5e..fdfc2a62dd67 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
@@ -28,6 +28,7 @@
 #include <asm/pte-walk.h>
 
 #include "book3s.h"
+#include "book3s_hv.h"
 #include "trace_hv.h"
 
 //#define DEBUG_RESIZE_HPT	1
@@ -347,7 +348,7 @@ static int kvmppc_mmu_book3s_64_hv_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
 	unsigned long v, orig_v, gr;
 	__be64 *hptep;
 	long int index;
-	int virtmode = vcpu->arch.shregs.msr & (data ? MSR_DR : MSR_IR);
+	int virtmode = __kvmppc_get_msr_hv(vcpu) & (data ? MSR_DR : MSR_IR);
 
 	if (kvm_is_radix(vcpu->kvm))
 		return kvmppc_mmu_radix_xlate(vcpu, eaddr, gpte, data, iswrite);
@@ -385,7 +386,7 @@ static int kvmppc_mmu_book3s_64_hv_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
 
 	/* Get PP bits and key for permission check */
 	pp = gr & (HPTE_R_PP0 | HPTE_R_PP);
-	key = (vcpu->arch.shregs.msr & MSR_PR) ? SLB_VSID_KP : SLB_VSID_KS;
+	key = (__kvmppc_get_msr_hv(vcpu) & MSR_PR) ? SLB_VSID_KP : SLB_VSID_KS;
 	key &= slb_v;
 
 	/* Calculate permissions */
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 7fa7fcebe8da..11bc5aaea01f 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -1370,7 +1370,7 @@ int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu)
  */
 static void kvmppc_cede(struct kvm_vcpu *vcpu)
 {
-	vcpu->arch.shregs.msr |= MSR_EE;
+	__kvmppc_set_msr_hv(vcpu, __kvmppc_get_msr_hv(vcpu) | MSR_EE);
 	vcpu->arch.ceded = 1;
 	smp_mb();
 	if (vcpu->arch.prodded) {
@@ -1585,7 +1585,7 @@ static int kvmppc_handle_exit_hv(struct kvm_vcpu *vcpu,
 	 * That can happen due to a bug, or due to a machine check
 	 * occurring at just the wrong time.
 	 */
-	if (vcpu->arch.shregs.msr & MSR_HV) {
+	if (__kvmppc_get_msr_hv(vcpu) & MSR_HV) {
 		printk(KERN_EMERG "KVM trap in HV mode!\n");
 		printk(KERN_EMERG "trap=0x%x | pc=0x%lx | msr=0x%llx\n",
 			vcpu->arch.trap, kvmppc_get_pc(vcpu),
@@ -1636,7 +1636,7 @@ static int kvmppc_handle_exit_hv(struct kvm_vcpu *vcpu,
 		 * so that it knows that the machine check occurred.
 		 */
 		if (!vcpu->kvm->arch.fwnmi_enabled) {
-			ulong flags = (vcpu->arch.shregs.msr & 0x083c0000) |
+			ulong flags = (__kvmppc_get_msr_hv(vcpu) & 0x083c0000) |
 					(kvmppc_get_msr(vcpu) & SRR1_PREFIXED);
 			kvmppc_core_queue_machine_check(vcpu, flags);
 			r = RESUME_GUEST;
@@ -1666,7 +1666,7 @@ static int kvmppc_handle_exit_hv(struct kvm_vcpu *vcpu,
 		 * as a result of a hypervisor emulation interrupt
 		 * (e40) getting turned into a 700 by BML RTAS.
 		 */
-		flags = (vcpu->arch.shregs.msr & 0x1f0000ull) |
+		flags = (__kvmppc_get_msr_hv(vcpu) & 0x1f0000ull) |
 			(kvmppc_get_msr(vcpu) & SRR1_PREFIXED);
 		kvmppc_core_queue_program(vcpu, flags);
 		r = RESUME_GUEST;
@@ -1676,7 +1676,7 @@ static int kvmppc_handle_exit_hv(struct kvm_vcpu *vcpu,
 	{
 		int i;
 
-		if (unlikely(vcpu->arch.shregs.msr & MSR_PR)) {
+		if (unlikely(__kvmppc_get_msr_hv(vcpu) & MSR_PR)) {
 			/*
 			 * Guest userspace executed sc 1. This can only be
 			 * reached by the P9 path because the old path
@@ -1754,7 +1754,7 @@ static int kvmppc_handle_exit_hv(struct kvm_vcpu *vcpu,
 			break;
 		}
 
-		if (!(vcpu->arch.shregs.msr & MSR_DR))
+		if (!(__kvmppc_get_msr_hv(vcpu) & MSR_DR))
 			vsid = vcpu->kvm->arch.vrma_slb_v;
 		else
 			vsid = vcpu->arch.fault_gpa;
@@ -1778,7 +1778,7 @@ static int kvmppc_handle_exit_hv(struct kvm_vcpu *vcpu,
 		long err;
 
 		vcpu->arch.fault_dar = kvmppc_get_pc(vcpu);
-		vcpu->arch.fault_dsisr = vcpu->arch.shregs.msr &
+		vcpu->arch.fault_dsisr = __kvmppc_get_msr_hv(vcpu) &
 			DSISR_SRR1_MATCH_64S;
 		if (kvm_is_radix(vcpu->kvm) || !cpu_has_feature(CPU_FTR_ARCH_300)) {
 			/*
@@ -1787,7 +1787,7 @@ static int kvmppc_handle_exit_hv(struct kvm_vcpu *vcpu,
 			 * hash fault handling below is v3 only (it uses ASDR
 			 * via fault_gpa).
 			 */
-			if (vcpu->arch.shregs.msr & HSRR1_HISI_WRITE)
+			if (__kvmppc_get_msr_hv(vcpu) & HSRR1_HISI_WRITE)
 				vcpu->arch.fault_dsisr |= DSISR_ISSTORE;
 			r = RESUME_PAGE_FAULT;
 			break;
@@ -1801,7 +1801,7 @@ static int kvmppc_handle_exit_hv(struct kvm_vcpu *vcpu,
 			break;
 		}
 
-		if (!(vcpu->arch.shregs.msr & MSR_IR))
+		if (!(__kvmppc_get_msr_hv(vcpu) & MSR_IR))
 			vsid = vcpu->kvm->arch.vrma_slb_v;
 		else
 			vsid = vcpu->arch.fault_gpa;
@@ -1891,7 +1891,7 @@ static int kvmppc_handle_exit_hv(struct kvm_vcpu *vcpu,
 		kvmppc_dump_regs(vcpu);
 		printk(KERN_EMERG "trap=0x%x | pc=0x%lx | msr=0x%llx\n",
 			vcpu->arch.trap, kvmppc_get_pc(vcpu),
-			vcpu->arch.shregs.msr);
+			__kvmppc_get_msr_hv(vcpu));
 		run->hw.hardware_exit_reason = vcpu->arch.trap;
 		r = RESUME_HOST;
 		break;
@@ -1915,11 +1915,11 @@ static int kvmppc_handle_nested_exit(struct kvm_vcpu *vcpu)
 	 * That can happen due to a bug, or due to a machine check
 	 * occurring at just the wrong time.
 	 */
-	if (vcpu->arch.shregs.msr & MSR_HV) {
+	if (__kvmppc_get_msr_hv(vcpu) & MSR_HV) {
 		pr_emerg("KVM trap in HV mode while nested!\n");
 		pr_emerg("trap=0x%x | pc=0x%lx | msr=0x%llx\n",
 			 vcpu->arch.trap, kvmppc_get_pc(vcpu),
-			 vcpu->arch.shregs.msr);
+			 __kvmppc_get_msr_hv(vcpu));
 		kvmppc_dump_regs(vcpu);
 		return RESUME_HOST;
 	}
@@ -1976,7 +1976,7 @@ static int kvmppc_handle_nested_exit(struct kvm_vcpu *vcpu)
 		vcpu->arch.fault_dar = kvmppc_get_pc(vcpu);
 		vcpu->arch.fault_dsisr = kvmppc_get_msr(vcpu) &
 					 DSISR_SRR1_MATCH_64S;
-		if (vcpu->arch.shregs.msr & HSRR1_HISI_WRITE)
+		if (__kvmppc_get_msr_hv(vcpu) & HSRR1_HISI_WRITE)
 			vcpu->arch.fault_dsisr |= DSISR_ISSTORE;
 		srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
 		r = kvmhv_nested_page_fault(vcpu);
@@ -2935,7 +2935,7 @@ static int kvmppc_core_vcpu_create_hv(struct kvm_vcpu *vcpu)
 	spin_lock_init(&vcpu->arch.vpa_update_lock);
 	spin_lock_init(&vcpu->arch.tbacct_lock);
 	vcpu->arch.busy_preempt = TB_NIL;
-	vcpu->arch.shregs.msr = MSR_ME;
+	__kvmppc_set_msr_hv(vcpu, MSR_ME);
 	vcpu->arch.intr_msr = MSR_SF | MSR_ME;
 
 	/*
@@ -4184,7 +4184,7 @@ static int kvmhv_p9_guest_entry(struct kvm_vcpu *vcpu, u64 time_limit,
 		__this_cpu_write(cpu_in_guest, NULL);
 
 		if (trap == BOOK3S_INTERRUPT_SYSCALL &&
-		    !(vcpu->arch.shregs.msr & MSR_PR)) {
+		    !(__kvmppc_get_msr_hv(vcpu) & MSR_PR)) {
 			unsigned long req = kvmppc_get_gpr(vcpu, 3);
 
 			/*
@@ -4663,7 +4663,7 @@ int kvmhv_run_single_vcpu(struct kvm_vcpu *vcpu, u64 time_limit,
 
 	if (!nested) {
 		kvmppc_core_prepare_to_enter(vcpu);
-		if (vcpu->arch.shregs.msr & MSR_EE) {
+		if (__kvmppc_get_msr_hv(vcpu) & MSR_EE) {
 			if (xive_interrupt_pending(vcpu))
 				kvmppc_inject_interrupt_hv(vcpu,
 						BOOK3S_INTERRUPT_EXTERNAL, 0);
@@ -4876,7 +4876,7 @@ static int kvmppc_vcpu_run_hv(struct kvm_vcpu *vcpu)
 		if (run->exit_reason == KVM_EXIT_PAPR_HCALL) {
 			accumulate_time(vcpu, &vcpu->arch.hcall);
 
-			if (WARN_ON_ONCE(vcpu->arch.shregs.msr & MSR_PR)) {
+			if (WARN_ON_ONCE(__kvmppc_get_msr_hv(vcpu) & MSR_PR)) {
 				/*
 				 * These should have been caught reflected
 				 * into the guest by now. Final sanity check:
diff --git a/arch/powerpc/kvm/book3s_hv.h b/arch/powerpc/kvm/book3s_hv.h
index acd9a7a95bbf..95241764dfb4 100644
--- a/arch/powerpc/kvm/book3s_hv.h
+++ b/arch/powerpc/kvm/book3s_hv.h
@@ -51,6 +51,16 @@ void accumulate_time(struct kvm_vcpu *vcpu, struct kvmhv_tb_accumulator *next);
 #define end_timing(vcpu) do {} while (0)
 #endif
 
+static inline void __kvmppc_set_msr_hv(struct kvm_vcpu *vcpu, u64 val)
+{
+	vcpu->arch.shregs.msr = val;
+}
+
+static inline u64 __kvmppc_get_msr_hv(struct kvm_vcpu *vcpu)
+{
+	return vcpu->arch.shregs.msr;
+}
+
 #define KVMPPC_BOOK3S_HV_VCPU_ACCESSOR_SET(reg, size)			\
 static inline void kvmppc_set_##reg ##_hv(struct kvm_vcpu *vcpu, u##size val)	\
 {									\
diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c
index 0f5b021fa559..663f5222f3d0 100644
--- a/arch/powerpc/kvm/book3s_hv_builtin.c
+++ b/arch/powerpc/kvm/book3s_hv_builtin.c
@@ -32,6 +32,7 @@
 
 #include "book3s_xics.h"
 #include "book3s_xive.h"
+#include "book3s_hv.h"
 
 /*
  * Hash page table alignment on newer cpus(CPU_FTR_ARCH_206)
@@ -510,7 +511,7 @@ void kvmppc_set_msr_hv(struct kvm_vcpu *vcpu, u64 msr)
 	 */
 	if ((msr & MSR_TS_MASK) == MSR_TS_MASK)
 		msr &= ~MSR_TS_MASK;
-	vcpu->arch.shregs.msr = msr;
+	__kvmppc_set_msr_hv(vcpu, msr);
 	kvmppc_end_cede(vcpu);
 }
 EXPORT_SYMBOL_GPL(kvmppc_set_msr_hv);
@@ -548,7 +549,7 @@ static void inject_interrupt(struct kvm_vcpu *vcpu, int vec, u64 srr1_flags)
 	kvmppc_set_srr0(vcpu, pc);
 	kvmppc_set_srr1(vcpu, (msr & SRR1_MSR_BITS) | srr1_flags);
 	kvmppc_set_pc(vcpu, new_pc);
-	vcpu->arch.shregs.msr = new_msr;
+	__kvmppc_set_msr_hv(vcpu, new_msr);
 }
 
 void kvmppc_inject_interrupt_hv(struct kvm_vcpu *vcpu, int vec, u64 srr1_flags)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 012/583] KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (10 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 011/583] KVM: PPC: Book3S HV: Introduce low level MSR accessor Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 013/583] selftests/powerpc: Fix error handling in FPU/VMX preemption tests Greg Kroah-Hartman
                   ` (577 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nicholas Piggin, Jordan Niethe,
	Michael Ellerman, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nicholas Piggin <npiggin@gmail.com>

[ Upstream commit ecd10702baae5c16a91d139bde7eff84ce55daee ]

Commit 026728dc5d41 ("KVM: PPC: Book3S HV P9: Inject pending xive
interrupts at guest entry") changed guest entry so that if external
interrupts are enabled, BOOK3S_IRQPRIO_EXTERNAL is not tested for. Test
for this regardless of MSR_EE.

For an L1 host, do not inject an interrupt, but always
use LPCR_MER. If the L0 desires it can inject an interrupt.

Fixes: 026728dc5d41 ("KVM: PPC: Book3S HV P9: Inject pending xive interrupts at guest entry")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[jpn: use kvmpcc_get_msr(), write commit message]
Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231201132618.555031-7-vaibhav@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/powerpc/kvm/book3s_hv.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 11bc5aaea01f..0429488ba170 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -4663,13 +4663,19 @@ int kvmhv_run_single_vcpu(struct kvm_vcpu *vcpu, u64 time_limit,
 
 	if (!nested) {
 		kvmppc_core_prepare_to_enter(vcpu);
-		if (__kvmppc_get_msr_hv(vcpu) & MSR_EE) {
-			if (xive_interrupt_pending(vcpu))
+		if (test_bit(BOOK3S_IRQPRIO_EXTERNAL,
+			     &vcpu->arch.pending_exceptions) ||
+		    xive_interrupt_pending(vcpu)) {
+			/*
+			 * For nested HV, don't synthesize but always pass MER,
+			 * the L0 will be able to optimise that more
+			 * effectively than manipulating registers directly.
+			 */
+			if (!kvmhv_on_pseries() && (__kvmppc_get_msr_hv(vcpu) & MSR_EE))
 				kvmppc_inject_interrupt_hv(vcpu,
-						BOOK3S_INTERRUPT_EXTERNAL, 0);
-		} else if (test_bit(BOOK3S_IRQPRIO_EXTERNAL,
-			     &vcpu->arch.pending_exceptions)) {
-			lpcr |= LPCR_MER;
+							   BOOK3S_INTERRUPT_EXTERNAL, 0);
+			else
+				lpcr |= LPCR_MER;
 		}
 	} else if (vcpu->arch.pending_exceptions ||
 		   vcpu->arch.doorbell_request ||
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 013/583] selftests/powerpc: Fix error handling in FPU/VMX preemption tests
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (11 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 012/583] KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 014/583] powerpc/hv-gpci: Add return value check in affinity_domain_via_partition_show function Greg Kroah-Hartman
                   ` (576 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Michael Ellerman, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Michael Ellerman <mpe@ellerman.id.au>

[ Upstream commit 9dbd5927408c4a0707de73ae9dd9306b184e8fee ]

The FPU & VMX preemption tests do not check for errors returned by the
low-level asm routines, preempt_fpu() / preempt_vsx() respectively.
That means any register corruption detected by the asm routines does not
result in a test failure.

Fix it by returning the return value of the asm routines from the
pthread child routines.

Fixes: e5ab8be68e44 ("selftests/powerpc: Test preservation of FPU and VMX regs across preemption")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231128132748.1990179-1-mpe@ellerman.id.au
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/powerpc/math/fpu_preempt.c |  9 +++++----
 tools/testing/selftests/powerpc/math/vmx_preempt.c | 10 ++++++----
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/powerpc/math/fpu_preempt.c b/tools/testing/selftests/powerpc/math/fpu_preempt.c
index 5235bdc8c0b1..3e5b5663d244 100644
--- a/tools/testing/selftests/powerpc/math/fpu_preempt.c
+++ b/tools/testing/selftests/powerpc/math/fpu_preempt.c
@@ -37,19 +37,20 @@ __thread double darray[] = {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0,
 int threads_starting;
 int running;
 
-extern void preempt_fpu(double *darray, int *threads_starting, int *running);
+extern int preempt_fpu(double *darray, int *threads_starting, int *running);
 
 void *preempt_fpu_c(void *p)
 {
+	long rc;
 	int i;
+
 	srand(pthread_self());
 	for (i = 0; i < 21; i++)
 		darray[i] = rand();
 
-	/* Test failed if it ever returns */
-	preempt_fpu(darray, &threads_starting, &running);
+	rc = preempt_fpu(darray, &threads_starting, &running);
 
-	return p;
+	return (void *)rc;
 }
 
 int test_preempt_fpu(void)
diff --git a/tools/testing/selftests/powerpc/math/vmx_preempt.c b/tools/testing/selftests/powerpc/math/vmx_preempt.c
index 6761d6ce30ec..6f7cf400c687 100644
--- a/tools/testing/selftests/powerpc/math/vmx_preempt.c
+++ b/tools/testing/selftests/powerpc/math/vmx_preempt.c
@@ -37,19 +37,21 @@ __thread vector int varray[] = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10,11,12},
 int threads_starting;
 int running;
 
-extern void preempt_vmx(vector int *varray, int *threads_starting, int *running);
+extern int preempt_vmx(vector int *varray, int *threads_starting, int *running);
 
 void *preempt_vmx_c(void *p)
 {
 	int i, j;
+	long rc;
+
 	srand(pthread_self());
 	for (i = 0; i < 12; i++)
 		for (j = 0; j < 4; j++)
 			varray[i][j] = rand();
 
-	/* Test fails if it ever returns */
-	preempt_vmx(varray, &threads_starting, &running);
-	return p;
+	rc = preempt_vmx(varray, &threads_starting, &running);
+
+	return (void *)rc;
 }
 
 int test_preempt_vmx(void)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 014/583] powerpc/hv-gpci: Add return value check in affinity_domain_via_partition_show function
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (12 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 013/583] selftests/powerpc: Fix error handling in FPU/VMX preemption tests Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 015/583] powerpc/rtas: Avoid warning on invalid token argument to sys_rtas() Greg Kroah-Hartman
                   ` (575 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Disha Goel, Kajol Jain,
	Michael Ellerman, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kajol Jain <kjain@linux.ibm.com>

[ Upstream commit 070b71f428facd9130319707db854ed8bd24637a ]

To access hv-gpci kernel interface files data, the
"Enable Performance Information Collection" option has to be set
in hmc. Incase that option is not set and user try to read
the interface files, it should give error message as
operation not permitted.

Result of accessing added interface files with disabled
performance collection option:

[command]# cat processor_bus_topology
cat: processor_bus_topology: Operation not permitted

[command]# cat processor_config
cat: processor_config: Operation not permitted

[command]# cat affinity_domain_via_domain
cat: affinity_domain_via_domain: Operation not permitted

[command]# cat affinity_domain_via_virtual_processor
cat: affinity_domain_via_virtual_processor: Operation not permitted

[command]# cat affinity_domain_via_partition

Based on above result there is no error message when reading
affinity_domain_via_partition file because of missing
check for failed hcall. Fix this issue by adding
a check in the start of affinity_domain_via_partition_show
function, to return error incase hcall fails, with error type
other then H_PARAMETER.

Fixes: a15e0d6a6929 ("powerpc/hv_gpci: Add sysfs file inside hv_gpci device to show affinity domain via partition information")
Reported-by: Disha Goel <disgoel@linux.vnet.ibm.com>
Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231116122033.160964-1-kjain@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/powerpc/perf/hv-gpci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/perf/hv-gpci.c b/arch/powerpc/perf/hv-gpci.c
index 39dbe6b348df..27f18119fda1 100644
--- a/arch/powerpc/perf/hv-gpci.c
+++ b/arch/powerpc/perf/hv-gpci.c
@@ -534,6 +534,9 @@ static ssize_t affinity_domain_via_partition_show(struct device *dev, struct dev
 	if (!ret)
 		goto parse_result;
 
+	if (ret && (ret != H_PARAMETER))
+		goto out;
+
 	/*
 	 * ret value as 'H_PARAMETER' implies that the current buffer size
 	 * can't accommodate all the information, and a partial buffer
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 015/583] powerpc/rtas: Avoid warning on invalid token argument to sys_rtas()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (13 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 014/583] powerpc/hv-gpci: Add return value check in affinity_domain_via_partition_show function Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 016/583] powerpc/powernv: Add a null pointer check to scom_debug_init_one() Greg Kroah-Hartman
                   ` (574 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nathan Lynch, Michael Ellerman, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nathan Lynch <nathanl@linux.ibm.com>

[ Upstream commit 01e346ffefda3a7088afebf02b940614179688e7 ]

rtas_token_to_function() WARNs when passed an invalid token; it's
meant to catch bugs in kernel-based users of RTAS functions. However,
user space controls the token value passed to rtas_token_to_function()
by block_rtas_call(), so user space with sufficient privilege to use
sys_rtas() can trigger the warnings at will:

  unexpected failed lookup for token 2048
  WARNING: CPU: 20 PID: 2247 at arch/powerpc/kernel/rtas.c:556
    rtas_token_to_function+0xfc/0x110
  ...
  NIP rtas_token_to_function+0xfc/0x110
  LR  rtas_token_to_function+0xf8/0x110
  Call Trace:
    rtas_token_to_function+0xf8/0x110 (unreliable)
    sys_rtas+0x188/0x880
    system_call_exception+0x268/0x530
    system_call_common+0x160/0x2c4

It's desirable to continue warning on bogus tokens in
rtas_token_to_function(). Currently it is used to look up RTAS
function descriptors when tracing, where we know there has to have
been a successful descriptor lookup by different means already, and it
would be a serious inconsistency for the reverse lookup to fail.

So instead of weakening rtas_token_to_function()'s contract by
removing the warnings, introduce rtas_token_to_function_untrusted(),
which has no opinion on failed lookups. Convert block_rtas_call() and
rtas_token_to_function() to use it.

Fixes: 8252b88294d2 ("powerpc/rtas: improve function information lookups")
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231212-papr-sys_rtas-vs-lockdown-v6-1-e9eafd0c8c6c@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/powerpc/kernel/rtas.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index eddc031c4b95..87d65bdd3eca 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -544,6 +544,21 @@ static int __init rtas_token_to_function_xarray_init(void)
 }
 arch_initcall(rtas_token_to_function_xarray_init);
 
+/*
+ * For use by sys_rtas(), where the token value is provided by user
+ * space and we don't want to warn on failed lookups.
+ */
+static const struct rtas_function *rtas_token_to_function_untrusted(s32 token)
+{
+	return xa_load(&rtas_token_to_function_xarray, token);
+}
+
+/*
+ * Reverse lookup for deriving the function descriptor from a
+ * known-good token value in contexts where the former is not already
+ * available. @token must be valid, e.g. derived from the result of a
+ * prior lookup against the function table.
+ */
 static const struct rtas_function *rtas_token_to_function(s32 token)
 {
 	const struct rtas_function *func;
@@ -551,7 +566,7 @@ static const struct rtas_function *rtas_token_to_function(s32 token)
 	if (WARN_ONCE(token < 0, "invalid token %d", token))
 		return NULL;
 
-	func = xa_load(&rtas_token_to_function_xarray, token);
+	func = rtas_token_to_function_untrusted(token);
 
 	if (WARN_ONCE(!func, "unexpected failed lookup for token %d", token))
 		return NULL;
@@ -1726,7 +1741,7 @@ static bool block_rtas_call(int token, int nargs,
 	 * If this token doesn't correspond to a function the kernel
 	 * understands, you're not allowed to call it.
 	 */
-	func = rtas_token_to_function(token);
+	func = rtas_token_to_function_untrusted(token);
 	if (!func)
 		goto err;
 	/*
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 016/583] powerpc/powernv: Add a null pointer check to scom_debug_init_one()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (14 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 015/583] powerpc/rtas: Avoid warning on invalid token argument to sys_rtas() Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 017/583] powerpc/powernv: Add a null pointer check in opal_event_init() Greg Kroah-Hartman
                   ` (573 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kunwu Chan, Michael Ellerman, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kunwu Chan <chentao@kylinos.cn>

[ Upstream commit 9a260f2dd827bbc82cc60eb4f4d8c22707d80742 ]

kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure.
Add a null pointer check, and release 'ent' to avoid memory leaks.

Fixes: bfd2f0d49aef ("powerpc/powernv: Get rid of old scom_controller abstraction")
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231208085937.107210-1-chentao@kylinos.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/powerpc/platforms/powernv/opal-xscom.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/powerpc/platforms/powernv/opal-xscom.c b/arch/powerpc/platforms/powernv/opal-xscom.c
index 262cd6fac907..748c2b97fa53 100644
--- a/arch/powerpc/platforms/powernv/opal-xscom.c
+++ b/arch/powerpc/platforms/powernv/opal-xscom.c
@@ -165,6 +165,11 @@ static int scom_debug_init_one(struct dentry *root, struct device_node *dn,
 	ent->chip = chip;
 	snprintf(ent->name, 16, "%08x", chip);
 	ent->path.data = (void *)kasprintf(GFP_KERNEL, "%pOF", dn);
+	if (!ent->path.data) {
+		kfree(ent);
+		return -ENOMEM;
+	}
+
 	ent->path.size = strlen((char *)ent->path.data);
 
 	dir = debugfs_create_dir(ent->name, root);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 017/583] powerpc/powernv: Add a null pointer check in opal_event_init()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (15 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 016/583] powerpc/powernv: Add a null pointer check to scom_debug_init_one() Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 018/583] powerpc/powernv: Add a null pointer check in opal_powercap_init() Greg Kroah-Hartman
                   ` (572 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kunwu Chan, Michael Ellerman, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kunwu Chan <chentao@kylinos.cn>

[ Upstream commit 8649829a1dd25199bbf557b2621cedb4bf9b3050 ]

kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure.

Fixes: 2717a33d6074 ("powerpc/opal-irqchip: Use interrupt names if present")
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231127030755.1546750-1-chentao@kylinos.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/powerpc/platforms/powernv/opal-irqchip.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/platforms/powernv/opal-irqchip.c b/arch/powerpc/platforms/powernv/opal-irqchip.c
index f9a7001dacb7..56a1f7ce78d2 100644
--- a/arch/powerpc/platforms/powernv/opal-irqchip.c
+++ b/arch/powerpc/platforms/powernv/opal-irqchip.c
@@ -275,6 +275,8 @@ int __init opal_event_init(void)
 		else
 			name = kasprintf(GFP_KERNEL, "opal");
 
+		if (!name)
+			continue;
 		/* Install interrupt handler */
 		rc = request_irq(r->start, opal_interrupt, r->flags & IRQD_TRIGGER_MASK,
 				 name, NULL);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 018/583] powerpc/powernv: Add a null pointer check in opal_powercap_init()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (16 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 017/583] powerpc/powernv: Add a null pointer check in opal_event_init() Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 019/583] powerpc/imc-pmu: Add a null pointer check in update_events_in_group() Greg Kroah-Hartman
                   ` (571 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kunwu Chan, Michael Ellerman, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kunwu Chan <chentao@kylinos.cn>

[ Upstream commit e123015c0ba859cf48aa7f89c5016cc6e98e018d ]

kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure.

Fixes: b9ef7b4b867f ("powerpc: Convert to using %pOFn instead of device_node.name")
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231126095739.1501990-1-chentao@kylinos.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/powerpc/platforms/powernv/opal-powercap.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/powerpc/platforms/powernv/opal-powercap.c b/arch/powerpc/platforms/powernv/opal-powercap.c
index 7bfe4cbeb35a..ea917266aa17 100644
--- a/arch/powerpc/platforms/powernv/opal-powercap.c
+++ b/arch/powerpc/platforms/powernv/opal-powercap.c
@@ -196,6 +196,12 @@ void __init opal_powercap_init(void)
 
 		j = 0;
 		pcaps[i].pg.name = kasprintf(GFP_KERNEL, "%pOFn", node);
+		if (!pcaps[i].pg.name) {
+			kfree(pcaps[i].pattrs);
+			kfree(pcaps[i].pg.attrs);
+			goto out_pcaps_pattrs;
+		}
+
 		if (has_min) {
 			powercap_add_attr(min, "powercap-min",
 					  &pcaps[i].pattrs[j]);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 019/583] powerpc/imc-pmu: Add a null pointer check in update_events_in_group()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (17 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 018/583] powerpc/powernv: Add a null pointer check in opal_powercap_init() Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 020/583] sched/fair: Update min_vruntime for reweight_entity() correctly Greg Kroah-Hartman
                   ` (570 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kunwu Chan, Michael Ellerman, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kunwu Chan <chentao@kylinos.cn>

[ Upstream commit 0a233867a39078ebb0f575e2948593bbff5826b3 ]

kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure.

Fixes: 885dcd709ba9 ("powerpc/perf: Add nest IMC PMU support")
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231126093719.1440305-1-chentao@kylinos.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/powerpc/perf/imc-pmu.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
index ada817c49b72..56d82f7f9734 100644
--- a/arch/powerpc/perf/imc-pmu.c
+++ b/arch/powerpc/perf/imc-pmu.c
@@ -299,6 +299,8 @@ static int update_events_in_group(struct device_node *node, struct imc_pmu *pmu)
 	attr_group->attrs = attrs;
 	do {
 		ev_val_str = kasprintf(GFP_KERNEL, "event=0x%x", pmu->events[i].value);
+		if (!ev_val_str)
+			continue;
 		dev_str = device_str_attr_create(pmu->events[i].name, ev_val_str);
 		if (!dev_str)
 			continue;
@@ -306,6 +308,8 @@ static int update_events_in_group(struct device_node *node, struct imc_pmu *pmu)
 		attrs[j++] = dev_str;
 		if (pmu->events[i].scale) {
 			ev_scale_str = kasprintf(GFP_KERNEL, "%s.scale", pmu->events[i].name);
+			if (!ev_scale_str)
+				continue;
 			dev_str = device_str_attr_create(ev_scale_str, pmu->events[i].scale);
 			if (!dev_str)
 				continue;
@@ -315,6 +319,8 @@ static int update_events_in_group(struct device_node *node, struct imc_pmu *pmu)
 
 		if (pmu->events[i].unit) {
 			ev_unit_str = kasprintf(GFP_KERNEL, "%s.unit", pmu->events[i].name);
+			if (!ev_unit_str)
+				continue;
 			dev_str = device_str_attr_create(ev_unit_str, pmu->events[i].unit);
 			if (!dev_str)
 				continue;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 020/583] sched/fair: Update min_vruntime for reweight_entity() correctly
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (18 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 019/583] powerpc/imc-pmu: Add a null pointer check in update_events_in_group() Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 021/583] perf/x86/intel/uncore: Fix NULL pointer dereference issue in upi_fill_topology() Greg Kroah-Hartman
                   ` (569 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yiwei Lin, Peter Zijlstra (Intel),
	Abel Wu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yiwei Lin <s921975628@gmail.com>

[ Upstream commit 5068d84054b766efe7c6202fc71b2350d1c326f1 ]

Since reweight_entity() may have chance to change the weight of
cfs_rq->curr entity, we should also update_min_vruntime() if
this is the case

Fixes: eab03c23c2a1 ("sched/eevdf: Fix vruntime adjustment on reweight")
Signed-off-by: Yiwei Lin <s921975628@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Abel Wu <wuyun.abel@bytedance.com>
Link: https://lore.kernel.org/r/20231117080106.12890-1-s921975628@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/sched/fair.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index fa9fff0f9620..d336af9cba13 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3771,17 +3771,17 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se,
 	enqueue_load_avg(cfs_rq, se);
 	if (se->on_rq) {
 		update_load_add(&cfs_rq->load, se->load.weight);
-		if (!curr) {
-			/*
-			 * The entity's vruntime has been adjusted, so let's check
-			 * whether the rq-wide min_vruntime needs updated too. Since
-			 * the calculations above require stable min_vruntime rather
-			 * than up-to-date one, we do the update at the end of the
-			 * reweight process.
-			 */
+		if (!curr)
 			__enqueue_entity(cfs_rq, se);
-			update_min_vruntime(cfs_rq);
-		}
+
+		/*
+		 * The entity's vruntime has been adjusted, so let's check
+		 * whether the rq-wide min_vruntime needs updated too. Since
+		 * the calculations above require stable min_vruntime rather
+		 * than up-to-date one, we do the update at the end of the
+		 * reweight process.
+		 */
+		update_min_vruntime(cfs_rq);
 	}
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 021/583] perf/x86/intel/uncore: Fix NULL pointer dereference issue in upi_fill_topology()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (19 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 020/583] sched/fair: Update min_vruntime for reweight_entity() correctly Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 022/583] spi: spi-zynqmp-gqspi: fix driver kconfig dependencies Greg Kroah-Hartman
                   ` (568 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kyle Meyer, Alexander Antonov,
	Peter Zijlstra (Intel),
	Kan Liang, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alexander Antonov <alexander.antonov@linux.intel.com>

[ Upstream commit 1692cf434ba13ee212495b5af795b6a07e986ce4 ]

Get logical socket id instead of physical id in discover_upi_topology()
to avoid out-of-bound access on 'upi = &type->topology[nid][idx];' line
that leads to NULL pointer dereference in upi_fill_topology()

Fixes: f680b6e6062e ("perf/x86/intel/uncore: Enable UPI topology discovery for Icelake Server")
Reported-by: Kyle Meyer <kyle.meyer@hpe.com>
Signed-off-by: Alexander Antonov <alexander.antonov@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Tested-by: Kyle Meyer <kyle.meyer@hpe.com>
Link: https://lore.kernel.org/r/20231127185246.2371939-2-alexander.antonov@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/x86/events/intel/uncore_snbep.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 8250f0f59c2b..49bc27ab26ad 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -5596,7 +5596,7 @@ static int discover_upi_topology(struct intel_uncore_type *type, int ubox_did, i
 	struct pci_dev *ubox = NULL;
 	struct pci_dev *dev = NULL;
 	u32 nid, gid;
-	int i, idx, ret = -EPERM;
+	int i, idx, lgc_pkg, ret = -EPERM;
 	struct intel_uncore_topology *upi;
 	unsigned int devfn;
 
@@ -5614,8 +5614,13 @@ static int discover_upi_topology(struct intel_uncore_type *type, int ubox_did, i
 		for (i = 0; i < 8; i++) {
 			if (nid != GIDNIDMAP(gid, i))
 				continue;
+			lgc_pkg = topology_phys_to_logical_pkg(i);
+			if (lgc_pkg < 0) {
+				ret = -EPERM;
+				goto err;
+			}
 			for (idx = 0; idx < type->num_boxes; idx++) {
-				upi = &type->topology[nid][idx];
+				upi = &type->topology[lgc_pkg][idx];
 				devfn = PCI_DEVFN(dev_link0 + idx, ICX_UPI_REGS_ADDR_FUNCTION);
 				dev = pci_get_domain_bus_and_slot(pci_domain_nr(ubox->bus),
 								  ubox->bus->number,
@@ -5626,6 +5631,7 @@ static int discover_upi_topology(struct intel_uncore_type *type, int ubox_did, i
 						goto err;
 				}
 			}
+			break;
 		}
 	}
 err:
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 022/583] spi: spi-zynqmp-gqspi: fix driver kconfig dependencies
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (20 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 021/583] perf/x86/intel/uncore: Fix NULL pointer dereference issue in upi_fill_topology() Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 023/583] mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response Greg Kroah-Hartman
                   ` (567 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Amit Kumar Mahapatra,
	Radhey Shyam Pandey, Mark Brown, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>

[ Upstream commit 424a8166764e462258fdccaaefbdeb07517c8b21 ]

ZynqMP GQSPI driver no longer uses spi-master framework. It had been
converted to use spi-mem framework. So remove driver dependency from
spi-master and replace it with spi-mem.

Fixes: 1c26372e5aa9 ("spi: spi-zynqmp-gqspi: Update driver to use spi-mem framework")
Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Link: https://lore.kernel.org/r/1699282435-884917-1-git-send-email-radhey.shyam.pandey@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/spi/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index bcbf840cd41c..3ce0fd5df8e9 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -1165,9 +1165,10 @@ config SPI_ZYNQ_QSPI
 
 config SPI_ZYNQMP_GQSPI
 	tristate "Xilinx ZynqMP GQSPI controller"
-	depends on (SPI_MASTER && HAS_DMA) || COMPILE_TEST
+	depends on (SPI_MEM && HAS_DMA) || COMPILE_TEST
 	help
 	  Enables Xilinx GQSPI controller driver for Zynq UltraScale+ MPSoC.
+	  This controller only supports SPI memory interface.
 
 config SPI_AMD
 	tristate "AMD SPI controller"
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 023/583] mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (21 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 022/583] spi: spi-zynqmp-gqspi: fix driver kconfig dependencies Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 024/583] ACPI: video: check for error while searching for backlight device parent Greg Kroah-Hartman
                   ` (566 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Miquel Raynal, Andy Shevchenko,
	Ronald Monthero, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ronald Monthero <debug.penguin32@gmail.com>

[ Upstream commit 923fb6238cb3ac529aa2bf13b3b1e53762186a8b ]

Under heavy load it is likely that the controller is done
with its own task but the thread unlocking the wait is not
scheduled in time. Increasing IFC_TIMEOUT_MSECS allows the
controller to respond within allowable timeslice of 1 sec.

fsl,ifc-nand 7e800000.nand: Controller is not responding

[<804b2047>] (nand_get_device) from [<804b5335>] (nand_write_oob+0x1b/0x4a)
[<804b5335>] (nand_write_oob) from [<804a3585>] (mtd_write+0x41/0x5c)
[<804a3585>] (mtd_write) from [<804c1d47>] (ubi_io_write+0x17f/0x22c)
[<804c1d47>] (ubi_io_write) from [<804c047b>] (ubi_eba_write_leb+0x5b/0x1d0)

Fixes: 82771882d960 ("NAND Machine support for Integrated Flash Controller")
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Ronald Monthero <debug.penguin32@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20231118083156.776887-1-debug.penguin32@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/mtd/nand/raw/fsl_ifc_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c
index 20bb1e0cb5eb..f0e2318ce088 100644
--- a/drivers/mtd/nand/raw/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c
@@ -21,7 +21,7 @@
 
 #define ERR_BYTE		0xFF /* Value returned for read
 					bytes when read failed	*/
-#define IFC_TIMEOUT_MSECS	500  /* Maximum number of mSecs to wait
+#define IFC_TIMEOUT_MSECS	1000 /* Maximum timeout to wait
 					for IFC NAND Machine	*/
 
 struct fsl_ifc_ctrl;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 024/583] ACPI: video: check for error while searching for backlight device parent
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (22 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 023/583] mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 025/583] ACPI: LPIT: Avoid u32 multiplication overflow Greg Kroah-Hartman
                   ` (565 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nikita Kiryushin, Rafael J. Wysocki,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nikita Kiryushin <kiryushin@ancud.ru>

[ Upstream commit ccd45faf4973746c4f30ea41eec864e5cf191099 ]

If acpi_get_parent() called in acpi_video_dev_register_backlight()
fails, for example, because acpi_ut_acquire_mutex() fails inside
acpi_get_parent), this can lead to incorrect (uninitialized)
acpi_parent handle being passed to acpi_get_pci_dev() for detecting
the parent pci device.

Check acpi_get_parent() result and set parent device only in case of success.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 9661e92c10a9 ("acpi: tie ACPI backlight devices to PCI devices if possible")
Signed-off-by: Nikita Kiryushin <kiryushin@ancud.ru>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/acpi_video.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index 35f071ad9532..27a6ae89f13a 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -1713,12 +1713,12 @@ static void acpi_video_dev_register_backlight(struct acpi_video_device *device)
 		return;
 	count++;
 
-	acpi_get_parent(device->dev->handle, &acpi_parent);
-
-	pdev = acpi_get_pci_dev(acpi_parent);
-	if (pdev) {
-		parent = &pdev->dev;
-		pci_dev_put(pdev);
+	if (ACPI_SUCCESS(acpi_get_parent(device->dev->handle, &acpi_parent))) {
+		pdev = acpi_get_pci_dev(acpi_parent);
+		if (pdev) {
+			parent = &pdev->dev;
+			pci_dev_put(pdev);
+		}
 	}
 
 	memset(&props, 0, sizeof(struct backlight_properties));
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 025/583] ACPI: LPIT: Avoid u32 multiplication overflow
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (23 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 024/583] ACPI: video: check for error while searching for backlight device parent Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 026/583] KEYS: encrypted: Add check for strsep Greg Kroah-Hartman
                   ` (564 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nikita Kiryushin, Rafael J. Wysocki,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nikita Kiryushin <kiryushin@ancud.ru>

[ Upstream commit 56d2eeda87995245300836ee4dbd13b002311782 ]

In lpit_update_residency() there is a possibility of overflow
in multiplication, if tsc_khz is large enough (> UINT_MAX/1000).

Change multiplication to mul_u32_u32().

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: eeb2d80d502a ("ACPI / LPIT: Add Low Power Idle Table (LPIT) support")
Signed-off-by: Nikita Kiryushin <kiryushin@ancud.ru>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/acpi_lpit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpi_lpit.c b/drivers/acpi/acpi_lpit.c
index c5598b6d5db8..794962c5c88e 100644
--- a/drivers/acpi/acpi_lpit.c
+++ b/drivers/acpi/acpi_lpit.c
@@ -105,7 +105,7 @@ static void lpit_update_residency(struct lpit_residency_info *info,
 		return;
 
 	info->frequency = lpit_native->counter_frequency ?
-				lpit_native->counter_frequency : tsc_khz * 1000;
+				lpit_native->counter_frequency : mul_u32_u32(tsc_khz, 1000U);
 	if (!info->frequency)
 		info->frequency = 1;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 026/583] KEYS: encrypted: Add check for strsep
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (24 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 025/583] ACPI: LPIT: Avoid u32 multiplication overflow Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 027/583] spi: cadence-quadspi: add missing clk_disable_unprepare() in cqspi_probe() Greg Kroah-Hartman
                   ` (563 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Chen Ni, Mimi Zohar, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chen Ni <nichen@iscas.ac.cn>

[ Upstream commit b4af096b5df5dd131ab796c79cedc7069d8f4882 ]

Add check for strsep() in order to transfer the error.

Fixes: cd3bc044af48 ("KEYS: encrypted: Instantiate key with user-provided decrypted data")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 security/keys/encrypted-keys/encrypted.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/security/keys/encrypted-keys/encrypted.c b/security/keys/encrypted-keys/encrypted.c
index 1e313982af02..fea7e0937150 100644
--- a/security/keys/encrypted-keys/encrypted.c
+++ b/security/keys/encrypted-keys/encrypted.c
@@ -237,6 +237,10 @@ static int datablob_parse(char *datablob, const char **format,
 			break;
 		}
 		*decrypted_data = strsep(&datablob, " \t");
+		if (!*decrypted_data) {
+			pr_info("encrypted_key: decrypted_data is missing\n");
+			break;
+		}
 		ret = 0;
 		break;
 	case Opt_load:
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 027/583] spi: cadence-quadspi: add missing clk_disable_unprepare() in cqspi_probe()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (25 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 026/583] KEYS: encrypted: Add check for strsep Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 028/583] platform/x86/intel/vsec: Fix xa_alloc memory leak Greg Kroah-Hartman
                   ` (562 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yang Yingliang, Mark Brown, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yang Yingliang <yangyingliang@huawei.com>

[ Upstream commit 5cb475174cce1bfedf1025b6e235e2c43d81144f ]

cqspi_jh7110_clk_init() is called after clk_prepare_enable(cqspi->clk),
if it fails, it should goto label 'probe_reset_failed' to disable
cqspi->clk.

In the error path after calling cqspi_jh7110_clk_init(),
cqspi_jh7110_disable_clk() need be called.

Fixes: 33f1ef6d4eb6 ("spi: cadence-quadspi: Add clock configuration for StarFive JH7110 QSPI")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20231129081147.628004-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/spi/spi-cadence-quadspi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index b50db71ac4cc..2064dc4ea935 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1825,7 +1825,7 @@ static int cqspi_probe(struct platform_device *pdev)
 		if (ddata->jh7110_clk_init) {
 			ret = cqspi_jh7110_clk_init(pdev, cqspi);
 			if (ret)
-				goto probe_clk_failed;
+				goto probe_reset_failed;
 		}
 
 		if (of_device_is_compatible(pdev->dev.of_node,
@@ -1872,6 +1872,8 @@ static int cqspi_probe(struct platform_device *pdev)
 probe_setup_failed:
 	cqspi_controller_enable(cqspi, 0);
 probe_reset_failed:
+	if (cqspi->is_jh7110)
+		cqspi_jh7110_disable_clk(pdev, cqspi);
 	clk_disable_unprepare(cqspi->clk);
 probe_clk_failed:
 	pm_runtime_put_sync(dev);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 028/583] platform/x86/intel/vsec: Fix xa_alloc memory leak
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (26 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 027/583] spi: cadence-quadspi: add missing clk_disable_unprepare() in cqspi_probe() Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 029/583] cpufreq: scmi: process the result of devm_of_clk_add_hw_provider() Greg Kroah-Hartman
                   ` (561 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, David E. Box, Ilpo Järvinen,
	Hans de Goede, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: David E. Box <david.e.box@linux.intel.com>

[ Upstream commit 8cbcc1dbf8a62c730fadd60de761e0658547a589 ]

Commit 936874b77dd0 ("platform/x86/intel/vsec: Add PCI error recovery
support to Intel PMT") added an xarray to track the list of vsec devices to
be recovered after a PCI error. But it did not provide cleanup for the list
leading to a memory leak that was caught by kmemleak.  Do xa_alloc() before
devm_add_action_or_reset() so that the list may be cleaned up with
xa_erase() in the release function.

Fixes: 936874b77dd0 ("platform/x86/intel/vsec: Add PCI error recovery support to Intel PMT")
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20231129222132.2331261-2-david.e.box@linux.intel.com
[hdegoede@redhat.com: Add missing xa_erase() on error-exit
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/platform/x86/intel/vsec.c | 25 +++++++++++++++----------
 drivers/platform/x86/intel/vsec.h |  1 +
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/drivers/platform/x86/intel/vsec.c b/drivers/platform/x86/intel/vsec.c
index c1f9e4471b28..343ab6a82c01 100644
--- a/drivers/platform/x86/intel/vsec.c
+++ b/drivers/platform/x86/intel/vsec.c
@@ -120,6 +120,8 @@ static void intel_vsec_dev_release(struct device *dev)
 {
 	struct intel_vsec_device *intel_vsec_dev = dev_to_ivdev(dev);
 
+	xa_erase(&auxdev_array, intel_vsec_dev->id);
+
 	mutex_lock(&vsec_ida_lock);
 	ida_free(intel_vsec_dev->ida, intel_vsec_dev->auxdev.id);
 	mutex_unlock(&vsec_ida_lock);
@@ -135,19 +137,28 @@ int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,
 	struct auxiliary_device *auxdev = &intel_vsec_dev->auxdev;
 	int ret, id;
 
-	mutex_lock(&vsec_ida_lock);
-	ret = ida_alloc(intel_vsec_dev->ida, GFP_KERNEL);
-	mutex_unlock(&vsec_ida_lock);
+	ret = xa_alloc(&auxdev_array, &intel_vsec_dev->id, intel_vsec_dev,
+		       PMT_XA_LIMIT, GFP_KERNEL);
 	if (ret < 0) {
 		kfree(intel_vsec_dev->resource);
 		kfree(intel_vsec_dev);
 		return ret;
 	}
 
+	mutex_lock(&vsec_ida_lock);
+	id = ida_alloc(intel_vsec_dev->ida, GFP_KERNEL);
+	mutex_unlock(&vsec_ida_lock);
+	if (id < 0) {
+		xa_erase(&auxdev_array, intel_vsec_dev->id);
+		kfree(intel_vsec_dev->resource);
+		kfree(intel_vsec_dev);
+		return id;
+	}
+
 	if (!parent)
 		parent = &pdev->dev;
 
-	auxdev->id = ret;
+	auxdev->id = id;
 	auxdev->name = name;
 	auxdev->dev.parent = parent;
 	auxdev->dev.release = intel_vsec_dev_release;
@@ -169,12 +180,6 @@ int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,
 	if (ret < 0)
 		return ret;
 
-	/* Add auxdev to list */
-	ret = xa_alloc(&auxdev_array, &id, intel_vsec_dev, PMT_XA_LIMIT,
-		       GFP_KERNEL);
-	if (ret)
-		return ret;
-
 	return 0;
 }
 EXPORT_SYMBOL_NS_GPL(intel_vsec_add_aux, INTEL_VSEC);
diff --git a/drivers/platform/x86/intel/vsec.h b/drivers/platform/x86/intel/vsec.h
index 0fd042c171ba..0a6201b4a0e9 100644
--- a/drivers/platform/x86/intel/vsec.h
+++ b/drivers/platform/x86/intel/vsec.h
@@ -45,6 +45,7 @@ struct intel_vsec_device {
 	struct ida *ida;
 	struct intel_vsec_platform_info *info;
 	int num_resources;
+	int id; /* xa */
 	void *priv_data;
 	size_t priv_data_size;
 };
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 029/583] cpufreq: scmi: process the result of devm_of_clk_add_hw_provider()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (27 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 028/583] platform/x86/intel/vsec: Fix xa_alloc memory leak Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 030/583] calipso: fix memory leak in netlbl_calipso_add_pass() Greg Kroah-Hartman
                   ` (560 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alexandra Diupina, Viresh Kumar,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alexandra Diupina <adiupina@astralinux.ru>

[ Upstream commit c4a5118a3ae1eadc687d84eef9431f9e13eb015c ]

devm_of_clk_add_hw_provider() may return an errno, so
add a return value check

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 8410e7f3b31e ("cpufreq: scmi: Fix OPP addition failure with a dummy clock provider")
Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/cpufreq/scmi-cpufreq.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
index f34e6382a4c5..028df8a5f537 100644
--- a/drivers/cpufreq/scmi-cpufreq.c
+++ b/drivers/cpufreq/scmi-cpufreq.c
@@ -310,8 +310,11 @@ static int scmi_cpufreq_probe(struct scmi_device *sdev)
 
 #ifdef CONFIG_COMMON_CLK
 	/* dummy clock provider as needed by OPP if clocks property is used */
-	if (of_property_present(dev->of_node, "#clock-cells"))
-		devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL);
+	if (of_property_present(dev->of_node, "#clock-cells")) {
+		ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, NULL);
+		if (ret)
+			return dev_err_probe(dev, ret, "%s: registering clock provider failed\n", __func__);
+	}
 #endif
 
 	ret = cpufreq_register_driver(&scmi_cpufreq_driver);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 030/583] calipso: fix memory leak in netlbl_calipso_add_pass()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (28 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 029/583] cpufreq: scmi: process the result of devm_of_clk_add_hw_provider() Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 031/583] efivarfs: force RO when remounting if SetVariable is not supported Greg Kroah-Hartman
                   ` (559 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Gavrilov Ilia, Paul Moore, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Gavrilov Ilia <Ilia.Gavrilov@infotecs.ru>

[ Upstream commit ec4e9d630a64df500641892f4e259e8149594a99 ]

If IPv6 support is disabled at boot (ipv6.disable=1),
the calipso_init() -> netlbl_calipso_ops_register() function isn't called,
and the netlbl_calipso_ops_get() function always returns NULL.
In this case, the netlbl_calipso_add_pass() function allocates memory
for the doi_def variable but doesn't free it with the calipso_doi_free().

BUG: memory leak
unreferenced object 0xffff888011d68180 (size 64):
  comm "syz-executor.1", pid 10746, jiffies 4295410986 (age 17.928s)
  hex dump (first 32 bytes):
    00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<...>] kmalloc include/linux/slab.h:552 [inline]
    [<...>] netlbl_calipso_add_pass net/netlabel/netlabel_calipso.c:76 [inline]
    [<...>] netlbl_calipso_add+0x22e/0x4f0 net/netlabel/netlabel_calipso.c:111
    [<...>] genl_family_rcv_msg_doit+0x22f/0x330 net/netlink/genetlink.c:739
    [<...>] genl_family_rcv_msg net/netlink/genetlink.c:783 [inline]
    [<...>] genl_rcv_msg+0x341/0x5a0 net/netlink/genetlink.c:800
    [<...>] netlink_rcv_skb+0x14d/0x440 net/netlink/af_netlink.c:2515
    [<...>] genl_rcv+0x29/0x40 net/netlink/genetlink.c:811
    [<...>] netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline]
    [<...>] netlink_unicast+0x54b/0x800 net/netlink/af_netlink.c:1339
    [<...>] netlink_sendmsg+0x90a/0xdf0 net/netlink/af_netlink.c:1934
    [<...>] sock_sendmsg_nosec net/socket.c:651 [inline]
    [<...>] sock_sendmsg+0x157/0x190 net/socket.c:671
    [<...>] ____sys_sendmsg+0x712/0x870 net/socket.c:2342
    [<...>] ___sys_sendmsg+0xf8/0x170 net/socket.c:2396
    [<...>] __sys_sendmsg+0xea/0x1b0 net/socket.c:2429
    [<...>] do_syscall_64+0x30/0x40 arch/x86/entry/common.c:46
    [<...>] entry_SYSCALL_64_after_hwframe+0x61/0xc6

Found by InfoTeCS on behalf of Linux Verification Center
(linuxtesting.org) with Syzkaller

Fixes: cb72d38211ea ("netlabel: Initial support for the CALIPSO netlink protocol.")
Signed-off-by: Gavrilov Ilia <Ilia.Gavrilov@infotecs.ru>
[PM: merged via the LSM tree at Jakub Kicinski request]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/netlabel/netlabel_calipso.c | 49 +++++++++++++++++----------------
 1 file changed, 26 insertions(+), 23 deletions(-)

diff --git a/net/netlabel/netlabel_calipso.c b/net/netlabel/netlabel_calipso.c
index f1d5b8465217..a07c2216d28b 100644
--- a/net/netlabel/netlabel_calipso.c
+++ b/net/netlabel/netlabel_calipso.c
@@ -54,6 +54,28 @@ static const struct nla_policy calipso_genl_policy[NLBL_CALIPSO_A_MAX + 1] = {
 	[NLBL_CALIPSO_A_MTYPE] = { .type = NLA_U32 },
 };
 
+static const struct netlbl_calipso_ops *calipso_ops;
+
+/**
+ * netlbl_calipso_ops_register - Register the CALIPSO operations
+ * @ops: ops to register
+ *
+ * Description:
+ * Register the CALIPSO packet engine operations.
+ *
+ */
+const struct netlbl_calipso_ops *
+netlbl_calipso_ops_register(const struct netlbl_calipso_ops *ops)
+{
+	return xchg(&calipso_ops, ops);
+}
+EXPORT_SYMBOL(netlbl_calipso_ops_register);
+
+static const struct netlbl_calipso_ops *netlbl_calipso_ops_get(void)
+{
+	return READ_ONCE(calipso_ops);
+}
+
 /* NetLabel Command Handlers
  */
 /**
@@ -96,15 +118,18 @@ static int netlbl_calipso_add_pass(struct genl_info *info,
  *
  */
 static int netlbl_calipso_add(struct sk_buff *skb, struct genl_info *info)
-
 {
 	int ret_val = -EINVAL;
 	struct netlbl_audit audit_info;
+	const struct netlbl_calipso_ops *ops = netlbl_calipso_ops_get();
 
 	if (!info->attrs[NLBL_CALIPSO_A_DOI] ||
 	    !info->attrs[NLBL_CALIPSO_A_MTYPE])
 		return -EINVAL;
 
+	if (!ops)
+		return -EOPNOTSUPP;
+
 	netlbl_netlink_auditinfo(&audit_info);
 	switch (nla_get_u32(info->attrs[NLBL_CALIPSO_A_MTYPE])) {
 	case CALIPSO_MAP_PASS:
@@ -363,28 +388,6 @@ int __init netlbl_calipso_genl_init(void)
 	return genl_register_family(&netlbl_calipso_gnl_family);
 }
 
-static const struct netlbl_calipso_ops *calipso_ops;
-
-/**
- * netlbl_calipso_ops_register - Register the CALIPSO operations
- * @ops: ops to register
- *
- * Description:
- * Register the CALIPSO packet engine operations.
- *
- */
-const struct netlbl_calipso_ops *
-netlbl_calipso_ops_register(const struct netlbl_calipso_ops *ops)
-{
-	return xchg(&calipso_ops, ops);
-}
-EXPORT_SYMBOL(netlbl_calipso_ops_register);
-
-static const struct netlbl_calipso_ops *netlbl_calipso_ops_get(void)
-{
-	return READ_ONCE(calipso_ops);
-}
-
 /**
  * calipso_doi_add - Add a new DOI to the CALIPSO protocol engine
  * @doi_def: the DOI structure
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 031/583] efivarfs: force RO when remounting if SetVariable is not supported
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (29 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 030/583] calipso: fix memory leak in netlbl_calipso_add_pass() Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 032/583] efivarfs: Free s_fs_info on unmount Greg Kroah-Hartman
                   ` (558 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ilias Apalodimas, Ard Biesheuvel,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ilias Apalodimas <ilias.apalodimas@linaro.org>

[ Upstream commit 0e8d2444168dd519fea501599d150e62718ed2fe ]

If SetVariable at runtime is not supported by the firmware we never assign
a callback for that function. At the same time mount the efivarfs as
RO so no one can call that.  However, we never check the permission flags
when someone remounts the filesystem as RW. As a result this leads to a
crash looking like this:

$ mount -o remount,rw /sys/firmware/efi/efivars
$ efi-updatevar -f PK.auth PK

[  303.279166] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
[  303.280482] Mem abort info:
[  303.280854]   ESR = 0x0000000086000004
[  303.281338]   EC = 0x21: IABT (current EL), IL = 32 bits
[  303.282016]   SET = 0, FnV = 0
[  303.282414]   EA = 0, S1PTW = 0
[  303.282821]   FSC = 0x04: level 0 translation fault
[  303.283771] user pgtable: 4k pages, 48-bit VAs, pgdp=000000004258c000
[  303.284913] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000
[  303.286076] Internal error: Oops: 0000000086000004 [#1] PREEMPT SMP
[  303.286936] Modules linked in: qrtr tpm_tis tpm_tis_core crct10dif_ce arm_smccc_trng rng_core drm fuse ip_tables x_tables ipv6
[  303.288586] CPU: 1 PID: 755 Comm: efi-updatevar Not tainted 6.3.0-rc1-00108-gc7d0c4695c68 #1
[  303.289748] Hardware name: Unknown Unknown Product/Unknown Product, BIOS 2023.04-00627-g88336918701d 04/01/2023
[  303.291150] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[  303.292123] pc : 0x0
[  303.292443] lr : efivar_set_variable_locked+0x74/0xec
[  303.293156] sp : ffff800008673c10
[  303.293619] x29: ffff800008673c10 x28: ffff0000037e8000 x27: 0000000000000000
[  303.294592] x26: 0000000000000800 x25: ffff000002467400 x24: 0000000000000027
[  303.295572] x23: ffffd49ea9832000 x22: ffff0000020c9800 x21: ffff000002467000
[  303.296566] x20: 0000000000000001 x19: 00000000000007fc x18: 0000000000000000
[  303.297531] x17: 0000000000000000 x16: 0000000000000000 x15: 0000aaaac807ab54
[  303.298495] x14: ed37489f673633c0 x13: 71c45c606de13f80 x12: 47464259e219acf4
[  303.299453] x11: ffff000002af7b01 x10: 0000000000000003 x9 : 0000000000000002
[  303.300431] x8 : 0000000000000010 x7 : ffffd49ea8973230 x6 : 0000000000a85201
[  303.301412] x5 : 0000000000000000 x4 : ffff0000020c9800 x3 : 00000000000007fc
[  303.302370] x2 : 0000000000000027 x1 : ffff000002467400 x0 : ffff000002467000
[  303.303341] Call trace:
[  303.303679]  0x0
[  303.303938]  efivar_entry_set_get_size+0x98/0x16c
[  303.304585]  efivarfs_file_write+0xd0/0x1a4
[  303.305148]  vfs_write+0xc4/0x2e4
[  303.305601]  ksys_write+0x70/0x104
[  303.306073]  __arm64_sys_write+0x1c/0x28
[  303.306622]  invoke_syscall+0x48/0x114
[  303.307156]  el0_svc_common.constprop.0+0x44/0xec
[  303.307803]  do_el0_svc+0x38/0x98
[  303.308268]  el0_svc+0x2c/0x84
[  303.308702]  el0t_64_sync_handler+0xf4/0x120
[  303.309293]  el0t_64_sync+0x190/0x194
[  303.309794] Code: ???????? ???????? ???????? ???????? (????????)
[  303.310612] ---[ end trace 0000000000000000 ]---

Fix this by adding a .reconfigure() function to the fs operations which
we can use to check the requested flags and deny anything that's not RO
if the firmware doesn't implement SetVariable at runtime.

Fixes: f88814cc2578 ("efi/efivars: Expose RT service availability via efivars abstraction")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/efivarfs/super.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
index 996271473609..05c01694e852 100644
--- a/fs/efivarfs/super.c
+++ b/fs/efivarfs/super.c
@@ -14,6 +14,7 @@
 #include <linux/slab.h>
 #include <linux/magic.h>
 #include <linux/statfs.h>
+#include <linux/printk.h>
 
 #include "internal.h"
 
@@ -275,8 +276,19 @@ static int efivarfs_get_tree(struct fs_context *fc)
 	return get_tree_single(fc, efivarfs_fill_super);
 }
 
+static int efivarfs_reconfigure(struct fs_context *fc)
+{
+	if (!efivar_supports_writes() && !(fc->sb_flags & SB_RDONLY)) {
+		pr_err("Firmware does not support SetVariableRT. Can not remount with rw\n");
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
 static const struct fs_context_operations efivarfs_context_ops = {
 	.get_tree	= efivarfs_get_tree,
+	.reconfigure	= efivarfs_reconfigure,
 };
 
 static int efivarfs_init_fs_context(struct fs_context *fc)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 032/583] efivarfs: Free s_fs_info on unmount
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (30 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 031/583] efivarfs: force RO when remounting if SetVariable is not supported Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 033/583] spi: sh-msiof: Enforce fixed DTDL for R-Car H3 Greg Kroah-Hartman
                   ` (557 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Ard Biesheuvel, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ard Biesheuvel <ardb@kernel.org>

[ Upstream commit 547713d502f7b4b8efccd409cff84d731a23853b ]

Now that we allocate a s_fs_info struct on fs context creation, we
should ensure that we free it again when the superblock goes away.

Fixes: 5329aa5101f7 ("efivarfs: Add uid/gid mount options")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/efivarfs/super.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
index 05c01694e852..d59d9670965c 100644
--- a/fs/efivarfs/super.c
+++ b/fs/efivarfs/super.c
@@ -299,6 +299,8 @@ static int efivarfs_init_fs_context(struct fs_context *fc)
 
 static void efivarfs_kill_sb(struct super_block *sb)
 {
+	struct efivarfs_fs_info *sfi = sb->s_fs_info;
+
 	kill_litter_super(sb);
 
 	if (!efivar_is_available())
@@ -306,6 +308,7 @@ static void efivarfs_kill_sb(struct super_block *sb)
 
 	/* Remove all entries and destroy */
 	efivar_entry_iter(efivarfs_destroy, &efivarfs_list, NULL);
+	kfree(sfi);
 }
 
 static struct file_system_type efivarfs_type = {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 033/583] spi: sh-msiof: Enforce fixed DTDL for R-Car H3
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (31 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 032/583] efivarfs: Free s_fs_info on unmount Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 034/583] ACPI: LPSS: Fix the fractional clock divider flags Greg Kroah-Hartman
                   ` (556 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Wolfram Sang, Geert Uytterhoeven,
	Yoshihiro Shimoda, Mark Brown, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

[ Upstream commit e5c7bcb499840551cfbe85c6df177ebc50432bf0 ]

Documentation says only DTDL of 200 is allowed for this SoC.

Fixes: 4286db8456f4 ("spi: sh-msiof: Add R-Car Gen 2 and 3 fallback bindings")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://msgid.link/r/20231212081239.14254-1-wsa+renesas@sang-engineering.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/spi/spi-sh-msiof.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index fb452bc78372..cfc3b1ddbd22 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -29,12 +29,15 @@
 
 #include <asm/unaligned.h>
 
+#define SH_MSIOF_FLAG_FIXED_DTDL_200	BIT(0)
+
 struct sh_msiof_chipdata {
 	u32 bits_per_word_mask;
 	u16 tx_fifo_size;
 	u16 rx_fifo_size;
 	u16 ctlr_flags;
 	u16 min_div_pow;
+	u32 flags;
 };
 
 struct sh_msiof_spi_priv {
@@ -1072,6 +1075,16 @@ static const struct sh_msiof_chipdata rcar_gen3_data = {
 	.min_div_pow = 1,
 };
 
+static const struct sh_msiof_chipdata rcar_r8a7795_data = {
+	.bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16) |
+			      SPI_BPW_MASK(24) | SPI_BPW_MASK(32),
+	.tx_fifo_size = 64,
+	.rx_fifo_size = 64,
+	.ctlr_flags = SPI_CONTROLLER_MUST_TX,
+	.min_div_pow = 1,
+	.flags = SH_MSIOF_FLAG_FIXED_DTDL_200,
+};
+
 static const struct of_device_id sh_msiof_match[] __maybe_unused = {
 	{ .compatible = "renesas,sh-mobile-msiof", .data = &sh_data },
 	{ .compatible = "renesas,msiof-r8a7743",   .data = &rcar_gen2_data },
@@ -1082,6 +1095,7 @@ static const struct of_device_id sh_msiof_match[] __maybe_unused = {
 	{ .compatible = "renesas,msiof-r8a7793",   .data = &rcar_gen2_data },
 	{ .compatible = "renesas,msiof-r8a7794",   .data = &rcar_gen2_data },
 	{ .compatible = "renesas,rcar-gen2-msiof", .data = &rcar_gen2_data },
+	{ .compatible = "renesas,msiof-r8a7795",   .data = &rcar_r8a7795_data },
 	{ .compatible = "renesas,msiof-r8a7796",   .data = &rcar_gen3_data },
 	{ .compatible = "renesas,rcar-gen3-msiof", .data = &rcar_gen3_data },
 	{ .compatible = "renesas,rcar-gen4-msiof", .data = &rcar_gen3_data },
@@ -1279,6 +1293,9 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
 		return -ENXIO;
 	}
 
+	if (chipdata->flags & SH_MSIOF_FLAG_FIXED_DTDL_200)
+		info->dtdl = 200;
+
 	if (info->mode == MSIOF_SPI_TARGET)
 		ctlr = spi_alloc_target(&pdev->dev,
 				        sizeof(struct sh_msiof_spi_priv));
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 034/583] ACPI: LPSS: Fix the fractional clock divider flags
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (32 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 033/583] spi: sh-msiof: Enforce fixed DTDL for R-Car H3 Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 035/583] ACPI: extlog: Clear Extended Error Log status when RAS_CEC handled the error Greg Kroah-Hartman
                   ` (555 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alex Vinarskis, Andy Shevchenko,
	Rafael J. Wysocki, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

[ Upstream commit 3ebccf1d1ca74bbb78e6f8c38d1d172e468d91f8 ]

The conversion to CLK_FRAC_DIVIDER_POWER_OF_TWO_PS uses wrong flags
in the parameters and hence miscalculates the values in the clock
divider. Fix this by applying the flag to the proper parameter.

Fixes: 82f53f9ee577 ("clk: fractional-divider: Introduce POWER_OF_TWO_PS flag")
Reported-by: Alex Vinarskis <alex.vinarskis@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/acpi_lpss.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index 539e700de4d2..a052e0ab19e4 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -465,8 +465,9 @@ static int register_device_clock(struct acpi_device *adev,
 		if (!clk_name)
 			return -ENOMEM;
 		clk = clk_register_fractional_divider(NULL, clk_name, parent,
+						      0, prv_base, 1, 15, 16, 15,
 						      CLK_FRAC_DIVIDER_POWER_OF_TWO_PS,
-						      prv_base, 1, 15, 16, 15, 0, NULL);
+						      NULL);
 		parent = clk_name;
 
 		clk_name = kasprintf(GFP_KERNEL, "%s-update", devname);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 035/583] ACPI: extlog: Clear Extended Error Log status when RAS_CEC handled the error
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (33 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 034/583] ACPI: LPSS: Fix the fractional clock divider flags Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 036/583] thermal: core: Fix NULL pointer dereference in zone registration error path Greg Kroah-Hartman
                   ` (554 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Erwin Tsaur, Tony Luck,
	Rafael J. Wysocki, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tony Luck <tony.luck@intel.com>

[ Upstream commit 38c872a9e96f72f2947affc0526cc05659367d3d ]

When both CONFIG_RAS_CEC and CONFIG_ACPI_EXTLOG are enabled, Linux does
not clear the status word of the BIOS supplied error record for corrected
errors. This may prevent logging of subsequent uncorrected errors.

Fix by clearing the status.

Fixes: 23ba710a0864 ("x86/mce: Fix all mce notifiers to update the mce->kflags bitmask")
Reported-by: Erwin Tsaur <erwin.tsaur@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/acpi_extlog.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c
index e120a96e1eae..71e8d4e7a36c 100644
--- a/drivers/acpi/acpi_extlog.c
+++ b/drivers/acpi/acpi_extlog.c
@@ -145,9 +145,14 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
 	static u32 err_seq;
 
 	estatus = extlog_elog_entry_check(cpu, bank);
-	if (estatus == NULL || (mce->kflags & MCE_HANDLED_CEC))
+	if (!estatus)
 		return NOTIFY_DONE;
 
+	if (mce->kflags & MCE_HANDLED_CEC) {
+		estatus->block_status = 0;
+		return NOTIFY_DONE;
+	}
+
 	memcpy(elog_buf, (void *)estatus, ELOG_ENTRY_LEN);
 	/* clear record status to enable BIOS to update it again */
 	estatus->block_status = 0;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 036/583] thermal: core: Fix NULL pointer dereference in zone registration error path
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (34 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 035/583] ACPI: extlog: Clear Extended Error Log status when RAS_CEC handled the error Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 037/583] kunit: debugfs: Fix unchecked dereference in debugfs_print_results() Greg Kroah-Hartman
                   ` (553 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Lukasz Luba, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

[ Upstream commit 04e6ccfc93c5a1aa1d75a537cf27e418895e20ea ]

If device_register() in thermal_zone_device_register_with_trips()
returns an error, the tz variable is set to NULL and subsequently
dereferenced in kfree(tz->tzp).

Commit adc8749b150c ("thermal/drivers/core: Use put_device() if
device_register() fails") added the tz = NULL assignment in question to
avoid a possible double-free after dropping the reference to the zone
device.  However, after commit 4649620d9404 ("thermal: core: Make
thermal_zone_device_unregister() return after freeing the zone"), that
assignment has become redundant, because dropping the reference to the
zone device does not cause the zone object to be freed any more.

Drop it to address the NULL pointer dereference.

Fixes: 3d439b1a2ad3 ("thermal/core: Alloc-copy-free the thermal zone parameters structure")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/thermal/thermal_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index e6f3166a9208..2de524fb7be5 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -1382,7 +1382,6 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t
 	device_del(&tz->device);
 release_device:
 	put_device(&tz->device);
-	tz = NULL;
 remove_id:
 	ida_free(&thermal_tz_ida, id);
 free_tzp:
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 037/583] kunit: debugfs: Fix unchecked dereference in debugfs_print_results()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (35 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 036/583] thermal: core: Fix NULL pointer dereference in zone registration error path Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 038/583] mtd: Fix gluebi NULL pointer dereference caused by ftl notifier Greg Kroah-Hartman
                   ` (552 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Richard Fitzgerald, Dan Carpenter,
	Rae Moar, Shuah Khan, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Richard Fitzgerald <rf@opensource.cirrus.com>

[ Upstream commit 34dfd5bb2e5507e69d9b6d6c90f546600c7a4977 ]

Move the call to kunit_suite_has_succeeded() after the check that
the kunit_suite pointer is valid.

This was found by smatch:

 lib/kunit/debugfs.c:66 debugfs_print_results() warn: variable
 dereferenced before check 'suite' (see line 63)

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Fixes: 38289a26e1b8 ("kunit: fix debugfs code to use enum kunit_status, not bool")
Reviewed-by: Rae Moar <rmoar@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 lib/kunit/debugfs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/kunit/debugfs.c b/lib/kunit/debugfs.c
index 22c5c496a68f..35ddb329dad6 100644
--- a/lib/kunit/debugfs.c
+++ b/lib/kunit/debugfs.c
@@ -53,12 +53,14 @@ static void debugfs_print_result(struct seq_file *seq,
 static int debugfs_print_results(struct seq_file *seq, void *v)
 {
 	struct kunit_suite *suite = (struct kunit_suite *)seq->private;
-	enum kunit_status success = kunit_suite_has_succeeded(suite);
+	enum kunit_status success;
 	struct kunit_case *test_case;
 
 	if (!suite)
 		return 0;
 
+	success = kunit_suite_has_succeeded(suite);
+
 	/* Print KTAP header so the debugfs log can be parsed as valid KTAP. */
 	seq_puts(seq, "KTAP version 1\n");
 	seq_puts(seq, "1..1\n");
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 038/583] mtd: Fix gluebi NULL pointer dereference caused by ftl notifier
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (36 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 037/583] kunit: debugfs: Fix unchecked dereference in debugfs_print_results() Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 039/583] cpuidle: haltpoll: Do not enable interrupts when entering idle Greg Kroah-Hartman
                   ` (551 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, ZhaoLong Wang, Zhihao Cheng,
	Richard Weinberger, Miquel Raynal, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: ZhaoLong Wang <wangzhaolong1@huawei.com>

[ Upstream commit a43bdc376deab5fff1ceb93dca55bcab8dbdc1d6 ]

If both ftl.ko and gluebi.ko are loaded, the notifier of ftl
triggers NULL pointer dereference when trying to access
‘gluebi->desc’ in gluebi_read().

ubi_gluebi_init
  ubi_register_volume_notifier
    ubi_enumerate_volumes
      ubi_notify_all
        gluebi_notify    nb->notifier_call()
          gluebi_create
            mtd_device_register
              mtd_device_parse_register
                add_mtd_device
                  blktrans_notify_add   not->add()
                    ftl_add_mtd         tr->add_mtd()
                      scan_header
                        mtd_read
                          mtd_read_oob
                            mtd_read_oob_std
                              gluebi_read   mtd->read()
                                gluebi->desc - NULL

Detailed reproduction information available at the Link [1],

In the normal case, obtain gluebi->desc in the gluebi_get_device(),
and access gluebi->desc in the gluebi_read(). However,
gluebi_get_device() is not executed in advance in the
ftl_add_mtd() process, which leads to NULL pointer dereference.

The solution for the gluebi module is to run jffs2 on the UBI
volume without considering working with ftl or mtdblock [2].
Therefore, this problem can be avoided by preventing gluebi from
creating the mtdblock device after creating mtd partition of the
type MTD_UBIVOLUME.

Fixes: 2ba3d76a1e29 ("UBI: make gluebi a separate module")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217992 [1]
Link: https://lore.kernel.org/lkml/441107100.23734.1697904580252.JavaMail.zimbra@nod.at/ [2]
Signed-off-by: ZhaoLong Wang <wangzhaolong1@huawei.com>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20231220024619.2138625-1-wangzhaolong1@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/mtd/mtd_blkdevs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index ff18636e0889..5bc32108ca03 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -463,7 +463,7 @@ static void blktrans_notify_add(struct mtd_info *mtd)
 {
 	struct mtd_blktrans_ops *tr;
 
-	if (mtd->type == MTD_ABSENT)
+	if (mtd->type == MTD_ABSENT || mtd->type == MTD_UBIVOLUME)
 		return;
 
 	list_for_each_entry(tr, &blktrans_majors, list)
@@ -503,7 +503,7 @@ int register_mtd_blktrans(struct mtd_blktrans_ops *tr)
 	mutex_lock(&mtd_table_mutex);
 	list_add(&tr->list, &blktrans_majors);
 	mtd_for_each_device(mtd)
-		if (mtd->type != MTD_ABSENT)
+		if (mtd->type != MTD_ABSENT && mtd->type != MTD_UBIVOLUME)
 			tr->add_mtd(tr, mtd);
 	mutex_unlock(&mtd_table_mutex);
 	return 0;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 039/583] cpuidle: haltpoll: Do not enable interrupts when entering idle
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (37 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 038/583] mtd: Fix gluebi NULL pointer dereference caused by ftl notifier Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 040/583] drivers/thermal/loongson2_thermal: Fix incorrect PTR_ERR() judgment Greg Kroah-Hartman
                   ` (550 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, forza, Borislav Petkov (AMD),
	Rafael J. Wysocki, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Borislav Petkov (AMD) <bp@alien8.de>

[ Upstream commit c8f5caec3df84a02b937d6d9cda1f7ffa8dc443f ]

The cpuidle drivers' ->enter() methods are supposed to be IRQ invariant:

  5e26aa933911 ("cpuidle/poll: Ensure IRQs stay disabled after cpuidle_state::enter() calls")
  bb7b11258561 ("cpuidle: Move IRQ state validation")

Do that in the haltpoll driver too.

Fixes: 5e26aa933911 ("cpuidle/poll: Ensure IRQs stay disabled after cpuidle_state::enter() calls")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218245
Reported-by: <forza@tnonline.net>
Tested-by: <forza@tnonline.net>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/cpuidle/cpuidle-haltpoll.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c
index e66df22f9695..d8515d5c0853 100644
--- a/drivers/cpuidle/cpuidle-haltpoll.c
+++ b/drivers/cpuidle/cpuidle-haltpoll.c
@@ -25,13 +25,12 @@ MODULE_PARM_DESC(force, "Load unconditionally");
 static struct cpuidle_device __percpu *haltpoll_cpuidle_devices;
 static enum cpuhp_state haltpoll_hp_state;
 
-static int default_enter_idle(struct cpuidle_device *dev,
-			      struct cpuidle_driver *drv, int index)
+static __cpuidle int default_enter_idle(struct cpuidle_device *dev,
+					struct cpuidle_driver *drv, int index)
 {
-	if (current_clr_polling_and_test()) {
-		local_irq_enable();
+	if (current_clr_polling_and_test())
 		return index;
-	}
+
 	arch_cpu_idle();
 	return index;
 }
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 040/583] drivers/thermal/loongson2_thermal: Fix incorrect PTR_ERR() judgment
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (38 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 039/583] cpuidle: haltpoll: Do not enable interrupts when entering idle Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 041/583] selinux: Fix error priority for bind with AF_UNSPEC on PF_INET6 socket Greg Kroah-Hartman
                   ` (549 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yinbo Zhu, Binbin Zhou,
	Daniel Lezcano, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Binbin Zhou <zhoubinbin@loongson.cn>

[ Upstream commit 15ef92e9c41124ee9d88b01208364f3fe1f45f84 ]

PTR_ERR() returns -ENODEV when thermal-zones are undefined, and we need
-ENODEV as the right value for comparison.

Otherwise, tz->type is NULL when thermal-zones is undefined, resulting
in the following error:

[   12.290030] CPU 1 Unable to handle kernel paging request at virtual address fffffffffffffff1, era == 900000000355f410, ra == 90000000031579b8
[   12.302877] Oops[#1]:
[   12.305190] CPU: 1 PID: 181 Comm: systemd-udevd Not tainted 6.6.0-rc7+ #5385
[   12.312304] pc 900000000355f410 ra 90000000031579b8 tp 90000001069e8000 sp 90000001069eba10
[   12.320739] a0 0000000000000000 a1 fffffffffffffff1 a2 0000000000000014 a3 0000000000000001
[   12.329173] a4 90000001069eb990 a5 0000000000000001 a6 0000000000001001 a7 900000010003431c
[   12.337606] t0 fffffffffffffff1 t1 54567fd5da9b4fd4 t2 900000010614ec40 t3 00000000000dc901
[   12.346041] t4 0000000000000000 t5 0000000000000004 t6 900000010614ee20 t7 900000000d00b790
[   12.354472] t8 00000000000dc901 u0 54567fd5da9b4fd4 s9 900000000402ae10 s0 900000010614ec40
[   12.362916] s1 90000000039fced0 s2 ffffffffffffffed s3 ffffffffffffffed s4 9000000003acc000
[   12.362931] s5 0000000000000004 s6 fffffffffffff000 s7 0000000000000490 s8 90000001028b2ec8
[   12.362938]    ra: 90000000031579b8 thermal_add_hwmon_sysfs+0x258/0x300
[   12.386411]   ERA: 900000000355f410 strscpy+0xf0/0x160
[   12.391626]  CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE)
[   12.397898]  PRMD: 00000004 (PPLV0 +PIE -PWE)
[   12.403678]  EUEN: 00000000 (-FPE -SXE -ASXE -BTE)
[   12.409859]  ECFG: 00071c1c (LIE=2-4,10-12 VS=7)
[   12.415882] ESTAT: 00010000 [PIL] (IS= ECode=1 EsubCode=0)
[   12.415907]  BADV: fffffffffffffff1
[   12.415911]  PRID: 0014a000 (Loongson-64bit, Loongson-2K1000)
[   12.415917] Modules linked in: loongson2_thermal(+) vfat fat uio_pdrv_genirq uio fuse zram zsmalloc
[   12.415950] Process systemd-udevd (pid: 181, threadinfo=00000000358b9718, task=00000000ace72fe3)
[   12.415961] Stack : 0000000000000dc0 54567fd5da9b4fd4 900000000402ae10 9000000002df9358
[   12.415982]         ffffffffffffffed 0000000000000004 9000000107a10aa8 90000001002a3410
[   12.415999]         ffffffffffffffed ffffffffffffffed 9000000107a11268 9000000003157ab0
[   12.416016]         9000000107a10aa8 ffffff80020fc0c8 90000001002a3410 ffffffffffffffed
[   12.416032]         0000000000000024 ffffff80020cc1e8 900000000402b2a0 9000000003acc000
[   12.416048]         90000001002a3410 0000000000000000 ffffff80020f4030 90000001002a3410
[   12.416065]         0000000000000000 9000000002df6808 90000001002a3410 0000000000000000
[   12.416081]         ffffff80020f4030 0000000000000000 90000001002a3410 9000000002df2ba8
[   12.416097]         00000000000000b4 90000001002a34f4 90000001002a3410 0000000000000002
[   12.416114]         ffffff80020f4030 fffffffffffffff0 90000001002a3410 9000000002df2f30
[   12.416131]         ...
[   12.416138] Call Trace:
[   12.416142] [<900000000355f410>] strscpy+0xf0/0x160
[   12.416167] [<90000000031579b8>] thermal_add_hwmon_sysfs+0x258/0x300
[   12.416183] [<9000000003157ab0>] devm_thermal_add_hwmon_sysfs+0x50/0xe0
[   12.416200] [<ffffff80020cc1e8>] loongson2_thermal_probe+0x128/0x200 [loongson2_thermal]
[   12.416232] [<9000000002df6808>] platform_probe+0x68/0x140
[   12.416249] [<9000000002df2ba8>] really_probe+0xc8/0x3c0
[   12.416269] [<9000000002df2f30>] __driver_probe_device+0x90/0x180
[   12.416286] [<9000000002df3058>] driver_probe_device+0x38/0x160
[   12.416302] [<9000000002df33a8>] __driver_attach+0xa8/0x200
[   12.416314] [<9000000002deffec>] bus_for_each_dev+0x8c/0x120
[   12.416330] [<9000000002df198c>] bus_add_driver+0x10c/0x2a0
[   12.416346] [<9000000002df46b4>] driver_register+0x74/0x160
[   12.416358] [<90000000022201a4>] do_one_initcall+0x84/0x220
[   12.416372] [<90000000022f3ab8>] do_init_module+0x58/0x2c0
[   12.416386] [<90000000022f6538>] init_module_from_file+0x98/0x100
[   12.416399] [<90000000022f67f0>] sys_finit_module+0x230/0x3c0
[   12.416412] [<900000000358f7c8>] do_syscall+0x88/0xc0
[   12.416431] [<900000000222137c>] handle_syscall+0xbc/0x158

Fixes: e7e3a7c35791 ("thermal/drivers/loongson-2: Add thermal management support")
Cc: Yinbo Zhu <zhuyinbo@loongson.cn>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/343c14de98216636a47b43e8bfd47b70d0a8e068.1700817227.git.zhoubinbin@loongson.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/thermal/loongson2_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/loongson2_thermal.c b/drivers/thermal/loongson2_thermal.c
index 133098dc0854..99ca0c7bc41c 100644
--- a/drivers/thermal/loongson2_thermal.c
+++ b/drivers/thermal/loongson2_thermal.c
@@ -127,7 +127,7 @@ static int loongson2_thermal_probe(struct platform_device *pdev)
 		if (!IS_ERR(tzd))
 			break;
 
-		if (PTR_ERR(tzd) != ENODEV)
+		if (PTR_ERR(tzd) != -ENODEV)
 			continue;
 
 		return dev_err_probe(dev, PTR_ERR(tzd), "failed to register");
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 041/583] selinux: Fix error priority for bind with AF_UNSPEC on PF_INET6 socket
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (39 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 040/583] drivers/thermal/loongson2_thermal: Fix incorrect PTR_ERR() judgment Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 042/583] crypto: rsa - add a check for allocation failure Greg Kroah-Hartman
                   ` (548 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Eric Paris, Konstantin Meskhidze,
	Paul Moore, Stephen Smalley, Muhammad Usama Anjum,
	Mickaël Salaün, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mickaël Salaün <mic@digikod.net>

[ Upstream commit bbf5a1d0e5d0fb3bdf90205aa872636122692a50 ]

The IPv6 network stack first checks the sockaddr length (-EINVAL error)
before checking the family (-EAFNOSUPPORT error).

This was discovered thanks to commit a549d055a22e ("selftests/landlock:
Add network tests").

Cc: Eric Paris <eparis@parisplace.org>
Cc: Konstantin Meskhidze <konstantin.meskhidze@huawei.com>
Cc: Paul Moore <paul@paul-moore.com>
Cc: Stephen Smalley <stephen.smalley.work@gmail.com>
Reported-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Closes: https://lore.kernel.org/r/0584f91c-537c-4188-9e4f-04f192565667@collabora.com
Fixes: 0f8db8cc73df ("selinux: add AF_UNSPEC and INADDR_ANY checks to selinux_socket_bind()")
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Tested-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 security/selinux/hooks.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 208503340721..aa0afc122f09 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -4661,6 +4661,13 @@ static int selinux_socket_bind(struct socket *sock, struct sockaddr *address, in
 				return -EINVAL;
 			addr4 = (struct sockaddr_in *)address;
 			if (family_sa == AF_UNSPEC) {
+				if (family == PF_INET6) {
+					/* Length check from inet6_bind_sk() */
+					if (addrlen < SIN6_LEN_RFC2133)
+						return -EINVAL;
+					/* Family check from __inet6_bind() */
+					goto err_af;
+				}
 				/* see __inet_bind(), we only want to allow
 				 * AF_UNSPEC if the address is INADDR_ANY
 				 */
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 042/583] crypto: rsa - add a check for allocation failure
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (40 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 041/583] selinux: Fix error priority for bind with AF_UNSPEC on PF_INET6 socket Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 043/583] crypto: jh7110 - Correct deferred probe return Greg Kroah-Hartman
                   ` (547 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Dan Carpenter, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dan Carpenter <dan.carpenter@linaro.org>

[ Upstream commit d872ca165cb67112f2841ef9c37d51ef7e63d1e4 ]

Static checkers insist that the mpi_alloc() allocation can fail so add
a check to prevent a NULL dereference.  Small allocations like this
can't actually fail in current kernels, but adding a check is very
simple and makes the static checkers happy.

Fixes: 6637e11e4ad2 ("crypto: rsa - allow only odd e and restrict value in FIPS mode")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 crypto/rsa.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/crypto/rsa.c b/crypto/rsa.c
index c79613cdce6e..b9cd11fb7d36 100644
--- a/crypto/rsa.c
+++ b/crypto/rsa.c
@@ -220,6 +220,8 @@ static int rsa_check_exponent_fips(MPI e)
 	}
 
 	e_max = mpi_alloc(0);
+	if (!e_max)
+		return -ENOMEM;
 	mpi_set_bit(e_max, 256);
 
 	if (mpi_cmp(e, e_max) >= 0) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 043/583] crypto: jh7110 - Correct deferred probe return
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (41 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 042/583] crypto: rsa - add a check for allocation failure Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 044/583] crypto: virtio - Handle dataq logic with tasklet Greg Kroah-Hartman
                   ` (546 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chanho Park, Jia Jie Ho, Herbert Xu,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chanho Park <chanho61.park@samsung.com>

[ Upstream commit d57343022b71b9f41e731282dbe0baf0cff6ada8 ]

This fixes list_add corruption error when the driver is returned
with -EPROBE_DEFER. It is also required to roll back the previous
probe sequences in case of deferred_probe. So, this removes
'err_probe_defer" goto label and just use err_dma_init instead.

Fixes: 42ef0e944b01 ("crypto: starfive - Add crypto engine support")
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Reviewed-by: Jia Jie Ho <jiajie.ho@starfivetech.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/starfive/jh7110-cryp.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/crypto/starfive/jh7110-cryp.c b/drivers/crypto/starfive/jh7110-cryp.c
index 08e974e0dd12..3a67ddc4d936 100644
--- a/drivers/crypto/starfive/jh7110-cryp.c
+++ b/drivers/crypto/starfive/jh7110-cryp.c
@@ -180,12 +180,8 @@ static int starfive_cryp_probe(struct platform_device *pdev)
 	spin_unlock(&dev_list.lock);
 
 	ret = starfive_dma_init(cryp);
-	if (ret) {
-		if (ret == -EPROBE_DEFER)
-			goto err_probe_defer;
-		else
-			goto err_dma_init;
-	}
+	if (ret)
+		goto err_dma_init;
 
 	/* Initialize crypto engine */
 	cryp->engine = crypto_engine_alloc_init(&pdev->dev, 1);
@@ -233,7 +229,7 @@ static int starfive_cryp_probe(struct platform_device *pdev)
 
 	tasklet_kill(&cryp->aes_done);
 	tasklet_kill(&cryp->hash_done);
-err_probe_defer:
+
 	return ret;
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 044/583] crypto: virtio - Handle dataq logic with tasklet
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (42 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 043/583] crypto: jh7110 - Correct deferred probe return Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 045/583] crypto: sa2ul - Return crypto_aead_setkey to transfer the error Greg Kroah-Hartman
                   ` (545 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Halil Pasic, wangyangxin, Gonglei,
	Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Gonglei (Arei) <arei.gonglei@huawei.com>

[ Upstream commit fed93fb62e05c38152b0fc1dc9609639e63eed76 ]

Doing ipsec produces a spinlock recursion warning.
This is due to crypto_finalize_request() being called in the upper half.
Move virtual data queue processing of virtio-crypto driver to tasklet.

Fixes: dbaf0624ffa57 ("crypto: add virtio-crypto driver")
Reported-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: wangyangxin <wangyangxin1@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/virtio/virtio_crypto_common.h |  2 ++
 drivers/crypto/virtio/virtio_crypto_core.c   | 23 +++++++++++---------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/crypto/virtio/virtio_crypto_common.h b/drivers/crypto/virtio/virtio_crypto_common.h
index 154590e1f764..7059bbe5a2eb 100644
--- a/drivers/crypto/virtio/virtio_crypto_common.h
+++ b/drivers/crypto/virtio/virtio_crypto_common.h
@@ -10,6 +10,7 @@
 #include <linux/virtio.h>
 #include <linux/crypto.h>
 #include <linux/spinlock.h>
+#include <linux/interrupt.h>
 #include <crypto/aead.h>
 #include <crypto/aes.h>
 #include <crypto/engine.h>
@@ -28,6 +29,7 @@ struct data_queue {
 	char name[32];
 
 	struct crypto_engine *engine;
+	struct tasklet_struct done_task;
 };
 
 struct virtio_crypto {
diff --git a/drivers/crypto/virtio/virtio_crypto_core.c b/drivers/crypto/virtio/virtio_crypto_core.c
index 43a0838d31ff..428d76562447 100644
--- a/drivers/crypto/virtio/virtio_crypto_core.c
+++ b/drivers/crypto/virtio/virtio_crypto_core.c
@@ -72,27 +72,28 @@ int virtio_crypto_ctrl_vq_request(struct virtio_crypto *vcrypto, struct scatterl
 	return 0;
 }
 
-static void virtcrypto_dataq_callback(struct virtqueue *vq)
+static void virtcrypto_done_task(unsigned long data)
 {
-	struct virtio_crypto *vcrypto = vq->vdev->priv;
+	struct data_queue *data_vq = (struct data_queue *)data;
+	struct virtqueue *vq = data_vq->vq;
 	struct virtio_crypto_request *vc_req;
-	unsigned long flags;
 	unsigned int len;
-	unsigned int qid = vq->index;
 
-	spin_lock_irqsave(&vcrypto->data_vq[qid].lock, flags);
 	do {
 		virtqueue_disable_cb(vq);
 		while ((vc_req = virtqueue_get_buf(vq, &len)) != NULL) {
-			spin_unlock_irqrestore(
-				&vcrypto->data_vq[qid].lock, flags);
 			if (vc_req->alg_cb)
 				vc_req->alg_cb(vc_req, len);
-			spin_lock_irqsave(
-				&vcrypto->data_vq[qid].lock, flags);
 		}
 	} while (!virtqueue_enable_cb(vq));
-	spin_unlock_irqrestore(&vcrypto->data_vq[qid].lock, flags);
+}
+
+static void virtcrypto_dataq_callback(struct virtqueue *vq)
+{
+	struct virtio_crypto *vcrypto = vq->vdev->priv;
+	struct data_queue *dq = &vcrypto->data_vq[vq->index];
+
+	tasklet_schedule(&dq->done_task);
 }
 
 static int virtcrypto_find_vqs(struct virtio_crypto *vi)
@@ -150,6 +151,8 @@ static int virtcrypto_find_vqs(struct virtio_crypto *vi)
 			ret = -ENOMEM;
 			goto err_engine;
 		}
+		tasklet_init(&vi->data_vq[i].done_task, virtcrypto_done_task,
+				(unsigned long)&vi->data_vq[i]);
 	}
 
 	kfree(names);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 045/583] crypto: sa2ul - Return crypto_aead_setkey to transfer the error
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (43 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 044/583] crypto: virtio - Handle dataq logic with tasklet Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 046/583] crypto: ccp - fix memleak in ccp_init_dm_workarea Greg Kroah-Hartman
                   ` (544 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Chen Ni, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chen Ni <nichen@iscas.ac.cn>

[ Upstream commit ce852f1308ac738e61c5b2502517deea593a1554 ]

Return crypto_aead_setkey() in order to transfer the error if
it fails.

Fixes: d2c8ac187fc9 ("crypto: sa2ul - Add AEAD algorithm support")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/sa2ul.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c
index 6238d34f8db2..94eb6f6afa25 100644
--- a/drivers/crypto/sa2ul.c
+++ b/drivers/crypto/sa2ul.c
@@ -1869,9 +1869,8 @@ static int sa_aead_setkey(struct crypto_aead *authenc,
 	crypto_aead_set_flags(ctx->fallback.aead,
 			      crypto_aead_get_flags(authenc) &
 			      CRYPTO_TFM_REQ_MASK);
-	crypto_aead_setkey(ctx->fallback.aead, key, keylen);
 
-	return 0;
+	return crypto_aead_setkey(ctx->fallback.aead, key, keylen);
 }
 
 static int sa_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 046/583] crypto: ccp - fix memleak in ccp_init_dm_workarea
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (44 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 045/583] crypto: sa2ul - Return crypto_aead_setkey to transfer the error Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 047/583] crypto: af_alg - Disallow multiple in-flight AIO requests Greg Kroah-Hartman
                   ` (543 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Dinghao Liu, Tom Lendacky,
	Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dinghao Liu <dinghao.liu@zju.edu.cn>

[ Upstream commit a1c95dd5bc1d6a5d7a75a376c2107421b7d6240d ]

When dma_map_single() fails, wa->address is supposed to be freed
by the callers of ccp_init_dm_workarea() through ccp_dm_free().
However, many of the call spots don't expect to have to call
ccp_dm_free() on failure of ccp_init_dm_workarea(), which may
lead to a memleak. Let's free wa->address in ccp_init_dm_workarea()
when dma_map_single() fails.

Fixes: 63b945091a07 ("crypto: ccp - CCP device driver and interface support")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/ccp/ccp-ops.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c
index aa4e1a500691..cb8e99936abb 100644
--- a/drivers/crypto/ccp/ccp-ops.c
+++ b/drivers/crypto/ccp/ccp-ops.c
@@ -179,8 +179,11 @@ static int ccp_init_dm_workarea(struct ccp_dm_workarea *wa,
 
 		wa->dma.address = dma_map_single(wa->dev, wa->address, len,
 						 dir);
-		if (dma_mapping_error(wa->dev, wa->dma.address))
+		if (dma_mapping_error(wa->dev, wa->dma.address)) {
+			kfree(wa->address);
+			wa->address = NULL;
 			return -ENOMEM;
+		}
 
 		wa->dma.length = len;
 	}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 047/583] crypto: af_alg - Disallow multiple in-flight AIO requests
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (45 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 046/583] crypto: ccp - fix memleak in ccp_init_dm_workarea Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 048/583] crypto: safexcel - Add error handling for dma_map_sg() calls Greg Kroah-Hartman
                   ` (542 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Herbert Xu <herbert@gondor.apana.org.au>

[ Upstream commit 67b164a871af1d736f131fd6fe78a610909f06f3 ]

Having multiple in-flight AIO requests results in unpredictable
output because they all share the same IV.  Fix this by only allowing
one request at a time.

Fixes: 83094e5e9e49 ("crypto: af_alg - add async support to algif_aead")
Fixes: a596999b7ddf ("crypto: algif - change algif_skcipher to be asynchronous")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 crypto/af_alg.c         | 14 +++++++++++++-
 include/crypto/if_alg.h |  3 +++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index ea6fb8e89d06..68cc9290cabe 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -1116,9 +1116,13 @@ EXPORT_SYMBOL_GPL(af_alg_sendmsg);
 void af_alg_free_resources(struct af_alg_async_req *areq)
 {
 	struct sock *sk = areq->sk;
+	struct af_alg_ctx *ctx;
 
 	af_alg_free_areq_sgls(areq);
 	sock_kfree_s(sk, areq, areq->areqlen);
+
+	ctx = alg_sk(sk)->private;
+	ctx->inflight = false;
 }
 EXPORT_SYMBOL_GPL(af_alg_free_resources);
 
@@ -1188,11 +1192,19 @@ EXPORT_SYMBOL_GPL(af_alg_poll);
 struct af_alg_async_req *af_alg_alloc_areq(struct sock *sk,
 					   unsigned int areqlen)
 {
-	struct af_alg_async_req *areq = sock_kmalloc(sk, areqlen, GFP_KERNEL);
+	struct af_alg_ctx *ctx = alg_sk(sk)->private;
+	struct af_alg_async_req *areq;
+
+	/* Only one AIO request can be in flight. */
+	if (ctx->inflight)
+		return ERR_PTR(-EBUSY);
 
+	areq = sock_kmalloc(sk, areqlen, GFP_KERNEL);
 	if (unlikely(!areq))
 		return ERR_PTR(-ENOMEM);
 
+	ctx->inflight = true;
+
 	areq->areqlen = areqlen;
 	areq->sk = sk;
 	areq->first_rsgl.sgl.sgt.sgl = areq->first_rsgl.sgl.sgl;
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
index ef8ce86b1f78..08b803a4fcde 100644
--- a/include/crypto/if_alg.h
+++ b/include/crypto/if_alg.h
@@ -136,6 +136,7 @@ struct af_alg_async_req {
  *			recvmsg is invoked.
  * @init:		True if metadata has been sent.
  * @len:		Length of memory allocated for this data structure.
+ * @inflight:		Non-zero when AIO requests are in flight.
  */
 struct af_alg_ctx {
 	struct list_head tsgl_list;
@@ -154,6 +155,8 @@ struct af_alg_ctx {
 	bool init;
 
 	unsigned int len;
+
+	unsigned int inflight;
 };
 
 int af_alg_register_type(const struct af_alg_type *type);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 048/583] crypto: safexcel - Add error handling for dma_map_sg() calls
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (46 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 047/583] crypto: af_alg - Disallow multiple in-flight AIO requests Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 049/583] crypto: sahara - remove FLAGS_NEW_KEY logic Greg Kroah-Hartman
                   ` (541 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nikita Zhandarovich, Antoine Tenart,
	Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nikita Zhandarovich <n.zhandarovich@fintech.ru>

[ Upstream commit 87e02063d07708cac5bfe9fd3a6a242898758ac8 ]

Macro dma_map_sg() may return 0 on error. This patch enables
checks in case of the macro failure and ensures unmapping of
previously mapped buffers with dma_unmap_sg().

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: 49186a7d9e46 ("crypto: inside_secure - Avoid dma map if size is zero")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Reviewed-by: Antoine Tenart <atenart@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../crypto/inside-secure/safexcel_cipher.c    | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/crypto/inside-secure/safexcel_cipher.c b/drivers/crypto/inside-secure/safexcel_cipher.c
index 272c28b5a088..b83818634ae4 100644
--- a/drivers/crypto/inside-secure/safexcel_cipher.c
+++ b/drivers/crypto/inside-secure/safexcel_cipher.c
@@ -742,9 +742,9 @@ static int safexcel_send_req(struct crypto_async_request *base, int ring,
 				max(totlen_src, totlen_dst));
 			return -EINVAL;
 		}
-		if (sreq->nr_src > 0)
-			dma_map_sg(priv->dev, src, sreq->nr_src,
-				   DMA_BIDIRECTIONAL);
+		if (sreq->nr_src > 0 &&
+		    !dma_map_sg(priv->dev, src, sreq->nr_src, DMA_BIDIRECTIONAL))
+			return -EIO;
 	} else {
 		if (unlikely(totlen_src && (sreq->nr_src <= 0))) {
 			dev_err(priv->dev, "Source buffer not large enough (need %d bytes)!",
@@ -752,8 +752,9 @@ static int safexcel_send_req(struct crypto_async_request *base, int ring,
 			return -EINVAL;
 		}
 
-		if (sreq->nr_src > 0)
-			dma_map_sg(priv->dev, src, sreq->nr_src, DMA_TO_DEVICE);
+		if (sreq->nr_src > 0 &&
+		    !dma_map_sg(priv->dev, src, sreq->nr_src, DMA_TO_DEVICE))
+			return -EIO;
 
 		if (unlikely(totlen_dst && (sreq->nr_dst <= 0))) {
 			dev_err(priv->dev, "Dest buffer not large enough (need %d bytes)!",
@@ -762,9 +763,11 @@ static int safexcel_send_req(struct crypto_async_request *base, int ring,
 			goto unmap;
 		}
 
-		if (sreq->nr_dst > 0)
-			dma_map_sg(priv->dev, dst, sreq->nr_dst,
-				   DMA_FROM_DEVICE);
+		if (sreq->nr_dst > 0 &&
+		    !dma_map_sg(priv->dev, dst, sreq->nr_dst, DMA_FROM_DEVICE)) {
+			ret = -EIO;
+			goto unmap;
+		}
 	}
 
 	memcpy(ctx->base.ctxr->data, ctx->key, ctx->key_len);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 049/583] crypto: sahara - remove FLAGS_NEW_KEY logic
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (47 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 048/583] crypto: safexcel - Add error handling for dma_map_sg() calls Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 050/583] crypto: sahara - fix cbc selftest failure Greg Kroah-Hartman
                   ` (540 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ovidiu Panait, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ovidiu Panait <ovidiu.panait@windriver.com>

[ Upstream commit 8fd183435728b139248a77978ea3732039341779 ]

Remove the FLAGS_NEW_KEY logic as it has the following issues:
- the wrong key may end up being used when there are multiple data streams:
       t1            t2
    setkey()
    encrypt()
                   setkey()
                   encrypt()

    encrypt() <--- key from t2 is used
- switching between encryption and decryption with the same key is not
  possible, as the hdr flags are only updated when a new setkey() is
  performed

With this change, the key is always sent along with the cryptdata when
performing encryption/decryption operations.

Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/sahara.c | 34 +++++++++++++---------------------
 1 file changed, 13 insertions(+), 21 deletions(-)

diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c
index 62d93526920f..79708919260a 100644
--- a/drivers/crypto/sahara.c
+++ b/drivers/crypto/sahara.c
@@ -43,7 +43,6 @@
 #define FLAGS_MODE_MASK		0x000f
 #define FLAGS_ENCRYPT		BIT(0)
 #define FLAGS_CBC		BIT(1)
-#define FLAGS_NEW_KEY		BIT(3)
 
 #define SAHARA_HDR_BASE			0x00800000
 #define SAHARA_HDR_SKHA_ALG_AES	0
@@ -141,8 +140,6 @@ struct sahara_hw_link {
 };
 
 struct sahara_ctx {
-	unsigned long flags;
-
 	/* AES-specific context */
 	int keylen;
 	u8 key[AES_KEYSIZE_128];
@@ -447,26 +444,22 @@ static int sahara_hw_descriptor_create(struct sahara_dev *dev)
 	int i, j;
 	int idx = 0;
 
-	/* Copy new key if necessary */
-	if (ctx->flags & FLAGS_NEW_KEY) {
-		memcpy(dev->key_base, ctx->key, ctx->keylen);
-		ctx->flags &= ~FLAGS_NEW_KEY;
+	memcpy(dev->key_base, ctx->key, ctx->keylen);
 
-		if (dev->flags & FLAGS_CBC) {
-			dev->hw_desc[idx]->len1 = AES_BLOCK_SIZE;
-			dev->hw_desc[idx]->p1 = dev->iv_phys_base;
-		} else {
-			dev->hw_desc[idx]->len1 = 0;
-			dev->hw_desc[idx]->p1 = 0;
-		}
-		dev->hw_desc[idx]->len2 = ctx->keylen;
-		dev->hw_desc[idx]->p2 = dev->key_phys_base;
-		dev->hw_desc[idx]->next = dev->hw_phys_desc[1];
+	if (dev->flags & FLAGS_CBC) {
+		dev->hw_desc[idx]->len1 = AES_BLOCK_SIZE;
+		dev->hw_desc[idx]->p1 = dev->iv_phys_base;
+	} else {
+		dev->hw_desc[idx]->len1 = 0;
+		dev->hw_desc[idx]->p1 = 0;
+	}
+	dev->hw_desc[idx]->len2 = ctx->keylen;
+	dev->hw_desc[idx]->p2 = dev->key_phys_base;
+	dev->hw_desc[idx]->next = dev->hw_phys_desc[1];
+	dev->hw_desc[idx]->hdr = sahara_aes_key_hdr(dev);
 
-		dev->hw_desc[idx]->hdr = sahara_aes_key_hdr(dev);
+	idx++;
 
-		idx++;
-	}
 
 	dev->nb_in_sg = sg_nents_for_len(dev->in_sg, dev->total);
 	if (dev->nb_in_sg < 0) {
@@ -608,7 +601,6 @@ static int sahara_aes_setkey(struct crypto_skcipher *tfm, const u8 *key,
 	/* SAHARA only supports 128bit keys */
 	if (keylen == AES_KEYSIZE_128) {
 		memcpy(ctx->key, key, keylen);
-		ctx->flags |= FLAGS_NEW_KEY;
 		return 0;
 	}
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 050/583] crypto: sahara - fix cbc selftest failure
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (48 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 049/583] crypto: sahara - remove FLAGS_NEW_KEY logic Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 051/583] crypto: sahara - fix ahash " Greg Kroah-Hartman
                   ` (539 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ovidiu Panait, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ovidiu Panait <ovidiu.panait@windriver.com>

[ Upstream commit 9f10bc28c0fb676ae58aa3bfa358db8f5de124bb ]

The kernel crypto API requires that all CBC implementations update the IV
buffer to contain the last ciphertext block.

This fixes the following cbc selftest error:
alg: skcipher: sahara-cbc-aes encryption test failed (wrong output IV) on
test vector 0, cfg="in-place (one sglist)"

Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/sahara.c | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c
index 79708919260a..037a623271f3 100644
--- a/drivers/crypto/sahara.c
+++ b/drivers/crypto/sahara.c
@@ -148,6 +148,7 @@ struct sahara_ctx {
 
 struct sahara_aes_reqctx {
 	unsigned long mode;
+	u8 iv_out[AES_BLOCK_SIZE];
 	struct skcipher_request fallback_req;	// keep at the end
 };
 
@@ -541,8 +542,24 @@ static int sahara_hw_descriptor_create(struct sahara_dev *dev)
 	return -EINVAL;
 }
 
+static void sahara_aes_cbc_update_iv(struct skcipher_request *req)
+{
+	struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req);
+	struct sahara_aes_reqctx *rctx = skcipher_request_ctx(req);
+	unsigned int ivsize = crypto_skcipher_ivsize(skcipher);
+
+	/* Update IV buffer to contain the last ciphertext block */
+	if (rctx->mode & FLAGS_ENCRYPT) {
+		sg_pcopy_to_buffer(req->dst, sg_nents(req->dst), req->iv,
+				   ivsize, req->cryptlen - ivsize);
+	} else {
+		memcpy(req->iv, rctx->iv_out, ivsize);
+	}
+}
+
 static int sahara_aes_process(struct skcipher_request *req)
 {
+	struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req);
 	struct sahara_dev *dev = dev_ptr;
 	struct sahara_ctx *ctx;
 	struct sahara_aes_reqctx *rctx;
@@ -564,8 +581,17 @@ static int sahara_aes_process(struct skcipher_request *req)
 	rctx->mode &= FLAGS_MODE_MASK;
 	dev->flags = (dev->flags & ~FLAGS_MODE_MASK) | rctx->mode;
 
-	if ((dev->flags & FLAGS_CBC) && req->iv)
-		memcpy(dev->iv_base, req->iv, AES_KEYSIZE_128);
+	if ((dev->flags & FLAGS_CBC) && req->iv) {
+		unsigned int ivsize = crypto_skcipher_ivsize(skcipher);
+
+		memcpy(dev->iv_base, req->iv, ivsize);
+
+		if (!(dev->flags & FLAGS_ENCRYPT)) {
+			sg_pcopy_to_buffer(req->src, sg_nents(req->src),
+					   rctx->iv_out, ivsize,
+					   req->cryptlen - ivsize);
+		}
+	}
 
 	/* assign new context to device */
 	dev->ctx = ctx;
@@ -588,6 +614,9 @@ static int sahara_aes_process(struct skcipher_request *req)
 	dma_unmap_sg(dev->device, dev->in_sg, dev->nb_in_sg,
 		DMA_TO_DEVICE);
 
+	if ((dev->flags & FLAGS_CBC) && req->iv)
+		sahara_aes_cbc_update_iv(req);
+
 	return 0;
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 051/583] crypto: sahara - fix ahash selftest failure
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (49 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 050/583] crypto: sahara - fix cbc selftest failure Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 052/583] crypto: sahara - fix processing requests with cryptlen < sg->length Greg Kroah-Hartman
                   ` (538 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ovidiu Panait, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ovidiu Panait <ovidiu.panait@windriver.com>

[ Upstream commit afffcf3db98b9495114b79d5381f8cc3f69476fb ]

update() calls should not modify the result buffer, so add an additional
check for "rctx->last" to make sure that only the final hash value is
copied into the buffer.

Fixes the following selftest failure:
alg: ahash: sahara-sha256 update() used result buffer on test vector 3,
cfg="init+update+final aligned buffer"

Fixes: 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/sahara.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c
index 037a623271f3..2f8c81763bd4 100644
--- a/drivers/crypto/sahara.c
+++ b/drivers/crypto/sahara.c
@@ -1047,7 +1047,7 @@ static int sahara_sha_process(struct ahash_request *req)
 
 	memcpy(rctx->context, dev->context_base, rctx->context_size);
 
-	if (req->result)
+	if (req->result && rctx->last)
 		memcpy(req->result, rctx->context, rctx->digest_size);
 
 	return 0;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 052/583] crypto: sahara - fix processing requests with cryptlen < sg->length
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (50 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 051/583] crypto: sahara - fix ahash " Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 053/583] crypto: sahara - fix error handling in sahara_hw_descriptor_create() Greg Kroah-Hartman
                   ` (537 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ovidiu Panait, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ovidiu Panait <ovidiu.panait@windriver.com>

[ Upstream commit 5b8668ce3452827d27f8c34ff6ba080a8f983ed0 ]

It's not always the case that the entire sg entry needs to be processed.
Currently, when cryptlen is less than sg->legth, "Descriptor length" errors
are encountered.

The error was noticed when testing xts(sahara-ecb-aes) with arbitrary sized
input data. To fix this, take the actual request size into account when
populating the hw links.

Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/sahara.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c
index 2f8c81763bd4..55cfe51575b9 100644
--- a/drivers/crypto/sahara.c
+++ b/drivers/crypto/sahara.c
@@ -444,6 +444,7 @@ static int sahara_hw_descriptor_create(struct sahara_dev *dev)
 	int ret;
 	int i, j;
 	int idx = 0;
+	u32 len;
 
 	memcpy(dev->key_base, ctx->key, ctx->keylen);
 
@@ -494,12 +495,14 @@ static int sahara_hw_descriptor_create(struct sahara_dev *dev)
 	/* Create input links */
 	dev->hw_desc[idx]->p1 = dev->hw_phys_link[0];
 	sg = dev->in_sg;
+	len = dev->total;
 	for (i = 0; i < dev->nb_in_sg; i++) {
-		dev->hw_link[i]->len = sg->length;
+		dev->hw_link[i]->len = min(len, sg->length);
 		dev->hw_link[i]->p = sg->dma_address;
 		if (i == (dev->nb_in_sg - 1)) {
 			dev->hw_link[i]->next = 0;
 		} else {
+			len -= min(len, sg->length);
 			dev->hw_link[i]->next = dev->hw_phys_link[i + 1];
 			sg = sg_next(sg);
 		}
@@ -508,12 +511,14 @@ static int sahara_hw_descriptor_create(struct sahara_dev *dev)
 	/* Create output links */
 	dev->hw_desc[idx]->p2 = dev->hw_phys_link[i];
 	sg = dev->out_sg;
+	len = dev->total;
 	for (j = i; j < dev->nb_out_sg + i; j++) {
-		dev->hw_link[j]->len = sg->length;
+		dev->hw_link[j]->len = min(len, sg->length);
 		dev->hw_link[j]->p = sg->dma_address;
 		if (j == (dev->nb_out_sg + i - 1)) {
 			dev->hw_link[j]->next = 0;
 		} else {
+			len -= min(len, sg->length);
 			dev->hw_link[j]->next = dev->hw_phys_link[j + 1];
 			sg = sg_next(sg);
 		}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 053/583] crypto: sahara - fix error handling in sahara_hw_descriptor_create()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (51 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 052/583] crypto: sahara - fix processing requests with cryptlen < sg->length Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 054/583] crypto: hisilicon/qm - save capability registers in qm init process Greg Kroah-Hartman
                   ` (536 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ovidiu Panait, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ovidiu Panait <ovidiu.panait@windriver.com>

[ Upstream commit ee6e6f0a7f5b39d50a5ef5fcc006f4f693db18a7 ]

Do not call dma_unmap_sg() for scatterlists that were not mapped
successfully.

Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/sahara.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c
index 55cfe51575b9..e86df3c51787 100644
--- a/drivers/crypto/sahara.c
+++ b/drivers/crypto/sahara.c
@@ -483,13 +483,14 @@ static int sahara_hw_descriptor_create(struct sahara_dev *dev)
 			 DMA_TO_DEVICE);
 	if (!ret) {
 		dev_err(dev->device, "couldn't map in sg\n");
-		goto unmap_in;
+		return -EINVAL;
 	}
+
 	ret = dma_map_sg(dev->device, dev->out_sg, dev->nb_out_sg,
 			 DMA_FROM_DEVICE);
 	if (!ret) {
 		dev_err(dev->device, "couldn't map out sg\n");
-		goto unmap_out;
+		goto unmap_in;
 	}
 
 	/* Create input links */
@@ -537,9 +538,6 @@ static int sahara_hw_descriptor_create(struct sahara_dev *dev)
 
 	return 0;
 
-unmap_out:
-	dma_unmap_sg(dev->device, dev->out_sg, dev->nb_out_sg,
-		DMA_FROM_DEVICE);
 unmap_in:
 	dma_unmap_sg(dev->device, dev->in_sg, dev->nb_in_sg,
 		DMA_TO_DEVICE);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 054/583] crypto: hisilicon/qm - save capability registers in qm init process
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (52 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 053/583] crypto: sahara - fix error handling in sahara_hw_descriptor_create() Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 055/583] crypto: hisilicon/zip - add zip comp high perf mode configuration Greg Kroah-Hartman
                   ` (535 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Zhiqi Song, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Zhiqi Song <songzhiqi1@huawei.com>

[ Upstream commit cabe13d0bd2efb8dd50ed2310f57b33e1a69a0d4 ]

In previous capability register implementation, qm irq related values
were read from capability registers dynamically when needed. But in
abnormal scenario, e.g. the core is timeout and the device needs to
soft reset and reset failed after disabling the MSE, the device can
not be removed normally, causing the following call trace:

	| Call trace:
        |  pci_irq_vector+0xfc/0x140
        |  hisi_qm_uninit+0x278/0x3b0 [hisi_qm]
        |  hpre_remove+0x16c/0x1c0 [hisi_hpre]
        |  pci_device_remove+0x6c/0x264
        |  device_release_driver_internal+0x1ec/0x3e0
        |  device_release_driver+0x3c/0x60
        |  pci_stop_bus_device+0xfc/0x22c
        |  pci_stop_and_remove_bus_device+0x38/0x70
        |  pci_iov_remove_virtfn+0x108/0x1c0
        |  sriov_disable+0x7c/0x1e4
        |  pci_disable_sriov+0x4c/0x6c
        |  hisi_qm_sriov_disable+0x90/0x160 [hisi_qm]
        |  hpre_remove+0x1a8/0x1c0 [hisi_hpre]
        |  pci_device_remove+0x6c/0x264
        |  device_release_driver_internal+0x1ec/0x3e0
        |  driver_detach+0x168/0x2d0
        |  bus_remove_driver+0xc0/0x230
        |  driver_unregister+0x58/0xdc
        |  pci_unregister_driver+0x40/0x220
        |  hpre_exit+0x34/0x64 [hisi_hpre]
        |  __arm64_sys_delete_module+0x374/0x620
        [...]

        | Call trace:
        |  free_msi_irqs+0x25c/0x300
        |  pci_disable_msi+0x19c/0x264
        |  pci_free_irq_vectors+0x4c/0x70
        |  hisi_qm_pci_uninit+0x44/0x90 [hisi_qm]
        |  hisi_qm_uninit+0x28c/0x3b0 [hisi_qm]
        |  hpre_remove+0x16c/0x1c0 [hisi_hpre]
        |  pci_device_remove+0x6c/0x264
        [...]

The reason for this call trace is that when the MSE is disabled, the value
of capability registers in the BAR space become invalid. This will make the
subsequent unregister process get the wrong irq vector through capability
registers and get the wrong irq number by pci_irq_vector().

So add a capability table structure to pre-store the valid value of the irq
information capability register in qm init process, avoid obtaining invalid
capability register value after the MSE is disabled.

Fixes: 3536cc55cada ("crypto: hisilicon/qm - support get device irq information from hardware registers")
Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/hisilicon/qm.c | 62 +++++++++++++++++++++++++++++------
 include/linux/hisi_acc_qm.h   | 12 +++++++
 2 files changed, 64 insertions(+), 10 deletions(-)

diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index f1589eb3b46a..5872e0f0c094 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -306,6 +306,13 @@ enum qm_basic_type {
 	QM_VF_IRQ_NUM_CAP,
 };
 
+enum qm_pre_store_cap_idx {
+	QM_EQ_IRQ_TYPE_CAP_IDX = 0x0,
+	QM_AEQ_IRQ_TYPE_CAP_IDX,
+	QM_ABN_IRQ_TYPE_CAP_IDX,
+	QM_PF2VF_IRQ_TYPE_CAP_IDX,
+};
+
 static const struct hisi_qm_cap_info qm_cap_info_comm[] = {
 	{QM_SUPPORT_DB_ISOLATION, 0x30,   0, BIT(0),  0x0, 0x0, 0x0},
 	{QM_SUPPORT_FUNC_QOS,     0x3100, 0, BIT(8),  0x0, 0x0, 0x1},
@@ -335,6 +342,13 @@ static const struct hisi_qm_cap_info qm_basic_info[] = {
 	{QM_VF_IRQ_NUM_CAP,     0x311c,   0,  GENMASK(15, 0), 0x1,       0x2,       0x3},
 };
 
+static const u32 qm_pre_store_caps[] = {
+	QM_EQ_IRQ_TYPE_CAP,
+	QM_AEQ_IRQ_TYPE_CAP,
+	QM_ABN_IRQ_TYPE_CAP,
+	QM_PF2VF_IRQ_TYPE_CAP,
+};
+
 struct qm_mailbox {
 	__le16 w0;
 	__le16 queue_num;
@@ -4903,7 +4917,7 @@ static void qm_unregister_abnormal_irq(struct hisi_qm *qm)
 	if (qm->fun_type == QM_HW_VF)
 		return;
 
-	val = hisi_qm_get_hw_info(qm, qm_basic_info, QM_ABN_IRQ_TYPE_CAP, qm->cap_ver);
+	val = qm->cap_tables.qm_cap_table[QM_ABN_IRQ_TYPE_CAP_IDX].cap_val;
 	if (!((val >> QM_IRQ_TYPE_SHIFT) & QM_ABN_IRQ_TYPE_MASK))
 		return;
 
@@ -4920,7 +4934,7 @@ static int qm_register_abnormal_irq(struct hisi_qm *qm)
 	if (qm->fun_type == QM_HW_VF)
 		return 0;
 
-	val = hisi_qm_get_hw_info(qm, qm_basic_info, QM_ABN_IRQ_TYPE_CAP, qm->cap_ver);
+	val = qm->cap_tables.qm_cap_table[QM_ABN_IRQ_TYPE_CAP_IDX].cap_val;
 	if (!((val >> QM_IRQ_TYPE_SHIFT) & QM_ABN_IRQ_TYPE_MASK))
 		return 0;
 
@@ -4937,7 +4951,7 @@ static void qm_unregister_mb_cmd_irq(struct hisi_qm *qm)
 	struct pci_dev *pdev = qm->pdev;
 	u32 irq_vector, val;
 
-	val = hisi_qm_get_hw_info(qm, qm_basic_info, QM_PF2VF_IRQ_TYPE_CAP, qm->cap_ver);
+	val = qm->cap_tables.qm_cap_table[QM_PF2VF_IRQ_TYPE_CAP_IDX].cap_val;
 	if (!((val >> QM_IRQ_TYPE_SHIFT) & QM_IRQ_TYPE_MASK))
 		return;
 
@@ -4951,7 +4965,7 @@ static int qm_register_mb_cmd_irq(struct hisi_qm *qm)
 	u32 irq_vector, val;
 	int ret;
 
-	val = hisi_qm_get_hw_info(qm, qm_basic_info, QM_PF2VF_IRQ_TYPE_CAP, qm->cap_ver);
+	val = qm->cap_tables.qm_cap_table[QM_PF2VF_IRQ_TYPE_CAP_IDX].cap_val;
 	if (!((val >> QM_IRQ_TYPE_SHIFT) & QM_IRQ_TYPE_MASK))
 		return 0;
 
@@ -4968,7 +4982,7 @@ static void qm_unregister_aeq_irq(struct hisi_qm *qm)
 	struct pci_dev *pdev = qm->pdev;
 	u32 irq_vector, val;
 
-	val = hisi_qm_get_hw_info(qm, qm_basic_info, QM_AEQ_IRQ_TYPE_CAP, qm->cap_ver);
+	val = qm->cap_tables.qm_cap_table[QM_AEQ_IRQ_TYPE_CAP_IDX].cap_val;
 	if (!((val >> QM_IRQ_TYPE_SHIFT) & QM_IRQ_TYPE_MASK))
 		return;
 
@@ -4982,7 +4996,7 @@ static int qm_register_aeq_irq(struct hisi_qm *qm)
 	u32 irq_vector, val;
 	int ret;
 
-	val = hisi_qm_get_hw_info(qm, qm_basic_info, QM_AEQ_IRQ_TYPE_CAP, qm->cap_ver);
+	val = qm->cap_tables.qm_cap_table[QM_AEQ_IRQ_TYPE_CAP_IDX].cap_val;
 	if (!((val >> QM_IRQ_TYPE_SHIFT) & QM_IRQ_TYPE_MASK))
 		return 0;
 
@@ -5000,7 +5014,7 @@ static void qm_unregister_eq_irq(struct hisi_qm *qm)
 	struct pci_dev *pdev = qm->pdev;
 	u32 irq_vector, val;
 
-	val = hisi_qm_get_hw_info(qm, qm_basic_info, QM_EQ_IRQ_TYPE_CAP, qm->cap_ver);
+	val = qm->cap_tables.qm_cap_table[QM_EQ_IRQ_TYPE_CAP_IDX].cap_val;
 	if (!((val >> QM_IRQ_TYPE_SHIFT) & QM_IRQ_TYPE_MASK))
 		return;
 
@@ -5014,7 +5028,7 @@ static int qm_register_eq_irq(struct hisi_qm *qm)
 	u32 irq_vector, val;
 	int ret;
 
-	val = hisi_qm_get_hw_info(qm, qm_basic_info, QM_EQ_IRQ_TYPE_CAP, qm->cap_ver);
+	val = qm->cap_tables.qm_cap_table[QM_EQ_IRQ_TYPE_CAP_IDX].cap_val;
 	if (!((val >> QM_IRQ_TYPE_SHIFT) & QM_IRQ_TYPE_MASK))
 		return 0;
 
@@ -5102,7 +5116,29 @@ static int qm_get_qp_num(struct hisi_qm *qm)
 	return 0;
 }
 
-static void qm_get_hw_caps(struct hisi_qm *qm)
+static int qm_pre_store_irq_type_caps(struct hisi_qm *qm)
+{
+	struct hisi_qm_cap_record *qm_cap;
+	struct pci_dev *pdev = qm->pdev;
+	size_t i, size;
+
+	size = ARRAY_SIZE(qm_pre_store_caps);
+	qm_cap = devm_kzalloc(&pdev->dev, sizeof(*qm_cap) * size, GFP_KERNEL);
+	if (!qm_cap)
+		return -ENOMEM;
+
+	for (i = 0; i < size; i++) {
+		qm_cap[i].type = qm_pre_store_caps[i];
+		qm_cap[i].cap_val = hisi_qm_get_hw_info(qm, qm_basic_info,
+							qm_pre_store_caps[i], qm->cap_ver);
+	}
+
+	qm->cap_tables.qm_cap_table = qm_cap;
+
+	return 0;
+}
+
+static int qm_get_hw_caps(struct hisi_qm *qm)
 {
 	const struct hisi_qm_cap_info *cap_info = qm->fun_type == QM_HW_PF ?
 						  qm_cap_info_pf : qm_cap_info_vf;
@@ -5133,6 +5169,9 @@ static void qm_get_hw_caps(struct hisi_qm *qm)
 		if (val)
 			set_bit(cap_info[i].type, &qm->caps);
 	}
+
+	/* Fetch and save the value of irq type related capability registers */
+	return qm_pre_store_irq_type_caps(qm);
 }
 
 static int qm_get_pci_res(struct hisi_qm *qm)
@@ -5154,7 +5193,10 @@ static int qm_get_pci_res(struct hisi_qm *qm)
 		goto err_request_mem_regions;
 	}
 
-	qm_get_hw_caps(qm);
+	ret = qm_get_hw_caps(qm);
+	if (ret)
+		goto err_ioremap;
+
 	if (test_bit(QM_SUPPORT_DB_ISOLATION, &qm->caps)) {
 		qm->db_interval = QM_QP_DB_INTERVAL;
 		qm->db_phys_base = pci_resource_start(pdev, PCI_BAR_4);
diff --git a/include/linux/hisi_acc_qm.h b/include/linux/hisi_acc_qm.h
index 7262c9993c39..eff6ec42ccbe 100644
--- a/include/linux/hisi_acc_qm.h
+++ b/include/linux/hisi_acc_qm.h
@@ -265,6 +265,16 @@ struct hisi_qm_cap_info {
 	u32 v3_val;
 };
 
+struct hisi_qm_cap_record {
+	u32 type;
+	u32 cap_val;
+};
+
+struct hisi_qm_cap_tables {
+	struct hisi_qm_cap_record *qm_cap_table;
+	struct hisi_qm_cap_record *dev_cap_table;
+};
+
 struct hisi_qm_list {
 	struct mutex lock;
 	struct list_head list;
@@ -363,6 +373,8 @@ struct hisi_qm {
 	u32 mb_qos;
 	u32 type_rate;
 	struct qm_err_isolate isolate_data;
+
+	struct hisi_qm_cap_tables cap_tables;
 };
 
 struct hisi_qp_status {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 055/583] crypto: hisilicon/zip - add zip comp high perf mode configuration
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (53 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 054/583] crypto: hisilicon/qm - save capability registers in qm init process Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 056/583] crypto: hisilicon/qm - add a function to set qm algs Greg Kroah-Hartman
                   ` (534 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chenghai Huang, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chenghai Huang <huangchenghai2@huawei.com>

[ Upstream commit a9864bae1806499ebf3757a9e71dddde5b9c48c6 ]

To meet specific application scenarios, the function of switching between
the high performance mode and the high compression mode is added.

Use the perf_mode=0/1 configuration to set the compression high perf mode,
0(default, high compression mode), 1(high performance mode). These two
modes only apply to the compression direction and are compatible with
software algorithm in both directions.

Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Stable-dep-of: cf8b5156bbc8 ("crypto: hisilicon/hpre - save capability registers in probe process")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/hisilicon/zip/zip_main.c | 65 +++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/drivers/crypto/hisilicon/zip/zip_main.c b/drivers/crypto/hisilicon/zip/zip_main.c
index 84dbaeb07ea8..0dfd6e240e1c 100644
--- a/drivers/crypto/hisilicon/zip/zip_main.c
+++ b/drivers/crypto/hisilicon/zip/zip_main.c
@@ -106,6 +106,14 @@
 #define HZIP_CLOCK_GATED_EN		(HZIP_CORE_GATED_EN | \
 					 HZIP_CORE_GATED_OOO_EN)
 
+/* zip comp high performance */
+#define HZIP_HIGH_PERF_OFFSET		0x301208
+
+enum {
+	HZIP_HIGH_COMP_RATE,
+	HZIP_HIGH_COMP_PERF,
+};
+
 static const char hisi_zip_name[] = "hisi_zip";
 static struct dentry *hzip_debugfs_root;
 
@@ -351,6 +359,37 @@ static int hzip_diff_regs_show(struct seq_file *s, void *unused)
 	return 0;
 }
 DEFINE_SHOW_ATTRIBUTE(hzip_diff_regs);
+
+static int perf_mode_set(const char *val, const struct kernel_param *kp)
+{
+	int ret;
+	u32 n;
+
+	if (!val)
+		return -EINVAL;
+
+	ret = kstrtou32(val, 10, &n);
+	if (ret != 0 || (n != HZIP_HIGH_COMP_PERF &&
+			 n != HZIP_HIGH_COMP_RATE))
+		return -EINVAL;
+
+	return param_set_int(val, kp);
+}
+
+static const struct kernel_param_ops zip_com_perf_ops = {
+	.set = perf_mode_set,
+	.get = param_get_int,
+};
+
+/*
+ * perf_mode = 0 means enable high compression rate mode,
+ * perf_mode = 1 means enable high compression performance mode.
+ * These two modes only apply to the compression direction.
+ */
+static u32 perf_mode = HZIP_HIGH_COMP_RATE;
+module_param_cb(perf_mode, &zip_com_perf_ops, &perf_mode, 0444);
+MODULE_PARM_DESC(perf_mode, "ZIP high perf mode 0(default), 1(enable)");
+
 static const struct kernel_param_ops zip_uacce_mode_ops = {
 	.set = uacce_mode_set,
 	.get = param_get_int,
@@ -416,6 +455,28 @@ bool hisi_zip_alg_support(struct hisi_qm *qm, u32 alg)
 	return false;
 }
 
+static int hisi_zip_set_high_perf(struct hisi_qm *qm)
+{
+	u32 val;
+	int ret;
+
+	val = readl_relaxed(qm->io_base + HZIP_HIGH_PERF_OFFSET);
+	if (perf_mode == HZIP_HIGH_COMP_PERF)
+		val |= HZIP_HIGH_COMP_PERF;
+	else
+		val &= ~HZIP_HIGH_COMP_PERF;
+
+	/* Set perf mode */
+	writel(val, qm->io_base + HZIP_HIGH_PERF_OFFSET);
+	ret = readl_relaxed_poll_timeout(qm->io_base + HZIP_HIGH_PERF_OFFSET,
+					 val, val == perf_mode, HZIP_DELAY_1_US,
+					 HZIP_POLL_TIMEOUT_US);
+	if (ret)
+		pci_err(qm->pdev, "failed to set perf mode\n");
+
+	return ret;
+}
+
 static int hisi_zip_set_qm_algs(struct hisi_qm *qm)
 {
 	struct device *dev = &qm->pdev->dev;
@@ -1114,6 +1175,10 @@ static int hisi_zip_pf_probe_init(struct hisi_zip *hisi_zip)
 	if (ret)
 		return ret;
 
+	ret = hisi_zip_set_high_perf(qm);
+	if (ret)
+		return ret;
+
 	hisi_zip_open_sva_prefetch(qm);
 	hisi_qm_dev_err_init(qm);
 	hisi_zip_debug_regs_clear(qm);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 056/583] crypto: hisilicon/qm - add a function to set qm algs
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (54 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 055/583] crypto: hisilicon/zip - add zip comp high perf mode configuration Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 057/583] crypto: hisilicon/hpre - save capability registers in probe process Greg Kroah-Hartman
                   ` (533 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Wenkai Lin, Hao Fang, Zhiqi Song,
	Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Wenkai Lin <linwenkai6@hisilicon.com>

[ Upstream commit f76f0d7f20672611974d3cc705996751fc403734 ]

Extract a public function to set qm algs and remove
the similar code for setting qm algs in each module.

Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
Signed-off-by: Hao Fang <fanghao11@huawei.com>
Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Stable-dep-of: cf8b5156bbc8 ("crypto: hisilicon/hpre - save capability registers in probe process")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/hisilicon/hpre/hpre_main.c | 42 ++-----------------
 drivers/crypto/hisilicon/qm.c             | 36 +++++++++++++++++
 drivers/crypto/hisilicon/sec2/sec_main.c  | 47 ++++------------------
 drivers/crypto/hisilicon/zip/zip_main.c   | 49 ++++-------------------
 include/linux/hisi_acc_qm.h               |  8 +++-
 5 files changed, 62 insertions(+), 120 deletions(-)

diff --git a/drivers/crypto/hisilicon/hpre/hpre_main.c b/drivers/crypto/hisilicon/hpre/hpre_main.c
index 3dce35debf63..4b3cba95950b 100644
--- a/drivers/crypto/hisilicon/hpre/hpre_main.c
+++ b/drivers/crypto/hisilicon/hpre/hpre_main.c
@@ -117,8 +117,6 @@
 #define HPRE_DFX_COMMON2_LEN		0xE
 #define HPRE_DFX_CORE_LEN		0x43
 
-#define HPRE_DEV_ALG_MAX_LEN	256
-
 static const char hpre_name[] = "hisi_hpre";
 static struct dentry *hpre_debugfs_root;
 static const struct pci_device_id hpre_dev_ids[] = {
@@ -134,12 +132,7 @@ struct hpre_hw_error {
 	const char *msg;
 };
 
-struct hpre_dev_alg {
-	u32 alg_msk;
-	const char *alg;
-};
-
-static const struct hpre_dev_alg hpre_dev_algs[] = {
+static const struct qm_dev_alg hpre_dev_algs[] = {
 	{
 		.alg_msk = BIT(0),
 		.alg = "rsa\n"
@@ -361,35 +354,6 @@ bool hpre_check_alg_support(struct hisi_qm *qm, u32 alg)
 	return false;
 }
 
-static int hpre_set_qm_algs(struct hisi_qm *qm)
-{
-	struct device *dev = &qm->pdev->dev;
-	char *algs, *ptr;
-	u32 alg_msk;
-	int i;
-
-	if (!qm->use_sva)
-		return 0;
-
-	algs = devm_kzalloc(dev, HPRE_DEV_ALG_MAX_LEN * sizeof(char), GFP_KERNEL);
-	if (!algs)
-		return -ENOMEM;
-
-	alg_msk = hisi_qm_get_hw_info(qm, hpre_basic_info, HPRE_DEV_ALG_BITMAP_CAP, qm->cap_ver);
-
-	for (i = 0; i < ARRAY_SIZE(hpre_dev_algs); i++)
-		if (alg_msk & hpre_dev_algs[i].alg_msk)
-			strcat(algs, hpre_dev_algs[i].alg);
-
-	ptr = strrchr(algs, '\n');
-	if (ptr)
-		*ptr = '\0';
-
-	qm->uacce->algs = algs;
-
-	return 0;
-}
-
 static int hpre_diff_regs_show(struct seq_file *s, void *unused)
 {
 	struct hisi_qm *qm = s->private;
@@ -1140,6 +1104,7 @@ static void hpre_debugfs_exit(struct hisi_qm *qm)
 
 static int hpre_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 {
+	u64 alg_msk;
 	int ret;
 
 	if (pdev->revision == QM_HW_V1) {
@@ -1170,7 +1135,8 @@ static int hpre_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 		return ret;
 	}
 
-	ret = hpre_set_qm_algs(qm);
+	alg_msk = hisi_qm_get_hw_info(qm, hpre_basic_info, HPRE_DEV_ALG_BITMAP_CAP, qm->cap_ver);
+	ret = hisi_qm_set_algs(qm, alg_msk, hpre_dev_algs, ARRAY_SIZE(hpre_dev_algs));
 	if (ret) {
 		pci_err(pdev, "Failed to set hpre algs!\n");
 		hisi_qm_uninit(qm);
diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index 5872e0f0c094..e889363ed978 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -228,6 +228,8 @@
 #define QM_QOS_MAX_CIR_U		6
 #define QM_AUTOSUSPEND_DELAY		3000
 
+#define QM_DEV_ALG_MAX_LEN		256
+
 #define QM_MK_CQC_DW3_V1(hop_num, pg_sz, buf_sz, cqe_sz) \
 	(((hop_num) << QM_CQ_HOP_NUM_SHIFT) | \
 	((pg_sz) << QM_CQ_PAGE_SIZE_SHIFT) | \
@@ -801,6 +803,40 @@ static void qm_get_xqc_depth(struct hisi_qm *qm, u16 *low_bits,
 	*high_bits = (depth >> QM_XQ_DEPTH_SHIFT) & QM_XQ_DEPTH_MASK;
 }
 
+int hisi_qm_set_algs(struct hisi_qm *qm, u64 alg_msk, const struct qm_dev_alg *dev_algs,
+		     u32 dev_algs_size)
+{
+	struct device *dev = &qm->pdev->dev;
+	char *algs, *ptr;
+	int i;
+
+	if (!qm->uacce)
+		return 0;
+
+	if (dev_algs_size >= QM_DEV_ALG_MAX_LEN) {
+		dev_err(dev, "algs size %u is equal or larger than %d.\n",
+			dev_algs_size, QM_DEV_ALG_MAX_LEN);
+		return -EINVAL;
+	}
+
+	algs = devm_kzalloc(dev, QM_DEV_ALG_MAX_LEN * sizeof(char), GFP_KERNEL);
+	if (!algs)
+		return -ENOMEM;
+
+	for (i = 0; i < dev_algs_size; i++)
+		if (alg_msk & dev_algs[i].alg_msk)
+			strcat(algs, dev_algs[i].alg);
+
+	ptr = strrchr(algs, '\n');
+	if (ptr) {
+		*ptr = '\0';
+		qm->uacce->algs = algs;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(hisi_qm_set_algs);
+
 static u32 qm_get_irq_num(struct hisi_qm *qm)
 {
 	if (qm->fun_type == QM_HW_PF)
diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers/crypto/hisilicon/sec2/sec_main.c
index 62bd8936a915..5c39667507ab 100644
--- a/drivers/crypto/hisilicon/sec2/sec_main.c
+++ b/drivers/crypto/hisilicon/sec2/sec_main.c
@@ -120,7 +120,6 @@
 					GENMASK_ULL(42, 25))
 #define SEC_AEAD_BITMAP			(GENMASK_ULL(7, 6) | GENMASK_ULL(18, 17) | \
 					GENMASK_ULL(45, 43))
-#define SEC_DEV_ALG_MAX_LEN		256
 
 struct sec_hw_error {
 	u32 int_msk;
@@ -132,11 +131,6 @@ struct sec_dfx_item {
 	u32 offset;
 };
 
-struct sec_dev_alg {
-	u64 alg_msk;
-	const char *algs;
-};
-
 static const char sec_name[] = "hisi_sec2";
 static struct dentry *sec_debugfs_root;
 
@@ -173,15 +167,15 @@ static const struct hisi_qm_cap_info sec_basic_info[] = {
 	{SEC_CORE4_ALG_BITMAP_HIGH, 0x3170, 0, GENMASK(31, 0), 0x3FFF, 0x3FFF, 0x3FFF},
 };
 
-static const struct sec_dev_alg sec_dev_algs[] = { {
+static const struct qm_dev_alg sec_dev_algs[] = { {
 		.alg_msk = SEC_CIPHER_BITMAP,
-		.algs = "cipher\n",
+		.alg = "cipher\n",
 	}, {
 		.alg_msk = SEC_DIGEST_BITMAP,
-		.algs = "digest\n",
+		.alg = "digest\n",
 	}, {
 		.alg_msk = SEC_AEAD_BITMAP,
-		.algs = "aead\n",
+		.alg = "aead\n",
 	},
 };
 
@@ -1077,37 +1071,9 @@ static int sec_pf_probe_init(struct sec_dev *sec)
 	return ret;
 }
 
-static int sec_set_qm_algs(struct hisi_qm *qm)
-{
-	struct device *dev = &qm->pdev->dev;
-	char *algs, *ptr;
-	u64 alg_mask;
-	int i;
-
-	if (!qm->use_sva)
-		return 0;
-
-	algs = devm_kzalloc(dev, SEC_DEV_ALG_MAX_LEN * sizeof(char), GFP_KERNEL);
-	if (!algs)
-		return -ENOMEM;
-
-	alg_mask = sec_get_alg_bitmap(qm, SEC_DEV_ALG_BITMAP_HIGH, SEC_DEV_ALG_BITMAP_LOW);
-
-	for (i = 0; i < ARRAY_SIZE(sec_dev_algs); i++)
-		if (alg_mask & sec_dev_algs[i].alg_msk)
-			strcat(algs, sec_dev_algs[i].algs);
-
-	ptr = strrchr(algs, '\n');
-	if (ptr)
-		*ptr = '\0';
-
-	qm->uacce->algs = algs;
-
-	return 0;
-}
-
 static int sec_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 {
+	u64 alg_msk;
 	int ret;
 
 	qm->pdev = pdev;
@@ -1142,7 +1108,8 @@ static int sec_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 		return ret;
 	}
 
-	ret = sec_set_qm_algs(qm);
+	alg_msk = sec_get_alg_bitmap(qm, SEC_DEV_ALG_BITMAP_HIGH, SEC_DEV_ALG_BITMAP_LOW);
+	ret = hisi_qm_set_algs(qm, alg_msk, sec_dev_algs, ARRAY_SIZE(sec_dev_algs));
 	if (ret) {
 		pci_err(qm->pdev, "Failed to set sec algs!\n");
 		hisi_qm_uninit(qm);
diff --git a/drivers/crypto/hisilicon/zip/zip_main.c b/drivers/crypto/hisilicon/zip/zip_main.c
index 0dfd6e240e1c..4d64a43515a9 100644
--- a/drivers/crypto/hisilicon/zip/zip_main.c
+++ b/drivers/crypto/hisilicon/zip/zip_main.c
@@ -73,7 +73,6 @@
 #define HZIP_AXI_SHUTDOWN_ENABLE	BIT(14)
 #define HZIP_WR_PORT			BIT(11)
 
-#define HZIP_DEV_ALG_MAX_LEN		256
 #define HZIP_ALG_ZLIB_BIT		GENMASK(1, 0)
 #define HZIP_ALG_GZIP_BIT		GENMASK(3, 2)
 #define HZIP_ALG_DEFLATE_BIT		GENMASK(5, 4)
@@ -127,23 +126,18 @@ struct zip_dfx_item {
 	u32 offset;
 };
 
-struct zip_dev_alg {
-	u32 alg_msk;
-	const char *algs;
-};
-
-static const struct zip_dev_alg zip_dev_algs[] = { {
+static const struct qm_dev_alg zip_dev_algs[] = { {
 		.alg_msk = HZIP_ALG_ZLIB_BIT,
-		.algs = "zlib\n",
+		.alg = "zlib\n",
 	}, {
 		.alg_msk = HZIP_ALG_GZIP_BIT,
-		.algs = "gzip\n",
+		.alg = "gzip\n",
 	}, {
 		.alg_msk = HZIP_ALG_DEFLATE_BIT,
-		.algs = "deflate\n",
+		.alg = "deflate\n",
 	}, {
 		.alg_msk = HZIP_ALG_LZ77_BIT,
-		.algs = "lz77_zstd\n",
+		.alg = "lz77_zstd\n",
 	},
 };
 
@@ -477,35 +471,6 @@ static int hisi_zip_set_high_perf(struct hisi_qm *qm)
 	return ret;
 }
 
-static int hisi_zip_set_qm_algs(struct hisi_qm *qm)
-{
-	struct device *dev = &qm->pdev->dev;
-	char *algs, *ptr;
-	u32 alg_mask;
-	int i;
-
-	if (!qm->use_sva)
-		return 0;
-
-	algs = devm_kzalloc(dev, HZIP_DEV_ALG_MAX_LEN * sizeof(char), GFP_KERNEL);
-	if (!algs)
-		return -ENOMEM;
-
-	alg_mask = hisi_qm_get_hw_info(qm, zip_basic_cap_info, ZIP_DEV_ALG_BITMAP, qm->cap_ver);
-
-	for (i = 0; i < ARRAY_SIZE(zip_dev_algs); i++)
-		if (alg_mask & zip_dev_algs[i].alg_msk)
-			strcat(algs, zip_dev_algs[i].algs);
-
-	ptr = strrchr(algs, '\n');
-	if (ptr)
-		*ptr = '\0';
-
-	qm->uacce->algs = algs;
-
-	return 0;
-}
-
 static void hisi_zip_open_sva_prefetch(struct hisi_qm *qm)
 {
 	u32 val;
@@ -1192,6 +1157,7 @@ static int hisi_zip_pf_probe_init(struct hisi_zip *hisi_zip)
 
 static int hisi_zip_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 {
+	u64 alg_msk;
 	int ret;
 
 	qm->pdev = pdev;
@@ -1227,7 +1193,8 @@ static int hisi_zip_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 		return ret;
 	}
 
-	ret = hisi_zip_set_qm_algs(qm);
+	alg_msk = hisi_qm_get_hw_info(qm, zip_basic_cap_info, ZIP_DEV_ALG_BITMAP, qm->cap_ver);
+	ret = hisi_qm_set_algs(qm, alg_msk, zip_dev_algs, ARRAY_SIZE(zip_dev_algs));
 	if (ret) {
 		pci_err(qm->pdev, "Failed to set zip algs!\n");
 		hisi_qm_uninit(qm);
diff --git a/include/linux/hisi_acc_qm.h b/include/linux/hisi_acc_qm.h
index eff6ec42ccbe..5c4b3a68053f 100644
--- a/include/linux/hisi_acc_qm.h
+++ b/include/linux/hisi_acc_qm.h
@@ -160,6 +160,11 @@ enum qm_cap_bits {
 	QM_SUPPORT_RPM,
 };
 
+struct qm_dev_alg {
+	u64 alg_msk;
+	const char *alg;
+};
+
 struct dfx_diff_registers {
 	u32 *regs;
 	u32 reg_offset;
@@ -362,7 +367,6 @@ struct hisi_qm {
 	struct work_struct rst_work;
 	struct work_struct cmd_process;
 
-	const char *algs;
 	bool use_sva;
 
 	resource_size_t phys_base;
@@ -548,6 +552,8 @@ void hisi_qm_regs_dump(struct seq_file *s, struct debugfs_regset32 *regset);
 u32 hisi_qm_get_hw_info(struct hisi_qm *qm,
 			const struct hisi_qm_cap_info *info_table,
 			u32 index, bool is_read);
+int hisi_qm_set_algs(struct hisi_qm *qm, u64 alg_msk, const struct qm_dev_alg *dev_algs,
+		     u32 dev_algs_size);
 
 /* Used by VFIO ACC live migration driver */
 struct pci_driver *hisi_sec_get_pf_driver(void);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 057/583] crypto: hisilicon/hpre - save capability registers in probe process
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (55 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 056/583] crypto: hisilicon/qm - add a function to set qm algs Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 058/583] crypto: hisilicon/sec2 " Greg Kroah-Hartman
                   ` (532 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Zhiqi Song, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Zhiqi Song <songzhiqi1@huawei.com>

[ Upstream commit cf8b5156bbc8c9376f699e8d35e9464b739e33ff ]

Pre-store the valid value of hpre alg support related capability
register in hpre_qm_init(), which will be called by hpre_probe().
It can reduce the number of capability register queries and avoid
obtaining incorrect values in abnormal scenarios, such as reset
failed and the memory space disabled.

Fixes: f214d59a0603 ("crypto: hisilicon/hpre - support hpre capability")
Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/hisilicon/hpre/hpre_main.c | 82 ++++++++++++++++++-----
 1 file changed, 64 insertions(+), 18 deletions(-)

diff --git a/drivers/crypto/hisilicon/hpre/hpre_main.c b/drivers/crypto/hisilicon/hpre/hpre_main.c
index 4b3cba95950b..b97ce0ee7140 100644
--- a/drivers/crypto/hisilicon/hpre/hpre_main.c
+++ b/drivers/crypto/hisilicon/hpre/hpre_main.c
@@ -225,6 +225,20 @@ static const struct hisi_qm_cap_info hpre_basic_info[] = {
 	{HPRE_CORE10_ALG_BITMAP_CAP, 0x3170, 0, GENMASK(31, 0), 0x0, 0x10, 0x10}
 };
 
+enum hpre_pre_store_cap_idx {
+	HPRE_CLUSTER_NUM_CAP_IDX = 0x0,
+	HPRE_CORE_ENABLE_BITMAP_CAP_IDX,
+	HPRE_DRV_ALG_BITMAP_CAP_IDX,
+	HPRE_DEV_ALG_BITMAP_CAP_IDX,
+};
+
+static const u32 hpre_pre_store_caps[] = {
+	HPRE_CLUSTER_NUM_CAP,
+	HPRE_CORE_ENABLE_BITMAP_CAP,
+	HPRE_DRV_ALG_BITMAP_CAP,
+	HPRE_DEV_ALG_BITMAP_CAP,
+};
+
 static const struct hpre_hw_error hpre_hw_errors[] = {
 	{
 		.int_msk = BIT(0),
@@ -347,7 +361,7 @@ bool hpre_check_alg_support(struct hisi_qm *qm, u32 alg)
 {
 	u32 cap_val;
 
-	cap_val = hisi_qm_get_hw_info(qm, hpre_basic_info, HPRE_DRV_ALG_BITMAP_CAP, qm->cap_ver);
+	cap_val = qm->cap_tables.dev_cap_table[HPRE_DRV_ALG_BITMAP_CAP_IDX].cap_val;
 	if (alg & cap_val)
 		return true;
 
@@ -423,16 +437,6 @@ static u32 vfs_num;
 module_param_cb(vfs_num, &vfs_num_ops, &vfs_num, 0444);
 MODULE_PARM_DESC(vfs_num, "Number of VFs to enable(1-63), 0(default)");
 
-static inline int hpre_cluster_num(struct hisi_qm *qm)
-{
-	return hisi_qm_get_hw_info(qm, hpre_basic_info, HPRE_CLUSTER_NUM_CAP, qm->cap_ver);
-}
-
-static inline int hpre_cluster_core_mask(struct hisi_qm *qm)
-{
-	return hisi_qm_get_hw_info(qm, hpre_basic_info, HPRE_CORE_ENABLE_BITMAP_CAP, qm->cap_ver);
-}
-
 struct hisi_qp *hpre_create_qp(u8 type)
 {
 	int node = cpu_to_node(smp_processor_id());
@@ -499,13 +503,15 @@ static int hpre_cfg_by_dsm(struct hisi_qm *qm)
 
 static int hpre_set_cluster(struct hisi_qm *qm)
 {
-	u32 cluster_core_mask = hpre_cluster_core_mask(qm);
-	u8 clusters_num = hpre_cluster_num(qm);
 	struct device *dev = &qm->pdev->dev;
 	unsigned long offset;
+	u32 cluster_core_mask;
+	u8 clusters_num;
 	u32 val = 0;
 	int ret, i;
 
+	cluster_core_mask = qm->cap_tables.dev_cap_table[HPRE_CORE_ENABLE_BITMAP_CAP_IDX].cap_val;
+	clusters_num = qm->cap_tables.dev_cap_table[HPRE_CLUSTER_NUM_CAP_IDX].cap_val;
 	for (i = 0; i < clusters_num; i++) {
 		offset = i * HPRE_CLSTR_ADDR_INTRVL;
 
@@ -700,11 +706,12 @@ static int hpre_set_user_domain_and_cache(struct hisi_qm *qm)
 
 static void hpre_cnt_regs_clear(struct hisi_qm *qm)
 {
-	u8 clusters_num = hpre_cluster_num(qm);
 	unsigned long offset;
+	u8 clusters_num;
 	int i;
 
 	/* clear clusterX/cluster_ctrl */
+	clusters_num = qm->cap_tables.dev_cap_table[HPRE_CLUSTER_NUM_CAP_IDX].cap_val;
 	for (i = 0; i < clusters_num; i++) {
 		offset = HPRE_CLSTR_BASE + i * HPRE_CLSTR_ADDR_INTRVL;
 		writel(0x0, qm->io_base + offset + HPRE_CLUSTER_INQURY);
@@ -991,13 +998,14 @@ static int hpre_pf_comm_regs_debugfs_init(struct hisi_qm *qm)
 
 static int hpre_cluster_debugfs_init(struct hisi_qm *qm)
 {
-	u8 clusters_num = hpre_cluster_num(qm);
 	struct device *dev = &qm->pdev->dev;
 	char buf[HPRE_DBGFS_VAL_MAX_LEN];
 	struct debugfs_regset32 *regset;
 	struct dentry *tmp_d;
+	u8 clusters_num;
 	int i, ret;
 
+	clusters_num = qm->cap_tables.dev_cap_table[HPRE_CLUSTER_NUM_CAP_IDX].cap_val;
 	for (i = 0; i < clusters_num; i++) {
 		ret = snprintf(buf, HPRE_DBGFS_VAL_MAX_LEN, "cluster%d", i);
 		if (ret >= HPRE_DBGFS_VAL_MAX_LEN)
@@ -1102,6 +1110,34 @@ static void hpre_debugfs_exit(struct hisi_qm *qm)
 	debugfs_remove_recursive(qm->debug.debug_root);
 }
 
+static int hpre_pre_store_cap_reg(struct hisi_qm *qm)
+{
+	struct hisi_qm_cap_record *hpre_cap;
+	struct device *dev = &qm->pdev->dev;
+	size_t i, size;
+
+	size = ARRAY_SIZE(hpre_pre_store_caps);
+	hpre_cap = devm_kzalloc(dev, sizeof(*hpre_cap) * size, GFP_KERNEL);
+	if (!hpre_cap)
+		return -ENOMEM;
+
+	for (i = 0; i < size; i++) {
+		hpre_cap[i].type = hpre_pre_store_caps[i];
+		hpre_cap[i].cap_val = hisi_qm_get_hw_info(qm, hpre_basic_info,
+				      hpre_pre_store_caps[i], qm->cap_ver);
+	}
+
+	if (hpre_cap[HPRE_CLUSTER_NUM_CAP_IDX].cap_val > HPRE_CLUSTERS_NUM_MAX) {
+		dev_err(dev, "Device cluster num %u is out of range for driver supports %d!\n",
+			hpre_cap[HPRE_CLUSTER_NUM_CAP_IDX].cap_val, HPRE_CLUSTERS_NUM_MAX);
+		return -EINVAL;
+	}
+
+	qm->cap_tables.dev_cap_table = hpre_cap;
+
+	return 0;
+}
+
 static int hpre_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 {
 	u64 alg_msk;
@@ -1135,7 +1171,15 @@ static int hpre_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 		return ret;
 	}
 
-	alg_msk = hisi_qm_get_hw_info(qm, hpre_basic_info, HPRE_DEV_ALG_BITMAP_CAP, qm->cap_ver);
+	/* Fetch and save the value of capability registers */
+	ret = hpre_pre_store_cap_reg(qm);
+	if (ret) {
+		pci_err(pdev, "Failed to pre-store capability registers!\n");
+		hisi_qm_uninit(qm);
+		return ret;
+	}
+
+	alg_msk = qm->cap_tables.dev_cap_table[HPRE_DEV_ALG_BITMAP_CAP_IDX].cap_val;
 	ret = hisi_qm_set_algs(qm, alg_msk, hpre_dev_algs, ARRAY_SIZE(hpre_dev_algs));
 	if (ret) {
 		pci_err(pdev, "Failed to set hpre algs!\n");
@@ -1149,11 +1193,12 @@ static int hpre_show_last_regs_init(struct hisi_qm *qm)
 {
 	int cluster_dfx_regs_num =  ARRAY_SIZE(hpre_cluster_dfx_regs);
 	int com_dfx_regs_num = ARRAY_SIZE(hpre_com_dfx_regs);
-	u8 clusters_num = hpre_cluster_num(qm);
 	struct qm_debug *debug = &qm->debug;
 	void __iomem *io_base;
+	u8 clusters_num;
 	int i, j, idx;
 
+	clusters_num = qm->cap_tables.dev_cap_table[HPRE_CLUSTER_NUM_CAP_IDX].cap_val;
 	debug->last_words = kcalloc(cluster_dfx_regs_num * clusters_num +
 			com_dfx_regs_num, sizeof(unsigned int), GFP_KERNEL);
 	if (!debug->last_words)
@@ -1190,10 +1235,10 @@ static void hpre_show_last_dfx_regs(struct hisi_qm *qm)
 {
 	int cluster_dfx_regs_num =  ARRAY_SIZE(hpre_cluster_dfx_regs);
 	int com_dfx_regs_num = ARRAY_SIZE(hpre_com_dfx_regs);
-	u8 clusters_num = hpre_cluster_num(qm);
 	struct qm_debug *debug = &qm->debug;
 	struct pci_dev *pdev = qm->pdev;
 	void __iomem *io_base;
+	u8 clusters_num;
 	int i, j, idx;
 	u32 val;
 
@@ -1208,6 +1253,7 @@ static void hpre_show_last_dfx_regs(struct hisi_qm *qm)
 			  hpre_com_dfx_regs[i].name, debug->last_words[i], val);
 	}
 
+	clusters_num = qm->cap_tables.dev_cap_table[HPRE_CLUSTER_NUM_CAP_IDX].cap_val;
 	for (i = 0; i < clusters_num; i++) {
 		io_base = qm->io_base + hpre_cluster_offsets[i];
 		for (j = 0; j <  cluster_dfx_regs_num; j++) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 058/583] crypto: hisilicon/sec2 - save capability registers in probe process
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (56 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 057/583] crypto: hisilicon/hpre - save capability registers in probe process Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 059/583] crypto: hisilicon/zip " Greg Kroah-Hartman
                   ` (531 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Zhiqi Song, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Zhiqi Song <songzhiqi1@huawei.com>

[ Upstream commit f1115b0096c3163592e04e74f5a7548c25bda957 ]

Pre-store the valid value of the sec alg support related capability
register in sec_qm_init(), which will be called by probe process.
It can reduce the number of capability register queries and avoid
obtaining incorrect values in abnormal scenarios, such as reset
failed and the memory space disabled.

Fixes: 921715b6b782 ("crypto: hisilicon/sec - get algorithm bitmap from registers")
Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/hisilicon/sec2/sec.h        |  7 ++++
 drivers/crypto/hisilicon/sec2/sec_crypto.c | 13 +++++--
 drivers/crypto/hisilicon/sec2/sec_main.c   | 43 ++++++++++++++++++++--
 3 files changed, 57 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/hisilicon/sec2/sec.h b/drivers/crypto/hisilicon/sec2/sec.h
index 3e57fc04b377..410c83712e28 100644
--- a/drivers/crypto/hisilicon/sec2/sec.h
+++ b/drivers/crypto/hisilicon/sec2/sec.h
@@ -220,6 +220,13 @@ enum sec_cap_type {
 	SEC_CORE4_ALG_BITMAP_HIGH,
 };
 
+enum sec_cap_reg_record_idx {
+	SEC_DRV_ALG_BITMAP_LOW_IDX = 0x0,
+	SEC_DRV_ALG_BITMAP_HIGH_IDX,
+	SEC_DEV_ALG_BITMAP_LOW_IDX,
+	SEC_DEV_ALG_BITMAP_HIGH_IDX,
+};
+
 void sec_destroy_qps(struct hisi_qp **qps, int qp_num);
 struct hisi_qp **sec_create_qps(void);
 int sec_register_to_crypto(struct hisi_qm *qm);
diff --git a/drivers/crypto/hisilicon/sec2/sec_crypto.c b/drivers/crypto/hisilicon/sec2/sec_crypto.c
index 074e50ef512c..c3a630cb27a6 100644
--- a/drivers/crypto/hisilicon/sec2/sec_crypto.c
+++ b/drivers/crypto/hisilicon/sec2/sec_crypto.c
@@ -2543,8 +2543,12 @@ static int sec_register_aead(u64 alg_mask)
 
 int sec_register_to_crypto(struct hisi_qm *qm)
 {
-	u64 alg_mask = sec_get_alg_bitmap(qm, SEC_DRV_ALG_BITMAP_HIGH, SEC_DRV_ALG_BITMAP_LOW);
-	int ret;
+	u64 alg_mask;
+	int ret = 0;
+
+	alg_mask = sec_get_alg_bitmap(qm, SEC_DRV_ALG_BITMAP_HIGH_IDX,
+				      SEC_DRV_ALG_BITMAP_LOW_IDX);
+
 
 	ret = sec_register_skcipher(alg_mask);
 	if (ret)
@@ -2559,7 +2563,10 @@ int sec_register_to_crypto(struct hisi_qm *qm)
 
 void sec_unregister_from_crypto(struct hisi_qm *qm)
 {
-	u64 alg_mask = sec_get_alg_bitmap(qm, SEC_DRV_ALG_BITMAP_HIGH, SEC_DRV_ALG_BITMAP_LOW);
+	u64 alg_mask;
+
+	alg_mask = sec_get_alg_bitmap(qm, SEC_DRV_ALG_BITMAP_HIGH_IDX,
+				      SEC_DRV_ALG_BITMAP_LOW_IDX);
 
 	sec_unregister_aead(alg_mask, ARRAY_SIZE(sec_aeads));
 	sec_unregister_skcipher(alg_mask, ARRAY_SIZE(sec_skciphers));
diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers/crypto/hisilicon/sec2/sec_main.c
index 5c39667507ab..bf02a6b2eed4 100644
--- a/drivers/crypto/hisilicon/sec2/sec_main.c
+++ b/drivers/crypto/hisilicon/sec2/sec_main.c
@@ -167,6 +167,13 @@ static const struct hisi_qm_cap_info sec_basic_info[] = {
 	{SEC_CORE4_ALG_BITMAP_HIGH, 0x3170, 0, GENMASK(31, 0), 0x3FFF, 0x3FFF, 0x3FFF},
 };
 
+static const u32 sec_pre_store_caps[] = {
+	SEC_DRV_ALG_BITMAP_LOW,
+	SEC_DRV_ALG_BITMAP_HIGH,
+	SEC_DEV_ALG_BITMAP_LOW,
+	SEC_DEV_ALG_BITMAP_HIGH,
+};
+
 static const struct qm_dev_alg sec_dev_algs[] = { {
 		.alg_msk = SEC_CIPHER_BITMAP,
 		.alg = "cipher\n",
@@ -388,8 +395,8 @@ u64 sec_get_alg_bitmap(struct hisi_qm *qm, u32 high, u32 low)
 {
 	u32 cap_val_h, cap_val_l;
 
-	cap_val_h = hisi_qm_get_hw_info(qm, sec_basic_info, high, qm->cap_ver);
-	cap_val_l = hisi_qm_get_hw_info(qm, sec_basic_info, low, qm->cap_ver);
+	cap_val_h = qm->cap_tables.dev_cap_table[high].cap_val;
+	cap_val_l = qm->cap_tables.dev_cap_table[low].cap_val;
 
 	return ((u64)cap_val_h << SEC_ALG_BITMAP_SHIFT) | (u64)cap_val_l;
 }
@@ -1071,6 +1078,28 @@ static int sec_pf_probe_init(struct sec_dev *sec)
 	return ret;
 }
 
+static int sec_pre_store_cap_reg(struct hisi_qm *qm)
+{
+	struct hisi_qm_cap_record *sec_cap;
+	struct pci_dev *pdev = qm->pdev;
+	size_t i, size;
+
+	size = ARRAY_SIZE(sec_pre_store_caps);
+	sec_cap = devm_kzalloc(&pdev->dev, sizeof(*sec_cap) * size, GFP_KERNEL);
+	if (!sec_cap)
+		return -ENOMEM;
+
+	for (i = 0; i < size; i++) {
+		sec_cap[i].type = sec_pre_store_caps[i];
+		sec_cap[i].cap_val = hisi_qm_get_hw_info(qm, sec_basic_info,
+				     sec_pre_store_caps[i], qm->cap_ver);
+	}
+
+	qm->cap_tables.dev_cap_table = sec_cap;
+
+	return 0;
+}
+
 static int sec_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 {
 	u64 alg_msk;
@@ -1108,7 +1137,15 @@ static int sec_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 		return ret;
 	}
 
-	alg_msk = sec_get_alg_bitmap(qm, SEC_DEV_ALG_BITMAP_HIGH, SEC_DEV_ALG_BITMAP_LOW);
+	/* Fetch and save the value of capability registers */
+	ret = sec_pre_store_cap_reg(qm);
+	if (ret) {
+		pci_err(qm->pdev, "Failed to pre-store capability registers!\n");
+		hisi_qm_uninit(qm);
+		return ret;
+	}
+
+	alg_msk = sec_get_alg_bitmap(qm, SEC_DEV_ALG_BITMAP_HIGH_IDX, SEC_DEV_ALG_BITMAP_LOW_IDX);
 	ret = hisi_qm_set_algs(qm, alg_msk, sec_dev_algs, ARRAY_SIZE(sec_dev_algs));
 	if (ret) {
 		pci_err(qm->pdev, "Failed to set sec algs!\n");
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 059/583] crypto: hisilicon/zip - save capability registers in probe process
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (57 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 058/583] crypto: hisilicon/sec2 " Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 060/583] pstore: ram_core: fix possible overflow in persistent_ram_init_ecc() Greg Kroah-Hartman
                   ` (530 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Zhiqi Song, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Zhiqi Song <songzhiqi1@huawei.com>

[ Upstream commit 2ff0ad847951d61c2d8b309e1ccefb26c57dcc7b ]

Pre-store the valid value of the zip alg support related capability
register in hisi_zip_qm_init(), which will be called by hisi_zip_probe().
It can reduce the number of capability register queries and avoid
obtaining incorrect values in abnormal scenarios, such as reset failed
and the memory space disabled.

Fixes: db700974b69d ("crypto: hisilicon/zip - support zip capability")
Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/hisilicon/zip/zip_main.c | 73 ++++++++++++++++++++-----
 1 file changed, 60 insertions(+), 13 deletions(-)

diff --git a/drivers/crypto/hisilicon/zip/zip_main.c b/drivers/crypto/hisilicon/zip/zip_main.c
index 4d64a43515a9..cd7ecb2180bf 100644
--- a/drivers/crypto/hisilicon/zip/zip_main.c
+++ b/drivers/crypto/hisilicon/zip/zip_main.c
@@ -248,6 +248,26 @@ static struct hisi_qm_cap_info zip_basic_cap_info[] = {
 	{ZIP_CAP_MAX, 0x317c, 0, GENMASK(0, 0), 0x0, 0x0, 0x0}
 };
 
+enum zip_pre_store_cap_idx {
+	ZIP_CORE_NUM_CAP_IDX = 0x0,
+	ZIP_CLUSTER_COMP_NUM_CAP_IDX,
+	ZIP_CLUSTER_DECOMP_NUM_CAP_IDX,
+	ZIP_DECOMP_ENABLE_BITMAP_IDX,
+	ZIP_COMP_ENABLE_BITMAP_IDX,
+	ZIP_DRV_ALG_BITMAP_IDX,
+	ZIP_DEV_ALG_BITMAP_IDX,
+};
+
+static const u32 zip_pre_store_caps[] = {
+	ZIP_CORE_NUM_CAP,
+	ZIP_CLUSTER_COMP_NUM_CAP,
+	ZIP_CLUSTER_DECOMP_NUM_CAP,
+	ZIP_DECOMP_ENABLE_BITMAP,
+	ZIP_COMP_ENABLE_BITMAP,
+	ZIP_DRV_ALG_BITMAP,
+	ZIP_DEV_ALG_BITMAP,
+};
+
 enum {
 	HZIP_COMP_CORE0,
 	HZIP_COMP_CORE1,
@@ -442,7 +462,7 @@ bool hisi_zip_alg_support(struct hisi_qm *qm, u32 alg)
 {
 	u32 cap_val;
 
-	cap_val = hisi_qm_get_hw_info(qm, zip_basic_cap_info, ZIP_DRV_ALG_BITMAP, qm->cap_ver);
+	cap_val = qm->cap_tables.dev_cap_table[ZIP_DRV_ALG_BITMAP_IDX].cap_val;
 	if ((alg & cap_val) == alg)
 		return true;
 
@@ -567,10 +587,8 @@ static int hisi_zip_set_user_domain_and_cache(struct hisi_qm *qm)
 	}
 
 	/* let's open all compression/decompression cores */
-	dcomp_bm = hisi_qm_get_hw_info(qm, zip_basic_cap_info,
-				       ZIP_DECOMP_ENABLE_BITMAP, qm->cap_ver);
-	comp_bm = hisi_qm_get_hw_info(qm, zip_basic_cap_info,
-				      ZIP_COMP_ENABLE_BITMAP, qm->cap_ver);
+	dcomp_bm = qm->cap_tables.dev_cap_table[ZIP_DECOMP_ENABLE_BITMAP_IDX].cap_val;
+	comp_bm = qm->cap_tables.dev_cap_table[ZIP_COMP_ENABLE_BITMAP_IDX].cap_val;
 	writel(HZIP_DECOMP_CHECK_ENABLE | dcomp_bm | comp_bm, base + HZIP_CLOCK_GATE_CTRL);
 
 	/* enable sqc,cqc writeback */
@@ -797,9 +815,8 @@ static int hisi_zip_core_debug_init(struct hisi_qm *qm)
 	char buf[HZIP_BUF_SIZE];
 	int i;
 
-	zip_core_num = hisi_qm_get_hw_info(qm, zip_basic_cap_info, ZIP_CORE_NUM_CAP, qm->cap_ver);
-	zip_comp_core_num = hisi_qm_get_hw_info(qm, zip_basic_cap_info, ZIP_CLUSTER_COMP_NUM_CAP,
-						qm->cap_ver);
+	zip_core_num = qm->cap_tables.dev_cap_table[ZIP_CORE_NUM_CAP_IDX].cap_val;
+	zip_comp_core_num = qm->cap_tables.dev_cap_table[ZIP_CLUSTER_COMP_NUM_CAP_IDX].cap_val;
 
 	for (i = 0; i < zip_core_num; i++) {
 		if (i < zip_comp_core_num)
@@ -941,7 +958,7 @@ static int hisi_zip_show_last_regs_init(struct hisi_qm *qm)
 	u32 zip_core_num;
 	int i, j, idx;
 
-	zip_core_num = hisi_qm_get_hw_info(qm, zip_basic_cap_info, ZIP_CORE_NUM_CAP, qm->cap_ver);
+	zip_core_num = qm->cap_tables.dev_cap_table[ZIP_CORE_NUM_CAP_IDX].cap_val;
 
 	debug->last_words = kcalloc(core_dfx_regs_num * zip_core_num + com_dfx_regs_num,
 				    sizeof(unsigned int), GFP_KERNEL);
@@ -997,9 +1014,9 @@ static void hisi_zip_show_last_dfx_regs(struct hisi_qm *qm)
 				 hzip_com_dfx_regs[i].name, debug->last_words[i], val);
 	}
 
-	zip_core_num = hisi_qm_get_hw_info(qm, zip_basic_cap_info, ZIP_CORE_NUM_CAP, qm->cap_ver);
-	zip_comp_core_num = hisi_qm_get_hw_info(qm, zip_basic_cap_info, ZIP_CLUSTER_COMP_NUM_CAP,
-						qm->cap_ver);
+	zip_core_num = qm->cap_tables.dev_cap_table[ZIP_CORE_NUM_CAP_IDX].cap_val;
+	zip_comp_core_num = qm->cap_tables.dev_cap_table[ZIP_CLUSTER_COMP_NUM_CAP_IDX].cap_val;
+
 	for (i = 0; i < zip_core_num; i++) {
 		if (i < zip_comp_core_num)
 			scnprintf(buf, sizeof(buf), "Comp_core-%d", i);
@@ -1155,6 +1172,28 @@ static int hisi_zip_pf_probe_init(struct hisi_zip *hisi_zip)
 	return ret;
 }
 
+static int zip_pre_store_cap_reg(struct hisi_qm *qm)
+{
+	struct hisi_qm_cap_record *zip_cap;
+	struct pci_dev *pdev = qm->pdev;
+	size_t i, size;
+
+	size = ARRAY_SIZE(zip_pre_store_caps);
+	zip_cap = devm_kzalloc(&pdev->dev, sizeof(*zip_cap) * size, GFP_KERNEL);
+	if (!zip_cap)
+		return -ENOMEM;
+
+	for (i = 0; i < size; i++) {
+		zip_cap[i].type = zip_pre_store_caps[i];
+		zip_cap[i].cap_val = hisi_qm_get_hw_info(qm, zip_basic_cap_info,
+				     zip_pre_store_caps[i], qm->cap_ver);
+	}
+
+	qm->cap_tables.dev_cap_table = zip_cap;
+
+	return 0;
+}
+
 static int hisi_zip_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 {
 	u64 alg_msk;
@@ -1193,7 +1232,15 @@ static int hisi_zip_qm_init(struct hisi_qm *qm, struct pci_dev *pdev)
 		return ret;
 	}
 
-	alg_msk = hisi_qm_get_hw_info(qm, zip_basic_cap_info, ZIP_DEV_ALG_BITMAP, qm->cap_ver);
+	/* Fetch and save the value of capability registers */
+	ret = zip_pre_store_cap_reg(qm);
+	if (ret) {
+		pci_err(qm->pdev, "Failed to pre-store capability registers!\n");
+		hisi_qm_uninit(qm);
+		return ret;
+	}
+
+	alg_msk = qm->cap_tables.dev_cap_table[ZIP_DEV_ALG_BITMAP_IDX].cap_val;
 	ret = hisi_qm_set_algs(qm, alg_msk, zip_dev_algs, ARRAY_SIZE(zip_dev_algs));
 	if (ret) {
 		pci_err(qm->pdev, "Failed to set zip algs!\n");
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 060/583] pstore: ram_core: fix possible overflow in persistent_ram_init_ecc()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (58 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 059/583] crypto: hisilicon/zip " Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 061/583] erofs: fix memory leak on short-lived bounced pages Greg Kroah-Hartman
                   ` (529 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sergey Shtylyov, Kees Cook, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sergey Shtylyov <s.shtylyov@omp.ru>

[ Upstream commit 86222a8fc16ec517de8da2604d904c9df3a08e5d ]

In persistent_ram_init_ecc(), on 64-bit arches DIV_ROUND_UP() will return
64-bit value since persistent_ram_zone::buffer_size has type size_t which
is derived from the 64-bit *unsigned long*, while the ecc_blocks variable
this value gets assigned to has (always 32-bit) *int* type.  Even if that
value fits into *int* type, an overflow is still possible when calculating
the size_t typed ecc_total variable further below since there's no cast to
any 64-bit type before multiplication.  Declaring the ecc_blocks variable
as *size_t* should fix this mess...

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.

Fixes: 9cc05ad97c57 ("staging: android: persistent_ram: refactor ecc support")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/20231105202936.25694-1-s.shtylyov@omp.ru
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/pstore/ram_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
index 650e437b55e6..f1848cdd6d34 100644
--- a/fs/pstore/ram_core.c
+++ b/fs/pstore/ram_core.c
@@ -190,7 +190,7 @@ static int persistent_ram_init_ecc(struct persistent_ram_zone *prz,
 {
 	int numerr;
 	struct persistent_ram_buffer *buffer = prz->buffer;
-	int ecc_blocks;
+	size_t ecc_blocks;
 	size_t ecc_total;
 
 	if (!ecc_info || !ecc_info->ecc_size)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 061/583] erofs: fix memory leak on short-lived bounced pages
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (59 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 060/583] pstore: ram_core: fix possible overflow in persistent_ram_init_ecc() Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 062/583] fs: indicate request originates from old mount API Greg Kroah-Hartman
                   ` (528 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yue Hu, Chao Yu, Gao Xiang, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Gao Xiang <hsiangkao@linux.alibaba.com>

[ Upstream commit 93d6fda7f926451a0fa1121b9558d75ca47e861e ]

Both MicroLZMA and DEFLATE algorithms can use short-lived pages on
demand for the overlapped inplace I/O decompression.

However, those short-lived pages are actually added to
`be->compressed_pages`.  Thus, it should be checked instead of
`pcl->compressed_bvecs`.

The LZ4 algorithm doesn't work like this, so it won't be impacted.

Fixes: 67139e36d970 ("erofs: introduce `z_erofs_parse_in_bvecs'")
Reviewed-by: Yue Hu <huyue2@coolpad.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20231128180431.4116991-1-hsiangkao@linux.alibaba.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/erofs/zdata.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index a7e6847f6f8f..a33cd6757f98 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -1309,12 +1309,11 @@ static int z_erofs_decompress_pcluster(struct z_erofs_decompress_backend *be,
 		put_page(page);
 	} else {
 		for (i = 0; i < pclusterpages; ++i) {
-			page = pcl->compressed_bvecs[i].page;
+			/* consider shortlived pages added when decompressing */
+			page = be->compressed_pages[i];
 
 			if (erofs_page_is_managed(sbi, page))
 				continue;
-
-			/* recycle all individual short-lived pages */
 			(void)z_erofs_put_shortlivedpage(be->pagepool, page);
 			WRITE_ONCE(pcl->compressed_bvecs[i].page, NULL);
 		}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 062/583] fs: indicate request originates from old mount API
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (60 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 061/583] erofs: fix memory leak on short-lived bounced pages Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 063/583] gfs2: Fix kernel NULL pointer dereference in gfs2_rgrp_dump Greg Kroah-Hartman
                   ` (527 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christoph Hellwig,
	Johannes Thumshirn, Anand Jain, Christian Brauner, Josef Bacik,
	David Sterba, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christian Brauner <brauner@kernel.org>

[ Upstream commit f67d922edb4e95a4a56d07d5d40a76dd4f23a85b ]

We already communicate to filesystems when a remount request comes from
the old mount API as some filesystems choose to implement different
behavior in the new mount API than the old mount API to e.g., take the
chance to fix significant API bugs. Allow the same for regular mount
requests.

Fixes: b330966f79fb ("fuse: reject options on reconfigure via fsconfig(2)")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/namespace.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/fs/namespace.c b/fs/namespace.c
index e157efc54023..bfc5cff0e196 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2873,7 +2873,12 @@ static int do_remount(struct path *path, int ms_flags, int sb_flags,
 	if (IS_ERR(fc))
 		return PTR_ERR(fc);
 
+	/*
+	 * Indicate to the filesystem that the remount request is coming
+	 * from the legacy mount system call.
+	 */
 	fc->oldapi = true;
+
 	err = parse_monolithic_mount_data(fc, data);
 	if (!err) {
 		down_write(&sb->s_umount);
@@ -3322,6 +3327,12 @@ static int do_new_mount(struct path *path, const char *fstype, int sb_flags,
 	if (IS_ERR(fc))
 		return PTR_ERR(fc);
 
+	/*
+	 * Indicate to the filesystem that the mount request is coming
+	 * from the legacy mount system call.
+	 */
+	fc->oldapi = true;
+
 	if (subtype)
 		err = vfs_parse_fs_string(fc, "subtype",
 					  subtype, strlen(subtype));
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 063/583] gfs2: Fix kernel NULL pointer dereference in gfs2_rgrp_dump
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (61 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 062/583] fs: indicate request originates from old mount API Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 064/583] gfs2: fix kernel BUG in gfs2_quota_cleanup Greg Kroah-Hartman
                   ` (526 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Osama Muhammad, Andreas Gruenbacher,
	Sasha Levin, syzbot+da0fc229cc1ff4bb2e6d

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Osama Muhammad <osmtendev@gmail.com>

[ Upstream commit 8877243beafa7c6bfc42022cbfdf9e39b25bd4fa ]

Syzkaller has reported a NULL pointer dereference when accessing
rgd->rd_rgl in gfs2_rgrp_dump().  This can happen when creating
rgd->rd_gl fails in read_rindex_entry().  Add a NULL pointer check in
gfs2_rgrp_dump() to prevent that.

Reported-and-tested-by: syzbot+da0fc229cc1ff4bb2e6d@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?extid=da0fc229cc1ff4bb2e6d
Fixes: 72244b6bc752 ("gfs2: improve debug information when lvb mismatches are found")
Signed-off-by: Osama Muhammad <osmtendev@gmail.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/gfs2/rgrp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 9308190895c8..307b952a41f8 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -2306,7 +2306,7 @@ void gfs2_rgrp_dump(struct seq_file *seq, struct gfs2_rgrpd *rgd,
 		       (unsigned long long)rgd->rd_addr, rgd->rd_flags,
 		       rgd->rd_free, rgd->rd_free_clone, rgd->rd_dinodes,
 		       rgd->rd_requested, rgd->rd_reserved, rgd->rd_extfail_pt);
-	if (rgd->rd_sbd->sd_args.ar_rgrplvb) {
+	if (rgd->rd_sbd->sd_args.ar_rgrplvb && rgd->rd_rgl) {
 		struct gfs2_rgrp_lvb *rgl = rgd->rd_rgl;
 
 		gfs2_print_dbg(seq, "%s  L: f:%02x b:%u i:%u\n", fs_id_buf,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 064/583] gfs2: fix kernel BUG in gfs2_quota_cleanup
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (62 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 063/583] gfs2: Fix kernel NULL pointer dereference in gfs2_rgrp_dump Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 065/583] dlm: fix format seq ops type 4 Greg Kroah-Hartman
                   ` (525 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Edward Adam Davis,
	Andreas Gruenbacher, Sasha Levin, syzbot+3b6e67ac2b646da57862

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Edward Adam Davis <eadavis@qq.com>

[ Upstream commit 71733b4922007500ae259af9e96017080f5d36d9 ]

[Syz report]
kernel BUG at fs/gfs2/quota.c:1508!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 5060 Comm: syz-executor505 Not tainted 6.7.0-rc3-syzkaller-00134-g994d5c58e50e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
RIP: 0010:gfs2_quota_cleanup+0x6b5/0x6c0 fs/gfs2/quota.c:1508
Code: fe e9 cf fd ff ff 44 89 e9 80 e1 07 80 c1 03 38 c1 0f 8c 2d fe ff ff 4c 89 ef e8 b6 19 23 fe e9 20 fe ff ff e8 ec 11 c7 fd 90 <0f> 0b e8 84 9c 4f 07 0f 1f 40 00 66 0f 1f 00 55 41 57 41 56 41 54
RSP: 0018:ffffc9000409f9e0 EFLAGS: 00010293
RAX: ffffffff83c76854 RBX: 0000000000000002 RCX: ffff888026001dc0
RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000000
RBP: ffffc9000409fb00 R08: ffffffff83c762b0 R09: 1ffff1100fd38015
R10: dffffc0000000000 R11: ffffed100fd38016 R12: dffffc0000000000
R13: ffff88807e9c0828 R14: ffff888014693580 R15: ffff88807e9c0000
FS:  0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f16d1bd70f8 CR3: 0000000027199000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 gfs2_put_super+0x2e1/0x940 fs/gfs2/super.c:611
 generic_shutdown_super+0x13a/0x2c0 fs/super.c:696
 kill_block_super+0x44/0x90 fs/super.c:1667
 deactivate_locked_super+0xc1/0x130 fs/super.c:484
 cleanup_mnt+0x426/0x4c0 fs/namespace.c:1256
 task_work_run+0x24a/0x300 kernel/task_work.c:180
 exit_task_work include/linux/task_work.h:38 [inline]
 do_exit+0xa34/0x2750 kernel/exit.c:871
 do_group_exit+0x206/0x2c0 kernel/exit.c:1021
 __do_sys_exit_group kernel/exit.c:1032 [inline]
 __se_sys_exit_group kernel/exit.c:1030 [inline]
 __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1030
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
...

[pid  5060] fsconfig(4, FSCONFIG_CMD_RECONFIGURE, NULL, NULL, 0) = 0
[pid  5060] exit_group(1)               = ?
...

[Analysis]
When the task exits, it will execute cleanup_mnt() to recycle the mounted gfs2
file system, but it performs a system call fsconfig(4, FSCONFIG_CMD_RECONFIGURE,
NULL, NULL, 0) before executing the task exit operation.

This will execute the following kernel path to complete the setting of
SDF_JOURNAL_LIVE for sd_flags:

SYSCALL_DEFINE5(fsconfig, ..)->
	vfs_fsconfig_locked()->
		vfs_cmd_reconfigure()->
			gfs2_reconfigure()->
				gfs2_make_fs_rw()->
					set_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);

[Fix]
Add SDF_NORECOVERY check in gfs2_quota_cleanup() to avoid checking
SDF_JOURNAL_LIVE on the path where gfs2 is being unmounted.

Reported-and-tested-by: syzbot+3b6e67ac2b646da57862@syzkaller.appspotmail.com
Fixes: f66af88e3321 ("gfs2: Stop using gfs2_make_fs_ro for withdraw")
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/gfs2/quota.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index 41d0232532a0..f689847bab40 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -1493,7 +1493,8 @@ void gfs2_quota_cleanup(struct gfs2_sbd *sdp)
 	LIST_HEAD(dispose);
 	int count;
 
-	BUG_ON(test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags));
+	BUG_ON(!test_bit(SDF_NORECOVERY, &sdp->sd_flags) &&
+		test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags));
 
 	spin_lock(&qd_lock);
 	list_for_each_entry(qd, &sdp->sd_quota_list, qd_list) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 065/583] dlm: fix format seq ops type 4
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (63 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 064/583] gfs2: fix kernel BUG in gfs2_quota_cleanup Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 066/583] crypto: virtio - Wait for tasklet to complete on device remove Greg Kroah-Hartman
                   ` (524 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alexander Aring, David Teigland,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alexander Aring <aahringo@redhat.com>

[ Upstream commit 367e753d5c54a414d82610eb709fe71fda6cf1c3 ]

This patch fixes to set the type 4 format ops in case of table_open4().
It got accidentially changed by commit 541adb0d4d10 ("fs: dlm: debugfs
for queued callbacks") and since them toss debug dumps the same format
as format 5 that are the queued ast callbacks for lkbs.

Fixes: 541adb0d4d10 ("fs: dlm: debugfs for queued callbacks")
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/dlm/debug_fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/dlm/debug_fs.c b/fs/dlm/debug_fs.c
index c93359ceaae6..d2c035387595 100644
--- a/fs/dlm/debug_fs.c
+++ b/fs/dlm/debug_fs.c
@@ -748,7 +748,7 @@ static int table_open4(struct inode *inode, struct file *file)
 	struct seq_file *seq;
 	int ret;
 
-	ret = seq_open(file, &format5_seq_ops);
+	ret = seq_open(file, &format4_seq_ops);
 	if (ret)
 		return ret;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 066/583] crypto: virtio - Wait for tasklet to complete on device remove
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (64 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 065/583] dlm: fix format seq ops type 4 Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 067/583] crypto: sahara - avoid skcipher fallback code duplication Greg Kroah-Hartman
                   ` (523 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, wangyangxin, Gonglei, Herbert Xu,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: wangyangxin <wangyangxin1@huawei.com>

[ Upstream commit 67cc511e8d436456cc98033e6d4ba83ebfc8e672 ]

The scheduled tasklet needs to be executed on device remove.

Fixes: fed93fb62e05 ("crypto: virtio - Handle dataq logic with tasklet")
Signed-off-by: wangyangxin <wangyangxin1@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/virtio/virtio_crypto_core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/crypto/virtio/virtio_crypto_core.c b/drivers/crypto/virtio/virtio_crypto_core.c
index 428d76562447..b909c6a2bf1c 100644
--- a/drivers/crypto/virtio/virtio_crypto_core.c
+++ b/drivers/crypto/virtio/virtio_crypto_core.c
@@ -500,12 +500,15 @@ static void virtcrypto_free_unused_reqs(struct virtio_crypto *vcrypto)
 static void virtcrypto_remove(struct virtio_device *vdev)
 {
 	struct virtio_crypto *vcrypto = vdev->priv;
+	int i;
 
 	dev_info(&vdev->dev, "Start virtcrypto_remove.\n");
 
 	flush_work(&vcrypto->config_work);
 	if (virtcrypto_dev_started(vcrypto))
 		virtcrypto_dev_stop(vcrypto);
+	for (i = 0; i < vcrypto->max_data_queues; i++)
+		tasklet_kill(&vcrypto->data_vq[i].done_task);
 	virtio_reset_device(vdev);
 	virtcrypto_free_unused_reqs(vcrypto);
 	virtcrypto_clear_crypto_engines(vcrypto);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 067/583] crypto: sahara - avoid skcipher fallback code duplication
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (65 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 066/583] crypto: virtio - Wait for tasklet to complete on device remove Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:51 ` [PATCH 6.6 068/583] crypto: sahara - handle zero-length aes requests Greg Kroah-Hartman
                   ` (522 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ovidiu Panait, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ovidiu Panait <ovidiu.panait@windriver.com>

[ Upstream commit 01d70a4bbff20ea05cadb4c208841985a7cc6596 ]

Factor out duplicated skcipher fallback handling code to a helper function
sahara_aes_fallback(). Also, keep a single check if fallback is required in
sahara_aes_crypt().

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Stable-dep-of: d1d6351e37aa ("crypto: sahara - handle zero-length aes requests")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/sahara.c | 85 ++++++++++++-----------------------------
 1 file changed, 25 insertions(+), 60 deletions(-)

diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c
index e86df3c51787..a109f9bdbe04 100644
--- a/drivers/crypto/sahara.c
+++ b/drivers/crypto/sahara.c
@@ -648,12 +648,37 @@ static int sahara_aes_setkey(struct crypto_skcipher *tfm, const u8 *key,
 	return crypto_skcipher_setkey(ctx->fallback, key, keylen);
 }
 
+static int sahara_aes_fallback(struct skcipher_request *req, unsigned long mode)
+{
+	struct sahara_aes_reqctx *rctx = skcipher_request_ctx(req);
+	struct sahara_ctx *ctx = crypto_skcipher_ctx(
+		crypto_skcipher_reqtfm(req));
+
+	skcipher_request_set_tfm(&rctx->fallback_req, ctx->fallback);
+	skcipher_request_set_callback(&rctx->fallback_req,
+				      req->base.flags,
+				      req->base.complete,
+				      req->base.data);
+	skcipher_request_set_crypt(&rctx->fallback_req, req->src,
+				   req->dst, req->cryptlen, req->iv);
+
+	if (mode & FLAGS_ENCRYPT)
+		return crypto_skcipher_encrypt(&rctx->fallback_req);
+
+	return crypto_skcipher_decrypt(&rctx->fallback_req);
+}
+
 static int sahara_aes_crypt(struct skcipher_request *req, unsigned long mode)
 {
 	struct sahara_aes_reqctx *rctx = skcipher_request_ctx(req);
+	struct sahara_ctx *ctx = crypto_skcipher_ctx(
+		crypto_skcipher_reqtfm(req));
 	struct sahara_dev *dev = dev_ptr;
 	int err = 0;
 
+	if (unlikely(ctx->keylen != AES_KEYSIZE_128))
+		return sahara_aes_fallback(req, mode);
+
 	dev_dbg(dev->device, "nbytes: %d, enc: %d, cbc: %d\n",
 		req->cryptlen, !!(mode & FLAGS_ENCRYPT), !!(mode & FLAGS_CBC));
 
@@ -676,81 +701,21 @@ static int sahara_aes_crypt(struct skcipher_request *req, unsigned long mode)
 
 static int sahara_aes_ecb_encrypt(struct skcipher_request *req)
 {
-	struct sahara_aes_reqctx *rctx = skcipher_request_ctx(req);
-	struct sahara_ctx *ctx = crypto_skcipher_ctx(
-		crypto_skcipher_reqtfm(req));
-
-	if (unlikely(ctx->keylen != AES_KEYSIZE_128)) {
-		skcipher_request_set_tfm(&rctx->fallback_req, ctx->fallback);
-		skcipher_request_set_callback(&rctx->fallback_req,
-					      req->base.flags,
-					      req->base.complete,
-					      req->base.data);
-		skcipher_request_set_crypt(&rctx->fallback_req, req->src,
-					   req->dst, req->cryptlen, req->iv);
-		return crypto_skcipher_encrypt(&rctx->fallback_req);
-	}
-
 	return sahara_aes_crypt(req, FLAGS_ENCRYPT);
 }
 
 static int sahara_aes_ecb_decrypt(struct skcipher_request *req)
 {
-	struct sahara_aes_reqctx *rctx = skcipher_request_ctx(req);
-	struct sahara_ctx *ctx = crypto_skcipher_ctx(
-		crypto_skcipher_reqtfm(req));
-
-	if (unlikely(ctx->keylen != AES_KEYSIZE_128)) {
-		skcipher_request_set_tfm(&rctx->fallback_req, ctx->fallback);
-		skcipher_request_set_callback(&rctx->fallback_req,
-					      req->base.flags,
-					      req->base.complete,
-					      req->base.data);
-		skcipher_request_set_crypt(&rctx->fallback_req, req->src,
-					   req->dst, req->cryptlen, req->iv);
-		return crypto_skcipher_decrypt(&rctx->fallback_req);
-	}
-
 	return sahara_aes_crypt(req, 0);
 }
 
 static int sahara_aes_cbc_encrypt(struct skcipher_request *req)
 {
-	struct sahara_aes_reqctx *rctx = skcipher_request_ctx(req);
-	struct sahara_ctx *ctx = crypto_skcipher_ctx(
-		crypto_skcipher_reqtfm(req));
-
-	if (unlikely(ctx->keylen != AES_KEYSIZE_128)) {
-		skcipher_request_set_tfm(&rctx->fallback_req, ctx->fallback);
-		skcipher_request_set_callback(&rctx->fallback_req,
-					      req->base.flags,
-					      req->base.complete,
-					      req->base.data);
-		skcipher_request_set_crypt(&rctx->fallback_req, req->src,
-					   req->dst, req->cryptlen, req->iv);
-		return crypto_skcipher_encrypt(&rctx->fallback_req);
-	}
-
 	return sahara_aes_crypt(req, FLAGS_ENCRYPT | FLAGS_CBC);
 }
 
 static int sahara_aes_cbc_decrypt(struct skcipher_request *req)
 {
-	struct sahara_aes_reqctx *rctx = skcipher_request_ctx(req);
-	struct sahara_ctx *ctx = crypto_skcipher_ctx(
-		crypto_skcipher_reqtfm(req));
-
-	if (unlikely(ctx->keylen != AES_KEYSIZE_128)) {
-		skcipher_request_set_tfm(&rctx->fallback_req, ctx->fallback);
-		skcipher_request_set_callback(&rctx->fallback_req,
-					      req->base.flags,
-					      req->base.complete,
-					      req->base.data);
-		skcipher_request_set_crypt(&rctx->fallback_req, req->src,
-					   req->dst, req->cryptlen, req->iv);
-		return crypto_skcipher_decrypt(&rctx->fallback_req);
-	}
-
 	return sahara_aes_crypt(req, FLAGS_CBC);
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 068/583] crypto: sahara - handle zero-length aes requests
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (66 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 067/583] crypto: sahara - avoid skcipher fallback code duplication Greg Kroah-Hartman
@ 2024-01-22 23:51 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 069/583] crypto: sahara - fix ahash reqsize Greg Kroah-Hartman
                   ` (521 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:51 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ovidiu Panait, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ovidiu Panait <ovidiu.panait@windriver.com>

[ Upstream commit d1d6351e37aac14b32a291731d0855996c459d11 ]

In case of a zero-length input, exit gracefully from sahara_aes_crypt().

Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/sahara.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c
index a109f9bdbe04..96f59d57c36b 100644
--- a/drivers/crypto/sahara.c
+++ b/drivers/crypto/sahara.c
@@ -676,6 +676,9 @@ static int sahara_aes_crypt(struct skcipher_request *req, unsigned long mode)
 	struct sahara_dev *dev = dev_ptr;
 	int err = 0;
 
+	if (!req->cryptlen)
+		return 0;
+
 	if (unlikely(ctx->keylen != AES_KEYSIZE_128))
 		return sahara_aes_fallback(req, mode);
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 069/583] crypto: sahara - fix ahash reqsize
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (67 preceding siblings ...)
  2024-01-22 23:51 ` [PATCH 6.6 068/583] crypto: sahara - handle zero-length aes requests Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 070/583] crypto: sahara - fix wait_for_completion_timeout() error handling Greg Kroah-Hartman
                   ` (520 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ovidiu Panait, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ovidiu Panait <ovidiu.panait@windriver.com>

[ Upstream commit efcb50f41740ac55e6ccc4986c1a7740e21c62b4 ]

Set the reqsize for sha algorithms to sizeof(struct sahara_sha_reqctx), the
extra space is not needed.

Fixes: 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/sahara.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c
index 96f59d57c36b..80d419d6a609 100644
--- a/drivers/crypto/sahara.c
+++ b/drivers/crypto/sahara.c
@@ -1162,8 +1162,7 @@ static int sahara_sha_import(struct ahash_request *req, const void *in)
 static int sahara_sha_cra_init(struct crypto_tfm *tfm)
 {
 	crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
-				 sizeof(struct sahara_sha_reqctx) +
-				 SHA_BUFFER_LEN + SHA256_BLOCK_SIZE);
+				 sizeof(struct sahara_sha_reqctx));
 
 	return 0;
 }
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 070/583] crypto: sahara - fix wait_for_completion_timeout() error handling
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (68 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 069/583] crypto: sahara - fix ahash reqsize Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 071/583] crypto: sahara - improve error handling in sahara_sha_process() Greg Kroah-Hartman
                   ` (519 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ovidiu Panait, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ovidiu Panait <ovidiu.panait@windriver.com>

[ Upstream commit 2dba8e1d1a7957dcbe7888846268538847b471d1 ]

The sg lists are not unmapped in case of timeout errors. Fix this.

Fixes: 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256")
Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/sahara.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c
index 80d419d6a609..86ff5add2e15 100644
--- a/drivers/crypto/sahara.c
+++ b/drivers/crypto/sahara.c
@@ -607,16 +607,17 @@ static int sahara_aes_process(struct skcipher_request *req)
 
 	timeout = wait_for_completion_timeout(&dev->dma_completion,
 				msecs_to_jiffies(SAHARA_TIMEOUT_MS));
-	if (!timeout) {
-		dev_err(dev->device, "AES timeout\n");
-		return -ETIMEDOUT;
-	}
 
 	dma_unmap_sg(dev->device, dev->out_sg, dev->nb_out_sg,
 		DMA_FROM_DEVICE);
 	dma_unmap_sg(dev->device, dev->in_sg, dev->nb_in_sg,
 		DMA_TO_DEVICE);
 
+	if (!timeout) {
+		dev_err(dev->device, "AES timeout\n");
+		return -ETIMEDOUT;
+	}
+
 	if ((dev->flags & FLAGS_CBC) && req->iv)
 		sahara_aes_cbc_update_iv(req);
 
@@ -1007,15 +1008,16 @@ static int sahara_sha_process(struct ahash_request *req)
 
 	timeout = wait_for_completion_timeout(&dev->dma_completion,
 				msecs_to_jiffies(SAHARA_TIMEOUT_MS));
-	if (!timeout) {
-		dev_err(dev->device, "SHA timeout\n");
-		return -ETIMEDOUT;
-	}
 
 	if (rctx->sg_in_idx)
 		dma_unmap_sg(dev->device, dev->in_sg, dev->nb_in_sg,
 			     DMA_TO_DEVICE);
 
+	if (!timeout) {
+		dev_err(dev->device, "SHA timeout\n");
+		return -ETIMEDOUT;
+	}
+
 	memcpy(rctx->context, dev->context_base, rctx->context_size);
 
 	if (req->result && rctx->last)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 071/583] crypto: sahara - improve error handling in sahara_sha_process()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (69 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 070/583] crypto: sahara - fix wait_for_completion_timeout() error handling Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 072/583] crypto: sahara - fix processing hash requests with req->nbytes < sg->length Greg Kroah-Hartman
                   ` (518 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ovidiu Panait, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ovidiu Panait <ovidiu.panait@windriver.com>

[ Upstream commit 5deff027fca49a1eb3b20359333cf2ae562a2343 ]

sahara_sha_hw_data_descriptor_create() returns negative error codes on
failure, so make sure the errors are correctly handled / propagated.

Fixes: 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/sahara.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c
index 86ff5add2e15..117aa4296c2a 100644
--- a/drivers/crypto/sahara.c
+++ b/drivers/crypto/sahara.c
@@ -987,7 +987,10 @@ static int sahara_sha_process(struct ahash_request *req)
 		return ret;
 
 	if (rctx->first) {
-		sahara_sha_hw_data_descriptor_create(dev, rctx, req, 0);
+		ret = sahara_sha_hw_data_descriptor_create(dev, rctx, req, 0);
+		if (ret)
+			return ret;
+
 		dev->hw_desc[0]->next = 0;
 		rctx->first = 0;
 	} else {
@@ -995,7 +998,10 @@ static int sahara_sha_process(struct ahash_request *req)
 
 		sahara_sha_hw_context_descriptor_create(dev, rctx, req, 0);
 		dev->hw_desc[0]->next = dev->hw_phys_desc[1];
-		sahara_sha_hw_data_descriptor_create(dev, rctx, req, 1);
+		ret = sahara_sha_hw_data_descriptor_create(dev, rctx, req, 1);
+		if (ret)
+			return ret;
+
 		dev->hw_desc[1]->next = 0;
 	}
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 072/583] crypto: sahara - fix processing hash requests with req->nbytes < sg->length
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (70 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 071/583] crypto: sahara - improve error handling in sahara_sha_process() Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 073/583] crypto: sahara - do not resize req->src when doing hash operations Greg Kroah-Hartman
                   ` (517 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ovidiu Panait, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ovidiu Panait <ovidiu.panait@windriver.com>

[ Upstream commit 7bafa74d1ba35dcc173e1ce915e983d65905f77e ]

It's not always the case that the entire sg entry needs to be processed.
Currently, when nbytes is less than sg->length, "Descriptor length" errors
are encountered.

To fix this, take the actual request size into account when populating the
hw links.

Fixes: 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/sahara.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c
index 117aa4296c2a..477b4d8b450d 100644
--- a/drivers/crypto/sahara.c
+++ b/drivers/crypto/sahara.c
@@ -776,6 +776,7 @@ static int sahara_sha_hw_links_create(struct sahara_dev *dev,
 				       int start)
 {
 	struct scatterlist *sg;
+	unsigned int len;
 	unsigned int i;
 	int ret;
 
@@ -797,12 +798,14 @@ static int sahara_sha_hw_links_create(struct sahara_dev *dev,
 	if (!ret)
 		return -EFAULT;
 
+	len = rctx->total;
 	for (i = start; i < dev->nb_in_sg + start; i++) {
-		dev->hw_link[i]->len = sg->length;
+		dev->hw_link[i]->len = min(len, sg->length);
 		dev->hw_link[i]->p = sg->dma_address;
 		if (i == (dev->nb_in_sg + start - 1)) {
 			dev->hw_link[i]->next = 0;
 		} else {
+			len -= min(len, sg->length);
 			dev->hw_link[i]->next = dev->hw_phys_link[i + 1];
 			sg = sg_next(sg);
 		}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 073/583] crypto: sahara - do not resize req->src when doing hash operations
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (71 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 072/583] crypto: sahara - fix processing hash requests with req->nbytes < sg->length Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 074/583] crypto: scomp - fix req->dst buffer overflow Greg Kroah-Hartman
                   ` (516 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ovidiu Panait, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ovidiu Panait <ovidiu.panait@windriver.com>

[ Upstream commit a3c6f4f4d249cecaf2f34471aadbfb4f4ef57298 ]

When testing sahara sha256 speed performance with tcrypt (mode=404) on
imx53-qsrb board, multiple "Invalid numbers of src SG." errors are
reported. This was traced to sahara_walk_and_recalc() resizing req->src
and causing the subsequent dma_map_sg() call to fail.

Now that the previous commit fixed sahara_sha_hw_links_create() to take
into account the actual request size, rather than relying on sg->length
values, the resize operation is no longer necessary.

Therefore, remove sahara_walk_and_recalc() and simplify associated logic.

Fixes: 5a2bb93f5992 ("crypto: sahara - add support for SHA1/256")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/crypto/sahara.c | 38 ++------------------------------------
 1 file changed, 2 insertions(+), 36 deletions(-)

diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c
index 477b4d8b450d..8e84dd98a273 100644
--- a/drivers/crypto/sahara.c
+++ b/drivers/crypto/sahara.c
@@ -886,24 +886,6 @@ static int sahara_sha_hw_context_descriptor_create(struct sahara_dev *dev,
 	return 0;
 }
 
-static int sahara_walk_and_recalc(struct scatterlist *sg, unsigned int nbytes)
-{
-	if (!sg || !sg->length)
-		return nbytes;
-
-	while (nbytes && sg) {
-		if (nbytes <= sg->length) {
-			sg->length = nbytes;
-			sg_mark_end(sg);
-			break;
-		}
-		nbytes -= sg->length;
-		sg = sg_next(sg);
-	}
-
-	return nbytes;
-}
-
 static int sahara_sha_prepare_request(struct ahash_request *req)
 {
 	struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
@@ -940,36 +922,20 @@ static int sahara_sha_prepare_request(struct ahash_request *req)
 					hash_later, 0);
 	}
 
-	/* nbytes should now be multiple of blocksize */
-	req->nbytes = req->nbytes - hash_later;
-
-	sahara_walk_and_recalc(req->src, req->nbytes);
-
+	rctx->total = len - hash_later;
 	/* have data from previous operation and current */
 	if (rctx->buf_cnt && req->nbytes) {
 		sg_init_table(rctx->in_sg_chain, 2);
 		sg_set_buf(rctx->in_sg_chain, rctx->rembuf, rctx->buf_cnt);
-
 		sg_chain(rctx->in_sg_chain, 2, req->src);
-
-		rctx->total = req->nbytes + rctx->buf_cnt;
 		rctx->in_sg = rctx->in_sg_chain;
-
-		req->src = rctx->in_sg_chain;
 	/* only data from previous operation */
 	} else if (rctx->buf_cnt) {
-		if (req->src)
-			rctx->in_sg = req->src;
-		else
-			rctx->in_sg = rctx->in_sg_chain;
-		/* buf was copied into rembuf above */
+		rctx->in_sg = rctx->in_sg_chain;
 		sg_init_one(rctx->in_sg, rctx->rembuf, rctx->buf_cnt);
-		rctx->total = rctx->buf_cnt;
 	/* no data from previous operation */
 	} else {
 		rctx->in_sg = req->src;
-		rctx->total = req->nbytes;
-		req->src = rctx->in_sg;
 	}
 
 	/* on next call, we only have the remaining data in the buffer */
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 074/583] crypto: scomp - fix req->dst buffer overflow
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (72 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 073/583] crypto: sahara - do not resize req->src when doing hash operations Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 075/583] csky: fix arch_jump_label_transform_static override Greg Kroah-Hartman
                   ` (515 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, syzbot+3eff5e51bf1db122a16e,
	Chengming Zhou, Barry Song, Herbert Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chengming Zhou <zhouchengming@bytedance.com>

[ Upstream commit 744e1885922a9943458954cfea917b31064b4131 ]

The req->dst buffer size should be checked before copying from the
scomp_scratch->dst to avoid req->dst buffer overflow problem.

Fixes: 1ab53a77b772 ("crypto: acomp - add driver-side scomp interface")
Reported-by: syzbot+3eff5e51bf1db122a16e@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/0000000000000b05cd060d6b5511@google.com/
Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Reviewed-by: Barry Song <v-songbaohua@oppo.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 crypto/scompress.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/crypto/scompress.c b/crypto/scompress.c
index 442a82c9de7d..b108a30a7600 100644
--- a/crypto/scompress.c
+++ b/crypto/scompress.c
@@ -117,6 +117,7 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir)
 	struct crypto_scomp *scomp = *tfm_ctx;
 	void **ctx = acomp_request_ctx(req);
 	struct scomp_scratch *scratch;
+	unsigned int dlen;
 	int ret;
 
 	if (!req->src || !req->slen || req->slen > SCOMP_SCRATCH_SIZE)
@@ -128,6 +129,8 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir)
 	if (!req->dlen || req->dlen > SCOMP_SCRATCH_SIZE)
 		req->dlen = SCOMP_SCRATCH_SIZE;
 
+	dlen = req->dlen;
+
 	scratch = raw_cpu_ptr(&scomp_scratch);
 	spin_lock(&scratch->lock);
 
@@ -145,6 +148,9 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir)
 				ret = -ENOMEM;
 				goto out;
 			}
+		} else if (req->dlen > dlen) {
+			ret = -ENOSPC;
+			goto out;
 		}
 		scatterwalk_map_and_copy(scratch->dst, req->dst, 0, req->dlen,
 					 1);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 075/583] csky: fix arch_jump_label_transform_static override
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (73 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 074/583] crypto: scomp - fix req->dst buffer overflow Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 076/583] blocklayoutdriver: Fix reference leak of pnfs_device_node Greg Kroah-Hartman
                   ` (514 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Guo Ren, Arnd Bergmann, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnd Bergmann <arnd@arndb.de>

[ Upstream commit ca8e45c8048a2c9503c74751d25414601f730580 ]

The arch_jump_label_transform_static() function in csky was originally meant to
override the generic __weak function, but that got changed to an #ifndef check.

This showed up as a missing-prototype warning:
arch/csky/kernel/jump_label.c:43:6: error: no previous prototype for 'arch_jump_label_transform_static' [-Werror=missing-prototypes]

Change the method to use the new method of having a #define and a prototype
for the global function.

Fixes: 7e6b9db27de9 ("jump_label: make initial NOP patching the special case")
Fixes: 4e8bb4ba5a55 ("csky: Add jump-label implementation")
Reviewed-by: Guo Ren <guoren@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/csky/include/asm/jump_label.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/csky/include/asm/jump_label.h b/arch/csky/include/asm/jump_label.h
index d488ba6084bc..98a3f4b168bd 100644
--- a/arch/csky/include/asm/jump_label.h
+++ b/arch/csky/include/asm/jump_label.h
@@ -43,5 +43,10 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key,
 	return true;
 }
 
+enum jump_label_type;
+void arch_jump_label_transform_static(struct jump_entry *entry,
+				      enum jump_label_type type);
+#define arch_jump_label_transform_static arch_jump_label_transform_static
+
 #endif  /* __ASSEMBLY__ */
 #endif	/* __ASM_CSKY_JUMP_LABEL_H */
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 076/583] blocklayoutdriver: Fix reference leak of pnfs_device_node
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (74 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 075/583] csky: fix arch_jump_label_transform_static override Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 077/583] NFS: Use parents objective cred in nfs_access_login_time() Greg Kroah-Hartman
                   ` (513 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Benjamin Coddington, Anna Schumaker,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Benjamin Coddington <bcodding@redhat.com>

[ Upstream commit 1530827b90025cdf80c9b0d07a166d045a0a7b81 ]

The error path for blocklayout's device lookup is missing a reference drop
for the case where a lookup finds the device, but the device is marked with
NFS_DEVICEID_UNAVAILABLE.

Fixes: b3dce6a2f060 ("pnfs/blocklayout: handle transient devices")
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/nfs/blocklayout/blocklayout.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
index 943aeea1eb16..1d1d7abc3205 100644
--- a/fs/nfs/blocklayout/blocklayout.c
+++ b/fs/nfs/blocklayout/blocklayout.c
@@ -580,6 +580,8 @@ bl_find_get_deviceid(struct nfs_server *server,
 		nfs4_delete_deviceid(node->ld, node->nfs_client, id);
 		goto retry;
 	}
+
+	nfs4_put_deviceid_node(node);
 	return ERR_PTR(-ENODEV);
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 077/583] NFS: Use parents objective cred in nfs_access_login_time()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (75 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 076/583] blocklayoutdriver: Fix reference leak of pnfs_device_node Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 078/583] NFSv4.1/pnfs: Ensure we handle the error NFS4ERR_RETURNCONFLICT Greg Kroah-Hartman
                   ` (512 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Scott Mayhew, Anna Schumaker, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Scott Mayhew <smayhew@redhat.com>

[ Upstream commit a10a9233073d984b239e22358ba21825e27e2e88 ]

The subjective cred (task->cred) can potentially be overridden and
subsquently freed in non-RCU context, which could lead to a panic if we
try to use it in cred_fscmp().  Use __task_cred(), which returns the
objective cred (task->real_cred) instead.

Fixes: 0eb43812c027 ("NFS: Clear the file access cache upon login")
Fixes: 5e9a7b9c2ea1 ("NFS: Fix up a sparse warning")

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/nfs/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index e6a51fd94fea..9fc5061d51b2 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -2968,7 +2968,7 @@ static u64 nfs_access_login_time(const struct task_struct *task,
 	rcu_read_lock();
 	for (;;) {
 		parent = rcu_dereference(task->real_parent);
-		pcred = rcu_dereference(parent->cred);
+		pcred = __task_cred(parent);
 		if (parent == task || cred_fscmp(pcred, cred) != 0)
 			break;
 		task = parent;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 078/583] NFSv4.1/pnfs: Ensure we handle the error NFS4ERR_RETURNCONFLICT
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (76 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 077/583] NFS: Use parents objective cred in nfs_access_login_time() Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 079/583] SUNRPC: fix _xprt_switch_find_current_entry logic Greg Kroah-Hartman
                   ` (511 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Trond Myklebust, Anna Schumaker,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Trond Myklebust <trond.myklebust@hammerspace.com>

[ Upstream commit 037e56a22ff37f9a9c2330b66cff55d3d1ff9b90 ]

Once the client has processed the CB_LAYOUTRECALL, but has not yet
successfully returned the layout, the server is supposed to switch to
returning NFS4ERR_RETURNCONFLICT. This patch ensures that we handle
that return value correctly.

Fixes: 183d9e7b112a ("pnfs: rework LAYOUTGET retry handling")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/nfs/nfs4proc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 0ff913b4e9e0..e8b52e36906c 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -170,6 +170,7 @@ static int nfs4_map_errors(int err)
 	case -NFS4ERR_RESOURCE:
 	case -NFS4ERR_LAYOUTTRYLATER:
 	case -NFS4ERR_RECALLCONFLICT:
+	case -NFS4ERR_RETURNCONFLICT:
 		return -EREMOTEIO;
 	case -NFS4ERR_WRONGSEC:
 	case -NFS4ERR_WRONG_CRED:
@@ -558,6 +559,7 @@ static int nfs4_do_handle_exception(struct nfs_server *server,
 		case -NFS4ERR_GRACE:
 		case -NFS4ERR_LAYOUTTRYLATER:
 		case -NFS4ERR_RECALLCONFLICT:
+		case -NFS4ERR_RETURNCONFLICT:
 			exception->delay = 1;
 			return 0;
 
@@ -9662,6 +9664,7 @@ nfs4_layoutget_handle_exception(struct rpc_task *task,
 		status = -EBUSY;
 		break;
 	case -NFS4ERR_RECALLCONFLICT:
+	case -NFS4ERR_RETURNCONFLICT:
 		status = -ERECALLCONFLICT;
 		break;
 	case -NFS4ERR_DELEG_REVOKED:
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 079/583] SUNRPC: fix _xprt_switch_find_current_entry logic
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (77 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 078/583] NFSv4.1/pnfs: Ensure we handle the error NFS4ERR_RETURNCONFLICT Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 080/583] pNFS: Fix the pnfs block drivers calculation of layoutget size Greg Kroah-Hartman
                   ` (510 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Olga Kornievskaia, Anna Schumaker,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Olga Kornievskaia <kolga@netapp.com>

[ Upstream commit 98b4e5137504a5bd9346562b1310cdc13486603b ]

Fix the logic for picking current transport entry.

Fixes: 95d0d30c66b8 ("SUNRPC create an iterator to list only OFFLINE xprts")
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/sunrpc/xprtmultipath.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sunrpc/xprtmultipath.c b/net/sunrpc/xprtmultipath.c
index 701250b305db..74ee2271251e 100644
--- a/net/sunrpc/xprtmultipath.c
+++ b/net/sunrpc/xprtmultipath.c
@@ -284,7 +284,7 @@ struct rpc_xprt *_xprt_switch_find_current_entry(struct list_head *head,
 		if (cur == pos)
 			found = true;
 		if (found && ((find_active && xprt_is_active(pos)) ||
-			      (!find_active && xprt_is_active(pos))))
+			      (!find_active && !xprt_is_active(pos))))
 			return pos;
 	}
 	return NULL;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 080/583] pNFS: Fix the pnfs block drivers calculation of layoutget size
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (78 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 079/583] SUNRPC: fix _xprt_switch_find_current_entry logic Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 081/583] asm-generic: Fix 32 bit __generic_cmpxchg_local Greg Kroah-Hartman
                   ` (509 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Benjamin Coddington,
	Trond Myklebust, Christoph Hellwig, Anna Schumaker, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Trond Myklebust <trond.myklebust@hammerspace.com>

[ Upstream commit 8a6291bf3b0eae1bf26621e6419a91682f2d6227 ]

Instead of relying on the value of the 'bytes_left' field, we should
calculate the layout size based on the offset of the request that is
being written out.

Reported-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Fixes: 954998b60caa ("NFS: Fix error handling for O_DIRECT write scheduling")
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Tested-by: Benjamin Coddington <bcodding@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/nfs/blocklayout/blocklayout.c | 5 ++---
 fs/nfs/direct.c                  | 5 +++--
 fs/nfs/internal.h                | 2 +-
 fs/nfs/pnfs.c                    | 3 ++-
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
index 1d1d7abc3205..6be13e0ec170 100644
--- a/fs/nfs/blocklayout/blocklayout.c
+++ b/fs/nfs/blocklayout/blocklayout.c
@@ -895,10 +895,9 @@ bl_pg_init_write(struct nfs_pageio_descriptor *pgio, struct nfs_page *req)
 	}
 
 	if (pgio->pg_dreq == NULL)
-		wb_size = pnfs_num_cont_bytes(pgio->pg_inode,
-					      req->wb_index);
+		wb_size = pnfs_num_cont_bytes(pgio->pg_inode, req->wb_index);
 	else
-		wb_size = nfs_dreq_bytes_left(pgio->pg_dreq);
+		wb_size = nfs_dreq_bytes_left(pgio->pg_dreq, req_offset(req));
 
 	pnfs_generic_pg_init_write(pgio, req, wb_size);
 
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index f6c74f424691..5918c67dae0d 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -205,9 +205,10 @@ static void nfs_direct_req_release(struct nfs_direct_req *dreq)
 	kref_put(&dreq->kref, nfs_direct_req_free);
 }
 
-ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq)
+ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq, loff_t offset)
 {
-	return dreq->bytes_left;
+	loff_t start = offset - dreq->io_start;
+	return dreq->max_count - start;
 }
 EXPORT_SYMBOL_GPL(nfs_dreq_bytes_left);
 
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 9c9cf764f600..b1fa81c9dff6 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -655,7 +655,7 @@ extern int nfs_sillyrename(struct inode *dir, struct dentry *dentry);
 /* direct.c */
 void nfs_init_cinfo_from_dreq(struct nfs_commit_info *cinfo,
 			      struct nfs_direct_req *dreq);
-extern ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq);
+extern ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq, loff_t offset);
 
 /* nfs4proc.c */
 extern struct nfs_client *nfs4_init_client(struct nfs_client *clp,
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 84343aefbbd6..9084f156d67b 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -2729,7 +2729,8 @@ pnfs_generic_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *r
 		if (pgio->pg_dreq == NULL)
 			rd_size = i_size_read(pgio->pg_inode) - req_offset(req);
 		else
-			rd_size = nfs_dreq_bytes_left(pgio->pg_dreq);
+			rd_size = nfs_dreq_bytes_left(pgio->pg_dreq,
+						      req_offset(req));
 
 		pgio->pg_lseg =
 			pnfs_update_layout(pgio->pg_inode, nfs_req_openctx(req),
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 081/583] asm-generic: Fix 32 bit __generic_cmpxchg_local
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (79 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 080/583] pNFS: Fix the pnfs block drivers calculation of layoutget size Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 082/583] arm64: dts: qcom: qrb4210-rb2: dont force usb peripheral mode Greg Kroah-Hartman
                   ` (508 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, David McKay, Stuart Menefy,
	Arnd Bergmann, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: David McKay <david.mckay@codasip.com>

[ Upstream commit d93cca2f3109f88c94a32d3322ec8b2854a9c339 ]

Commit 656e9007ef58 ("asm-generic: avoid __generic_cmpxchg_local
warnings") introduced a typo that means the code is incorrect for 32 bit
values. It will work fine for postive numbers, but will fail for
negative numbers on a system where longs are 64 bit.

Fixes: 656e9007ef58 ("asm-generic: avoid __generic_cmpxchg_local warnings")
Signed-off-by: David McKay <david.mckay@codasip.com>
Signed-off-by: Stuart Menefy <stuart.menefy@codasip.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/asm-generic/cmpxchg-local.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/asm-generic/cmpxchg-local.h b/include/asm-generic/cmpxchg-local.h
index 3df9f59a544e..f27d66fdc00a 100644
--- a/include/asm-generic/cmpxchg-local.h
+++ b/include/asm-generic/cmpxchg-local.h
@@ -34,7 +34,7 @@ static inline unsigned long __generic_cmpxchg_local(volatile void *ptr,
 			*(u16 *)ptr = (new & 0xffffu);
 		break;
 	case 4: prev = *(u32 *)ptr;
-		if (prev == (old & 0xffffffffffu))
+		if (prev == (old & 0xffffffffu))
 			*(u32 *)ptr = (new & 0xffffffffu);
 		break;
 	case 8: prev = *(u64 *)ptr;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 082/583] arm64: dts: qcom: qrb4210-rb2: dont force usb peripheral mode
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (80 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 081/583] asm-generic: Fix 32 bit __generic_cmpxchg_local Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 083/583] arm64: dts: qcom: sc8280xp-x13s: Use the correct DP PHY compatible Greg Kroah-Hartman
                   ` (507 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Caleb Connolly, Vladimir Zapolskiy,
	Konrad Dybcio, Bryan ODonoghue, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Caleb Connolly <caleb.connolly@linaro.org>

[ Upstream commit 27c2ca90e2f34cd3c4849af996e1a96a69e700d3 ]

The rb2 only has a single USB controller, it can be switched between a
type-c port and an internal USB hub via a DIP switch. Until dynamic
role switching is available it's preferable to put the USB controller
in host mode so that the type-A ports and ethernet are available.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Fixes: eaa53a85748d ("arm64: dts: qcom: qrb4210-rb2: Enable USB node")
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Link: https://lore.kernel.org/r/20231010-caleb-rb2-host-mode-v1-1-b057d443cd62@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
index a7278a9472ed..9738c0dacd58 100644
--- a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
+++ b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
@@ -518,7 +518,6 @@ &usb {
 
 &usb_dwc3 {
 	maximum-speed = "super-speed";
-	dr_mode = "peripheral";
 };
 
 &usb_hsphy {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 083/583] arm64: dts: qcom: sc8280xp-x13s: Use the correct DP PHY compatible
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (81 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 082/583] arm64: dts: qcom: qrb4210-rb2: dont force usb peripheral mode Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 084/583] arm64: dts: qcom: sc8280xp-x13s: add missing camera LED pin config Greg Kroah-Hartman
                   ` (506 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Konrad Dybcio <konrad.dybcio@linaro.org>

[ Upstream commit 0cd080dd6d08817c9980d2069197b066636b0f23 ]

The DP PHY needs different settings when an eDP display is used.
Make sure these apply on the X13s.

FWIW
I could not notice any user-facing change stemming from this commit.

Fixes: f48c70b111b4 ("arm64: dts: qcom: sc8280xp-x13s: enable eDP display")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20230929-topic-x13s_edpphy-v1-1-ce59f9eb4226@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
index 38edaf51aa34..6a4c6cc19c09 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
@@ -601,6 +601,7 @@ mdss0_dp3_out: endpoint {
 };
 
 &mdss0_dp3_phy {
+	compatible = "qcom,sc8280xp-edp-phy";
 	vdda-phy-supply = <&vreg_l6b>;
 	vdda-pll-supply = <&vreg_l3b>;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 084/583] arm64: dts: qcom: sc8280xp-x13s: add missing camera LED pin config
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (82 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 083/583] arm64: dts: qcom: sc8280xp-x13s: Use the correct DP PHY compatible Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 085/583] ARM: dts: qcom: msm8226: provide dsi phy clocks to mmcc Greg Kroah-Hartman
                   ` (505 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Johan Hovold,
	Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Johan Hovold <johan+linaro@kernel.org>

[ Upstream commit a3457cc5bc30ad053c90ae9f14e9b7723d204a98 ]

Add the missing pin configuration for the recently added camera
indicator LED.

Fixes: 1c63dd1c5fda ("arm64: dts: qcom: sc8280xp-x13s: Add camera activity LED")
Cc: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20231003093647.3840-1-johan+linaro@kernel.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts    | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
index 6a4c6cc19c09..f2055899ae7a 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
@@ -82,6 +82,9 @@ switch-lid {
 	leds {
 		compatible = "gpio-leds";
 
+		pinctrl-names = "default";
+		pinctrl-0 = <&cam_indicator_en>;
+
 		led-camera-indicator {
 			label = "white:camera-indicator";
 			function = LED_FUNCTION_INDICATOR;
@@ -1278,6 +1281,13 @@ hstp-sw-ctrl-pins {
 		};
 	};
 
+	cam_indicator_en: cam-indicator-en-state {
+		pins = "gpio28";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
 	edp_reg_en: edp-reg-en-state {
 		pins = "gpio25";
 		function = "gpio";
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 085/583] ARM: dts: qcom: msm8226: provide dsi phy clocks to mmcc
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (83 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 084/583] arm64: dts: qcom: sc8280xp-x13s: add missing camera LED pin config Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 086/583] wifi: plfxlc: check for allocation failure in plfxlc_usb_wreq_async() Greg Kroah-Hartman
                   ` (504 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Luca Weiss, Dmitry Baryshkov,
	Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Luca Weiss <luca@z3ntu.xyz>

[ Upstream commit 836d083524888069cd358776a4e6c4ceec04962e ]

Some mmcc clocks have dsi0pll & dsi0pllbyte as clock parents so we
should provide them in the dt, which I missed in the commit adding the
mdss nodes.

Fixes: d5fb01ad5eb4 ("ARM: dts: qcom: msm8226: Add mdss nodes")
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20230712-msm8226-dsi-clock-fixup-v1-1-71010b0b89ca@z3ntu.xyz
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/boot/dts/qcom/qcom-msm8226.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi b/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi
index 44f3f0127fd7..78738371f634 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi
@@ -404,8 +404,8 @@ mmcc: clock-controller@fd8c0000 {
 				 <&gcc GPLL0_VOTE>,
 				 <&gcc GPLL1_VOTE>,
 				 <&rpmcc RPM_SMD_GFX3D_CLK_SRC>,
-				 <0>,
-				 <0>;
+				 <&mdss_dsi0_phy 1>,
+				 <&mdss_dsi0_phy 0>;
 			clock-names = "xo",
 				      "mmss_gpll0_vote",
 				      "gpll0_vote",
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 086/583] wifi: plfxlc: check for allocation failure in plfxlc_usb_wreq_async()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (84 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 085/583] ARM: dts: qcom: msm8226: provide dsi phy clocks to mmcc Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 087/583] wifi: rtw88: fix RX filter in FIF_ALLMULTI flag Greg Kroah-Hartman
                   ` (503 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Dan Carpenter, Kalle Valo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dan Carpenter <dan.carpenter@linaro.org>

[ Upstream commit 40018a8fa9aa63ca5b26e803502138158fb0ff96 ]

Check for if the usb_alloc_urb() failed.

Fixes: 68d57a07bfe5 ("wireless: add plfxlc driver for pureLiFi X, XL, XC devices")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/e8d4a19a-f251-4101-a89b-607345e938cb@moroto.mountain
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/purelifi/plfxlc/usb.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/purelifi/plfxlc/usb.c b/drivers/net/wireless/purelifi/plfxlc/usb.c
index 76d0a778636a..311676c1ece0 100644
--- a/drivers/net/wireless/purelifi/plfxlc/usb.c
+++ b/drivers/net/wireless/purelifi/plfxlc/usb.c
@@ -493,9 +493,12 @@ int plfxlc_usb_wreq_async(struct plfxlc_usb *usb, const u8 *buffer,
 			  void *context)
 {
 	struct usb_device *udev = interface_to_usbdev(usb->ez_usb);
-	struct urb *urb = usb_alloc_urb(0, GFP_ATOMIC);
+	struct urb *urb;
 	int r;
 
+	urb = usb_alloc_urb(0, GFP_ATOMIC);
+	if (!urb)
+		return -ENOMEM;
 	usb_fill_bulk_urb(urb, udev, usb_sndbulkpipe(udev, EP_DATA_OUT),
 			  (void *)buffer, buffer_len, complete_fn, context);
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 087/583] wifi: rtw88: fix RX filter in FIF_ALLMULTI flag
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (85 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 086/583] wifi: plfxlc: check for allocation failure in plfxlc_usb_wreq_async() Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 088/583] bpf, lpm: Fix check prefixlen before walking trie Greg Kroah-Hartman
                   ` (502 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chih-Kang Chang, Ping-Ke Shih,
	Kalle Valo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chih-Kang Chang <gary.chang@realtek.com>

[ Upstream commit 53ee0b3b99edc6a47096bffef15695f5a895386f ]

The broadcast packets will be filtered in the FIF_ALLMULTI flag in
the original code, which causes beacon packets to be filtered out
and disconnection. Therefore, we fix it.

Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231103020851.102238-1-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/realtek/rtw88/mac80211.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c
index a99b53d44267..d8d68f16014e 100644
--- a/drivers/net/wireless/realtek/rtw88/mac80211.c
+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
@@ -280,9 +280,9 @@ static void rtw_ops_configure_filter(struct ieee80211_hw *hw,
 
 	if (changed_flags & FIF_ALLMULTI) {
 		if (*new_flags & FIF_ALLMULTI)
-			rtwdev->hal.rcr |= BIT_AM | BIT_AB;
+			rtwdev->hal.rcr |= BIT_AM;
 		else
-			rtwdev->hal.rcr &= ~(BIT_AM | BIT_AB);
+			rtwdev->hal.rcr &= ~(BIT_AM);
 	}
 	if (changed_flags & FIF_FCSFAIL) {
 		if (*new_flags & FIF_FCSFAIL)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 088/583] bpf, lpm: Fix check prefixlen before walking trie
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (86 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 087/583] wifi: rtw88: fix RX filter in FIF_ALLMULTI flag Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 089/583] bpf: Add crosstask check to __bpf_get_stack Greg Kroah-Hartman
                   ` (501 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Florian Lehner, Andrii Nakryiko,
	Alexei Starovoitov, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Florian Lehner <dev@der-flo.net>

[ Upstream commit 9b75dbeb36fcd9fc7ed51d370310d0518a387769 ]

When looking up an element in LPM trie, the condition 'matchlen ==
trie->max_prefixlen' will never return true, if key->prefixlen is larger
than trie->max_prefixlen. Consequently all elements in the LPM trie will
be visited and no element is returned in the end.

To resolve this, check key->prefixlen first before walking the LPM trie.

Fixes: b95a5c4db09b ("bpf: add a longest prefix match trie map implementation")
Signed-off-by: Florian Lehner <dev@der-flo.net>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20231105085801.3742-1-dev@der-flo.net
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/lpm_trie.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/bpf/lpm_trie.c b/kernel/bpf/lpm_trie.c
index 17c7e7782a1f..b32be680da6c 100644
--- a/kernel/bpf/lpm_trie.c
+++ b/kernel/bpf/lpm_trie.c
@@ -231,6 +231,9 @@ static void *trie_lookup_elem(struct bpf_map *map, void *_key)
 	struct lpm_trie_node *node, *found = NULL;
 	struct bpf_lpm_trie_key *key = _key;
 
+	if (key->prefixlen > trie->max_prefixlen)
+		return NULL;
+
 	/* Start walking the trie from the root node ... */
 
 	for (node = rcu_dereference_check(trie->root, rcu_read_lock_bh_held());
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 089/583] bpf: Add crosstask check to __bpf_get_stack
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (87 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 088/583] bpf, lpm: Fix check prefixlen before walking trie Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 090/583] wifi: ath11k: Defer on rproc_get failure Greg Kroah-Hartman
                   ` (500 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jordan Rome, Andrii Nakryiko, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jordan Rome <jordalgo@meta.com>

[ Upstream commit b8e3a87a627b575896e448021e5c2f8a3bc19931 ]

Currently get_perf_callchain only supports user stack walking for
the current task. Passing the correct *crosstask* param will return
0 frames if the task passed to __bpf_get_stack isn't the current
one instead of a single incorrect frame/address. This change
passes the correct *crosstask* param but also does a preemptive
check in __bpf_get_stack if the task is current and returns
-EOPNOTSUPP if it is not.

This issue was found using bpf_get_task_stack inside a BPF
iterator ("iter/task"), which iterates over all tasks.
bpf_get_task_stack works fine for fetching kernel stacks
but because get_perf_callchain relies on the caller to know
if the requested *task* is the current one (via *crosstask*)
it was failing in a confusing way.

It might be possible to get user stacks for all tasks utilizing
something like access_process_vm but that requires the bpf
program calling bpf_get_task_stack to be sleepable and would
therefore be a breaking change.

Fixes: fa28dcb82a38 ("bpf: Introduce helper bpf_get_task_stack()")
Signed-off-by: Jordan Rome <jordalgo@meta.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20231108112334.3433136-1-jordalgo@meta.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/uapi/linux/bpf.h       |  3 +++
 kernel/bpf/stackmap.c          | 11 ++++++++++-
 tools/include/uapi/linux/bpf.h |  3 +++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 0448700890f7..ada7acb91a1b 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -4490,6 +4490,8 @@ union bpf_attr {
  * long bpf_get_task_stack(struct task_struct *task, void *buf, u32 size, u64 flags)
  *	Description
  *		Return a user or a kernel stack in bpf program provided buffer.
+ *		Note: the user stack will only be populated if the *task* is
+ *		the current task; all other tasks will return -EOPNOTSUPP.
  *		To achieve this, the helper needs *task*, which is a valid
  *		pointer to **struct task_struct**. To store the stacktrace, the
  *		bpf program provides *buf* with a nonnegative *size*.
@@ -4501,6 +4503,7 @@ union bpf_attr {
  *
  *		**BPF_F_USER_STACK**
  *			Collect a user space stack instead of a kernel stack.
+ *			The *task* must be the current task.
  *		**BPF_F_USER_BUILD_ID**
  *			Collect buildid+offset instead of ips for user stack,
  *			only valid if **BPF_F_USER_STACK** is also specified.
diff --git a/kernel/bpf/stackmap.c b/kernel/bpf/stackmap.c
index 458bb80b14d5..36775c4bc33f 100644
--- a/kernel/bpf/stackmap.c
+++ b/kernel/bpf/stackmap.c
@@ -388,6 +388,7 @@ static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
 {
 	u32 trace_nr, copy_len, elem_size, num_elem, max_depth;
 	bool user_build_id = flags & BPF_F_USER_BUILD_ID;
+	bool crosstask = task && task != current;
 	u32 skip = flags & BPF_F_SKIP_FIELD_MASK;
 	bool user = flags & BPF_F_USER_STACK;
 	struct perf_callchain_entry *trace;
@@ -410,6 +411,14 @@ static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
 	if (task && user && !user_mode(regs))
 		goto err_fault;
 
+	/* get_perf_callchain does not support crosstask user stack walking
+	 * but returns an empty stack instead of NULL.
+	 */
+	if (crosstask && user) {
+		err = -EOPNOTSUPP;
+		goto clear;
+	}
+
 	num_elem = size / elem_size;
 	max_depth = num_elem + skip;
 	if (sysctl_perf_event_max_stack < max_depth)
@@ -421,7 +430,7 @@ static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
 		trace = get_callchain_entry_for_task(task, max_depth);
 	else
 		trace = get_perf_callchain(regs, 0, kernel, user, max_depth,
-					   false, false);
+					   crosstask, false);
 	if (unlikely(!trace))
 		goto err_fault;
 
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 0448700890f7..ada7acb91a1b 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -4490,6 +4490,8 @@ union bpf_attr {
  * long bpf_get_task_stack(struct task_struct *task, void *buf, u32 size, u64 flags)
  *	Description
  *		Return a user or a kernel stack in bpf program provided buffer.
+ *		Note: the user stack will only be populated if the *task* is
+ *		the current task; all other tasks will return -EOPNOTSUPP.
  *		To achieve this, the helper needs *task*, which is a valid
  *		pointer to **struct task_struct**. To store the stacktrace, the
  *		bpf program provides *buf* with a nonnegative *size*.
@@ -4501,6 +4503,7 @@ union bpf_attr {
  *
  *		**BPF_F_USER_STACK**
  *			Collect a user space stack instead of a kernel stack.
+ *			The *task* must be the current task.
  *		**BPF_F_USER_BUILD_ID**
  *			Collect buildid+offset instead of ips for user stack,
  *			only valid if **BPF_F_USER_STACK** is also specified.
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 090/583] wifi: ath11k: Defer on rproc_get failure
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (88 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 089/583] bpf: Add crosstask check to __bpf_get_stack Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 091/583] wifi: libertas: stop selecting wext Greg Kroah-Hartman
                   ` (499 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Luca Weiss, Kalle Valo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Luca Weiss <luca.weiss@fairphone.com>

[ Upstream commit 2a3ec40b98b46c339adb57313d3b933ee5e7a8e8 ]

If we already have gotten the rproc_handle (meaning the "qcom,rproc"
property is defined in the devicetree), it's a valid state that the
remoteproc module hasn't probed yet so we should defer probing instead
of just failing to probe.

This resolves a race condition when the ath11k driver probes and fails
before the wpss remoteproc driver has probed, like the following:

  [    6.232360] ath11k 17a10040.wifi: failed to get rproc
  [    6.232366] ath11k 17a10040.wifi: failed to get rproc: -22
  [    6.232478] ath11k: probe of 17a10040.wifi failed with error -22
       ...
  [    6.252415] remoteproc remoteproc2: 8a00000.remoteproc is available
  [    6.252776] remoteproc remoteproc2: powering up 8a00000.remoteproc
  [    6.252781] remoteproc remoteproc2: Booting fw image qcom/qcm6490/fairphone5/wpss.mdt, size 7188

So, defer the probe if we hit that so we can retry later once the wpss
remoteproc is available.

Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-01264-QCAMSLSWPLZ-1.37886.3

Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20231027-ath11k-rproc-defer-v1-1-f6b6a812cd18@fairphone.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/ath/ath11k/ahb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index 1215ebdf173a..ef11c138bf30 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -802,8 +802,8 @@ static int ath11k_core_get_rproc(struct ath11k_base *ab)
 
 	prproc = rproc_get_by_phandle(rproc_phandle);
 	if (!prproc) {
-		ath11k_err(ab, "failed to get rproc\n");
-		return -EINVAL;
+		ath11k_dbg(ab, ATH11K_DBG_AHB, "failed to get rproc, deferring\n");
+		return -EPROBE_DEFER;
 	}
 	ab_ahb->tgt_rproc = prproc;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 091/583] wifi: libertas: stop selecting wext
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (89 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 090/583] wifi: ath11k: Defer on rproc_get failure Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 092/583] ARM: dts: qcom: apq8064: correct XOADC register address Greg Kroah-Hartman
                   ` (498 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Arnd Bergmann, Kalle Valo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnd Bergmann <arnd@arndb.de>

[ Upstream commit 8170b04c2c92eee52ea50b96db4c54662197e512 ]

Libertas no longer references the iw_handler infrastructure or wext_spy,
so neither of the 'select' statements are used any more.

Fixes: e86dc1ca4676 ("Libertas: cfg80211 support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231108153409.1065286-1-arnd@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/marvell/libertas/Kconfig | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/wireless/marvell/libertas/Kconfig b/drivers/net/wireless/marvell/libertas/Kconfig
index 6d62ab49aa8d..c7d02adb3eea 100644
--- a/drivers/net/wireless/marvell/libertas/Kconfig
+++ b/drivers/net/wireless/marvell/libertas/Kconfig
@@ -2,8 +2,6 @@
 config LIBERTAS
 	tristate "Marvell 8xxx Libertas WLAN driver support"
 	depends on CFG80211
-	select WIRELESS_EXT
-	select WEXT_SPY
 	select LIB80211
 	select FW_LOADER
 	help
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 092/583] ARM: dts: qcom: apq8064: correct XOADC register address
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (90 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 091/583] wifi: libertas: stop selecting wext Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 093/583] net/ncsi: Fix netlink major/minor version numbers Greg Kroah-Hartman
                   ` (497 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Krzysztof Kozlowski,
	Dmitry Baryshkov, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

[ Upstream commit 554557542e709e190eff8a598f0cde02647d533a ]

The XOADC is present at the address 0x197 rather than just 197. It
doesn't change a lot (since the driver hardcodes all register
addresses), but the DT should present correct address anyway.

Fixes: c4b70883ee33 ("ARM: dts: add XOADC and IIO HWMON to APQ8064")
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20230928110309.1212221-3-dmitry.baryshkov@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/boot/dts/qcom/qcom-apq8064.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/qcom/qcom-apq8064.dtsi b/arch/arm/boot/dts/qcom/qcom-apq8064.dtsi
index 516f0d2495e2..950adb63af70 100644
--- a/arch/arm/boot/dts/qcom/qcom-apq8064.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-apq8064.dtsi
@@ -738,7 +738,7 @@ pwrkey@1c {
 
 				xoadc: xoadc@197 {
 					compatible = "qcom,pm8921-adc";
-					reg = <197>;
+					reg = <0x197>;
 					interrupts-extended = <&pmicintc 78 IRQ_TYPE_EDGE_RISING>;
 					#address-cells = <2>;
 					#size-cells = <0>;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 093/583] net/ncsi: Fix netlink major/minor version numbers
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (91 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 092/583] ARM: dts: qcom: apq8064: correct XOADC register address Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 094/583] firmware: ti_sci: Fix an off-by-one in ti_sci_debugfs_create() Greg Kroah-Hartman
                   ` (496 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Peter Delevoryas, David S. Miller,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Peter Delevoryas <peter@pjd.dev>

[ Upstream commit 3084b58bfd0b9e4b5e034f31f31b42977db35f12 ]

The netlink interface for major and minor version numbers doesn't actually
return the major and minor version numbers.

It reports a u32 that contains the (major, minor, update, alpha1)
components as the major version number, and then alpha2 as the minor
version number.

For whatever reason, the u32 byte order was reversed (ntohl): maybe it was
assumed that the encoded value was a single big-endian u32, and alpha2 was
the minor version.

The correct way to get the supported NC-SI version from the network
controller is to parse the Get Version ID response as described in 8.4.44
of the NC-SI spec[1].

    Get Version ID Response Packet Format

              Bits
            +--------+--------+--------+--------+
     Bytes  | 31..24 | 23..16 | 15..8  | 7..0   |
    +-------+--------+--------+--------+--------+
    | 0..15 | NC-SI Header                      |
    +-------+--------+--------+--------+--------+
    | 16..19| Response code   | Reason code     |
    +-------+--------+--------+--------+--------+
    |20..23 | Major  | Minor  | Update | Alpha1 |
    +-------+--------+--------+--------+--------+
    |24..27 |         reserved         | Alpha2 |
    +-------+--------+--------+--------+--------+
    |            .... other stuff ....          |

The major, minor, and update fields are all binary-coded decimal (BCD)
encoded [2]. The spec provides examples below the Get Version ID response
format in section 8.4.44.1, but for practical purposes, this is an example
from a live network card:

    root@bmc:~# ncsi-util 0x15
    NC-SI Command Response:
    cmd: GET_VERSION_ID(0x15)
    Response: COMMAND_COMPLETED(0x0000)  Reason: NO_ERROR(0x0000)
    Payload length = 40

    20: 0xf1 0xf1 0xf0 0x00 <<<<<<<<< (major, minor, update, alpha1)
    24: 0x00 0x00 0x00 0x00 <<<<<<<<< (_, _, _, alpha2)

    28: 0x6d 0x6c 0x78 0x30
    32: 0x2e 0x31 0x00 0x00
    36: 0x00 0x00 0x00 0x00
    40: 0x16 0x1d 0x07 0xd2
    44: 0x10 0x1d 0x15 0xb3
    48: 0x00 0x17 0x15 0xb3
    52: 0x00 0x00 0x81 0x19

This should be parsed as "1.1.0".

"f" in the upper-nibble means to ignore it, contributing zero.

If both nibbles are "f", I think the whole field is supposed to be ignored.
Major and minor are "required", meaning they're not supposed to be "ff",
but the update field is "optional" so I think it can be ff. I think the
simplest thing to do is just set the major and minor to zero instead of
juggling some conditional logic or something.

bcd2bin() from "include/linux/bcd.h" seems to assume both nibbles are 0-9,
so I've provided a custom BCD decoding function.

Alpha1 and alpha2 are ISO/IEC 8859-1 encoded, which just means ASCII
characters as far as I can tell, although the full encoding table for
non-alphabetic characters is slightly different (I think).

I imagine the alpha fields are just supposed to be alphabetic characters,
but I haven't seen any network cards actually report a non-zero value for
either.

If people wrote software against this netlink behavior, and were parsing
the major and minor versions themselves from the u32, then this would
definitely break their code.

[1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0222_1.0.0.pdf
[2] https://en.wikipedia.org/wiki/Binary-coded_decimal
[2] https://en.wikipedia.org/wiki/ISO/IEC_8859-1

Signed-off-by: Peter Delevoryas <peter@pjd.dev>
Fixes: 138635cc27c9 ("net/ncsi: NCSI response packet handler")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ncsi/internal.h     |  7 +++++--
 net/ncsi/ncsi-netlink.c |  4 ++--
 net/ncsi/ncsi-pkt.h     |  7 +++++--
 net/ncsi/ncsi-rsp.c     | 26 ++++++++++++++++++++++++--
 4 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/net/ncsi/internal.h b/net/ncsi/internal.h
index 03757e76bb6b..374412ed780b 100644
--- a/net/ncsi/internal.h
+++ b/net/ncsi/internal.h
@@ -105,8 +105,11 @@ enum {
 
 
 struct ncsi_channel_version {
-	u32 version;		/* Supported BCD encoded NCSI version */
-	u32 alpha2;		/* Supported BCD encoded NCSI version */
+	u8   major;		/* NCSI version major */
+	u8   minor;		/* NCSI version minor */
+	u8   update;		/* NCSI version update */
+	char alpha1;		/* NCSI version alpha1 */
+	char alpha2;		/* NCSI version alpha2 */
 	u8  fw_name[12];	/* Firmware name string                */
 	u32 fw_version;		/* Firmware version                   */
 	u16 pci_ids[4];		/* PCI identification                 */
diff --git a/net/ncsi/ncsi-netlink.c b/net/ncsi/ncsi-netlink.c
index a3a6753a1db7..2f872d064396 100644
--- a/net/ncsi/ncsi-netlink.c
+++ b/net/ncsi/ncsi-netlink.c
@@ -71,8 +71,8 @@ static int ncsi_write_channel_info(struct sk_buff *skb,
 	if (nc == nc->package->preferred_channel)
 		nla_put_flag(skb, NCSI_CHANNEL_ATTR_FORCED);
 
-	nla_put_u32(skb, NCSI_CHANNEL_ATTR_VERSION_MAJOR, nc->version.version);
-	nla_put_u32(skb, NCSI_CHANNEL_ATTR_VERSION_MINOR, nc->version.alpha2);
+	nla_put_u32(skb, NCSI_CHANNEL_ATTR_VERSION_MAJOR, nc->version.major);
+	nla_put_u32(skb, NCSI_CHANNEL_ATTR_VERSION_MINOR, nc->version.minor);
 	nla_put_string(skb, NCSI_CHANNEL_ATTR_VERSION_STR, nc->version.fw_name);
 
 	vid_nest = nla_nest_start_noflag(skb, NCSI_CHANNEL_ATTR_VLAN_LIST);
diff --git a/net/ncsi/ncsi-pkt.h b/net/ncsi/ncsi-pkt.h
index ba66c7dc3a21..c9d1da34dc4d 100644
--- a/net/ncsi/ncsi-pkt.h
+++ b/net/ncsi/ncsi-pkt.h
@@ -197,9 +197,12 @@ struct ncsi_rsp_gls_pkt {
 /* Get Version ID */
 struct ncsi_rsp_gvi_pkt {
 	struct ncsi_rsp_pkt_hdr rsp;          /* Response header */
-	__be32                  ncsi_version; /* NCSI version    */
+	unsigned char           major;        /* NCSI version major */
+	unsigned char           minor;        /* NCSI version minor */
+	unsigned char           update;       /* NCSI version update */
+	unsigned char           alpha1;       /* NCSI version alpha1 */
 	unsigned char           reserved[3];  /* Reserved        */
-	unsigned char           alpha2;       /* NCSI version    */
+	unsigned char           alpha2;       /* NCSI version alpha2 */
 	unsigned char           fw_name[12];  /* f/w name string */
 	__be32                  fw_version;   /* f/w version     */
 	__be16                  pci_ids[4];   /* PCI IDs         */
diff --git a/net/ncsi/ncsi-rsp.c b/net/ncsi/ncsi-rsp.c
index 069c2659074b..480e80e3c283 100644
--- a/net/ncsi/ncsi-rsp.c
+++ b/net/ncsi/ncsi-rsp.c
@@ -19,6 +19,19 @@
 #include "ncsi-pkt.h"
 #include "ncsi-netlink.h"
 
+/* Nibbles within [0xA, 0xF] add zero "0" to the returned value.
+ * Optional fields (encoded as 0xFF) will default to zero.
+ */
+static u8 decode_bcd_u8(u8 x)
+{
+	int lo = x & 0xF;
+	int hi = x >> 4;
+
+	lo = lo < 0xA ? lo : 0;
+	hi = hi < 0xA ? hi : 0;
+	return lo + hi * 10;
+}
+
 static int ncsi_validate_rsp_pkt(struct ncsi_request *nr,
 				 unsigned short payload)
 {
@@ -755,9 +768,18 @@ static int ncsi_rsp_handler_gvi(struct ncsi_request *nr)
 	if (!nc)
 		return -ENODEV;
 
-	/* Update to channel's version info */
+	/* Update channel's version info
+	 *
+	 * Major, minor, and update fields are supposed to be
+	 * unsigned integers encoded as packed BCD.
+	 *
+	 * Alpha1 and alpha2 are ISO/IEC 8859-1 characters.
+	 */
 	ncv = &nc->version;
-	ncv->version = ntohl(rsp->ncsi_version);
+	ncv->major = decode_bcd_u8(rsp->major);
+	ncv->minor = decode_bcd_u8(rsp->minor);
+	ncv->update = decode_bcd_u8(rsp->update);
+	ncv->alpha1 = rsp->alpha1;
 	ncv->alpha2 = rsp->alpha2;
 	memcpy(ncv->fw_name, rsp->fw_name, 12);
 	ncv->fw_version = ntohl(rsp->fw_version);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 094/583] firmware: ti_sci: Fix an off-by-one in ti_sci_debugfs_create()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (92 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 093/583] net/ncsi: Fix netlink major/minor version numbers Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 095/583] scsi: bfa: Use the proper data type for BLIST flags Greg Kroah-Hartman
                   ` (495 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christophe JAILLET, Dan Carpenter,
	Nishanth Menon, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

[ Upstream commit 964946b88887089f447a9b6a28c39ee97dc76360 ]

The ending NULL is not taken into account by strncat(), so switch to
snprintf() to correctly build 'debug_name'.

Using snprintf() also makes the code more readable.

Fixes: aa276781a64a ("firmware: Add basic support for TI System Control Interface (TI-SCI) protocol")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/7158db0a4d7b19855ddd542ec61b666973aad8dc.1698660720.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/firmware/ti_sci.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index 66c3846c9147..3b4c9355cb60 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -161,7 +161,7 @@ static int ti_sci_debugfs_create(struct platform_device *pdev,
 {
 	struct device *dev = &pdev->dev;
 	struct resource *res;
-	char debug_name[50] = "ti_sci_debug@";
+	char debug_name[50];
 
 	/* Debug region is optional */
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
@@ -178,10 +178,10 @@ static int ti_sci_debugfs_create(struct platform_device *pdev,
 	/* Setup NULL termination */
 	info->debug_buffer[info->debug_region_size] = 0;
 
-	info->d = debugfs_create_file(strncat(debug_name, dev_name(dev),
-					      sizeof(debug_name) -
-					      sizeof("ti_sci_debug@")),
-				      0444, NULL, info, &ti_sci_debug_fops);
+	snprintf(debug_name, sizeof(debug_name), "ti_sci_debug@%s",
+		 dev_name(dev));
+	info->d = debugfs_create_file(debug_name, 0444, NULL, info,
+				      &ti_sci_debug_fops);
 	if (IS_ERR(info->d))
 		return PTR_ERR(info->d);
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 095/583] scsi: bfa: Use the proper data type for BLIST flags
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (93 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 094/583] firmware: ti_sci: Fix an off-by-one in ti_sci_debugfs_create() Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 096/583] wifi: rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior Greg Kroah-Hartman
                   ` (494 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, kernel test robot, Bart Van Assche,
	Martin K. Petersen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bart Van Assche <bvanassche@acm.org>

[ Upstream commit 0349be31e4ffc79723e46e2e373569567b06347b ]

Fix the following sparse warning:

drivers/scsi/bfa/bfad_bsg.c:2553:50: sparse: sparse: incorrect type in initializer (different base types)

Fixes: 2e5a6c3baccd ("scsi: bfa: Convert bfad_reset_sdev_bflags() from a macro into a function")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202311031255.lmSPisIk-lkp@intel.com/
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20231115193338.2261972-1-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/bfa/bfad_bsg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c
index 520f9152f3bf..d4ceca2d435e 100644
--- a/drivers/scsi/bfa/bfad_bsg.c
+++ b/drivers/scsi/bfa/bfad_bsg.c
@@ -2550,7 +2550,7 @@ bfad_iocmd_vf_clr_stats(struct bfad_s *bfad, void *cmd)
 static void bfad_reset_sdev_bflags(struct bfad_im_port_s *im_port,
 				   int lunmask_cfg)
 {
-	const u32 scan_flags = BLIST_NOREPORTLUN | BLIST_SPARSELUN;
+	const blist_flags_t scan_flags = BLIST_NOREPORTLUN | BLIST_SPARSELUN;
 	struct bfad_itnim_s *itnim;
 	struct scsi_device *sdev;
 	unsigned long flags;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 096/583] wifi: rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (94 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 095/583] scsi: bfa: Use the proper data type for BLIST flags Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 097/583] arm64: dts: ti: k3-am62a-main: Fix GPIO pin count in DT nodes Greg Kroah-Hartman
                   ` (493 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Su Hui, Ping-Ke Shih, Kalle Valo,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Su Hui <suhui@nfschina.com>

[ Upstream commit bc8263083af60e7e57c6120edbc1f75d6c909a35 ]

Clang static checker warns:

drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c:184:49:
	The result of the left shift is undefined due to shifting by '32',
	which is greater or equal to the width of type 'u32'.
	[core.UndefinedBinaryOperatorResult]

If the value of the right operand is negative or is greater than or
equal to the width of the promoted left operand, the behavior is
undefined.[1][2]

For example, when using different gcc's compilation optimization options
(-O0 or -O2), the result of '(u32)data << 32' is different. One is 0, the
other is old value of data. Let _rtl8821ae_phy_calculate_bit_shift()'s
return value less than 32 to fix this problem. Warn if bitmask is zero.

[1] https://stackoverflow.com/questions/11270492/what-does-the-c-standard-say-about-bitshifting-more-bits-than-the-width-of-type
[2] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf

Fixes: 21e4b0726dc6 ("rtlwifi: rtl8821ae: Move driver from staging to regular tree")
Signed-off-by: Su Hui <suhui@nfschina.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231127013511.26694-2-suhui@nfschina.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
index 5323ead30db0..fa1839d8ee55 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
@@ -29,9 +29,10 @@ static void _rtl8821ae_phy_rf_serial_write(struct ieee80211_hw *hw,
 					   u32 data);
 static u32 _rtl8821ae_phy_calculate_bit_shift(u32 bitmask)
 {
-	u32 i = ffs(bitmask);
+	if (WARN_ON_ONCE(!bitmask))
+		return 0;
 
-	return i ? i - 1 : 32;
+	return __ffs(bitmask);
 }
 static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw);
 /*static bool _rtl8812ae_phy_config_mac_with_headerfile(struct ieee80211_hw *hw);*/
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 097/583] arm64: dts: ti: k3-am62a-main: Fix GPIO pin count in DT nodes
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (95 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 096/583] wifi: rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 098/583] arm64: dts: ti: k3-am65-main: Fix DSS irq trigger type Greg Kroah-Hartman
                   ` (492 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nitin Yadav, Nishanth Menon, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nitin Yadav <n-yadav@ti.com>

[ Upstream commit 7dc4af358cc382c5d20bd5b726e53ef0f526eb6d ]

Fix number of gpio pins in main_gpio0 & main_gpio1 DT nodes according
to AM62A7 datasheet[0].

[0] https://www.ti.com/lit/gpn/am62a3 Section: 6.3.10 GPIO (Page No. 52-55)
Fixes: 5fc6b1b62639 ("arm64: dts: ti: Introduce AM62A7 family of SoCs")
Signed-off-by: Nitin Yadav <n-yadav@ti.com>
Link: https://lore.kernel.org/r/20231027065930.1187405-1-n-yadav@ti.com
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/ti/k3-am62a-main.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
index 3198af08fb9f..de36abb243f1 100644
--- a/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
@@ -462,7 +462,7 @@ main_gpio0: gpio@600000 {
 			     <193>, <194>, <195>;
 		interrupt-controller;
 		#interrupt-cells = <2>;
-		ti,ngpio = <87>;
+		ti,ngpio = <92>;
 		ti,davinci-gpio-unbanked = <0>;
 		power-domains = <&k3_pds 77 TI_SCI_PD_EXCLUSIVE>;
 		clocks = <&k3_clks 77 0>;
@@ -480,7 +480,7 @@ main_gpio1: gpio@601000 {
 			     <183>, <184>, <185>;
 		interrupt-controller;
 		#interrupt-cells = <2>;
-		ti,ngpio = <88>;
+		ti,ngpio = <52>;
 		ti,davinci-gpio-unbanked = <0>;
 		power-domains = <&k3_pds 78 TI_SCI_PD_EXCLUSIVE>;
 		clocks = <&k3_clks 78 0>;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 098/583] arm64: dts: ti: k3-am65-main: Fix DSS irq trigger type
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (96 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 097/583] arm64: dts: ti: k3-am62a-main: Fix GPIO pin count in DT nodes Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 099/583] arm64: dts: ti: iot2050: Re-add aliases Greg Kroah-Hartman
                   ` (491 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Tomi Valkeinen, Aradhya Bhatia,
	Nishanth Menon, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

[ Upstream commit b57160859263c083c49482b0d083a586b1517f78 ]

DSS irq trigger type is set to IRQ_TYPE_EDGE_RISING in the DT file, but
the TRM says it is level triggered.

For some reason triggering on rising edge results in double the amount
of expected interrupts, e.g. for normal page flipping test the number of
interrupts per second is 2 * fps. It is as if the IRQ triggers on both
edges. There are no other side effects to this issue than slightly
increased CPU & power consumption due to the extra interrupt.

Switching to IRQ_TYPE_LEVEL_HIGH is correct and fixes the issue, so
let's do that.

Fixes: fc539b90eda2 ("arm64: dts: ti: am654: Add DSS node")
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Aradhya Bhatia <a-bhatia1@ti.com>
Link: https://lore.kernel.org/r/20231106-am65-dss-clk-edge-v1-1-4a959fec0e1e@ideasonboard.com
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/ti/k3-am65-main.dtsi b/arch/arm64/boot/dts/ti/k3-am65-main.dtsi
index bc460033a37a..c98068b6c122 100644
--- a/arch/arm64/boot/dts/ti/k3-am65-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am65-main.dtsi
@@ -1034,7 +1034,7 @@ dss: dss@4a00000 {
 		assigned-clocks = <&k3_clks 67 2>;
 		assigned-clock-parents = <&k3_clks 67 5>;
 
-		interrupts = <GIC_SPI 166 IRQ_TYPE_EDGE_RISING>;
+		interrupts = <GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>;
 
 		dma-coherent;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 099/583] arm64: dts: ti: iot2050: Re-add aliases
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (97 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 098/583] arm64: dts: ti: k3-am65-main: Fix DSS irq trigger type Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 100/583] wifi: rtw88: sdio: Honor the host max_req_size in the RX path Greg Kroah-Hartman
                   ` (490 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jan Kiszka, Nishanth Menon, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jan Kiszka <jan.kiszka@siemens.com>

[ Upstream commit ad8edf4ff37ab157f6547da173aedc9f4e5c4015 ]

Lost while dropping them from the common dtsi.

Fixes: ffc449e016e2 ("arm64: dts: ti: k3-am65: Drop aliases")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Link: https://lore.kernel.org/r/1edbc1b56ed4ff2256d7afb7db3cab4b3a423692.1699087938.git.jan.kiszka@siemens.com
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi b/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi
index ba1c14a54acf..b849648d51f9 100644
--- a/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi
@@ -14,6 +14,16 @@
 
 / {
 	aliases {
+		serial0 = &wkup_uart0;
+		serial1 = &mcu_uart0;
+		serial2 = &main_uart0;
+		serial3 = &main_uart1;
+		i2c0 = &wkup_i2c0;
+		i2c1 = &mcu_i2c0;
+		i2c2 = &main_i2c0;
+		i2c3 = &main_i2c1;
+		i2c4 = &main_i2c2;
+		i2c5 = &main_i2c3;
 		spi0 = &mcu_spi0;
 		mmc0 = &sdhci1;
 		mmc1 = &sdhci0;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 100/583] wifi: rtw88: sdio: Honor the host max_req_size in the RX path
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (98 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 099/583] arm64: dts: ti: iot2050: Re-add aliases Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 101/583] selftests/bpf: Fix erroneous bitmask operation Greg Kroah-Hartman
                   ` (489 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Lukas F. Hartmann, Ping-Ke Shih,
	Martin Blumenstingl, Ulf Hansson, Kalle Valo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

[ Upstream commit 00384f565a91c08c4bedae167f749b093d10e3fe ]

Lukas reports skb_over_panic errors on his Banana Pi BPI-CM4 which comes
with an Amlogic A311D (G12B) SoC and a RTL8822CS SDIO wifi/Bluetooth
combo card. The error he observed is identical to what has been fixed
in commit e967229ead0e ("wifi: rtw88: sdio: Check the HISR RX_REQUEST
bit in rtw_sdio_rx_isr()") but that commit didn't fix Lukas' problem.

Lukas found that disabling or limiting RX aggregation works around the
problem for some time (but does not fully fix it). In the following
discussion a few key topics have been discussed which have an impact on
this problem:
- The Amlogic A311D (G12B) SoC has a hardware bug in the SDIO controller
  which prevents DMA transfers. Instead all transfers need to go through
  the controller SRAM which limits transfers to 1536 bytes
- rtw88 chips don't split incoming (RX) packets, so if a big packet is
  received this is forwarded to the host in it's original form
- rtw88 chips can do RX aggregation, meaning more multiple incoming
  packets can be pulled by the host from the card with one MMC/SDIO
  transfer. This Depends on settings in the REG_RXDMA_AGG_PG_TH
  register (BIT_RXDMA_AGG_PG_TH limits the number of packets that will
  be aggregated, BIT_DMA_AGG_TO_V1 configures a timeout for aggregation
  and BIT_EN_PRE_CALC makes the chip honor the limits more effectively)

Use multiple consecutive reads in rtw_sdio_read_port() and limit the
number of bytes which are copied by the host from the card in one
MMC/SDIO transfer. This allows receiving a buffer that's larger than
the hosts max_req_size (number of bytes which can be transferred in
one MMC/SDIO transfer). As a result of this the skb_over_panic error
is gone as the rtw88 driver is now able to receive more than 1536 bytes
from the card (either because the incoming packet is larger than that
or because multiple packets have been aggregated).

In case of an receive errors (-EILSEQ has been observed by Lukas) we
need to drain the remaining data from the card's buffer, otherwise the
card will return corrupt data for the next rtw_sdio_read_port() call.

Fixes: 65371a3f14e7 ("wifi: rtw88: sdio: Add HCI implementation for SDIO based chipsets")
Reported-by: Lukas F. Hartmann <lukas@mntre.com>
Closes: https://lore.kernel.org/linux-wireless/CAFBinCBaXtebixKbjkWKW_WXc5k=NdGNaGUjVE8NCPNxOhsb2g@mail.gmail.com/
Suggested-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Tested-by: Lukas F. Hartmann <lukas@mntre.com>
Reported-by: Lukas F. Hartmann <lukas@mntre.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Tested-by: Lukas F. Hartmann <lukas@mntre.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231120115726.1569323-1-martin.blumenstingl@googlemail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/realtek/rtw88/sdio.c | 35 ++++++++++++++++++-----
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/sdio.c b/drivers/net/wireless/realtek/rtw88/sdio.c
index 2c1fb2dabd40..0cae5746f540 100644
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
@@ -500,19 +500,40 @@ static u32 rtw_sdio_get_tx_addr(struct rtw_dev *rtwdev, size_t size,
 static int rtw_sdio_read_port(struct rtw_dev *rtwdev, u8 *buf, size_t count)
 {
 	struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
+	struct mmc_host *host = rtwsdio->sdio_func->card->host;
 	bool bus_claim = rtw_sdio_bus_claim_needed(rtwsdio);
 	u32 rxaddr = rtwsdio->rx_addr++;
-	int ret;
+	int ret = 0, err;
+	size_t bytes;
 
 	if (bus_claim)
 		sdio_claim_host(rtwsdio->sdio_func);
 
-	ret = sdio_memcpy_fromio(rtwsdio->sdio_func, buf,
-				 RTW_SDIO_ADDR_RX_RX0FF_GEN(rxaddr), count);
-	if (ret)
-		rtw_warn(rtwdev,
-			 "Failed to read %zu byte(s) from SDIO port 0x%08x",
-			 count, rxaddr);
+	while (count > 0) {
+		bytes = min_t(size_t, host->max_req_size, count);
+
+		err = sdio_memcpy_fromio(rtwsdio->sdio_func, buf,
+					 RTW_SDIO_ADDR_RX_RX0FF_GEN(rxaddr),
+					 bytes);
+		if (err) {
+			rtw_warn(rtwdev,
+				 "Failed to read %zu byte(s) from SDIO port 0x%08x: %d",
+				 bytes, rxaddr, err);
+
+			 /* Signal to the caller that reading did not work and
+			  * that the data in the buffer is short/corrupted.
+			  */
+			ret = err;
+
+			/* Don't stop here - instead drain the remaining data
+			 * from the card's buffer, else the card will return
+			 * corrupt data for the next rtw_sdio_read_port() call.
+			 */
+		}
+
+		count -= bytes;
+		buf += bytes;
+	}
 
 	if (bus_claim)
 		sdio_release_host(rtwsdio->sdio_func);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 101/583] selftests/bpf: Fix erroneous bitmask operation
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (99 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 100/583] wifi: rtw88: sdio: Honor the host max_req_size in the RX path Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 102/583] md: synchronize flush io with array reconfiguration Greg Kroah-Hartman
                   ` (488 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jeroen van Ingen Schenau,
	Daniel Borkmann, Minh Le Hoang, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jeroen van Ingen Schenau <jeroen.vaningenschenau@novoserve.com>

[ Upstream commit b6a3451e0847d5d70fb5fa2b2a80ab9f80bf2c7b ]

xdp_synproxy_kern.c is a BPF program that generates SYN cookies on
allowed TCP ports and sends SYNACKs to clients, accelerating synproxy
iptables module.

Fix the bitmask operation when checking the status of an existing
conntrack entry within tcp_lookup() function. Do not AND with the bit
position number, but with the bitmask value to check whether the entry
found has the IPS_CONFIRMED flag set.

Fixes: fb5cd0ce70d4 ("selftests/bpf: Add selftests for raw syncookie helpers")
Signed-off-by: Jeroen van Ingen Schenau <jeroen.vaningenschenau@novoserve.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Minh Le Hoang <minh.lehoang@novoserve.com>
Link: https://lore.kernel.org/xdp-newbies/CAAi1gX7owA+Tcxq-titC-h-KPM7Ri-6ZhTNMhrnPq5gmYYwKow@mail.gmail.com/T/#u
Link: https://lore.kernel.org/bpf/20231130120353.3084-1-jeroen.vaningenschenau@novoserve.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c b/tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c
index 07d786329105..04fc2c6c79e8 100644
--- a/tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c
+++ b/tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c
@@ -447,13 +447,13 @@ static __always_inline int tcp_lookup(void *ctx, struct header_pointers *hdr, bo
 		unsigned long status = ct->status;
 
 		bpf_ct_release(ct);
-		if (status & IPS_CONFIRMED_BIT)
+		if (status & IPS_CONFIRMED)
 			return XDP_PASS;
 	} else if (ct_lookup_opts.error != -ENOENT) {
 		return XDP_ABORTED;
 	}
 
-	/* error == -ENOENT || !(status & IPS_CONFIRMED_BIT) */
+	/* error == -ENOENT || !(status & IPS_CONFIRMED) */
 	return XDP_TX;
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 102/583] md: synchronize flush io with array reconfiguration
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (100 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 101/583] selftests/bpf: Fix erroneous bitmask operation Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 103/583] bpf: enforce precision of R0 on callback return Greg Kroah-Hartman
                   ` (487 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Yu Kuai, Song Liu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yu Kuai <yukuai3@huawei.com>

[ Upstream commit fa2bbff7b0b4e211fec5e5686ef96350690597b5 ]

Currently rcu is used to protect iterating rdev from submit_flushes():

submit_flushes			remove_and_add_spares
				synchronize_rcu
				pers->hot_remove_disk()
 rcu_read_lock()
 rdev_for_each_rcu
  if (rdev->raid_disk >= 0)
				rdev->radi_disk = -1;
   atomic_inc(&rdev->nr_pending)
   rcu_read_unlock()
   bi = bio_alloc_bioset()
   bi->bi_end_io = md_end_flush
   bi->private = rdev
   submit_bio
   // issue io for removed rdev

Fix this problem by grabbing 'acive_io' before iterating rdev, make sure
that remove_and_add_spares() won't concurrent with submit_flushes().

Fixes: a2826aa92e2e ("md: support barrier requests on all personalities.")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20231129020234.1586910-1-yukuai1@huaweicloud.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/md/md.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index b2ef6af8376a..8c40c1c3959c 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -494,6 +494,9 @@ static void md_end_flush(struct bio *bio)
 	rdev_dec_pending(rdev, mddev);
 
 	if (atomic_dec_and_test(&mddev->flush_pending)) {
+		/* The pair is percpu_ref_get() from md_flush_request() */
+		percpu_ref_put(&mddev->active_io);
+
 		/* The pre-request flush has finished */
 		queue_work(md_wq, &mddev->flush_work);
 	}
@@ -513,12 +516,8 @@ static void submit_flushes(struct work_struct *ws)
 	rdev_for_each_rcu(rdev, mddev)
 		if (rdev->raid_disk >= 0 &&
 		    !test_bit(Faulty, &rdev->flags)) {
-			/* Take two references, one is dropped
-			 * when request finishes, one after
-			 * we reclaim rcu_read_lock
-			 */
 			struct bio *bi;
-			atomic_inc(&rdev->nr_pending);
+
 			atomic_inc(&rdev->nr_pending);
 			rcu_read_unlock();
 			bi = bio_alloc_bioset(rdev->bdev, 0,
@@ -529,7 +528,6 @@ static void submit_flushes(struct work_struct *ws)
 			atomic_inc(&mddev->flush_pending);
 			submit_bio(bi);
 			rcu_read_lock();
-			rdev_dec_pending(rdev, mddev);
 		}
 	rcu_read_unlock();
 	if (atomic_dec_and_test(&mddev->flush_pending))
@@ -582,6 +580,18 @@ bool md_flush_request(struct mddev *mddev, struct bio *bio)
 	/* new request after previous flush is completed */
 	if (ktime_after(req_start, mddev->prev_flush_start)) {
 		WARN_ON(mddev->flush_bio);
+		/*
+		 * Grab a reference to make sure mddev_suspend() will wait for
+		 * this flush to be done.
+		 *
+		 * md_flush_reqeust() is called under md_handle_request() and
+		 * 'active_io' is already grabbed, hence percpu_ref_is_zero()
+		 * won't pass, percpu_ref_tryget_live() can't be used because
+		 * percpu_ref_kill() can be called by mddev_suspend()
+		 * concurrently.
+		 */
+		WARN_ON(percpu_ref_is_zero(&mddev->active_io));
+		percpu_ref_get(&mddev->active_io);
 		mddev->flush_bio = bio;
 		bio = NULL;
 	}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 103/583] bpf: enforce precision of R0 on callback return
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (101 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 102/583] md: synchronize flush io with array reconfiguration Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 104/583] ARM: dts: qcom: sdx65: correct PCIe EP phy-names Greg Kroah-Hartman
                   ` (486 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Eduard Zingerman, Shung-Hsi Yu,
	Andrii Nakryiko, Alexei Starovoitov, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Andrii Nakryiko <andrii@kernel.org>

[ Upstream commit 0acd03a5bd188b0c501d285d938439618bd855c4 ]

Given verifier checks actual value, r0 has to be precise, so we need to
propagate precision properly. r0 also has to be marked as read,
otherwise subsequent state comparisons will ignore such register as
unimportant and precision won't really help here.

Fixes: 69c087ba6225 ("bpf: Add bpf_for_each_map_elem() helper")
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20231202175705.885270-4-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/verifier.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 824531d4c262..2deae0db03e8 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -9284,6 +9284,13 @@ static int prepare_func_exit(struct bpf_verifier_env *env, int *insn_idx)
 			verbose(env, "R0 not a scalar value\n");
 			return -EACCES;
 		}
+
+		/* we are going to rely on register's precise value */
+		err = mark_reg_read(env, r0, r0->parent, REG_LIVE_READ64);
+		err = err ?: mark_chain_precision(env, BPF_REG_0);
+		if (err)
+			return err;
+
 		if (!tnum_in(range, r0->var_off)) {
 			verbose_invalid_scalar(env, r0, &range, "callback return", "R0");
 			return -EINVAL;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 104/583] ARM: dts: qcom: sdx65: correct PCIe EP phy-names
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (102 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 103/583] bpf: enforce precision of R0 on callback return Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 105/583] ARM: dts: qcom: sdx65: correct SPMI node name Greg Kroah-Hartman
                   ` (485 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Krzysztof Kozlowski,
	Manivannan Sadhasivam, Dmitry Baryshkov, Bjorn Andersson,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

[ Upstream commit 94da379dba88c4cdd562bad21c9ba5656e5ed5df ]

Qualcomm PCIe endpoint bindings expect phy-names to be "pciephy":

  arch/arm/boot/dts/qcom/qcom-sdx65-mtp.dtb: pcie-ep@1c00000: phy-names:0: 'pciephy' was expected

Fixes: 9c0bb38414a4 ("ARM: dts: qcom: sdx65: Add support for PCIe EP")
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20230924183103.49487-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/boot/dts/qcom/qcom-sdx65.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/qcom/qcom-sdx65.dtsi b/arch/arm/boot/dts/qcom/qcom-sdx65.dtsi
index 1a3583029a64..35a887176b3c 100644
--- a/arch/arm/boot/dts/qcom/qcom-sdx65.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-sdx65.dtsi
@@ -338,7 +338,7 @@ pcie_ep: pcie-ep@1c00000 {
 			power-domains = <&gcc PCIE_GDSC>;
 
 			phys = <&pcie_phy>;
-			phy-names = "pcie-phy";
+			phy-names = "pciephy";
 
 			max-link-speed = <3>;
 			num-lanes = <2>;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 105/583] ARM: dts: qcom: sdx65: correct SPMI node name
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (103 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 104/583] ARM: dts: qcom: sdx65: correct PCIe EP phy-names Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 106/583] dt-bindings: arm: qcom: Fix html link Greg Kroah-Hartman
                   ` (484 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Krzysztof Kozlowski,
	Dmitry Baryshkov, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

[ Upstream commit a900ad783f507cb396e402827052e70c0c565ae9 ]

Node names should not have vendor prefixes:

  qcom-sdx65-mtp.dtb: qcom,spmi@c440000: $nodename:0: 'qcom,spmi@c440000' does not match '^spmi@.*

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20230924183103.49487-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/boot/dts/qcom/qcom-sdx65.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/qcom/qcom-sdx65.dtsi b/arch/arm/boot/dts/qcom/qcom-sdx65.dtsi
index 35a887176b3c..271899c861c0 100644
--- a/arch/arm/boot/dts/qcom/qcom-sdx65.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-sdx65.dtsi
@@ -530,7 +530,7 @@ restart@c264000 {
 			reg = <0x0c264000 0x1000>;
 		};
 
-		spmi_bus: qcom,spmi@c440000 {
+		spmi_bus: spmi@c440000 {
 			compatible = "qcom,spmi-pmic-arb";
 			reg = <0xc440000 0xd00>,
 				<0xc600000 0x2000000>,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 106/583] dt-bindings: arm: qcom: Fix html link
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (104 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 105/583] ARM: dts: qcom: sdx65: correct SPMI node name Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 107/583] arm64: dts: qcom: sc8180x-primus: Fix HALL_INT polarity Greg Kroah-Hartman
                   ` (483 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alexandre TORGUE, Yanteng Si,
	Jonathan Corbet, Douglas Anderson, Krzysztof Kozlowski,
	Stephen Boyd, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Stephen Boyd <swboyd@chromium.org>

[ Upstream commit 3c3fcac8d3b1b0f242845c3b3c3263bd38b3b92f ]

This link got broken by commit e790a4ce5290 ("arm: docs: Move Arm
documentation to Documentation/arch/") when the doc moved from arm/ to
arch/arm/. Fix the link so that it can continue to be followed.

Fixes: e790a4ce5290 ("arm: docs: Move Arm documentation to Documentation/arch/")
Cc: Alexandre TORGUE <alexandre.torgue@foss.st.com>
Cc: Yanteng Si <siyanteng@loongson.cn>
Cc: Jonathan Corbet <corbet@lwn.net>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20231129030443.2753833-1-swboyd@chromium.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 Documentation/devicetree/bindings/arm/qcom.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/arm/qcom.yaml b/Documentation/devicetree/bindings/arm/qcom.yaml
index adbfaea32343..90f31beb80c2 100644
--- a/Documentation/devicetree/bindings/arm/qcom.yaml
+++ b/Documentation/devicetree/bindings/arm/qcom.yaml
@@ -136,7 +136,7 @@ description: |
   There are many devices in the list below that run the standard ChromeOS
   bootloader setup and use the open source depthcharge bootloader to boot the
   OS. These devices do not use the scheme described above. For details, see:
-  https://docs.kernel.org/arm/google/chromebook-boot-flow.html
+  https://docs.kernel.org/arch/arm/google/chromebook-boot-flow.html
 
 properties:
   $nodename:
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 107/583] arm64: dts: qcom: sc8180x-primus: Fix HALL_INT polarity
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (105 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 106/583] dt-bindings: arm: qcom: Fix html link Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 108/583] arm64: dts: qcom: sm8450: correct TX Soundwire clock Greg Kroah-Hartman
                   ` (482 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Bjorn Andersson, Konrad Dybcio,
	Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bjorn Andersson <quic_bjorande@quicinc.com>

[ Upstream commit 1aaa08e8de365cce59203541cafadb5053b1ec1a ]

The hall sensor interrupt on the Primus is active low, which means that
with the current configuration the device attempts to suspend when the
LID is open.

Fix the polarity of the HALL_INT GPIO to avoid this.

Fixes: 2ce38cc1e8fe ("arm64: dts: qcom: sc8180x: Introduce Primus")
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231130-sc8180x-primus-lid-polarity-v1-1-da917b59604b@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sc8180x-primus.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
index 834e6f9fb7c8..ae008c3b0aed 100644
--- a/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
+++ b/arch/arm64/boot/dts/qcom/sc8180x-primus.dts
@@ -42,7 +42,7 @@ gpio-keys {
 		pinctrl-0 = <&hall_int_active_state>;
 
 		lid-switch {
-			gpios = <&tlmm 121 GPIO_ACTIVE_HIGH>;
+			gpios = <&tlmm 121 GPIO_ACTIVE_LOW>;
 			linux,input-type = <EV_SW>;
 			linux,code = <SW_LID>;
 			wakeup-source;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 108/583] arm64: dts: qcom: sm8450: correct TX Soundwire clock
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (106 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 107/583] arm64: dts: qcom: sc8180x-primus: Fix HALL_INT polarity Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 109/583] arm64: dts: qcom: sm8550: " Greg Kroah-Hartman
                   ` (481 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Neil Armstrong, Krzysztof Kozlowski,
	Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

[ Upstream commit 20e886590a310665244a354e3b693b881544edec ]

The TX Soundwire controller should take clock from TX macro codec, not
VA macro codec clock, otherwise the clock stays disabled.  This looks
like a copy-paste issue, because the SC8280xp code uses here correctly
clock from TX macro.  The VA macro clock is already consumed by TX macro
codec, thus it won't be disabled by this change.

Fixes: 14341e76dbc7 ("arm64: dts: qcom: sm8450: add Soundwire and LPASS")
Reported-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231129140537.161720-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sm8450.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8450.dtsi b/arch/arm64/boot/dts/qcom/sm8450.dtsi
index 2a60cf8bd891..79cc8fbcd846 100644
--- a/arch/arm64/boot/dts/qcom/sm8450.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi
@@ -2325,7 +2325,7 @@ swr2: soundwire-controller@33b0000 {
 				     <GIC_SPI 520 IRQ_TYPE_LEVEL_HIGH>;
 			interrupt-names = "core", "wakeup";
 
-			clocks = <&vamacro>;
+			clocks = <&txmacro>;
 			clock-names = "iface";
 			label = "TX";
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 109/583] arm64: dts: qcom: sm8550: correct TX Soundwire clock
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (107 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 108/583] arm64: dts: qcom: sm8450: correct TX Soundwire clock Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 110/583] arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered Greg Kroah-Hartman
                   ` (480 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Neil Armstrong, Krzysztof Kozlowski,
	Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

[ Upstream commit ead0f132fc494b46fcd94788456f9b264fd631bb ]

The TX Soundwire controller should take clock from TX macro codec, not
VA macro codec clock, otherwise the clock stays disabled.  This looks
like a copy-paste issue, because the SC8280xp code uses here correctly
clock from TX macro.  The VA macro clock is already consumed by TX macro
codec, thus it won't be disabled by this change.

Fixes: 61b006389bb7 ("arm64: dts: qcom: sm8550: add Soundwire controllers")
Reported-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231129140537.161720-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sm8550.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi
index d115960bdeec..52c0c1730702 100644
--- a/arch/arm64/boot/dts/qcom/sm8550.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi
@@ -2178,7 +2178,7 @@ swr2: soundwire-controller@6d30000 {
 			interrupts = <GIC_SPI 496 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 520 IRQ_TYPE_LEVEL_HIGH>;
 			interrupt-names = "core", "wakeup";
-			clocks = <&lpass_vamacro>;
+			clocks = <&lpass_txmacro>;
 			clock-names = "iface";
 			label = "TX";
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 110/583] arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (108 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 109/583] arm64: dts: qcom: sm8550: " Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 111/583] arm64: dts: qcom: sc7280: Mark some nodes as reserved Greg Kroah-Hartman
                   ` (479 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Guenter Roeck, Stephen Boyd,
	Douglas Anderson, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Douglas Anderson <dianders@chromium.org>

[ Upstream commit 7ac90b4cf107a3999b30844d7899e0331686b33b ]

On sc7180 when the watchdog timer fires your logs get filled with:
  watchdog0: pretimeout event
  watchdog0: pretimeout event
  watchdog0: pretimeout event
  ...
  watchdog0: pretimeout event

If you're using console-ramoops to debug crashes the above gets quite
annoying since it blows away any other log messages that might have
been there.

The issue is that the "bark" interrupt (AKA the "pretimeout"
interrupt) remains high until the watchdog is pet. Since we've got
things configured as "level" triggered we'll keep getting interrupted
over and over.

Let's switch to edge triggered. Now we'll get one interrupt when the
"bark" interrupt goes off and won't get another one until the "bark"
interrupt is cleared and asserts again.

This matches how many older Qualcomm SoCs have things configured.

Fixes: 28cc13e4060c ("arm64: dts: qcom: sc7180: Add watchdog bark interrupt")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20231106144335.v2.1.Ic7577567baff921347d423b722de8b857602efb1@changeid
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi
index a79c0f2e1879..589ae40cd3cc 100644
--- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
@@ -3587,7 +3587,7 @@ watchdog@17c10000 {
 			compatible = "qcom,apss-wdt-sc7180", "qcom,kpss-wdt";
 			reg = <0 0x17c10000 0 0x1000>;
 			clocks = <&sleep_clk>;
-			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
 		};
 
 		timer@17c20000 {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 111/583] arm64: dts: qcom: sc7280: Mark some nodes as reserved
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (109 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 110/583] arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 112/583] arm64: dts: qcom: sc7280: Make watchdog bark interrupt edge triggered Greg Kroah-Hartman
                   ` (478 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Luca Weiss, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Luca Weiss <luca.weiss@fairphone.com>

[ Upstream commit 6da24ba932082bae110feb917a64bb54637fa7c0 ]

With the standard Qualcomm TrustZone setup, components such as lpasscc,
pdc_reset and watchdog shouldn't be touched by Linux. Mark them with
the status 'reserved' and reenable them in the chrome-common dtsi.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Link: https://lore.kernel.org/r/20230919-fp5-initial-v2-1-14bb7cedadf5@fairphone.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Stable-dep-of: 6897fac411db ("arm64: dts: qcom: sc7280: Make watchdog bark interrupt edge triggered")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../boot/dts/qcom/sc7280-chrome-common.dtsi   | 24 +++++++++++++++++++
 arch/arm64/boot/dts/qcom/sc7280.dtsi          |  8 ++++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi b/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi
index 2e1cd219fc18..5d462ae14ba1 100644
--- a/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi
@@ -46,6 +46,26 @@ wpss_mem: memory@9ae00000 {
 	};
 };
 
+&lpass_aon {
+	status = "okay";
+};
+
+&lpass_core {
+	status = "okay";
+};
+
+&lpass_hm {
+	status = "okay";
+};
+
+&lpasscc {
+	status = "okay";
+};
+
+&pdc_reset {
+	status = "okay";
+};
+
 /* The PMIC PON code isn't compatible w/ how Chrome EC/BIOS handle things. */
 &pmk8350_pon {
 	status = "disabled";
@@ -84,6 +104,10 @@ &scm {
 	dma-coherent;
 };
 
+&watchdog {
+	status = "okay";
+};
+
 &wifi {
 	status = "okay";
 
diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
index 91bb58c6b1a6..6f2a8f60856d 100644
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
@@ -2255,6 +2255,7 @@ lpasscc: lpasscc@3000000 {
 			clocks = <&gcc GCC_CFG_NOC_LPASS_CLK>;
 			clock-names = "iface";
 			#clock-cells = <1>;
+			status = "reserved"; /* Owned by ADSP firmware */
 		};
 
 		lpass_rx_macro: codec@3200000 {
@@ -2406,6 +2407,7 @@ lpass_aon: clock-controller@3380000 {
 			clock-names = "bi_tcxo", "bi_tcxo_ao", "iface";
 			#clock-cells = <1>;
 			#power-domain-cells = <1>;
+			status = "reserved"; /* Owned by ADSP firmware */
 		};
 
 		lpass_core: clock-controller@3900000 {
@@ -2416,6 +2418,7 @@ lpass_core: clock-controller@3900000 {
 			power-domains = <&lpass_hm LPASS_CORE_CC_LPASS_CORE_HM_GDSC>;
 			#clock-cells = <1>;
 			#power-domain-cells = <1>;
+			status = "reserved"; /* Owned by ADSP firmware */
 		};
 
 		lpass_cpu: audio@3987000 {
@@ -2486,6 +2489,7 @@ lpass_hm: clock-controller@3c00000 {
 			clock-names = "bi_tcxo";
 			#clock-cells = <1>;
 			#power-domain-cells = <1>;
+			status = "reserved"; /* Owned by ADSP firmware */
 		};
 
 		lpass_ag_noc: interconnect@3c40000 {
@@ -4199,6 +4203,7 @@ pdc_reset: reset-controller@b5e0000 {
 			compatible = "qcom,sc7280-pdc-global";
 			reg = <0 0x0b5e0000 0 0x20000>;
 			#reset-cells = <1>;
+			status = "reserved"; /* Owned by firmware */
 		};
 
 		tsens0: thermal-sensor@c263000 {
@@ -5195,11 +5200,12 @@ msi-controller@17a40000 {
 			};
 		};
 
-		watchdog@17c10000 {
+		watchdog: watchdog@17c10000 {
 			compatible = "qcom,apss-wdt-sc7280", "qcom,kpss-wdt";
 			reg = <0 0x17c10000 0 0x1000>;
 			clocks = <&sleep_clk>;
 			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			status = "reserved"; /* Owned by Gunyah hyp */
 		};
 
 		timer@17c20000 {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 112/583] arm64: dts: qcom: sc7280: Make watchdog bark interrupt edge triggered
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (110 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 111/583] arm64: dts: qcom: sc7280: Mark some nodes as reserved Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 113/583] arm64: dts: qcom: sdm845: " Greg Kroah-Hartman
                   ` (477 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Guenter Roeck, Stephen Boyd,
	Douglas Anderson, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Douglas Anderson <dianders@chromium.org>

[ Upstream commit 6897fac411db7b43243f67d4fd4d3f95abf7f656 ]

As described in the patch ("arm64: dts: qcom: sc7180: Make watchdog
bark interrupt edge triggered"), the Qualcomm watchdog timer's bark
interrupt should be configured as edge triggered. Make the change.

Fixes: 0e51f883daa9 ("arm64: dts: qcom: sc7280: Add APSS watchdog node")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20231106144335.v2.2.I11f77956d2492c88aca0ef5462123f225caf4fb4@changeid
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sc7280.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
index 6f2a8f60856d..95c35892fb85 100644
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
@@ -5204,7 +5204,7 @@ watchdog: watchdog@17c10000 {
 			compatible = "qcom,apss-wdt-sc7280", "qcom,kpss-wdt";
 			reg = <0 0x17c10000 0 0x1000>;
 			clocks = <&sleep_clk>;
-			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
 			status = "reserved"; /* Owned by Gunyah hyp */
 		};
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 113/583] arm64: dts: qcom: sdm845: Make watchdog bark interrupt edge triggered
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (111 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 112/583] arm64: dts: qcom: sc7280: Make watchdog bark interrupt edge triggered Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 114/583] arm64: dts: qcom: sm8150: " Greg Kroah-Hartman
                   ` (476 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Guenter Roeck, Stephen Boyd,
	Douglas Anderson, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Douglas Anderson <dianders@chromium.org>

[ Upstream commit 263b348499454f38d36b9442c3cf9279c571bb54 ]

As described in the patch ("arm64: dts: qcom: sc7180: Make watchdog
bark interrupt edge triggered"), the Qualcomm watchdog timer's bark
interrupt should be configured as edge triggered. Make the change.

Fixes: 36c436b03c58 ("arm64: dts: qcom: sdm845: Add watchdog bark interrupt")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20231106144335.v2.3.I16675ebe5517c68453a1bd7f4334ff885f806c03@changeid
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 055ca80c0075..2cf1993a8190 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -5118,7 +5118,7 @@ watchdog@17980000 {
 			compatible = "qcom,apss-wdt-sdm845", "qcom,kpss-wdt";
 			reg = <0 0x17980000 0 0x1000>;
 			clocks = <&sleep_clk>;
-			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
 		};
 
 		apss_shared: mailbox@17990000 {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 114/583] arm64: dts: qcom: sm8150: Make watchdog bark interrupt edge triggered
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (112 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 113/583] arm64: dts: qcom: sdm845: " Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 115/583] arm64: dts: qcom: sm8250: " Greg Kroah-Hartman
                   ` (475 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Guenter Roeck, Stephen Boyd,
	Douglas Anderson, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Douglas Anderson <dianders@chromium.org>

[ Upstream commit 9204e9a4099212c850e1703c374ef4538080825b ]

As described in the patch ("arm64: dts: qcom: sc7180: Make watchdog
bark interrupt edge triggered"), the Qualcomm watchdog timer's bark
interrupt should be configured as edge triggered. Make the change.

Fixes: b094c8f8dd2a ("arm64: dts: qcom: sm8150: Add watchdog bark interrupt")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20231106144335.v2.4.I23d0aa6c8f1fec5c26ad9b3c610df6f4c5392850@changeid
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
index 19c6003dca15..d7a2c3567532 100644
--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
@@ -4197,7 +4197,7 @@ watchdog@17c10000 {
 			compatible = "qcom,apss-wdt-sm8150", "qcom,kpss-wdt";
 			reg = <0 0x17c10000 0 0x1000>;
 			clocks = <&sleep_clk>;
-			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
 		};
 
 		timer@17c20000 {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 115/583] arm64: dts: qcom: sm8250: Make watchdog bark interrupt edge triggered
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (113 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 114/583] arm64: dts: qcom: sm8150: " Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 116/583] arm64: dts: qcom: sa8775p: " Greg Kroah-Hartman
                   ` (474 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Guenter Roeck, Stephen Boyd,
	Douglas Anderson, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Douglas Anderson <dianders@chromium.org>

[ Upstream commit 735d80e2e8e5d073ae8b1fff8b1589ea284aa5af ]

As described in the patch ("arm64: dts: qcom: sc7180: Make watchdog
bark interrupt edge triggered"), the Qualcomm watchdog timer's bark
interrupt should be configured as edge triggered. Make the change.

Fixes: 46a4359f9156 ("arm64: dts: qcom: sm8250: Add watchdog bark interrupt")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20231106144335.v2.5.I2910e7c10493d896841e9785c1817df9b9a58701@changeid
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sm8250.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
index a4e58ad731c3..1a98481d0c7f 100644
--- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
@@ -5664,7 +5664,7 @@ watchdog@17c10000 {
 			compatible = "qcom,apss-wdt-sm8250", "qcom,kpss-wdt";
 			reg = <0 0x17c10000 0 0x1000>;
 			clocks = <&sleep_clk>;
-			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
 		};
 
 		timer@17c20000 {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 116/583] arm64: dts: qcom: sa8775p: Make watchdog bark interrupt edge triggered
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (114 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 115/583] arm64: dts: qcom: sm8250: " Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 117/583] arm64: dts: qcom: sc8280xp: " Greg Kroah-Hartman
                   ` (473 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Guenter Roeck, Stephen Boyd,
	Douglas Anderson, Bartosz Golaszewski, Bjorn Andersson,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Douglas Anderson <dianders@chromium.org>

[ Upstream commit 48d5cf4772ec6268853158d9ffc54612e988ebe6 ]

As described in the patch ("arm64: dts: qcom: sc7180: Make watchdog
bark interrupt edge triggered"), the Qualcomm watchdog timer's bark
interrupt should be configured as edge triggered. Make the change.

Fixes: 09b701b89a76 ("arm64: dts: qcom: sa8775p: add the watchdog node")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20231106144335.v2.6.I909b7c4453d7b7fb0db4b6e49aa21666279d827d@changeid
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sa8775p.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sa8775p.dtsi b/arch/arm64/boot/dts/qcom/sa8775p.dtsi
index 9f4f58e831a4..be31ef35dfe8 100644
--- a/arch/arm64/boot/dts/qcom/sa8775p.dtsi
+++ b/arch/arm64/boot/dts/qcom/sa8775p.dtsi
@@ -2173,7 +2173,7 @@ watchdog@17c10000 {
 			compatible = "qcom,apss-wdt-sa8775p", "qcom,kpss-wdt";
 			reg = <0x0 0x17c10000 0x0 0x1000>;
 			clocks = <&sleep_clk>;
-			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
 		};
 
 		memtimer: timer@17c20000 {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 117/583] arm64: dts: qcom: sc8280xp: Make watchdog bark interrupt edge triggered
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (115 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 116/583] arm64: dts: qcom: sa8775p: " Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 118/583] arm64: dts: qcom: sm6350: " Greg Kroah-Hartman
                   ` (472 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Guenter Roeck, Stephen Boyd,
	Douglas Anderson, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Douglas Anderson <dianders@chromium.org>

[ Upstream commit 6c4a9c7ea486da490400c84ba2768c90d228c283 ]

As described in the patch ("arm64: dts: qcom: sc7180: Make watchdog
bark interrupt edge triggered"), the Qualcomm watchdog timer's bark
interrupt should be configured as edge triggered. Make the change.

Fixes: 152d1faf1e2f ("arm64: dts: qcom: add SC8280XP platform")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20231106144335.v2.7.I1c8ab71570f6906fd020decb80675f05fbe1fe74@changeid
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
index cad59af7ccef..b8081513176a 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
@@ -4225,7 +4225,7 @@ watchdog@17c10000 {
 			compatible = "qcom,apss-wdt-sc8280xp", "qcom,kpss-wdt";
 			reg = <0 0x17c10000 0 0x1000>;
 			clocks = <&sleep_clk>;
-			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
 		};
 
 		timer@17c20000 {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 118/583] arm64: dts: qcom: sm6350: Make watchdog bark interrupt edge triggered
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (116 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 117/583] arm64: dts: qcom: sc8280xp: " Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 119/583] bpf: Add map and need_defer parameters to .map_fd_put_ptr() Greg Kroah-Hartman
                   ` (471 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Guenter Roeck, Stephen Boyd,
	Douglas Anderson, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Douglas Anderson <dianders@chromium.org>

[ Upstream commit 5b84bb2b8d86595544fc8272364b0f1a34b68a4f ]

As described in the patch ("arm64: dts: qcom: sc7180: Make watchdog
bark interrupt edge triggered"), the Qualcomm watchdog timer's bark
interrupt should be configured as edge triggered. Make the change.

Fixes: 5f82b9cda61e ("arm64: dts: qcom: Add SM6350 device tree")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20231106144335.v2.8.Ic1d4402e99c70354d501ccd98105e908a902f671@changeid
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sm6350.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi b/arch/arm64/boot/dts/qcom/sm6350.dtsi
index 8fd6f4d03490..6464e144c228 100644
--- a/arch/arm64/boot/dts/qcom/sm6350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi
@@ -2524,7 +2524,7 @@ watchdog@17c10000 {
 			compatible = "qcom,apss-wdt-sm6350", "qcom,kpss-wdt";
 			reg = <0 0x17c10000 0 0x1000>;
 			clocks = <&sleep_clk>;
-			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
 		};
 
 		timer@17c20000 {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 119/583] bpf: Add map and need_defer parameters to .map_fd_put_ptr()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (117 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 118/583] arm64: dts: qcom: sm6350: " Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 120/583] bpf: Defer the free of inner map when necessary Greg Kroah-Hartman
                   ` (470 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hou Tao, Alexei Starovoitov, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hou Tao <houtao1@huawei.com>

[ Upstream commit 20c20bd11a0702ce4dc9300c3da58acf551d9725 ]

map is the pointer of outer map, and need_defer needs some explanation.
need_defer tells the implementation to defer the reference release of
the passed element and ensure that the element is still alive before
the bpf program, which may manipulate it, exits.

The following three cases will invoke map_fd_put_ptr() and different
need_defer values will be passed to these callers:

1) release the reference of the old element in the map during map update
   or map deletion. The release must be deferred, otherwise the bpf
   program may incur use-after-free problem, so need_defer needs to be
   true.
2) release the reference of the to-be-added element in the error path of
   map update. The to-be-added element is not visible to any bpf
   program, so it is OK to pass false for need_defer parameter.
3) release the references of all elements in the map during map release.
   Any bpf program which has access to the map must have been exited and
   released, so need_defer=false will be OK.

These two parameters will be used by the following patches to fix the
potential use-after-free problem for map-in-map.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20231204140425.1480317-3-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Stable-dep-of: 876673364161 ("bpf: Defer the free of inner map when necessary")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/bpf.h     |  6 +++++-
 kernel/bpf/arraymap.c   | 12 +++++++-----
 kernel/bpf/hashtab.c    |  6 +++---
 kernel/bpf/map_in_map.c |  2 +-
 kernel/bpf/map_in_map.h |  2 +-
 5 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 75e039081f92..4bed78e47347 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -106,7 +106,11 @@ struct bpf_map_ops {
 	/* funcs called by prog_array and perf_event_array map */
 	void *(*map_fd_get_ptr)(struct bpf_map *map, struct file *map_file,
 				int fd);
-	void (*map_fd_put_ptr)(void *ptr);
+	/* If need_defer is true, the implementation should guarantee that
+	 * the to-be-put element is still alive before the bpf program, which
+	 * may manipulate it, exists.
+	 */
+	void (*map_fd_put_ptr)(struct bpf_map *map, void *ptr, bool need_defer);
 	int (*map_gen_lookup)(struct bpf_map *map, struct bpf_insn *insn_buf);
 	u32 (*map_fd_sys_lookup_elem)(void *ptr);
 	void (*map_seq_show_elem)(struct bpf_map *map, void *key,
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c
index c85ff9162a5c..9bfad7e96913 100644
--- a/kernel/bpf/arraymap.c
+++ b/kernel/bpf/arraymap.c
@@ -867,7 +867,7 @@ int bpf_fd_array_map_update_elem(struct bpf_map *map, struct file *map_file,
 	}
 
 	if (old_ptr)
-		map->ops->map_fd_put_ptr(old_ptr);
+		map->ops->map_fd_put_ptr(map, old_ptr, true);
 	return 0;
 }
 
@@ -890,7 +890,7 @@ static long fd_array_map_delete_elem(struct bpf_map *map, void *key)
 	}
 
 	if (old_ptr) {
-		map->ops->map_fd_put_ptr(old_ptr);
+		map->ops->map_fd_put_ptr(map, old_ptr, true);
 		return 0;
 	} else {
 		return -ENOENT;
@@ -913,8 +913,9 @@ static void *prog_fd_array_get_ptr(struct bpf_map *map,
 	return prog;
 }
 
-static void prog_fd_array_put_ptr(void *ptr)
+static void prog_fd_array_put_ptr(struct bpf_map *map, void *ptr, bool need_defer)
 {
+	/* bpf_prog is freed after one RCU or tasks trace grace period */
 	bpf_prog_put(ptr);
 }
 
@@ -1201,8 +1202,9 @@ static void *perf_event_fd_array_get_ptr(struct bpf_map *map,
 	return ee;
 }
 
-static void perf_event_fd_array_put_ptr(void *ptr)
+static void perf_event_fd_array_put_ptr(struct bpf_map *map, void *ptr, bool need_defer)
 {
+	/* bpf_perf_event is freed after one RCU grace period */
 	bpf_event_entry_free_rcu(ptr);
 }
 
@@ -1256,7 +1258,7 @@ static void *cgroup_fd_array_get_ptr(struct bpf_map *map,
 	return cgroup_get_from_fd(fd);
 }
 
-static void cgroup_fd_array_put_ptr(void *ptr)
+static void cgroup_fd_array_put_ptr(struct bpf_map *map, void *ptr, bool need_defer)
 {
 	/* cgroup_put free cgrp after a rcu grace period */
 	cgroup_put(ptr);
diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c
index fd8d4b0addfc..5b9146fa825f 100644
--- a/kernel/bpf/hashtab.c
+++ b/kernel/bpf/hashtab.c
@@ -897,7 +897,7 @@ static void htab_put_fd_value(struct bpf_htab *htab, struct htab_elem *l)
 
 	if (map->ops->map_fd_put_ptr) {
 		ptr = fd_htab_map_get_ptr(map, l);
-		map->ops->map_fd_put_ptr(ptr);
+		map->ops->map_fd_put_ptr(map, ptr, true);
 	}
 }
 
@@ -2484,7 +2484,7 @@ static void fd_htab_map_free(struct bpf_map *map)
 		hlist_nulls_for_each_entry_safe(l, n, head, hash_node) {
 			void *ptr = fd_htab_map_get_ptr(map, l);
 
-			map->ops->map_fd_put_ptr(ptr);
+			map->ops->map_fd_put_ptr(map, ptr, false);
 		}
 	}
 
@@ -2525,7 +2525,7 @@ int bpf_fd_htab_map_update_elem(struct bpf_map *map, struct file *map_file,
 
 	ret = htab_map_update_elem(map, key, &ptr, map_flags);
 	if (ret)
-		map->ops->map_fd_put_ptr(ptr);
+		map->ops->map_fd_put_ptr(map, ptr, false);
 
 	return ret;
 }
diff --git a/kernel/bpf/map_in_map.c b/kernel/bpf/map_in_map.c
index cd5eafaba97e..2dfeb5835e16 100644
--- a/kernel/bpf/map_in_map.c
+++ b/kernel/bpf/map_in_map.c
@@ -127,7 +127,7 @@ void *bpf_map_fd_get_ptr(struct bpf_map *map,
 	return inner_map;
 }
 
-void bpf_map_fd_put_ptr(void *ptr)
+void bpf_map_fd_put_ptr(struct bpf_map *map, void *ptr, bool need_defer)
 {
 	/* ptr->ops->map_free() has to go through one
 	 * rcu grace period by itself.
diff --git a/kernel/bpf/map_in_map.h b/kernel/bpf/map_in_map.h
index bcb7534afb3c..7d61602354de 100644
--- a/kernel/bpf/map_in_map.h
+++ b/kernel/bpf/map_in_map.h
@@ -13,7 +13,7 @@ struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd);
 void bpf_map_meta_free(struct bpf_map *map_meta);
 void *bpf_map_fd_get_ptr(struct bpf_map *map, struct file *map_file,
 			 int ufd);
-void bpf_map_fd_put_ptr(void *ptr);
+void bpf_map_fd_put_ptr(struct bpf_map *map, void *ptr, bool need_defer);
 u32 bpf_map_fd_sys_lookup_elem(void *ptr);
 
 #endif
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 120/583] bpf: Defer the free of inner map when necessary
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (118 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 119/583] bpf: Add map and need_defer parameters to .map_fd_put_ptr() Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 121/583] selftests/net: specify the interface when do arping Greg Kroah-Hartman
                   ` (469 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hou Tao, Alexei Starovoitov, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hou Tao <houtao1@huawei.com>

[ Upstream commit 876673364161da50eed6b472d746ef88242b2368 ]

When updating or deleting an inner map in map array or map htab, the map
may still be accessed by non-sleepable program or sleepable program.
However bpf_map_fd_put_ptr() decreases the ref-counter of the inner map
directly through bpf_map_put(), if the ref-counter is the last one
(which is true for most cases), the inner map will be freed by
ops->map_free() in a kworker. But for now, most .map_free() callbacks
don't use synchronize_rcu() or its variants to wait for the elapse of a
RCU grace period, so after the invocation of ops->map_free completes,
the bpf program which is accessing the inner map may incur
use-after-free problem.

Fix the free of inner map by invoking bpf_map_free_deferred() after both
one RCU grace period and one tasks trace RCU grace period if the inner
map has been removed from the outer map before. The deferment is
accomplished by using call_rcu() or call_rcu_tasks_trace() when
releasing the last ref-counter of bpf map. The newly-added rcu_head
field in bpf_map shares the same storage space with work field to
reduce the size of bpf_map.

Fixes: bba1dc0b55ac ("bpf: Remove redundant synchronize_rcu.")
Fixes: 638e4b825d52 ("bpf: Allows per-cpu maps and map-in-map in sleepable programs")
Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20231204140425.1480317-5-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/bpf.h     |  7 ++++++-
 kernel/bpf/map_in_map.c | 11 ++++++++---
 kernel/bpf/syscall.c    | 32 +++++++++++++++++++++++++++-----
 3 files changed, 41 insertions(+), 9 deletions(-)

diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 4bed78e47347..9b08d792fa95 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -275,7 +275,11 @@ struct bpf_map {
 	 */
 	atomic64_t refcnt ____cacheline_aligned;
 	atomic64_t usercnt;
-	struct work_struct work;
+	/* rcu is used before freeing and work is only used during freeing */
+	union {
+		struct work_struct work;
+		struct rcu_head rcu;
+	};
 	struct mutex freeze_mutex;
 	atomic64_t writecnt;
 	/* 'Ownership' of program-containing map is claimed by the first program
@@ -291,6 +295,7 @@ struct bpf_map {
 	} owner;
 	bool bypass_spec_v1;
 	bool frozen; /* write-once; write-protected by freeze_mutex */
+	bool free_after_mult_rcu_gp;
 	s64 __percpu *elem_count;
 };
 
diff --git a/kernel/bpf/map_in_map.c b/kernel/bpf/map_in_map.c
index 2dfeb5835e16..3248ff5d8161 100644
--- a/kernel/bpf/map_in_map.c
+++ b/kernel/bpf/map_in_map.c
@@ -129,10 +129,15 @@ void *bpf_map_fd_get_ptr(struct bpf_map *map,
 
 void bpf_map_fd_put_ptr(struct bpf_map *map, void *ptr, bool need_defer)
 {
-	/* ptr->ops->map_free() has to go through one
-	 * rcu grace period by itself.
+	struct bpf_map *inner_map = ptr;
+
+	/* The inner map may still be used by both non-sleepable and sleepable
+	 * bpf program, so free it after one RCU grace period and one tasks
+	 * trace RCU grace period.
 	 */
-	bpf_map_put(ptr);
+	if (need_defer)
+		WRITE_ONCE(inner_map->free_after_mult_rcu_gp, true);
+	bpf_map_put(inner_map);
 }
 
 u32 bpf_map_fd_sys_lookup_elem(void *ptr)
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index d77b2f8b9364..1625b9d5202c 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -717,6 +717,28 @@ static void bpf_map_put_uref(struct bpf_map *map)
 	}
 }
 
+static void bpf_map_free_in_work(struct bpf_map *map)
+{
+	INIT_WORK(&map->work, bpf_map_free_deferred);
+	/* Avoid spawning kworkers, since they all might contend
+	 * for the same mutex like slab_mutex.
+	 */
+	queue_work(system_unbound_wq, &map->work);
+}
+
+static void bpf_map_free_rcu_gp(struct rcu_head *rcu)
+{
+	bpf_map_free_in_work(container_of(rcu, struct bpf_map, rcu));
+}
+
+static void bpf_map_free_mult_rcu_gp(struct rcu_head *rcu)
+{
+	if (rcu_trace_implies_rcu_gp())
+		bpf_map_free_rcu_gp(rcu);
+	else
+		call_rcu(rcu, bpf_map_free_rcu_gp);
+}
+
 /* decrement map refcnt and schedule it for freeing via workqueue
  * (underlying map implementation ops->map_free() might sleep)
  */
@@ -726,11 +748,11 @@ void bpf_map_put(struct bpf_map *map)
 		/* bpf_map_free_id() must be called first */
 		bpf_map_free_id(map);
 		btf_put(map->btf);
-		INIT_WORK(&map->work, bpf_map_free_deferred);
-		/* Avoid spawning kworkers, since they all might contend
-		 * for the same mutex like slab_mutex.
-		 */
-		queue_work(system_unbound_wq, &map->work);
+
+		if (READ_ONCE(map->free_after_mult_rcu_gp))
+			call_rcu_tasks_trace(&map->rcu, bpf_map_free_mult_rcu_gp);
+		else
+			bpf_map_free_in_work(map);
 	}
 }
 EXPORT_SYMBOL_GPL(bpf_map_put);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 121/583] selftests/net: specify the interface when do arping
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (119 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 120/583] bpf: Defer the free of inner map when necessary Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 122/583] bpf: fix check for attempt to corrupt spilled pointer Greg Kroah-Hartman
                   ` (468 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Hangbin Liu, Paolo Abeni, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hangbin Liu <liuhangbin@gmail.com>

[ Upstream commit 7f770d28f2e5abfd442ad689ba1129dd66593529 ]

When do arping, the interface need to be specified. Or we will
get error: Interface "lo" is not ARPable. And the test failed.
]# ./arp_ndisc_untracked_subnets.sh
    TEST: test_arp:  accept_arp=0                                       [ OK ]
    TEST: test_arp:  accept_arp=1                                       [FAIL]
    TEST: test_arp:  accept_arp=2  same_subnet=0                        [ OK ]
    TEST: test_arp:  accept_arp=2  same_subnet=1                        [FAIL]

After fix:
]# ./arp_ndisc_untracked_subnets.sh
    TEST: test_arp:  accept_arp=0                                       [ OK ]
    TEST: test_arp:  accept_arp=1                                       [ OK ]
    TEST: test_arp:  accept_arp=2  same_subnet=0                        [ OK ]
    TEST: test_arp:  accept_arp=2  same_subnet=1                        [ OK ]

Fixes: 0ea7b0a454ca ("selftests: net: arp_ndisc_untracked_subnets: test for arp_accept and accept_untracked_na")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/net/arp_ndisc_untracked_subnets.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/arp_ndisc_untracked_subnets.sh b/tools/testing/selftests/net/arp_ndisc_untracked_subnets.sh
index c899b446acb6..327427ec10f5 100755
--- a/tools/testing/selftests/net/arp_ndisc_untracked_subnets.sh
+++ b/tools/testing/selftests/net/arp_ndisc_untracked_subnets.sh
@@ -150,7 +150,7 @@ arp_test_gratuitous() {
 	fi
 	# Supply arp_accept option to set up which sets it in sysctl
 	setup ${arp_accept}
-	ip netns exec ${HOST_NS} arping -A -U ${HOST_ADDR} -c1 2>&1 >/dev/null
+	ip netns exec ${HOST_NS} arping -A -I ${HOST_INTF} -U ${HOST_ADDR} -c1 2>&1 >/dev/null
 
 	if verify_arp $1 $2; then
 		printf "    TEST: %-60s  [ OK ]\n" "${test_msg[*]}"
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 122/583] bpf: fix check for attempt to corrupt spilled pointer
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (120 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 121/583] selftests/net: specify the interface when do arping Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 123/583] scsi: fnic: Return error if vmalloc() failed Greg Kroah-Hartman
                   ` (467 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Andrii Nakryiko, Alexei Starovoitov,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Andrii Nakryiko <andrii@kernel.org>

[ Upstream commit ab125ed3ec1c10ccc36bc98c7a4256ad114a3dae ]

When register is spilled onto a stack as a 1/2/4-byte register, we set
slot_type[BPF_REG_SIZE - 1] (plus potentially few more below it,
depending on actual spill size). So to check if some stack slot has
spilled register we need to consult slot_type[7], not slot_type[0].

To avoid the need to remember and double-check this in the future, just
use is_spilled_reg() helper.

Fixes: 27113c59b6d0 ("bpf: Check the other end of slot_type for STACK_SPILL")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20231205184248.1502704-4-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/verifier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 2deae0db03e8..24152ac6a393 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -4330,7 +4330,7 @@ static int check_stack_write_fixed_off(struct bpf_verifier_env *env,
 	 * so it's aligned access and [off, off + size) are within stack limits
 	 */
 	if (!env->allow_ptr_leaks &&
-	    state->stack[spi].slot_type[0] == STACK_SPILL &&
+	    is_spilled_reg(&state->stack[spi]) &&
 	    size != BPF_REG_SIZE) {
 		verbose(env, "attempt to corrupt spilled pointer on stack\n");
 		return -EACCES;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 123/583] scsi: fnic: Return error if vmalloc() failed
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (121 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 122/583] bpf: fix check for attempt to corrupt spilled pointer Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 124/583] arm64: dts: qcom: qrb2210-rb1: Hook up USB3 Greg Kroah-Hartman
                   ` (466 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Artem Chernyshev, Karan Tilak Kumar,
	Martin K. Petersen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Artem Chernyshev <artem.chernyshev@red-soft.ru>

[ Upstream commit f5f27a332a14f43463aa0075efa3a0c662c0f4a8 ]

In fnic_init_module() exists redundant check for return value from
fnic_debugfs_init(), because at moment it only can return zero. It make
sense to process theoretical vmalloc() failure.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 9730ddfb123d ("scsi: fnic: remove redundant assignment of variable rc")
Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Link: https://lore.kernel.org/r/20231128111008.2280507-1-artem.chernyshev@red-soft.ru
Reviewed-by: Karan Tilak Kumar <kartilak@cisco.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/fnic/fnic_debugfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/fnic/fnic_debugfs.c b/drivers/scsi/fnic/fnic_debugfs.c
index c4d9ed0d7d75..2619a2d4f5f1 100644
--- a/drivers/scsi/fnic/fnic_debugfs.c
+++ b/drivers/scsi/fnic/fnic_debugfs.c
@@ -52,9 +52,10 @@ int fnic_debugfs_init(void)
 		fc_trc_flag->fnic_trace = 2;
 		fc_trc_flag->fc_trace = 3;
 		fc_trc_flag->fc_clear = 4;
+		return 0;
 	}
 
-	return 0;
+	return -ENOMEM;
 }
 
 /*
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 124/583] arm64: dts: qcom: qrb2210-rb1: Hook up USB3
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (122 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 123/583] scsi: fnic: Return error if vmalloc() failed Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 125/583] arm64: dts: qcom: qrb2210-rb1: use USB host mode Greg Kroah-Hartman
                   ` (465 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Dmitry Baryshkov,
	Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Konrad Dybcio <konrad.dybcio@linaro.org>

[ Upstream commit 59f9ff79cd9cf3bc10743d61662b5729fcffff24 ]

Configure the USB3 PHY to enable USB3 functionality

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20230906-topic-rb1_features_sans_icc-v1-5-e92ce6fbde16@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Stable-dep-of: e0cee8dc6757 ("arm64: dts: qcom: qrb2210-rb1: use USB host mode")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/qrb2210-rb1.dts | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
index 0f7c59187896..52be19d55aed 100644
--- a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
+++ b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
@@ -366,6 +366,12 @@ &usb {
 	status = "okay";
 };
 
+&usb_qmpphy {
+	vdda-phy-supply = <&pm2250_l12>;
+	vdda-pll-supply = <&pm2250_l13>;
+	status = "okay";
+};
+
 &usb_hsphy {
 	vdd-supply = <&pm2250_l12>;
 	vdda-pll-supply = <&pm2250_l13>;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 125/583] arm64: dts: qcom: qrb2210-rb1: use USB host mode
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (123 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 124/583] arm64: dts: qcom: qrb2210-rb1: Hook up USB3 Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 126/583] arm64: dts: qcom: qrb5165-rb5: correct LED panic indicator Greg Kroah-Hartman
                   ` (464 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Caleb Connolly, Konrad Dybcio,
	Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Caleb Connolly <caleb.connolly@linaro.org>

[ Upstream commit e0cee8dc6757f9f18718eec553be9fffa503e103 ]

The default for the QCM2290 platform that this board is based on is OTG
mode, however the role detection logic is not hooked up for this board
and the dwc3 driver is configured to not allow role switching from
userspace.

Force this board to host mode as this is the preferred usecase until we
get role switching hooked up.

Fixes: e18771961336 ("arm64: dts: qcom: Add initial QTI RB1 device tree")
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231025-b4-rb1-usb-host-v1-1-522616c575ef@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/qrb2210-rb1.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
index 52be19d55aed..37abb83ea464 100644
--- a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
+++ b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
@@ -372,6 +372,10 @@ &usb_qmpphy {
 	status = "okay";
 };
 
+&usb_dwc3 {
+	dr_mode = "host";
+};
+
 &usb_hsphy {
 	vdd-supply = <&pm2250_l12>;
 	vdda-pll-supply = <&pm2250_l13>;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 126/583] arm64: dts: qcom: qrb5165-rb5: correct LED panic indicator
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (124 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 125/583] arm64: dts: qcom: qrb2210-rb1: use USB host mode Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 127/583] arm64: dts: qcom: sdm845-db845c: " Greg Kroah-Hartman
                   ` (463 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski,
	Manivannan Sadhasivam, Konrad Dybcio, Bjorn Andersson,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

[ Upstream commit dc6b5562acbac0285ab3b2dad23930b6434bdfc6 ]

There is no "panic-indicator" default trigger but a property with that
name:

  qrb5165-rb5.dtb: leds: led-user4: Unevaluated properties are not allowed ('linux,default-trigger' was unexpected)

Fixes: b5cbd84e499a ("arm64: dts: qcom: qrb5165-rb5: Add onboard LED support")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231111094623.12476-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
index dfa8ee5c75af..e95a004c3391 100644
--- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
+++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
@@ -63,8 +63,8 @@ led-user4 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&pm8150_gpios 10 GPIO_ACTIVE_HIGH>;
-			linux,default-trigger = "panic-indicator";
 			default-state = "off";
+			panic-indicator;
 		};
 
 		led-wlan {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 127/583] arm64: dts: qcom: sdm845-db845c: correct LED panic indicator
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (125 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 126/583] arm64: dts: qcom: qrb5165-rb5: correct LED panic indicator Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:52 ` [PATCH 6.6 128/583] arm64: dts: qcom: sm6125: add interrupts to DWC3 USB controller Greg Kroah-Hartman
                   ` (462 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski, Konrad Dybcio,
	Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

[ Upstream commit 0c90c75e663246203a2b7f6dd9e08a110f4c3c43 ]

There is no "panic-indicator" default trigger but a property with that
name:

  sdm845-db845c.dtb: leds: led-0: Unevaluated properties are not allowed ('linux,default-trigger' was unexpected)

Fixes: 3f72e2d3e682 ("arm64: dts: qcom: Add Dragonboard 845c")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231111095617.16496-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
index c7eba6c491be..7e7bf3fb3be6 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
@@ -67,8 +67,8 @@ led-0 {
 			function = LED_FUNCTION_INDICATOR;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&pm8998_gpios 13 GPIO_ACTIVE_HIGH>;
-			linux,default-trigger = "panic-indicator";
 			default-state = "off";
+			panic-indicator;
 		};
 
 		led-1 {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 128/583] arm64: dts: qcom: sm6125: add interrupts to DWC3 USB controller
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (126 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 127/583] arm64: dts: qcom: sdm845-db845c: " Greg Kroah-Hartman
@ 2024-01-22 23:52 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 129/583] arm64: dts: qcom: sm8350: Fix DMA0 address Greg Kroah-Hartman
                   ` (461 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:52 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski, Marijn Suijten,
	Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

[ Upstream commit 67e4656f4487b95a39e45884c99235f62ebfaa47 ]

Add interrupts to SM6125 DWC3 USB controller, based on downstream/vendor
code of Trinket DTSI from Xiaomi Laurel device, to fix dtbs_check
warnings:

  sm6125-xiaomi-laurel-sprout.dtb: usb@4ef8800: 'interrupt-names' is a required property
  sm6125-xiaomi-laurel-sprout.dtb: usb@4ef8800: 'oneOf' conditional failed, one must be fixed:
    'interrupts' is a required property
    'interrupts-extended' is a required property

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Fixes: cff4bbaf2a2d ("arm64: dts: qcom: Add support for SM6125")
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
Link: https://lore.kernel.org/r/20231111164229.63803-5-krzysztof.kozlowski@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sm6125.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6125.dtsi b/arch/arm64/boot/dts/qcom/sm6125.dtsi
index 197f8fed19a2..07081088ba14 100644
--- a/arch/arm64/boot/dts/qcom/sm6125.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6125.dtsi
@@ -1165,6 +1165,10 @@ usb3: usb@4ef8800 {
 					  <&gcc GCC_USB30_PRIM_MASTER_CLK>;
 			assigned-clock-rates = <19200000>, <66666667>;
 
+			interrupts = <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 422 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "hs_phy_irq", "ss_phy_irq";
+
 			power-domains = <&gcc USB30_PRIM_GDSC>;
 			qcom,select-utmi-as-pipe-clk;
 			status = "disabled";
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 129/583] arm64: dts: qcom: sm8350: Fix DMA0 address
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (127 preceding siblings ...)
  2024-01-22 23:52 ` [PATCH 6.6 128/583] arm64: dts: qcom: sm6125: add interrupts to DWC3 USB controller Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 130/583] arm64: dts: qcom: sc7280: Fix up GPU SIDs Greg Kroah-Hartman
                   ` (460 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Nia Espera,
	Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nia Espera <nespera@igalia.com>

[ Upstream commit 01a9e9eb6cdbce175ddea3cbe1163daed6d54344 ]

DMA0 node downstream is specified at 0x900000, so fix the typo. Without
this, enabling any i2c node using DMA0 causes a hang.

Fixes: bc08fbf49bc8 ("arm64: dts: qcom: sm8350: Define GPI DMA engines")
Fixes: 41d6bca799b3 ("arm64: dts: qcom: sm8350: correct DMA controller unit address")
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Nia Espera <nespera@igalia.com>
Link: https://lore.kernel.org/r/20231111-nia-sm8350-for-upstream-v4-2-3a638b02eea5@igalia.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sm8350.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8350.dtsi b/arch/arm64/boot/dts/qcom/sm8350.dtsi
index a94e069da83d..a7cf506f24b6 100644
--- a/arch/arm64/boot/dts/qcom/sm8350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8350.dtsi
@@ -918,9 +918,9 @@ spi19: spi@894000 {
 			};
 		};
 
-		gpi_dma0: dma-controller@9800000 {
+		gpi_dma0: dma-controller@900000 {
 			compatible = "qcom,sm8350-gpi-dma", "qcom,sm6350-gpi-dma";
-			reg = <0 0x09800000 0 0x60000>;
+			reg = <0 0x00900000 0 0x60000>;
 			interrupts = <GIC_SPI 244 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 245 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 130/583] arm64: dts: qcom: sc7280: Fix up GPU SIDs
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (128 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 129/583] arm64: dts: qcom: sm8350: Fix DMA0 address Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 131/583] arm64: dts: qcom: sc7280: Mark Adreno SMMU as DMA coherent Greg Kroah-Hartman
                   ` (459 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Konrad Dybcio <konrad.dybcio@linaro.org>

[ Upstream commit 94085049fdad7a36fe14dd55e72e712fe55d6bca ]

GPU_SMMU SID 1 is meant for Adreno LPAC (Low Priority Async Compute).
On platforms that support it (in firmware), it is necessary to
describe that link, or Adreno register access will hang the board.

The current settings are functionally identical, *but* due to what is
likely hardcoded security policies, the secure firmware rejects them,
resulting in the board hanging. To avoid that, alter the settings such
that SID 0 and 1 are described separately.

Fixes: 96c471970b7b ("arm64: dts: qcom: sc7280: Add gpu support")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20230926-topic-a643-v2-2-06fa3d899c0a@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sc7280.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
index 95c35892fb85..4903d17c4207 100644
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
@@ -2558,7 +2558,8 @@ gpu: gpu@3d00000 {
 				    "cx_mem",
 				    "cx_dbgc";
 			interrupts = <GIC_SPI 300 IRQ_TYPE_LEVEL_HIGH>;
-			iommus = <&adreno_smmu 0 0x401>;
+			iommus = <&adreno_smmu 0 0x400>,
+				 <&adreno_smmu 1 0x400>;
 			operating-points-v2 = <&gpu_opp_table>;
 			qcom,gmu = <&gmu>;
 			interconnects = <&gem_noc MASTER_GFX3D 0 &mc_virt SLAVE_EBI1 0>;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 131/583] arm64: dts: qcom: sc7280: Mark Adreno SMMU as DMA coherent
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (129 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 130/583] arm64: dts: qcom: sc7280: Fix up GPU SIDs Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 132/583] arm64: dts: qcom: sa8775p: fix USB wakeup interrupt types Greg Kroah-Hartman
                   ` (458 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Akhil P Oommen, Konrad Dybcio,
	Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Konrad Dybcio <konrad.dybcio@linaro.org>

[ Upstream commit 31edad478534186a2718be9206ce7b19f2735f6e ]

The SMMUs on sc7280 are cache-coherent. APPS_SMMU is marked as such,
mark the GPU one as well.

Fixes: 96c471970b7b ("arm64: dts: qcom: sc7280: Add gpu support")
Reviewed-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20230926-topic-a643-v2-3-06fa3d899c0a@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sc7280.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
index 4903d17c4207..1fa1a615109a 100644
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
@@ -2733,6 +2733,7 @@ adreno_smmu: iommu@3da0000 {
 					"gpu_cc_hub_aon_clk";
 
 			power-domains = <&gpucc GPU_CC_CX_GDSC>;
+			dma-coherent;
 		};
 
 		remoteproc_mpss: remoteproc@4080000 {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 132/583] arm64: dts: qcom: sa8775p: fix USB wakeup interrupt types
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (130 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 131/583] arm64: dts: qcom: sc7280: Mark Adreno SMMU as DMA coherent Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 133/583] arm64: dts: qcom: sc7280: fix usb_2 " Greg Kroah-Hartman
                   ` (457 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Shazad Hussain, Johan Hovold,
	Andrew Halaney, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Johan Hovold <johan+linaro@kernel.org>

[ Upstream commit 0984bc0165f7c5203dfffe8cdb5186995f628a80 ]

The DP/DM wakeup interrupts are edge triggered and which edge to trigger
on depends on use-case and whether a Low speed or Full/High speed device
is connected.

Note that only triggering on rising edges can be used to detect resume
events but not disconnect events.

Fixes: de1001525c1a ("arm64: dts: qcom: sa8775p: add USB nodes")
Cc: Shazad Hussain <quic_shazhuss@quicinc.com>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Link: https://lore.kernel.org/r/20231120164331.8116-3-johan+linaro@kernel.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sa8775p.dtsi | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sa8775p.dtsi b/arch/arm64/boot/dts/qcom/sa8775p.dtsi
index be31ef35dfe8..d4ca92b98c7d 100644
--- a/arch/arm64/boot/dts/qcom/sa8775p.dtsi
+++ b/arch/arm64/boot/dts/qcom/sa8775p.dtsi
@@ -1602,8 +1602,8 @@ usb_0: usb@a6f8800 {
 			assigned-clock-rates = <19200000>, <200000000>;
 
 			interrupts-extended = <&intc GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>,
-					      <&pdc 14 IRQ_TYPE_EDGE_RISING>,
-					      <&pdc 15 IRQ_TYPE_EDGE_RISING>,
+					      <&pdc 14 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 15 IRQ_TYPE_EDGE_BOTH>,
 					      <&pdc 12 IRQ_TYPE_LEVEL_HIGH>;
 			interrupt-names = "pwr_event",
 					  "dp_hs_phy_irq",
@@ -1689,8 +1689,8 @@ usb_1: usb@a8f8800 {
 			assigned-clock-rates = <19200000>, <200000000>;
 
 			interrupts-extended = <&intc GIC_SPI 352 IRQ_TYPE_LEVEL_HIGH>,
-					      <&pdc 8 IRQ_TYPE_EDGE_RISING>,
-					      <&pdc 7 IRQ_TYPE_EDGE_RISING>,
+					      <&pdc 8 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 7 IRQ_TYPE_EDGE_BOTH>,
 					      <&pdc 13 IRQ_TYPE_LEVEL_HIGH>;
 			interrupt-names = "pwr_event",
 					  "dp_hs_phy_irq",
@@ -1752,8 +1752,8 @@ usb_2: usb@a4f8800 {
 			assigned-clock-rates = <19200000>, <200000000>;
 
 			interrupts-extended = <&intc GIC_SPI 444 IRQ_TYPE_LEVEL_HIGH>,
-					      <&pdc 10 IRQ_TYPE_EDGE_RISING>,
-					      <&pdc 9 IRQ_TYPE_EDGE_RISING>;
+					      <&pdc 10 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 9 IRQ_TYPE_EDGE_BOTH>;
 			interrupt-names = "pwr_event",
 					  "dp_hs_phy_irq",
 					  "dm_hs_phy_irq";
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 133/583] arm64: dts: qcom: sc7280: fix usb_2 wakeup interrupt types
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (131 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 132/583] arm64: dts: qcom: sa8775p: fix USB wakeup interrupt types Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 134/583] arm64: dts: qcom: sm8550: fix USB " Greg Kroah-Hartman
                   ` (456 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Johan Hovold, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Johan Hovold <johan+linaro@kernel.org>

[ Upstream commit 24f8aba9a7c77c7e9d814a5754798e8346c7dd28 ]

The DP/DM wakeup interrupts are edge triggered and which edge to trigger
on depends on use-case and whether a Low speed or Full/High speed device
is connected.

Note that only triggering on rising edges can be used to detect resume
events but not disconnect events.

Fixes: bb9efa59c665 ("arm64: dts: qcom: sc7280: Add USB related nodes")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20231120164331.8116-6-johan+linaro@kernel.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sc7280.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
index 1fa1a615109a..e6798447b29a 100644
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
@@ -3411,8 +3411,8 @@ usb_2: usb@8cf8800 {
 			assigned-clock-rates = <19200000>, <200000000>;
 
 			interrupts-extended = <&intc GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
-					      <&pdc 12 IRQ_TYPE_EDGE_RISING>,
-					      <&pdc 13 IRQ_TYPE_EDGE_RISING>;
+					      <&pdc 12 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 13 IRQ_TYPE_EDGE_BOTH>;
 			interrupt-names = "hs_phy_irq",
 					  "dp_hs_phy_irq",
 					  "dm_hs_phy_irq";
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 134/583] arm64: dts: qcom: sm8550: fix USB wakeup interrupt types
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (132 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 133/583] arm64: dts: qcom: sc7280: fix usb_2 " Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 135/583] wifi: mt76: fix typo in mt76_get_of_eeprom_from_nvmem function Greg Kroah-Hartman
                   ` (455 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Abel Vesa, Johan Hovold,
	Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Johan Hovold <johan+linaro@kernel.org>

[ Upstream commit 29d91ecf530a4ef0b7f94cb8cde07ed69731e45d ]

The DP/DM wakeup interrupts are edge triggered and which edge to trigger
on depends on use-case and whether a Low speed or Full/High speed device
is connected.

Note that only triggering on rising edges can be used to detect resume
events but not disconnect events.

Fixes: 7f7e5c1b037f ("arm64: dts: qcom: sm8550: Add USB PHYs and controller nodes")
Cc: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20231120164331.8116-12-johan+linaro@kernel.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sm8550.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi
index 52c0c1730702..045cef68a256 100644
--- a/arch/arm64/boot/dts/qcom/sm8550.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi
@@ -2893,8 +2893,8 @@ usb_1: usb@a6f8800 {
 
 			interrupts-extended = <&intc GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
 					      <&pdc 17 IRQ_TYPE_LEVEL_HIGH>,
-					      <&pdc 15 IRQ_TYPE_EDGE_RISING>,
-					      <&pdc 14 IRQ_TYPE_EDGE_RISING>;
+					      <&pdc 15 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 14 IRQ_TYPE_EDGE_BOTH>;
 			interrupt-names = "hs_phy_irq",
 					  "ss_phy_irq",
 					  "dm_hs_phy_irq",
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 135/583] wifi: mt76: fix typo in mt76_get_of_eeprom_from_nvmem function
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (133 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 134/583] arm64: dts: qcom: sm8550: fix USB " Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 136/583] wifi: mt76: mt7915: fallback to non-wed mode if platform_get_resource fails in mt7915_mmio_wed_init() Greg Kroah-Hartman
                   ` (454 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christian Marangi, Felix Fietkau,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christian Marangi <ansuelsmth@gmail.com>

[ Upstream commit c33e5f4cbb9f961e66473a9ace077c4d1f29a5bb ]

Fix typo in mt76_get_of_eeprom_from_nvmem where eeprom was misspelled as
epprom.

Fixes: 5bef3a406c6e ("wifi: mt76: add support for providing eeprom in nvmem cells")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/eeprom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c
index 36564930aef1..9220baec2394 100644
--- a/drivers/net/wireless/mediatek/mt76/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/eeprom.c
@@ -106,7 +106,7 @@ static int mt76_get_of_epprom_from_mtd(struct mt76_dev *dev, void *eep, int offs
 #endif
 }
 
-static int mt76_get_of_epprom_from_nvmem(struct mt76_dev *dev, void *eep, int len)
+static int mt76_get_of_eeprom_from_nvmem(struct mt76_dev *dev, void *eep, int len)
 {
 	struct device_node *np = dev->dev->of_node;
 	struct nvmem_cell *cell;
@@ -153,7 +153,7 @@ int mt76_get_of_eeprom(struct mt76_dev *dev, void *eep, int offset, int len)
 	if (!ret)
 		return 0;
 
-	return mt76_get_of_epprom_from_nvmem(dev, eep, len);
+	return mt76_get_of_eeprom_from_nvmem(dev, eep, len);
 }
 EXPORT_SYMBOL_GPL(mt76_get_of_eeprom);
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 136/583] wifi: mt76: mt7915: fallback to non-wed mode if platform_get_resource fails in mt7915_mmio_wed_init()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (134 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 135/583] wifi: mt76: fix typo in mt76_get_of_eeprom_from_nvmem function Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 137/583] wifi: mt76: mt7996: fix the size of struct bss_rate_tlv Greg Kroah-Hartman
                   ` (453 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Lorenzo Bianconi, Felix Fietkau,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Lorenzo Bianconi <lorenzo@kernel.org>

[ Upstream commit 5f9d5d4fc561e7bd3a18742f1fdb96cab98f1870 ]

mt76 assumes mt7915_mmio_wed_init can fail just after wed driver has
been attached running mtk_wed_device_attach().
Fall back to non-wed mode if platform_get_resource fails in
mt7915_mmio_wed_init routines.

Fixes: eebb70976be5 ("wifi: mt76: mt7915: enable wed for mt7986-wmac chipset")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7915/mmio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c b/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
index fc7ace638ce8..f4ad7219f94f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
@@ -742,7 +742,7 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
 
 		res = platform_get_resource(plat_dev, IORESOURCE_MEM, 0);
 		if (!res)
-			return -ENOMEM;
+			return 0;
 
 		wed->wlan.platform_dev = plat_dev;
 		wed->wlan.bus_type = MTK_WED_BUS_AXI;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 137/583] wifi: mt76: mt7996: fix the size of struct bss_rate_tlv
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (135 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 136/583] wifi: mt76: mt7915: fallback to non-wed mode if platform_get_resource fails in mt7915_mmio_wed_init() Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 138/583] wifi: mt76: mt7996: fix rate usage of inband discovery frames Greg Kroah-Hartman
                   ` (452 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sujuan Chen, Shayne Chen,
	Felix Fietkau, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sujuan Chen <sujuan.chen@mediatek.com>

[ Upstream commit 4aa9992674e70074fce450f65ebc95c2ba2b79ae ]

Align the format of struct bss_rate_tlv to the firmware.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7996/mcu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h
index e4b31228ba0d..dc8d0a30c707 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h
@@ -221,7 +221,7 @@ struct bss_rate_tlv {
 	u8 short_preamble;
 	u8 bc_fixed_rate;
 	u8 mc_fixed_rate;
-	u8 __rsv2[1];
+	u8 __rsv2[9];
 } __packed;
 
 struct bss_ra_tlv {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 138/583] wifi: mt76: mt7996: fix rate usage of inband discovery frames
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (136 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 137/583] wifi: mt76: mt7996: fix the size of struct bss_rate_tlv Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 139/583] wifi: mt76: mt7915: fix EEPROM offset of TSSI flag on MT7981 Greg Kroah-Hartman
                   ` (451 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, MeiChia Chiu, Shayne Chen,
	Felix Fietkau, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: MeiChia Chiu <meichia.chiu@mediatek.com>

[ Upstream commit 1e3f387736c744e73b5398a147b90412f82f54da ]

For UBPR and FILS frames, the BSS_CHANGED_BEACON flag will also be set,
which causes those frames to use the beacon rate in TX descriptors.
Adjust the statement to fix this issue.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: MeiChia Chiu <meichia.chiu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7996/mac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
index c43839a20508..26d5675202ba 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
@@ -840,10 +840,10 @@ void mt7996_mac_write_txwi(struct mt7996_dev *dev, __le32 *txwi,
 	struct mt76_vif *mvif;
 	u16 tx_count = 15;
 	u32 val;
-	bool beacon = !!(changed & (BSS_CHANGED_BEACON |
-				    BSS_CHANGED_BEACON_ENABLED));
 	bool inband_disc = !!(changed & (BSS_CHANGED_UNSOL_BCAST_PROBE_RESP |
 					 BSS_CHANGED_FILS_DISCOVERY));
+	bool beacon = !!(changed & (BSS_CHANGED_BEACON |
+				    BSS_CHANGED_BEACON_ENABLED)) && (!inband_disc);
 
 	mvif = vif ? (struct mt76_vif *)vif->drv_priv : NULL;
 	if (mvif) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 139/583] wifi: mt76: mt7915: fix EEPROM offset of TSSI flag on MT7981
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (137 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 138/583] wifi: mt76: mt7996: fix rate usage of inband discovery frames Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 140/583] wifi: mt76: mt7915: also MT7981 is 3T3R but nss2 on 5 GHz band Greg Kroah-Hartman
                   ` (450 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, StanleyYP Wang, Daniel Golle,
	Felix Fietkau, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>

[ Upstream commit 3531c72aedb95261f4d78c47efa4b5ba7cdcddd9 ]

The offset of the TSSI flag on the EEPROM of MT7981 devices was wrong.
Set the correct offset instead.

Fixes: 6bad146d162e ("wifi: mt76: mt7915: add support for MT7981")
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h
index f3e56817d36e..adc26a222823 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h
@@ -144,7 +144,8 @@ static inline bool
 mt7915_tssi_enabled(struct mt7915_dev *dev, enum nl80211_band band)
 {
 	u8 *eep = dev->mt76.eeprom.data;
-	u8 val = eep[MT_EE_WIFI_CONF + 7];
+	u8 offs = is_mt7981(&dev->mt76) ? 8 : 7;
+	u8 val = eep[MT_EE_WIFI_CONF + offs];
 
 	if (band == NL80211_BAND_2GHZ)
 		return val & MT_EE_WIFI_CONF7_TSSI0_2G;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 140/583] wifi: mt76: mt7915: also MT7981 is 3T3R but nss2 on 5 GHz band
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (138 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 139/583] wifi: mt76: mt7915: fix EEPROM offset of TSSI flag on MT7981 Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 141/583] wifi: mt76: mt7921s: fix workqueue problem causes STA association fail Greg Kroah-Hartman
                   ` (449 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, StanleyYP Wang, Daniel Golle,
	Felix Fietkau, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>

[ Upstream commit ff434cc129d6907e6dbc89dd0ebc59fd3646d4c2 ]

Just like MT7916 also MT7981 can handle 3T3R DBDC frontend and should
hence be included in the corresponding conditional expression in the
driver. Add it.

Fixes: 6bad146d162e ("wifi: mt76: mt7915: add support for MT7981")
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7915/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
index d85105a43d70..3196f56cdf4a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
@@ -1047,8 +1047,9 @@ mt7915_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant)
 
 	phy->mt76->antenna_mask = tx_ant;
 
-	/* handle a variant of mt7916 which has 3T3R but nss2 on 5 GHz band */
-	if (is_mt7916(&dev->mt76) && band && hweight8(tx_ant) == max_nss)
+	/* handle a variant of mt7916/mt7981 which has 3T3R but nss2 on 5 GHz band */
+	if ((is_mt7916(&dev->mt76) || is_mt7981(&dev->mt76)) &&
+	    band && hweight8(tx_ant) == max_nss)
 		phy->mt76->chainmask = (dev->chainmask >> chainshift) << chainshift;
 	else
 		phy->mt76->chainmask = tx_ant << (chainshift * band);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 141/583] wifi: mt76: mt7921s: fix workqueue problem causes STA association fail
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (139 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 140/583] wifi: mt76: mt7915: also MT7981 is 3T3R but nss2 on 5 GHz band Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 142/583] bpf: Fix verification of indirect var-off stack access Greg Kroah-Hartman
                   ` (448 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Wang Zhao, Deren Wu, Felix Fietkau,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Wang Zhao <wang.zhao@mediatek.com>

[ Upstream commit 92184eae1d5ad804884e2c6e289d885b9e3194d1 ]

The ieee80211_queue_work function queues work into the mac80211
local->workqueue, which is widely used for mac80211 internal
work processes. In the mt76 driver, both the mt76-sido-status and
mt76-sdio-net threads enqueue workers to the workqueue with this
function. However, in some cases, when two workers are enqueued
to the workqueue almost simultaneously, the second worker may not
be scheduled immediately and may get stuck for a while.
This can cause timing issues. To avoid these timing
conflicts caused by worker scheduling, replace the worker
with an independent thread.

Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support")
Signed-off-by: Wang Zhao <wang.zhao@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt76.h      |  3 +--
 .../net/wireless/mediatek/mt76/mt7615/sdio.c   |  2 +-
 .../net/wireless/mediatek/mt76/mt7921/sdio.c   |  4 +++-
 .../wireless/mediatek/mt76/mt7921/sdio_mac.c   |  3 ++-
 drivers/net/wireless/mediatek/mt76/sdio.c      | 18 +++++++++++-------
 5 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index dae5410d67e8..7f44736ca26f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -572,8 +572,7 @@ struct mt76_sdio {
 	struct mt76_worker txrx_worker;
 	struct mt76_worker status_worker;
 	struct mt76_worker net_worker;
-
-	struct work_struct stat_work;
+	struct mt76_worker stat_worker;
 
 	u8 *xmit_buf;
 	u32 xmit_buf_sz;
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c b/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
index fc547a0031ea..67cedd2555f9 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
@@ -204,8 +204,8 @@ static int mt7663s_suspend(struct device *dev)
 	mt76_worker_disable(&mdev->mt76.sdio.txrx_worker);
 	mt76_worker_disable(&mdev->mt76.sdio.status_worker);
 	mt76_worker_disable(&mdev->mt76.sdio.net_worker);
+	mt76_worker_disable(&mdev->mt76.sdio.stat_worker);
 
-	cancel_work_sync(&mdev->mt76.sdio.stat_work);
 	clear_bit(MT76_READING_STATS, &mdev->mphy.state);
 
 	mt76_tx_status_check(&mdev->mt76, true);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/sdio.c b/drivers/net/wireless/mediatek/mt76/mt7921/sdio.c
index dc1beb76df3e..7591e54d2897 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/sdio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/sdio.c
@@ -228,7 +228,7 @@ static int mt7921s_suspend(struct device *__dev)
 	mt76_txq_schedule_all(&dev->mphy);
 	mt76_worker_disable(&mdev->tx_worker);
 	mt76_worker_disable(&mdev->sdio.status_worker);
-	cancel_work_sync(&mdev->sdio.stat_work);
+	mt76_worker_disable(&mdev->sdio.stat_worker);
 	clear_bit(MT76_READING_STATS, &dev->mphy.state);
 	mt76_tx_status_check(mdev, true);
 
@@ -260,6 +260,7 @@ static int mt7921s_suspend(struct device *__dev)
 restore_worker:
 	mt76_worker_enable(&mdev->tx_worker);
 	mt76_worker_enable(&mdev->sdio.status_worker);
+	mt76_worker_enable(&mdev->sdio.stat_worker);
 
 	if (!pm->ds_enable)
 		mt76_connac_mcu_set_deep_sleep(mdev, false);
@@ -292,6 +293,7 @@ static int mt7921s_resume(struct device *__dev)
 	mt76_worker_enable(&mdev->sdio.txrx_worker);
 	mt76_worker_enable(&mdev->sdio.status_worker);
 	mt76_worker_enable(&mdev->sdio.net_worker);
+	mt76_worker_enable(&mdev->sdio.stat_worker);
 
 	/* restore previous ds setting */
 	if (!pm->ds_enable)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mac.c
index 8edd0291c128..389eb0903807 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/sdio_mac.c
@@ -107,7 +107,7 @@ int mt7921s_mac_reset(struct mt792x_dev *dev)
 	mt76_worker_disable(&dev->mt76.sdio.txrx_worker);
 	mt76_worker_disable(&dev->mt76.sdio.status_worker);
 	mt76_worker_disable(&dev->mt76.sdio.net_worker);
-	cancel_work_sync(&dev->mt76.sdio.stat_work);
+	mt76_worker_disable(&dev->mt76.sdio.stat_worker);
 
 	mt7921s_disable_irq(&dev->mt76);
 	mt7921s_wfsys_reset(dev);
@@ -115,6 +115,7 @@ int mt7921s_mac_reset(struct mt792x_dev *dev)
 	mt76_worker_enable(&dev->mt76.sdio.txrx_worker);
 	mt76_worker_enable(&dev->mt76.sdio.status_worker);
 	mt76_worker_enable(&dev->mt76.sdio.net_worker);
+	mt76_worker_enable(&dev->mt76.sdio.stat_worker);
 
 	dev->fw_assert = false;
 	clear_bit(MT76_MCU_RESET, &dev->mphy.state);
diff --git a/drivers/net/wireless/mediatek/mt76/sdio.c b/drivers/net/wireless/mediatek/mt76/sdio.c
index 419723118ded..c52d550f0c32 100644
--- a/drivers/net/wireless/mediatek/mt76/sdio.c
+++ b/drivers/net/wireless/mediatek/mt76/sdio.c
@@ -481,21 +481,21 @@ static void mt76s_status_worker(struct mt76_worker *w)
 		if (dev->drv->tx_status_data && ndata_frames > 0 &&
 		    !test_and_set_bit(MT76_READING_STATS, &dev->phy.state) &&
 		    !test_bit(MT76_STATE_SUSPEND, &dev->phy.state))
-			ieee80211_queue_work(dev->hw, &dev->sdio.stat_work);
+			mt76_worker_schedule(&sdio->stat_worker);
 	} while (nframes > 0);
 
 	if (resched)
 		mt76_worker_schedule(&dev->tx_worker);
 }
 
-static void mt76s_tx_status_data(struct work_struct *work)
+static void mt76s_tx_status_data(struct mt76_worker *worker)
 {
 	struct mt76_sdio *sdio;
 	struct mt76_dev *dev;
 	u8 update = 1;
 	u16 count = 0;
 
-	sdio = container_of(work, struct mt76_sdio, stat_work);
+	sdio = container_of(worker, struct mt76_sdio, stat_worker);
 	dev = container_of(sdio, struct mt76_dev, sdio);
 
 	while (true) {
@@ -508,7 +508,7 @@ static void mt76s_tx_status_data(struct work_struct *work)
 	}
 
 	if (count && test_bit(MT76_STATE_RUNNING, &dev->phy.state))
-		ieee80211_queue_work(dev->hw, &sdio->stat_work);
+		mt76_worker_schedule(&sdio->status_worker);
 	else
 		clear_bit(MT76_READING_STATS, &dev->phy.state);
 }
@@ -600,8 +600,8 @@ void mt76s_deinit(struct mt76_dev *dev)
 	mt76_worker_teardown(&sdio->txrx_worker);
 	mt76_worker_teardown(&sdio->status_worker);
 	mt76_worker_teardown(&sdio->net_worker);
+	mt76_worker_teardown(&sdio->stat_worker);
 
-	cancel_work_sync(&sdio->stat_work);
 	clear_bit(MT76_READING_STATS, &dev->phy.state);
 
 	mt76_tx_status_check(dev, true);
@@ -644,10 +644,14 @@ int mt76s_init(struct mt76_dev *dev, struct sdio_func *func,
 	if (err)
 		return err;
 
+	err = mt76_worker_setup(dev->hw, &sdio->stat_worker, mt76s_tx_status_data,
+				"sdio-sta");
+	if (err)
+		return err;
+
 	sched_set_fifo_low(sdio->status_worker.task);
 	sched_set_fifo_low(sdio->net_worker.task);
-
-	INIT_WORK(&sdio->stat_work, mt76s_tx_status_data);
+	sched_set_fifo_low(sdio->stat_worker.task);
 
 	dev->queue_ops = &sdio_queue_ops;
 	dev->bus = bus_ops;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 142/583] bpf: Fix verification of indirect var-off stack access
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (140 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 141/583] wifi: mt76: mt7921s: fix workqueue problem causes STA association fail Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 143/583] arm64: dts: hisilicon: hikey970-pmic: fix regulator cells properties Greg Kroah-Hartman
                   ` (447 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hao Sun, Andrei Matei,
	Andrii Nakryiko, Eduard Zingerman, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Andrei Matei <andreimatei1@gmail.com>

[ Upstream commit a833a17aeac73b33f79433d7cee68d5cafd71e4f ]

This patch fixes a bug around the verification of possibly-zero-sized
stack accesses. When the access was done through a var-offset stack
pointer, check_stack_access_within_bounds was incorrectly computing the
maximum-offset of a zero-sized read to be the same as the register's min
offset. Instead, we have to take in account the register's maximum
possible value. The patch also simplifies how the max offset is checked;
the check is now simpler than for min offset.

The bug was allowing accesses to erroneously pass the
check_stack_access_within_bounds() checks, only to later crash in
check_stack_range_initialized() when all the possibly-affected stack
slots are iterated (this time with a correct max offset).
check_stack_range_initialized() is relying on
check_stack_access_within_bounds() for its accesses to the
stack-tracking vector to be within bounds; in the case of zero-sized
accesses, we were essentially only verifying that the lowest possible
slot was within bounds. We would crash when the max-offset of the stack
pointer was >= 0 (which shouldn't pass verification, and hopefully is
not something anyone's code attempts to do in practice).

Thanks Hao for reporting!

Fixes: 01f810ace9ed3 ("bpf: Allow variable-offset stack access")
Reported-by: Hao Sun <sunhao.th@gmail.com>
Signed-off-by: Andrei Matei <andreimatei1@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20231207041150.229139-2-andreimatei1@gmail.com

Closes: https://lore.kernel.org/bpf/CACkBjsZGEUaRCHsmaX=h-efVogsRfK1FPxmkgb0Os_frnHiNdw@mail.gmail.com/
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/verifier.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 24152ac6a393..76834ecc59a9 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -6414,10 +6414,7 @@ static int check_stack_access_within_bounds(
 
 	if (tnum_is_const(reg->var_off)) {
 		min_off = reg->var_off.value + off;
-		if (access_size > 0)
-			max_off = min_off + access_size - 1;
-		else
-			max_off = min_off;
+		max_off = min_off + access_size;
 	} else {
 		if (reg->smax_value >= BPF_MAX_VAR_OFF ||
 		    reg->smin_value <= -BPF_MAX_VAR_OFF) {
@@ -6426,15 +6423,12 @@ static int check_stack_access_within_bounds(
 			return -EACCES;
 		}
 		min_off = reg->smin_value + off;
-		if (access_size > 0)
-			max_off = reg->smax_value + off + access_size - 1;
-		else
-			max_off = min_off;
+		max_off = reg->smax_value + off + access_size;
 	}
 
 	err = check_stack_slot_within_bounds(min_off, state, type);
-	if (!err)
-		err = check_stack_slot_within_bounds(max_off, state, type);
+	if (!err && max_off > 0)
+		err = -EINVAL; /* out of stack access into non-negative offsets */
 
 	if (err) {
 		if (tnum_is_const(reg->var_off)) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 143/583] arm64: dts: hisilicon: hikey970-pmic: fix regulator cells properties
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (141 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 142/583] bpf: Fix verification of indirect var-off stack access Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 144/583] bpf: Guard stack limits against 32bit overflow Greg Kroah-Hartman
                   ` (446 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Johan Hovold, Wei Xu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Johan Hovold <johan+linaro@kernel.org>

[ Upstream commit 44ab3ee76a5a977864ba0bb6c352dcf6206804e0 ]

The Hi6421 PMIC regulator child nodes do not have unit addresses so drop
the incorrect '#address-cells' and '#size-cells' properties.

Fixes: 6219b20e1ecd ("arm64: dts: hisilicon: Add support for Hikey 970 PMIC")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/hisilicon/hikey970-pmic.dtsi | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm64/boot/dts/hisilicon/hikey970-pmic.dtsi b/arch/arm64/boot/dts/hisilicon/hikey970-pmic.dtsi
index 970047f2dabd..c06e011a6c3f 100644
--- a/arch/arm64/boot/dts/hisilicon/hikey970-pmic.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hikey970-pmic.dtsi
@@ -25,9 +25,6 @@ pmic: pmic@0 {
 			gpios = <&gpio28 0 0>;
 
 			regulators {
-				#address-cells = <1>;
-				#size-cells = <0>;
-
 				ldo3: ldo3 { /* HDMI */
 					regulator-name = "ldo3";
 					regulator-min-microvolt = <1500000>;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 144/583] bpf: Guard stack limits against 32bit overflow
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (142 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 143/583] arm64: dts: hisilicon: hikey970-pmic: fix regulator cells properties Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 145/583] bpf: Fix accesses to uninit stack slots Greg Kroah-Hartman
                   ` (445 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Andrii Nakryiko, Andrei Matei,
	Andrii Nakryiko, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Andrei Matei <andreimatei1@gmail.com>

[ Upstream commit 1d38a9ee81570c4bd61f557832dead4d6f816760 ]

This patch promotes the arithmetic around checking stack bounds to be
done in the 64-bit domain, instead of the current 32bit. The arithmetic
implies adding together a 64-bit register with a int offset. The
register was checked to be below 1<<29 when it was variable, but not
when it was fixed. The offset either comes from an instruction (in which
case it is 16 bit), from another register (in which case the caller
checked it to be below 1<<29 [1]), or from the size of an argument to a
kfunc (in which case it can be a u32 [2]). Between the register being
inconsistently checked to be below 1<<29, and the offset being up to an
u32, it appears that we were open to overflowing the `int`s which were
currently used for arithmetic.

[1] https://github.com/torvalds/linux/blob/815fb87b753055df2d9e50f6cd80eb10235fe3e9/kernel/bpf/verifier.c#L7494-L7498
[2] https://github.com/torvalds/linux/blob/815fb87b753055df2d9e50f6cd80eb10235fe3e9/kernel/bpf/verifier.c#L11904

Reported-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Signed-off-by: Andrei Matei <andreimatei1@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20231207041150.229139-4-andreimatei1@gmail.com
Stable-dep-of: 6b4a64bafd10 ("bpf: Fix accesses to uninit stack slots")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/verifier.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 76834ecc59a9..47599505cdf8 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -6371,7 +6371,7 @@ static int check_ptr_to_map_access(struct bpf_verifier_env *env,
  * The minimum valid offset is -MAX_BPF_STACK for writes, and
  * -state->allocated_stack for reads.
  */
-static int check_stack_slot_within_bounds(int off,
+static int check_stack_slot_within_bounds(s64 off,
 					  struct bpf_func_state *state,
 					  enum bpf_access_type t)
 {
@@ -6400,7 +6400,7 @@ static int check_stack_access_within_bounds(
 	struct bpf_reg_state *regs = cur_regs(env);
 	struct bpf_reg_state *reg = regs + regno;
 	struct bpf_func_state *state = func(env, reg);
-	int min_off, max_off;
+	s64 min_off, max_off;
 	int err;
 	char *err_extra;
 
@@ -6413,7 +6413,7 @@ static int check_stack_access_within_bounds(
 		err_extra = " write to";
 
 	if (tnum_is_const(reg->var_off)) {
-		min_off = reg->var_off.value + off;
+		min_off = (s64)reg->var_off.value + off;
 		max_off = min_off + access_size;
 	} else {
 		if (reg->smax_value >= BPF_MAX_VAR_OFF ||
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 145/583] bpf: Fix accesses to uninit stack slots
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (143 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 144/583] bpf: Guard stack limits against 32bit overflow Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 146/583] dt-bindings: media: mediatek: mdp3: correct RDMA and WROT node with generic names Greg Kroah-Hartman
                   ` (444 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hao Sun, Andrei Matei,
	Andrii Nakryiko, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Andrei Matei <andreimatei1@gmail.com>

[ Upstream commit 6b4a64bafd107e521c01eec3453ce94a3fb38529 ]

Privileged programs are supposed to be able to read uninitialized stack
memory (ever since 6715df8d5) but, before this patch, these accesses
were permitted inconsistently. In particular, accesses were permitted
above state->allocated_stack, but not below it. In other words, if the
stack was already "large enough", the access was permitted, but
otherwise the access was rejected instead of being allowed to "grow the
stack". This undesired rejection was happening in two places:
- in check_stack_slot_within_bounds()
- in check_stack_range_initialized()
This patch arranges for these accesses to be permitted. A bunch of tests
that were relying on the old rejection had to change; all of them were
changed to add also run unprivileged, in which case the old behavior
persists. One tests couldn't be updated - global_func16 - because it
can't run unprivileged for other reasons.

This patch also fixes the tracking of the stack size for variable-offset
reads. This second fix is bundled in the same commit as the first one
because they're inter-related. Before this patch, writes to the stack
using registers containing a variable offset (as opposed to registers
with fixed, known values) were not properly contributing to the
function's needed stack size. As a result, it was possible for a program
to verify, but then to attempt to read out-of-bounds data at runtime
because a too small stack had been allocated for it.

Each function tracks the size of the stack it needs in
bpf_subprog_info.stack_depth, which is maintained by
update_stack_depth(). For regular memory accesses, check_mem_access()
was calling update_state_depth() but it was passing in only the fixed
part of the offset register, ignoring the variable offset. This was
incorrect; the minimum possible value of that register should be used
instead.

This tracking is now fixed by centralizing the tracking of stack size in
grow_stack_state(), and by lifting the calls to grow_stack_state() to
check_stack_access_within_bounds() as suggested by Andrii. The code is
now simpler and more convincingly tracks the correct maximum stack size.
check_stack_range_initialized() can now rely on enough stack having been
allocated for the access; this helps with the fix for the first issue.

A few tests were changed to also check the stack depth computation. The
one that fails without this patch is verifier_var_off:stack_write_priv_vs_unpriv.

Fixes: 01f810ace9ed3 ("bpf: Allow variable-offset stack access")
Reported-by: Hao Sun <sunhao.th@gmail.com>
Signed-off-by: Andrei Matei <andreimatei1@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20231208032519.260451-3-andreimatei1@gmail.com

Closes: https://lore.kernel.org/bpf/CABWLsev9g8UP_c3a=1qbuZUi20tGoUXoU07FPf-5FLvhOKOY+Q@mail.gmail.com/
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/verifier.c                         | 65 ++++++++-----------
 .../selftests/bpf/progs/test_global_func16.c  |  2 +-
 .../bpf/progs/verifier_basic_stack.c          |  8 +--
 .../selftests/bpf/progs/verifier_int_ptr.c    |  5 +-
 .../selftests/bpf/progs/verifier_raw_stack.c  |  5 +-
 .../selftests/bpf/progs/verifier_var_off.c    | 62 ++++++++++++++----
 .../selftests/bpf/verifier/atomic_cmpxchg.c   | 11 ----
 tools/testing/selftests/bpf/verifier/calls.c  |  4 +-
 8 files changed, 91 insertions(+), 71 deletions(-)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 47599505cdf8..ed24ad2e5bd2 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -1632,7 +1632,10 @@ static int resize_reference_state(struct bpf_func_state *state, size_t n)
 	return 0;
 }
 
-static int grow_stack_state(struct bpf_func_state *state, int size)
+/* Possibly update state->allocated_stack to be at least size bytes. Also
+ * possibly update the function's high-water mark in its bpf_subprog_info.
+ */
+static int grow_stack_state(struct bpf_verifier_env *env, struct bpf_func_state *state, int size)
 {
 	size_t old_n = state->allocated_stack / BPF_REG_SIZE, n = size / BPF_REG_SIZE;
 
@@ -1644,6 +1647,11 @@ static int grow_stack_state(struct bpf_func_state *state, int size)
 		return -ENOMEM;
 
 	state->allocated_stack = size;
+
+	/* update known max for given subprogram */
+	if (env->subprog_info[state->subprogno].stack_depth < size)
+		env->subprog_info[state->subprogno].stack_depth = size;
+
 	return 0;
 }
 
@@ -4323,9 +4331,6 @@ static int check_stack_write_fixed_off(struct bpf_verifier_env *env,
 	struct bpf_reg_state *reg = NULL;
 	u32 dst_reg = insn->dst_reg;
 
-	err = grow_stack_state(state, round_up(slot + 1, BPF_REG_SIZE));
-	if (err)
-		return err;
 	/* caller checked that off % size == 0 and -MAX_BPF_STACK <= off < 0,
 	 * so it's aligned access and [off, off + size) are within stack limits
 	 */
@@ -4481,10 +4486,6 @@ static int check_stack_write_var_off(struct bpf_verifier_env *env,
 	    (!value_reg && is_bpf_st_mem(insn) && insn->imm == 0))
 		writing_zero = true;
 
-	err = grow_stack_state(state, round_up(-min_off, BPF_REG_SIZE));
-	if (err)
-		return err;
-
 	for (i = min_off; i < max_off; i++) {
 		int spi;
 
@@ -5599,20 +5600,6 @@ static int check_ptr_alignment(struct bpf_verifier_env *env,
 					   strict);
 }
 
-static int update_stack_depth(struct bpf_verifier_env *env,
-			      const struct bpf_func_state *func,
-			      int off)
-{
-	u16 stack = env->subprog_info[func->subprogno].stack_depth;
-
-	if (stack >= -off)
-		return 0;
-
-	/* update known max for given subprogram */
-	env->subprog_info[func->subprogno].stack_depth = -off;
-	return 0;
-}
-
 /* starting from main bpf function walk all instructions of the function
  * and recursively walk all callees that given function can call.
  * Ignore jump and exit insns.
@@ -6371,13 +6358,14 @@ static int check_ptr_to_map_access(struct bpf_verifier_env *env,
  * The minimum valid offset is -MAX_BPF_STACK for writes, and
  * -state->allocated_stack for reads.
  */
-static int check_stack_slot_within_bounds(s64 off,
-					  struct bpf_func_state *state,
-					  enum bpf_access_type t)
+static int check_stack_slot_within_bounds(struct bpf_verifier_env *env,
+                                          s64 off,
+                                          struct bpf_func_state *state,
+                                          enum bpf_access_type t)
 {
 	int min_valid_off;
 
-	if (t == BPF_WRITE)
+	if (t == BPF_WRITE || env->allow_uninit_stack)
 		min_valid_off = -MAX_BPF_STACK;
 	else
 		min_valid_off = -state->allocated_stack;
@@ -6426,7 +6414,7 @@ static int check_stack_access_within_bounds(
 		max_off = reg->smax_value + off + access_size;
 	}
 
-	err = check_stack_slot_within_bounds(min_off, state, type);
+	err = check_stack_slot_within_bounds(env, min_off, state, type);
 	if (!err && max_off > 0)
 		err = -EINVAL; /* out of stack access into non-negative offsets */
 
@@ -6441,8 +6429,10 @@ static int check_stack_access_within_bounds(
 			verbose(env, "invalid variable-offset%s stack R%d var_off=%s size=%d\n",
 				err_extra, regno, tn_buf, access_size);
 		}
+		return err;
 	}
-	return err;
+
+	return grow_stack_state(env, state, round_up(-min_off, BPF_REG_SIZE));
 }
 
 /* check whether memory at (regno + off) is accessible for t = (read | write)
@@ -6457,7 +6447,6 @@ static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regn
 {
 	struct bpf_reg_state *regs = cur_regs(env);
 	struct bpf_reg_state *reg = regs + regno;
-	struct bpf_func_state *state;
 	int size, err = 0;
 
 	size = bpf_size_to_bytes(bpf_size);
@@ -6600,11 +6589,6 @@ static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regn
 		if (err)
 			return err;
 
-		state = func(env, reg);
-		err = update_stack_depth(env, state, off);
-		if (err)
-			return err;
-
 		if (t == BPF_READ)
 			err = check_stack_read(env, regno, off, size,
 					       value_regno);
@@ -6799,7 +6783,8 @@ static int check_atomic(struct bpf_verifier_env *env, int insn_idx, struct bpf_i
 
 /* When register 'regno' is used to read the stack (either directly or through
  * a helper function) make sure that it's within stack boundary and, depending
- * on the access type, that all elements of the stack are initialized.
+ * on the access type and privileges, that all elements of the stack are
+ * initialized.
  *
  * 'off' includes 'regno->off', but not its dynamic part (if any).
  *
@@ -6907,8 +6892,11 @@ static int check_stack_range_initialized(
 
 		slot = -i - 1;
 		spi = slot / BPF_REG_SIZE;
-		if (state->allocated_stack <= slot)
-			goto err;
+		if (state->allocated_stack <= slot) {
+			verbose(env, "verifier bug: allocated_stack too small");
+			return -EFAULT;
+		}
+
 		stype = &state->stack[spi].slot_type[slot % BPF_REG_SIZE];
 		if (*stype == STACK_MISC)
 			goto mark;
@@ -6932,7 +6920,6 @@ static int check_stack_range_initialized(
 			goto mark;
 		}
 
-err:
 		if (tnum_is_const(reg->var_off)) {
 			verbose(env, "invalid%s read from stack R%d off %d+%d size %d\n",
 				err_extra, regno, min_off, i - min_off, access_size);
@@ -6957,7 +6944,7 @@ static int check_stack_range_initialized(
 		 * helper may write to the entire memory range.
 		 */
 	}
-	return update_stack_depth(env, state, min_off);
+	return 0;
 }
 
 static int check_helper_mem_access(struct bpf_verifier_env *env, int regno,
diff --git a/tools/testing/selftests/bpf/progs/test_global_func16.c b/tools/testing/selftests/bpf/progs/test_global_func16.c
index e7206304632e..e3e64bc472cd 100644
--- a/tools/testing/selftests/bpf/progs/test_global_func16.c
+++ b/tools/testing/selftests/bpf/progs/test_global_func16.c
@@ -13,7 +13,7 @@ __noinline int foo(int (*arr)[10])
 }
 
 SEC("cgroup_skb/ingress")
-__failure __msg("invalid indirect read from stack")
+__success
 int global_func16(struct __sk_buff *skb)
 {
 	int array[10];
diff --git a/tools/testing/selftests/bpf/progs/verifier_basic_stack.c b/tools/testing/selftests/bpf/progs/verifier_basic_stack.c
index 359df865a8f3..8d77cc5323d3 100644
--- a/tools/testing/selftests/bpf/progs/verifier_basic_stack.c
+++ b/tools/testing/selftests/bpf/progs/verifier_basic_stack.c
@@ -27,8 +27,8 @@ __naked void stack_out_of_bounds(void)
 
 SEC("socket")
 __description("uninitialized stack1")
-__failure __msg("invalid indirect read from stack")
-__failure_unpriv
+__success __log_level(4) __msg("stack depth 8")
+__failure_unpriv __msg_unpriv("invalid indirect read from stack")
 __naked void uninitialized_stack1(void)
 {
 	asm volatile ("					\
@@ -45,8 +45,8 @@ __naked void uninitialized_stack1(void)
 
 SEC("socket")
 __description("uninitialized stack2")
-__failure __msg("invalid read from stack")
-__failure_unpriv
+__success __log_level(4) __msg("stack depth 8")
+__failure_unpriv __msg_unpriv("invalid read from stack")
 __naked void uninitialized_stack2(void)
 {
 	asm volatile ("					\
diff --git a/tools/testing/selftests/bpf/progs/verifier_int_ptr.c b/tools/testing/selftests/bpf/progs/verifier_int_ptr.c
index b054f9c48143..589e8270de46 100644
--- a/tools/testing/selftests/bpf/progs/verifier_int_ptr.c
+++ b/tools/testing/selftests/bpf/progs/verifier_int_ptr.c
@@ -5,9 +5,10 @@
 #include <bpf/bpf_helpers.h>
 #include "bpf_misc.h"
 
-SEC("cgroup/sysctl")
+SEC("socket")
 __description("ARG_PTR_TO_LONG uninitialized")
-__failure __msg("invalid indirect read from stack R4 off -16+0 size 8")
+__success
+__failure_unpriv __msg_unpriv("invalid indirect read from stack R4 off -16+0 size 8")
 __naked void arg_ptr_to_long_uninitialized(void)
 {
 	asm volatile ("					\
diff --git a/tools/testing/selftests/bpf/progs/verifier_raw_stack.c b/tools/testing/selftests/bpf/progs/verifier_raw_stack.c
index efbfc3a4ad6a..f67390224a9c 100644
--- a/tools/testing/selftests/bpf/progs/verifier_raw_stack.c
+++ b/tools/testing/selftests/bpf/progs/verifier_raw_stack.c
@@ -5,9 +5,10 @@
 #include <bpf/bpf_helpers.h>
 #include "bpf_misc.h"
 
-SEC("tc")
+SEC("socket")
 __description("raw_stack: no skb_load_bytes")
-__failure __msg("invalid read from stack R6 off=-8 size=8")
+__success
+__failure_unpriv __msg_unpriv("invalid read from stack R6 off=-8 size=8")
 __naked void stack_no_skb_load_bytes(void)
 {
 	asm volatile ("					\
diff --git a/tools/testing/selftests/bpf/progs/verifier_var_off.c b/tools/testing/selftests/bpf/progs/verifier_var_off.c
index 83a90afba785..d1f23c1a7c5b 100644
--- a/tools/testing/selftests/bpf/progs/verifier_var_off.c
+++ b/tools/testing/selftests/bpf/progs/verifier_var_off.c
@@ -59,9 +59,10 @@ __naked void stack_read_priv_vs_unpriv(void)
 "	::: __clobber_all);
 }
 
-SEC("lwt_in")
+SEC("cgroup/skb")
 __description("variable-offset stack read, uninitialized")
-__failure __msg("invalid variable-offset read from stack R2")
+__success
+__failure_unpriv __msg_unpriv("R2 variable stack access prohibited for !root")
 __naked void variable_offset_stack_read_uninitialized(void)
 {
 	asm volatile ("					\
@@ -83,12 +84,55 @@ __naked void variable_offset_stack_read_uninitialized(void)
 
 SEC("socket")
 __description("variable-offset stack write, priv vs unpriv")
-__success __failure_unpriv
+__success
+/* Check that the maximum stack depth is correctly maintained according to the
+ * maximum possible variable offset.
+ */
+__log_level(4) __msg("stack depth 16")
+__failure_unpriv
 /* Variable stack access is rejected for unprivileged.
  */
 __msg_unpriv("R2 variable stack access prohibited for !root")
 __retval(0)
 __naked void stack_write_priv_vs_unpriv(void)
+{
+	asm volatile ("                               \
+	/* Get an unknown value */                    \
+	r2 = *(u32*)(r1 + 0);                         \
+	/* Make it small and 8-byte aligned */        \
+	r2 &= 8;                                      \
+	r2 -= 16;                                     \
+	/* Add it to fp. We now have either fp-8 or   \
+	 * fp-16, but we don't know which             \
+	 */                                           \
+	r2 += r10;                                    \
+	/* Dereference it for a stack write */        \
+	r0 = 0;                                       \
+	*(u64*)(r2 + 0) = r0;                         \
+	exit;                                         \
+"	::: __clobber_all);
+}
+
+/* Similar to the previous test, but this time also perform a read from the
+ * address written to with a variable offset. The read is allowed, showing that,
+ * after a variable-offset write, a priviledged program can read the slots that
+ * were in the range of that write (even if the verifier doesn't actually know if
+ * the slot being read was really written to or not.
+ *
+ * Despite this test being mostly a superset, the previous test is also kept for
+ * the sake of it checking the stack depth in the case where there is no read.
+ */
+SEC("socket")
+__description("variable-offset stack write followed by read")
+__success
+/* Check that the maximum stack depth is correctly maintained according to the
+ * maximum possible variable offset.
+ */
+__log_level(4) __msg("stack depth 16")
+__failure_unpriv
+__msg_unpriv("R2 variable stack access prohibited for !root")
+__retval(0)
+__naked void stack_write_followed_by_read(void)
 {
 	asm volatile ("					\
 	/* Get an unknown value */			\
@@ -103,12 +147,7 @@ __naked void stack_write_priv_vs_unpriv(void)
 	/* Dereference it for a stack write */		\
 	r0 = 0;						\
 	*(u64*)(r2 + 0) = r0;				\
-	/* Now read from the address we just wrote. This shows\
-	 * that, after a variable-offset write, a priviledged\
-	 * program can read the slots that were in the range of\
-	 * that write (even if the verifier doesn't actually know\
-	 * if the slot being read was really written to or not.\
-	 */						\
+	/* Now read from the address we just wrote. */ \
 	r3 = *(u64*)(r2 + 0);				\
 	r0 = 0;						\
 	exit;						\
@@ -253,9 +292,10 @@ __naked void access_min_out_of_bound(void)
 	: __clobber_all);
 }
 
-SEC("lwt_in")
+SEC("cgroup/skb")
 __description("indirect variable-offset stack access, min_off < min_initialized")
-__failure __msg("invalid indirect read from stack R2 var_off")
+__success
+__failure_unpriv __msg_unpriv("R2 variable stack access prohibited for !root")
 __naked void access_min_off_min_initialized(void)
 {
 	asm volatile ("					\
diff --git a/tools/testing/selftests/bpf/verifier/atomic_cmpxchg.c b/tools/testing/selftests/bpf/verifier/atomic_cmpxchg.c
index 319337bdcfc8..9a7b1106fda8 100644
--- a/tools/testing/selftests/bpf/verifier/atomic_cmpxchg.c
+++ b/tools/testing/selftests/bpf/verifier/atomic_cmpxchg.c
@@ -83,17 +83,6 @@
 	.result = REJECT,
 	.errstr = "!read_ok",
 },
-{
-	"Can't use cmpxchg on uninit memory",
-	.insns = {
-		BPF_MOV64_IMM(BPF_REG_0, 3),
-		BPF_MOV64_IMM(BPF_REG_2, 4),
-		BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, BPF_REG_10, BPF_REG_2, -8),
-		BPF_EXIT_INSN(),
-	},
-	.result = REJECT,
-	.errstr = "invalid read from stack",
-},
 {
 	"BPF_W cmpxchg should zero top 32 bits",
 	.insns = {
diff --git a/tools/testing/selftests/bpf/verifier/calls.c b/tools/testing/selftests/bpf/verifier/calls.c
index 3d5cd51071f0..ab25a81fd3a1 100644
--- a/tools/testing/selftests/bpf/verifier/calls.c
+++ b/tools/testing/selftests/bpf/verifier/calls.c
@@ -1505,7 +1505,9 @@
 	.prog_type = BPF_PROG_TYPE_XDP,
 	.fixup_map_hash_8b = { 23 },
 	.result = REJECT,
-	.errstr = "invalid read from stack R7 off=-16 size=8",
+	.errstr = "R0 invalid mem access 'scalar'",
+	.result_unpriv = REJECT,
+	.errstr_unpriv = "invalid read from stack R7 off=-16 size=8",
 },
 {
 	"calls: two calls that receive map_value via arg=ptr_stack_of_caller. test1",
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 146/583] dt-bindings: media: mediatek: mdp3: correct RDMA and WROT node with generic names
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (144 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 145/583] bpf: Fix accesses to uninit stack slots Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 147/583] arm64: dts: mediatek: mt8183: correct MDP3 DMA-related nodes Greg Kroah-Hartman
                   ` (443 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Moudy Ho, Rob Herring,
	AngeloGioacchino Del Regno, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Moudy Ho <moudy.ho@mediatek.com>

[ Upstream commit f5f185bf7c42f6ca885202fefc40fc871d08a722 ]

The DMA-related nodes RDMA/WROT in MDP3 should be changed to generic names.
In addition, fix improper space indent in example.

Fixes: 4ad7b39623ab ("media: dt-binding: mediatek: add bindings for MediaTek MDP3 components")
Signed-off-by: Moudy Ho <moudy.ho@mediatek.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../bindings/media/mediatek,mdp3-rdma.yaml    | 29 +++++++++++--------
 .../bindings/media/mediatek,mdp3-wrot.yaml    | 23 +++++++++------
 2 files changed, 31 insertions(+), 21 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml b/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml
index 7032c7e15039..3e128733ef53 100644
--- a/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml
@@ -61,6 +61,9 @@ properties:
       - description: used for 1st data pipe from RDMA
       - description: used for 2nd data pipe from RDMA
 
+  '#dma-cells':
+    const: 1
+
 required:
   - compatible
   - reg
@@ -70,6 +73,7 @@ required:
   - clocks
   - iommus
   - mboxes
+  - '#dma-cells'
 
 additionalProperties: false
 
@@ -80,16 +84,17 @@ examples:
     #include <dt-bindings/power/mt8183-power.h>
     #include <dt-bindings/memory/mt8183-larb-port.h>
 
-    mdp3_rdma0: mdp3-rdma0@14001000 {
-      compatible = "mediatek,mt8183-mdp3-rdma";
-      reg = <0x14001000 0x1000>;
-      mediatek,gce-client-reg = <&gce SUBSYS_1400XXXX 0x1000 0x1000>;
-      mediatek,gce-events = <CMDQ_EVENT_MDP_RDMA0_SOF>,
-                            <CMDQ_EVENT_MDP_RDMA0_EOF>;
-      power-domains = <&spm MT8183_POWER_DOMAIN_DISP>;
-      clocks = <&mmsys CLK_MM_MDP_RDMA0>,
-               <&mmsys CLK_MM_MDP_RSZ1>;
-      iommus = <&iommu>;
-      mboxes = <&gce 20 CMDQ_THR_PRIO_LOWEST>,
-               <&gce 21 CMDQ_THR_PRIO_LOWEST>;
+    dma-controller@14001000 {
+        compatible = "mediatek,mt8183-mdp3-rdma";
+        reg = <0x14001000 0x1000>;
+        mediatek,gce-client-reg = <&gce SUBSYS_1400XXXX 0x1000 0x1000>;
+        mediatek,gce-events = <CMDQ_EVENT_MDP_RDMA0_SOF>,
+                              <CMDQ_EVENT_MDP_RDMA0_EOF>;
+        power-domains = <&spm MT8183_POWER_DOMAIN_DISP>;
+        clocks = <&mmsys CLK_MM_MDP_RDMA0>,
+                 <&mmsys CLK_MM_MDP_RSZ1>;
+        iommus = <&iommu>;
+        mboxes = <&gce 20 CMDQ_THR_PRIO_LOWEST>,
+                 <&gce 21 CMDQ_THR_PRIO_LOWEST>;
+        #dma-cells = <1>;
     };
diff --git a/Documentation/devicetree/bindings/media/mediatek,mdp3-wrot.yaml b/Documentation/devicetree/bindings/media/mediatek,mdp3-wrot.yaml
index 0baa77198fa2..64ea98aa0592 100644
--- a/Documentation/devicetree/bindings/media/mediatek,mdp3-wrot.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek,mdp3-wrot.yaml
@@ -50,6 +50,9 @@ properties:
   iommus:
     maxItems: 1
 
+  '#dma-cells':
+    const: 1
+
 required:
   - compatible
   - reg
@@ -58,6 +61,7 @@ required:
   - power-domains
   - clocks
   - iommus
+  - '#dma-cells'
 
 additionalProperties: false
 
@@ -68,13 +72,14 @@ examples:
     #include <dt-bindings/power/mt8183-power.h>
     #include <dt-bindings/memory/mt8183-larb-port.h>
 
-    mdp3_wrot0: mdp3-wrot0@14005000 {
-      compatible = "mediatek,mt8183-mdp3-wrot";
-      reg = <0x14005000 0x1000>;
-      mediatek,gce-client-reg = <&gce SUBSYS_1400XXXX 0x5000 0x1000>;
-      mediatek,gce-events = <CMDQ_EVENT_MDP_WROT0_SOF>,
-                            <CMDQ_EVENT_MDP_WROT0_EOF>;
-      power-domains = <&spm MT8183_POWER_DOMAIN_DISP>;
-      clocks = <&mmsys CLK_MM_MDP_WROT0>;
-      iommus = <&iommu>;
+    dma-controller@14005000 {
+        compatible = "mediatek,mt8183-mdp3-wrot";
+        reg = <0x14005000 0x1000>;
+        mediatek,gce-client-reg = <&gce SUBSYS_1400XXXX 0x5000 0x1000>;
+        mediatek,gce-events = <CMDQ_EVENT_MDP_WROT0_SOF>,
+                              <CMDQ_EVENT_MDP_WROT0_EOF>;
+        power-domains = <&spm MT8183_POWER_DOMAIN_DISP>;
+        clocks = <&mmsys CLK_MM_MDP_WROT0>;
+        iommus = <&iommu>;
+        #dma-cells = <1>;
     };
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 147/583] arm64: dts: mediatek: mt8183: correct MDP3 DMA-related nodes
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (145 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 146/583] dt-bindings: media: mediatek: mdp3: correct RDMA and WROT node with generic names Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 148/583] arm64: dts: mediatek: mt8195: revise VDOSYS RDMA node name Greg Kroah-Hartman
                   ` (442 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Moudy Ho,
	AngeloGioacchino Del Regno, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Moudy Ho <moudy.ho@mediatek.com>

[ Upstream commit 188ffcd7fea79af3cac441268fc99f60e87f03b3 ]

In order to generalize the node names, the DMA-related nodes
corresponding to MT8183 MDP3 need to be corrected.

Fixes: 60a2fb8d202a ("arm64: dts: mt8183: add MediaTek MDP3 nodes")
Signed-off-by: Moudy Ho <moudy.ho@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/mediatek/mt8183.dtsi | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
index 976dc968b3ca..df6e9990cd5f 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
@@ -1660,7 +1660,7 @@ mmsys: syscon@14000000 {
 			mediatek,gce-client-reg = <&gce SUBSYS_1400XXXX 0 0x1000>;
 		};
 
-		mdp3-rdma0@14001000 {
+		dma-controller0@14001000 {
 			compatible = "mediatek,mt8183-mdp3-rdma";
 			reg = <0 0x14001000 0 0x1000>;
 			mediatek,gce-client-reg = <&gce SUBSYS_1400XXXX 0x1000 0x1000>;
@@ -1672,6 +1672,7 @@ mdp3-rdma0@14001000 {
 			iommus = <&iommu M4U_PORT_MDP_RDMA0>;
 			mboxes = <&gce 20 CMDQ_THR_PRIO_LOWEST 0>,
 				 <&gce 21 CMDQ_THR_PRIO_LOWEST 0>;
+			#dma-cells = <1>;
 		};
 
 		mdp3-rsz0@14003000 {
@@ -1692,7 +1693,7 @@ mdp3-rsz1@14004000 {
 			clocks = <&mmsys CLK_MM_MDP_RSZ1>;
 		};
 
-		mdp3-wrot0@14005000 {
+		dma-controller@14005000 {
 			compatible = "mediatek,mt8183-mdp3-wrot";
 			reg = <0 0x14005000 0 0x1000>;
 			mediatek,gce-client-reg = <&gce SUBSYS_1400XXXX 0x5000 0x1000>;
@@ -1701,6 +1702,7 @@ mdp3-wrot0@14005000 {
 			power-domains = <&spm MT8183_POWER_DOMAIN_DISP>;
 			clocks = <&mmsys CLK_MM_MDP_WROT0>;
 			iommus = <&iommu M4U_PORT_MDP_WROT0>;
+			#dma-cells = <1>;
 		};
 
 		mdp3-wdma@14006000 {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 148/583] arm64: dts: mediatek: mt8195: revise VDOSYS RDMA node name
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (146 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 147/583] arm64: dts: mediatek: mt8183: correct MDP3 DMA-related nodes Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 149/583] arm64: dts: mediatek: mt8186: Fix alias prefix for ovl_2l0 Greg Kroah-Hartman
                   ` (441 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Moudy Ho,
	AngeloGioacchino Del Regno, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Moudy Ho <moudy.ho@mediatek.com>

[ Upstream commit 52f4a10f2a860402c130c5c21d055e721d63a7e9 ]

DMA-related nodes have their own standardized naming. Therefore,
the MT8195 VDOSYS RDMA has been unified and corrected.
Additionally, these modifications will facilitate the further
integration of bindings.

Fixes: 92d2c23dc269 ("arm64: dts: mt8195: add display node for vdosys1")
Signed-off-by: Moudy Ho <moudy.ho@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/mediatek/mt8195.dtsi | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts/mediatek/mt8195.dtsi
index e0ac2e9f5b72..6708c4d21abf 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi
@@ -2873,7 +2873,7 @@ larb3: larb@1c103000 {
 			power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>;
 		};
 
-		vdo1_rdma0: rdma@1c104000 {
+		vdo1_rdma0: dma-controller@1c104000 {
 			compatible = "mediatek,mt8195-vdo1-rdma";
 			reg = <0 0x1c104000 0 0x1000>;
 			interrupts = <GIC_SPI 495 IRQ_TYPE_LEVEL_HIGH 0>;
@@ -2881,9 +2881,10 @@ vdo1_rdma0: rdma@1c104000 {
 			power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>;
 			iommus = <&iommu_vdo M4U_PORT_L2_MDP_RDMA0>;
 			mediatek,gce-client-reg = <&gce0 SUBSYS_1c10XXXX 0x4000 0x1000>;
+			#dma-cells = <1>;
 		};
 
-		vdo1_rdma1: rdma@1c105000 {
+		vdo1_rdma1: dma-controller@1c105000 {
 			compatible = "mediatek,mt8195-vdo1-rdma";
 			reg = <0 0x1c105000 0 0x1000>;
 			interrupts = <GIC_SPI 496 IRQ_TYPE_LEVEL_HIGH 0>;
@@ -2891,9 +2892,10 @@ vdo1_rdma1: rdma@1c105000 {
 			power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>;
 			iommus = <&iommu_vpp M4U_PORT_L3_MDP_RDMA1>;
 			mediatek,gce-client-reg = <&gce0 SUBSYS_1c10XXXX 0x5000 0x1000>;
+			#dma-cells = <1>;
 		};
 
-		vdo1_rdma2: rdma@1c106000 {
+		vdo1_rdma2: dma-controller@1c106000 {
 			compatible = "mediatek,mt8195-vdo1-rdma";
 			reg = <0 0x1c106000 0 0x1000>;
 			interrupts = <GIC_SPI 497 IRQ_TYPE_LEVEL_HIGH 0>;
@@ -2901,9 +2903,10 @@ vdo1_rdma2: rdma@1c106000 {
 			power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>;
 			iommus = <&iommu_vdo M4U_PORT_L2_MDP_RDMA2>;
 			mediatek,gce-client-reg = <&gce0 SUBSYS_1c10XXXX 0x6000 0x1000>;
+			#dma-cells = <1>;
 		};
 
-		vdo1_rdma3: rdma@1c107000 {
+		vdo1_rdma3: dma-controller@1c107000 {
 			compatible = "mediatek,mt8195-vdo1-rdma";
 			reg = <0 0x1c107000 0 0x1000>;
 			interrupts = <GIC_SPI 498 IRQ_TYPE_LEVEL_HIGH 0>;
@@ -2911,9 +2914,10 @@ vdo1_rdma3: rdma@1c107000 {
 			power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>;
 			iommus = <&iommu_vpp M4U_PORT_L3_MDP_RDMA3>;
 			mediatek,gce-client-reg = <&gce0 SUBSYS_1c10XXXX 0x7000 0x1000>;
+			#dma-cells = <1>;
 		};
 
-		vdo1_rdma4: rdma@1c108000 {
+		vdo1_rdma4: dma-controller@1c108000 {
 			compatible = "mediatek,mt8195-vdo1-rdma";
 			reg = <0 0x1c108000 0 0x1000>;
 			interrupts = <GIC_SPI 499 IRQ_TYPE_LEVEL_HIGH 0>;
@@ -2921,9 +2925,10 @@ vdo1_rdma4: rdma@1c108000 {
 			power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>;
 			iommus = <&iommu_vdo M4U_PORT_L2_MDP_RDMA4>;
 			mediatek,gce-client-reg = <&gce0 SUBSYS_1c10XXXX 0x8000 0x1000>;
+			#dma-cells = <1>;
 		};
 
-		vdo1_rdma5: rdma@1c109000 {
+		vdo1_rdma5: dma-controller@1c109000 {
 			compatible = "mediatek,mt8195-vdo1-rdma";
 			reg = <0 0x1c109000 0 0x1000>;
 			interrupts = <GIC_SPI 500 IRQ_TYPE_LEVEL_HIGH 0>;
@@ -2931,9 +2936,10 @@ vdo1_rdma5: rdma@1c109000 {
 			power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>;
 			iommus = <&iommu_vpp M4U_PORT_L3_MDP_RDMA5>;
 			mediatek,gce-client-reg = <&gce0 SUBSYS_1c10XXXX 0x9000 0x1000>;
+			#dma-cells = <1>;
 		};
 
-		vdo1_rdma6: rdma@1c10a000 {
+		vdo1_rdma6: dma-controller@1c10a000 {
 			compatible = "mediatek,mt8195-vdo1-rdma";
 			reg = <0 0x1c10a000 0 0x1000>;
 			interrupts = <GIC_SPI 501 IRQ_TYPE_LEVEL_HIGH 0>;
@@ -2941,9 +2947,10 @@ vdo1_rdma6: rdma@1c10a000 {
 			power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>;
 			iommus = <&iommu_vdo M4U_PORT_L2_MDP_RDMA6>;
 			mediatek,gce-client-reg = <&gce0 SUBSYS_1c10XXXX 0xa000 0x1000>;
+			#dma-cells = <1>;
 		};
 
-		vdo1_rdma7: rdma@1c10b000 {
+		vdo1_rdma7: dma-controller@1c10b000 {
 			compatible = "mediatek,mt8195-vdo1-rdma";
 			reg = <0 0x1c10b000 0 0x1000>;
 			interrupts = <GIC_SPI 502 IRQ_TYPE_LEVEL_HIGH 0>;
@@ -2951,6 +2958,7 @@ vdo1_rdma7: rdma@1c10b000 {
 			power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>;
 			iommus = <&iommu_vpp M4U_PORT_L3_MDP_RDMA7>;
 			mediatek,gce-client-reg = <&gce0 SUBSYS_1c10XXXX 0xb000 0x1000>;
+			#dma-cells = <1>;
 		};
 
 		merge1: vpp-merge@1c10c000 {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 149/583] arm64: dts: mediatek: mt8186: Fix alias prefix for ovl_2l0
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (147 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 148/583] arm64: dts: mediatek: mt8195: revise VDOSYS RDMA node name Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 150/583] arm64: dts: mediatek: mt8186: fix address warning for ADSP mailboxes Greg Kroah-Hartman
                   ` (440 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chen-Yu Tsai,
	AngeloGioacchino Del Regno, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chen-Yu Tsai <wenst@chromium.org>

[ Upstream commit 6ed159e499bc2ebedf94c9086244220824e71672 ]

The alias prefix for ovl_2l (2 layer overlay) is "ovl-2l", not "ovl_2l".

Fix this.

Fixes: 7e07d3322de2 ("arm64: dts: mediatek: mt8186: Add display nodes")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://lore.kernel.org/r/20231130074032.913511-4-wenst@chromium.org
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/mediatek/mt8186.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8186.dtsi b/arch/arm64/boot/dts/mediatek/mt8186.dtsi
index df0c04f2ba1d..021397671099 100644
--- a/arch/arm64/boot/dts/mediatek/mt8186.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8186.dtsi
@@ -22,7 +22,7 @@ / {
 
 	aliases {
 		ovl0 = &ovl0;
-		ovl_2l0 = &ovl_2l0;
+		ovl-2l0 = &ovl_2l0;
 		rdma0 = &rdma0;
 		rdma1 = &rdma1;
 	};
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 150/583] arm64: dts: mediatek: mt8186: fix address warning for ADSP mailboxes
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (148 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 149/583] arm64: dts: mediatek: mt8186: Fix alias prefix for ovl_2l0 Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 151/583] wifi: mt76: mt7921: fix country count limitation for CLC Greg Kroah-Hartman
                   ` (439 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Eugen Hristev,
	AngeloGioacchino Del Regno, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eugen Hristev <eugen.hristev@collabora.com>

[ Upstream commit 840e341bed3c4331061031dc9db0aff04abafb4b ]

Fix warnings reported by dtbs_check :

arch/arm64/boot/dts/mediatek/mt8186.dtsi:1163.35-1168.5: Warning (simple_bus_reg):
 /soc/mailbox@10686000: simple-bus unit address format error, expected "10686100"
arch/arm64/boot/dts/mediatek/mt8186.dtsi:1170.35-1175.5: Warning (simple_bus_reg):
 /soc/mailbox@10687000: simple-bus unit address format error, expected "10687100"

by having the right bus address as node name.

Fixes: 379cf0e639ae ("arm64: dts: mediatek: mt8186: Add ADSP mailbox nodes")
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Link: https://lore.kernel.org/r/20231204135533.21327-1-eugen.hristev@collabora.com
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/mediatek/mt8186.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8186.dtsi b/arch/arm64/boot/dts/mediatek/mt8186.dtsi
index 021397671099..2fec6fd1c1a7 100644
--- a/arch/arm64/boot/dts/mediatek/mt8186.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8186.dtsi
@@ -1160,14 +1160,14 @@ adsp: adsp@10680000 {
 			status = "disabled";
 		};
 
-		adsp_mailbox0: mailbox@10686000 {
+		adsp_mailbox0: mailbox@10686100 {
 			compatible = "mediatek,mt8186-adsp-mbox";
 			#mbox-cells = <0>;
 			reg = <0 0x10686100 0 0x1000>;
 			interrupts = <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH 0>;
 		};
 
-		adsp_mailbox1: mailbox@10687000 {
+		adsp_mailbox1: mailbox@10687100 {
 			compatible = "mediatek,mt8186-adsp-mbox";
 			#mbox-cells = <0>;
 			reg = <0 0x10687100 0 0x1000>;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 151/583] wifi: mt76: mt7921: fix country count limitation for CLC
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (149 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 150/583] arm64: dts: mediatek: mt8186: fix address warning for ADSP mailboxes Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 152/583] wifi: iwlwifi: dont support triggered EHT CQI feedback Greg Kroah-Hartman
                   ` (438 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ming Yen Hsieh, Felix Fietkau, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>

[ Upstream commit fa6ad88e023ddfa6c5dcdb466d159e89f451e305 ]

Due to the increase in the number of power tables for 6Ghz on CLC,
the variable nr_country is no longer sufficient to represent the
total quantity. Therefore, we have switched to calculating the
length of clc buf to obtain the correct power table. Additionally,
the version number has been incremented to 1.

Fixes: 23bdc5d8cadf ("wifi: mt76: mt7921: introduce Country Location Control support")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
index 90c93970acab..d1b1b8f767fc 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
@@ -1136,22 +1136,27 @@ int __mt7921_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2,
 		u8 type[2];
 		u8 rsvd[64];
 	} __packed req = {
+		.ver = 1,
 		.idx = idx,
 		.env = env_cap,
 		.acpi_conf = mt792x_acpi_get_flags(&dev->phy),
 	};
 	int ret, valid_cnt = 0;
-	u8 i, *pos;
+	u16 buf_len = 0;
+	u8 *pos;
 
 	if (!clc)
 		return 0;
 
+	buf_len = le16_to_cpu(clc->len) - sizeof(*clc);
 	pos = clc->data;
-	for (i = 0; i < clc->nr_country; i++) {
+	while (buf_len > 16) {
 		struct mt7921_clc_rule *rule = (struct mt7921_clc_rule *)pos;
 		u16 len = le16_to_cpu(rule->len);
+		u16 offset = len + sizeof(*rule);
 
-		pos += len + sizeof(*rule);
+		pos += offset;
+		buf_len -= offset;
 		if (rule->alpha2[0] != alpha2[0] ||
 		    rule->alpha2[1] != alpha2[1])
 			continue;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 152/583] wifi: iwlwifi: dont support triggered EHT CQI feedback
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (150 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 151/583] wifi: mt76: mt7921: fix country count limitation for CLC Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 153/583] selftests/bpf: Relax time_tai test for equal timestamps in tai_forward Greg Kroah-Hartman
                   ` (437 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Miri Korenblit, Johannes Berg, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Miri Korenblit <miriam.rachel.korenblit@intel.com>

[ Upstream commit 637bbd5b3cbd0fc6945ebd2e311315b6cca1f9c5 ]

EHT CQI is one of the EHT PHY capabilities. We don't support EHT CQI.
The non-triggered CQI feedback bit was unset in a previous patch,
but the triggered CQI feedback bit wasn't. Unset it.

Fixes: 0e21ec6edbb5 ("wifi: iwlwifi: nvm: Update EHT capabilities for GL device")
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20231207044813.092528daf59e.I5715769490835819beddb00c91bbc9e806e170cb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
index 31176897b746..e3120ab893f4 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
@@ -1012,7 +1012,8 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans,
 			  IEEE80211_EHT_PHY_CAP3_NG_16_MU_FEEDBACK |
 			  IEEE80211_EHT_PHY_CAP3_CODEBOOK_4_2_SU_FDBK |
 			  IEEE80211_EHT_PHY_CAP3_CODEBOOK_7_5_MU_FDBK |
-			  IEEE80211_EHT_PHY_CAP3_TRIG_MU_BF_PART_BW_FDBK);
+			  IEEE80211_EHT_PHY_CAP3_TRIG_MU_BF_PART_BW_FDBK |
+			  IEEE80211_EHT_PHY_CAP3_TRIG_CQI_FDBK);
 		iftype_data->eht_cap.eht_cap_elem.phy_cap_info[4] &=
 			~(IEEE80211_EHT_PHY_CAP4_PART_BW_DL_MU_MIMO |
 			  IEEE80211_EHT_PHY_CAP4_POWER_BOOST_FACT_SUPP);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 153/583] selftests/bpf: Relax time_tai test for equal timestamps in tai_forward
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (151 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 152/583] wifi: iwlwifi: dont support triggered EHT CQI feedback Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 154/583] block: Set memalloc_noio to false on device_add_disk() error path Greg Kroah-Hartman
                   ` (436 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, YiFei Zhu, Andrii Nakryiko, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: YiFei Zhu <zhuyifei@google.com>

[ Upstream commit e1ba7f64b192f083b4423644be03bb9e3dc8ae84 ]

We're observing test flakiness on an arm64 platform which might not
have timestamps as precise as x86. The test log looks like:

  test_time_tai:PASS:tai_open 0 nsec
  test_time_tai:PASS:test_run 0 nsec
  test_time_tai:PASS:tai_ts1 0 nsec
  test_time_tai:PASS:tai_ts2 0 nsec
  test_time_tai:FAIL:tai_forward unexpected tai_forward: actual 1702348135471494160 <= expected 1702348135471494160
  test_time_tai:PASS:tai_gettime 0 nsec
  test_time_tai:PASS:tai_future_ts1 0 nsec
  test_time_tai:PASS:tai_future_ts2 0 nsec
  test_time_tai:PASS:tai_range_ts1 0 nsec
  test_time_tai:PASS:tai_range_ts2 0 nsec
  #199     time_tai:FAIL

This patch changes ASSERT_GT to ASSERT_GE in the tai_forward assertion
so that equal timestamps are permitted.

Fixes: 64e15820b987 ("selftests/bpf: Add BPF-helper test for CLOCK_TAI access")
Signed-off-by: YiFei Zhu <zhuyifei@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20231212182911.3784108-1-zhuyifei@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/bpf/prog_tests/time_tai.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/time_tai.c b/tools/testing/selftests/bpf/prog_tests/time_tai.c
index a31119823666..f45af1b0ef2c 100644
--- a/tools/testing/selftests/bpf/prog_tests/time_tai.c
+++ b/tools/testing/selftests/bpf/prog_tests/time_tai.c
@@ -56,7 +56,7 @@ void test_time_tai(void)
 	ASSERT_NEQ(ts2, 0, "tai_ts2");
 
 	/* TAI is moving forward only */
-	ASSERT_GT(ts2, ts1, "tai_forward");
+	ASSERT_GE(ts2, ts1, "tai_forward");
 
 	/* Check for future */
 	ret = clock_gettime(CLOCK_TAI, &now_tai);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 154/583] block: Set memalloc_noio to false on device_add_disk() error path
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (152 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 153/583] selftests/bpf: Relax time_tai test for equal timestamps in tai_forward Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 155/583] arm64: dts: xilinx: Apply overlays to base dtbs Greg Kroah-Hartman
                   ` (435 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Li Nan, Christoph Hellwig,
	Jens Axboe, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Li Nan <linan122@huawei.com>

[ Upstream commit 5fa3d1a00c2d4ba14f1300371ad39d5456e890d7 ]

On the error path of device_add_disk(), device's memalloc_noio flag was
set but not cleared. As the comment of pm_runtime_set_memalloc_noio(),
"The function should be called between device_add() and device_del()".
Clear this flag before device_del() now.

Fixes: 25e823c8c37d ("block/genhd.c: apply pm_runtime_set_memalloc_noio on block devices")
Signed-off-by: Li Nan <linan122@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20231211075356.1839282-1-linan666@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 block/genhd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/genhd.c b/block/genhd.c
index cc32a0c704eb..95a4b8ae2aea 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -542,6 +542,7 @@ int __must_check device_add_disk(struct device *parent, struct gendisk *disk,
 	kobject_put(disk->part0->bd_holder_dir);
 out_del_block_link:
 	sysfs_remove_link(block_depr, dev_name(ddev));
+	pm_runtime_set_memalloc_noio(ddev, false);
 out_device_del:
 	device_del(ddev);
 out_free_ext_minor:
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 155/583] arm64: dts: xilinx: Apply overlays to base dtbs
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (153 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 154/583] block: Set memalloc_noio to false on device_add_disk() error path Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 156/583] arm64: dts: renesas: white-hawk-cpu: Fix missing serial console pin control Greg Kroah-Hartman
                   ` (434 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Rob Herring, Michal Simek, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Rob Herring <robh@kernel.org>

[ Upstream commit 23b697ec85f3e7beed271b9f344c54821de2251e ]

DT overlays in tree need to be applied to a base DTB to validate they
apply, to run schema checks on them, and to catch any errors at compile
time. Defining the "-dtbs" variable is not enough as the combined DT must
be added to dtbs-y.

zynqmp-sck-kr-g-revA.dtso and zynqmp-sck-kr-g-revB.dtso don't exist, so drop
them.

Signed-off-by: Rob Herring <robh@kernel.org>
Fixes: 45fe0dc4ea2e ("arm64: xilinx: Use zynqmp prefix for SOM dt overlays")
Link: https://lore.kernel.org/r/20230911214751.2202913-1-robh@kernel.org
Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/xilinx/Makefile | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/boot/dts/xilinx/Makefile b/arch/arm64/boot/dts/xilinx/Makefile
index 5e40c0b4fa0a..1068b0fa8e98 100644
--- a/arch/arm64/boot/dts/xilinx/Makefile
+++ b/arch/arm64/boot/dts/xilinx/Makefile
@@ -22,11 +22,10 @@ dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sm-k26-revA.dtb
 dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-smk-k26-revA.dtb
 
 zynqmp-sm-k26-revA-sck-kv-g-revA-dtbs := zynqmp-sm-k26-revA.dtb zynqmp-sck-kv-g-revA.dtbo
+dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sm-k26-revA-sck-kv-g-revA.dtb
 zynqmp-sm-k26-revA-sck-kv-g-revB-dtbs := zynqmp-sm-k26-revA.dtb zynqmp-sck-kv-g-revB.dtbo
+dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-sm-k26-revA-sck-kv-g-revB.dtb
 zynqmp-smk-k26-revA-sck-kv-g-revA-dtbs := zynqmp-smk-k26-revA.dtb zynqmp-sck-kv-g-revA.dtbo
+dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-smk-k26-revA-sck-kv-g-revA.dtb
 zynqmp-smk-k26-revA-sck-kv-g-revB-dtbs := zynqmp-smk-k26-revA.dtb zynqmp-sck-kv-g-revB.dtbo
-
-zynqmp-sm-k26-revA-sck-kr-g-revA-dtbs := zynqmp-sm-k26-revA.dtb zynqmp-sck-kr-g-revA.dtbo
-zynqmp-sm-k26-revA-sck-kr-g-revB-dtbs := zynqmp-sm-k26-revA.dtb zynqmp-sck-kr-g-revB.dtbo
-zynqmp-smk-k26-revA-sck-kr-g-revA-dtbs := zynqmp-smk-k26-revA.dtb zynqmp-sck-kr-g-revA.dtbo
-zynqmp-smk-k26-revA-sck-kr-g-revB-dtbs := zynqmp-smk-k26-revA.dtb zynqmp-sck-kr-g-revB.dtbo
+dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-smk-k26-revA-sck-kv-g-revB.dtb
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 156/583] arm64: dts: renesas: white-hawk-cpu: Fix missing serial console pin control
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (154 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 155/583] arm64: dts: xilinx: Apply overlays to base dtbs Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 157/583] arm64: dts: imx8mm: Reduce GPU to nominal speed Greg Kroah-Hartman
                   ` (433 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Geert Uytterhoeven, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Geert Uytterhoeven <geert+renesas@glider.be>

[ Upstream commit fc67495680f60e88bb8ca43421c1dd628928d581 ]

The pin control description for the serial console was added, but not
enabled, due to missing pinctrl properties in the serial port device
node.

Fixes: 7a8d590de8132853 ("arm64: dts: renesas: white-hawk-cpu: Add serial port pin control")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/8a51516581cd71ecbfa174af9c7cebad1fc83c5b.1702459865.git.geert+renesas@glider.be
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi b/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi
index bb4a5270f71b..913f70fe6c5c 100644
--- a/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi
@@ -187,6 +187,9 @@ &extalr_clk {
 };
 
 &hscif0 {
+	pinctrl-0 = <&hscif0_pins>;
+	pinctrl-names = "default";
+
 	status = "okay";
 };
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 157/583] arm64: dts: imx8mm: Reduce GPU to nominal speed
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (155 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 156/583] arm64: dts: renesas: white-hawk-cpu: Fix missing serial console pin control Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 158/583] scsi: ufs: qcom: Fix the return value of ufs_qcom_ice_program_key() Greg Kroah-Hartman
                   ` (432 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Adam Ford, Shawn Guo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Adam Ford <aford173@gmail.com>

[ Upstream commit 1f794d3eed5345413c2b0cf1bcccc92d77681220 ]

When the GPU nodes were added, the GPU_PLL_OUT was configured
for 1000MHz, but this requires the SoC to run in overdrive mode
which requires an elevated voltage operating point.

Since this may run some boards out of spec, the default clock
should be set to 800MHz for nominal operating mode. Boards
that run at the higher voltage can update their clocks
accordingly.

Fixes: 4523be8e46be ("arm64: dts: imx8mm: Add GPU nodes for 2D and 3D core")
Signed-off-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/freescale/imx8mm.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
index 738024baaa57..54faf83cb436 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
@@ -1408,7 +1408,7 @@ gpu_3d: gpu@38000000 {
 			assigned-clocks = <&clk IMX8MM_CLK_GPU3D_CORE>,
 					  <&clk IMX8MM_GPU_PLL_OUT>;
 			assigned-clock-parents = <&clk IMX8MM_GPU_PLL_OUT>;
-			assigned-clock-rates = <0>, <1000000000>;
+			assigned-clock-rates = <0>, <800000000>;
 			power-domains = <&pgc_gpu>;
 		};
 
@@ -1423,7 +1423,7 @@ gpu_2d: gpu@38008000 {
 			assigned-clocks = <&clk IMX8MM_CLK_GPU2D_CORE>,
 					  <&clk IMX8MM_GPU_PLL_OUT>;
 			assigned-clock-parents = <&clk IMX8MM_GPU_PLL_OUT>;
-			assigned-clock-rates = <0>, <1000000000>;
+			assigned-clock-rates = <0>, <800000000>;
 			power-domains = <&pgc_gpu>;
 		};
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 158/583] scsi: ufs: qcom: Fix the return value of ufs_qcom_ice_program_key()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (156 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 157/583] arm64: dts: imx8mm: Reduce GPU to nominal speed Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 159/583] scsi: ufs: qcom: Fix the return value when platform_get_resource_byname() fails Greg Kroah-Hartman
                   ` (431 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Abel Vesa, Manivannan Sadhasivam,
	Martin K. Petersen, Sasha Levin, Andrew Halaney

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

[ Upstream commit 3bf7ab4ac30c03beecf57c052e87d5a38fb8aed6 ]

Currently, the function returns -EINVAL if algorithm other than AES-256-XTS
is requested. But the correct error code is -EOPNOTSUPP. Fix it!

Cc: Abel Vesa <abel.vesa@linaro.org>
Fixes: 56541c7c4468 ("scsi: ufs: ufs-qcom: Switch to the new ICE API")
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20231208065902.11006-3-manivannan.sadhasivam@linaro.org
Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8775p-ride
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ufs/host/ufs-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index fc40726e13c2..fc0fa1065a30 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -159,7 +159,7 @@ static int ufs_qcom_ice_program_key(struct ufs_hba *hba,
 	cap = hba->crypto_cap_array[cfg->crypto_cap_idx];
 	if (cap.algorithm_id != UFS_CRYPTO_ALG_AES_XTS ||
 	    cap.key_size != UFS_CRYPTO_KEY_SIZE_256)
-		return -EINVAL;
+		return -EOPNOTSUPP;
 
 	if (config_enable)
 		return qcom_ice_program_key(host->ice,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 159/583] scsi: ufs: qcom: Fix the return value when platform_get_resource_byname() fails
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (157 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 158/583] scsi: ufs: qcom: Fix the return value of ufs_qcom_ice_program_key() Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 160/583] scsi: hisi_sas: Replace with standard error code return value Greg Kroah-Hartman
                   ` (430 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Andrew Halaney,
	Manivannan Sadhasivam, Martin K. Petersen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

[ Upstream commit 3a747c5cf9b6c36649783b28d2ef8f9c92b16a0f ]

The return value should be -ENODEV indicating that the resource is not
provided in DT, not -ENOMEM. Fix it!

Fixes: c263b4ef737e ("scsi: ufs: core: mcq: Configure resource regions")
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20231208065902.11006-4-manivannan.sadhasivam@linaro.org
Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8775p-ride
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/ufs/host/ufs-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index fc0fa1065a30..0cbe14aca877 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -1675,7 +1675,7 @@ static int ufs_qcom_mcq_config_resource(struct ufs_hba *hba)
 		if (!res->resource) {
 			dev_info(hba->dev, "Resource %s not provided\n", res->name);
 			if (i == RES_UFS)
-				return -ENOMEM;
+				return -ENODEV;
 			continue;
 		} else if (i == RES_UFS) {
 			res_mem = res->resource;
-- 
2.43.0



truct iio_dev *iio_dev = private;
+	struct ad7091r_state *st = iio_priv(iio_dev);
 	unsigned int i, read_val;
 	int ret;
 	s64 timestamp = iio_get_time_ns(iio_dev);
@@ -234,7 +234,7 @@ int ad7091r_probe(struct device *dev, co
 	if (irq) {
 		ret = devm_request_threaded_irq(dev, irq, NULL,
 				ad7091r_event_handler,
-				IRQF_TRIGGER_FALLING | IRQF_ONESHOT, name, st);
+				IRQF_TRIGGER_FALLING | IRQF_ONESHOT, name, iio_dev);
 		if (ret)
 			return ret;
 	}



^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 160/583] scsi: hisi_sas: Replace with standard error code return value
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (158 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 159/583] scsi: ufs: qcom: Fix the return value when platform_get_resource_byname() fails Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 161/583] scsi: hisi_sas: Check before using pointer variables Greg Kroah-Hartman
                   ` (429 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yihang Li, Xiang Chen,
	Martin K. Petersen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yihang Li <liyihang9@huawei.com>

[ Upstream commit d34ee535705eb43885bc0f561c63046f697355ad ]

In function hisi_sas_controller_prereset(), -ENOSYS (Function not
implemented) should be returned if the driver does not support .soft_reset.
Returns -EPERM (Operation not permitted) if HISI_SAS_RESETTING_BIT is
already be set.

In function _suspend_v3_hw(), returns -EPERM (Operation not permitted) if
HISI_SAS_RESETTING_BIT is already be set.

Fixes: 4522204ab218 ("scsi: hisi_sas: tidy host controller reset function a bit")
Signed-off-by: Yihang Li <liyihang9@huawei.com>
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Link: https://lore.kernel.org/r/1702525516-51258-3-git-send-email-chenxiang66@hisilicon.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/hisi_sas/hisi_sas_main.c  | 4 ++--
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 9472b9743aef..6dfa8be17ea4 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1565,12 +1565,12 @@ EXPORT_SYMBOL_GPL(hisi_sas_controller_reset_done);
 static int hisi_sas_controller_prereset(struct hisi_hba *hisi_hba)
 {
 	if (!hisi_hba->hw->soft_reset)
-		return -1;
+		return -ENOENT;
 
 	down(&hisi_hba->sem);
 	if (test_and_set_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags)) {
 		up(&hisi_hba->sem);
-		return -1;
+		return -EPERM;
 	}
 
 	if (hisi_sas_debugfs_enable && hisi_hba->debugfs_itct[0].itct)
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
index 089186fe1791..568bd8052639 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
@@ -5148,7 +5148,7 @@ static int _suspend_v3_hw(struct device *device)
 	}
 
 	if (test_and_set_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags))
-		return -1;
+		return -EPERM;
 
 	dev_warn(dev, "entering suspend state\n");
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 161/583] scsi: hisi_sas: Check before using pointer variables
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (159 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 160/583] scsi: hisi_sas: Replace with standard error code return value Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 162/583] scsi: hisi_sas: Rollback some operations if FLR failed Greg Kroah-Hartman
                   ` (428 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yihang Li, Xiang Chen,
	Martin K. Petersen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yihang Li <liyihang9@huawei.com>

[ Upstream commit 8dd10296be8562a45c6c6794dd492a2b7dccede8 ]

In commit 4b329abc9180 ("scsi: hisi_sas: Move slot variable definition in
hisi_sas_abort_task()"), we move the variables slot to the function head.
However, the variable slot may be NULL, we should check it in each branch.

Fixes: 4b329abc9180 ("scsi: hisi_sas: Move slot variable definition in hisi_sas_abort_task()")
Signed-off-by: Yihang Li <liyihang9@huawei.com>
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Link: https://lore.kernel.org/r/1702525516-51258-4-git-send-email-chenxiang66@hisilicon.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/hisi_sas/hisi_sas_main.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 6dfa8be17ea4..b155ac800979 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1641,7 +1641,10 @@ static int hisi_sas_abort_task(struct sas_task *task)
 	task->task_state_flags |= SAS_TASK_STATE_ABORTED;
 	spin_unlock_irqrestore(&task->task_state_lock, flags);
 
-	if (slot && task->task_proto & SAS_PROTOCOL_SSP) {
+	if (!slot)
+		goto out;
+
+	if (task->task_proto & SAS_PROTOCOL_SSP) {
 		u16 tag = slot->idx;
 		int rc2;
 
@@ -1688,7 +1691,7 @@ static int hisi_sas_abort_task(struct sas_task *task)
 				rc = hisi_sas_softreset_ata_disk(device);
 			}
 		}
-	} else if (slot && task->task_proto & SAS_PROTOCOL_SMP) {
+	} else if (task->task_proto & SAS_PROTOCOL_SMP) {
 		/* SMP */
 		u32 tag = slot->idx;
 		struct hisi_sas_cq *cq = &hisi_hba->cq[slot->dlvry_queue];
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 162/583] scsi: hisi_sas: Rollback some operations if FLR failed
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (160 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 161/583] scsi: hisi_sas: Check before using pointer variables Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 163/583] scsi: hisi_sas: Correct the number of global debugfs registers Greg Kroah-Hartman
                   ` (427 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yihang Li, Xiang Chen,
	Martin K. Petersen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yihang Li <liyihang9@huawei.com>

[ Upstream commit 7ea3e7763c50b20a8bd25cf524ea0c6463de69be ]

We obtain the semaphore and set HISI_SAS_RESETTING_BIT in
hisi_sas_reset_prepare_v3_hw(), block the scsi host and set
HISI_SAS_REJECT_CMD_BIT in hisi_sas_controller_reset_prepare(), released
them in hisi_sas_controller_reset_done(). However, if the HW reset failure
in FLR results in early return, the semaphore and flag bits will not be
release.

Rollback some operations including clearing flags / releasing semaphore
when FLR is failed.

Fixes: e5ea48014adc ("scsi: hisi_sas: Implement handlers of PCIe FLR for v3 hw")
Signed-off-by: Yihang Li <liyihang9@huawei.com>
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Link: https://lore.kernel.org/r/1702525516-51258-5-git-send-email-chenxiang66@hisilicon.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
index 568bd8052639..53c955c4f080 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
@@ -5098,6 +5098,7 @@ static void hisi_sas_reset_done_v3_hw(struct pci_dev *pdev)
 {
 	struct sas_ha_struct *sha = pci_get_drvdata(pdev);
 	struct hisi_hba *hisi_hba = sha->lldd_ha;
+	struct Scsi_Host *shost = hisi_hba->shost;
 	struct device *dev = hisi_hba->dev;
 	int rc;
 
@@ -5106,6 +5107,10 @@ static void hisi_sas_reset_done_v3_hw(struct pci_dev *pdev)
 	rc = hw_init_v3_hw(hisi_hba);
 	if (rc) {
 		dev_err(dev, "FLR: hw init failed rc=%d\n", rc);
+		clear_bit(HISI_SAS_REJECT_CMD_BIT, &hisi_hba->flags);
+		scsi_unblock_requests(shost);
+		clear_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags);
+		up(&hisi_hba->sem);
 		return;
 	}
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 163/583] scsi: hisi_sas: Correct the number of global debugfs registers
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (161 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 162/583] scsi: hisi_sas: Rollback some operations if FLR failed Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 164/583] ARM: dts: stm32: dont mix SCMI and non-SCMI board compatibles Greg Kroah-Hartman
                   ` (426 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yihang Li, Xiang Chen,
	Martin K. Petersen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yihang Li <liyihang9@huawei.com>

[ Upstream commit 73e33f969ef05328766b23a99b2c07bfff765009 ]

In function debugfs_debugfs_snapshot_global_reg_v3_hw() it uses
debugfs_axi_reg.count (which is the number of axi debugfs registers) to
acquire the number of global debugfs registers.

Use debugfs_global_reg.count to acquire the number of global debugfs
registers instead.

Fixes: 623a4b6d5c2a ("scsi: hisi_sas: Move debugfs code to v3 hw driver")
Signed-off-by: Yihang Li <liyihang9@huawei.com>
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Link: https://lore.kernel.org/r/1702525516-51258-6-git-send-email-chenxiang66@hisilicon.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
index 53c955c4f080..520fffc14282 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
@@ -3478,7 +3478,7 @@ static void debugfs_snapshot_global_reg_v3_hw(struct hisi_hba *hisi_hba)
 	u32 *databuf = hisi_hba->debugfs_regs[dump_index][DEBUGFS_GLOBAL].data;
 	int i;
 
-	for (i = 0; i < debugfs_axi_reg.count; i++, databuf++)
+	for (i = 0; i < debugfs_global_reg.count; i++, databuf++)
 		*databuf = hisi_sas_read32(hisi_hba, 4 * i);
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 164/583] ARM: dts: stm32: dont mix SCMI and non-SCMI board compatibles
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (162 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 163/583] scsi: hisi_sas: Correct the number of global debugfs registers Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 165/583] bpf: Fix a race condition between btf_put() and map_free() Greg Kroah-Hartman
                   ` (425 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ahmad Fatoum, Alexandre Torgue, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ahmad Fatoum <a.fatoum@pengutronix.de>

[ Upstream commit bfc3c6743de0ecb169026c36cbdbc0d12d22a528 ]

The binding erroneously decreed that the SCMI variants of the ST
evaluation kits are compatible with the non-SCMI variants.

This is not correct, as a kernel or bootloader compatible with the non-SCMI
variant is not necessarily able to function, when direct access
to resources is replaced by having to talk SCMI to the secure monitor.

The binding has been adjusted to reflect thus, so synchronize the device
trees now.

Fixes: 5b7e58313a77 ("ARM: dts: stm32: Add SCMI version of STM32 boards (DK1/DK2/ED1/EV1)")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/boot/dts/st/stm32mp157a-dk1-scmi.dts | 2 +-
 arch/arm/boot/dts/st/stm32mp157c-dk2-scmi.dts | 2 +-
 arch/arm/boot/dts/st/stm32mp157c-ed1-scmi.dts | 2 +-
 arch/arm/boot/dts/st/stm32mp157c-ev1-scmi.dts | 3 +--
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/st/stm32mp157a-dk1-scmi.dts b/arch/arm/boot/dts/st/stm32mp157a-dk1-scmi.dts
index afcd6285890c..c27963898b5e 100644
--- a/arch/arm/boot/dts/st/stm32mp157a-dk1-scmi.dts
+++ b/arch/arm/boot/dts/st/stm32mp157a-dk1-scmi.dts
@@ -11,7 +11,7 @@
 
 / {
 	model = "STMicroelectronics STM32MP157A-DK1 SCMI Discovery Board";
-	compatible = "st,stm32mp157a-dk1-scmi", "st,stm32mp157a-dk1", "st,stm32mp157";
+	compatible = "st,stm32mp157a-dk1-scmi", "st,stm32mp157";
 
 	reserved-memory {
 		optee@de000000 {
diff --git a/arch/arm/boot/dts/st/stm32mp157c-dk2-scmi.dts b/arch/arm/boot/dts/st/stm32mp157c-dk2-scmi.dts
index 39358d902000..622618943134 100644
--- a/arch/arm/boot/dts/st/stm32mp157c-dk2-scmi.dts
+++ b/arch/arm/boot/dts/st/stm32mp157c-dk2-scmi.dts
@@ -11,7 +11,7 @@
 
 / {
 	model = "STMicroelectronics STM32MP157C-DK2 SCMI Discovery Board";
-	compatible = "st,stm32mp157c-dk2-scmi", "st,stm32mp157c-dk2", "st,stm32mp157";
+	compatible = "st,stm32mp157c-dk2-scmi", "st,stm32mp157";
 
 	reserved-memory {
 		optee@de000000 {
diff --git a/arch/arm/boot/dts/st/stm32mp157c-ed1-scmi.dts b/arch/arm/boot/dts/st/stm32mp157c-ed1-scmi.dts
index 07ea765a4553..c7c4d7e89d61 100644
--- a/arch/arm/boot/dts/st/stm32mp157c-ed1-scmi.dts
+++ b/arch/arm/boot/dts/st/stm32mp157c-ed1-scmi.dts
@@ -11,7 +11,7 @@
 
 / {
 	model = "STMicroelectronics STM32MP157C-ED1 SCMI eval daughter";
-	compatible = "st,stm32mp157c-ed1-scmi", "st,stm32mp157c-ed1", "st,stm32mp157";
+	compatible = "st,stm32mp157c-ed1-scmi", "st,stm32mp157";
 
 	reserved-memory {
 		optee@fe000000 {
diff --git a/arch/arm/boot/dts/st/stm32mp157c-ev1-scmi.dts b/arch/arm/boot/dts/st/stm32mp157c-ev1-scmi.dts
index 813086ec2489..2ab77e64f1bb 100644
--- a/arch/arm/boot/dts/st/stm32mp157c-ev1-scmi.dts
+++ b/arch/arm/boot/dts/st/stm32mp157c-ev1-scmi.dts
@@ -11,8 +11,7 @@
 
 / {
 	model = "STMicroelectronics STM32MP157C-EV1 SCMI eval daughter on eval mother";
-	compatible = "st,stm32mp157c-ev1-scmi", "st,stm32mp157c-ev1", "st,stm32mp157c-ed1",
-		     "st,stm32mp157";
+	compatible = "st,stm32mp157c-ev1-scmi", "st,stm32mp157c-ed1", "st,stm32mp157";
 
 	reserved-memory {
 		optee@fe000000 {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 165/583] bpf: Fix a race condition between btf_put() and map_free()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (163 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 164/583] ARM: dts: stm32: dont mix SCMI and non-SCMI board compatibles Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 166/583] selftests/net: fix grep checking for fib_nexthop_multiprefix Greg Kroah-Hartman
                   ` (424 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hou Tao, Yonghong Song,
	Alexei Starovoitov, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yonghong Song <yonghong.song@linux.dev>

[ Upstream commit 59e5791f59dd83e8aa72a4e74217eabb6e8cfd90 ]

When running `./test_progs -j` in my local vm with latest kernel,
I once hit a kasan error like below:

  [ 1887.184724] BUG: KASAN: slab-use-after-free in bpf_rb_root_free+0x1f8/0x2b0
  [ 1887.185599] Read of size 4 at addr ffff888106806910 by task kworker/u12:2/2830
  [ 1887.186498]
  [ 1887.186712] CPU: 3 PID: 2830 Comm: kworker/u12:2 Tainted: G           OEL     6.7.0-rc3-00699-g90679706d486-dirty #494
  [ 1887.188034] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
  [ 1887.189618] Workqueue: events_unbound bpf_map_free_deferred
  [ 1887.190341] Call Trace:
  [ 1887.190666]  <TASK>
  [ 1887.190949]  dump_stack_lvl+0xac/0xe0
  [ 1887.191423]  ? nf_tcp_handle_invalid+0x1b0/0x1b0
  [ 1887.192019]  ? panic+0x3c0/0x3c0
  [ 1887.192449]  print_report+0x14f/0x720
  [ 1887.192930]  ? preempt_count_sub+0x1c/0xd0
  [ 1887.193459]  ? __virt_addr_valid+0xac/0x120
  [ 1887.194004]  ? bpf_rb_root_free+0x1f8/0x2b0
  [ 1887.194572]  kasan_report+0xc3/0x100
  [ 1887.195085]  ? bpf_rb_root_free+0x1f8/0x2b0
  [ 1887.195668]  bpf_rb_root_free+0x1f8/0x2b0
  [ 1887.196183]  ? __bpf_obj_drop_impl+0xb0/0xb0
  [ 1887.196736]  ? preempt_count_sub+0x1c/0xd0
  [ 1887.197270]  ? preempt_count_sub+0x1c/0xd0
  [ 1887.197802]  ? _raw_spin_unlock+0x1f/0x40
  [ 1887.198319]  bpf_obj_free_fields+0x1d4/0x260
  [ 1887.198883]  array_map_free+0x1a3/0x260
  [ 1887.199380]  bpf_map_free_deferred+0x7b/0xe0
  [ 1887.199943]  process_scheduled_works+0x3a2/0x6c0
  [ 1887.200549]  worker_thread+0x633/0x890
  [ 1887.201047]  ? __kthread_parkme+0xd7/0xf0
  [ 1887.201574]  ? kthread+0x102/0x1d0
  [ 1887.202020]  kthread+0x1ab/0x1d0
  [ 1887.202447]  ? pr_cont_work+0x270/0x270
  [ 1887.202954]  ? kthread_blkcg+0x50/0x50
  [ 1887.203444]  ret_from_fork+0x34/0x50
  [ 1887.203914]  ? kthread_blkcg+0x50/0x50
  [ 1887.204397]  ret_from_fork_asm+0x11/0x20
  [ 1887.204913]  </TASK>
  [ 1887.204913]  </TASK>
  [ 1887.205209]
  [ 1887.205416] Allocated by task 2197:
  [ 1887.205881]  kasan_set_track+0x3f/0x60
  [ 1887.206366]  __kasan_kmalloc+0x6e/0x80
  [ 1887.206856]  __kmalloc+0xac/0x1a0
  [ 1887.207293]  btf_parse_fields+0xa15/0x1480
  [ 1887.207836]  btf_parse_struct_metas+0x566/0x670
  [ 1887.208387]  btf_new_fd+0x294/0x4d0
  [ 1887.208851]  __sys_bpf+0x4ba/0x600
  [ 1887.209292]  __x64_sys_bpf+0x41/0x50
  [ 1887.209762]  do_syscall_64+0x4c/0xf0
  [ 1887.210222]  entry_SYSCALL_64_after_hwframe+0x63/0x6b
  [ 1887.210868]
  [ 1887.211074] Freed by task 36:
  [ 1887.211460]  kasan_set_track+0x3f/0x60
  [ 1887.211951]  kasan_save_free_info+0x28/0x40
  [ 1887.212485]  ____kasan_slab_free+0x101/0x180
  [ 1887.213027]  __kmem_cache_free+0xe4/0x210
  [ 1887.213514]  btf_free+0x5b/0x130
  [ 1887.213918]  rcu_core+0x638/0xcc0
  [ 1887.214347]  __do_softirq+0x114/0x37e

The error happens at bpf_rb_root_free+0x1f8/0x2b0:

  00000000000034c0 <bpf_rb_root_free>:
  ; {
    34c0: f3 0f 1e fa                   endbr64
    34c4: e8 00 00 00 00                callq   0x34c9 <bpf_rb_root_free+0x9>
    34c9: 55                            pushq   %rbp
    34ca: 48 89 e5                      movq    %rsp, %rbp
  ...
  ;       if (rec && rec->refcount_off >= 0 &&
    36aa: 4d 85 ed                      testq   %r13, %r13
    36ad: 74 a9                         je      0x3658 <bpf_rb_root_free+0x198>
    36af: 49 8d 7d 10                   leaq    0x10(%r13), %rdi
    36b3: e8 00 00 00 00                callq   0x36b8 <bpf_rb_root_free+0x1f8>
                                        <==== kasan function
    36b8: 45 8b 7d 10                   movl    0x10(%r13), %r15d
                                        <==== use-after-free load
    36bc: 45 85 ff                      testl   %r15d, %r15d
    36bf: 78 8c                         js      0x364d <bpf_rb_root_free+0x18d>

So the problem is at rec->refcount_off in the above.

I did some source code analysis and find the reason.
                                  CPU A                        CPU B
  bpf_map_put:
    ...
    btf_put with rcu callback
    ...
    bpf_map_free_deferred
      with system_unbound_wq
    ...                          ...                           ...
    ...                          btf_free_rcu:                 ...
    ...                          ...                           bpf_map_free_deferred:
    ...                          ...
    ...         --------->       btf_struct_metas_free()
    ...         | race condition ...
    ...         --------->                                     map->ops->map_free()
    ...
    ...                          btf->struct_meta_tab = NULL

In the above, map_free() corresponds to array_map_free() and eventually
calling bpf_rb_root_free() which calls:
  ...
  __bpf_obj_drop_impl(obj, field->graph_root.value_rec, false);
  ...

Here, 'value_rec' is assigned in btf_check_and_fixup_fields() with following code:

  meta = btf_find_struct_meta(btf, btf_id);
  if (!meta)
    return -EFAULT;
  rec->fields[i].graph_root.value_rec = meta->record;

So basically, 'value_rec' is a pointer to the record in struct_metas_tab.
And it is possible that that particular record has been freed by
btf_struct_metas_free() and hence we have a kasan error here.

Actually it is very hard to reproduce the failure with current bpf/bpf-next
code, I only got the above error once. To increase reproducibility, I added
a delay in bpf_map_free_deferred() to delay map->ops->map_free(), which
significantly increased reproducibility.

#  diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
#  index 5e43ddd1b83f..aae5b5213e93 100644
#  --- a/kernel/bpf/syscall.c
#  +++ b/kernel/bpf/syscall.c
# @@ -695,6 +695,7 @@ static void bpf_map_free_deferred(struct work_struct *work)
#        struct bpf_map *map = container_of(work, struct bpf_map, work);
#        struct btf_record *rec = map->record;
#
#  +     mdelay(100);
#        security_bpf_map_free(map);
#        bpf_map_release_memcg(map);
#        /* implementation dependent freeing */

Hao also provided test cases ([1]) for easily reproducing the above issue.

There are two ways to fix the issue, the v1 of the patch ([2]) moving
btf_put() after map_free callback, and the v5 of the patch ([3]) using
a kptr style fix which tries to get a btf reference during
map_check_btf(). Each approach has its pro and cons. The first approach
delays freeing btf while the second approach needs to acquire reference
depending on context which makes logic not very elegant and may
complicate things with future new data structures. Alexei
suggested in [4] going back to v1 which is what this patch
tries to do.

Rerun './test_progs -j' with the above mdelay() hack for a couple
of times and didn't observe the error for the above rb_root test cases.
Running Hou's test ([1]) is also successful.

  [1] https://lore.kernel.org/bpf/20231207141500.917136-1-houtao@huaweicloud.com/
  [2] v1: https://lore.kernel.org/bpf/20231204173946.3066377-1-yonghong.song@linux.dev/
  [3] v5: https://lore.kernel.org/bpf/20231208041621.2968241-1-yonghong.song@linux.dev/
  [4] v4: https://lore.kernel.org/bpf/CAADnVQJ3FiXUhZJwX_81sjZvSYYKCFB3BT6P8D59RS2Gu+0Z7g@mail.gmail.com/

Cc: Hou Tao <houtao@huaweicloud.com>
Fixes: 958cf2e273f0 ("bpf: Introduce bpf_obj_new")
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20231214203815.1469107-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/syscall.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 1625b9d5202c..3f3bd5518a69 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -692,6 +692,7 @@ static void bpf_map_free_deferred(struct work_struct *work)
 {
 	struct bpf_map *map = container_of(work, struct bpf_map, work);
 	struct btf_record *rec = map->record;
+	struct btf *btf = map->btf;
 
 	security_bpf_map_free(map);
 	bpf_map_release_memcg(map);
@@ -707,6 +708,10 @@ static void bpf_map_free_deferred(struct work_struct *work)
 	 * template bpf_map struct used during verification.
 	 */
 	btf_record_free(rec);
+	/* Delay freeing of btf for maps, as map_free callback may need
+	 * struct_meta info which will be freed with btf_put().
+	 */
+	btf_put(btf);
 }
 
 static void bpf_map_put_uref(struct bpf_map *map)
@@ -747,7 +752,6 @@ void bpf_map_put(struct bpf_map *map)
 	if (atomic64_dec_and_test(&map->refcnt)) {
 		/* bpf_map_free_id() must be called first */
 		bpf_map_free_id(map);
-		btf_put(map->btf);
 
 		if (READ_ONCE(map->free_after_mult_rcu_gp))
 			call_rcu_tasks_trace(&map->rcu, bpf_map_free_mult_rcu_gp);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 166/583] selftests/net: fix grep checking for fib_nexthop_multiprefix
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (164 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 165/583] bpf: Fix a race condition between btf_put() and map_free() Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 167/583] ipmr: support IP_PKTINFO on cache report IGMP msg Greg Kroah-Hartman
                   ` (423 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hangbin Liu, Jakub Kicinski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hangbin Liu <liuhangbin@gmail.com>

[ Upstream commit a33e9da3470499e9ff476138f271fb52d6bfe767 ]

When running fib_nexthop_multiprefix test I saw all IPv6 test failed.
e.g.

 ]# ./fib_nexthop_multiprefix.sh
 TEST: IPv4: host 0 to host 1, mtu 1300                              [ OK ]
 TEST: IPv6: host 0 to host 1, mtu 1300                              [FAIL]

 With -v it shows

 COMMAND: ip netns exec h0 /usr/sbin/ping6 -s 1350 -c5 -w5 2001:db8:101::1
 PING 2001:db8:101::1(2001:db8:101::1) 1350 data bytes
 From 2001:db8:100::64 icmp_seq=1 Packet too big: mtu=1300

 --- 2001:db8:101::1 ping statistics ---
 1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

 Route get
 2001:db8:101::1 via 2001:db8:100::64 dev eth0 src 2001:db8:100::1 metric 1024 expires 599sec mtu 1300 pref medium
 Searching for:
     2001:db8:101::1 from :: via 2001:db8:100::64 dev eth0 src 2001:db8:100::1 .* mtu 1300

The reason is when CONFIG_IPV6_SUBTREES is not enabled, rt6_fill_node() will
not put RTA_SRC info. After fix:

]# ./fib_nexthop_multiprefix.sh
TEST: IPv4: host 0 to host 1, mtu 1300                              [ OK ]
TEST: IPv6: host 0 to host 1, mtu 1300                              [ OK ]

Fixes: 735ab2f65dce ("selftests: Add test with multiple prefixes using single nexthop")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://lore.kernel.org/r/20231213060856.4030084-7-liuhangbin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/net/fib_nexthop_multiprefix.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/fib_nexthop_multiprefix.sh b/tools/testing/selftests/net/fib_nexthop_multiprefix.sh
index 51df5e305855..b52d59547fc5 100755
--- a/tools/testing/selftests/net/fib_nexthop_multiprefix.sh
+++ b/tools/testing/selftests/net/fib_nexthop_multiprefix.sh
@@ -209,12 +209,12 @@ validate_v6_exception()
 		echo "Route get"
 		ip -netns h0 -6 ro get ${dst}
 		echo "Searching for:"
-		echo "    ${dst} from :: via ${r1} dev eth0 src ${h0} .* mtu ${mtu}"
+		echo "    ${dst}.* via ${r1} dev eth0 src ${h0} .* mtu ${mtu}"
 		echo
 	fi
 
 	ip -netns h0 -6 ro get ${dst} | \
-	grep -q "${dst} from :: via ${r1} dev eth0 src ${h0} .* mtu ${mtu}"
+	grep -q "${dst}.* via ${r1} dev eth0 src ${h0} .* mtu ${mtu}"
 	rc=$?
 
 	log_test $rc 0 "IPv6: host 0 to host ${i}, mtu ${mtu}"
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 167/583] ipmr: support IP_PKTINFO on cache report IGMP msg
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (165 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 166/583] selftests/net: fix grep checking for fib_nexthop_multiprefix Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 168/583] virtio/vsock: fix logic which reduces credit update messages Greg Kroah-Hartman
                   ` (422 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Leone Fernando, Eric Dumazet,
	David S. Miller, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Leone Fernando <leone4fernando@gmail.com>

[ Upstream commit bb7403655b3c3eb245d0ee330047cd3e20b3c4af ]

In order to support IP_PKTINFO on those packets, we need to call
ipv4_pktinfo_prepare.

When sending mrouted/pimd daemons a cache report IGMP msg, it is
unnecessary to set dst on the newly created skb.
It used to be necessary on older versions until
commit d826eb14ecef ("ipv4: PKTINFO doesnt need dst reference") which
changed the way IP_PKTINFO struct is been retrieved.

Changes from v1:
1. Undo changes in ipv4_pktinfo_prepare function. use it directly
   and copy the control block.

Fixes: d826eb14ecef ("ipv4: PKTINFO doesnt need dst reference")
Signed-off-by: Leone Fernando <leone4fernando@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv4/ipmr.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 9e222a57bc2b..0063a237253b 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1025,6 +1025,10 @@ static int ipmr_cache_report(const struct mr_table *mrt,
 	struct sk_buff *skb;
 	int ret;
 
+	mroute_sk = rcu_dereference(mrt->mroute_sk);
+	if (!mroute_sk)
+		return -EINVAL;
+
 	if (assert == IGMPMSG_WHOLEPKT || assert == IGMPMSG_WRVIFWHOLE)
 		skb = skb_realloc_headroom(pkt, sizeof(struct iphdr));
 	else
@@ -1069,7 +1073,8 @@ static int ipmr_cache_report(const struct mr_table *mrt,
 		msg = (struct igmpmsg *)skb_network_header(skb);
 		msg->im_vif = vifi;
 		msg->im_vif_hi = vifi >> 8;
-		skb_dst_set(skb, dst_clone(skb_dst(pkt)));
+		ipv4_pktinfo_prepare(mroute_sk, pkt);
+		memcpy(skb->cb, pkt->cb, sizeof(skb->cb));
 		/* Add our header */
 		igmp = skb_put(skb, sizeof(struct igmphdr));
 		igmp->type = assert;
@@ -1079,12 +1084,6 @@ static int ipmr_cache_report(const struct mr_table *mrt,
 		skb->transport_header = skb->network_header;
 	}
 
-	mroute_sk = rcu_dereference(mrt->mroute_sk);
-	if (!mroute_sk) {
-		kfree_skb(skb);
-		return -EINVAL;
-	}
-
 	igmpmsg_netlink_event(mrt, skb);
 
 	/* Deliver to mrouted */
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 168/583] virtio/vsock: fix logic which reduces credit update messages
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (166 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 167/583] ipmr: support IP_PKTINFO on cache report IGMP msg Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 169/583] virtio/vsock: send credit update during setting SO_RCVLOWAT Greg Kroah-Hartman
                   ` (421 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Arseniy Krasnov, Stefano Garzarella,
	Michael S. Tsirkin, David S. Miller, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arseniy Krasnov <avkrasnov@salutedevices.com>

[ Upstream commit 93b80887668226180ea5f5349cc728ca6dc700ab ]

Add one more condition for sending credit update during dequeue from
stream socket: when number of bytes in the rx queue is smaller than
SO_RCVLOWAT value of the socket. This is actual for non-default value
of SO_RCVLOWAT (e.g. not 1) - idea is to "kick" peer to continue data
transmission, because we need at least SO_RCVLOWAT bytes in our rx
queue to wake up user for reading data (in corner case it is also
possible to stuck both tx and rx sides, this is why 'Fixes' is used).

Fixes: b89d882dc9fc ("vsock/virtio: reduce credit update messages")
Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/vmw_vsock/virtio_transport_common.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index 4084578b0b91..34a6d5e64ff2 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -398,6 +398,8 @@ virtio_transport_stream_do_dequeue(struct vsock_sock *vsk,
 	struct virtio_vsock_sock *vvs = vsk->trans;
 	size_t bytes, total = 0;
 	struct sk_buff *skb;
+	u32 fwd_cnt_delta;
+	bool low_rx_bytes;
 	int err = -EFAULT;
 	u32 free_space;
 
@@ -439,7 +441,10 @@ virtio_transport_stream_do_dequeue(struct vsock_sock *vsk,
 		}
 	}
 
-	free_space = vvs->buf_alloc - (vvs->fwd_cnt - vvs->last_fwd_cnt);
+	fwd_cnt_delta = vvs->fwd_cnt - vvs->last_fwd_cnt;
+	free_space = vvs->buf_alloc - fwd_cnt_delta;
+	low_rx_bytes = (vvs->rx_bytes <
+			sock_rcvlowat(sk_vsock(vsk), 0, INT_MAX));
 
 	spin_unlock_bh(&vvs->rx_lock);
 
@@ -449,9 +454,11 @@ virtio_transport_stream_do_dequeue(struct vsock_sock *vsk,
 	 * too high causes extra messages. Too low causes transmitter
 	 * stalls. As stalls are in theory more expensive than extra
 	 * messages, we set the limit to a high value. TODO: experiment
-	 * with different values.
+	 * with different values. Also send credit update message when
+	 * number of bytes in rx queue is not enough to wake up reader.
 	 */
-	if (free_space < VIRTIO_VSOCK_MAX_PKT_BUF_SIZE)
+	if (fwd_cnt_delta &&
+	    (free_space < VIRTIO_VSOCK_MAX_PKT_BUF_SIZE || low_rx_bytes))
 		virtio_transport_send_credit_update(vsk);
 
 	return total;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 169/583] virtio/vsock: send credit update during setting SO_RCVLOWAT
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (167 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 168/583] virtio/vsock: fix logic which reduces credit update messages Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 170/583] dma-mapping: clear dev->dma_mem to NULL after freeing it Greg Kroah-Hartman
                   ` (420 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Arseniy Krasnov, Stefano Garzarella,
	Michael S. Tsirkin, David S. Miller, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arseniy Krasnov <avkrasnov@salutedevices.com>

[ Upstream commit 0fe1798968115488c0c02f4633032a015b1faf97 ]

Send credit update message when SO_RCVLOWAT is updated and it is bigger
than number of bytes in rx queue. It is needed, because 'poll()' will
wait until number of bytes in rx queue will be not smaller than
O_RCVLOWAT, so kick sender to send more data. Otherwise mutual hungup
for tx/rx is possible: sender waits for free space and receiver is
waiting data in 'poll()'.

Rename 'set_rcvlowat' callback to 'notify_set_rcvlowat' and set
'sk->sk_rcvlowat' only in one place (i.e. 'vsock_set_rcvlowat'), so the
transport doesn't need to do it.

Fixes: b89d882dc9fc ("vsock/virtio: reduce credit update messages")
Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vhost/vsock.c                   |  1 +
 include/linux/virtio_vsock.h            |  1 +
 include/net/af_vsock.h                  |  2 +-
 net/vmw_vsock/af_vsock.c                |  9 ++++++--
 net/vmw_vsock/hyperv_transport.c        |  4 ++--
 net/vmw_vsock/virtio_transport.c        |  1 +
 net/vmw_vsock/virtio_transport_common.c | 30 +++++++++++++++++++++++++
 net/vmw_vsock/vsock_loopback.c          |  1 +
 8 files changed, 44 insertions(+), 5 deletions(-)

diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index 817d377a3f36..61255855d490 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -438,6 +438,7 @@ static struct virtio_transport vhost_transport = {
 		.notify_send_pre_enqueue  = virtio_transport_notify_send_pre_enqueue,
 		.notify_send_post_enqueue = virtio_transport_notify_send_post_enqueue,
 		.notify_buffer_size       = virtio_transport_notify_buffer_size,
+		.notify_set_rcvlowat      = virtio_transport_notify_set_rcvlowat,
 
 		.read_skb = virtio_transport_read_skb,
 	},
diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h
index c58453699ee9..fbf30721bac9 100644
--- a/include/linux/virtio_vsock.h
+++ b/include/linux/virtio_vsock.h
@@ -246,4 +246,5 @@ void virtio_transport_put_credit(struct virtio_vsock_sock *vvs, u32 credit);
 void virtio_transport_deliver_tap_pkt(struct sk_buff *skb);
 int virtio_transport_purge_skbs(void *vsk, struct sk_buff_head *list);
 int virtio_transport_read_skb(struct vsock_sock *vsk, skb_read_actor_t read_actor);
+int virtio_transport_notify_set_rcvlowat(struct vsock_sock *vsk, int val);
 #endif /* _LINUX_VIRTIO_VSOCK_H */
diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h
index b01cf9ac2437..dc3cb16835b6 100644
--- a/include/net/af_vsock.h
+++ b/include/net/af_vsock.h
@@ -137,7 +137,6 @@ struct vsock_transport {
 	u64 (*stream_rcvhiwat)(struct vsock_sock *);
 	bool (*stream_is_active)(struct vsock_sock *);
 	bool (*stream_allow)(u32 cid, u32 port);
-	int (*set_rcvlowat)(struct vsock_sock *vsk, int val);
 
 	/* SEQ_PACKET. */
 	ssize_t (*seqpacket_dequeue)(struct vsock_sock *vsk, struct msghdr *msg,
@@ -168,6 +167,7 @@ struct vsock_transport {
 		struct vsock_transport_send_notify_data *);
 	/* sk_lock held by the caller */
 	void (*notify_buffer_size)(struct vsock_sock *, u64 *);
+	int (*notify_set_rcvlowat)(struct vsock_sock *vsk, int val);
 
 	/* Shutdown. */
 	int (*shutdown)(struct vsock_sock *, int);
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index ccd8cefeea7b..4afb6a541cf3 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -2214,8 +2214,13 @@ static int vsock_set_rcvlowat(struct sock *sk, int val)
 
 	transport = vsk->transport;
 
-	if (transport && transport->set_rcvlowat)
-		return transport->set_rcvlowat(vsk, val);
+	if (transport && transport->notify_set_rcvlowat) {
+		int err;
+
+		err = transport->notify_set_rcvlowat(vsk, val);
+		if (err)
+			return err;
+	}
 
 	WRITE_ONCE(sk->sk_rcvlowat, val ? : 1);
 	return 0;
diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c
index 7cb1a9d2cdb4..e2157e387217 100644
--- a/net/vmw_vsock/hyperv_transport.c
+++ b/net/vmw_vsock/hyperv_transport.c
@@ -816,7 +816,7 @@ int hvs_notify_send_post_enqueue(struct vsock_sock *vsk, ssize_t written,
 }
 
 static
-int hvs_set_rcvlowat(struct vsock_sock *vsk, int val)
+int hvs_notify_set_rcvlowat(struct vsock_sock *vsk, int val)
 {
 	return -EOPNOTSUPP;
 }
@@ -856,7 +856,7 @@ static struct vsock_transport hvs_transport = {
 	.notify_send_pre_enqueue  = hvs_notify_send_pre_enqueue,
 	.notify_send_post_enqueue = hvs_notify_send_post_enqueue,
 
-	.set_rcvlowat             = hvs_set_rcvlowat
+	.notify_set_rcvlowat      = hvs_notify_set_rcvlowat
 };
 
 static bool hvs_check_transport(struct vsock_sock *vsk)
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index b80bf681327b..a64bf601b480 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -457,6 +457,7 @@ static struct virtio_transport virtio_transport = {
 		.notify_send_pre_enqueue  = virtio_transport_notify_send_pre_enqueue,
 		.notify_send_post_enqueue = virtio_transport_notify_send_post_enqueue,
 		.notify_buffer_size       = virtio_transport_notify_buffer_size,
+		.notify_set_rcvlowat      = virtio_transport_notify_set_rcvlowat,
 
 		.read_skb = virtio_transport_read_skb,
 	},
diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index 34a6d5e64ff2..e87fd9480acd 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -1526,6 +1526,36 @@ int virtio_transport_read_skb(struct vsock_sock *vsk, skb_read_actor_t recv_acto
 }
 EXPORT_SYMBOL_GPL(virtio_transport_read_skb);
 
+int virtio_transport_notify_set_rcvlowat(struct vsock_sock *vsk, int val)
+{
+	struct virtio_vsock_sock *vvs = vsk->trans;
+	bool send_update;
+
+	spin_lock_bh(&vvs->rx_lock);
+
+	/* If number of available bytes is less than new SO_RCVLOWAT value,
+	 * kick sender to send more data, because sender may sleep in its
+	 * 'send()' syscall waiting for enough space at our side. Also
+	 * don't send credit update when peer already knows actual value -
+	 * such transmission will be useless.
+	 */
+	send_update = (vvs->rx_bytes < val) &&
+		      (vvs->fwd_cnt != vvs->last_fwd_cnt);
+
+	spin_unlock_bh(&vvs->rx_lock);
+
+	if (send_update) {
+		int err;
+
+		err = virtio_transport_send_credit_update(vsk);
+		if (err < 0)
+			return err;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(virtio_transport_notify_set_rcvlowat);
+
 MODULE_LICENSE("GPL v2");
 MODULE_AUTHOR("Asias He");
 MODULE_DESCRIPTION("common code for virtio vsock");
diff --git a/net/vmw_vsock/vsock_loopback.c b/net/vmw_vsock/vsock_loopback.c
index 5c6360df1f31..0ce65d0a4a44 100644
--- a/net/vmw_vsock/vsock_loopback.c
+++ b/net/vmw_vsock/vsock_loopback.c
@@ -90,6 +90,7 @@ static struct virtio_transport loopback_transport = {
 		.notify_send_pre_enqueue  = virtio_transport_notify_send_pre_enqueue,
 		.notify_send_post_enqueue = virtio_transport_notify_send_post_enqueue,
 		.notify_buffer_size       = virtio_transport_notify_buffer_size,
+		.notify_set_rcvlowat      = virtio_transport_notify_set_rcvlowat,
 
 		.read_skb = virtio_transport_read_skb,
 	},
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 170/583] dma-mapping: clear dev->dma_mem to NULL after freeing it
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (168 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 169/583] virtio/vsock: send credit update during setting SO_RCVLOWAT Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 171/583] bpf: Limit the number of uprobes when attaching program to multiple uprobes Greg Kroah-Hartman
                   ` (419 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Joakim Zhang, Christoph Hellwig,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Joakim Zhang <joakim.zhang@cixtech.com>

[ Upstream commit b07bc2347672cc8c7293c64499f1488278c5ca3d ]

Reproduced with below sequence:
dma_declare_coherent_memory()->dma_release_coherent_memory()
->dma_declare_coherent_memory()->"return -EBUSY" error

It will return -EBUSY from the dma_assign_coherent_memory()
in dma_declare_coherent_memory(), the reason is that dev->dma_mem
pointer has not been set to NULL after it's freed.

Fixes: cf65a0f6f6ff ("dma-mapping: move all DMA mapping code to kernel/dma")
Signed-off-by: Joakim Zhang <joakim.zhang@cixtech.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/dma/coherent.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/dma/coherent.c b/kernel/dma/coherent.c
index c21abc77c53e..ff5683a57f77 100644
--- a/kernel/dma/coherent.c
+++ b/kernel/dma/coherent.c
@@ -132,8 +132,10 @@ int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
 
 void dma_release_coherent_memory(struct device *dev)
 {
-	if (dev)
+	if (dev) {
 		_dma_release_coherent_memory(dev->dma_mem);
+		dev->dma_mem = NULL;
+	}
 }
 
 static void *__dma_alloc_from_coherent(struct device *dev,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 171/583] bpf: Limit the number of uprobes when attaching program to multiple uprobes
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (169 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 170/583] dma-mapping: clear dev->dma_mem to NULL after freeing it Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 172/583] bpf: Limit the number of kprobes when attaching program to multiple kprobes Greg Kroah-Hartman
                   ` (418 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Xingwei Lee, Hou Tao,
	Daniel Borkmann, Jiri Olsa, Andrii Nakryiko, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hou Tao <houtao1@huawei.com>

[ Upstream commit 8b2efe51ba85ca83460941672afac6fca4199df6 ]

An abnormally big cnt may be passed to link_create.uprobe_multi.cnt,
and it will trigger the following warning in kvmalloc_node():

	if (unlikely(size > INT_MAX)) {
		WARN_ON_ONCE(!(flags & __GFP_NOWARN));
		return NULL;
	}

Fix the warning by limiting the maximal number of uprobes in
bpf_uprobe_multi_link_attach(). If the number of uprobes is greater than
MAX_UPROBE_MULTI_CNT, the attachment will return -E2BIG.

Fixes: 89ae89f53d20 ("bpf: Add multi uprobe link")
Reported-by: Xingwei Lee <xrivendell7@gmail.com>
Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Closes: https://lore.kernel.org/bpf/CABOYnLwwJY=yFAGie59LFsUsBAgHfroVqbzZ5edAXbFE3YiNVA@mail.gmail.com
Link: https://lore.kernel.org/bpf/20231215100708.2265609-2-houtao@huaweicloud.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/trace/bpf_trace.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 868008f56fec..39c4cef98b95 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -41,6 +41,8 @@
 #define bpf_event_rcu_dereference(p)					\
 	rcu_dereference_protected(p, lockdep_is_held(&bpf_event_mutex))
 
+#define MAX_UPROBE_MULTI_CNT (1U << 20)
+
 #ifdef CONFIG_MODULES
 struct bpf_trace_module {
 	struct module *module;
@@ -3198,6 +3200,8 @@ int bpf_uprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *pr
 
 	if (!upath || !uoffsets || !cnt)
 		return -EINVAL;
+	if (cnt > MAX_UPROBE_MULTI_CNT)
+		return -E2BIG;
 
 	uref_ctr_offsets = u64_to_user_ptr(attr->link_create.uprobe_multi.ref_ctr_offsets);
 	ucookies = u64_to_user_ptr(attr->link_create.uprobe_multi.cookies);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 172/583] bpf: Limit the number of kprobes when attaching program to multiple kprobes
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (170 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 171/583] bpf: Limit the number of uprobes when attaching program to multiple uprobes Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 173/583] arm64: dts: qcom: acer-aspire1: Correct audio codec definition Greg Kroah-Hartman
                   ` (417 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hou Tao, Daniel Borkmann, Jiri Olsa,
	Andrii Nakryiko, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hou Tao <houtao1@huawei.com>

[ Upstream commit d6d1e6c17cab2dcb7b8530c599f00e7de906d380 ]

An abnormally big cnt may also be assigned to kprobe_multi.cnt when
attaching multiple kprobes. It will trigger the following warning in
kvmalloc_node():

	if (unlikely(size > INT_MAX)) {
	    WARN_ON_ONCE(!(flags & __GFP_NOWARN));
	    return NULL;
	}

Fix the warning by limiting the maximal number of kprobes in
bpf_kprobe_multi_link_attach(). If the number of kprobes is greater than
MAX_KPROBE_MULTI_CNT, the attachment will fail and return -E2BIG.

Fixes: 0dcac2725406 ("bpf: Add multi kprobe link")
Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20231215100708.2265609-3-houtao@huaweicloud.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/trace/bpf_trace.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 39c4cef98b95..1d76f3b014ae 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -42,6 +42,7 @@
 	rcu_dereference_protected(p, lockdep_is_held(&bpf_event_mutex))
 
 #define MAX_UPROBE_MULTI_CNT (1U << 20)
+#define MAX_KPROBE_MULTI_CNT (1U << 20)
 
 #ifdef CONFIG_MODULES
 struct bpf_trace_module {
@@ -2897,6 +2898,8 @@ int bpf_kprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *pr
 	cnt = attr->link_create.kprobe_multi.cnt;
 	if (!cnt)
 		return -EINVAL;
+	if (cnt > MAX_KPROBE_MULTI_CNT)
+		return -E2BIG;
 
 	size = cnt * sizeof(*addrs);
 	addrs = kvmalloc_array(cnt, sizeof(*addrs), GFP_KERNEL);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 173/583] arm64: dts: qcom: acer-aspire1: Correct audio codec definition
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (171 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 172/583] bpf: Limit the number of kprobes when attaching program to multiple kprobes Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 174/583] soc: qcom: llcc: Fix dis_cap_alloc and retain_on_pc configuration Greg Kroah-Hartman
                   ` (416 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nikita Travkin, Bjorn Andersson,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nikita Travkin <nikita@trvn.ru>

[ Upstream commit feec9f0add432a867f23e29afcd2f7088889b8e2 ]

When initially added, a mistake was made in the definition of the codec.

Despite the fact that the DMIC line is connected on the side of the
codec chip, and relevant passive components, including 0-ohm resistors
connecting the dmics, are present, the dmic line is still cut in
another place on the board, which was overlooked.

Correct this by replacing the dmic configuration with a comment
describing this hardware detail.

While at it, also add missing regulators definitions. This is not a
functional change as all the relevant regulators were already added via
the other rail supplies.

Fixes: 4a9f8f8f2ada ("arm64: dts: qcom: Add Acer Aspire 1")
Signed-off-by: Nikita Travkin <nikita@trvn.ru>
Link: https://lore.kernel.org/r/20231205-aspire1-sound-v2-2-443b7ac0a06f@trvn.ru
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../arm64/boot/dts/qcom/sc7180-acer-aspire1.dts | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts b/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts
index dbb48934d499..3342cb048038 100644
--- a/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts
+++ b/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts
@@ -209,9 +209,22 @@ alc5682: codec@1a {
 		AVDD-supply = <&vreg_l15a_1p8>;
 		MICVDD-supply = <&reg_codec_3p3>;
 		VBAT-supply = <&reg_codec_3p3>;
+		DBVDD-supply = <&vreg_l15a_1p8>;
+		LDO1-IN-supply = <&vreg_l15a_1p8>;
+
+		/*
+		 * NOTE: The board has a path from this codec to the
+		 * DMIC microphones in the lid, however some of the option
+		 * resistors are absent and the microphones are connected
+		 * to the SoC instead.
+		 *
+		 * If the resistors were to be changed by the user to
+		 * connect the codec, the following could be used:
+		 *
+		 * realtek,dmic1-data-pin = <1>;
+		 * realtek,dmic1-clk-pin = <1>;
+		 */
 
-		realtek,dmic1-data-pin = <1>;
-		realtek,dmic1-clk-pin = <1>;
 		realtek,jd-src = <1>;
 	};
 };
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 174/583] soc: qcom: llcc: Fix dis_cap_alloc and retain_on_pc configuration
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (172 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 173/583] arm64: dts: qcom: acer-aspire1: Correct audio codec definition Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 175/583] arm64: dts: qcom: sm6375: fix USB wakeup interrupt types Greg Kroah-Hartman
                   ` (415 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Atul Dhudase, Mukesh Ojha,
	Douglas Anderson, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Atul Dhudase <quic_adhudase@quicinc.com>

[ Upstream commit eed6e57e9f3e2beac37563eb6a0129549daa330e ]

Commit c14e64b46944 ("soc: qcom: llcc: Support chipsets that can
 write to llcc") add the support for chipset where capacity based
allocation and retention through power collapse can be programmed
based on content of SCT table mentioned in the llcc driver where
the target like sdm845 where the entire programming related to it
is controlled in firmware. However, the commit introduces a bug
where capacity/retention register get overwritten each time it
gets programmed for each slice and that results in misconfiguration
of the register based on SCT table and that is not expected
behaviour instead it should be read modify write to retain the
configuration of other slices.

This issue is totally caught from code review and programming test
and not through any power/perf numbers so, it is not known what
impact this could make if we don't have this change however,
this feature are for these targets and they should have been
programmed accordingly as per their configuration mentioned in
SCT table like others bits information.

This change brings one difference where it keeps capacity/retention
bits of the slices that are not mentioned in SCT table in unknown
state where as earlier it was initialized to zero.

Fixes: c14e64b46944 ("soc: qcom: llcc: Support chipsets that can write to llcc")
Signed-off-by: Atul Dhudase <quic_adhudase@quicinc.com>
Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/1701876771-10695-1-git-send-email-quic_mojha@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/soc/qcom/llcc-qcom.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
index c61848595da0..309c12f2d3bb 100644
--- a/drivers/soc/qcom/llcc-qcom.c
+++ b/drivers/soc/qcom/llcc-qcom.c
@@ -785,15 +785,15 @@ static int _qcom_llcc_cfg_program(const struct llcc_slice_config *config,
 		u32 disable_cap_alloc, retain_pc;
 
 		disable_cap_alloc = config->dis_cap_alloc << config->slice_id;
-		ret = regmap_write(drv_data->bcast_regmap,
-				LLCC_TRP_SCID_DIS_CAP_ALLOC, disable_cap_alloc);
+		ret = regmap_update_bits(drv_data->bcast_regmap, LLCC_TRP_SCID_DIS_CAP_ALLOC,
+					 BIT(config->slice_id), disable_cap_alloc);
 		if (ret)
 			return ret;
 
 		if (drv_data->version < LLCC_VERSION_4_1_0_0) {
 			retain_pc = config->retain_on_pc << config->slice_id;
-			ret = regmap_write(drv_data->bcast_regmap,
-					LLCC_TRP_PCB_ACT, retain_pc);
+			ret = regmap_update_bits(drv_data->bcast_regmap, LLCC_TRP_PCB_ACT,
+						 BIT(config->slice_id), retain_pc);
 			if (ret)
 				return ret;
 		}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 175/583] arm64: dts: qcom: sm6375: fix USB wakeup interrupt types
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (173 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 174/583] soc: qcom: llcc: Fix dis_cap_alloc and retain_on_pc configuration Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 176/583] arm64: dts: qcom: sm6375: Hook up MPM Greg Kroah-Hartman
                   ` (414 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Johan Hovold,
	Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Johan Hovold <johan+linaro@kernel.org>

[ Upstream commit 41952be6661b20f56c2c5b06c431880dd975b747 ]

The DP/DM wakeup interrupts are edge triggered and which edge to trigger
on depends on use-case and whether a Low speed or Full/High speed device
is connected.

Fixes: 59d34ca97f91 ("arm64: dts: qcom: Add initial device tree for SM6375")
Cc: stable@vger.kernel.org      # 6.2
Cc: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20231120164331.8116-10-johan+linaro@kernel.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Stable-dep-of: d3246a0cf43f ("arm64: dts: qcom: sm6375: Hook up MPM")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sm6375.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm6375.dtsi b/arch/arm64/boot/dts/qcom/sm6375.dtsi
index e7ff55443da7..b479f3d9a3a8 100644
--- a/arch/arm64/boot/dts/qcom/sm6375.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6375.dtsi
@@ -1362,8 +1362,8 @@ usb_1: usb@4ef8800 {
 
 			interrupts = <GIC_SPI 302 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
-				     <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>,
-				     <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
+				     <GIC_SPI 93 IRQ_TYPE_EDGE_BOTH>,
+				     <GIC_SPI 94 IRQ_TYPE_EDGE_BOTH>;
 			interrupt-names = "hs_phy_irq",
 					  "ss_phy_irq",
 					  "dm_hs_phy_irq",
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 176/583] arm64: dts: qcom: sm6375: Hook up MPM
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (174 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 175/583] arm64: dts: qcom: sm6375: fix USB wakeup interrupt types Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 177/583] arm64: dts: qcom: sm8150: make dispcc cast minimal vote on MMCX Greg Kroah-Hartman
                   ` (413 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Konrad Dybcio <konrad.dybcio@linaro.org>

[ Upstream commit d3246a0cf43fd24a1986163284edd2389143809d ]

Add a node for MPM and wire it up on consumers that use it. This also
fixes a very bad and sad assumption I made when initially porting this
SoC that the downstream MPM-TLMM mappings were 1-1. That apparently
changed some time ago, so with this patch the MPM consumers will actually
be hooked up to the correct interrupt lines.

Fixes: 59d34ca97f91 ("arm64: dts: qcom: Add initial device tree for SM6375")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231215-topic-mpm_dt-v1-1-c6636fc75ce3@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sm6375.dtsi | 41 +++++++++++++++++++++++-----
 1 file changed, 34 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm6375.dtsi b/arch/arm64/boot/dts/qcom/sm6375.dtsi
index b479f3d9a3a8..e56f7ea4ebc6 100644
--- a/arch/arm64/boot/dts/qcom/sm6375.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6375.dtsi
@@ -311,6 +311,25 @@ scm {
 		};
 	};
 
+	mpm: interrupt-controller {
+		compatible = "qcom,mpm";
+		qcom,rpm-msg-ram = <&apss_mpm>;
+		interrupts = <GIC_SPI 197 IRQ_TYPE_EDGE_RISING>;
+		mboxes = <&ipcc IPCC_CLIENT_AOP IPCC_MPROC_SIGNAL_SMP2P>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+		#power-domain-cells = <0>;
+		interrupt-parent = <&intc>;
+		qcom,mpm-pin-count = <96>;
+		qcom,mpm-pin-map = <5 296>,  /* Soundwire wake_irq */
+				   <12 422>, /* DWC3 ss_phy_irq */
+				   <86 183>, /* MPM wake, SPMI */
+				   <89 314>, /* TSENS0 0C */
+				   <90 315>, /* TSENS1 0C */
+				   <93 164>, /* DWC3 dm_hs_phy_irq */
+				   <94 165>; /* DWC3 dp_hs_phy_irq */
+	};
+
 	memory@80000000 {
 		device_type = "memory";
 		/* We expect the bootloader to fill in the size */
@@ -486,6 +505,7 @@ CPU_PD7: power-domain-cpu7 {
 
 		CLUSTER_PD: power-domain-cpu-cluster0 {
 			#power-domain-cells = <0>;
+			power-domains = <&mpm>;
 			domain-idle-states = <&CLUSTER_SLEEP_0>;
 		};
 	};
@@ -808,7 +828,7 @@ tlmm: pinctrl@500000 {
 			reg = <0 0x00500000 0 0x800000>;
 			interrupts = <GIC_SPI 227 IRQ_TYPE_LEVEL_HIGH>;
 			gpio-ranges = <&tlmm 0 0 157>;
-			/* TODO: Hook up MPM as wakeup-parent when it's there */
+			wakeup-parent = <&mpm>;
 			interrupt-controller;
 			gpio-controller;
 			#interrupt-cells = <2>;
@@ -930,7 +950,7 @@ spmi_bus: spmi@1c40000 {
 			      <0 0x01c0a000 0 0x26000>;
 			reg-names = "core", "chnls", "obsrvr", "intr", "cnfg";
 			interrupt-names = "periph_irq";
-			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts-extended = <&mpm 86 IRQ_TYPE_LEVEL_HIGH>;
 			qcom,ee = <0>;
 			qcom,channel = <0>;
 			#address-cells = <2>;
@@ -962,8 +982,15 @@ tsens1: thermal-sensor@4413000 {
 		};
 
 		rpm_msg_ram: sram@45f0000 {
-			compatible = "qcom,rpm-msg-ram";
+			compatible = "qcom,rpm-msg-ram", "mmio-sram";
 			reg = <0 0x045f0000 0 0x7000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0 0x0 0x045f0000 0x7000>;
+
+			apss_mpm: sram@1b8 {
+				reg = <0x1b8 0x48>;
+			};
 		};
 
 		sram@4690000 {
@@ -1360,10 +1387,10 @@ usb_1: usb@4ef8800 {
 					  <&gcc GCC_USB30_PRIM_MASTER_CLK>;
 			assigned-clock-rates = <19200000>, <133333333>;
 
-			interrupts = <GIC_SPI 302 IRQ_TYPE_LEVEL_HIGH>,
-				     <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
-				     <GIC_SPI 93 IRQ_TYPE_EDGE_BOTH>,
-				     <GIC_SPI 94 IRQ_TYPE_EDGE_BOTH>;
+			interrupts-extended = <&intc GIC_SPI 302 IRQ_TYPE_LEVEL_HIGH>,
+					      <&mpm 12 IRQ_TYPE_LEVEL_HIGH>,
+					      <&mpm 93 IRQ_TYPE_EDGE_BOTH>,
+					      <&mpm 94 IRQ_TYPE_EDGE_BOTH>;
 			interrupt-names = "hs_phy_irq",
 					  "ss_phy_irq",
 					  "dm_hs_phy_irq",
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 177/583] arm64: dts: qcom: sm8150: make dispcc cast minimal vote on MMCX
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (175 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 176/583] arm64: dts: qcom: sm6375: Hook up MPM Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 178/583] arm64: dts: qcom: sm8150-hdk: fix SS USB regulators Greg Kroah-Hartman
                   ` (412 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Dmitry Baryshkov,
	Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

[ Upstream commit 617de4ce7b1c4b41c1316e493d4717cd2f208def ]

Add required-opps property to the display clock controller. This makes
it cast minimal vote on the MMCX lane and prevents further 'clock stuck'
errors when enabling the display.

Fixes: 2ef3bb17c45c ("arm64: dts: qcom: sm8150: Add DISPCC node")
Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20231215174152.315403-2-dmitry.baryshkov@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sm8150.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
index d7a2c3567532..32045fb48157 100644
--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
@@ -3959,6 +3959,7 @@ dispcc: clock-controller@af00000 {
 				      "dp_phy_pll_link_clk",
 				      "dp_phy_pll_vco_div_clk";
 			power-domains = <&rpmhpd SM8150_MMCX>;
+			required-opps = <&rpmhpd_opp_low_svs>;
 			#clock-cells = <1>;
 			#reset-cells = <1>;
 			#power-domain-cells = <1>;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 178/583] arm64: dts: qcom: sm8150-hdk: fix SS USB regulators
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (176 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 177/583] arm64: dts: qcom: sm8150: make dispcc cast minimal vote on MMCX Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 179/583] soc: qcom: llcc: Fix LLCC_TRP_ATTR2_CFGn offset Greg Kroah-Hartman
                   ` (411 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Dmitry Baryshkov,
	Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

[ Upstream commit a509adf05b2aac31b22781f5aa09e4768a5b6c39 ]

The SM8150-HDK uses two different regulators to power up SuperSpeed USB
PHYs. The L5A regulator is used for the second USB host, while the first
(OTG) USB host uses different regulator, L18A. Fix the regulator for the
usb_1 QMPPHY and (to remove possible confusion) drop the
usb_ss_dp_core_1/_2 labels.

Fixes: 0ab1b2d10afe ("arm64: dts: qcom: add sm8150 hdk dts")
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20231215174152.315403-4-dmitry.baryshkov@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sm8150-hdk.dts | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8150-hdk.dts b/arch/arm64/boot/dts/qcom/sm8150-hdk.dts
index bb161b536da4..f4c6e1309a7e 100644
--- a/arch/arm64/boot/dts/qcom/sm8150-hdk.dts
+++ b/arch/arm64/boot/dts/qcom/sm8150-hdk.dts
@@ -127,8 +127,6 @@ vdda_qrefs_0p875_5:
 		vdda_sp_sensor:
 		vdda_ufs_2ln_core_1:
 		vdda_ufs_2ln_core_2:
-		vdda_usb_ss_dp_core_1:
-		vdda_usb_ss_dp_core_2:
 		vdda_qlink_lv:
 		vdda_qlink_lv_ck:
 		vreg_l5a_0p875: ldo5 {
@@ -210,6 +208,12 @@ vreg_l17a_3p0: ldo17 {
 			regulator-max-microvolt = <3008000>;
 			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
 		};
+
+		vreg_l18a_0p8: ldo18 {
+			regulator-min-microvolt = <880000>;
+			regulator-max-microvolt = <880000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+		};
 	};
 
 	regulators-1 {
@@ -445,13 +449,13 @@ &usb_2_hsphy {
 &usb_1_qmpphy {
 	status = "okay";
 	vdda-phy-supply = <&vreg_l3c_1p2>;
-	vdda-pll-supply = <&vdda_usb_ss_dp_core_1>;
+	vdda-pll-supply = <&vreg_l18a_0p8>;
 };
 
 &usb_2_qmpphy {
 	status = "okay";
 	vdda-phy-supply = <&vreg_l3c_1p2>;
-	vdda-pll-supply = <&vdda_usb_ss_dp_core_1>;
+	vdda-pll-supply = <&vreg_l5a_0p875>;
 };
 
 &usb_1 {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 179/583] soc: qcom: llcc: Fix LLCC_TRP_ATTR2_CFGn offset
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (177 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 178/583] arm64: dts: qcom: sm8150-hdk: fix SS USB regulators Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 180/583] block: add check of minors and first_minor in device_add_disk() Greg Kroah-Hartman
                   ` (410 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Unnathi Chalicheemala,
	Satya Durga Srinivasu Prabhala, Konrad Dybcio, Abel Vesa,
	Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Abel Vesa <abel.vesa@linaro.org>

[ Upstream commit 110cb8d861cc1a040cdab495b22ac436c49d1454 ]

According to documentation, it has increments of 4, not 8.

Fixes: c72ca343f911 ("soc: qcom: llcc: Add v4.1 HW version support")
Reported-by: Unnathi Chalicheemala <quic_uchalich@quicinc.com>
Reviewed-by: Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20231012160509.184891-1-abel.vesa@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/soc/qcom/llcc-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
index 309c12f2d3bb..e877aace1155 100644
--- a/drivers/soc/qcom/llcc-qcom.c
+++ b/drivers/soc/qcom/llcc-qcom.c
@@ -46,7 +46,7 @@
 #define LLCC_TRP_STATUSn(n)           (4 + n * SZ_4K)
 #define LLCC_TRP_ATTR0_CFGn(n)        (0x21000 + SZ_8 * n)
 #define LLCC_TRP_ATTR1_CFGn(n)        (0x21004 + SZ_8 * n)
-#define LLCC_TRP_ATTR2_CFGn(n)        (0x21100 + SZ_8 * n)
+#define LLCC_TRP_ATTR2_CFGn(n)        (0x21100 + SZ_4 * n)
 
 #define LLCC_TRP_SCID_DIS_CAP_ALLOC   0x21f00
 #define LLCC_TRP_PCB_ACT              0x21f04
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 180/583] block: add check of minors and first_minor in device_add_disk()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (178 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 179/583] soc: qcom: llcc: Fix LLCC_TRP_ATTR2_CFGn offset Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 181/583] arm64: dts: qcom: sc7280: Mark SDHCI hosts as cache-coherent Greg Kroah-Hartman
                   ` (409 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Li Nan, Christoph Hellwig,
	Jens Axboe, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Li Nan <linan122@huawei.com>

[ Upstream commit 4c434392c4777881d01beada6701eff8c76b43fe ]

'first_minor' represents the starting minor number of disks, and
'minors' represents the number of partitions in the device. Neither
of them can be greater than MINORMASK + 1.

Commit e338924bd05d ("block: check minor range in device_add_disk()")
only added the check of 'first_minor + minors'. However, their sum might
be less than MINORMASK but their values are wrong. Complete the checks now.

Fixes: e338924bd05d ("block: check minor range in device_add_disk()")
Signed-off-by: Li Nan <linan122@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20231219075942.840255-1-linan666@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 block/genhd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/block/genhd.c b/block/genhd.c
index 95a4b8ae2aea..f9b81be6c761 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -432,7 +432,9 @@ int __must_check device_add_disk(struct device *parent, struct gendisk *disk,
 				DISK_MAX_PARTS);
 			disk->minors = DISK_MAX_PARTS;
 		}
-		if (disk->first_minor + disk->minors > MINORMASK + 1)
+		if (disk->first_minor > MINORMASK ||
+		    disk->minors > MINORMASK + 1 ||
+		    disk->first_minor + disk->minors > MINORMASK + 1)
 			goto out_exit_elevator;
 	} else {
 		if (WARN_ON(disk->minors))
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 181/583] arm64: dts: qcom: sc7280: Mark SDHCI hosts as cache-coherent
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (179 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 180/583] block: add check of minors and first_minor in device_add_disk() Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 182/583] arm64: dts: qcom: ipq6018: fix clock rates for GCC_USB0_MOCK_UTMI_CLK Greg Kroah-Hartman
                   ` (408 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Konrad Dybcio <konrad.dybcio@linaro.org>

[ Upstream commit 827f5fc8d912203c1f971e47d61130b13c6820ba ]

The SDHCI hosts on SC7280 are cache-coherent, just like on most fairly
recent Qualcomm SoCs. Mark them as such.

Fixes: 298c81a7d44f ("arm64: dts: qcom: sc7280: Add nodes for eMMC and SD card")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231218-topic-7280_dmac_sdhci-v1-1-97af7efd64a1@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sc7280.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
index e6798447b29a..ec5c36425a22 100644
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
@@ -925,6 +925,7 @@ sdhc_1: mmc@7c4000 {
 
 			bus-width = <8>;
 			supports-cqe;
+			dma-coherent;
 
 			qcom,dll-config = <0x0007642c>;
 			qcom,ddr-config = <0x80040868>;
@@ -3291,6 +3292,7 @@ sdhc_2: mmc@8804000 {
 			operating-points-v2 = <&sdhc2_opp_table>;
 
 			bus-width = <4>;
+			dma-coherent;
 
 			qcom,dll-config = <0x0007642c>;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 182/583] arm64: dts: qcom: ipq6018: fix clock rates for GCC_USB0_MOCK_UTMI_CLK
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (180 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 181/583] arm64: dts: qcom: sc7280: Mark SDHCI hosts as cache-coherent Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 183/583] arm64: dts: qcom: sm8550: Separate out X3 idle state Greg Kroah-Hartman
                   ` (407 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chukun Pan, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chukun Pan <amadeus@jmu.edu.cn>

[ Upstream commit 5c0dbe8b058436ad5daecb19c60869f832607ea3 ]

The downstream QSDK kernel [1] and GCC_USB1_MOCK_UTMI_CLK are both 24MHz.
Adjust GCC_USB0_MOCK_UTMI_CLK to 24MHz to avoid the following error:

clk: couldn't set gcc_usb0_mock_utmi_clk clk rate to 20000000 (-22), current rate: 24000000

1. https://git.codelinaro.org/clo/qsdk/oss/kernel/linux-ipq-5.4/-/commit/486c8485f59

Fixes: 5726079cd486 ("arm64: dts: ipq6018: Use reference clock to set dwc3 period")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://lore.kernel.org/r/20231218150805.1228160-1-amadeus@jmu.edu.cn
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/ipq6018.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/ipq6018.dtsi b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
index 264845cecf92..fc907afe5174 100644
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -565,7 +565,7 @@ usb3: usb@8af8800 {
 					  <&gcc GCC_USB0_MOCK_UTMI_CLK>;
 			assigned-clock-rates = <133330000>,
 					       <133330000>,
-					       <20000000>;
+					       <24000000>;
 
 			resets = <&gcc GCC_USB0_BCR>;
 			status = "disabled";
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 183/583] arm64: dts: qcom: sm8550: Separate out X3 idle state
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (181 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 182/583] arm64: dts: qcom: ipq6018: fix clock rates for GCC_USB0_MOCK_UTMI_CLK Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 184/583] arm64: dts: qcom: sm8550: Update idle state time requirements Greg Kroah-Hartman
                   ` (406 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Konrad Dybcio <konrad.dybcio@linaro.org>

[ Upstream commit 28b735232d5e16a34f98dbac1e7b5401c1c16d89 ]

The X3 core has different entry/exit/residency time requirements than
the big cluster. Denote them to stop confusing the scheduler.

Fixes: ffc50b2d3828 ("arm64: dts: qcom: Add base SM8550 dtsi")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231218-topic-8550_fixes-v1-11-ce1272d77540@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sm8550.dtsi | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi
index 045cef68a256..15d91ace8703 100644
--- a/arch/arm64/boot/dts/qcom/sm8550.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi
@@ -298,6 +298,16 @@ BIG_CPU_SLEEP_0: cpu-sleep-1-0 {
 				min-residency-us = <4791>;
 				local-timer-stop;
 			};
+
+			PRIME_CPU_SLEEP_0: cpu-sleep-2-0 {
+				compatible = "arm,idle-state";
+				idle-state-name = "goldplus-rail-power-collapse";
+				arm,psci-suspend-param = <0x40000004>;
+				entry-latency-us = <500>;
+				exit-latency-us = <1350>;
+				min-residency-us = <7480>;
+				local-timer-stop;
+			};
 		};
 
 		domain-idle-states {
@@ -398,7 +408,7 @@ CPU_PD6: power-domain-cpu6 {
 		CPU_PD7: power-domain-cpu7 {
 			#power-domain-cells = <0>;
 			power-domains = <&CLUSTER_PD>;
-			domain-idle-states = <&BIG_CPU_SLEEP_0>;
+			domain-idle-states = <&PRIME_CPU_SLEEP_0>;
 		};
 
 		CLUSTER_PD: power-domain-cluster {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 184/583] arm64: dts: qcom: sm8550: Update idle state time requirements
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (182 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 183/583] arm64: dts: qcom: sm8550: Separate out X3 idle state Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 185/583] arm64: dts: qcom: sc8180x: Mark PCIe hosts cache-coherent Greg Kroah-Hartman
                   ` (405 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Konrad Dybcio <konrad.dybcio@linaro.org>

[ Upstream commit ad6556fb45d4ab91ad786a2025cbe2b0f2e6cf77 ]

The idle state entry/exit/residency times differ from what shipped on
production devices, mostly being overly optimistic in entry times and
overly pessimistic in minimal residency times. Align them with
downstream sources.

Fixes: ffc50b2d3828 ("arm64: dts: qcom: Add base SM8550 dtsi")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231218-topic-8550_fixes-v1-12-ce1272d77540@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sm8550.dtsi | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi
index 15d91ace8703..3a228d4f0c14 100644
--- a/arch/arm64/boot/dts/qcom/sm8550.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi
@@ -283,9 +283,9 @@ LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 {
 				compatible = "arm,idle-state";
 				idle-state-name = "silver-rail-power-collapse";
 				arm,psci-suspend-param = <0x40000004>;
-				entry-latency-us = <800>;
+				entry-latency-us = <550>;
 				exit-latency-us = <750>;
-				min-residency-us = <4090>;
+				min-residency-us = <6700>;
 				local-timer-stop;
 			};
 
@@ -294,8 +294,8 @@ BIG_CPU_SLEEP_0: cpu-sleep-1-0 {
 				idle-state-name = "gold-rail-power-collapse";
 				arm,psci-suspend-param = <0x40000004>;
 				entry-latency-us = <600>;
-				exit-latency-us = <1550>;
-				min-residency-us = <4791>;
+				exit-latency-us = <1300>;
+				min-residency-us = <8136>;
 				local-timer-stop;
 			};
 
@@ -314,17 +314,17 @@ domain-idle-states {
 			CLUSTER_SLEEP_0: cluster-sleep-0 {
 				compatible = "domain-idle-state";
 				arm,psci-suspend-param = <0x41000044>;
-				entry-latency-us = <1050>;
-				exit-latency-us = <2500>;
-				min-residency-us = <5309>;
+				entry-latency-us = <750>;
+				exit-latency-us = <2350>;
+				min-residency-us = <9144>;
 			};
 
 			CLUSTER_SLEEP_1: cluster-sleep-1 {
 				compatible = "domain-idle-state";
 				arm,psci-suspend-param = <0x4100c344>;
-				entry-latency-us = <2700>;
-				exit-latency-us = <3500>;
-				min-residency-us = <13959>;
+				entry-latency-us = <2800>;
+				exit-latency-us = <4400>;
+				min-residency-us = <10150>;
 			};
 		};
 	};
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 185/583] arm64: dts: qcom: sc8180x: Mark PCIe hosts cache-coherent
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (183 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 184/583] arm64: dts: qcom: sm8550: Update idle state time requirements Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 186/583] arm64: dts: qcom: sc8180x: switch PCIe QMP PHY to new style of bindings Greg Kroah-Hartman
                   ` (404 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Konrad Dybcio <konrad.dybcio@linaro.org>

[ Upstream commit 45e8c72712345263208f7c94f334fa718634f557 ]

The PCIe controllers on 8180 are cache-coherent. Mark them as such.

Fixes: d20b6c84f56a ("arm64: dts: qcom: sc8180x: Add PCIe instances")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231219-topic-8180_pcie_dmac-v1-1-5d00fc1b23fd@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sc8180x.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc8180x.dtsi b/arch/arm64/boot/dts/qcom/sc8180x.dtsi
index 486f7ffef43b..0d85bdec5a82 100644
--- a/arch/arm64/boot/dts/qcom/sc8180x.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc8180x.dtsi
@@ -1751,6 +1751,7 @@ pcie0: pci@1c00000 {
 
 			phys = <&pcie0_lane>;
 			phy-names = "pciephy";
+			dma-coherent;
 
 			status = "disabled";
 		};
@@ -1858,6 +1859,7 @@ pcie3: pci@1c08000 {
 
 			phys = <&pcie3_lane>;
 			phy-names = "pciephy";
+			dma-coherent;
 
 			status = "disabled";
 		};
@@ -1965,6 +1967,7 @@ pcie1: pci@1c10000 {
 
 			phys = <&pcie1_lane>;
 			phy-names = "pciephy";
+			dma-coherent;
 
 			status = "disabled";
 		};
@@ -2072,6 +2075,7 @@ pcie2: pci@1c18000 {
 
 			phys = <&pcie2_lane>;
 			phy-names = "pciephy";
+			dma-coherent;
 
 			status = "disabled";
 		};
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 186/583] arm64: dts: qcom: sc8180x: switch PCIe QMP PHY to new style of bindings
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (184 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 185/583] arm64: dts: qcom: sc8180x: Mark PCIe hosts cache-coherent Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 187/583] arm64: dts: qcom: sc8180x: Fix up PCIe nodes Greg Kroah-Hartman
                   ` (403 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Dmitry Baryshkov, Bjorn Andersson,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

[ Upstream commit a6546460ca439bade19d64eb63cee2d97c29fb72 ]

Change the PCIe QMP PHY to use newer style of QMP PHY bindings (single
resource region, no per-PHY subnodes). While we are at it, rename PHY
nodes to `phy@`.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20230820142035.89903-13-dmitry.baryshkov@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Stable-dep-of: 78403b37f677 ("arm64: dts: qcom: sc8180x: Fix up PCIe nodes")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sc8180x.dtsi | 148 ++++++++++----------------
 1 file changed, 55 insertions(+), 93 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sc8180x.dtsi b/arch/arm64/boot/dts/qcom/sc8180x.dtsi
index 0d85bdec5a82..dfaeb337960e 100644
--- a/arch/arm64/boot/dts/qcom/sc8180x.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc8180x.dtsi
@@ -1749,24 +1749,29 @@ pcie0: pci@1c00000 {
 					<&gem_noc MASTER_AMPSS_M0 0 &config_noc SLAVE_PCIE_0 0>;
 			interconnect-names = "pcie-mem", "cpu-pcie";
 
-			phys = <&pcie0_lane>;
+			phys = <&pcie0_phy>;
 			phy-names = "pciephy";
 			dma-coherent;
 
 			status = "disabled";
 		};
 
-		pcie0_phy: phy-wrapper@1c06000 {
+		pcie0_phy: phy@1c06000 {
 			compatible = "qcom,sc8180x-qmp-pcie-phy";
-			reg = <0 0x1c06000 0 0x1c0>;
-			#address-cells = <2>;
-			#size-cells = <2>;
-			ranges;
+			reg = <0 0x01c06000 0 0x1000>;
 			clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>,
 				 <&gcc GCC_PCIE_0_CFG_AHB_CLK>,
 				 <&gcc GCC_PCIE_0_CLKREF_CLK>,
-				 <&gcc GCC_PCIE1_PHY_REFGEN_CLK>;
-			clock-names = "aux", "cfg_ahb", "ref", "refgen";
+				 <&gcc GCC_PCIE1_PHY_REFGEN_CLK>,
+				 <&gcc GCC_PCIE_0_PIPE_CLK>;
+			clock-names = "aux",
+				      "cfg_ahb",
+				      "ref",
+				      "refgen",
+				      "pipe";
+			#clock-cells = <0>;
+			clock-output-names = "pcie_0_pipe_clk";
+			#phy-cells = <0>;
 
 			resets = <&gcc GCC_PCIE_0_PHY_BCR>;
 			reset-names = "phy";
@@ -1775,21 +1780,6 @@ pcie0_phy: phy-wrapper@1c06000 {
 			assigned-clock-rates = <100000000>;
 
 			status = "disabled";
-
-			pcie0_lane: phy@1c06200 {
-				reg = <0 0x1c06200 0 0x170>, /* tx0 */
-				      <0 0x1c06400 0 0x200>, /* rx0 */
-				      <0 0x1c06a00 0 0x1f0>, /* pcs */
-				      <0 0x1c06600 0 0x170>, /* tx1 */
-				      <0 0x1c06800 0 0x200>, /* rx1 */
-				      <0 0x1c06e00 0 0xf4>; /* pcs_com */
-				clocks = <&gcc GCC_PCIE_0_PIPE_CLK>;
-				clock-names = "pipe0";
-
-				#clock-cells = <0>;
-				clock-output-names = "pcie_0_pipe_clk";
-				#phy-cells = <0>;
-			};
 		};
 
 		pcie3: pci@1c08000 {
@@ -1857,24 +1847,30 @@ pcie3: pci@1c08000 {
 					<&gem_noc MASTER_AMPSS_M0 0 &config_noc SLAVE_PCIE_0 0>;
 			interconnect-names = "pcie-mem", "cpu-pcie";
 
-			phys = <&pcie3_lane>;
+			phys = <&pcie3_phy>;
 			phy-names = "pciephy";
 			dma-coherent;
 
 			status = "disabled";
 		};
 
-		pcie3_phy: phy-wrapper@1c0c000 {
+		pcie3_phy: phy@1c0c000 {
 			compatible = "qcom,sc8180x-qmp-pcie-phy";
-			reg = <0 0x1c0c000 0 0x1c0>;
-			#address-cells = <2>;
-			#size-cells = <2>;
-			ranges;
+			reg = <0 0x01c0c000 0 0x1000>;
 			clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>,
 				 <&gcc GCC_PCIE_3_CFG_AHB_CLK>,
 				 <&gcc GCC_PCIE_3_CLKREF_CLK>,
-				 <&gcc GCC_PCIE2_PHY_REFGEN_CLK>;
-			clock-names = "aux", "cfg_ahb", "ref", "refgen";
+				 <&gcc GCC_PCIE2_PHY_REFGEN_CLK>,
+				 <&gcc GCC_PCIE_3_PIPE_CLK>;
+			clock-names = "aux",
+				      "cfg_ahb",
+				      "ref",
+				      "refgen",
+				      "pipe";
+			#clock-cells = <0>;
+			clock-output-names = "pcie_3_pipe_clk";
+
+			#phy-cells = <0>;
 
 			resets = <&gcc GCC_PCIE_3_PHY_BCR>;
 			reset-names = "phy";
@@ -1883,21 +1879,6 @@ pcie3_phy: phy-wrapper@1c0c000 {
 			assigned-clock-rates = <100000000>;
 
 			status = "disabled";
-
-			pcie3_lane: phy@1c0c200 {
-				reg = <0 0x1c0c200 0 0x170>, /* tx0 */
-				      <0 0x1c0c400 0 0x200>, /* rx0 */
-				      <0 0x1c0ca00 0 0x1f0>, /* pcs */
-				      <0 0x1c0c600 0 0x170>, /* tx1 */
-				      <0 0x1c0c800 0 0x200>, /* rx1 */
-				      <0 0x1c0ce00 0 0xf4>; /* pcs_com */
-				clocks = <&gcc GCC_PCIE_3_PIPE_CLK>;
-				clock-names = "pipe0";
-
-				#clock-cells = <0>;
-				clock-output-names = "pcie_3_pipe_clk";
-				#phy-cells = <0>;
-			};
 		};
 
 		pcie1: pci@1c10000 {
@@ -1965,24 +1946,30 @@ pcie1: pci@1c10000 {
 					<&gem_noc MASTER_AMPSS_M0 0 &config_noc SLAVE_PCIE_0 0>;
 			interconnect-names = "pcie-mem", "cpu-pcie";
 
-			phys = <&pcie1_lane>;
+			phys = <&pcie1_phy>;
 			phy-names = "pciephy";
 			dma-coherent;
 
 			status = "disabled";
 		};
 
-		pcie1_phy: phy-wrapper@1c16000 {
+		pcie1_phy: phy@1c16000 {
 			compatible = "qcom,sc8180x-qmp-pcie-phy";
-			reg = <0 0x1c16000 0 0x1c0>;
-			#address-cells = <2>;
-			#size-cells = <2>;
-			ranges;
+			reg = <0 0x01c16000 0 0x1000>;
 			clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>,
 				 <&gcc GCC_PCIE_1_CFG_AHB_CLK>,
 				 <&gcc GCC_PCIE_1_CLKREF_CLK>,
-				 <&gcc GCC_PCIE1_PHY_REFGEN_CLK>;
-			clock-names = "aux", "cfg_ahb", "ref", "refgen";
+				 <&gcc GCC_PCIE1_PHY_REFGEN_CLK>,
+				 <&gcc GCC_PCIE_1_PIPE_CLK>;
+			clock-names = "aux",
+				      "cfg_ahb",
+				      "ref",
+				      "refgen",
+				      "pipe";
+			#clock-cells = <0>;
+			clock-output-names = "pcie_1_pipe_clk";
+
+			#phy-cells = <0>;
 
 			resets = <&gcc GCC_PCIE_1_PHY_BCR>;
 			reset-names = "phy";
@@ -1991,21 +1978,6 @@ pcie1_phy: phy-wrapper@1c16000 {
 			assigned-clock-rates = <100000000>;
 
 			status = "disabled";
-
-			pcie1_lane: phy@1c0e200 {
-				reg = <0 0x1c16200 0 0x170>, /* tx0 */
-				      <0 0x1c16400 0 0x200>, /* rx0 */
-				      <0 0x1c16a00 0 0x1f0>, /* pcs */
-				      <0 0x1c16600 0 0x170>, /* tx1 */
-				      <0 0x1c16800 0 0x200>, /* rx1 */
-				      <0 0x1c16e00 0 0xf4>; /* pcs_com */
-				clocks = <&gcc GCC_PCIE_1_PIPE_CLK>;
-				clock-names = "pipe0";
-				#clock-cells = <0>;
-				clock-output-names = "pcie_1_pipe_clk";
-
-				#phy-cells = <0>;
-			};
 		};
 
 		pcie2: pci@1c18000 {
@@ -2073,24 +2045,30 @@ pcie2: pci@1c18000 {
 					<&gem_noc MASTER_AMPSS_M0 0 &config_noc SLAVE_PCIE_0 0>;
 			interconnect-names = "pcie-mem", "cpu-pcie";
 
-			phys = <&pcie2_lane>;
+			phys = <&pcie2_phy>;
 			phy-names = "pciephy";
 			dma-coherent;
 
 			status = "disabled";
 		};
 
-		pcie2_phy: phy-wrapper@1c1c000 {
+		pcie2_phy: phy@1c1c000 {
 			compatible = "qcom,sc8180x-qmp-pcie-phy";
-			reg = <0 0x1c1c000 0 0x1c0>;
-			#address-cells = <2>;
-			#size-cells = <2>;
-			ranges;
+			reg = <0 0x01c1c000 0 0x1000>;
 			clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>,
 				 <&gcc GCC_PCIE_2_CFG_AHB_CLK>,
 				 <&gcc GCC_PCIE_2_CLKREF_CLK>,
-				 <&gcc GCC_PCIE2_PHY_REFGEN_CLK>;
-			clock-names = "aux", "cfg_ahb", "ref", "refgen";
+				 <&gcc GCC_PCIE2_PHY_REFGEN_CLK>,
+				 <&gcc GCC_PCIE_2_PIPE_CLK>;
+			clock-names = "aux",
+				      "cfg_ahb",
+				      "ref",
+				      "refgen",
+				      "pipe";
+			#clock-cells = <0>;
+			clock-output-names = "pcie_3_pipe_clk";
+
+			#phy-cells = <0>;
 
 			resets = <&gcc GCC_PCIE_2_PHY_BCR>;
 			reset-names = "phy";
@@ -2099,22 +2077,6 @@ pcie2_phy: phy-wrapper@1c1c000 {
 			assigned-clock-rates = <100000000>;
 
 			status = "disabled";
-
-			pcie2_lane: phy@1c0e200 {
-				reg = <0 0x1c1c200 0 0x170>, /* tx0 */
-				      <0 0x1c1c400 0 0x200>, /* rx0 */
-				      <0 0x1c1ca00 0 0x1f0>, /* pcs */
-				      <0 0x1c1c600 0 0x170>, /* tx1 */
-				      <0 0x1c1c800 0 0x200>, /* rx1 */
-				      <0 0x1c1ce00 0 0xf4>; /* pcs_com */
-				clocks = <&gcc GCC_PCIE_2_PIPE_CLK>;
-				clock-names = "pipe0";
-
-				#clock-cells = <0>;
-				clock-output-names = "pcie_2_pipe_clk";
-
-				#phy-cells = <0>;
-			};
 		};
 
 		ufs_mem_hc: ufshc@1d84000 {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 187/583] arm64: dts: qcom: sc8180x: Fix up PCIe nodes
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (185 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 186/583] arm64: dts: qcom: sc8180x: switch PCIe QMP PHY to new style of bindings Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:53 ` [PATCH 6.6 188/583] bpf: Re-enable unit_size checking for global per-cpu allocator Greg Kroah-Hartman
                   ` (402 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Konrad Dybcio <konrad.dybcio@linaro.org>

[ Upstream commit 78403b37f6770441f80a78d13772394731afe055 ]

Duplicated clock output names cause probe errors and wrong clocks cause
hardware not to work. Fix such issues.

Fixes: d20b6c84f56a ("arm64: dts: qcom: sc8180x: Add PCIe instances")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231219-topic-8180_pcie-v1-1-c2acbba4723c@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/qcom/sc8180x.dtsi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sc8180x.dtsi b/arch/arm64/boot/dts/qcom/sc8180x.dtsi
index dfaeb337960e..f4381424e70a 100644
--- a/arch/arm64/boot/dts/qcom/sc8180x.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc8180x.dtsi
@@ -1762,7 +1762,7 @@ pcie0_phy: phy@1c06000 {
 			clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>,
 				 <&gcc GCC_PCIE_0_CFG_AHB_CLK>,
 				 <&gcc GCC_PCIE_0_CLKREF_CLK>,
-				 <&gcc GCC_PCIE1_PHY_REFGEN_CLK>,
+				 <&gcc GCC_PCIE0_PHY_REFGEN_CLK>,
 				 <&gcc GCC_PCIE_0_PIPE_CLK>;
 			clock-names = "aux",
 				      "cfg_ahb",
@@ -1860,7 +1860,7 @@ pcie3_phy: phy@1c0c000 {
 			clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>,
 				 <&gcc GCC_PCIE_3_CFG_AHB_CLK>,
 				 <&gcc GCC_PCIE_3_CLKREF_CLK>,
-				 <&gcc GCC_PCIE2_PHY_REFGEN_CLK>,
+				 <&gcc GCC_PCIE3_PHY_REFGEN_CLK>,
 				 <&gcc GCC_PCIE_3_PIPE_CLK>;
 			clock-names = "aux",
 				      "cfg_ahb",
@@ -2066,7 +2066,7 @@ pcie2_phy: phy@1c1c000 {
 				      "refgen",
 				      "pipe";
 			#clock-cells = <0>;
-			clock-output-names = "pcie_3_pipe_clk";
+			clock-output-names = "pcie_2_pipe_clk";
 
 			#phy-cells = <0>;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 188/583] bpf: Re-enable unit_size checking for global per-cpu allocator
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (186 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 187/583] arm64: dts: qcom: sc8180x: Fix up PCIe nodes Greg Kroah-Hartman
@ 2024-01-22 23:53 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 189/583] bpf: Use pcpu_alloc_size() in bpf_mem_free{_rcu}() Greg Kroah-Hartman
                   ` (401 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:53 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hou Tao, Alexei Starovoitov, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hou Tao <houtao1@huawei.com>

[ Upstream commit baa8fdecd87bb8751237b45e3bcb5a179e5a12ca ]

With pcpu_alloc_size() in place, check whether or not the size of
the dynamic per-cpu area is matched with unit_size.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20231020133202.4043247-4-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Stable-dep-of: 7ac5c53e0073 ("bpf: Use c->unit_size to select target cache during free")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/memalloc.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/kernel/bpf/memalloc.c b/kernel/bpf/memalloc.c
index 956f80ee6f5c..9657d5951d78 100644
--- a/kernel/bpf/memalloc.c
+++ b/kernel/bpf/memalloc.c
@@ -491,21 +491,17 @@ static int check_obj_size(struct bpf_mem_cache *c, unsigned int idx)
 	struct llist_node *first;
 	unsigned int obj_size;
 
-	/* For per-cpu allocator, the size of free objects in free list doesn't
-	 * match with unit_size and now there is no way to get the size of
-	 * per-cpu pointer saved in free object, so just skip the checking.
-	 */
-	if (c->percpu_size)
-		return 0;
-
 	first = c->free_llist.first;
 	if (!first)
 		return 0;
 
-	obj_size = ksize(first);
+	if (c->percpu_size)
+		obj_size = pcpu_alloc_size(((void **)first)[1]);
+	else
+		obj_size = ksize(first);
 	if (obj_size != c->unit_size) {
-		WARN_ONCE(1, "bpf_mem_cache[%u]: unexpected object size %u, expect %u\n",
-			  idx, obj_size, c->unit_size);
+		WARN_ONCE(1, "bpf_mem_cache[%u]: percpu %d, unexpected object size %u, expect %u\n",
+			  idx, c->percpu_size, obj_size, c->unit_size);
 		return -EINVAL;
 	}
 	return 0;
@@ -967,6 +963,12 @@ void notrace *bpf_mem_cache_alloc_flags(struct bpf_mem_alloc *ma, gfp_t flags)
 	return !ret ? NULL : ret + LLIST_NODE_SZ;
 }
 
+/* The alignment of dynamic per-cpu area is 8, so c->unit_size and the
+ * actual size of dynamic per-cpu area will always be matched and there is
+ * no need to adjust size_index for per-cpu allocation. However for the
+ * simplicity of the implementation, use an unified size_index for both
+ * kmalloc and per-cpu allocation.
+ */
 static __init int bpf_mem_cache_adjust_size(void)
 {
 	unsigned int size;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 189/583] bpf: Use pcpu_alloc_size() in bpf_mem_free{_rcu}()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (187 preceding siblings ...)
  2024-01-22 23:53 ` [PATCH 6.6 188/583] bpf: Re-enable unit_size checking for global per-cpu allocator Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 190/583] bpf: Use c->unit_size to select target cache during free Greg Kroah-Hartman
                   ` (400 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hou Tao, Alexei Starovoitov, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hou Tao <houtao1@huawei.com>

[ Upstream commit 3f2189e4f77b7a3e979d143dc4ff586488c7e8a5 ]

For bpf_global_percpu_ma, the pointer passed to bpf_mem_free_rcu() is
allocated by kmalloc() and its size is fixed (16-bytes on x86-64). So
no matter which cache allocates the dynamic per-cpu area, on x86-64
cache[2] will always be used to free the per-cpu area.

Fix the unbalance by checking whether the bpf memory allocator is
per-cpu or not and use pcpu_alloc_size() instead of ksize() to
find the correct cache for per-cpu free.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20231020133202.4043247-5-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Stable-dep-of: 7ac5c53e0073 ("bpf: Use c->unit_size to select target cache during free")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/bpf_mem_alloc.h |  1 +
 kernel/bpf/memalloc.c         | 17 +++++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/include/linux/bpf_mem_alloc.h b/include/linux/bpf_mem_alloc.h
index d644bbb298af..bb1223b21308 100644
--- a/include/linux/bpf_mem_alloc.h
+++ b/include/linux/bpf_mem_alloc.h
@@ -11,6 +11,7 @@ struct bpf_mem_caches;
 struct bpf_mem_alloc {
 	struct bpf_mem_caches __percpu *caches;
 	struct bpf_mem_cache __percpu *cache;
+	bool percpu;
 	struct work_struct work;
 };
 
diff --git a/kernel/bpf/memalloc.c b/kernel/bpf/memalloc.c
index 9657d5951d78..5f93bafa4a26 100644
--- a/kernel/bpf/memalloc.c
+++ b/kernel/bpf/memalloc.c
@@ -522,6 +522,8 @@ int bpf_mem_alloc_init(struct bpf_mem_alloc *ma, int size, bool percpu)
 	struct bpf_mem_cache *c, __percpu *pc;
 	struct obj_cgroup *objcg = NULL;
 
+	ma->percpu = percpu;
+
 	if (size) {
 		pc = __alloc_percpu_gfp(sizeof(*pc), 8, GFP_KERNEL);
 		if (!pc)
@@ -866,6 +868,17 @@ void notrace *bpf_mem_alloc(struct bpf_mem_alloc *ma, size_t size)
 	return !ret ? NULL : ret + LLIST_NODE_SZ;
 }
 
+static notrace int bpf_mem_free_idx(void *ptr, bool percpu)
+{
+	size_t size;
+
+	if (percpu)
+		size = pcpu_alloc_size(*((void **)ptr));
+	else
+		size = ksize(ptr - LLIST_NODE_SZ);
+	return bpf_mem_cache_idx(size);
+}
+
 void notrace bpf_mem_free(struct bpf_mem_alloc *ma, void *ptr)
 {
 	int idx;
@@ -873,7 +886,7 @@ void notrace bpf_mem_free(struct bpf_mem_alloc *ma, void *ptr)
 	if (!ptr)
 		return;
 
-	idx = bpf_mem_cache_idx(ksize(ptr - LLIST_NODE_SZ));
+	idx = bpf_mem_free_idx(ptr, ma->percpu);
 	if (idx < 0)
 		return;
 
@@ -887,7 +900,7 @@ void notrace bpf_mem_free_rcu(struct bpf_mem_alloc *ma, void *ptr)
 	if (!ptr)
 		return;
 
-	idx = bpf_mem_cache_idx(ksize(ptr - LLIST_NODE_SZ));
+	idx = bpf_mem_free_idx(ptr, ma->percpu);
 	if (idx < 0)
 		return;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 190/583] bpf: Use c->unit_size to select target cache during free
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (188 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 189/583] bpf: Use pcpu_alloc_size() in bpf_mem_free{_rcu}() Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 191/583] wifi: rtlwifi: add calculate_bit_shift() Greg Kroah-Hartman
                   ` (399 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, kernel test robot, Hou Tao,
	Alexei Starovoitov, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hou Tao <houtao1@huawei.com>

[ Upstream commit 7ac5c53e00735d183a0f5e2cfce5eeb6c16319f2 ]

At present, bpf memory allocator uses check_obj_size() to ensure that
ksize() of allocated pointer is equal with the unit_size of used
bpf_mem_cache. Its purpose is to prevent bpf_mem_free() from selecting
a bpf_mem_cache which has different unit_size compared with the
bpf_mem_cache used for allocation. But as reported by lkp, the return
value of ksize() or kmalloc_size_roundup() may change due to slab merge
and it will lead to the warning report in check_obj_size().

The reported warning happened as follows:
(1) in bpf_mem_cache_adjust_size(), kmalloc_size_roundup(96) returns the
object_size of kmalloc-96 instead of kmalloc-cg-96. The object_size of
kmalloc-96 is 96, so size_index for 96 is not adjusted accordingly.
(2) the object_size of kmalloc-cg-96 is adjust from 96 to 128 due to
slab merge in __kmem_cache_alias(). For SLAB, SLAB_HWCACHE_ALIGN is
enabled by default for kmalloc slab, so align is 64 and size is 128 for
kmalloc-cg-96. SLUB has a similar merge logic, but its object_size will
not be changed, because its align is 8 under x86-64.
(3) when unit_alloc() does kmalloc_node(96, __GFP_ACCOUNT, node),
ksize() returns 128 instead of 96 for the returned pointer.
(4) the warning in check_obj_size() is triggered.

Considering the slab merge can happen in anytime (e.g, a slab created in
a new module), the following case is also possible: during the
initialization of bpf_global_ma, there is no slab merge and ksize() for
a 96-bytes object returns 96. But after that a new slab created by a
kernel module is merged to kmalloc-cg-96 and the object_size of
kmalloc-cg-96 is adjust from 96 to 128 (which is possible for x86-64 +
CONFIG_SLAB, because its alignment requirement is 64 for 96-bytes slab).
So soon or later, when bpf_global_ma frees a 96-byte-sized pointer
which is allocated from bpf_mem_cache with unit_size=96, bpf_mem_free()
will free the pointer through a bpf_mem_cache in which unit_size is 128,
because the return value of ksize() changes. The warning for the
mismatch will be triggered again.

A feasible fix is introducing similar APIs compared with ksize() and
kmalloc_size_roundup() to return the actually-allocated size instead of
size which may change due to slab merge, but it will introduce
unnecessary dependency on the implementation details of mm subsystem.

As for now the pointer of bpf_mem_cache is saved in the 8-bytes area
(or 4-bytes under 32-bit host) above the returned pointer, using
unit_size in the saved bpf_mem_cache to select the target cache instead
of inferring the size from the pointer itself. Beside no extra
dependency on mm subsystem, the performance for bpf_mem_free_rcu() is
also improved as shown below.

Before applying the patch, the performances of bpf_mem_alloc() and
bpf_mem_free_rcu() on 8-CPUs VM with one producer are as follows:

kmalloc : alloc 11.69 ± 0.28M/s free 29.58 ± 0.93M/s
percpu  : alloc 14.11 ± 0.52M/s free 14.29 ± 0.99M/s

After apply the patch, the performance for bpf_mem_free_rcu() increases
9% and 146% for kmalloc memory and per-cpu memory respectively:

kmalloc: alloc 11.01 ± 0.03M/s free   32.42 ± 0.48M/s
percpu:  alloc 12.84 ± 0.12M/s free   35.24 ± 0.23M/s

After the fixes, there is no need to adjust size_index to fix the
mismatch between allocation and free, so remove it as well. Also return
NULL instead of ZERO_SIZE_PTR for zero-sized alloc in bpf_mem_alloc(),
because there is no bpf_mem_cache pointer saved above ZERO_SIZE_PTR.

Fixes: 9077fc228f09 ("bpf: Use kmalloc_size_roundup() to adjust size_index")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/bpf/202310302113.9f8fe705-oliver.sang@intel.com
Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20231216131052.27621-2-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/memalloc.c | 105 +++++-------------------------------------
 1 file changed, 11 insertions(+), 94 deletions(-)

diff --git a/kernel/bpf/memalloc.c b/kernel/bpf/memalloc.c
index 5f93bafa4a26..85f9501ff6e6 100644
--- a/kernel/bpf/memalloc.c
+++ b/kernel/bpf/memalloc.c
@@ -486,27 +486,6 @@ static void prefill_mem_cache(struct bpf_mem_cache *c, int cpu)
 	alloc_bulk(c, c->unit_size <= 256 ? 4 : 1, cpu_to_node(cpu), false);
 }
 
-static int check_obj_size(struct bpf_mem_cache *c, unsigned int idx)
-{
-	struct llist_node *first;
-	unsigned int obj_size;
-
-	first = c->free_llist.first;
-	if (!first)
-		return 0;
-
-	if (c->percpu_size)
-		obj_size = pcpu_alloc_size(((void **)first)[1]);
-	else
-		obj_size = ksize(first);
-	if (obj_size != c->unit_size) {
-		WARN_ONCE(1, "bpf_mem_cache[%u]: percpu %d, unexpected object size %u, expect %u\n",
-			  idx, c->percpu_size, obj_size, c->unit_size);
-		return -EINVAL;
-	}
-	return 0;
-}
-
 /* When size != 0 bpf_mem_cache for each cpu.
  * This is typical bpf hash map use case when all elements have equal size.
  *
@@ -517,10 +496,10 @@ static int check_obj_size(struct bpf_mem_cache *c, unsigned int idx)
 int bpf_mem_alloc_init(struct bpf_mem_alloc *ma, int size, bool percpu)
 {
 	static u16 sizes[NUM_CACHES] = {96, 192, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096};
-	int cpu, i, err, unit_size, percpu_size = 0;
 	struct bpf_mem_caches *cc, __percpu *pcc;
 	struct bpf_mem_cache *c, __percpu *pc;
 	struct obj_cgroup *objcg = NULL;
+	int cpu, i, unit_size, percpu_size = 0;
 
 	ma->percpu = percpu;
 
@@ -560,7 +539,6 @@ int bpf_mem_alloc_init(struct bpf_mem_alloc *ma, int size, bool percpu)
 	pcc = __alloc_percpu_gfp(sizeof(*cc), 8, GFP_KERNEL);
 	if (!pcc)
 		return -ENOMEM;
-	err = 0;
 #ifdef CONFIG_MEMCG_KMEM
 	objcg = get_obj_cgroup_from_current();
 #endif
@@ -573,28 +551,12 @@ int bpf_mem_alloc_init(struct bpf_mem_alloc *ma, int size, bool percpu)
 			c->tgt = c;
 
 			init_refill_work(c);
-			/* Another bpf_mem_cache will be used when allocating
-			 * c->unit_size in bpf_mem_alloc(), so doesn't prefill
-			 * for the bpf_mem_cache because these free objects will
-			 * never be used.
-			 */
-			if (i != bpf_mem_cache_idx(c->unit_size))
-				continue;
 			prefill_mem_cache(c, cpu);
-			err = check_obj_size(c, i);
-			if (err)
-				goto out;
 		}
 	}
 
-out:
 	ma->caches = pcc;
-	/* refill_work is either zeroed or initialized, so it is safe to
-	 * call irq_work_sync().
-	 */
-	if (err)
-		bpf_mem_alloc_destroy(ma);
-	return err;
+	return 0;
 }
 
 static void drain_mem_cache(struct bpf_mem_cache *c)
@@ -858,7 +820,7 @@ void notrace *bpf_mem_alloc(struct bpf_mem_alloc *ma, size_t size)
 	void *ret;
 
 	if (!size)
-		return ZERO_SIZE_PTR;
+		return NULL;
 
 	idx = bpf_mem_cache_idx(size + LLIST_NODE_SZ);
 	if (idx < 0)
@@ -868,26 +830,17 @@ void notrace *bpf_mem_alloc(struct bpf_mem_alloc *ma, size_t size)
 	return !ret ? NULL : ret + LLIST_NODE_SZ;
 }
 
-static notrace int bpf_mem_free_idx(void *ptr, bool percpu)
-{
-	size_t size;
-
-	if (percpu)
-		size = pcpu_alloc_size(*((void **)ptr));
-	else
-		size = ksize(ptr - LLIST_NODE_SZ);
-	return bpf_mem_cache_idx(size);
-}
-
 void notrace bpf_mem_free(struct bpf_mem_alloc *ma, void *ptr)
 {
+	struct bpf_mem_cache *c;
 	int idx;
 
 	if (!ptr)
 		return;
 
-	idx = bpf_mem_free_idx(ptr, ma->percpu);
-	if (idx < 0)
+	c = *(void **)(ptr - LLIST_NODE_SZ);
+	idx = bpf_mem_cache_idx(c->unit_size);
+	if (WARN_ON_ONCE(idx < 0))
 		return;
 
 	unit_free(this_cpu_ptr(ma->caches)->cache + idx, ptr);
@@ -895,13 +848,15 @@ void notrace bpf_mem_free(struct bpf_mem_alloc *ma, void *ptr)
 
 void notrace bpf_mem_free_rcu(struct bpf_mem_alloc *ma, void *ptr)
 {
+	struct bpf_mem_cache *c;
 	int idx;
 
 	if (!ptr)
 		return;
 
-	idx = bpf_mem_free_idx(ptr, ma->percpu);
-	if (idx < 0)
+	c = *(void **)(ptr - LLIST_NODE_SZ);
+	idx = bpf_mem_cache_idx(c->unit_size);
+	if (WARN_ON_ONCE(idx < 0))
 		return;
 
 	unit_free_rcu(this_cpu_ptr(ma->caches)->cache + idx, ptr);
@@ -975,41 +930,3 @@ void notrace *bpf_mem_cache_alloc_flags(struct bpf_mem_alloc *ma, gfp_t flags)
 
 	return !ret ? NULL : ret + LLIST_NODE_SZ;
 }
-
-/* The alignment of dynamic per-cpu area is 8, so c->unit_size and the
- * actual size of dynamic per-cpu area will always be matched and there is
- * no need to adjust size_index for per-cpu allocation. However for the
- * simplicity of the implementation, use an unified size_index for both
- * kmalloc and per-cpu allocation.
- */
-static __init int bpf_mem_cache_adjust_size(void)
-{
-	unsigned int size;
-
-	/* Adjusting the indexes in size_index() according to the object_size
-	 * of underlying slab cache, so bpf_mem_alloc() will select a
-	 * bpf_mem_cache with unit_size equal to the object_size of
-	 * the underlying slab cache.
-	 *
-	 * The maximal value of KMALLOC_MIN_SIZE and __kmalloc_minalign() is
-	 * 256-bytes, so only do adjustment for [8-bytes, 192-bytes].
-	 */
-	for (size = 192; size >= 8; size -= 8) {
-		unsigned int kmalloc_size, index;
-
-		kmalloc_size = kmalloc_size_roundup(size);
-		if (kmalloc_size == size)
-			continue;
-
-		if (kmalloc_size <= 192)
-			index = size_index[(kmalloc_size - 1) / 8];
-		else
-			index = fls(kmalloc_size - 1) - 1;
-		/* Only overwrite if necessary */
-		if (size_index[(size - 1) / 8] != index)
-			size_index[(size - 1) / 8] = index;
-	}
-
-	return 0;
-}
-subsys_initcall(bpf_mem_cache_adjust_size);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 191/583] wifi: rtlwifi: add calculate_bit_shift()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (189 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 190/583] bpf: Use c->unit_size to select target cache during free Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 192/583] wifi: rtlwifi: rtl8188ee: phy: using calculate_bit_shift() Greg Kroah-Hartman
                   ` (398 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Su Hui, Ping-Ke Shih, Kalle Valo,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Su Hui <suhui@nfschina.com>

[ Upstream commit 52221dfddbbfb5b4e029bb2efe9bb7da33ec1e46 ]

There are many same functions like _rtl88e_phy_calculate_bit_shift(),
_rtl92c_phy_calculate_bit_shift() and so on. And these functions can
cause undefined bitwise shift behavior. Add calculate_bit_shift() to
replace them and fix undefined behavior in subsequent patches.

Signed-off-by: Su Hui <suhui@nfschina.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231219065739.1895666-2-suhui@nfschina.com
Stable-dep-of: 969bc926f04b ("wifi: rtlwifi: rtl8188ee: phy: using calculate_bit_shift()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/realtek/rtlwifi/wifi.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h
index 2e7e04f91279..8cbf3fb38853 100644
--- a/drivers/net/wireless/realtek/rtlwifi/wifi.h
+++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h
@@ -3080,4 +3080,11 @@ static inline struct ieee80211_sta *rtl_find_sta(struct ieee80211_hw *hw,
 	return ieee80211_find_sta(mac->vif, mac_addr);
 }
 
+static inline u32 calculate_bit_shift(u32 bitmask)
+{
+	if (WARN_ON_ONCE(!bitmask))
+		return 0;
+
+	return __ffs(bitmask);
+}
 #endif
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 192/583] wifi: rtlwifi: rtl8188ee: phy: using calculate_bit_shift()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (190 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 191/583] wifi: rtlwifi: add calculate_bit_shift() Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 193/583] wifi: rtlwifi: rtl8192c: " Greg Kroah-Hartman
                   ` (397 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Su Hui, Kalle Valo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Su Hui <suhui@nfschina.com>

[ Upstream commit 969bc926f04b438676768aeffffffb050e480b62 ]

Using calculate_bit_shift() to replace _rtl88e_phy_calculate_bit_shift().
And fix the undefined bitwise shift behavior problem.

Fixes: f0eb856e0b6c ("rtlwifi: rtl8188ee: Add new driver")
Signed-off-by: Su Hui <suhui@nfschina.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231219065739.1895666-4-suhui@nfschina.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../net/wireless/realtek/rtlwifi/rtl8188ee/phy.c   | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
index 12d0b3a87af7..0fab3a0c7d49 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
@@ -16,12 +16,6 @@ static u32 _rtl88e_phy_rf_serial_read(struct ieee80211_hw *hw,
 static void _rtl88e_phy_rf_serial_write(struct ieee80211_hw *hw,
 					enum radio_path rfpath, u32 offset,
 					u32 data);
-static u32 _rtl88e_phy_calculate_bit_shift(u32 bitmask)
-{
-	u32 i = ffs(bitmask);
-
-	return i ? i - 1 : 32;
-}
 static bool _rtl88e_phy_bb8188e_config_parafile(struct ieee80211_hw *hw);
 static bool _rtl88e_phy_config_mac_with_headerfile(struct ieee80211_hw *hw);
 static bool phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
@@ -51,7 +45,7 @@ u32 rtl88e_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask)
 	rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE,
 		"regaddr(%#x), bitmask(%#x)\n", regaddr, bitmask);
 	originalvalue = rtl_read_dword(rtlpriv, regaddr);
-	bitshift = _rtl88e_phy_calculate_bit_shift(bitmask);
+	bitshift = calculate_bit_shift(bitmask);
 	returnvalue = (originalvalue & bitmask) >> bitshift;
 
 	rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE,
@@ -74,7 +68,7 @@ void rtl88e_phy_set_bb_reg(struct ieee80211_hw *hw,
 
 	if (bitmask != MASKDWORD) {
 		originalvalue = rtl_read_dword(rtlpriv, regaddr);
-		bitshift = _rtl88e_phy_calculate_bit_shift(bitmask);
+		bitshift = calculate_bit_shift(bitmask);
 		data = ((originalvalue & (~bitmask)) | (data << bitshift));
 	}
 
@@ -99,7 +93,7 @@ u32 rtl88e_phy_query_rf_reg(struct ieee80211_hw *hw,
 
 
 	original_value = _rtl88e_phy_rf_serial_read(hw, rfpath, regaddr);
-	bitshift = _rtl88e_phy_calculate_bit_shift(bitmask);
+	bitshift = calculate_bit_shift(bitmask);
 	readback_value = (original_value & bitmask) >> bitshift;
 
 	spin_unlock(&rtlpriv->locks.rf_lock);
@@ -127,7 +121,7 @@ void rtl88e_phy_set_rf_reg(struct ieee80211_hw *hw,
 			original_value = _rtl88e_phy_rf_serial_read(hw,
 								    rfpath,
 								    regaddr);
-			bitshift = _rtl88e_phy_calculate_bit_shift(bitmask);
+			bitshift = calculate_bit_shift(bitmask);
 			data =
 			    ((original_value & (~bitmask)) |
 			     (data << bitshift));
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 193/583] wifi: rtlwifi: rtl8192c: using calculate_bit_shift()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (191 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 192/583] wifi: rtlwifi: rtl8188ee: phy: using calculate_bit_shift() Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 194/583] wifi: rtlwifi: rtl8192cu: " Greg Kroah-Hartman
                   ` (396 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Su Hui, Kalle Valo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Su Hui <suhui@nfschina.com>

[ Upstream commit 1dedc3a6699d827d345019e921b8d8f37f694333 ]

Using calculate_bit_shift() to replace _rtl92c_phy_calculate_bit_shift().
And fix the undefined bitwise shift behavior problem.

Fixes: 4295cd254af3 ("rtlwifi: Move common parts of rtl8192ce/phy.c")
Signed-off-by: Su Hui <suhui@nfschina.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231219065739.1895666-5-suhui@nfschina.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../wireless/realtek/rtlwifi/rtl8192c/phy_common.c   | 12 ++----------
 .../wireless/realtek/rtlwifi/rtl8192c/phy_common.h   |  1 -
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
index 3d29c8dbb255..144ee780e1b6 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
@@ -17,7 +17,7 @@ u32 rtl92c_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask)
 	rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE, "regaddr(%#x), bitmask(%#x)\n",
 		regaddr, bitmask);
 	originalvalue = rtl_read_dword(rtlpriv, regaddr);
-	bitshift = _rtl92c_phy_calculate_bit_shift(bitmask);
+	bitshift = calculate_bit_shift(bitmask);
 	returnvalue = (originalvalue & bitmask) >> bitshift;
 
 	rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE,
@@ -40,7 +40,7 @@ void rtl92c_phy_set_bb_reg(struct ieee80211_hw *hw,
 
 	if (bitmask != MASKDWORD) {
 		originalvalue = rtl_read_dword(rtlpriv, regaddr);
-		bitshift = _rtl92c_phy_calculate_bit_shift(bitmask);
+		bitshift = calculate_bit_shift(bitmask);
 		data = ((originalvalue & (~bitmask)) | (data << bitshift));
 	}
 
@@ -143,14 +143,6 @@ void _rtl92c_phy_rf_serial_write(struct ieee80211_hw *hw,
 }
 EXPORT_SYMBOL(_rtl92c_phy_rf_serial_write);
 
-u32 _rtl92c_phy_calculate_bit_shift(u32 bitmask)
-{
-	u32 i = ffs(bitmask);
-
-	return i ? i - 1 : 32;
-}
-EXPORT_SYMBOL(_rtl92c_phy_calculate_bit_shift);
-
 static void _rtl92c_phy_bb_config_1t(struct ieee80211_hw *hw)
 {
 	rtl_set_bbreg(hw, RFPGA0_TXINFO, 0x3, 0x2);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.h b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.h
index 75afa6253ad0..e64d377dfe9e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.h
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.h
@@ -196,7 +196,6 @@ bool rtl92c_phy_set_rf_power_state(struct ieee80211_hw *hw,
 void rtl92ce_phy_set_rf_on(struct ieee80211_hw *hw);
 void rtl92c_phy_set_io(struct ieee80211_hw *hw);
 void rtl92c_bb_block_on(struct ieee80211_hw *hw);
-u32 _rtl92c_phy_calculate_bit_shift(u32 bitmask);
 long _rtl92c_phy_txpwr_idx_to_dbm(struct ieee80211_hw *hw,
 				  enum wireless_mode wirelessmode,
 				  u8 txpwridx);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 194/583] wifi: rtlwifi: rtl8192cu: using calculate_bit_shift()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (192 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 193/583] wifi: rtlwifi: rtl8192c: " Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 195/583] wifi: rtlwifi: rtl8192ce: " Greg Kroah-Hartman
                   ` (395 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Su Hui, Kalle Valo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Su Hui <suhui@nfschina.com>

[ Upstream commit f4088c8fcbabadad9dd17d17ae9ba24e9e3221ec ]

Using calculate_bit_shift() to replace _rtl92c_phy_calculate_bit_shift().
And fix an undefined bitwise shift behavior problem.

Fixes: f0a39ae738d6 ("rtlwifi: rtl8192cu: Add routine phy")
Signed-off-by: Su Hui <suhui@nfschina.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231219065739.1895666-6-suhui@nfschina.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c
index a8d9fe269f31..0b8cb7e61fd8 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c
@@ -32,7 +32,7 @@ u32 rtl92cu_phy_query_rf_reg(struct ieee80211_hw *hw,
 		original_value = _rtl92c_phy_fw_rf_serial_read(hw,
 							       rfpath, regaddr);
 	}
-	bitshift = _rtl92c_phy_calculate_bit_shift(bitmask);
+	bitshift = calculate_bit_shift(bitmask);
 	readback_value = (original_value & bitmask) >> bitshift;
 	rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE,
 		"regaddr(%#x), rfpath(%#x), bitmask(%#x), original_value(%#x)\n",
@@ -56,7 +56,7 @@ void rtl92cu_phy_set_rf_reg(struct ieee80211_hw *hw,
 			original_value = _rtl92c_phy_rf_serial_read(hw,
 								    rfpath,
 								    regaddr);
-			bitshift = _rtl92c_phy_calculate_bit_shift(bitmask);
+			bitshift = calculate_bit_shift(bitmask);
 			data =
 			    ((original_value & (~bitmask)) |
 			     (data << bitshift));
@@ -67,7 +67,7 @@ void rtl92cu_phy_set_rf_reg(struct ieee80211_hw *hw,
 			original_value = _rtl92c_phy_fw_rf_serial_read(hw,
 								       rfpath,
 								       regaddr);
-			bitshift = _rtl92c_phy_calculate_bit_shift(bitmask);
+			bitshift = calculate_bit_shift(bitmask);
 			data =
 			    ((original_value & (~bitmask)) |
 			     (data << bitshift));
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 195/583] wifi: rtlwifi: rtl8192ce: using calculate_bit_shift()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (193 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 194/583] wifi: rtlwifi: rtl8192cu: " Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 196/583] wifi: rtlwifi: rtl8192de: " Greg Kroah-Hartman
                   ` (394 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Su Hui, Kalle Valo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Su Hui <suhui@nfschina.com>

[ Upstream commit 3d03e8231031bcc65a48cd88ef9c71b6524ce70b ]

Using calculate_bit_shift() to replace _rtl92c_phy_calculate_bit_shift().
And fix the undefined bitwise shift behavior problem.

Fixes: 0c8173385e54 ("rtl8192ce: Add new driver")
Signed-off-by: Su Hui <suhui@nfschina.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231219065739.1895666-7-suhui@nfschina.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c | 6 +++---
 drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.h | 1 -
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c
index da54e51badd3..fa70a7d5539f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c
@@ -39,7 +39,7 @@ u32 rtl92c_phy_query_rf_reg(struct ieee80211_hw *hw,
 							       rfpath, regaddr);
 	}
 
-	bitshift = _rtl92c_phy_calculate_bit_shift(bitmask);
+	bitshift = calculate_bit_shift(bitmask);
 	readback_value = (original_value & bitmask) >> bitshift;
 
 	spin_unlock(&rtlpriv->locks.rf_lock);
@@ -110,7 +110,7 @@ void rtl92ce_phy_set_rf_reg(struct ieee80211_hw *hw,
 			original_value = _rtl92c_phy_rf_serial_read(hw,
 								    rfpath,
 								    regaddr);
-			bitshift = _rtl92c_phy_calculate_bit_shift(bitmask);
+			bitshift = calculate_bit_shift(bitmask);
 			data =
 			    ((original_value & (~bitmask)) |
 			     (data << bitshift));
@@ -122,7 +122,7 @@ void rtl92ce_phy_set_rf_reg(struct ieee80211_hw *hw,
 			original_value = _rtl92c_phy_fw_rf_serial_read(hw,
 								       rfpath,
 								       regaddr);
-			bitshift = _rtl92c_phy_calculate_bit_shift(bitmask);
+			bitshift = calculate_bit_shift(bitmask);
 			data =
 			    ((original_value & (~bitmask)) |
 			     (data << bitshift));
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.h b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.h
index 7582a162bd11..c7a0d4c776f0 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.h
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.h
@@ -94,7 +94,6 @@ u32 _rtl92c_phy_rf_serial_read(struct ieee80211_hw *hw, enum radio_path rfpath,
 			       u32 offset);
 u32 _rtl92c_phy_fw_rf_serial_read(struct ieee80211_hw *hw,
 				  enum radio_path rfpath, u32 offset);
-u32 _rtl92c_phy_calculate_bit_shift(u32 bitmask);
 void _rtl92c_phy_rf_serial_write(struct ieee80211_hw *hw,
 				 enum radio_path rfpath, u32 offset, u32 data);
 void _rtl92c_phy_fw_rf_serial_write(struct ieee80211_hw *hw,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 196/583] wifi: rtlwifi: rtl8192de: using calculate_bit_shift()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (194 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 195/583] wifi: rtlwifi: rtl8192ce: " Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 197/583] wifi: rtlwifi: rtl8192ee: " Greg Kroah-Hartman
                   ` (393 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Su Hui, Kalle Valo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Su Hui <suhui@nfschina.com>

[ Upstream commit b8b2baad2e652042cf8b6339939ac2f4e6f53de4 ]

Using calculate_bit_shift() to replace _rtl92d_phy_calculate_bit_shift().
And fix the undefined bitwise shift behavior problem.

Fixes: 7274a8c22980 ("rtlwifi: rtl8192de: Merge phy routines")
Signed-off-by: Su Hui <suhui@nfschina.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231219065739.1895666-8-suhui@nfschina.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../net/wireless/realtek/rtlwifi/rtl8192de/phy.c  | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
index d18c092b6142..d835a27429f0 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
@@ -169,13 +169,6 @@ static const u8 channel_all[59] = {
 	157, 159, 161, 163, 165
 };
 
-static u32 _rtl92d_phy_calculate_bit_shift(u32 bitmask)
-{
-	u32 i = ffs(bitmask);
-
-	return i ? i - 1 : 32;
-}
-
 u32 rtl92d_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask)
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
@@ -198,7 +191,7 @@ u32 rtl92d_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask)
 	} else {
 		originalvalue = rtl_read_dword(rtlpriv, regaddr);
 	}
-	bitshift = _rtl92d_phy_calculate_bit_shift(bitmask);
+	bitshift = calculate_bit_shift(bitmask);
 	returnvalue = (originalvalue & bitmask) >> bitshift;
 	rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE,
 		"BBR MASK=0x%x Addr[0x%x]=0x%x\n",
@@ -230,7 +223,7 @@ void rtl92d_phy_set_bb_reg(struct ieee80211_hw *hw,
 					dbi_direct);
 		else
 			originalvalue = rtl_read_dword(rtlpriv, regaddr);
-		bitshift = _rtl92d_phy_calculate_bit_shift(bitmask);
+		bitshift = calculate_bit_shift(bitmask);
 		data = ((originalvalue & (~bitmask)) | (data << bitshift));
 	}
 	if (rtlhal->during_mac1init_radioa || rtlhal->during_mac0init_radiob)
@@ -317,7 +310,7 @@ u32 rtl92d_phy_query_rf_reg(struct ieee80211_hw *hw,
 		regaddr, rfpath, bitmask);
 	spin_lock(&rtlpriv->locks.rf_lock);
 	original_value = _rtl92d_phy_rf_serial_read(hw, rfpath, regaddr);
-	bitshift = _rtl92d_phy_calculate_bit_shift(bitmask);
+	bitshift = calculate_bit_shift(bitmask);
 	readback_value = (original_value & bitmask) >> bitshift;
 	spin_unlock(&rtlpriv->locks.rf_lock);
 	rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE,
@@ -343,7 +336,7 @@ void rtl92d_phy_set_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
 		if (bitmask != RFREG_OFFSET_MASK) {
 			original_value = _rtl92d_phy_rf_serial_read(hw,
 				rfpath, regaddr);
-			bitshift = _rtl92d_phy_calculate_bit_shift(bitmask);
+			bitshift = calculate_bit_shift(bitmask);
 			data = ((original_value & (~bitmask)) |
 				(data << bitshift));
 		}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 197/583] wifi: rtlwifi: rtl8192ee: using calculate_bit_shift()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (195 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 196/583] wifi: rtlwifi: rtl8192de: " Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 198/583] wifi: rtlwifi: rtl8192se: " Greg Kroah-Hartman
                   ` (392 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Su Hui, Kalle Valo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Su Hui <suhui@nfschina.com>

[ Upstream commit 63526897fc0d086069bcab67c3a112caaec751cb ]

Using calculate_bit_shift() to replace _rtl92ee_phy_calculate_bit_shift().
And fix the undefined bitwise shift behavior problem.

Fixes: b1a3bfc97cd9 ("rtlwifi: rtl8192ee: Move driver from staging to the regular tree")
Signed-off-by: Su Hui <suhui@nfschina.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231219065739.1895666-9-suhui@nfschina.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../net/wireless/realtek/rtlwifi/rtl8192ee/phy.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
index cc0bcaf13e96..73ef602bfb01 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
@@ -16,7 +16,6 @@ static u32 _rtl92ee_phy_rf_serial_read(struct ieee80211_hw *hw,
 static void _rtl92ee_phy_rf_serial_write(struct ieee80211_hw *hw,
 					 enum radio_path rfpath, u32 offset,
 					 u32 data);
-static u32 _rtl92ee_phy_calculate_bit_shift(u32 bitmask);
 static bool _rtl92ee_phy_bb8192ee_config_parafile(struct ieee80211_hw *hw);
 static bool _rtl92ee_phy_config_mac_with_headerfile(struct ieee80211_hw *hw);
 static bool phy_config_bb_with_hdr_file(struct ieee80211_hw *hw,
@@ -46,7 +45,7 @@ u32 rtl92ee_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask)
 	rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE,
 		"regaddr(%#x), bitmask(%#x)\n", regaddr, bitmask);
 	originalvalue = rtl_read_dword(rtlpriv, regaddr);
-	bitshift = _rtl92ee_phy_calculate_bit_shift(bitmask);
+	bitshift = calculate_bit_shift(bitmask);
 	returnvalue = (originalvalue & bitmask) >> bitshift;
 
 	rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE,
@@ -68,7 +67,7 @@ void rtl92ee_phy_set_bb_reg(struct ieee80211_hw *hw, u32 regaddr,
 
 	if (bitmask != MASKDWORD) {
 		originalvalue = rtl_read_dword(rtlpriv, regaddr);
-		bitshift = _rtl92ee_phy_calculate_bit_shift(bitmask);
+		bitshift = calculate_bit_shift(bitmask);
 		data = ((originalvalue & (~bitmask)) | (data << bitshift));
 	}
 
@@ -92,7 +91,7 @@ u32 rtl92ee_phy_query_rf_reg(struct ieee80211_hw *hw,
 	spin_lock(&rtlpriv->locks.rf_lock);
 
 	original_value = _rtl92ee_phy_rf_serial_read(hw , rfpath, regaddr);
-	bitshift = _rtl92ee_phy_calculate_bit_shift(bitmask);
+	bitshift = calculate_bit_shift(bitmask);
 	readback_value = (original_value & bitmask) >> bitshift;
 
 	spin_unlock(&rtlpriv->locks.rf_lock);
@@ -119,7 +118,7 @@ void rtl92ee_phy_set_rf_reg(struct ieee80211_hw *hw,
 
 	if (bitmask != RFREG_OFFSET_MASK) {
 		original_value = _rtl92ee_phy_rf_serial_read(hw, rfpath, addr);
-		bitshift = _rtl92ee_phy_calculate_bit_shift(bitmask);
+		bitshift = calculate_bit_shift(bitmask);
 		data = (original_value & (~bitmask)) | (data << bitshift);
 	}
 
@@ -201,13 +200,6 @@ static void _rtl92ee_phy_rf_serial_write(struct ieee80211_hw *hw,
 		pphyreg->rf3wire_offset, data_and_addr);
 }
 
-static u32 _rtl92ee_phy_calculate_bit_shift(u32 bitmask)
-{
-	u32 i = ffs(bitmask);
-
-	return i ? i - 1 : 32;
-}
-
 bool rtl92ee_phy_mac_config(struct ieee80211_hw *hw)
 {
 	return _rtl92ee_phy_config_mac_with_headerfile(hw);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 198/583] wifi: rtlwifi: rtl8192se: using calculate_bit_shift()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (196 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 197/583] wifi: rtlwifi: rtl8192ee: " Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 199/583] wifi: iwlwifi: mvm: set siso/mimo chains to 1 in FW SMPS request Greg Kroah-Hartman
                   ` (391 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Su Hui, Kalle Valo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Su Hui <suhui@nfschina.com>

[ Upstream commit ac32b9317063b101a8ff3d3e885f76f87a280419 ]

Using calculate_bit_shift() to replace _rtl92s_phy_calculate_bit_shift().
And fix the undefined bitwise shift behavior problem.

Fixes: d15853163bea ("rtlwifi: rtl8192se: Merge phy routines")
Signed-off-by: Su Hui <suhui@nfschina.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231219065739.1895666-10-suhui@nfschina.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../net/wireless/realtek/rtlwifi/rtl8192se/phy.c  | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
index 09591a0b5a81..d9ef7e1da1db 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
@@ -14,13 +14,6 @@
 #include "hw.h"
 #include "table.h"
 
-static u32 _rtl92s_phy_calculate_bit_shift(u32 bitmask)
-{
-	u32 i = ffs(bitmask);
-
-	return i ? i - 1 : 32;
-}
-
 u32 rtl92s_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask)
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
@@ -30,7 +23,7 @@ u32 rtl92s_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask)
 		regaddr, bitmask);
 
 	originalvalue = rtl_read_dword(rtlpriv, regaddr);
-	bitshift = _rtl92s_phy_calculate_bit_shift(bitmask);
+	bitshift = calculate_bit_shift(bitmask);
 	returnvalue = (originalvalue & bitmask) >> bitshift;
 
 	rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE, "BBR MASK=0x%x Addr[0x%x]=0x%x\n",
@@ -52,7 +45,7 @@ void rtl92s_phy_set_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask,
 
 	if (bitmask != MASKDWORD) {
 		originalvalue = rtl_read_dword(rtlpriv, regaddr);
-		bitshift = _rtl92s_phy_calculate_bit_shift(bitmask);
+		bitshift = calculate_bit_shift(bitmask);
 		data = ((originalvalue & (~bitmask)) | (data << bitshift));
 	}
 
@@ -157,7 +150,7 @@ u32 rtl92s_phy_query_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
 
 	original_value = _rtl92s_phy_rf_serial_read(hw, rfpath, regaddr);
 
-	bitshift = _rtl92s_phy_calculate_bit_shift(bitmask);
+	bitshift = calculate_bit_shift(bitmask);
 	readback_value = (original_value & bitmask) >> bitshift;
 
 	spin_unlock(&rtlpriv->locks.rf_lock);
@@ -188,7 +181,7 @@ void rtl92s_phy_set_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
 	if (bitmask != RFREG_OFFSET_MASK) {
 		original_value = _rtl92s_phy_rf_serial_read(hw, rfpath,
 							    regaddr);
-		bitshift = _rtl92s_phy_calculate_bit_shift(bitmask);
+		bitshift = calculate_bit_shift(bitmask);
 		data = ((original_value & (~bitmask)) | (data << bitshift));
 	}
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 199/583] wifi: iwlwifi: mvm: set siso/mimo chains to 1 in FW SMPS request
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (197 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 198/583] wifi: rtlwifi: rtl8192se: " Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 200/583] wifi: iwlwifi: mvm: send TX path flush in rfkill Greg Kroah-Hartman
                   ` (390 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Johannes Berg, Luciano Coelho,
	Miri Korenblit, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Johannes Berg <johannes.berg@intel.com>

[ Upstream commit b1a2e5c310e063560760806d2cc5d2233c596067 ]

The firmware changed their mind, don't set the chains to zero,
instead set them to 1 as we normally would for connections to
APs that don't use MIMO.

Fixes: 2a7ce54ccc23 ("iwlwifi: mvm: honour firmware SMPS requests")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20231219215605.7f031f1a127f.Idc816e0f604b07d22a9d5352bc23c445512fad14@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c
index a5b432bc9e2f..9c582e23ebba 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c
@@ -99,17 +99,6 @@ static void iwl_mvm_phy_ctxt_set_rxchain(struct iwl_mvm *mvm,
 		active_cnt = 2;
 	}
 
-	/*
-	 * If the firmware requested it, then we know that it supports
-	 * getting zero for the values to indicate "use one, but pick
-	 * which one yourself", which means it can dynamically pick one
-	 * that e.g. has better RSSI.
-	 */
-	if (mvm->fw_static_smps_request && active_cnt == 1 && idle_cnt == 1) {
-		idle_cnt = 0;
-		active_cnt = 0;
-	}
-
 	*rxchain_info = cpu_to_le32(iwl_mvm_get_valid_rx_ant(mvm) <<
 					PHY_RX_CHAIN_VALID_POS);
 	*rxchain_info |= cpu_to_le32(idle_cnt << PHY_RX_CHAIN_CNT_POS);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 200/583] wifi: iwlwifi: mvm: send TX path flush in rfkill
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (198 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 199/583] wifi: iwlwifi: mvm: set siso/mimo chains to 1 in FW SMPS request Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 201/583] wifi: iwlwifi: fix out of bound copy_from_user Greg Kroah-Hartman
                   ` (389 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Johannes Berg, Gregory Greenman,
	Miri Korenblit, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Johannes Berg <johannes.berg@intel.com>

[ Upstream commit 2afc3dad39ea84a072d04ff40a417234326adc47 ]

If we want to drop packets, that's surely a good thing to
do when we want to enter rfkill. Send this command despite
rfkill so we can successfully clean up everything, we need
to handle it separately since it has CMD_WANT_SKB, so it's
not going to automatically return success when in rfkill.

Fixes: d4e3a341b87b ("iwlwifi: mvm: add support for new flush queue response")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20231219215605.c528a6fa6cec.Ibe5e9560359ccc0fba60c35e01de285c376748a2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
index 177a4628a913..6fdb2c38518e 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
@@ -2236,7 +2236,7 @@ int iwl_mvm_flush_sta_tids(struct iwl_mvm *mvm, u32 sta_id, u16 tids)
 	WARN_ON(!iwl_mvm_has_new_tx_api(mvm));
 
 	if (iwl_fw_lookup_notif_ver(mvm->fw, LONG_GROUP, TXPATH_FLUSH, 0) > 0)
-		cmd.flags |= CMD_WANT_SKB;
+		cmd.flags |= CMD_WANT_SKB | CMD_SEND_IN_RFKILL;
 
 	IWL_DEBUG_TX_QUEUES(mvm, "flush for sta id %d tid mask 0x%x\n",
 			    sta_id, tids);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 201/583] wifi: iwlwifi: fix out of bound copy_from_user
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (199 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 200/583] wifi: iwlwifi: mvm: send TX path flush in rfkill Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 202/583] wifi: iwlwifi: assign phy_ctxt before eSR activation Greg Kroah-Hartman
                   ` (388 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Anjaneyulu, Gregory Greenman,
	Benjamin Berg, Miri Korenblit, Johannes Berg, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>

[ Upstream commit cb2dfacb197bed0241fbb4f84bd0995a47f4465e ]

The driver copies the userspace buffer into an internal NUL
byte terminated buffer. While doing so, it was reading beyond
the end of the userspace buffer, overwriting its own NUL
termination in the process.

Fix this by only copying the correct number of bytes.

Fixes: 3f244876ef73 ("wifi: iwlwifi: make debugfs entries link specific")
Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Reviewed-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20231219215605.e4913deb2ad4.Idcf6a7e909ff4b7801cd49c2f691f84a2f68eff9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index cf27f106d4d5..7057421e513b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -1673,7 +1673,7 @@ static ssize_t _iwl_dbgfs_link_sta_##name##_write(struct file *file,	\
 	char buf[buflen] = {};						\
 	size_t buf_size = min(count, sizeof(buf) -  1);			\
 									\
-	if (copy_from_user(buf, user_buf, sizeof(buf)))			\
+	if (copy_from_user(buf, user_buf, buf_size))			\
 		return -EFAULT;						\
 									\
 	return _iwl_dbgfs_link_sta_wrap_write(iwl_dbgfs_##name##_write,	\
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 202/583] wifi: iwlwifi: assign phy_ctxt before eSR activation
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (200 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 201/583] wifi: iwlwifi: fix out of bound copy_from_user Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 203/583] netfilter: nf_tables: mark newset as dead on transaction abort Greg Kroah-Hartman
                   ` (387 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Gregory Greenman, Miri Korenblit,
	Johannes Berg, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Miri Korenblit <miriam.rachel.korenblit@intel.com>

[ Upstream commit 9b6614e5ead5d19a71893bcca3f1a6569ca0c456 ]

eSR is activated when a chanctx is assigned to more than one link.
During eSR activation we should disable RLC for both phys, and configure
the FW with a special phy command for both phys.
Currently we assign the phy_ctxt to the link only after eSR activation,
so RLC is not disabled for the new phy_ctxt, and a cmd is not sent to FW.
Fix this by first assigning the new phy_ctxt to the link and then
doing the eSR activation.

Fixes: 12bacfc2c065 ("wifi: iwlwifi: handle eSR transitions")
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20231219215605.3d94507f5d9a.I537fcd73aedf94c7348c03157e486f24301fef14@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
index 2ddb6f763a0b..1e58f0234293 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
@@ -269,17 +269,17 @@ __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm,
 		}
 	}
 
+	mvmvif->link[link_id]->phy_ctxt = phy_ctxt;
+
 	if (iwl_mvm_is_esr_supported(mvm->fwrt.trans) && n_active > 1) {
 		mvmvif->link[link_id]->listen_lmac = true;
 		ret = iwl_mvm_esr_mode_active(mvm, vif);
 		if (ret) {
 			IWL_ERR(mvm, "failed to activate ESR mode (%d)\n", ret);
-			return ret;
+			goto out;
 		}
 	}
 
-	mvmvif->link[link_id]->phy_ctxt = phy_ctxt;
-
 	if (switching_chanctx) {
 		/* reactivate if we turned this off during channel switch */
 		if (vif->type == NL80211_IFTYPE_AP)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 203/583] netfilter: nf_tables: mark newset as dead on transaction abort
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (201 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 202/583] wifi: iwlwifi: assign phy_ctxt before eSR activation Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 204/583] netfilter: nf_tables: validate chain type update if available Greg Kroah-Hartman
                   ` (386 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Florian Westphal, Pablo Neira Ayuso,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Florian Westphal <fw@strlen.de>

[ Upstream commit 08e4c8c5919fd405a4d709b4ba43d836894a26eb ]

If a transaction is aborted, we should mark the to-be-released NEWSET dead,
just like commit path does for DEL and DESTROYSET commands.

In both cases all remaining elements will be released via
set->ops->destroy().

The existing abort code does NOT post the actual release to the work queue.
Also the entire __nf_tables_abort() function is wrapped in gc_seq
begin/end pair.

Therefore, async gc worker will never try to release the pending set
elements, as gc sequence is always stale.

It might be possible to speed up transaction aborts via work queue too,
this would result in a race and a possible use-after-free.

So fix this before it becomes an issue.

Fixes: 5f68718b34a5 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/netfilter/nf_tables_api.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 5a14e1ab0b13..24cad36565d7 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -10345,6 +10345,7 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action)
 				nft_trans_destroy(trans);
 				break;
 			}
+			nft_trans_set(trans)->dead = 1;
 			list_del_rcu(&nft_trans_set(trans)->list);
 			break;
 		case NFT_MSG_DELSET:
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 204/583] netfilter: nf_tables: validate chain type update if available
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (202 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 203/583] netfilter: nf_tables: mark newset as dead on transaction abort Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 205/583] Bluetooth: Fix bogus check for re-auth no supported with non-ssp Greg Kroah-Hartman
                   ` (385 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Pablo Neira Ayuso, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pablo Neira Ayuso <pablo@netfilter.org>

[ Upstream commit aaba7ddc8507f4ad5bbd07988573967632bc2385 ]

Parse netlink attribute containing the chain type in this update, to
bail out if this is different from the existing type.

Otherwise, it is possible to define a chain with the same name, hook and
priority but different type, which is silently ignored.

Fixes: 96518518cc41 ("netfilter: add nftables")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/netfilter/nf_tables_api.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 24cad36565d7..5822912045ef 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2263,7 +2263,16 @@ static int nft_chain_parse_hook(struct net *net,
 				return -EOPNOTSUPP;
 		}
 
-		type = basechain->type;
+		if (nla[NFTA_CHAIN_TYPE]) {
+			type = __nf_tables_chain_type_lookup(nla[NFTA_CHAIN_TYPE],
+							     family);
+			if (!type) {
+				NL_SET_BAD_ATTR(extack, nla[NFTA_CHAIN_TYPE]);
+				return -ENOENT;
+			}
+		} else {
+			type = basechain->type;
+		}
 	}
 
 	if (!try_module_get(type->owner)) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 205/583] Bluetooth: Fix bogus check for re-auth no supported with non-ssp
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (203 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 204/583] netfilter: nf_tables: validate chain type update if available Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 206/583] Bluetooth: btnxpuart: fix recv_buf() return value Greg Kroah-Hartman
                   ` (384 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Luiz Augusto von Dentz, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

[ Upstream commit d03376c185926098cb4d668d6458801eb785c0a5 ]

This reverts 19f8def031bfa50c579149b200bfeeb919727b27
"Bluetooth: Fix auth_complete_evt for legacy units" which seems to be
working around a bug on a broken controller rather then any limitation
imposed by the Bluetooth spec, in fact if there ws not possible to
re-auth the command shall fail not succeed.

Fixes: 19f8def031bf ("Bluetooth: Fix auth_complete_evt for legacy units")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/net/bluetooth/hci_core.h |  1 -
 net/bluetooth/hci_conn.c         |  8 +++-----
 net/bluetooth/hci_event.c        | 11 ++---------
 3 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 7a4be33bd07a..b83cfcf66664 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -957,7 +957,6 @@ void hci_inquiry_cache_flush(struct hci_dev *hdev);
 /* ----- HCI Connections ----- */
 enum {
 	HCI_CONN_AUTH_PEND,
-	HCI_CONN_REAUTH_PEND,
 	HCI_CONN_ENCRYPT_PEND,
 	HCI_CONN_RSWITCH_PEND,
 	HCI_CONN_MODE_CHANGE_PEND,
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index f3139c4c20fc..1fdf4b905365 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -2380,12 +2380,10 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
 		hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED,
 			     sizeof(cp), &cp);
 
-		/* If we're already encrypted set the REAUTH_PEND flag,
-		 * otherwise set the ENCRYPT_PEND.
+		/* Set the ENCRYPT_PEND to trigger encryption after
+		 * authentication.
 		 */
-		if (test_bit(HCI_CONN_ENCRYPT, &conn->flags))
-			set_bit(HCI_CONN_REAUTH_PEND, &conn->flags);
-		else
+		if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags))
 			set_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
 	}
 
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index f7ebbbd30218..16e442773229 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3500,14 +3500,8 @@ static void hci_auth_complete_evt(struct hci_dev *hdev, void *data,
 
 	if (!ev->status) {
 		clear_bit(HCI_CONN_AUTH_FAILURE, &conn->flags);
-
-		if (!hci_conn_ssp_enabled(conn) &&
-		    test_bit(HCI_CONN_REAUTH_PEND, &conn->flags)) {
-			bt_dev_info(hdev, "re-auth of legacy device is not possible.");
-		} else {
-			set_bit(HCI_CONN_AUTH, &conn->flags);
-			conn->sec_level = conn->pending_sec_level;
-		}
+		set_bit(HCI_CONN_AUTH, &conn->flags);
+		conn->sec_level = conn->pending_sec_level;
 	} else {
 		if (ev->status == HCI_ERROR_PIN_OR_KEY_MISSING)
 			set_bit(HCI_CONN_AUTH_FAILURE, &conn->flags);
@@ -3516,7 +3510,6 @@ static void hci_auth_complete_evt(struct hci_dev *hdev, void *data,
 	}
 
 	clear_bit(HCI_CONN_AUTH_PEND, &conn->flags);
-	clear_bit(HCI_CONN_REAUTH_PEND, &conn->flags);
 
 	if (conn->state == BT_CONFIG) {
 		if (!ev->status && hci_conn_ssp_enabled(conn)) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 206/583] Bluetooth: btnxpuart: fix recv_buf() return value
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (204 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 205/583] Bluetooth: Fix bogus check for re-auth no supported with non-ssp Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 207/583] Bluetooth: btmtkuart: " Greg Kroah-Hartman
                   ` (383 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Francesco Dolcini,
	Luiz Augusto von Dentz, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Francesco Dolcini <francesco.dolcini@toradex.com>

[ Upstream commit 94d05394254401e503867c16aff561d3e687dfdc ]

Serdev recv_buf() callback is supposed to return the amount of bytes
consumed, therefore an int in between 0 and count.

Do not return a negative number in case of issue, just print an error
and return count. Before this change, in case of error, the returned
negative number was internally converted to 0 in ttyport_receive_buf,
now when the receive buffer is corrupted we return the size of the whole
received data (`count`). This should allow for better recovery in case
receiver/transmitter get out of sync if some data is lost.

This fixes a WARN in ttyport_receive_buf().

  Bluetooth: hci0: Frame reassembly failed (-84)
  ------------[ cut here ]------------
  serial serial0: receive_buf returns -84 (count = 6)
  WARNING: CPU: 0 PID: 37 at drivers/tty/serdev/serdev-ttyport.c:37 ttyport_receive_buf+0xd8/0xf8
  Modules linked in: mwifiex_sdio(+) ...
  CPU: 0 PID: 37 Comm: kworker/u4:2 Not tainted 6.7.0-rc2-00147-gf1a09972a45a #1
  Hardware name: Toradex Verdin AM62 WB on Verdin Development Board (DT)
  Workqueue: events_unbound flush_to_ldisc
  pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
  pc : ttyport_receive_buf+0xd8/0xf8
  lr : ttyport_receive_buf+0xd8/0xf8
...
  Call trace:
   ttyport_receive_buf+0xd8/0xf8
   flush_to_ldisc+0xbc/0x1a4
   process_scheduled_works+0x16c/0x28c

Closes: https://lore.kernel.org/all/ZWEIhcUXfutb5SY6@francesco-nb.int.toradex.com/
Fixes: 689ca16e5232 ("Bluetooth: NXP: Add protocol support for NXP Bluetooth chipsets")
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/bluetooth/btnxpuart.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
index b7e66b7ac570..951fe3014a3f 100644
--- a/drivers/bluetooth/btnxpuart.c
+++ b/drivers/bluetooth/btnxpuart.c
@@ -1276,11 +1276,10 @@ static int btnxpuart_receive_buf(struct serdev_device *serdev, const u8 *data,
 	if (IS_ERR(nxpdev->rx_skb)) {
 		int err = PTR_ERR(nxpdev->rx_skb);
 		/* Safe to ignore out-of-sync bootloader signatures */
-		if (is_fw_downloading(nxpdev))
-			return count;
-		bt_dev_err(nxpdev->hdev, "Frame reassembly failed (%d)", err);
+		if (!is_fw_downloading(nxpdev))
+			bt_dev_err(nxpdev->hdev, "Frame reassembly failed (%d)", err);
 		nxpdev->rx_skb = NULL;
-		return err;
+		return count;
 	}
 	if (!is_fw_downloading(nxpdev))
 		nxpdev->hdev->stat.byte_rx += count;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 207/583] Bluetooth: btmtkuart: fix recv_buf() return value
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (205 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 206/583] Bluetooth: btnxpuart: fix recv_buf() return value Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 208/583] null_blk: dont cap max_hw_sectors to BLK_DEF_MAX_SECTORS Greg Kroah-Hartman
                   ` (382 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Francesco Dolcini,
	Luiz Augusto von Dentz, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Francesco Dolcini <francesco.dolcini@toradex.com>

[ Upstream commit 64057f051f20c2a2184b9db7f8037d928d68a4f4 ]

Serdev recv_buf() callback is supposed to return the amount of bytes
consumed, therefore an int in between 0 and count.

Do not return negative number in case of issue, just print an error and
return count. This fixes a WARN in ttyport_receive_buf().

Link: https://lore.kernel.org/all/087be419-ec6b-47ad-851a-5e1e3ea5cfcc@kernel.org/
Fixes: 7237c4c9ec92 ("Bluetooth: mediatek: Add protocol support for MediaTek serial devices")
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/bluetooth/btmtkuart.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/bluetooth/btmtkuart.c b/drivers/bluetooth/btmtkuart.c
index 935feab815d9..203a000a84e3 100644
--- a/drivers/bluetooth/btmtkuart.c
+++ b/drivers/bluetooth/btmtkuart.c
@@ -336,7 +336,7 @@ mtk_stp_split(struct btmtkuart_dev *bdev, const unsigned char *data, int count,
 	return data;
 }
 
-static int btmtkuart_recv(struct hci_dev *hdev, const u8 *data, size_t count)
+static void btmtkuart_recv(struct hci_dev *hdev, const u8 *data, size_t count)
 {
 	struct btmtkuart_dev *bdev = hci_get_drvdata(hdev);
 	const unsigned char *p_left = data, *p_h4;
@@ -375,25 +375,20 @@ static int btmtkuart_recv(struct hci_dev *hdev, const u8 *data, size_t count)
 			bt_dev_err(bdev->hdev,
 				   "Frame reassembly failed (%d)", err);
 			bdev->rx_skb = NULL;
-			return err;
+			return;
 		}
 
 		sz_left -= sz_h4;
 		p_left += sz_h4;
 	}
-
-	return 0;
 }
 
 static int btmtkuart_receive_buf(struct serdev_device *serdev, const u8 *data,
 				 size_t count)
 {
 	struct btmtkuart_dev *bdev = serdev_device_get_drvdata(serdev);
-	int err;
 
-	err = btmtkuart_recv(bdev->hdev, data, count);
-	if (err < 0)
-		return err;
+	btmtkuart_recv(bdev->hdev, data, count);
 
 	bdev->hdev->stat.byte_rx += count;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 208/583] null_blk: dont cap max_hw_sectors to BLK_DEF_MAX_SECTORS
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (206 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 207/583] Bluetooth: btmtkuart: " Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 209/583] arm64: dts: rockchip: Fix led pinctrl of lubancat 1 Greg Kroah-Hartman
                   ` (381 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Jens Axboe, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christoph Hellwig <hch@lst.de>

[ Upstream commit 9a9525de865410047fa962867b4fcd33943b206f ]

null_blk has some rather odd capping of the max_hw_sectors value to
BLK_DEF_MAX_SECTORS, which doesn't make sense - max_hw_sector is the
hardware limit, and BLK_DEF_MAX_SECTORS despite the confusing name is the
default cap for the max_sectors field used for normal file system I/O.

Remove all the capping, and simply leave it to the block layer or
user to take up or not all of that for file system I/O.

Fixes: ea17fd354ca8 ("null_blk: Allow controlling max_hw_sectors limit")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20231227092305.279567-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/block/null_blk/main.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index 968090935eb2..9544746de168 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -2165,10 +2165,8 @@ static int null_add_dev(struct nullb_device *dev)
 
 	blk_queue_logical_block_size(nullb->q, dev->blocksize);
 	blk_queue_physical_block_size(nullb->q, dev->blocksize);
-	if (!dev->max_sectors)
-		dev->max_sectors = queue_max_hw_sectors(nullb->q);
-	dev->max_sectors = min(dev->max_sectors, BLK_DEF_MAX_SECTORS);
-	blk_queue_max_hw_sectors(nullb->q, dev->max_sectors);
+	if (dev->max_sectors)
+		blk_queue_max_hw_sectors(nullb->q, dev->max_sectors);
 
 	if (dev->virt_boundary)
 		blk_queue_virt_boundary(nullb->q, PAGE_SIZE - 1);
@@ -2268,12 +2266,6 @@ static int __init null_init(void)
 		g_bs = PAGE_SIZE;
 	}
 
-	if (g_max_sectors > BLK_DEF_MAX_SECTORS) {
-		pr_warn("invalid max sectors\n");
-		pr_warn("defaults max sectors to %u\n", BLK_DEF_MAX_SECTORS);
-		g_max_sectors = BLK_DEF_MAX_SECTORS;
-	}
-
 	if (g_home_node != NUMA_NO_NODE && g_home_node >= nr_online_nodes) {
 		pr_err("invalid home_node value\n");
 		g_home_node = NUMA_NO_NODE;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 209/583] arm64: dts: rockchip: Fix led pinctrl of lubancat 1
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (207 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 208/583] null_blk: dont cap max_hw_sectors to BLK_DEF_MAX_SECTORS Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 210/583] wifi: cfg80211: correct comment about MLD ID Greg Kroah-Hartman
                   ` (380 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Zhang Ning, Andy Yan,
	Heiko Stuebner, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Andy Yan <andyshrk@163.com>

[ Upstream commit 8586a5d217ef7bfeee24943c600a8a7890d6f477 ]

According to the schematics, the gpio control sys_led is GPIO0_C5.

Fixes: 8d94da58de53 ("arm64: dts: rockchip: Add EmbedFire LubanCat 1")
Reported-by: Zhang Ning <zhangn1985@outlook.com>
Closes: https://lore.kernel.org/linux-rockchip/OS0P286MB06412D049D8BF7B063D41350CD95A@OS0P286MB0641.JPNP286.PROD.OUTLOOK.COM/T/#u
Signed-off-by: Andy Yan <andyshrk@163.com>
Link: https://lore.kernel.org/r/20231225005055.3102743-1-andyshrk@163.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/boot/dts/rockchip/rk3566-lubancat-1.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3566-lubancat-1.dts b/arch/arm64/boot/dts/rockchip/rk3566-lubancat-1.dts
index 1c6d83b47cd2..6ecdf5d28339 100644
--- a/arch/arm64/boot/dts/rockchip/rk3566-lubancat-1.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3566-lubancat-1.dts
@@ -455,7 +455,7 @@ &pcie2x1 {
 &pinctrl {
 	leds {
 		sys_led_pin: sys-status-led-pin {
-			rockchip,pins = <0 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
+			rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 	};
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 210/583] wifi: cfg80211: correct comment about MLD ID
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (208 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 209/583] arm64: dts: rockchip: Fix led pinctrl of lubancat 1 Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 211/583] wifi: cfg80211: parse all ML elements in an ML probe response Greg Kroah-Hartman
                   ` (379 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Benjamin Berg, Miri Korenblit,
	Johannes Berg, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Benjamin Berg <benjamin.berg@intel.com>

[ Upstream commit 2a0698f86d4dfc43cc0c1703efb7ba6b1506a4e2 ]

The comment was referencing the wrong section of the documentation and
was also subtly wrong as it assumed the rules that apply when sending
probe requests directly to a nontransmitted AP. However, in that case
the response comes from the transmitting AP and the AP MLD ID will be
included.

Fixes: 2481b5da9c6b ("wifi: cfg80211: handle BSS data contained in ML probe responses")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240102213313.0917ab4b5d7f.I76aff0e261a5de44ffb467e591a46597a30d7c0a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/wireless/scan.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index e4cc6209c7b9..a7d7469b10a4 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -2625,8 +2625,11 @@ static void cfg80211_parse_ml_sta_data(struct wiphy *wiphy,
 	/* MLD capabilities and operations */
 	pos += 2;
 
-	/* Not included when the (nontransmitted) AP is responding itself,
-	 * but defined to zero then (Draft P802.11be_D3.0, 9.4.2.170.2)
+	/*
+	 * The MLD ID of the reporting AP is always zero. It is set if the AP
+	 * is part of an MBSSID set and will be non-zero for ML Elements
+	 * relating to a nontransmitted BSS (matching the Multi-BSSID Index,
+	 * Draft P802.11be_D3.2, 35.3.4.2)
 	 */
 	if (u16_get_bits(control, IEEE80211_MLC_BASIC_PRES_MLD_ID)) {
 		mld_id = *pos;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 211/583] wifi: cfg80211: parse all ML elements in an ML probe response
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (209 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 210/583] wifi: cfg80211: correct comment about MLD ID Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 212/583] bpf: sockmap, fix proto update hook to avoid dup calls Greg Kroah-Hartman
                   ` (378 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Benjamin Berg, Miri Korenblit,
	Johannes Berg, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Benjamin Berg <benjamin.berg@intel.com>

[ Upstream commit d18125b640309e925441ce49559be33867ae6b29 ]

A probe response from a transmitting AP in an Multi-BSSID setup will
contain more than one Multi-Link element. Most likely, only one of these
elements contains per-STA profiles.

Fixes: 2481b5da9c6b ("wifi: cfg80211: handle BSS data contained in ML probe responses")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240102213313.6635eb152735.I94289002d4a2f7b6b44dfa428344854e37b0b29c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/wireless/scan.c | 40 ++++++++++++++++++++++++++--------------
 1 file changed, 26 insertions(+), 14 deletions(-)

diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index a7d7469b10a4..bd4dd75e446e 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -2569,10 +2569,12 @@ cfg80211_tbtt_info_for_mld_ap(const u8 *ie, size_t ielen, u8 mld_id, u8 link_id,
 	return false;
 }
 
-static void cfg80211_parse_ml_sta_data(struct wiphy *wiphy,
-				       struct cfg80211_inform_single_bss_data *tx_data,
-				       struct cfg80211_bss *source_bss,
-				       gfp_t gfp)
+static void
+cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy,
+				struct cfg80211_inform_single_bss_data *tx_data,
+				struct cfg80211_bss *source_bss,
+				const struct element *elem,
+				gfp_t gfp)
 {
 	struct cfg80211_inform_single_bss_data data = {
 		.drv_data = tx_data->drv_data,
@@ -2581,7 +2583,6 @@ static void cfg80211_parse_ml_sta_data(struct wiphy *wiphy,
 		.bss_source = BSS_SOURCE_STA_PROFILE,
 	};
 	struct ieee80211_multi_link_elem *ml_elem;
-	const struct element *elem;
 	struct cfg80211_mle *mle;
 	u16 control;
 	u8 *new_ie;
@@ -2591,15 +2592,7 @@ static void cfg80211_parse_ml_sta_data(struct wiphy *wiphy,
 	const u8 *pos;
 	u8 i;
 
-	if (!source_bss)
-		return;
-
-	if (tx_data->ftype != CFG80211_BSS_FTYPE_PRESP)
-		return;
-
-	elem = cfg80211_find_ext_elem(WLAN_EID_EXT_EHT_MULTI_LINK,
-				      tx_data->ie, tx_data->ielen);
-	if (!elem || !ieee80211_mle_size_ok(elem->data + 1, elem->datalen - 1))
+	if (!ieee80211_mle_size_ok(elem->data + 1, elem->datalen - 1))
 		return;
 
 	ml_elem = (void *)elem->data + 1;
@@ -2734,6 +2727,25 @@ static void cfg80211_parse_ml_sta_data(struct wiphy *wiphy,
 	kfree(mle);
 }
 
+static void cfg80211_parse_ml_sta_data(struct wiphy *wiphy,
+				       struct cfg80211_inform_single_bss_data *tx_data,
+				       struct cfg80211_bss *source_bss,
+				       gfp_t gfp)
+{
+	const struct element *elem;
+
+	if (!source_bss)
+		return;
+
+	if (tx_data->ftype != CFG80211_BSS_FTYPE_PRESP)
+		return;
+
+	for_each_element_extid(elem, WLAN_EID_EXT_EHT_MULTI_LINK,
+			       tx_data->ie, tx_data->ielen)
+		cfg80211_parse_ml_elem_sta_data(wiphy, tx_data, source_bss,
+						elem, gfp);
+}
+
 struct cfg80211_bss *
 cfg80211_inform_bss_data(struct wiphy *wiphy,
 			 struct cfg80211_inform_bss *data,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 212/583] bpf: sockmap, fix proto update hook to avoid dup calls
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (210 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 211/583] wifi: cfg80211: parse all ML elements in an ML probe response Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 213/583] sctp: support MSG_ERRQUEUE flag in recvmsg() Greg Kroah-Hartman
                   ` (377 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Xingwei Lee, John Fastabend,
	Martin KaFai Lau, Jakub Sitnicki, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: John Fastabend <john.fastabend@gmail.com>

[ Upstream commit 16b2f264983dc264c1560cc0170e760dec1bf54f ]

When sockets are added to a sockmap or sockhash we allocate and init a
psock. Then update the proto ops with sock_map_init_proto the flow is

  sock_hash_update_common
    sock_map_link
      psock = sock_map_psock_get_checked() <-returns existing psock
      sock_map_init_proto(sk, psock)       <- updates sk_proto

If the socket is already in a map this results in the sock_map_init_proto
being called multiple times on the same socket. We do this because when
a socket is added to multiple maps this might result in a new set of BPF
programs being attached to the socket requiring an updated ops struct.

This creates a rule where it must be safe to call psock_update_sk_prot
multiple times. When we added a fix for UAF through unix sockets in patch
4dd9a38a753fc we broke this rule by adding a sock_hold in that path
to ensure the sock is not released. The result is if a af_unix stream sock
is placed in multiple maps it results in a memory leak because we call
sock_hold multiple times with only a single sock_put on it.

Fixes: 8866730aed51 ("bpf, sockmap: af_unix stream sockets need to hold ref for pair sock")
Reported-by: Xingwei Lee <xrivendell7@gmail.com>
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/r/20231221232327.43678-2-john.fastabend@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/unix/unix_bpf.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/net/unix/unix_bpf.c b/net/unix/unix_bpf.c
index 7ea7c3a0d0d0..bd84785bf8d6 100644
--- a/net/unix/unix_bpf.c
+++ b/net/unix/unix_bpf.c
@@ -161,15 +161,30 @@ int unix_stream_bpf_update_proto(struct sock *sk, struct sk_psock *psock, bool r
 {
 	struct sock *sk_pair;
 
+	/* Restore does not decrement the sk_pair reference yet because we must
+	 * keep the a reference to the socket until after an RCU grace period
+	 * and any pending sends have completed.
+	 */
 	if (restore) {
 		sk->sk_write_space = psock->saved_write_space;
 		sock_replace_proto(sk, psock->sk_proto);
 		return 0;
 	}
 
-	sk_pair = unix_peer(sk);
-	sock_hold(sk_pair);
-	psock->sk_pair = sk_pair;
+	/* psock_update_sk_prot can be called multiple times if psock is
+	 * added to multiple maps and/or slots in the same map. There is
+	 * also an edge case where replacing a psock with itself can trigger
+	 * an extra psock_update_sk_prot during the insert process. So it
+	 * must be safe to do multiple calls. Here we need to ensure we don't
+	 * increment the refcnt through sock_hold many times. There will only
+	 * be a single matching destroy operation.
+	 */
+	if (!psock->sk_pair) {
+		sk_pair = unix_peer(sk);
+		sock_hold(sk_pair);
+		psock->sk_pair = sk_pair;
+	}
+
 	unix_stream_bpf_check_needs_rebuild(psock->sk_proto);
 	sock_replace_proto(sk, &unix_stream_bpf_prot);
 	return 0;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 213/583] sctp: support MSG_ERRQUEUE flag in recvmsg()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (211 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 212/583] bpf: sockmap, fix proto update hook to avoid dup calls Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 214/583] sctp: fix busy polling Greg Kroah-Hartman
                   ` (376 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Eric Dumazet,
	Marcelo Ricardo Leitner, Willem de Bruijn, Xin Long,
	Jakub Kicinski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 4746b36b1abe11ca32987b2d21e1e770deab17cc ]

For some reason sctp_poll() generates EPOLLERR if sk->sk_error_queue
is not empty but recvmsg() can not drain the error queue yet.

This is needed to better support timestamping.

I had to export inet_recv_error(), since sctp
can be compiled as a module.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Cc: Willem de Bruijn <willemb@google.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://lore.kernel.org/r/20231212145550.3872051-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: a562c0a2d651 ("sctp: fix busy polling")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv4/af_inet.c | 1 +
 net/sctp/socket.c  | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 2713c9b06c4c..b0a5de1303b5 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1632,6 +1632,7 @@ int inet_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
 #endif
 	return -EINVAL;
 }
+EXPORT_SYMBOL(inet_recv_error);
 
 int inet_gro_complete(struct sk_buff *skb, int nhoff)
 {
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 7f89e43154c0..5fb02bbb4b34 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -2099,6 +2099,9 @@ static int sctp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
 	pr_debug("%s: sk:%p, msghdr:%p, len:%zd, flags:0x%x, addr_len:%p)\n",
 		 __func__, sk, msg, len, flags, addr_len);
 
+	if (unlikely(flags & MSG_ERRQUEUE))
+		return inet_recv_error(sk, msg, len, addr_len);
+
 	lock_sock(sk);
 
 	if (sctp_style(sk, TCP) && !sctp_sstate(sk, ESTABLISHED) &&
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 214/583] sctp: fix busy polling
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (212 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 213/583] sctp: support MSG_ERRQUEUE flag in recvmsg() Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 215/583] blk-cgroup: fix rcu lockdep warning in blkg_lookup() Greg Kroah-Hartman
                   ` (375 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jacob Moroni, Eric Dumazet,
	Marcelo Ricardo Leitner, Xin Long, David S. Miller, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit a562c0a2d651e040681b0bfce9b4d229ac3b0b8c ]

Busy polling while holding the socket lock makes litle sense,
because incoming packets wont reach our receive queue.

Fixes: 8465a5fcd1ce ("sctp: add support for busy polling to sctp protocol")
Reported-by: Jacob Moroni <jmoroni@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Cc: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/sctp/socket.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 5fb02bbb4b34..6b9fcdb0952a 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -2102,6 +2102,10 @@ static int sctp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
 	if (unlikely(flags & MSG_ERRQUEUE))
 		return inet_recv_error(sk, msg, len, addr_len);
 
+	if (sk_can_busy_loop(sk) &&
+	    skb_queue_empty_lockless(&sk->sk_receive_queue))
+		sk_busy_loop(sk, flags & MSG_DONTWAIT);
+
 	lock_sock(sk);
 
 	if (sctp_style(sk, TCP) && !sctp_sstate(sk, ESTABLISHED) &&
@@ -9046,12 +9050,6 @@ struct sk_buff *sctp_skb_recv_datagram(struct sock *sk, int flags, int *err)
 		if (sk->sk_shutdown & RCV_SHUTDOWN)
 			break;
 
-		if (sk_can_busy_loop(sk)) {
-			sk_busy_loop(sk, flags & MSG_DONTWAIT);
-
-			if (!skb_queue_empty_lockless(&sk->sk_receive_queue))
-				continue;
-		}
 
 		/* User doesn't want to wait.  */
 		error = -EAGAIN;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 215/583] blk-cgroup: fix rcu lockdep warning in blkg_lookup()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (213 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 214/583] sctp: fix busy polling Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 216/583] net/sched: act_ct: fix skb leak and crash on ooo frags Greg Kroah-Hartman
                   ` (374 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Changhui Zhong, Ming Lei, Yu Kuai,
	Tejun Heo, Jens Axboe, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ming Lei <ming.lei@redhat.com>

[ Upstream commit 393cd8ffd832f23eec3a105553eff622e8198918 ]

blkg_lookup() is called with either queue_lock or rcu read lock, so
use rcu_dereference_check(lockdep_is_held(&q->queue_lock)) for
retrieving 'blkg', which way models the check exactly for covering
queue lock or rcu read lock.

Fix lockdep warning of "block/blk-cgroup.h:254 suspicious rcu_dereference_check() usage!"
from blkg_lookup().

Tested-by: Changhui Zhong <czhong@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Fixes: 83462a6c971c ("blkcg: Drop unnecessary RCU read [un]locks from blkg_conf_prep/finish()")
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20231219012833.2129540-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 block/blk-cgroup.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
index fd482439afbc..b927a4a0ad03 100644
--- a/block/blk-cgroup.h
+++ b/block/blk-cgroup.h
@@ -252,7 +252,8 @@ static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg,
 	if (blkcg == &blkcg_root)
 		return q->root_blkg;
 
-	blkg = rcu_dereference(blkcg->blkg_hint);
+	blkg = rcu_dereference_check(blkcg->blkg_hint,
+			lockdep_is_held(&q->queue_lock));
 	if (blkg && blkg->q == q)
 		return blkg;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 216/583] net/sched: act_ct: fix skb leak and crash on ooo frags
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (214 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 215/583] blk-cgroup: fix rcu lockdep warning in blkg_lookup() Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 217/583] mlxbf_gige: Fix intermittent no ip issue Greg Kroah-Hartman
                   ` (373 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Tao Liu, Jakub Kicinski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tao Liu <taoliu828@163.com>

[ Upstream commit 3f14b377d01d8357eba032b4cabc8c1149b458b6 ]

act_ct adds skb->users before defragmentation. If frags arrive in order,
the last frag's reference is reset in:

  inet_frag_reasm_prepare
    skb_morph

which is not straightforward.

However when frags arrive out of order, nobody unref the last frag, and
all frags are leaked. The situation is even worse, as initiating packet
capture can lead to a crash[0] when skb has been cloned and shared at the
same time.

Fix the issue by removing skb_get() before defragmentation. act_ct
returns TC_ACT_CONSUMED when defrag failed or in progress.

[0]:
[  843.804823] ------------[ cut here ]------------
[  843.809659] kernel BUG at net/core/skbuff.c:2091!
[  843.814516] invalid opcode: 0000 [#1] PREEMPT SMP
[  843.819296] CPU: 7 PID: 0 Comm: swapper/7 Kdump: loaded Tainted: G S 6.7.0-rc3 #2
[  843.824107] Hardware name: XFUSION 1288H V6/BC13MBSBD, BIOS 1.29 11/25/2022
[  843.828953] RIP: 0010:pskb_expand_head+0x2ac/0x300
[  843.833805] Code: 8b 70 28 48 85 f6 74 82 48 83 c6 08 bf 01 00 00 00 e8 38 bd ff ff 8b 83 c0 00 00 00 48 03 83 c8 00 00 00 e9 62 ff ff ff 0f 0b <0f> 0b e8 8d d0 ff ff e9 b3 fd ff ff 81 7c 24 14 40 01 00 00 4c 89
[  843.843698] RSP: 0018:ffffc9000cce07c0 EFLAGS: 00010202
[  843.848524] RAX: 0000000000000002 RBX: ffff88811a211d00 RCX: 0000000000000820
[  843.853299] RDX: 0000000000000640 RSI: 0000000000000000 RDI: ffff88811a211d00
[  843.857974] RBP: ffff888127d39518 R08: 00000000bee97314 R09: 0000000000000000
[  843.862584] R10: 0000000000000000 R11: ffff8881109f0000 R12: 0000000000000880
[  843.867147] R13: ffff888127d39580 R14: 0000000000000640 R15: ffff888170f7b900
[  843.871680] FS:  0000000000000000(0000) GS:ffff889ffffc0000(0000) knlGS:0000000000000000
[  843.876242] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  843.880778] CR2: 00007fa42affcfb8 CR3: 000000011433a002 CR4: 0000000000770ef0
[  843.885336] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  843.889809] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  843.894229] PKRU: 55555554
[  843.898539] Call Trace:
[  843.902772]  <IRQ>
[  843.906922]  ? __die_body+0x1e/0x60
[  843.911032]  ? die+0x3c/0x60
[  843.915037]  ? do_trap+0xe2/0x110
[  843.918911]  ? pskb_expand_head+0x2ac/0x300
[  843.922687]  ? do_error_trap+0x65/0x80
[  843.926342]  ? pskb_expand_head+0x2ac/0x300
[  843.929905]  ? exc_invalid_op+0x50/0x60
[  843.933398]  ? pskb_expand_head+0x2ac/0x300
[  843.936835]  ? asm_exc_invalid_op+0x1a/0x20
[  843.940226]  ? pskb_expand_head+0x2ac/0x300
[  843.943580]  inet_frag_reasm_prepare+0xd1/0x240
[  843.946904]  ip_defrag+0x5d4/0x870
[  843.950132]  nf_ct_handle_fragments+0xec/0x130 [nf_conntrack]
[  843.953334]  tcf_ct_act+0x252/0xd90 [act_ct]
[  843.956473]  ? tcf_mirred_act+0x516/0x5a0 [act_mirred]
[  843.959657]  tcf_action_exec+0xa1/0x160
[  843.962823]  fl_classify+0x1db/0x1f0 [cls_flower]
[  843.966010]  ? skb_clone+0x53/0xc0
[  843.969173]  tcf_classify+0x24d/0x420
[  843.972333]  tc_run+0x8f/0xf0
[  843.975465]  __netif_receive_skb_core+0x67a/0x1080
[  843.978634]  ? dev_gro_receive+0x249/0x730
[  843.981759]  __netif_receive_skb_list_core+0x12d/0x260
[  843.984869]  netif_receive_skb_list_internal+0x1cb/0x2f0
[  843.987957]  ? mlx5e_handle_rx_cqe_mpwrq_rep+0xfa/0x1a0 [mlx5_core]
[  843.991170]  napi_complete_done+0x72/0x1a0
[  843.994305]  mlx5e_napi_poll+0x28c/0x6d0 [mlx5_core]
[  843.997501]  __napi_poll+0x25/0x1b0
[  844.000627]  net_rx_action+0x256/0x330
[  844.003705]  __do_softirq+0xb3/0x29b
[  844.006718]  irq_exit_rcu+0x9e/0xc0
[  844.009672]  common_interrupt+0x86/0xa0
[  844.012537]  </IRQ>
[  844.015285]  <TASK>
[  844.017937]  asm_common_interrupt+0x26/0x40
[  844.020591] RIP: 0010:acpi_safe_halt+0x1b/0x20
[  844.023247] Code: ff 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 65 48 8b 04 25 00 18 03 00 48 8b 00 a8 08 75 0c 66 90 0f 00 2d 81 d0 44 00 fb f4 <fa> c3 0f 1f 00 89 fa ec 48 8b 05 ee 88 ed 00 a9 00 00 00 80 75 11
[  844.028900] RSP: 0018:ffffc90000533e70 EFLAGS: 00000246
[  844.031725] RAX: 0000000000004000 RBX: 0000000000000001 RCX: 0000000000000000
[  844.034553] RDX: ffff889ffffc0000 RSI: ffffffff828b7f20 RDI: ffff88a090f45c64
[  844.037368] RBP: ffff88a0901a2800 R08: ffff88a090f45c00 R09: 00000000000317c0
[  844.040155] R10: 00ec812281150475 R11: ffff889fffff0e04 R12: ffffffff828b7fa0
[  844.042962] R13: ffffffff828b7f20 R14: 0000000000000001 R15: 0000000000000000
[  844.045819]  acpi_idle_enter+0x7b/0xc0
[  844.048621]  cpuidle_enter_state+0x7f/0x430
[  844.051451]  cpuidle_enter+0x2d/0x40
[  844.054279]  do_idle+0x1d4/0x240
[  844.057096]  cpu_startup_entry+0x2a/0x30
[  844.059934]  start_secondary+0x104/0x130
[  844.062787]  secondary_startup_64_no_verify+0x16b/0x16b
[  844.065674]  </TASK>

Fixes: b57dc7c13ea9 ("net/sched: Introduce action ct")
Signed-off-by: Tao Liu <taoliu828@163.com>
Link: https://lore.kernel.org/r/20231228081457.936732-1-taoliu828@163.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/sched/act_ct.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c
index dd710fb9f490..a7b3f60dd0a8 100644
--- a/net/sched/act_ct.c
+++ b/net/sched/act_ct.c
@@ -851,7 +851,6 @@ static int tcf_ct_handle_fragments(struct net *net, struct sk_buff *skb,
 	if (err || !frag)
 		return err;
 
-	skb_get(skb);
 	err = nf_ct_handle_fragments(net, skb, zone, family, &proto, &mru);
 	if (err)
 		return err;
@@ -995,12 +994,8 @@ TC_INDIRECT_SCOPE int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a,
 	nh_ofs = skb_network_offset(skb);
 	skb_pull_rcsum(skb, nh_ofs);
 	err = tcf_ct_handle_fragments(net, skb, family, p->zone, &defrag);
-	if (err == -EINPROGRESS) {
-		retval = TC_ACT_STOLEN;
-		goto out_clear;
-	}
 	if (err)
-		goto drop;
+		goto out_frag;
 
 	err = nf_ct_skb_network_trim(skb, family);
 	if (err)
@@ -1087,6 +1082,11 @@ TC_INDIRECT_SCOPE int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a,
 		qdisc_skb_cb(skb)->pkt_len = skb->len;
 	return retval;
 
+out_frag:
+	if (err != -EINPROGRESS)
+		tcf_action_inc_drop_qstats(&c->common);
+	return TC_ACT_CONSUMED;
+
 drop:
 	tcf_action_inc_drop_qstats(&c->common);
 	return TC_ACT_SHOT;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 217/583] mlxbf_gige: Fix intermittent no ip issue
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (215 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 216/583] net/sched: act_ct: fix skb leak and crash on ooo frags Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 218/583] mlxbf_gige: Enable the GigE port in mlxbf_gige_open Greg Kroah-Hartman
                   ` (372 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, David Thompson, Asmaa Mnebhi,
	David S. Miller, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Asmaa Mnebhi <asmaa@nvidia.com>

[ Upstream commit ef210ef85d5cb543ce34a57803ed856d0c8c08c2 ]

Although the link is up, there is no ip assigned on setups with high background
traffic. Nothing is transmitted nor received. The RX error count keeps on
increasing. After several minutes, the RX error count stagnates and the
GigE interface finally gets an ip.

The issue is that mlxbf_gige_rx_init() is called before phy_start().
As soon as the RX DMA is enabled in mlxbf_gige_rx_init(), the RX CI reaches the max
of 128, and becomes equal to RX PI. RX CI doesn't decrease since the code hasn't
ran phy_start yet.
Bring the PHY up before starting the RX.

Fixes: f92e1869d74e ("Add Mellanox BlueField Gigabit Ethernet driver")
Reviewed-by: David Thompson <davthompson@nvidia.com>
Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 14 +++++++-------
 .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c   |  6 +++---
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
index 694de9513b9f..7d132a132a29 100644
--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
@@ -147,14 +147,14 @@ static int mlxbf_gige_open(struct net_device *netdev)
 	 */
 	priv->valid_polarity = 0;
 
-	err = mlxbf_gige_rx_init(priv);
+	phy_start(phydev);
+
+	err = mlxbf_gige_tx_init(priv);
 	if (err)
 		goto free_irqs;
-	err = mlxbf_gige_tx_init(priv);
+	err = mlxbf_gige_rx_init(priv);
 	if (err)
-		goto rx_deinit;
-
-	phy_start(phydev);
+		goto tx_deinit;
 
 	netif_napi_add(netdev, &priv->napi, mlxbf_gige_poll);
 	napi_enable(&priv->napi);
@@ -176,8 +176,8 @@ static int mlxbf_gige_open(struct net_device *netdev)
 
 	return 0;
 
-rx_deinit:
-	mlxbf_gige_rx_deinit(priv);
+tx_deinit:
+	mlxbf_gige_tx_deinit(priv);
 
 free_irqs:
 	mlxbf_gige_free_irqs(priv);
diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c
index 227d01cace3f..699984358493 100644
--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c
+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c
@@ -142,6 +142,9 @@ int mlxbf_gige_rx_init(struct mlxbf_gige *priv)
 	writeq(MLXBF_GIGE_RX_MAC_FILTER_COUNT_PASS_EN,
 	       priv->base + MLXBF_GIGE_RX_MAC_FILTER_COUNT_PASS);
 
+	writeq(ilog2(priv->rx_q_entries),
+	       priv->base + MLXBF_GIGE_RX_WQE_SIZE_LOG2);
+
 	/* Clear MLXBF_GIGE_INT_MASK 'receive pkt' bit to
 	 * indicate readiness to receive interrupts
 	 */
@@ -154,9 +157,6 @@ int mlxbf_gige_rx_init(struct mlxbf_gige *priv)
 	data |= MLXBF_GIGE_RX_DMA_EN;
 	writeq(data, priv->base + MLXBF_GIGE_RX_DMA);
 
-	writeq(ilog2(priv->rx_q_entries),
-	       priv->base + MLXBF_GIGE_RX_WQE_SIZE_LOG2);
-
 	return 0;
 
 free_wqe_and_skb:
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 218/583] mlxbf_gige: Enable the GigE port in mlxbf_gige_open
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (216 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 217/583] mlxbf_gige: Fix intermittent no ip issue Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 219/583] rxrpc: Fix skbuff cleanup of calls recvmsg_queue and rx_oos_queue Greg Kroah-Hartman
                   ` (371 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, David Thompson, Asmaa Mnebhi,
	Florian Fainelli, David S. Miller, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Asmaa Mnebhi <asmaa@nvidia.com>

[ Upstream commit a460f4a684511e007bbf1700758a41f05d9981e6 ]

At the moment, the GigE port is enabled in the mlxbf_gige_probe
function. If the mlxbf_gige_open is not executed, this could cause
pause frames to increase in the case where there is high backgroud
traffic. This results in clogging the port.
So move enabling the OOB port to mlxbf_gige_open.

Fixes: f92e1869d74e ("Add Mellanox BlueField Gigabit Ethernet driver")
Reviewed-by: David Thompson <davthompson@nvidia.com>
Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c   | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
index 7d132a132a29..aaf1faed4133 100644
--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
@@ -130,9 +130,15 @@ static int mlxbf_gige_open(struct net_device *netdev)
 {
 	struct mlxbf_gige *priv = netdev_priv(netdev);
 	struct phy_device *phydev = netdev->phydev;
+	u64 control;
 	u64 int_en;
 	int err;
 
+	/* Perform general init of GigE block */
+	control = readq(priv->base + MLXBF_GIGE_CONTROL);
+	control |= MLXBF_GIGE_CONTROL_PORT_EN;
+	writeq(control, priv->base + MLXBF_GIGE_CONTROL);
+
 	err = mlxbf_gige_request_irqs(priv);
 	if (err)
 		return err;
@@ -365,7 +371,6 @@ static int mlxbf_gige_probe(struct platform_device *pdev)
 	void __iomem *plu_base;
 	void __iomem *base;
 	int addr, phy_irq;
-	u64 control;
 	int err;
 
 	base = devm_platform_ioremap_resource(pdev, MLXBF_GIGE_RES_MAC);
@@ -380,11 +385,6 @@ static int mlxbf_gige_probe(struct platform_device *pdev)
 	if (IS_ERR(plu_base))
 		return PTR_ERR(plu_base);
 
-	/* Perform general init of GigE block */
-	control = readq(base + MLXBF_GIGE_CONTROL);
-	control |= MLXBF_GIGE_CONTROL_PORT_EN;
-	writeq(control, base + MLXBF_GIGE_CONTROL);
-
 	netdev = devm_alloc_etherdev(&pdev->dev, sizeof(*priv));
 	if (!netdev)
 		return -ENOMEM;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 219/583] rxrpc: Fix skbuff cleanup of calls recvmsg_queue and rx_oos_queue
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (217 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 218/583] mlxbf_gige: Enable the GigE port in mlxbf_gige_open Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 220/583] ip6_tunnel: fix NEXTHDR_FRAGMENT handling in ip6_tnl_parse_tlv_enc_lim() Greg Kroah-Hartman
                   ` (370 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Marc Dionne, David Howells,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	linux-afs, netdev, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: David Howells <dhowells@redhat.com>

[ Upstream commit 4fc68c4c1a114ba597b4f3b082f04622dfa0e0f6 ]

Fix rxrpc_cleanup_ring() to use rxrpc_purge_queue() rather than
skb_queue_purge() so that the count of outstanding skbuffs is correctly
updated when a failed call is cleaned up.

Without this rmmod may hang waiting for rxrpc_n_rx_skbs to become zero.

Fixes: 5d7edbc9231e ("rxrpc: Get rid of the Rx ring")
Reported-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Eric Dumazet <edumazet@google.com>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: linux-afs@lists.infradead.org
cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/rxrpc/call_object.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c
index 773eecd1e979..f10b37c14772 100644
--- a/net/rxrpc/call_object.c
+++ b/net/rxrpc/call_object.c
@@ -545,8 +545,8 @@ void rxrpc_get_call(struct rxrpc_call *call, enum rxrpc_call_trace why)
  */
 static void rxrpc_cleanup_ring(struct rxrpc_call *call)
 {
-	skb_queue_purge(&call->recvmsg_queue);
-	skb_queue_purge(&call->rx_oos_queue);
+	rxrpc_purge_queue(&call->recvmsg_queue);
+	rxrpc_purge_queue(&call->rx_oos_queue);
 }
 
 /*
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 220/583] ip6_tunnel: fix NEXTHDR_FRAGMENT handling in ip6_tnl_parse_tlv_enc_lim()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (218 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 219/583] rxrpc: Fix skbuff cleanup of calls recvmsg_queue and rx_oos_queue Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 221/583] ARM: davinci: always select CONFIG_CPU_ARM926T Greg Kroah-Hartman
                   ` (369 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, syzbot, Eric Dumazet,
	Willem de Bruijn, David Ahern, David S. Miller, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit d375b98e0248980681e5e56b712026174d617198 ]

syzbot pointed out [1] that NEXTHDR_FRAGMENT handling is broken.

Reading frag_off can only be done if we pulled enough bytes
to skb->head. Currently we might access garbage.

[1]
BUG: KMSAN: uninit-value in ip6_tnl_parse_tlv_enc_lim+0x94f/0xbb0
ip6_tnl_parse_tlv_enc_lim+0x94f/0xbb0
ipxip6_tnl_xmit net/ipv6/ip6_tunnel.c:1326 [inline]
ip6_tnl_start_xmit+0xab2/0x1a70 net/ipv6/ip6_tunnel.c:1432
__netdev_start_xmit include/linux/netdevice.h:4940 [inline]
netdev_start_xmit include/linux/netdevice.h:4954 [inline]
xmit_one net/core/dev.c:3548 [inline]
dev_hard_start_xmit+0x247/0xa10 net/core/dev.c:3564
__dev_queue_xmit+0x33b8/0x5130 net/core/dev.c:4349
dev_queue_xmit include/linux/netdevice.h:3134 [inline]
neigh_connected_output+0x569/0x660 net/core/neighbour.c:1592
neigh_output include/net/neighbour.h:542 [inline]
ip6_finish_output2+0x23a9/0x2b30 net/ipv6/ip6_output.c:137
ip6_finish_output+0x855/0x12b0 net/ipv6/ip6_output.c:222
NF_HOOK_COND include/linux/netfilter.h:303 [inline]
ip6_output+0x323/0x610 net/ipv6/ip6_output.c:243
dst_output include/net/dst.h:451 [inline]
ip6_local_out+0xe9/0x140 net/ipv6/output_core.c:155
ip6_send_skb net/ipv6/ip6_output.c:1952 [inline]
ip6_push_pending_frames+0x1f9/0x560 net/ipv6/ip6_output.c:1972
rawv6_push_pending_frames+0xbe8/0xdf0 net/ipv6/raw.c:582
rawv6_sendmsg+0x2b66/0x2e70 net/ipv6/raw.c:920
inet_sendmsg+0x105/0x190 net/ipv4/af_inet.c:847
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
____sys_sendmsg+0x9c2/0xd60 net/socket.c:2584
___sys_sendmsg+0x28d/0x3c0 net/socket.c:2638
__sys_sendmsg net/socket.c:2667 [inline]
__do_sys_sendmsg net/socket.c:2676 [inline]
__se_sys_sendmsg net/socket.c:2674 [inline]
__x64_sys_sendmsg+0x307/0x490 net/socket.c:2674
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b

Uninit was created at:
slab_post_alloc_hook+0x129/0xa70 mm/slab.h:768
slab_alloc_node mm/slub.c:3478 [inline]
__kmem_cache_alloc_node+0x5c9/0x970 mm/slub.c:3517
__do_kmalloc_node mm/slab_common.c:1006 [inline]
__kmalloc_node_track_caller+0x118/0x3c0 mm/slab_common.c:1027
kmalloc_reserve+0x249/0x4a0 net/core/skbuff.c:582
pskb_expand_head+0x226/0x1a00 net/core/skbuff.c:2098
__pskb_pull_tail+0x13b/0x2310 net/core/skbuff.c:2655
pskb_may_pull_reason include/linux/skbuff.h:2673 [inline]
pskb_may_pull include/linux/skbuff.h:2681 [inline]
ip6_tnl_parse_tlv_enc_lim+0x901/0xbb0 net/ipv6/ip6_tunnel.c:408
ipxip6_tnl_xmit net/ipv6/ip6_tunnel.c:1326 [inline]
ip6_tnl_start_xmit+0xab2/0x1a70 net/ipv6/ip6_tunnel.c:1432
__netdev_start_xmit include/linux/netdevice.h:4940 [inline]
netdev_start_xmit include/linux/netdevice.h:4954 [inline]
xmit_one net/core/dev.c:3548 [inline]
dev_hard_start_xmit+0x247/0xa10 net/core/dev.c:3564
__dev_queue_xmit+0x33b8/0x5130 net/core/dev.c:4349
dev_queue_xmit include/linux/netdevice.h:3134 [inline]
neigh_connected_output+0x569/0x660 net/core/neighbour.c:1592
neigh_output include/net/neighbour.h:542 [inline]
ip6_finish_output2+0x23a9/0x2b30 net/ipv6/ip6_output.c:137
ip6_finish_output+0x855/0x12b0 net/ipv6/ip6_output.c:222
NF_HOOK_COND include/linux/netfilter.h:303 [inline]
ip6_output+0x323/0x610 net/ipv6/ip6_output.c:243
dst_output include/net/dst.h:451 [inline]
ip6_local_out+0xe9/0x140 net/ipv6/output_core.c:155
ip6_send_skb net/ipv6/ip6_output.c:1952 [inline]
ip6_push_pending_frames+0x1f9/0x560 net/ipv6/ip6_output.c:1972
rawv6_push_pending_frames+0xbe8/0xdf0 net/ipv6/raw.c:582
rawv6_sendmsg+0x2b66/0x2e70 net/ipv6/raw.c:920
inet_sendmsg+0x105/0x190 net/ipv4/af_inet.c:847
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
____sys_sendmsg+0x9c2/0xd60 net/socket.c:2584
___sys_sendmsg+0x28d/0x3c0 net/socket.c:2638
__sys_sendmsg net/socket.c:2667 [inline]
__do_sys_sendmsg net/socket.c:2676 [inline]
__se_sys_sendmsg net/socket.c:2674 [inline]
__x64_sys_sendmsg+0x307/0x490 net/socket.c:2674
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b

CPU: 0 PID: 7345 Comm: syz-executor.3 Not tainted 6.7.0-rc8-syzkaller-00024-gac865f00af29 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023

Fixes: fbfa743a9d2a ("ipv6: fix ip6_tnl_parse_tlv_enc_lim()")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv6/ip6_tunnel.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 5e80e517f071..46c19bd48990 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -399,7 +399,7 @@ __u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw)
 	const struct ipv6hdr *ipv6h = (const struct ipv6hdr *)raw;
 	unsigned int nhoff = raw - skb->data;
 	unsigned int off = nhoff + sizeof(*ipv6h);
-	u8 next, nexthdr = ipv6h->nexthdr;
+	u8 nexthdr = ipv6h->nexthdr;
 
 	while (ipv6_ext_hdr(nexthdr) && nexthdr != NEXTHDR_NONE) {
 		struct ipv6_opt_hdr *hdr;
@@ -410,25 +410,25 @@ __u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw)
 
 		hdr = (struct ipv6_opt_hdr *)(skb->data + off);
 		if (nexthdr == NEXTHDR_FRAGMENT) {
-			struct frag_hdr *frag_hdr = (struct frag_hdr *) hdr;
-			if (frag_hdr->frag_off)
-				break;
 			optlen = 8;
 		} else if (nexthdr == NEXTHDR_AUTH) {
 			optlen = ipv6_authlen(hdr);
 		} else {
 			optlen = ipv6_optlen(hdr);
 		}
-		/* cache hdr->nexthdr, since pskb_may_pull() might
-		 * invalidate hdr
-		 */
-		next = hdr->nexthdr;
-		if (nexthdr == NEXTHDR_DEST) {
-			u16 i = 2;
 
-			/* Remember : hdr is no longer valid at this point. */
-			if (!pskb_may_pull(skb, off + optlen))
+		if (!pskb_may_pull(skb, off + optlen))
+			break;
+
+		hdr = (struct ipv6_opt_hdr *)(skb->data + off);
+		if (nexthdr == NEXTHDR_FRAGMENT) {
+			struct frag_hdr *frag_hdr = (struct frag_hdr *)hdr;
+
+			if (frag_hdr->frag_off)
 				break;
+		}
+		if (nexthdr == NEXTHDR_DEST) {
+			u16 i = 2;
 
 			while (1) {
 				struct ipv6_tlv_tnl_enc_lim *tel;
@@ -449,7 +449,7 @@ __u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw)
 					i++;
 			}
 		}
-		nexthdr = next;
+		nexthdr = hdr->nexthdr;
 		off += optlen;
 	}
 	return 0;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 221/583] ARM: davinci: always select CONFIG_CPU_ARM926T
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (219 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 220/583] ip6_tunnel: fix NEXTHDR_FRAGMENT handling in ip6_tnl_parse_tlv_enc_lim() Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 222/583] Revert "drm/tidss: Annotate dma-fence critical section in commit path" Greg Kroah-Hartman
                   ` (368 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Bartosz Golaszewski, Arnd Bergmann,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnd Bergmann <arnd@arndb.de>

[ Upstream commit 40974ee421b4d1fc74ac733d86899ce1b83d8f65 ]

The select was lost by accident during the multiplatform conversion.
Any davinci-only

arm-linux-gnueabi-ld: arch/arm/mach-davinci/sleep.o: in function `CACHE_FLUSH':
(.text+0x168): undefined reference to `arm926_flush_kern_cache_all'

Fixes: f962396ce292 ("ARM: davinci: support multiplatform build for ARM v5")
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20240108110055.1531153-1-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/mach-davinci/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 4316e1370627..59de137c6f53 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -4,6 +4,7 @@ menuconfig ARCH_DAVINCI
 	bool "TI DaVinci"
 	depends on ARCH_MULTI_V5
 	depends on CPU_LITTLE_ENDIAN
+	select CPU_ARM926T
 	select DAVINCI_TIMER
 	select ZONE_DMA
 	select PM_GENERIC_DOMAINS if PM
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 222/583] Revert "drm/tidss: Annotate dma-fence critical section in commit path"
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (220 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 221/583] ARM: davinci: always select CONFIG_CPU_ARM926T Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 223/583] Revert "drm/omapdrm: " Greg Kroah-Hartman
                   ` (367 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Aradhya Bhatia, Tomi Valkeinen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

[ Upstream commit ca34d816558c3e4c3f8fe037b5a6b16c944693de ]

This reverts commit 4d56a4f08391857ba93465de489707b66adad114.

The DMA-fence annotations cause a lockdep warning (see below). As per
https://patchwork.freedesktop.org/patch/462170/ it sounds like the
annotations don't work correctly.

======================================================
WARNING: possible circular locking dependency detected
6.6.0-rc2+ #1 Not tainted
------------------------------------------------------
kmstest/733 is trying to acquire lock:
ffff8000819377f0 (fs_reclaim){+.+.}-{0:0}, at: __kmem_cache_alloc_node+0x58/0x2d4

but task is already holding lock:
ffff800081a06aa0 (dma_fence_map){++++}-{0:0}, at: tidss_atomic_commit_tail+0x20/0xc0 [tidss]

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-> #2 (dma_fence_map){++++}-{0:0}:
       __dma_fence_might_wait+0x5c/0xd0
       dma_resv_lockdep+0x1a4/0x32c
       do_one_initcall+0x84/0x2fc
       kernel_init_freeable+0x28c/0x4c4
       kernel_init+0x24/0x1dc
       ret_from_fork+0x10/0x20

-> #1 (mmu_notifier_invalidate_range_start){+.+.}-{0:0}:
       fs_reclaim_acquire+0x70/0xe4
       __kmem_cache_alloc_node+0x58/0x2d4
       kmalloc_trace+0x38/0x78
       __kthread_create_worker+0x3c/0x150
       kthread_create_worker+0x64/0x8c
       workqueue_init+0x1e8/0x2f0
       kernel_init_freeable+0x11c/0x4c4
       kernel_init+0x24/0x1dc
       ret_from_fork+0x10/0x20

-> #0 (fs_reclaim){+.+.}-{0:0}:
       __lock_acquire+0x1370/0x20d8
       lock_acquire+0x1e8/0x308
       fs_reclaim_acquire+0xd0/0xe4
       __kmem_cache_alloc_node+0x58/0x2d4
       __kmalloc_node_track_caller+0x58/0xf0
       kmemdup+0x34/0x60
       regmap_bulk_write+0x64/0x2c0
       tc358768_bridge_pre_enable+0x8c/0x12d0 [tc358768]
       drm_atomic_bridge_call_pre_enable+0x68/0x80 [drm]
       drm_atomic_bridge_chain_pre_enable+0x50/0x158 [drm]
       drm_atomic_helper_commit_modeset_enables+0x164/0x264 [drm_kms_helper]
       tidss_atomic_commit_tail+0x58/0xc0 [tidss]
       commit_tail+0xa0/0x188 [drm_kms_helper]
       drm_atomic_helper_commit+0x1a8/0x1c0 [drm_kms_helper]
       drm_atomic_commit+0xa8/0xe0 [drm]
       drm_mode_atomic_ioctl+0x9ec/0xc80 [drm]
       drm_ioctl_kernel+0xc4/0x170 [drm]
       drm_ioctl+0x234/0x4b0 [drm]
       drm_compat_ioctl+0x110/0x12c [drm]
       __arm64_compat_sys_ioctl+0x128/0x150
       invoke_syscall+0x48/0x110
       el0_svc_common.constprop.0+0x40/0xe0
       do_el0_svc_compat+0x1c/0x38
       el0_svc_compat+0x48/0xb4
       el0t_32_sync_handler+0xb0/0x138
       el0t_32_sync+0x194/0x198

other info that might help us debug this:

Chain exists of:
  fs_reclaim --> mmu_notifier_invalidate_range_start --> dma_fence_map

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  rlock(dma_fence_map);
                               lock(mmu_notifier_invalidate_range_start);
                               lock(dma_fence_map);
  lock(fs_reclaim);

 *** DEADLOCK ***

3 locks held by kmstest/733:
 #0: ffff800082e5bba0 (crtc_ww_class_acquire){+.+.}-{0:0}, at: drm_mode_atomic_ioctl+0x118/0xc80 [drm]
 #1: ffff000004224c88 (crtc_ww_class_mutex){+.+.}-{3:3}, at: modeset_lock+0xdc/0x1a0 [drm]
 #2: ffff800081a06aa0 (dma_fence_map){++++}-{0:0}, at: tidss_atomic_commit_tail+0x20/0xc0 [tidss]

stack backtrace:
CPU: 0 PID: 733 Comm: kmstest Not tainted 6.6.0-rc2+ #1
Hardware name: Toradex Verdin AM62 on Verdin Development Board (DT)
Call trace:
 dump_backtrace+0x98/0x118
 show_stack+0x18/0x24
 dump_stack_lvl+0x60/0xac
 dump_stack+0x18/0x24
 print_circular_bug+0x288/0x368
 check_noncircular+0x168/0x17c
 __lock_acquire+0x1370/0x20d8
 lock_acquire+0x1e8/0x308
 fs_reclaim_acquire+0xd0/0xe4
 __kmem_cache_alloc_node+0x58/0x2d4
 __kmalloc_node_track_caller+0x58/0xf0
 kmemdup+0x34/0x60
 regmap_bulk_write+0x64/0x2c0
 tc358768_bridge_pre_enable+0x8c/0x12d0 [tc358768]
 drm_atomic_bridge_call_pre_enable+0x68/0x80 [drm]
 drm_atomic_bridge_chain_pre_enable+0x50/0x158 [drm]
 drm_atomic_helper_commit_modeset_enables+0x164/0x264 [drm_kms_helper]
 tidss_atomic_commit_tail+0x58/0xc0 [tidss]
 commit_tail+0xa0/0x188 [drm_kms_helper]
 drm_atomic_helper_commit+0x1a8/0x1c0 [drm_kms_helper]
 drm_atomic_commit+0xa8/0xe0 [drm]
 drm_mode_atomic_ioctl+0x9ec/0xc80 [drm]
 drm_ioctl_kernel+0xc4/0x170 [drm]
 drm_ioctl+0x234/0x4b0 [drm]
 drm_compat_ioctl+0x110/0x12c [drm]
 __arm64_compat_sys_ioctl+0x128/0x150
 invoke_syscall+0x48/0x110
 el0_svc_common.constprop.0+0x40/0xe0
 do_el0_svc_compat+0x1c/0x38
 el0_svc_compat+0x48/0xb4
 el0t_32_sync_handler+0xb0/0x138
 el0t_32_sync+0x194/0x198

Fixes: 4d56a4f08391 ("drm/tidss: Annotate dma-fence critical section in commit path")
Reviewed-by: Aradhya Bhatia <a-bhatia1@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230920-dma-fence-annotation-revert-v1-1-7ebf6f7f5bf6@ideasonboard.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/tidss/tidss_kms.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/tidss/tidss_kms.c b/drivers/gpu/drm/tidss/tidss_kms.c
index c979ad1af236..d096d8d2bc8f 100644
--- a/drivers/gpu/drm/tidss/tidss_kms.c
+++ b/drivers/gpu/drm/tidss/tidss_kms.c
@@ -4,8 +4,6 @@
  * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
  */
 
-#include <linux/dma-fence.h>
-
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
@@ -25,7 +23,6 @@ static void tidss_atomic_commit_tail(struct drm_atomic_state *old_state)
 {
 	struct drm_device *ddev = old_state->dev;
 	struct tidss_device *tidss = to_tidss(ddev);
-	bool fence_cookie = dma_fence_begin_signalling();
 
 	dev_dbg(ddev->dev, "%s\n", __func__);
 
@@ -36,7 +33,6 @@ static void tidss_atomic_commit_tail(struct drm_atomic_state *old_state)
 	drm_atomic_helper_commit_modeset_enables(ddev, old_state);
 
 	drm_atomic_helper_commit_hw_done(old_state);
-	dma_fence_end_signalling(fence_cookie);
 	drm_atomic_helper_wait_for_flip_done(ddev, old_state);
 
 	drm_atomic_helper_cleanup_planes(ddev, old_state);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 223/583] Revert "drm/omapdrm: Annotate dma-fence critical section in commit path"
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (221 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 222/583] Revert "drm/tidss: Annotate dma-fence critical section in commit path" Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 224/583] drm/dp_mst: Fix fractional DSC bpp handling Greg Kroah-Hartman
                   ` (366 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Aradhya Bhatia, Tomi Valkeinen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

[ Upstream commit 9d7c8c066916f231ca0ed4e4fce6c4b58ca3e451 ]

This reverts commit 250aa22920cd5d956a5d3e9c6a43d671c2bae217.

The DMA-fence annotations cause a lockdep warning (see below). As per
https://patchwork.freedesktop.org/patch/462170/ it sounds like the
annotations don't work correctly.

======================================================
WARNING: possible circular locking dependency detected
6.5.0-rc2+ #2 Not tainted
------------------------------------------------------
kmstest/219 is trying to acquire lock:
c4705838 (&hdmi->lock){+.+.}-{3:3}, at: hdmi5_bridge_mode_set+0x1c/0x50

but task is already holding lock:
c11e1128 (dma_fence_map){++++}-{0:0}, at: omap_atomic_commit_tail+0x14/0xbc

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-> #2 (dma_fence_map){++++}-{0:0}:
       __dma_fence_might_wait+0x48/0xb4
       dma_resv_lockdep+0x1b8/0x2bc
       do_one_initcall+0x68/0x3b0
       kernel_init_freeable+0x260/0x34c
       kernel_init+0x14/0x140
       ret_from_fork+0x14/0x28

-> #1 (fs_reclaim){+.+.}-{0:0}:
       fs_reclaim_acquire+0x70/0xa8
       __kmem_cache_alloc_node+0x3c/0x368
       kmalloc_trace+0x28/0x58
       _drm_do_get_edid+0x7c/0x35c
       hdmi5_bridge_get_edid+0xc8/0x1ac
       drm_bridge_connector_get_modes+0x64/0xc0
       drm_helper_probe_single_connector_modes+0x170/0x528
       drm_client_modeset_probe+0x208/0x1334
       __drm_fb_helper_initial_config_and_unlock+0x30/0x548
       omap_fbdev_client_hotplug+0x3c/0x6c
       drm_client_register+0x58/0x94
       pdev_probe+0x544/0x6b0
       platform_probe+0x58/0xbc
       really_probe+0xd8/0x3fc
       __driver_probe_device+0x94/0x1f4
       driver_probe_device+0x2c/0xc4
       __device_attach_driver+0xa4/0x11c
       bus_for_each_drv+0x84/0xdc
       __device_attach+0xac/0x20c
       bus_probe_device+0x8c/0x90
       device_add+0x588/0x7e0
       platform_device_add+0x110/0x24c
       platform_device_register_full+0x108/0x15c
       dss_bind+0x90/0xc0
       try_to_bring_up_aggregate_device+0x1e0/0x2c8
       __component_add+0xa4/0x174
       hdmi5_probe+0x1c8/0x270
       platform_probe+0x58/0xbc
       really_probe+0xd8/0x3fc
       __driver_probe_device+0x94/0x1f4
       driver_probe_device+0x2c/0xc4
       __device_attach_driver+0xa4/0x11c
       bus_for_each_drv+0x84/0xdc
       __device_attach+0xac/0x20c
       bus_probe_device+0x8c/0x90
       deferred_probe_work_func+0x8c/0xd8
       process_one_work+0x2ac/0x6e4
       worker_thread+0x30/0x4ec
       kthread+0x100/0x124
       ret_from_fork+0x14/0x28

-> #0 (&hdmi->lock){+.+.}-{3:3}:
       __lock_acquire+0x145c/0x29cc
       lock_acquire.part.0+0xb4/0x258
       __mutex_lock+0x90/0x950
       mutex_lock_nested+0x1c/0x24
       hdmi5_bridge_mode_set+0x1c/0x50
       drm_bridge_chain_mode_set+0x48/0x5c
       crtc_set_mode+0x188/0x1d0
       omap_atomic_commit_tail+0x2c/0xbc
       commit_tail+0x9c/0x188
       drm_atomic_helper_commit+0x158/0x18c
       drm_atomic_commit+0xa4/0xe8
       drm_mode_atomic_ioctl+0x9a4/0xc38
       drm_ioctl+0x210/0x4a8
       sys_ioctl+0x138/0xf00
       ret_fast_syscall+0x0/0x1c

other info that might help us debug this:

Chain exists of:
  &hdmi->lock --> fs_reclaim --> dma_fence_map

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  rlock(dma_fence_map);
                               lock(fs_reclaim);
                               lock(dma_fence_map);
  lock(&hdmi->lock);

 *** DEADLOCK ***

3 locks held by kmstest/219:
 #0: f1011de4 (crtc_ww_class_acquire){+.+.}-{0:0}, at: drm_mode_atomic_ioctl+0xf0/0xc38
 #1: c47059c8 (crtc_ww_class_mutex){+.+.}-{3:3}, at: modeset_lock+0xf8/0x230
 #2: c11e1128 (dma_fence_map){++++}-{0:0}, at: omap_atomic_commit_tail+0x14/0xbc

stack backtrace:
CPU: 1 PID: 219 Comm: kmstest Not tainted 6.5.0-rc2+ #2
Hardware name: Generic DRA74X (Flattened Device Tree)
 unwind_backtrace from show_stack+0x10/0x14
 show_stack from dump_stack_lvl+0x58/0x70
 dump_stack_lvl from check_noncircular+0x164/0x198
 check_noncircular from __lock_acquire+0x145c/0x29cc
 __lock_acquire from lock_acquire.part.0+0xb4/0x258
 lock_acquire.part.0 from __mutex_lock+0x90/0x950
 __mutex_lock from mutex_lock_nested+0x1c/0x24
 mutex_lock_nested from hdmi5_bridge_mode_set+0x1c/0x50
 hdmi5_bridge_mode_set from drm_bridge_chain_mode_set+0x48/0x5c
 drm_bridge_chain_mode_set from crtc_set_mode+0x188/0x1d0
 crtc_set_mode from omap_atomic_commit_tail+0x2c/0xbc
 omap_atomic_commit_tail from commit_tail+0x9c/0x188
 commit_tail from drm_atomic_helper_commit+0x158/0x18c
 drm_atomic_helper_commit from drm_atomic_commit+0xa4/0xe8
 drm_atomic_commit from drm_mode_atomic_ioctl+0x9a4/0xc38
 drm_mode_atomic_ioctl from drm_ioctl+0x210/0x4a8
 drm_ioctl from sys_ioctl+0x138/0xf00
 sys_ioctl from ret_fast_syscall+0x0/0x1c
Exception stack(0xf1011fa8 to 0xf1011ff0)
1fa0:                   00466d58 be9ab510 00000003 c03864bc be9ab510 be9ab4e0
1fc0: 00466d58 be9ab510 c03864bc 00000036 00466ef0 00466fc0 00467020 00466f20
1fe0: b6bc7ef4 be9ab4d0 b6bbbb00 b6cb2cc0

Fixes: 250aa22920cd ("drm/omapdrm: Annotate dma-fence critical section in commit path")
Reviewed-by: Aradhya Bhatia <a-bhatia1@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230920-dma-fence-annotation-revert-v1-2-7ebf6f7f5bf6@ideasonboard.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index afeeb7737552..e000577a95dd 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -69,7 +69,6 @@ static void omap_atomic_commit_tail(struct drm_atomic_state *old_state)
 {
 	struct drm_device *dev = old_state->dev;
 	struct omap_drm_private *priv = dev->dev_private;
-	bool fence_cookie = dma_fence_begin_signalling();
 
 	dispc_runtime_get(priv->dispc);
 
@@ -92,6 +91,8 @@ static void omap_atomic_commit_tail(struct drm_atomic_state *old_state)
 		omap_atomic_wait_for_completion(dev, old_state);
 
 		drm_atomic_helper_commit_planes(dev, old_state, 0);
+
+		drm_atomic_helper_commit_hw_done(old_state);
 	} else {
 		/*
 		 * OMAP3 DSS seems to have issues with the work-around above,
@@ -101,11 +102,9 @@ static void omap_atomic_commit_tail(struct drm_atomic_state *old_state)
 		drm_atomic_helper_commit_planes(dev, old_state, 0);
 
 		drm_atomic_helper_commit_modeset_enables(dev, old_state);
-	}
 
-	drm_atomic_helper_commit_hw_done(old_state);
-
-	dma_fence_end_signalling(fence_cookie);
+		drm_atomic_helper_commit_hw_done(old_state);
+	}
 
 	/*
 	 * Wait for completion of the page flips to ensure that old buffers
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 224/583] drm/dp_mst: Fix fractional DSC bpp handling
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (222 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 223/583] Revert "drm/omapdrm: " Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 225/583] drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off() Greg Kroah-Hartman
                   ` (365 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Manasi Navare, Lyude Paul,
	Harry Wentland, David Francis, Mikita Lipski, Alex Deucher,
	Ville Syrjälä,
	Maxime Ripard, Imre Deak, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

[ Upstream commit 7707dd6022593f3edd8e182e7935870cf326f874 ]

The current code does '(bpp << 4) / 16' in the MST PBN
calculation, but that is just the same as 'bpp' so the
DSC codepath achieves absolutely nothing. Fix it up so that
the fractional part of the bpp value is actually used instead
of truncated away. 64*1006 has enough zero lsbs that we can
just shift that down in the dividend and thus still manage
to stick to a 32bit divisor.

And while touching this, let's just make the whole thing more
straightforward by making the passed in bpp value .4 binary
fixed point always, instead of having to pass in different
things based on whether DSC is enabled or not.

v2:
- Fix DSC kunit test cases.

Cc: Manasi Navare <manasi.d.navare@intel.com>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: David Francis <David.Francis@amd.com>
Cc: Mikita Lipski <mikita.lipski@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Fixes: dc48529fb14e ("drm/dp_mst: Add PBN calculation for DSC modes")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
[Imre: Fix kunit test cases]
Acked-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231030155843.2251023-3-imre.deak@intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  2 +-
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   |  2 +-
 drivers/gpu/drm/display/drm_dp_mst_topology.c | 20 +++++--------------
 drivers/gpu/drm/i915/display/intel_dp_mst.c   |  5 ++---
 drivers/gpu/drm/nouveau/dispnv50/disp.c       |  3 +--
 .../gpu/drm/tests/drm_dp_mst_helper_test.c    |  6 +++---
 include/drm/display/drm_dp_mst_helper.h       |  2 +-
 7 files changed, 14 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 5084833e3608..861b5e45e2a7 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -6882,7 +6882,7 @@ static int dm_encoder_helper_atomic_check(struct drm_encoder *encoder,
 								    max_bpc);
 		bpp = convert_dc_color_depth_into_bpc(color_depth) * 3;
 		clock = adjusted_mode->clock;
-		dm_new_connector_state->pbn = drm_dp_calc_pbn_mode(clock, bpp, false);
+		dm_new_connector_state->pbn = drm_dp_calc_pbn_mode(clock, bpp << 4);
 	}
 
 	dm_new_connector_state->vcpi_slots =
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 28f5eb9ecbd3..10dd4cd6f59c 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -1636,7 +1636,7 @@ enum dc_status dm_dp_mst_is_port_support_mode(
 	} else {
 		/* check if mode could be supported within full_pbn */
 		bpp = convert_dc_color_depth_into_bpc(stream->timing.display_color_depth) * 3;
-		pbn = drm_dp_calc_pbn_mode(stream->timing.pix_clk_100hz / 10, bpp, false);
+		pbn = drm_dp_calc_pbn_mode(stream->timing.pix_clk_100hz / 10, bpp << 4);
 		if (pbn > full_pbn)
 			return DC_FAIL_BANDWIDTH_VALIDATE;
 	}
diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c
index 8c929ef72c72..6d169c83b062 100644
--- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
@@ -4690,13 +4690,12 @@ EXPORT_SYMBOL(drm_dp_check_act_status);
 
 /**
  * drm_dp_calc_pbn_mode() - Calculate the PBN for a mode.
- * @clock: dot clock for the mode
- * @bpp: bpp for the mode.
- * @dsc: DSC mode. If true, bpp has units of 1/16 of a bit per pixel
+ * @clock: dot clock
+ * @bpp: bpp as .4 binary fixed point
  *
  * This uses the formula in the spec to calculate the PBN value for a mode.
  */
-int drm_dp_calc_pbn_mode(int clock, int bpp, bool dsc)
+int drm_dp_calc_pbn_mode(int clock, int bpp)
 {
 	/*
 	 * margin 5300ppm + 300ppm ~ 0.6% as per spec, factor is 1.006
@@ -4707,18 +4706,9 @@ int drm_dp_calc_pbn_mode(int clock, int bpp, bool dsc)
 	 * peak_kbps *= (1006/1000)
 	 * peak_kbps *= (64/54)
 	 * peak_kbps *= 8    convert to bytes
-	 *
-	 * If the bpp is in units of 1/16, further divide by 16. Put this
-	 * factor in the numerator rather than the denominator to avoid
-	 * integer overflow
 	 */
-
-	if (dsc)
-		return DIV_ROUND_UP_ULL(mul_u32_u32(clock * (bpp / 16), 64 * 1006),
-					8 * 54 * 1000 * 1000);
-
-	return DIV_ROUND_UP_ULL(mul_u32_u32(clock * bpp, 64 * 1006),
-				8 * 54 * 1000 * 1000);
+	return DIV_ROUND_UP_ULL(mul_u32_u32(clock * bpp, 64 * 1006 >> 4),
+				1000 * 8 * 54 * 1000);
 }
 EXPORT_SYMBOL(drm_dp_calc_pbn_mode);
 
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index 77bd1313c808..f104bd7f8c2a 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -109,8 +109,7 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder,
 			continue;
 
 		crtc_state->pbn = drm_dp_calc_pbn_mode(adjusted_mode->crtc_clock,
-						       dsc ? bpp << 4 : bpp,
-						       dsc);
+						       bpp << 4);
 
 		slots = drm_dp_atomic_find_time_slots(state, &intel_dp->mst_mgr,
 						      connector->port,
@@ -941,7 +940,7 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector,
 		return ret;
 
 	if (mode_rate > max_rate || mode->clock > max_dotclk ||
-	    drm_dp_calc_pbn_mode(mode->clock, min_bpp, false) > port->full_pbn) {
+	    drm_dp_calc_pbn_mode(mode->clock, min_bpp << 4) > port->full_pbn) {
 		*status = MODE_CLOCK_HIGH;
 		return 0;
 	}
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index 617162aac060..de8041c94de5 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -966,8 +966,7 @@ nv50_msto_atomic_check(struct drm_encoder *encoder,
 		const int clock = crtc_state->adjusted_mode.clock;
 
 		asyh->or.bpc = connector->display_info.bpc;
-		asyh->dp.pbn = drm_dp_calc_pbn_mode(clock, asyh->or.bpc * 3,
-						    false);
+		asyh->dp.pbn = drm_dp_calc_pbn_mode(clock, asyh->or.bpc * 3 << 4);
 	}
 
 	mst_state = drm_atomic_get_mst_topology_state(state, &mstm->mgr);
diff --git a/drivers/gpu/drm/tests/drm_dp_mst_helper_test.c b/drivers/gpu/drm/tests/drm_dp_mst_helper_test.c
index 545beea33e8c..e3c818dfc0e6 100644
--- a/drivers/gpu/drm/tests/drm_dp_mst_helper_test.c
+++ b/drivers/gpu/drm/tests/drm_dp_mst_helper_test.c
@@ -42,13 +42,13 @@ static const struct drm_dp_mst_calc_pbn_mode_test drm_dp_mst_calc_pbn_mode_cases
 		.clock = 332880,
 		.bpp = 24,
 		.dsc = true,
-		.expected = 50
+		.expected = 1191
 	},
 	{
 		.clock = 324540,
 		.bpp = 24,
 		.dsc = true,
-		.expected = 49
+		.expected = 1161
 	},
 };
 
@@ -56,7 +56,7 @@ static void drm_test_dp_mst_calc_pbn_mode(struct kunit *test)
 {
 	const struct drm_dp_mst_calc_pbn_mode_test *params = test->param_value;
 
-	KUNIT_EXPECT_EQ(test, drm_dp_calc_pbn_mode(params->clock, params->bpp, params->dsc),
+	KUNIT_EXPECT_EQ(test, drm_dp_calc_pbn_mode(params->clock, params->bpp << 4),
 			params->expected);
 }
 
diff --git a/include/drm/display/drm_dp_mst_helper.h b/include/drm/display/drm_dp_mst_helper.h
index ed5c9660563c..8eeb6730ac6d 100644
--- a/include/drm/display/drm_dp_mst_helper.h
+++ b/include/drm/display/drm_dp_mst_helper.h
@@ -832,7 +832,7 @@ struct edid *drm_dp_mst_get_edid(struct drm_connector *connector,
 int drm_dp_get_vc_payload_bw(const struct drm_dp_mst_topology_mgr *mgr,
 			     int link_rate, int link_lane_count);
 
-int drm_dp_calc_pbn_mode(int clock, int bpp, bool dsc);
+int drm_dp_calc_pbn_mode(int clock, int bpp);
 
 void drm_dp_mst_update_slots(struct drm_dp_mst_topology_state *mst_state, uint8_t link_encoding_cap);
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 225/583] drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (223 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 224/583] drm/dp_mst: Fix fractional DSC bpp handling Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 226/583] RDMA/usnic: Silence uninitialized symbol smatch warnings Greg Kroah-Hartman
                   ` (364 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, AngeloGioacchino Del Regno,
	Steven Price, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

[ Upstream commit 22aa1a209018dc2eca78745f7666db63637cd5dc ]

The layout of the registers {TILER,SHADER,L2}_PWROFF_LO, used to request
powering off cores, is the same as the {TILER,SHADER,L2}_PWRON_LO ones:
this means that in order to request poweroff of cores, we are supposed
to write a bitmask of cores that should be powered off!
This means that the panfrost_gpu_power_off() function has always been
doing nothing.

Fix powering off the GPU by writing a bitmask of the cores to poweroff
to the relevant PWROFF_LO registers and then check that the transition
(from ON to OFF) has finished by polling the relevant PWRTRANS_LO
registers.

While at it, in order to avoid code duplication, move the core mask
logic from panfrost_gpu_power_on() to a new panfrost_get_core_mask()
function, used in both poweron and poweroff.

Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231102141507.73481-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/panfrost/panfrost_gpu.c | 64 ++++++++++++++++++-------
 1 file changed, 46 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c
index d28b99732dde..e20619169fe1 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gpu.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c
@@ -321,28 +321,38 @@ static void panfrost_gpu_init_features(struct panfrost_device *pfdev)
 		 pfdev->features.shader_present, pfdev->features.l2_present);
 }
 
+static u64 panfrost_get_core_mask(struct panfrost_device *pfdev)
+{
+	u64 core_mask;
+
+	if (pfdev->features.l2_present == 1)
+		return U64_MAX;
+
+	/*
+	 * Only support one core group now.
+	 * ~(l2_present - 1) unsets all bits in l2_present except
+	 * the bottom bit. (l2_present - 2) has all the bits in
+	 * the first core group set. AND them together to generate
+	 * a mask of cores in the first core group.
+	 */
+	core_mask = ~(pfdev->features.l2_present - 1) &
+		     (pfdev->features.l2_present - 2);
+	dev_info_once(pfdev->dev, "using only 1st core group (%lu cores from %lu)\n",
+		      hweight64(core_mask),
+		      hweight64(pfdev->features.shader_present));
+
+	return core_mask;
+}
+
 void panfrost_gpu_power_on(struct panfrost_device *pfdev)
 {
 	int ret;
 	u32 val;
-	u64 core_mask = U64_MAX;
+	u64 core_mask;
 
 	panfrost_gpu_init_quirks(pfdev);
+	core_mask = panfrost_get_core_mask(pfdev);
 
-	if (pfdev->features.l2_present != 1) {
-		/*
-		 * Only support one core group now.
-		 * ~(l2_present - 1) unsets all bits in l2_present except
-		 * the bottom bit. (l2_present - 2) has all the bits in
-		 * the first core group set. AND them together to generate
-		 * a mask of cores in the first core group.
-		 */
-		core_mask = ~(pfdev->features.l2_present - 1) &
-			     (pfdev->features.l2_present - 2);
-		dev_info_once(pfdev->dev, "using only 1st core group (%lu cores from %lu)\n",
-			      hweight64(core_mask),
-			      hweight64(pfdev->features.shader_present));
-	}
 	gpu_write(pfdev, L2_PWRON_LO, pfdev->features.l2_present & core_mask);
 	ret = readl_relaxed_poll_timeout(pfdev->iomem + L2_READY_LO,
 		val, val == (pfdev->features.l2_present & core_mask),
@@ -367,9 +377,27 @@ void panfrost_gpu_power_on(struct panfrost_device *pfdev)
 
 void panfrost_gpu_power_off(struct panfrost_device *pfdev)
 {
-	gpu_write(pfdev, TILER_PWROFF_LO, 0);
-	gpu_write(pfdev, SHADER_PWROFF_LO, 0);
-	gpu_write(pfdev, L2_PWROFF_LO, 0);
+	u64 core_mask = panfrost_get_core_mask(pfdev);
+	int ret;
+	u32 val;
+
+	gpu_write(pfdev, SHADER_PWROFF_LO, pfdev->features.shader_present & core_mask);
+	ret = readl_relaxed_poll_timeout(pfdev->iomem + SHADER_PWRTRANS_LO,
+					 val, !val, 1, 1000);
+	if (ret)
+		dev_err(pfdev->dev, "shader power transition timeout");
+
+	gpu_write(pfdev, TILER_PWROFF_LO, pfdev->features.tiler_present);
+	ret = readl_relaxed_poll_timeout(pfdev->iomem + TILER_PWRTRANS_LO,
+					 val, !val, 1, 1000);
+	if (ret)
+		dev_err(pfdev->dev, "tiler power transition timeout");
+
+	gpu_write(pfdev, L2_PWROFF_LO, pfdev->features.l2_present & core_mask);
+	ret = readl_poll_timeout(pfdev->iomem + L2_PWRTRANS_LO,
+				 val, !val, 0, 1000);
+	if (ret)
+		dev_err(pfdev->dev, "l2 power transition timeout");
 }
 
 int panfrost_gpu_init(struct panfrost_device *pfdev)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 226/583] RDMA/usnic: Silence uninitialized symbol smatch warnings
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (224 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 225/583] drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off() Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 227/583] RDMA/hns: Fix inappropriate err code for unsupported operations Greg Kroah-Hartman
                   ` (363 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Dan Carpenter, Leon Romanovsky, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Leon Romanovsky <leonro@nvidia.com>

[ Upstream commit b9a85e5eec126d6ae6c362f94b447c223e8fe6e4 ]

The patch 1da177e4c3f4: "Linux-2.6.12-rc2" from Apr 16, 2005
(linux-next), leads to the following Smatch static checker warning:

        drivers/infiniband/hw/mthca/mthca_cmd.c:644 mthca_SYS_EN()
        error: uninitialized symbol 'out'.

drivers/infiniband/hw/mthca/mthca_cmd.c
    636 int mthca_SYS_EN(struct mthca_dev *dev)
    637 {
    638         u64 out;
    639         int ret;
    640
    641         ret = mthca_cmd_imm(dev, 0, &out, 0, 0, CMD_SYS_EN, CMD_TIME_CLASS_D);

We pass out here and it gets used without being initialized.

        err = mthca_cmd_post(dev, in_param,
                             out_param ? *out_param : 0,
                                         ^^^^^^^^^^
                             in_modifier, op_modifier,
                             op, context->token, 1);

It's the same in mthca_cmd_wait() and mthca_cmd_poll().

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/533bc3df-8078-4397-b93d-d1f6cec9b636@moroto.mountain
Link: https://lore.kernel.org/r/c559cb7113158c02d75401ac162652072ef1b5f0.1699867650.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/infiniband/hw/mthca/mthca_cmd.c  | 4 ++--
 drivers/infiniband/hw/mthca/mthca_main.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c
index f330ce895d88..8fe0cef7e2be 100644
--- a/drivers/infiniband/hw/mthca/mthca_cmd.c
+++ b/drivers/infiniband/hw/mthca/mthca_cmd.c
@@ -635,7 +635,7 @@ void mthca_free_mailbox(struct mthca_dev *dev, struct mthca_mailbox *mailbox)
 
 int mthca_SYS_EN(struct mthca_dev *dev)
 {
-	u64 out;
+	u64 out = 0;
 	int ret;
 
 	ret = mthca_cmd_imm(dev, 0, &out, 0, 0, CMD_SYS_EN, CMD_TIME_CLASS_D);
@@ -1955,7 +1955,7 @@ int mthca_WRITE_MGM(struct mthca_dev *dev, int index,
 int mthca_MGID_HASH(struct mthca_dev *dev, struct mthca_mailbox *mailbox,
 		    u16 *hash)
 {
-	u64 imm;
+	u64 imm = 0;
 	int err;
 
 	err = mthca_cmd_imm(dev, mailbox->dma, &imm, 0, 0, CMD_MGID_HASH,
diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c
index b54bc8865dae..1ab268b77096 100644
--- a/drivers/infiniband/hw/mthca/mthca_main.c
+++ b/drivers/infiniband/hw/mthca/mthca_main.c
@@ -382,7 +382,7 @@ static int mthca_init_icm(struct mthca_dev *mdev,
 			  struct mthca_init_hca_param *init_hca,
 			  u64 icm_size)
 {
-	u64 aux_pages;
+	u64 aux_pages = 0;
 	int err;
 
 	err = mthca_SET_ICM_SIZE(mdev, icm_size, &aux_pages);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 227/583] RDMA/hns: Fix inappropriate err code for unsupported operations
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (225 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 226/583] RDMA/usnic: Silence uninitialized symbol smatch warnings Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 228/583] drm/panel: nv3051d: Hold panel in reset for unprepare Greg Kroah-Hartman
                   ` (362 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Junxian Huang, Leon Romanovsky, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Junxian Huang <huangjunxian6@hisilicon.com>

[ Upstream commit f45b83ad39f8033e717b1eee57e81811113d5a84 ]

EOPNOTSUPP is more situable than EINVAL for allocating XRCD while XRC
is not supported and unsupported resizing SRQ.

Fixes: 32548870d438 ("RDMA/hns: Add support for XRC on HIP09")
Fixes: 221109e64316 ("RDMA/hns: Add interception for resizing SRQs")
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://lore.kernel.org/r/20231114123449.1106162-2-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +-
 drivers/infiniband/hw/hns/hns_roce_pd.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 486d635b6e3a..84c18996517c 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -5634,7 +5634,7 @@ static int hns_roce_v2_modify_srq(struct ib_srq *ibsrq,
 
 	/* Resizing SRQs is not supported yet */
 	if (srq_attr_mask & IB_SRQ_MAX_WR)
-		return -EINVAL;
+		return -EOPNOTSUPP;
 
 	if (srq_attr_mask & IB_SRQ_LIMIT) {
 		if (srq_attr->srq_limit > srq->wqe_cnt)
diff --git a/drivers/infiniband/hw/hns/hns_roce_pd.c b/drivers/infiniband/hw/hns/hns_roce_pd.c
index 783e71852c50..bd1fe89ca205 100644
--- a/drivers/infiniband/hw/hns/hns_roce_pd.c
+++ b/drivers/infiniband/hw/hns/hns_roce_pd.c
@@ -150,7 +150,7 @@ int hns_roce_alloc_xrcd(struct ib_xrcd *ib_xrcd, struct ib_udata *udata)
 	int ret;
 
 	if (!(hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_XRC))
-		return -EINVAL;
+		return -EOPNOTSUPP;
 
 	ret = hns_roce_xrcd_alloc(hr_dev, &xrcd->xrcdn);
 	if (ret)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 228/583] drm/panel: nv3051d: Hold panel in reset for unprepare
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (226 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 227/583] RDMA/hns: Fix inappropriate err code for unsupported operations Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 229/583] drm/panel-elida-kd35t133: hold " Greg Kroah-Hartman
                   ` (361 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chris Morgan, Jessica Zhang,
	Neil Armstrong, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chris Morgan <macromorgan@hotmail.com>

[ Upstream commit 697ebc319b942403a6fee894607fd2cd47cca069 ]

Improve the panel's ability to restore from suspend by holding the
panel in suspend after unprepare.

Fixes: b1d39f0f4264 ("drm/panel: Add NewVision NV3051D MIPI-DSI LCD panel")
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Link: https://lore.kernel.org/r/20231117202536.1387815-3-macroalpha82@gmail.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20231117202536.1387815-3-macroalpha82@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/panel/panel-newvision-nv3051d.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
index ad98dd9322b4..227937afe257 100644
--- a/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
+++ b/drivers/gpu/drm/panel/panel-newvision-nv3051d.c
@@ -261,6 +261,8 @@ static int panel_nv3051d_unprepare(struct drm_panel *panel)
 
 	usleep_range(10000, 15000);
 
+	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+
 	regulator_disable(ctx->vdd);
 
 	return 0;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 229/583] drm/panel-elida-kd35t133: hold panel in reset for unprepare
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (227 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 228/583] drm/panel: nv3051d: Hold panel in reset for unprepare Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 230/583] drm/nouveau/fence:: fix warning directly dereferencing a rcu pointer Greg Kroah-Hartman
                   ` (360 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chris Morgan, Jessica Zhang,
	Neil Armstrong, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chris Morgan <macromorgan@hotmail.com>

[ Upstream commit 03c5b2a5f6c39fe4e090346536cf1c14ee18b61e ]

For devices like the Anbernic RG351M and RG351P the panel is wired to
an always on regulator. When the device suspends and wakes up, there
are some slight artifacts on the screen that go away over time. If
instead we hold the panel in reset status after it is unprepared,
this does not happen.

Fixes: 5b6603360c12 ("drm/panel: add panel driver for Elida KD35T133 panels")
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Link: https://lore.kernel.org/r/20231117194405.1386265-3-macroalpha82@gmail.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20231117194405.1386265-3-macroalpha82@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/panel/panel-elida-kd35t133.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-elida-kd35t133.c b/drivers/gpu/drm/panel/panel-elida-kd35t133.c
index e7be15b68102..6de117232346 100644
--- a/drivers/gpu/drm/panel/panel-elida-kd35t133.c
+++ b/drivers/gpu/drm/panel/panel-elida-kd35t133.c
@@ -104,6 +104,8 @@ static int kd35t133_unprepare(struct drm_panel *panel)
 		return ret;
 	}
 
+	gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+
 	regulator_disable(ctx->iovcc);
 	regulator_disable(ctx->vdd);
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 230/583] drm/nouveau/fence:: fix warning directly dereferencing a rcu pointer
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (228 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 229/583] drm/panel-elida-kd35t133: hold " Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 231/583] drm/bridge: tpd12s015: Drop buggy __exit annotation for remove function Greg Kroah-Hartman
                   ` (359 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Abhinav Singh, Danilo Krummrich,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Abhinav Singh <singhabhinav9051571833@gmail.com>

[ Upstream commit 5f35a624c1e30b5bae5023b3c256e94e0ad4f806 ]

Fix a sparse warning with this message
"warning:dereference of noderef expression". In this context it means we
are dereferencing a __rcu tagged pointer directly.

We should not be directly dereferencing a rcu pointer. To get a normal
(non __rcu tagged pointer) from a __rcu tagged pointer we are using the
function unrcu_pointer(...). The non __rcu tagged pointer then can be
dereferenced just like a normal pointer.

I tested with qemu with this command
qemu-system-x86_64 \
	-m 2G \
	-smp 2 \
	-kernel bzImage \
	-append "console=ttyS0 root=/dev/sda earlyprintk=serial net.ifnames=0" \
	-drive file=bullseye.img,format=raw \
	-net user,host=10.0.2.10,hostfwd=tcp:127.0.0.1:10021-:22 \
	-net nic,model=e1000 \
	-enable-kvm \
	-nographic \
	-pidfile vm.pid \
	2>&1 | tee vm.log
with lockdep enabled.

Fixes: 0ec5f02f0e2c ("drm/nouveau: prevent stale fence->channel pointers, and protect with rcu")
Signed-off-by: Abhinav Singh <singhabhinav9051571833@gmail.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231113191303.3277733-1-singhabhinav9051571833@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/nouveau/nv04_fence.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nv04_fence.c b/drivers/gpu/drm/nouveau/nv04_fence.c
index 5b71a5a5cd85..cdbc75e3d1f6 100644
--- a/drivers/gpu/drm/nouveau/nv04_fence.c
+++ b/drivers/gpu/drm/nouveau/nv04_fence.c
@@ -39,7 +39,7 @@ struct nv04_fence_priv {
 static int
 nv04_fence_emit(struct nouveau_fence *fence)
 {
-	struct nvif_push *push = fence->channel->chan.push;
+	struct nvif_push *push = unrcu_pointer(fence->channel)->chan.push;
 	int ret = PUSH_WAIT(push, 2);
 	if (ret == 0) {
 		PUSH_NVSQ(push, NV_SW, 0x0150, fence->base.seqno);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 231/583] drm/bridge: tpd12s015: Drop buggy __exit annotation for remove function
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (229 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 230/583] drm/nouveau/fence:: fix warning directly dereferencing a rcu pointer Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 232/583] drm/tilcdc: Fix irq free on unload Greg Kroah-Hartman
                   ` (358 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Uwe Kleine-König,
	Thomas Zimmermann, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

[ Upstream commit ce3e112e7ae854249d8755906acc5f27e1542114 ]

With tpd12s015_remove() marked with __exit this function is discarded
when the driver is compiled as a built-in. The result is that when the
driver unbinds there is no cleanup done which results in resource
leakage or worse.

Fixes: cff5e6f7e83f ("drm/bridge: Add driver for the TI TPD12S015 HDMI level shifter")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20231102165640.3307820-19-u.kleine-koenig@pengutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/bridge/ti-tpd12s015.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/ti-tpd12s015.c b/drivers/gpu/drm/bridge/ti-tpd12s015.c
index e0e015243a60..b588fea12502 100644
--- a/drivers/gpu/drm/bridge/ti-tpd12s015.c
+++ b/drivers/gpu/drm/bridge/ti-tpd12s015.c
@@ -179,7 +179,7 @@ static int tpd12s015_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int __exit tpd12s015_remove(struct platform_device *pdev)
+static int tpd12s015_remove(struct platform_device *pdev)
 {
 	struct tpd12s015_device *tpd = platform_get_drvdata(pdev);
 
@@ -197,7 +197,7 @@ MODULE_DEVICE_TABLE(of, tpd12s015_of_match);
 
 static struct platform_driver tpd12s015_driver = {
 	.probe	= tpd12s015_probe,
-	.remove	= __exit_p(tpd12s015_remove),
+	.remove = tpd12s015_remove,
 	.driver	= {
 		.name	= "tpd12s015",
 		.of_match_table = tpd12s015_of_match,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 232/583] drm/tilcdc: Fix irq free on unload
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (230 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 231/583] drm/bridge: tpd12s015: Drop buggy __exit annotation for remove function Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 233/583] media: pvrusb2: fix use after free on context disconnection Greg Kroah-Hartman
                   ` (357 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Thomas Zimmermann, Aradhya Bhatia,
	Tomi Valkeinen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

[ Upstream commit 38360bf96d816e175bc602c4ee76953cd303b71d ]

The driver only frees the reserved irq if priv->irq_enabled is set to
true. However, the driver mistakenly sets priv->irq_enabled to false,
instead of true, in tilcdc_irq_install(), and thus the driver never
frees the irq, causing issues on loading the driver a second time.

Fixes: b6366814fa77 ("drm/tilcdc: Convert to Linux IRQ interfaces")
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Aradhya Bhatia <a-bhatia1@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230919-lcdc-v1-1-ba60da7421e1@ideasonboard.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 8ebd7134ee21..2f6eaac7f659 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -138,7 +138,7 @@ static int tilcdc_irq_install(struct drm_device *dev, unsigned int irq)
 	if (ret)
 		return ret;
 
-	priv->irq_enabled = false;
+	priv->irq_enabled = true;
 
 	return 0;
 }
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 233/583] media: pvrusb2: fix use after free on context disconnection
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (231 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 232/583] drm/tilcdc: Fix irq free on unload Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 234/583] media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the crash of multi-core JPEG devices Greg Kroah-Hartman
                   ` (356 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ricardo B. Marliere, Mike Isely,
	Hans Verkuil, Mauro Carvalho Chehab, Sasha Levin,
	syzbot+621409285c4156a009b3

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ricardo B. Marliere <ricardo@marliere.net>

[ Upstream commit ded85b0c0edd8f45fec88783d7555a5b982449c1 ]

Upon module load, a kthread is created targeting the
pvr2_context_thread_func function, which may call pvr2_context_destroy
and thus call kfree() on the context object. However, that might happen
before the usb hub_event handler is able to notify the driver. This
patch adds a sanity check before the invalid read reported by syzbot,
within the context disconnection call stack.

Reported-and-tested-by: syzbot+621409285c4156a009b3@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/000000000000a02a4205fff8eb92@google.com/

Fixes: e5be15c63804 ("V4L/DVB (7711): pvrusb2: Fix race on module unload")
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/media/usb/pvrusb2/pvrusb2-context.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/pvrusb2/pvrusb2-context.c b/drivers/media/usb/pvrusb2/pvrusb2-context.c
index 14170a5d72b3..1764674de98b 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-context.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-context.c
@@ -268,7 +268,8 @@ void pvr2_context_disconnect(struct pvr2_context *mp)
 {
 	pvr2_hdw_disconnect(mp->hdw);
 	mp->disconnect_flag = !0;
-	pvr2_context_notify(mp);
+	if (!pvr2_context_shutok())
+		pvr2_context_notify(mp);
 }
 
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 234/583] media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the crash of multi-core JPEG devices
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (232 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 233/583] media: pvrusb2: fix use after free on context disconnection Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 235/583] media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls Greg Kroah-Hartman
                   ` (355 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Zheng Wang, Dmitry Osipenko,
	Hans Verkuil, Mauro Carvalho Chehab, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Zheng Wang <zyytlz.wz@163.com>

[ Upstream commit d8212c5c87c143ca01b78f6bf61244af07e0058e ]

This patch reverts commit c677d7ae8314
("media: mtk-jpeg: Fix use after free bug due to uncanceled work").
The job_timeout_work is initialized only for
the single-core JPEG device so it will cause the crash for multi-core
JPEG devices.

Fix it by removing the cancel_delayed_work_sync function.

Fixes: c677d7ae8314 ("media: mtk-jpeg: Fix use after free bug due to uncanceled work")
Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
index 7194f88edc0f..60425c99a2b8 100644
--- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
@@ -1403,7 +1403,6 @@ static void mtk_jpeg_remove(struct platform_device *pdev)
 {
 	struct mtk_jpeg_dev *jpeg = platform_get_drvdata(pdev);
 
-	cancel_delayed_work_sync(&jpeg->job_timeout_work);
 	pm_runtime_disable(&pdev->dev);
 	video_unregister_device(jpeg->vdev);
 	v4l2_m2m_release(jpeg->m2m_dev);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 235/583] media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (233 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 234/583] media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the crash of multi-core JPEG devices Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 236/583] media: verisilicon: " Greg Kroah-Hartman
                   ` (354 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Paul Kocialkowski, Daniel Almeida,
	Hans Verkuil, Mauro Carvalho Chehab, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

[ Upstream commit 3907f6ef8e0d55a88cdb0f7238363d24e26790ca ]

The (TRY_)DECODER_CMD ioctls are used to support flushing when holding
capture buffers is supported. This is the case of this driver but the
ioctls were never hooked to the ioctl ops.

Add them to correctly support flushing.

Fixes: 0c078e310b6d ("media: visl: add virtual stateless decoder driver")
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/media/test-drivers/visl/visl-video.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/test-drivers/visl/visl-video.c b/drivers/media/test-drivers/visl/visl-video.c
index 7cac6a6456eb..9303a3e118d7 100644
--- a/drivers/media/test-drivers/visl/visl-video.c
+++ b/drivers/media/test-drivers/visl/visl-video.c
@@ -525,6 +525,9 @@ const struct v4l2_ioctl_ops visl_ioctl_ops = {
 	.vidioc_streamon		= v4l2_m2m_ioctl_streamon,
 	.vidioc_streamoff		= v4l2_m2m_ioctl_streamoff,
 
+	.vidioc_decoder_cmd		= v4l2_m2m_ioctl_stateless_decoder_cmd,
+	.vidioc_try_decoder_cmd		= v4l2_m2m_ioctl_stateless_try_decoder_cmd,
+
 	.vidioc_subscribe_event		= v4l2_ctrl_subscribe_event,
 	.vidioc_unsubscribe_event	= v4l2_event_unsubscribe,
 };
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 236/583] media: verisilicon: Hook the (TRY_)DECODER_CMD stateless ioctls
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (234 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 235/583] media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 237/583] media: rkvdec: " Greg Kroah-Hartman
                   ` (353 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Paul Kocialkowski, Daniel Almeida,
	Hans Verkuil, Mauro Carvalho Chehab, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

[ Upstream commit 6c0d9e12b1d12bbd95484e4b99f63feeb423765f ]

The (TRY_)DECODER_CMD ioctls are used to support flushing when holding
capture buffers is supported. This is the case of this driver but the
ioctls were never hooked to the ioctl ops.

Add them to correctly support flushing.

Fixes: 340ce50f75a6 ("media: hantro: Enable HOLD_CAPTURE_BUF for H.264")
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/media/platform/verisilicon/hantro_drv.c  | 2 ++
 drivers/media/platform/verisilicon/hantro_v4l2.c | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
index 50ec24c753e9..1874c976081f 100644
--- a/drivers/media/platform/verisilicon/hantro_drv.c
+++ b/drivers/media/platform/verisilicon/hantro_drv.c
@@ -904,6 +904,8 @@ static int hantro_add_func(struct hantro_dev *vpu, unsigned int funcid)
 
 	if (funcid == MEDIA_ENT_F_PROC_VIDEO_ENCODER) {
 		vpu->encoder = func;
+		v4l2_disable_ioctl(vfd, VIDIOC_TRY_DECODER_CMD);
+		v4l2_disable_ioctl(vfd, VIDIOC_DECODER_CMD);
 	} else {
 		vpu->decoder = func;
 		v4l2_disable_ioctl(vfd, VIDIOC_TRY_ENCODER_CMD);
diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c
index b3ae037a50f6..db145519fc5d 100644
--- a/drivers/media/platform/verisilicon/hantro_v4l2.c
+++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
@@ -785,6 +785,9 @@ const struct v4l2_ioctl_ops hantro_ioctl_ops = {
 	.vidioc_g_selection = vidioc_g_selection,
 	.vidioc_s_selection = vidioc_s_selection,
 
+	.vidioc_decoder_cmd = v4l2_m2m_ioctl_stateless_decoder_cmd,
+	.vidioc_try_decoder_cmd = v4l2_m2m_ioctl_stateless_try_decoder_cmd,
+
 	.vidioc_try_encoder_cmd = v4l2_m2m_ioctl_try_encoder_cmd,
 	.vidioc_encoder_cmd = vidioc_encoder_cmd,
 };
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 237/583] media: rkvdec: Hook the (TRY_)DECODER_CMD stateless ioctls
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (235 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 236/583] media: verisilicon: " Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 238/583] media: amphion: Fix VPU core alias name Greg Kroah-Hartman
                   ` (352 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Paul Kocialkowski, Daniel Almeida,
	Hans Verkuil, Mauro Carvalho Chehab, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

[ Upstream commit 1fb7b5ab62113b29ce331464048d8c39e58fd08a ]

The (TRY_)DECODER_CMD ioctls are used to support flushing when holding
capture buffers is supported. This is the case of this driver but the
ioctls were never hooked to the ioctl ops.

Add them to correctly support flushing.

Fixes: ed7bb87d3d03 ("media: rkvdec: Enable capture buffer holding for H264")
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/staging/media/rkvdec/rkvdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
index 84a41792cb4b..ac398b5a9736 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -461,6 +461,9 @@ static const struct v4l2_ioctl_ops rkvdec_ioctl_ops = {
 
 	.vidioc_streamon = v4l2_m2m_ioctl_streamon,
 	.vidioc_streamoff = v4l2_m2m_ioctl_streamoff,
+
+	.vidioc_decoder_cmd = v4l2_m2m_ioctl_stateless_decoder_cmd,
+	.vidioc_try_decoder_cmd = v4l2_m2m_ioctl_stateless_try_decoder_cmd,
 };
 
 static int rkvdec_queue_setup(struct vb2_queue *vq, unsigned int *num_buffers,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 238/583] media: amphion: Fix VPU core alias name
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (236 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 237/583] media: rkvdec: " Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 239/583] drm/bridge: Fix typo in post_disable() description Greg Kroah-Hartman
                   ` (351 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alexander Stein, Ming Qian,
	Hans Verkuil, Mauro Carvalho Chehab, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alexander Stein <alexander.stein@ew.tq-group.com>

[ Upstream commit f033c87fda47e272bb4f75dc7b03677261d91158 ]

Starting with commit f6038de293f2 ("arm64: dts: imx8qm: Fix VPU core
alias name") the alias for VPU cores uses dashes instead of underscores.
Adjust the alias stem accordingly. Fixes the errors:
amphion-vpu-core 2d040000.vpu-core: can't get vpu core id
amphion-vpu-core 2d050000.vpu-core: can't get vpu core id

Fixes: f6038de293f2 ("arm64: dts: imx8qm: Fix VPU core alias name")
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/media/platform/amphion/vpu_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/amphion/vpu_core.c b/drivers/media/platform/amphion/vpu_core.c
index 1af6fc9460d4..3a2030d02e45 100644
--- a/drivers/media/platform/amphion/vpu_core.c
+++ b/drivers/media/platform/amphion/vpu_core.c
@@ -642,7 +642,7 @@ static int vpu_core_probe(struct platform_device *pdev)
 		return -ENODEV;
 
 	core->type = core->res->type;
-	core->id = of_alias_get_id(dev->of_node, "vpu_core");
+	core->id = of_alias_get_id(dev->of_node, "vpu-core");
 	if (core->id < 0) {
 		dev_err(dev, "can't get vpu core id\n");
 		return core->id;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 239/583] drm/bridge: Fix typo in post_disable() description
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (237 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 238/583] media: amphion: Fix VPU core alias name Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 240/583] f2fs: fix to avoid dirent corruption Greg Kroah-Hartman
                   ` (350 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Dario Binacchi, Robert Foss, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dario Binacchi <dario.binacchi@amarulasolutions.com>

[ Upstream commit 288b039db225676e0c520c981a1b5a2562d893a3 ]

s/singals/signals/

Fixes: 199e4e967af4 ("drm: Extract drm_bridge.h")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20231124094253.658064-1-dario.binacchi@amarulasolutions.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/drm/drm_bridge.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
index c339fc85fd07..103ff57fc83c 100644
--- a/include/drm/drm_bridge.h
+++ b/include/drm/drm_bridge.h
@@ -192,7 +192,7 @@ struct drm_bridge_funcs {
 	 * or &drm_encoder_helper_funcs.dpms hook.
 	 *
 	 * The bridge must assume that the display pipe (i.e. clocks and timing
-	 * singals) feeding it is no longer running when this callback is
+	 * signals) feeding it is no longer running when this callback is
 	 * called.
 	 *
 	 * The @post_disable callback is optional.
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 240/583] f2fs: fix to avoid dirent corruption
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (238 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 239/583] drm/bridge: Fix typo in post_disable() description Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 241/583] drm/radeon/r600_cs: Fix possible int overflows in r600_cs_check_reg() Greg Kroah-Hartman
                   ` (349 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jan Kara, Al Viro, Chao Yu,
	Jaegeuk Kim, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chao Yu <chao@kernel.org>

[ Upstream commit 53edb549565f55ccd0bdf43be3d66ce4c2d48b28 ]

As Al reported in link[1]:

f2fs_rename()
...
	if (old_dir != new_dir && !whiteout)
		f2fs_set_link(old_inode, old_dir_entry,
					old_dir_page, new_dir);
	else
		f2fs_put_page(old_dir_page, 0);

You want correct inumber in the ".." link.  And cross-directory
rename does move the source to new parent, even if you'd been asked
to leave a whiteout in the old place.

[1] https://lore.kernel.org/all/20231017055040.GN800259@ZenIV/

With below testcase, it may cause dirent corruption, due to it missed
to call f2fs_set_link() to update ".." link to new directory.
- mkdir -p dir/foo
- renameat2 -w dir/foo bar

[ASSERT] (__chk_dots_dentries:1421)  --> Bad inode number[0x4] for '..', parent parent ino is [0x3]
[FSCK] other corrupted bugs                           [Fail]

Fixes: 7e01e7ad746b ("f2fs: support RENAME_WHITEOUT")
Cc: Jan Kara <jack@suse.cz>
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Chao Yu <chao@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/f2fs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 193b22a2d6bf..02d9c47797be 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -1106,7 +1106,7 @@ static int f2fs_rename(struct mnt_idmap *idmap, struct inode *old_dir,
 	}
 
 	if (old_dir_entry) {
-		if (old_dir != new_dir && !whiteout)
+		if (old_dir != new_dir)
 			f2fs_set_link(old_inode, old_dir_entry,
 						old_dir_page, new_dir);
 		else
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 241/583] drm/radeon/r600_cs: Fix possible int overflows in r600_cs_check_reg()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (239 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 240/583] f2fs: fix to avoid dirent corruption Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 242/583] drm/radeon/r100: Fix integer overflow issues in r100_cs_track_check() Greg Kroah-Hartman
                   ` (348 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nikita Zhandarovich, Alex Deucher,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nikita Zhandarovich <n.zhandarovich@fintech.ru>

[ Upstream commit 39c960bbf9d9ea862398759e75736cfb68c3446f ]

While improbable, there may be a chance of hitting integer
overflow when the result of radeon_get_ib_value() gets shifted
left.

Avoid it by casting one of the operands to larger data type (u64).

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: 1729dd33d20b ("drm/radeon/kms: r600 CS parser fixes")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/radeon/r600_cs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
index 638f861af80f..6cf54a747749 100644
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -1275,7 +1275,7 @@ static int r600_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx)
 			return -EINVAL;
 		}
 		tmp = (reg - CB_COLOR0_BASE) / 4;
-		track->cb_color_bo_offset[tmp] = radeon_get_ib_value(p, idx) << 8;
+		track->cb_color_bo_offset[tmp] = (u64)radeon_get_ib_value(p, idx) << 8;
 		ib[idx] += (u32)((reloc->gpu_offset >> 8) & 0xffffffff);
 		track->cb_color_base_last[tmp] = ib[idx];
 		track->cb_color_bo[tmp] = reloc->robj;
@@ -1302,7 +1302,7 @@ static int r600_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx)
 					"0x%04X\n", reg);
 			return -EINVAL;
 		}
-		track->htile_offset = radeon_get_ib_value(p, idx) << 8;
+		track->htile_offset = (u64)radeon_get_ib_value(p, idx) << 8;
 		ib[idx] += (u32)((reloc->gpu_offset >> 8) & 0xffffffff);
 		track->htile_bo = reloc->robj;
 		track->db_dirty = true;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 242/583] drm/radeon/r100: Fix integer overflow issues in r100_cs_track_check()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (240 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 241/583] drm/radeon/r600_cs: Fix possible int overflows in r600_cs_check_reg() Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 243/583] drm/radeon: check return value of radeon_ring_lock() Greg Kroah-Hartman
                   ` (347 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nikita Zhandarovich, Alex Deucher,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nikita Zhandarovich <n.zhandarovich@fintech.ru>

[ Upstream commit b5c5baa458faa5430c445acd9a17481274d77ccf ]

It may be possible, albeit unlikely, to encounter integer overflow
during the multiplication of several unsigned int variables, the
result being assigned to a variable 'size' of wider type.

Prevent this potential behaviour by converting one of the multiples
to unsigned long.

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: 0242f74d29df ("drm/radeon: clean up CS functions in r100.c")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/radeon/r100.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index affa9e0309b2..cfeca2694d5f 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -2321,7 +2321,7 @@ int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track)
 	switch (prim_walk) {
 	case 1:
 		for (i = 0; i < track->num_arrays; i++) {
-			size = track->arrays[i].esize * track->max_indx * 4;
+			size = track->arrays[i].esize * track->max_indx * 4UL;
 			if (track->arrays[i].robj == NULL) {
 				DRM_ERROR("(PW %u) Vertex array %u no buffer "
 					  "bound\n", prim_walk, i);
@@ -2340,7 +2340,7 @@ int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track)
 		break;
 	case 2:
 		for (i = 0; i < track->num_arrays; i++) {
-			size = track->arrays[i].esize * (nverts - 1) * 4;
+			size = track->arrays[i].esize * (nverts - 1) * 4UL;
 			if (track->arrays[i].robj == NULL) {
 				DRM_ERROR("(PW %u) Vertex array %u no buffer "
 					  "bound\n", prim_walk, i);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 243/583] drm/radeon: check return value of radeon_ring_lock()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (241 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 242/583] drm/radeon/r100: Fix integer overflow issues in r100_cs_track_check() Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 244/583] drm/tidss: Move reset to the end of dispc_init() Greg Kroah-Hartman
                   ` (346 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nikita Zhandarovich, Alex Deucher,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nikita Zhandarovich <n.zhandarovich@fintech.ru>

[ Upstream commit 71225e1c930942cb1e042fc08c5cc0c4ef30e95e ]

In the unlikely event of radeon_ring_lock() failing, its errno return
value should be processed. This patch checks said return value and
prints a debug message in case of an error.

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: 48c0c902e2e6 ("drm/radeon/kms: add support for CP setup on SI")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/radeon/si.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index a91012447b56..85e9cba49cec 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -3611,6 +3611,10 @@ static int si_cp_start(struct radeon_device *rdev)
 	for (i = RADEON_RING_TYPE_GFX_INDEX; i <= CAYMAN_RING_TYPE_CP2_INDEX; ++i) {
 		ring = &rdev->ring[i];
 		r = radeon_ring_lock(rdev, ring, 2);
+		if (r) {
+			DRM_ERROR("radeon: cp failed to lock ring (%d).\n", r);
+			return r;
+		}
 
 		/* clear the compute context state */
 		radeon_ring_write(ring, PACKET3_COMPUTE(PACKET3_CLEAR_STATE, 0));
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 244/583] drm/tidss: Move reset to the end of dispc_init()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (242 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 243/583] drm/radeon: check return value of radeon_ring_lock() Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 245/583] drm/tidss: Return error value from from softreset Greg Kroah-Hartman
                   ` (345 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Laurent Pinchart, Aradhya Bhatia,
	Tomi Valkeinen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

[ Upstream commit 36d1e0852680aa038e2428d450673390111b165c ]

We do a DSS reset in the middle of the dispc_init(). While that happens
to work now, we should really make sure that e..g the fclk, which is
acquired only later in the function, is enabled when doing a reset. This
will be handled in a later patch, but for now, let's move the
dispc_softreset() call to the end of dispc_init(), which is a sensible
place for it anyway.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Aradhya Bhatia <a-bhatia1@ti.com>
Link: https://lore.kernel.org/r/20231109-tidss-probe-v2-4-ac91b5ea35c0@ideasonboard.com
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Stable-dep-of: bc288a927815 ("drm/tidss: Fix dss reset")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/tidss/tidss_dispc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c
index 9d9dee7abaef..8d822372bf94 100644
--- a/drivers/gpu/drm/tidss/tidss_dispc.c
+++ b/drivers/gpu/drm/tidss/tidss_dispc.c
@@ -2777,10 +2777,6 @@ int dispc_init(struct tidss_device *tidss)
 			return r;
 	}
 
-	/* K2G display controller does not support soft reset */
-	if (feat->subrev != DISPC_K2G)
-		dispc_softreset(dispc);
-
 	for (i = 0; i < dispc->feat->num_vps; i++) {
 		u32 gamma_size = dispc->feat->vp_feat.color.gamma_size;
 		u32 *gamma_table;
@@ -2829,6 +2825,10 @@ int dispc_init(struct tidss_device *tidss)
 	of_property_read_u32(dispc->dev->of_node, "max-memory-bandwidth",
 			     &dispc->memory_bandwidth_limit);
 
+	/* K2G display controller does not support soft reset */
+	if (feat->subrev != DISPC_K2G)
+		dispc_softreset(dispc);
+
 	tidss->dispc = dispc;
 
 	return 0;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 245/583] drm/tidss: Return error value from from softreset
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (243 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 244/583] drm/tidss: Move reset to the end of dispc_init() Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 246/583] drm/tidss: Check for K2G in in dispc_softreset() Greg Kroah-Hartman
                   ` (344 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Aradhya Bhatia, Tomi Valkeinen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

[ Upstream commit aceafbb5035c4bfc75a321863ed1e393d644d2d2 ]

Return an error value from dispc_softreset() so that the caller can
handle the errors.

Reviewed-by: Aradhya Bhatia <a-bhatia1@ti.com>
Link: https://lore.kernel.org/r/20231109-tidss-probe-v2-5-ac91b5ea35c0@ideasonboard.com
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Stable-dep-of: bc288a927815 ("drm/tidss: Fix dss reset")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/tidss/tidss_dispc.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c
index 8d822372bf94..9a29f5fa8453 100644
--- a/drivers/gpu/drm/tidss/tidss_dispc.c
+++ b/drivers/gpu/drm/tidss/tidss_dispc.c
@@ -2702,7 +2702,7 @@ static void dispc_init_errata(struct dispc_device *dispc)
 	}
 }
 
-static void dispc_softreset(struct dispc_device *dispc)
+static int dispc_softreset(struct dispc_device *dispc)
 {
 	u32 val;
 	int ret = 0;
@@ -2712,8 +2712,12 @@ static void dispc_softreset(struct dispc_device *dispc)
 	/* Wait for reset to complete */
 	ret = readl_poll_timeout(dispc->base_common + DSS_SYSSTATUS,
 				 val, val & 1, 100, 5000);
-	if (ret)
-		dev_warn(dispc->dev, "failed to reset dispc\n");
+	if (ret) {
+		dev_err(dispc->dev, "failed to reset dispc\n");
+		return ret;
+	}
+
+	return 0;
 }
 
 int dispc_init(struct tidss_device *tidss)
@@ -2826,8 +2830,11 @@ int dispc_init(struct tidss_device *tidss)
 			     &dispc->memory_bandwidth_limit);
 
 	/* K2G display controller does not support soft reset */
-	if (feat->subrev != DISPC_K2G)
-		dispc_softreset(dispc);
+	if (feat->subrev != DISPC_K2G) {
+		r = dispc_softreset(dispc);
+		if (r)
+			return r;
+	}
 
 	tidss->dispc = dispc;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 246/583] drm/tidss: Check for K2G in in dispc_softreset()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (244 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 245/583] drm/tidss: Return error value from from softreset Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 247/583] drm/tidss: Fix dss reset Greg Kroah-Hartman
                   ` (343 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Laurent Pinchart, Aradhya Bhatia,
	Tomi Valkeinen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

[ Upstream commit 151825150cf9c2e9fb90763d35b9dff3783628ac ]

K2G doesn't have softreset feature. Instead of having every caller of
dispc_softreset() check for K2G, move the check into dispc_softreset(),
and make dispc_softreset() return 0 in case of K2G.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Aradhya Bhatia <a-bhatia1@ti.com>
Link: https://lore.kernel.org/r/20231109-tidss-probe-v2-6-ac91b5ea35c0@ideasonboard.com
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Stable-dep-of: bc288a927815 ("drm/tidss: Fix dss reset")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/tidss/tidss_dispc.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c
index 9a29f5fa8453..2af623842cfb 100644
--- a/drivers/gpu/drm/tidss/tidss_dispc.c
+++ b/drivers/gpu/drm/tidss/tidss_dispc.c
@@ -2707,6 +2707,10 @@ static int dispc_softreset(struct dispc_device *dispc)
 	u32 val;
 	int ret = 0;
 
+	/* K2G display controller does not support soft reset */
+	if (dispc->feat->subrev == DISPC_K2G)
+		return 0;
+
 	/* Soft reset */
 	REG_FLD_MOD(dispc, DSS_SYSCONFIG, 1, 1, 1);
 	/* Wait for reset to complete */
@@ -2829,12 +2833,9 @@ int dispc_init(struct tidss_device *tidss)
 	of_property_read_u32(dispc->dev->of_node, "max-memory-bandwidth",
 			     &dispc->memory_bandwidth_limit);
 
-	/* K2G display controller does not support soft reset */
-	if (feat->subrev != DISPC_K2G) {
-		r = dispc_softreset(dispc);
-		if (r)
-			return r;
-	}
+	r = dispc_softreset(dispc);
+	if (r)
+		return r;
 
 	tidss->dispc = dispc;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 247/583] drm/tidss: Fix dss reset
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (245 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 246/583] drm/tidss: Check for K2G in in dispc_softreset() Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:54 ` [PATCH 6.6 248/583] drm/imx/lcdc: Fix double-free of driver data Greg Kroah-Hartman
                   ` (342 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Aradhya Bhatia, Tomi Valkeinen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

[ Upstream commit bc288a927815efcf9d7f4a54d4d89c5df478c635 ]

The probe function calls dispc_softreset() before runtime PM is enabled
and without enabling any of the DSS clocks. This happens to work by
luck, and we need to make sure the DSS HW is active and the fclk is
enabled.

To fix the above, add a new function, dispc_init_hw(), which does:

- pm_runtime_set_active()
- clk_prepare_enable(fclk)
- dispc_softreset().

This ensures that the reset can be successfully accomplished.

Note that we use pm_runtime_set_active(), not the normal
pm_runtime_get(). The reason for this is that at this point we haven't
enabled the runtime PM yet and also we don't want the normal resume
callback to be called: the dispc resume callback does some initial HW
setup, and it expects that the HW was off (no video ports are
streaming). If the bootloader has enabled the DSS and has set up a
boot time splash-screen, the DSS would be enabled and streaming which
might lead to issues with the normal resume callback.

Fixes: c9b2d923befd ("drm/tidss: Soft Reset DISPC on startup")
Reviewed-by: Aradhya Bhatia <a-bhatia1@ti.com>
Link: https://lore.kernel.org/r/20231109-tidss-probe-v2-8-ac91b5ea35c0@ideasonboard.com
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/tidss/tidss_dispc.c | 45 ++++++++++++++++++++++++++++-
 1 file changed, 44 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c
index 2af623842cfb..98efbaf3b0c2 100644
--- a/drivers/gpu/drm/tidss/tidss_dispc.c
+++ b/drivers/gpu/drm/tidss/tidss_dispc.c
@@ -2724,6 +2724,49 @@ static int dispc_softreset(struct dispc_device *dispc)
 	return 0;
 }
 
+static int dispc_init_hw(struct dispc_device *dispc)
+{
+	struct device *dev = dispc->dev;
+	int ret;
+
+	ret = pm_runtime_set_active(dev);
+	if (ret) {
+		dev_err(dev, "Failed to set DSS PM to active\n");
+		return ret;
+	}
+
+	ret = clk_prepare_enable(dispc->fclk);
+	if (ret) {
+		dev_err(dev, "Failed to enable DSS fclk\n");
+		goto err_runtime_suspend;
+	}
+
+	ret = dispc_softreset(dispc);
+	if (ret)
+		goto err_clk_disable;
+
+	clk_disable_unprepare(dispc->fclk);
+	ret = pm_runtime_set_suspended(dev);
+	if (ret) {
+		dev_err(dev, "Failed to set DSS PM to suspended\n");
+		return ret;
+	}
+
+	return 0;
+
+err_clk_disable:
+	clk_disable_unprepare(dispc->fclk);
+
+err_runtime_suspend:
+	ret = pm_runtime_set_suspended(dev);
+	if (ret) {
+		dev_err(dev, "Failed to set DSS PM to suspended\n");
+		return ret;
+	}
+
+	return ret;
+}
+
 int dispc_init(struct tidss_device *tidss)
 {
 	struct device *dev = tidss->dev;
@@ -2833,7 +2876,7 @@ int dispc_init(struct tidss_device *tidss)
 	of_property_read_u32(dispc->dev->of_node, "max-memory-bandwidth",
 			     &dispc->memory_bandwidth_limit);
 
-	r = dispc_softreset(dispc);
+	r = dispc_init_hw(dispc);
 	if (r)
 		return r;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 248/583] drm/imx/lcdc: Fix double-free of driver data
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (246 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 247/583] drm/tidss: Fix dss reset Greg Kroah-Hartman
@ 2024-01-22 23:54 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 249/583] ASoC: cs35l33: Fix GPIO name and drop legacy include Greg Kroah-Hartman
                   ` (341 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:54 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Uwe Kleine-König,
	Philipp Zabel, Philipp Zabel, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

[ Upstream commit ff3670877e7c73d06c2a835d9abb62efcae0145c ]

The struct imx_lcdc driver data is allocated using devm_drm_dev_alloc()
so it must not be explicitly kfree()d.

Also drm_kms_helper_poll_fini() should not be called as there is no
matching drm_kms_helper_poll_init(). So drop the release function
completely.

Fixes: c87e859cdeb5 ("drm/imx/lcdc: Implement DRM driver for imx25")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230706092731.2630232-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
index 22b65f4a0e30..4beb3b4bd694 100644
--- a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
+++ b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
@@ -342,21 +342,12 @@ static const struct drm_mode_config_helper_funcs imx_lcdc_mode_config_helpers =
 	.atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
 };
 
-static void imx_lcdc_release(struct drm_device *drm)
-{
-	struct imx_lcdc *lcdc = imx_lcdc_from_drmdev(drm);
-
-	drm_kms_helper_poll_fini(drm);
-	kfree(lcdc);
-}
-
 DEFINE_DRM_GEM_DMA_FOPS(imx_lcdc_drm_fops);
 
 static struct drm_driver imx_lcdc_drm_driver = {
 	.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
 	.fops = &imx_lcdc_drm_fops,
 	DRM_GEM_DMA_DRIVER_OPS_VMAP,
-	.release = imx_lcdc_release,
 	.name = "imx-lcdc",
 	.desc = "i.MX LCDC driver",
 	.date = "20200716",
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 249/583] ASoC: cs35l33: Fix GPIO name and drop legacy include
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (247 preceding siblings ...)
  2024-01-22 23:54 ` [PATCH 6.6 248/583] drm/imx/lcdc: Fix double-free of driver data Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 250/583] drm/msm/mdp4: flush vblank event on disable Greg Kroah-Hartman
                   ` (340 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Charles Keepax, Linus Walleij,
	Mark Brown, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Linus Walleij <linus.walleij@linaro.org>

[ Upstream commit 50678d339d670a92658e5538ebee30447c88ccb3 ]

This driver includes the legacy GPIO APIs <linux/gpio.h> and
<linux/of_gpio.h> but does not use any symbols from any of
them.

Drop the includes.

Further the driver is requesting "reset-gpios" rather than
just "reset" from the GPIO framework. This is wrong because
the gpiolib core will add "-gpios" before processing the
request from e.g. device tree. Drop the suffix.

The last problem means that the optional RESET GPIO has
never been properly retrieved and used even if it existed,
but nobody noticed.

Fixes: 3333cb7187b9 ("ASoC: cs35l33: Initial commit of the cs35l33 CODEC driver.")
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231201-descriptors-sound-cirrus-v2-2-ee9f9d4655eb@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/cs35l33.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/soc/codecs/cs35l33.c b/sound/soc/codecs/cs35l33.c
index 9968c2e189e6..d25455f39566 100644
--- a/sound/soc/codecs/cs35l33.c
+++ b/sound/soc/codecs/cs35l33.c
@@ -22,13 +22,11 @@
 #include <sound/soc-dapm.h>
 #include <sound/initval.h>
 #include <sound/tlv.h>
-#include <linux/gpio.h>
 #include <linux/gpio/consumer.h>
 #include <sound/cs35l33.h>
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
 #include <linux/regulator/machine.h>
-#include <linux/of_gpio.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_irq.h>
@@ -1167,7 +1165,7 @@ static int cs35l33_i2c_probe(struct i2c_client *i2c_client)
 
 	/* We could issue !RST or skip it based on AMP topology */
 	cs35l33->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev,
-			"reset-gpios", GPIOD_OUT_HIGH);
+			"reset", GPIOD_OUT_HIGH);
 	if (IS_ERR(cs35l33->reset_gpio)) {
 		dev_err(&i2c_client->dev, "%s ERROR: Can't get reset GPIO\n",
 			__func__);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 250/583] drm/msm/mdp4: flush vblank event on disable
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (248 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 249/583] ASoC: cs35l33: Fix GPIO name and drop legacy include Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 251/583] drm/msm/dpu: Add missing safe_lut_tbl in sc8180x catalog Greg Kroah-Hartman
                   ` (339 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Dmitry Baryshkov, Abhinav Kumar,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

[ Upstream commit c6721b3c6423d8a348ae885a0f4c85e14f9bf85c ]

Flush queued events when disabling the crtc. This avoids timeouts when
we come back and wait for dependencies (like the previous frame's
flip_done).

Fixes: c8afe684c95c ("drm/msm: basic KMS driver for snapdragon")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/569127/
Link: https://lore.kernel.org/r/20231127215401.4064128-1-dmitry.baryshkov@linaro.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
index 169f9de4a12a..3100957225a7 100644
--- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
+++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
@@ -269,6 +269,7 @@ static void mdp4_crtc_atomic_disable(struct drm_crtc *crtc,
 {
 	struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc);
 	struct mdp4_kms *mdp4_kms = get_kms(crtc);
+	unsigned long flags;
 
 	DBG("%s", mdp4_crtc->name);
 
@@ -281,6 +282,14 @@ static void mdp4_crtc_atomic_disable(struct drm_crtc *crtc,
 	mdp_irq_unregister(&mdp4_kms->base, &mdp4_crtc->err);
 	mdp4_disable(mdp4_kms);
 
+	if (crtc->state->event && !crtc->state->active) {
+		WARN_ON(mdp4_crtc->event);
+		spin_lock_irqsave(&mdp4_kms->dev->event_lock, flags);
+		drm_crtc_send_vblank_event(crtc, crtc->state->event);
+		crtc->state->event = NULL;
+		spin_unlock_irqrestore(&mdp4_kms->dev->event_lock, flags);
+	}
+
 	mdp4_crtc->enabled = false;
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 251/583] drm/msm/dpu: Add missing safe_lut_tbl in sc8180x catalog
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (249 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 250/583] drm/msm/mdp4: flush vblank event on disable Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 252/583] drm/msm/dsi: Use pm_runtime_resume_and_get to prevent refcnt leaks Greg Kroah-Hartman
                   ` (338 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Bjorn Andersson, Anton Bambura,
	Dmitry Baryshkov, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bjorn Andersson <quic_bjorande@quicinc.com>

[ Upstream commit 7cc2621f16b644bb7af37987cb471311641a9e56 ]

Similar to SC8280XP, the misconfigured SAFE logic causes rather
significant delays in __arm_smmu_tlb_sync(), resulting in poor
performance for things such as USB.

Introduce appropriate SAFE values for SC8180X to correct this.

Fixes: f3af2d6ee9ab ("drm/msm/dpu: Add SC8180x to hw catalog")
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Reported-by: Anton Bambura <jenneron@postmarketos.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/569840/
Link: https://lore.kernel.org/r/20231130-sc8180x-dpu-safe-lut-v1-1-a8a6bbac36b8@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h
index f3de21025ca7..c92fbf24fbac 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h
@@ -377,6 +377,7 @@ static const struct dpu_perf_cfg sc8180x_perf_data = {
 	.min_llcc_ib = 800000,
 	.min_dram_ib = 800000,
 	.danger_lut_tbl = {0xf, 0xffff, 0x0},
+	.safe_lut_tbl = {0xfff0, 0xf000, 0xffff},
 	.qos_lut_tbl = {
 		{.nentry = ARRAY_SIZE(sc7180_qos_linear),
 		.entries = sc7180_qos_linear
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 252/583] drm/msm/dsi: Use pm_runtime_resume_and_get to prevent refcnt leaks
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (250 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 251/583] drm/msm/dpu: Add missing safe_lut_tbl in sc8180x catalog Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 253/583] drm/drv: propagate errors from drm_modeset_register_all() Greg Kroah-Hartman
                   ` (337 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Dmitry Baryshkov,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Konrad Dybcio <konrad.dybcio@linaro.org>

[ Upstream commit 3d07a411b4faaf2b498760ccf12888f8de529de0 ]

This helper has been introduced to avoid programmer errors (missing
_put calls leading to dangling refcnt) when using pm_runtime_get, use it.

While at it, start checking the return value.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fixes: 5c8290284402 ("drm/msm/dsi: Split PHY drivers to separate files")
Patchwork: https://patchwork.freedesktop.org/patch/543350/
Link: https://lore.kernel.org/r/20230620-topic-dsiphy_rpm-v2-1-a11a751f34f0@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
index 05621e5e7d63..b6314bb66d2f 100644
--- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
+++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
@@ -516,7 +516,9 @@ static int dsi_phy_enable_resource(struct msm_dsi_phy *phy)
 	struct device *dev = &phy->pdev->dev;
 	int ret;
 
-	pm_runtime_get_sync(dev);
+	ret = pm_runtime_resume_and_get(dev);
+	if (ret)
+		return ret;
 
 	ret = clk_prepare_enable(phy->ahb_clk);
 	if (ret) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 253/583] drm/drv: propagate errors from drm_modeset_register_all()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (251 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 252/583] drm/msm/dsi: Use pm_runtime_resume_and_get to prevent refcnt leaks Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 254/583] media: v4l: async: Fix duplicated list deletion Greg Kroah-Hartman
                   ` (336 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Neil Armstrong, Dmitry Baryshkov,
	Maxime Ripard, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

[ Upstream commit 5f8dec200923a76dc57187965fd59c1136f5d085 ]

In case the drm_modeset_register_all() function fails, its error code
will be ignored. Instead make the drm_dev_register() bail out in case of
such an error.

Fixes: 79190ea2658a ("drm: Add callbacks for late registering")
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20231202225552.1283638-1-dmitry.baryshkov@linaro.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/drm_drv.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 3eda026ffac6..71bb8806dc5f 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -940,8 +940,11 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
 			goto err_minors;
 	}
 
-	if (drm_core_check_feature(dev, DRIVER_MODESET))
-		drm_modeset_register_all(dev);
+	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+		ret = drm_modeset_register_all(dev);
+		if (ret)
+			goto err_unload;
+	}
 
 	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
 		 driver->name, driver->major, driver->minor,
@@ -951,6 +954,9 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
 
 	goto out_unlock;
 
+err_unload:
+	if (dev->driver->unload)
+		dev->driver->unload(dev);
 err_minors:
 	remove_compat_control_link(dev);
 	drm_minor_unregister(dev, DRM_MINOR_ACCEL);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 254/583] media: v4l: async: Fix duplicated list deletion
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (252 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 253/583] drm/drv: propagate errors from drm_modeset_register_all() Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 255/583] ASoC: Intel: glk_rt5682_max98357a: fix board id mismatch Greg Kroah-Hartman
                   ` (335 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sebastian Reichel, Sakari Ailus,
	Hans Verkuil, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sebastian Reichel <sre@kernel.org>

[ Upstream commit 3de6ee94aae701fa949cd3b5df6b6a440ddfb8f2 ]

The list deletion call dropped here is already called from the
helper function in the line before. Having a second list_del()
call results in either a warning (with CONFIG_DEBUG_LIST=y):

list_del corruption, c46c8198->next is LIST_POISON1 (00000100)

If CONFIG_DEBUG_LIST is disabled the operation results in a
kernel error due to NULL pointer dereference.

Fixes: 28a1295795d8 ("media: v4l: async: Allow multiple connections between entities")
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/media/v4l2-core/v4l2-async.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index 091e8cf4114b..8cfd593d293d 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -880,7 +880,6 @@ void v4l2_async_unregister_subdev(struct v4l2_subdev *sd)
 				  &asc->notifier->waiting_list);
 
 			v4l2_async_unbind_subdev_one(asc->notifier, asc);
-			list_del(&asc->asc_subdev_entry);
 		}
 	}
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 255/583] ASoC: Intel: glk_rt5682_max98357a: fix board id mismatch
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (253 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 254/583] media: v4l: async: Fix duplicated list deletion Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 256/583] ASoC: Intel: sof_sdw_rt_sdca_jack_common: ctx->headset_codec_dev = NULL Greg Kroah-Hartman
                   ` (334 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Curtis Malainey, Bard Liao,
	Brent Lu, Pierre-Louis Bossart, Mark Brown, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Brent Lu <brent.lu@intel.com>

[ Upstream commit 486ede0df82dd74472c6f5651e38ff48f7f766c1 ]

The drv_name in enumeration table for ALC5682I-VS codec does not match
the board id string in machine driver. Modify the entry of "10EC5682"
to enumerate "RTL5682" as well and remove invalid entry.

Fixes: 88b4d77d6035 ("ASoC: Intel: glk_rt5682_max98357a: support ALC5682I-VS codec")
Reported-by: Curtis Malainey <cujomalainey@chromium.org>
Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231204214200.203100-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/intel/common/soc-acpi-intel-glk-match.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/sound/soc/intel/common/soc-acpi-intel-glk-match.c b/sound/soc/intel/common/soc-acpi-intel-glk-match.c
index 387e73100884..8911c90bbaf6 100644
--- a/sound/soc/intel/common/soc-acpi-intel-glk-match.c
+++ b/sound/soc/intel/common/soc-acpi-intel-glk-match.c
@@ -19,6 +19,11 @@ static const struct snd_soc_acpi_codecs glk_codecs = {
 	.codecs = {"MX98357A"}
 };
 
+static const struct snd_soc_acpi_codecs glk_rt5682_rt5682s_hp = {
+	.num_codecs = 2,
+	.codecs = {"10EC5682", "RTL5682"},
+};
+
 struct snd_soc_acpi_mach snd_soc_acpi_intel_glk_machines[] = {
 	{
 		.id = "INT343A",
@@ -35,20 +40,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_glk_machines[] = {
 		.sof_tplg_filename = "sof-glk-da7219.tplg",
 	},
 	{
-		.id = "10EC5682",
+		.comp_ids = &glk_rt5682_rt5682s_hp,
 		.drv_name = "glk_rt5682_mx98357a",
 		.fw_filename = "intel/dsp_fw_glk.bin",
 		.machine_quirk = snd_soc_acpi_codec_list,
 		.quirk_data = &glk_codecs,
 		.sof_tplg_filename = "sof-glk-rt5682.tplg",
 	},
-	{
-		.id = "RTL5682",
-		.drv_name = "glk_rt5682_max98357a",
-		.machine_quirk = snd_soc_acpi_codec_list,
-		.quirk_data = &glk_codecs,
-		.sof_tplg_filename = "sof-glk-rt5682.tplg",
-	},
 	{
 		.id = "10134242",
 		.drv_name = "glk_cs4242_mx98357a",
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 256/583] ASoC: Intel: sof_sdw_rt_sdca_jack_common: ctx->headset_codec_dev = NULL
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (254 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 255/583] ASoC: Intel: glk_rt5682_max98357a: fix board id mismatch Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 257/583] ASoC: SOF: topology: Use partial match for disconnecting DAI link and DAI widget Greg Kroah-Hartman
                   ` (333 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Péter Ujfalusi, Bard Liao,
	Pierre-Louis Bossart, Mark Brown, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bard Liao <yung-chuan.liao@linux.intel.com>

[ Upstream commit e38e252dbceeef7d2f848017132efd68e9ae1416 ]

sof_sdw_rt_sdca_jack_exit() are used by different codecs, and some of
them use the same dai name.
For example, rt712 and rt713 both use "rt712-sdca-aif1" and
sof_sdw_rt_sdca_jack_exit().
As a result, sof_sdw_rt_sdca_jack_exit() will be called twice by
mc_dailink_exit_loop(). Set ctx->headset_codec_dev = NULL; after
put_device(ctx->headset_codec_dev); to avoid ctx->headset_codec_dev
being put twice.

Fixes: 5360c6704638 ("ASoC: Intel: sof_sdw: add rt712 support")
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231204214200.203100-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c
index 4360b9f5ff2c..890517eb63f6 100644
--- a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c
+++ b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c
@@ -168,6 +168,7 @@ int sof_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link
 
 	device_remove_software_node(ctx->headset_codec_dev);
 	put_device(ctx->headset_codec_dev);
+	ctx->headset_codec_dev = NULL;
 
 	return 0;
 }
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 257/583] ASoC: SOF: topology: Use partial match for disconnecting DAI link and DAI widget
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (255 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 256/583] ASoC: Intel: sof_sdw_rt_sdca_jack_common: ctx->headset_codec_dev = NULL Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 258/583] drm/panfrost: Ignore core_mask for poweroff and disable PWRTRANS irq Greg Kroah-Hartman
                   ` (332 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ranjani Sridharan, Bard Liao,
	Pierre-Louis Bossart, Mark Brown, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bard Liao <yung-chuan.liao@linux.intel.com>

[ Upstream commit 2f03970198d6438d95b96f69041254bd39aafed0 ]

We use partial match for connecting DAI link and DAI widget. We need to
use partial match for disconnecting, too.

Fixes: fe88788779fc ("ASoC: SOF: topology: Use partial match for connecting DAI link and DAI widget")
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231204214713.208951-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/sof/topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index 37ec671a2d76..7133ec13322b 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -1134,7 +1134,7 @@ static void sof_disconnect_dai_widget(struct snd_soc_component *scomp,
 	list_for_each_entry(rtd, &card->rtd_list, list) {
 		/* does stream match DAI link ? */
 		if (!rtd->dai_link->stream_name ||
-		    strcmp(sname, rtd->dai_link->stream_name))
+		    !strstr(rtd->dai_link->stream_name, sname))
 			continue;
 
 		for_each_rtd_cpu_dais(rtd, i, cpu_dai)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 258/583] drm/panfrost: Ignore core_mask for poweroff and disable PWRTRANS irq
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (256 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 257/583] ASoC: SOF: topology: Use partial match for disconnecting DAI link and DAI widget Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 259/583] drm/msm/dpu: correct clk bit for WB2 block Greg Kroah-Hartman
                   ` (331 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Boris Brezillon, Steven Price,
	AngeloGioacchino Del Regno, Marek Szyprowski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

[ Upstream commit a4f5892914ca7709ea6d191f0edace93a5935966 ]

Some SoCs may be equipped with a GPU containing two core groups
and this is exactly the case of Samsung's Exynos 5422 featuring
an ARM Mali-T628 MP6 GPU: the support for this GPU in Panfrost
is partial, as this driver currently supports using only one
core group and that's reflected on all parts of it, including
the power on (and power off, previously to this patch) function.

The issue with this is that even though executing the soft reset
operation should power off all cores unconditionally, on at least
one platform we're seeing a crash that seems to be happening due
to an interrupt firing which may be because we are calling power
transition only on the first core group, leaving the second one
unchanged, or because ISR execution was pending before entering
the panfrost_gpu_power_off() function and executed after powering
off the GPU cores, or all of the above.

Finally, solve this by:
 - Avoid to enable the power transition interrupt on reset; and
 - Ignoring the core_mask and ask the GPU to poweroff both core groups

Fixes: 22aa1a209018 ("drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off()")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231204114215.54575-2-angelogioacchino.delregno@collabora.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/panfrost/panfrost_gpu.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c
index e20619169fe1..eca45b83e4e6 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gpu.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c
@@ -71,7 +71,12 @@ int panfrost_gpu_soft_reset(struct panfrost_device *pfdev)
 	}
 
 	gpu_write(pfdev, GPU_INT_CLEAR, GPU_IRQ_MASK_ALL);
-	gpu_write(pfdev, GPU_INT_MASK, GPU_IRQ_MASK_ALL);
+
+	/* Only enable the interrupts we care about */
+	gpu_write(pfdev, GPU_INT_MASK,
+		  GPU_IRQ_MASK_ERROR |
+		  GPU_IRQ_PERFCNT_SAMPLE_COMPLETED |
+		  GPU_IRQ_CLEAN_CACHES_COMPLETED);
 
 	return 0;
 }
@@ -377,11 +382,10 @@ void panfrost_gpu_power_on(struct panfrost_device *pfdev)
 
 void panfrost_gpu_power_off(struct panfrost_device *pfdev)
 {
-	u64 core_mask = panfrost_get_core_mask(pfdev);
 	int ret;
 	u32 val;
 
-	gpu_write(pfdev, SHADER_PWROFF_LO, pfdev->features.shader_present & core_mask);
+	gpu_write(pfdev, SHADER_PWROFF_LO, pfdev->features.shader_present);
 	ret = readl_relaxed_poll_timeout(pfdev->iomem + SHADER_PWRTRANS_LO,
 					 val, !val, 1, 1000);
 	if (ret)
@@ -393,7 +397,7 @@ void panfrost_gpu_power_off(struct panfrost_device *pfdev)
 	if (ret)
 		dev_err(pfdev->dev, "tiler power transition timeout");
 
-	gpu_write(pfdev, L2_PWROFF_LO, pfdev->features.l2_present & core_mask);
+	gpu_write(pfdev, L2_PWROFF_LO, pfdev->features.l2_present);
 	ret = readl_poll_timeout(pfdev->iomem + L2_PWRTRANS_LO,
 				 val, !val, 0, 1000);
 	if (ret)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 259/583] drm/msm/dpu: correct clk bit for WB2 block
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (257 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 258/583] drm/panfrost: Ignore core_mask for poweroff and disable PWRTRANS irq Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 260/583] drm/radeon: check the alloc_workqueue return value in radeon_crtc_init() Greg Kroah-Hartman
                   ` (330 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Dmitry Baryshkov, Abhinav Kumar,
	Paloma Arellano, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

[ Upstream commit e843ca2f30e630675e2d2a75c96f4844f2854430 ]

On sc7280 there are two clk bits for WB2: vbif_cli and clk_ctrl. While
programming the VBIF params of WB, the driver should be toggling the
former bit, while the sc7180_mdp, sc7280_mdp and sm8250_mdp structs
list the latter one.

Correct that to ensure proper programming sequence for WB2 on these
platforms.

Fixes: 255f056181ac ("drm/msm/dpu: sc7180: add missing WB2 clock control")
Fixes: 3ce166380567 ("drm/msm/dpu: add writeback support for sc7280")
Fixes: 53324b99bd7b ("drm/msm/dpu: add writeback blocks to the sm8250 DPU catalog")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Tested-by: Paloma Arellano <quic_parellan@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/570185/
Link: https://lore.kernel.org/r/20231203002437.1291595-1-dmitry.baryshkov@linaro.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h | 2 +-
 drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_2_sc7180.h | 2 +-
 drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h
index 5f9b437b82a6..ee781037ada9 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h
@@ -32,7 +32,7 @@ static const struct dpu_mdp_cfg sm8250_mdp = {
 		[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2bc, .bit_off = 8 },
 		[DPU_CLK_CTRL_DMA3] = { .reg_off = 0x2c4, .bit_off = 8 },
 		[DPU_CLK_CTRL_REG_DMA] = { .reg_off = 0x2bc, .bit_off = 20 },
-		[DPU_CLK_CTRL_WB2] = { .reg_off = 0x3b8, .bit_off = 24 },
+		[DPU_CLK_CTRL_WB2] = { .reg_off = 0x2bc, .bit_off = 16 },
 	},
 };
 
diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_2_sc7180.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_2_sc7180.h
index d030c08636b4..69d3f7e5e095 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_2_sc7180.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_2_sc7180.h
@@ -25,7 +25,7 @@ static const struct dpu_mdp_cfg sc7180_mdp = {
 		[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 },
 		[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },
 		[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 },
-		[DPU_CLK_CTRL_WB2] = { .reg_off = 0x3b8, .bit_off = 24 },
+		[DPU_CLK_CTRL_WB2] = { .reg_off = 0x2bc, .bit_off = 16 },
 	},
 };
 
diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h
index 3b5061c4402a..9195cb996f44 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h
@@ -25,7 +25,7 @@ static const struct dpu_mdp_cfg sc7280_mdp = {
 		[DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 },
 		[DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },
 		[DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 },
-		[DPU_CLK_CTRL_WB2] = { .reg_off = 0x3b8, .bit_off = 24 },
+		[DPU_CLK_CTRL_WB2] = { .reg_off = 0x2bc, .bit_off = 16 },
 	},
 };
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 260/583] drm/radeon: check the alloc_workqueue return value in radeon_crtc_init()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (258 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 259/583] drm/msm/dpu: correct clk bit for WB2 block Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 261/583] drm/radeon/dpm: fix a memleak in sumo_parse_power_table Greg Kroah-Hartman
                   ` (329 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yang Yingliang, Alex Deucher, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yang Yingliang <yangyingliang@huawei.com>

[ Upstream commit 7a2464fac80d42f6f8819fed97a553e9c2f43310 ]

check the alloc_workqueue return value in radeon_crtc_init()
to avoid null-ptr-deref.

Fixes: fa7f517cb26e ("drm/radeon: rework page flip handling v4")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/radeon/radeon_display.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index 901e75ec70ff..efd18c8d84c8 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -687,11 +687,16 @@ static void radeon_crtc_init(struct drm_device *dev, int index)
 	if (radeon_crtc == NULL)
 		return;
 
+	radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI, 0);
+	if (!radeon_crtc->flip_queue) {
+		kfree(radeon_crtc);
+		return;
+	}
+
 	drm_crtc_init(dev, &radeon_crtc->base, &radeon_crtc_funcs);
 
 	drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256);
 	radeon_crtc->crtc_id = index;
-	radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI, 0);
 	rdev->mode_info.crtcs[index] = radeon_crtc;
 
 	if (rdev->family >= CHIP_BONAIRE) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 261/583] drm/radeon/dpm: fix a memleak in sumo_parse_power_table
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (259 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 260/583] drm/radeon: check the alloc_workqueue return value in radeon_crtc_init() Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 262/583] drm/radeon/trinity_dpm: fix a memleak in trinity_parse_power_table Greg Kroah-Hartman
                   ` (328 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Zhipeng Lu, Alex Deucher, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Zhipeng Lu <alexious@zju.edu.cn>

[ Upstream commit 0737df9ed0997f5b8addd6e2b9699a8c6edba2e4 ]

The rdev->pm.dpm.ps allocated by kcalloc should be freed in every
following error-handling path. However, in the error-handling of
rdev->pm.power_state[i].clock_info the rdev->pm.dpm.ps is not freed,
resulting in a memleak in this function.

Fixes: 80ea2c129c76 ("drm/radeon/kms: add dpm support for sumo asics (v2)")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/radeon/sumo_dpm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c b/drivers/gpu/drm/radeon/sumo_dpm.c
index f74f381af05f..d49c145db437 100644
--- a/drivers/gpu/drm/radeon/sumo_dpm.c
+++ b/drivers/gpu/drm/radeon/sumo_dpm.c
@@ -1493,8 +1493,10 @@ static int sumo_parse_power_table(struct radeon_device *rdev)
 		non_clock_array_index = power_state->v2.nonClockInfoIndex;
 		non_clock_info = (struct _ATOM_PPLIB_NONCLOCK_INFO *)
 			&non_clock_info_array->nonClockInfo[non_clock_array_index];
-		if (!rdev->pm.power_state[i].clock_info)
+		if (!rdev->pm.power_state[i].clock_info) {
+			kfree(rdev->pm.dpm.ps);
 			return -EINVAL;
+		}
 		ps = kzalloc(sizeof(struct sumo_ps), GFP_KERNEL);
 		if (ps == NULL) {
 			kfree(rdev->pm.dpm.ps);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 262/583] drm/radeon/trinity_dpm: fix a memleak in trinity_parse_power_table
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (260 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 261/583] drm/radeon/dpm: fix a memleak in sumo_parse_power_table Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 263/583] drm/bridge: cdns-mhdp8546: Fix use of uninitialized variable Greg Kroah-Hartman
                   ` (327 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Zhipeng Lu, Alex Deucher, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Zhipeng Lu <alexious@zju.edu.cn>

[ Upstream commit 28c28d7f77c06ac2c0b8f9c82bc04eba22912b3b ]

The rdev->pm.dpm.ps allocated by kcalloc should be freed in every
following error-handling path. However, in the error-handling of
rdev->pm.power_state[i].clock_info the rdev->pm.dpm.ps is not freed,
resulting in a memleak in this function.

Fixes: d70229f70447 ("drm/radeon/kms: add dpm support for trinity asics")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/radeon/trinity_dpm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/trinity_dpm.c
index 08ea1c864cb2..ef1cc7bad20a 100644
--- a/drivers/gpu/drm/radeon/trinity_dpm.c
+++ b/drivers/gpu/drm/radeon/trinity_dpm.c
@@ -1726,8 +1726,10 @@ static int trinity_parse_power_table(struct radeon_device *rdev)
 		non_clock_array_index = power_state->v2.nonClockInfoIndex;
 		non_clock_info = (struct _ATOM_PPLIB_NONCLOCK_INFO *)
 			&non_clock_info_array->nonClockInfo[non_clock_array_index];
-		if (!rdev->pm.power_state[i].clock_info)
+		if (!rdev->pm.power_state[i].clock_info) {
+			kfree(rdev->pm.dpm.ps);
 			return -EINVAL;
+		}
 		ps = kzalloc(sizeof(struct sumo_ps), GFP_KERNEL);
 		if (ps == NULL) {
 			kfree(rdev->pm.dpm.ps);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 263/583] drm/bridge: cdns-mhdp8546: Fix use of uninitialized variable
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (261 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 262/583] drm/radeon/trinity_dpm: fix a memleak in trinity_parse_power_table Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 264/583] drm/bridge: tc358767: Fix return value on error case Greg Kroah-Hartman
                   ` (326 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Maxime Ripard, Tomi Valkeinen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

[ Upstream commit 155d6fb61270dd297f128731cd155080deee8f3a ]

'ret' could be uninitialized at the end of the function, although it's
not clear if that can happen in practice.

Fixes: 6a3608eae6d3 ("drm: bridge: cdns-mhdp8546: Enable HDCP")
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231103-uninit-fixes-v2-3-c22b2444f5f5@ideasonboard.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c
index 946212a95598..5e3b8edcf794 100644
--- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c
+++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c
@@ -403,7 +403,8 @@ static int _cdns_mhdp_hdcp_disable(struct cdns_mhdp_device *mhdp)
 
 static int _cdns_mhdp_hdcp_enable(struct cdns_mhdp_device *mhdp, u8 content_type)
 {
-	int ret, tries = 3;
+	int ret = -EINVAL;
+	int tries = 3;
 	u32 i;
 
 	for (i = 0; i < tries; i++) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 264/583] drm/bridge: tc358767: Fix return value on error case
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (262 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 263/583] drm/bridge: cdns-mhdp8546: Fix use of uninitialized variable Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 265/583] media: cx231xx: fix a memleak in cx231xx_init_isoc Greg Kroah-Hartman
                   ` (325 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Maxime Ripard, Tomi Valkeinen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

[ Upstream commit 32bd29b619638256c5b75fb021d6d9f12fc4a984 ]

If the hpd_pin is invalid, the driver returns 'ret'. But 'ret' contains
0, instead of an error value.

Return -EINVAL instead.

Fixes: f25ee5017e4f ("drm/bridge: tc358767: add IRQ and HPD support")
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231103-uninit-fixes-v2-4-c22b2444f5f5@ideasonboard.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/bridge/tc358767.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
index b45bffab7c81..d941c3a0e611 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -2273,7 +2273,7 @@ static int tc_probe(struct i2c_client *client)
 	} else {
 		if (tc->hpd_pin < 0 || tc->hpd_pin > 1) {
 			dev_err(dev, "failed to parse HPD number\n");
-			return ret;
+			return -EINVAL;
 		}
 	}
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 265/583] media: cx231xx: fix a memleak in cx231xx_init_isoc
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (263 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 264/583] drm/bridge: tc358767: Fix return value on error case Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 266/583] RDMA/hns: Fix memory leak in free_mr_init() Greg Kroah-Hartman
                   ` (324 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Zhipeng Lu, Hans Verkuil, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Zhipeng Lu <alexious@zju.edu.cn>

[ Upstream commit 5d3c8990e2bbf929cb211563dadd70708f42e4e6 ]

The dma_q->p_left_data alloced by kzalloc should be freed in all the
following error handling paths. However, it hasn't been freed in the
allocation error paths of dev->video_mode.isoc_ctl.urb and
dev->video_mode.isoc_ctl.transfer_buffer.

On the other hand, the dma_q->p_left_data did be freed in the
error-handling paths after that of dev->video_mode.isoc_ctl.urb and
dev->video_mode.isoc_ctl.transfer_buffer, by calling
cx231xx_uninit_isoc(dev). So the same free operation should be done in
error-handling paths of those two allocation.

Fixes: 64fbf4445526 ("[media] cx231xx: Added support for Carraera, Shelby, RDx_253S and VIDEO_GRABBER")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/media/usb/cx231xx/cx231xx-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c b/drivers/media/usb/cx231xx/cx231xx-core.c
index 727e6268567f..f1feccc28bf0 100644
--- a/drivers/media/usb/cx231xx/cx231xx-core.c
+++ b/drivers/media/usb/cx231xx/cx231xx-core.c
@@ -1024,6 +1024,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
 	if (!dev->video_mode.isoc_ctl.urb) {
 		dev_err(dev->dev,
 			"cannot alloc memory for usb buffers\n");
+		kfree(dma_q->p_left_data);
 		return -ENOMEM;
 	}
 
@@ -1033,6 +1034,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
 		dev_err(dev->dev,
 			"cannot allocate memory for usbtransfer\n");
 		kfree(dev->video_mode.isoc_ctl.urb);
+		kfree(dma_q->p_left_data);
 		return -ENOMEM;
 	}
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 266/583] RDMA/hns: Fix memory leak in free_mr_init()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (264 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 265/583] media: cx231xx: fix a memleak in cx231xx_init_isoc Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 267/583] clk: qcom: gpucc-sm8150: Update the gpu_cc_pll1 config Greg Kroah-Hartman
                   ` (323 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chengchang Tang, Junxian Huang,
	Leon Romanovsky, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chengchang Tang <tangchengchang@huawei.com>

[ Upstream commit 288f535951aa81ed674f5e5477ab11b9d9351b8c ]

When a reserved QP fails to be created, the memory of the remaining
created reserved QPs is leaked.

Fixes: 70f92521584f ("RDMA/hns: Use the reserved loopback QPs to free MR before destroying MPT")
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://lore.kernel.org/r/20231207114231.2872104-6-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 84c18996517c..3c62a0042da4 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -2693,6 +2693,10 @@ static int free_mr_alloc_res(struct hns_roce_dev *hr_dev)
 	return 0;
 
 create_failed_qp:
+	for (i--; i >= 0; i--) {
+		hns_roce_v2_destroy_qp(&free_mr->rsv_qp[i]->ibqp, NULL);
+		kfree(free_mr->rsv_qp[i]);
+	}
 	hns_roce_destroy_cq(cq, NULL);
 	kfree(cq);
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 267/583] clk: qcom: gpucc-sm8150: Update the gpu_cc_pll1 config
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (265 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 266/583] RDMA/hns: Fix memory leak in free_mr_init() Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 268/583] media: bttv: start_streaming should return a proper error code Greg Kroah-Hartman
                   ` (322 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Satya Priya Kakitapalli,
	Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>

[ Upstream commit 6ebd9a4f8b8d2b35cf965a04849c4ba763722f13 ]

Update the test_ctl_hi_val and test_ctl_hi1_val of gpu_cc_pll1
as per latest HW recommendation.

Fixes: 0cef71f2ccc8 ("clk: qcom: Add graphics clock controller driver for SM8150")
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231122042814.4158076-1-quic_skakitap@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/clk/qcom/gpucc-sm8150.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/qcom/gpucc-sm8150.c b/drivers/clk/qcom/gpucc-sm8150.c
index 8422fd047493..c89a5b59ddb7 100644
--- a/drivers/clk/qcom/gpucc-sm8150.c
+++ b/drivers/clk/qcom/gpucc-sm8150.c
@@ -37,8 +37,8 @@ static struct alpha_pll_config gpu_cc_pll1_config = {
 	.config_ctl_hi_val = 0x00002267,
 	.config_ctl_hi1_val = 0x00000024,
 	.test_ctl_val = 0x00000000,
-	.test_ctl_hi_val = 0x00000002,
-	.test_ctl_hi1_val = 0x00000000,
+	.test_ctl_hi_val = 0x00000000,
+	.test_ctl_hi1_val = 0x00000020,
 	.user_ctl_val = 0x00000000,
 	.user_ctl_hi_val = 0x00000805,
 	.user_ctl_hi1_val = 0x000000d0,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 268/583] media: bttv: start_streaming should return a proper error code
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (266 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 267/583] clk: qcom: gpucc-sm8150: Update the gpu_cc_pll1 config Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 269/583] media: bttv: add back vbi hack Greg Kroah-Hartman
                   ` (321 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hans Verkuil, Mauro Carvalho Chehab,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hans Verkuil <hverkuil-cisco@xs4all.nl>

[ Upstream commit 0d75bb6ae127f5e3fd0e2239714908fd2038193d ]

The start_streaming callback returned 0 or 1 instead of a
proper error code. Fix that.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Fixes: b7ec3212a73a ("media: bttv: convert to vb2")
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/media/pci/bt8xx/bttv-driver.c | 6 ++----
 drivers/media/pci/bt8xx/bttv-vbi.c    | 8 +++-----
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index 09a193bb87df..8e8c9dada67a 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -1536,13 +1536,11 @@ static void buf_cleanup(struct vb2_buffer *vb)
 
 static int start_streaming(struct vb2_queue *q, unsigned int count)
 {
-	int ret = 1;
 	int seqnr = 0;
 	struct bttv_buffer *buf;
 	struct bttv *btv = vb2_get_drv_priv(q);
 
-	ret = check_alloc_btres_lock(btv, RESOURCE_VIDEO_STREAM);
-	if (ret == 0) {
+	if (!check_alloc_btres_lock(btv, RESOURCE_VIDEO_STREAM)) {
 		if (btv->field_count)
 			seqnr++;
 		while (!list_empty(&btv->capture)) {
@@ -1553,7 +1551,7 @@ static int start_streaming(struct vb2_queue *q, unsigned int count)
 			vb2_buffer_done(&buf->vbuf.vb2_buf,
 					VB2_BUF_STATE_QUEUED);
 		}
-		return !ret;
+		return -EBUSY;
 	}
 	if (!vb2_is_streaming(&btv->vbiq)) {
 		init_irqreg(btv);
diff --git a/drivers/media/pci/bt8xx/bttv-vbi.c b/drivers/media/pci/bt8xx/bttv-vbi.c
index ab213e51ec95..e489a3acb4b9 100644
--- a/drivers/media/pci/bt8xx/bttv-vbi.c
+++ b/drivers/media/pci/bt8xx/bttv-vbi.c
@@ -123,14 +123,12 @@ static void buf_cleanup_vbi(struct vb2_buffer *vb)
 
 static int start_streaming_vbi(struct vb2_queue *q, unsigned int count)
 {
-	int ret;
 	int seqnr = 0;
 	struct bttv_buffer *buf;
 	struct bttv *btv = vb2_get_drv_priv(q);
 
 	btv->framedrop = 0;
-	ret = check_alloc_btres_lock(btv, RESOURCE_VBI);
-	if (ret == 0) {
+	if (!check_alloc_btres_lock(btv, RESOURCE_VBI)) {
 		if (btv->field_count)
 			seqnr++;
 		while (!list_empty(&btv->vcapture)) {
@@ -141,13 +139,13 @@ static int start_streaming_vbi(struct vb2_queue *q, unsigned int count)
 			vb2_buffer_done(&buf->vbuf.vb2_buf,
 					VB2_BUF_STATE_QUEUED);
 		}
-		return !ret;
+		return -EBUSY;
 	}
 	if (!vb2_is_streaming(&btv->capq)) {
 		init_irqreg(btv);
 		btv->field_count = 0;
 	}
-	return !ret;
+	return 0;
 }
 
 static void stop_streaming_vbi(struct vb2_queue *q)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 269/583] media: bttv: add back vbi hack
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (267 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 268/583] media: bttv: start_streaming should return a proper error code Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 270/583] media: imx-mipi-csis: Fix clock handling in remove() Greg Kroah-Hartman
                   ` (320 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hans Verkuil,
	Dr. David Alan Gilbert, Mauro Carvalho Chehab, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hans Verkuil <hverkuil-cisco@xs4all.nl>

[ Upstream commit 3f1faa154a4316b1b585a25394697504b3c24e98 ]

The old (now removed) videobuf framework had an optional vbi hack where
the sequence number of the frame counter was copied in the last 4 bytes
of the buffer. This hack was active only for the read() interface
(so not for streaming I/O), and it was enabled by bttv. This allowed
applications that used read() for the VBI data to match it with the
corresponding video frame.

When bttv was converted to vb2 this hack was forgotten, but some old
applications rely on this.

So add this back, but this time in the bttv driver rather than in the
vb2 framework.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Fixes: b7ec3212a73a ("media: bttv: convert to vb2")
Tested-by: Dr. David Alan Gilbert <dave@treblig.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/media/pci/bt8xx/bttv-driver.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index 8e8c9dada67a..49a3dd70ec0f 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -2772,6 +2772,27 @@ bttv_irq_wakeup_vbi(struct bttv *btv, struct bttv_buffer *wakeup,
 		return;
 	wakeup->vbuf.vb2_buf.timestamp = ktime_get_ns();
 	wakeup->vbuf.sequence = btv->field_count >> 1;
+
+	/*
+	 * Ugly hack for backwards compatibility.
+	 * Some applications expect that the last 4 bytes of
+	 * the VBI data contains the sequence number.
+	 *
+	 * This makes it possible to associate the VBI data
+	 * with the video frame if you use read() to get the
+	 * VBI data.
+	 */
+	if (vb2_fileio_is_active(wakeup->vbuf.vb2_buf.vb2_queue)) {
+		u32 *vaddr = vb2_plane_vaddr(&wakeup->vbuf.vb2_buf, 0);
+		unsigned long size =
+			vb2_get_plane_payload(&wakeup->vbuf.vb2_buf, 0) / 4;
+
+		if (vaddr && size) {
+			vaddr += size - 1;
+			*vaddr = wakeup->vbuf.sequence;
+		}
+	}
+
 	vb2_buffer_done(&wakeup->vbuf.vb2_buf, state);
 	if (btv->field_count == 0)
 		btor(BT848_INT_VSYNC, BT848_INT_MASK);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 270/583] media: imx-mipi-csis: Fix clock handling in remove()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (268 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 269/583] media: bttv: add back vbi hack Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 271/583] media: imx-mipi-csis: Drop extra clock enable at probe() Greg Kroah-Hartman
                   ` (319 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Tomi Valkeinen, Laurent Pinchart,
	Mauro Carvalho Chehab, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

[ Upstream commit 5705b0e0eb550ff834125a46a4ef99b62093d83d ]

The driver always calls mipi_csis_runtime_suspend() and
mipi_csis_clk_disable() in remove(). This causes multiple WARNs from the
kernel, as the clocks get disabled too many times.

Fix the remove() to call mipi_csis_runtime_suspend() and
mipi_csis_clk_disable() in a way that reverses what is done in probe().

Link: https://lore.kernel.org/r/20231122-imx-csis-v2-1-e44b8dc4cb66@ideasonboard.com

Fixes: 7807063b862b ("media: staging/imx7: add MIPI CSI-2 receiver subdev for i.MX7")
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/media/platform/nxp/imx-mipi-csis.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c
index 5f93712bf485..e7629c9f5746 100644
--- a/drivers/media/platform/nxp/imx-mipi-csis.c
+++ b/drivers/media/platform/nxp/imx-mipi-csis.c
@@ -1504,8 +1504,10 @@ static void mipi_csis_remove(struct platform_device *pdev)
 	v4l2_async_nf_cleanup(&csis->notifier);
 	v4l2_async_unregister_subdev(&csis->sd);
 
+	if (!pm_runtime_enabled(&pdev->dev))
+		mipi_csis_runtime_suspend(&pdev->dev);
+
 	pm_runtime_disable(&pdev->dev);
-	mipi_csis_runtime_suspend(&pdev->dev);
 	mipi_csis_clk_disable(csis);
 	v4l2_subdev_cleanup(&csis->sd);
 	media_entity_cleanup(&csis->sd.entity);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 271/583] media: imx-mipi-csis: Drop extra clock enable at probe()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (269 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 270/583] media: imx-mipi-csis: Fix clock handling in remove() Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 272/583] media: dt-bindings: media: rkisp1: Fix the port description for the parallel interface Greg Kroah-Hartman
                   ` (318 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Tomi Valkeinen, Laurent Pinchart,
	Mauro Carvalho Chehab, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

[ Upstream commit fb387fcb5cdd0384ba04a5d15a3605e2dccdab2a ]

The driver always enables the clocks at probe() and disables them only
at remove(). It is not clear why the driver does this, as it supports
runtime PM, and enables and disables the clocks in the runtime resume
and suspend callbacks. Also, in the case runtime PM is not available,
the driver calls the resume and suspend callbacks manually from probe()
and remove().

Drop the unnecessary clock enable, thus enabling the clocks only when
actually needed.

Link: https://lore.kernel.org/r/20231122-imx-csis-v2-2-e44b8dc4cb66@ideasonboard.com

Fixes: 7807063b862b ("media: staging/imx7: add MIPI CSI-2 receiver subdev for i.MX7")
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/media/platform/nxp/imx-mipi-csis.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c
index e7629c9f5746..142ac7b73e14 100644
--- a/drivers/media/platform/nxp/imx-mipi-csis.c
+++ b/drivers/media/platform/nxp/imx-mipi-csis.c
@@ -1437,24 +1437,18 @@ static int mipi_csis_probe(struct platform_device *pdev)
 	/* Reset PHY and enable the clocks. */
 	mipi_csis_phy_reset(csis);
 
-	ret = mipi_csis_clk_enable(csis);
-	if (ret < 0) {
-		dev_err(csis->dev, "failed to enable clocks: %d\n", ret);
-		return ret;
-	}
-
 	/* Now that the hardware is initialized, request the interrupt. */
 	ret = devm_request_irq(dev, irq, mipi_csis_irq_handler, 0,
 			       dev_name(dev), csis);
 	if (ret) {
 		dev_err(dev, "Interrupt request failed\n");
-		goto err_disable_clock;
+		return ret;
 	}
 
 	/* Initialize and register the subdev. */
 	ret = mipi_csis_subdev_init(csis);
 	if (ret < 0)
-		goto err_disable_clock;
+		return ret;
 
 	platform_set_drvdata(pdev, &csis->sd);
 
@@ -1488,8 +1482,6 @@ static int mipi_csis_probe(struct platform_device *pdev)
 	v4l2_async_nf_unregister(&csis->notifier);
 	v4l2_async_nf_cleanup(&csis->notifier);
 	v4l2_async_unregister_subdev(&csis->sd);
-err_disable_clock:
-	mipi_csis_clk_disable(csis);
 
 	return ret;
 }
@@ -1508,7 +1500,6 @@ static void mipi_csis_remove(struct platform_device *pdev)
 		mipi_csis_runtime_suspend(&pdev->dev);
 
 	pm_runtime_disable(&pdev->dev);
-	mipi_csis_clk_disable(csis);
 	v4l2_subdev_cleanup(&csis->sd);
 	media_entity_cleanup(&csis->sd.entity);
 	pm_runtime_set_suspended(&pdev->dev);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 272/583] media: dt-bindings: media: rkisp1: Fix the port description for the parallel interface
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (270 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 271/583] media: imx-mipi-csis: Drop extra clock enable at probe() Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 273/583] media: rkisp1: Fix media device memory leak Greg Kroah-Hartman
                   ` (317 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Mehdi Djait, Conor Dooley,
	Laurent Pinchart, Mauro Carvalho Chehab, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mehdi Djait <mehdi.djait@bootlin.com>

[ Upstream commit 25bf28b25a2afa1864b7143259443160d9163ea0 ]

The bus-type belongs to the endpoint's properties and should therefore
be moved.

Link: https://lore.kernel.org/r/20231115164407.99876-1-mehdi.djait@bootlin.com

Fixes: 6a0eaa25bf36 ("media: dt-bindings: media: rkisp1: Add port for parallel interface")
Signed-off-by: Mehdi Djait <mehdi.djait@bootlin.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../devicetree/bindings/media/rockchip-isp1.yaml      | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/rockchip-isp1.yaml b/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
index e466dff8286d..afcaa427d48b 100644
--- a/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
+++ b/Documentation/devicetree/bindings/media/rockchip-isp1.yaml
@@ -90,15 +90,16 @@ properties:
         description: connection point for input on the parallel interface
 
         properties:
-          bus-type:
-            enum: [5, 6]
-
           endpoint:
             $ref: video-interfaces.yaml#
             unevaluatedProperties: false
 
-        required:
-          - bus-type
+            properties:
+              bus-type:
+                enum: [5, 6]
+
+            required:
+              - bus-type
 
     anyOf:
       - required:
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 273/583] media: rkisp1: Fix media device memory leak
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (271 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 272/583] media: dt-bindings: media: rkisp1: Fix the port description for the parallel interface Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 274/583] drm/msm/adreno: Fix A680 chip id Greg Kroah-Hartman
                   ` (316 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Tommaso Merciai, Tomi Valkeinen,
	Laurent Pinchart, Mauro Carvalho Chehab, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

[ Upstream commit 452f604a4683654f4d9472b3126d8da61d748443 ]

Add missing calls to media_device_cleanup() to fix memory leak.

Link: https://lore.kernel.org/r/20231122-rkisp-fixes-v2-1-78bfb63cdcf8@ideasonboard.com

Fixes: d65dd85281fb ("media: staging: rkisp1: add Rockchip ISP1 base driver")
Reviewed-by: Tommaso Merciai <tomm.merciai@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
index c41abd2833f1..894d5afaff4e 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
@@ -582,7 +582,7 @@ static int rkisp1_probe(struct platform_device *pdev)
 
 	ret = v4l2_device_register(rkisp1->dev, &rkisp1->v4l2_dev);
 	if (ret)
-		goto err_pm_runtime_disable;
+		goto err_media_dev_cleanup;
 
 	ret = media_device_register(&rkisp1->media_dev);
 	if (ret) {
@@ -617,6 +617,8 @@ static int rkisp1_probe(struct platform_device *pdev)
 	media_device_unregister(&rkisp1->media_dev);
 err_unreg_v4l2_dev:
 	v4l2_device_unregister(&rkisp1->v4l2_dev);
+err_media_dev_cleanup:
+	media_device_cleanup(&rkisp1->media_dev);
 err_pm_runtime_disable:
 	pm_runtime_disable(&pdev->dev);
 	return ret;
@@ -637,6 +639,8 @@ static void rkisp1_remove(struct platform_device *pdev)
 	media_device_unregister(&rkisp1->media_dev);
 	v4l2_device_unregister(&rkisp1->v4l2_dev);
 
+	media_device_cleanup(&rkisp1->media_dev);
+
 	pm_runtime_disable(&pdev->dev);
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 274/583] drm/msm/adreno: Fix A680 chip id
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (272 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 273/583] media: rkisp1: Fix media device memory leak Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 275/583] drm/panel: st7701: Fix AVCL calculation Greg Kroah-Hartman
                   ` (315 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Bjorn Andersson, Rob Clark, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bjorn Andersson <quic_bjorande@quicinc.com>

[ Upstream commit 3e6688fd96966b6c275e95c39aa367bc0a490ccd ]

The only A680 referenced from DeviceTree is patch level 1, which since
commit '90b593ce1c9e ("drm/msm/adreno: Switch to chip-id for identifying
GPU")' isn't a known chip id.

Correct the chip id to allow the A680 to be recognized again.

Fixes: 90b593ce1c9e ("drm/msm/adreno: Switch to chip-id for identifying GPU")
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/569839/
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/msm/adreno/adreno_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c
index f2d9d34ed50f..b7b527e21dac 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_device.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
@@ -462,7 +462,7 @@ static const struct adreno_info gpulist[] = {
 			{ 190, 1 },
 		),
 	}, {
-		.chip_ids = ADRENO_CHIP_IDS(0x06080000),
+		.chip_ids = ADRENO_CHIP_IDS(0x06080001),
 		.family = ADRENO_6XX_GEN2,
 		.revn = 680,
 		.fw = {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 275/583] drm/panel: st7701: Fix AVCL calculation
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (273 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 274/583] drm/msm/adreno: Fix A680 chip id Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 276/583] f2fs: fix to wait on block writeback for post_read case Greg Kroah-Hartman
                   ` (314 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chris Morgan, Neil Armstrong, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chris Morgan <macromorgan@hotmail.com>

[ Upstream commit 799825aa87200ade1ba21db853d1c2ff720dcfe0 ]

The AVCL register, according to the datasheet, comes in increments
of -0.2v between -4.4v (represented by 0x0) to -5.0v (represented
by 0x3). The current calculation is done by adding the defined
AVCL value in mV to -4400 and then dividing by 200 to get the register
value. Unfortunately if I subtract -4400 from -4400 I get -8800, which
divided by 200 gives me -44. If I instead subtract -4400 from -4400
I get 0, which divided by 200 gives me 0. Based on the datasheet this
is the expected register value.

Fixes: 83b7a8e7e88e ("drm/panel/panel-sitronix-st7701: Parametrize voltage and timing")

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231208154847.130615-2-macroalpha82@gmail.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20231208154847.130615-2-macroalpha82@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/panel/panel-sitronix-st7701.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c b/drivers/gpu/drm/panel/panel-sitronix-st7701.c
index 0459965e1b4f..036ac403ed21 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c
@@ -288,7 +288,7 @@ static void st7701_init_sequence(struct st7701 *st7701)
 		   FIELD_PREP(DSI_CMD2_BK1_PWRCTRL2_AVDD_MASK,
 			      DIV_ROUND_CLOSEST(desc->avdd_mv - 6200, 200)) |
 		   FIELD_PREP(DSI_CMD2_BK1_PWRCTRL2_AVCL_MASK,
-			      DIV_ROUND_CLOSEST(-4400 + desc->avcl_mv, 200)));
+			      DIV_ROUND_CLOSEST(-4400 - desc->avcl_mv, 200)));
 
 	/* T2D = 0.2us * T2D[3:0] */
 	ST7701_DSI(st7701, DSI_CMD2_BK1_SPD1,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 276/583] f2fs: fix to wait on block writeback for post_read case
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (274 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 275/583] drm/panel: st7701: Fix AVCL calculation Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 277/583] f2fs: fix to check compress file in f2fs_move_file_range() Greg Kroah-Hartman
                   ` (313 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Chao Yu, Jaegeuk Kim, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chao Yu <chao@kernel.org>

[ Upstream commit 55fdc1c24a1d6229fe0ecf31335fb9a2eceaaa00 ]

If inode is compressed, but not encrypted, it missed to call
f2fs_wait_on_block_writeback() to wait for GCed page writeback
in IPU write path.

Thread A				GC-Thread
					- f2fs_gc
					 - do_garbage_collect
					  - gc_data_segment
					   - move_data_block
					    - f2fs_submit_page_write
					     migrate normal cluster's block via
					     meta_inode's page cache
- f2fs_write_single_data_page
 - f2fs_do_write_data_page
  - f2fs_inplace_write_data
   - f2fs_submit_page_bio

IRQ
- f2fs_read_end_io
					IRQ
					old data overrides new data due to
					out-of-order GC and common IO.
					- f2fs_read_end_io

Fixes: 4c8ff7095bef ("f2fs: support data compression")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/f2fs/data.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 1ac34eb49a0e..f5f33926acf8 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -2568,9 +2568,6 @@ int f2fs_encrypt_one_page(struct f2fs_io_info *fio)
 
 	page = fio->compressed_page ? fio->compressed_page : fio->page;
 
-	/* wait for GCed page writeback via META_MAPPING */
-	f2fs_wait_on_block_writeback(inode, fio->old_blkaddr);
-
 	if (fscrypt_inode_uses_inline_crypto(inode))
 		return 0;
 
@@ -2752,6 +2749,10 @@ int f2fs_do_write_data_page(struct f2fs_io_info *fio)
 		goto out_writepage;
 	}
 
+	/* wait for GCed page writeback via META_MAPPING */
+	if (fio->post_read)
+		f2fs_wait_on_block_writeback(inode, fio->old_blkaddr);
+
 	/*
 	 * If current allocation needs SSR,
 	 * it had better in-place writes for updated data.
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 277/583] f2fs: fix to check compress file in f2fs_move_file_range()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (275 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 276/583] f2fs: fix to wait on block writeback for post_read case Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 278/583] f2fs: fix to update iostat correctly in f2fs_filemap_fault() Greg Kroah-Hartman
                   ` (312 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Chao Yu, Jaegeuk Kim, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chao Yu <chao@kernel.org>

[ Upstream commit fb9b65340c818875ea86464faf3c744bdce0055c ]

f2fs_move_file_range() doesn't support migrating compressed cluster
data, let's add the missing check condition and return -EOPNOTSUPP
for the case until we support it.

Fixes: 4c8ff7095bef ("f2fs: support data compression")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/f2fs/file.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index a06f03d23762..e36a3208a3e9 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -2818,6 +2818,11 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in,
 			goto out;
 	}
 
+	if (f2fs_compressed_file(src) || f2fs_compressed_file(dst)) {
+		ret = -EOPNOTSUPP;
+		goto out_unlock;
+	}
+
 	ret = -EINVAL;
 	if (pos_in + len > src->i_size || pos_in + len < pos_in)
 		goto out_unlock;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 278/583] f2fs: fix to update iostat correctly in f2fs_filemap_fault()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (276 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 277/583] f2fs: fix to check compress file in f2fs_move_file_range() Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 279/583] media: dvbdev: drop refcount on error path in dvb_device_open() Greg Kroah-Hartman
                   ` (311 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Chao Yu, Jaegeuk Kim, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chao Yu <chao@kernel.org>

[ Upstream commit bb34cc6ca87ff78f9fb5913d7619dc1389554da6 ]

In f2fs_filemap_fault(), it fixes to update iostat info only if
VM_FAULT_LOCKED is tagged in return value of filemap_fault().

Fixes: 8b83ac81f428 ("f2fs: support read iostat")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/f2fs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index e36a3208a3e9..a631d706e117 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -42,7 +42,7 @@ static vm_fault_t f2fs_filemap_fault(struct vm_fault *vmf)
 	vm_fault_t ret;
 
 	ret = filemap_fault(vmf);
-	if (!ret)
+	if (ret & VM_FAULT_LOCKED)
 		f2fs_update_iostat(F2FS_I_SB(inode), inode,
 					APP_MAPPED_READ_IO, F2FS_BLKSIZE);
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 279/583] media: dvbdev: drop refcount on error path in dvb_device_open()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (277 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 278/583] f2fs: fix to update iostat correctly in f2fs_filemap_fault() Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 280/583] media: dvb-frontends: m88ds3103: Fix a memory leak in an error handling path of m88ds3103_probe() Greg Kroah-Hartman
                   ` (310 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Dan Carpenter, Hans Verkuil, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dan Carpenter <dan.carpenter@linaro.org>

[ Upstream commit a2dd235df435a05d389240be748909ada91201d2 ]

If call to file->f_op->open() fails, then call dvb_device_put(dvbdev).

Fixes: 0fc044b2b5e2 ("media: dvbdev: adopts refcnt to avoid UAF")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/media/dvb-core/dvbdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c
index 305bb21d843c..49f0eb7d0b9d 100644
--- a/drivers/media/dvb-core/dvbdev.c
+++ b/drivers/media/dvb-core/dvbdev.c
@@ -104,6 +104,8 @@ static int dvb_device_open(struct inode *inode, struct file *file)
 			err = file->f_op->open(inode, file);
 		up_read(&minor_rwsem);
 		mutex_unlock(&dvbdev_mutex);
+		if (err)
+			dvb_device_put(dvbdev);
 		return err;
 	}
 fail:
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 280/583] media: dvb-frontends: m88ds3103: Fix a memory leak in an error handling path of m88ds3103_probe()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (278 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 279/583] media: dvbdev: drop refcount on error path in dvb_device_open() Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 281/583] clk: renesas: rzg2l-cpg: Reuse code in rzg2l_cpg_reset() Greg Kroah-Hartman
                   ` (309 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christophe JAILLET, Hans Verkuil,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

[ Upstream commit 5b2f885e2f6f482d05c23f04c8240f7b4fc5bdb5 ]

If an error occurs after a successful i2c_mux_add_adapter(), then
i2c_mux_del_adapters() should be called to free some resources, as
already done in the remove function.

Fixes: e6089feca460 ("media: m88ds3103: Add support for ds3103b demod")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/media/dvb-frontends/m88ds3103.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c
index cf037b61b226..affaa36d3147 100644
--- a/drivers/media/dvb-frontends/m88ds3103.c
+++ b/drivers/media/dvb-frontends/m88ds3103.c
@@ -1894,7 +1894,7 @@ static int m88ds3103_probe(struct i2c_client *client)
 		/* get frontend address */
 		ret = regmap_read(dev->regmap, 0x29, &utmp);
 		if (ret)
-			goto err_kfree;
+			goto err_del_adapters;
 		dev->dt_addr = ((utmp & 0x80) == 0) ? 0x42 >> 1 : 0x40 >> 1;
 		dev_dbg(&client->dev, "dt addr is 0x%02x\n", dev->dt_addr);
 
@@ -1902,11 +1902,14 @@ static int m88ds3103_probe(struct i2c_client *client)
 						      dev->dt_addr);
 		if (IS_ERR(dev->dt_client)) {
 			ret = PTR_ERR(dev->dt_client);
-			goto err_kfree;
+			goto err_del_adapters;
 		}
 	}
 
 	return 0;
+
+err_del_adapters:
+	i2c_mux_del_adapters(dev->muxc);
 err_kfree:
 	kfree(dev);
 err:
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 281/583] clk: renesas: rzg2l-cpg: Reuse code in rzg2l_cpg_reset()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (279 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 280/583] media: dvb-frontends: m88ds3103: Fix a memory leak in an error handling path of m88ds3103_probe() Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 282/583] clk: renesas: rzg2l: Check reset monitor registers Greg Kroah-Hartman
                   ` (308 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Claudiu Beznea, Geert Uytterhoeven,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

[ Upstream commit 5f9e29b9159a41fcf6733c3b59fa46a90ce3ae20 ]

Code in rzg2l_cpg_reset() is equivalent with the combined code of
rzg2l_cpg_assert() and rzg2l_cpg_deassert(). There is no need to have
different versions thus re-use rzg2l_cpg_assert() and rzg2l_cpg_deassert().

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20231120070024.4079344-2-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Stable-dep-of: da235d2fac21 ("clk: renesas: rzg2l: Check reset monitor registers")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/clk/renesas/rzg2l-cpg.c | 38 +++++++++++++--------------------
 1 file changed, 15 insertions(+), 23 deletions(-)

diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c
index 3f01620e292b..8303282cf528 100644
--- a/drivers/clk/renesas/rzg2l-cpg.c
+++ b/drivers/clk/renesas/rzg2l-cpg.c
@@ -1105,29 +1105,6 @@ rzg2l_cpg_register_mod_clk(const struct rzg2l_mod_clk *mod,
 
 #define rcdev_to_priv(x)	container_of(x, struct rzg2l_cpg_priv, rcdev)
 
-static int rzg2l_cpg_reset(struct reset_controller_dev *rcdev,
-			   unsigned long id)
-{
-	struct rzg2l_cpg_priv *priv = rcdev_to_priv(rcdev);
-	const struct rzg2l_cpg_info *info = priv->info;
-	unsigned int reg = info->resets[id].off;
-	u32 dis = BIT(info->resets[id].bit);
-	u32 we = dis << 16;
-
-	dev_dbg(rcdev->dev, "reset id:%ld offset:0x%x\n", id, CLK_RST_R(reg));
-
-	/* Reset module */
-	writel(we, priv->base + CLK_RST_R(reg));
-
-	/* Wait for at least one cycle of the RCLK clock (@ ca. 32 kHz) */
-	udelay(35);
-
-	/* Release module from reset state */
-	writel(we | dis, priv->base + CLK_RST_R(reg));
-
-	return 0;
-}
-
 static int rzg2l_cpg_assert(struct reset_controller_dev *rcdev,
 			    unsigned long id)
 {
@@ -1158,6 +1135,21 @@ static int rzg2l_cpg_deassert(struct reset_controller_dev *rcdev,
 	return 0;
 }
 
+static int rzg2l_cpg_reset(struct reset_controller_dev *rcdev,
+			   unsigned long id)
+{
+	int ret;
+
+	ret = rzg2l_cpg_assert(rcdev, id);
+	if (ret)
+		return ret;
+
+	/* Wait for at least one cycle of the RCLK clock (@ ca. 32 kHz) */
+	udelay(35);
+
+	return rzg2l_cpg_deassert(rcdev, id);
+}
+
 static int rzg2l_cpg_status(struct reset_controller_dev *rcdev,
 			    unsigned long id)
 {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 282/583] clk: renesas: rzg2l: Check reset monitor registers
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (280 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 281/583] clk: renesas: rzg2l-cpg: Reuse code in rzg2l_cpg_reset() Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 283/583] drm/msm/dpu: Set input_sel bit for INTF Greg Kroah-Hartman
                   ` (307 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Claudiu Beznea, Geert Uytterhoeven,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

[ Upstream commit da235d2fac212d0add570e755feb1167a830bc99 ]

The hardware manual of both RZ/G2L and RZ/G3S specifies that the reset
monitor registers need to be interrogated when the reset signals are
toggled (chapters "Procedures for Supplying and Stopping Reset Signals"
and "Procedure for Activating Modules").  Without this, there is a
chance that different modules (e.g. Ethernet) are not ready after their
reset signal is toggled, leading to failures (on probe or resume from
deep sleep states).

The same indications are available for RZ/V2M for TYPE-B reset controls.

Fixes: ef3c613ccd68 ("clk: renesas: Add CPG core wrapper for RZ/G2L SoC")
Fixes: 8090bea32484 ("clk: renesas: rzg2l: Add support for RZ/V2M reset monitor reg")
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20231207070700.4156557-2-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/clk/renesas/rzg2l-cpg.c | 59 ++++++++++++++++++++++++---------
 1 file changed, 44 insertions(+), 15 deletions(-)

diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c
index 8303282cf528..75f9eca020ce 100644
--- a/drivers/clk/renesas/rzg2l-cpg.c
+++ b/drivers/clk/renesas/rzg2l-cpg.c
@@ -1111,12 +1111,27 @@ static int rzg2l_cpg_assert(struct reset_controller_dev *rcdev,
 	struct rzg2l_cpg_priv *priv = rcdev_to_priv(rcdev);
 	const struct rzg2l_cpg_info *info = priv->info;
 	unsigned int reg = info->resets[id].off;
-	u32 value = BIT(info->resets[id].bit) << 16;
+	u32 mask = BIT(info->resets[id].bit);
+	s8 monbit = info->resets[id].monbit;
+	u32 value = mask << 16;
 
 	dev_dbg(rcdev->dev, "assert id:%ld offset:0x%x\n", id, CLK_RST_R(reg));
 
 	writel(value, priv->base + CLK_RST_R(reg));
-	return 0;
+
+	if (info->has_clk_mon_regs) {
+		reg = CLK_MRST_R(reg);
+	} else if (monbit >= 0) {
+		reg = CPG_RST_MON;
+		mask = BIT(monbit);
+	} else {
+		/* Wait for at least one cycle of the RCLK clock (@ ca. 32 kHz) */
+		udelay(35);
+		return 0;
+	}
+
+	return readl_poll_timeout_atomic(priv->base + reg, value,
+					 value & mask, 10, 200);
 }
 
 static int rzg2l_cpg_deassert(struct reset_controller_dev *rcdev,
@@ -1125,14 +1140,28 @@ static int rzg2l_cpg_deassert(struct reset_controller_dev *rcdev,
 	struct rzg2l_cpg_priv *priv = rcdev_to_priv(rcdev);
 	const struct rzg2l_cpg_info *info = priv->info;
 	unsigned int reg = info->resets[id].off;
-	u32 dis = BIT(info->resets[id].bit);
-	u32 value = (dis << 16) | dis;
+	u32 mask = BIT(info->resets[id].bit);
+	s8 monbit = info->resets[id].monbit;
+	u32 value = (mask << 16) | mask;
 
 	dev_dbg(rcdev->dev, "deassert id:%ld offset:0x%x\n", id,
 		CLK_RST_R(reg));
 
 	writel(value, priv->base + CLK_RST_R(reg));
-	return 0;
+
+	if (info->has_clk_mon_regs) {
+		reg = CLK_MRST_R(reg);
+	} else if (monbit >= 0) {
+		reg = CPG_RST_MON;
+		mask = BIT(monbit);
+	} else {
+		/* Wait for at least one cycle of the RCLK clock (@ ca. 32 kHz) */
+		udelay(35);
+		return 0;
+	}
+
+	return readl_poll_timeout_atomic(priv->base + reg, value,
+					 !(value & mask), 10, 200);
 }
 
 static int rzg2l_cpg_reset(struct reset_controller_dev *rcdev,
@@ -1144,9 +1173,6 @@ static int rzg2l_cpg_reset(struct reset_controller_dev *rcdev,
 	if (ret)
 		return ret;
 
-	/* Wait for at least one cycle of the RCLK clock (@ ca. 32 kHz) */
-	udelay(35);
-
 	return rzg2l_cpg_deassert(rcdev, id);
 }
 
@@ -1155,18 +1181,21 @@ static int rzg2l_cpg_status(struct reset_controller_dev *rcdev,
 {
 	struct rzg2l_cpg_priv *priv = rcdev_to_priv(rcdev);
 	const struct rzg2l_cpg_info *info = priv->info;
-	unsigned int reg = info->resets[id].off;
-	u32 bitmask = BIT(info->resets[id].bit);
 	s8 monbit = info->resets[id].monbit;
+	unsigned int reg;
+	u32 bitmask;
 
 	if (info->has_clk_mon_regs) {
-		return !!(readl(priv->base + CLK_MRST_R(reg)) & bitmask);
+		reg = CLK_MRST_R(info->resets[id].off);
+		bitmask = BIT(info->resets[id].bit);
 	} else if (monbit >= 0) {
-		u32 monbitmask = BIT(monbit);
-
-		return !!(readl(priv->base + CPG_RST_MON) & monbitmask);
+		reg = CPG_RST_MON;
+		bitmask = BIT(monbit);
+	} else {
+		return -ENOTSUPP;
 	}
-	return -ENOTSUPP;
+
+	return !!(readl(priv->base + reg) & bitmask);
 }
 
 static const struct reset_control_ops rzg2l_cpg_reset_ops = {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 283/583] drm/msm/dpu: Set input_sel bit for INTF
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (281 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 282/583] clk: renesas: rzg2l: Check reset monitor registers Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 284/583] drm/msm/dpu: Drop enable and frame_count parameters from dpu_hw_setup_misr() Greg Kroah-Hartman
                   ` (306 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Rob Clark, Jessica Zhang,
	Abhinav Kumar, Dmitry Baryshkov, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jessica Zhang <quic_jesszhan@quicinc.com>

[ Upstream commit 980fffd0c69e5df0f67ee089d405899d532aeeab ]

Set the input_sel bit for encoders as it was missed in the initial
implementation.

Reported-by: Rob Clark <robdclark@gmail.com>
Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/39
Fixes: 91143873a05d ("drm/msm/dpu: Add MISR register support for interface")
Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/572007/
Link: https://lore.kernel.org/r/20231213-encoder-fixup-v4-1-6da6cd1bf118@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c   | 2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c | 9 +++++++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h | 3 ++-
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c
index 8ec6505d9e78..bce8783d644c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c
@@ -320,7 +320,7 @@ static u32 dpu_hw_intf_get_line_count(struct dpu_hw_intf *intf)
 
 static void dpu_hw_intf_setup_misr(struct dpu_hw_intf *intf, bool enable, u32 frame_count)
 {
-	dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, enable, frame_count);
+	dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, enable, frame_count, 0x1);
 }
 
 static int dpu_hw_intf_collect_misr(struct dpu_hw_intf *intf, u32 *misr_value)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c
index d1c3bd8379ea..a34cf8c979cb 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c
@@ -83,7 +83,7 @@ static void dpu_hw_lm_setup_border_color(struct dpu_hw_mixer *ctx,
 
 static void dpu_hw_lm_setup_misr(struct dpu_hw_mixer *ctx, bool enable, u32 frame_count)
 {
-	dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, enable, frame_count);
+	dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, enable, frame_count, 0x0);
 }
 
 static int dpu_hw_lm_collect_misr(struct dpu_hw_mixer *ctx, u32 *misr_value)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c
index 9d2273fd2fed..da04a914b065 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c
@@ -481,9 +481,13 @@ void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset,
 		      cfg->danger_safe_en ? QOS_QOS_CTRL_DANGER_SAFE_EN : 0);
 }
 
+/*
+ * note: Aside from encoders, input_sel should be set to 0x0 by default
+ */
 void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
 		u32 misr_ctrl_offset,
-		bool enable, u32 frame_count)
+		bool enable, u32 frame_count,
+		u8 input_sel)
 {
 	u32 config = 0;
 
@@ -494,7 +498,8 @@ void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
 
 	if (enable) {
 		config = (frame_count & MISR_FRAME_COUNT_MASK) |
-			MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK;
+			MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK |
+			((input_sel & 0xF) << 24);
 
 		DPU_REG_WRITE(c, misr_ctrl_offset, config);
 	} else {
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h
index 1f6079f47071..f7061fcc97f7 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h
@@ -360,7 +360,8 @@ void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset,
 void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
 		u32 misr_ctrl_offset,
 		bool enable,
-		u32 frame_count);
+		u32 frame_count,
+		u8 input_sel);
 
 int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c,
 		u32 misr_ctrl_offset,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 284/583] drm/msm/dpu: Drop enable and frame_count parameters from dpu_hw_setup_misr()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (282 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 283/583] drm/msm/dpu: Set input_sel bit for INTF Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 285/583] drm/mediatek: Return error if MDP RDMA failed to enable the clock Greg Kroah-Hartman
                   ` (305 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jessica Zhang, Abhinav Kumar,
	Dmitry Baryshkov, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jessica Zhang <quic_jesszhan@quicinc.com>

[ Upstream commit 3313c23f3eab698bc6b904520ee608fc0f7b03d0 ]

Drop the enable and frame_count parameters from dpu_hw_setup_misr() as they
are always set to the same values.

In addition, replace MISR_FRAME_COUNT_MASK with MISR_FRAME_COUNT as
frame_count is always set to the same value.

Fixes: 7b37523fb1d1 ("drm/msm/dpu: Move MISR methods to dpu_hw_util")
Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/572009/
Link: https://lore.kernel.org/r/20231213-encoder-fixup-v4-2-6da6cd1bf118@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c    |  4 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c |  4 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c |  6 +++---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h |  4 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c   |  6 +++---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h   |  3 ++-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c | 19 +++++--------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h |  9 +++------
 8 files changed, 22 insertions(+), 33 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index 8ce7586e2ddf..e238e4e8116c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
  * Copyright (C) 2013 Red Hat
  * Author: Rob Clark <robdclark@gmail.com>
@@ -125,7 +125,7 @@ static void dpu_crtc_setup_lm_misr(struct dpu_crtc_state *crtc_state)
 			continue;
 
 		/* Calculate MISR over 1 frame */
-		m->hw_lm->ops.setup_misr(m->hw_lm, true, 1);
+		m->hw_lm->ops.setup_misr(m->hw_lm);
 	}
 }
 
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index d34e684a4178..b02aa2eb6c17 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -2,7 +2,7 @@
 /*
  * Copyright (C) 2013 Red Hat
  * Copyright (c) 2014-2018, 2020-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Author: Rob Clark <robdclark@gmail.com>
  */
@@ -255,7 +255,7 @@ void dpu_encoder_setup_misr(const struct drm_encoder *drm_enc)
 		if (!phys->hw_intf || !phys->hw_intf->ops.setup_misr)
 			continue;
 
-		phys->hw_intf->ops.setup_misr(phys->hw_intf, true, 1);
+		phys->hw_intf->ops.setup_misr(phys->hw_intf);
 	}
 }
 
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c
index bce8783d644c..da071b1c02af 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
  */
 
@@ -318,9 +318,9 @@ static u32 dpu_hw_intf_get_line_count(struct dpu_hw_intf *intf)
 	return DPU_REG_READ(c, INTF_LINE_COUNT);
 }
 
-static void dpu_hw_intf_setup_misr(struct dpu_hw_intf *intf, bool enable, u32 frame_count)
+static void dpu_hw_intf_setup_misr(struct dpu_hw_intf *intf)
 {
-	dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, enable, frame_count, 0x1);
+	dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, 0x1);
 }
 
 static int dpu_hw_intf_collect_misr(struct dpu_hw_intf *intf, u32 *misr_value)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h
index 77f80531782b..4e86108bee28 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
  */
 
@@ -94,7 +94,7 @@ struct dpu_hw_intf_ops {
 
 	void (*bind_pingpong_blk)(struct dpu_hw_intf *intf,
 			const enum dpu_pingpong pp);
-	void (*setup_misr)(struct dpu_hw_intf *intf, bool enable, u32 frame_count);
+	void (*setup_misr)(struct dpu_hw_intf *intf);
 	int (*collect_misr)(struct dpu_hw_intf *intf, u32 *misr_value);
 
 	// Tearcheck on INTF since DPU 5.0.0
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c
index a34cf8c979cb..a590c1f7465f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -81,9 +81,9 @@ static void dpu_hw_lm_setup_border_color(struct dpu_hw_mixer *ctx,
 	}
 }
 
-static void dpu_hw_lm_setup_misr(struct dpu_hw_mixer *ctx, bool enable, u32 frame_count)
+static void dpu_hw_lm_setup_misr(struct dpu_hw_mixer *ctx)
 {
-	dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, enable, frame_count, 0x0);
+	dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, 0x0);
 }
 
 static int dpu_hw_lm_collect_misr(struct dpu_hw_mixer *ctx, u32 *misr_value)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h
index 36992d046a53..98b77cda6547 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -57,7 +58,7 @@ struct dpu_hw_lm_ops {
 	/**
 	 * setup_misr: Enable/disable MISR
 	 */
-	void (*setup_misr)(struct dpu_hw_mixer *ctx, bool enable, u32 frame_count);
+	void (*setup_misr)(struct dpu_hw_mixer *ctx);
 
 	/**
 	 * collect_misr: Read MISR signature
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c
index da04a914b065..6eee9f68ab4c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
  */
 #define pr_fmt(fmt)	"[drm:%s:%d] " fmt, __func__, __LINE__
@@ -485,9 +485,7 @@ void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset,
  * note: Aside from encoders, input_sel should be set to 0x0 by default
  */
 void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
-		u32 misr_ctrl_offset,
-		bool enable, u32 frame_count,
-		u8 input_sel)
+		u32 misr_ctrl_offset, u8 input_sel)
 {
 	u32 config = 0;
 
@@ -496,16 +494,9 @@ void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
 	/* Clear old MISR value (in case it's read before a new value is calculated)*/
 	wmb();
 
-	if (enable) {
-		config = (frame_count & MISR_FRAME_COUNT_MASK) |
-			MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK |
-			((input_sel & 0xF) << 24);
-
-		DPU_REG_WRITE(c, misr_ctrl_offset, config);
-	} else {
-		DPU_REG_WRITE(c, misr_ctrl_offset, 0);
-	}
-
+	config = MISR_FRAME_COUNT | MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK |
+		((input_sel & 0xF) << 24);
+	DPU_REG_WRITE(c, misr_ctrl_offset, config);
 }
 
 int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c,
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h
index f7061fcc97f7..0aed54d7f6c9 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -13,7 +13,7 @@
 #include "dpu_hw_catalog.h"
 
 #define REG_MASK(n)                     ((BIT(n)) - 1)
-#define MISR_FRAME_COUNT_MASK           0xFF
+#define MISR_FRAME_COUNT                0x1
 #define MISR_CTRL_ENABLE                BIT(8)
 #define MISR_CTRL_STATUS                BIT(9)
 #define MISR_CTRL_STATUS_CLEAR          BIT(10)
@@ -358,10 +358,7 @@ void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset,
 			   const struct dpu_hw_qos_cfg *cfg);
 
 void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
-		u32 misr_ctrl_offset,
-		bool enable,
-		u32 frame_count,
-		u8 input_sel);
+		u32 misr_ctrl_offset, u8 input_sel);
 
 int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c,
 		u32 misr_ctrl_offset,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 285/583] drm/mediatek: Return error if MDP RDMA failed to enable the clock
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (283 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 284/583] drm/msm/dpu: Drop enable and frame_count parameters from dpu_hw_setup_misr() Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 286/583] drm/mediatek: Remove the redundant driver data for DPI Greg Kroah-Hartman
                   ` (304 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, CK Hu, AngeloGioacchino Del Regno,
	Hsiao Chien Sung, Chun-Kuang Hu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hsiao Chien Sung <shawn.sung@mediatek.com>

[ Upstream commit 21b287146adf39304193e4c49198021e06a28ded ]

Return the result of clk_prepare_enable() instead of
always returns 0.

Fixes: f8946e2b6bb2 ("drm/mediatek: Add display MDP RDMA support for MT8195")

Reviewed-by: CK Hu <ck.hu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231214055847.4936-21-shawn.sung@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/mediatek/mtk_mdp_rdma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
index c3adaeefd551..c7233d0ac210 100644
--- a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
+++ b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c
@@ -246,8 +246,7 @@ int mtk_mdp_rdma_clk_enable(struct device *dev)
 {
 	struct mtk_mdp_rdma *rdma = dev_get_drvdata(dev);
 
-	clk_prepare_enable(rdma->clk);
-	return 0;
+	return clk_prepare_enable(rdma->clk);
 }
 
 void mtk_mdp_rdma_clk_disable(struct device *dev)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 286/583] drm/mediatek: Remove the redundant driver data for DPI
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (284 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 285/583] drm/mediatek: Return error if MDP RDMA failed to enable the clock Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 287/583] drm/mediatek: Fix underrun in VDO1 when switches off the layer Greg Kroah-Hartman
                   ` (303 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, CK Hu, AngeloGioacchino Del Regno,
	Hsiao Chien Sung, Chun-Kuang Hu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hsiao Chien Sung <shawn.sung@mediatek.com>

[ Upstream commit 8ac6935e5689a491f0bec78fec732722b3dad094 ]

DPI input is in 1T2P mode on both MT8195 and MT8188.
Remove the redundant driver data to align the settings, or
the screen will glitch.

Fixes: 2847cd7e6403 ("drm/mediatek: Add mt8188 dpi compatibles and platform data")

Reviewed-by: CK Hu <ck.hu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231214055847.4936-22-shawn.sung@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/mediatek/mtk_dpi.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
index 2f931e4e2b60..bc073a6b367e 100644
--- a/drivers/gpu/drm/mediatek/mtk_dpi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
@@ -957,20 +957,6 @@ static const struct mtk_dpi_conf mt8186_conf = {
 	.csc_enable_bit = CSC_ENABLE,
 };
 
-static const struct mtk_dpi_conf mt8188_dpintf_conf = {
-	.cal_factor = mt8195_dpintf_calculate_factor,
-	.max_clock_khz = 600000,
-	.output_fmts = mt8195_output_fmts,
-	.num_output_fmts = ARRAY_SIZE(mt8195_output_fmts),
-	.pixels_per_iter = 4,
-	.input_2pixel = false,
-	.dimension_mask = DPINTF_HPW_MASK,
-	.hvsize_mask = DPINTF_HSIZE_MASK,
-	.channel_swap_shift = DPINTF_CH_SWAP,
-	.yuv422_en_bit = DPINTF_YUV422_EN,
-	.csc_enable_bit = DPINTF_CSC_ENABLE,
-};
-
 static const struct mtk_dpi_conf mt8192_conf = {
 	.cal_factor = mt8183_calculate_factor,
 	.reg_h_fre_con = 0xe0,
@@ -1094,7 +1080,7 @@ static const struct of_device_id mtk_dpi_of_ids[] = {
 	{ .compatible = "mediatek,mt8173-dpi", .data = &mt8173_conf },
 	{ .compatible = "mediatek,mt8183-dpi", .data = &mt8183_conf },
 	{ .compatible = "mediatek,mt8186-dpi", .data = &mt8186_conf },
-	{ .compatible = "mediatek,mt8188-dp-intf", .data = &mt8188_dpintf_conf },
+	{ .compatible = "mediatek,mt8188-dp-intf", .data = &mt8195_dpintf_conf },
 	{ .compatible = "mediatek,mt8192-dpi", .data = &mt8192_conf },
 	{ .compatible = "mediatek,mt8195-dp-intf", .data = &mt8195_dpintf_conf },
 	{ /* sentinel */ },
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 287/583] drm/mediatek: Fix underrun in VDO1 when switches off the layer
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (285 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 286/583] drm/mediatek: Remove the redundant driver data for DPI Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 288/583] drm/amdgpu/debugfs: fix error code when smc register accessors are NULL Greg Kroah-Hartman
                   ` (302 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, CK Hu, AngeloGioacchino Del Regno,
	Hsiao Chien Sung, Chun-Kuang Hu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hsiao Chien Sung <shawn.sung@mediatek.com>

[ Upstream commit 73b5ab27ab2ee616f2709dc212c2b0007894a12e ]

Do not reset Merge while using CMDQ because reset API doesn't
wait for frame done event as CMDQ does and could lead to
underrun when the layer is switching off.

Fixes: aaf94f7c3ae6 ("drm/mediatek: Add display merge async reset control")

Reviewed-by: CK Hu <ck.hu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231214055847.4936-23-shawn.sung@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/mediatek/mtk_disp_merge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_disp_merge.c b/drivers/gpu/drm/mediatek/mtk_disp_merge.c
index e525a6b9e5b0..22f768d923d5 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_merge.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_merge.c
@@ -103,7 +103,7 @@ void mtk_merge_stop_cmdq(struct device *dev, struct cmdq_pkt *cmdq_pkt)
 	mtk_ddp_write(cmdq_pkt, 0, &priv->cmdq_reg, priv->regs,
 		      DISP_REG_MERGE_CTRL);
 
-	if (priv->async_clk)
+	if (!cmdq_pkt && priv->async_clk)
 		reset_control_reset(priv->reset_ctl);
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 288/583] drm/amdgpu/debugfs: fix error code when smc register accessors are NULL
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (286 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 287/583] drm/mediatek: Fix underrun in VDO1 when switches off the layer Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 289/583] drm/amd/pm: fix a double-free in si_dpm_init Greg Kroah-Hartman
                   ` (301 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christian König, Alex Deucher,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alex Deucher <alexander.deucher@amd.com>

[ Upstream commit afe58346d5d3887b3e49ff623d2f2e471f232a8d ]

Should be -EOPNOTSUPP.

Fixes: 5104fdf50d32 ("drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 3f2126f99923..418ff7cd662d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -755,7 +755,7 @@ static ssize_t amdgpu_debugfs_regs_smc_read(struct file *f, char __user *buf,
 	int r;
 
 	if (!adev->smc_rreg)
-		return -EPERM;
+		return -EOPNOTSUPP;
 
 	if (size & 0x3 || *pos & 0x3)
 		return -EINVAL;
@@ -814,7 +814,7 @@ static ssize_t amdgpu_debugfs_regs_smc_write(struct file *f, const char __user *
 	int r;
 
 	if (!adev->smc_wreg)
-		return -EPERM;
+		return -EOPNOTSUPP;
 
 	if (size & 0x3 || *pos & 0x3)
 		return -EINVAL;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 289/583] drm/amd/pm: fix a double-free in si_dpm_init
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (287 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 288/583] drm/amdgpu/debugfs: fix error code when smc register accessors are NULL Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 290/583] drivers/amd/pm: fix a use-after-free in kv_parse_power_table Greg Kroah-Hartman
                   ` (300 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Zhipeng Lu, Alex Deucher, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Zhipeng Lu <alexious@zju.edu.cn>

[ Upstream commit ac16667237a82e2597e329eb9bc520d1cf9dff30 ]

When the allocation of
adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries fails,
amdgpu_free_extended_power_table is called to free some fields of adev.
However, when the control flow returns to si_dpm_sw_init, it goes to
label dpm_failed and calls si_dpm_fini, which calls
amdgpu_free_extended_power_table again and free those fields again. Thus
a double-free is triggered.

Fixes: 841686df9f7d ("drm/amdgpu: add SI DPM support (v4)")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
index 02e69ccff3ba..f81e4bd48110 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
@@ -7379,10 +7379,9 @@ static int si_dpm_init(struct amdgpu_device *adev)
 		kcalloc(4,
 			sizeof(struct amdgpu_clock_voltage_dependency_entry),
 			GFP_KERNEL);
-	if (!adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries) {
-		amdgpu_free_extended_power_table(adev);
+	if (!adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries)
 		return -ENOMEM;
-	}
+
 	adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.count = 4;
 	adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries[0].clk = 0;
 	adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries[0].v = 0;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 290/583] drivers/amd/pm: fix a use-after-free in kv_parse_power_table
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (288 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 289/583] drm/amd/pm: fix a double-free in si_dpm_init Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 291/583] gpu/drm/radeon: fix two memleaks in radeon_vm_init Greg Kroah-Hartman
                   ` (299 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Zhipeng Lu, Alex Deucher, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Zhipeng Lu <alexious@zju.edu.cn>

[ Upstream commit 28dd788382c43b330480f57cd34cde0840896743 ]

When ps allocated by kzalloc equals to NULL, kv_parse_power_table
frees adev->pm.dpm.ps that allocated before. However, after the control
flow goes through the following call chains:

kv_parse_power_table
  |-> kv_dpm_init
        |-> kv_dpm_sw_init
	      |-> kv_dpm_fini

The adev->pm.dpm.ps is used in the for loop of kv_dpm_fini after its
first free in kv_parse_power_table and causes a use-after-free bug.

Fixes: a2e73f56fa62 ("drm/amdgpu: Add support for CIK parts")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
index 5d28c951a319..5cb4725c773f 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
@@ -2735,10 +2735,8 @@ static int kv_parse_power_table(struct amdgpu_device *adev)
 		non_clock_info = (struct _ATOM_PPLIB_NONCLOCK_INFO *)
 			&non_clock_info_array->nonClockInfo[non_clock_array_index];
 		ps = kzalloc(sizeof(struct kv_ps), GFP_KERNEL);
-		if (ps == NULL) {
-			kfree(adev->pm.dpm.ps);
+		if (ps == NULL)
 			return -ENOMEM;
-		}
 		adev->pm.dpm.ps[i].ps_priv = ps;
 		k = 0;
 		idx = (u8 *)&power_state->v2.clockInfoIndex[0];
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 291/583] gpu/drm/radeon: fix two memleaks in radeon_vm_init
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (289 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 290/583] drivers/amd/pm: fix a use-after-free in kv_parse_power_table Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 292/583] drm/amd/pm: fix a double-free in amdgpu_parse_extended_power_table Greg Kroah-Hartman
                   ` (298 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Zhipeng Lu, Alex Deucher, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Zhipeng Lu <alexious@zju.edu.cn>

[ Upstream commit c2709b2d6a537ca0fa0f1da36fdaf07e48ef447d ]

When radeon_bo_create and radeon_vm_clear_bo fail, the vm->page_tables
allocated before need to be freed. However, neither radeon_vm_init
itself nor its caller have done such deallocation.

Fixes: 6d2f2944e95e ("drm/radeon: use normal BOs for the page tables v4")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/radeon/radeon_vm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_vm.c b/drivers/gpu/drm/radeon/radeon_vm.c
index 987cabbf1318..c38b4d5d6a14 100644
--- a/drivers/gpu/drm/radeon/radeon_vm.c
+++ b/drivers/gpu/drm/radeon/radeon_vm.c
@@ -1204,13 +1204,17 @@ int radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm)
 	r = radeon_bo_create(rdev, pd_size, align, true,
 			     RADEON_GEM_DOMAIN_VRAM, 0, NULL,
 			     NULL, &vm->page_directory);
-	if (r)
+	if (r) {
+		kfree(vm->page_tables);
+		vm->page_tables = NULL;
 		return r;
-
+	}
 	r = radeon_vm_clear_bo(rdev, vm->page_directory);
 	if (r) {
 		radeon_bo_unref(&vm->page_directory);
 		vm->page_directory = NULL;
+		kfree(vm->page_tables);
+		vm->page_tables = NULL;
 		return r;
 	}
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 292/583] drm/amd/pm: fix a double-free in amdgpu_parse_extended_power_table
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (290 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 291/583] gpu/drm/radeon: fix two memleaks in radeon_vm_init Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 293/583] f2fs: fix to check return value of f2fs_recover_xattr_data Greg Kroah-Hartman
                   ` (297 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Zhipeng Lu, Alex Deucher, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Zhipeng Lu <alexious@zju.edu.cn>

[ Upstream commit a6582701178a47c4d0cb2188c965c59c0c0647c8 ]

The amdgpu_free_extended_power_table is called in every error-handling
paths of amdgpu_parse_extended_power_table. However, after the following
call chain of returning:

amdgpu_parse_extended_power_table
  |-> kv_dpm_init / si_dpm_init
      (the only two caller of amdgpu_parse_extended_power_table)
        |-> kv_dpm_sw_init / si_dpm_sw_init
            (the only caller of kv_dpm_init / si_dpm_init, accordingly)
              |-> kv_dpm_fini / si_dpm_fini
                  (goto dpm_failed in xx_dpm_sw_init)
                    |-> amdgpu_free_extended_power_table

As above, the amdgpu_free_extended_power_table is called twice in this
returning chain and thus a double-free is triggered. Similarily, the
last kfree in amdgpu_parse_extended_power_table also cause a double free
with amdgpu_free_extended_power_table in kv_dpm_fini.

Fixes: 84176663e70d ("drm/amd/pm: create a new holder for those APIs used only by legacy ASICs(si/kv)")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c    | 52 +++++--------------
 1 file changed, 13 insertions(+), 39 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c
index 81fb4e5dd804..60377747bab4 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c
@@ -272,10 +272,8 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev)
 				 le16_to_cpu(power_info->pplib4.usVddcDependencyOnSCLKOffset));
 			ret = amdgpu_parse_clk_voltage_dep_table(&adev->pm.dpm.dyn_state.vddc_dependency_on_sclk,
 								 dep_table);
-			if (ret) {
-				amdgpu_free_extended_power_table(adev);
+			if (ret)
 				return ret;
-			}
 		}
 		if (power_info->pplib4.usVddciDependencyOnMCLKOffset) {
 			dep_table = (ATOM_PPLIB_Clock_Voltage_Dependency_Table *)
@@ -283,10 +281,8 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev)
 				 le16_to_cpu(power_info->pplib4.usVddciDependencyOnMCLKOffset));
 			ret = amdgpu_parse_clk_voltage_dep_table(&adev->pm.dpm.dyn_state.vddci_dependency_on_mclk,
 								 dep_table);
-			if (ret) {
-				amdgpu_free_extended_power_table(adev);
+			if (ret)
 				return ret;
-			}
 		}
 		if (power_info->pplib4.usVddcDependencyOnMCLKOffset) {
 			dep_table = (ATOM_PPLIB_Clock_Voltage_Dependency_Table *)
@@ -294,10 +290,8 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev)
 				 le16_to_cpu(power_info->pplib4.usVddcDependencyOnMCLKOffset));
 			ret = amdgpu_parse_clk_voltage_dep_table(&adev->pm.dpm.dyn_state.vddc_dependency_on_mclk,
 								 dep_table);
-			if (ret) {
-				amdgpu_free_extended_power_table(adev);
+			if (ret)
 				return ret;
-			}
 		}
 		if (power_info->pplib4.usMvddDependencyOnMCLKOffset) {
 			dep_table = (ATOM_PPLIB_Clock_Voltage_Dependency_Table *)
@@ -305,10 +299,8 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev)
 				 le16_to_cpu(power_info->pplib4.usMvddDependencyOnMCLKOffset));
 			ret = amdgpu_parse_clk_voltage_dep_table(&adev->pm.dpm.dyn_state.mvdd_dependency_on_mclk,
 								 dep_table);
-			if (ret) {
-				amdgpu_free_extended_power_table(adev);
+			if (ret)
 				return ret;
-			}
 		}
 		if (power_info->pplib4.usMaxClockVoltageOnDCOffset) {
 			ATOM_PPLIB_Clock_Voltage_Limit_Table *clk_v =
@@ -339,10 +331,8 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev)
 				kcalloc(psl->ucNumEntries,
 					sizeof(struct amdgpu_phase_shedding_limits_entry),
 					GFP_KERNEL);
-			if (!adev->pm.dpm.dyn_state.phase_shedding_limits_table.entries) {
-				amdgpu_free_extended_power_table(adev);
+			if (!adev->pm.dpm.dyn_state.phase_shedding_limits_table.entries)
 				return -ENOMEM;
-			}
 
 			entry = &psl->entries[0];
 			for (i = 0; i < psl->ucNumEntries; i++) {
@@ -383,10 +373,8 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev)
 			ATOM_PPLIB_CAC_Leakage_Record *entry;
 			u32 size = cac_table->ucNumEntries * sizeof(struct amdgpu_cac_leakage_table);
 			adev->pm.dpm.dyn_state.cac_leakage_table.entries = kzalloc(size, GFP_KERNEL);
-			if (!adev->pm.dpm.dyn_state.cac_leakage_table.entries) {
-				amdgpu_free_extended_power_table(adev);
+			if (!adev->pm.dpm.dyn_state.cac_leakage_table.entries)
 				return -ENOMEM;
-			}
 			entry = &cac_table->entries[0];
 			for (i = 0; i < cac_table->ucNumEntries; i++) {
 				if (adev->pm.dpm.platform_caps & ATOM_PP_PLATFORM_CAP_EVV) {
@@ -438,10 +426,8 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev)
 				sizeof(struct amdgpu_vce_clock_voltage_dependency_entry);
 			adev->pm.dpm.dyn_state.vce_clock_voltage_dependency_table.entries =
 				kzalloc(size, GFP_KERNEL);
-			if (!adev->pm.dpm.dyn_state.vce_clock_voltage_dependency_table.entries) {
-				amdgpu_free_extended_power_table(adev);
+			if (!adev->pm.dpm.dyn_state.vce_clock_voltage_dependency_table.entries)
 				return -ENOMEM;
-			}
 			adev->pm.dpm.dyn_state.vce_clock_voltage_dependency_table.count =
 				limits->numEntries;
 			entry = &limits->entries[0];
@@ -493,10 +479,8 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev)
 				sizeof(struct amdgpu_uvd_clock_voltage_dependency_entry);
 			adev->pm.dpm.dyn_state.uvd_clock_voltage_dependency_table.entries =
 				kzalloc(size, GFP_KERNEL);
-			if (!adev->pm.dpm.dyn_state.uvd_clock_voltage_dependency_table.entries) {
-				amdgpu_free_extended_power_table(adev);
+			if (!adev->pm.dpm.dyn_state.uvd_clock_voltage_dependency_table.entries)
 				return -ENOMEM;
-			}
 			adev->pm.dpm.dyn_state.uvd_clock_voltage_dependency_table.count =
 				limits->numEntries;
 			entry = &limits->entries[0];
@@ -525,10 +509,8 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev)
 				sizeof(struct amdgpu_clock_voltage_dependency_entry);
 			adev->pm.dpm.dyn_state.samu_clock_voltage_dependency_table.entries =
 				kzalloc(size, GFP_KERNEL);
-			if (!adev->pm.dpm.dyn_state.samu_clock_voltage_dependency_table.entries) {
-				amdgpu_free_extended_power_table(adev);
+			if (!adev->pm.dpm.dyn_state.samu_clock_voltage_dependency_table.entries)
 				return -ENOMEM;
-			}
 			adev->pm.dpm.dyn_state.samu_clock_voltage_dependency_table.count =
 				limits->numEntries;
 			entry = &limits->entries[0];
@@ -548,10 +530,8 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev)
 				 le16_to_cpu(ext_hdr->usPPMTableOffset));
 			adev->pm.dpm.dyn_state.ppm_table =
 				kzalloc(sizeof(struct amdgpu_ppm_table), GFP_KERNEL);
-			if (!adev->pm.dpm.dyn_state.ppm_table) {
-				amdgpu_free_extended_power_table(adev);
+			if (!adev->pm.dpm.dyn_state.ppm_table)
 				return -ENOMEM;
-			}
 			adev->pm.dpm.dyn_state.ppm_table->ppm_design = ppm->ucPpmDesign;
 			adev->pm.dpm.dyn_state.ppm_table->cpu_core_number =
 				le16_to_cpu(ppm->usCpuCoreNumber);
@@ -583,10 +563,8 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev)
 				sizeof(struct amdgpu_clock_voltage_dependency_entry);
 			adev->pm.dpm.dyn_state.acp_clock_voltage_dependency_table.entries =
 				kzalloc(size, GFP_KERNEL);
-			if (!adev->pm.dpm.dyn_state.acp_clock_voltage_dependency_table.entries) {
-				amdgpu_free_extended_power_table(adev);
+			if (!adev->pm.dpm.dyn_state.acp_clock_voltage_dependency_table.entries)
 				return -ENOMEM;
-			}
 			adev->pm.dpm.dyn_state.acp_clock_voltage_dependency_table.count =
 				limits->numEntries;
 			entry = &limits->entries[0];
@@ -606,10 +584,8 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev)
 			ATOM_PowerTune_Table *pt;
 			adev->pm.dpm.dyn_state.cac_tdp_table =
 				kzalloc(sizeof(struct amdgpu_cac_tdp_table), GFP_KERNEL);
-			if (!adev->pm.dpm.dyn_state.cac_tdp_table) {
-				amdgpu_free_extended_power_table(adev);
+			if (!adev->pm.dpm.dyn_state.cac_tdp_table)
 				return -ENOMEM;
-			}
 			if (rev > 0) {
 				ATOM_PPLIB_POWERTUNE_Table_V1 *ppt = (ATOM_PPLIB_POWERTUNE_Table_V1 *)
 					(mode_info->atom_context->bios + data_offset +
@@ -645,10 +621,8 @@ int amdgpu_parse_extended_power_table(struct amdgpu_device *adev)
 			ret = amdgpu_parse_clk_voltage_dep_table(
 					&adev->pm.dpm.dyn_state.vddgfx_dependency_on_sclk,
 					dep_table);
-			if (ret) {
-				kfree(adev->pm.dpm.dyn_state.vddgfx_dependency_on_sclk.entries);
+			if (ret)
 				return ret;
-			}
 		}
 	}
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 293/583] f2fs: fix to check return value of f2fs_recover_xattr_data
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (291 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 292/583] drm/amd/pm: fix a double-free in amdgpu_parse_extended_power_table Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 294/583] dt-bindings: clock: Update the videocc resets for sm8150 Greg Kroah-Hartman
                   ` (296 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Zhiguo Niu, Chao Yu, Jaegeuk Kim,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Zhiguo Niu <zhiguo.niu@unisoc.com>

[ Upstream commit 86d7d57a3f096c8349b32a0cd5f6f314e4416a6d ]

Should check return value of f2fs_recover_xattr_data in
__f2fs_setxattr rather than doing invalid retry if error happen.

Also just do set_page_dirty in f2fs_recover_xattr_data when
page is changed really.

Fixes: 50a472bbc79f ("f2fs: do not return EFSCORRUPTED, but try to run online repair")
Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/f2fs/node.c  |  6 +++---
 fs/f2fs/xattr.c | 11 +++++++----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 8b30f11f37b4..9e00932770d8 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -2751,11 +2751,11 @@ int f2fs_recover_xattr_data(struct inode *inode, struct page *page)
 	f2fs_update_inode_page(inode);
 
 	/* 3: update and set xattr node page dirty */
-	if (page)
+	if (page) {
 		memcpy(F2FS_NODE(xpage), F2FS_NODE(page),
 				VALID_XATTR_BLOCK_SIZE);
-
-	set_page_dirty(xpage);
+		set_page_dirty(xpage);
+	}
 	f2fs_put_page(xpage, 1);
 
 	return 0;
diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c
index e197657db36b..e47cc917d118 100644
--- a/fs/f2fs/xattr.c
+++ b/fs/f2fs/xattr.c
@@ -660,11 +660,14 @@ static int __f2fs_setxattr(struct inode *inode, int index,
 	here = __find_xattr(base_addr, last_base_addr, NULL, index, len, name);
 	if (!here) {
 		if (!F2FS_I(inode)->i_xattr_nid) {
+			error = f2fs_recover_xattr_data(inode, NULL);
 			f2fs_notice(F2FS_I_SB(inode),
-				"recover xattr in inode (%lu)", inode->i_ino);
-			f2fs_recover_xattr_data(inode, NULL);
-			kfree(base_addr);
-			goto retry;
+				"recover xattr in inode (%lu), error(%d)",
+					inode->i_ino, error);
+			if (!error) {
+				kfree(base_addr);
+				goto retry;
+			}
 		}
 		f2fs_err(F2FS_I_SB(inode), "set inode (%lu) has corrupted xattr",
 								inode->i_ino);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 294/583] dt-bindings: clock: Update the videocc resets for sm8150
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (292 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 293/583] f2fs: fix to check return value of f2fs_recover_xattr_data Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 295/583] clk: qcom: videocc-sm8150: Update the videocc resets Greg Kroah-Hartman
                   ` (295 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Satya Priya Kakitapalli,
	Krzysztof Kozlowski, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>

[ Upstream commit 3185f96968eedd117ec72ee7b87ead44b6d1bbbd ]

Add all the available resets for the video clock controller
on sm8150.

Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231201-videocc-8150-v3-1-56bec3a5e443@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Stable-dep-of: 1fd9a939db24 ("clk: qcom: videocc-sm8150: Update the videocc resets")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/dt-bindings/clock/qcom,videocc-sm8150.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/dt-bindings/clock/qcom,videocc-sm8150.h b/include/dt-bindings/clock/qcom,videocc-sm8150.h
index e24ee840cfdb..c557b78dc572 100644
--- a/include/dt-bindings/clock/qcom,videocc-sm8150.h
+++ b/include/dt-bindings/clock/qcom,videocc-sm8150.h
@@ -16,6 +16,10 @@
 
 /* VIDEO_CC Resets */
 #define VIDEO_CC_MVSC_CORE_CLK_BCR	0
+#define VIDEO_CC_INTERFACE_BCR		1
+#define VIDEO_CC_MVS0_BCR		2
+#define VIDEO_CC_MVS1_BCR		3
+#define VIDEO_CC_MVSC_BCR		4
 
 /* VIDEO_CC GDSCRs */
 #define VENUS_GDSC			0
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 295/583] clk: qcom: videocc-sm8150: Update the videocc resets
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (293 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 294/583] dt-bindings: clock: Update the videocc resets for sm8150 Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 296/583] clk: qcom: videocc-sm8150: Add missing PLL config property Greg Kroah-Hartman
                   ` (294 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Satya Priya Kakitapalli,
	Bryan ODonoghue, Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>

[ Upstream commit 1fd9a939db24d2f66e48f8bca3e3654add3fa205 ]

Add all the available resets for the video clock controller
on sm8150.

Fixes: 5658e8cf1a8a ("clk: qcom: add video clock controller driver for SM8150")
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231201-videocc-8150-v3-2-56bec3a5e443@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/clk/qcom/videocc-sm8150.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/clk/qcom/videocc-sm8150.c b/drivers/clk/qcom/videocc-sm8150.c
index 1afdbe4a249d..6a5f89f53da8 100644
--- a/drivers/clk/qcom/videocc-sm8150.c
+++ b/drivers/clk/qcom/videocc-sm8150.c
@@ -214,6 +214,10 @@ static const struct regmap_config video_cc_sm8150_regmap_config = {
 
 static const struct qcom_reset_map video_cc_sm8150_resets[] = {
 	[VIDEO_CC_MVSC_CORE_CLK_BCR] = { 0x850, 2 },
+	[VIDEO_CC_INTERFACE_BCR] = { 0x8f0 },
+	[VIDEO_CC_MVS0_BCR] = { 0x870 },
+	[VIDEO_CC_MVS1_BCR] = { 0x8b0 },
+	[VIDEO_CC_MVSC_BCR] = { 0x810 },
 };
 
 static const struct qcom_cc_desc video_cc_sm8150_desc = {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 296/583] clk: qcom: videocc-sm8150: Add missing PLL config property
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (294 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 295/583] clk: qcom: videocc-sm8150: Update the videocc resets Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 297/583] clk: sp7021: fix return value check in sp7021_clk_probe() Greg Kroah-Hartman
                   ` (293 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Satya Priya Kakitapalli,
	Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>

[ Upstream commit 71f130c9193f613d497f7245365ed05ffdb0a401 ]

When the driver was ported upstream, PLL test_ctl_hi1 register value
was omitted. Add it to ensure the PLLs are fully configured.

Fixes: 5658e8cf1a8a ("clk: qcom: add video clock controller driver for SM8150")
Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231201-videocc-8150-v3-3-56bec3a5e443@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/clk/qcom/videocc-sm8150.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/qcom/videocc-sm8150.c b/drivers/clk/qcom/videocc-sm8150.c
index 6a5f89f53da8..52a9a453a143 100644
--- a/drivers/clk/qcom/videocc-sm8150.c
+++ b/drivers/clk/qcom/videocc-sm8150.c
@@ -33,6 +33,7 @@ static struct alpha_pll_config video_pll0_config = {
 	.config_ctl_val = 0x20485699,
 	.config_ctl_hi_val = 0x00002267,
 	.config_ctl_hi1_val = 0x00000024,
+	.test_ctl_hi1_val = 0x00000020,
 	.user_ctl_val = 0x00000000,
 	.user_ctl_hi_val = 0x00000805,
 	.user_ctl_hi1_val = 0x000000D0,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 297/583] clk: sp7021: fix return value check in sp7021_clk_probe()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (295 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 296/583] clk: qcom: videocc-sm8150: Add missing PLL config property Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 298/583] drivers: clk: zynqmp: calculate closest mux rate Greg Kroah-Hartman
                   ` (292 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yang Yingliang, Stephen Boyd, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yang Yingliang <yangyingliang@huawei.com>

[ Upstream commit 1004c346a2b7393fce37dd1f320555e0a0d71e3f ]

devm_platform_ioremap_resource() never returns NULL pointer,
it will return ERR_PTR() when it fails, so replace the check
with IS_ERR().

Fixes: d54c1fd4a51e ("clk: Add Sunplus SP7021 clock driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20231128133016.2494699-1-yangyingliang@huawei.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/clk/clk-sp7021.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/clk-sp7021.c b/drivers/clk/clk-sp7021.c
index 01d3c4c7b0b2..7cb7d501d7a6 100644
--- a/drivers/clk/clk-sp7021.c
+++ b/drivers/clk/clk-sp7021.c
@@ -604,14 +604,14 @@ static int sp7021_clk_probe(struct platform_device *pdev)
 	int i;
 
 	clk_base = devm_platform_ioremap_resource(pdev, 0);
-	if (!clk_base)
-		return -ENXIO;
+	if (IS_ERR(clk_base))
+		return PTR_ERR(clk_base);
 	pll_base = devm_platform_ioremap_resource(pdev, 1);
-	if (!pll_base)
-		return -ENXIO;
+	if (IS_ERR(pll_base))
+		return PTR_ERR(pll_base);
 	sys_base = devm_platform_ioremap_resource(pdev, 2);
-	if (!sys_base)
-		return -ENXIO;
+	if (IS_ERR(sys_base))
+		return PTR_ERR(sys_base);
 
 	/* enable default clks */
 	for (i = 0; i < ARRAY_SIZE(sp_clken); i++)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 298/583] drivers: clk: zynqmp: calculate closest mux rate
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (296 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 297/583] clk: sp7021: fix return value check in sp7021_clk_probe() Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 299/583] drivers: clk: zynqmp: update divider round rate logic Greg Kroah-Hartman
                   ` (291 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jay Buddhabhatti, Stephen Boyd, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jay Buddhabhatti <jay.buddhabhatti@amd.com>

[ Upstream commit b782921ddd7f84f524723090377903f399fdbbcb ]

Currently zynqmp clock driver is not calculating closest mux rate and
because of that Linux is not setting proper frequency for CPU and
not able to set given frequency for dynamic frequency scaling.

E.g., In current logic initial acpu clock parent and frequency as below
apll1                  0    0    0  2199999978    0     0  50000      Y
    acpu0_mux          0    0    0  2199999978    0     0  50000      Y
        acpu0_idiv1    0    0    0  2199999978    0     0  50000      Y
            acpu0      0    0    0  2199999978    0     0  50000      Y

After changing acpu frequency to 549999994 Hz using CPU freq scaling its
selecting incorrect parent which is not closest frequency.
rpll_to_xpd            0    0    0  1599999984    0     0  50000      Y
    acpu0_mux          0    0    0  1599999984    0     0  50000      Y
        acpu0_div1     0    0    0   533333328    0     0  50000      Y
            acpu0      0    0    0   533333328    0     0  50000      Y

Parent should remain same since 549999994 = 2199999978 / 4.

So use __clk_mux_determine_rate_closest() generic function to calculate
closest rate for mux clock. After this change its selecting correct
parent and correct clock rate.
apll1                  0    0    0  2199999978    0     0  50000      Y
    acpu0_mux          0    0    0  2199999978    0     0  50000      Y
        acpu0_div1     0    0    0   549999995    0     0  50000      Y
            acpu0      0    0    0   549999995    0     0  50000      Y

Fixes: 3fde0e16d016 ("drivers: clk: Add ZynqMP clock driver")
Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Link: https://lore.kernel.org/r/20231129112916.23125-2-jay.buddhabhatti@amd.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/clk/zynqmp/clk-mux-zynqmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/zynqmp/clk-mux-zynqmp.c b/drivers/clk/zynqmp/clk-mux-zynqmp.c
index 60359333f26d..9b5d3050b742 100644
--- a/drivers/clk/zynqmp/clk-mux-zynqmp.c
+++ b/drivers/clk/zynqmp/clk-mux-zynqmp.c
@@ -89,7 +89,7 @@ static int zynqmp_clk_mux_set_parent(struct clk_hw *hw, u8 index)
 static const struct clk_ops zynqmp_clk_mux_ops = {
 	.get_parent = zynqmp_clk_mux_get_parent,
 	.set_parent = zynqmp_clk_mux_set_parent,
-	.determine_rate = __clk_mux_determine_rate,
+	.determine_rate = __clk_mux_determine_rate_closest,
 };
 
 static const struct clk_ops zynqmp_clk_mux_ro_ops = {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 299/583] drivers: clk: zynqmp: update divider round rate logic
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (297 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 298/583] drivers: clk: zynqmp: calculate closest mux rate Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 300/583] watchdog: set cdev owner before adding Greg Kroah-Hartman
                   ` (290 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jay Buddhabhatti, Stephen Boyd, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jay Buddhabhatti <jay.buddhabhatti@amd.com>

[ Upstream commit 1fe15be1fb613534ecbac5f8c3f8744f757d237d ]

Currently zynqmp divider round rate is considering single parent and
calculating rate and parent rate accordingly. But if divider clock flag
is set to SET_RATE_PARENT then its not trying to traverse through all
parent rate and not selecting best parent rate from that. So use common
divider_round_rate() which is traversing through all clock parents and
its rate and calculating proper parent rate.

Fixes: 3fde0e16d016 ("drivers: clk: Add ZynqMP clock driver")
Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Link: https://lore.kernel.org/r/20231129112916.23125-3-jay.buddhabhatti@amd.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/clk/zynqmp/divider.c | 66 +++---------------------------------
 1 file changed, 5 insertions(+), 61 deletions(-)

diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c
index 33a3b2a22659..5a00487ae408 100644
--- a/drivers/clk/zynqmp/divider.c
+++ b/drivers/clk/zynqmp/divider.c
@@ -110,52 +110,6 @@ static unsigned long zynqmp_clk_divider_recalc_rate(struct clk_hw *hw,
 	return DIV_ROUND_UP_ULL(parent_rate, value);
 }
 
-static void zynqmp_get_divider2_val(struct clk_hw *hw,
-				    unsigned long rate,
-				    struct zynqmp_clk_divider *divider,
-				    u32 *bestdiv)
-{
-	int div1;
-	int div2;
-	long error = LONG_MAX;
-	unsigned long div1_prate;
-	struct clk_hw *div1_parent_hw;
-	struct zynqmp_clk_divider *pdivider;
-	struct clk_hw *div2_parent_hw = clk_hw_get_parent(hw);
-
-	if (!div2_parent_hw)
-		return;
-
-	pdivider = to_zynqmp_clk_divider(div2_parent_hw);
-	if (!pdivider)
-		return;
-
-	div1_parent_hw = clk_hw_get_parent(div2_parent_hw);
-	if (!div1_parent_hw)
-		return;
-
-	div1_prate = clk_hw_get_rate(div1_parent_hw);
-	*bestdiv = 1;
-	for (div1 = 1; div1 <= pdivider->max_div;) {
-		for (div2 = 1; div2 <= divider->max_div;) {
-			long new_error = ((div1_prate / div1) / div2) - rate;
-
-			if (abs(new_error) < abs(error)) {
-				*bestdiv = div2;
-				error = new_error;
-			}
-			if (divider->flags & CLK_DIVIDER_POWER_OF_TWO)
-				div2 = div2 << 1;
-			else
-				div2++;
-		}
-		if (pdivider->flags & CLK_DIVIDER_POWER_OF_TWO)
-			div1 = div1 << 1;
-		else
-			div1++;
-	}
-}
-
 /**
  * zynqmp_clk_divider_round_rate() - Round rate of divider clock
  * @hw:			handle between common and hardware-specific interfaces
@@ -174,6 +128,7 @@ static long zynqmp_clk_divider_round_rate(struct clk_hw *hw,
 	u32 div_type = divider->div_type;
 	u32 bestdiv;
 	int ret;
+	u8 width;
 
 	/* if read only, just return current value */
 	if (divider->flags & CLK_DIVIDER_READ_ONLY) {
@@ -193,23 +148,12 @@ static long zynqmp_clk_divider_round_rate(struct clk_hw *hw,
 		return DIV_ROUND_UP_ULL((u64)*prate, bestdiv);
 	}
 
-	bestdiv = zynqmp_divider_get_val(*prate, rate, divider->flags);
-
-	/*
-	 * In case of two divisors, compute best divider values and return
-	 * divider2 value based on compute value. div1 will  be automatically
-	 * set to optimum based on required total divider value.
-	 */
-	if (div_type == TYPE_DIV2 &&
-	    (clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT)) {
-		zynqmp_get_divider2_val(hw, rate, divider, &bestdiv);
-	}
+	width = fls(divider->max_div);
 
-	if ((clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) && divider->is_frac)
-		bestdiv = rate % *prate ? 1 : bestdiv;
+	rate = divider_round_rate(hw, rate, prate, NULL, width, divider->flags);
 
-	bestdiv = min_t(u32, bestdiv, divider->max_div);
-	*prate = rate * bestdiv;
+	if (divider->is_frac && (clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) && (rate % *prate))
+		*prate = rate;
 
 	return rate;
 }
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 300/583] watchdog: set cdev owner before adding
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (298 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 299/583] drivers: clk: zynqmp: update divider round rate logic Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 301/583] watchdog/hpwdt: Only claim UNKNOWN NMI if from iLO Greg Kroah-Hartman
                   ` (289 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Curtis Klein, Guenter Roeck,
	Wim Van Sebroeck, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Curtis Klein <curtis.klein@hpe.com>

[ Upstream commit 38d75297745f04206db9c29bdd75557f0344c7cc ]

When the new watchdog character device is registered, it becomes
available for opening. This creates a race where userspace may open the
device before the character device's owner is set. This results in an
imbalance in module_get calls as the cdev_get in cdev_open will not
increment the reference count on the watchdog driver module.

This causes problems when the watchdog character device is released as
the module loader's reference will also be released. This makes it
impossible to open the watchdog device later on as it now appears that
the module is being unloaded. The open will fail with -ENXIO from
chrdev_open.

The legacy watchdog device will fail with -EBUSY from the try_module_get
in watchdog_open because it's module owner is the watchdog core module
so it can still be opened but it will fail to get a refcount on the
underlying watchdog device driver.

Fixes: 72139dfa2464 ("watchdog: Fix the race between the release of watchdog_core_data and cdev")
Signed-off-by: Curtis Klein <curtis.klein@hpe.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20231205190522.55153-1-curtis.klein@hpe.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/watchdog/watchdog_dev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
index 15df74e11a59..e2bd266b1b5b 100644
--- a/drivers/watchdog/watchdog_dev.c
+++ b/drivers/watchdog/watchdog_dev.c
@@ -1073,6 +1073,7 @@ static int watchdog_cdev_register(struct watchdog_device *wdd)
 
 	/* Fill in the data structures */
 	cdev_init(&wd_data->cdev, &watchdog_fops);
+	wd_data->cdev.owner = wdd->ops->owner;
 
 	/* Add the device */
 	err = cdev_device_add(&wd_data->cdev, &wd_data->dev);
@@ -1087,8 +1088,6 @@ static int watchdog_cdev_register(struct watchdog_device *wdd)
 		return err;
 	}
 
-	wd_data->cdev.owner = wdd->ops->owner;
-
 	/* Record time of most recent heartbeat as 'just before now'. */
 	wd_data->last_hw_keepalive = ktime_sub(ktime_get(), 1);
 	watchdog_set_open_deadline(wd_data);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 301/583] watchdog/hpwdt: Only claim UNKNOWN NMI if from iLO
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (299 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 300/583] watchdog: set cdev owner before adding Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 302/583] watchdog: bcm2835_wdt: Fix WDIOC_SETTIMEOUT handling Greg Kroah-Hartman
                   ` (288 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jerry Hoemann, Guenter Roeck,
	Wim Van Sebroeck, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jerry Hoemann <jerry.hoemann@hpe.com>

[ Upstream commit dced0b3e51dd2af3730efe14dd86b5e3173f0a65 ]

Avoid unnecessary crashes by claiming only NMIs that are due to
ERROR signalling or generated by the hpwdt hardware device.

The code does this, but only for iLO5.

The intent was to preserve legacy, Gen9 and earlier, semantics of
using hpwdt for error containtment as hardware/firmware would signal
fatal IO errors as an NMI with the expectation of hpwdt crashing
the system.  Howerver, these IO errors should be received by hpwdt
as an NMI_IO_CHECK.  So the test is overly permissive and should
not be limited to only ilo5.

We need to enable this protection for future iLOs not matching the
current PCI IDs.

Fixes: 62290a5c194b ("watchdog: hpwdt: Claim NMIs generated by iLO5")
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20231213215340.495734-2-jerry.hoemann@hpe.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/watchdog/hpwdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index f79f932bca14..79ed1626d8ea 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -178,7 +178,7 @@ static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs)
 		"3. OA Forward Progress Log\n"
 		"4. iLO Event Log";
 
-	if (ilo5 && ulReason == NMI_UNKNOWN && !mynmi)
+	if (ulReason == NMI_UNKNOWN && !mynmi)
 		return NMI_DONE;
 
 	if (ilo5 && !pretimeout && !mynmi)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 302/583] watchdog: bcm2835_wdt: Fix WDIOC_SETTIMEOUT handling
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (300 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 301/583] watchdog/hpwdt: Only claim UNKNOWN NMI if from iLO Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 303/583] watchdog: rti_wdt: Drop runtime pm reference count when watchdog is unused Greg Kroah-Hartman
                   ` (287 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Stefan Wahren, Florian Fainelli,
	Guenter Roeck, Wim Van Sebroeck, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Stefan Wahren <wahrenst@gmx.net>

[ Upstream commit f33f5b1fd1be5f5106d16f831309648cb0f1c31d ]

Users report about the unexpected behavior for setting timeouts above
15 sec on Raspberry Pi. According to watchdog-api.rst the ioctl
WDIOC_SETTIMEOUT shouldn't fail because of hardware limitations.
But looking at the code shows that max_timeout based on the
register value PM_WDOG_TIME_SET, which is the maximum.

Since 664a39236e71 ("watchdog: Introduce hardware maximum heartbeat
in watchdog core") the watchdog core is able to handle this problem.

This fix has been tested with watchdog-test from selftests.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=217374
Fixes: 664a39236e71 ("watchdog: Introduce hardware maximum heartbeat in watchdog core")
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20231112173251.4827-1-wahrenst@gmx.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/watchdog/bcm2835_wdt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c
index 7a855289ff5e..bb001c5d7f17 100644
--- a/drivers/watchdog/bcm2835_wdt.c
+++ b/drivers/watchdog/bcm2835_wdt.c
@@ -42,6 +42,7 @@
 
 #define SECS_TO_WDOG_TICKS(x) ((x) << 16)
 #define WDOG_TICKS_TO_SECS(x) ((x) >> 16)
+#define WDOG_TICKS_TO_MSECS(x) ((x) * 1000 >> 16)
 
 struct bcm2835_wdt {
 	void __iomem		*base;
@@ -140,7 +141,7 @@ static struct watchdog_device bcm2835_wdt_wdd = {
 	.info =		&bcm2835_wdt_info,
 	.ops =		&bcm2835_wdt_ops,
 	.min_timeout =	1,
-	.max_timeout =	WDOG_TICKS_TO_SECS(PM_WDOG_TIME_SET),
+	.max_hw_heartbeat_ms =	WDOG_TICKS_TO_MSECS(PM_WDOG_TIME_SET),
 	.timeout =	WDOG_TICKS_TO_SECS(PM_WDOG_TIME_SET),
 };
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 303/583] watchdog: rti_wdt: Drop runtime pm reference count when watchdog is unused
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (301 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 302/583] watchdog: bcm2835_wdt: Fix WDIOC_SETTIMEOUT handling Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 304/583] clk: rs9: Fix DIF OEn bit placement on 9FGV0241 Greg Kroah-Hartman
                   ` (286 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Vignesh Raghavendra,
	Manorit Chawdhry, Guenter Roeck, Wim Van Sebroeck, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Vignesh Raghavendra <vigneshr@ti.com>

[ Upstream commit c1a6edf3b541e44e78f10bc6024df779715723f1 ]

Call runtime_pm_put*() if watchdog is not already started during probe and re
enable it in watchdog start as required.

On K3 SoCs, watchdogs and their corresponding CPUs are under same
power-domain, so if the reference count of unused watchdogs aren't
dropped, it will lead to CPU hotplug failures as Device Management
firmware won't allow to turn off the power-domain due to dangling
reference count.

Fixes: 2d63908bdbfb ("watchdog: Add K3 RTI watchdog support")
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Tested-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20231213140110.938129-1-vigneshr@ti.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/watchdog/rti_wdt.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c
index 8e1be7ba0103..9215793a1c81 100644
--- a/drivers/watchdog/rti_wdt.c
+++ b/drivers/watchdog/rti_wdt.c
@@ -77,6 +77,11 @@ static int rti_wdt_start(struct watchdog_device *wdd)
 {
 	u32 timer_margin;
 	struct rti_wdt_device *wdt = watchdog_get_drvdata(wdd);
+	int ret;
+
+	ret = pm_runtime_resume_and_get(wdd->parent);
+	if (ret)
+		return ret;
 
 	/* set timeout period */
 	timer_margin = (u64)wdd->timeout * wdt->freq;
@@ -343,6 +348,9 @@ static int rti_wdt_probe(struct platform_device *pdev)
 	if (last_ping)
 		watchdog_set_last_hw_keepalive(wdd, last_ping);
 
+	if (!watchdog_hw_running(wdd))
+		pm_runtime_put_sync(&pdev->dev);
+
 	return 0;
 
 err_iomap:
@@ -357,7 +365,10 @@ static void rti_wdt_remove(struct platform_device *pdev)
 	struct rti_wdt_device *wdt = platform_get_drvdata(pdev);
 
 	watchdog_unregister_device(&wdt->wdd);
-	pm_runtime_put(&pdev->dev);
+
+	if (!pm_runtime_suspended(&pdev->dev))
+		pm_runtime_put(&pdev->dev);
+
 	pm_runtime_disable(&pdev->dev);
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 304/583] clk: rs9: Fix DIF OEn bit placement on 9FGV0241
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (302 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 303/583] watchdog: rti_wdt: Drop runtime pm reference count when watchdog is unused Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 305/583] clk: si5341: fix an error code problem in si5341_output_clk_set_rate Greg Kroah-Hartman
                   ` (285 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Marek Vasut, Alexander Stein,
	Stephen Boyd, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Marek Vasut <marek.vasut+renesas@mailbox.org>

[ Upstream commit 29d861b5d29b6c80a887e93ad982cbbf4af2a06b ]

On 9FGV0241, the DIF OE0 is BIT(1) and DIF OE1 is BIT(2), on the other
chips like 9FGV0441 and 9FGV0841 DIF OE0 is BIT(0) and so on. Increment
the index in BIT() macro instead of the result of BIT() macro to shift
the bit correctly on 9FGV0241.

Fixes: 603df193ec51 ("clk: rs9: Support device specific dif bit calculation")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://lore.kernel.org/r/20231105200642.62792-1-marek.vasut+renesas@mailbox.org
Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/clk/clk-renesas-pcie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-renesas-pcie.c b/drivers/clk/clk-renesas-pcie.c
index 7d7b2cb75318..3b6ad2307a41 100644
--- a/drivers/clk/clk-renesas-pcie.c
+++ b/drivers/clk/clk-renesas-pcie.c
@@ -163,7 +163,7 @@ static u8 rs9_calc_dif(const struct rs9_driver_data *rs9, int idx)
 	enum rs9_model model = rs9->chip_info->model;
 
 	if (model == RENESAS_9FGV0241)
-		return BIT(idx) + 1;
+		return BIT(idx + 1);
 	else if (model == RENESAS_9FGV0441)
 		return BIT(idx);
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 305/583] clk: si5341: fix an error code problem in si5341_output_clk_set_rate
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (303 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 304/583] clk: rs9: Fix DIF OEn bit placement on 9FGV0241 Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 306/583] ASoC: amd: vangogh: Drop conflicting ACPI-based probing Greg Kroah-Hartman
                   ` (284 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Mike Looijmans, Su Hui,
	Stephen Boyd, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Su Hui <suhui@nfschina.com>

[ Upstream commit 5607068ae5ab02c3ac9cabc6859d36e98004c341 ]

regmap_bulk_write() return zero or negative error code, return the value
of regmap_bulk_write() rather than '0'.

Fixes: 3044a860fd09 ("clk: Add Si5341/Si5340 driver")
Acked-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Su Hui <suhui@nfschina.com>
Link: https://lore.kernel.org/r/20231101031633.996124-1-suhui@nfschina.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/clk/clk-si5341.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/clk/clk-si5341.c b/drivers/clk/clk-si5341.c
index 9599857842c7..2920fe2e5e8b 100644
--- a/drivers/clk/clk-si5341.c
+++ b/drivers/clk/clk-si5341.c
@@ -895,10 +895,8 @@ static int si5341_output_clk_set_rate(struct clk_hw *hw, unsigned long rate,
 	r[0] = r_div ? (r_div & 0xff) : 1;
 	r[1] = (r_div >> 8) & 0xff;
 	r[2] = (r_div >> 16) & 0xff;
-	err = regmap_bulk_write(output->data->regmap,
+	return regmap_bulk_write(output->data->regmap,
 			SI5341_OUT_R_REG(output), r, 3);
-
-	return 0;
 }
 
 static int si5341_output_reparent(struct clk_si5341_output *output, u8 index)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 306/583] ASoC: amd: vangogh: Drop conflicting ACPI-based probing
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (304 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 305/583] clk: si5341: fix an error code problem in si5341_output_clk_set_rate Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 307/583] ASoC: tas2781: add support for FW version 0x0503 Greg Kroah-Hartman
                   ` (283 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Cristian Ciocaltea, Emil Velikov,
	Mark Brown, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>

[ Upstream commit ddd1ee12a8fb6e4d6f86eddeba64c135eee56623 ]

The Vangogh machine driver variant based on the MAX98388 amplifier, as
found on Valve's Steam Deck OLED, relies on probing via an ACPI match
table.  This worked fine until commit 197b1f7f0df1 ("ASoC: amd: Add new
dmi entries to config entry") enabled SOF support for the target machine
(i.e. Galileo product), causing the sound card to enter the deferred
probe state indefinitely:

$ cat /sys/kernel/debug/devices_deferred
AMDI8821:00	acp5x_mach: Register card (acp5x-max98388) failed

The issue is related to commit e89f45edb747 ("ASoC: amd: vangogh: Add
check for acp config flags in vangogh platform"), which tries to
mitigate potential conflicts between SOF and generic ACP Vangogh
drivers, due to sharing the PCI device IDs.

However, the solution is effective only if the machine driver is
directly probed by pci-acp5x through platform_device_register_full().

Hence, remove the conflicting ACPI based probing and rely exclusively on
DMI quirks for sound card setup.

Fixes: dba22efd0d17 ("ASoC: amd: vangogh: Add support for NAU8821/MAX98388 variant")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Link: https://msgid.link/r/20231209203229.878730-2-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/amd/vangogh/acp5x-mach.c | 35 +++++++++++-------------------
 1 file changed, 13 insertions(+), 22 deletions(-)

diff --git a/sound/soc/amd/vangogh/acp5x-mach.c b/sound/soc/amd/vangogh/acp5x-mach.c
index eda464545866..2ccc95d57783 100644
--- a/sound/soc/amd/vangogh/acp5x-mach.c
+++ b/sound/soc/amd/vangogh/acp5x-mach.c
@@ -439,7 +439,15 @@ static const struct dmi_system_id acp5x_vg_quirk_table[] = {
 		.matches = {
 			DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Valve"),
 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Jupiter"),
-		}
+		},
+		.driver_data = (void *)&acp5x_8821_35l41_card,
+	},
+	{
+		.matches = {
+			DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Valve"),
+			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Galileo"),
+		},
+		.driver_data = (void *)&acp5x_8821_98388_card,
 	},
 	{}
 };
@@ -452,25 +460,15 @@ static int acp5x_probe(struct platform_device *pdev)
 	struct snd_soc_card *card;
 	int ret;
 
-	card = (struct snd_soc_card *)device_get_match_data(dev);
-	if (!card) {
-		/*
-		 * This is normally the result of directly probing the driver
-		 * in pci-acp5x through platform_device_register_full(), which
-		 * is necessary for the CS35L41 variant, as it doesn't support
-		 * ACPI probing and relies on DMI quirks.
-		 */
-		dmi_id = dmi_first_match(acp5x_vg_quirk_table);
-		if (!dmi_id)
-			return -ENODEV;
-
-		card = &acp5x_8821_35l41_card;
-	}
+	dmi_id = dmi_first_match(acp5x_vg_quirk_table);
+	if (!dmi_id || !dmi_id->driver_data)
+		return -ENODEV;
 
 	machine = devm_kzalloc(dev, sizeof(*machine), GFP_KERNEL);
 	if (!machine)
 		return -ENOMEM;
 
+	card = dmi_id->driver_data;
 	card->dev = dev;
 	platform_set_drvdata(pdev, card);
 	snd_soc_card_set_drvdata(card, machine);
@@ -482,17 +480,10 @@ static int acp5x_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct acpi_device_id acp5x_acpi_match[] = {
-	{ "AMDI8821", (kernel_ulong_t)&acp5x_8821_98388_card },
-	{},
-};
-MODULE_DEVICE_TABLE(acpi, acp5x_acpi_match);
-
 static struct platform_driver acp5x_mach_driver = {
 	.driver = {
 		.name = DRV_NAME,
 		.pm = &snd_soc_pm_ops,
-		.acpi_match_table = acp5x_acpi_match,
 	},
 	.probe = acp5x_probe,
 };
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 307/583] ASoC: tas2781: add support for FW version 0x0503
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (305 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 306/583] ASoC: amd: vangogh: Drop conflicting ACPI-based probing Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:55 ` [PATCH 6.6 308/583] drm/mediatek: dp: Add phy_mtk_dp module as pre-dependency Greg Kroah-Hartman
                   ` (282 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Gergo Koteles, Mark Brown, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Gergo Koteles <soyer@irl.hu>

[ Upstream commit ee00330a5b78e2acf4b3aac32913da43e2c12a26 ]

Layout of FW version 0x0503 is compatible with 0x0502.
Already supported by TI's tas2781-linux-driver tree.
https://git.ti.com/cgit/tas2781-linux-drivers/tas2781-linux-driver/

Fixes: 915f5eadebd2 ("ASoC: tas2781: firmware lib")
Signed-off-by: Gergo Koteles <soyer@irl.hu>
Link: https://msgid.link/r/98d4ee4e01e834af72a1a0bea6736facf43582e0.1702513517.git.soyer@irl.hu
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/tas2781-fmwlib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/tas2781-fmwlib.c b/sound/soc/codecs/tas2781-fmwlib.c
index 1dfac9b2fca2..61b05629a9a9 100644
--- a/sound/soc/codecs/tas2781-fmwlib.c
+++ b/sound/soc/codecs/tas2781-fmwlib.c
@@ -2012,6 +2012,7 @@ static int tasdevice_dspfw_ready(const struct firmware *fmw,
 	case 0x301:
 	case 0x302:
 	case 0x502:
+	case 0x503:
 		tas_priv->fw_parse_variable_header =
 			fw_parse_variable_header_kernel;
 		tas_priv->fw_parse_program_data =
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 308/583] drm/mediatek: dp: Add phy_mtk_dp module as pre-dependency
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (306 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 307/583] ASoC: tas2781: add support for FW version 0x0503 Greg Kroah-Hartman
@ 2024-01-22 23:55 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 309/583] accel/habanalabs: fix information leak in sec_attest_info() Greg Kroah-Hartman
                   ` (281 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:55 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, AngeloGioacchino Del Regno,
	Nícolas F .  R .  A .  Prado, Guillaume Ranquet,
	Chun-Kuang Hu, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nícolas F. R. A. Prado <nfraprado@collabora.com>

[ Upstream commit c8048dd0b07df68724805254b9e994d99e9a7af4 ]

The mtk_dp driver registers a phy device which is handled by the
phy_mtk_dp driver and assumes that the phy probe will complete
synchronously, proceeding to make use of functionality exposed by that
driver right away. This assumption however is false when the phy driver
is built as a module, causing the mtk_dp driver to fail probe in this
case.

Add the phy_mtk_dp module as a pre-dependency to the mtk_dp module to
ensure the phy module has been loaded before the dp, so that the phy
probe happens synchrounously and the mtk_dp driver can probe
successfully even with the phy driver built as a module.

Suggested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Guillaume Ranquet <granquet@baylibre.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231121142938.460846-1-nfraprado@collabora.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/mediatek/mtk_dp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
index 0e285df6577e..4052a3133b57 100644
--- a/drivers/gpu/drm/mediatek/mtk_dp.c
+++ b/drivers/gpu/drm/mediatek/mtk_dp.c
@@ -2784,3 +2784,4 @@ MODULE_AUTHOR("Markus Schneider-Pargmann <msp@baylibre.com>");
 MODULE_AUTHOR("Bo-Chen Chen <rex-bc.chen@mediatek.com>");
 MODULE_DESCRIPTION("MediaTek DisplayPort Driver");
 MODULE_LICENSE("GPL");
+MODULE_SOFTDEP("pre: phy_mtk_dp");
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 309/583] accel/habanalabs: fix information leak in sec_attest_info()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (307 preceding siblings ...)
  2024-01-22 23:55 ` [PATCH 6.6 308/583] drm/mediatek: dp: Add phy_mtk_dp module as pre-dependency Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 310/583] clk: qcom: gcc-sm8550: Add the missing RETAIN_FF_ENABLE GDSC flag Greg Kroah-Hartman
                   ` (280 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Xingyuan Mo, Oded Gabbay, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Xingyuan Mo <hdthky0@gmail.com>

[ Upstream commit a9f07790a4b2250f0140e9a61c7f842fd9b618c7 ]

This function may copy the pad0 field of struct hl_info_sec_attest to user
mode which has not been initialized, resulting in leakage of kernel heap
data to user mode. To prevent this, use kzalloc() to allocate and zero out
the buffer, which can also eliminate other uninitialized holes, if any.

Fixes: 0c88760f8f5e ("habanalabs/gaudi2: add secured attestation info uapi")
Signed-off-by: Xingyuan Mo <hdthky0@gmail.com>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/accel/habanalabs/common/habanalabs_ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/accel/habanalabs/common/habanalabs_ioctl.c b/drivers/accel/habanalabs/common/habanalabs_ioctl.c
index 6a45a92344e9..a7f6c54c123e 100644
--- a/drivers/accel/habanalabs/common/habanalabs_ioctl.c
+++ b/drivers/accel/habanalabs/common/habanalabs_ioctl.c
@@ -682,7 +682,7 @@ static int sec_attest_info(struct hl_fpriv *hpriv, struct hl_info_args *args)
 	if (!sec_attest_info)
 		return -ENOMEM;
 
-	info = kmalloc(sizeof(*info), GFP_KERNEL);
+	info = kzalloc(sizeof(*info), GFP_KERNEL);
 	if (!info) {
 		rc = -ENOMEM;
 		goto free_sec_attest_info;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 310/583] clk: qcom: gcc-sm8550: Add the missing RETAIN_FF_ENABLE GDSC flag
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (308 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 309/583] accel/habanalabs: fix information leak in sec_attest_info() Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 311/583] clk: qcom: gcc-sm8550: Mark the PCIe GDSCs votable Greg Kroah-Hartman
                   ` (279 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Konrad Dybcio <konrad.dybcio@linaro.org>

[ Upstream commit 1fe8273c8d4088dd68faaab8640ec95f381cbf1e ]

All of the 8550's GCC GDSCs can and should use the retain registers so
as not to lose their state when entering lower power modes.

Fixes: 955f2ea3b9e9 ("clk: qcom: Add GCC driver for SM8550")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231218-topic-8550_fixes-v1-3-ce1272d77540@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/clk/qcom/gcc-sm8550.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/qcom/gcc-sm8550.c b/drivers/clk/qcom/gcc-sm8550.c
index 586126c4dd90..1c3d78500392 100644
--- a/drivers/clk/qcom/gcc-sm8550.c
+++ b/drivers/clk/qcom/gcc-sm8550.c
@@ -3002,7 +3002,7 @@ static struct gdsc pcie_0_gdsc = {
 		.name = "pcie_0_gdsc",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = POLL_CFG_GDSCR,
+	.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
 };
 
 static struct gdsc pcie_0_phy_gdsc = {
@@ -3011,7 +3011,7 @@ static struct gdsc pcie_0_phy_gdsc = {
 		.name = "pcie_0_phy_gdsc",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = POLL_CFG_GDSCR,
+	.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
 };
 
 static struct gdsc pcie_1_gdsc = {
@@ -3020,7 +3020,7 @@ static struct gdsc pcie_1_gdsc = {
 		.name = "pcie_1_gdsc",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = POLL_CFG_GDSCR,
+	.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
 };
 
 static struct gdsc pcie_1_phy_gdsc = {
@@ -3029,7 +3029,7 @@ static struct gdsc pcie_1_phy_gdsc = {
 		.name = "pcie_1_phy_gdsc",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = POLL_CFG_GDSCR,
+	.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
 };
 
 static struct gdsc ufs_phy_gdsc = {
@@ -3038,7 +3038,7 @@ static struct gdsc ufs_phy_gdsc = {
 		.name = "ufs_phy_gdsc",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = POLL_CFG_GDSCR,
+	.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
 };
 
 static struct gdsc ufs_mem_phy_gdsc = {
@@ -3047,7 +3047,7 @@ static struct gdsc ufs_mem_phy_gdsc = {
 		.name = "ufs_mem_phy_gdsc",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = POLL_CFG_GDSCR,
+	.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
 };
 
 static struct gdsc usb30_prim_gdsc = {
@@ -3056,7 +3056,7 @@ static struct gdsc usb30_prim_gdsc = {
 		.name = "usb30_prim_gdsc",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = POLL_CFG_GDSCR,
+	.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
 };
 
 static struct gdsc usb3_phy_gdsc = {
@@ -3065,7 +3065,7 @@ static struct gdsc usb3_phy_gdsc = {
 		.name = "usb3_phy_gdsc",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = POLL_CFG_GDSCR,
+	.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
 };
 
 static struct clk_regmap *gcc_sm8550_clocks[] = {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 311/583] clk: qcom: gcc-sm8550: Mark the PCIe GDSCs votable
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (309 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 310/583] clk: qcom: gcc-sm8550: Add the missing RETAIN_FF_ENABLE GDSC flag Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 312/583] clk: qcom: gcc-sm8550: use collapse-voting for PCIe GDSCs Greg Kroah-Hartman
                   ` (278 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Konrad Dybcio <konrad.dybcio@linaro.org>

[ Upstream commit e7fe73fc6b68ee97b1e8f124a66a5ee50d8d5e5b ]

The PCIe GDSCs on most Qualcomm platforms expect the OS to always
consider collapse requests as successful. This also concerns SM8550.

Add the VOTABLE flag to the GDSCs in question to comply with these
expectations.

Fixes: 955f2ea3b9e9 ("clk: qcom: Add GCC driver for SM8550")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231218-topic-8550_fixes-v1-4-ce1272d77540@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/clk/qcom/gcc-sm8550.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/qcom/gcc-sm8550.c b/drivers/clk/qcom/gcc-sm8550.c
index 1c3d78500392..a16d07426b71 100644
--- a/drivers/clk/qcom/gcc-sm8550.c
+++ b/drivers/clk/qcom/gcc-sm8550.c
@@ -3002,7 +3002,7 @@ static struct gdsc pcie_0_gdsc = {
 		.name = "pcie_0_gdsc",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
+	.flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
 };
 
 static struct gdsc pcie_0_phy_gdsc = {
@@ -3011,7 +3011,7 @@ static struct gdsc pcie_0_phy_gdsc = {
 		.name = "pcie_0_phy_gdsc",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
+	.flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
 };
 
 static struct gdsc pcie_1_gdsc = {
@@ -3020,7 +3020,7 @@ static struct gdsc pcie_1_gdsc = {
 		.name = "pcie_1_gdsc",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
+	.flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
 };
 
 static struct gdsc pcie_1_phy_gdsc = {
@@ -3029,7 +3029,7 @@ static struct gdsc pcie_1_phy_gdsc = {
 		.name = "pcie_1_phy_gdsc",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
+	.flags = VOTABLE | POLL_CFG_GDSCR | RETAIN_FF_ENABLE,
 };
 
 static struct gdsc ufs_phy_gdsc = {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 312/583] clk: qcom: gcc-sm8550: use collapse-voting for PCIe GDSCs
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (310 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 311/583] clk: qcom: gcc-sm8550: Mark the PCIe GDSCs votable Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 313/583] clk: qcom: gcc-sm8550: Mark RCGs shared where applicable Greg Kroah-Hartman
                   ` (277 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Konrad Dybcio <konrad.dybcio@linaro.org>

[ Upstream commit 7e77a39265293ea4f05e20fff180755503c49918 ]

The PCIe GDSCs can be shared with other masters and should use the APCS
collapse-vote register when updating the power state.

This is specifically also needed to be able to disable power domains
that have been enabled by boot firmware using the vote register.

Following other recent Qualcomm platforms, describe this register and
the corresponding mask for the PCIe (and _phy) GDSCs.

Fixes: 955f2ea3b9e9 ("clk: qcom: Add GCC driver for SM8550")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231218-topic-8550_fixes-v1-5-ce1272d77540@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/clk/qcom/gcc-sm8550.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/clk/qcom/gcc-sm8550.c b/drivers/clk/qcom/gcc-sm8550.c
index a16d07426b71..73bda0d03aa7 100644
--- a/drivers/clk/qcom/gcc-sm8550.c
+++ b/drivers/clk/qcom/gcc-sm8550.c
@@ -2998,6 +2998,8 @@ static struct clk_branch gcc_video_axi1_clk = {
 
 static struct gdsc pcie_0_gdsc = {
 	.gdscr = 0x6b004,
+	.collapse_ctrl = 0x52020,
+	.collapse_mask = BIT(0),
 	.pd = {
 		.name = "pcie_0_gdsc",
 	},
@@ -3007,6 +3009,8 @@ static struct gdsc pcie_0_gdsc = {
 
 static struct gdsc pcie_0_phy_gdsc = {
 	.gdscr = 0x6c000,
+	.collapse_ctrl = 0x52020,
+	.collapse_mask = BIT(3),
 	.pd = {
 		.name = "pcie_0_phy_gdsc",
 	},
@@ -3016,6 +3020,8 @@ static struct gdsc pcie_0_phy_gdsc = {
 
 static struct gdsc pcie_1_gdsc = {
 	.gdscr = 0x8d004,
+	.collapse_ctrl = 0x52020,
+	.collapse_mask = BIT(1),
 	.pd = {
 		.name = "pcie_1_gdsc",
 	},
@@ -3025,6 +3031,8 @@ static struct gdsc pcie_1_gdsc = {
 
 static struct gdsc pcie_1_phy_gdsc = {
 	.gdscr = 0x8e000,
+	.collapse_ctrl = 0x52020,
+	.collapse_mask = BIT(4),
 	.pd = {
 		.name = "pcie_1_phy_gdsc",
 	},
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 313/583] clk: qcom: gcc-sm8550: Mark RCGs shared where applicable
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (311 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 312/583] clk: qcom: gcc-sm8550: use collapse-voting for PCIe GDSCs Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 314/583] clk: qcom: dispcc-sm8550: Update disp PLL settings Greg Kroah-Hartman
                   ` (276 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Konrad Dybcio <konrad.dybcio@linaro.org>

[ Upstream commit 929c75d575667af389c8a9e03cebc93d43bb7f31 ]

The vast majority of shared RCGs were not marked as such. Fix it.

Fixes: 955f2ea3b9e9 ("clk: qcom: Add GCC driver for SM8550")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231218-topic-8550_fixes-v1-6-ce1272d77540@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/clk/qcom/gcc-sm8550.c | 86 +++++++++++++++++------------------
 1 file changed, 43 insertions(+), 43 deletions(-)

diff --git a/drivers/clk/qcom/gcc-sm8550.c b/drivers/clk/qcom/gcc-sm8550.c
index 73bda0d03aa7..b883dffe5f7a 100644
--- a/drivers/clk/qcom/gcc-sm8550.c
+++ b/drivers/clk/qcom/gcc-sm8550.c
@@ -401,7 +401,7 @@ static struct clk_rcg2 gcc_gp1_clk_src = {
 		.parent_data = gcc_parent_data_1,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_1),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -416,7 +416,7 @@ static struct clk_rcg2 gcc_gp2_clk_src = {
 		.parent_data = gcc_parent_data_1,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_1),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -431,7 +431,7 @@ static struct clk_rcg2 gcc_gp3_clk_src = {
 		.parent_data = gcc_parent_data_1,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_1),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -451,7 +451,7 @@ static struct clk_rcg2 gcc_pcie_0_aux_clk_src = {
 		.parent_data = gcc_parent_data_2,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_2),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -471,7 +471,7 @@ static struct clk_rcg2 gcc_pcie_0_phy_rchng_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -486,7 +486,7 @@ static struct clk_rcg2 gcc_pcie_1_aux_clk_src = {
 		.parent_data = gcc_parent_data_2,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_2),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -501,7 +501,7 @@ static struct clk_rcg2 gcc_pcie_1_phy_rchng_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -521,7 +521,7 @@ static struct clk_rcg2 gcc_pdm2_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -536,7 +536,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s0_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -551,7 +551,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s1_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -566,7 +566,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s2_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -581,7 +581,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s3_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -596,7 +596,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s4_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -611,7 +611,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s5_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -626,7 +626,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s6_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -641,7 +641,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s7_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -656,7 +656,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s8_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -671,7 +671,7 @@ static struct clk_rcg2 gcc_qupv3_i2c_s9_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -700,7 +700,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s0_clk_src_init = {
 	.parent_data = gcc_parent_data_0,
 	.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 	.flags = CLK_SET_RATE_PARENT,
-	.ops = &clk_rcg2_ops,
+	.ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap1_s0_clk_src = {
@@ -717,7 +717,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s1_clk_src_init = {
 	.parent_data = gcc_parent_data_0,
 	.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 	.flags = CLK_SET_RATE_PARENT,
-	.ops = &clk_rcg2_ops,
+	.ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap1_s1_clk_src = {
@@ -750,7 +750,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s2_clk_src_init = {
 	.parent_data = gcc_parent_data_0,
 	.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 	.flags = CLK_SET_RATE_PARENT,
-	.ops = &clk_rcg2_ops,
+	.ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap1_s2_clk_src = {
@@ -767,7 +767,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s3_clk_src_init = {
 	.parent_data = gcc_parent_data_0,
 	.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 	.flags = CLK_SET_RATE_PARENT,
-	.ops = &clk_rcg2_ops,
+	.ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap1_s3_clk_src = {
@@ -784,7 +784,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s4_clk_src_init = {
 	.parent_data = gcc_parent_data_0,
 	.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 	.flags = CLK_SET_RATE_PARENT,
-	.ops = &clk_rcg2_ops,
+	.ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap1_s4_clk_src = {
@@ -801,7 +801,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s5_clk_src_init = {
 	.parent_data = gcc_parent_data_0,
 	.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 	.flags = CLK_SET_RATE_PARENT,
-	.ops = &clk_rcg2_ops,
+	.ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap1_s5_clk_src = {
@@ -818,7 +818,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s6_clk_src_init = {
 	.parent_data = gcc_parent_data_0,
 	.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 	.flags = CLK_SET_RATE_PARENT,
-	.ops = &clk_rcg2_ops,
+	.ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap1_s6_clk_src = {
@@ -835,7 +835,7 @@ static struct clk_init_data gcc_qupv3_wrap1_s7_clk_src_init = {
 	.parent_data = gcc_parent_data_0,
 	.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 	.flags = CLK_SET_RATE_PARENT,
-	.ops = &clk_rcg2_ops,
+	.ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap1_s7_clk_src = {
@@ -852,7 +852,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s0_clk_src_init = {
 	.parent_data = gcc_parent_data_0,
 	.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 	.flags = CLK_SET_RATE_PARENT,
-	.ops = &clk_rcg2_ops,
+	.ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap2_s0_clk_src = {
@@ -869,7 +869,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s1_clk_src_init = {
 	.parent_data = gcc_parent_data_0,
 	.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 	.flags = CLK_SET_RATE_PARENT,
-	.ops = &clk_rcg2_ops,
+	.ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap2_s1_clk_src = {
@@ -886,7 +886,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s2_clk_src_init = {
 	.parent_data = gcc_parent_data_0,
 	.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 	.flags = CLK_SET_RATE_PARENT,
-	.ops = &clk_rcg2_ops,
+	.ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap2_s2_clk_src = {
@@ -903,7 +903,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s3_clk_src_init = {
 	.parent_data = gcc_parent_data_0,
 	.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 	.flags = CLK_SET_RATE_PARENT,
-	.ops = &clk_rcg2_ops,
+	.ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap2_s3_clk_src = {
@@ -920,7 +920,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s4_clk_src_init = {
 	.parent_data = gcc_parent_data_0,
 	.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 	.flags = CLK_SET_RATE_PARENT,
-	.ops = &clk_rcg2_ops,
+	.ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap2_s4_clk_src = {
@@ -937,7 +937,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s5_clk_src_init = {
 	.parent_data = gcc_parent_data_0,
 	.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 	.flags = CLK_SET_RATE_PARENT,
-	.ops = &clk_rcg2_ops,
+	.ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap2_s5_clk_src = {
@@ -975,7 +975,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s6_clk_src_init = {
 	.parent_data = gcc_parent_data_8,
 	.num_parents = ARRAY_SIZE(gcc_parent_data_8),
 	.flags = CLK_SET_RATE_PARENT,
-	.ops = &clk_rcg2_ops,
+	.ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap2_s6_clk_src = {
@@ -992,7 +992,7 @@ static struct clk_init_data gcc_qupv3_wrap2_s7_clk_src_init = {
 	.parent_data = gcc_parent_data_0,
 	.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 	.flags = CLK_SET_RATE_PARENT,
-	.ops = &clk_rcg2_ops,
+	.ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap2_s7_clk_src = {
@@ -1025,7 +1025,7 @@ static struct clk_rcg2 gcc_sdcc2_apps_clk_src = {
 		.parent_data = gcc_parent_data_9,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_9),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -1048,7 +1048,7 @@ static struct clk_rcg2 gcc_sdcc4_apps_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -1071,7 +1071,7 @@ static struct clk_rcg2 gcc_ufs_phy_axi_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -1093,7 +1093,7 @@ static struct clk_rcg2 gcc_ufs_phy_ice_core_clk_src = {
 		.parent_data = gcc_parent_data_3,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_3),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -1114,7 +1114,7 @@ static struct clk_rcg2 gcc_ufs_phy_phy_aux_clk_src = {
 		.parent_data = gcc_parent_data_4,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_4),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -1136,7 +1136,7 @@ static struct clk_rcg2 gcc_ufs_phy_unipro_core_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -1159,7 +1159,7 @@ static struct clk_rcg2 gcc_usb30_prim_master_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -1174,7 +1174,7 @@ static struct clk_rcg2 gcc_usb30_prim_mock_utmi_clk_src = {
 		.parent_data = gcc_parent_data_0,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_0),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
@@ -1189,7 +1189,7 @@ static struct clk_rcg2 gcc_usb3_prim_phy_aux_clk_src = {
 		.parent_data = gcc_parent_data_2,
 		.num_parents = ARRAY_SIZE(gcc_parent_data_2),
 		.flags = CLK_SET_RATE_PARENT,
-		.ops = &clk_rcg2_ops,
+		.ops = &clk_rcg2_shared_ops,
 	},
 };
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 314/583] clk: qcom: dispcc-sm8550: Update disp PLL settings
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (312 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 313/583] clk: qcom: gcc-sm8550: Mark RCGs shared where applicable Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 315/583] clk: fixed-rate: fix clk_hw_register_fixed_rate_with_accuracy_parent_hw Greg Kroah-Hartman
                   ` (275 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Bjorn Andersson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Konrad Dybcio <konrad.dybcio@linaro.org>

[ Upstream commit febd251d8775c4fb6e4acd6b5d7b0ed707f4611f ]

The settings in the driver seem to have been taken from an older
release. Update them to match the latest values.

Fixes: 90114ca11476 ("clk: qcom: add SM8550 DISPCC driver")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231218-topic-8550_fixes-v1-8-ce1272d77540@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/clk/qcom/dispcc-sm8550.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/clk/qcom/dispcc-sm8550.c b/drivers/clk/qcom/dispcc-sm8550.c
index aefa19f3c2c5..0b8f0904b339 100644
--- a/drivers/clk/qcom/dispcc-sm8550.c
+++ b/drivers/clk/qcom/dispcc-sm8550.c
@@ -81,6 +81,10 @@ static const struct alpha_pll_config disp_cc_pll0_config = {
 	.config_ctl_val = 0x20485699,
 	.config_ctl_hi_val = 0x00182261,
 	.config_ctl_hi1_val = 0x82aa299c,
+	.test_ctl_val = 0x00000000,
+	.test_ctl_hi_val = 0x00000003,
+	.test_ctl_hi1_val = 0x00009000,
+	.test_ctl_hi2_val = 0x00000034,
 	.user_ctl_val = 0x00000000,
 	.user_ctl_hi_val = 0x00000005,
 };
@@ -108,6 +112,10 @@ static const struct alpha_pll_config disp_cc_pll1_config = {
 	.config_ctl_val = 0x20485699,
 	.config_ctl_hi_val = 0x00182261,
 	.config_ctl_hi1_val = 0x82aa299c,
+	.test_ctl_val = 0x00000000,
+	.test_ctl_hi_val = 0x00000003,
+	.test_ctl_hi1_val = 0x00009000,
+	.test_ctl_hi2_val = 0x00000034,
 	.user_ctl_val = 0x00000000,
 	.user_ctl_hi_val = 0x00000005,
 };
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 315/583] clk: fixed-rate: fix clk_hw_register_fixed_rate_with_accuracy_parent_hw
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (313 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 314/583] clk: qcom: dispcc-sm8550: Update disp PLL settings Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 316/583] pwm: stm32: Use hweight32 in stm32_pwm_detect_channels Greg Kroah-Hartman
                   ` (274 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Théo Lebrun, Stephen Boyd, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Théo Lebrun <theo.lebrun@bootlin.com>

[ Upstream commit ee0cf5e07f44a10fce8f1bfa9db226c0b5ecf880 ]

Add missing comma and remove extraneous NULL argument. The macro is
currently used by no one which explains why the typo slipped by.

Fixes: 2d34f09e79c9 ("clk: fixed-rate: Add support for specifying parents via DT/pointers")
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20231218-mbly-clk-v1-1-44ce54108f06@bootlin.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/clk-provider.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index ace3a4ce2fc9..1293c38ddb7f 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -448,8 +448,8 @@ struct clk *clk_register_fixed_rate(struct device *dev, const char *name,
  */
 #define clk_hw_register_fixed_rate_with_accuracy_parent_hw(dev, name,	      \
 		parent_hw, flags, fixed_rate, fixed_accuracy)		      \
-	__clk_hw_register_fixed_rate((dev), NULL, (name), NULL, (parent_hw)   \
-				     NULL, NULL, (flags), (fixed_rate),	      \
+	__clk_hw_register_fixed_rate((dev), NULL, (name), NULL, (parent_hw),  \
+				     NULL, (flags), (fixed_rate),	      \
 				     (fixed_accuracy), 0, false)
 /**
  * clk_hw_register_fixed_rate_with_accuracy_parent_data - register fixed-rate
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 316/583] pwm: stm32: Use hweight32 in stm32_pwm_detect_channels
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (314 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 315/583] clk: fixed-rate: fix clk_hw_register_fixed_rate_with_accuracy_parent_hw Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 317/583] pwm: stm32: Fix enable count for clk in .probe() Greg Kroah-Hartman
                   ` (273 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Philipp Zabel,
	Uwe Kleine-König, Fabrice Gasnier, Thierry Reding,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Philipp Zabel <p.zabel@pengutronix.de>

[ Upstream commit 41fa8f57c0d269243fe3bde2bce71e82c884b9ad ]

Use hweight32() to count the CCxE bits in stm32_pwm_detect_channels().
Since the return value is assigned to chip.npwm, change it to unsigned
int as well.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Stable-dep-of: 19f1016ea960 ("pwm: stm32: Fix enable count for clk in .probe()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/pwm/pwm-stm32.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
index 3d6be7749e23..0c7781f17805 100644
--- a/drivers/pwm/pwm-stm32.c
+++ b/drivers/pwm/pwm-stm32.c
@@ -579,10 +579,9 @@ static void stm32_pwm_detect_complementary(struct stm32_pwm *priv)
 	priv->have_complementary_output = (ccer != 0);
 }
 
-static int stm32_pwm_detect_channels(struct stm32_pwm *priv)
+static unsigned int stm32_pwm_detect_channels(struct stm32_pwm *priv)
 {
 	u32 ccer;
-	int npwm = 0;
 
 	/*
 	 * If channels enable bits don't exist writing 1 will have no
@@ -592,19 +591,7 @@ static int stm32_pwm_detect_channels(struct stm32_pwm *priv)
 	regmap_read(priv->regmap, TIM_CCER, &ccer);
 	regmap_clear_bits(priv->regmap, TIM_CCER, TIM_CCER_CCXE);
 
-	if (ccer & TIM_CCER_CC1E)
-		npwm++;
-
-	if (ccer & TIM_CCER_CC2E)
-		npwm++;
-
-	if (ccer & TIM_CCER_CC3E)
-		npwm++;
-
-	if (ccer & TIM_CCER_CC4E)
-		npwm++;
-
-	return npwm;
+	return hweight32(ccer & TIM_CCER_CCXE);
 }
 
 static int stm32_pwm_probe(struct platform_device *pdev)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 317/583] pwm: stm32: Fix enable count for clk in .probe()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (315 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 316/583] pwm: stm32: Use hweight32 in stm32_pwm_detect_channels Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 318/583] ASoC: rt5645: Drop double EF20 entry from dmi_platform_data[] Greg Kroah-Hartman
                   ` (272 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Philipp Zabel,
	Uwe Kleine-König, Fabrice Gasnier, Thierry Reding,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Philipp Zabel <p.zabel@pengutronix.de>

[ Upstream commit 19f1016ea9600ed89bc24247c36ff5934ad94fbb ]

Make the driver take over hardware state without disabling in .probe()
and enable the clock for each enabled channel.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
[ukleinek: split off from a patch that also implemented .get_state()]
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fixes: 7edf7369205b ("pwm: Add driver for STM32 plaftorm")
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/pwm/pwm-stm32.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
index 0c7781f17805..dd2ee5d9ca06 100644
--- a/drivers/pwm/pwm-stm32.c
+++ b/drivers/pwm/pwm-stm32.c
@@ -579,17 +579,21 @@ static void stm32_pwm_detect_complementary(struct stm32_pwm *priv)
 	priv->have_complementary_output = (ccer != 0);
 }
 
-static unsigned int stm32_pwm_detect_channels(struct stm32_pwm *priv)
+static unsigned int stm32_pwm_detect_channels(struct stm32_pwm *priv,
+					      unsigned int *num_enabled)
 {
-	u32 ccer;
+	u32 ccer, ccer_backup;
 
 	/*
 	 * If channels enable bits don't exist writing 1 will have no
 	 * effect so we can detect and count them.
 	 */
+	regmap_read(priv->regmap, TIM_CCER, &ccer_backup);
 	regmap_set_bits(priv->regmap, TIM_CCER, TIM_CCER_CCXE);
 	regmap_read(priv->regmap, TIM_CCER, &ccer);
-	regmap_clear_bits(priv->regmap, TIM_CCER, TIM_CCER_CCXE);
+	regmap_write(priv->regmap, TIM_CCER, ccer_backup);
+
+	*num_enabled = hweight32(ccer_backup & TIM_CCER_CCXE);
 
 	return hweight32(ccer & TIM_CCER_CCXE);
 }
@@ -600,6 +604,8 @@ static int stm32_pwm_probe(struct platform_device *pdev)
 	struct device_node *np = dev->of_node;
 	struct stm32_timers *ddata = dev_get_drvdata(pdev->dev.parent);
 	struct stm32_pwm *priv;
+	unsigned int num_enabled;
+	unsigned int i;
 	int ret;
 
 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -622,7 +628,11 @@ static int stm32_pwm_probe(struct platform_device *pdev)
 
 	priv->chip.dev = dev;
 	priv->chip.ops = &stm32pwm_ops;
-	priv->chip.npwm = stm32_pwm_detect_channels(priv);
+	priv->chip.npwm = stm32_pwm_detect_channels(priv, &num_enabled);
+
+	/* Initialize clock refcount to number of enabled PWM channels. */
+	for (i = 0; i < num_enabled; i++)
+		clk_enable(priv->clk);
 
 	ret = devm_pwmchip_add(dev, &priv->chip);
 	if (ret < 0)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 318/583] ASoC: rt5645: Drop double EF20 entry from dmi_platform_data[]
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (316 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 317/583] pwm: stm32: Fix enable count for clk in .probe() Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 319/583] ALSA: scarlett2: Add missing error check to scarlett2_config_save() Greg Kroah-Hartman
                   ` (271 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Chris Chiu, Hans de Goede,
	Mark Brown, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hans de Goede <hdegoede@redhat.com>

[ Upstream commit 51add1687f39292af626ac3c2046f49241713273 ]

dmi_platform_data[] first contains a DMI entry matching:

   DMI_MATCH(DMI_PRODUCT_NAME, "EF20"),

and then contains an identical entry except for the match being:

   DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),

Since these are partial (non exact) DMI matches the first match
will also match any board with "EF20EA" in their DMI product-name,
drop the second, redundant, entry.

Fixes: a4dae468cfdd ("ASoC: rt5645: Add ACPI-defined GPIO for ECS EF20 series")
Cc: Chris Chiu <chiu@endlessos.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://msgid.link/r/20231126214024.300505-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/codecs/rt5645.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index a0d01d71d8b5..edcb85bd8ea7 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3854,14 +3854,6 @@ static const struct dmi_system_id dmi_platform_data[] = {
 		},
 		.driver_data = (void *)&ecs_ef20_platform_data,
 	},
-	{
-		.ident = "EF20EA",
-		.callback = cht_rt5645_ef20_quirk_cb,
-		.matches = {
-			DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
-		},
-		.driver_data = (void *)&ecs_ef20_platform_data,
-	},
 	{ }
 };
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 319/583] ALSA: scarlett2: Add missing error check to scarlett2_config_save()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (317 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 318/583] ASoC: rt5645: Drop double EF20 entry from dmi_platform_data[] Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 320/583] ALSA: scarlett2: Add missing error check to scarlett2_usb_set_config() Greg Kroah-Hartman
                   ` (270 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Geoffrey D. Bennett, Takashi Iwai,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Geoffrey D. Bennett <g@b4.vu>

[ Upstream commit 5f6ff6931a1c0065a55448108940371e1ac8075f ]

scarlett2_config_save() was ignoring the return value from
scarlett2_usb(). As this function is not called from user-space we
can't return the error, so call usb_audio_err() instead.

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Fixes: 9e4d5c1be21f ("ALSA: usb-audio: Scarlett Gen 2 mixer interface")
Link: https://lore.kernel.org/r/bf0a15332d852d7825fa6da87d2a0d9c0b702053.1703001053.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/usb/mixer_scarlett_gen2.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sound/usb/mixer_scarlett_gen2.c b/sound/usb/mixer_scarlett_gen2.c
index d260be8cb6bc..64cfe2d6045e 100644
--- a/sound/usb/mixer_scarlett_gen2.c
+++ b/sound/usb/mixer_scarlett_gen2.c
@@ -1337,9 +1337,11 @@ static void scarlett2_config_save(struct usb_mixer_interface *mixer)
 {
 	__le32 req = cpu_to_le32(SCARLETT2_USB_CONFIG_SAVE);
 
-	scarlett2_usb(mixer, SCARLETT2_USB_DATA_CMD,
-		      &req, sizeof(u32),
-		      NULL, 0);
+	int err = scarlett2_usb(mixer, SCARLETT2_USB_DATA_CMD,
+				&req, sizeof(u32),
+				NULL, 0);
+	if (err < 0)
+		usb_audio_err(mixer->chip, "config save failed: %d\n", err);
 }
 
 /* Delayed work to save config */
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 320/583] ALSA: scarlett2: Add missing error check to scarlett2_usb_set_config()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (318 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 319/583] ALSA: scarlett2: Add missing error check to scarlett2_config_save() Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 321/583] ALSA: scarlett2: Allow passing any output to line_out_remap() Greg Kroah-Hartman
                   ` (269 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Geoffrey D. Bennett, Takashi Iwai,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Geoffrey D. Bennett <g@b4.vu>

[ Upstream commit ca459dfa7d4ed9098fcf13e410963be6ae9b6bf3 ]

scarlett2_usb_set_config() calls scarlett2_usb_get() but was not
checking the result. Return the error if it fails rather than
continuing with an invalid value.

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Fixes: 9e15fae6c51a ("ALSA: usb-audio: scarlett2: Allow bit-level access to config")
Link: https://lore.kernel.org/r/def110c5c31dbdf0a7414d258838a0a31c0fab67.1703001053.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/usb/mixer_scarlett_gen2.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/usb/mixer_scarlett_gen2.c b/sound/usb/mixer_scarlett_gen2.c
index 64cfe2d6045e..834b936e7106 100644
--- a/sound/usb/mixer_scarlett_gen2.c
+++ b/sound/usb/mixer_scarlett_gen2.c
@@ -1390,7 +1390,10 @@ static int scarlett2_usb_set_config(
 		size = 1;
 		offset = config_item->offset;
 
-		scarlett2_usb_get(mixer, offset, &tmp, 1);
+		err = scarlett2_usb_get(mixer, offset, &tmp, 1);
+		if (err < 0)
+			return err;
+
 		if (value)
 			tmp |= (1 << index);
 		else
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 321/583] ALSA: scarlett2: Allow passing any output to line_out_remap()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (319 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 320/583] ALSA: scarlett2: Add missing error check to scarlett2_usb_set_config() Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 322/583] ALSA: scarlett2: Add missing error checks to *_ctl_get() Greg Kroah-Hartman
                   ` (268 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Geoffrey D. Bennett, Takashi Iwai,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Geoffrey D. Bennett <g@b4.vu>

[ Upstream commit 2190b9aea4eb92ccf3176e35c17c959e40f1a81b ]

Line outputs 3 & 4 on the Gen 3 18i8 are internally the analogue 7 and
8 outputs, and this renumbering is hidden from the user by
line_out_remap(). By allowing higher values (representing non-analogue
outputs) to be passed to line_out_remap(), repeated code from
scarlett2_mux_src_enum_ctl_get() and scarlett2_mux_src_enum_ctl_put()
can be removed.

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://lore.kernel.org/r/3b70267931f5994628ab27306c73cddd17b93c8f.1698342632.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Stable-dep-of: 50603a67daef ("ALSA: scarlett2: Add missing error checks to *_ctl_get()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/usb/mixer_scarlett_gen2.c | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/sound/usb/mixer_scarlett_gen2.c b/sound/usb/mixer_scarlett_gen2.c
index 834b936e7106..5e3118bd0dc1 100644
--- a/sound/usb/mixer_scarlett_gen2.c
+++ b/sound/usb/mixer_scarlett_gen2.c
@@ -1901,9 +1901,16 @@ static int scarlett2_master_volume_ctl_get(struct snd_kcontrol *kctl,
 static int line_out_remap(struct scarlett2_data *private, int index)
 {
 	const struct scarlett2_device_info *info = private->info;
+	const int (*port_count)[SCARLETT2_PORT_DIRNS] = info->port_count;
+	int line_out_count =
+		port_count[SCARLETT2_PORT_TYPE_ANALOGUE][SCARLETT2_PORT_OUT];
 
 	if (!info->line_out_remap_enable)
 		return index;
+
+	if (index >= line_out_count)
+		return index;
+
 	return info->line_out_remap[index];
 }
 
@@ -3388,14 +3395,7 @@ static int scarlett2_mux_src_enum_ctl_get(struct snd_kcontrol *kctl,
 	struct usb_mixer_elem_info *elem = kctl->private_data;
 	struct usb_mixer_interface *mixer = elem->head.mixer;
 	struct scarlett2_data *private = mixer->private_data;
-	const struct scarlett2_device_info *info = private->info;
-	const int (*port_count)[SCARLETT2_PORT_DIRNS] = info->port_count;
-	int line_out_count =
-		port_count[SCARLETT2_PORT_TYPE_ANALOGUE][SCARLETT2_PORT_OUT];
-	int index = elem->control;
-
-	if (index < line_out_count)
-		index = line_out_remap(private, index);
+	int index = line_out_remap(private, elem->control);
 
 	mutex_lock(&private->data_mutex);
 	if (private->mux_updated)
@@ -3412,16 +3412,9 @@ static int scarlett2_mux_src_enum_ctl_put(struct snd_kcontrol *kctl,
 	struct usb_mixer_elem_info *elem = kctl->private_data;
 	struct usb_mixer_interface *mixer = elem->head.mixer;
 	struct scarlett2_data *private = mixer->private_data;
-	const struct scarlett2_device_info *info = private->info;
-	const int (*port_count)[SCARLETT2_PORT_DIRNS] = info->port_count;
-	int line_out_count =
-		port_count[SCARLETT2_PORT_TYPE_ANALOGUE][SCARLETT2_PORT_OUT];
-	int index = elem->control;
+	int index = line_out_remap(private, elem->control);
 	int oval, val, err = 0;
 
-	if (index < line_out_count)
-		index = line_out_remap(private, index);
-
 	mutex_lock(&private->data_mutex);
 
 	oval = private->mux[index];
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 322/583] ALSA: scarlett2: Add missing error checks to *_ctl_get()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (320 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 321/583] ALSA: scarlett2: Allow passing any output to line_out_remap() Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 323/583] ALSA: scarlett2: Add clamp() in scarlett2_mixer_ctl_put() Greg Kroah-Hartman
                   ` (267 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Geoffrey D. Bennett, Takashi Iwai,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Geoffrey D. Bennett <g@b4.vu>

[ Upstream commit 50603a67daef161c78c814580d57f7f0be57167e ]

The *_ctl_get() functions which call scarlett2_update_*() were not
checking the return value. Fix to check the return value and pass to
the caller.

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Fixes: 9e4d5c1be21f ("ALSA: usb-audio: Scarlett Gen 2 mixer interface")
Link: https://lore.kernel.org/r/32a5fdc83b05fa74e0fcdd672fbf71d75c5f0a6d.1703001053.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/usb/mixer_scarlett_gen2.c | 182 +++++++++++++++++++++++---------
 1 file changed, 130 insertions(+), 52 deletions(-)

diff --git a/sound/usb/mixer_scarlett_gen2.c b/sound/usb/mixer_scarlett_gen2.c
index 5e3118bd0dc1..087e120d7103 100644
--- a/sound/usb/mixer_scarlett_gen2.c
+++ b/sound/usb/mixer_scarlett_gen2.c
@@ -1798,14 +1798,20 @@ static int scarlett2_sync_ctl_get(struct snd_kcontrol *kctl,
 	struct usb_mixer_elem_info *elem = kctl->private_data;
 	struct usb_mixer_interface *mixer = elem->head.mixer;
 	struct scarlett2_data *private = mixer->private_data;
+	int err = 0;
 
 	mutex_lock(&private->data_mutex);
-	if (private->sync_updated)
-		scarlett2_update_sync(mixer);
+
+	if (private->sync_updated) {
+		err = scarlett2_update_sync(mixer);
+		if (err < 0)
+			goto unlock;
+	}
 	ucontrol->value.enumerated.item[0] = private->sync;
-	mutex_unlock(&private->data_mutex);
 
-	return 0;
+unlock:
+	mutex_unlock(&private->data_mutex);
+	return err;
 }
 
 static const struct snd_kcontrol_new scarlett2_sync_ctl = {
@@ -1888,14 +1894,20 @@ static int scarlett2_master_volume_ctl_get(struct snd_kcontrol *kctl,
 	struct usb_mixer_elem_info *elem = kctl->private_data;
 	struct usb_mixer_interface *mixer = elem->head.mixer;
 	struct scarlett2_data *private = mixer->private_data;
+	int err = 0;
 
 	mutex_lock(&private->data_mutex);
-	if (private->vol_updated)
-		scarlett2_update_volumes(mixer);
-	mutex_unlock(&private->data_mutex);
 
+	if (private->vol_updated) {
+		err = scarlett2_update_volumes(mixer);
+		if (err < 0)
+			goto unlock;
+	}
 	ucontrol->value.integer.value[0] = private->master_vol;
-	return 0;
+
+unlock:
+	mutex_unlock(&private->data_mutex);
+	return err;
 }
 
 static int line_out_remap(struct scarlett2_data *private, int index)
@@ -1921,14 +1933,20 @@ static int scarlett2_volume_ctl_get(struct snd_kcontrol *kctl,
 	struct usb_mixer_interface *mixer = elem->head.mixer;
 	struct scarlett2_data *private = mixer->private_data;
 	int index = line_out_remap(private, elem->control);
+	int err = 0;
 
 	mutex_lock(&private->data_mutex);
-	if (private->vol_updated)
-		scarlett2_update_volumes(mixer);
-	mutex_unlock(&private->data_mutex);
 
+	if (private->vol_updated) {
+		err = scarlett2_update_volumes(mixer);
+		if (err < 0)
+			goto unlock;
+	}
 	ucontrol->value.integer.value[0] = private->vol[index];
-	return 0;
+
+unlock:
+	mutex_unlock(&private->data_mutex);
+	return err;
 }
 
 static int scarlett2_volume_ctl_put(struct snd_kcontrol *kctl,
@@ -1995,14 +2013,20 @@ static int scarlett2_mute_ctl_get(struct snd_kcontrol *kctl,
 	struct usb_mixer_interface *mixer = elem->head.mixer;
 	struct scarlett2_data *private = mixer->private_data;
 	int index = line_out_remap(private, elem->control);
+	int err = 0;
 
 	mutex_lock(&private->data_mutex);
-	if (private->vol_updated)
-		scarlett2_update_volumes(mixer);
-	mutex_unlock(&private->data_mutex);
 
+	if (private->vol_updated) {
+		err = scarlett2_update_volumes(mixer);
+		if (err < 0)
+			goto unlock;
+	}
 	ucontrol->value.integer.value[0] = private->mute_switch[index];
-	return 0;
+
+unlock:
+	mutex_unlock(&private->data_mutex);
+	return err;
 }
 
 static int scarlett2_mute_ctl_put(struct snd_kcontrol *kctl,
@@ -2248,14 +2272,20 @@ static int scarlett2_level_enum_ctl_get(struct snd_kcontrol *kctl,
 	const struct scarlett2_device_info *info = private->info;
 
 	int index = elem->control + info->level_input_first;
+	int err = 0;
 
 	mutex_lock(&private->data_mutex);
-	if (private->input_other_updated)
-		scarlett2_update_input_other(mixer);
+
+	if (private->input_other_updated) {
+		err = scarlett2_update_input_other(mixer);
+		if (err < 0)
+			goto unlock;
+	}
 	ucontrol->value.enumerated.item[0] = private->level_switch[index];
-	mutex_unlock(&private->data_mutex);
 
-	return 0;
+unlock:
+	mutex_unlock(&private->data_mutex);
+	return err;
 }
 
 static int scarlett2_level_enum_ctl_put(struct snd_kcontrol *kctl,
@@ -2306,15 +2336,21 @@ static int scarlett2_pad_ctl_get(struct snd_kcontrol *kctl,
 	struct usb_mixer_elem_info *elem = kctl->private_data;
 	struct usb_mixer_interface *mixer = elem->head.mixer;
 	struct scarlett2_data *private = mixer->private_data;
+	int err = 0;
 
 	mutex_lock(&private->data_mutex);
-	if (private->input_other_updated)
-		scarlett2_update_input_other(mixer);
+
+	if (private->input_other_updated) {
+		err = scarlett2_update_input_other(mixer);
+		if (err < 0)
+			goto unlock;
+	}
 	ucontrol->value.integer.value[0] =
 		private->pad_switch[elem->control];
-	mutex_unlock(&private->data_mutex);
 
-	return 0;
+unlock:
+	mutex_unlock(&private->data_mutex);
+	return err;
 }
 
 static int scarlett2_pad_ctl_put(struct snd_kcontrol *kctl,
@@ -2364,14 +2400,20 @@ static int scarlett2_air_ctl_get(struct snd_kcontrol *kctl,
 	struct usb_mixer_elem_info *elem = kctl->private_data;
 	struct usb_mixer_interface *mixer = elem->head.mixer;
 	struct scarlett2_data *private = mixer->private_data;
+	int err = 0;
 
 	mutex_lock(&private->data_mutex);
-	if (private->input_other_updated)
-		scarlett2_update_input_other(mixer);
+
+	if (private->input_other_updated) {
+		err = scarlett2_update_input_other(mixer);
+		if (err < 0)
+			goto unlock;
+	}
 	ucontrol->value.integer.value[0] = private->air_switch[elem->control];
-	mutex_unlock(&private->data_mutex);
 
-	return 0;
+unlock:
+	mutex_unlock(&private->data_mutex);
+	return err;
 }
 
 static int scarlett2_air_ctl_put(struct snd_kcontrol *kctl,
@@ -2421,15 +2463,21 @@ static int scarlett2_phantom_ctl_get(struct snd_kcontrol *kctl,
 	struct usb_mixer_elem_info *elem = kctl->private_data;
 	struct usb_mixer_interface *mixer = elem->head.mixer;
 	struct scarlett2_data *private = mixer->private_data;
+	int err = 0;
 
 	mutex_lock(&private->data_mutex);
-	if (private->input_other_updated)
-		scarlett2_update_input_other(mixer);
+
+	if (private->input_other_updated) {
+		err = scarlett2_update_input_other(mixer);
+		if (err < 0)
+			goto unlock;
+	}
 	ucontrol->value.integer.value[0] =
 		private->phantom_switch[elem->control];
-	mutex_unlock(&private->data_mutex);
 
-	return 0;
+unlock:
+	mutex_unlock(&private->data_mutex);
+	return err;
 }
 
 static int scarlett2_phantom_ctl_put(struct snd_kcontrol *kctl,
@@ -2601,14 +2649,20 @@ static int scarlett2_direct_monitor_ctl_get(
 	struct usb_mixer_elem_info *elem = kctl->private_data;
 	struct usb_mixer_interface *mixer = elem->head.mixer;
 	struct scarlett2_data *private = elem->head.mixer->private_data;
+	int err = 0;
 
 	mutex_lock(&private->data_mutex);
-	if (private->monitor_other_updated)
-		scarlett2_update_monitor_other(mixer);
+
+	if (private->monitor_other_updated) {
+		err = scarlett2_update_monitor_other(mixer);
+		if (err < 0)
+			goto unlock;
+	}
 	ucontrol->value.enumerated.item[0] = private->direct_monitor_switch;
-	mutex_unlock(&private->data_mutex);
 
-	return 0;
+unlock:
+	mutex_unlock(&private->data_mutex);
+	return err;
 }
 
 static int scarlett2_direct_monitor_ctl_put(
@@ -2708,14 +2762,20 @@ static int scarlett2_speaker_switch_enum_ctl_get(
 	struct usb_mixer_elem_info *elem = kctl->private_data;
 	struct usb_mixer_interface *mixer = elem->head.mixer;
 	struct scarlett2_data *private = mixer->private_data;
+	int err = 0;
 
 	mutex_lock(&private->data_mutex);
-	if (private->monitor_other_updated)
-		scarlett2_update_monitor_other(mixer);
+
+	if (private->monitor_other_updated) {
+		err = scarlett2_update_monitor_other(mixer);
+		if (err < 0)
+			goto unlock;
+	}
 	ucontrol->value.enumerated.item[0] = private->speaker_switching_switch;
-	mutex_unlock(&private->data_mutex);
 
-	return 0;
+unlock:
+	mutex_unlock(&private->data_mutex);
+	return err;
 }
 
 /* when speaker switching gets enabled, switch the main/alt speakers
@@ -2863,14 +2923,20 @@ static int scarlett2_talkback_enum_ctl_get(
 	struct usb_mixer_elem_info *elem = kctl->private_data;
 	struct usb_mixer_interface *mixer = elem->head.mixer;
 	struct scarlett2_data *private = mixer->private_data;
+	int err = 0;
 
 	mutex_lock(&private->data_mutex);
-	if (private->monitor_other_updated)
-		scarlett2_update_monitor_other(mixer);
+
+	if (private->monitor_other_updated) {
+		err = scarlett2_update_monitor_other(mixer);
+		if (err < 0)
+			goto unlock;
+	}
 	ucontrol->value.enumerated.item[0] = private->talkback_switch;
-	mutex_unlock(&private->data_mutex);
 
-	return 0;
+unlock:
+	mutex_unlock(&private->data_mutex);
+	return err;
 }
 
 static int scarlett2_talkback_enum_ctl_put(
@@ -3018,14 +3084,20 @@ static int scarlett2_dim_mute_ctl_get(struct snd_kcontrol *kctl,
 	struct usb_mixer_elem_info *elem = kctl->private_data;
 	struct usb_mixer_interface *mixer = elem->head.mixer;
 	struct scarlett2_data *private = mixer->private_data;
+	int err = 0;
 
 	mutex_lock(&private->data_mutex);
-	if (private->vol_updated)
-		scarlett2_update_volumes(mixer);
-	mutex_unlock(&private->data_mutex);
 
+	if (private->vol_updated) {
+		err = scarlett2_update_volumes(mixer);
+		if (err < 0)
+			goto unlock;
+	}
 	ucontrol->value.integer.value[0] = private->dim_mute[elem->control];
-	return 0;
+
+unlock:
+	mutex_unlock(&private->data_mutex);
+	return err;
 }
 
 static int scarlett2_dim_mute_ctl_put(struct snd_kcontrol *kctl,
@@ -3396,14 +3468,20 @@ static int scarlett2_mux_src_enum_ctl_get(struct snd_kcontrol *kctl,
 	struct usb_mixer_interface *mixer = elem->head.mixer;
 	struct scarlett2_data *private = mixer->private_data;
 	int index = line_out_remap(private, elem->control);
+	int err = 0;
 
 	mutex_lock(&private->data_mutex);
-	if (private->mux_updated)
-		scarlett2_usb_get_mux(mixer);
+
+	if (private->mux_updated) {
+		err = scarlett2_usb_get_mux(mixer);
+		if (err < 0)
+			goto unlock;
+	}
 	ucontrol->value.enumerated.item[0] = private->mux[index];
-	mutex_unlock(&private->data_mutex);
 
-	return 0;
+unlock:
+	mutex_unlock(&private->data_mutex);
+	return err;
 }
 
 static int scarlett2_mux_src_enum_ctl_put(struct snd_kcontrol *kctl,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 323/583] ALSA: scarlett2: Add clamp() in scarlett2_mixer_ctl_put()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (321 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 322/583] ALSA: scarlett2: Add missing error checks to *_ctl_get() Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 324/583] mmc: sdhci_am654: Fix TI SoC dependencies Greg Kroah-Hartman
                   ` (266 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Geoffrey D. Bennett, Takashi Iwai,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Geoffrey D. Bennett <g@b4.vu>

[ Upstream commit 04f8f053252b86c7583895c962d66747ecdc61b7 ]

Ensure the value passed to scarlett2_mixer_ctl_put() is between 0 and
SCARLETT2_MIXER_MAX_VALUE so we don't attempt to access outside
scarlett2_mixer_values[].

Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Fixes: 9e4d5c1be21f ("ALSA: usb-audio: Scarlett Gen 2 mixer interface")
Link: https://lore.kernel.org/r/3b19fb3da641b587749b85fe1daa1b4e696c0c1b.1703001053.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/usb/mixer_scarlett_gen2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/usb/mixer_scarlett_gen2.c b/sound/usb/mixer_scarlett_gen2.c
index 087e120d7103..c04cff722541 100644
--- a/sound/usb/mixer_scarlett_gen2.c
+++ b/sound/usb/mixer_scarlett_gen2.c
@@ -3361,7 +3361,8 @@ static int scarlett2_mixer_ctl_put(struct snd_kcontrol *kctl,
 	mutex_lock(&private->data_mutex);
 
 	oval = private->mix[index];
-	val = ucontrol->value.integer.value[0];
+	val = clamp(ucontrol->value.integer.value[0],
+		    0L, (long)SCARLETT2_MIXER_MAX_VALUE);
 	num_mixer_in = port_count[SCARLETT2_PORT_TYPE_MIX][SCARLETT2_PORT_OUT];
 	mix_num = index / num_mixer_in;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 324/583] mmc: sdhci_am654: Fix TI SoC dependencies
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (322 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 323/583] ALSA: scarlett2: Add clamp() in scarlett2_mixer_ctl_put() Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 325/583] mmc: sdhci_omap: " Greg Kroah-Hartman
                   ` (265 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Peter Robinson, Ulf Hansson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Peter Robinson <pbrobinson@gmail.com>

[ Upstream commit cb052da7f031b0d2309a4895ca236afb3b4bbf50 ]

The sdhci_am654 is specific to recent TI SoCs, update the
dependencies for those SoCs and compile testing. While we're
at it update the text to reflect the wider range of
supported TI SoCS the driver now supports.

Fixes: 41fd4caeb00b ("mmc: sdhci_am654: Add Initial Support for AM654 SDHCI driver")
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Link: https://lore.kernel.org/r/20231220135950.433588-1-pbrobinson@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/mmc/host/Kconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index 554e67103c1a..e1c8c5474ad7 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -1033,14 +1033,15 @@ config MMC_SDHCI_OMAP
 
 config MMC_SDHCI_AM654
 	tristate "Support for the SDHCI Controller in TI's AM654 SOCs"
+	depends on ARCH_K3 || COMPILE_TEST
 	depends on MMC_SDHCI_PLTFM && OF
 	select MMC_SDHCI_IO_ACCESSORS
 	select MMC_CQHCI
 	select REGMAP_MMIO
 	help
 	  This selects the Secure Digital Host Controller Interface (SDHCI)
-	  support present in TI's AM654 SOCs. The controller supports
-	  SD/MMC/SDIO devices.
+	  support present in TI's AM65x/AM64x/AM62x/J721E SOCs. The controller
+	  supports SD/MMC/SDIO devices.
 
 	  If you have a controller with this interface, say Y or M here.
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 325/583] mmc: sdhci_omap: Fix TI SoC dependencies
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (323 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 324/583] mmc: sdhci_am654: Fix TI SoC dependencies Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 326/583] drm/amdkfd: Fix type of dbg_flags in struct kfd_process Greg Kroah-Hartman
                   ` (264 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Peter Robinson, Ulf Hansson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Peter Robinson <pbrobinson@gmail.com>

[ Upstream commit 09f164d393a6671e5ff8342ba6b3cb7fe3f20208 ]

The sdhci_omap is specific to  older TI SoCs, update the
dependencies for those SoCs and compile testing. While we're
at it update the text to reflect the wider range of
supported TI SoCS the driver now supports.

Fixes: 7d326930d352 ("mmc: sdhci-omap: Add OMAP SDHCI driver")
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Link: https://lore.kernel.org/r/20231220135950.433588-2-pbrobinson@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/mmc/host/Kconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index e1c8c5474ad7..bc7e2ad37002 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -1018,14 +1018,15 @@ config MMC_SDHCI_XENON
 
 config MMC_SDHCI_OMAP
 	tristate "TI SDHCI Controller Support"
+	depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || COMPILE_TEST
 	depends on MMC_SDHCI_PLTFM && OF
 	select THERMAL
 	imply TI_SOC_THERMAL
 	select MMC_SDHCI_EXTERNAL_DMA if DMA_ENGINE
 	help
 	  This selects the Secure Digital Host Controller Interface (SDHCI)
-	  support present in TI's DRA7 SOCs. The controller supports
-	  SD/MMC/SDIO devices.
+	  support present in TI's Keystone/OMAP2+/DRA7 SOCs. The controller
+	  supports SD/MMC/SDIO devices.
 
 	  If you have a controller with this interface, say Y or M here.
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 326/583] drm/amdkfd: Fix type of dbg_flags in struct kfd_process
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (324 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 325/583] mmc: sdhci_omap: " Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 327/583] gpiolib: make gpio_device_get() and gpio_device_put() public Greg Kroah-Hartman
                   ` (263 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Lijo Lazar, Felix Kuehling,
	Christian König, Alex Deucher, Srinivasan Shanmugam,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>

[ Upstream commit 217e85f97031791fb48a2d374c7bdcf439365b21 ]

dbg_flags looks to be defined with incorrect data type; to process
multiple debug flag options, and hence defined dbg_flags as u32.

Fixes the below:

drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_packet_manager_v9.c:117 pm_map_process_aldebaran() warn: maybe use && instead of &

Fixes: 0de4ec9a0353 ("drm/amdgpu: prepare map process for multi-process debug devices")
Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
Cc: Felix Kuehling <Felix.Kuehling@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
index df7a5cdb8693..3287a3961395 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
@@ -971,7 +971,7 @@ struct kfd_process {
 	struct work_struct debug_event_workarea;
 
 	/* Tracks debug per-vmid request for debug flags */
-	bool dbg_flags;
+	u32 dbg_flags;
 
 	atomic_t poison;
 	/* Queues are in paused stated because we are in the process of doing a CRIU checkpoint */
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 327/583] gpiolib: make gpio_device_get() and gpio_device_put() public
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (325 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 326/583] drm/amdkfd: Fix type of dbg_flags in struct kfd_process Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 328/583] gpiolib: provide gpio_device_find() Greg Kroah-Hartman
                   ` (262 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Bartosz Golaszewski, Linus Walleij,
	Andy Shevchenko, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

[ Upstream commit 36aa129f221c9070afd8dff03154ab49702a5b1b ]

In order to start migrating away from accessing struct gpio_chip by
users other than their owners, let's first make the reference management
functions for the opaque struct gpio_device public in the driver.h
header.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Stable-dep-of: 48e1b4d369cf ("gpiolib: remove the GPIO device from the list when it's unregistered")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpio/gpiolib.c      | 24 ++++++++++++++++++++++++
 drivers/gpio/gpiolib.h      | 10 ----------
 include/linux/gpio/driver.h |  3 +++
 3 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 40a0022ea719..c2b40d7138fa 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1058,6 +1058,30 @@ static struct gpio_chip *find_chip_by_name(const char *name)
 	return gpiochip_find((void *)name, gpiochip_match_name);
 }
 
+/**
+ * gpio_device_get() - Increase the reference count of this GPIO device
+ * @gdev: GPIO device to increase the refcount for
+ *
+ * Returns:
+ * Pointer to @gdev.
+ */
+struct gpio_device *gpio_device_get(struct gpio_device *gdev)
+{
+	return to_gpio_device(get_device(&gdev->dev));
+}
+EXPORT_SYMBOL_GPL(gpio_device_get);
+
+/**
+ * gpio_device_put() - Decrease the reference count of this GPIO device and
+ *                     possibly free all resources associated with it.
+ * @gdev: GPIO device to decrease the reference count for
+ */
+void gpio_device_put(struct gpio_device *gdev)
+{
+	put_device(&gdev->dev);
+}
+EXPORT_SYMBOL_GPL(gpio_device_put);
+
 #ifdef CONFIG_GPIOLIB_IRQCHIP
 
 /*
diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h
index a0a67569300b..aa1926083689 100644
--- a/drivers/gpio/gpiolib.h
+++ b/drivers/gpio/gpiolib.h
@@ -86,16 +86,6 @@ static inline struct gpio_device *to_gpio_device(struct device *dev)
 	return container_of(dev, struct gpio_device, dev);
 }
 
-static inline struct gpio_device *gpio_device_get(struct gpio_device *gdev)
-{
-	return to_gpio_device(get_device(&gdev->dev));
-}
-
-static inline void gpio_device_put(struct gpio_device *gdev)
-{
-	put_device(&gdev->dev);
-}
-
 /* gpio suffixes used for ACPI and device tree lookup */
 static __maybe_unused const char * const gpio_suffixes[] = { "gpios", "gpio" };
 
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 4f0c5d62c8f3..64c214317a83 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -607,6 +607,9 @@ extern int devm_gpiochip_add_data_with_key(struct device *dev, struct gpio_chip
 extern struct gpio_chip *gpiochip_find(void *data,
 			      int (*match)(struct gpio_chip *gc, void *data));
 
+struct gpio_device *gpio_device_get(struct gpio_device *gdev);
+void gpio_device_put(struct gpio_device *gdev);
+
 bool gpiochip_line_is_irq(struct gpio_chip *gc, unsigned int offset);
 int gpiochip_reqres_irq(struct gpio_chip *gc, unsigned int offset);
 void gpiochip_relres_irq(struct gpio_chip *gc, unsigned int offset);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 328/583] gpiolib: provide gpio_device_find()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (326 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 327/583] gpiolib: make gpio_device_get() and gpio_device_put() public Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-23  9:56   ` Bartosz Golaszewski
  2024-01-22 23:56 ` [PATCH 6.6 329/583] gpio: sysfs: drop the mention of gpiochip_find() from sysfs code Greg Kroah-Hartman
                   ` (261 subsequent siblings)
  589 siblings, 1 reply; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Bartosz Golaszewski, Linus Walleij,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

[ Upstream commit cfe102f63308c8c8e01199a682868a64b83f653e ]

gpiochip_find() is wrong and its kernel doc is misleading as the
function doesn't return a reference to the gpio_chip but just a raw
pointer. The chip itself is not guaranteed to stay alive, in fact it can
be deleted at any point. Also: other than GPIO drivers themselves,
nobody else has any business accessing gpio_chip structs.

Provide a new gpio_device_find() function that returns a real reference
to the opaque gpio_device structure that is guaranteed to stay alive for
as long as there are active users of it.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Stable-dep-of: 48e1b4d369cf ("gpiolib: remove the GPIO device from the list when it's unregistered")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpio/gpiolib.c      | 71 +++++++++++++++++++++++++++----------
 include/linux/gpio/driver.h |  3 ++
 2 files changed, 56 insertions(+), 18 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index c2b40d7138fa..71492d213ef4 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1014,16 +1014,10 @@ void gpiochip_remove(struct gpio_chip *gc)
 }
 EXPORT_SYMBOL_GPL(gpiochip_remove);
 
-/**
- * gpiochip_find() - iterator for locating a specific gpio_chip
- * @data: data to pass to match function
- * @match: Callback function to check gpio_chip
+/*
+ * FIXME: This will be removed soon.
  *
- * Similar to bus_find_device.  It returns a reference to a gpio_chip as
- * determined by a user supplied @match callback.  The callback should return
- * 0 if the device doesn't match and non-zero if it does.  If the callback is
- * non-zero, this function will return to the caller and not iterate over any
- * more gpio_chips.
+ * This function is depracated, don't use.
  */
 struct gpio_chip *gpiochip_find(void *data,
 				int (*match)(struct gpio_chip *gc,
@@ -1031,21 +1025,62 @@ struct gpio_chip *gpiochip_find(void *data,
 {
 	struct gpio_device *gdev;
 	struct gpio_chip *gc = NULL;
-	unsigned long flags;
-
-	spin_lock_irqsave(&gpio_lock, flags);
-	list_for_each_entry(gdev, &gpio_devices, list)
-		if (gdev->chip && match(gdev->chip, data)) {
-			gc = gdev->chip;
-			break;
-		}
 
-	spin_unlock_irqrestore(&gpio_lock, flags);
+	gdev = gpio_device_find(data, match);
+	if (gdev) {
+		gc = gdev->chip;
+		gpio_device_put(gdev);
+	}
 
 	return gc;
 }
 EXPORT_SYMBOL_GPL(gpiochip_find);
 
+/**
+ * gpio_device_find() - find a specific GPIO device
+ * @data: data to pass to match function
+ * @match: Callback function to check gpio_chip
+ *
+ * Returns:
+ * New reference to struct gpio_device.
+ *
+ * Similar to bus_find_device(). It returns a reference to a gpio_device as
+ * determined by a user supplied @match callback. The callback should return
+ * 0 if the device doesn't match and non-zero if it does. If the callback
+ * returns non-zero, this function will return to the caller and not iterate
+ * over any more gpio_devices.
+ *
+ * The callback takes the GPIO chip structure as argument. During the execution
+ * of the callback function the chip is protected from being freed. TODO: This
+ * actually has yet to be implemented.
+ *
+ * If the function returns non-NULL, the returned reference must be freed by
+ * the caller using gpio_device_put().
+ */
+struct gpio_device *gpio_device_find(void *data,
+				     int (*match)(struct gpio_chip *gc,
+						  void *data))
+{
+	struct gpio_device *gdev;
+
+	/*
+	 * Not yet but in the future the spinlock below will become a mutex.
+	 * Annotate this function before anyone tries to use it in interrupt
+	 * context like it happened with gpiochip_find().
+	 */
+	might_sleep();
+
+	guard(spinlock_irqsave)(&gpio_lock);
+
+	list_for_each_entry(gdev, &gpio_devices, list) {
+		if (gdev->chip && match(gdev->chip, data))
+			return gpio_device_get(gdev);
+	}
+
+	return NULL;
+}
+EXPORT_SYMBOL_GPL(gpio_device_find);
+
 static int gpiochip_match_name(struct gpio_chip *gc, void *data)
 {
 	const char *name = data;
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 64c214317a83..d6e38a500833 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -607,6 +607,9 @@ extern int devm_gpiochip_add_data_with_key(struct device *dev, struct gpio_chip
 extern struct gpio_chip *gpiochip_find(void *data,
 			      int (*match)(struct gpio_chip *gc, void *data));
 
+struct gpio_device *gpio_device_find(void *data,
+				int (*match)(struct gpio_chip *gc, void *data));
+
 struct gpio_device *gpio_device_get(struct gpio_device *gdev);
 void gpio_device_put(struct gpio_device *gdev);
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 329/583] gpio: sysfs: drop the mention of gpiochip_find() from sysfs code
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (327 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 328/583] gpiolib: provide gpio_device_find() Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 330/583] IB/iser: Prevent invalidating wrong MR Greg Kroah-Hartman
                   ` (260 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Bartosz Golaszewski, Linus Walleij,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

[ Upstream commit e404b0cc9f0b0b551f3276a814d38abf1f26d98f ]

We have removed all callers of gpiochip_find() so don't mention it in
gpiolib-sysfs.c.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Stable-dep-of: 48e1b4d369cf ("gpiolib: remove the GPIO device from the list when it's unregistered")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpio/gpiolib-sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index c7c5c19ebc66..12d853845bb8 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -817,7 +817,7 @@ static int __init gpiolib_sysfs_init(void)
 		 * gpiochip_sysfs_register() acquires a mutex. This is unsafe
 		 * and needs to be fixed.
 		 *
-		 * Also it would be nice to use gpiochip_find() here so we
+		 * Also it would be nice to use gpio_device_find() here so we
 		 * can keep gpio_chips local to gpiolib.c, but the yield of
 		 * gpio_lock prevents us from doing this.
 		 */
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 330/583] IB/iser: Prevent invalidating wrong MR
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (328 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 329/583] gpio: sysfs: drop the mention of gpiochip_find() from sysfs code Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 331/583] drm/amdkfd: Confirm list is non-empty before utilizing list_first_entry in kfd_topology.c Greg Kroah-Hartman
                   ` (259 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Max Gurtovoy, Sergey Gorenko,
	Jason Gunthorpe, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sergey Gorenko <sergeygo@nvidia.com>

[ Upstream commit 2f1888281e67205bd80d3e8f54dbd519a9653f26 ]

The iser_reg_resources structure has two pointers to MR but only one
mr_valid field. The implementation assumes that we use only *sig_mr when
pi_enable is true. Otherwise, we use only *mr. However, it is only
sometimes correct. Read commands without protection information occur even
when pi_enble is true. For example, the following SCSI commands have a
Data-In buffer but never have protection information: READ CAPACITY (16),
INQUIRY, MODE SENSE(6), MAINTENANCE IN. So, we use
*sig_mr for some SCSI commands and *mr for the other SCSI commands.

In most cases, it works fine because the remote invalidation is applied.
However, there are two cases when the remote invalidation is not
applicable.
 1. Small write commands when all data is sent as an immediate.
 2. The target does not support the remote invalidation feature.

The lazy invalidation is used if the remote invalidation is impossible.
Since, at the lazy invalidation, we always invalidate the MR we want to
use, the wrong MR may be invalidated.

To fix the issue, we need a field per MR that indicates the MR needs
invalidation. Since the ib_mr structure already has such a field, let's
use ib_mr.need_inval instead of iser_reg_resources.mr_valid.

Fixes: b76a439982f8 ("IB/iser: Use IB_WR_REG_MR_INTEGRITY for PI handover")
Link: https://lore.kernel.org/r/20231219072311.40989-1-sergeygo@nvidia.com
Acked-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Signed-off-by: Sergey Gorenko <sergeygo@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/infiniband/ulp/iser/iscsi_iser.h     | 2 --
 drivers/infiniband/ulp/iser/iser_initiator.c | 5 ++++-
 drivers/infiniband/ulp/iser/iser_memory.c    | 8 ++++----
 drivers/infiniband/ulp/iser/iser_verbs.c     | 1 -
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
index dee8c97ff056..d967d5532459 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -317,12 +317,10 @@ struct iser_device {
  *
  * @mr:         memory region
  * @sig_mr:     signature memory region
- * @mr_valid:   is mr valid indicator
  */
 struct iser_reg_resources {
 	struct ib_mr                     *mr;
 	struct ib_mr                     *sig_mr;
-	u8				  mr_valid:1;
 };
 
 /**
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c
index 39ea73f69016..f5f090dc4f1e 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -581,7 +581,10 @@ static inline int iser_inv_desc(struct iser_fr_desc *desc, u32 rkey)
 		return -EINVAL;
 	}
 
-	desc->rsc.mr_valid = 0;
+	if (desc->sig_protected)
+		desc->rsc.sig_mr->need_inval = false;
+	else
+		desc->rsc.mr->need_inval = false;
 
 	return 0;
 }
diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c
index 29ae2c6a250a..6efcb79c8efe 100644
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -264,7 +264,7 @@ static int iser_reg_sig_mr(struct iscsi_iser_task *iser_task,
 
 	iser_set_prot_checks(iser_task->sc, &sig_attrs->check_mask);
 
-	if (rsc->mr_valid)
+	if (rsc->sig_mr->need_inval)
 		iser_inv_rkey(&tx_desc->inv_wr, mr, cqe, &wr->wr);
 
 	ib_update_fast_reg_key(mr, ib_inc_rkey(mr->rkey));
@@ -288,7 +288,7 @@ static int iser_reg_sig_mr(struct iscsi_iser_task *iser_task,
 	wr->access = IB_ACCESS_LOCAL_WRITE |
 		     IB_ACCESS_REMOTE_READ |
 		     IB_ACCESS_REMOTE_WRITE;
-	rsc->mr_valid = 1;
+	rsc->sig_mr->need_inval = true;
 
 	sig_reg->sge.lkey = mr->lkey;
 	sig_reg->rkey = mr->rkey;
@@ -313,7 +313,7 @@ static int iser_fast_reg_mr(struct iscsi_iser_task *iser_task,
 	struct ib_reg_wr *wr = &tx_desc->reg_wr;
 	int n;
 
-	if (rsc->mr_valid)
+	if (rsc->mr->need_inval)
 		iser_inv_rkey(&tx_desc->inv_wr, mr, cqe, &wr->wr);
 
 	ib_update_fast_reg_key(mr, ib_inc_rkey(mr->rkey));
@@ -336,7 +336,7 @@ static int iser_fast_reg_mr(struct iscsi_iser_task *iser_task,
 		     IB_ACCESS_REMOTE_WRITE |
 		     IB_ACCESS_REMOTE_READ;
 
-	rsc->mr_valid = 1;
+	rsc->mr->need_inval = true;
 
 	reg->sge.lkey = mr->lkey;
 	reg->rkey = mr->rkey;
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index 95b8eebf7e04..6801b70dc9e0 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -129,7 +129,6 @@ iser_create_fastreg_desc(struct iser_device *device,
 			goto err_alloc_mr_integrity;
 		}
 	}
-	desc->rsc.mr_valid = 0;
 
 	return desc;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 331/583] drm/amdkfd: Confirm list is non-empty before utilizing list_first_entry in kfd_topology.c
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (329 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 330/583] IB/iser: Prevent invalidating wrong MR Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 332/583] drm/amd/pm/smu7: fix a memleak in smu7_hwmgr_backend_init Greg Kroah-Hartman
                   ` (258 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Felix Kuehling,
	Christian König, Alex Deucher, Srinivasan Shanmugam,
	Lijo Lazar, Felix Kuehling, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>

[ Upstream commit 499839eca34ad62d43025ec0b46b80e77065f6d8 ]

Before using list_first_entry, make sure to check that list is not
empty, if list is empty return -ENODATA.

Fixes the below:
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c:1347 kfd_create_indirect_link_prop() warn: can 'gpu_link' even be NULL?
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c:1428 kfd_add_peer_prop() warn: can 'iolink1' even be NULL?
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c:1433 kfd_add_peer_prop() warn: can 'iolink2' even be NULL?

Fixes: 0f28cca87e9a ("drm/amdkfd: Extend KFD device topology to surface peer-to-peer links")
Cc: Felix Kuehling <Felix.Kuehling@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Suggested-by: Felix Kuehling <Felix.Kuehling@amd.com>
Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index c8c75ff7cea8..6e75e8fa18be 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -1342,10 +1342,11 @@ static int kfd_create_indirect_link_prop(struct kfd_topology_device *kdev, int g
 		num_cpu++;
 	}
 
+	if (list_empty(&kdev->io_link_props))
+		return -ENODATA;
+
 	gpu_link = list_first_entry(&kdev->io_link_props,
-					struct kfd_iolink_properties, list);
-	if (!gpu_link)
-		return -ENOMEM;
+				    struct kfd_iolink_properties, list);
 
 	for (i = 0; i < num_cpu; i++) {
 		/* CPU <--> GPU */
@@ -1423,15 +1424,17 @@ static int kfd_add_peer_prop(struct kfd_topology_device *kdev,
 				peer->gpu->adev))
 		return ret;
 
+	if (list_empty(&kdev->io_link_props))
+		return -ENODATA;
+
 	iolink1 = list_first_entry(&kdev->io_link_props,
-							struct kfd_iolink_properties, list);
-	if (!iolink1)
-		return -ENOMEM;
+				   struct kfd_iolink_properties, list);
+
+	if (list_empty(&peer->io_link_props))
+		return -ENODATA;
 
 	iolink2 = list_first_entry(&peer->io_link_props,
-							struct kfd_iolink_properties, list);
-	if (!iolink2)
-		return -ENOMEM;
+				   struct kfd_iolink_properties, list);
 
 	props = kfd_alloc_struct(props);
 	if (!props)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 332/583] drm/amd/pm/smu7: fix a memleak in smu7_hwmgr_backend_init
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (330 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 331/583] drm/amdkfd: Confirm list is non-empty before utilizing list_first_entry in kfd_topology.c Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 333/583] drm/amd/display: avoid stringop-overflow warnings for dp_decide_lane_settings() Greg Kroah-Hartman
                   ` (257 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Zhipeng Lu, Alex Deucher, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Zhipeng Lu <alexious@zju.edu.cn>

[ Upstream commit 2f3be3ca779b11c332441b10e00443a2510f4d7b ]

The hwmgr->backend, (i.e. data) allocated by kzalloc is not freed in
the error-handling paths of smu7_get_evv_voltages and
smu7_update_edc_leakage_table. However, it did be freed in the
error-handling of phm_initializa_dynamic_state_adjustment_rule_settings,
by smu7_hwmgr_backend_fini. So the lack of free in smu7_get_evv_voltages
and smu7_update_edc_leakage_table is considered a memleak in this patch.

Fixes: 599a7e9fe1b6 ("drm/amd/powerplay: implement smu7 hwmgr to manager asics with smu ip version 7.")
Fixes: 8f0804c6b7d0 ("drm/amd/pm: add edc leakage controller setting")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
index 11372fcc59c8..b1a8799e2dee 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
@@ -2974,6 +2974,8 @@ static int smu7_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
 		result = smu7_get_evv_voltages(hwmgr);
 		if (result) {
 			pr_info("Get EVV Voltage Failed.  Abort Driver loading!\n");
+			kfree(hwmgr->backend);
+			hwmgr->backend = NULL;
 			return -EINVAL;
 		}
 	} else {
@@ -3019,8 +3021,10 @@ static int smu7_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
 	}
 
 	result = smu7_update_edc_leakage_table(hwmgr);
-	if (result)
+	if (result) {
+		smu7_hwmgr_backend_fini(hwmgr);
 		return result;
+	}
 
 	return 0;
 }
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 333/583] drm/amd/display: avoid stringop-overflow warnings for dp_decide_lane_settings()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (331 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 332/583] drm/amd/pm/smu7: fix a memleak in smu7_hwmgr_backend_init Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 334/583] kselftest/alsa - mixer-test: fix the number of parameters to ksft_exit_fail_msg() Greg Kroah-Hartman
                   ` (256 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Randy Dunlap, Arnd Bergmann,
	Alex Deucher, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnd Bergmann <arnd@arndb.de>

[ Upstream commit c966dc0e9d96dc44423c404a2628236f1200c24e ]

gcc prints a warning about a possible array overflow for a couple of
callers of dp_decide_lane_settings() after commit 1b56c90018f0 ("Makefile:
Enable -Wstringop-overflow globally"):

drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_training_fixed_vs_pe_retimer.c: In function 'dp_perform_fixed_vs_pe_training_sequence_legacy':
drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_training_fixed_vs_pe_retimer.c:426:25: error: 'dp_decide_lane_settings' accessing 4 bytes in a region of size 1 [-Werror=stringop-overflow=]
  426 |                         dp_decide_lane_settings(lt_settings, dpcd_lane_adjust,
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  427 |                                         lt_settings->hw_lane_settings, lt_settings->dpcd_lane_settings);
      |                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_training_fixed_vs_pe_retimer.c:426:25: note: referencing argument 4 of type 'union dpcd_training_lane[4]'

I'm not entirely sure what caused this, but changing the prototype to expect
a pointer instead of an array avoids the warnings.

Fixes: 7727e7b60f82 ("drm/amd/display: Improve robustness of FIXED_VS link training at DP1 rates")
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../gpu/drm/amd/display/dc/link/protocols/link_dp_training.c    | 2 +-
 .../gpu/drm/amd/display/dc/link/protocols/link_dp_training.h    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c
index 90339c2dfd84..5a0b04518956 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c
@@ -807,7 +807,7 @@ void dp_decide_lane_settings(
 		const struct link_training_settings *lt_settings,
 		const union lane_adjust ln_adjust[LANE_COUNT_DP_MAX],
 		struct dc_lane_settings hw_lane_settings[LANE_COUNT_DP_MAX],
-		union dpcd_training_lane dpcd_lane_settings[LANE_COUNT_DP_MAX])
+		union dpcd_training_lane *dpcd_lane_settings)
 {
 	uint32_t lane;
 
diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.h b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.h
index 7d027bac8255..851bd17317a0 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.h
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.h
@@ -111,7 +111,7 @@ void dp_decide_lane_settings(
 	const struct link_training_settings *lt_settings,
 	const union lane_adjust ln_adjust[LANE_COUNT_DP_MAX],
 	struct dc_lane_settings hw_lane_settings[LANE_COUNT_DP_MAX],
-	union dpcd_training_lane dpcd_lane_settings[LANE_COUNT_DP_MAX]);
+	union dpcd_training_lane *dpcd_lane_settings);
 
 enum dc_dp_training_pattern decide_cr_training_pattern(
 		const struct dc_link_settings *link_settings);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 334/583] kselftest/alsa - mixer-test: fix the number of parameters to ksft_exit_fail_msg()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (332 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 333/583] drm/amd/display: avoid stringop-overflow warnings for dp_decide_lane_settings() Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 335/583] kselftest/alsa - mixer-test: Fix the print format specifier warning Greg Kroah-Hartman
                   ` (255 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Shuah Khan, linux-sound, linux-kselftest,
	linux-kernel, Mirsad Todorovac, Takashi Iwai, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>

[ Upstream commit 8c51c13dc63d46e754c44215eabc0890a8bd9bfb ]

Minor fix in the number of arguments to error reporting function in the
test program as reported by GCC 13.2.0 warning.

mixer-test.c: In function ‘find_controls’:
mixer-test.c:169:44: warning: too many arguments for format [-Wformat-extra-args]
  169 |                         ksft_exit_fail_msg("snd_ctl_poll_descriptors() failed for %d\n",
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The number of arguments in call to ksft_exit_fail_msg() doesn't correspond
to the format specifiers, so this is adjusted resembling the sibling calls
to the error function.

Fixes: b1446bda56456 ("kselftest: alsa: Check for event generation when we write to controls")
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: linux-sound@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240107173704.937824-2-mirsad.todorovac@alu.unizg.hr
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/alsa/mixer-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/alsa/mixer-test.c b/tools/testing/selftests/alsa/mixer-test.c
index 23df154fcdd7..208c2170c074 100644
--- a/tools/testing/selftests/alsa/mixer-test.c
+++ b/tools/testing/selftests/alsa/mixer-test.c
@@ -166,7 +166,7 @@ static void find_controls(void)
 		err = snd_ctl_poll_descriptors(card_data->handle,
 					       &card_data->pollfd, 1);
 		if (err != 1) {
-			ksft_exit_fail_msg("snd_ctl_poll_descriptors() failed for %d\n",
+			ksft_exit_fail_msg("snd_ctl_poll_descriptors() failed for card %d: %d\n",
 				       card, err);
 		}
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 335/583] kselftest/alsa - mixer-test: Fix the print format specifier warning
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (333 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 334/583] kselftest/alsa - mixer-test: fix the number of parameters to ksft_exit_fail_msg() Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 336/583] kselftest/alsa - conf: Stringify the printed errno in sysfs_get() Greg Kroah-Hartman
                   ` (254 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Shuah Khan, linux-sound, linux-kselftest,
	linux-kernel, Mirsad Todorovac, Takashi Iwai, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>

[ Upstream commit 3f47c1ebe5ca9c5883e596c7888dec4bec0176d8 ]

The GCC 13.2.0 compiler issued the following warning:

mixer-test.c: In function ‘ctl_value_index_valid’:
mixer-test.c:322:79: warning: format ‘%lld’ expects argument of type ‘long long int’, \
			      but argument 5 has type ‘long int’ [-Wformat=]
  322 |                         ksft_print_msg("%s.%d value %lld more than maximum %lld\n",
      |                                                                            ~~~^
      |                                                                               |
      |                                                                               long long int
      |                                                                            %ld
  323 |                                        ctl->name, index, int64_val,
  324 |                                        snd_ctl_elem_info_get_max(ctl->info));
      |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                        |
      |                                        long int

Fixing the format specifier as advised by the compiler suggestion removes the
warning.

Fixes: 3f48b137d88e7 ("kselftest: alsa: Factor out check that values meet constraints")
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: linux-sound@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240107173704.937824-3-mirsad.todorovac@alu.unizg.hr
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/alsa/mixer-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/alsa/mixer-test.c b/tools/testing/selftests/alsa/mixer-test.c
index 208c2170c074..df942149c6f6 100644
--- a/tools/testing/selftests/alsa/mixer-test.c
+++ b/tools/testing/selftests/alsa/mixer-test.c
@@ -319,7 +319,7 @@ static bool ctl_value_index_valid(struct ctl_data *ctl,
 		}
 
 		if (int64_val > snd_ctl_elem_info_get_max64(ctl->info)) {
-			ksft_print_msg("%s.%d value %lld more than maximum %lld\n",
+			ksft_print_msg("%s.%d value %lld more than maximum %ld\n",
 				       ctl->name, index, int64_val,
 				       snd_ctl_elem_info_get_max(ctl->info));
 			return false;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 336/583] kselftest/alsa - conf: Stringify the printed errno in sysfs_get()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (334 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 335/583] kselftest/alsa - mixer-test: Fix the print format specifier warning Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 337/583] ksmbd: validate the zero field of packet header Greg Kroah-Hartman
                   ` (253 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Shuah Khan, linux-sound, linux-kselftest,
	linux-kernel, Mirsad Todorovac, Takashi Iwai, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>

[ Upstream commit fd38dd6abda589a8771e7872e4dea28c99c6a6ef ]

GCC 13.2.0 reported the warning of the print format specifier:

conf.c: In function ‘sysfs_get’:
conf.c:181:72: warning: format ‘%s’ expects argument of type ‘char *’, \
			but argument 3 has type ‘int’ [-Wformat=]
  181 |                 ksft_exit_fail_msg("sysfs: unable to read value '%s': %s\n",
      |                                                                       ~^
      |                                                                        |
      |                                                                        char *
      |                                                                       %d

The fix passes strerror(errno) as it was intended, like in the sibling error
exit message.

Fixes: aba51cd0949ae ("selftests: alsa - add PCM test")
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: linux-sound@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240107173704.937824-5-mirsad.todorovac@alu.unizg.hr
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/alsa/conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/alsa/conf.c b/tools/testing/selftests/alsa/conf.c
index 2f1685a3eae1..ff09038fdce6 100644
--- a/tools/testing/selftests/alsa/conf.c
+++ b/tools/testing/selftests/alsa/conf.c
@@ -186,7 +186,7 @@ static char *sysfs_get(const char *sysfs_root, const char *id)
 	close(fd);
 	if (len < 0)
 		ksft_exit_fail_msg("sysfs: unable to read value '%s': %s\n",
-				   path, errno);
+				   path, strerror(errno));
 	while (len > 0 && path[len-1] == '\n')
 		len--;
 	path[len] = '\0';
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 337/583] ksmbd: validate the zero field of packet header
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (335 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 336/583] kselftest/alsa - conf: Stringify the printed errno in sysfs_get() Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 338/583] of: Fix double free in of_parse_phandle_with_args_map Greg Kroah-Hartman
                   ` (252 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Li Nan, Tom Talpey, Namjae Jeon,
	Steve French, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Li Nan <linan122@huawei.com>

[ Upstream commit 516b3eb8c8065f7465f87608d37a7ed08298c7a5 ]

The SMB2 Protocol requires that "The first byte of the Direct TCP
transport packet header MUST be zero (0x00)"[1]. Commit 1c1bcf2d3ea0
("ksmbd: validate smb request protocol id") removed the validation of
this 1-byte zero. Add the validation back now.

[1]: [MS-SMB2] - v20230227, page 30.
https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-SMB2/%5bMS-SMB2%5d-230227.pdf

Fixes: 1c1bcf2d3ea0 ("ksmbd: validate smb request protocol id")
Signed-off-by: Li Nan <linan122@huawei.com>
Acked-by: Tom Talpey <tom@talpey.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/smb/server/smb_common.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/smb/server/smb_common.c b/fs/smb/server/smb_common.c
index 6691ae68af0c..7c98bf699772 100644
--- a/fs/smb/server/smb_common.c
+++ b/fs/smb/server/smb_common.c
@@ -158,8 +158,12 @@ int ksmbd_verify_smb_message(struct ksmbd_work *work)
  */
 bool ksmbd_smb_request(struct ksmbd_conn *conn)
 {
-	__le32 *proto = (__le32 *)smb2_get_msg(conn->request_buf);
+	__le32 *proto;
 
+	if (conn->request_buf[0] != 0)
+		return false;
+
+	proto = (__le32 *)smb2_get_msg(conn->request_buf);
 	if (*proto == SMB2_COMPRESSION_TRANSFORM_ID) {
 		pr_err_ratelimited("smb2 compression not support yet");
 		return false;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 338/583] of: Fix double free in of_parse_phandle_with_args_map
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (336 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 337/583] ksmbd: validate the zero field of packet header Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 339/583] fbdev: imxfb: fix left margin setting Greg Kroah-Hartman
                   ` (251 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Stephen Boyd, Christian A. Ehrhardt,
	Rob Herring, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christian A. Ehrhardt <lk@c--e.de>

[ Upstream commit 4dde83569832f9377362e50f7748463340c5db6b ]

In of_parse_phandle_with_args_map() the inner loop that
iterates through the map entries calls of_node_put(new)
to free the reference acquired by the previous iteration
of the inner loop. This assumes that the value of "new" is
NULL on the first iteration of the inner loop.

Make sure that this is true in all iterations of the outer
loop by setting "new" to NULL after its value is assigned to "cur".

Extend the unittest to detect the double free and add an additional
test case that actually triggers this path.

Fixes: bd6f2fd5a1 ("of: Support parsing phandle argument lists through a nexus node")
Cc: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: "Christian A. Ehrhardt" <lk@c--e.de>
Link: https://lore.kernel.org/r/20231229105411.1603434-1-lk@c--e.de
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/of/base.c                           |  1 +
 drivers/of/unittest-data/tests-phandle.dtsi | 10 ++-
 drivers/of/unittest.c                       | 74 ++++++++++++---------
 3 files changed, 53 insertions(+), 32 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 8d93cb6ea9cd..b0ad8fc06e80 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1464,6 +1464,7 @@ int of_parse_phandle_with_args_map(const struct device_node *np,
 		out_args->np = new;
 		of_node_put(cur);
 		cur = new;
+		new = NULL;
 	}
 put:
 	of_node_put(cur);
diff --git a/drivers/of/unittest-data/tests-phandle.dtsi b/drivers/of/unittest-data/tests-phandle.dtsi
index d01f92f0f0db..554a996b2ef1 100644
--- a/drivers/of/unittest-data/tests-phandle.dtsi
+++ b/drivers/of/unittest-data/tests-phandle.dtsi
@@ -40,6 +40,13 @@ provider4: provider4 {
 				phandle-map-pass-thru = <0x0 0xf0>;
 			};
 
+			provider5: provider5 {
+				#phandle-cells = <2>;
+				phandle-map = <2 7 &provider4 2 3>;
+				phandle-map-mask = <0xff 0xf>;
+				phandle-map-pass-thru = <0x0 0xf0>;
+			};
+
 			consumer-a {
 				phandle-list =	<&provider1 1>,
 						<&provider2 2 0>,
@@ -66,7 +73,8 @@ consumer-b {
 						<&provider4 4 0x100>,
 						<&provider4 0 0x61>,
 						<&provider0>,
-						<&provider4 19 0x20>;
+						<&provider4 19 0x20>,
+						<&provider5 2 7>;
 				phandle-list-bad-phandle = <12345678 0 0>;
 				phandle-list-bad-args = <&provider2 1 0>,
 							<&provider4 0>;
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index ad2b7879cc67..c63f5963751b 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -456,6 +456,9 @@ static void __init of_unittest_parse_phandle_with_args(void)
 
 		unittest(passed, "index %i - data error on node %pOF rc=%i\n",
 			 i, args.np, rc);
+
+		if (rc == 0)
+			of_node_put(args.np);
 	}
 
 	/* Check for missing list property */
@@ -545,8 +548,9 @@ static void __init of_unittest_parse_phandle_with_args(void)
 
 static void __init of_unittest_parse_phandle_with_args_map(void)
 {
-	struct device_node *np, *p0, *p1, *p2, *p3;
+	struct device_node *np, *p[6] = {};
 	struct of_phandle_args args;
+	unsigned int prefs[6];
 	int i, rc;
 
 	np = of_find_node_by_path("/testcase-data/phandle-tests/consumer-b");
@@ -555,34 +559,24 @@ static void __init of_unittest_parse_phandle_with_args_map(void)
 		return;
 	}
 
-	p0 = of_find_node_by_path("/testcase-data/phandle-tests/provider0");
-	if (!p0) {
-		pr_err("missing testcase data\n");
-		return;
-	}
-
-	p1 = of_find_node_by_path("/testcase-data/phandle-tests/provider1");
-	if (!p1) {
-		pr_err("missing testcase data\n");
-		return;
-	}
-
-	p2 = of_find_node_by_path("/testcase-data/phandle-tests/provider2");
-	if (!p2) {
-		pr_err("missing testcase data\n");
-		return;
-	}
-
-	p3 = of_find_node_by_path("/testcase-data/phandle-tests/provider3");
-	if (!p3) {
-		pr_err("missing testcase data\n");
-		return;
+	p[0] = of_find_node_by_path("/testcase-data/phandle-tests/provider0");
+	p[1] = of_find_node_by_path("/testcase-data/phandle-tests/provider1");
+	p[2] = of_find_node_by_path("/testcase-data/phandle-tests/provider2");
+	p[3] = of_find_node_by_path("/testcase-data/phandle-tests/provider3");
+	p[4] = of_find_node_by_path("/testcase-data/phandle-tests/provider4");
+	p[5] = of_find_node_by_path("/testcase-data/phandle-tests/provider5");
+	for (i = 0; i < ARRAY_SIZE(p); ++i) {
+		if (!p[i]) {
+			pr_err("missing testcase data\n");
+			return;
+		}
+		prefs[i] = kref_read(&p[i]->kobj.kref);
 	}
 
 	rc = of_count_phandle_with_args(np, "phandle-list", "#phandle-cells");
-	unittest(rc == 7, "of_count_phandle_with_args() returned %i, expected 7\n", rc);
+	unittest(rc == 8, "of_count_phandle_with_args() returned %i, expected 7\n", rc);
 
-	for (i = 0; i < 8; i++) {
+	for (i = 0; i < 9; i++) {
 		bool passed = true;
 
 		memset(&args, 0, sizeof(args));
@@ -593,13 +587,13 @@ static void __init of_unittest_parse_phandle_with_args_map(void)
 		switch (i) {
 		case 0:
 			passed &= !rc;
-			passed &= (args.np == p1);
+			passed &= (args.np == p[1]);
 			passed &= (args.args_count == 1);
 			passed &= (args.args[0] == 1);
 			break;
 		case 1:
 			passed &= !rc;
-			passed &= (args.np == p3);
+			passed &= (args.np == p[3]);
 			passed &= (args.args_count == 3);
 			passed &= (args.args[0] == 2);
 			passed &= (args.args[1] == 5);
@@ -610,28 +604,36 @@ static void __init of_unittest_parse_phandle_with_args_map(void)
 			break;
 		case 3:
 			passed &= !rc;
-			passed &= (args.np == p0);
+			passed &= (args.np == p[0]);
 			passed &= (args.args_count == 0);
 			break;
 		case 4:
 			passed &= !rc;
-			passed &= (args.np == p1);
+			passed &= (args.np == p[1]);
 			passed &= (args.args_count == 1);
 			passed &= (args.args[0] == 3);
 			break;
 		case 5:
 			passed &= !rc;
-			passed &= (args.np == p0);
+			passed &= (args.np == p[0]);
 			passed &= (args.args_count == 0);
 			break;
 		case 6:
 			passed &= !rc;
-			passed &= (args.np == p2);
+			passed &= (args.np == p[2]);
 			passed &= (args.args_count == 2);
 			passed &= (args.args[0] == 15);
 			passed &= (args.args[1] == 0x20);
 			break;
 		case 7:
+			passed &= !rc;
+			passed &= (args.np == p[3]);
+			passed &= (args.args_count == 3);
+			passed &= (args.args[0] == 2);
+			passed &= (args.args[1] == 5);
+			passed &= (args.args[2] == 3);
+			break;
+		case 8:
 			passed &= (rc == -ENOENT);
 			break;
 		default:
@@ -640,6 +642,9 @@ static void __init of_unittest_parse_phandle_with_args_map(void)
 
 		unittest(passed, "index %i - data error on node %s rc=%i\n",
 			 i, args.np->full_name, rc);
+
+		if (rc == 0)
+			of_node_put(args.np);
 	}
 
 	/* Check for missing list property */
@@ -686,6 +691,13 @@ static void __init of_unittest_parse_phandle_with_args_map(void)
 		   "OF: /testcase-data/phandle-tests/consumer-b: #phandle-cells = 2 found 1");
 
 	unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
+
+	for (i = 0; i < ARRAY_SIZE(p); ++i) {
+		unittest(prefs[i] == kref_read(&p[i]->kobj.kref),
+			 "provider%d: expected:%d got:%d\n",
+			 i, prefs[i], kref_read(&p[i]->kobj.kref));
+		of_node_put(p[i]);
+	}
 }
 
 static void __init of_unittest_property_string(void)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 339/583] fbdev: imxfb: fix left margin setting
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (337 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 338/583] of: Fix double free in of_parse_phandle_with_args_map Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 340/583] of: unittest: Fix of_count_phandle_with_args() expected value message Greg Kroah-Hartman
                   ` (250 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Dario Binacchi, Helge Deller, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dario Binacchi <dario.binacchi@amarulasolutions.com>

[ Upstream commit 5758844105f7dd9a0a04990cd92499a1a593dd36 ]

The previous setting did not take into account the CSTN mode.
For the H_WAIT_2 bitfield (bits 0-7) of the LCDC Horizontal Configuration
Register (LCDCR), the IMX25RM manual states that:

In TFT mode, it specifies the number of SCLK periods between the end of
HSYNC and the beginning of OE signal, and the total delay time equals
(H_WAIT_2 + 3) of SCLK periods.
In CSTN mode, it specifies the number of SCLK periods between the end of
HSYNC and the first display data in each line, and the total delay time
equals (H_WAIT_2 + 2) of SCLK periods.

The patch handles both cases.

Fixes: 4e47382fbca9 ("fbdev: imxfb: warn about invalid left/right margin")
Fixes: 7e8549bcee00 ("imxfb: Fix margin settings")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/video/fbdev/imxfb.c | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index 84201c9608d3..7042a43b81d8 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -42,6 +42,7 @@
 #include <video/videomode.h>
 
 #define PCR_TFT		(1 << 31)
+#define PCR_COLOR	(1 << 30)
 #define PCR_BPIX_8	(3 << 25)
 #define PCR_BPIX_12	(4 << 25)
 #define PCR_BPIX_16	(5 << 25)
@@ -150,6 +151,12 @@ enum imxfb_type {
 	IMX21_FB,
 };
 
+enum imxfb_panel_type {
+	PANEL_TYPE_MONOCHROME,
+	PANEL_TYPE_CSTN,
+	PANEL_TYPE_TFT,
+};
+
 struct imxfb_info {
 	struct platform_device  *pdev;
 	void __iomem		*regs;
@@ -157,6 +164,7 @@ struct imxfb_info {
 	struct clk		*clk_ahb;
 	struct clk		*clk_per;
 	enum imxfb_type		devtype;
+	enum imxfb_panel_type	panel_type;
 	bool			enabled;
 
 	/*
@@ -444,6 +452,13 @@ static int imxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 	if (!is_imx1_fb(fbi) && imxfb_mode->aus_mode)
 		fbi->lauscr = LAUSCR_AUS_MODE;
 
+	if (imxfb_mode->pcr & PCR_TFT)
+		fbi->panel_type = PANEL_TYPE_TFT;
+	else if (imxfb_mode->pcr & PCR_COLOR)
+		fbi->panel_type = PANEL_TYPE_CSTN;
+	else
+		fbi->panel_type = PANEL_TYPE_MONOCHROME;
+
 	/*
 	 * Copy the RGB parameters for this display
 	 * from the machine specific parameters.
@@ -596,6 +611,7 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
 {
 	struct imxfb_info *fbi = info->par;
 	u32 ymax_mask = is_imx1_fb(fbi) ? YMAX_MASK_IMX1 : YMAX_MASK_IMX21;
+	u8 left_margin_low;
 
 	pr_debug("var: xres=%d hslen=%d lm=%d rm=%d\n",
 		var->xres, var->hsync_len,
@@ -604,6 +620,13 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
 		var->yres, var->vsync_len,
 		var->upper_margin, var->lower_margin);
 
+	if (fbi->panel_type == PANEL_TYPE_TFT)
+		left_margin_low = 3;
+	else if (fbi->panel_type == PANEL_TYPE_CSTN)
+		left_margin_low = 2;
+	else
+		left_margin_low = 0;
+
 #if DEBUG_VAR
 	if (var->xres < 16        || var->xres > 1024)
 		printk(KERN_ERR "%s: invalid xres %d\n",
@@ -611,7 +634,7 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
 	if (var->hsync_len < 1    || var->hsync_len > 64)
 		printk(KERN_ERR "%s: invalid hsync_len %d\n",
 			info->fix.id, var->hsync_len);
-	if (var->left_margin < 3  || var->left_margin > 255)
+	if (var->left_margin < left_margin_low  || var->left_margin > 255)
 		printk(KERN_ERR "%s: invalid left_margin %d\n",
 			info->fix.id, var->left_margin);
 	if (var->right_margin < 1 || var->right_margin > 255)
@@ -637,7 +660,7 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
 
 	writel(HCR_H_WIDTH(var->hsync_len - 1) |
 		HCR_H_WAIT_1(var->right_margin - 1) |
-		HCR_H_WAIT_2(var->left_margin - 3),
+		HCR_H_WAIT_2(var->left_margin - left_margin_low),
 		fbi->regs + LCDC_HCR);
 
 	writel(VCR_V_WIDTH(var->vsync_len) |
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 340/583] of: unittest: Fix of_count_phandle_with_args() expected value message
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (338 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 339/583] fbdev: imxfb: fix left margin setting Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 341/583] class: fix use-after-free in class_register() Greg Kroah-Hartman
                   ` (249 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Geert Uytterhoeven, Rob Herring,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Geert Uytterhoeven <geert+renesas@glider.be>

[ Upstream commit 716089b417cf98d01f0dc1b39f9c47e1d7b4c965 ]

The expected result value for the call to of_count_phandle_with_args()
was updated from 7 to 8, but the accompanying error message was
forgotten.

Fixes: 4dde83569832f937 ("of: Fix double free in of_parse_phandle_with_args_map")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240111085025.2073894-1-geert+renesas@glider.be
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/of/unittest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index c63f5963751b..f278def7ef03 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -574,7 +574,7 @@ static void __init of_unittest_parse_phandle_with_args_map(void)
 	}
 
 	rc = of_count_phandle_with_args(np, "phandle-list", "#phandle-cells");
-	unittest(rc == 8, "of_count_phandle_with_args() returned %i, expected 7\n", rc);
+	unittest(rc == 8, "of_count_phandle_with_args() returned %i, expected 8\n", rc);
 
 	for (i = 0; i < 9; i++) {
 		bool passed = true;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 341/583] class: fix use-after-free in class_register()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (339 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 340/583] of: unittest: Fix of_count_phandle_with_args() expected value message Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 342/583] kernfs: convert kernfs_idr_lock to an irq safe raw spinlock Greg Kroah-Hartman
                   ` (248 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Jing Xia, Xuewen Yan

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jing Xia <jing.xia@unisoc.com>

commit 93ec4a3b76404bce01bd5c9032bef5df6feb1d62 upstream.

The lock_class_key is still registered and can be found in
lock_keys_hash hlist after subsys_private is freed in error
handler path.A task who iterate over the lock_keys_hash
later may cause use-after-free.So fix that up and unregister
the lock_class_key before kfree(cp).

On our platform, a driver fails to kset_register because of
creating duplicate filename '/class/xxx'.With Kasan enabled,
it prints a invalid-access bug report.

KASAN bug report:

BUG: KASAN: invalid-access in lockdep_register_key+0x19c/0x1bc
Write of size 8 at addr 15ffff808b8c0368 by task modprobe/252
Pointer tag: [15], memory tag: [fe]

CPU: 7 PID: 252 Comm: modprobe Tainted: G        W
 6.6.0-mainline-maybe-dirty #1

Call trace:
dump_backtrace+0x1b0/0x1e4
show_stack+0x2c/0x40
dump_stack_lvl+0xac/0xe0
print_report+0x18c/0x4d8
kasan_report+0xe8/0x148
__hwasan_store8_noabort+0x88/0x98
lockdep_register_key+0x19c/0x1bc
class_register+0x94/0x1ec
init_module+0xbc/0xf48 [rfkill]
do_one_initcall+0x17c/0x72c
do_init_module+0x19c/0x3f8
...
Memory state around the buggy address:
ffffff808b8c0100: 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a
ffffff808b8c0200: 8a 8a 8a 8a 8a 8a 8a 8a fe fe fe fe fe fe fe fe
>ffffff808b8c0300: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
                                     ^
ffffff808b8c0400: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03

As CONFIG_KASAN_GENERIC is not set, Kasan reports invalid-access
not use-after-free here.In this case, modprobe is manipulating
the corrupted lock_keys_hash hlish where lock_class_key is already
freed before.

It's worth noting that this only can happen if lockdep is enabled,
which is not true for normal system.

Fixes: dcfbb67e48a2 ("driver core: class: use lock_class_key already present in struct subsys_private")
Cc: stable <stable@kernel.org>
Signed-off-by: Jing Xia <jing.xia@unisoc.com>
Signed-off-by: Xuewen Yan <xuewen.yan@unisoc.com>
Link: https://lore.kernel.org/r/20231220024603.186078-1-jing.xia@unisoc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/base/class.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -215,6 +215,7 @@ int class_register(const struct class *c
 	return 0;
 
 err_out:
+	lockdep_unregister_key(key);
 	kfree(cp);
 	return error;
 }



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 342/583] kernfs: convert kernfs_idr_lock to an irq safe raw spinlock
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (340 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 341/583] class: fix use-after-free in class_register() Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 343/583] Revert "kernfs: convert kernfs_idr_lock to an irq safe raw spinlock" Greg Kroah-Hartman
                   ` (247 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Andrea Righi, Tejun Heo

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Andrea Righi <andrea.righi@canonical.com>

commit c312828c37a72fe2d033a961c47c227b0767e9f8 upstream.

bpf_cgroup_from_id() is basically a wrapper to cgroup_get_from_id(),
that is relying on kernfs to determine the right cgroup associated to
the target id.

As a kfunc, it has the potential to be attached to any function through
BPF, particularly in contexts where certain locks are held.

However, kernfs is not using an irq safe spinlock for kernfs_idr_lock,
that means any kernfs function that is acquiring this lock can be
interrupted and potentially hit bpf_cgroup_from_id() in the process,
triggering a deadlock.

For example, it is really easy to trigger a lockdep splat between
kernfs_idr_lock and rq->_lock, attaching a small BPF program to
__set_cpus_allowed_ptr_locked() that just calls bpf_cgroup_from_id():

 =====================================================
 WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
 6.7.0-rc7-virtme #5 Not tainted
 -----------------------------------------------------
 repro/131 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
 ffffffffb2dc4578 (kernfs_idr_lock){+.+.}-{2:2}, at: kernfs_find_and_get_node_by_id+0x1d/0x80

 and this task is already holding:
 ffff911cbecaf218 (&rq->__lock){-.-.}-{2:2}, at: task_rq_lock+0x50/0xc0
 which would create a new lock dependency:
  (&rq->__lock){-.-.}-{2:2} -> (kernfs_idr_lock){+.+.}-{2:2}

 but this new dependency connects a HARDIRQ-irq-safe lock:
  (&rq->__lock){-.-.}-{2:2}

 ... which became HARDIRQ-irq-safe at:
   lock_acquire+0xbf/0x2b0
   _raw_spin_lock_nested+0x2e/0x40
   scheduler_tick+0x5d/0x170
   update_process_times+0x9c/0xb0
   tick_periodic+0x27/0xe0
   tick_handle_periodic+0x24/0x70
   __sysvec_apic_timer_interrupt+0x64/0x1a0
   sysvec_apic_timer_interrupt+0x6f/0x80
   asm_sysvec_apic_timer_interrupt+0x1a/0x20
   memcpy+0xc/0x20
   arch_dup_task_struct+0x15/0x30
   copy_process+0x1ce/0x1eb0
   kernel_clone+0xac/0x390
   kernel_thread+0x6f/0xa0
   kthreadd+0x199/0x230
   ret_from_fork+0x31/0x50
   ret_from_fork_asm+0x1b/0x30

 to a HARDIRQ-irq-unsafe lock:
  (kernfs_idr_lock){+.+.}-{2:2}

 ... which became HARDIRQ-irq-unsafe at:
 ...
   lock_acquire+0xbf/0x2b0
   _raw_spin_lock+0x30/0x40
   __kernfs_new_node.isra.0+0x83/0x280
   kernfs_create_root+0xf6/0x1d0
   sysfs_init+0x1b/0x70
   mnt_init+0xd9/0x2a0
   vfs_caches_init+0xcf/0xe0
   start_kernel+0x58a/0x6a0
   x86_64_start_reservations+0x18/0x30
   x86_64_start_kernel+0xc5/0xe0
   secondary_startup_64_no_verify+0x178/0x17b

 other info that might help us debug this:

  Possible interrupt unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(kernfs_idr_lock);
                                local_irq_disable();
                                lock(&rq->__lock);
                                lock(kernfs_idr_lock);
   <Interrupt>
     lock(&rq->__lock);

  *** DEADLOCK ***

Prevent this deadlock condition converting kernfs_idr_lock to a raw irq
safe spinlock.

The performance impact of this change should be negligible and it also
helps to prevent similar deadlock conditions with any other subsystems
that may depend on kernfs.

Fixes: 332ea1f697be ("bpf: Add bpf_cgroup_from_id() kfunc")
Cc: stable <stable@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20231229074916.53547-1-andrea.righi@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/kernfs/dir.c |   23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -27,7 +27,7 @@ static DEFINE_RWLOCK(kernfs_rename_lock)
  */
 static DEFINE_SPINLOCK(kernfs_pr_cont_lock);
 static char kernfs_pr_cont_buf[PATH_MAX];	/* protected by pr_cont_lock */
-static DEFINE_SPINLOCK(kernfs_idr_lock);	/* root->ino_idr */
+static DEFINE_RAW_SPINLOCK(kernfs_idr_lock);	/* root->ino_idr */
 
 #define rb_to_kn(X) rb_entry((X), struct kernfs_node, rb)
 
@@ -539,6 +539,7 @@ void kernfs_put(struct kernfs_node *kn)
 {
 	struct kernfs_node *parent;
 	struct kernfs_root *root;
+	unsigned long flags;
 
 	if (!kn || !atomic_dec_and_test(&kn->count))
 		return;
@@ -563,9 +564,9 @@ void kernfs_put(struct kernfs_node *kn)
 		simple_xattrs_free(&kn->iattr->xattrs, NULL);
 		kmem_cache_free(kernfs_iattrs_cache, kn->iattr);
 	}
-	spin_lock(&kernfs_idr_lock);
+	raw_spin_lock_irqsave(&kernfs_idr_lock, flags);
 	idr_remove(&root->ino_idr, (u32)kernfs_ino(kn));
-	spin_unlock(&kernfs_idr_lock);
+	raw_spin_unlock_irqrestore(&kernfs_idr_lock, flags);
 	kmem_cache_free(kernfs_node_cache, kn);
 
 	kn = parent;
@@ -607,6 +608,7 @@ static struct kernfs_node *__kernfs_new_
 	struct kernfs_node *kn;
 	u32 id_highbits;
 	int ret;
+	unsigned long irqflags;
 
 	name = kstrdup_const(name, GFP_KERNEL);
 	if (!name)
@@ -617,13 +619,13 @@ static struct kernfs_node *__kernfs_new_
 		goto err_out1;
 
 	idr_preload(GFP_KERNEL);
-	spin_lock(&kernfs_idr_lock);
+	raw_spin_lock_irqsave(&kernfs_idr_lock, irqflags);
 	ret = idr_alloc_cyclic(&root->ino_idr, kn, 1, 0, GFP_ATOMIC);
 	if (ret >= 0 && ret < root->last_id_lowbits)
 		root->id_highbits++;
 	id_highbits = root->id_highbits;
 	root->last_id_lowbits = ret;
-	spin_unlock(&kernfs_idr_lock);
+	raw_spin_unlock_irqrestore(&kernfs_idr_lock, irqflags);
 	idr_preload_end();
 	if (ret < 0)
 		goto err_out2;
@@ -659,9 +661,9 @@ static struct kernfs_node *__kernfs_new_
 	return kn;
 
  err_out3:
-	spin_lock(&kernfs_idr_lock);
+	raw_spin_lock_irqsave(&kernfs_idr_lock, irqflags);
 	idr_remove(&root->ino_idr, (u32)kernfs_ino(kn));
-	spin_unlock(&kernfs_idr_lock);
+	raw_spin_unlock_irqrestore(&kernfs_idr_lock, irqflags);
  err_out2:
 	kmem_cache_free(kernfs_node_cache, kn);
  err_out1:
@@ -702,8 +704,9 @@ struct kernfs_node *kernfs_find_and_get_
 	struct kernfs_node *kn;
 	ino_t ino = kernfs_id_ino(id);
 	u32 gen = kernfs_id_gen(id);
+	unsigned long flags;
 
-	spin_lock(&kernfs_idr_lock);
+	raw_spin_lock_irqsave(&kernfs_idr_lock, flags);
 
 	kn = idr_find(&root->ino_idr, (u32)ino);
 	if (!kn)
@@ -727,10 +730,10 @@ struct kernfs_node *kernfs_find_and_get_
 	if (unlikely(!__kernfs_active(kn) || !atomic_inc_not_zero(&kn->count)))
 		goto err_unlock;
 
-	spin_unlock(&kernfs_idr_lock);
+	raw_spin_unlock_irqrestore(&kernfs_idr_lock, flags);
 	return kn;
 err_unlock:
-	spin_unlock(&kernfs_idr_lock);
+	raw_spin_unlock_irqrestore(&kernfs_idr_lock, flags);
 	return NULL;
 }
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 343/583] Revert "kernfs: convert kernfs_idr_lock to an irq safe raw spinlock"
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (341 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 342/583] kernfs: convert kernfs_idr_lock to an irq safe raw spinlock Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 344/583] selftests/bpf: Add assert for user stacks in test_task_stack Greg Kroah-Hartman
                   ` (246 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Tejun Heo, Andrea Righi, Geert Uytterhoeven

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tejun Heo <tj@kernel.org>

commit e3977e0609a07d86406029fceea0fd40d7849368 upstream.

This reverts commit dad3fb67ca1cbef87ce700e83a55835e5921ce8a.

The commit converted kernfs_idr_lock to an IRQ-safe raw_spinlock because it
could be acquired while holding an rq lock through bpf_cgroup_from_id().
However, kernfs_idr_lock is held while doing GPF_NOWAIT allocations which
involves acquiring an non-IRQ-safe and non-raw lock leading to the following
lockdep warning:

  =============================
  [ BUG: Invalid wait context ]
  6.7.0-rc5-kzm9g-00251-g655022a45b1c #578 Not tainted
  -----------------------------
  swapper/0/0 is trying to lock:
  dfbcd488 (&c->lock){....}-{3:3}, at: local_lock_acquire+0x0/0xa4
  other info that might help us debug this:
  context-{5:5}
  2 locks held by swapper/0/0:
   #0: dfbc9c60 (lock){+.+.}-{3:3}, at: local_lock_acquire+0x0/0xa4
   #1: c0c012a8 (kernfs_idr_lock){....}-{2:2}, at: __kernfs_new_node.constprop.0+0x68/0x258
  stack backtrace:
  CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.7.0-rc5-kzm9g-00251-g655022a45b1c #578
  Hardware name: Generic SH73A0 (Flattened Device Tree)
   unwind_backtrace from show_stack+0x10/0x14
   show_stack from dump_stack_lvl+0x68/0x90
   dump_stack_lvl from __lock_acquire+0x3cc/0x168c
   __lock_acquire from lock_acquire+0x274/0x30c
   lock_acquire from local_lock_acquire+0x28/0xa4
   local_lock_acquire from ___slab_alloc+0x234/0x8a8
   ___slab_alloc from __slab_alloc.constprop.0+0x30/0x44
   __slab_alloc.constprop.0 from kmem_cache_alloc+0x7c/0x148
   kmem_cache_alloc from radix_tree_node_alloc.constprop.0+0x44/0xdc
   radix_tree_node_alloc.constprop.0 from idr_get_free+0x110/0x2b8
   idr_get_free from idr_alloc_u32+0x9c/0x108
   idr_alloc_u32 from idr_alloc_cyclic+0x50/0xb8
   idr_alloc_cyclic from __kernfs_new_node.constprop.0+0x88/0x258
   __kernfs_new_node.constprop.0 from kernfs_create_root+0xbc/0x154
   kernfs_create_root from sysfs_init+0x18/0x5c
   sysfs_init from mnt_init+0xc4/0x220
   mnt_init from vfs_caches_init+0x6c/0x88
   vfs_caches_init from start_kernel+0x474/0x528
   start_kernel from 0x0

Let's rever the commit. It's undesirable to spread out raw spinlock usage
anyway and the problem can be solved by protecting the lookup path with RCU
instead.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Andrea Righi <andrea.righi@canonical.com>
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: http://lkml.kernel.org/r/CAMuHMdV=AKt+mwY7svEq5gFPx41LoSQZ_USME5_MEdWQze13ww@mail.gmail.com
Link: https://lore.kernel.org/r/20240109214828.252092-2-tj@kernel.org
Tested-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/kernfs/dir.c |   23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -27,7 +27,7 @@ static DEFINE_RWLOCK(kernfs_rename_lock)
  */
 static DEFINE_SPINLOCK(kernfs_pr_cont_lock);
 static char kernfs_pr_cont_buf[PATH_MAX];	/* protected by pr_cont_lock */
-static DEFINE_RAW_SPINLOCK(kernfs_idr_lock);	/* root->ino_idr */
+static DEFINE_SPINLOCK(kernfs_idr_lock);	/* root->ino_idr */
 
 #define rb_to_kn(X) rb_entry((X), struct kernfs_node, rb)
 
@@ -539,7 +539,6 @@ void kernfs_put(struct kernfs_node *kn)
 {
 	struct kernfs_node *parent;
 	struct kernfs_root *root;
-	unsigned long flags;
 
 	if (!kn || !atomic_dec_and_test(&kn->count))
 		return;
@@ -564,9 +563,9 @@ void kernfs_put(struct kernfs_node *kn)
 		simple_xattrs_free(&kn->iattr->xattrs, NULL);
 		kmem_cache_free(kernfs_iattrs_cache, kn->iattr);
 	}
-	raw_spin_lock_irqsave(&kernfs_idr_lock, flags);
+	spin_lock(&kernfs_idr_lock);
 	idr_remove(&root->ino_idr, (u32)kernfs_ino(kn));
-	raw_spin_unlock_irqrestore(&kernfs_idr_lock, flags);
+	spin_unlock(&kernfs_idr_lock);
 	kmem_cache_free(kernfs_node_cache, kn);
 
 	kn = parent;
@@ -608,7 +607,6 @@ static struct kernfs_node *__kernfs_new_
 	struct kernfs_node *kn;
 	u32 id_highbits;
 	int ret;
-	unsigned long irqflags;
 
 	name = kstrdup_const(name, GFP_KERNEL);
 	if (!name)
@@ -619,13 +617,13 @@ static struct kernfs_node *__kernfs_new_
 		goto err_out1;
 
 	idr_preload(GFP_KERNEL);
-	raw_spin_lock_irqsave(&kernfs_idr_lock, irqflags);
+	spin_lock(&kernfs_idr_lock);
 	ret = idr_alloc_cyclic(&root->ino_idr, kn, 1, 0, GFP_ATOMIC);
 	if (ret >= 0 && ret < root->last_id_lowbits)
 		root->id_highbits++;
 	id_highbits = root->id_highbits;
 	root->last_id_lowbits = ret;
-	raw_spin_unlock_irqrestore(&kernfs_idr_lock, irqflags);
+	spin_unlock(&kernfs_idr_lock);
 	idr_preload_end();
 	if (ret < 0)
 		goto err_out2;
@@ -661,9 +659,9 @@ static struct kernfs_node *__kernfs_new_
 	return kn;
 
  err_out3:
-	raw_spin_lock_irqsave(&kernfs_idr_lock, irqflags);
+	spin_lock(&kernfs_idr_lock);
 	idr_remove(&root->ino_idr, (u32)kernfs_ino(kn));
-	raw_spin_unlock_irqrestore(&kernfs_idr_lock, irqflags);
+	spin_unlock(&kernfs_idr_lock);
  err_out2:
 	kmem_cache_free(kernfs_node_cache, kn);
  err_out1:
@@ -704,9 +702,8 @@ struct kernfs_node *kernfs_find_and_get_
 	struct kernfs_node *kn;
 	ino_t ino = kernfs_id_ino(id);
 	u32 gen = kernfs_id_gen(id);
-	unsigned long flags;
 
-	raw_spin_lock_irqsave(&kernfs_idr_lock, flags);
+	spin_lock(&kernfs_idr_lock);
 
 	kn = idr_find(&root->ino_idr, (u32)ino);
 	if (!kn)
@@ -730,10 +727,10 @@ struct kernfs_node *kernfs_find_and_get_
 	if (unlikely(!__kernfs_active(kn) || !atomic_inc_not_zero(&kn->count)))
 		goto err_unlock;
 
-	raw_spin_unlock_irqrestore(&kernfs_idr_lock, flags);
+	spin_unlock(&kernfs_idr_lock);
 	return kn;
 err_unlock:
-	raw_spin_unlock_irqrestore(&kernfs_idr_lock, flags);
+	spin_unlock(&kernfs_idr_lock);
 	return NULL;
 }
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 344/583] selftests/bpf: Add assert for user stacks in test_task_stack
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (342 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 343/583] Revert "kernfs: convert kernfs_idr_lock to an irq safe raw spinlock" Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 345/583] keys, dns: Fix size check of V1 server-list header Greg Kroah-Hartman
                   ` (245 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jordan Rome, Andrii Nakryiko,
	Stanislav Fomichev

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jordan Rome <linux@jordanrome.com>

commit 727a92d62fd6a382b4c5972008e45667e707b0e4 upstream.

This is a follow up to:
commit b8e3a87a627b ("bpf: Add crosstask check to __bpf_get_stack").

This test ensures that the task iterator only gets a single
user stack (for the current task).

Signed-off-by: Jordan Rome <linux@jordanrome.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/bpf/20231112023010.144675-1-linux@jordanrome.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 tools/testing/selftests/bpf/prog_tests/bpf_iter.c       |    2 ++
 tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c |    5 +++++
 2 files changed, 7 insertions(+)

--- a/tools/testing/selftests/bpf/prog_tests/bpf_iter.c
+++ b/tools/testing/selftests/bpf/prog_tests/bpf_iter.c
@@ -334,6 +334,8 @@ static void test_task_stack(void)
 	do_dummy_read(skel->progs.dump_task_stack);
 	do_dummy_read(skel->progs.get_task_user_stacks);
 
+	ASSERT_EQ(skel->bss->num_user_stacks, 1, "num_user_stacks");
+
 	bpf_iter_task_stack__destroy(skel);
 }
 
--- a/tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c
+++ b/tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c
@@ -35,6 +35,8 @@ int dump_task_stack(struct bpf_iter__tas
 	return 0;
 }
 
+int num_user_stacks = 0;
+
 SEC("iter/task")
 int get_task_user_stacks(struct bpf_iter__task *ctx)
 {
@@ -51,6 +53,9 @@ int get_task_user_stacks(struct bpf_iter
 	if (res <= 0)
 		return 0;
 
+	/* Only one task, the current one, should succeed */
+	++num_user_stacks;
+
 	buf_sz += res;
 
 	/* If the verifier doesn't refine bpf_get_task_stack res, and instead



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 345/583] keys, dns: Fix size check of V1 server-list header
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (343 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 344/583] selftests/bpf: Add assert for user stacks in test_task_stack Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 346/583] binder: fix async space check for 0-sized buffers Greg Kroah-Hartman
                   ` (244 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Pengfei Xu, David Howells,
	Linus Torvalds, Petr Vorel

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: David Howells <dhowells@redhat.com>

commit acc657692aed438e9931438f8c923b2b107aebf9 upstream.

Fix the size check added to dns_resolver_preparse() for the V1 server-list
header so that it doesn't give EINVAL if the size supplied is the same as
the size of the header struct (which should be valid).

This can be tested with:

        echo -n -e '\0\0\01\xff\0\0' | keyctl padd dns_resolver desc @p

which will give "add_key: Invalid argument" without this fix.

Fixes: 1997b3cb4217 ("keys, dns: Fix missing size check of V1 server-list header")
Reported-by: Pengfei Xu <pengfei.xu@intel.com>
Link: https://lore.kernel.org/r/ZZ4fyY4r3rqgZL+4@xpf.sh.intel.com/
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/dns_resolver/dns_key.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/dns_resolver/dns_key.c
+++ b/net/dns_resolver/dns_key.c
@@ -104,7 +104,7 @@ dns_resolver_preparse(struct key_prepars
 		const struct dns_server_list_v1_header *v1;
 
 		/* It may be a server list. */
-		if (datalen <= sizeof(*v1))
+		if (datalen < sizeof(*v1))
 			return -EINVAL;
 
 		v1 = (const struct dns_server_list_v1_header *)data;



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 346/583] binder: fix async space check for 0-sized buffers
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (344 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 345/583] keys, dns: Fix size check of V1 server-list header Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 347/583] binder: fix unused alloc->free_async_space Greg Kroah-Hartman
                   ` (243 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alice Ryhl, Carlos Llamas

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Carlos Llamas <cmllamas@google.com>

commit 3091c21d3e9322428691ce0b7a0cfa9c0b239eeb upstream.

Move the padding of 0-sized buffers to an earlier stage to account for
this round up during the alloc->free_async_space check.

Fixes: 74310e06be4d ("android: binder: Move buffer out of area shared with user space")
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20231201172212.1813387-5-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/android/binder_alloc.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
@@ -407,6 +407,10 @@ static struct binder_buffer *binder_allo
 				alloc->pid, extra_buffers_size);
 		return ERR_PTR(-EINVAL);
 	}
+
+	/* Pad 0-size buffers so they get assigned unique addresses */
+	size = max(size, sizeof(void *));
+
 	if (is_async &&
 	    alloc->free_async_space < size + sizeof(struct binder_buffer)) {
 		binder_alloc_debug(BINDER_DEBUG_BUFFER_ALLOC,
@@ -415,9 +419,6 @@ static struct binder_buffer *binder_allo
 		return ERR_PTR(-ENOSPC);
 	}
 
-	/* Pad 0-size buffers so they get assigned unique addresses */
-	size = max(size, sizeof(void *));
-
 	while (n) {
 		buffer = rb_entry(n, struct binder_buffer, rb_node);
 		BUG_ON(!buffer->free);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 347/583] binder: fix unused alloc->free_async_space
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (345 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 346/583] binder: fix async space check for 0-sized buffers Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 348/583] mips/smp: Call rcutree_report_cpu_starting() earlier Greg Kroah-Hartman
                   ` (242 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Carlos Llamas, Alice Ryhl

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Carlos Llamas <cmllamas@google.com>

commit c6d05e0762ab276102246d24affd1e116a46aa0c upstream.

Each transaction is associated with a 'struct binder_buffer' that stores
the metadata about its buffer area. Since commit 74310e06be4d ("android:
binder: Move buffer out of area shared with user space") this struct is
no longer embedded within the buffer itself but is instead allocated on
the heap to prevent userspace access to this driver-exclusive info.

Unfortunately, the space of this struct is still being accounted for in
the total buffer size calculation, specifically for async transactions.
This results in an additional 104 bytes added to every async buffer
request, and this area is never used.

This wasted space can be substantial. If we consider the maximum mmap
buffer space of SZ_4M, the driver will reserve half of it for async
transactions, or 0x200000. This area should, in theory, accommodate up
to 262,144 buffers of the minimum 8-byte size. However, after adding
the extra 'sizeof(struct binder_buffer)', the total number of buffers
drops to only 18,724, which is a sad 7.14% of the actual capacity.

This patch fixes the buffer size calculation to enable the utilization
of the entire async buffer space. This is expected to reduce the number
of -ENOSPC errors that are seen on the field.

Fixes: 74310e06be4d ("android: binder: Move buffer out of area shared with user space")
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20231201172212.1813387-6-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/android/binder_alloc.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
@@ -344,8 +344,7 @@ static bool debug_low_async_space_locked
 			continue;
 		if (!buffer->async_transaction)
 			continue;
-		total_alloc_size += binder_alloc_buffer_size(alloc, buffer)
-			+ sizeof(struct binder_buffer);
+		total_alloc_size += binder_alloc_buffer_size(alloc, buffer);
 		num_buffers++;
 	}
 
@@ -411,8 +410,7 @@ static struct binder_buffer *binder_allo
 	/* Pad 0-size buffers so they get assigned unique addresses */
 	size = max(size, sizeof(void *));
 
-	if (is_async &&
-	    alloc->free_async_space < size + sizeof(struct binder_buffer)) {
+	if (is_async && alloc->free_async_space < size) {
 		binder_alloc_debug(BINDER_DEBUG_BUFFER_ALLOC,
 			     "%d: binder_alloc_buf size %zd failed, no async space left\n",
 			      alloc->pid, size);
@@ -520,7 +518,7 @@ static struct binder_buffer *binder_allo
 	buffer->pid = pid;
 	buffer->oneway_spam_suspect = false;
 	if (is_async) {
-		alloc->free_async_space -= size + sizeof(struct binder_buffer);
+		alloc->free_async_space -= size;
 		binder_alloc_debug(BINDER_DEBUG_BUFFER_ALLOC_ASYNC,
 			     "%d: binder_alloc_buf size %zd async free %zd\n",
 			      alloc->pid, size, alloc->free_async_space);
@@ -658,8 +656,7 @@ static void binder_free_buf_locked(struc
 	BUG_ON(buffer->user_data > alloc->buffer + alloc->buffer_size);
 
 	if (buffer->async_transaction) {
-		alloc->free_async_space += buffer_size + sizeof(struct binder_buffer);
-
+		alloc->free_async_space += buffer_size;
 		binder_alloc_debug(BINDER_DEBUG_BUFFER_ALLOC_ASYNC,
 			     "%d: binder_free_buf size %zd async free %zd\n",
 			      alloc->pid, size, alloc->free_async_space);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 348/583] mips/smp: Call rcutree_report_cpu_starting() earlier
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (346 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 347/583] binder: fix unused alloc->free_async_space Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 349/583] Input: atkbd - use ab83 as id when skipping the getid command Greg Kroah-Hartman
                   ` (241 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Stefan Wiehler, Huacai Chen,
	Thomas Bogendoerfer

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Stefan Wiehler <stefan.wiehler@nokia.com>

commit 55702ec9603ebeffb15e6f7b113623fe1d8872f4 upstream.

rcutree_report_cpu_starting() must be called before
clockevents_register_device() to avoid the following lockdep splat triggered by
calling list_add() when CONFIG_PROVE_RCU_LIST=y:

  WARNING: suspicious RCU usage
  ...
  -----------------------------
  kernel/locking/lockdep.c:3680 RCU-list traversed in non-reader section!!

  other info that might help us debug this:

  RCU used illegally from offline CPU!
  rcu_scheduler_active = 1, debug_locks = 1
  no locks held by swapper/1/0.
  ...
  Call Trace:
  [<ffffffff8012a434>] show_stack+0x64/0x158
  [<ffffffff80a93d98>] dump_stack_lvl+0x90/0xc4
  [<ffffffff801c9e9c>] __lock_acquire+0x1404/0x2940
  [<ffffffff801cbf3c>] lock_acquire+0x14c/0x448
  [<ffffffff80aa4260>] _raw_spin_lock_irqsave+0x50/0x88
  [<ffffffff8021e0c8>] clockevents_register_device+0x60/0x1e8
  [<ffffffff80130ff0>] r4k_clockevent_init+0x220/0x3a0
  [<ffffffff801339d0>] start_secondary+0x50/0x3b8

raw_smp_processor_id() is required in order to avoid calling into lockdep
before RCU has declared the CPU to be watched for readers.

See also commit 29368e093921 ("x86/smpboot:  Move rcu_cpu_starting() earlier"),
commit de5d9dae150c ("s390/smp: move rcu_cpu_starting() earlier") and commit
99f070b62322 ("powerpc/smp: Call rcu_cpu_starting() earlier").

Signed-off-by: Stefan Wiehler <stefan.wiehler@nokia.com>
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/mips/kernel/smp.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -351,10 +351,11 @@ early_initcall(mips_smp_ipi_init);
  */
 asmlinkage void start_secondary(void)
 {
-	unsigned int cpu;
+	unsigned int cpu = raw_smp_processor_id();
 
 	cpu_probe();
 	per_cpu_trap_init(false);
+	rcu_cpu_starting(cpu);
 	mips_clockevent_init();
 	mp_ops->init_secondary();
 	cpu_report();
@@ -366,7 +367,6 @@ asmlinkage void start_secondary(void)
 	 */
 
 	calibrate_delay();
-	cpu = smp_processor_id();
 	cpu_data[cpu].udelay_val = loops_per_jiffy;
 
 	set_cpu_sibling_map(cpu);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 349/583] Input: atkbd - use ab83 as id when skipping the getid command
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (347 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 348/583] mips/smp: Call rcutree_report_cpu_starting() earlier Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 350/583] rust: Ignore preserve-most functions Greg Kroah-Hartman
                   ` (240 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Barnabás Pőcze,
	Hans de Goede, Dmitry Torokhov

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hans de Goede <hdegoede@redhat.com>

commit 58f65f9db7e0de366a5a115c2e2c0703858bba69 upstream.

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: 936e4d49ecbc ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/input/keyboard/atkbd.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -791,9 +791,9 @@ static bool atkbd_is_portable_device(voi
  * not work. So in this case simply assume a keyboard is connected to avoid
  * confusing some laptop keyboards.
  *
- * Skipping ATKBD_CMD_GETID ends up using a fake keyboard id. Using a fake id is
- * ok in translated mode, only atkbd_select_set() checks atkbd->id and in
- * translated mode that is a no-op.
+ * Skipping ATKBD_CMD_GETID ends up using a fake keyboard id. Using the standard
+ * 0xab83 id is ok in translated mode, only atkbd_select_set() checks atkbd->id
+ * and in translated mode that is a no-op.
  */
 static bool atkbd_skip_getid(struct atkbd *atkbd)
 {
@@ -811,6 +811,7 @@ static int atkbd_probe(struct atkbd *atk
 {
 	struct ps2dev *ps2dev = &atkbd->ps2dev;
 	unsigned char param[2];
+	bool skip_getid;
 
 /*
  * Some systems, where the bit-twiddling when testing the io-lines of the
@@ -832,7 +833,8 @@ static int atkbd_probe(struct atkbd *atk
  */
 
 	param[0] = param[1] = 0xa5;	/* initialize with invalid values */
-	if (atkbd_skip_getid(atkbd) || ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
+	skip_getid = atkbd_skip_getid(atkbd);
+	if (skip_getid || ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
 
 /*
  * If the get ID command was skipped or failed, we check if we can at least set
@@ -842,7 +844,7 @@ static int atkbd_probe(struct atkbd *atk
 		param[0] = 0;
 		if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS))
 			return -1;
-		atkbd->id = 0xabba;
+		atkbd->id = skip_getid ? 0xab83 : 0xabba;
 		return 0;
 	}
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 350/583] rust: Ignore preserve-most functions
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (348 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 349/583] Input: atkbd - use ab83 as id when skipping the getid command Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 351/583] Revert "drm/amdkfd: Relocate TBA/TMA to opposite side of VM hole" Greg Kroah-Hartman
                   ` (239 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Matthew Maurer,
	Martin Rodriguez Reboredo, Alice Ryhl, Miguel Ojeda

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Matthew Maurer <mmaurer@google.com>

commit bad098d76835c1379e1cf6afc935f8a7e050f83c upstream.

Neither bindgen nor Rust know about the preserve-most calling
convention, and Clang describes it as unstable. Since we aren't using
functions with this calling convention from Rust, blocklist them.

These functions are only added to the build when list hardening is
enabled, which is likely why others didn't notice this yet.

Signed-off-by: Matthew Maurer <mmaurer@google.com>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20231031201945.1412345-1-mmaurer@google.com
[ Used Markdown for consistency with the other comments in the file. ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 rust/bindgen_parameters |    4 ++++
 1 file changed, 4 insertions(+)

--- a/rust/bindgen_parameters
+++ b/rust/bindgen_parameters
@@ -20,3 +20,7 @@
 
 # `seccomp`'s comment gets understood as a doctest
 --no-doc-comments
+
+# These functions use the `__preserve_most` calling convention, which neither bindgen
+# nor Rust currently understand, and which Clang currently declares to be unstable.
+--blocklist-function __list_.*_report



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 351/583] Revert "drm/amdkfd: Relocate TBA/TMA to opposite side of VM hole"
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (349 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 350/583] rust: Ignore preserve-most functions Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 352/583] xen-netback: dont produce zero-size SKB frags Greg Kroah-Hartman
                   ` (238 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Jay Cornwall, Kaibo Ma, Alex Deucher

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kaibo Ma <ent3rm4n@gmail.com>

commit 0f35b0a7b8fa402adbffa2565047cdcc4c480153 upstream.

That commit causes NULL pointer dereferences in dmesgs when
running applications using ROCm, including clinfo, blender,
and PyTorch, since v6.6.1. Revert it to fix blender again.

This reverts commit 96c211f1f9ef82183493f4ceed4e347b52849149.

Closes: https://github.com/ROCm/ROCm/issues/2596
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2991
Reviewed-by: Jay Cornwall <jay.cornwall@amd.com>
Signed-off-by: Kaibo Ma <ent3rm4n@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c |   26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

--- a/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c
@@ -330,12 +330,6 @@ static void kfd_init_apertures_vi(struct
 	pdd->gpuvm_limit =
 		pdd->dev->kfd->shared_resources.gpuvm_size - 1;
 
-	/* dGPUs: the reserved space for kernel
-	 * before SVM
-	 */
-	pdd->qpd.cwsr_base = SVM_CWSR_BASE;
-	pdd->qpd.ib_base = SVM_IB_BASE;
-
 	pdd->scratch_base = MAKE_SCRATCH_APP_BASE_VI();
 	pdd->scratch_limit = MAKE_SCRATCH_APP_LIMIT(pdd->scratch_base);
 }
@@ -345,18 +339,18 @@ static void kfd_init_apertures_v9(struct
 	pdd->lds_base = MAKE_LDS_APP_BASE_V9();
 	pdd->lds_limit = MAKE_LDS_APP_LIMIT(pdd->lds_base);
 
-	pdd->gpuvm_base = PAGE_SIZE;
+        /* Raven needs SVM to support graphic handle, etc. Leave the small
+         * reserved space before SVM on Raven as well, even though we don't
+         * have to.
+         * Set gpuvm_base and gpuvm_limit to CANONICAL addresses so that they
+         * are used in Thunk to reserve SVM.
+         */
+        pdd->gpuvm_base = SVM_USER_BASE;
 	pdd->gpuvm_limit =
 		pdd->dev->kfd->shared_resources.gpuvm_size - 1;
 
 	pdd->scratch_base = MAKE_SCRATCH_APP_BASE_V9();
 	pdd->scratch_limit = MAKE_SCRATCH_APP_LIMIT(pdd->scratch_base);
-
-	/*
-	 * Place TBA/TMA on opposite side of VM hole to prevent
-	 * stray faults from triggering SVM on these pages.
-	 */
-	pdd->qpd.cwsr_base = pdd->dev->kfd->shared_resources.gpuvm_size;
 }
 
 int kfd_init_apertures(struct kfd_process *process)
@@ -413,6 +407,12 @@ int kfd_init_apertures(struct kfd_proces
 					return -EINVAL;
 				}
 			}
+
+                        /* dGPUs: the reserved space for kernel
+                         * before SVM
+                         */
+                        pdd->qpd.cwsr_base = SVM_CWSR_BASE;
+                        pdd->qpd.ib_base = SVM_IB_BASE;
 		}
 
 		dev_dbg(kfd_device, "node id %u\n", id);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 352/583] xen-netback: dont produce zero-size SKB frags
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (350 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 351/583] Revert "drm/amdkfd: Relocate TBA/TMA to opposite side of VM hole" Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 353/583] binder: fix race between mmput() and do_exit() Greg Kroah-Hartman
                   ` (237 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jan Beulich, Juergen Gross, Paul Durrant

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jan Beulich <jbeulich@suse.com>

commit c7ec4f2d684e17d69bbdd7c4324db0ef5daac26a upstream.

While frontends may submit zero-size requests (wasting a precious slot),
core networking code as of at least 3ece782693c4b ("sock: skb_copy_ubufs
support for compound pages") can't deal with SKBs when they have all
zero-size fragments. Respond to empty requests right when populating
fragments; all further processing is fragment based and hence won't
encounter these empty requests anymore.

In a way this should have been that way from the beginning: When no data
is to be transferred for a particular request, there's not even a point
in validating the respective grant ref. That's no different from e.g.
passing NULL into memcpy() when at the same time the size is 0.

This is XSA-448 / CVE-2023-46838.

Cc: stable@vger.kernel.org
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/xen-netback/netback.c |   44 ++++++++++++++++++++++++++++++++------
 1 file changed, 38 insertions(+), 6 deletions(-)

--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -463,12 +463,25 @@ static void xenvif_get_requests(struct x
 	}
 
 	for (shinfo->nr_frags = 0; nr_slots > 0 && shinfo->nr_frags < MAX_SKB_FRAGS;
-	     shinfo->nr_frags++, gop++, nr_slots--) {
+	     nr_slots--) {
+		if (unlikely(!txp->size)) {
+			unsigned long flags;
+
+			spin_lock_irqsave(&queue->response_lock, flags);
+			make_tx_response(queue, txp, 0, XEN_NETIF_RSP_OKAY);
+			push_tx_responses(queue);
+			spin_unlock_irqrestore(&queue->response_lock, flags);
+			++txp;
+			continue;
+		}
+
 		index = pending_index(queue->pending_cons++);
 		pending_idx = queue->pending_ring[index];
 		xenvif_tx_create_map_op(queue, pending_idx, txp,
 				        txp == first ? extra_count : 0, gop);
 		frag_set_pending_idx(&frags[shinfo->nr_frags], pending_idx);
+		++shinfo->nr_frags;
+		++gop;
 
 		if (txp == first)
 			txp = txfrags;
@@ -481,20 +494,39 @@ static void xenvif_get_requests(struct x
 		shinfo = skb_shinfo(nskb);
 		frags = shinfo->frags;
 
-		for (shinfo->nr_frags = 0; shinfo->nr_frags < nr_slots;
-		     shinfo->nr_frags++, txp++, gop++) {
+		for (shinfo->nr_frags = 0; shinfo->nr_frags < nr_slots; ++txp) {
+			if (unlikely(!txp->size)) {
+				unsigned long flags;
+
+				spin_lock_irqsave(&queue->response_lock, flags);
+				make_tx_response(queue, txp, 0,
+						 XEN_NETIF_RSP_OKAY);
+				push_tx_responses(queue);
+				spin_unlock_irqrestore(&queue->response_lock,
+						       flags);
+				continue;
+			}
+
 			index = pending_index(queue->pending_cons++);
 			pending_idx = queue->pending_ring[index];
 			xenvif_tx_create_map_op(queue, pending_idx, txp, 0,
 						gop);
 			frag_set_pending_idx(&frags[shinfo->nr_frags],
 					     pending_idx);
+			++shinfo->nr_frags;
+			++gop;
 		}
 
-		skb_shinfo(skb)->frag_list = nskb;
-	} else if (nskb) {
+		if (shinfo->nr_frags) {
+			skb_shinfo(skb)->frag_list = nskb;
+			nskb = NULL;
+		}
+	}
+
+	if (nskb) {
 		/* A frag_list skb was allocated but it is no longer needed
-		 * because enough slots were converted to copy ops above.
+		 * because enough slots were converted to copy ops above or some
+		 * were empty.
 		 */
 		kfree_skb(nskb);
 	}



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 353/583] binder: fix race between mmput() and do_exit()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (351 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 352/583] xen-netback: dont produce zero-size SKB frags Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 354/583] clocksource/drivers/timer-ti-dm: Fix make W=n kerneldoc warnings Greg Kroah-Hartman
                   ` (236 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Alice Ryhl, Carlos Llamas

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Carlos Llamas <cmllamas@google.com>

commit 9a9ab0d963621d9d12199df9817e66982582d5a5 upstream.

Task A calls binder_update_page_range() to allocate and insert pages on
a remote address space from Task B. For this, Task A pins the remote mm
via mmget_not_zero() first. This can race with Task B do_exit() and the
final mmput() refcount decrement will come from Task A.

  Task A            | Task B
  ------------------+------------------
  mmget_not_zero()  |
                    |  do_exit()
                    |    exit_mm()
                    |      mmput()
  mmput()           |
    exit_mmap()     |
      remove_vma()  |
        fput()      |

In this case, the work of ____fput() from Task B is queued up in Task A
as TWA_RESUME. So in theory, Task A returns to userspace and the cleanup
work gets executed. However, Task A instead sleep, waiting for a reply
from Task B that never comes (it's dead).

This means the binder_deferred_release() is blocked until an unrelated
binder event forces Task A to go back to userspace. All the associated
death notifications will also be delayed until then.

In order to fix this use mmput_async() that will schedule the work in
the corresponding mm->async_put_work WQ instead of Task A.

Fixes: 457b9a6f09f0 ("Staging: android: add binder driver")
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20231201172212.1813387-4-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/android/binder_alloc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
@@ -271,7 +271,7 @@ static int binder_update_page_range(stru
 	}
 	if (mm) {
 		mmap_write_unlock(mm);
-		mmput(mm);
+		mmput_async(mm);
 	}
 	return 0;
 
@@ -304,7 +304,7 @@ err_page_ptr_cleared:
 err_no_vma:
 	if (mm) {
 		mmap_write_unlock(mm);
-		mmput(mm);
+		mmput_async(mm);
 	}
 	return vma ? -ENOMEM : -ESRCH;
 }



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 354/583] clocksource/drivers/timer-ti-dm: Fix make W=n kerneldoc warnings
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (352 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 353/583] binder: fix race between mmput() and do_exit() Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 355/583] powerpc/64s: Increase default stack size to 32KB Greg Kroah-Hartman
                   ` (235 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, kernel test robot, Tony Lindgren,
	Randy Dunlap, Daniel Lezcano

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tony Lindgren <tony@atomide.com>

commit b99a212a7697c542b460adaa15d4a98abf8223f0 upstream.

Kernel test robot reports of kerneldoc related warnings that happen with
make W=n for "parameter or member not described".

These were caused by changes to function parameter names with
earlier commits where the kerneldoc parts were not updated.

Fixes: 49cd16bb573e ("clocksource/drivers/timer-ti-dm: Simplify register writes with dmtimer_write()")
Fixes: a6e543f61531 ("clocksource/drivers/timer-ti-dm: Move struct omap_dm_timer fields to driver")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202311040403.DzIiBuwU-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202311040606.XL5OcR9O-lkp@intel.com/
Signed-off-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20231114072930.40615-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/clocksource/timer-ti-dm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/clocksource/timer-ti-dm.c
+++ b/drivers/clocksource/timer-ti-dm.c
@@ -183,7 +183,7 @@ static inline u32 dmtimer_read(struct dm
  * dmtimer_write - write timer registers in posted and non-posted mode
  * @timer:      timer pointer over which write operation is to perform
  * @reg:        lowest byte holds the register offset
- * @value:      data to write into the register
+ * @val:        data to write into the register
  *
  * The posted mode bit is encoded in reg. Note that in posted mode, the write
  * pending bit must be checked. Otherwise a write on a register which has a
@@ -949,7 +949,7 @@ static int omap_dm_timer_set_int_enable(
 
 /**
  * omap_dm_timer_set_int_disable - disable timer interrupts
- * @timer:	pointer to timer handle
+ * @cookie:	pointer to timer cookie
  * @mask:	bit mask of interrupts to be disabled
  *
  * Disables the specified timer interrupts for a timer.



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 355/583] powerpc/64s: Increase default stack size to 32KB
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (353 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 354/583] clocksource/drivers/timer-ti-dm: Fix make W=n kerneldoc warnings Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 356/583] tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug Greg Kroah-Hartman
                   ` (234 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Michael Ellerman, Aneesh Kumar K.V (IBM)

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Michael Ellerman <mpe@ellerman.id.au>

commit 18f14afe281648e31ed35c9ad2fcb724c4838ad9 upstream.

There are reports of kernels crashing due to stack overflow while
running OpenShift (Kubernetes). The primary contributor to the stack
usage seems to be openvswitch, which is used by OVN-Kubernetes (based on
OVN (Open Virtual Network)), but NFS also contributes in some stack
traces.

There may be some opportunities to reduce stack usage in the openvswitch
code, but doing so potentially require tradeoffs vs performance, and
also requires testing across architectures.

Looking at stack usage across the kernel (using -fstack-usage), shows
that ppc64le stack frames are on average 50-100% larger than the
equivalent function built for x86-64. Which is not surprising given the
minimum stack frame size is 32 bytes on ppc64le vs 16 bytes on x86-64.

So increase the default stack size to 32KB for the modern 64-bit Book3S
platforms, ie. pseries (virtualised) and powernv (bare metal). That
leaves the older systems like G5s, and the AmigaOne (pasemi) with a 16KB
stack which should be sufficient on those machines.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Aneesh Kumar K.V (IBM) <aneesh.kumar@kernel.org>
Link: https://msgid.link/20231215124449.317597-1-mpe@ellerman.id.au
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/powerpc/Kconfig |    1 +
 1 file changed, 1 insertion(+)

--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -857,6 +857,7 @@ config THREAD_SHIFT
 	int "Thread shift" if EXPERT
 	range 13 15
 	default "15" if PPC_256K_PAGES
+	default "15" if PPC_PSERIES || PPC_POWERNV
 	default "14" if PPC64
 	default "13"
 	help



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 356/583] tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (354 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 355/583] powerpc/64s: Increase default stack size to 32KB Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 357/583] Revert "usb: gadget: f_uvc: change endpoint allocation in uvc_function_bind()" Greg Kroah-Hartman
                   ` (233 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Gerald Schaefer, Heiko Carstens,
	Thomas Gleixner, Frederic Weisbecker

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Heiko Carstens <hca@linux.ibm.com>

commit 71fee48fb772ac4f6cfa63dbebc5629de8b4cc09 upstream.

When offlining and onlining CPUs the overall reported idle and iowait
times as reported by /proc/stat jump backward and forward:

cpu  132 0 176 225249 47 6 6 21 0 0
cpu0 80 0 115 112575 33 3 4 18 0 0
cpu1 52 0 60 112673 13 3 1 2 0 0

cpu  133 0 177 226681 47 6 6 21 0 0
cpu0 80 0 116 113387 33 3 4 18 0 0

cpu  133 0 178 114431 33 6 6 21 0 0 <---- jump backward
cpu0 80 0 116 114247 33 3 4 18 0 0
cpu1 52 0 61 183 0 3 1 2 0 0        <---- idle + iowait start with 0

cpu  133 0 178 228956 47 6 6 21 0 0 <---- jump forward
cpu0 81 0 117 114929 33 3 4 18 0 0

Reason for this is that get_idle_time() in fs/proc/stat.c has different
sources for both values depending on if a CPU is online or offline:

- if a CPU is online the values may be taken from its per cpu
  tick_cpu_sched structure

- if a CPU is offline the values are taken from its per cpu cpustat
  structure

The problem is that the per cpu tick_cpu_sched structure is set to zero on
CPU offline. See tick_cancel_sched_timer() in kernel/time/tick-sched.c.

Therefore when a CPU is brought offline and online afterwards both its idle
and iowait sleeptime will be zero, causing a jump backward in total system
idle and iowait sleeptime. In a similar way if a CPU is then brought
offline again the total idle and iowait sleeptimes will jump forward.

It looks like this behavior was introduced with commit 4b0c0f294f60
("tick: Cleanup NOHZ per cpu data on cpu down").

This was only noticed now on s390, since we switched to generic idle time
reporting with commit be76ea614460 ("s390/idle: remove arch_cpu_idle_time()
and corresponding code").

Fix this by preserving the values of idle_sleeptime and iowait_sleeptime
members of the per-cpu tick_sched structure on CPU hotplug.

Fixes: 4b0c0f294f60 ("tick: Cleanup NOHZ per cpu data on cpu down")
Reported-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20240115163555.1004144-1-hca@linux.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 kernel/time/tick-sched.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -1547,13 +1547,18 @@ void tick_setup_sched_timer(void)
 void tick_cancel_sched_timer(int cpu)
 {
 	struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
+	ktime_t idle_sleeptime, iowait_sleeptime;
 
 # ifdef CONFIG_HIGH_RES_TIMERS
 	if (ts->sched_timer.base)
 		hrtimer_cancel(&ts->sched_timer);
 # endif
 
+	idle_sleeptime = ts->idle_sleeptime;
+	iowait_sleeptime = ts->iowait_sleeptime;
 	memset(ts, 0, sizeof(*ts));
+	ts->idle_sleeptime = idle_sleeptime;
+	ts->iowait_sleeptime = iowait_sleeptime;
 }
 #endif
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 357/583] Revert "usb: gadget: f_uvc: change endpoint allocation in uvc_function_bind()"
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (355 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 356/583] tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 358/583] usb: phy: mxs: remove CONFIG_USB_OTG condition for mxs_phy_is_otg_host() Greg Kroah-Hartman
                   ` (232 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Frank Li

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Frank Li <Frank.Li@nxp.com>

commit 895ee5aefb7e24203de5dffae7ce9a02d78fa3d1 upstream.

This reverts commit 3c5b006f3ee800b4bd9ed37b3a8f271b8560126e.

gadget_is_{super|dual}speed() API check UDC controller capitblity. It
should pass down highest speed endpoint descriptor to UDC controller. So
UDC controller driver can reserve enough resource at check_config(),
especially mult and maxburst. So UDC driver (such as cdns3) can know need
at least (mult + 1) * (maxburst + 1) * wMaxPacketSize internal memory for
this uvc functions.

Cc:  <stable@vger.kernel.org>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20231224153816.1664687-5-Frank.Li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/gadget/function/f_uvc.c |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -719,13 +719,29 @@ uvc_function_bind(struct usb_configurati
 	}
 	uvc->enable_interrupt_ep = opts->enable_interrupt_ep;
 
-	ep = usb_ep_autoconfig(cdev->gadget, &uvc_fs_streaming_ep);
+	/*
+	 * gadget_is_{super|dual}speed() API check UDC controller capitblity. It should pass down
+	 * highest speed endpoint descriptor to UDC controller. So UDC controller driver can reserve
+	 * enough resource at check_config(), especially mult and maxburst. So UDC driver (such as
+	 * cdns3) can know need at least (mult + 1) * (maxburst + 1) * wMaxPacketSize internal
+	 * memory for this uvc functions. This is the only straightforward method to resolve the UDC
+	 * resource allocation issue in the current gadget framework.
+	 */
+	if (gadget_is_superspeed(c->cdev->gadget))
+		ep = usb_ep_autoconfig_ss(cdev->gadget, &uvc_ss_streaming_ep,
+					  &uvc_ss_streaming_comp);
+	else if (gadget_is_dualspeed(cdev->gadget))
+		ep = usb_ep_autoconfig(cdev->gadget, &uvc_hs_streaming_ep);
+	else
+		ep = usb_ep_autoconfig(cdev->gadget, &uvc_fs_streaming_ep);
+
 	if (!ep) {
 		uvcg_info(f, "Unable to allocate streaming EP\n");
 		goto error;
 	}
 	uvc->video.ep = ep;
 
+	uvc_fs_streaming_ep.bEndpointAddress = uvc->video.ep->address;
 	uvc_hs_streaming_ep.bEndpointAddress = uvc->video.ep->address;
 	uvc_ss_streaming_ep.bEndpointAddress = uvc->video.ep->address;
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 358/583] usb: phy: mxs: remove CONFIG_USB_OTG condition for mxs_phy_is_otg_host()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (356 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 357/583] Revert "usb: gadget: f_uvc: change endpoint allocation in uvc_function_bind()" Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 359/583] usb: dwc: ep0: Update request status in dwc3_ep0_stall_restart Greg Kroah-Hartman
                   ` (231 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Peter Chen, Xu Yang

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Xu Yang <xu.yang_2@nxp.com>

commit ff2b89de471da942a4d853443688113a44fd35ed upstream.

When CONFIG_USB_OTG is not set, mxs_phy_is_otg_host() will always return
false. This behaviour is wrong. Since phy.last_event will always be set
for either host or device mode. Therefore, CONFIG_USB_OTG condition
can be removed.

Fixes: 5eda42aebb76 ("usb: phy: mxs: fix getting wrong state with mxs_phy_is_otg_host()")
cc:  <stable@vger.kernel.org>
Acked-by: Peter Chen <peter.chen@kernel.org>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Link: https://lore.kernel.org/r/20231228110753.1755756-3-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/phy/phy-mxs-usb.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -388,8 +388,7 @@ static void __mxs_phy_disconnect_line(st
 
 static bool mxs_phy_is_otg_host(struct mxs_phy *mxs_phy)
 {
-	return IS_ENABLED(CONFIG_USB_OTG) &&
-		mxs_phy->phy.last_event == USB_EVENT_ID;
+	return mxs_phy->phy.last_event == USB_EVENT_ID;
 }
 
 static void mxs_phy_disconnect_line(struct mxs_phy *mxs_phy, bool on)



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 359/583] usb: dwc: ep0: Update request status in dwc3_ep0_stall_restart
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (357 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 358/583] usb: phy: mxs: remove CONFIG_USB_OTG condition for mxs_phy_is_otg_host() Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 360/583] usb: dwc3: gadget: Handle EP0 request dequeuing properly Greg Kroah-Hartman
                   ` (230 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Uttkarsh Aggarwal

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Uttkarsh Aggarwal <quic_uaggarwa@quicinc.com>

commit e9d40b215e38480fd94c66b06d79045717a59e9c upstream.

Current implementation blocks the running operations when Plug-out and
Plug-In is performed continuously, process gets stuck in
dwc3_thread_interrupt().

Code Flow:

	CPU1

	->Gadget_start
	->dwc3_interrupt
	->dwc3_thread_interrupt
	->dwc3_process_event_buf
	->dwc3_process_event_entry
	->dwc3_endpoint_interrupt
	->dwc3_ep0_interrupt
	->dwc3_ep0_inspect_setup
	->dwc3_ep0_stall_and_restart

By this time if pending_list is not empty, it will get the next request
on the given list and calls dwc3_gadget_giveback which will unmap request
and call its complete() callback to notify upper layers that it has
completed. Currently dwc3_gadget_giveback status is set to -ECONNRESET,
whereas it should be -ESHUTDOWN based on condition if not dwc->connected
is true.

Cc:  <stable@vger.kernel.org>
Fixes: d742220b3577 ("usb: dwc3: ep0: giveback requests on stall_and_restart")
Signed-off-by: Uttkarsh Aggarwal <quic_uaggarwa@quicinc.com>
Link: https://lore.kernel.org/r/20231222094704.20276-1-quic_uaggarwa@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/dwc3/ep0.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -238,7 +238,10 @@ void dwc3_ep0_stall_and_restart(struct d
 		struct dwc3_request	*req;
 
 		req = next_request(&dep->pending_list);
-		dwc3_gadget_giveback(dep, req, -ECONNRESET);
+		if (!dwc->connected)
+			dwc3_gadget_giveback(dep, req, -ESHUTDOWN);
+		else
+			dwc3_gadget_giveback(dep, req, -ECONNRESET);
 	}
 
 	dwc->eps[0]->trb_enqueue = 0;



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 360/583] usb: dwc3: gadget: Handle EP0 request dequeuing properly
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (358 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 359/583] usb: dwc: ep0: Update request status in dwc3_ep0_stall_restart Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 361/583] usb: dwc3: gadget: Queue PM runtime idle on disconnect event Greg Kroah-Hartman
                   ` (229 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, stable, Wesley Cheng, Thinh Nguyen

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Wesley Cheng <quic_wcheng@quicinc.com>

commit 730e12fbec53ab59dd807d981a204258a4cfb29a upstream.

Current EP0 dequeue path will share the same as other EPs.  However, there
are some special considerations that need to be made for EP0 transfers:

  - EP0 transfers never transition into the started_list
  - EP0 only has one active request at a time

In case there is a vendor specific control message for a function over USB
FFS, then there is no guarantee on the timeline which the DATA/STATUS stage
is responded to.  While this occurs, any attempt to end transfers on
non-control EPs will end up having the DWC3_EP_DELAY_STOP flag set, and
defer issuing of the end transfer command.  If the USB FFS application
decides to timeout the control transfer, or if USB FFS AIO path exits, the
USB FFS driver will issue a call to usb_ep_dequeue() for the ep0 request.

In case of the AIO exit path, the AIO FS blocks until all pending USB
requests utilizing the AIO path is completed.  However, since the dequeue
of ep0 req does not happen properly, all non-control EPs with the
DWC3_EP_DELAY_STOP flag set will not be handled, and the AIO exit path will
be stuck waiting for the USB FFS data endpoints to receive a completion
callback.

Fix is to utilize dwc3_ep0_reset_state() in the dequeue API to ensure EP0
is brought back to the SETUP state, and ensures that any deferred end
transfer commands are handled.  This also will end any active transfers
on EP0, compared to the previous implementation which directly called
giveback only.

Fixes: fcd2def66392 ("usb: dwc3: gadget: Refactor dwc3_gadget_ep_dequeue")
Cc: stable <stable@kernel.org>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20231206201814.32664-1-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/dwc3/gadget.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2103,7 +2103,17 @@ static int dwc3_gadget_ep_dequeue(struct
 
 	list_for_each_entry(r, &dep->pending_list, list) {
 		if (r == req) {
-			dwc3_gadget_giveback(dep, req, -ECONNRESET);
+			/*
+			 * Explicitly check for EP0/1 as dequeue for those
+			 * EPs need to be handled differently.  Control EP
+			 * only deals with one USB req, and giveback will
+			 * occur during dwc3_ep0_stall_and_restart().  EP0
+			 * requests are never added to started_list.
+			 */
+			if (dep->number > 1)
+				dwc3_gadget_giveback(dep, req, -ECONNRESET);
+			else
+				dwc3_ep0_reset_state(dwc);
 			goto out;
 		}
 	}



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 361/583] usb: dwc3: gadget: Queue PM runtime idle on disconnect event
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (359 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 360/583] usb: dwc3: gadget: Handle EP0 request dequeuing properly Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 362/583] Revert "usb: dwc3: Soft reset phy on probe for host" Greg Kroah-Hartman
                   ` (228 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Wesley Cheng

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Wesley Cheng <quic_wcheng@quicinc.com>

commit 3c7af52c7616c3aa6dacd2336ec748d4a65df8f4 upstream.

There is a scenario where DWC3 runtime suspend is blocked due to the
dwc->connected flag still being true while PM usage_count is zero after
DWC3 giveback is completed and the USB gadget session is being terminated.
This leads to a case where nothing schedules a PM runtime idle for the
device.

The exact condition is seen with the following sequence:
  1.  USB bus reset is issued by the host
  2.  Shortly after, or concurrently, a USB PD DR SWAP request is received
      (sink->source)
  3.  USB bus reset event handler runs and issues
      dwc3_stop_active_transfers(), and pending transfer are stopped
  4.  DWC3 usage_count decremented to 0, and runtime idle occurs while
      dwc->connected == true, returns -EBUSY
  5.  DWC3 disconnect event seen, dwc->connected set to false due to DR
      swap handling
  6.  No runtime idle after this point

Address this by issuing an asynchronous PM runtime idle call after the
disconnect event is completed, as it modifies the dwc->connected flag,
which is what blocks the initial runtime idle.

Fixes: fc8bb91bc83e ("usb: dwc3: implement runtime PM")
Cc:  <stable@vger.kernel.org>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20240103214946.2596-1-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/dwc3/gadget.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -3983,6 +3983,13 @@ static void dwc3_gadget_disconnect_inter
 	usb_gadget_set_state(dwc->gadget, USB_STATE_NOTATTACHED);
 
 	dwc3_ep0_reset_state(dwc);
+
+	/*
+	 * Request PM idle to address condition where usage count is
+	 * already decremented to zero, but waiting for the disconnect
+	 * interrupt to set dwc->connected to FALSE.
+	 */
+	pm_request_idle(dwc->dev);
 }
 
 static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc)



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 362/583] Revert "usb: dwc3: Soft reset phy on probe for host"
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (360 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 361/583] usb: dwc3: gadget: Queue PM runtime idle on disconnect event Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 363/583] Revert "usb: dwc3: dont reset device side if dwc3 was configured as host-only" Greg Kroah-Hartman
                   ` (227 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Köry Maincent, Thinh Nguyen

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

commit 7059fbebcb00554c3f31e5b5d93ef6d2d96dc7b4 upstream.

This reverts commit 8bea147dfdf823eaa8d3baeccc7aeb041b41944b.

The phy soft reset GUSB2PHYCFG.PHYSOFTRST only applies to UTMI phy, not
ULPI. This fix is incomplete.

Cc:  <stable@vger.kernel.org>
Fixes: 8bea147dfdf8 ("usb: dwc3: Soft reset phy on probe for host")
Reported-by: Köry Maincent <kory.maincent@bootlin.com>
Closes: https://lore.kernel.org/linux-usb/20231205151959.5236c231@kmaincent-XPS-13-7390
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/29a26593a60eba727de872a3e580a674807b3339.1703282469.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/dwc3/core.c |   39 +--------------------------------------
 1 file changed, 1 insertion(+), 38 deletions(-)

--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -279,46 +279,9 @@ int dwc3_core_soft_reset(struct dwc3 *dw
 	 * XHCI driver will reset the host block. If dwc3 was configured for
 	 * host-only mode or current role is host, then we can return early.
 	 */
-	if (dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST)
+	if (dwc->dr_mode == USB_DR_MODE_HOST || dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST)
 		return 0;
 
-	/*
-	 * If the dr_mode is host and the dwc->current_dr_role is not the
-	 * corresponding DWC3_GCTL_PRTCAP_HOST, then the dwc3_core_init_mode
-	 * isn't executed yet. Ensure the phy is ready before the controller
-	 * updates the GCTL.PRTCAPDIR or other settings by soft-resetting
-	 * the phy.
-	 *
-	 * Note: GUSB3PIPECTL[n] and GUSB2PHYCFG[n] are port settings where n
-	 * is port index. If this is a multiport host, then we need to reset
-	 * all active ports.
-	 */
-	if (dwc->dr_mode == USB_DR_MODE_HOST) {
-		u32 usb3_port;
-		u32 usb2_port;
-
-		usb3_port = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0));
-		usb3_port |= DWC3_GUSB3PIPECTL_PHYSOFTRST;
-		dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), usb3_port);
-
-		usb2_port = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
-		usb2_port |= DWC3_GUSB2PHYCFG_PHYSOFTRST;
-		dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), usb2_port);
-
-		/* Small delay for phy reset assertion */
-		usleep_range(1000, 2000);
-
-		usb3_port &= ~DWC3_GUSB3PIPECTL_PHYSOFTRST;
-		dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), usb3_port);
-
-		usb2_port &= ~DWC3_GUSB2PHYCFG_PHYSOFTRST;
-		dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), usb2_port);
-
-		/* Wait for clock synchronization */
-		msleep(50);
-		return 0;
-	}
-
 	reg = dwc3_readl(dwc->regs, DWC3_DCTL);
 	reg |= DWC3_DCTL_CSFTRST;
 	reg &= ~DWC3_DCTL_RUN_STOP;



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 363/583] Revert "usb: dwc3: dont reset device side if dwc3 was configured as host-only"
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (361 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 362/583] Revert "usb: dwc3: Soft reset phy on probe for host" Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 364/583] usb: chipidea: wait controller resume finished for wakeup irq Greg Kroah-Hartman
                   ` (226 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Thinh Nguyen

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

commit afe28cd686aeb77e8d9140d50fb1cf06a7ecb731 upstream.

This reverts commit e835c0a4e23c38531dcee5ef77e8d1cf462658c7.

Don't omit soft-reset. During initialization, the driver may need to
perform a soft reset to ensure the phy is ready when the controller
updates the GCTL.PRTCAPDIR or other settings by issuing phy soft-reset.
Many platforms often have access to DCTL register for soft-reset despite
being host-only. If there are actual reported issues from the platforms
that don't expose DCTL registers, then we will need to revisit (perhaps
to teach dwc3 to perform xhci's soft-reset USBCMD.HCRST).

Cc:  <stable@vger.kernel.org>
Fixes: e835c0a4e23c ("usb: dwc3: don't reset device side if dwc3 was configured as host-only")
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/7668ab11a48f260820825274976eb41fec7f54d1.1703282469.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/dwc3/core.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -277,9 +277,9 @@ int dwc3_core_soft_reset(struct dwc3 *dw
 	/*
 	 * We're resetting only the device side because, if we're in host mode,
 	 * XHCI driver will reset the host block. If dwc3 was configured for
-	 * host-only mode or current role is host, then we can return early.
+	 * host-only mode, then we can return early.
 	 */
-	if (dwc->dr_mode == USB_DR_MODE_HOST || dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST)
+	if (dwc->current_dr_role == DWC3_GCTL_PRTCAP_HOST)
 		return 0;
 
 	reg = dwc3_readl(dwc->regs, DWC3_DCTL);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 364/583] usb: chipidea: wait controller resume finished for wakeup irq
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (362 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 363/583] Revert "usb: dwc3: dont reset device side if dwc3 was configured as host-only" Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 365/583] usb: cdns3: fix uvc failure work since sg support enabled Greg Kroah-Hartman
                   ` (225 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Peter Chen, Xu Yang, Li Jun

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Xu Yang <xu.yang_2@nxp.com>

commit 128d849074d05545becf86e713715ce7676fc074 upstream.

After the chipidea driver introduce extcon for id and vbus, it's able
to wakeup from another irq source, in case the system with extcon ID
cable, wakeup from usb ID cable and device removal, the usb device
disconnect irq may come firstly before the extcon notifier while system
resume, so we will get 2 "wakeup" irq, one for usb device disconnect;
and one for extcon ID cable change(real wakeup event), current driver
treat them as 2 successive wakeup irq so can't handle it correctly, then
finally the usb irq can't be enabled. This patch adds a check to bypass
further usb events before controller resume finished to fix it.

Fixes: 1f874edcb731 ("usb: chipidea: add runtime power management support")
cc:  <stable@vger.kernel.org>
Acked-by: Peter Chen <peter.chen@kernel.org>
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Link: https://lore.kernel.org/r/20231228110753.1755756-2-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/chipidea/core.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -523,6 +523,13 @@ static irqreturn_t ci_irq_handler(int ir
 	u32 otgsc = 0;
 
 	if (ci->in_lpm) {
+		/*
+		 * If we already have a wakeup irq pending there,
+		 * let's just return to wait resume finished firstly.
+		 */
+		if (ci->wakeup_int)
+			return IRQ_HANDLED;
+
 		disable_irq_nosync(irq);
 		ci->wakeup_int = true;
 		pm_runtime_get(ci->dev);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 365/583] usb: cdns3: fix uvc failure work since sg support enabled
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (363 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 364/583] usb: chipidea: wait controller resume finished for wakeup irq Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 366/583] usb: cdns3: fix iso transfer error when mult is not zero Greg Kroah-Hartman
                   ` (224 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Frank Li

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Frank Li <Frank.Li@nxp.com>

commit 1b8be5ecff26201bafb0a554c74e91571299fb94 upstream.

When IP version >= DEV_VER_V2, gadget:sg_supported is true. So uvc gadget
function driver will use sg to equeue data, first is 8bytes header, the
second is 1016bytes data.

    cdns3_prepare_trb: ep2in: trb 0000000000ac755f, dma buf: 0xbf455000, size: 8, burst: 128 ctrl: 0x00000415 (C=1, T=0, ISP, CHAIN, Normal)
    cdns3_prepare_trb: ep2in: trb 00000000a574e693, dma buf: 0xc0200fe0, size: 1016, burst: 128 ctrl: 0x00000405 (C=1, T=0, ISP, Normal)

But cdns3_ep_run_transfer() can't correctly handle this case, which only
support one TRB for ISO transfer.

The controller requires duplicate the TD for each SOF if priv_ep->interval
is not 1. DMA will read data from DDR to internal FIFO when get SOF. Send
data to bus when receive IN token. DMA always refill FIFO when get SOF
regardless host send IN token or not. If host send IN token later, some
frames data will be lost.

Fixed it by below major steps:

1. Calculate numembers of TRB base on sg_nums and priv_ep->interval.
2. Remove CHAIN flags for each end TRB of TD when duplicate TD.
3. The controller requires LINK TRB must be first TRB of TD. When check
there are not enough TRBs lefts, just fill LINK TRB for left TRBs.

.... CHAIN_TRB DATA_TRB, CHAIN_TRB DATA_TRB,  LINK_TRB ... LINK_TRB
                                                           ^End of TRB List

Cc:  <stable@vger.kernel.org>
Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20231224153816.1664687-2-Frank.Li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/cdns3/cdns3-gadget.c |   51 ++++++++++++++++++++++++++++++---------
 1 file changed, 40 insertions(+), 11 deletions(-)

--- a/drivers/usb/cdns3/cdns3-gadget.c
+++ b/drivers/usb/cdns3/cdns3-gadget.c
@@ -1119,6 +1119,7 @@ static int cdns3_ep_run_transfer(struct
 	dma_addr_t trb_dma;
 	u32 togle_pcs = 1;
 	int sg_iter = 0;
+	int num_trb_req;
 	int num_trb;
 	int address;
 	u32 control;
@@ -1127,15 +1128,13 @@ static int cdns3_ep_run_transfer(struct
 	struct scatterlist *s = NULL;
 	bool sg_supported = !!(request->num_mapped_sgs);
 
+	num_trb_req = sg_supported ? request->num_mapped_sgs : 1;
+
+	/* ISO transfer require each SOF have a TD, each TD include some TRBs */
 	if (priv_ep->type == USB_ENDPOINT_XFER_ISOC)
-		num_trb = priv_ep->interval;
+		num_trb = priv_ep->interval * num_trb_req;
 	else
-		num_trb = sg_supported ? request->num_mapped_sgs : 1;
-
-	if (num_trb > priv_ep->free_trbs) {
-		priv_ep->flags |= EP_RING_FULL;
-		return -ENOBUFS;
-	}
+		num_trb = num_trb_req;
 
 	priv_req = to_cdns3_request(request);
 	address = priv_ep->endpoint.desc->bEndpointAddress;
@@ -1184,14 +1183,31 @@ static int cdns3_ep_run_transfer(struct
 
 		link_trb->control = cpu_to_le32(((priv_ep->pcs) ? TRB_CYCLE : 0) |
 				    TRB_TYPE(TRB_LINK) | TRB_TOGGLE | ch_bit);
+
+		if (priv_ep->type == USB_ENDPOINT_XFER_ISOC) {
+			/*
+			 * ISO require LINK TRB must be first one of TD.
+			 * Fill LINK TRBs for left trb space to simply software process logic.
+			 */
+			while (priv_ep->enqueue) {
+				*trb = *link_trb;
+				trace_cdns3_prepare_trb(priv_ep, trb);
+
+				cdns3_ep_inc_enq(priv_ep);
+				trb = priv_ep->trb_pool + priv_ep->enqueue;
+				priv_req->trb = trb;
+			}
+		}
+	}
+
+	if (num_trb > priv_ep->free_trbs) {
+		priv_ep->flags |= EP_RING_FULL;
+		return -ENOBUFS;
 	}
 
 	if (priv_dev->dev_ver <= DEV_VER_V2)
 		togle_pcs = cdns3_wa1_update_guard(priv_ep, trb);
 
-	if (sg_supported)
-		s = request->sg;
-
 	/* set incorrect Cycle Bit for first trb*/
 	control = priv_ep->pcs ? 0 : TRB_CYCLE;
 	trb->length = 0;
@@ -1209,6 +1225,9 @@ static int cdns3_ep_run_transfer(struct
 	do {
 		u32 length;
 
+		if (!(sg_iter % num_trb_req) && sg_supported)
+			s = request->sg;
+
 		/* fill TRB */
 		control |= TRB_TYPE(TRB_NORMAL);
 		if (sg_supported) {
@@ -1250,7 +1269,7 @@ static int cdns3_ep_run_transfer(struct
 		if (sg_supported) {
 			trb->control |= cpu_to_le32(TRB_ISP);
 			/* Don't set chain bit for last TRB */
-			if (sg_iter < num_trb - 1)
+			if ((sg_iter % num_trb_req) < num_trb_req - 1)
 				trb->control |= cpu_to_le32(TRB_CHAIN);
 
 			s = sg_next(s);
@@ -1508,6 +1527,12 @@ static void cdns3_transfer_completed(str
 
 		/* The TRB was changed as link TRB, and the request was handled at ep_dequeue */
 		while (TRB_FIELD_TO_TYPE(le32_to_cpu(trb->control)) == TRB_LINK) {
+
+			/* ISO ep_traddr may stop at LINK TRB */
+			if (priv_ep->dequeue == cdns3_get_dma_pos(priv_dev, priv_ep) &&
+			    priv_ep->type == USB_ENDPOINT_XFER_ISOC)
+				break;
+
 			trace_cdns3_complete_trb(priv_ep, trb);
 			cdns3_ep_inc_deq(priv_ep);
 			trb = priv_ep->trb_pool + priv_ep->dequeue;
@@ -1540,6 +1565,10 @@ static void cdns3_transfer_completed(str
 			}
 
 			if (request_handled) {
+				/* TRBs are duplicated by priv_ep->interval time for ISO IN */
+				if (priv_ep->type == USB_ENDPOINT_XFER_ISOC && priv_ep->dir)
+					request->actual /= priv_ep->interval;
+
 				cdns3_gadget_giveback(priv_ep, priv_req, 0);
 				request_handled = false;
 				transfer_end = false;



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 366/583] usb: cdns3: fix iso transfer error when mult is not zero
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (364 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 365/583] usb: cdns3: fix uvc failure work since sg support enabled Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 367/583] usb: cdns3: Fix uvc fail when DMA cross 4k boundery since sg enabled Greg Kroah-Hartman
                   ` (223 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Frank Li

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Frank Li <Frank.Li@nxp.com>

commit 92f02efa1d86d7dcaef7f38a5fe3396c4e88a93c upstream.

ISO basic transfer is
	ITP(SOF) Package_0 Package_1 ... Package_n

CDNS3 DMA start dma transfer from memmory to internal FIFO when get SOF,
controller will transfer data to usb bus from internal FIFO when get IN
token.

According USB spec defination:
	Maximum number of packets = (bMaxBurst + 1) * (Mult + 1)

Internal memory should be the same as (bMaxBurst + 1) * (Mult + 1). DMA
don't fetch data advance when ISO transfer, so only reserve
(bMaxBurst + 1) * (Mult + 1) internal memory for ISO transfer.

Need save Mult and bMaxBurst information and set it into EP_CFG register,
otherwise only 1 package is sent by controller, other package will be
lost.

Cc:  <stable@vger.kernel.org>
Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20231224153816.1664687-3-Frank.Li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/cdns3/cdns3-gadget.c |   59 +++++++++++++++++++++++----------------
 drivers/usb/cdns3/cdns3-gadget.h |    3 +
 2 files changed, 39 insertions(+), 23 deletions(-)

--- a/drivers/usb/cdns3/cdns3-gadget.c
+++ b/drivers/usb/cdns3/cdns3-gadget.c
@@ -2064,11 +2064,10 @@ int cdns3_ep_config(struct cdns3_endpoin
 	bool is_iso_ep = (priv_ep->type == USB_ENDPOINT_XFER_ISOC);
 	struct cdns3_device *priv_dev = priv_ep->cdns3_dev;
 	u32 bEndpointAddress = priv_ep->num | priv_ep->dir;
-	u32 max_packet_size = 0;
-	u8 maxburst = 0;
+	u32 max_packet_size = priv_ep->wMaxPacketSize;
+	u8 maxburst = priv_ep->bMaxBurst;
 	u32 ep_cfg = 0;
 	u8 buffering;
-	u8 mult = 0;
 	int ret;
 
 	buffering = priv_dev->ep_buf_size - 1;
@@ -2090,8 +2089,7 @@ int cdns3_ep_config(struct cdns3_endpoin
 		break;
 	default:
 		ep_cfg = EP_CFG_EPTYPE(USB_ENDPOINT_XFER_ISOC);
-		mult = priv_dev->ep_iso_burst - 1;
-		buffering = mult + 1;
+		buffering = (priv_ep->bMaxBurst + 1) * (priv_ep->mult + 1) - 1;
 	}
 
 	switch (priv_dev->gadget.speed) {
@@ -2102,17 +2100,8 @@ int cdns3_ep_config(struct cdns3_endpoin
 		max_packet_size = is_iso_ep ? 1024 : 512;
 		break;
 	case USB_SPEED_SUPER:
-		/* It's limitation that driver assumes in driver. */
-		mult = 0;
-		max_packet_size = 1024;
-		if (priv_ep->type == USB_ENDPOINT_XFER_ISOC) {
-			maxburst = priv_dev->ep_iso_burst - 1;
-			buffering = (mult + 1) *
-				    (maxburst + 1);
-
-			if (priv_ep->interval > 1)
-				buffering++;
-		} else {
+		if (priv_ep->type != USB_ENDPOINT_XFER_ISOC) {
+			max_packet_size = 1024;
 			maxburst = priv_dev->ep_buf_size - 1;
 		}
 		break;
@@ -2141,7 +2130,6 @@ int cdns3_ep_config(struct cdns3_endpoin
 	if (priv_dev->dev_ver < DEV_VER_V2)
 		priv_ep->trb_burst_size = 16;
 
-	mult = min_t(u8, mult, EP_CFG_MULT_MAX);
 	buffering = min_t(u8, buffering, EP_CFG_BUFFERING_MAX);
 	maxburst = min_t(u8, maxburst, EP_CFG_MAXBURST_MAX);
 
@@ -2175,7 +2163,7 @@ int cdns3_ep_config(struct cdns3_endpoin
 	}
 
 	ep_cfg |= EP_CFG_MAXPKTSIZE(max_packet_size) |
-		  EP_CFG_MULT(mult) |
+		  EP_CFG_MULT(priv_ep->mult) |			/* must match EP setting */
 		  EP_CFG_BUFFERING(buffering) |
 		  EP_CFG_MAXBURST(maxburst);
 
@@ -2265,6 +2253,13 @@ usb_ep *cdns3_gadget_match_ep(struct usb
 	priv_ep->type = usb_endpoint_type(desc);
 	priv_ep->flags |= EP_CLAIMED;
 	priv_ep->interval = desc->bInterval ? BIT(desc->bInterval - 1) : 0;
+	priv_ep->wMaxPacketSize =  usb_endpoint_maxp(desc);
+	priv_ep->mult = USB_EP_MAXP_MULT(priv_ep->wMaxPacketSize);
+	priv_ep->wMaxPacketSize &= USB_ENDPOINT_MAXP_MASK;
+	if (priv_ep->type == USB_ENDPOINT_XFER_ISOC && comp_desc) {
+		priv_ep->mult =  USB_SS_MULT(comp_desc->bmAttributes) - 1;
+		priv_ep->bMaxBurst = comp_desc->bMaxBurst;
+	}
 
 	spin_unlock_irqrestore(&priv_dev->lock, flags);
 	return &priv_ep->endpoint;
@@ -3048,22 +3043,40 @@ static int cdns3_gadget_check_config(str
 	struct cdns3_endpoint *priv_ep;
 	struct usb_ep *ep;
 	int n_in = 0;
+	int iso = 0;
+	int out = 1;
 	int total;
+	int n;
 
 	list_for_each_entry(ep, &gadget->ep_list, ep_list) {
 		priv_ep = ep_to_cdns3_ep(ep);
-		if ((priv_ep->flags & EP_CLAIMED) && (ep->address & USB_DIR_IN))
-			n_in++;
+		if (!(priv_ep->flags & EP_CLAIMED))
+			continue;
+
+		n = (priv_ep->mult + 1) * (priv_ep->bMaxBurst + 1);
+		if (ep->address & USB_DIR_IN) {
+			/*
+			 * ISO transfer: DMA start move data when get ISO, only transfer
+			 * data as min(TD size, iso). No benefit for allocate bigger
+			 * internal memory than 'iso'.
+			 */
+			if (priv_ep->type == USB_ENDPOINT_XFER_ISOC)
+				iso += n;
+			else
+				n_in++;
+		} else {
+			if (priv_ep->type == USB_ENDPOINT_XFER_ISOC)
+				out = max_t(int, out, n);
+		}
 	}
 
 	/* 2KB are reserved for EP0, 1KB for out*/
-	total = 2 + n_in + 1;
+	total = 2 + n_in + out + iso;
 
 	if (total > priv_dev->onchip_buffers)
 		return -ENOMEM;
 
-	priv_dev->ep_buf_size = priv_dev->ep_iso_burst =
-			(priv_dev->onchip_buffers - 2) / (n_in + 1);
+	priv_dev->ep_buf_size = (priv_dev->onchip_buffers - 2 - iso) / (n_in + out);
 
 	return 0;
 }
--- a/drivers/usb/cdns3/cdns3-gadget.h
+++ b/drivers/usb/cdns3/cdns3-gadget.h
@@ -1168,6 +1168,9 @@ struct cdns3_endpoint {
 	u8			dir;
 	u8			num;
 	u8			type;
+	u8			mult;
+	u8			bMaxBurst;
+	u16			wMaxPacketSize;
 	int			interval;
 
 	int			free_trbs;



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 367/583] usb: cdns3: Fix uvc fail when DMA cross 4k boundery since sg enabled
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (365 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 366/583] usb: cdns3: fix iso transfer error when mult is not zero Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:56 ` [PATCH 6.6 368/583] Revert "usb: typec: class: fix typec_altmode_put_partner to put plugs" Greg Kroah-Hartman
                   ` (222 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Frank Li

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Frank Li <Frank.Li@nxp.com>

commit 40c304109e866a7dc123661a5c8ca72f6b5e14e0 upstream.

Supposed DMA cross 4k bounder problem should be fixed at DEV_VER_V2, but
still met problem when do ISO transfer if sg enabled.

Data pattern likes below when sg enabled, package size is 1k and mult is 2
	[UVC Header(8B) ] [data(3k - 8)] ...

The received data at offset 0xd000 will get 0xc000 data, len 0x70. Error
happen position as below pattern:
	0xd000: wrong
	0xe000: wrong
	0xf000: correct
	0x10000: wrong
	0x11000: wrong
	0x12000: correct
	...

To avoid DMA cross 4k bounder at ISO transfer, reduce burst len according
to start DMA address's alignment.

Cc:  <stable@vger.kernel.org>
Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20231224153816.1664687-4-Frank.Li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/cdns3/cdns3-gadget.c |   32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

--- a/drivers/usb/cdns3/cdns3-gadget.c
+++ b/drivers/usb/cdns3/cdns3-gadget.c
@@ -1120,6 +1120,7 @@ static int cdns3_ep_run_transfer(struct
 	u32 togle_pcs = 1;
 	int sg_iter = 0;
 	int num_trb_req;
+	int trb_burst;
 	int num_trb;
 	int address;
 	u32 control;
@@ -1242,7 +1243,36 @@ static int cdns3_ep_run_transfer(struct
 			total_tdl += DIV_ROUND_UP(length,
 					       priv_ep->endpoint.maxpacket);
 
-		trb->length |= cpu_to_le32(TRB_BURST_LEN(priv_ep->trb_burst_size) |
+		trb_burst = priv_ep->trb_burst_size;
+
+		/*
+		 * Supposed DMA cross 4k bounder problem should be fixed at DEV_VER_V2, but still
+		 * met problem when do ISO transfer if sg enabled.
+		 *
+		 * Data pattern likes below when sg enabled, package size is 1k and mult is 2
+		 *       [UVC Header(8B) ] [data(3k - 8)] ...
+		 *
+		 * The received data at offset 0xd000 will get 0xc000 data, len 0x70. Error happen
+		 * as below pattern:
+		 *	0xd000: wrong
+		 *	0xe000: wrong
+		 *	0xf000: correct
+		 *	0x10000: wrong
+		 *	0x11000: wrong
+		 *	0x12000: correct
+		 *	...
+		 *
+		 * But it is still unclear about why error have not happen below 0xd000, it should
+		 * cross 4k bounder. But anyway, the below code can fix this problem.
+		 *
+		 * To avoid DMA cross 4k bounder at ISO transfer, reduce burst len according to 16.
+		 */
+		if (priv_ep->type == USB_ENDPOINT_XFER_ISOC && priv_dev->dev_ver <= DEV_VER_V2)
+			if (ALIGN_DOWN(trb->buffer, SZ_4K) !=
+			    ALIGN_DOWN(trb->buffer + length, SZ_4K))
+				trb_burst = 16;
+
+		trb->length |= cpu_to_le32(TRB_BURST_LEN(trb_burst) |
 					TRB_LEN(length));
 		pcs = priv_ep->pcs ? TRB_CYCLE : 0;
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 368/583] Revert "usb: typec: class: fix typec_altmode_put_partner to put plugs"
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (366 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 367/583] usb: cdns3: Fix uvc fail when DMA cross 4k boundery since sg enabled Greg Kroah-Hartman
@ 2024-01-22 23:56 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 369/583] usb: typec: class: fix typec_altmode_put_partner to put plugs Greg Kroah-Hartman
                   ` (221 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:56 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, RD Babiera, Chris Bainbridge,
	Heikki Krogerus

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Heikki Krogerus <heikki.krogerus@linux.intel.com>

commit 9c6b789e954fae73c548f39332bcc56bdf0d4373 upstream.

This reverts commit b17b7fe6dd5c6ff74b38b0758ca799cdbb79e26e.

That commit messed up the reference counting, so it needs to
be rethought.

Fixes: b17b7fe6dd5c ("usb: typec: class: fix typec_altmode_put_partner to put plugs")
Cc:  <stable@vger.kernel.org>
Cc: RD Babiera <rdbabiera@google.com>
Reported-by: Chris Bainbridge <chris.bainbridge@gmail.com>
Closes: https://lore.kernel.org/lkml/CAP-bSRb3SXpgo_BEdqZB-p1K5625fMegRZ17ZkPE1J8ZYgEHDg@mail.gmail.com/
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240102091142.2136472-1-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/typec/class.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -266,7 +266,7 @@ static void typec_altmode_put_partner(st
 	if (!partner)
 		return;
 
-	adev = &altmode->adev;
+	adev = &partner->adev;
 
 	if (is_typec_plug(adev->dev.parent)) {
 		struct typec_plug *plug = to_typec_plug(adev->dev.parent);
@@ -496,8 +496,7 @@ static void typec_altmode_release(struct
 {
 	struct altmode *alt = to_altmode(to_typec_altmode(dev));
 
-	if (!is_typec_port(dev->parent))
-		typec_altmode_put_partner(alt);
+	typec_altmode_put_partner(alt);
 
 	altmode_id_remove(alt->adev.dev.parent, alt->id);
 	kfree(alt);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 369/583] usb: typec: class: fix typec_altmode_put_partner to put plugs
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (367 preceding siblings ...)
  2024-01-22 23:56 ` [PATCH 6.6 368/583] Revert "usb: typec: class: fix typec_altmode_put_partner to put plugs" Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 370/583] usb: mon: Fix atomicity violation in mon_bin_vma_fault Greg Kroah-Hartman
                   ` (220 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christian A. Ehrhardt, RD Babiera,
	Heikki Krogerus

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: RD Babiera <rdbabiera@google.com>

commit 5962ded777d689cd8bf04454273e32228d7fb71f upstream.

When typec_altmode_put_partner is called by a plug altmode upon release,
the port altmode the plug belongs to will not remove its reference to the
plug. The check to see if the altmode being released is a plug evaluates
against the released altmode's partner instead of the calling altmode, so
change adev in typec_altmode_put_partner to properly refer to the altmode
being released.

Because typec_altmode_set_partner calls get_device() on the port altmode,
add partner_adev that points to the port altmode in typec_put_partner to
call put_device() on. typec_altmode_set_partner is not called for port
altmodes, so add a check in typec_altmode_release to prevent
typec_altmode_put_partner() calls on port altmode release.

Fixes: 8a37d87d72f0 ("usb: typec: Bus type for alternate modes")
Cc:  <stable@vger.kernel.org>
Co-developed-by: Christian A. Ehrhardt <lk@c--e.de>
Signed-off-by: Christian A. Ehrhardt <lk@c--e.de>
Signed-off-by: RD Babiera <rdbabiera@google.com>
Tested-by: Christian A. Ehrhardt <lk@c--e.de>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240103181754.2492492-2-rdbabiera@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/typec/class.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -262,11 +262,13 @@ static void typec_altmode_put_partner(st
 {
 	struct altmode *partner = altmode->partner;
 	struct typec_altmode *adev;
+	struct typec_altmode *partner_adev;
 
 	if (!partner)
 		return;
 
-	adev = &partner->adev;
+	adev = &altmode->adev;
+	partner_adev = &partner->adev;
 
 	if (is_typec_plug(adev->dev.parent)) {
 		struct typec_plug *plug = to_typec_plug(adev->dev.parent);
@@ -275,7 +277,7 @@ static void typec_altmode_put_partner(st
 	} else {
 		partner->partner = NULL;
 	}
-	put_device(&adev->dev);
+	put_device(&partner_adev->dev);
 }
 
 /**
@@ -496,7 +498,8 @@ static void typec_altmode_release(struct
 {
 	struct altmode *alt = to_altmode(to_typec_altmode(dev));
 
-	typec_altmode_put_partner(alt);
+	if (!is_typec_port(dev->parent))
+		typec_altmode_put_partner(alt);
 
 	altmode_id_remove(alt->adev.dev.parent, alt->id);
 	kfree(alt);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 370/583] usb: mon: Fix atomicity violation in mon_bin_vma_fault
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (368 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 369/583] usb: typec: class: fix typec_altmode_put_partner to put plugs Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 371/583] dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp-phy: fix path to header Greg Kroah-Hartman
                   ` (219 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Gui-Dong Han

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Gui-Dong Han <2045gemini@gmail.com>

commit 2dd23cc4d0e6aa55cf9fb3b05f2f4165b01de81c upstream.

In mon_bin_vma_fault():
    offset = vmf->pgoff << PAGE_SHIFT;
    if (offset >= rp->b_size)
        return VM_FAULT_SIGBUS;
    chunk_idx = offset / CHUNK_SIZE;
    pageptr = rp->b_vec[chunk_idx].pg;
The code is executed without holding any lock.

In mon_bin_vma_close():
    spin_lock_irqsave(&rp->b_lock, flags);
    rp->mmap_active--;
    spin_unlock_irqrestore(&rp->b_lock, flags);

In mon_bin_ioctl():
    spin_lock_irqsave(&rp->b_lock, flags);
    if (rp->mmap_active) {
        ...
    } else {
        ...
        kfree(rp->b_vec);
        rp->b_vec  = vec;
        rp->b_size = size;
        ...
    }
    spin_unlock_irqrestore(&rp->b_lock, flags);

Concurrent execution of mon_bin_vma_fault() with mon_bin_vma_close() and
mon_bin_ioctl() could lead to atomicity violations. mon_bin_vma_fault()
accesses rp->b_size and rp->b_vec without locking, risking array
out-of-bounds access or use-after-free bugs due to possible modifications
in mon_bin_ioctl().

This possible bug is found by an experimental static analysis tool
developed by our team, BassCheck[1]. This tool analyzes the locking APIs
to extract function pairs that can be concurrently executed, and then
analyzes the instructions in the paired functions to identify possible
concurrency bugs including data races and atomicity violations. The above
possible bug is reported when our tool analyzes the source code of
Linux 6.2.

To address this issue, it is proposed to add a spin lock pair in
mon_bin_vma_fault() to ensure atomicity. With this patch applied, our tool
never reports the possible bug, with the kernel configuration allyesconfig
for x86_64. Due to the lack of associated hardware, we cannot test the
patch in runtime testing, and just verify it according to the code logic.

[1] https://sites.google.com/view/basscheck/

Fixes: 19e6317d24c2 ("usb: mon: Fix a deadlock in usbmon between ...")
Cc:  <stable@vger.kernel.org>
Signed-off-by: Gui-Dong Han <2045gemini@gmail.com>
Link: https://lore.kernel.org/r/20240105052412.9377-1-2045gemini@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/mon/mon_bin.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -1250,14 +1250,19 @@ static vm_fault_t mon_bin_vma_fault(stru
 	struct mon_reader_bin *rp = vmf->vma->vm_private_data;
 	unsigned long offset, chunk_idx;
 	struct page *pageptr;
+	unsigned long flags;
 
+	spin_lock_irqsave(&rp->b_lock, flags);
 	offset = vmf->pgoff << PAGE_SHIFT;
-	if (offset >= rp->b_size)
+	if (offset >= rp->b_size) {
+		spin_unlock_irqrestore(&rp->b_lock, flags);
 		return VM_FAULT_SIGBUS;
+	}
 	chunk_idx = offset / CHUNK_SIZE;
 	pageptr = rp->b_vec[chunk_idx].pg;
 	get_page(pageptr);
 	vmf->page = pageptr;
+	spin_unlock_irqrestore(&rp->b_lock, flags);
 	return 0;
 }
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 371/583] dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp-phy: fix path to header
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (369 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 370/583] usb: mon: Fix atomicity violation in mon_bin_vma_fault Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 372/583] serial: core: fix sanitizing check for RTS settings Greg Kroah-Hartman
                   ` (218 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski, Rob Herring,
	Johan Hovold, Vinod Koul

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

commit 21a1d02579ae75fd45555b84d20ba55632a14a19 upstream.

Fix the path to bindings header in description.

Fixes: e1c4c5436b4a ("dt-bindings: phy: qcom,qmp-usb3-dp: fix sc8280xp binding")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20231218130553.45893-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
@@ -62,12 +62,12 @@ properties:
   "#clock-cells":
     const: 1
     description:
-      See include/dt-bindings/dt-bindings/phy/phy-qcom-qmp.h
+      See include/dt-bindings/phy/phy-qcom-qmp.h
 
   "#phy-cells":
     const: 1
     description:
-      See include/dt-bindings/dt-bindings/phy/phy-qcom-qmp.h
+      See include/dt-bindings/phy/phy-qcom-qmp.h
 
   orientation-switch:
     description:



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 372/583] serial: core: fix sanitizing check for RTS settings
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (370 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 371/583] dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp-phy: fix path to header Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 373/583] serial: core: make sure RS485 cannot be enabled when it is not supported Greg Kroah-Hartman
                   ` (217 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Ilpo Järvinen, Lino Sanfilippo

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Lino Sanfilippo <l.sanfilippo@kunbus.com>

commit 4afeced55baa391490b61ed9164867e2927353ed upstream.

Among other things uart_sanitize_serial_rs485() tests the sanity of the RTS
settings in a RS485 configuration that has been passed by userspace.
If RTS-on-send and RTS-after-send are both set or unset the configuration
is adjusted and RTS-after-send is disabled and RTS-on-send enabled.

This however makes only sense if both RTS modes are actually supported by
the driver.

With commit be2e2cb1d281 ("serial: Sanitize rs485_struct") the code does
take the driver support into account but only checks if one of both RTS
modes are supported. This may lead to the errorneous result of RTS-on-send
being set even if only RTS-after-send is supported.

Fix this by changing the implemented logic: First clear all unsupported
flags in the RS485 configuration, then adjust an invalid RTS setting by
taking into account which RTS mode is supported.

Cc:  <stable@vger.kernel.org>
Fixes: be2e2cb1d281 ("serial: Sanitize rs485_struct")
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
Link: https://lore.kernel.org/r/20240103061818.564-4-l.sanfilippo@kunbus.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/tty/serial/serial_core.c |   28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1370,19 +1370,27 @@ static void uart_sanitize_serial_rs485(s
 		return;
 	}
 
+	rs485->flags &= supported_flags;
+
 	/* Pick sane settings if the user hasn't */
-	if ((supported_flags & (SER_RS485_RTS_ON_SEND|SER_RS485_RTS_AFTER_SEND)) &&
-	    !(rs485->flags & SER_RS485_RTS_ON_SEND) ==
+	if (!(rs485->flags & SER_RS485_RTS_ON_SEND) ==
 	    !(rs485->flags & SER_RS485_RTS_AFTER_SEND)) {
-		dev_warn_ratelimited(port->dev,
-			"%s (%d): invalid RTS setting, using RTS_ON_SEND instead\n",
-			port->name, port->line);
-		rs485->flags |= SER_RS485_RTS_ON_SEND;
-		rs485->flags &= ~SER_RS485_RTS_AFTER_SEND;
-		supported_flags |= SER_RS485_RTS_ON_SEND|SER_RS485_RTS_AFTER_SEND;
-	}
+		if (supported_flags & SER_RS485_RTS_ON_SEND) {
+			rs485->flags |= SER_RS485_RTS_ON_SEND;
+			rs485->flags &= ~SER_RS485_RTS_AFTER_SEND;
 
-	rs485->flags &= supported_flags;
+			dev_warn_ratelimited(port->dev,
+				"%s (%d): invalid RTS setting, using RTS_ON_SEND instead\n",
+				port->name, port->line);
+		} else {
+			rs485->flags |= SER_RS485_RTS_AFTER_SEND;
+			rs485->flags &= ~SER_RS485_RTS_ON_SEND;
+
+			dev_warn_ratelimited(port->dev,
+				"%s (%d): invalid RTS setting, using RTS_AFTER_SEND instead\n",
+				port->name, port->line);
+		}
+	}
 
 	uart_sanitize_serial_rs485_delays(port, rs485);
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 373/583] serial: core: make sure RS485 cannot be enabled when it is not supported
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (371 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 372/583] serial: core: fix sanitizing check for RTS settings Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 374/583] serial: 8250_bcm2835aux: Restore clock error handling Greg Kroah-Hartman
                   ` (216 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Shawn Guo, Sascha Hauer,
	Ilpo Järvinen, Lino Sanfilippo

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Lino Sanfilippo <l.sanfilippo@kunbus.com>

commit c73986913fa47e71e0b1ad7f039f6444915e8810 upstream.

Some uart drivers specify a rs485_config() function and then decide later
to disable RS485 support for some reason (e.g. imx and ar933).

In these cases userspace may be able to activate RS485 via TIOCSRS485
nevertheless, since in uart_set_rs485_config() an existing rs485_config()
function indicates that RS485 is supported.

Make sure that this is not longer possible by checking the uarts
rs485_supported.flags instead and bailing out if SER_RS485_ENABLED is not
set.

Furthermore instead of returning an empty structure return -ENOTTY if the
RS485 configuration is requested via TIOCGRS485 but RS485 is not supported.
This has a small impact on userspace visibility but it is consistent with
the -ENOTTY error for TIOCGRS485.

Fixes: e849145e1fdd ("serial: ar933x: Fill in rs485_supported")
Fixes: 55e18c6b6d42 ("serial: imx: Remove serial_rs485 sanitization")
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc:  <stable@vger.kernel.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
Link: https://lore.kernel.org/r/20240103061818.564-5-l.sanfilippo@kunbus.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/tty/serial/serial_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1453,7 +1453,7 @@ static int uart_set_rs485_config(struct
 	int ret;
 	unsigned long flags;
 
-	if (!port->rs485_config)
+	if (!(port->rs485_supported.flags & SER_RS485_ENABLED))
 		return -ENOTTY;
 
 	if (copy_from_user(&rs485, rs485_user, sizeof(*rs485_user)))



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 374/583] serial: 8250_bcm2835aux: Restore clock error handling
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (372 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 373/583] serial: core: make sure RS485 cannot be enabled when it is not supported Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 375/583] serial: core, imx: do not set RS485 enabled if it is not supported Greg Kroah-Hartman
                   ` (215 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, stable, Stefan Wahren, Florian Fainelli

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Stefan Wahren <wahrenst@gmx.net>

commit 83e571f054cd742eb9a46d46ef05193904adf53f upstream.

The commit fcc446c8aa63 ("serial: 8250_bcm2835aux: Add ACPI support")
dropped the error handling for clock acquiring. But even an optional
clock needs this.

Fixes: fcc446c8aa63 ("serial: 8250_bcm2835aux: Add ACPI support")
Cc: stable <stable@kernel.org>
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/20231220114334.4712-1-wahrenst@gmx.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/tty/serial/8250/8250_bcm2835aux.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/tty/serial/8250/8250_bcm2835aux.c
+++ b/drivers/tty/serial/8250/8250_bcm2835aux.c
@@ -119,6 +119,8 @@ static int bcm2835aux_serial_probe(struc
 
 	/* get the clock - this also enables the HW */
 	data->clk = devm_clk_get_optional(&pdev->dev, NULL);
+	if (IS_ERR(data->clk))
+		return dev_err_probe(&pdev->dev, PTR_ERR(data->clk), "could not get clk\n");
 
 	/* get the interrupt */
 	ret = platform_get_irq(pdev, 0);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 375/583] serial: core, imx: do not set RS485 enabled if it is not supported
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (373 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 374/583] serial: 8250_bcm2835aux: Restore clock error handling Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 376/583] serial: imx: Ensure that imx_uart_rs485_config() is called with enabled clock Greg Kroah-Hartman
                   ` (214 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Shawn Guo, Sascha Hauer,
	Uwe Kleine-König, Lino Sanfilippo, Ilpo Järvinen

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Lino Sanfilippo <l.sanfilippo@kunbus.com>

commit 74eab89b26ac433ad857292f4707b43c1a8f0209 upstream.

If the imx driver cannot support RS485 it nullifies the ports
rs485_supported structure. But it still calls uart_get_rs485_mode() which
may set the RS485_ENABLED flag nevertheless.

This may lead to an attempt to configure RS485 even if it is not supported
when the flag is evaluated in uart_configure_port() at port startup.

Avoid this by bailing out of uart_get_rs485_mode() if the RS485_ENABLED
flag is not supported by the caller.

With this fix a check for RTS availability is now obsolete in the imx
driver, since it can not evaluate to true any more. So remove this check.

Furthermore the explicit nullifcation of rs485_supported is not needed,
since the memory has already been set to zeros at allocation. So remove
this, too.

Fixes: 00d7a00e2a6f ("serial: imx: Fill in rs485_supported")
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc:  <stable@vger.kernel.org>
Suggested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240103061818.564-6-l.sanfilippo@kunbus.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/tty/serial/imx.c         |    7 -------
 drivers/tty/serial/serial_core.c |    3 +++
 2 files changed, 3 insertions(+), 7 deletions(-)

--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2214,7 +2214,6 @@ static enum hrtimer_restart imx_trigger_
 	return HRTIMER_NORESTART;
 }
 
-static const struct serial_rs485 imx_no_rs485 = {};	/* No RS485 if no RTS */
 static const struct serial_rs485 imx_rs485_supported = {
 	.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND |
 		 SER_RS485_RX_DURING_TX,
@@ -2298,8 +2297,6 @@ static int imx_uart_probe(struct platfor
 	/* RTS is required to control the RS485 transmitter */
 	if (sport->have_rtscts || sport->have_rtsgpio)
 		sport->port.rs485_supported = imx_rs485_supported;
-	else
-		sport->port.rs485_supported = imx_no_rs485;
 	sport->port.flags = UPF_BOOT_AUTOCONF;
 	timer_setup(&sport->timer, imx_uart_timeout, 0);
 
@@ -2336,10 +2333,6 @@ static int imx_uart_probe(struct platfor
 		return ret;
 	}
 
-	if (sport->port.rs485.flags & SER_RS485_ENABLED &&
-	    (!sport->have_rtscts && !sport->have_rtsgpio))
-		dev_err(&pdev->dev, "no RTS control, disabling rs485\n");
-
 	/*
 	 * If using the i.MX UART RTS/CTS control then the RTS (CTS_B)
 	 * signal cannot be set low during transmission in case the
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -3576,6 +3576,9 @@ int uart_get_rs485_mode(struct uart_port
 	int ret;
 	int rx_during_tx_gpio_flag;
 
+	if (!(port->rs485_supported.flags & SER_RS485_ENABLED))
+		return 0;
+
 	ret = device_property_read_u32_array(dev, "rs485-rts-delay",
 					     rs485_delay, 2);
 	if (!ret) {



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 376/583] serial: imx: Ensure that imx_uart_rs485_config() is called with enabled clock
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (374 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 375/583] serial: core, imx: do not set RS485 enabled if it is not supported Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 377/583] serial: 8250_exar: Set missing rs485_supported flag Greg Kroah-Hartman
                   ` (213 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, stable, Christoph Niedermaier, Lukas Wunner

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christoph Niedermaier <cniedermaier@dh-electronics.com>

commit 7c45eaa813476bd195ac1227a64b52f9cf2e2030 upstream.

There are register accesses in the function imx_uart_rs485_config(). The
clock must be enabled for these accesses. This was ensured by calling it
via the function uart_rs485_config() in the probe() function within the
range where the clock is enabled. With the commit 7c7f9bc986e6 ("serial:
Deassert Transmit Enable on probe in driver-specific way") it was removed
from the probe() function and is now only called through the function
uart_add_one_port() which is located at the end of the probe() function.
But the clock is already switched off in this area. To ensure that the
clock is enabled during register access, move the disabling of the clock
to the very end of the probe() function. To avoid leaking enabled clocks
on error also add an error path for exiting with disabling the clock.

Fixes: 7c7f9bc986e6 ("serial: Deassert Transmit Enable on probe in driver-specific way")
Cc: stable <stable@kernel.org>
Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Link: https://lore.kernel.org/r/20231226113647.39376-1-cniedermaier@dh-electronics.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/tty/serial/imx.c |   23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2328,10 +2328,8 @@ static int imx_uart_probe(struct platfor
 	}
 
 	ret = uart_get_rs485_mode(&sport->port);
-	if (ret) {
-		clk_disable_unprepare(sport->clk_ipg);
-		return ret;
-	}
+	if (ret)
+		goto err_clk;
 
 	/*
 	 * If using the i.MX UART RTS/CTS control then the RTS (CTS_B)
@@ -2411,8 +2409,6 @@ static int imx_uart_probe(struct platfor
 		imx_uart_writel(sport, ucr3, UCR3);
 	}
 
-	clk_disable_unprepare(sport->clk_ipg);
-
 	hrtimer_init(&sport->trigger_start_tx, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 	hrtimer_init(&sport->trigger_stop_tx, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 	sport->trigger_start_tx.function = imx_trigger_start_tx;
@@ -2428,7 +2424,7 @@ static int imx_uart_probe(struct platfor
 		if (ret) {
 			dev_err(&pdev->dev, "failed to request rx irq: %d\n",
 				ret);
-			return ret;
+			goto err_clk;
 		}
 
 		ret = devm_request_irq(&pdev->dev, txirq, imx_uart_txint, 0,
@@ -2436,7 +2432,7 @@ static int imx_uart_probe(struct platfor
 		if (ret) {
 			dev_err(&pdev->dev, "failed to request tx irq: %d\n",
 				ret);
-			return ret;
+			goto err_clk;
 		}
 
 		ret = devm_request_irq(&pdev->dev, rtsirq, imx_uart_rtsint, 0,
@@ -2444,14 +2440,14 @@ static int imx_uart_probe(struct platfor
 		if (ret) {
 			dev_err(&pdev->dev, "failed to request rts irq: %d\n",
 				ret);
-			return ret;
+			goto err_clk;
 		}
 	} else {
 		ret = devm_request_irq(&pdev->dev, rxirq, imx_uart_int, 0,
 				       dev_name(&pdev->dev), sport);
 		if (ret) {
 			dev_err(&pdev->dev, "failed to request irq: %d\n", ret);
-			return ret;
+			goto err_clk;
 		}
 	}
 
@@ -2459,7 +2455,12 @@ static int imx_uart_probe(struct platfor
 
 	platform_set_drvdata(pdev, sport);
 
-	return uart_add_one_port(&imx_uart_uart_driver, &sport->port);
+	ret = uart_add_one_port(&imx_uart_uart_driver, &sport->port);
+
+err_clk:
+	clk_disable_unprepare(sport->clk_ipg);
+
+	return ret;
 }
 
 static int imx_uart_remove(struct platform_device *pdev)



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 377/583] serial: 8250_exar: Set missing rs485_supported flag
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (375 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 376/583] serial: imx: Ensure that imx_uart_rs485_config() is called with enabled clock Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 378/583] serial: omap: do not override settings for RS485 support Greg Kroah-Hartman
                   ` (212 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Ilpo Järvinen, Lino Sanfilippo

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Lino Sanfilippo <l.sanfilippo@kunbus.com>

commit 0c2a5f471ce58bca8f8ab5fcb911aff91eaaa5eb upstream.

The UART supports an auto-RTS mode in which the RTS pin is automatically
activated during transmission. So mark this mode as being supported even
if RTS is not controlled by the driver but the UART.

Also the serial core expects now at least one of both modes rts-on-send or
rts-after-send to be supported. This is since during sanitization
unsupported flags are deleted from a RS485 configuration set by userspace.
However if the configuration ends up with both flags unset, the core prints
a warning since it considers such a configuration invalid (see
uart_sanitize_serial_rs485()).

Cc:  <stable@vger.kernel.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
Link: https://lore.kernel.org/r/20240103061818.564-8-l.sanfilippo@kunbus.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/tty/serial/8250/8250_exar.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/tty/serial/8250/8250_exar.c
+++ b/drivers/tty/serial/8250/8250_exar.c
@@ -446,7 +446,7 @@ static int generic_rs485_config(struct u
 }
 
 static const struct serial_rs485 generic_rs485_supported = {
-	.flags = SER_RS485_ENABLED,
+	.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND,
 };
 
 static const struct exar8250_platform exar8250_default_platform = {
@@ -490,7 +490,8 @@ static int iot2040_rs485_config(struct u
 }
 
 static const struct serial_rs485 iot2040_rs485_supported = {
-	.flags = SER_RS485_ENABLED | SER_RS485_RX_DURING_TX | SER_RS485_TERMINATE_BUS,
+	.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND |
+		 SER_RS485_RX_DURING_TX | SER_RS485_TERMINATE_BUS,
 };
 
 static const struct property_entry iot2040_gpio_properties[] = {



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 378/583] serial: omap: do not override settings for RS485 support
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (376 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 377/583] serial: 8250_exar: Set missing rs485_supported flag Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 379/583] ALSA: oxygen: Fix right channel of capture volume mixer Greg Kroah-Hartman
                   ` (211 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Lino Sanfilippo, Ilpo Järvinen

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Lino Sanfilippo <l.sanfilippo@kunbus.com>

commit 51f93776b84dee23e44a7be880736669a01cec2b upstream.

The drivers RS485 support is deactivated if there is no RTS GPIO available.
This is done by nullifying the ports rs485_supported struct. After that
however the settings in serial_omap_rs485_supported are assigned to the
same structure unconditionally, which results in an unintended reactivation
of RS485 support.

Fix this by moving the assignment to the beginning of
serial_omap_probe_rs485() and thus before uart_get_rs485_mode() gets
called.

Also replace the assignment of rs485_config() to have the complete RS485
setup in one function.

Fixes: e2752ae3cfc9 ("serial: omap: Disallow RS-485 if rts-gpio is not specified")
Cc:  <stable@vger.kernel.org>
Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240103061818.564-7-l.sanfilippo@kunbus.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/tty/serial/omap-serial.c |   27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1483,6 +1483,13 @@ static struct omap_uart_port_info *of_ge
 	return omap_up_info;
 }
 
+static const struct serial_rs485 serial_omap_rs485_supported = {
+	.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND |
+		 SER_RS485_RX_DURING_TX,
+	.delay_rts_before_send = 1,
+	.delay_rts_after_send = 1,
+};
+
 static int serial_omap_probe_rs485(struct uart_omap_port *up,
 				   struct device *dev)
 {
@@ -1497,6 +1504,9 @@ static int serial_omap_probe_rs485(struc
 	if (!np)
 		return 0;
 
+	up->port.rs485_config = serial_omap_config_rs485;
+	up->port.rs485_supported = serial_omap_rs485_supported;
+
 	ret = uart_get_rs485_mode(&up->port);
 	if (ret)
 		return ret;
@@ -1531,13 +1541,6 @@ static int serial_omap_probe_rs485(struc
 	return 0;
 }
 
-static const struct serial_rs485 serial_omap_rs485_supported = {
-	.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND |
-		 SER_RS485_RX_DURING_TX,
-	.delay_rts_before_send = 1,
-	.delay_rts_after_send = 1,
-};
-
 static int serial_omap_probe(struct platform_device *pdev)
 {
 	struct omap_uart_port_info *omap_up_info = dev_get_platdata(&pdev->dev);
@@ -1604,17 +1607,11 @@ static int serial_omap_probe(struct plat
 		dev_info(up->port.dev, "no wakeirq for uart%d\n",
 			 up->port.line);
 
-	ret = serial_omap_probe_rs485(up, &pdev->dev);
-	if (ret < 0)
-		goto err_rs485;
-
 	sprintf(up->name, "OMAP UART%d", up->port.line);
 	up->port.mapbase = mem->start;
 	up->port.membase = base;
 	up->port.flags = omap_up_info->flags;
 	up->port.uartclk = omap_up_info->uartclk;
-	up->port.rs485_config = serial_omap_config_rs485;
-	up->port.rs485_supported = serial_omap_rs485_supported;
 	if (!up->port.uartclk) {
 		up->port.uartclk = DEFAULT_CLK_SPEED;
 		dev_warn(&pdev->dev,
@@ -1622,6 +1619,10 @@ static int serial_omap_probe(struct plat
 			 DEFAULT_CLK_SPEED);
 	}
 
+	ret = serial_omap_probe_rs485(up, &pdev->dev);
+	if (ret < 0)
+		goto err_rs485;
+
 	up->latency = PM_QOS_CPU_LATENCY_DEFAULT_VALUE;
 	up->calc_latency = PM_QOS_CPU_LATENCY_DEFAULT_VALUE;
 	cpu_latency_qos_add_request(&up->pm_qos_request, up->latency);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 379/583] ALSA: oxygen: Fix right channel of capture volume mixer
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (377 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 378/583] serial: omap: do not override settings for RS485 support Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 380/583] ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq2xxx Greg Kroah-Hartman
                   ` (210 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Takashi Iwai

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Takashi Iwai <tiwai@suse.de>

commit a03cfad512ac24a35184d7d87ec0d5489e1cb763 upstream.

There was a typo in oxygen mixer code that didn't update the right
channel value properly for the capture volume.  Let's fix it.

This trivial fix was originally reported on Bugzilla.

Fixes: a3601560496d ("[ALSA] oxygen: add front panel controls")
Cc: <stable@vger.kernel.org>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=156561
Link: https://lore.kernel.org/r/20240112111023.6208-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 sound/pci/oxygen/oxygen_mixer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/pci/oxygen/oxygen_mixer.c
+++ b/sound/pci/oxygen/oxygen_mixer.c
@@ -718,7 +718,7 @@ static int ac97_fp_rec_volume_put(struct
 	oldreg = oxygen_read_ac97(chip, 1, AC97_REC_GAIN);
 	newreg = oldreg & ~0x0707;
 	newreg = newreg | (value->value.integer.value[0] & 7);
-	newreg = newreg | ((value->value.integer.value[0] & 7) << 8);
+	newreg = newreg | ((value->value.integer.value[1] & 7) << 8);
 	change = newreg != oldreg;
 	if (change)
 		oxygen_write_ac97(chip, 1, AC97_REC_GAIN, newreg);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 380/583] ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq2xxx
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (378 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 379/583] ALSA: oxygen: Fix right channel of capture volume mixer Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 381/583] ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on HP ZBook Greg Kroah-Hartman
                   ` (209 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Çağhan Demir, Takashi Iwai

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Çağhan Demir <caghandemir@marun.edu.tr>

commit bc7863d18677df66b2c7a0e172c91296ff380f11 upstream.

This HP Laptop uses ALC236 codec with COEF 0x07 idx 1 controlling
the mute LED. This patch enables the already existing quirk for
this device.

Signed-off-by: Çağhan Demir <caghandemir@marun.edu.tr>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20240115172303.4718-1-caghandemir@marun.edu.tr
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 sound/pci/hda/patch_realtek.c |    1 +
 1 file changed, 1 insertion(+)

--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -9754,6 +9754,7 @@ static const struct snd_pci_quirk alc269
 	SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
 	SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
+	SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
 	SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 381/583] ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on HP ZBook
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (379 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 380/583] ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq2xxx Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 382/583] ALSA: hda/realtek: Enable headset mic on Lenovo M70 Gen5 Greg Kroah-Hartman
                   ` (208 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Yo-Jung Lin, Takashi Iwai

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yo-Jung Lin <leo.lin@canonical.com>

commit b018cee7369896c7a15bfdbe88f168f3dbd8ba27 upstream.

On some HP ZBooks, the audio LEDs can be enabled by
ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF. So use it accordingly.

Signed-off-by: Yo-Jung Lin <leo.lin@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20240116020722.27236-1-leo.lin@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 sound/pci/hda/patch_realtek.c |    1 +
 1 file changed, 1 insertion(+)

--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -9849,6 +9849,7 @@ static const struct snd_pci_quirk alc269
 	SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
+	SND_PCI_QUIRK(0x103c, 0x8c97, "HP ZBook", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
 	SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 382/583] ALSA: hda/realtek: Enable headset mic on Lenovo M70 Gen5
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (380 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 381/583] ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on HP ZBook Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 383/583] ksmbd: validate mech token in session setup Greg Kroah-Hartman
                   ` (207 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Bin Li, Takashi Iwai

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bin Li <bin.li@canonical.com>

commit fb3c007fde80d9d3b4207943e74c150c9116cead upstream.

Lenovo M70 Gen5 is equipped with ALC623, and it needs
ALC283_FIXUP_HEADSET_MIC quirk to make its headset mic work.

Signed-off-by: Bin Li <bin.li@canonical.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20240117154123.21578-1-bin.li@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 sound/pci/hda/patch_realtek.c |    1 +
 1 file changed, 1 insertion(+)

--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -10116,6 +10116,7 @@ static const struct snd_pci_quirk alc269
 	SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
 	SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
 	SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
+	SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC),
 	SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
 	SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
 	SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 383/583] ksmbd: validate mech token in session setup
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (381 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 382/583] ALSA: hda/realtek: Enable headset mic on Lenovo M70 Gen5 Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 384/583] ksmbd: fix UAF issue in ksmbd_tcp_new_connection() Greg Kroah-Hartman
                   ` (206 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Namjae Jeon, Steve French, zdi-disclosures

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Namjae Jeon <linkinjeon@kernel.org>

commit 92e470163d96df8db6c4fa0f484e4a229edb903d upstream.

If client send invalid mech token in session setup request, ksmbd
validate and make the error if it is invalid.

Cc: stable@vger.kernel.org
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-22890
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/smb/server/asn1.c       |    5 +++++
 fs/smb/server/connection.h |    1 +
 fs/smb/server/smb2pdu.c    |   22 +++++++++++++++++-----
 3 files changed, 23 insertions(+), 5 deletions(-)

--- a/fs/smb/server/asn1.c
+++ b/fs/smb/server/asn1.c
@@ -214,10 +214,15 @@ static int ksmbd_neg_token_alloc(void *c
 {
 	struct ksmbd_conn *conn = context;
 
+	if (!vlen)
+		return -EINVAL;
+
 	conn->mechToken = kmemdup_nul(value, vlen, GFP_KERNEL);
 	if (!conn->mechToken)
 		return -ENOMEM;
 
+	conn->mechTokenLen = (unsigned int)vlen;
+
 	return 0;
 }
 
--- a/fs/smb/server/connection.h
+++ b/fs/smb/server/connection.h
@@ -88,6 +88,7 @@ struct ksmbd_conn {
 	__u16				dialect;
 
 	char				*mechToken;
+	unsigned int			mechTokenLen;
 
 	struct ksmbd_conn_ops	*conn_ops;
 
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -1414,7 +1414,10 @@ static struct ksmbd_user *session_user(s
 	char *name;
 	unsigned int name_off, name_len, secbuf_len;
 
-	secbuf_len = le16_to_cpu(req->SecurityBufferLength);
+	if (conn->use_spnego && conn->mechToken)
+		secbuf_len = conn->mechTokenLen;
+	else
+		secbuf_len = le16_to_cpu(req->SecurityBufferLength);
 	if (secbuf_len < sizeof(struct authenticate_message)) {
 		ksmbd_debug(SMB, "blob len %d too small\n", secbuf_len);
 		return NULL;
@@ -1505,7 +1508,10 @@ static int ntlm_authenticate(struct ksmb
 		struct authenticate_message *authblob;
 
 		authblob = user_authblob(conn, req);
-		sz = le16_to_cpu(req->SecurityBufferLength);
+		if (conn->use_spnego && conn->mechToken)
+			sz = conn->mechTokenLen;
+		else
+			sz = le16_to_cpu(req->SecurityBufferLength);
 		rc = ksmbd_decode_ntlmssp_auth_blob(authblob, sz, conn, sess);
 		if (rc) {
 			set_user_flag(sess->user, KSMBD_USER_FLAG_BAD_PASSWORD);
@@ -1778,8 +1784,7 @@ int smb2_sess_setup(struct ksmbd_work *w
 
 	negblob_off = le16_to_cpu(req->SecurityBufferOffset);
 	negblob_len = le16_to_cpu(req->SecurityBufferLength);
-	if (negblob_off < offsetof(struct smb2_sess_setup_req, Buffer) ||
-	    negblob_len < offsetof(struct negotiate_message, NegotiateFlags)) {
+	if (negblob_off < offsetof(struct smb2_sess_setup_req, Buffer)) {
 		rc = -EINVAL;
 		goto out_err;
 	}
@@ -1788,8 +1793,15 @@ int smb2_sess_setup(struct ksmbd_work *w
 			negblob_off);
 
 	if (decode_negotiation_token(conn, negblob, negblob_len) == 0) {
-		if (conn->mechToken)
+		if (conn->mechToken) {
 			negblob = (struct negotiate_message *)conn->mechToken;
+			negblob_len = conn->mechTokenLen;
+		}
+	}
+
+	if (negblob_len < offsetof(struct negotiate_message, NegotiateFlags)) {
+		rc = -EINVAL;
+		goto out_err;
 	}
 
 	if (server_conf.auth_mechs & conn->auth_mechs) {



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 384/583] ksmbd: fix UAF issue in ksmbd_tcp_new_connection()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (382 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 383/583] ksmbd: validate mech token in session setup Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 385/583] ksmbd: only v2 leases handle the directory Greg Kroah-Hartman
                   ` (205 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Namjae Jeon, Steve French, zdi-disclosures

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Namjae Jeon <linkinjeon@kernel.org>

commit 38d20c62903d669693a1869aa68c4dd5674e2544 upstream.

The race is between the handling of a new TCP connection and
its disconnection. It leads to UAF on `struct tcp_transport` in
ksmbd_tcp_new_connection() function.

Cc: stable@vger.kernel.org
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-22991
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/smb/server/connection.c     |    6 ------
 fs/smb/server/connection.h     |    1 -
 fs/smb/server/transport_rdma.c |   11 ++++++-----
 fs/smb/server/transport_tcp.c  |   13 +++++++------
 4 files changed, 13 insertions(+), 18 deletions(-)

--- a/fs/smb/server/connection.c
+++ b/fs/smb/server/connection.c
@@ -415,13 +415,7 @@ static void stop_sessions(void)
 again:
 	down_read(&conn_list_lock);
 	list_for_each_entry(conn, &conn_list, conns_list) {
-		struct task_struct *task;
-
 		t = conn->transport;
-		task = t->handler;
-		if (task)
-			ksmbd_debug(CONN, "Stop session handler %s/%d\n",
-				    task->comm, task_pid_nr(task));
 		ksmbd_conn_set_exiting(conn);
 		if (t->ops->shutdown) {
 			up_read(&conn_list_lock);
--- a/fs/smb/server/connection.h
+++ b/fs/smb/server/connection.h
@@ -135,7 +135,6 @@ struct ksmbd_transport_ops {
 struct ksmbd_transport {
 	struct ksmbd_conn		*conn;
 	struct ksmbd_transport_ops	*ops;
-	struct task_struct		*handler;
 };
 
 #define KSMBD_TCP_RECV_TIMEOUT	(7 * HZ)
--- a/fs/smb/server/transport_rdma.c
+++ b/fs/smb/server/transport_rdma.c
@@ -2039,6 +2039,7 @@ static bool rdma_frwr_is_supported(struc
 static int smb_direct_handle_connect_request(struct rdma_cm_id *new_cm_id)
 {
 	struct smb_direct_transport *t;
+	struct task_struct *handler;
 	int ret;
 
 	if (!rdma_frwr_is_supported(&new_cm_id->device->attrs)) {
@@ -2056,11 +2057,11 @@ static int smb_direct_handle_connect_req
 	if (ret)
 		goto out_err;
 
-	KSMBD_TRANS(t)->handler = kthread_run(ksmbd_conn_handler_loop,
-					      KSMBD_TRANS(t)->conn, "ksmbd:r%u",
-					      smb_direct_port);
-	if (IS_ERR(KSMBD_TRANS(t)->handler)) {
-		ret = PTR_ERR(KSMBD_TRANS(t)->handler);
+	handler = kthread_run(ksmbd_conn_handler_loop,
+			      KSMBD_TRANS(t)->conn, "ksmbd:r%u",
+			      smb_direct_port);
+	if (IS_ERR(handler)) {
+		ret = PTR_ERR(handler);
 		pr_err("Can't start thread\n");
 		goto out_err;
 	}
--- a/fs/smb/server/transport_tcp.c
+++ b/fs/smb/server/transport_tcp.c
@@ -185,6 +185,7 @@ static int ksmbd_tcp_new_connection(stru
 	struct sockaddr *csin;
 	int rc = 0;
 	struct tcp_transport *t;
+	struct task_struct *handler;
 
 	t = alloc_transport(client_sk);
 	if (!t) {
@@ -199,13 +200,13 @@ static int ksmbd_tcp_new_connection(stru
 		goto out_error;
 	}
 
-	KSMBD_TRANS(t)->handler = kthread_run(ksmbd_conn_handler_loop,
-					      KSMBD_TRANS(t)->conn,
-					      "ksmbd:%u",
-					      ksmbd_tcp_get_port(csin));
-	if (IS_ERR(KSMBD_TRANS(t)->handler)) {
+	handler = kthread_run(ksmbd_conn_handler_loop,
+			      KSMBD_TRANS(t)->conn,
+			      "ksmbd:%u",
+			      ksmbd_tcp_get_port(csin));
+	if (IS_ERR(handler)) {
 		pr_err("cannot start conn thread\n");
-		rc = PTR_ERR(KSMBD_TRANS(t)->handler);
+		rc = PTR_ERR(handler);
 		free_transport(t);
 	}
 	return rc;



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 385/583] ksmbd: only v2 leases handle the directory
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (383 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 384/583] ksmbd: fix UAF issue in ksmbd_tcp_new_connection() Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 386/583] ceph: select FS_ENCRYPTION_ALGS if FS_ENCRYPTION Greg Kroah-Hartman
                   ` (204 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Namjae Jeon, Steve French

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Namjae Jeon <linkinjeon@kernel.org>

commit 77bebd186442a7d703b796784db7495129cc3e70 upstream.

When smb2 leases is disable, ksmbd can send oplock break notification
and cause wait oplock break ack timeout. It may appear like hang when
accessing a directory. This patch make only v2 leases handle the
directory.

Cc: stable@vger.kernel.org
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/smb/server/oplock.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/fs/smb/server/oplock.c
+++ b/fs/smb/server/oplock.c
@@ -1191,6 +1191,12 @@ int smb_grant_oplock(struct ksmbd_work *
 	bool prev_op_has_lease;
 	__le32 prev_op_state = 0;
 
+	/* Only v2 leases handle the directory */
+	if (S_ISDIR(file_inode(fp->filp)->i_mode)) {
+		if (!lctx || lctx->version != 2)
+			return 0;
+	}
+
 	opinfo = alloc_opinfo(work, pid, tid);
 	if (!opinfo)
 		return -ENOMEM;



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 386/583] ceph: select FS_ENCRYPTION_ALGS if FS_ENCRYPTION
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (384 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 385/583] ksmbd: only v2 leases handle the directory Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 387/583] LoongArch: Fix and simplify fcsr initialization on execve() Greg Kroah-Hartman
                   ` (203 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Eric Biggers, Xiubo Li, Ilya Dryomov

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Biggers <ebiggers@google.com>

commit 9c896d6bc3dfef86659a6a1fb25ccdea5dbef6a3 upstream.

The kconfig options for filesystems that support FS_ENCRYPTION are
supposed to select FS_ENCRYPTION_ALGS.  This is needed to ensure that
required crypto algorithms get enabled as loadable modules or builtin as
is appropriate for the set of enabled filesystems.  Do this for CEPH_FS
so that there aren't any missing algorithms if someone happens to have
CEPH_FS as their only enabled filesystem that supports encryption.

Cc: stable@vger.kernel.org
Fixes: f061feda6c54 ("ceph: add fscrypt ioctls and ceph.fscrypt.auth vxattr")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/ceph/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ceph/Kconfig b/fs/ceph/Kconfig
index 94df854147d3..7249d70e1a43 100644
--- a/fs/ceph/Kconfig
+++ b/fs/ceph/Kconfig
@@ -7,6 +7,7 @@ config CEPH_FS
 	select CRYPTO_AES
 	select CRYPTO
 	select NETFS_SUPPORT
+	select FS_ENCRYPTION_ALGS if FS_ENCRYPTION
 	default n
 	help
 	  Choose Y or M here to include support for mounting the
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 387/583] LoongArch: Fix and simplify fcsr initialization on execve()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (385 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 386/583] ceph: select FS_ENCRYPTION_ALGS if FS_ENCRYPTION Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 388/583] io_uring: dont check iopoll if request completes Greg Kroah-Hartman
                   ` (202 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Xi Ruoyao, Huacai Chen

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Xi Ruoyao <xry111@xry111.site>

commit c2396651309eba291c15e32db8fbe44c738b5921 upstream.

There has been a lingering bug in LoongArch Linux systems causing some
GCC tests to intermittently fail (see Closes link).  I've made a minimal
reproducer:

    zsh% cat measure.s
    .align 4
    .globl _start
    _start:
        movfcsr2gr  $a0, $fcsr0
        bstrpick.w  $a0, $a0, 16, 16
        beqz        $a0, .ok
        break       0
    .ok:
        li.w        $a7, 93
        syscall     0
    zsh% cc mesaure.s -o measure -nostdlib
    zsh% echo $((1.0/3))
    0.33333333333333331
    zsh% while ./measure; do ; done

This while loop should not stop as POSIX is clear that execve must set
fenv to the default, where FCSR should be zero.  But in fact it will
just stop after running for a while (normally less than 30 seconds).
Note that "$((1.0/3))" is needed to reproduce this issue because it
raises FE_INVALID and makes fcsr0 non-zero.

The problem is we are currently relying on SET_PERSONALITY2() to reset
current->thread.fpu.fcsr.  But SET_PERSONALITY2() is executed before
start_thread which calls lose_fpu(0).  We can see if kernel preempt is
enabled, we may switch to another thread after SET_PERSONALITY2() but
before lose_fpu(0).  Then bad thing happens: during the thread switch
the value of the fcsr0 register is stored into current->thread.fpu.fcsr,
making it dirty again.

The issue can be fixed by setting current->thread.fpu.fcsr after
lose_fpu(0) because lose_fpu() clears TIF_USEDFPU, then the thread
switch won't touch current->thread.fpu.fcsr.

The only other architecture setting FCSR in SET_PERSONALITY2() is MIPS.
I've ran a similar test on MIPS with mainline kernel and it turns out
MIPS is buggy, too.  Anyway MIPS do this for supporting different FP
flavors (NaN encodings, etc.) which do not exist on LoongArch.  So for
LoongArch, we can simply remove the current->thread.fpu.fcsr setting
from SET_PERSONALITY2() and do it in start_thread(), after lose_fpu(0).

The while loop failing with the mainline kernel has survived one hour
after this change on LoongArch.

Fixes: 803b0fc5c3f2baa ("LoongArch: Add process management")
Closes: https://github.com/loongson-community/discussions/issues/7
Link: https://lore.kernel.org/linux-mips/7a6aa1bbdbbe2e63ae96ff163fab0349f58f1b9e.camel@xry111.site/
Cc: stable@vger.kernel.org
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/loongarch/include/asm/elf.h |    5 -----
 arch/loongarch/kernel/elf.c      |    5 -----
 arch/loongarch/kernel/process.c  |    1 +
 3 files changed, 1 insertion(+), 10 deletions(-)

--- a/arch/loongarch/include/asm/elf.h
+++ b/arch/loongarch/include/asm/elf.h
@@ -241,8 +241,6 @@ void loongarch_dump_regs64(u64 *uregs, c
 do {									\
 	current->thread.vdso = &vdso_info;				\
 									\
-	loongarch_set_personality_fcsr(state);				\
-									\
 	if (personality(current->personality) != PER_LINUX)		\
 		set_personality(PER_LINUX);				\
 } while (0)
@@ -259,7 +257,6 @@ do {									\
 	clear_thread_flag(TIF_32BIT_ADDR);				\
 									\
 	current->thread.vdso = &vdso_info;				\
-	loongarch_set_personality_fcsr(state);				\
 									\
 	p = personality(current->personality);				\
 	if (p != PER_LINUX32 && p != PER_LINUX)				\
@@ -340,6 +337,4 @@ extern int arch_elf_pt_proc(void *ehdr,
 extern int arch_check_elf(void *ehdr, bool has_interpreter, void *interp_ehdr,
 			  struct arch_elf_state *state);
 
-extern void loongarch_set_personality_fcsr(struct arch_elf_state *state);
-
 #endif /* _ASM_ELF_H */
--- a/arch/loongarch/kernel/elf.c
+++ b/arch/loongarch/kernel/elf.c
@@ -23,8 +23,3 @@ int arch_check_elf(void *_ehdr, bool has
 {
 	return 0;
 }
-
-void loongarch_set_personality_fcsr(struct arch_elf_state *state)
-{
-	current->thread.fpu.fcsr = boot_cpu_data.fpu_csr0;
-}
--- a/arch/loongarch/kernel/process.c
+++ b/arch/loongarch/kernel/process.c
@@ -85,6 +85,7 @@ void start_thread(struct pt_regs *regs,
 	regs->csr_euen = euen;
 	lose_fpu(0);
 	lose_lbt(0);
+	current->thread.fpu.fcsr = boot_cpu_data.fpu_csr0;
 
 	clear_thread_flag(TIF_LSX_CTX_LIVE);
 	clear_thread_flag(TIF_LASX_CTX_LIVE);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 388/583] io_uring: dont check iopoll if request completes
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (386 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 387/583] LoongArch: Fix and simplify fcsr initialization on execve() Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 389/583] io_uring/rw: ensure io->bytes_done is always initialized Greg Kroah-Hartman
                   ` (201 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Pavel Begunkov, Jens Axboe

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pavel Begunkov <asml.silence@gmail.com>

commit 9b43ef3d52532a0175ed6654618f7db61d390d2e upstream.

IOPOLL request should never return IOU_OK, so the following iopoll
queueing check in io_issue_sqe() after getting IOU_OK doesn't make any
sense as would never turn true. Let's optimise on that and return a bit
earlier. It's also much more resilient to potential bugs from
mischieving iopoll implementations.

Cc:  <stable@vger.kernel.org>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/2f8690e2fa5213a2ff292fac29a7143c036cdd60.1701390926.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 io_uring/io_uring.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1891,7 +1891,11 @@ static int io_issue_sqe(struct io_kiocb
 			io_req_complete_defer(req);
 		else
 			io_req_complete_post(req, issue_flags);
-	} else if (ret != IOU_ISSUE_SKIP_COMPLETE)
+
+		return 0;
+	}
+
+	if (ret != IOU_ISSUE_SKIP_COMPLETE)
 		return ret;
 
 	/* If the op doesn't have a file, we're not polling for it */



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 389/583] io_uring/rw: ensure io->bytes_done is always initialized
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (387 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 388/583] io_uring: dont check iopoll if request completes Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 390/583] io_uring: ensure local task_work is run on wait timeout Greg Kroah-Hartman
                   ` (200 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, xingwei lee, Jens Axboe

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jens Axboe <axboe@kernel.dk>

commit 0a535eddbe0dc1de4386046ab849f08aeb2f8faf upstream.

If IOSQE_ASYNC is set and we fail importing an iovec for a readv or
writev request, then we leave ->bytes_done uninitialized and hence the
eventual failure CQE posted can potentially have a random res value
rather than the expected -EINVAL.

Setup ->bytes_done before potentially failing, so we have a consistent
value if we fail the request early.

Cc: stable@vger.kernel.org
Reported-by: xingwei lee <xrivendell7@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 io_uring/rw.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -549,15 +549,19 @@ static inline int io_rw_prep_async(struc
 	struct iovec *iov;
 	int ret;
 
+	iorw->bytes_done = 0;
+	iorw->free_iovec = NULL;
+
 	/* submission path, ->uring_lock should already be taken */
 	ret = io_import_iovec(rw, req, &iov, &iorw->s, 0);
 	if (unlikely(ret < 0))
 		return ret;
 
-	iorw->bytes_done = 0;
-	iorw->free_iovec = iov;
-	if (iov)
+	if (iov) {
+		iorw->free_iovec = iov;
 		req->flags |= REQ_F_NEED_CLEANUP;
+	}
+
 	return 0;
 }
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 390/583] io_uring: ensure local task_work is run on wait timeout
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (388 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 389/583] io_uring/rw: ensure io->bytes_done is always initialized Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 391/583] fbdev/acornfb: Fix name of fb_ops initializer macro Greg Kroah-Hartman
                   ` (199 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Jens Axboe

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jens Axboe <axboe@kernel.dk>

commit 6ff1407e24e6fdfa4a16ba9ba551e3d253a26391 upstream.

A previous commit added an earlier break condition here, which is fine if
we're using non-local task_work as it'll be run on return to userspace.
However, if DEFER_TASKRUN is used, then we could be leaving local
task_work that is ready to process in the ctx list until next time that
we enter the kernel to wait for events.

Move the break condition to _after_ we have run task_work.

Cc: stable@vger.kernel.org
Fixes: 846072f16eed ("io_uring: mimimise io_cqring_wait_schedule")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 io_uring/io_uring.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -2630,8 +2630,6 @@ static int io_cqring_wait(struct io_ring
 		__set_current_state(TASK_RUNNING);
 		atomic_set(&ctx->cq_wait_nr, 0);
 
-		if (ret < 0)
-			break;
 		/*
 		 * Run task_work after scheduling and before io_should_wake().
 		 * If we got woken because of task_work being processed, run it
@@ -2641,6 +2639,18 @@ static int io_cqring_wait(struct io_ring
 		if (!llist_empty(&ctx->work_llist))
 			io_run_local_work(ctx);
 
+		/*
+		 * Non-local task_work will be run on exit to userspace, but
+		 * if we're using DEFER_TASKRUN, then we could have waited
+		 * with a timeout for a number of requests. If the timeout
+		 * hits, we could have some requests ready to process. Ensure
+		 * this break is _after_ we have run task_work, to avoid
+		 * deferring running potentially pending requests until the
+		 * next time we wait for events.
+		 */
+		if (ret < 0)
+			break;
+
 		check_cq = READ_ONCE(ctx->check_cq);
 		if (unlikely(check_cq)) {
 			/* let the caller flush overflows, retry */



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 391/583] fbdev/acornfb: Fix name of fb_ops initializer macro
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (389 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 390/583] io_uring: ensure local task_work is run on wait timeout Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 392/583] fbdev: flush deferred work in fb_deferred_io_fsync() Greg Kroah-Hartman
                   ` (198 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Thomas Zimmermann, Sam Ravnborg,
	Helge Deller, Javier Martinez Canillas, Arnd Bergmann

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Thomas Zimmermann <tzimmermann@suse.de>

commit b48807788e7a2bd93044fe84cfe8ff64b85ec15e upstream.

Fix build by using the correct name for the initializer macro
for struct fb_ops.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 9037afde8b9d ("fbdev/acornfb: Use fbdev I/O helpers")
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: <stable@vger.kernel.org> # v6.6+
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231127131655.4020-2-tzimmermann@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/video/fbdev/acornfb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/video/fbdev/acornfb.c
+++ b/drivers/video/fbdev/acornfb.c
@@ -605,7 +605,7 @@ acornfb_pan_display(struct fb_var_screen
 
 static const struct fb_ops acornfb_ops = {
 	.owner		= THIS_MODULE,
-	FB_IOMEM_DEFAULT_OPS,
+	FB_DEFAULT_IOMEM_OPS,
 	.fb_check_var	= acornfb_check_var,
 	.fb_set_par	= acornfb_set_par,
 	.fb_setcolreg	= acornfb_setcolreg,



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 392/583] fbdev: flush deferred work in fb_deferred_io_fsync()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (390 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 391/583] fbdev/acornfb: Fix name of fb_ops initializer macro Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 393/583] fbdev: flush deferred IO before closing Greg Kroah-Hartman
                   ` (197 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nam Cao, Sebastian Andrzej Siewior,
	Helge Deller

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nam Cao <namcao@linutronix.de>

commit 15e4c1f462279b4e128f27de48133e0debe9e0df upstream.

The driver's fsync() is supposed to flush any pending operation to
hardware. It is implemented in this driver by cancelling the queued
deferred IO first, then schedule it for "immediate execution" by calling
schedule_delayed_work() again with delay=0. However, setting delay=0
only means the work is scheduled immediately, it does not mean the work
is executed immediately. There is no guarantee that the work is finished
after schedule_delayed_work() returns. After this driver's fsync()
returns, there can still be pending work. Furthermore, if close() is
called by users immediately after fsync(), the pending work gets
cancelled and fsync() may do nothing.

To ensure that the deferred IO completes, use flush_delayed_work()
instead. Write operations to this driver either write to the device
directly, or invoke schedule_delayed_work(); so by flushing the
workqueue, it can be guaranteed that all previous writes make it to the
device.

Fixes: 5e841b88d23d ("fb: fsync() method for deferred I/O flush.")
Cc: stable@vger.kernel.org
Signed-off-by: Nam Cao <namcao@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/video/fbdev/core/fb_defio.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

--- a/drivers/video/fbdev/core/fb_defio.c
+++ b/drivers/video/fbdev/core/fb_defio.c
@@ -132,11 +132,7 @@ int fb_deferred_io_fsync(struct file *fi
 		return 0;
 
 	inode_lock(inode);
-	/* Kill off the delayed work */
-	cancel_delayed_work_sync(&info->deferred_work);
-
-	/* Run it immediately */
-	schedule_delayed_work(&info->deferred_work, 0);
+	flush_delayed_work(&info->deferred_work);
 	inode_unlock(inode);
 
 	return 0;



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 393/583] fbdev: flush deferred IO before closing
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (391 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 392/583] fbdev: flush deferred work in fb_deferred_io_fsync() Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 394/583] scsi: ufs: core: Simplify power management during async scan Greg Kroah-Hartman
                   ` (196 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nam Cao, Sebastian Andrzej Siewior,
	Helge Deller

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nam Cao <namcao@linutronix.de>

commit 33cd6ea9c0673517cdb06ad5c915c6f22e9615fc upstream.

When framebuffer gets closed, the queued deferred IO gets cancelled. This
can cause some last display data to vanish. This is problematic for users
who send a still image to the framebuffer, then close the file: the image
may never appear.

To ensure none of display data get lost, flush the queued deferred IO
first before closing.

Another possible solution is to delete the cancel_delayed_work_sync()
instead. The difference is that the display may appear some time after
closing. However, the clearing of page mapping after this needs to be
removed too, because the page mapping is used by the deferred work. It is
not completely obvious whether it is okay to not clear the page mapping.
For a patch intended for stable trees, go with the simple and obvious
solution.

Fixes: 60b59beafba8 ("fbdev: mm: Deferred IO support")
Cc: stable@vger.kernel.org
Signed-off-by: Nam Cao <namcao@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/video/fbdev/core/fb_defio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/video/fbdev/core/fb_defio.c
+++ b/drivers/video/fbdev/core/fb_defio.c
@@ -313,7 +313,7 @@ static void fb_deferred_io_lastclose(str
 	struct page *page;
 	int i;
 
-	cancel_delayed_work_sync(&info->deferred_work);
+	flush_delayed_work(&info->deferred_work);
 
 	/* clear out the mapping that we setup */
 	for (i = 0 ; i < info->fix.smem_len; i += PAGE_SIZE) {



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 394/583] scsi: ufs: core: Simplify power management during async scan
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (392 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 393/583] fbdev: flush deferred IO before closing Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 395/583] scsi: target: core: add missing file_{start,end}_write() Greg Kroah-Hartman
                   ` (195 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Bart Van Assche, Can Guo,
	Manivannan Sadhasivam, Martin K. Petersen

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bart Van Assche <bvanassche@acm.org>

commit daf7795406bf307997366f694888bd317ae5b5fa upstream.

ufshcd_init() calls pm_runtime_get_sync() before it calls
async_schedule(). ufshcd_async_scan() calls pm_runtime_put_sync() directly
or indirectly from ufshcd_add_lus(). Simplify ufshcd_async_scan() by always
calling pm_runtime_put_sync() from ufshcd_async_scan().

Cc: <stable@vger.kernel.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20231218225229.2542156-2-bvanassche@acm.org
Reviewed-by: Can Guo <quic_cang@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/ufs/core/ufshcd.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -8540,7 +8540,6 @@ static int ufshcd_add_lus(struct ufs_hba
 
 	ufs_bsg_probe(hba);
 	scsi_scan_host(hba->host);
-	pm_runtime_put_sync(hba->dev);
 
 out:
 	return ret;
@@ -8808,15 +8807,15 @@ static void ufshcd_async_scan(void *data
 
 	/* Probe and add UFS logical units  */
 	ret = ufshcd_add_lus(hba);
+
 out:
+	pm_runtime_put_sync(hba->dev);
 	/*
 	 * If we failed to initialize the device or the device is not
 	 * present, turn off the power/clocks etc.
 	 */
-	if (ret) {
-		pm_runtime_put_sync(hba->dev);
+	if (ret)
 		ufshcd_hba_exit(hba);
-	}
 }
 
 static enum scsi_timeout_action ufshcd_eh_timed_out(struct scsi_cmnd *scmd)



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 395/583] scsi: target: core: add missing file_{start,end}_write()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (393 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 394/583] scsi: ufs: core: Simplify power management during async scan Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 396/583] scsi: mpi3mr: Refresh sdev queue depth after controller reset Greg Kroah-Hartman
                   ` (194 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Amir Goldstein,
	Martin K. Petersen, Jens Axboe, Christian Brauner

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Amir Goldstein <amir73il@gmail.com>

commit 0db1d53937fafa8bb96e077375691e16902f4899 upstream.

The callers of vfs_iter_write() are required to hold file_start_write().
file_start_write() is a no-op for the S_ISBLK() case, but it is really
needed when the backing file is a regular file.

We are going to move file_{start,end}_write() into vfs_iter_write(), but
we need to fix this first, so that the fix could be backported to stable
kernels.

Suggested-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/ZV8ETIpM+wZa33B5@infradead.org/
Cc:  <stable@vger.kernel.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/r/20231123092000.2665902-1-amir73il@gmail.com
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/target/target_core_file.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -332,11 +332,13 @@ static int fd_do_rw(struct se_cmd *cmd,
 	}
 
 	iov_iter_bvec(&iter, is_write, bvec, sgl_nents, len);
-	if (is_write)
+	if (is_write) {
+		file_start_write(fd);
 		ret = vfs_iter_write(fd, &iter, &pos, 0);
-	else
+		file_end_write(fd);
+	} else {
 		ret = vfs_iter_read(fd, &iter, &pos, 0);
-
+	}
 	if (is_write) {
 		if (ret < 0 || ret != data_length) {
 			pr_err("%s() write returned %d\n", __func__, ret);
@@ -467,7 +469,9 @@ fd_execute_write_same(struct se_cmd *cmd
 	}
 
 	iov_iter_bvec(&iter, ITER_SOURCE, bvec, nolb, len);
+	file_start_write(fd_dev->fd_file);
 	ret = vfs_iter_write(fd_dev->fd_file, &iter, &pos, 0);
+	file_end_write(fd_dev->fd_file);
 
 	kfree(bvec);
 	if (ret < 0 || ret != len) {



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 396/583] scsi: mpi3mr: Refresh sdev queue depth after controller reset
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (394 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 395/583] scsi: target: core: add missing file_{start,end}_write() Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 397/583] scsi: mpi3mr: Clean up block devices post " Greg Kroah-Hartman
                   ` (193 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sathya Prakash, Chandrakanth patil,
	Martin K. Petersen

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chandrakanth patil <chandrakanth.patil@broadcom.com>

commit e5aab848dfdf7996d20ece4d28d2733c732c5e5a upstream.

After a controller reset, the firmware may modify the device queue depth.
Therefore, update the device queue depth accordingly.

Cc: <stable@vger.kernel.org> # v5.15+
Co-developed-by: Sathya Prakash <sathya.prakash@broadcom.com>
Signed-off-by: Sathya Prakash <sathya.prakash@broadcom.com>
Signed-off-by: Chandrakanth patil <chandrakanth.patil@broadcom.com>
Link: https://lore.kernel.org/r/20231126053134.10133-2-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/scsi/mpi3mr/mpi3mr_os.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -1070,8 +1070,14 @@ void mpi3mr_rfresh_tgtdevs(struct mpi3mr
 	tgtdev = NULL;
 	list_for_each_entry(tgtdev, &mrioc->tgtdev_list, list) {
 		if ((tgtdev->dev_handle != MPI3MR_INVALID_DEV_HANDLE) &&
-		    !tgtdev->is_hidden && !tgtdev->host_exposed)
-			mpi3mr_report_tgtdev_to_host(mrioc, tgtdev->perst_id);
+		    !tgtdev->is_hidden) {
+			if (!tgtdev->host_exposed)
+				mpi3mr_report_tgtdev_to_host(mrioc,
+							     tgtdev->perst_id);
+			else if (tgtdev->starget)
+				starget_for_each_device(tgtdev->starget,
+							(void *)tgtdev, mpi3mr_update_sdev);
+	}
 	}
 }
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 397/583] scsi: mpi3mr: Clean up block devices post controller reset
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (395 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 396/583] scsi: mpi3mr: Refresh sdev queue depth after controller reset Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 398/583] scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable State Greg Kroah-Hartman
                   ` (192 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sathya Prakash, Chandrakanth patil,
	Martin K. Petersen

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chandrakanth patil <chandrakanth.patil@broadcom.com>

commit c01d515687e358b22aa8414d6dac60d7defa6eb9 upstream.

After a controller reset, if the firmware changes the state of devices to
"hide", then remove those devices from the OS.

Cc: <stable@vger.kernel.org> # v6.6+
Co-developed-by: Sathya Prakash <sathya.prakash@broadcom.com>
Signed-off-by: Sathya Prakash <sathya.prakash@broadcom.com>
Signed-off-by: Chandrakanth patil <chandrakanth.patil@broadcom.com>
Link: https://lore.kernel.org/r/20231126053134.10133-3-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/scsi/mpi3mr/mpi3mr_os.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 561fe0857bc0..872d4b809d08 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -1047,8 +1047,9 @@ void mpi3mr_rfresh_tgtdevs(struct mpi3mr_ioc *mrioc)
 	list_for_each_entry_safe(tgtdev, tgtdev_next, &mrioc->tgtdev_list,
 	    list) {
 		if ((tgtdev->dev_handle == MPI3MR_INVALID_DEV_HANDLE) &&
-		    tgtdev->host_exposed && tgtdev->starget &&
-		    tgtdev->starget->hostdata) {
+		     tgtdev->is_hidden &&
+		     tgtdev->host_exposed && tgtdev->starget &&
+		     tgtdev->starget->hostdata) {
 			tgt_priv = tgtdev->starget->hostdata;
 			tgt_priv->dev_removed = 1;
 			atomic_set(&tgt_priv->block_io, 0);
@@ -1064,6 +1065,10 @@ void mpi3mr_rfresh_tgtdevs(struct mpi3mr_ioc *mrioc)
 				mpi3mr_remove_tgtdev_from_host(mrioc, tgtdev);
 			mpi3mr_tgtdev_del_from_list(mrioc, tgtdev, true);
 			mpi3mr_tgtdev_put(tgtdev);
+		} else if (tgtdev->is_hidden & tgtdev->host_exposed) {
+			dprint_reset(mrioc, "hiding target device with perst_id(%d)\n",
+				     tgtdev->perst_id);
+			mpi3mr_remove_tgtdev_from_host(mrioc, tgtdev);
 		}
 	}
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 398/583] scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable State
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (396 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 397/583] scsi: mpi3mr: Clean up block devices post " Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 399/583] md: bypass block throttle for superblock update Greg Kroah-Hartman
                   ` (191 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sathya Prakash, Chandrakanth patil,
	Martin K. Petersen

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chandrakanth patil <chandrakanth.patil@broadcom.com>

commit f8fb3f39148e8010479e4b2003ba4728818ec661 upstream.

If a controller reset is underway or the controller is in an unrecoverable
state, the PEL enable management command will be returned as EAGAIN or
EFAULT.

Cc: <stable@vger.kernel.org> # v6.1+
Co-developed-by: Sathya Prakash <sathya.prakash@broadcom.com>
Signed-off-by: Sathya Prakash <sathya.prakash@broadcom.com>
Signed-off-by: Chandrakanth patil <chandrakanth.patil@broadcom.com>
Link: https://lore.kernel.org/r/20231126053134.10133-4-chandrakanth.patil@broadcom.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/scsi/mpi3mr/mpi3mr_app.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

--- a/drivers/scsi/mpi3mr/mpi3mr_app.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
@@ -223,6 +223,22 @@ static long mpi3mr_bsg_pel_enable(struct
 		return rval;
 	}
 
+	if (mrioc->unrecoverable) {
+		dprint_bsg_err(mrioc, "%s: unrecoverable controller\n",
+			       __func__);
+		return -EFAULT;
+	}
+
+	if (mrioc->reset_in_progress) {
+		dprint_bsg_err(mrioc, "%s: reset in progress\n", __func__);
+		return -EAGAIN;
+	}
+
+	if (mrioc->stop_bsgs) {
+		dprint_bsg_err(mrioc, "%s: bsgs are blocked\n", __func__);
+		return -EAGAIN;
+	}
+
 	sg_copy_to_buffer(job->request_payload.sg_list,
 			  job->request_payload.sg_cnt,
 			  &pel_enable, sizeof(pel_enable));



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 399/583] md: bypass block throttle for superblock update
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (397 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 398/583] scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable State Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 400/583] drm/amd: Enable PCIe PME from D3 Greg Kroah-Hartman
                   ` (190 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yu Kuai, Junxiao Bi,
	Logan Gunthorpe, Song Liu

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Junxiao Bi <junxiao.bi@oracle.com>

commit d6e035aad6c09991da1c667fb83419329a3baed8 upstream.

commit 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d")
introduced a hung bug and will be reverted in next patch, since the issue
that commit is fixing is due to md superblock write is throttled by wbt,
to fix it, we can have superblock write bypass block layer throttle.

Fixes: 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d")
Cc: stable@vger.kernel.org # v5.19+
Suggested-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20231108182216.73611-1-junxiao.bi@oracle.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/md/md.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -940,9 +940,10 @@ void md_super_write(struct mddev *mddev,
 		return;
 
 	bio = bio_alloc_bioset(rdev->meta_bdev ? rdev->meta_bdev : rdev->bdev,
-			       1,
-			       REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH | REQ_FUA,
-			       GFP_NOIO, &mddev->sync_set);
+			      1,
+			      REQ_OP_WRITE | REQ_SYNC | REQ_IDLE | REQ_META
+				  | REQ_PREFLUSH | REQ_FUA,
+			      GFP_NOIO, &mddev->sync_set);
 
 	atomic_inc(&rdev->nr_pending);
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 400/583] drm/amd: Enable PCIe PME from D3
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (398 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 399/583] md: bypass block throttle for superblock update Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 401/583] block: add check that partition length needs to be aligned with block size Greg Kroah-Hartman
                   ` (189 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Mario Limonciello, Alex Deucher

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mario Limonciello <mario.limonciello@amd.com>

commit bd1f6a31e7762ebc99b97f3eda5e5ea3708fa792 upstream.

When dGPU is put into BOCO it may be in D3cold but still able send
PME on display hotplug event. For this to work it must be enabled
as wake source from D3.

When runpm is enabled use pci_wake_from_d3() to mark wakeup as
enabled by default.

Cc: stable@vger.kernel.org # 6.1+
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -2197,6 +2197,8 @@ retry_init:
 
 		pci_wake_from_d3(pdev, TRUE);
 
+		pci_wake_from_d3(pdev, TRUE);
+
 		/*
 		 * For runpm implemented via BACO, PMFW will handle the
 		 * timing for BACO in and out:



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 401/583] block: add check that partition length needs to be aligned with block size
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (399 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 400/583] drm/amd: Enable PCIe PME from D3 Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 402/583] block: Remove special-casing of compound pages Greg Kroah-Hartman
                   ` (188 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Min Li, Damien Le Moal,
	Chaitanya Kulkarni, Christoph Hellwig, Jens Axboe

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Min Li <min15.li@samsung.com>

commit 6f64f866aa1ae6975c95d805ed51d7e9433a0016 upstream.

Before calling add partition or resize partition, there is no check
on whether the length is aligned with the logical block size.
If the logical block size of the disk is larger than 512 bytes,
then the partition size maybe not the multiple of the logical block size,
and when the last sector is read, bio_truncate() will adjust the bio size,
resulting in an IO error if the size of the read command is smaller than
the logical block size.If integrity data is supported, this will also
result in a null pointer dereference when calling bio_integrity_free.

Cc:  <stable@vger.kernel.org>
Signed-off-by: Min Li <min15.li@samsung.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230629142517.121241-1-min15.li@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 block/ioctl.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -18,7 +18,7 @@ static int blkpg_do_ioctl(struct block_d
 {
 	struct gendisk *disk = bdev->bd_disk;
 	struct blkpg_partition p;
-	long long start, length;
+	sector_t start, length;
 
 	if (disk->flags & GENHD_FL_NO_PART)
 		return -EINVAL;
@@ -35,14 +35,17 @@ static int blkpg_do_ioctl(struct block_d
 	if (op == BLKPG_DEL_PARTITION)
 		return bdev_del_partition(disk, p.pno);
 
+	if (p.start < 0 || p.length <= 0 || p.start + p.length < 0)
+		return -EINVAL;
+	/* Check that the partition is aligned to the block size */
+	if (!IS_ALIGNED(p.start | p.length, bdev_logical_block_size(bdev)))
+		return -EINVAL;
+
 	start = p.start >> SECTOR_SHIFT;
 	length = p.length >> SECTOR_SHIFT;
 
 	switch (op) {
 	case BLKPG_ADD_PARTITION:
-		/* check if partition is aligned to blocksize */
-		if (p.start & (bdev_logical_block_size(bdev) - 1))
-			return -EINVAL;
 		return bdev_add_partition(disk, p.pno, start, length);
 	case BLKPG_RESIZE_PARTITION:
 		return bdev_resize_partition(disk, p.pno, start, length);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 402/583] block: Remove special-casing of compound pages
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (400 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 401/583] block: add check that partition length needs to be aligned with block size Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 403/583] block: Fix iterating over an empty bio with bio_for_each_folio_all Greg Kroah-Hartman
                   ` (187 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Matthew Wilcox (Oracle), Jens Axboe

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Matthew Wilcox (Oracle) <willy@infradead.org>

commit 1b151e2435fc3a9b10c8946c6aebe9f3e1938c55 upstream.

The special casing was originally added in pre-git history; reproducing
the commit log here:

> commit a318a92567d77
> Author: Andrew Morton <akpm@osdl.org>
> Date:   Sun Sep 21 01:42:22 2003 -0700
>
>     [PATCH] Speed up direct-io hugetlbpage handling
>
>     This patch short-circuits all the direct-io page dirtying logic for
>     higher-order pages.  Without this, we pointlessly bounce BIOs up to
>     keventd all the time.

In the last twenty years, compound pages have become used for more than
just hugetlb.  Rewrite these functions to operate on folios instead
of pages and remove the special case for hugetlbfs; I don't think
it's needed any more (and if it is, we can put it back in as a call
to folio_test_hugetlb()).

This was found by inspection; as far as I can tell, this bug can lead
to pages used as the destination of a direct I/O read not being marked
as dirty.  If those pages are then reclaimed by the MM without being
dirtied for some other reason, they won't be written out.  Then when
they're faulted back in, they will not contain the data they should.
It'll take a pretty unusual setup to produce this problem with several
races all going the wrong way.

This problem predates the folio work; it could for example have been
triggered by mmaping a THP in tmpfs and using that as the target of an
O_DIRECT read.

Fixes: 800d8c63b2e98 ("shmem: add huge pages support")
Cc:  <stable@vger.kernel.org>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 block/bio.c |   46 ++++++++++++++++++++++++----------------------
 1 file changed, 24 insertions(+), 22 deletions(-)

--- a/block/bio.c
+++ b/block/bio.c
@@ -1145,13 +1145,22 @@ EXPORT_SYMBOL(bio_add_folio);
 
 void __bio_release_pages(struct bio *bio, bool mark_dirty)
 {
-	struct bvec_iter_all iter_all;
-	struct bio_vec *bvec;
+	struct folio_iter fi;
 
-	bio_for_each_segment_all(bvec, bio, iter_all) {
-		if (mark_dirty && !PageCompound(bvec->bv_page))
-			set_page_dirty_lock(bvec->bv_page);
-		bio_release_page(bio, bvec->bv_page);
+	bio_for_each_folio_all(fi, bio) {
+		struct page *page;
+		size_t done = 0;
+
+		if (mark_dirty) {
+			folio_lock(fi.folio);
+			folio_mark_dirty(fi.folio);
+			folio_unlock(fi.folio);
+		}
+		page = folio_page(fi.folio, fi.offset / PAGE_SIZE);
+		do {
+			bio_release_page(bio, page++);
+			done += PAGE_SIZE;
+		} while (done < fi.length);
 	}
 }
 EXPORT_SYMBOL_GPL(__bio_release_pages);
@@ -1439,18 +1448,12 @@ EXPORT_SYMBOL(bio_free_pages);
  * bio_set_pages_dirty() and bio_check_pages_dirty() are support functions
  * for performing direct-IO in BIOs.
  *
- * The problem is that we cannot run set_page_dirty() from interrupt context
+ * The problem is that we cannot run folio_mark_dirty() from interrupt context
  * because the required locks are not interrupt-safe.  So what we can do is to
  * mark the pages dirty _before_ performing IO.  And in interrupt context,
  * check that the pages are still dirty.   If so, fine.  If not, redirty them
  * in process context.
  *
- * We special-case compound pages here: normally this means reads into hugetlb
- * pages.  The logic in here doesn't really work right for compound pages
- * because the VM does not uniformly chase down the head page in all cases.
- * But dirtiness of compound pages is pretty meaningless anyway: the VM doesn't
- * handle them at all.  So we skip compound pages here at an early stage.
- *
  * Note that this code is very hard to test under normal circumstances because
  * direct-io pins the pages with get_user_pages().  This makes
  * is_page_cache_freeable return false, and the VM will not clean the pages.
@@ -1466,12 +1469,12 @@ EXPORT_SYMBOL(bio_free_pages);
  */
 void bio_set_pages_dirty(struct bio *bio)
 {
-	struct bio_vec *bvec;
-	struct bvec_iter_all iter_all;
+	struct folio_iter fi;
 
-	bio_for_each_segment_all(bvec, bio, iter_all) {
-		if (!PageCompound(bvec->bv_page))
-			set_page_dirty_lock(bvec->bv_page);
+	bio_for_each_folio_all(fi, bio) {
+		folio_lock(fi.folio);
+		folio_mark_dirty(fi.folio);
+		folio_unlock(fi.folio);
 	}
 }
 EXPORT_SYMBOL_GPL(bio_set_pages_dirty);
@@ -1515,12 +1518,11 @@ static void bio_dirty_fn(struct work_str
 
 void bio_check_pages_dirty(struct bio *bio)
 {
-	struct bio_vec *bvec;
+	struct folio_iter fi;
 	unsigned long flags;
-	struct bvec_iter_all iter_all;
 
-	bio_for_each_segment_all(bvec, bio, iter_all) {
-		if (!PageDirty(bvec->bv_page) && !PageCompound(bvec->bv_page))
+	bio_for_each_folio_all(fi, bio) {
+		if (!folio_test_dirty(fi.folio))
 			goto defer;
 	}
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 403/583] block: Fix iterating over an empty bio with bio_for_each_folio_all
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (401 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 402/583] block: Remove special-casing of compound pages Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 404/583] netfilter: nf_tables: check if catch-all set element is active in next generation Greg Kroah-Hartman
                   ` (186 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, syzbot+8b23309d5788a79d3eea,
	syzbot+004c1e0fced2b4bc3dcc, Matthew Wilcox (Oracle),
	Jens Axboe

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Matthew Wilcox (Oracle) <willy@infradead.org>

commit 7bed6f3d08b7af27b7015da8dc3acf2b9c1f21d7 upstream.

If the bio contains no data, bio_first_folio() calls page_folio() on a
NULL pointer and oopses.  Move the test that we've reached the end of
the bio from bio_next_folio() to bio_first_folio().

Reported-by: syzbot+8b23309d5788a79d3eea@syzkaller.appspotmail.com
Reported-by: syzbot+004c1e0fced2b4bc3dcc@syzkaller.appspotmail.com
Fixes: 640d1930bef4 ("block: Add bio_for_each_folio_all()")
Cc: stable@vger.kernel.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Link: https://lore.kernel.org/r/20240116212959.3413014-1-willy@infradead.org
[axboe: add unlikely() to error case]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/linux/bio.h |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -286,6 +286,11 @@ static inline void bio_first_folio(struc
 {
 	struct bio_vec *bvec = bio_first_bvec_all(bio) + i;
 
+	if (unlikely(i >= bio->bi_vcnt)) {
+		fi->folio = NULL;
+		return;
+	}
+
 	fi->folio = page_folio(bvec->bv_page);
 	fi->offset = bvec->bv_offset +
 			PAGE_SIZE * (bvec->bv_page - &fi->folio->page);
@@ -303,10 +308,8 @@ static inline void bio_next_folio(struct
 		fi->offset = 0;
 		fi->length = min(folio_size(fi->folio), fi->_seg_count);
 		fi->_next = folio_next(fi->folio);
-	} else if (fi->_i + 1 < bio->bi_vcnt) {
-		bio_first_folio(fi, bio, fi->_i + 1);
 	} else {
-		fi->folio = NULL;
+		bio_first_folio(fi, bio, fi->_i + 1);
 	}
 }
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 404/583] netfilter: nf_tables: check if catch-all set element is active in next generation
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (402 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 403/583] block: Fix iterating over an empty bio with bio_for_each_folio_all Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 405/583] pwm: jz4740: Dont use dev_err_probe() in .request() Greg Kroah-Hartman
                   ` (185 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, lonial con, Pablo Neira Ayuso

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pablo Neira Ayuso <pablo@netfilter.org>

commit b1db244ffd041a49ecc9618e8feb6b5c1afcdaa7 upstream.

When deactivating the catch-all set element, check the state in the next
generation that represents this transaction.

This bug uncovered after the recent removal of the element busy mark
a2dd0233cbc4 ("netfilter: nf_tables: remove busy mark and gc batch API").

Fixes: aaa31047a6d2 ("netfilter: nftables: add catch-all set element support")
Cc: stable@vger.kernel.org
Reported-by: lonial con <kongln9170@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/netfilter/nf_tables_api.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -6431,7 +6431,7 @@ static int nft_setelem_catchall_deactiva
 
 	list_for_each_entry(catchall, &set->catchall_list, list) {
 		ext = nft_set_elem_ext(set, catchall->elem);
-		if (!nft_is_active(net, ext))
+		if (!nft_is_active_next(net, ext))
 			continue;
 
 		kfree(elem->priv);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 405/583] pwm: jz4740: Dont use dev_err_probe() in .request()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (403 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 404/583] netfilter: nf_tables: check if catch-all set element is active in next generation Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 406/583] pwm: Fix out-of-bounds access in of_pwm_single_xlate() Greg Kroah-Hartman
                   ` (184 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Krzysztof Kozlowski, Uwe Kleine-König

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

commit 9320fc509b87b4d795fb37112931e2f4f8b5c55f upstream.

dev_err_probe() is only supposed to be used in probe functions. While it
probably doesn't hurt, both the EPROBE_DEFER handling and calling
device_set_deferred_probe_reason() are conceptually wrong in the request
callback. So replace the call by dev_err() and a separate return
statement.

This effectively reverts commit c0bfe9606e03 ("pwm: jz4740: Simplify
with dev_err_probe()").

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240106141302.1253365-2-u.kleine-koenig@pengutronix.de
Fixes: c0bfe9606e03 ("pwm: jz4740: Simplify with dev_err_probe()")
Cc: stable@vger.kernel.org
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/pwm/pwm-jz4740.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- a/drivers/pwm/pwm-jz4740.c
+++ b/drivers/pwm/pwm-jz4740.c
@@ -60,9 +60,10 @@ static int jz4740_pwm_request(struct pwm
 	snprintf(name, sizeof(name), "timer%u", pwm->hwpwm);
 
 	clk = clk_get(chip->dev, name);
-	if (IS_ERR(clk))
-		return dev_err_probe(chip->dev, PTR_ERR(clk),
-				     "Failed to get clock\n");
+	if (IS_ERR(clk)) {
+		dev_err(chip->dev, "error %pe: Failed to get clock\n", clk);
+		return PTR_ERR(clk);
+	}
 
 	err = clk_prepare_enable(clk);
 	if (err < 0) {



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 406/583] pwm: Fix out-of-bounds access in of_pwm_single_xlate()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (404 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 405/583] pwm: jz4740: Dont use dev_err_probe() in .request() Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 407/583] md/raid1: Use blk_opf_t for read and write operations Greg Kroah-Hartman
                   ` (183 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Uwe Kleine-König

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

commit a297d07b9a1e4fb8cda25a4a2363a507d294b7c9 upstream.

With args->args_count == 2 args->args[2] is not defined. Actually the
flags are contained in args->args[1].

Fixes: 3ab7b6ac5d82 ("pwm: Introduce single-PWM of_xlate function")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/243908750d306e018a3d4bf2eb745d53ab50f663.1704835845.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/pwm/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -176,7 +176,7 @@ of_pwm_single_xlate(struct pwm_chip *chi
 	pwm->args.period = args->args[0];
 	pwm->args.polarity = PWM_POLARITY_NORMAL;
 
-	if (args->args_count == 2 && args->args[2] & PWM_POLARITY_INVERTED)
+	if (args->args_count == 2 && args->args[1] & PWM_POLARITY_INVERTED)
 		pwm->args.polarity = PWM_POLARITY_INVERSED;
 
 	return pwm;



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 407/583] md/raid1: Use blk_opf_t for read and write operations
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (405 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 406/583] pwm: Fix out-of-bounds access in of_pwm_single_xlate() Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 408/583] rootfs: Fix support for rootfstype= when root= is given Greg Kroah-Hartman
                   ` (182 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Song Liu, Jens Axboe,
	kernel test robot, Bart Van Assche

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bart Van Assche <bvanassche@acm.org>

commit 7dab24554dedd4e6f408af8eb2d25c89997a6a1f upstream.

Use the type blk_opf_t for read and write operations instead of int. This
patch does not affect the generated code but fixes the following sparse
warning:

drivers/md/raid1.c:1993:60: sparse: sparse: incorrect type in argument 5 (different base types)
     expected restricted blk_opf_t [usertype] opf
     got int rw

Cc: Song Liu <song@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Fixes: 3c5e514db58f ("md/raid1: Use the new blk_opf_t type")
Cc: stable@vger.kernel.org # v6.0+
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202401080657.UjFnvQgX-lkp@intel.com/
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20240108001223.23835-1-bvanassche@acm.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/md/raid1.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1983,12 +1983,12 @@ static void end_sync_write(struct bio *b
 }
 
 static int r1_sync_page_io(struct md_rdev *rdev, sector_t sector,
-			   int sectors, struct page *page, int rw)
+			   int sectors, struct page *page, blk_opf_t rw)
 {
 	if (sync_page_io(rdev, sector, sectors << 9, page, rw, false))
 		/* success */
 		return 1;
-	if (rw == WRITE) {
+	if (rw == REQ_OP_WRITE) {
 		set_bit(WriteErrorSeen, &rdev->flags);
 		if (!test_and_set_bit(WantReplacement,
 				      &rdev->flags))
@@ -2105,7 +2105,7 @@ static int fix_sync_read_error(struct r1
 			rdev = conf->mirrors[d].rdev;
 			if (r1_sync_page_io(rdev, sect, s,
 					    pages[idx],
-					    WRITE) == 0) {
+					    REQ_OP_WRITE) == 0) {
 				r1_bio->bios[d]->bi_end_io = NULL;
 				rdev_dec_pending(rdev, mddev);
 			}
@@ -2120,7 +2120,7 @@ static int fix_sync_read_error(struct r1
 			rdev = conf->mirrors[d].rdev;
 			if (r1_sync_page_io(rdev, sect, s,
 					    pages[idx],
-					    READ) != 0)
+					    REQ_OP_READ) != 0)
 				atomic_add(s, &rdev->corrected_errors);
 		}
 		sectors -= s;
@@ -2332,7 +2332,7 @@ static void fix_read_error(struct r1conf
 				atomic_inc(&rdev->nr_pending);
 				rcu_read_unlock();
 				r1_sync_page_io(rdev, sect, s,
-						conf->tmppage, WRITE);
+						conf->tmppage, REQ_OP_WRITE);
 				rdev_dec_pending(rdev, mddev);
 			} else
 				rcu_read_unlock();
@@ -2349,7 +2349,7 @@ static void fix_read_error(struct r1conf
 				atomic_inc(&rdev->nr_pending);
 				rcu_read_unlock();
 				if (r1_sync_page_io(rdev, sect, s,
-						    conf->tmppage, READ)) {
+						conf->tmppage, REQ_OP_READ)) {
 					atomic_add(s, &rdev->corrected_errors);
 					pr_info("md/raid1:%s: read error corrected (%d sectors at %llu on %pg)\n",
 						mdname(mddev), s,



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 408/583] rootfs: Fix support for rootfstype= when root= is given
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (406 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 407/583] md/raid1: Use blk_opf_t for read and write operations Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 409/583] Bluetooth: Fix atomicity violation in {min,max}_key_size_set Greg Kroah-Hartman
                   ` (181 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Rob Landley, Stefan Berger, Mimi Zohar

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Stefan Berger <stefanb@linux.ibm.com>

commit 21528c69a0d8483f7c6345b1a0bc8d8975e9a172 upstream.

Documentation/filesystems/ramfs-rootfs-initramfs.rst states:

  If CONFIG_TMPFS is enabled, rootfs will use tmpfs instead of ramfs by
  default.  To force ramfs, add "rootfstype=ramfs" to the kernel command
  line.

This currently does not work when root= is provided since then
saved_root_name contains a string and rootfstype= is ignored. Therefore,
ramfs is currently always chosen when root= is provided.

The current behavior for rootfs's filesystem is:

   root=       | rootfstype= | chosen rootfs filesystem
   ------------+-------------+--------------------------
   unspecified | unspecified | tmpfs
   unspecified | tmpfs       | tmpfs
   unspecified | ramfs       | ramfs
    provided   | ignored     | ramfs

rootfstype= should be respected regardless whether root= is given,
as shown below:

   root=       | rootfstype= | chosen rootfs filesystem
   ------------+-------------+--------------------------
   unspecified | unspecified | tmpfs  (as before)
   unspecified | tmpfs       | tmpfs  (as before)
   unspecified | ramfs       | ramfs  (as before)
    provided   | unspecified | ramfs  (compatibility with before)
    provided   | tmpfs       | tmpfs  (new)
    provided   | ramfs       | ramfs  (new)

This table represents the new behavior.

Fixes: 6e19eded3684 ("initmpfs: use initramfs if rootfstype= or root= specified")
Cc: <stable@vger.kernel.org>
Signed-off-by: Rob Landley <rob@landley.net>
Link: https://lore.kernel.org/lkml/8244c75f-445e-b15b-9dbf-266e7ca666e2@landley.net/
Reviewed-and-Tested-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Link: https://lore.kernel.org/r/20231120011248.396012-1-stefanb@linux.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 init/do_mounts.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -510,7 +510,10 @@ struct file_system_type rootfs_fs_type =
 
 void __init init_rootfs(void)
 {
-	if (IS_ENABLED(CONFIG_TMPFS) && !saved_root_name[0] &&
-		(!root_fs_names || strstr(root_fs_names, "tmpfs")))
-		is_tmpfs = true;
+	if (IS_ENABLED(CONFIG_TMPFS)) {
+		if (!saved_root_name[0] && !root_fs_names)
+			is_tmpfs = true;
+		else if (root_fs_names && !!strstr(root_fs_names, "tmpfs"))
+			is_tmpfs = true;
+	}
 }



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 409/583] Bluetooth: Fix atomicity violation in {min,max}_key_size_set
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (407 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 408/583] rootfs: Fix support for rootfstype= when root= is given Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 410/583] bpf: Fix re-attachment branch in bpf_tracing_prog_attach Greg Kroah-Hartman
                   ` (180 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Gui-Dong Han, Luiz Augusto von Dentz

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Gui-Dong Han <2045gemini@gmail.com>

commit da9065caa594d19b26e1a030fd0cc27bd365d685 upstream.

In min_key_size_set():
    if (val > hdev->le_max_key_size || val < SMP_MIN_ENC_KEY_SIZE)
        return -EINVAL;
    hci_dev_lock(hdev);
    hdev->le_min_key_size = val;
    hci_dev_unlock(hdev);

In max_key_size_set():
    if (val > SMP_MAX_ENC_KEY_SIZE || val < hdev->le_min_key_size)
        return -EINVAL;
    hci_dev_lock(hdev);
    hdev->le_max_key_size = val;
    hci_dev_unlock(hdev);

The atomicity violation occurs due to concurrent execution of set_min and
set_max funcs.Consider a scenario where setmin writes a new, valid 'min'
value, and concurrently, setmax writes a value that is greater than the
old 'min' but smaller than the new 'min'. In this case, setmax might check
against the old 'min' value (before acquiring the lock) but write its
value after the 'min' has been updated by setmin. This leads to a
situation where the 'max' value ends up being smaller than the 'min'
value, which is an inconsistency.

This possible bug is found by an experimental static analysis tool
developed by our team, BassCheck[1]. This tool analyzes the locking APIs
to extract function pairs that can be concurrently executed, and then
analyzes the instructions in the paired functions to identify possible
concurrency bugs including data races and atomicity violations. The above
possible bug is reported when our tool analyzes the source code of
Linux 5.17.

To resolve this issue, it is suggested to encompass the validity checks
within the locked sections in both set_min and set_max funcs. The
modification ensures that the validation of 'val' against the
current min/max values is atomic, thus maintaining the integrity of the
settings. With this patch applied, our tool no longer reports the bug,
with the kernel configuration allyesconfig for x86_64. Due to the lack of
associated hardware, we cannot test the patch in runtime testing, and just
verify it according to the code logic.

[1] https://sites.google.com/view/basscheck/

Fixes: 18f81241b74f ("Bluetooth: Move {min,max}_key_size debugfs ...")
Cc: stable@vger.kernel.org
Signed-off-by: Gui-Dong Han <2045gemini@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/bluetooth/hci_debugfs.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

--- a/net/bluetooth/hci_debugfs.c
+++ b/net/bluetooth/hci_debugfs.c
@@ -1046,10 +1046,12 @@ static int min_key_size_set(void *data,
 {
 	struct hci_dev *hdev = data;
 
-	if (val > hdev->le_max_key_size || val < SMP_MIN_ENC_KEY_SIZE)
+	hci_dev_lock(hdev);
+	if (val > hdev->le_max_key_size || val < SMP_MIN_ENC_KEY_SIZE) {
+		hci_dev_unlock(hdev);
 		return -EINVAL;
+	}
 
-	hci_dev_lock(hdev);
 	hdev->le_min_key_size = val;
 	hci_dev_unlock(hdev);
 
@@ -1074,10 +1076,12 @@ static int max_key_size_set(void *data,
 {
 	struct hci_dev *hdev = data;
 
-	if (val > SMP_MAX_ENC_KEY_SIZE || val < hdev->le_min_key_size)
+	hci_dev_lock(hdev);
+	if (val > SMP_MAX_ENC_KEY_SIZE || val < hdev->le_min_key_size) {
+		hci_dev_unlock(hdev);
 		return -EINVAL;
+	}
 
-	hci_dev_lock(hdev);
 	hdev->le_max_key_size = val;
 	hci_dev_unlock(hdev);
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 410/583] bpf: Fix re-attachment branch in bpf_tracing_prog_attach
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (408 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 409/583] Bluetooth: Fix atomicity violation in {min,max}_key_size_set Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 411/583] iommu/arm-smmu-qcom: Add missing GMU entry to match table Greg Kroah-Hartman
                   ` (179 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jiri Olsa, Song Liu, Dmitrii Dolgov,
	Alexei Starovoitov

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jiri Olsa <olsajiri@gmail.com>

commit 715d82ba636cb3629a6e18a33bb9dbe53f9936ee upstream.

The following case can cause a crash due to missing attach_btf:

1) load rawtp program
2) load fentry program with rawtp as target_fd
3) create tracing link for fentry program with target_fd = 0
4) repeat 3

In the end we have:

- prog->aux->dst_trampoline == NULL
- tgt_prog == NULL (because we did not provide target_fd to link_create)
- prog->aux->attach_btf == NULL (the program was loaded with attach_prog_fd=X)
- the program was loaded for tgt_prog but we have no way to find out which one

    BUG: kernel NULL pointer dereference, address: 0000000000000058
    Call Trace:
     <TASK>
     ? __die+0x20/0x70
     ? page_fault_oops+0x15b/0x430
     ? fixup_exception+0x22/0x330
     ? exc_page_fault+0x6f/0x170
     ? asm_exc_page_fault+0x22/0x30
     ? bpf_tracing_prog_attach+0x279/0x560
     ? btf_obj_id+0x5/0x10
     bpf_tracing_prog_attach+0x439/0x560
     __sys_bpf+0x1cf4/0x2de0
     __x64_sys_bpf+0x1c/0x30
     do_syscall_64+0x41/0xf0
     entry_SYSCALL_64_after_hwframe+0x6e/0x76

Return -EINVAL in this situation.

Fixes: f3a95075549e0 ("bpf: Allow trampoline re-attach for tracing and lsm programs")
Cc: stable@vger.kernel.org
Signed-off-by: Jiri Olsa <olsajiri@gmail.com>
Acked-by: Jiri Olsa <olsajiri@gmail.com>
Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Dmitrii Dolgov <9erthalion6@gmail.com>
Link: https://lore.kernel.org/r/20240103190559.14750-4-9erthalion6@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 kernel/bpf/syscall.c |    9 +++++++++
 1 file changed, 9 insertions(+)

--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -3197,6 +3197,10 @@ static int bpf_tracing_prog_attach(struc
 	 *
 	 * - if prog->aux->dst_trampoline and tgt_prog is NULL, the program
 	 *   was detached and is going for re-attachment.
+	 *
+	 * - if prog->aux->dst_trampoline is NULL and tgt_prog and prog->aux->attach_btf
+	 *   are NULL, then program was already attached and user did not provide
+	 *   tgt_prog_fd so we have no way to find out or create trampoline
 	 */
 	if (!prog->aux->dst_trampoline && !tgt_prog) {
 		/*
@@ -3210,6 +3214,11 @@ static int bpf_tracing_prog_attach(struc
 			err = -EINVAL;
 			goto out_unlock;
 		}
+		/* We can allow re-attach only if we have valid attach_btf. */
+		if (!prog->aux->attach_btf) {
+			err = -EINVAL;
+			goto out_unlock;
+		}
 		btf_id = prog->aux->attach_btf_id;
 		key = bpf_trampoline_compute_key(NULL, prog->aux->attach_btf, btf_id);
 	}



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 411/583] iommu/arm-smmu-qcom: Add missing GMU entry to match table
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (409 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 410/583] bpf: Fix re-attachment branch in bpf_tracing_prog_attach Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 412/583] iommu/dma: Trace bounce buffer usage when mapping buffers Greg Kroah-Hartman
                   ` (178 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Rob Clark, Johan Hovold,
	Robin Murphy, Will Deacon

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Rob Clark <robdclark@chromium.org>

commit afc95681c3068956fed1241a1ff1612c066c75ac upstream.

In some cases the firmware expects cbndx 1 to be assigned to the GMU,
so we also want the default domain for the GMU to be an identy domain.
This way it does not get a context bank assigned.  Without this, both
of_dma_configure() and drm/msm's iommu_domain_attach() will trigger
allocating and configuring a context bank.  So GMU ends up attached to
both cbndx 1 and later cbndx 2.  This arrangement seemingly confounds
and surprises the firmware if the GPU later triggers a translation
fault, resulting (on sc8280xp / lenovo x13s, at least) in the SMMU
getting wedged and the GPU stuck without memory access.

Cc: stable@vger.kernel.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
Tested-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/20231210180655.75542-1-robdclark@gmail.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
@@ -243,6 +243,7 @@ static int qcom_adreno_smmu_init_context
 
 static const struct of_device_id qcom_smmu_client_of_match[] __maybe_unused = {
 	{ .compatible = "qcom,adreno" },
+	{ .compatible = "qcom,adreno-gmu" },
 	{ .compatible = "qcom,mdp4" },
 	{ .compatible = "qcom,mdss" },
 	{ .compatible = "qcom,sc7180-mdss" },



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 412/583] iommu/dma: Trace bounce buffer usage when mapping buffers
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (410 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 411/583] iommu/arm-smmu-qcom: Add missing GMU entry to match table Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 413/583] wifi: mt76: fix broken precal loading from MTD for mt7915 Greg Kroah-Hartman
                   ` (177 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Tom Murphy, Lu Baolu,
	Saravana Kannan, Isaac J. Manjarres, Joerg Roedel

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Isaac J. Manjarres <isaacmanjarres@google.com>

commit a63c357b9fd56ad5fe64616f5b22835252c6a76a upstream.

When commit 82612d66d51d ("iommu: Allow the dma-iommu api to
use bounce buffers") was introduced, it did not add the logic
for tracing the bounce buffer usage from iommu_dma_map_page().

All of the users of swiotlb_tbl_map_single() trace their bounce
buffer usage, except iommu_dma_map_page(). This makes it difficult
to track SWIOTLB usage from that function. Thus, trace bounce buffer
usage from iommu_dma_map_page().

Fixes: 82612d66d51d ("iommu: Allow the dma-iommu api to use bounce buffers")
Cc: stable@vger.kernel.org # v5.15+
Cc: Tom Murphy <murphyt7@tcd.ie>
Cc: Lu Baolu <baolu.lu@linux.intel.com>
Cc: Saravana Kannan <saravanak@google.com>
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
Link: https://lore.kernel.org/r/20231208234141.2356157-1-isaacmanjarres@google.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/iommu/dma-iommu.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/iommu/dma-iommu.c
+++ b/drivers/iommu/dma-iommu.c
@@ -29,6 +29,7 @@
 #include <linux/spinlock.h>
 #include <linux/swiotlb.h>
 #include <linux/vmalloc.h>
+#include <trace/events/swiotlb.h>
 
 #include "dma-iommu.h"
 
@@ -1052,6 +1053,8 @@ static dma_addr_t iommu_dma_map_page(str
 			return DMA_MAPPING_ERROR;
 		}
 
+		trace_swiotlb_bounced(dev, phys, size);
+
 		aligned_size = iova_align(iovad, size);
 		phys = swiotlb_tbl_map_single(dev, phys, size, aligned_size,
 					      iova_mask(iovad), dir, attrs);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 413/583] wifi: mt76: fix broken precal loading from MTD for mt7915
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (411 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 412/583] iommu/dma: Trace bounce buffer usage when mapping buffers Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 414/583] wifi: rtlwifi: Remove bogus and dangerous ASPM disable/enable code Greg Kroah-Hartman
                   ` (176 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Christian Marangi, Felix Fietkau

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christian Marangi <ansuelsmth@gmail.com>

commit e874a79250b39447765ac13272b67ac36ccf2a75 upstream.

Commit 495184ac91bb ("mt76: mt7915: add support for applying
pre-calibration data") was fundamentally broken and never worked.

The idea (before NVMEM support) was to expand the MTD function and pass
an additional offset. For normal EEPROM load the offset would always be
0. For the purpose of precal loading, an offset was passed that was
internally the size of EEPROM, since precal data is right after the
EEPROM.

Problem is that the offset value passed is never handled and is actually
overwrite by

	offset = be32_to_cpup(list);
	ret = mtd_read(mtd, offset, len, &retlen, eep);

resulting in the passed offset value always ingnored. (and even passing
garbage data as precal as the start of the EEPROM is getting read)

Fix this by adding to the current offset value, the offset from DT to
correctly read the piece of data at the requested location.

Cc: stable@vger.kernel.org
Fixes: 495184ac91bb ("mt76: mt7915: add support for applying pre-calibration data")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/wireless/mediatek/mt76/eeprom.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/mediatek/mt76/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/eeprom.c
@@ -67,7 +67,7 @@ static int mt76_get_of_epprom_from_mtd(s
 		goto out_put_node;
 	}
 
-	offset = be32_to_cpup(list);
+	offset += be32_to_cpup(list);
 	ret = mtd_read(mtd, offset, len, &retlen, eep);
 	put_mtd_device(mtd);
 	if (mtd_is_bitflip(ret))



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 414/583] wifi: rtlwifi: Remove bogus and dangerous ASPM disable/enable code
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (412 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 413/583] wifi: mt76: fix broken precal loading from MTD for mt7915 Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 415/583] wifi: rtlwifi: Convert LNKCTL change to PCIe cap RMW accessors Greg Kroah-Hartman
                   ` (175 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Ilpo Järvinen, Kalle Valo

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

commit b3943b3c2971444364e03224cfc828c5789deada upstream.

Ever since introduction in the commit 0c8173385e54 ("rtl8192ce: Add new
driver") the rtlwifi code has, according to comments, attempted to
disable/enable ASPM of the upstream bridge by writing into its LNKCTL
register. However, the code has never been correct because it performs
the writes to the device instead of the upstream bridge.

Worse yet, the offset where the PCIe capabilities reside is derived
from the offset of the upstream bridge. As a result, the write will use
an offset on the device that does not relate to the LNKCTL register
making the ASPM disable/enable code outright dangerous.

Because of those problems, there is no indication that the driver needs
disable/enable ASPM on the upstream bridge. As the Capabilities offset
is not correctly calculated for the write to target device's LNKCTL
register, the code is not disabling/enabling device's ASPM either.
Therefore, just remove the upstream bridge related ASPM disable/enable
code entirely.

The upstream bridge related ASPM code was the only user of the struct
mp_adapter members num4bytes, pcibridge_pciehdr_offset, and
pcibridge_linkctrlreg so those are removed as well.

Note: This change does not remove the code related to changing the
device's ASPM on purpose (which is independent of this flawed code
related to upstream bridge's ASPM).

Suggested-by: Bjorn Helgaas <bhelgaas@kernel.org>
Fixes: 0c8173385e54 ("rtl8192ce: Add new driver")
Fixes: 886e14b65a8f ("rtlwifi: Eliminate raw reads and writes from PCIe portion")
Cc: stable@vger.kernel.org
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231124084725.12738-2-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/wireless/realtek/rtlwifi/pci.c |   58 -----------------------------
 drivers/net/wireless/realtek/rtlwifi/pci.h |    5 --
 2 files changed, 1 insertion(+), 62 deletions(-)

--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -192,11 +192,8 @@ static void rtl_pci_disable_aspm(struct
 	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
 	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
 	u8 pcibridge_vendor = pcipriv->ndis_adapter.pcibridge_vendor;
-	u8 num4bytes = pcipriv->ndis_adapter.num4bytes;
 	/*Retrieve original configuration settings. */
 	u8 linkctrl_reg = pcipriv->ndis_adapter.linkctrl_reg;
-	u16 pcibridge_linkctrlreg = pcipriv->ndis_adapter.
-				pcibridge_linkctrlreg;
 	u16 aspmlevel = 0;
 	u8 tmp_u1b = 0;
 
@@ -221,16 +218,8 @@ static void rtl_pci_disable_aspm(struct
 	/*Set corresponding value. */
 	aspmlevel |= BIT(0) | BIT(1);
 	linkctrl_reg &= ~aspmlevel;
-	pcibridge_linkctrlreg &= ~(BIT(0) | BIT(1));
 
 	_rtl_pci_platform_switch_device_pci_aspm(hw, linkctrl_reg);
-	udelay(50);
-
-	/*4 Disable Pci Bridge ASPM */
-	pci_write_config_byte(rtlpci->pdev, (num4bytes << 2),
-			      pcibridge_linkctrlreg);
-
-	udelay(50);
 }
 
 /*Enable RTL8192SE ASPM & Enable Pci Bridge ASPM for
@@ -245,9 +234,7 @@ static void rtl_pci_enable_aspm(struct i
 	struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
 	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
 	u8 pcibridge_vendor = pcipriv->ndis_adapter.pcibridge_vendor;
-	u8 num4bytes = pcipriv->ndis_adapter.num4bytes;
 	u16 aspmlevel;
-	u8 u_pcibridge_aspmsetting;
 	u8 u_device_aspmsetting;
 
 	if (!ppsc->support_aspm)
@@ -259,25 +246,6 @@ static void rtl_pci_enable_aspm(struct i
 		return;
 	}
 
-	/*4 Enable Pci Bridge ASPM */
-
-	u_pcibridge_aspmsetting =
-	    pcipriv->ndis_adapter.pcibridge_linkctrlreg |
-	    rtlpci->const_hostpci_aspm_setting;
-
-	if (pcibridge_vendor == PCI_BRIDGE_VENDOR_INTEL)
-		u_pcibridge_aspmsetting &= ~BIT(0);
-
-	pci_write_config_byte(rtlpci->pdev, (num4bytes << 2),
-			      u_pcibridge_aspmsetting);
-
-	rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD,
-		"PlatformEnableASPM(): Write reg[%x] = %x\n",
-		(pcipriv->ndis_adapter.pcibridge_pciehdr_offset + 0x10),
-		u_pcibridge_aspmsetting);
-
-	udelay(50);
-
 	/*Get ASPM level (with/without Clock Req) */
 	aspmlevel = rtlpci->const_devicepci_aspm_setting;
 	u_device_aspmsetting = pcipriv->ndis_adapter.linkctrl_reg;
@@ -358,22 +326,6 @@ static bool rtl_pci_check_buddy_priv(str
 	return tpriv != NULL;
 }
 
-static void rtl_pci_get_linkcontrol_field(struct ieee80211_hw *hw)
-{
-	struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
-	struct rtl_pci *rtlpci = rtl_pcidev(pcipriv);
-	u8 capabilityoffset = pcipriv->ndis_adapter.pcibridge_pciehdr_offset;
-	u8 linkctrl_reg;
-	u8 num4bbytes;
-
-	num4bbytes = (capabilityoffset + 0x10) / 4;
-
-	/*Read  Link Control Register */
-	pci_read_config_byte(rtlpci->pdev, (num4bbytes << 2), &linkctrl_reg);
-
-	pcipriv->ndis_adapter.pcibridge_linkctrlreg = linkctrl_reg;
-}
-
 static void rtl_pci_parse_configuration(struct pci_dev *pdev,
 					struct ieee80211_hw *hw)
 {
@@ -2028,12 +1980,6 @@ static bool _rtl_pci_find_adapter(struct
 		    PCI_SLOT(bridge_pdev->devfn);
 		pcipriv->ndis_adapter.pcibridge_funcnum =
 		    PCI_FUNC(bridge_pdev->devfn);
-		pcipriv->ndis_adapter.pcibridge_pciehdr_offset =
-		    pci_pcie_cap(bridge_pdev);
-		pcipriv->ndis_adapter.num4bytes =
-		    (pcipriv->ndis_adapter.pcibridge_pciehdr_offset + 0x10) / 4;
-
-		rtl_pci_get_linkcontrol_field(hw);
 
 		if (pcipriv->ndis_adapter.pcibridge_vendor ==
 		    PCI_BRIDGE_VENDOR_AMD) {
@@ -2050,13 +1996,11 @@ static bool _rtl_pci_find_adapter(struct
 		pdev->vendor, pcipriv->ndis_adapter.linkctrl_reg);
 
 	rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG,
-		"pci_bridge busnumber:devnumber:funcnumber:vendor:pcie_cap:link_ctl_reg:amd %d:%d:%d:%x:%x:%x:%x\n",
+		"pci_bridge busnumber:devnumber:funcnumber:vendor:amd %d:%d:%d:%x:%x\n",
 		pcipriv->ndis_adapter.pcibridge_busnum,
 		pcipriv->ndis_adapter.pcibridge_devnum,
 		pcipriv->ndis_adapter.pcibridge_funcnum,
 		pcibridge_vendors[pcipriv->ndis_adapter.pcibridge_vendor],
-		pcipriv->ndis_adapter.pcibridge_pciehdr_offset,
-		pcipriv->ndis_adapter.pcibridge_linkctrlreg,
 		pcipriv->ndis_adapter.amd_l1_patch);
 
 	rtl_pci_parse_configuration(pdev, hw);
--- a/drivers/net/wireless/realtek/rtlwifi/pci.h
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.h
@@ -236,11 +236,6 @@ struct mp_adapter {
 	u16 pcibridge_vendorid;
 	u16 pcibridge_deviceid;
 
-	u8 num4bytes;
-
-	u8 pcibridge_pciehdr_offset;
-	u8 pcibridge_linkctrlreg;
-
 	bool amd_l1_patch;
 };
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 415/583] wifi: rtlwifi: Convert LNKCTL change to PCIe cap RMW accessors
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (413 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 414/583] wifi: rtlwifi: Remove bogus and dangerous ASPM disable/enable code Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 416/583] wifi: mwifiex: add extra delay for firmware ready Greg Kroah-Hartman
                   ` (174 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Ilpo Järvinen, Kalle Valo

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

commit 5894d0089cbc146063dcc0239a78ede0a8142efb upstream.

The rtlwifi driver comes with custom code to write into PCIe Link
Control register. RMW access for the Link Control register requires
locking that is already provided by the standard PCIe capability
accessors.

Convert the custom RMW code writing into LNKCTL register to standard
RMW capability accessors. The accesses are changed to cover the full
LNKCTL register instead of touching just a single byte of the register.

Fixes: 0c8173385e54 ("rtl8192ce: Add new driver")
Cc: stable@vger.kernel.org
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231124084725.12738-3-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/wireless/realtek/rtlwifi/pci.c |   21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -164,21 +164,29 @@ static bool _rtl_pci_platform_switch_dev
 	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
 	struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
 
+	value &= PCI_EXP_LNKCTL_ASPMC;
+
 	if (rtlhal->hw_type != HARDWARE_TYPE_RTL8192SE)
-		value |= 0x40;
+		value |= PCI_EXP_LNKCTL_CCC;
 
-	pci_write_config_byte(rtlpci->pdev, 0x80, value);
+	pcie_capability_clear_and_set_word(rtlpci->pdev, PCI_EXP_LNKCTL,
+					   PCI_EXP_LNKCTL_ASPMC | value,
+					   value);
 
 	return false;
 }
 
-/*When we set 0x01 to enable clk request. Set 0x0 to disable clk req.*/
-static void _rtl_pci_switch_clk_req(struct ieee80211_hw *hw, u8 value)
+/* @value is PCI_EXP_LNKCTL_CLKREQ_EN or 0 to enable/disable clk request. */
+static void _rtl_pci_switch_clk_req(struct ieee80211_hw *hw, u16 value)
 {
 	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
 	struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
 
-	pci_write_config_byte(rtlpci->pdev, 0x81, value);
+	value &= PCI_EXP_LNKCTL_CLKREQ_EN;
+
+	pcie_capability_clear_and_set_word(rtlpci->pdev, PCI_EXP_LNKCTL,
+					   PCI_EXP_LNKCTL_CLKREQ_EN,
+					   value);
 
 	if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192SE)
 		udelay(100);
@@ -259,7 +267,8 @@ static void rtl_pci_enable_aspm(struct i
 
 	if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_CLK_REQ) {
 		_rtl_pci_switch_clk_req(hw, (ppsc->reg_rfps_level &
-					     RT_RF_OFF_LEVL_CLK_REQ) ? 1 : 0);
+					     RT_RF_OFF_LEVL_CLK_REQ) ?
+					     PCI_EXP_LNKCTL_CLKREQ_EN : 0);
 		RT_SET_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_CLK_REQ);
 	}
 	udelay(100);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 416/583] wifi: mwifiex: add extra delay for firmware ready
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (414 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 415/583] wifi: rtlwifi: Convert LNKCTL change to PCIe cap RMW accessors Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 417/583] wifi: mwifiex: configure BSSID consistently when starting AP Greg Kroah-Hartman
                   ` (173 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, David Lin, Francesco Dolcini,
	Brian Norris, Kalle Valo, Marcel Ziswiler

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: David Lin <yu-hao.lin@nxp.com>

commit 1c5d463c0770c6fa2037511a24fb17966fd07d97 upstream.

For SDIO IW416, due to a bug, FW may return ready before complete full
initialization. Command timeout may occur at driver load after reboot.
Workaround by adding 100ms delay at checking FW status.

Signed-off-by: David Lin <yu-hao.lin@nxp.com>
Cc: stable@vger.kernel.org
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Acked-by: Brian Norris <briannorris@chromium.org>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> # Verdin AM62 (IW416)
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231208234029.2197-1-yu-hao.lin@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/wireless/marvell/mwifiex/sdio.c |   19 +++++++++++++++++++
 drivers/net/wireless/marvell/mwifiex/sdio.h |    2 ++
 2 files changed, 21 insertions(+)

--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -331,6 +331,7 @@ static const struct mwifiex_sdio_device
 	.can_dump_fw = false,
 	.can_auto_tdls = false,
 	.can_ext_scan = false,
+	.fw_ready_extra_delay = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8787 = {
@@ -346,6 +347,7 @@ static const struct mwifiex_sdio_device
 	.can_dump_fw = false,
 	.can_auto_tdls = false,
 	.can_ext_scan = true,
+	.fw_ready_extra_delay = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8797 = {
@@ -361,6 +363,7 @@ static const struct mwifiex_sdio_device
 	.can_dump_fw = false,
 	.can_auto_tdls = false,
 	.can_ext_scan = true,
+	.fw_ready_extra_delay = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8897 = {
@@ -376,6 +379,7 @@ static const struct mwifiex_sdio_device
 	.can_dump_fw = true,
 	.can_auto_tdls = false,
 	.can_ext_scan = true,
+	.fw_ready_extra_delay = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8977 = {
@@ -392,6 +396,7 @@ static const struct mwifiex_sdio_device
 	.fw_dump_enh = true,
 	.can_auto_tdls = false,
 	.can_ext_scan = true,
+	.fw_ready_extra_delay = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8978 = {
@@ -408,6 +413,7 @@ static const struct mwifiex_sdio_device
 	.fw_dump_enh = true,
 	.can_auto_tdls = false,
 	.can_ext_scan = true,
+	.fw_ready_extra_delay = true,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8997 = {
@@ -425,6 +431,7 @@ static const struct mwifiex_sdio_device
 	.fw_dump_enh = true,
 	.can_auto_tdls = false,
 	.can_ext_scan = true,
+	.fw_ready_extra_delay = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8887 = {
@@ -440,6 +447,7 @@ static const struct mwifiex_sdio_device
 	.can_dump_fw = false,
 	.can_auto_tdls = true,
 	.can_ext_scan = true,
+	.fw_ready_extra_delay = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8987 = {
@@ -456,6 +464,7 @@ static const struct mwifiex_sdio_device
 	.fw_dump_enh = true,
 	.can_auto_tdls = true,
 	.can_ext_scan = true,
+	.fw_ready_extra_delay = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8801 = {
@@ -471,6 +480,7 @@ static const struct mwifiex_sdio_device
 	.can_dump_fw = false,
 	.can_auto_tdls = false,
 	.can_ext_scan = true,
+	.fw_ready_extra_delay = false,
 };
 
 static struct memory_type_mapping generic_mem_type_map[] = {
@@ -563,6 +573,7 @@ mwifiex_sdio_probe(struct sdio_func *fun
 		card->fw_dump_enh = data->fw_dump_enh;
 		card->can_auto_tdls = data->can_auto_tdls;
 		card->can_ext_scan = data->can_ext_scan;
+		card->fw_ready_extra_delay = data->fw_ready_extra_delay;
 		INIT_WORK(&card->work, mwifiex_sdio_work);
 	}
 
@@ -766,6 +777,7 @@ mwifiex_sdio_read_fw_status(struct mwifi
 static int mwifiex_check_fw_status(struct mwifiex_adapter *adapter,
 				   u32 poll_num)
 {
+	struct sdio_mmc_card *card = adapter->card;
 	int ret = 0;
 	u16 firmware_stat;
 	u32 tries;
@@ -783,6 +795,13 @@ static int mwifiex_check_fw_status(struc
 		ret = -1;
 	}
 
+	if (card->fw_ready_extra_delay &&
+	    firmware_stat == FIRMWARE_READY_SDIO)
+		/* firmware might pretend to be ready, when it's not.
+		 * Wait a little bit more as a workaround.
+		 */
+		msleep(100);
+
 	return ret;
 }
 
--- a/drivers/net/wireless/marvell/mwifiex/sdio.h
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.h
@@ -258,6 +258,7 @@ struct sdio_mmc_card {
 	bool fw_dump_enh;
 	bool can_auto_tdls;
 	bool can_ext_scan;
+	bool fw_ready_extra_delay;
 
 	struct mwifiex_sdio_mpa_tx mpa_tx;
 	struct mwifiex_sdio_mpa_rx mpa_rx;
@@ -281,6 +282,7 @@ struct mwifiex_sdio_device {
 	bool fw_dump_enh;
 	bool can_auto_tdls;
 	bool can_ext_scan;
+	bool fw_ready_extra_delay;
 };
 
 /*



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 417/583] wifi: mwifiex: configure BSSID consistently when starting AP
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (415 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 416/583] wifi: mwifiex: add extra delay for firmware ready Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 418/583] wifi: mwifiex: fix uninitialized firmware_stat Greg Kroah-Hartman
                   ` (172 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, David Lin, Francesco Dolcini,
	Brian Norris, Kalle Valo, Rafael Beims

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: David Lin <yu-hao.lin@nxp.com>

commit f0dd488e11e71ac095df7638d892209c629d9af2 upstream.

AP BSSID configuration is missing at AP start.  Without this fix, FW returns
STA interface MAC address after first init.  When hostapd restarts, it gets MAC
address from netdev before driver sets STA MAC to netdev again. Now MAC address
between hostapd and net interface are different causes STA cannot connect to
AP.  After that MAC address of uap0 mlan0 become the same. And issue disappears
after following hostapd restart (another issue is AP/STA MAC address become the
same).

This patch fixes the issue cleanly.

Signed-off-by: David Lin <yu-hao.lin@nxp.com>
Fixes: 12190c5d80bd ("mwifiex: add cfg80211 start_ap and stop_ap handlers")
Cc: stable@vger.kernel.org
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Tested-by: Rafael Beims <rafael.beims@toradex.com> # Verdin iMX8MP/SD8997 SD
Acked-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231215005118.17031-1-yu-hao.lin@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/wireless/marvell/mwifiex/cfg80211.c |    2 ++
 drivers/net/wireless/marvell/mwifiex/fw.h       |    1 +
 drivers/net/wireless/marvell/mwifiex/ioctl.h    |    1 +
 drivers/net/wireless/marvell/mwifiex/uap_cmd.c  |    8 ++++++++
 4 files changed, 12 insertions(+)

--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -2046,6 +2046,8 @@ static int mwifiex_cfg80211_start_ap(str
 
 	mwifiex_set_sys_config_invalid_data(bss_cfg);
 
+	memcpy(bss_cfg->mac_addr, priv->curr_addr, ETH_ALEN);
+
 	if (params->beacon_interval)
 		bss_cfg->beacon_period = params->beacon_interval;
 	if (params->dtim_period)
--- a/drivers/net/wireless/marvell/mwifiex/fw.h
+++ b/drivers/net/wireless/marvell/mwifiex/fw.h
@@ -165,6 +165,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
 #define TLV_TYPE_STA_MAC_ADDR       (PROPRIETARY_TLV_BASE_ID + 32)
 #define TLV_TYPE_BSSID              (PROPRIETARY_TLV_BASE_ID + 35)
 #define TLV_TYPE_CHANNELBANDLIST    (PROPRIETARY_TLV_BASE_ID + 42)
+#define TLV_TYPE_UAP_MAC_ADDRESS    (PROPRIETARY_TLV_BASE_ID + 43)
 #define TLV_TYPE_UAP_BEACON_PERIOD  (PROPRIETARY_TLV_BASE_ID + 44)
 #define TLV_TYPE_UAP_DTIM_PERIOD    (PROPRIETARY_TLV_BASE_ID + 45)
 #define TLV_TYPE_UAP_BCAST_SSID     (PROPRIETARY_TLV_BASE_ID + 48)
--- a/drivers/net/wireless/marvell/mwifiex/ioctl.h
+++ b/drivers/net/wireless/marvell/mwifiex/ioctl.h
@@ -107,6 +107,7 @@ struct mwifiex_uap_bss_param {
 	u8 qos_info;
 	u8 power_constraint;
 	struct mwifiex_types_wmm_info wmm_info;
+	u8 mac_addr[ETH_ALEN];
 };
 
 enum {
--- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
@@ -468,6 +468,7 @@ void mwifiex_config_uap_11d(struct mwifi
 static int
 mwifiex_uap_bss_param_prepare(u8 *tlv, void *cmd_buf, u16 *param_size)
 {
+	struct host_cmd_tlv_mac_addr *mac_tlv;
 	struct host_cmd_tlv_dtim_period *dtim_period;
 	struct host_cmd_tlv_beacon_period *beacon_period;
 	struct host_cmd_tlv_ssid *ssid;
@@ -487,6 +488,13 @@ mwifiex_uap_bss_param_prepare(u8 *tlv, v
 	int i;
 	u16 cmd_size = *param_size;
 
+	mac_tlv = (struct host_cmd_tlv_mac_addr *)tlv;
+	mac_tlv->header.type = cpu_to_le16(TLV_TYPE_UAP_MAC_ADDRESS);
+	mac_tlv->header.len = cpu_to_le16(ETH_ALEN);
+	memcpy(mac_tlv->mac_addr, bss_cfg->mac_addr, ETH_ALEN);
+	cmd_size += sizeof(struct host_cmd_tlv_mac_addr);
+	tlv += sizeof(struct host_cmd_tlv_mac_addr);
+
 	if (bss_cfg->ssid.ssid_len) {
 		ssid = (struct host_cmd_tlv_ssid *)tlv;
 		ssid->header.type = cpu_to_le16(TLV_TYPE_UAP_SSID);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 418/583] wifi: mwifiex: fix uninitialized firmware_stat
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (416 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 417/583] wifi: mwifiex: configure BSSID consistently when starting AP Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 419/583] net: stmmac: fix ethtool per-queue statistics Greg Kroah-Hartman
                   ` (171 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, David Lin, kernel test robot,
	Dan Carpenter, Brian Norris, Kalle Valo

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: David Lin <yu-hao.lin@nxp.com>

commit 3df95e265924ac898c1a38a0c01846dd0bd3b354 upstream.

Variable firmware_stat is possible to be used without initialization.

Signed-off-by: David Lin <yu-hao.lin@nxp.com>
Fixes: 1c5d463c0770 ("wifi: mwifiex: add extra delay for firmware ready")
Cc: stable@vger.kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202312192236.ZflaWYCw-lkp@intel.com/
Acked-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20231221015511.1032128-1-yu-hao.lin@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/wireless/marvell/mwifiex/sdio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -779,7 +779,7 @@ static int mwifiex_check_fw_status(struc
 {
 	struct sdio_mmc_card *card = adapter->card;
 	int ret = 0;
-	u16 firmware_stat;
+	u16 firmware_stat = 0;
 	u32 tries;
 
 	for (tries = 0; tries < poll_num; tries++) {



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 419/583] net: stmmac: fix ethtool per-queue statistics
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (417 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 418/583] wifi: mwifiex: fix uninitialized firmware_stat Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 420/583] Revert "net: rtnetlink: Enslave device before bringing it up" Greg Kroah-Hartman
                   ` (170 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Petr Tesarik, Jisheng Zhang,
	Andrew Lunn, David S. Miller

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Petr Tesarik <petr@tesarici.cz>

commit 61921bdaa132b580b6db6858e6d7dcdb870df5fe upstream.

Fix per-queue statistics for devices with more than one queue.

The output data pointer is currently reset in each loop iteration,
effectively summing all queue statistics in the first four u64 values.

The summary values are not even labeled correctly. For example, if eth0 has
2 queues, ethtool -S eth0 shows:

     q0_tx_pkt_n: 374 (actually tx_pkt_n over all queues)
     q0_tx_irq_n: 23  (actually tx_normal_irq_n over all queues)
     q1_tx_pkt_n: 462 (actually rx_pkt_n over all queues)
     q1_tx_irq_n: 446 (actually rx_normal_irq_n over all queues)
     q0_rx_pkt_n: 0
     q0_rx_irq_n: 0
     q1_rx_pkt_n: 0
     q1_rx_irq_n: 0

Fixes: 133466c3bbe1 ("net: stmmac: use per-queue 64 bit statistics where necessary")
Cc: stable@vger.kernel.org
Signed-off-by: Petr Tesarik <petr@tesarici.cz>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -543,15 +543,12 @@ static void stmmac_get_per_qstats(struct
 	u32 rx_cnt = priv->plat->rx_queues_to_use;
 	unsigned int start;
 	int q, stat;
-	u64 *pos;
 	char *p;
 
-	pos = data;
 	for (q = 0; q < tx_cnt; q++) {
 		struct stmmac_txq_stats *txq_stats = &priv->xstats.txq_stats[q];
 		struct stmmac_txq_stats snapshot;
 
-		data = pos;
 		do {
 			start = u64_stats_fetch_begin(&txq_stats->syncp);
 			snapshot = *txq_stats;
@@ -559,17 +556,15 @@ static void stmmac_get_per_qstats(struct
 
 		p = (char *)&snapshot + offsetof(struct stmmac_txq_stats, tx_pkt_n);
 		for (stat = 0; stat < STMMAC_TXQ_STATS; stat++) {
-			*data++ += (*(u64 *)p);
+			*data++ = (*(u64 *)p);
 			p += sizeof(u64);
 		}
 	}
 
-	pos = data;
 	for (q = 0; q < rx_cnt; q++) {
 		struct stmmac_rxq_stats *rxq_stats = &priv->xstats.rxq_stats[q];
 		struct stmmac_rxq_stats snapshot;
 
-		data = pos;
 		do {
 			start = u64_stats_fetch_begin(&rxq_stats->syncp);
 			snapshot = *rxq_stats;
@@ -577,7 +572,7 @@ static void stmmac_get_per_qstats(struct
 
 		p = (char *)&snapshot + offsetof(struct stmmac_rxq_stats, rx_pkt_n);
 		for (stat = 0; stat < STMMAC_RXQ_STATS; stat++) {
-			*data++ += (*(u64 *)p);
+			*data++ = (*(u64 *)p);
 			p += sizeof(u64);
 		}
 	}



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 420/583] Revert "net: rtnetlink: Enslave device before bringing it up"
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (418 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 419/583] net: stmmac: fix ethtool per-queue statistics Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 421/583] Revert "nSVM: Check for reserved encodings of TLB_CONTROL in nested VMCB" Greg Kroah-Hartman
                   ` (169 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nicolas Dichtel, Jiri Pirko,
	Hangbin Liu, Jakub Kicinski

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>

commit ec4ffd100ffb396eca13ebe7d18938ea80f399c3 upstream.

This reverts commit a4abfa627c3865c37e036bccb681619a50d3d93c.

The patch broke:
> ip link set dummy0 up
> ip link set dummy0 master bond0 down

This last command is useful to be able to enslave an interface with only
one netlink message.

After discussion, there is no good reason to support:
> ip link set dummy0 down
> ip link set dummy0 master bond0 up
because the bond interface already set the slave up when it is up.

Cc: stable@vger.kernel.org
Fixes: a4abfa627c38 ("net: rtnetlink: Enslave device before bringing it up")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://lore.kernel.org/r/20240108094103.2001224-2-nicolas.dichtel@6wind.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/core/rtnetlink.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2869,13 +2869,6 @@ static int do_setlink(const struct sk_bu
 		call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
 	}
 
-	if (tb[IFLA_MASTER]) {
-		err = do_set_master(dev, nla_get_u32(tb[IFLA_MASTER]), extack);
-		if (err)
-			goto errout;
-		status |= DO_SETLINK_MODIFIED;
-	}
-
 	if (ifm->ifi_flags || ifm->ifi_change) {
 		err = dev_change_flags(dev, rtnl_dev_combine_flags(dev, ifm),
 				       extack);
@@ -2883,6 +2876,13 @@ static int do_setlink(const struct sk_bu
 			goto errout;
 	}
 
+	if (tb[IFLA_MASTER]) {
+		err = do_set_master(dev, nla_get_u32(tb[IFLA_MASTER]), extack);
+		if (err)
+			goto errout;
+		status |= DO_SETLINK_MODIFIED;
+	}
+
 	if (tb[IFLA_CARRIER]) {
 		err = dev_change_carrier(dev, nla_get_u8(tb[IFLA_CARRIER]));
 		if (err)



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 421/583] Revert "nSVM: Check for reserved encodings of TLB_CONTROL in nested VMCB"
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (419 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 420/583] Revert "net: rtnetlink: Enslave device before bringing it up" Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 422/583] cxl/port: Fix decoder initialization when nr_targets > interleave_ways Greg Kroah-Hartman
                   ` (168 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Stefan Sterz, Maxim Levitsky,
	Sean Christopherson

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sean Christopherson <seanjc@google.com>

commit a484755ab2526ebdbe042397cdd6e427eb4b1a68 upstream.

Revert KVM's made-up consistency check on SVM's TLB control.  The APM says
that unsupported encodings are reserved, but the APM doesn't state that
VMRUN checks for a supported encoding.  Unless something is called out
in "Canonicalization and Consistency Checks" or listed as MBZ (Must Be
Zero), AMD behavior is typically to let software shoot itself in the foot.

This reverts commit 174a921b6975ef959dd82ee9e8844067a62e3ec1.

Fixes: 174a921b6975 ("nSVM: Check for reserved encodings of TLB_CONTROL in nested VMCB")
Reported-by: Stefan Sterz <s.sterz@proxmox.com>
Closes: https://lkml.kernel.org/r/b9915c9c-4cf6-051a-2d91-44cc6380f455%40proxmox.com
Cc: stable@vger.kernel.org
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20231018194104.1896415-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/x86/kvm/svm/nested.c |   15 ---------------
 1 file changed, 15 deletions(-)

--- a/arch/x86/kvm/svm/nested.c
+++ b/arch/x86/kvm/svm/nested.c
@@ -247,18 +247,6 @@ static bool nested_svm_check_bitmap_pa(s
 	    kvm_vcpu_is_legal_gpa(vcpu, addr + size - 1);
 }
 
-static bool nested_svm_check_tlb_ctl(struct kvm_vcpu *vcpu, u8 tlb_ctl)
-{
-	/* Nested FLUSHBYASID is not supported yet.  */
-	switch(tlb_ctl) {
-		case TLB_CONTROL_DO_NOTHING:
-		case TLB_CONTROL_FLUSH_ALL_ASID:
-			return true;
-		default:
-			return false;
-	}
-}
-
 static bool __nested_vmcb_check_controls(struct kvm_vcpu *vcpu,
 					 struct vmcb_ctrl_area_cached *control)
 {
@@ -278,9 +266,6 @@ static bool __nested_vmcb_check_controls
 					   IOPM_SIZE)))
 		return false;
 
-	if (CC(!nested_svm_check_tlb_ctl(vcpu, control->tlb_ctl)))
-		return false;
-
 	if (CC((control->int_ctl & V_NMI_ENABLE_MASK) &&
 	       !vmcb12_is_intercept(control, INTERCEPT_NMI))) {
 		return false;



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 422/583] cxl/port: Fix decoder initialization when nr_targets > interleave_ways
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (420 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 421/583] Revert "nSVM: Check for reserved encodings of TLB_CONTROL in nested VMCB" Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 423/583] PCI/P2PDMA: Remove reference to pci_p2pdma_map_sg() Greg Kroah-Hartman
                   ` (167 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Huang, Ying, Alison Schofield,
	Dave Jiang, Dan Williams, Huang

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Huang Ying <ying.huang@intel.com>

commit d6488fee66472b468ed88d265b14aa3f04dc3bdf upstream.

The decoder_populate_targets() helper walks all of the targets in a port
and makes sure they can be looked up in @target_map. Where @target_map
is a lookup table from target position to target id (corresponding to a
cxl_dport instance). However @target_map is only responsible for
conveying the active dport instances as indicated by interleave_ways.

When nr_targets > interleave_ways it results in
decoder_populate_targets() walking off the end of the valid entries in
@target_map. Given target_map is initialized to 0 it results in the
dport lookup failing if position 0 is not mapped to a dport with an id
of 0:

  cxl_port port3: Failed to populate active decoder targets
  cxl_port port3: Failed to add decoder
  cxl_port port3: Failed to add decoder3.0
  cxl_bus_probe: cxl_port port3: probe: -6

This bug also highlights that when the decoder's ->targets[] array is
written in cxl_port_setup_targets() it is missing a hold of the
targets_lock to synchronize against sysfs readers of the target list. A
fix for that is saved for a later patch.

Fixes: a5c258021689 ("cxl/bus: Populate the target list at decoder create")
Cc:  <stable@vger.kernel.org>
Signed-off-by: Huang, Ying <ying.huang@intel.com>
[djbw: rewrite the changelog, find the Fixes: tag]
Co-developed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/cxl/core/port.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/cxl/core/port.c
+++ b/drivers/cxl/core/port.c
@@ -1590,7 +1590,7 @@ static int decoder_populate_targets(stru
 		return -EINVAL;
 
 	write_seqlock(&cxlsd->target_lock);
-	for (i = 0; i < cxlsd->nr_targets; i++) {
+	for (i = 0; i < cxlsd->cxld.interleave_ways; i++) {
 		struct cxl_dport *dport = find_dport(port, target_map[i]);
 
 		if (!dport) {



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 423/583] PCI/P2PDMA: Remove reference to pci_p2pdma_map_sg()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (421 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 422/583] cxl/port: Fix decoder initialization when nr_targets > interleave_ways Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 424/583] x86/pci: Reserve ECAM if BIOS didnt include it in PNP0C02 _CRS Greg Kroah-Hartman
                   ` (166 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Tadeusz Struk, Bjorn Helgaas,
	Logan Gunthorpe, stable

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tadeusz Struk <tstruk@gigaio.com>

commit 9a000a72af75886e5de13f4edef7f0d788622e7d upstream.

Update Documentation/driver-api/pci/p2pdma.rst doc and remove references to
obsolete p2pdma mapping functions.

Fixes: 0d06132fc84b ("PCI/P2PDMA: Remove pci_p2pdma_[un]map_sg()")
Link: https://lore.kernel.org/r/20231113180325.444692-1-tstruk@gmail.com
Signed-off-by: Tadeusz Struk <tstruk@gigaio.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 Documentation/driver-api/pci/p2pdma.rst |   16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

--- a/Documentation/driver-api/pci/p2pdma.rst
+++ b/Documentation/driver-api/pci/p2pdma.rst
@@ -83,19 +83,9 @@ this to include other types of resources
 Client Drivers
 --------------
 
-A client driver typically only has to conditionally change its DMA map
-routine to use the mapping function :c:func:`pci_p2pdma_map_sg()` instead
-of the usual :c:func:`dma_map_sg()` function. Memory mapped in this
-way does not need to be unmapped.
-
-The client may also, optionally, make use of
-:c:func:`is_pci_p2pdma_page()` to determine when to use the P2P mapping
-functions and when to use the regular mapping functions. In some
-situations, it may be more appropriate to use a flag to indicate a
-given request is P2P memory and map appropriately. It is important to
-ensure that struct pages that back P2P memory stay out of code that
-does not have support for them as other code may treat the pages as
-regular memory which may not be appropriate.
+A client driver only has to use the mapping API :c:func:`dma_map_sg()`
+and :c:func:`dma_unmap_sg()` functions as usual, and the implementation
+will do the right thing for the P2P capable memory.
 
 
 Orchestrator Drivers



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 424/583] x86/pci: Reserve ECAM if BIOS didnt include it in PNP0C02 _CRS
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (422 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 423/583] PCI/P2PDMA: Remove reference to pci_p2pdma_map_sg() Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 425/583] PCI: dwc: endpoint: Fix dw_pcie_ep_raise_msix_irq() alignment support Greg Kroah-Hartman
                   ` (165 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Tomasz Pala, Sebastian Manciulea,
	Bjorn Helgaas

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Bjorn Helgaas <bhelgaas@google.com>

commit 070909e56a7d65fd0b4aad6e808966b7c634befe upstream.

Tomasz, Sebastian, and some Proxmox users reported problems initializing
ixgbe NICs.

I think the problem is that ECAM space described in the ACPI MCFG table is
not reserved via a PNP0C02 _CRS method as required by the PCI Firmware spec
(r3.3, sec 4.1.2), but it *is* included in the PNP0A03 host bridge _CRS as
part of the MMIO aperture.

If we allocate space for a PCI BAR, we're likely to allocate it from that
ECAM space, which obviously cannot work.

This could happen for any device, but in the ixgbe case it happens because
it's an SR-IOV device and the BIOS didn't allocate space for the VF BARs,
so Linux reallocated the bridge window leading to ixgbe and put it on top
of the ECAM space.  From Tomasz' system:

  PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem 0x80000000-0x8fffffff] (base 0x80000000)
  PCI: MMCONFIG at [mem 0x80000000-0x8fffffff] not reserved in ACPI motherboard resources
  pci_bus 0000:00: root bus resource [mem 0x80000000-0xfbffffff window]

  pci 0000:00:01.1: PCI bridge to [bus 02-03]
  pci 0000:00:01.1:   bridge window [mem 0xfb900000-0xfbbfffff]
  pci 0000:02:00.0: [8086:10fb] type 00 class 0x020000  # ixgbe
  pci 0000:02:00.0: reg 0x10: [mem 0xfba80000-0xfbafffff 64bit]
  pci 0000:02:00.0: VF(n) BAR0 space: [mem 0x00000000-0x000fffff 64bit] (contains BAR0 for 64 VFs)
  pci 0000:02:00.0: BAR 7: no space for [mem size 0x00100000 64bit]   # VF BAR 0

  pci_bus 0000:00: No. 2 try to assign unassigned res
  pci 0000:00:01.1: resource 14 [mem 0xfb900000-0xfbbfffff] released
  pci 0000:00:01.1: BAR 14: assigned [mem 0x80000000-0x806fffff]
  pci 0000:02:00.0: BAR 0: assigned [mem 0x80000000-0x8007ffff 64bit]
  pci 0000:02:00.0: BAR 7: assigned [mem 0x80204000-0x80303fff 64bit] # VF BAR 0

Fixes: 07eab0901ede ("efi/x86: Remove EfiMemoryMappedIO from E820 map")
Fixes: fd3a8cff4d4a ("x86/pci: Treat EfiMemoryMappedIO as reservation of ECAM space")
Reported-by: Tomasz Pala <gotar@polanet.pl>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=218050
Reported-by: Sebastian Manciulea <manciuleas@protonmail.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=218107
Link: https://forum.proxmox.com/threads/proxmox-8-kernel-6-2-16-4-pve-ixgbe-driver-fails-to-load-due-to-pci-device-probing-failure.131203/
Link: https://lore.kernel.org/r/20231121183643.249006-2-helgaas@kernel.org
Tested-by: Tomasz Pala <gotar@polanet.pl>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org	# v6.2+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/x86/pci/mmconfig-shared.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -525,6 +525,8 @@ static bool __ref is_mmconf_reserved(che
 static bool __ref
 pci_mmcfg_check_reserved(struct device *dev, struct pci_mmcfg_region *cfg, int early)
 {
+	struct resource *conflict;
+
 	if (!early && !acpi_disabled) {
 		if (is_mmconf_reserved(is_acpi_reserved, cfg, dev,
 				       "ACPI motherboard resource"))
@@ -542,8 +544,17 @@ pci_mmcfg_check_reserved(struct device *
 			       &cfg->res);
 
 		if (is_mmconf_reserved(is_efi_mmio, cfg, dev,
-				       "EfiMemoryMappedIO"))
+				       "EfiMemoryMappedIO")) {
+			conflict = insert_resource_conflict(&iomem_resource,
+							    &cfg->res);
+			if (conflict)
+				pr_warn("MMCONFIG %pR conflicts with %s %pR\n",
+					&cfg->res, conflict->name, conflict);
+			else
+				pr_info("MMCONFIG %pR reserved to work around lack of ACPI motherboard _CRS\n",
+					&cfg->res);
 			return true;
+		}
 	}
 
 	/*



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 425/583] PCI: dwc: endpoint: Fix dw_pcie_ep_raise_msix_irq() alignment support
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (423 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 424/583] x86/pci: Reserve ECAM if BIOS didnt include it in PNP0C02 _CRS Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 426/583] PCI: mediatek: Clear interrupt status before dispatching handler Greg Kroah-Hartman
                   ` (164 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Niklas Cassel,
	Krzysztof Wilczyński, Manivannan Sadhasivam,
	Kishon Vijay Abraham I

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Niklas Cassel <niklas.cassel@wdc.com>

commit 2217fffcd63f86776c985d42e76daa43a56abdf1 upstream.

Commit 6f5e193bfb55 ("PCI: dwc: Fix dw_pcie_ep_raise_msix_irq() to get
correct MSI-X table address") modified dw_pcie_ep_raise_msix_irq() to
support iATUs which require a specific alignment.

However, this support cannot have been properly tested.

The whole point is for the iATU to map an address that is aligned,
using dw_pcie_ep_map_addr(), and then let the writel() write to
ep->msi_mem + aligned_offset.

Thus, modify the address that is mapped such that it is aligned.
With this change, dw_pcie_ep_raise_msix_irq() matches the logic in
dw_pcie_ep_raise_msi_irq().

Link: https://lore.kernel.org/linux-pci/20231128132231.2221614-1-nks@flawful.org
Fixes: 6f5e193bfb55 ("PCI: dwc: Fix dw_pcie_ep_raise_msix_irq() to get correct MSI-X table address")
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: stable@vger.kernel.org # 5.7
Cc: Kishon Vijay Abraham I <kishon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/pci/controller/dwc/pcie-designware-ep.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/pci/controller/dwc/pcie-designware-ep.c
+++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
@@ -598,6 +598,7 @@ int dw_pcie_ep_raise_msix_irq(struct dw_
 	}
 
 	aligned_offset = msg_addr & (epc->mem->window.page_size - 1);
+	msg_addr &= ~aligned_offset;
 	ret = dw_pcie_ep_map_addr(epc, func_no, 0, ep->msi_mem_phys, msg_addr,
 				  epc->mem->window.page_size);
 	if (ret)



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 426/583] PCI: mediatek: Clear interrupt status before dispatching handler
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (424 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 425/583] PCI: dwc: endpoint: Fix dw_pcie_ep_raise_msix_irq() alignment support Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 427/583] x86/kvm: Do not try to disable kvmclock if it was not enabled Greg Kroah-Hartman
                   ` (163 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, qizhong cheng, Jianjun Wang,
	Krzysztof Wilczyński, Bjorn Helgaas,
	AngeloGioacchino Del Regno

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: qizhong cheng <qizhong.cheng@mediatek.com>

commit 4e11c29873a8a296a20f99b3e03095e65ebf897d upstream.

We found a failure when using the iperf tool during WiFi performance
testing, where some MSIs were received while clearing the interrupt
status, and these MSIs cannot be serviced.

The interrupt status can be cleared even if the MSI status remains pending.
As such, given the edge-triggered interrupt type, its status should be
cleared before being dispatched to the handler of the underling device.

[kwilczynski: commit log, code comment wording]
Link: https://lore.kernel.org/linux-pci/20231211094923.31967-1-jianjun.wang@mediatek.com
Fixes: 43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and MT7622")
Signed-off-by: qizhong cheng <qizhong.cheng@mediatek.com>
Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
[bhelgaas: rewrap comment]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc:  <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/pci/controller/pcie-mediatek.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/drivers/pci/controller/pcie-mediatek.c
+++ b/drivers/pci/controller/pcie-mediatek.c
@@ -617,12 +617,18 @@ static void mtk_pcie_intr_handler(struct
 		if (status & MSI_STATUS){
 			unsigned long imsi_status;
 
+			/*
+			 * The interrupt status can be cleared even if the
+			 * MSI status remains pending. As such, given the
+			 * edge-triggered interrupt type, its status should
+			 * be cleared before being dispatched to the
+			 * handler of the underlying device.
+			 */
+			writel(MSI_STATUS, port->base + PCIE_INT_STATUS);
 			while ((imsi_status = readl(port->base + PCIE_IMSI_STATUS))) {
 				for_each_set_bit(bit, &imsi_status, MTK_MSI_IRQS_NUM)
 					generic_handle_domain_irq(port->inner_domain, bit);
 			}
-			/* Clear MSI interrupt status */
-			writel(MSI_STATUS, port->base + PCIE_INT_STATUS);
 		}
 	}
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 427/583] x86/kvm: Do not try to disable kvmclock if it was not enabled
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (425 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 426/583] PCI: mediatek: Clear interrupt status before dispatching handler Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:57 ` [PATCH 6.6 428/583] KVM: arm64: vgic-v4: Restore pending state on host userspace write Greg Kroah-Hartman
                   ` (162 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kirill A. Shutemov,
	Sean Christopherson, Vitaly Kuznetsov, Paolo Bonzini, Wanpeng Li

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

commit 1c6d984f523f67ecfad1083bb04c55d91977bb15 upstream.

kvm_guest_cpu_offline() tries to disable kvmclock regardless if it is
present in the VM. It leads to write to a MSR that doesn't exist on some
configurations, namely in TDX guest:

	unchecked MSR access error: WRMSR to 0x12 (tried to write 0x0000000000000000)
	at rIP: 0xffffffff8110687c (kvmclock_disable+0x1c/0x30)

kvmclock enabling is gated by CLOCKSOURCE and CLOCKSOURCE2 KVM paravirt
features.

Do not disable kvmclock if it was not enabled.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Fixes: c02027b5742b ("x86/kvm: Disable kvmclock on all CPUs on shutdown")
Reviewed-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Wanpeng Li <wanpengli@tencent.com>
Cc: stable@vger.kernel.org
Message-Id: <20231205004510.27164-6-kirill.shutemov@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/x86/kernel/kvmclock.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -24,8 +24,8 @@
 
 static int kvmclock __initdata = 1;
 static int kvmclock_vsyscall __initdata = 1;
-static int msr_kvm_system_time __ro_after_init = MSR_KVM_SYSTEM_TIME;
-static int msr_kvm_wall_clock __ro_after_init = MSR_KVM_WALL_CLOCK;
+static int msr_kvm_system_time __ro_after_init;
+static int msr_kvm_wall_clock __ro_after_init;
 static u64 kvm_sched_clock_offset __ro_after_init;
 
 static int __init parse_no_kvmclock(char *arg)
@@ -195,7 +195,8 @@ static void kvm_setup_secondary_clock(vo
 
 void kvmclock_disable(void)
 {
-	native_write_msr(msr_kvm_system_time, 0, 0);
+	if (msr_kvm_system_time)
+		native_write_msr(msr_kvm_system_time, 0, 0);
 }
 
 static void __init kvmclock_init_mem(void)
@@ -294,7 +295,10 @@ void __init kvmclock_init(void)
 	if (kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE2)) {
 		msr_kvm_system_time = MSR_KVM_SYSTEM_TIME_NEW;
 		msr_kvm_wall_clock = MSR_KVM_WALL_CLOCK_NEW;
-	} else if (!kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE)) {
+	} else if (kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE)) {
+		msr_kvm_system_time = MSR_KVM_SYSTEM_TIME;
+		msr_kvm_wall_clock = MSR_KVM_WALL_CLOCK;
+	} else {
 		return;
 	}
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 428/583] KVM: arm64: vgic-v4: Restore pending state on host userspace write
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (426 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 427/583] x86/kvm: Do not try to disable kvmclock if it was not enabled Greg Kroah-Hartman
@ 2024-01-22 23:57 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 429/583] KVM: arm64: vgic-its: Avoid potential UAF in LPI translation cache Greg Kroah-Hartman
                   ` (161 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:57 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kunkun Jiang, Marc Zyngier, Zenghui Yu

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Marc Zyngier <maz@kernel.org>

commit 7b95382f965133ef61ce44aaabc518c16eb46909 upstream.

When the VMM writes to ISPENDR0 to set the state pending state of
an SGI, we fail to convey this to the HW if this SGI is already
backed by a GICv4.1 vSGI.

This is a bit of a corner case, as this would only occur if the
vgic state is changed on an already running VM, but this can
apparently happen across a guest reset driven by the VMM.

Fix this by always writing out the pending_latch value to the
HW, and reseting it to false.

Reported-by: Kunkun Jiang <jiangkunkun@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Cc: stable@vger.kernel.org # 5.10+
Link: https://lore.kernel.org/r/7e7f2c0c-448b-10a9-8929-4b8f4f6e2a32@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/arm64/kvm/vgic/vgic-mmio-v3.c |   27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

--- a/arch/arm64/kvm/vgic/vgic-mmio-v3.c
+++ b/arch/arm64/kvm/vgic/vgic-mmio-v3.c
@@ -365,19 +365,26 @@ static int vgic_v3_uaccess_write_pending
 		struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i);
 
 		raw_spin_lock_irqsave(&irq->irq_lock, flags);
-		if (test_bit(i, &val)) {
-			/*
-			 * pending_latch is set irrespective of irq type
-			 * (level or edge) to avoid dependency that VM should
-			 * restore irq config before pending info.
-			 */
-			irq->pending_latch = true;
-			vgic_queue_irq_unlock(vcpu->kvm, irq, flags);
-		} else {
+
+		/*
+		 * pending_latch is set irrespective of irq type
+		 * (level or edge) to avoid dependency that VM should
+		 * restore irq config before pending info.
+		 */
+		irq->pending_latch = test_bit(i, &val);
+
+		if (irq->hw && vgic_irq_is_sgi(irq->intid)) {
+			irq_set_irqchip_state(irq->host_irq,
+					      IRQCHIP_STATE_PENDING,
+					      irq->pending_latch);
 			irq->pending_latch = false;
-			raw_spin_unlock_irqrestore(&irq->irq_lock, flags);
 		}
 
+		if (irq->pending_latch)
+			vgic_queue_irq_unlock(vcpu->kvm, irq, flags);
+		else
+			raw_spin_unlock_irqrestore(&irq->irq_lock, flags);
+
 		vgic_put_irq(vcpu->kvm, irq);
 	}
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 429/583] KVM: arm64: vgic-its: Avoid potential UAF in LPI translation cache
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (427 preceding siblings ...)
  2024-01-22 23:57 ` [PATCH 6.6 428/583] KVM: arm64: vgic-v4: Restore pending state on host userspace write Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 430/583] KVM: x86/pmu: Move PMU reset logic to common x86 code Greg Kroah-Hartman
                   ` (160 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Oliver Upton, Marc Zyngier

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Oliver Upton <oliver.upton@linux.dev>

commit ad362fe07fecf0aba839ff2cc59a3617bd42c33f upstream.

There is a potential UAF scenario in the case of an LPI translation
cache hit racing with an operation that invalidates the cache, such
as a DISCARD ITS command. The root of the problem is that
vgic_its_check_cache() does not elevate the refcount on the vgic_irq
before dropping the lock that serializes refcount changes.

Have vgic_its_check_cache() raise the refcount on the returned vgic_irq
and add the corresponding decrement after queueing the interrupt.

Cc: stable@vger.kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240104183233.3560639-1-oliver.upton@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/arm64/kvm/vgic/vgic-its.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/arch/arm64/kvm/vgic/vgic-its.c
+++ b/arch/arm64/kvm/vgic/vgic-its.c
@@ -584,7 +584,11 @@ static struct vgic_irq *vgic_its_check_c
 	unsigned long flags;
 
 	raw_spin_lock_irqsave(&dist->lpi_list_lock, flags);
+
 	irq = __vgic_its_check_cache(dist, db, devid, eventid);
+	if (irq)
+		vgic_get_irq_kref(irq);
+
 	raw_spin_unlock_irqrestore(&dist->lpi_list_lock, flags);
 
 	return irq;
@@ -763,6 +767,7 @@ int vgic_its_inject_cached_translation(s
 	raw_spin_lock_irqsave(&irq->irq_lock, flags);
 	irq->pending_latch = true;
 	vgic_queue_irq_unlock(kvm, irq, flags);
+	vgic_put_irq(kvm, irq);
 
 	return 0;
 }



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 430/583] KVM: x86/pmu: Move PMU reset logic to common x86 code
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (428 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 429/583] KVM: arm64: vgic-its: Avoid potential UAF in LPI translation cache Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 431/583] KVM: x86/pmu: Reset the PMU, i.e. stop counters, before refreshing Greg Kroah-Hartman
                   ` (159 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Dapeng Mi, Sean Christopherson

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sean Christopherson <seanjc@google.com>

commit cbb359d81a2695bb5e63ec9de06fcbef28518891 upstream.

Move the common (or at least "ignored") aspects of resetting the vPMU to
common x86 code, along with the stop/release helpers that are no used only
by the common pmu.c.

There is no need to manually handle fixed counters as all_valid_pmc_idx
tracks both fixed and general purpose counters, and resetting the vPMU is
far from a hot path, i.e. the extra bit of overhead to the PMC from the
index is a non-issue.

Zero fixed_ctr_ctrl in common code even though it's Intel specific.
Ensuring it's zero doesn't harm AMD/SVM in any way, and stopping the fixed
counters via all_valid_pmc_idx, but not clearing the associated control
bits, would be odd/confusing.

Make the .reset() hook optional as SVM no longer needs vendor specific
handling.

Cc: stable@vger.kernel.org
Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://lore.kernel.org/r/20231103230541.352265-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/x86/include/asm/kvm-x86-pmu-ops.h |    2 -
 arch/x86/kvm/pmu.c                     |   40 ++++++++++++++++++++++++++++++++-
 arch/x86/kvm/pmu.h                     |   18 --------------
 arch/x86/kvm/svm/pmu.c                 |   16 -------------
 arch/x86/kvm/vmx/pmu_intel.c           |   20 ----------------
 5 files changed, 40 insertions(+), 56 deletions(-)

--- a/arch/x86/include/asm/kvm-x86-pmu-ops.h
+++ b/arch/x86/include/asm/kvm-x86-pmu-ops.h
@@ -22,7 +22,7 @@ KVM_X86_PMU_OP(get_msr)
 KVM_X86_PMU_OP(set_msr)
 KVM_X86_PMU_OP(refresh)
 KVM_X86_PMU_OP(init)
-KVM_X86_PMU_OP(reset)
+KVM_X86_PMU_OP_OPTIONAL(reset)
 KVM_X86_PMU_OP_OPTIONAL(deliver_pmi)
 KVM_X86_PMU_OP_OPTIONAL(cleanup)
 
--- a/arch/x86/kvm/pmu.c
+++ b/arch/x86/kvm/pmu.c
@@ -250,6 +250,24 @@ static bool pmc_resume_counter(struct kv
 	return true;
 }
 
+static void pmc_release_perf_event(struct kvm_pmc *pmc)
+{
+	if (pmc->perf_event) {
+		perf_event_release_kernel(pmc->perf_event);
+		pmc->perf_event = NULL;
+		pmc->current_config = 0;
+		pmc_to_pmu(pmc)->event_count--;
+	}
+}
+
+static void pmc_stop_counter(struct kvm_pmc *pmc)
+{
+	if (pmc->perf_event) {
+		pmc->counter = pmc_read_counter(pmc);
+		pmc_release_perf_event(pmc);
+	}
+}
+
 static int filter_cmp(const void *pa, const void *pb, u64 mask)
 {
 	u64 a = *(u64 *)pa & mask;
@@ -654,7 +672,27 @@ void kvm_pmu_refresh(struct kvm_vcpu *vc
 
 void kvm_pmu_reset(struct kvm_vcpu *vcpu)
 {
-	static_call(kvm_x86_pmu_reset)(vcpu);
+	struct kvm_pmu *pmu = vcpu_to_pmu(vcpu);
+	struct kvm_pmc *pmc;
+	int i;
+
+	bitmap_zero(pmu->reprogram_pmi, X86_PMC_IDX_MAX);
+
+	for_each_set_bit(i, pmu->all_valid_pmc_idx, X86_PMC_IDX_MAX) {
+		pmc = static_call(kvm_x86_pmu_pmc_idx_to_pmc)(pmu, i);
+		if (!pmc)
+			continue;
+
+		pmc_stop_counter(pmc);
+		pmc->counter = 0;
+
+		if (pmc_is_gp(pmc))
+			pmc->eventsel = 0;
+	}
+
+	pmu->fixed_ctr_ctrl = pmu->global_ctrl = pmu->global_status = 0;
+
+	static_call_cond(kvm_x86_pmu_reset)(vcpu);
 }
 
 void kvm_pmu_init(struct kvm_vcpu *vcpu)
--- a/arch/x86/kvm/pmu.h
+++ b/arch/x86/kvm/pmu.h
@@ -80,24 +80,6 @@ static inline void pmc_write_counter(str
 	pmc->counter &= pmc_bitmask(pmc);
 }
 
-static inline void pmc_release_perf_event(struct kvm_pmc *pmc)
-{
-	if (pmc->perf_event) {
-		perf_event_release_kernel(pmc->perf_event);
-		pmc->perf_event = NULL;
-		pmc->current_config = 0;
-		pmc_to_pmu(pmc)->event_count--;
-	}
-}
-
-static inline void pmc_stop_counter(struct kvm_pmc *pmc)
-{
-	if (pmc->perf_event) {
-		pmc->counter = pmc_read_counter(pmc);
-		pmc_release_perf_event(pmc);
-	}
-}
-
 static inline bool pmc_is_gp(struct kvm_pmc *pmc)
 {
 	return pmc->type == KVM_PMC_GP;
--- a/arch/x86/kvm/svm/pmu.c
+++ b/arch/x86/kvm/svm/pmu.c
@@ -233,21 +233,6 @@ static void amd_pmu_init(struct kvm_vcpu
 	}
 }
 
-static void amd_pmu_reset(struct kvm_vcpu *vcpu)
-{
-	struct kvm_pmu *pmu = vcpu_to_pmu(vcpu);
-	int i;
-
-	for (i = 0; i < KVM_AMD_PMC_MAX_GENERIC; i++) {
-		struct kvm_pmc *pmc = &pmu->gp_counters[i];
-
-		pmc_stop_counter(pmc);
-		pmc->counter = pmc->prev_counter = pmc->eventsel = 0;
-	}
-
-	pmu->global_ctrl = pmu->global_status = 0;
-}
-
 struct kvm_pmu_ops amd_pmu_ops __initdata = {
 	.hw_event_available = amd_hw_event_available,
 	.pmc_idx_to_pmc = amd_pmc_idx_to_pmc,
@@ -259,7 +244,6 @@ struct kvm_pmu_ops amd_pmu_ops __initdat
 	.set_msr = amd_pmu_set_msr,
 	.refresh = amd_pmu_refresh,
 	.init = amd_pmu_init,
-	.reset = amd_pmu_reset,
 	.EVENTSEL_EVENT = AMD64_EVENTSEL_EVENT,
 	.MAX_NR_GP_COUNTERS = KVM_AMD_PMC_MAX_GENERIC,
 	.MIN_NR_GP_COUNTERS = AMD64_NUM_COUNTERS,
--- a/arch/x86/kvm/vmx/pmu_intel.c
+++ b/arch/x86/kvm/vmx/pmu_intel.c
@@ -632,26 +632,6 @@ static void intel_pmu_init(struct kvm_vc
 
 static void intel_pmu_reset(struct kvm_vcpu *vcpu)
 {
-	struct kvm_pmu *pmu = vcpu_to_pmu(vcpu);
-	struct kvm_pmc *pmc = NULL;
-	int i;
-
-	for (i = 0; i < KVM_INTEL_PMC_MAX_GENERIC; i++) {
-		pmc = &pmu->gp_counters[i];
-
-		pmc_stop_counter(pmc);
-		pmc->counter = pmc->prev_counter = pmc->eventsel = 0;
-	}
-
-	for (i = 0; i < KVM_PMC_MAX_FIXED; i++) {
-		pmc = &pmu->fixed_counters[i];
-
-		pmc_stop_counter(pmc);
-		pmc->counter = pmc->prev_counter = 0;
-	}
-
-	pmu->fixed_ctr_ctrl = pmu->global_ctrl = pmu->global_status = 0;
-
 	intel_pmu_release_guest_lbr_event(vcpu);
 }
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 431/583] KVM: x86/pmu: Reset the PMU, i.e. stop counters, before refreshing
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (429 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 430/583] KVM: x86/pmu: Move PMU reset logic to common x86 code Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 432/583] iio: adc: ad7091r: Pass iio_dev to event handler Greg Kroah-Hartman
                   ` (158 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Dapeng Mi, Sean Christopherson

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sean Christopherson <seanjc@google.com>

commit 1647b52757d59131fe30cf73fa36fac834d4367f upstream.

Stop all counters and release all perf events before refreshing the vPMU,
i.e. before reconfiguring the vPMU to respond to changes in the vCPU
model.

Clear need_cleanup in kvm_pmu_reset() as well so that KVM doesn't
prematurely stop counters, e.g. if KVM enters the guest and enables
counters before the vCPU is scheduled out.

Cc: stable@vger.kernel.org
Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://lore.kernel.org/r/20231103230541.352265-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/x86/kvm/pmu.c |   35 ++++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 13 deletions(-)

--- a/arch/x86/kvm/pmu.c
+++ b/arch/x86/kvm/pmu.c
@@ -657,25 +657,14 @@ int kvm_pmu_set_msr(struct kvm_vcpu *vcp
 	return 0;
 }
 
-/* refresh PMU settings. This function generally is called when underlying
- * settings are changed (such as changes of PMU CPUID by guest VMs), which
- * should rarely happen.
- */
-void kvm_pmu_refresh(struct kvm_vcpu *vcpu)
-{
-	if (KVM_BUG_ON(kvm_vcpu_has_run(vcpu), vcpu->kvm))
-		return;
-
-	bitmap_zero(vcpu_to_pmu(vcpu)->all_valid_pmc_idx, X86_PMC_IDX_MAX);
-	static_call(kvm_x86_pmu_refresh)(vcpu);
-}
-
 void kvm_pmu_reset(struct kvm_vcpu *vcpu)
 {
 	struct kvm_pmu *pmu = vcpu_to_pmu(vcpu);
 	struct kvm_pmc *pmc;
 	int i;
 
+	pmu->need_cleanup = false;
+
 	bitmap_zero(pmu->reprogram_pmi, X86_PMC_IDX_MAX);
 
 	for_each_set_bit(i, pmu->all_valid_pmc_idx, X86_PMC_IDX_MAX) {
@@ -695,6 +684,26 @@ void kvm_pmu_reset(struct kvm_vcpu *vcpu
 	static_call_cond(kvm_x86_pmu_reset)(vcpu);
 }
 
+
+/*
+ * Refresh the PMU configuration for the vCPU, e.g. if userspace changes CPUID
+ * and/or PERF_CAPABILITIES.
+ */
+void kvm_pmu_refresh(struct kvm_vcpu *vcpu)
+{
+	if (KVM_BUG_ON(kvm_vcpu_has_run(vcpu), vcpu->kvm))
+		return;
+
+	/*
+	 * Stop/release all existing counters/events before realizing the new
+	 * vPMU model.
+	 */
+	kvm_pmu_reset(vcpu);
+
+	bitmap_zero(vcpu_to_pmu(vcpu)->all_valid_pmc_idx, X86_PMC_IDX_MAX);
+	static_call(kvm_x86_pmu_refresh)(vcpu);
+}
+
 void kvm_pmu_init(struct kvm_vcpu *vcpu)
 {
 	struct kvm_pmu *pmu = vcpu_to_pmu(vcpu);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 432/583] iio: adc: ad7091r: Pass iio_dev to event handler
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (430 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 431/583] KVM: x86/pmu: Reset the PMU, i.e. stop counters, before refreshing Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 433/583] HID: sensor-hub: Enable hid core report processing for all devices Greg Kroah-Hartman
                   ` (157 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Marcelo Schmitt, Stable, Jonathan Cameron

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Marcelo Schmitt <marcelo.schmitt@analog.com>

commit a25a7df518fc71b1ba981d691e9322e645d2689c upstream.

Previous version of ad7091r event handler received the ADC state pointer
and retrieved the iio device from driver data field with dev_get_drvdata().
However, no driver data have ever been set, which led to null pointer
dereference when running the event handler.

Pass the iio device to the event handler and retrieve the ADC state struct
from it so we avoid the null pointer dereference and save the driver from
filling the driver data field.

Fixes: ca69300173b6 ("iio: adc: Add support for AD7091R5 ADC")
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
Link: https://lore.kernel.org/r/5024b764107463de9578d5b3b0a3d5678e307b1a.1702746240.git.marcelo.schmitt1@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/iio/adc/ad7091r-base.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/iio/adc/ad7091r-base.c
+++ b/drivers/iio/adc/ad7091r-base.c
@@ -174,8 +174,8 @@ static const struct iio_info ad7091r_inf
 
 static irqreturn_t ad7091r_event_handler(int irq, void *private)
 {
-	struct ad7091r_state *st = (struct ad7091r_state *) private;
-	struct iio_dev *iio_dev = dev_get_drvdata(st->dev);
+	struct iio_dev *iio_dev = private;
+	struct ad7091r_state *st = iio_priv(iio_dev);
 	unsigned int i, read_val;
 	int ret;
 	s64 timestamp = iio_get_time_ns(iio_dev);
@@ -234,7 +234,7 @@ int ad7091r_probe(struct device *dev, co
 	if (irq) {
 		ret = devm_request_threaded_irq(dev, irq, NULL,
 				ad7091r_event_handler,
-				IRQF_TRIGGER_FALLING | IRQF_ONESHOT, name, st);
+				IRQF_TRIGGER_FALLING | IRQF_ONESHOT, name, iio_dev);
 		if (ret)
 			return ret;
 	}



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 433/583] HID: sensor-hub: Enable hid core report processing for all devices
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (431 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 432/583] iio: adc: ad7091r: Pass iio_dev to event handler Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 434/583] HID: wacom: Correct behavior when processing some confidence == false touches Greg Kroah-Hartman
                   ` (156 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Yauhen Kharuzhy, Daniel Thompson,
	Srinivas Pandruvada, Benjamin Tissoires

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yauhen Kharuzhy <jekhor@gmail.com>

commit 8e2f79f41a5d1b1a4a53ec524eb7609ca89f3c65 upstream.

After the commit 666cf30a589a ("HID: sensor-hub: Allow multi-function
sensor devices") hub devices are claimed by hidraw driver in hid_connect().
This causes stoppping of processing HID reports by hid core due to
optimization.

In such case, the hid-sensor-custom driver cannot match a known custom
sensor in hid_sensor_custom_get_known() because it try to check custom
properties which weren't filled from the report because hid core didn't
parsed it.

As result, custom sensors like hinge angle sensor and LISS sensors
don't work.

Mark the sensor hub devices claimed by some driver to avoid hidraw-related
optimizations.

Fixes: 666cf30a589a ("HID: sensor-hub: Allow multi-function sensor devices")
Cc: stable@vger.kernel.org
Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
Tested-by: Daniel Thompson <daniel.thompson@linaro.org>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20231219231503.1506801-1-jekhor@gmail.com
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/hid/hid-sensor-hub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index 2eba152e8b90..26e93a331a51 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -632,7 +632,7 @@ static int sensor_hub_probe(struct hid_device *hdev,
 	}
 	INIT_LIST_HEAD(&hdev->inputs);
 
-	ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
+	ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT | HID_CONNECT_DRIVER);
 	if (ret) {
 		hid_err(hdev, "hw start failed\n");
 		return ret;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 434/583] HID: wacom: Correct behavior when processing some confidence == false touches
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (432 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 433/583] HID: sensor-hub: Enable hid core report processing for all devices Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 435/583] serial: sc16is7xx: add check for unsupported SPI modes during probe Greg Kroah-Hartman
                   ` (155 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Tatsunosuke Tobita, Ping Cheng,
	Jason Gerecke, Jiri Kosina

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jason Gerecke <jason.gerecke@wacom.com>

commit 502296030ec6b0329e00f9fb15018e170cc63037 upstream.

There appear to be a few different ways that Wacom devices can deal with
confidence:

  1. If the device looses confidence in a touch, it will first clear
     the tipswitch flag in one report, and then clear the confidence
     flag in a second report. This behavior is used by e.g. DTH-2452.

  2. If the device looses confidence in a touch, it will clear both
     the tipswitch and confidence flags within the same report. This
     behavior is used by some AES devices.

  3. If the device looses confidence in a touch, it will clear *only*
     the confidence bit. The tipswitch bit will remain set so long as
     the touch is tracked. This behavior may be used in future devices.

The driver does not currently handle situation 3 properly. Touches that
loose confidence will remain "in prox" and essentially frozen in place
until the tipswitch bit is finally cleared. Not only does this result
in userspace seeing a stuck touch, but it also prevents pen arbitration
from working properly (the pen won't send events until all touches are
up, but we don't currently process events from non-confident touches).

This commit centralizes the checking of the confidence bit in the
wacom_wac_finger_slot() function and has 'prox' depend on it. In the
case where situation 3 is encountered, the treat the touch as though
it was removed, allowing both userspace and the pen arbitration to
act normally.

Signed-off-by: Tatsunosuke Tobita <tatsunosuke.tobita@wacom.com>
Signed-off-by: Ping Cheng <ping.cheng@wacom.com>
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Fixes: 7fb0413baa7f ("HID: wacom: Use "Confidence" flag to prevent reporting invalid contacts")
Cc: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/hid/wacom_wac.c |   32 ++++----------------------------
 1 file changed, 4 insertions(+), 28 deletions(-)

--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -2649,8 +2649,8 @@ static void wacom_wac_finger_slot(struct
 {
 	struct hid_data *hid_data = &wacom_wac->hid_data;
 	bool mt = wacom_wac->features.touch_max > 1;
-	bool prox = hid_data->tipswitch &&
-		    report_touch_events(wacom_wac);
+	bool touch_down = hid_data->tipswitch && hid_data->confidence;
+	bool prox = touch_down && report_touch_events(wacom_wac);
 
 	if (touch_is_muted(wacom_wac)) {
 		if (!wacom_wac->shared->touch_down)
@@ -2700,24 +2700,6 @@ static void wacom_wac_finger_slot(struct
 	}
 }
 
-static bool wacom_wac_slot_is_active(struct input_dev *dev, int key)
-{
-	struct input_mt *mt = dev->mt;
-	struct input_mt_slot *s;
-
-	if (!mt)
-		return false;
-
-	for (s = mt->slots; s != mt->slots + mt->num_slots; s++) {
-		if (s->key == key &&
-			input_mt_get_value(s, ABS_MT_TRACKING_ID) >= 0) {
-			return true;
-		}
-	}
-
-	return false;
-}
-
 static void wacom_wac_finger_event(struct hid_device *hdev,
 		struct hid_field *field, struct hid_usage *usage, __s32 value)
 {
@@ -2768,14 +2750,8 @@ static void wacom_wac_finger_event(struc
 	}
 
 	if (usage->usage_index + 1 == field->report_count) {
-		if (equivalent_usage == wacom_wac->hid_data.last_slot_field) {
-			bool touch_removed = wacom_wac_slot_is_active(wacom_wac->touch_input,
-				wacom_wac->hid_data.id) && !wacom_wac->hid_data.tipswitch;
-
-			if (wacom_wac->hid_data.confidence || touch_removed) {
-				wacom_wac_finger_slot(wacom_wac, wacom_wac->touch_input);
-			}
-		}
+		if (equivalent_usage == wacom_wac->hid_data.last_slot_field)
+			wacom_wac_finger_slot(wacom_wac, wacom_wac->touch_input);
 	}
 }
 



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 435/583] serial: sc16is7xx: add check for unsupported SPI modes during probe
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (433 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 434/583] HID: wacom: Correct behavior when processing some confidence == false touches Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 436/583] serial: sc16is7xx: set safe default SPI clock frequency Greg Kroah-Hartman
                   ` (154 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Hugo Villeneuve

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hugo Villeneuve <hvilleneuve@dimonoff.com>

commit 6d710b769c1f5f0d55c9ad9bb49b7dce009ec103 upstream.

The original comment is confusing because it implies that variants other
than the SC16IS762 supports other SPI modes beside SPI_MODE_0.

Extract from datasheet:
    The SC16IS762 differs from the SC16IS752 in that it supports SPI clock
    speeds up to 15 Mbit/s instead of the 4 Mbit/s supported by the
    SC16IS752... In all other aspects, the SC16IS762 is functionally and
    electrically the same as the SC16IS752.

The same is also true of the SC16IS760 variant versus the SC16IS740 and
SC16IS750 variants.

For all variants, only SPI mode 0 is supported.

Change comment and abort probing if the specified SPI mode is not
SPI_MODE_0.

Fixes: 2c837a8a8f9f ("sc16is7xx: spi interface is added")
Cc:  <stable@vger.kernel.org>
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://lore.kernel.org/r/20231221231823.2327894-3-hugo@hugovil.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/tty/serial/sc16is7xx.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1714,7 +1714,10 @@ static int sc16is7xx_spi_probe(struct sp
 
 	/* Setup SPI bus */
 	spi->bits_per_word	= 8;
-	/* only supports mode 0 on SC16IS762 */
+	/* For all variants, only mode 0 is supported */
+	if ((spi->mode & SPI_MODE_X_MASK) != SPI_MODE_0)
+		return dev_err_probe(&spi->dev, -EINVAL, "Unsupported SPI mode\n");
+
 	spi->mode		= spi->mode ? : SPI_MODE_0;
 	spi->max_speed_hz	= spi->max_speed_hz ? : 15000000;
 	ret = spi_setup(spi);



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 436/583] serial: sc16is7xx: set safe default SPI clock frequency
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (434 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 435/583] serial: sc16is7xx: add check for unsupported SPI modes during probe Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58   ` Greg Kroah-Hartman
                   ` (153 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Hugo Villeneuve

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hugo Villeneuve <hvilleneuve@dimonoff.com>

commit 3ef79cd1412236d884ab0c46b4d1921380807b48 upstream.

15 MHz is supported only by 76x variants.

If the SPI clock frequency is not specified, use a safe default clock value
of 4 MHz that is supported by all variants.

Also use HZ_PER_MHZ macro to improve readability.

Fixes: 2c837a8a8f9f ("sc16is7xx: spi interface is added")
Cc:  <stable@vger.kernel.org>
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://lore.kernel.org/r/20231221231823.2327894-4-hugo@hugovil.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/tty/serial/sc16is7xx.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -24,6 +24,7 @@
 #include <linux/tty_flip.h>
 #include <linux/spi/spi.h>
 #include <linux/uaccess.h>
+#include <linux/units.h>
 #include <uapi/linux/sched/types.h>
 
 #define SC16IS7XX_NAME			"sc16is7xx"
@@ -1719,7 +1720,7 @@ static int sc16is7xx_spi_probe(struct sp
 		return dev_err_probe(&spi->dev, -EINVAL, "Unsupported SPI mode\n");
 
 	spi->mode		= spi->mode ? : SPI_MODE_0;
-	spi->max_speed_hz	= spi->max_speed_hz ? : 15000000;
+	spi->max_speed_hz	= spi->max_speed_hz ? : 4 * HZ_PER_MHZ;
 	ret = spi_setup(spi);
 	if (ret)
 		return ret;



^ permalink raw reply	[flat|nested] 599+ messages in thread

* [PATCH 6.6 437/583] ARM: 9330/1: davinci: also select PINCTRL
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
@ 2024-01-22 23:58   ` Greg Kroah-Hartman
  2024-01-22 23:50 ` [PATCH 6.6 002/583] x86/mce/inject: Clear test status value Greg Kroah-Hartman
                     ` (588 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Randy Dunlap, kernel test robot,
	Bartosz Golaszewski, Arnd Bergmann, linux-arm-kernel, patches,
	Russell King (Oracle),
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Randy Dunlap <rdunlap@infradead.org>

[ Upstream commit f54e8634d1366926c807e2af6125b33cff555fa7 ]

kconfig warns when PINCTRL_SINGLE is selected but PINCTRL is not
set, so also set PINCTRL for ARCH_DAVINCI. This prevents a
kconfig/build warning:

   WARNING: unmet direct dependencies detected for PINCTRL_SINGLE
     Depends on [n]: PINCTRL [=n] && OF [=y] && HAS_IOMEM [=y]
     Selected by [y]:
     - ARCH_DAVINCI [=y] && ARCH_MULTI_V5 [=y]

Closes: lore.kernel.org/r/202311070548.0f6XfBrh-lkp@intel.com

Fixes: f962396ce292 ("ARM: davinci: support multiplatform build for ARM v5")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: patches@armlinux.org.uk
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/mach-davinci/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 59de137c6f53..2a8a9fe46586 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -11,6 +11,7 @@ menuconfig ARCH_DAVINCI
 	select PM_GENERIC_DOMAINS_OF if PM && OF
 	select REGMAP_MMIO
 	select RESET_CONTROLLER
+	select PINCTRL
 	select PINCTRL_SINGLE
 
 if ARCH_DAVINCI
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 437/583] ARM: 9330/1: davinci: also select PINCTRL
@ 2024-01-22 23:58   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Randy Dunlap, kernel test robot,
	Bartosz Golaszewski, Arnd Bergmann, linux-arm-kernel, patches,
	Russell King (Oracle),
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Randy Dunlap <rdunlap@infradead.org>

[ Upstream commit f54e8634d1366926c807e2af6125b33cff555fa7 ]

kconfig warns when PINCTRL_SINGLE is selected but PINCTRL is not
set, so also set PINCTRL for ARCH_DAVINCI. This prevents a
kconfig/build warning:

   WARNING: unmet direct dependencies detected for PINCTRL_SINGLE
     Depends on [n]: PINCTRL [=n] && OF [=y] && HAS_IOMEM [=y]
     Selected by [y]:
     - ARCH_DAVINCI [=y] && ARCH_MULTI_V5 [=y]

Closes: lore.kernel.org/r/202311070548.0f6XfBrh-lkp@intel.com

Fixes: f962396ce292 ("ARM: davinci: support multiplatform build for ARM v5")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: patches@armlinux.org.uk
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm/mach-davinci/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 59de137c6f53..2a8a9fe46586 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -11,6 +11,7 @@ menuconfig ARCH_DAVINCI
 	select PM_GENERIC_DOMAINS_OF if PM && OF
 	select REGMAP_MMIO
 	select RESET_CONTROLLER
+	select PINCTRL
 	select PINCTRL_SINGLE
 
 if ARCH_DAVINCI
-- 
2.43.0




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 438/583] mfd: rk8xx: fixup devices registration with PLATFORM_DEVID_AUTO
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (436 preceding siblings ...)
  2024-01-22 23:58   ` Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 439/583] mfd: cs42l43: Correct SoundWire port list Greg Kroah-Hartman
                   ` (151 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Adam Green, Neil Armstrong,
	Sebastian Reichel, Lee Jones, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Neil Armstrong <neil.armstrong@linaro.org>

[ Upstream commit 4aedcd4aa61d536ca17e67ecd5bc5d42529164f4 ]

Since commit 210f418f8ace ("mfd: rk8xx: Add rk806 support"), devices are
registered with "0" as id, causing devices to not have an automatic device id
and prevents having multiple RK8xx PMICs on the same system.

Properly pass PLATFORM_DEVID_AUTO to devm_mfd_add_devices() and since
it will ignore the cells .id with this special value, also cleanup
by removing all now ignored cells .id values.

Now we have the same behaviour as before rk806 introduction and rk806
retains the intended behavior.

This fixes a regression while booting the Odroid Go Ultra on v6.6.1:
sysfs: cannot create duplicate filename '/bus/platform/devices/rk808-clkout'
CPU: 3 PID: 97 Comm: kworker/u12:2 Not tainted 6.6.1 #1
Hardware name: Hardkernel ODROID-GO-Ultra (DT)
Workqueue: events_unbound deferred_probe_work_func
Call trace:
dump_backtrace+0x9c/0x11c
show_stack+0x18/0x24
dump_stack_lvl+0x78/0xc4
dump_stack+0x18/0x24
sysfs_warn_dup+0x64/0x80
sysfs_do_create_link_sd+0xf0/0xf8
sysfs_create_link+0x20/0x40
bus_add_device+0x114/0x160
device_add+0x3f0/0x7cc
platform_device_add+0x180/0x270
mfd_add_device+0x390/0x4a8
devm_mfd_add_devices+0xb0/0x150
rk8xx_probe+0x26c/0x410
rk8xx_i2c_probe+0x64/0x98
i2c_device_probe+0x104/0x2e8
really_probe+0x184/0x3c8
__driver_probe_device+0x7c/0x16c
driver_probe_device+0x3c/0x10c
__device_attach_driver+0xbc/0x158
bus_for_each_drv+0x80/0xdc
__device_attach+0x9c/0x1ac
device_initial_probe+0x14/0x20
bus_probe_device+0xac/0xb0
deferred_probe_work_func+0xa0/0xf4
process_one_work+0x1bc/0x378
worker_thread+0x1dc/0x3d4
kthread+0x104/0x118
ret_from_fork+0x10/0x20
rk8xx-i2c 0-001c: error -EEXIST: failed to add MFD devices
rk8xx-i2c: probe of 0-001c failed with error -17

Fixes: 210f418f8ace ("mfd: rk8xx: Add rk806 support")
Reported-by: Adam Green <greena88@gmail.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20231116-topic-amlogic-upstream-fix-rk8xx-devid-auto-v2-1-3f1bad68ab9d@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/mfd/rk8xx-core.c | 34 +++++++++++++---------------------
 1 file changed, 13 insertions(+), 21 deletions(-)

diff --git a/drivers/mfd/rk8xx-core.c b/drivers/mfd/rk8xx-core.c
index 11a831e92da8..a577f950c632 100644
--- a/drivers/mfd/rk8xx-core.c
+++ b/drivers/mfd/rk8xx-core.c
@@ -53,76 +53,68 @@ static const struct resource rk817_charger_resources[] = {
 };
 
 static const struct mfd_cell rk805s[] = {
-	{ .name = "rk808-clkout", .id = PLATFORM_DEVID_NONE, },
-	{ .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, },
-	{ .name = "rk805-pinctrl", .id = PLATFORM_DEVID_NONE, },
+	{ .name = "rk808-clkout", },
+	{ .name = "rk808-regulator", },
+	{ .name = "rk805-pinctrl", },
 	{
 		.name = "rk808-rtc",
 		.num_resources = ARRAY_SIZE(rtc_resources),
 		.resources = &rtc_resources[0],
-		.id = PLATFORM_DEVID_NONE,
 	},
 	{	.name = "rk805-pwrkey",
 		.num_resources = ARRAY_SIZE(rk805_key_resources),
 		.resources = &rk805_key_resources[0],
-		.id = PLATFORM_DEVID_NONE,
 	},
 };
 
 static const struct mfd_cell rk806s[] = {
-	{ .name = "rk805-pinctrl", .id = PLATFORM_DEVID_AUTO, },
-	{ .name = "rk808-regulator", .id = PLATFORM_DEVID_AUTO, },
+	{ .name = "rk805-pinctrl", },
+	{ .name = "rk808-regulator", },
 	{
 		.name = "rk805-pwrkey",
 		.resources = rk806_pwrkey_resources,
 		.num_resources = ARRAY_SIZE(rk806_pwrkey_resources),
-		.id = PLATFORM_DEVID_AUTO,
 	},
 };
 
 static const struct mfd_cell rk808s[] = {
-	{ .name = "rk808-clkout", .id = PLATFORM_DEVID_NONE, },
-	{ .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, },
+	{ .name = "rk808-clkout", },
+	{ .name = "rk808-regulator", },
 	{
 		.name = "rk808-rtc",
 		.num_resources = ARRAY_SIZE(rtc_resources),
 		.resources = rtc_resources,
-		.id = PLATFORM_DEVID_NONE,
 	},
 };
 
 static const struct mfd_cell rk817s[] = {
-	{ .name = "rk808-clkout", .id = PLATFORM_DEVID_NONE, },
-	{ .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, },
+	{ .name = "rk808-clkout", },
+	{ .name = "rk808-regulator", },
 	{
 		.name = "rk805-pwrkey",
 		.num_resources = ARRAY_SIZE(rk817_pwrkey_resources),
 		.resources = &rk817_pwrkey_resources[0],
-		.id = PLATFORM_DEVID_NONE,
 	},
 	{
 		.name = "rk808-rtc",
 		.num_resources = ARRAY_SIZE(rk817_rtc_resources),
 		.resources = &rk817_rtc_resources[0],
-		.id = PLATFORM_DEVID_NONE,
 	},
-	{ .name = "rk817-codec", .id = PLATFORM_DEVID_NONE, },
+	{ .name = "rk817-codec", },
 	{
 		.name = "rk817-charger",
 		.num_resources = ARRAY_SIZE(rk817_charger_resources),
 		.resources = &rk817_charger_resources[0],
-		.id = PLATFORM_DEVID_NONE,
 	},
 };
 
 static const struct mfd_cell rk818s[] = {
-	{ .name = "rk808-clkout", .id = PLATFORM_DEVID_NONE, },
-	{ .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, },
+	{ .name = "rk808-clkout", },
+	{ .name = "rk808-regulator", },
 	{
 		.name = "rk808-rtc",
 		.num_resources = ARRAY_SIZE(rtc_resources),
 		.resources = rtc_resources,
-		.id = PLATFORM_DEVID_NONE,
 	},
 };
 
@@ -680,7 +672,7 @@ int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap
 					     pre_init_reg[i].addr);
 	}
 
-	ret = devm_mfd_add_devices(dev, 0, cells, nr_cells, NULL, 0,
+	ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, cells, nr_cells, NULL, 0,
 			      regmap_irq_get_domain(rk808->irq_data));
 	if (ret)
 		return dev_err_probe(dev, ret, "failed to add MFD devices\n");
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 439/583] mfd: cs42l43: Correct SoundWire port list
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (437 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 438/583] mfd: rk8xx: fixup devices registration with PLATFORM_DEVID_AUTO Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 440/583] mfd: syscon: Fix null pointer dereference in of_syscon_register() Greg Kroah-Hartman
                   ` (150 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Charles Keepax, Lee Jones, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Charles Keepax <ckeepax@opensource.cirrus.com>

[ Upstream commit 47b1b03dc56ebc302620ce43e967aa8f33516f6f ]

Two ports are missing from the port list, and the wrong port is set
to 4 channels. Also the attempt to list them by function is rather
misguided, there is nothing in the hardware that fixes a particular
port to one function. Factor out the port properties to an actual
struct, fixing the missing ports and correcting the port set to 4
channels.

Fixes: ace6d1448138 ("mfd: cs42l43: Add support for cs42l43 core driver")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20231130115712.669180-1-ckeepax@opensource.cirrus.com
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/mfd/cs42l43-sdw.c | 74 +++++++++++++++------------------------
 1 file changed, 28 insertions(+), 46 deletions(-)

diff --git a/drivers/mfd/cs42l43-sdw.c b/drivers/mfd/cs42l43-sdw.c
index 7392b3d2e6b9..4be4df9dd8cf 100644
--- a/drivers/mfd/cs42l43-sdw.c
+++ b/drivers/mfd/cs42l43-sdw.c
@@ -17,13 +17,12 @@
 
 #include "cs42l43.h"
 
-enum cs42l43_sdw_ports {
-	CS42L43_DMIC_DEC_ASP_PORT = 1,
-	CS42L43_SPK_TX_PORT,
-	CS42L43_SPDIF_HP_PORT,
-	CS42L43_SPK_RX_PORT,
-	CS42L43_ASP_PORT,
-};
+#define CS42L43_SDW_PORT(port, chans) { \
+	.num = port, \
+	.max_ch = chans, \
+	.type = SDW_DPN_FULL, \
+	.max_word = 24, \
+}
 
 static const struct regmap_config cs42l43_sdw_regmap = {
 	.reg_bits		= 32,
@@ -42,65 +41,48 @@ static const struct regmap_config cs42l43_sdw_regmap = {
 	.num_reg_defaults	= ARRAY_SIZE(cs42l43_reg_default),
 };
 
+static const struct sdw_dpn_prop cs42l43_src_port_props[] = {
+	CS42L43_SDW_PORT(1, 4),
+	CS42L43_SDW_PORT(2, 2),
+	CS42L43_SDW_PORT(3, 2),
+	CS42L43_SDW_PORT(4, 2),
+};
+
+static const struct sdw_dpn_prop cs42l43_sink_port_props[] = {
+	CS42L43_SDW_PORT(5, 2),
+	CS42L43_SDW_PORT(6, 2),
+	CS42L43_SDW_PORT(7, 2),
+};
+
 static int cs42l43_read_prop(struct sdw_slave *sdw)
 {
 	struct sdw_slave_prop *prop = &sdw->prop;
 	struct device *dev = &sdw->dev;
-	struct sdw_dpn_prop *dpn;
-	unsigned long addr;
-	int nval;
 	int i;
-	u32 bit;
 
 	prop->use_domain_irq = true;
 	prop->paging_support = true;
 	prop->wake_capable = true;
-	prop->source_ports = BIT(CS42L43_DMIC_DEC_ASP_PORT) | BIT(CS42L43_SPK_TX_PORT);
-	prop->sink_ports = BIT(CS42L43_SPDIF_HP_PORT) |
-			   BIT(CS42L43_SPK_RX_PORT) | BIT(CS42L43_ASP_PORT);
 	prop->quirks = SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY;
 	prop->scp_int1_mask = SDW_SCP_INT1_BUS_CLASH | SDW_SCP_INT1_PARITY |
 			      SDW_SCP_INT1_IMPL_DEF;
 
-	nval = hweight32(prop->source_ports);
-	prop->src_dpn_prop = devm_kcalloc(dev, nval, sizeof(*prop->src_dpn_prop),
-					  GFP_KERNEL);
+	for (i = 0; i < ARRAY_SIZE(cs42l43_src_port_props); i++)
+		prop->source_ports |= BIT(cs42l43_src_port_props[i].num);
+
+	prop->src_dpn_prop = devm_kmemdup(dev, cs42l43_src_port_props,
+					  sizeof(cs42l43_src_port_props), GFP_KERNEL);
 	if (!prop->src_dpn_prop)
 		return -ENOMEM;
 
-	i = 0;
-	dpn = prop->src_dpn_prop;
-	addr = prop->source_ports;
-	for_each_set_bit(bit, &addr, 32) {
-		dpn[i].num = bit;
-		dpn[i].max_ch = 2;
-		dpn[i].type = SDW_DPN_FULL;
-		dpn[i].max_word = 24;
-		i++;
-	}
-	/*
-	 * All ports are 2 channels max, except the first one,
-	 * CS42L43_DMIC_DEC_ASP_PORT.
-	 */
-	dpn[CS42L43_DMIC_DEC_ASP_PORT].max_ch = 4;
+	for (i = 0; i < ARRAY_SIZE(cs42l43_sink_port_props); i++)
+		prop->sink_ports |= BIT(cs42l43_sink_port_props[i].num);
 
-	nval = hweight32(prop->sink_ports);
-	prop->sink_dpn_prop = devm_kcalloc(dev, nval, sizeof(*prop->sink_dpn_prop),
-					   GFP_KERNEL);
+	prop->sink_dpn_prop = devm_kmemdup(dev, cs42l43_sink_port_props,
+					   sizeof(cs42l43_sink_port_props), GFP_KERNEL);
 	if (!prop->sink_dpn_prop)
 		return -ENOMEM;
 
-	i = 0;
-	dpn = prop->sink_dpn_prop;
-	addr = prop->sink_ports;
-	for_each_set_bit(bit, &addr, 32) {
-		dpn[i].num = bit;
-		dpn[i].max_ch = 2;
-		dpn[i].type = SDW_DPN_FULL;
-		dpn[i].max_word = 24;
-		i++;
-	}
-
 	return 0;
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 440/583] mfd: syscon: Fix null pointer dereference in of_syscon_register()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (438 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 439/583] mfd: cs42l43: Correct SoundWire port list Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 441/583] leds: aw2013: Select missing dependency REGMAP_I2C Greg Kroah-Hartman
                   ` (149 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kunwu Chan, Arnd Bergmann,
	Lee Jones, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kunwu Chan <chentao@kylinos.cn>

[ Upstream commit 41673c66b3d0c09915698fec5c13b24336f18dd1 ]

kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure.

Fixes: e15d7f2b81d2 ("mfd: syscon: Use a unique name with regmap_config")
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20231204092443.2462115-1-chentao@kylinos.cn
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/mfd/syscon.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index 57b29c325131..c9550368d9ea 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -105,6 +105,10 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_res)
 	}
 
 	syscon_config.name = kasprintf(GFP_KERNEL, "%pOFn@%pa", np, &res.start);
+	if (!syscon_config.name) {
+		ret = -ENOMEM;
+		goto err_regmap;
+	}
 	syscon_config.reg_stride = reg_io_width;
 	syscon_config.val_bits = reg_io_width * 8;
 	syscon_config.max_register = resource_size(&res) - reg_io_width;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 441/583] leds: aw2013: Select missing dependency REGMAP_I2C
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (439 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 440/583] mfd: syscon: Fix null pointer dereference in of_syscon_register() Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 442/583] leds: aw200xx: Fix write to DIM parameter Greg Kroah-Hartman
                   ` (148 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Dang Huynh, Nikita Travkin,
	Lee Jones, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dang Huynh <danct12@riseup.net>

[ Upstream commit 75469bb0537ad2ab0fc1fb6e534a79cfc03f3b3f ]

The AW2013 driver uses devm_regmap_init_i2c, so REGMAP_I2C needs to
be selected.

Otherwise build process may fail with:
  ld: drivers/leds/leds-aw2013.o: in function `aw2013_probe':
    leds-aw2013.c:345: undefined reference to `__devm_regmap_init_i2c'

Signed-off-by: Dang Huynh <danct12@riseup.net>
Acked-by: Nikita Travkin <nikita@trvn.ru>
Fixes: 59ea3c9faf32 ("leds: add aw2013 driver")
Link: https://lore.kernel.org/r/20231103114203.1108922-1-danct12@riseup.net
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/leds/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index b92208eccdea..3132439f99e0 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -110,6 +110,7 @@ config LEDS_AW200XX
 config LEDS_AW2013
 	tristate "LED support for Awinic AW2013"
 	depends on LEDS_CLASS && I2C && OF
+	select REGMAP_I2C
 	help
 	  This option enables support for the AW2013 3-channel
 	  LED driver.
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 442/583] leds: aw200xx: Fix write to DIM parameter
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (440 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 441/583] leds: aw2013: Select missing dependency REGMAP_I2C Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 443/583] mfd: tps6594: Add null pointer check to tps6594_device_init() Greg Kroah-Hartman
                   ` (147 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Martin Kurbanov, Dmitry Rokosov,
	Andy Shevchenko, Lee Jones, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Martin Kurbanov <mmkurbanov@salutedevices.com>

[ Upstream commit adfd4621b78d0c02da91335da2b9ad847cb7b39e ]

If write only DIM value to the page 4, LED brightness will not be
updated, as both DIM and FADE need to be written to the page 4.
Therefore, write DIM to the page 1.

Fixes: 36a87f371b7a ("leds: Add AW20xx driver")
Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com>
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20231125200519.1750-2-ddrokosov@salutedevices.com
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/leds/leds-aw200xx.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c
index 691a743cc9b0..5142efea2339 100644
--- a/drivers/leds/leds-aw200xx.c
+++ b/drivers/leds/leds-aw200xx.c
@@ -74,6 +74,10 @@
 #define AW200XX_LED2REG(x, columns) \
 	((x) + (((x) / (columns)) * (AW200XX_DSIZE_COLUMNS_MAX - (columns))))
 
+/* DIM current configuration register on page 1 */
+#define AW200XX_REG_DIM_PAGE1(x, columns) \
+	AW200XX_REG(AW200XX_PAGE1, AW200XX_LED2REG(x, columns))
+
 /*
  * DIM current configuration register (page 4).
  * The even address for current DIM configuration.
@@ -153,7 +157,8 @@ static ssize_t dim_store(struct device *dev, struct device_attribute *devattr,
 
 	if (dim >= 0) {
 		ret = regmap_write(chip->regmap,
-				   AW200XX_REG_DIM(led->num, columns), dim);
+				   AW200XX_REG_DIM_PAGE1(led->num, columns),
+				   dim);
 		if (ret)
 			goto out_unlock;
 	}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 443/583] mfd: tps6594: Add null pointer check to tps6594_device_init()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (441 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 442/583] leds: aw200xx: Fix write to DIM parameter Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 444/583] mfd: intel-lpss: Fix the fractional clock divider flags Greg Kroah-Hartman
                   ` (146 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Lee Jones, Kunwu Chan, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kunwu Chan <chentao@kylinos.cn>

[ Upstream commit 825906f2ebe83977d747d8bce61675dddd72485d ]

devm_kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure.

Fixes: 325bec7157b3 ("mfd: tps6594: Add driver for TI TPS6594 PMIC")
Suggested-by: Lee Jones <lee@kernel.org>
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Link: https://lore.kernel.org/r/20231208033320.49345-1-chentao@kylinos.cn
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/mfd/tps6594-core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mfd/tps6594-core.c b/drivers/mfd/tps6594-core.c
index 0fb9c5cf213a..783ee59901e8 100644
--- a/drivers/mfd/tps6594-core.c
+++ b/drivers/mfd/tps6594-core.c
@@ -433,6 +433,9 @@ int tps6594_device_init(struct tps6594 *tps, bool enable_crc)
 	tps6594_irq_chip.name = devm_kasprintf(dev, GFP_KERNEL, "%s-%ld-0x%02x",
 					       dev->driver->name, tps->chip_id, tps->reg);
 
+	if (!tps6594_irq_chip.name)
+		return -ENOMEM;
+
 	ret = devm_regmap_add_irq_chip(dev, tps->regmap, tps->irq, IRQF_SHARED | IRQF_ONESHOT,
 				       0, &tps6594_irq_chip, &tps->irq_data);
 	if (ret)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 444/583] mfd: intel-lpss: Fix the fractional clock divider flags
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (442 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 443/583] mfd: tps6594: Add null pointer check to tps6594_device_init() Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 445/583] srcu: Use try-lock lockdep annotation for NMI-safe access Greg Kroah-Hartman
                   ` (145 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Andy Shevchenko, Alex Vinarskis,
	Lee Jones, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

[ Upstream commit 03d790f04fb2507173913cad9c213272ac983a60 ]

The conversion to CLK_FRAC_DIVIDER_POWER_OF_TWO_PS uses wrong flags
in the parameters and hence miscalculates the values in the clock
divider. Fix this by applying the flag to the proper parameter.

Fixes: 82f53f9ee577 ("clk: fractional-divider: Introduce POWER_OF_TWO_PS flag")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reported-by: Alex Vinarskis <alex.vinarskis@gmail.com>
Link: https://lore.kernel.org/r/20231211111441.3910083-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/mfd/intel-lpss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
index 9591b354072a..00e7b578bb3e 100644
--- a/drivers/mfd/intel-lpss.c
+++ b/drivers/mfd/intel-lpss.c
@@ -301,8 +301,8 @@ static int intel_lpss_register_clock_divider(struct intel_lpss *lpss,
 
 	snprintf(name, sizeof(name), "%s-div", devname);
 	tmp = clk_register_fractional_divider(NULL, name, __clk_get_name(tmp),
+					      0, lpss->priv, 1, 15, 16, 15,
 					      CLK_FRAC_DIVIDER_POWER_OF_TWO_PS,
-					      lpss->priv, 1, 15, 16, 15, 0,
 					      NULL);
 	if (IS_ERR(tmp))
 		return PTR_ERR(tmp);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 445/583] srcu: Use try-lock lockdep annotation for NMI-safe access.
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (443 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 444/583] mfd: intel-lpss: Fix the fractional clock divider flags Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 446/583] mips: dmi: Fix early remap on MIPS32 Greg Kroah-Hartman
                   ` (144 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Boqun Feng,
	Sebastian Andrzej Siewior, Paul E. McKenney,
	Neeraj Upadhyay (AMD),
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

[ Upstream commit 3c6b0c1c28184038d90dffe8eb542bedcb8ccf98 ]

It is claimed that srcu_read_lock_nmisafe() NMI-safe. However it
triggers a lockdep if used from NMI because lockdep expects a deadlock
since nothing disables NMIs while the lock is acquired.

This is because commit f0f44752f5f61 ("rcu: Annotate SRCU's update-side
lockdep dependencies") annotates synchronize_srcu() as a write lock
usage. This helps to detect a deadlocks such as
	srcu_read_lock();
	synchronize_srcu();
	srcu_read_unlock();

The side effect is that the lock srcu_struct now has a USED usage in normal
contexts, so it conflicts with a USED_READ usage in NMI. But this shouldn't
cause a real deadlock because the write lock usage from synchronize_srcu()
is a fake one and only used for read/write deadlock detection.

Use a try-lock annotation for srcu_read_lock_nmisafe() to avoid lockdep
complains if used from NMI.

Fixes: f0f44752f5f6 ("rcu: Annotate SRCU's update-side lockdep dependencies")
Link: https://lore.kernel.org/r/20230927160231.XRCDDSK4@linutronix.de
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Neeraj Upadhyay (AMD) <neeraj.iitr10@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/rcupdate.h | 6 ++++++
 include/linux/srcu.h     | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 5e5f920ade90..44aab5c0bd2c 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -303,6 +303,11 @@ static inline void rcu_lock_acquire(struct lockdep_map *map)
 	lock_acquire(map, 0, 0, 2, 0, NULL, _THIS_IP_);
 }
 
+static inline void rcu_try_lock_acquire(struct lockdep_map *map)
+{
+	lock_acquire(map, 0, 1, 2, 0, NULL, _THIS_IP_);
+}
+
 static inline void rcu_lock_release(struct lockdep_map *map)
 {
 	lock_release(map, _THIS_IP_);
@@ -317,6 +322,7 @@ int rcu_read_lock_any_held(void);
 #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
 
 # define rcu_lock_acquire(a)		do { } while (0)
+# define rcu_try_lock_acquire(a)	do { } while (0)
 # define rcu_lock_release(a)		do { } while (0)
 
 static inline int rcu_read_lock_held(void)
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 127ef3b2e607..236610e4a8fa 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -229,7 +229,7 @@ static inline int srcu_read_lock_nmisafe(struct srcu_struct *ssp) __acquires(ssp
 
 	srcu_check_nmi_safety(ssp, true);
 	retval = __srcu_read_lock_nmisafe(ssp);
-	rcu_lock_acquire(&ssp->dep_map);
+	rcu_try_lock_acquire(&ssp->dep_map);
 	return retval;
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 446/583] mips: dmi: Fix early remap on MIPS32
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (444 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 445/583] srcu: Use try-lock lockdep annotation for NMI-safe access Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 447/583] mips: Fix incorrect max_low_pfn adjustment Greg Kroah-Hartman
                   ` (143 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Serge Semin, Thomas Bogendoerfer,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Serge Semin <fancer.lancer@gmail.com>

[ Upstream commit 0d0a3748a2cb38f9da1f08d357688ebd982eb788 ]

dmi_early_remap() has been defined as ioremap_cache() which on MIPS32 gets
to be converted to the VM-based mapping. DMI early remapping is performed
at the setup_arch() stage with no VM available. So calling the
dmi_early_remap() for MIPS32 causes the system to crash at the early boot
time. Fix that by converting dmi_early_remap() to the uncached remapping
which is always available on both 32 and 64-bits MIPS systems.

Note this change shall not cause any regressions on the current DMI
support implementation because on the early boot-up stage neither MIPS32
nor MIPS64 has the cacheable ioremapping support anyway.

Fixes: be8fa1cb444c ("MIPS: Add support for Desktop Management Interface (DMI)")
Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/mips/include/asm/dmi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/include/asm/dmi.h b/arch/mips/include/asm/dmi.h
index 27415a288adf..dc397f630c66 100644
--- a/arch/mips/include/asm/dmi.h
+++ b/arch/mips/include/asm/dmi.h
@@ -5,7 +5,7 @@
 #include <linux/io.h>
 #include <linux/memblock.h>
 
-#define dmi_early_remap(x, l)		ioremap_cache(x, l)
+#define dmi_early_remap(x, l)		ioremap(x, l)
 #define dmi_early_unmap(x, l)		iounmap(x)
 #define dmi_remap(x, l)			ioremap_cache(x, l)
 #define dmi_unmap(x)			iounmap(x)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 447/583] mips: Fix incorrect max_low_pfn adjustment
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (445 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 446/583] mips: dmi: Fix early remap on MIPS32 Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 448/583] um: virt-pci: fix platform map offset Greg Kroah-Hartman
                   ` (142 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Serge Semin, Thomas Bogendoerfer,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Serge Semin <fancer.lancer@gmail.com>

[ Upstream commit 0f5cc249ff73552d3bd864e62f85841dafaa107d ]

max_low_pfn variable is incorrectly adjusted if the kernel is built with
high memory support and the later is detected in a running system, so the
memory which actually can be directly mapped is getting into the highmem
zone. See the ZONE_NORMAL range on my MIPS32r5 system:

> Zone ranges:
>   DMA      [mem 0x0000000000000000-0x0000000000ffffff]
>   Normal   [mem 0x0000000001000000-0x0000000007ffffff]
>   HighMem  [mem 0x0000000008000000-0x000000020fffffff]

while the zones are supposed to look as follows:

> Zone ranges:
>   DMA      [mem 0x0000000000000000-0x0000000000ffffff]
>   Normal   [mem 0x0000000001000000-0x000000001fffffff]
>   HighMem  [mem 0x0000000020000000-0x000000020fffffff]

Even though the physical memory within the range [0x08000000;0x20000000]
belongs to MMIO on our system, we don't really want it to be considered as
high memory since on MIPS32 that range still can be directly mapped.

Note there might be other problems caused by the max_low_pfn variable
misconfiguration. For instance high_memory variable is initialize with
virtual address corresponding to the max_low_pfn PFN, and by design it
must define the upper bound on direct map memory, then end of the normal
zone. That in its turn potentially may cause problems in accessing the
memory by means of the /dev/mem and /dev/kmem devices.

Let's fix the discovered misconfiguration then. It turns out the commit
a94e4f24ec83 ("MIPS: init: Drop boot_mem_map") didn't introduce the
max_low_pfn adjustment quite correct. If the kernel is built with high
memory support and the system is equipped with high memory, the
max_low_pfn variable will need to be initialized with PFN of the most
upper directly reachable memory address so the zone normal would be
correctly setup. On MIPS that PFN corresponds to PFN_DOWN(HIGHMEM_START).
If the system is built with no high memory support and one is detected in
the running system, we'll just need to adjust the max_pfn variable to
discard the found high memory from the system and leave the max_low_pfn as
is, since the later will be less than PFN_DOWN(HIGHMEM_START) anyway by
design of the for_each_memblock() loop performed a bit early in the
bootmem_init() method.

Fixes: a94e4f24ec83 ("MIPS: init: Drop boot_mem_map")
Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/mips/kernel/setup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index cb871eb784a7..f88a2f83c5ea 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -326,11 +326,11 @@ static void __init bootmem_init(void)
 		panic("Incorrect memory mapping !!!");
 
 	if (max_pfn > PFN_DOWN(HIGHMEM_START)) {
+		max_low_pfn = PFN_DOWN(HIGHMEM_START);
 #ifdef CONFIG_HIGHMEM
-		highstart_pfn = PFN_DOWN(HIGHMEM_START);
+		highstart_pfn = max_low_pfn;
 		highend_pfn = max_pfn;
 #else
-		max_low_pfn = PFN_DOWN(HIGHMEM_START);
 		max_pfn = max_low_pfn;
 #endif
 	}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 448/583] um: virt-pci: fix platform map offset
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (446 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 447/583] mips: Fix incorrect max_low_pfn adjustment Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 449/583] riscv: Check if the code to patch lies in the exit section Greg Kroah-Hartman
                   ` (141 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Vincent Whitchurch,
	Richard Weinberger, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Vincent Whitchurch <vincent.whitchurch@axis.com>

[ Upstream commit 32253f00ac8a8073bf6db4bfe9d6511cc93c4aef ]

The offset is currently always zero so the backend can't distinguish
between accesses to different ioremapped areas.

Fixes: 522c532c4fe7 ("virt-pci: add platform bus support")
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/um/drivers/virt-pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/um/drivers/virt-pci.c b/arch/um/drivers/virt-pci.c
index ffe2ee8a0246..97a37c062997 100644
--- a/arch/um/drivers/virt-pci.c
+++ b/arch/um/drivers/virt-pci.c
@@ -971,7 +971,7 @@ static long um_pci_map_platform(unsigned long offset, size_t size,
 	*ops = &um_pci_device_bar_ops;
 	*priv = &um_pci_platform_device->resptr[0];
 
-	return 0;
+	return offset;
 }
 
 static const struct logic_iomem_region_ops um_pci_platform_ops = {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 449/583] riscv: Check if the code to patch lies in the exit section
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (447 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 448/583] um: virt-pci: fix platform map offset Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 450/583] riscv: Fix module_alloc() that did not reset the linear mapping permissions Greg Kroah-Hartman
                   ` (140 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alexandre Ghiti, Charlie Jenkins,
	Palmer Dabbelt, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alexandre Ghiti <alexghiti@rivosinc.com>

[ Upstream commit 420370f3ae3d3b883813fd3051a38805160b2b9f ]

Otherwise we fall through to vmalloc_to_page() which panics since the
address does not lie in the vmalloc region.

Fixes: 043cb41a85de ("riscv: introduce interfaces to patch kernel code")
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20231214091926.203439-1-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/riscv/include/asm/sections.h   |  1 +
 arch/riscv/kernel/patch.c           | 11 ++++++++++-
 arch/riscv/kernel/vmlinux-xip.lds.S |  2 ++
 arch/riscv/kernel/vmlinux.lds.S     |  2 ++
 4 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/include/asm/sections.h b/arch/riscv/include/asm/sections.h
index 32336e8a17cb..a393d5035c54 100644
--- a/arch/riscv/include/asm/sections.h
+++ b/arch/riscv/include/asm/sections.h
@@ -13,6 +13,7 @@ extern char _start_kernel[];
 extern char __init_data_begin[], __init_data_end[];
 extern char __init_text_begin[], __init_text_end[];
 extern char __alt_start[], __alt_end[];
+extern char __exittext_begin[], __exittext_end[];
 
 static inline bool is_va_kernel_text(uintptr_t va)
 {
diff --git a/arch/riscv/kernel/patch.c b/arch/riscv/kernel/patch.c
index 13ee7bf589a1..37e87fdcf6a0 100644
--- a/arch/riscv/kernel/patch.c
+++ b/arch/riscv/kernel/patch.c
@@ -14,6 +14,7 @@
 #include <asm/fixmap.h>
 #include <asm/ftrace.h>
 #include <asm/patch.h>
+#include <asm/sections.h>
 
 struct patch_insn {
 	void *addr;
@@ -25,6 +26,14 @@ struct patch_insn {
 int riscv_patch_in_stop_machine = false;
 
 #ifdef CONFIG_MMU
+
+static inline bool is_kernel_exittext(uintptr_t addr)
+{
+	return system_state < SYSTEM_RUNNING &&
+		addr >= (uintptr_t)__exittext_begin &&
+		addr < (uintptr_t)__exittext_end;
+}
+
 /*
  * The fix_to_virt(, idx) needs a const value (not a dynamic variable of
  * reg-a0) or BUILD_BUG_ON failed with "idx >= __end_of_fixed_addresses".
@@ -35,7 +44,7 @@ static __always_inline void *patch_map(void *addr, const unsigned int fixmap)
 	uintptr_t uintaddr = (uintptr_t) addr;
 	struct page *page;
 
-	if (core_kernel_text(uintaddr))
+	if (core_kernel_text(uintaddr) || is_kernel_exittext(uintaddr))
 		page = phys_to_page(__pa_symbol(addr));
 	else if (IS_ENABLED(CONFIG_STRICT_MODULE_RWX))
 		page = vmalloc_to_page(addr);
diff --git a/arch/riscv/kernel/vmlinux-xip.lds.S b/arch/riscv/kernel/vmlinux-xip.lds.S
index 50767647fbc6..8c3daa1b0531 100644
--- a/arch/riscv/kernel/vmlinux-xip.lds.S
+++ b/arch/riscv/kernel/vmlinux-xip.lds.S
@@ -29,10 +29,12 @@ SECTIONS
 	HEAD_TEXT_SECTION
 	INIT_TEXT_SECTION(PAGE_SIZE)
 	/* we have to discard exit text and such at runtime, not link time */
+	__exittext_begin = .;
 	.exit.text :
 	{
 		EXIT_TEXT
 	}
+	__exittext_end = .;
 
 	.text : {
 		_text = .;
diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S
index 492dd4b8f3d6..002ca58dd998 100644
--- a/arch/riscv/kernel/vmlinux.lds.S
+++ b/arch/riscv/kernel/vmlinux.lds.S
@@ -69,10 +69,12 @@ SECTIONS
 		__soc_builtin_dtb_table_end = .;
 	}
 	/* we have to discard exit text and such at runtime, not link time */
+	__exittext_begin = .;
 	.exit.text :
 	{
 		EXIT_TEXT
 	}
+	__exittext_end = .;
 
 	__init_text_end = .;
 	. = ALIGN(SECTION_ALIGN);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 450/583] riscv: Fix module_alloc() that did not reset the linear mapping permissions
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (448 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 449/583] riscv: Check if the code to patch lies in the exit section Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 451/583] riscv: Fix set_memory_XX() and set_direct_map_XX() by splitting huge linear mappings Greg Kroah-Hartman
                   ` (139 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alexandre Ghiti, Palmer Dabbelt,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alexandre Ghiti <alexghiti@rivosinc.com>

[ Upstream commit 749b94b08005929bbc636df21a23322733166e35 ]

After unloading a module, we must reset the linear mapping permissions,
see the example below:

Before unloading a module:

0xffffaf809d65d000-0xffffaf809d6dc000    0x000000011d65d000       508K PTE .   ..     ..   D A G . . W R V
0xffffaf809d6dc000-0xffffaf809d6dd000    0x000000011d6dc000         4K PTE .   ..     ..   D A G . . . R V
0xffffaf809d6dd000-0xffffaf809d6e1000    0x000000011d6dd000        16K PTE .   ..     ..   D A G . . W R V
0xffffaf809d6e1000-0xffffaf809d6e7000    0x000000011d6e1000        24K PTE .   ..     ..   D A G . X . R V

After unloading a module:

0xffffaf809d65d000-0xffffaf809d6e1000    0x000000011d65d000       528K PTE .   ..     ..   D A G . . W R V
0xffffaf809d6e1000-0xffffaf809d6e7000    0x000000011d6e1000        24K PTE .   ..     ..   D A G . X W R V

The last mapping is not reset and we end up with WX mappings in the linear
mapping.

So add VM_FLUSH_RESET_PERMS to our module_alloc() definition.

Fixes: 0cff8bff7af8 ("riscv: avoid the PIC offset of static percpu data in module beyond 2G limits")
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20231213134027.155327-2-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/riscv/kernel/module.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/module.c b/arch/riscv/kernel/module.c
index 7c651d55fcbd..df4f6fec5d17 100644
--- a/arch/riscv/kernel/module.c
+++ b/arch/riscv/kernel/module.c
@@ -440,7 +440,8 @@ void *module_alloc(unsigned long size)
 {
 	return __vmalloc_node_range(size, 1, MODULES_VADDR,
 				    MODULES_END, GFP_KERNEL,
-				    PAGE_KERNEL, 0, NUMA_NO_NODE,
+				    PAGE_KERNEL, VM_FLUSH_RESET_PERMS,
+				    NUMA_NO_NODE,
 				    __builtin_return_address(0));
 }
 #endif
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 451/583] riscv: Fix set_memory_XX() and set_direct_map_XX() by splitting huge linear mappings
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (449 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 450/583] riscv: Fix module_alloc() that did not reset the linear mapping permissions Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 452/583] riscv: Fix set_direct_map_default_noflush() to reset _PAGE_EXEC Greg Kroah-Hartman
                   ` (138 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alexandre Ghiti, Palmer Dabbelt,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alexandre Ghiti <alexghiti@rivosinc.com>

[ Upstream commit 311cd2f6e25380cff0abc2884dc6a3d33bc9b5c3 ]

When STRICT_KERNEL_RWX is set, any change of permissions on any kernel
mapping (vmalloc/modules/kernel text...etc) should be applied on its
linear mapping alias. The problem is that the riscv kernel uses huge
mappings for the linear mapping and walk_page_range_novma() does not
split those huge mappings.

So this patchset implements such split in order to apply fine-grained
permissions on the linear mapping.

Below is the difference before and after (the first PUD mapping is split
into PTE/PMD mappings):

Before:

---[ Linear mapping ]---
0xffffaf8000080000-0xffffaf8000200000    0x0000000080080000      1536K PTE     D A G . . W R V
0xffffaf8000200000-0xffffaf8077c00000    0x0000000080200000      1914M PMD     D A G . . W R V
0xffffaf8077c00000-0xffffaf8078800000    0x00000000f7c00000        12M PMD     D A G . . . R V
0xffffaf8078800000-0xffffaf8078c00000    0x00000000f8800000         4M PMD     D A G . . W R V
0xffffaf8078c00000-0xffffaf8079200000    0x00000000f8c00000         6M PMD     D A G . . . R V
0xffffaf8079200000-0xffffaf807e600000    0x00000000f9200000        84M PMD     D A G . . W R V
0xffffaf807e600000-0xffffaf807e716000    0x00000000fe600000      1112K PTE     D A G . . W R V
0xffffaf807e717000-0xffffaf807e71a000    0x00000000fe717000        12K PTE     D A G . . W R V
0xffffaf807e71d000-0xffffaf807e71e000    0x00000000fe71d000         4K PTE     D A G . . W R V
0xffffaf807e722000-0xffffaf807e800000    0x00000000fe722000       888K PTE     D A G . . W R V
0xffffaf807e800000-0xffffaf807fe00000    0x00000000fe800000        22M PMD     D A G . . W R V
0xffffaf807fe00000-0xffffaf807ff54000    0x00000000ffe00000      1360K PTE     D A G . . W R V
0xffffaf807ff55000-0xffffaf8080000000    0x00000000fff55000       684K PTE     D A G . . W R V
0xffffaf8080000000-0xffffaf8400000000    0x0000000100000000        14G PUD     D A G . . W R V

After:

---[ Linear mapping ]---
0xffffaf8000080000-0xffffaf8000200000    0x0000000080080000      1536K PTE     D A G . . W R V
0xffffaf8000200000-0xffffaf8077c00000    0x0000000080200000      1914M PMD     D A G . . W R V
0xffffaf8077c00000-0xffffaf8078800000    0x00000000f7c00000        12M PMD     D A G . . . R V
0xffffaf8078800000-0xffffaf8078a00000    0x00000000f8800000         2M PMD     D A G . . W R V
0xffffaf8078a00000-0xffffaf8078c00000    0x00000000f8a00000         2M PTE     D A G . . W R V
0xffffaf8078c00000-0xffffaf8079200000    0x00000000f8c00000         6M PMD     D A G . . . R V
0xffffaf8079200000-0xffffaf807e600000    0x00000000f9200000        84M PMD     D A G . . W R V
0xffffaf807e600000-0xffffaf807e716000    0x00000000fe600000      1112K PTE     D A G . . W R V
0xffffaf807e717000-0xffffaf807e71a000    0x00000000fe717000        12K PTE     D A G . . W R V
0xffffaf807e71d000-0xffffaf807e71e000    0x00000000fe71d000         4K PTE     D A G . . W R V
0xffffaf807e722000-0xffffaf807e800000    0x00000000fe722000       888K PTE     D A G . . W R V
0xffffaf807e800000-0xffffaf807fe00000    0x00000000fe800000        22M PMD     D A G . . W R V
0xffffaf807fe00000-0xffffaf807ff54000    0x00000000ffe00000      1360K PTE     D A G . . W R V
0xffffaf807ff55000-0xffffaf8080000000    0x00000000fff55000       684K PTE     D A G . . W R V
0xffffaf8080000000-0xffffaf8080800000    0x0000000100000000         8M PMD     D A G . . W R V
0xffffaf8080800000-0xffffaf8080af6000    0x0000000100800000      3032K PTE     D A G . . W R V
0xffffaf8080af6000-0xffffaf8080af8000    0x0000000100af6000         8K PTE     D A G . X . R V
0xffffaf8080af8000-0xffffaf8080c00000    0x0000000100af8000      1056K PTE     D A G . . W R V
0xffffaf8080c00000-0xffffaf8081a00000    0x0000000100c00000        14M PMD     D A G . . W R V
0xffffaf8081a00000-0xffffaf8081a40000    0x0000000101a00000       256K PTE     D A G . . W R V
0xffffaf8081a40000-0xffffaf8081a44000    0x0000000101a40000        16K PTE     D A G . X . R V
0xffffaf8081a44000-0xffffaf8081a52000    0x0000000101a44000        56K PTE     D A G . . W R V
0xffffaf8081a52000-0xffffaf8081a54000    0x0000000101a52000         8K PTE     D A G . X . R V
...
0xffffaf809e800000-0xffffaf80c0000000    0x000000011e800000       536M PMD     D A G . . W R V
0xffffaf80c0000000-0xffffaf8400000000    0x0000000140000000        13G PUD     D A G . . W R V

Note that this also fixes memfd_secret() syscall which uses
set_direct_map_invalid_noflush() and set_direct_map_default_noflush() to
remove the pages from the linear mapping. Below is the kernel page table
while a memfd_secret() syscall is running, you can see all the !valid
page table entries in the linear mapping:

...
0xffffaf8082240000-0xffffaf8082241000    0x0000000102240000         4K PTE     D A G . . W R .
0xffffaf8082241000-0xffffaf8082250000    0x0000000102241000        60K PTE     D A G . . W R V
0xffffaf8082250000-0xffffaf8082252000    0x0000000102250000         8K PTE     D A G . . W R .
0xffffaf8082252000-0xffffaf8082256000    0x0000000102252000        16K PTE     D A G . . W R V
0xffffaf8082256000-0xffffaf8082257000    0x0000000102256000         4K PTE     D A G . . W R .
0xffffaf8082257000-0xffffaf8082258000    0x0000000102257000         4K PTE     D A G . . W R V
0xffffaf8082258000-0xffffaf8082259000    0x0000000102258000         4K PTE     D A G . . W R .
0xffffaf8082259000-0xffffaf808225a000    0x0000000102259000         4K PTE     D A G . . W R V
0xffffaf808225a000-0xffffaf808225c000    0x000000010225a000         8K PTE     D A G . . W R .
0xffffaf808225c000-0xffffaf8082266000    0x000000010225c000        40K PTE     D A G . . W R V
0xffffaf8082266000-0xffffaf8082268000    0x0000000102266000         8K PTE     D A G . . W R .
0xffffaf8082268000-0xffffaf8082284000    0x0000000102268000       112K PTE     D A G . . W R V
0xffffaf8082284000-0xffffaf8082288000    0x0000000102284000        16K PTE     D A G . . W R .
0xffffaf8082288000-0xffffaf808229c000    0x0000000102288000        80K PTE     D A G . . W R V
0xffffaf808229c000-0xffffaf80822a0000    0x000000010229c000        16K PTE     D A G . . W R .
0xffffaf80822a0000-0xffffaf80822a5000    0x00000001022a0000        20K PTE     D A G . . W R V
0xffffaf80822a5000-0xffffaf80822a6000    0x00000001022a5000         4K PTE     D A G . . . R V
0xffffaf80822a6000-0xffffaf80822ab000    0x00000001022a6000        20K PTE     D A G . . W R V
...

And when the memfd_secret() fd is released, the linear mapping is
correctly reset:

...
0xffffaf8082240000-0xffffaf80822a5000    0x0000000102240000       404K PTE     D A G . . W R V
0xffffaf80822a5000-0xffffaf80822a6000    0x00000001022a5000         4K PTE     D A G . . . R V
0xffffaf80822a6000-0xffffaf80822af000    0x00000001022a6000        36K PTE     D A G . . W R V
...

Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20231108075930.7157-3-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Stable-dep-of: b8b2711336f0 ("riscv: Fix set_direct_map_default_noflush() to reset _PAGE_EXEC")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/riscv/mm/pageattr.c | 270 +++++++++++++++++++++++++++++++++------
 1 file changed, 230 insertions(+), 40 deletions(-)

diff --git a/arch/riscv/mm/pageattr.c b/arch/riscv/mm/pageattr.c
index 161d0b34c2cb..fc5fc4f785c4 100644
--- a/arch/riscv/mm/pageattr.c
+++ b/arch/riscv/mm/pageattr.c
@@ -5,6 +5,7 @@
 
 #include <linux/pagewalk.h>
 #include <linux/pgtable.h>
+#include <linux/vmalloc.h>
 #include <asm/tlbflush.h>
 #include <asm/bitops.h>
 #include <asm/set_memory.h>
@@ -25,19 +26,6 @@ static unsigned long set_pageattr_masks(unsigned long val, struct mm_walk *walk)
 	return new_val;
 }
 
-static int pageattr_pgd_entry(pgd_t *pgd, unsigned long addr,
-			      unsigned long next, struct mm_walk *walk)
-{
-	pgd_t val = READ_ONCE(*pgd);
-
-	if (pgd_leaf(val)) {
-		val = __pgd(set_pageattr_masks(pgd_val(val), walk));
-		set_pgd(pgd, val);
-	}
-
-	return 0;
-}
-
 static int pageattr_p4d_entry(p4d_t *p4d, unsigned long addr,
 			      unsigned long next, struct mm_walk *walk)
 {
@@ -96,7 +84,6 @@ static int pageattr_pte_hole(unsigned long addr, unsigned long next,
 }
 
 static const struct mm_walk_ops pageattr_ops = {
-	.pgd_entry = pageattr_pgd_entry,
 	.p4d_entry = pageattr_p4d_entry,
 	.pud_entry = pageattr_pud_entry,
 	.pmd_entry = pageattr_pmd_entry,
@@ -105,12 +92,181 @@ static const struct mm_walk_ops pageattr_ops = {
 	.walk_lock = PGWALK_RDLOCK,
 };
 
+#ifdef CONFIG_64BIT
+static int __split_linear_mapping_pmd(pud_t *pudp,
+				      unsigned long vaddr, unsigned long end)
+{
+	pmd_t *pmdp;
+	unsigned long next;
+
+	pmdp = pmd_offset(pudp, vaddr);
+
+	do {
+		next = pmd_addr_end(vaddr, end);
+
+		if (next - vaddr >= PMD_SIZE &&
+		    vaddr <= (vaddr & PMD_MASK) && end >= next)
+			continue;
+
+		if (pmd_leaf(*pmdp)) {
+			struct page *pte_page;
+			unsigned long pfn = _pmd_pfn(*pmdp);
+			pgprot_t prot = __pgprot(pmd_val(*pmdp) & ~_PAGE_PFN_MASK);
+			pte_t *ptep_new;
+			int i;
+
+			pte_page = alloc_page(GFP_KERNEL);
+			if (!pte_page)
+				return -ENOMEM;
+
+			ptep_new = (pte_t *)page_address(pte_page);
+			for (i = 0; i < PTRS_PER_PTE; ++i, ++ptep_new)
+				set_pte(ptep_new, pfn_pte(pfn + i, prot));
+
+			smp_wmb();
+
+			set_pmd(pmdp, pfn_pmd(page_to_pfn(pte_page), PAGE_TABLE));
+		}
+	} while (pmdp++, vaddr = next, vaddr != end);
+
+	return 0;
+}
+
+static int __split_linear_mapping_pud(p4d_t *p4dp,
+				      unsigned long vaddr, unsigned long end)
+{
+	pud_t *pudp;
+	unsigned long next;
+	int ret;
+
+	pudp = pud_offset(p4dp, vaddr);
+
+	do {
+		next = pud_addr_end(vaddr, end);
+
+		if (next - vaddr >= PUD_SIZE &&
+		    vaddr <= (vaddr & PUD_MASK) && end >= next)
+			continue;
+
+		if (pud_leaf(*pudp)) {
+			struct page *pmd_page;
+			unsigned long pfn = _pud_pfn(*pudp);
+			pgprot_t prot = __pgprot(pud_val(*pudp) & ~_PAGE_PFN_MASK);
+			pmd_t *pmdp_new;
+			int i;
+
+			pmd_page = alloc_page(GFP_KERNEL);
+			if (!pmd_page)
+				return -ENOMEM;
+
+			pmdp_new = (pmd_t *)page_address(pmd_page);
+			for (i = 0; i < PTRS_PER_PMD; ++i, ++pmdp_new)
+				set_pmd(pmdp_new,
+					pfn_pmd(pfn + ((i * PMD_SIZE) >> PAGE_SHIFT), prot));
+
+			smp_wmb();
+
+			set_pud(pudp, pfn_pud(page_to_pfn(pmd_page), PAGE_TABLE));
+		}
+
+		ret = __split_linear_mapping_pmd(pudp, vaddr, next);
+		if (ret)
+			return ret;
+	} while (pudp++, vaddr = next, vaddr != end);
+
+	return 0;
+}
+
+static int __split_linear_mapping_p4d(pgd_t *pgdp,
+				      unsigned long vaddr, unsigned long end)
+{
+	p4d_t *p4dp;
+	unsigned long next;
+	int ret;
+
+	p4dp = p4d_offset(pgdp, vaddr);
+
+	do {
+		next = p4d_addr_end(vaddr, end);
+
+		/*
+		 * If [vaddr; end] contains [vaddr & P4D_MASK; next], we don't
+		 * need to split, we'll change the protections on the whole P4D.
+		 */
+		if (next - vaddr >= P4D_SIZE &&
+		    vaddr <= (vaddr & P4D_MASK) && end >= next)
+			continue;
+
+		if (p4d_leaf(*p4dp)) {
+			struct page *pud_page;
+			unsigned long pfn = _p4d_pfn(*p4dp);
+			pgprot_t prot = __pgprot(p4d_val(*p4dp) & ~_PAGE_PFN_MASK);
+			pud_t *pudp_new;
+			int i;
+
+			pud_page = alloc_page(GFP_KERNEL);
+			if (!pud_page)
+				return -ENOMEM;
+
+			/*
+			 * Fill the pud level with leaf puds that have the same
+			 * protections as the leaf p4d.
+			 */
+			pudp_new = (pud_t *)page_address(pud_page);
+			for (i = 0; i < PTRS_PER_PUD; ++i, ++pudp_new)
+				set_pud(pudp_new,
+					pfn_pud(pfn + ((i * PUD_SIZE) >> PAGE_SHIFT), prot));
+
+			/*
+			 * Make sure the pud filling is not reordered with the
+			 * p4d store which could result in seeing a partially
+			 * filled pud level.
+			 */
+			smp_wmb();
+
+			set_p4d(p4dp, pfn_p4d(page_to_pfn(pud_page), PAGE_TABLE));
+		}
+
+		ret = __split_linear_mapping_pud(p4dp, vaddr, next);
+		if (ret)
+			return ret;
+	} while (p4dp++, vaddr = next, vaddr != end);
+
+	return 0;
+}
+
+static int __split_linear_mapping_pgd(pgd_t *pgdp,
+				      unsigned long vaddr,
+				      unsigned long end)
+{
+	unsigned long next;
+	int ret;
+
+	do {
+		next = pgd_addr_end(vaddr, end);
+		/* We never use PGD mappings for the linear mapping */
+		ret = __split_linear_mapping_p4d(pgdp, vaddr, next);
+		if (ret)
+			return ret;
+	} while (pgdp++, vaddr = next, vaddr != end);
+
+	return 0;
+}
+
+static int split_linear_mapping(unsigned long start, unsigned long end)
+{
+	return __split_linear_mapping_pgd(pgd_offset_k(start), start, end);
+}
+#endif	/* CONFIG_64BIT */
+
 static int __set_memory(unsigned long addr, int numpages, pgprot_t set_mask,
 			pgprot_t clear_mask)
 {
 	int ret;
 	unsigned long start = addr;
 	unsigned long end = start + PAGE_SIZE * numpages;
+	unsigned long __maybe_unused lm_start;
+	unsigned long __maybe_unused lm_end;
 	struct pageattr_masks masks = {
 		.set_mask = set_mask,
 		.clear_mask = clear_mask
@@ -120,11 +276,67 @@ static int __set_memory(unsigned long addr, int numpages, pgprot_t set_mask,
 		return 0;
 
 	mmap_write_lock(&init_mm);
+
+#ifdef CONFIG_64BIT
+	/*
+	 * We are about to change the permissions of a kernel mapping, we must
+	 * apply the same changes to its linear mapping alias, which may imply
+	 * splitting a huge mapping.
+	 */
+
+	if (is_vmalloc_or_module_addr((void *)start)) {
+		struct vm_struct *area = NULL;
+		int i, page_start;
+
+		area = find_vm_area((void *)start);
+		page_start = (start - (unsigned long)area->addr) >> PAGE_SHIFT;
+
+		for (i = page_start; i < page_start + numpages; ++i) {
+			lm_start = (unsigned long)page_address(area->pages[i]);
+			lm_end = lm_start + PAGE_SIZE;
+
+			ret = split_linear_mapping(lm_start, lm_end);
+			if (ret)
+				goto unlock;
+
+			ret = walk_page_range_novma(&init_mm, lm_start, lm_end,
+						    &pageattr_ops, NULL, &masks);
+			if (ret)
+				goto unlock;
+		}
+	} else if (is_kernel_mapping(start) || is_linear_mapping(start)) {
+		lm_start = (unsigned long)lm_alias(start);
+		lm_end = (unsigned long)lm_alias(end);
+
+		ret = split_linear_mapping(lm_start, lm_end);
+		if (ret)
+			goto unlock;
+
+		ret = walk_page_range_novma(&init_mm, lm_start, lm_end,
+					    &pageattr_ops, NULL, &masks);
+		if (ret)
+			goto unlock;
+	}
+
 	ret =  walk_page_range_novma(&init_mm, start, end, &pageattr_ops, NULL,
 				     &masks);
+
+unlock:
+	mmap_write_unlock(&init_mm);
+
+	/*
+	 * We can't use flush_tlb_kernel_range() here as we may have split a
+	 * hugepage that is larger than that, so let's flush everything.
+	 */
+	flush_tlb_all();
+#else
+	ret =  walk_page_range_novma(&init_mm, start, end, &pageattr_ops, NULL,
+				     &masks);
+
 	mmap_write_unlock(&init_mm);
 
 	flush_tlb_kernel_range(start, end);
+#endif
 
 	return ret;
 }
@@ -159,36 +371,14 @@ int set_memory_nx(unsigned long addr, int numpages)
 
 int set_direct_map_invalid_noflush(struct page *page)
 {
-	int ret;
-	unsigned long start = (unsigned long)page_address(page);
-	unsigned long end = start + PAGE_SIZE;
-	struct pageattr_masks masks = {
-		.set_mask = __pgprot(0),
-		.clear_mask = __pgprot(_PAGE_PRESENT)
-	};
-
-	mmap_read_lock(&init_mm);
-	ret = walk_page_range(&init_mm, start, end, &pageattr_ops, &masks);
-	mmap_read_unlock(&init_mm);
-
-	return ret;
+	return __set_memory((unsigned long)page_address(page), 1,
+			    __pgprot(0), __pgprot(_PAGE_PRESENT));
 }
 
 int set_direct_map_default_noflush(struct page *page)
 {
-	int ret;
-	unsigned long start = (unsigned long)page_address(page);
-	unsigned long end = start + PAGE_SIZE;
-	struct pageattr_masks masks = {
-		.set_mask = PAGE_KERNEL,
-		.clear_mask = __pgprot(0)
-	};
-
-	mmap_read_lock(&init_mm);
-	ret = walk_page_range(&init_mm, start, end, &pageattr_ops, &masks);
-	mmap_read_unlock(&init_mm);
-
-	return ret;
+	return __set_memory((unsigned long)page_address(page), 1,
+			    PAGE_KERNEL, __pgprot(0));
 }
 
 #ifdef CONFIG_DEBUG_PAGEALLOC
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 452/583] riscv: Fix set_direct_map_default_noflush() to reset _PAGE_EXEC
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (450 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 451/583] riscv: Fix set_memory_XX() and set_direct_map_XX() by splitting huge linear mappings Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 453/583] riscv: Fixed wrong register in XIP_FIXUP_FLASH_OFFSET macro Greg Kroah-Hartman
                   ` (137 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alexandre Ghiti, Palmer Dabbelt,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alexandre Ghiti <alexghiti@rivosinc.com>

[ Upstream commit b8b2711336f03ece539de61479d6ffc44fb603d3 ]

When resetting the linear mapping permissions, we must make sure that we
clear the X bit so that do not end up with WX mappings (since we set
PAGE_KERNEL).

Fixes: 395a21ff859c ("riscv: add ARCH_HAS_SET_DIRECT_MAP support")
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20231213134027.155327-3-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/riscv/mm/pageattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/mm/pageattr.c b/arch/riscv/mm/pageattr.c
index fc5fc4f785c4..e703a9b59fc3 100644
--- a/arch/riscv/mm/pageattr.c
+++ b/arch/riscv/mm/pageattr.c
@@ -378,7 +378,7 @@ int set_direct_map_invalid_noflush(struct page *page)
 int set_direct_map_default_noflush(struct page *page)
 {
 	return __set_memory((unsigned long)page_address(page), 1,
-			    PAGE_KERNEL, __pgprot(0));
+			    PAGE_KERNEL, __pgprot(_PAGE_EXEC));
 }
 
 #ifdef CONFIG_DEBUG_PAGEALLOC
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 453/583] riscv: Fixed wrong register in XIP_FIXUP_FLASH_OFFSET macro
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (451 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 452/583] riscv: Fix set_direct_map_default_noflush() to reset _PAGE_EXEC Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 454/583] MIPS: Alchemy: Fix an out-of-bound access in db1200_dev_setup() Greg Kroah-Hartman
                   ` (136 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Frederik Haxel, Palmer Dabbelt, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Frederik Haxel <haxel@fzi.de>

[ Upstream commit 5daa3726410288075ba73c336bb2e80d6b06aa4d ]

During the refactoring, a bug was introduced in the rarly used
XIP_FIXUP_FLASH_OFFSET macro.

Fixes: bee7fbc38579 ("RISC-V CPU Idle Support")
Fixes: e7681beba992 ("RISC-V: Split out the XIP fixups into their own file")

Signed-off-by: Frederik Haxel <haxel@fzi.de>
Link: https://lore.kernel.org/r/20231212130116.848530-3-haxel@fzi.de
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/riscv/include/asm/xip_fixup.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/include/asm/xip_fixup.h b/arch/riscv/include/asm/xip_fixup.h
index d4ffc3c37649..b65bf6306f69 100644
--- a/arch/riscv/include/asm/xip_fixup.h
+++ b/arch/riscv/include/asm/xip_fixup.h
@@ -13,7 +13,7 @@
         add \reg, \reg, t0
 .endm
 .macro XIP_FIXUP_FLASH_OFFSET reg
-	la t1, __data_loc
+	la t0, __data_loc
 	REG_L t1, _xip_phys_offset
 	sub \reg, \reg, t1
 	add \reg, \reg, t0
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 454/583] MIPS: Alchemy: Fix an out-of-bound access in db1200_dev_setup()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (452 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 453/583] riscv: Fixed wrong register in XIP_FIXUP_FLASH_OFFSET macro Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 455/583] MIPS: Alchemy: Fix an out-of-bound access in db1550_dev_setup() Greg Kroah-Hartman
                   ` (135 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christophe JAILLET,
	Thomas Bogendoerfer, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

[ Upstream commit 89c4b588d11e9acf01d604de4b0c715884f59213 ]

When calling spi_register_board_info(), we should pass the number of
elements in 'db1200_spi_devs', not 'db1200_i2c_devs'.

Fixes: 63323ec54a7e ("MIPS: Alchemy: Extended DB1200 board support.")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/mips/alchemy/devboards/db1200.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/alchemy/devboards/db1200.c b/arch/mips/alchemy/devboards/db1200.c
index f521874ebb07..67f067706af2 100644
--- a/arch/mips/alchemy/devboards/db1200.c
+++ b/arch/mips/alchemy/devboards/db1200.c
@@ -847,7 +847,7 @@ int __init db1200_dev_setup(void)
 	i2c_register_board_info(0, db1200_i2c_devs,
 				ARRAY_SIZE(db1200_i2c_devs));
 	spi_register_board_info(db1200_spi_devs,
-				ARRAY_SIZE(db1200_i2c_devs));
+				ARRAY_SIZE(db1200_spi_devs));
 
 	/* SWITCHES:	S6.8 I2C/SPI selector  (OFF=I2C	 ON=SPI)
 	 *		S6.7 AC97/I2S selector (OFF=AC97 ON=I2S)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 455/583] MIPS: Alchemy: Fix an out-of-bound access in db1550_dev_setup()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (453 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 454/583] MIPS: Alchemy: Fix an out-of-bound access in db1200_dev_setup() Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 456/583] power: supply: cw2015: correct time_to_empty units in sysfs Greg Kroah-Hartman
                   ` (134 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christophe JAILLET,
	Thomas Bogendoerfer, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

[ Upstream commit 3c1e5abcda64bed0c7bffa65af2316995f269a61 ]

When calling spi_register_board_info(),

Fixes: f869d42e580f ("MIPS: Alchemy: Improved DB1550 support, with audio and serial busses.")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/mips/alchemy/devboards/db1550.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/alchemy/devboards/db1550.c b/arch/mips/alchemy/devboards/db1550.c
index fd91d9c9a252..6c6837181f55 100644
--- a/arch/mips/alchemy/devboards/db1550.c
+++ b/arch/mips/alchemy/devboards/db1550.c
@@ -589,7 +589,7 @@ int __init db1550_dev_setup(void)
 	i2c_register_board_info(0, db1550_i2c_devs,
 				ARRAY_SIZE(db1550_i2c_devs));
 	spi_register_board_info(db1550_spi_devs,
-				ARRAY_SIZE(db1550_i2c_devs));
+				ARRAY_SIZE(db1550_spi_devs));
 
 	c = clk_get(NULL, "psc0_intclk");
 	if (!IS_ERR(c)) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 456/583] power: supply: cw2015: correct time_to_empty units in sysfs
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (454 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 455/583] MIPS: Alchemy: Fix an out-of-bound access in db1550_dev_setup() Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 457/583] power: supply: bq256xx: fix some problem in bq256xx_hw_init Greg Kroah-Hartman
                   ` (133 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jan Palus, Sebastian Reichel, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jan Palus <jpalus@fastmail.com>

[ Upstream commit f37669119423ca852ca855b24732f25c0737aa57 ]

RRT_ALRT register holds remaining battery time in minutes therefore it
needs to be scaled accordingly when exposing TIME_TO_EMPTY via sysfs
expressed in seconds

Fixes: b4c7715c10c1 ("power: supply: add CellWise cw2015 fuel gauge driver")
Signed-off-by: Jan Palus <jpalus@fastmail.com>
Link: https://lore.kernel.org/r/20231111221704.5579-1-jpalus@fastmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/power/supply/cw2015_battery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/cw2015_battery.c b/drivers/power/supply/cw2015_battery.c
index bb29e9ebd24a..99f3ccdc30a6 100644
--- a/drivers/power/supply/cw2015_battery.c
+++ b/drivers/power/supply/cw2015_battery.c
@@ -491,7 +491,7 @@ static int cw_battery_get_property(struct power_supply *psy,
 
 	case POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW:
 		if (cw_battery_valid_time_to_empty(cw_bat))
-			val->intval = cw_bat->time_to_empty;
+			val->intval = cw_bat->time_to_empty * 60;
 		else
 			val->intval = 0;
 		break;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 457/583] power: supply: bq256xx: fix some problem in bq256xx_hw_init
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (455 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 456/583] power: supply: cw2015: correct time_to_empty units in sysfs Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 458/583] PCI: Avoid potential out-of-bounds read in pci_dev_for_each_resource() Greg Kroah-Hartman
                   ` (132 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Su Hui, Sebastian Reichel, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Su Hui <suhui@nfschina.com>

[ Upstream commit b55d073e6501dc6077edaa945a6dad8ac5c8bbab ]

smatch complains that there is a buffer overflow and clang complains
'ret' is never read.

Smatch error:
drivers/power/supply/bq256xx_charger.c:1578 bq256xx_hw_init() error:
buffer overflow 'bq256xx_watchdog_time' 4 <= 4

Clang static checker:
Value stored to 'ret' is never read.

Add check for buffer overflow and error code from regmap_update_bits().

Fixes: 32e4978bb920 ("power: supply: bq256xx: Introduce the BQ256XX charger driver")
Signed-off-by: Su Hui <suhui@nfschina.com>
Link: https://lore.kernel.org/r/20231116041822.1378758-1-suhui@nfschina.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/power/supply/bq256xx_charger.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/power/supply/bq256xx_charger.c b/drivers/power/supply/bq256xx_charger.c
index 82d3cd5ee2f9..c8368dae69c7 100644
--- a/drivers/power/supply/bq256xx_charger.c
+++ b/drivers/power/supply/bq256xx_charger.c
@@ -1574,13 +1574,16 @@ static int bq256xx_hw_init(struct bq256xx_device *bq)
 			wd_reg_val = i;
 			break;
 		}
-		if (bq->watchdog_timer > bq256xx_watchdog_time[i] &&
+		if (i + 1 < BQ256XX_NUM_WD_VAL &&
+		    bq->watchdog_timer > bq256xx_watchdog_time[i] &&
 		    bq->watchdog_timer < bq256xx_watchdog_time[i + 1])
 			wd_reg_val = i;
 	}
 	ret = regmap_update_bits(bq->regmap, BQ256XX_CHARGER_CONTROL_1,
 				 BQ256XX_WATCHDOG_MASK, wd_reg_val <<
 						BQ256XX_WDT_BIT_SHIFT);
+	if (ret)
+		return ret;
 
 	ret = power_supply_get_battery_info(bq->charger, &bat_info);
 	if (ret == -ENOMEM)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 458/583] PCI: Avoid potential out-of-bounds read in pci_dev_for_each_resource()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (456 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 457/583] power: supply: bq256xx: fix some problem in bq256xx_hw_init Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 459/583] serial: 8250: omap: Dont skip resource freeing if pm_runtime_resume_and_get() failed Greg Kroah-Hartman
                   ` (131 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Bjorn Helgaas, Jonas Gorski,
	Andy Shevchenko, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

[ Upstream commit 3171e46d677a668eed3086da78671f1e4f5b8405 ]

Coverity complains that pointer in the pci_dev_for_each_resource() may be
wrong, i.e., might be used for the out-of-bounds read.

There is no actual issue right now because we have another check afterwards
and the out-of-bounds read is not being performed. In any case it's better
code with this fixed, hence the proposed change.

As Jonas pointed out "It probably makes the code slightly less performant
as res will now be checked for being not NULL (which will always be true),
but I doubt it will be significant (or in any hot paths)."

Fixes: 09cc90063240 ("PCI: Introduce pci_dev_for_each_resource()")
Reported-by: Bjorn Helgaas <bhelgaas@google.com>
Closes: https://lore.kernel.org/r/20230509182122.GA1259567@bhelgaas
Suggested-by: Jonas Gorski <jonas.gorski@gmail.com>
Link: https://lore.kernel.org/r/20231030114218.2752236-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/pci.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index 1596b1205b8d..3af5f2998551 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -2101,14 +2101,14 @@ int pci_iobar_pfn(struct pci_dev *pdev, int bar, struct vm_area_struct *vma);
 	(pci_resource_end((dev), (bar)) ? 				\
 	 resource_size(pci_resource_n((dev), (bar))) : 0)
 
-#define __pci_dev_for_each_res0(dev, res, ...)				\
-	for (unsigned int __b = 0;					\
-	     res = pci_resource_n(dev, __b), __b < PCI_NUM_RESOURCES;	\
+#define __pci_dev_for_each_res0(dev, res, ...)				  \
+	for (unsigned int __b = 0;					  \
+	     __b < PCI_NUM_RESOURCES && (res = pci_resource_n(dev, __b)); \
 	     __b++)
 
-#define __pci_dev_for_each_res1(dev, res, __b)				\
-	for (__b = 0;							\
-	     res = pci_resource_n(dev, __b), __b < PCI_NUM_RESOURCES;	\
+#define __pci_dev_for_each_res1(dev, res, __b)				  \
+	for (__b = 0;							  \
+	     __b < PCI_NUM_RESOURCES && (res = pci_resource_n(dev, __b)); \
 	     __b++)
 
 #define pci_dev_for_each_resource(dev, res, ...)			\
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 459/583] serial: 8250: omap: Dont skip resource freeing if pm_runtime_resume_and_get() failed
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (457 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 458/583] PCI: Avoid potential out-of-bounds read in pci_dev_for_each_resource() Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 460/583] iommu: Map reserved memory as cacheable if device is coherent Greg Kroah-Hartman
                   ` (130 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Uwe Kleine-König,
	Tony Lindgren, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

[ Upstream commit ad90d0358bd3b4554f243a425168fc7cebe7d04e ]

Returning an error code from .remove() makes the driver core emit the
little helpful error message:

	remove callback returned a non-zero value. This will be ignored.

and then remove the device anyhow. So all resources that were not freed
are leaked in this case. Skipping serial8250_unregister_port() has the
potential to keep enough of the UART around to trigger a use-after-free.

So replace the error return (and with it the little helpful error
message) by a more useful error message and continue to cleanup.

Fixes: e3f0c638f428 ("serial: 8250: omap: Fix unpaired pm_runtime_put_sync() in omap8250_remove()")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20231110152927.70601-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/tty/serial/8250/8250_omap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index 1122f37fe744..346167afe9e1 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -1581,7 +1581,7 @@ static int omap8250_remove(struct platform_device *pdev)
 
 	err = pm_runtime_resume_and_get(&pdev->dev);
 	if (err)
-		return err;
+		dev_err(&pdev->dev, "Failed to resume hardware\n");
 
 	up = serial8250_get_port(priv->line);
 	omap_8250_shutdown(&up->port);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 460/583] iommu: Map reserved memory as cacheable if device is coherent
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (458 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 459/583] serial: 8250: omap: Dont skip resource freeing if pm_runtime_resume_and_get() failed Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 461/583] perf test: Remove atomics from test_loop to avoid test failures Greg Kroah-Hartman
                   ` (129 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Laurentiu Tudor, Jason Gunthorpe,
	Thierry Reding, Joerg Roedel, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Laurentiu Tudor <laurentiu.tudor@nxp.com>

[ Upstream commit f1aad9df93f39267e890836a28d22511f23474e1 ]

Check if the device is marked as DMA coherent in the DT and if so,
map its reserved memory as cacheable in the IOMMU.
This fixes the recently added IOMMU reserved memory support which
uses IOMMU_RESV_DIRECT without properly building the PROT for the
mapping.

Fixes: a5bf3cfce8cb ("iommu: Implement of_iommu_get_resv_regions()")
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20230926152600.8749-1-laurentiu.tudor@nxp.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/iommu/of_iommu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
index 35ba090f3b5e..47302b637cc0 100644
--- a/drivers/iommu/of_iommu.c
+++ b/drivers/iommu/of_iommu.c
@@ -260,6 +260,9 @@ void of_iommu_get_resv_regions(struct device *dev, struct list_head *list)
 				phys_addr_t iova;
 				size_t length;
 
+				if (of_dma_is_coherent(dev->of_node))
+					prot |= IOMMU_CACHE;
+
 				maps = of_translate_dma_region(np, maps, &iova, &length);
 				type = iommu_resv_region_get_type(dev, &phys, iova, length);
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 461/583] perf test: Remove atomics from test_loop to avoid test failures
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (459 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 460/583] iommu: Map reserved memory as cacheable if device is coherent Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 462/583] perf header: Fix segfault on build_mem_topology() error path Greg Kroah-Hartman
                   ` (128 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, James Clark, Nick Forrington,
	Leo Yan, Adrian Hunter, Alexander Shishkin, Ian Rogers,
	Jiri Olsa, Mark Rutland, Namhyung Kim, Arnaldo Carvalho de Melo,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nick Forrington <nick.forrington@arm.com>

[ Upstream commit 72b4ca7e993e94f09bcf6d19fc385a2e8060c71f ]

The current use of atomics can lead to test failures, as tests (such as
tests/shell/record.sh) search for samples with "test_loop" as the
top-most stack frame, but find frames related to the atomic operation
(e.g. __aarch64_ldadd4_relax).

This change simply removes the "count" variable, as it is not necessary.

Fixes: 1962ab6f6e0b39e4 ("perf test workload thloop: Make count increments atomic")
Reviewed-by: James Clark <james.clark@arm.com>
Signed-off-by: Nick Forrington <nick.forrington@arm.com>
Acked-by: Leo Yan <leo.yan@linaro.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20231102162225.50028-1-nick.forrington@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/perf/tests/workloads/thloop.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tools/perf/tests/workloads/thloop.c b/tools/perf/tests/workloads/thloop.c
index af05269c2eb8..457b29f91c3e 100644
--- a/tools/perf/tests/workloads/thloop.c
+++ b/tools/perf/tests/workloads/thloop.c
@@ -7,7 +7,6 @@
 #include "../tests.h"
 
 static volatile sig_atomic_t done;
-static volatile unsigned count;
 
 /* We want to check this symbol in perf report */
 noinline void test_loop(void);
@@ -19,8 +18,7 @@ static void sighandler(int sig __maybe_unused)
 
 noinline void test_loop(void)
 {
-	while (!done)
-		__atomic_fetch_add(&count, 1, __ATOMIC_RELAXED);
+	while (!done);
 }
 
 static void *thfunc(void *arg)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 462/583] perf header: Fix segfault on build_mem_topology() error path
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (460 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 461/583] perf test: Remove atomics from test_loop to avoid test failures Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 463/583] libapi: Add missing linux/types.h header to get the __u64 type on io.h Greg Kroah-Hartman
                   ` (127 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Adrian Hunter, Ian Rogers,
	German Gomez, James Clark, Jiri Olsa, Leo Yan, Namhyung Kim,
	Arnaldo Carvalho de Melo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Adrian Hunter <adrian.hunter@intel.com>

[ Upstream commit 70df07838fc1c0acfab3325ae79014e241a88bdf ]

Do not increase the node count unless a node has been successfully read,
because it can lead to a segfault if an error occurs.

For example, if perf exceeds the open file limit in memory_node__read(),
which, on a test system, could be made to happen by setting the file limit
to exactly 32:

 Before:

  $ ulimit -n 32
  $ perf mem record --all-user -- sleep 1
  [ perf record: Woken up 1 times to write data ]
  failed: can't open memory sysfs data
  perf: Segmentation fault
  Obtained 14 stack frames.
  perf(sighandler_dump_stack+0x48) [0x55f4b1f59558]
  /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f4ba1c42520]
  /lib/x86_64-linux-gnu/libc.so.6(free+0x1e) [0x7f4ba1ca53fe]
  perf(+0x178ff4) [0x55f4b1f48ff4]
  perf(+0x179a70) [0x55f4b1f49a70]
  perf(+0x17ef5d) [0x55f4b1f4ef5d]
  perf(+0x85c0b) [0x55f4b1e55c0b]
  perf(cmd_record+0xe1d) [0x55f4b1e5920d]
  perf(cmd_mem+0xc96) [0x55f4b1e80e56]
  perf(+0x130460) [0x55f4b1f00460]
  perf(main+0x689) [0x55f4b1e427d9]
  /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f4ba1c29d90]
  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f4ba1c29e40]
  perf(_start+0x25) [0x55f4b1e42a25]
  Segmentation fault (core dumped)
  $

After:

  $ ulimit -n 32
  $ perf mem record --all-user -- sleep 1
  [ perf record: Woken up 1 times to write data ]
  failed: can't open memory sysfs data
  [ perf record: Captured and wrote 0.005 MB perf.data (11 samples) ]
  $

Fixes: f8e502b9d1b3b197 ("perf header: Ensure bitmaps are freed")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Ian Rogers <irogers@google.com>
Cc: German Gomez <german.gomez@arm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20231123075848.9652-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/perf/util/header.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index d812e1e371a7..41032243774e 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1444,7 +1444,9 @@ static int build_mem_topology(struct memory_node **nodesp, u64 *cntp)
 			nodes = new_nodes;
 			size += 4;
 		}
-		ret = memory_node__read(&nodes[cnt++], idx);
+		ret = memory_node__read(&nodes[cnt], idx);
+		if (!ret)
+			cnt += 1;
 	}
 out:
 	closedir(dir);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 463/583] libapi: Add missing linux/types.h header to get the __u64 type on io.h
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (461 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 462/583] perf header: Fix segfault on build_mem_topology() error path Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 464/583] usb: core: Allow subclassed USB drivers to override usb_choose_configuration() Greg Kroah-Hartman
                   ` (126 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ian Rogers, Adrian Hunter,
	Jiri Olsa, Namhyung Kim, Arnaldo Carvalho de Melo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnaldo Carvalho de Melo <acme@redhat.com>

[ Upstream commit af76b2dec0984a079d8497bfa37d29a9b55932e1 ]

There are functions using __u64, so we need to have the linux/types.h
header otherwise we'll break when its not included before api/io.h.

Fixes: e95770af4c4a280f ("tools api: Add a lightweight buffered reading api")
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/lkml/ZWjDPL+IzPPsuC3X@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/lib/api/io.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/lib/api/io.h b/tools/lib/api/io.h
index 9fc429d2852d..f4a9328035bd 100644
--- a/tools/lib/api/io.h
+++ b/tools/lib/api/io.h
@@ -12,6 +12,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <linux/types.h>
 
 struct io {
 	/* File descriptor being read/ */
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 464/583] usb: core: Allow subclassed USB drivers to override usb_choose_configuration()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (462 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 463/583] libapi: Add missing linux/types.h header to get the __u64 type on io.h Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 465/583] r8152: Choose our USB config with choose_configuration() rather than probe() Greg Kroah-Hartman
                   ` (125 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alan Stern, Douglas Anderson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Douglas Anderson <dianders@chromium.org>

[ Upstream commit a87b8e3be926af0fc3b9b1af42b1127bd1ff077c ]

For some USB devices we might want to do something different for
usb_choose_configuration(). One example here is the r8152 driver where
we want to end up using the vendor driver with the preferred
interface.

The r8152 driver tried to make things work by implementing a USB
generic_subclass driver and then overriding the normal config
selection after it happened. This is less than ideal and also caused
breakage if someone deauthorized and re-authorized the USB device
because the USB core ended up going back to it's default logic for
choosing the best config. I made an attempt to fix this [1] but it was
a bit ugly.

Let's do this better and allow USB generic_subclass drivers to
override usb_choose_configuration().

[1] https://lore.kernel.org/r/20231130154337.1.Ie00e07f07f87149c9ce0b27ae4e26991d307e14b@changeid

Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20231201102946.v2.2.Iade5fa31997f1a0ca3e1dec0591633b02471df12@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: aa4f2b3e418e ("r8152: Choose our USB config with choose_configuration() rather than probe()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/usb/core/generic.c | 7 +++++++
 include/linux/usb.h        | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c
index 740342a2812a..dcb897158228 100644
--- a/drivers/usb/core/generic.c
+++ b/drivers/usb/core/generic.c
@@ -59,10 +59,17 @@ int usb_choose_configuration(struct usb_device *udev)
 	int num_configs;
 	int insufficient_power = 0;
 	struct usb_host_config *c, *best;
+	struct usb_device_driver *udriver = to_usb_device_driver(udev->dev.driver);
 
 	if (usb_device_is_owned(udev))
 		return 0;
 
+	if (udriver->choose_configuration) {
+		i = udriver->choose_configuration(udev);
+		if (i >= 0)
+			return i;
+	}
+
 	best = NULL;
 	c = udev->config;
 	num_configs = udev->descriptor.bNumConfigurations;
diff --git a/include/linux/usb.h b/include/linux/usb.h
index a21074861f91..bfd77ece0643 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1264,6 +1264,9 @@ struct usb_driver {
  *	module is being unloaded.
  * @suspend: Called when the device is going to be suspended by the system.
  * @resume: Called when the device is being resumed by the system.
+ * @choose_configuration: If non-NULL, called instead of the default
+ *	usb_choose_configuration(). If this returns an error then we'll go
+ *	on to call the normal usb_choose_configuration().
  * @dev_groups: Attributes attached to the device that will be created once it
  *	is bound to the driver.
  * @drvwrap: Driver-model core structure wrapper.
@@ -1287,6 +1290,9 @@ struct usb_device_driver {
 
 	int (*suspend) (struct usb_device *udev, pm_message_t message);
 	int (*resume) (struct usb_device *udev, pm_message_t message);
+
+	int (*choose_configuration) (struct usb_device *udev);
+
 	const struct attribute_group **dev_groups;
 	struct usbdrv_wrap drvwrap;
 	const struct usb_device_id *id_table;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 465/583] r8152: Choose our USB config with choose_configuration() rather than probe()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (463 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 464/583] usb: core: Allow subclassed USB drivers to override usb_choose_configuration() Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 466/583] perf test record user-regs: Fix mask for vg register Greg Kroah-Hartman
                   ` (124 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alan Stern, Douglas Anderson,
	Grant Grundler, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Douglas Anderson <dianders@chromium.org>

[ Upstream commit aa4f2b3e418e8673e55145de8b8016a7a9920306 ]

If you deauthorize the r8152 device (by writing 0 to the "authorized"
field in sysfs) and then reauthorize it (by writing a 1) then it no
longer works. This is because when you do the above we lose the
special configuration that we set in rtl8152_cfgselector_probe().
Deauthorizing causes the config to be set to -1 and then reauthorizing
runs the default logic for choosing the best config.

I made an attempt to fix it so that the config is kept across
deauthorizing / reauthorizing [1] but it was a bit ugly.

Let's instead use the new USB core feature to override
choose_configuration().

This patch relies upon the patches ("usb: core: Don't force USB
generic_subclass drivers to define probe()") and ("usb: core: Allow
subclassed USB drivers to override usb_choose_configuration()")

[1] https://lore.kernel.org/r/20231130154337.1.Ie00e07f07f87149c9ce0b27ae4e26991d307e14b@changeid

Fixes: ec51fbd1b8a2 ("r8152: add USB device driver for config selection")
Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Link: https://lore.kernel.org/r/20231201102946.v2.3.Ie00e07f07f87149c9ce0b27ae4e26991d307e14b@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/usb/r8152.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 127b34dcc5b3..cca5b81c8b18 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -10036,7 +10036,7 @@ static struct usb_driver rtl8152_driver = {
 	.disable_hub_initiated_lpm = 1,
 };
 
-static int rtl8152_cfgselector_probe(struct usb_device *udev)
+static int rtl8152_cfgselector_choose_configuration(struct usb_device *udev)
 {
 	struct usb_host_config *c;
 	int i, num_configs;
@@ -10063,19 +10063,13 @@ static int rtl8152_cfgselector_probe(struct usb_device *udev)
 	if (i == num_configs)
 		return -ENODEV;
 
-	if (usb_set_configuration(udev, c->desc.bConfigurationValue)) {
-		dev_err(&udev->dev, "Failed to set configuration %d\n",
-			c->desc.bConfigurationValue);
-		return -ENODEV;
-	}
-
-	return 0;
+	return c->desc.bConfigurationValue;
 }
 
 static struct usb_device_driver rtl8152_cfgselector_driver = {
-	.name =		MODULENAME "-cfgselector",
-	.probe =	rtl8152_cfgselector_probe,
-	.id_table =	rtl8152_table,
+	.name =	MODULENAME "-cfgselector",
+	.choose_configuration = rtl8152_cfgselector_choose_configuration,
+	.id_table = rtl8152_table,
 	.generic_subclass = 1,
 	.supports_autosuspend = 1,
 };
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 466/583] perf test record user-regs: Fix mask for vg register
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (464 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 465/583] r8152: Choose our USB config with choose_configuration() rather than probe() Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 467/583] vfio/pds: Fix calculations in pds_vfio_dirty_sync Greg Kroah-Hartman
                   ` (123 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Leo Yan, Veronika Molnarova,
	James Clark, Michael Petlan, Arnaldo Carvalho de Melo,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Veronika Molnarova <vmolnaro@redhat.com>

[ Upstream commit 28b01743ca752cea5ab182297d8b912b22f2a2d1 ]

The 'vg' register for arm64 shows up in --user_regs as available when
masking the variable AT_HWCAP with 1 << 22 returns '1' as done in
perf_regs.c.

However, in subtests for support of SVE, the check for the 'vg' register
is done by masking the variable AT_HWCAP with the value 0x200000 which
is equals to 1 << 21 instead of 1 << 22.

This results in inconsistencies on certain systems where the test
expects that the 'vg' register is not operational when it is, and
vice-versa.

During the testing on a machine that the test expected not to have the
'vg' register available, 'perf record' with the option --user-regs
showed records for the 'vg' register together with all of the others,
which means that the mask for the subtest of perf_event_attr is off by
one.

Change the value of the mask from 0x200000 to 0x400000 to correct it.

Fixes: 9440ebdc333dd12e ("perf test arm64: Add attr tests for new VG register")
Reviewed-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Link: https://lore.kernel.org/r/20231201194617.13012-1-vmolnaro@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64 | 2 +-
 tools/perf/tests/attr/test-record-user-regs-sve-aarch64    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64 b/tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64
index fbb065842880..bed765450ca9 100644
--- a/tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64
+++ b/tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64
@@ -6,4 +6,4 @@ args    = --no-bpf-event --user-regs=vg kill >/dev/null 2>&1
 ret     = 129
 test_ret = true
 arch    = aarch64
-auxv    = auxv["AT_HWCAP"] & 0x200000 == 0
+auxv    = auxv["AT_HWCAP"] & 0x400000 == 0
diff --git a/tools/perf/tests/attr/test-record-user-regs-sve-aarch64 b/tools/perf/tests/attr/test-record-user-regs-sve-aarch64
index c598c803221d..a65113cd7311 100644
--- a/tools/perf/tests/attr/test-record-user-regs-sve-aarch64
+++ b/tools/perf/tests/attr/test-record-user-regs-sve-aarch64
@@ -6,7 +6,7 @@ args    = --no-bpf-event --user-regs=vg kill >/dev/null 2>&1
 ret     = 1
 test_ret = true
 arch    = aarch64
-auxv    = auxv["AT_HWCAP"] & 0x200000 == 0x200000
+auxv    = auxv["AT_HWCAP"] & 0x400000 == 0x400000
 kernel_since = 6.1
 
 [event:base-record]
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 467/583] vfio/pds: Fix calculations in pds_vfio_dirty_sync
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (465 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 466/583] perf test record user-regs: Fix mask for vg register Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58   ` Greg Kroah-Hartman
                   ` (122 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Brett Creeley, Shannon Nelson,
	Alex Williamson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Brett Creeley <brett.creeley@amd.com>

[ Upstream commit 4004497cec3093d7b0087bc70709b45969fa07b6 ]

The incorrect check is being done for comparing the
iova/length being requested to sync. This can cause
the dirty sync operation to fail. Fix this by making
sure the iova offset added to the requested sync
length doesn't exceed the region_size.

Also, the region_start is assumed to always be at 0.
This can cause dirty tracking to fail because the
device/driver bitmap offset always starts at 0,
however, the region_start/iova may not. Fix this by
determining the iova offset from region_start to
determine the bitmap offset.

Fixes: f232836a9152 ("vfio/pds: Add support for dirty page tracking")
Signed-off-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Link: https://lore.kernel.org/r/20231117001207.2793-2-brett.creeley@amd.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vfio/pci/pds/dirty.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/vfio/pci/pds/dirty.c b/drivers/vfio/pci/pds/dirty.c
index c937aa6f3954..27607d7b9030 100644
--- a/drivers/vfio/pci/pds/dirty.c
+++ b/drivers/vfio/pci/pds/dirty.c
@@ -478,8 +478,7 @@ static int pds_vfio_dirty_sync(struct pds_vfio_pci_device *pds_vfio,
 		pds_vfio->vf_id, iova, length, pds_vfio->dirty.region_page_size,
 		pages, bitmap_size);
 
-	if (!length || ((dirty->region_start + iova + length) >
-			(dirty->region_start + dirty->region_size))) {
+	if (!length || ((iova - dirty->region_start + length) > dirty->region_size)) {
 		dev_err(dev, "Invalid iova 0x%lx and/or length 0x%lx to sync\n",
 			iova, length);
 		return -EINVAL;
@@ -496,7 +495,8 @@ static int pds_vfio_dirty_sync(struct pds_vfio_pci_device *pds_vfio,
 		return -EINVAL;
 	}
 
-	bmp_offset = DIV_ROUND_UP(iova / dirty->region_page_size, sizeof(u64));
+	bmp_offset = DIV_ROUND_UP((iova - dirty->region_start) /
+				  dirty->region_page_size, sizeof(u64));
 
 	dev_dbg(dev,
 		"Syncing dirty bitmap, iova 0x%lx length 0x%lx, bmp_offset %llu bmp_bytes %llu\n",
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 468/583] perf vendor events arm64 AmpereOne: Rename BPU_FLUSH_MEM_FAULT to GPC_FLUSH_MEM_FAULT
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
@ 2024-01-22 23:58   ` Greg Kroah-Hartman
  2024-01-22 23:50 ` [PATCH 6.6 002/583] x86/mce/inject: Clear test status value Greg Kroah-Hartman
                     ` (588 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ian Rogers, Ilkka Koskinen,
	Adrian Hunter, Alexander Shishkin, Ingo Molnar, James Clark,
	Jiri Olsa, John Garry, Leo Yan, linux-arm-kernel, Mark Rutland,
	Mike Leach, Namhyung Kim, Peter Zijlstra, Will Deacon,
	Arnaldo Carvalho de Melo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ilkka Koskinen <ilkka@os.amperecomputing.com>

[ Upstream commit 10a149e4b4a9187940adbfff0f216ccb5a15aa41 ]

The documentation wrongly called the event as BPU_FLUSH_MEM_FAULT and now
has been fixed. Correct the name in the perf tool as well.

Fixes: a9650b7f6fc09d16 ("perf vendor events arm64: Add AmpereOne core PMU events")
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ilkka Koskinen <ilkka@os.amperecomputing.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20231201021550.1109196-3-ilkka@os.amperecomputing.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../pmu-events/arch/arm64/ampere/ampereone/core-imp-def.json    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/pmu-events/arch/arm64/ampere/ampereone/core-imp-def.json b/tools/perf/pmu-events/arch/arm64/ampere/ampereone/core-imp-def.json
index 88b23b85e33c..879ff21e0b17 100644
--- a/tools/perf/pmu-events/arch/arm64/ampere/ampereone/core-imp-def.json
+++ b/tools/perf/pmu-events/arch/arm64/ampere/ampereone/core-imp-def.json
@@ -110,7 +110,7 @@
     {
         "PublicDescription": "Flushes due to memory hazards",
         "EventCode": "0x121",
-        "EventName": "BPU_FLUSH_MEM_FAULT",
+        "EventName": "GPC_FLUSH_MEM_FAULT",
         "BriefDescription": "Flushes due to memory hazards"
     },
     {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 468/583] perf vendor events arm64 AmpereOne: Rename BPU_FLUSH_MEM_FAULT to GPC_FLUSH_MEM_FAULT
@ 2024-01-22 23:58   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ian Rogers, Ilkka Koskinen,
	Adrian Hunter, Alexander Shishkin, Ingo Molnar, James Clark,
	Jiri Olsa, John Garry, Leo Yan, linux-arm-kernel, Mark Rutland,
	Mike Leach, Namhyung Kim, Peter Zijlstra, Will Deacon,
	Arnaldo Carvalho de Melo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ilkka Koskinen <ilkka@os.amperecomputing.com>

[ Upstream commit 10a149e4b4a9187940adbfff0f216ccb5a15aa41 ]

The documentation wrongly called the event as BPU_FLUSH_MEM_FAULT and now
has been fixed. Correct the name in the perf tool as well.

Fixes: a9650b7f6fc09d16 ("perf vendor events arm64: Add AmpereOne core PMU events")
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ilkka Koskinen <ilkka@os.amperecomputing.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20231201021550.1109196-3-ilkka@os.amperecomputing.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../pmu-events/arch/arm64/ampere/ampereone/core-imp-def.json    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/pmu-events/arch/arm64/ampere/ampereone/core-imp-def.json b/tools/perf/pmu-events/arch/arm64/ampere/ampereone/core-imp-def.json
index 88b23b85e33c..879ff21e0b17 100644
--- a/tools/perf/pmu-events/arch/arm64/ampere/ampereone/core-imp-def.json
+++ b/tools/perf/pmu-events/arch/arm64/ampere/ampereone/core-imp-def.json
@@ -110,7 +110,7 @@
     {
         "PublicDescription": "Flushes due to memory hazards",
         "EventCode": "0x121",
-        "EventName": "BPU_FLUSH_MEM_FAULT",
+        "EventName": "GPC_FLUSH_MEM_FAULT",
         "BriefDescription": "Flushes due to memory hazards"
     },
     {
-- 
2.43.0




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 469/583] perf mem: Fix error on hybrid related to availability of mem event in a PMU
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (467 preceding siblings ...)
  2024-01-22 23:58   ` Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 470/583] perf stat: Exit perf stat if parse groups fails Greg Kroah-Hartman
                   ` (120 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ammy Yi, Kan Liang, Ian Rogers,
	Adrian Hunter, Ingo Molnar, Jiri Olsa, Mark Rutland,
	Namhyung Kim, Peter Zijlstra, Ravi Bangoria,
	Arnaldo Carvalho de Melo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kan Liang <kan.liang@linux.intel.com>

[ Upstream commit a4320085a6c694326dd8db46f563d52d1a826f07 ]

The below error can be triggered on a hybrid machine.

 $ perf mem record -t load sleep 1
 event syntax error: 'breakpoint/mem-loads,ldlat=30/P'
                                \___ Bad event or PMU

 Unable to find PMU or event on a PMU of 'breakpoint'

In the perf_mem_events__record_args(), the current perf never checks the
availability of a mem event on a given PMU. All the PMUs will be added
to the perf mem event list. Perf errors out for the unsupported PMU.

Extend perf_mem_event__supported() and take a PMU into account. Check
the mem event for each PMU before adding it to the perf mem event list.

Optimize the perf_mem_events__init() a little bit. The function is to
check whether the mem events are supported in the system. It doesn't
need to scan all PMUs. Just return with the first supported PMU is good
enough.

Fixes: 5752c20f3787c9bc ("perf mem: Scan all PMUs instead of just core ones")
Reported-by: Ammy Yi <ammy.yi@intel.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Tested-by: Ammy Yi <ammy.yi@intel.com>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Link: https://lore.kernel.org/r/20231128203940.3964287-1-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/perf/util/mem-events.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c
index 954b235e12e5..3a2e3687878c 100644
--- a/tools/perf/util/mem-events.c
+++ b/tools/perf/util/mem-events.c
@@ -100,11 +100,14 @@ int perf_mem_events__parse(const char *str)
 	return -1;
 }
 
-static bool perf_mem_event__supported(const char *mnt, char *sysfs_name)
+static bool perf_mem_event__supported(const char *mnt, struct perf_pmu *pmu,
+				      struct perf_mem_event *e)
 {
+	char sysfs_name[100];
 	char path[PATH_MAX];
 	struct stat st;
 
+	scnprintf(sysfs_name, sizeof(sysfs_name), e->sysfs_name, pmu->name);
 	scnprintf(path, PATH_MAX, "%s/devices/%s", mnt, sysfs_name);
 	return !stat(path, &st);
 }
@@ -120,7 +123,6 @@ int perf_mem_events__init(void)
 
 	for (j = 0; j < PERF_MEM_EVENTS__MAX; j++) {
 		struct perf_mem_event *e = perf_mem_events__ptr(j);
-		char sysfs_name[100];
 		struct perf_pmu *pmu = NULL;
 
 		/*
@@ -136,12 +138,12 @@ int perf_mem_events__init(void)
 		 * of core PMU.
 		 */
 		while ((pmu = perf_pmus__scan(pmu)) != NULL) {
-			scnprintf(sysfs_name, sizeof(sysfs_name), e->sysfs_name, pmu->name);
-			e->supported |= perf_mem_event__supported(mnt, sysfs_name);
+			e->supported |= perf_mem_event__supported(mnt, pmu, e);
+			if (e->supported) {
+				found = true;
+				break;
+			}
 		}
-
-		if (e->supported)
-			found = true;
 	}
 
 	return found ? 0 : -ENOENT;
@@ -167,13 +169,10 @@ static void perf_mem_events__print_unsupport_hybrid(struct perf_mem_event *e,
 						    int idx)
 {
 	const char *mnt = sysfs__mount();
-	char sysfs_name[100];
 	struct perf_pmu *pmu = NULL;
 
 	while ((pmu = perf_pmus__scan(pmu)) != NULL) {
-		scnprintf(sysfs_name, sizeof(sysfs_name), e->sysfs_name,
-			  pmu->name);
-		if (!perf_mem_event__supported(mnt, sysfs_name)) {
+		if (!perf_mem_event__supported(mnt, pmu, e)) {
 			pr_err("failed: event '%s' not supported\n",
 			       perf_mem_events__name(idx, pmu->name));
 		}
@@ -183,6 +182,7 @@ static void perf_mem_events__print_unsupport_hybrid(struct perf_mem_event *e,
 int perf_mem_events__record_args(const char **rec_argv, int *argv_nr,
 				 char **rec_tmp, int *tmp_nr)
 {
+	const char *mnt = sysfs__mount();
 	int i = *argv_nr, k = 0;
 	struct perf_mem_event *e;
 
@@ -211,6 +211,9 @@ int perf_mem_events__record_args(const char **rec_argv, int *argv_nr,
 			while ((pmu = perf_pmus__scan(pmu)) != NULL) {
 				const char *s = perf_mem_events__name(j, pmu->name);
 
+				if (!perf_mem_event__supported(mnt, pmu, e))
+					continue;
+
 				rec_argv[i++] = "-e";
 				if (s) {
 					char *copy = strdup(s);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 470/583] perf stat: Exit perf stat if parse groups fails
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (468 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 469/583] perf mem: Fix error on hybrid related to availability of mem event in a PMU Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 471/583] base/node.c: initialize the accessor list before registering Greg Kroah-Hartman
                   ` (119 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Arnaldo Carvalho de Melo,
	Ian Rogers, Adrian Hunter, Alexander Shishkin, Ingo Molnar,
	Jiri Olsa, Mark Rutland, Namhyung Kim, Peter Zijlstra,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ian Rogers <irogers@google.com>

[ Upstream commit 0713ab3bd169da82c35eefd012b07b715e4ebcf7 ]

Metrics were added by a callback but commit a4b8cfcabb1d90ec ("perf
stat: Delay metric parsing") postponed this to allow optimizations based
on the CPU configuration.

In doing so it stopped errors in metric parsing from causing 'perf stat'
termination.

This change adds the termination for bad metric names back in.

Fixes: a4b8cfcabb1d90ec ("perf stat: Delay metric parsing")
Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Closes: https://lore.kernel.org/lkml/ZXByT1K6enTh2EHT@kernel.org/
Link: https://lore.kernel.org/r/20231206183533.972028-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/perf/builtin-stat.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index a3af805a1d57..78c104922181 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -2695,15 +2695,19 @@ int cmd_stat(int argc, const char **argv)
 	 */
 	if (metrics) {
 		const char *pmu = parse_events_option_args.pmu_filter ?: "all";
+		int ret = metricgroup__parse_groups(evsel_list, pmu, metrics,
+						stat_config.metric_no_group,
+						stat_config.metric_no_merge,
+						stat_config.metric_no_threshold,
+						stat_config.user_requested_cpu_list,
+						stat_config.system_wide,
+						&stat_config.metric_events);
 
-		metricgroup__parse_groups(evsel_list, pmu, metrics,
-					stat_config.metric_no_group,
-					stat_config.metric_no_merge,
-					stat_config.metric_no_threshold,
-					stat_config.user_requested_cpu_list,
-					stat_config.system_wide,
-					&stat_config.metric_events);
 		zfree(&metrics);
+		if (ret) {
+			status = ret;
+			goto out;
+		}
 	}
 
 	if (add_default_attributes())
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 471/583] base/node.c: initialize the accessor list before registering
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (469 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 470/583] perf stat: Exit perf stat if parse groups fails Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 472/583] acpi: property: Let args be NULL in __acpi_node_get_property_reference Greg Kroah-Hartman
                   ` (118 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Gregory Price, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Gregory Price <gourry.memverge@gmail.com>

[ Upstream commit 48b5928e18dc27e05cab3dc4c78cd8a15baaf1e5 ]

The current code registers the node as available in the node array
before initializing the accessor list.  This makes it so that
anything which might access the accessor list as a result of
allocations will cause an undefined memory access.

In one example, an extension to access hmat data during interleave
caused this undefined access as a result of a bulk allocation
that occurs during node initialization but before the accessor
list is initialized.

Initialize the accessor list before making the node generally
available to the global system.

Fixes: 08d9dbe72b1f ("node: Link memory nodes to their compute nodes")
Signed-off-by: Gregory Price <gregory.price@memverge.com>
Link: https://lore.kernel.org/r/20231030044239.971756-1-gregory.price@memverge.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/base/node.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/base/node.c b/drivers/base/node.c
index 493d533f8375..4d588f4658c8 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -868,11 +868,15 @@ int __register_one_node(int nid)
 {
 	int error;
 	int cpu;
+	struct node *node;
 
-	node_devices[nid] = kzalloc(sizeof(struct node), GFP_KERNEL);
-	if (!node_devices[nid])
+	node = kzalloc(sizeof(struct node), GFP_KERNEL);
+	if (!node)
 		return -ENOMEM;
 
+	INIT_LIST_HEAD(&node->access_list);
+	node_devices[nid] = node;
+
 	error = register_node(node_devices[nid], nid);
 
 	/* link cpu under this node */
@@ -881,7 +885,6 @@ int __register_one_node(int nid)
 			register_cpu_under_node(cpu, nid);
 	}
 
-	INIT_LIST_HEAD(&node_devices[nid]->access_list);
 	node_init_caches(nid);
 
 	return error;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 472/583] acpi: property: Let args be NULL in __acpi_node_get_property_reference
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (470 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 471/583] base/node.c: initialize the accessor list before registering Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 473/583] software node: Let args be NULL in software_node_get_reference_args Greg Kroah-Hartman
                   ` (117 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sakari Ailus, Andy Shevchenko,
	Heikki Krogerus, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sakari Ailus <sakari.ailus@linux.intel.com>

[ Upstream commit bef52aa0f3de1b7d8c258c13b16e577361dabf3a ]

fwnode_get_property_reference_args() may not be called with args argument
NULL on ACPI, OF already supports this. Add the missing NULL checks and
document this.

The purpose is to be able to count the references.

Fixes: 977d5ad39f3e ("ACPI: Convert ACPI reference args to generic fwnode reference args")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20231109101010.1329587-2-sakari.ailus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/property.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index 99b4e3355435..4d958a165da0 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -851,6 +851,7 @@ static int acpi_get_ref_args(struct fwnode_reference_args *args,
  * @index: Index of the reference to return
  * @num_args: Maximum number of arguments after each reference
  * @args: Location to store the returned reference with optional arguments
+ *	  (may be NULL)
  *
  * Find property with @name, verifify that it is a package containing at least
  * one object reference and if so, store the ACPI device object pointer to the
@@ -907,6 +908,9 @@ int __acpi_node_get_property_reference(const struct fwnode_handle *fwnode,
 		if (!device)
 			return -EINVAL;
 
+		if (!args)
+			return 0;
+
 		args->fwnode = acpi_fwnode_handle(device);
 		args->nargs = 0;
 		return 0;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 473/583] software node: Let args be NULL in software_node_get_reference_args
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (471 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 472/583] acpi: property: Let args be NULL in __acpi_node_get_property_reference Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 474/583] serial: imx: fix tx statemachine deadlock Greg Kroah-Hartman
                   ` (116 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sakari Ailus, Andy Shevchenko,
	Heikki Krogerus, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sakari Ailus <sakari.ailus@linux.intel.com>

[ Upstream commit 1eaea4b3604eb9ca7d9a1e73d88fc121bb4061f5 ]

fwnode_get_property_reference_args() may not be called with args argument
NULL and while OF already supports this. Add the missing NULL check.

The purpose is to be able to count the references.

Fixes: b06184acf751 ("software node: Add software_node_get_reference_args()")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20231109101010.1329587-3-sakari.ailus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/base/swnode.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
index 1886995a0b3a..079bd14bdedc 100644
--- a/drivers/base/swnode.c
+++ b/drivers/base/swnode.c
@@ -541,6 +541,9 @@ software_node_get_reference_args(const struct fwnode_handle *fwnode,
 	if (nargs > NR_FWNODE_REFERENCE_ARGS)
 		return -EINVAL;
 
+	if (!args)
+		return 0;
+
 	args->fwnode = software_node_get(refnode);
 	args->nargs = nargs;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 474/583] serial: imx: fix tx statemachine deadlock
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (472 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 473/583] software node: Let args be NULL in software_node_get_reference_args Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 475/583] selftests/sgx: Fix uninitialized pointer dereference in error path Greg Kroah-Hartman
                   ` (115 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Paul Geurts, Rasmus Villemoes,
	Eberhard Stoll, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Paul Geurts <paul_geurts@live.nl>

[ Upstream commit 78d60dae9a0c9f09aa3d6477c94047df2fe6f7b0 ]

When using the serial port as RS485 port, the tx statemachine is used to
control the RTS pin to drive the RS485 transceiver TX_EN pin. When the
TTY port is closed in the middle of a transmission (for instance during
userland application crash), imx_uart_shutdown disables the interface
and disables the Transmission Complete interrupt. afer that,
imx_uart_stop_tx bails on an incomplete transmission, to be retriggered
by the TC interrupt. This interrupt is disabled and therefore the tx
statemachine never transitions out of SEND. The statemachine is in
deadlock now, and the TX_EN remains low, making the interface useless.

imx_uart_stop_tx now checks for incomplete transmission AND whether TC
interrupts are enabled before bailing to be retriggered. This makes sure
the state machine handling is reached, and is properly set to
WAIT_AFTER_SEND.

Fixes: cb1a60923609 ("serial: imx: implement rts delaying for rs485")
Signed-off-by: Paul Geurts <paul_geurts@live.nl>
Tested-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Tested-by: Eberhard Stoll <eberhard.stoll@gmx.de>
Link: https://lore.kernel.org/r/AM0PR09MB26758F651BC1B742EB45775995B8A@AM0PR09MB2675.eurprd09.prod.outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/tty/serial/imx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 2e85c77e7c0d..c084ac3bb441 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -421,13 +421,13 @@ static void imx_uart_stop_tx(struct uart_port *port)
 	ucr1 = imx_uart_readl(sport, UCR1);
 	imx_uart_writel(sport, ucr1 & ~UCR1_TRDYEN, UCR1);
 
+	ucr4 = imx_uart_readl(sport, UCR4);
 	usr2 = imx_uart_readl(sport, USR2);
-	if (!(usr2 & USR2_TXDC)) {
+	if ((!(usr2 & USR2_TXDC)) && (ucr4 & UCR4_TCEN)) {
 		/* The shifter is still busy, so retry once TC triggers */
 		return;
 	}
 
-	ucr4 = imx_uart_readl(sport, UCR4);
 	ucr4 &= ~UCR4_TCEN;
 	imx_uart_writel(sport, ucr4, UCR4);
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 475/583] selftests/sgx: Fix uninitialized pointer dereference in error path
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (473 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 474/583] serial: imx: fix tx statemachine deadlock Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 476/583] selftests/sgx: Fix uninitialized pointer dereferences in encl_get_entry Greg Kroah-Hartman
                   ` (114 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jo Van Bulck, Dave Hansen,
	Jarkko Sakkinen, Kai Huang, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>

[ Upstream commit 79eba8c924f7decfa71ddf187d38cb9f5f2cd7b3 ]

Ensure ctx is zero-initialized, such that the encl_measure function will
not call EVP_MD_CTX_destroy with an uninitialized ctx pointer in case of an
early error during key generation.

Fixes: 2adcba79e69d ("selftests/x86: Add a selftest for SGX")
Signed-off-by: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Acked-by: Kai Huang <kai.huang@intel.com>
Link: https://lore.kernel.org/all/20231005153854.25566-2-jo.vanbulck%40cs.kuleuven.be
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/sgx/sigstruct.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/sgx/sigstruct.c b/tools/testing/selftests/sgx/sigstruct.c
index a07896a46364..d73b29becf5b 100644
--- a/tools/testing/selftests/sgx/sigstruct.c
+++ b/tools/testing/selftests/sgx/sigstruct.c
@@ -318,9 +318,9 @@ bool encl_measure(struct encl *encl)
 	struct sgx_sigstruct *sigstruct = &encl->sigstruct;
 	struct sgx_sigstruct_payload payload;
 	uint8_t digest[SHA256_DIGEST_LENGTH];
+	EVP_MD_CTX *ctx = NULL;
 	unsigned int siglen;
 	RSA *key = NULL;
-	EVP_MD_CTX *ctx;
 	int i;
 
 	memset(sigstruct, 0, sizeof(*sigstruct));
@@ -384,7 +384,8 @@ bool encl_measure(struct encl *encl)
 	return true;
 
 err:
-	EVP_MD_CTX_destroy(ctx);
+	if (ctx)
+		EVP_MD_CTX_destroy(ctx);
 	RSA_free(key);
 	return false;
 }
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 476/583] selftests/sgx: Fix uninitialized pointer dereferences in encl_get_entry
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (474 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 475/583] selftests/sgx: Fix uninitialized pointer dereference in error path Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 477/583] selftests/sgx: Include memory clobber for inline asm in test enclave Greg Kroah-Hartman
                   ` (113 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jo Van Bulck, Dave Hansen,
	Jarkko Sakkinen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>

[ Upstream commit b84fc2e0139ba4b23b8039bd7cfd242894fe8f8b ]

Ensure sym_tab and sym_names are zero-initialized and add an early-out
condition in the unlikely (erroneous) case that the enclave ELF file would
not contain a symbol table.

This addresses -Werror=maybe-uninitialized compiler warnings for gcc -O2.

Fixes: 33c5aac3bf32 ("selftests/sgx: Test complete changing of page type flow")
Signed-off-by: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/all/20231005153854.25566-3-jo.vanbulck%40cs.kuleuven.be
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/sgx/load.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/sgx/load.c b/tools/testing/selftests/sgx/load.c
index 94bdeac1cf04..c9f658e44de6 100644
--- a/tools/testing/selftests/sgx/load.c
+++ b/tools/testing/selftests/sgx/load.c
@@ -136,11 +136,11 @@ static bool encl_ioc_add_pages(struct encl *encl, struct encl_segment *seg)
  */
 uint64_t encl_get_entry(struct encl *encl, const char *symbol)
 {
+	Elf64_Sym *symtab = NULL;
+	char *sym_names = NULL;
 	Elf64_Shdr *sections;
-	Elf64_Sym *symtab;
 	Elf64_Ehdr *ehdr;
-	char *sym_names;
-	int num_sym;
+	int num_sym = 0;
 	int i;
 
 	ehdr = encl->bin;
@@ -161,6 +161,9 @@ uint64_t encl_get_entry(struct encl *encl, const char *symbol)
 		}
 	}
 
+	if (!symtab || !sym_names)
+		return 0;
+
 	for (i = 0; i < num_sym; i++) {
 		Elf64_Sym *sym = &symtab[i];
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 477/583] selftests/sgx: Include memory clobber for inline asm in test enclave
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (475 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 476/583] selftests/sgx: Fix uninitialized pointer dereferences in encl_get_entry Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 478/583] selftests/sgx: Skip non X86_64 platform Greg Kroah-Hartman
                   ` (112 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jo Van Bulck, Dave Hansen,
	Kai Huang, Jarkko Sakkinen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>

[ Upstream commit 853a57a43ebdb8c024160c1a0990bae85f4bcc2f ]

Add the "memory" clobber to the EMODPE and EACCEPT asm blocks to tell the
compiler the assembly code accesses to the secinfo struct. This ensures
the compiler treats the asm block as a memory barrier and the write to
secinfo will be visible to ENCLU.

Fixes: 20404a808593 ("selftests/sgx: Add test for EPCM permission changes")
Signed-off-by: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/all/20231005153854.25566-4-jo.vanbulck%40cs.kuleuven.be
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/sgx/test_encl.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/sgx/test_encl.c b/tools/testing/selftests/sgx/test_encl.c
index c0d6397295e3..ae791df3e5a5 100644
--- a/tools/testing/selftests/sgx/test_encl.c
+++ b/tools/testing/selftests/sgx/test_encl.c
@@ -24,10 +24,11 @@ static void do_encl_emodpe(void *_op)
 	secinfo.flags = op->flags;
 
 	asm volatile(".byte 0x0f, 0x01, 0xd7"
-				:
+				: /* no outputs */
 				: "a" (EMODPE),
 				  "b" (&secinfo),
-				  "c" (op->epc_addr));
+				  "c" (op->epc_addr)
+				: "memory" /* read from secinfo pointer */);
 }
 
 static void do_encl_eaccept(void *_op)
@@ -42,7 +43,8 @@ static void do_encl_eaccept(void *_op)
 				: "=a" (rax)
 				: "a" (EACCEPT),
 				  "b" (&secinfo),
-				  "c" (op->epc_addr));
+				  "c" (op->epc_addr)
+				: "memory" /* read from secinfo pointer */);
 
 	op->ret = rax;
 }
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 478/583] selftests/sgx: Skip non X86_64 platform
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (476 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 477/583] selftests/sgx: Include memory clobber for inline asm in test enclave Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 479/583] iio: adc: ad9467: fix reset gpio handling Greg Kroah-Hartman
                   ` (111 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Zhao Mengmeng, Dave Hansen,
	Jarkko Sakkinen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Zhao Mengmeng <zhaomengmeng@kylinos.cn>

[ Upstream commit 981cf568a8644161c2f15c02278ebc2834b51ba6 ]

When building whole selftests on arm64, rsync gives an erorr about sgx:

rsync: [sender] link_stat "/root/linux-next/tools/testing/selftests/sgx/test_encl.elf" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1327) [sender=3.2.5]

The root casue is sgx only used on X86_64, and shall be skipped on other
platforms.

Fix this by moving TEST_CUSTOM_PROGS and TEST_FILES inside the if check,
then the build result will be "Skipping non-existent dir: sgx".

Fixes: 2adcba79e69d ("selftests/x86: Add a selftest for SGX")
Signed-off-by: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/all/20231206025605.3965302-1-zhaomzhao%40126.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/sgx/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/sgx/Makefile b/tools/testing/selftests/sgx/Makefile
index 50aab6b57da3..01abe4969b0f 100644
--- a/tools/testing/selftests/sgx/Makefile
+++ b/tools/testing/selftests/sgx/Makefile
@@ -16,10 +16,10 @@ HOST_CFLAGS := -Wall -Werror -g $(INCLUDES) -fPIC -z noexecstack
 ENCL_CFLAGS := -Wall -Werror -static -nostdlib -nostartfiles -fPIC \
 	       -fno-stack-protector -mrdrnd $(INCLUDES)
 
+ifeq ($(CAN_BUILD_X86_64), 1)
 TEST_CUSTOM_PROGS := $(OUTPUT)/test_sgx
 TEST_FILES := $(OUTPUT)/test_encl.elf
 
-ifeq ($(CAN_BUILD_X86_64), 1)
 all: $(TEST_CUSTOM_PROGS) $(OUTPUT)/test_encl.elf
 endif
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 479/583] iio: adc: ad9467: fix reset gpio handling
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (477 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 478/583] selftests/sgx: Skip non X86_64 platform Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 480/583] iio: adc: ad9467: dont ignore error codes Greg Kroah-Hartman
                   ` (110 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, David Lechner, Nuno Sa,
	Jonathan Cameron, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nuno Sa <nuno.sa@analog.com>

[ Upstream commit 76f028539cf360f750efd8cde560edda298e4c6b ]

The reset gpio was being handled with inverted polarity. This means that
as far as gpiolib is concerned we were actually leaving the pin asserted
(in theory, this would mean reset). However, inverting the polarity in
devicetree made things work. Fix it by doing it the proper way and how
gpiolib expects it to be done.

While at it, moved the handling to it's own function and dropped
'reset_gpio' from the 'struct ad9467_state' as we only need it during
probe. On top of that, refactored things so that we now request the gpio
asserted (i.e in reset) and then de-assert it. Also note that we now use
gpiod_set_value_cansleep() instead of gpiod_direction_output() as we
already request the pin as output.

Fixes: ad6797120238 ("iio: adc: ad9467: add support AD9467 ADC")
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20231207-iio-backend-prep-v2-1-a4a33bc4d70e@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/iio/adc/ad9467.c | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/drivers/iio/adc/ad9467.c b/drivers/iio/adc/ad9467.c
index 39eccc28debe..4fb9e48dc782 100644
--- a/drivers/iio/adc/ad9467.c
+++ b/drivers/iio/adc/ad9467.c
@@ -121,7 +121,6 @@ struct ad9467_state {
 	unsigned int			output_mode;
 
 	struct gpio_desc		*pwrdown_gpio;
-	struct gpio_desc		*reset_gpio;
 };
 
 static int ad9467_spi_read(struct spi_device *spi, unsigned int reg)
@@ -378,6 +377,21 @@ static int ad9467_preenable_setup(struct adi_axi_adc_conv *conv)
 	return ad9467_outputmode_set(st->spi, st->output_mode);
 }
 
+static int ad9467_reset(struct device *dev)
+{
+	struct gpio_desc *gpio;
+
+	gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
+	if (IS_ERR_OR_NULL(gpio))
+		return PTR_ERR_OR_ZERO(gpio);
+
+	fsleep(1);
+	gpiod_set_value_cansleep(gpio, 0);
+	fsleep(10 * USEC_PER_MSEC);
+
+	return 0;
+}
+
 static int ad9467_probe(struct spi_device *spi)
 {
 	const struct ad9467_chip_info *info;
@@ -408,18 +422,9 @@ static int ad9467_probe(struct spi_device *spi)
 	if (IS_ERR(st->pwrdown_gpio))
 		return PTR_ERR(st->pwrdown_gpio);
 
-	st->reset_gpio = devm_gpiod_get_optional(&spi->dev, "reset",
-						 GPIOD_OUT_LOW);
-	if (IS_ERR(st->reset_gpio))
-		return PTR_ERR(st->reset_gpio);
-
-	if (st->reset_gpio) {
-		udelay(1);
-		ret = gpiod_direction_output(st->reset_gpio, 1);
-		if (ret)
-			return ret;
-		mdelay(10);
-	}
+	ret = ad9467_reset(&spi->dev);
+	if (ret)
+		return ret;
 
 	conv->chip_info = &info->axi_adc_info;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 480/583] iio: adc: ad9467: dont ignore error codes
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (478 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 479/583] iio: adc: ad9467: fix reset gpio handling Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 481/583] iio: adc: ad9467: add mutex to struct ad9467_state Greg Kroah-Hartman
                   ` (109 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, David Lechner, Nuno Sa,
	Jonathan Cameron, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nuno Sa <nuno.sa@analog.com>

[ Upstream commit e072e149cfb827e0ab4cafb0547e9658e35393cd ]

Make sure functions that return errors are not ignored.

Fixes: ad6797120238 ("iio: adc: ad9467: add support AD9467 ADC")
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20231207-iio-backend-prep-v2-2-a4a33bc4d70e@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/iio/adc/ad9467.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/drivers/iio/adc/ad9467.c b/drivers/iio/adc/ad9467.c
index 4fb9e48dc782..d3c98c4eccd3 100644
--- a/drivers/iio/adc/ad9467.c
+++ b/drivers/iio/adc/ad9467.c
@@ -162,9 +162,10 @@ static int ad9467_reg_access(struct adi_axi_adc_conv *conv, unsigned int reg,
 
 	if (readval == NULL) {
 		ret = ad9467_spi_write(spi, reg, writeval);
-		ad9467_spi_write(spi, AN877_ADC_REG_TRANSFER,
-				 AN877_ADC_TRANSFER_SYNC);
-		return ret;
+		if (ret)
+			return ret;
+		return ad9467_spi_write(spi, AN877_ADC_REG_TRANSFER,
+					AN877_ADC_TRANSFER_SYNC);
 	}
 
 	ret = ad9467_spi_read(spi, reg);
@@ -272,10 +273,13 @@ static int ad9467_get_scale(struct adi_axi_adc_conv *conv, int *val, int *val2)
 	const struct ad9467_chip_info *info1 = to_ad9467_chip_info(info);
 	struct ad9467_state *st = adi_axi_adc_conv_priv(conv);
 	unsigned int i, vref_val;
+	int ret;
 
-	vref_val = ad9467_spi_read(st->spi, AN877_ADC_REG_VREF);
+	ret = ad9467_spi_read(st->spi, AN877_ADC_REG_VREF);
+	if (ret < 0)
+		return ret;
 
-	vref_val &= info1->vref_mask;
+	vref_val = ret & info1->vref_mask;
 
 	for (i = 0; i < info->num_scales; i++) {
 		if (vref_val == info->scale_table[i][1])
@@ -296,6 +300,7 @@ static int ad9467_set_scale(struct adi_axi_adc_conv *conv, int val, int val2)
 	struct ad9467_state *st = adi_axi_adc_conv_priv(conv);
 	unsigned int scale_val[2];
 	unsigned int i;
+	int ret;
 
 	if (val != 0)
 		return -EINVAL;
@@ -305,11 +310,13 @@ static int ad9467_set_scale(struct adi_axi_adc_conv *conv, int val, int val2)
 		if (scale_val[0] != val || scale_val[1] != val2)
 			continue;
 
-		ad9467_spi_write(st->spi, AN877_ADC_REG_VREF,
-				 info->scale_table[i][1]);
-		ad9467_spi_write(st->spi, AN877_ADC_REG_TRANSFER,
-				 AN877_ADC_TRANSFER_SYNC);
-		return 0;
+		ret = ad9467_spi_write(st->spi, AN877_ADC_REG_VREF,
+				       info->scale_table[i][1]);
+		if (ret < 0)
+			return ret;
+
+		return ad9467_spi_write(st->spi, AN877_ADC_REG_TRANSFER,
+					AN877_ADC_TRANSFER_SYNC);
 	}
 
 	return -EINVAL;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 481/583] iio: adc: ad9467: add mutex to struct ad9467_state
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (479 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 480/583] iio: adc: ad9467: dont ignore error codes Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 482/583] iio: adc: ad9467: fix scale setting Greg Kroah-Hartman
                   ` (108 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nuno Sa, David Lechner,
	Jonathan Cameron, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nuno Sa <nuno.sa@analog.com>

[ Upstream commit 737720197be445bb9eec2986101e4a386e019337 ]

When calling ad9467_set_scale(), multiple calls to ad9467_spi_write()
are done which means we need to properly protect the whole operation so
we are sure we will be in a sane state if two concurrent calls occur.

Fixes: ad6797120238 ("iio: adc: ad9467: add support AD9467 ADC")
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20231207-iio-backend-prep-v2-3-a4a33bc4d70e@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/iio/adc/ad9467.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ad9467.c b/drivers/iio/adc/ad9467.c
index d3c98c4eccd3..104c6d394a3e 100644
--- a/drivers/iio/adc/ad9467.c
+++ b/drivers/iio/adc/ad9467.c
@@ -4,8 +4,9 @@
  *
  * Copyright 2012-2020 Analog Devices Inc.
  */
-
+#include <linux/cleanup.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
 #include <linux/device.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
@@ -121,6 +122,8 @@ struct ad9467_state {
 	unsigned int			output_mode;
 
 	struct gpio_desc		*pwrdown_gpio;
+	/* ensure consistent state obtained on multiple related accesses */
+	struct mutex			lock;
 };
 
 static int ad9467_spi_read(struct spi_device *spi, unsigned int reg)
@@ -161,6 +164,7 @@ static int ad9467_reg_access(struct adi_axi_adc_conv *conv, unsigned int reg,
 	int ret;
 
 	if (readval == NULL) {
+		guard(mutex)(&st->lock);
 		ret = ad9467_spi_write(spi, reg, writeval);
 		if (ret)
 			return ret;
@@ -310,6 +314,7 @@ static int ad9467_set_scale(struct adi_axi_adc_conv *conv, int val, int val2)
 		if (scale_val[0] != val || scale_val[1] != val2)
 			continue;
 
+		guard(mutex)(&st->lock);
 		ret = ad9467_spi_write(st->spi, AN877_ADC_REG_VREF,
 				       info->scale_table[i][1]);
 		if (ret < 0)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 482/583] iio: adc: ad9467: fix scale setting
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (480 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 481/583] iio: adc: ad9467: add mutex to struct ad9467_state Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 483/583] perf header: Fix one memory leakage in perf_event__fprintf_event_update() Greg Kroah-Hartman
                   ` (107 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nuno Sa, David Lechner,
	Jonathan Cameron, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nuno Sa <nuno.sa@analog.com>

[ Upstream commit b73f08bb7fe5a0901646ca5ceaa1e7a2d5ee6293 ]

When reading in_voltage_scale we can get something like:

root@analog:/sys/bus/iio/devices/iio:device2# cat in_voltage_scale
0.038146

However, when reading the available options:

root@analog:/sys/bus/iio/devices/iio:device2# cat
in_voltage_scale_available
2000.000000 2100.000006 2200.000007 2300.000008 2400.000009 2500.000010

which does not make sense. Moreover, when trying to set a new scale we
get an error because there's no call to __ad9467_get_scale() to give us
values as given when reading in_voltage_scale. Fix it by computing the
available scales during probe and properly pass the list when
.read_available() is called.

While at it, change to use .read_available() from iio_info. Also note
that to properly fix this, adi-axi-adc.c has to be changed accordingly.

Fixes: ad6797120238 ("iio: adc: ad9467: add support AD9467 ADC")
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20231207-iio-backend-prep-v2-4-a4a33bc4d70e@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/iio/adc/ad9467.c            | 47 ++++++++++++++++++
 drivers/iio/adc/adi-axi-adc.c       | 74 ++++++-----------------------
 include/linux/iio/adc/adi-axi-adc.h |  4 ++
 3 files changed, 66 insertions(+), 59 deletions(-)

diff --git a/drivers/iio/adc/ad9467.c b/drivers/iio/adc/ad9467.c
index 104c6d394a3e..f668313730cb 100644
--- a/drivers/iio/adc/ad9467.c
+++ b/drivers/iio/adc/ad9467.c
@@ -120,6 +120,7 @@ struct ad9467_state {
 	struct spi_device		*spi;
 	struct clk			*clk;
 	unsigned int			output_mode;
+	unsigned int                    (*scales)[2];
 
 	struct gpio_desc		*pwrdown_gpio;
 	/* ensure consistent state obtained on multiple related accesses */
@@ -216,6 +217,7 @@ static void __ad9467_get_scale(struct adi_axi_adc_conv *conv, int index,
 	.channel = _chan,						\
 	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) |		\
 		BIT(IIO_CHAN_INFO_SAMP_FREQ),				\
+	.info_mask_shared_by_type_available = BIT(IIO_CHAN_INFO_SCALE), \
 	.scan_index = _si,						\
 	.scan_type = {							\
 		.sign = _sign,						\
@@ -370,6 +372,26 @@ static int ad9467_write_raw(struct adi_axi_adc_conv *conv,
 	}
 }
 
+static int ad9467_read_avail(struct adi_axi_adc_conv *conv,
+			     struct iio_chan_spec const *chan,
+			     const int **vals, int *type, int *length,
+			     long mask)
+{
+	const struct adi_axi_adc_chip_info *info = conv->chip_info;
+	struct ad9467_state *st = adi_axi_adc_conv_priv(conv);
+
+	switch (mask) {
+	case IIO_CHAN_INFO_SCALE:
+		*vals = (const int *)st->scales;
+		*type = IIO_VAL_INT_PLUS_MICRO;
+		/* Values are stored in a 2D matrix */
+		*length = info->num_scales * 2;
+		return IIO_AVAIL_LIST;
+	default:
+		return -EINVAL;
+	}
+}
+
 static int ad9467_outputmode_set(struct spi_device *spi, unsigned int mode)
 {
 	int ret;
@@ -382,6 +404,26 @@ static int ad9467_outputmode_set(struct spi_device *spi, unsigned int mode)
 				AN877_ADC_TRANSFER_SYNC);
 }
 
+static int ad9467_scale_fill(struct adi_axi_adc_conv *conv)
+{
+	const struct adi_axi_adc_chip_info *info = conv->chip_info;
+	struct ad9467_state *st = adi_axi_adc_conv_priv(conv);
+	unsigned int i, val1, val2;
+
+	st->scales = devm_kmalloc_array(&st->spi->dev, info->num_scales,
+					sizeof(*st->scales), GFP_KERNEL);
+	if (!st->scales)
+		return -ENOMEM;
+
+	for (i = 0; i < info->num_scales; i++) {
+		__ad9467_get_scale(conv, i, &val1, &val2);
+		st->scales[i][0] = val1;
+		st->scales[i][1] = val2;
+	}
+
+	return 0;
+}
+
 static int ad9467_preenable_setup(struct adi_axi_adc_conv *conv)
 {
 	struct ad9467_state *st = adi_axi_adc_conv_priv(conv);
@@ -440,6 +482,10 @@ static int ad9467_probe(struct spi_device *spi)
 
 	conv->chip_info = &info->axi_adc_info;
 
+	ret = ad9467_scale_fill(conv);
+	if (ret)
+		return ret;
+
 	id = ad9467_spi_read(spi, AN877_ADC_REG_CHIP_ID);
 	if (id != conv->chip_info->id) {
 		dev_err(&spi->dev, "Mismatch CHIP_ID, got 0x%X, expected 0x%X\n",
@@ -450,6 +496,7 @@ static int ad9467_probe(struct spi_device *spi)
 	conv->reg_access = ad9467_reg_access;
 	conv->write_raw = ad9467_write_raw;
 	conv->read_raw = ad9467_read_raw;
+	conv->read_avail = ad9467_read_avail;
 	conv->preenable_setup = ad9467_preenable_setup;
 
 	st->output_mode = info->default_output_mode |
diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c
index aff0532a974a..ae83ada7f9f2 100644
--- a/drivers/iio/adc/adi-axi-adc.c
+++ b/drivers/iio/adc/adi-axi-adc.c
@@ -144,6 +144,20 @@ static int adi_axi_adc_write_raw(struct iio_dev *indio_dev,
 	return conv->write_raw(conv, chan, val, val2, mask);
 }
 
+static int adi_axi_adc_read_avail(struct iio_dev *indio_dev,
+				  struct iio_chan_spec const *chan,
+				  const int **vals, int *type, int *length,
+				  long mask)
+{
+	struct adi_axi_adc_state *st = iio_priv(indio_dev);
+	struct adi_axi_adc_conv *conv = &st->client->conv;
+
+	if (!conv->read_avail)
+		return -EOPNOTSUPP;
+
+	return conv->read_avail(conv, chan, vals, type, length, mask);
+}
+
 static int adi_axi_adc_update_scan_mode(struct iio_dev *indio_dev,
 					const unsigned long *scan_mask)
 {
@@ -228,69 +242,11 @@ struct adi_axi_adc_conv *devm_adi_axi_adc_conv_register(struct device *dev,
 }
 EXPORT_SYMBOL_NS_GPL(devm_adi_axi_adc_conv_register, IIO_ADI_AXI);
 
-static ssize_t in_voltage_scale_available_show(struct device *dev,
-					       struct device_attribute *attr,
-					       char *buf)
-{
-	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-	struct adi_axi_adc_state *st = iio_priv(indio_dev);
-	struct adi_axi_adc_conv *conv = &st->client->conv;
-	size_t len = 0;
-	int i;
-
-	for (i = 0; i < conv->chip_info->num_scales; i++) {
-		const unsigned int *s = conv->chip_info->scale_table[i];
-
-		len += scnprintf(buf + len, PAGE_SIZE - len,
-				 "%u.%06u ", s[0], s[1]);
-	}
-	buf[len - 1] = '\n';
-
-	return len;
-}
-
-static IIO_DEVICE_ATTR_RO(in_voltage_scale_available, 0);
-
-enum {
-	ADI_AXI_ATTR_SCALE_AVAIL,
-};
-
-#define ADI_AXI_ATTR(_en_, _file_)			\
-	[ADI_AXI_ATTR_##_en_] = &iio_dev_attr_##_file_.dev_attr.attr
-
-static struct attribute *adi_axi_adc_attributes[] = {
-	ADI_AXI_ATTR(SCALE_AVAIL, in_voltage_scale_available),
-	NULL
-};
-
-static umode_t axi_adc_attr_is_visible(struct kobject *kobj,
-				       struct attribute *attr, int n)
-{
-	struct device *dev = kobj_to_dev(kobj);
-	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-	struct adi_axi_adc_state *st = iio_priv(indio_dev);
-	struct adi_axi_adc_conv *conv = &st->client->conv;
-
-	switch (n) {
-	case ADI_AXI_ATTR_SCALE_AVAIL:
-		if (!conv->chip_info->num_scales)
-			return 0;
-		return attr->mode;
-	default:
-		return attr->mode;
-	}
-}
-
-static const struct attribute_group adi_axi_adc_attribute_group = {
-	.attrs = adi_axi_adc_attributes,
-	.is_visible = axi_adc_attr_is_visible,
-};
-
 static const struct iio_info adi_axi_adc_info = {
 	.read_raw = &adi_axi_adc_read_raw,
 	.write_raw = &adi_axi_adc_write_raw,
-	.attrs = &adi_axi_adc_attribute_group,
 	.update_scan_mode = &adi_axi_adc_update_scan_mode,
+	.read_avail = &adi_axi_adc_read_avail,
 };
 
 static const struct adi_axi_adc_core_info adi_axi_adc_10_0_a_info = {
diff --git a/include/linux/iio/adc/adi-axi-adc.h b/include/linux/iio/adc/adi-axi-adc.h
index 52620e5b8052..b7904992d561 100644
--- a/include/linux/iio/adc/adi-axi-adc.h
+++ b/include/linux/iio/adc/adi-axi-adc.h
@@ -41,6 +41,7 @@ struct adi_axi_adc_chip_info {
  * @reg_access		IIO debugfs_reg_access hook for the client ADC
  * @read_raw		IIO read_raw hook for the client ADC
  * @write_raw		IIO write_raw hook for the client ADC
+ * @read_avail		IIO read_avail hook for the client ADC
  */
 struct adi_axi_adc_conv {
 	const struct adi_axi_adc_chip_info		*chip_info;
@@ -54,6 +55,9 @@ struct adi_axi_adc_conv {
 	int (*write_raw)(struct adi_axi_adc_conv *conv,
 			 struct iio_chan_spec const *chan,
 			 int val, int val2, long mask);
+	int (*read_avail)(struct adi_axi_adc_conv *conv,
+			  struct iio_chan_spec const *chan,
+			  const int **val, int *type, int *length, long mask);
 };
 
 struct adi_axi_adc_conv *devm_adi_axi_adc_conv_register(struct device *dev,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 483/583] perf header: Fix one memory leakage in perf_event__fprintf_event_update()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (481 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 482/583] iio: adc: ad9467: fix scale setting Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 484/583] perf hisi-ptt: Fix one memory leakage in hisi_ptt_process_auxtrace_event() Greg Kroah-Hartman
                   ` (106 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ian Rogers, Yicong Yang,
	Namhyung Kim, Adrian Hunter, Alexander Shishkin, Ingo Molnar,
	Jiri Olsa, Jonathan Cameron, Junhao He, Mark Rutland,
	Peter Zijlstra, linuxarm, Arnaldo Carvalho de Melo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yicong Yang <yangyicong@hisilicon.com>

[ Upstream commit 813900d19b923fc1b241c1ce292472f68066092b ]

When dump the raw trace by `perf report -D` ASan reports a memory
leakage in perf_event__fprintf_event_update().

It shows that we allocated a temporary cpumap for dumping the CPUs but
doesn't release it and it's not used elsewhere. Fix this by free the
cpumap after the dumping.

Fixes: c853f9394b7bc189 ("perf tools: Add perf_event__fprintf_event_update function")
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Jonathan Cameron <jonathan.cameron@huawei.com>
Cc: Junhao He <hejunhao3@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linuxarm@huawei.com
Link: https://lore.kernel.org/r/20231207081635.8427-2-yangyicong@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/perf/util/header.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 41032243774e..f6035c219b41 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -4363,9 +4363,10 @@ size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp)
 		ret += fprintf(fp, "... ");
 
 		map = cpu_map__new_data(&ev->cpus.cpus);
-		if (map)
+		if (map) {
 			ret += cpu_map__fprintf(map, fp);
-		else
+			perf_cpu_map__put(map);
+		} else
 			ret += fprintf(fp, "failed to get cpus\n");
 		break;
 	default:
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 484/583] perf hisi-ptt: Fix one memory leakage in hisi_ptt_process_auxtrace_event()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (482 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 483/583] perf header: Fix one memory leakage in perf_event__fprintf_event_update() Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 485/583] perf genelf: Set ELF program header addresses properly Greg Kroah-Hartman
                   ` (105 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ian Rogers, Yicong Yang,
	Namhyung Kim, Adrian Hunter, Alexander Shishkin, Ingo Molnar,
	Jiri Olsa, Jonathan Cameron, Junhao He, Mark Rutland,
	Peter Zijlstra, Qi Liu, Arnaldo Carvalho de Melo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Yicong Yang <yangyicong@hisilicon.com>

[ Upstream commit 1bc479d665bc25a9a4e8168d5b400a47491511f9 ]

ASan complains a memory leakage in hisi_ptt_process_auxtrace_event()
that the data buffer is not freed. Since currently we only support the
raw dump trace mode, the data buffer is used only within this function.
So fix this by freeing the data buffer before going out.

Fixes: 5e91e57e68090c0e ("perf auxtrace arm64: Add support for parsing HiSilicon PCIe Trace packet")
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Acked-by: Namhyung Kim <Namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Jonathan Cameron <jonathan.cameron@huawei.com>
Cc: Junhao He <hejunhao3@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Qi Liu <liuqi115@huawei.com>
Link: https://lore.kernel.org/r/20231207081635.8427-3-yangyicong@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/perf/util/hisi-ptt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/hisi-ptt.c b/tools/perf/util/hisi-ptt.c
index 45b614bb73bf..764d660d30e2 100644
--- a/tools/perf/util/hisi-ptt.c
+++ b/tools/perf/util/hisi-ptt.c
@@ -121,6 +121,7 @@ static int hisi_ptt_process_auxtrace_event(struct perf_session *session,
 	if (dump_trace)
 		hisi_ptt_dump_event(ptt, data, size);
 
+	free(data);
 	return 0;
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 485/583] perf genelf: Set ELF program header addresses properly
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (483 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 484/583] perf hisi-ptt: Fix one memory leakage in hisi_ptt_process_auxtrace_event() Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 486/583] perf unwind-libdw: Handle JIT-generated DSOs properly Greg Kroah-Hartman
                   ` (104 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ian Rogers, Namhyung Kim,
	Adrian Hunter, Fangrui Song, Ingo Molnar, Jiri Olsa, Lieven Hey,
	Milian Wolff, Pablo Galindo, Peter Zijlstra,
	Arnaldo Carvalho de Melo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Namhyung Kim <namhyung@kernel.org>

[ Upstream commit 1af478903fc48c1409a8dd6b698383b62387adf1 ]

The text section starts after the ELF headers so PHDR.p_vaddr and
others should have the correct addresses.

Fixes: babd04386b1df8c3 ("perf jit: Include program header in ELF files")
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Fangrui Song <maskray@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Lieven Hey <lieven.hey@kdab.com>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Pablo Galindo <pablogsal@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20231212070547.612536-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/perf/util/genelf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/genelf.c b/tools/perf/util/genelf.c
index fefc72066c4e..ac17a3cb59dc 100644
--- a/tools/perf/util/genelf.c
+++ b/tools/perf/util/genelf.c
@@ -293,9 +293,9 @@ jit_write_elf(int fd, uint64_t load_addr, const char *sym,
 	 */
 	phdr = elf_newphdr(e, 1);
 	phdr[0].p_type = PT_LOAD;
-	phdr[0].p_offset = 0;
-	phdr[0].p_vaddr = 0;
-	phdr[0].p_paddr = 0;
+	phdr[0].p_offset = GEN_ELF_TEXT_OFFSET;
+	phdr[0].p_vaddr = GEN_ELF_TEXT_OFFSET;
+	phdr[0].p_paddr = GEN_ELF_TEXT_OFFSET;
 	phdr[0].p_filesz = csize;
 	phdr[0].p_memsz = csize;
 	phdr[0].p_flags = PF_X | PF_R;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 486/583] perf unwind-libdw: Handle JIT-generated DSOs properly
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (484 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 485/583] perf genelf: Set ELF program header addresses properly Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 487/583] perf unwind-libunwind: Fix base address for .eh_frame Greg Kroah-Hartman
                   ` (103 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Namhyung Kim, Adrian Hunter,
	Fangrui Song, Ian Rogers, Ingo Molnar, Jiri Olsa, Milian Wolff,
	Pablo Galindo, Peter Zijlstra, Arnaldo Carvalho de Melo,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Namhyung Kim <namhyung@kernel.org>

[ Upstream commit c966d23a351a33f8a977fd7efbb6f467132f7383 ]

Usually DSOs are mapped from the beginning of the file, so the base
address of the DSO can be calculated by map->start - map->pgoff.

However, JIT DSOs which are generated by `perf inject -j`, are mapped
only the code segment.  This makes unwind-libdw code confusing and
rejects processing unwinds in the JIT DSOs.  It should use the map
start address as base for them to fix the confusion.

Fixes: 1fe627da30331024 ("perf unwind: Take pgoff into account when reporting elf to libdwfl")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Fangrui Song <maskray@google.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Pablo Galindo <pablogsal@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20231212070547.612536-3-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/perf/util/unwind-libdw.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c
index 8554db3fc0d7..6013335a8dae 100644
--- a/tools/perf/util/unwind-libdw.c
+++ b/tools/perf/util/unwind-libdw.c
@@ -46,6 +46,7 @@ static int __report_module(struct addr_location *al, u64 ip,
 {
 	Dwfl_Module *mod;
 	struct dso *dso = NULL;
+	Dwarf_Addr base;
 	/*
 	 * Some callers will use al->sym, so we can't just use the
 	 * cheaper thread__find_map() here.
@@ -58,13 +59,25 @@ static int __report_module(struct addr_location *al, u64 ip,
 	if (!dso)
 		return 0;
 
+	/*
+	 * The generated JIT DSO files only map the code segment without
+	 * ELF headers.  Since JIT codes used to be packed in a memory
+	 * segment, calculating the base address using pgoff falls into
+	 * a different code in another DSO.  So just use the map->start
+	 * directly to pick the correct one.
+	 */
+	if (!strncmp(dso->long_name, "/tmp/jitted-", 12))
+		base = map__start(al->map);
+	else
+		base = map__start(al->map) - map__pgoff(al->map);
+
 	mod = dwfl_addrmodule(ui->dwfl, ip);
 	if (mod) {
 		Dwarf_Addr s;
 
 		dwfl_module_info(mod, NULL, &s, NULL, NULL, NULL, NULL, NULL);
-		if (s != map__start(al->map) - map__pgoff(al->map))
-			mod = 0;
+		if (s != base)
+			mod = NULL;
 	}
 
 	if (!mod) {
@@ -72,14 +85,14 @@ static int __report_module(struct addr_location *al, u64 ip,
 
 		__symbol__join_symfs(filename, sizeof(filename), dso->long_name);
 		mod = dwfl_report_elf(ui->dwfl, dso->short_name, filename, -1,
-				      map__start(al->map) - map__pgoff(al->map), false);
+				      base, false);
 	}
 	if (!mod) {
 		char filename[PATH_MAX];
 
 		if (dso__build_id_filename(dso, filename, sizeof(filename), false))
 			mod = dwfl_report_elf(ui->dwfl, dso->short_name, filename, -1,
-					      map__start(al->map) - map__pgoff(al->map), false);
+					      base, false);
 	}
 
 	if (mod) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 487/583] perf unwind-libunwind: Fix base address for .eh_frame
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (485 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 486/583] perf unwind-libdw: Handle JIT-generated DSOs properly Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:58 ` [PATCH 6.6 488/583] bus: mhi: ep: Do not allocate event ring element on stack Greg Kroah-Hartman
                   ` (102 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ian Rogers, Namhyung Kim,
	Adrian Hunter, Fangrui Song, Ingo Molnar, Jiri Olsa,
	Milian Wolff, Pablo Galindo, Peter Zijlstra,
	Arnaldo Carvalho de Melo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Namhyung Kim <namhyung@kernel.org>

[ Upstream commit 4fb54994b2360ab5029ee3a959161f6fe6bbb349 ]

The base address of a DSO mapping should start at the start of the file.
Usually DSOs are mapped from the pgoff 0 so it doesn't matter when it
uses the start of the map address.

But generated DSOs for JIT codes doesn't start from the 0 so it should
subtract the offset to calculate the .eh_frame table offsets correctly.

Fixes: dc2cf4ca866f5715 ("perf unwind: Fix segbase for ld.lld linked objects")
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Fangrui Song <maskray@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Pablo Galindo <pablogsal@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20231212070547.612536-4-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/perf/util/unwind-libunwind-local.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
index c0641882fd2f..5e5c3395a499 100644
--- a/tools/perf/util/unwind-libunwind-local.c
+++ b/tools/perf/util/unwind-libunwind-local.c
@@ -327,7 +327,7 @@ static int read_unwind_spec_eh_frame(struct dso *dso, struct unwind_info *ui,
 
 	maps__for_each_entry(thread__maps(ui->thread), map_node) {
 		struct map *map = map_node->map;
-		u64 start = map__start(map);
+		u64 start = map__start(map) - map__pgoff(map);
 
 		if (map__dso(map) == dso && start < base_addr)
 			base_addr = start;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 488/583] bus: mhi: ep: Do not allocate event ring element on stack
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (486 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 487/583] perf unwind-libunwind: Fix base address for .eh_frame Greg Kroah-Hartman
@ 2024-01-22 23:58 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 489/583] bus: mhi: ep: Use slab allocator where applicable Greg Kroah-Hartman
                   ` (101 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:58 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Manivannan Sadhasivam, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

[ Upstream commit 987fdb5a43a66764808371b54e6047834170d565 ]

It is possible that the host controller driver would use DMA framework to
write the event ring element. So avoid allocating event ring element on the
stack as DMA cannot work on vmalloc memory.

Cc: stable@vger.kernel.org
Fixes: 961aeb689224 ("bus: mhi: ep: Add support for sending events to the host")
Link: https://lore.kernel.org/r/20230901073502.69385-1-manivannan.sadhasivam@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Stable-dep-of: 327ec5f70609 ("PCI: epf-mhi: Fix the DMA data direction of dma_unmap_single()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/bus/mhi/ep/main.c | 68 ++++++++++++++++++++++++++++-----------
 1 file changed, 50 insertions(+), 18 deletions(-)

diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c
index 600881808982..e2513f5f47a6 100644
--- a/drivers/bus/mhi/ep/main.c
+++ b/drivers/bus/mhi/ep/main.c
@@ -71,45 +71,77 @@ static int mhi_ep_send_event(struct mhi_ep_cntrl *mhi_cntrl, u32 ring_idx,
 static int mhi_ep_send_completion_event(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_ring *ring,
 					struct mhi_ring_element *tre, u32 len, enum mhi_ev_ccs code)
 {
-	struct mhi_ring_element event = {};
+	struct mhi_ring_element *event;
+	int ret;
+
+	event = kzalloc(sizeof(struct mhi_ring_element), GFP_KERNEL);
+	if (!event)
+		return -ENOMEM;
 
-	event.ptr = cpu_to_le64(ring->rbase + ring->rd_offset * sizeof(*tre));
-	event.dword[0] = MHI_TRE_EV_DWORD0(code, len);
-	event.dword[1] = MHI_TRE_EV_DWORD1(ring->ch_id, MHI_PKT_TYPE_TX_EVENT);
+	event->ptr = cpu_to_le64(ring->rbase + ring->rd_offset * sizeof(*tre));
+	event->dword[0] = MHI_TRE_EV_DWORD0(code, len);
+	event->dword[1] = MHI_TRE_EV_DWORD1(ring->ch_id, MHI_PKT_TYPE_TX_EVENT);
 
-	return mhi_ep_send_event(mhi_cntrl, ring->er_index, &event, MHI_TRE_DATA_GET_BEI(tre));
+	ret = mhi_ep_send_event(mhi_cntrl, ring->er_index, event, MHI_TRE_DATA_GET_BEI(tre));
+	kfree(event);
+
+	return ret;
 }
 
 int mhi_ep_send_state_change_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_state state)
 {
-	struct mhi_ring_element event = {};
+	struct mhi_ring_element *event;
+	int ret;
+
+	event = kzalloc(sizeof(struct mhi_ring_element), GFP_KERNEL);
+	if (!event)
+		return -ENOMEM;
 
-	event.dword[0] = MHI_SC_EV_DWORD0(state);
-	event.dword[1] = MHI_SC_EV_DWORD1(MHI_PKT_TYPE_STATE_CHANGE_EVENT);
+	event->dword[0] = MHI_SC_EV_DWORD0(state);
+	event->dword[1] = MHI_SC_EV_DWORD1(MHI_PKT_TYPE_STATE_CHANGE_EVENT);
 
-	return mhi_ep_send_event(mhi_cntrl, 0, &event, 0);
+	ret = mhi_ep_send_event(mhi_cntrl, 0, event, 0);
+	kfree(event);
+
+	return ret;
 }
 
 int mhi_ep_send_ee_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_ee_type exec_env)
 {
-	struct mhi_ring_element event = {};
+	struct mhi_ring_element *event;
+	int ret;
+
+	event = kzalloc(sizeof(struct mhi_ring_element), GFP_KERNEL);
+	if (!event)
+		return -ENOMEM;
 
-	event.dword[0] = MHI_EE_EV_DWORD0(exec_env);
-	event.dword[1] = MHI_SC_EV_DWORD1(MHI_PKT_TYPE_EE_EVENT);
+	event->dword[0] = MHI_EE_EV_DWORD0(exec_env);
+	event->dword[1] = MHI_SC_EV_DWORD1(MHI_PKT_TYPE_EE_EVENT);
 
-	return mhi_ep_send_event(mhi_cntrl, 0, &event, 0);
+	ret = mhi_ep_send_event(mhi_cntrl, 0, event, 0);
+	kfree(event);
+
+	return ret;
 }
 
 static int mhi_ep_send_cmd_comp_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_ev_ccs code)
 {
 	struct mhi_ep_ring *ring = &mhi_cntrl->mhi_cmd->ring;
-	struct mhi_ring_element event = {};
+	struct mhi_ring_element *event;
+	int ret;
+
+	event = kzalloc(sizeof(struct mhi_ring_element), GFP_KERNEL);
+	if (!event)
+		return -ENOMEM;
 
-	event.ptr = cpu_to_le64(ring->rbase + ring->rd_offset * sizeof(struct mhi_ring_element));
-	event.dword[0] = MHI_CC_EV_DWORD0(code);
-	event.dword[1] = MHI_CC_EV_DWORD1(MHI_PKT_TYPE_CMD_COMPLETION_EVENT);
+	event->ptr = cpu_to_le64(ring->rbase + ring->rd_offset * sizeof(struct mhi_ring_element));
+	event->dword[0] = MHI_CC_EV_DWORD0(code);
+	event->dword[1] = MHI_CC_EV_DWORD1(MHI_PKT_TYPE_CMD_COMPLETION_EVENT);
 
-	return mhi_ep_send_event(mhi_cntrl, 0, &event, 0);
+	ret = mhi_ep_send_event(mhi_cntrl, 0, event, 0);
+	kfree(event);
+
+	return ret;
 }
 
 static int mhi_ep_process_cmd_ring(struct mhi_ep_ring *ring, struct mhi_ring_element *el)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 489/583] bus: mhi: ep: Use slab allocator where applicable
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (487 preceding siblings ...)
  2024-01-22 23:58 ` [PATCH 6.6 488/583] bus: mhi: ep: Do not allocate event ring element on stack Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 490/583] bus: mhi: ep: Pass mhi_ep_buf_info struct to read/write APIs Greg Kroah-Hartman
                   ` (100 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alex Elder, Manivannan Sadhasivam,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

[ Upstream commit 62210a26cd4f8ad52683a71c0226dfe85de1144d ]

Use slab allocator for allocating the memory for objects used frequently
and are of fixed size. This reduces the overheard associated with
kmalloc().

Suggested-by: Alex Elder <elder@linaro.org>
Link: https://lore.kernel.org/r/20231018122812.47261-1-manivannan.sadhasivam@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Stable-dep-of: 327ec5f70609 ("PCI: epf-mhi: Fix the DMA data direction of dma_unmap_single()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/bus/mhi/ep/main.c | 66 +++++++++++++++++++++++++++++----------
 include/linux/mhi_ep.h    |  3 ++
 2 files changed, 52 insertions(+), 17 deletions(-)

diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c
index e2513f5f47a6..517279600645 100644
--- a/drivers/bus/mhi/ep/main.c
+++ b/drivers/bus/mhi/ep/main.c
@@ -74,7 +74,7 @@ static int mhi_ep_send_completion_event(struct mhi_ep_cntrl *mhi_cntrl, struct m
 	struct mhi_ring_element *event;
 	int ret;
 
-	event = kzalloc(sizeof(struct mhi_ring_element), GFP_KERNEL);
+	event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL | GFP_DMA);
 	if (!event)
 		return -ENOMEM;
 
@@ -83,7 +83,7 @@ static int mhi_ep_send_completion_event(struct mhi_ep_cntrl *mhi_cntrl, struct m
 	event->dword[1] = MHI_TRE_EV_DWORD1(ring->ch_id, MHI_PKT_TYPE_TX_EVENT);
 
 	ret = mhi_ep_send_event(mhi_cntrl, ring->er_index, event, MHI_TRE_DATA_GET_BEI(tre));
-	kfree(event);
+	kmem_cache_free(mhi_cntrl->ev_ring_el_cache, event);
 
 	return ret;
 }
@@ -93,7 +93,7 @@ int mhi_ep_send_state_change_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_stat
 	struct mhi_ring_element *event;
 	int ret;
 
-	event = kzalloc(sizeof(struct mhi_ring_element), GFP_KERNEL);
+	event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL | GFP_DMA);
 	if (!event)
 		return -ENOMEM;
 
@@ -101,7 +101,7 @@ int mhi_ep_send_state_change_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_stat
 	event->dword[1] = MHI_SC_EV_DWORD1(MHI_PKT_TYPE_STATE_CHANGE_EVENT);
 
 	ret = mhi_ep_send_event(mhi_cntrl, 0, event, 0);
-	kfree(event);
+	kmem_cache_free(mhi_cntrl->ev_ring_el_cache, event);
 
 	return ret;
 }
@@ -111,7 +111,7 @@ int mhi_ep_send_ee_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_ee_type exec_e
 	struct mhi_ring_element *event;
 	int ret;
 
-	event = kzalloc(sizeof(struct mhi_ring_element), GFP_KERNEL);
+	event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL | GFP_DMA);
 	if (!event)
 		return -ENOMEM;
 
@@ -119,7 +119,7 @@ int mhi_ep_send_ee_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_ee_type exec_e
 	event->dword[1] = MHI_SC_EV_DWORD1(MHI_PKT_TYPE_EE_EVENT);
 
 	ret = mhi_ep_send_event(mhi_cntrl, 0, event, 0);
-	kfree(event);
+	kmem_cache_free(mhi_cntrl->ev_ring_el_cache, event);
 
 	return ret;
 }
@@ -130,7 +130,7 @@ static int mhi_ep_send_cmd_comp_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_e
 	struct mhi_ring_element *event;
 	int ret;
 
-	event = kzalloc(sizeof(struct mhi_ring_element), GFP_KERNEL);
+	event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL | GFP_DMA);
 	if (!event)
 		return -ENOMEM;
 
@@ -139,7 +139,7 @@ static int mhi_ep_send_cmd_comp_event(struct mhi_ep_cntrl *mhi_cntrl, enum mhi_e
 	event->dword[1] = MHI_CC_EV_DWORD1(MHI_PKT_TYPE_CMD_COMPLETION_EVENT);
 
 	ret = mhi_ep_send_event(mhi_cntrl, 0, event, 0);
-	kfree(event);
+	kmem_cache_free(mhi_cntrl->ev_ring_el_cache, event);
 
 	return ret;
 }
@@ -451,7 +451,7 @@ static int mhi_ep_process_ch_ring(struct mhi_ep_ring *ring, struct mhi_ring_elem
 		mhi_chan->xfer_cb(mhi_chan->mhi_dev, &result);
 	} else {
 		/* UL channel */
-		result.buf_addr = kzalloc(len, GFP_KERNEL);
+		result.buf_addr = kmem_cache_zalloc(mhi_cntrl->tre_buf_cache, GFP_KERNEL | GFP_DMA);
 		if (!result.buf_addr)
 			return -ENOMEM;
 
@@ -459,7 +459,7 @@ static int mhi_ep_process_ch_ring(struct mhi_ep_ring *ring, struct mhi_ring_elem
 			ret = mhi_ep_read_channel(mhi_cntrl, ring, &result, len);
 			if (ret < 0) {
 				dev_err(&mhi_chan->mhi_dev->dev, "Failed to read channel\n");
-				kfree(result.buf_addr);
+				kmem_cache_free(mhi_cntrl->tre_buf_cache, result.buf_addr);
 				return ret;
 			}
 
@@ -471,7 +471,7 @@ static int mhi_ep_process_ch_ring(struct mhi_ep_ring *ring, struct mhi_ring_elem
 			/* Read until the ring becomes empty */
 		} while (!mhi_ep_queue_is_empty(mhi_chan->mhi_dev, DMA_TO_DEVICE));
 
-		kfree(result.buf_addr);
+		kmem_cache_free(mhi_cntrl->tre_buf_cache, result.buf_addr);
 	}
 
 	return 0;
@@ -780,14 +780,14 @@ static void mhi_ep_ch_ring_worker(struct work_struct *work)
 		if (ret) {
 			dev_err(dev, "Error updating write offset for ring\n");
 			mutex_unlock(&chan->lock);
-			kfree(itr);
+			kmem_cache_free(mhi_cntrl->ring_item_cache, itr);
 			continue;
 		}
 
 		/* Sanity check to make sure there are elements in the ring */
 		if (ring->rd_offset == ring->wr_offset) {
 			mutex_unlock(&chan->lock);
-			kfree(itr);
+			kmem_cache_free(mhi_cntrl->ring_item_cache, itr);
 			continue;
 		}
 
@@ -799,12 +799,12 @@ static void mhi_ep_ch_ring_worker(struct work_struct *work)
 			dev_err(dev, "Error processing ring for channel (%u): %d\n",
 				ring->ch_id, ret);
 			mutex_unlock(&chan->lock);
-			kfree(itr);
+			kmem_cache_free(mhi_cntrl->ring_item_cache, itr);
 			continue;
 		}
 
 		mutex_unlock(&chan->lock);
-		kfree(itr);
+		kmem_cache_free(mhi_cntrl->ring_item_cache, itr);
 	}
 }
 
@@ -860,7 +860,7 @@ static void mhi_ep_queue_channel_db(struct mhi_ep_cntrl *mhi_cntrl, unsigned lon
 		u32 ch_id = ch_idx + i;
 
 		ring = &mhi_cntrl->mhi_chan[ch_id].ring;
-		item = kzalloc(sizeof(*item), GFP_ATOMIC);
+		item = kmem_cache_zalloc(mhi_cntrl->ring_item_cache, GFP_ATOMIC);
 		if (!item)
 			return;
 
@@ -1407,6 +1407,29 @@ int mhi_ep_register_controller(struct mhi_ep_cntrl *mhi_cntrl,
 		goto err_free_ch;
 	}
 
+	mhi_cntrl->ev_ring_el_cache = kmem_cache_create("mhi_ep_event_ring_el",
+							sizeof(struct mhi_ring_element), 0,
+							SLAB_CACHE_DMA, NULL);
+	if (!mhi_cntrl->ev_ring_el_cache) {
+		ret = -ENOMEM;
+		goto err_free_cmd;
+	}
+
+	mhi_cntrl->tre_buf_cache = kmem_cache_create("mhi_ep_tre_buf", MHI_EP_DEFAULT_MTU, 0,
+						      SLAB_CACHE_DMA, NULL);
+	if (!mhi_cntrl->tre_buf_cache) {
+		ret = -ENOMEM;
+		goto err_destroy_ev_ring_el_cache;
+	}
+
+	mhi_cntrl->ring_item_cache = kmem_cache_create("mhi_ep_ring_item",
+							sizeof(struct mhi_ep_ring_item), 0,
+							0, NULL);
+	if (!mhi_cntrl->ev_ring_el_cache) {
+		ret = -ENOMEM;
+		goto err_destroy_tre_buf_cache;
+	}
+
 	INIT_WORK(&mhi_cntrl->state_work, mhi_ep_state_worker);
 	INIT_WORK(&mhi_cntrl->reset_work, mhi_ep_reset_worker);
 	INIT_WORK(&mhi_cntrl->cmd_ring_work, mhi_ep_cmd_ring_worker);
@@ -1415,7 +1438,7 @@ int mhi_ep_register_controller(struct mhi_ep_cntrl *mhi_cntrl,
 	mhi_cntrl->wq = alloc_workqueue("mhi_ep_wq", 0, 0);
 	if (!mhi_cntrl->wq) {
 		ret = -ENOMEM;
-		goto err_free_cmd;
+		goto err_destroy_ring_item_cache;
 	}
 
 	INIT_LIST_HEAD(&mhi_cntrl->st_transition_list);
@@ -1474,6 +1497,12 @@ int mhi_ep_register_controller(struct mhi_ep_cntrl *mhi_cntrl,
 	ida_free(&mhi_ep_cntrl_ida, mhi_cntrl->index);
 err_destroy_wq:
 	destroy_workqueue(mhi_cntrl->wq);
+err_destroy_ring_item_cache:
+	kmem_cache_destroy(mhi_cntrl->ring_item_cache);
+err_destroy_ev_ring_el_cache:
+	kmem_cache_destroy(mhi_cntrl->ev_ring_el_cache);
+err_destroy_tre_buf_cache:
+	kmem_cache_destroy(mhi_cntrl->tre_buf_cache);
 err_free_cmd:
 	kfree(mhi_cntrl->mhi_cmd);
 err_free_ch:
@@ -1495,6 +1524,9 @@ void mhi_ep_unregister_controller(struct mhi_ep_cntrl *mhi_cntrl)
 
 	free_irq(mhi_cntrl->irq, mhi_cntrl);
 
+	kmem_cache_destroy(mhi_cntrl->tre_buf_cache);
+	kmem_cache_destroy(mhi_cntrl->ev_ring_el_cache);
+	kmem_cache_destroy(mhi_cntrl->ring_item_cache);
 	kfree(mhi_cntrl->mhi_cmd);
 	kfree(mhi_cntrl->mhi_chan);
 
diff --git a/include/linux/mhi_ep.h b/include/linux/mhi_ep.h
index f198a8ac7ee7..ce85d42b685d 100644
--- a/include/linux/mhi_ep.h
+++ b/include/linux/mhi_ep.h
@@ -128,6 +128,9 @@ struct mhi_ep_cntrl {
 	struct work_struct reset_work;
 	struct work_struct cmd_ring_work;
 	struct work_struct ch_ring_work;
+	struct kmem_cache *ring_item_cache;
+	struct kmem_cache *ev_ring_el_cache;
+	struct kmem_cache *tre_buf_cache;
 
 	void (*raise_irq)(struct mhi_ep_cntrl *mhi_cntrl, u32 vector);
 	int (*alloc_map)(struct mhi_ep_cntrl *mhi_cntrl, u64 pci_addr, phys_addr_t *phys_ptr,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 490/583] bus: mhi: ep: Pass mhi_ep_buf_info struct to read/write APIs
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (488 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 489/583] bus: mhi: ep: Use slab allocator where applicable Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 491/583] PCI: epf-mhi: Fix the DMA data direction of dma_unmap_single() Greg Kroah-Hartman
                   ` (99 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Manivannan Sadhasivam, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

[ Upstream commit b08ded2ef2e98768d5ee5f71da8fe768b1f7774b ]

In the preparation of DMA async support, let's pass the parameters to
read_from_host() and write_to_host() APIs using mhi_ep_buf_info structure.

No functional change.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Stable-dep-of: 327ec5f70609 ("PCI: epf-mhi: Fix the DMA data direction of dma_unmap_single()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/bus/mhi/ep/main.c                    | 23 +++----
 drivers/bus/mhi/ep/ring.c                    | 41 ++++++------
 drivers/pci/endpoint/functions/pci-epf-mhi.c | 66 +++++++++++---------
 include/linux/mhi_ep.h                       | 16 ++++-
 4 files changed, 84 insertions(+), 62 deletions(-)

diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c
index 517279600645..582d5c166a75 100644
--- a/drivers/bus/mhi/ep/main.c
+++ b/drivers/bus/mhi/ep/main.c
@@ -324,10 +324,9 @@ static int mhi_ep_read_channel(struct mhi_ep_cntrl *mhi_cntrl,
 	struct mhi_ep_chan *mhi_chan = &mhi_cntrl->mhi_chan[ring->ch_id];
 	struct device *dev = &mhi_cntrl->mhi_dev->dev;
 	size_t tr_len, read_offset, write_offset;
+	struct mhi_ep_buf_info buf_info = {};
 	struct mhi_ring_element *el;
 	bool tr_done = false;
-	void *write_addr;
-	u64 read_addr;
 	u32 buf_left;
 	int ret;
 
@@ -356,11 +355,13 @@ static int mhi_ep_read_channel(struct mhi_ep_cntrl *mhi_cntrl,
 
 		read_offset = mhi_chan->tre_size - mhi_chan->tre_bytes_left;
 		write_offset = len - buf_left;
-		read_addr = mhi_chan->tre_loc + read_offset;
-		write_addr = result->buf_addr + write_offset;
+
+		buf_info.host_addr = mhi_chan->tre_loc + read_offset;
+		buf_info.dev_addr = result->buf_addr + write_offset;
+		buf_info.size = tr_len;
 
 		dev_dbg(dev, "Reading %zd bytes from channel (%u)\n", tr_len, ring->ch_id);
-		ret = mhi_cntrl->read_from_host(mhi_cntrl, read_addr, write_addr, tr_len);
+		ret = mhi_cntrl->read_from_host(mhi_cntrl, &buf_info);
 		if (ret < 0) {
 			dev_err(&mhi_chan->mhi_dev->dev, "Error reading from channel\n");
 			return ret;
@@ -483,12 +484,11 @@ int mhi_ep_queue_skb(struct mhi_ep_device *mhi_dev, struct sk_buff *skb)
 	struct mhi_ep_cntrl *mhi_cntrl = mhi_dev->mhi_cntrl;
 	struct mhi_ep_chan *mhi_chan = mhi_dev->dl_chan;
 	struct device *dev = &mhi_chan->mhi_dev->dev;
+	struct mhi_ep_buf_info buf_info = {};
 	struct mhi_ring_element *el;
 	u32 buf_left, read_offset;
 	struct mhi_ep_ring *ring;
 	enum mhi_ev_ccs code;
-	void *read_addr;
-	u64 write_addr;
 	size_t tr_len;
 	u32 tre_len;
 	int ret;
@@ -517,11 +517,13 @@ int mhi_ep_queue_skb(struct mhi_ep_device *mhi_dev, struct sk_buff *skb)
 
 		tr_len = min(buf_left, tre_len);
 		read_offset = skb->len - buf_left;
-		read_addr = skb->data + read_offset;
-		write_addr = MHI_TRE_DATA_GET_PTR(el);
+
+		buf_info.dev_addr = skb->data + read_offset;
+		buf_info.host_addr = MHI_TRE_DATA_GET_PTR(el);
+		buf_info.size = tr_len;
 
 		dev_dbg(dev, "Writing %zd bytes to channel (%u)\n", tr_len, ring->ch_id);
-		ret = mhi_cntrl->write_to_host(mhi_cntrl, read_addr, write_addr, tr_len);
+		ret = mhi_cntrl->write_to_host(mhi_cntrl, &buf_info);
 		if (ret < 0) {
 			dev_err(dev, "Error writing to the channel\n");
 			goto err_exit;
@@ -1429,7 +1431,6 @@ int mhi_ep_register_controller(struct mhi_ep_cntrl *mhi_cntrl,
 		ret = -ENOMEM;
 		goto err_destroy_tre_buf_cache;
 	}
-
 	INIT_WORK(&mhi_cntrl->state_work, mhi_ep_state_worker);
 	INIT_WORK(&mhi_cntrl->reset_work, mhi_ep_reset_worker);
 	INIT_WORK(&mhi_cntrl->cmd_ring_work, mhi_ep_cmd_ring_worker);
diff --git a/drivers/bus/mhi/ep/ring.c b/drivers/bus/mhi/ep/ring.c
index 115518ec76a4..c673d7200b3e 100644
--- a/drivers/bus/mhi/ep/ring.c
+++ b/drivers/bus/mhi/ep/ring.c
@@ -30,7 +30,8 @@ static int __mhi_ep_cache_ring(struct mhi_ep_ring *ring, size_t end)
 {
 	struct mhi_ep_cntrl *mhi_cntrl = ring->mhi_cntrl;
 	struct device *dev = &mhi_cntrl->mhi_dev->dev;
-	size_t start, copy_size;
+	struct mhi_ep_buf_info buf_info = {};
+	size_t start;
 	int ret;
 
 	/* Don't proceed in the case of event ring. This happens during mhi_ep_ring_start(). */
@@ -43,30 +44,34 @@ static int __mhi_ep_cache_ring(struct mhi_ep_ring *ring, size_t end)
 
 	start = ring->wr_offset;
 	if (start < end) {
-		copy_size = (end - start) * sizeof(struct mhi_ring_element);
-		ret = mhi_cntrl->read_from_host(mhi_cntrl, ring->rbase +
-						(start * sizeof(struct mhi_ring_element)),
-						&ring->ring_cache[start], copy_size);
+		buf_info.size = (end - start) * sizeof(struct mhi_ring_element);
+		buf_info.host_addr = ring->rbase + (start * sizeof(struct mhi_ring_element));
+		buf_info.dev_addr = &ring->ring_cache[start];
+
+		ret = mhi_cntrl->read_from_host(mhi_cntrl, &buf_info);
 		if (ret < 0)
 			return ret;
 	} else {
-		copy_size = (ring->ring_size - start) * sizeof(struct mhi_ring_element);
-		ret = mhi_cntrl->read_from_host(mhi_cntrl, ring->rbase +
-						(start * sizeof(struct mhi_ring_element)),
-						&ring->ring_cache[start], copy_size);
+		buf_info.size = (ring->ring_size - start) * sizeof(struct mhi_ring_element);
+		buf_info.host_addr = ring->rbase + (start * sizeof(struct mhi_ring_element));
+		buf_info.dev_addr = &ring->ring_cache[start];
+
+		ret = mhi_cntrl->read_from_host(mhi_cntrl, &buf_info);
 		if (ret < 0)
 			return ret;
 
 		if (end) {
-			ret = mhi_cntrl->read_from_host(mhi_cntrl, ring->rbase,
-							&ring->ring_cache[0],
-							end * sizeof(struct mhi_ring_element));
+			buf_info.host_addr = ring->rbase;
+			buf_info.dev_addr = &ring->ring_cache[0];
+			buf_info.size = end * sizeof(struct mhi_ring_element);
+
+			ret = mhi_cntrl->read_from_host(mhi_cntrl, &buf_info);
 			if (ret < 0)
 				return ret;
 		}
 	}
 
-	dev_dbg(dev, "Cached ring: start %zu end %zu size %zu\n", start, end, copy_size);
+	dev_dbg(dev, "Cached ring: start %zu end %zu size %zu\n", start, end, buf_info.size);
 
 	return 0;
 }
@@ -102,6 +107,7 @@ int mhi_ep_ring_add_element(struct mhi_ep_ring *ring, struct mhi_ring_element *e
 {
 	struct mhi_ep_cntrl *mhi_cntrl = ring->mhi_cntrl;
 	struct device *dev = &mhi_cntrl->mhi_dev->dev;
+	struct mhi_ep_buf_info buf_info = {};
 	size_t old_offset = 0;
 	u32 num_free_elem;
 	__le64 rp;
@@ -133,12 +139,11 @@ int mhi_ep_ring_add_element(struct mhi_ep_ring *ring, struct mhi_ring_element *e
 	rp = cpu_to_le64(ring->rd_offset * sizeof(*el) + ring->rbase);
 	memcpy_toio((void __iomem *) &ring->ring_ctx->generic.rp, &rp, sizeof(u64));
 
-	ret = mhi_cntrl->write_to_host(mhi_cntrl, el, ring->rbase + (old_offset * sizeof(*el)),
-				       sizeof(*el));
-	if (ret < 0)
-		return ret;
+	buf_info.host_addr = ring->rbase + (old_offset * sizeof(*el));
+	buf_info.dev_addr = el;
+	buf_info.size = sizeof(*el);
 
-	return 0;
+	return mhi_cntrl->write_to_host(mhi_cntrl, &buf_info);
 }
 
 void mhi_ep_ring_init(struct mhi_ep_ring *ring, enum mhi_ep_ring_type type, u32 id)
diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c
index b7b9d3e21f97..ec5f4a38178b 100644
--- a/drivers/pci/endpoint/functions/pci-epf-mhi.c
+++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c
@@ -209,28 +209,28 @@ static void pci_epf_mhi_raise_irq(struct mhi_ep_cntrl *mhi_cntrl, u32 vector)
 			  vector + 1);
 }
 
-static int pci_epf_mhi_iatu_read(struct mhi_ep_cntrl *mhi_cntrl, u64 from,
-				 void *to, size_t size)
+static int pci_epf_mhi_iatu_read(struct mhi_ep_cntrl *mhi_cntrl,
+				 struct mhi_ep_buf_info *buf_info)
 {
 	struct pci_epf_mhi *epf_mhi = to_epf_mhi(mhi_cntrl);
-	size_t offset = get_align_offset(epf_mhi, from);
+	size_t offset = get_align_offset(epf_mhi, buf_info->host_addr);
 	void __iomem *tre_buf;
 	phys_addr_t tre_phys;
 	int ret;
 
 	mutex_lock(&epf_mhi->lock);
 
-	ret = __pci_epf_mhi_alloc_map(mhi_cntrl, from, &tre_phys, &tre_buf,
-				      offset, size);
+	ret = __pci_epf_mhi_alloc_map(mhi_cntrl, buf_info->host_addr, &tre_phys,
+				      &tre_buf, offset, buf_info->size);
 	if (ret) {
 		mutex_unlock(&epf_mhi->lock);
 		return ret;
 	}
 
-	memcpy_fromio(to, tre_buf, size);
+	memcpy_fromio(buf_info->dev_addr, tre_buf, buf_info->size);
 
-	__pci_epf_mhi_unmap_free(mhi_cntrl, from, tre_phys, tre_buf, offset,
-				 size);
+	__pci_epf_mhi_unmap_free(mhi_cntrl, buf_info->host_addr, tre_phys,
+				 tre_buf, offset, buf_info->size);
 
 	mutex_unlock(&epf_mhi->lock);
 
@@ -238,27 +238,27 @@ static int pci_epf_mhi_iatu_read(struct mhi_ep_cntrl *mhi_cntrl, u64 from,
 }
 
 static int pci_epf_mhi_iatu_write(struct mhi_ep_cntrl *mhi_cntrl,
-				  void *from, u64 to, size_t size)
+				  struct mhi_ep_buf_info *buf_info)
 {
 	struct pci_epf_mhi *epf_mhi = to_epf_mhi(mhi_cntrl);
-	size_t offset = get_align_offset(epf_mhi, to);
+	size_t offset = get_align_offset(epf_mhi, buf_info->host_addr);
 	void __iomem *tre_buf;
 	phys_addr_t tre_phys;
 	int ret;
 
 	mutex_lock(&epf_mhi->lock);
 
-	ret = __pci_epf_mhi_alloc_map(mhi_cntrl, to, &tre_phys, &tre_buf,
-				      offset, size);
+	ret = __pci_epf_mhi_alloc_map(mhi_cntrl, buf_info->host_addr, &tre_phys,
+				      &tre_buf, offset, buf_info->size);
 	if (ret) {
 		mutex_unlock(&epf_mhi->lock);
 		return ret;
 	}
 
-	memcpy_toio(tre_buf, from, size);
+	memcpy_toio(tre_buf, buf_info->dev_addr, buf_info->size);
 
-	__pci_epf_mhi_unmap_free(mhi_cntrl, to, tre_phys, tre_buf, offset,
-				 size);
+	__pci_epf_mhi_unmap_free(mhi_cntrl, buf_info->host_addr, tre_phys,
+				 tre_buf, offset, buf_info->size);
 
 	mutex_unlock(&epf_mhi->lock);
 
@@ -270,8 +270,8 @@ static void pci_epf_mhi_dma_callback(void *param)
 	complete(param);
 }
 
-static int pci_epf_mhi_edma_read(struct mhi_ep_cntrl *mhi_cntrl, u64 from,
-				 void *to, size_t size)
+static int pci_epf_mhi_edma_read(struct mhi_ep_cntrl *mhi_cntrl,
+				 struct mhi_ep_buf_info *buf_info)
 {
 	struct pci_epf_mhi *epf_mhi = to_epf_mhi(mhi_cntrl);
 	struct device *dma_dev = epf_mhi->epf->epc->dev.parent;
@@ -284,13 +284,13 @@ static int pci_epf_mhi_edma_read(struct mhi_ep_cntrl *mhi_cntrl, u64 from,
 	dma_addr_t dst_addr;
 	int ret;
 
-	if (size < SZ_4K)
-		return pci_epf_mhi_iatu_read(mhi_cntrl, from, to, size);
+	if (buf_info->size < SZ_4K)
+		return pci_epf_mhi_iatu_read(mhi_cntrl, buf_info);
 
 	mutex_lock(&epf_mhi->lock);
 
 	config.direction = DMA_DEV_TO_MEM;
-	config.src_addr = from;
+	config.src_addr = buf_info->host_addr;
 
 	ret = dmaengine_slave_config(chan, &config);
 	if (ret) {
@@ -298,14 +298,16 @@ static int pci_epf_mhi_edma_read(struct mhi_ep_cntrl *mhi_cntrl, u64 from,
 		goto err_unlock;
 	}
 
-	dst_addr = dma_map_single(dma_dev, to, size, DMA_FROM_DEVICE);
+	dst_addr = dma_map_single(dma_dev, buf_info->dev_addr, buf_info->size,
+				  DMA_FROM_DEVICE);
 	ret = dma_mapping_error(dma_dev, dst_addr);
 	if (ret) {
 		dev_err(dev, "Failed to map remote memory\n");
 		goto err_unlock;
 	}
 
-	desc = dmaengine_prep_slave_single(chan, dst_addr, size, DMA_DEV_TO_MEM,
+	desc = dmaengine_prep_slave_single(chan, dst_addr, buf_info->size,
+					   DMA_DEV_TO_MEM,
 					   DMA_CTRL_ACK | DMA_PREP_INTERRUPT);
 	if (!desc) {
 		dev_err(dev, "Failed to prepare DMA\n");
@@ -332,15 +334,15 @@ static int pci_epf_mhi_edma_read(struct mhi_ep_cntrl *mhi_cntrl, u64 from,
 	}
 
 err_unmap:
-	dma_unmap_single(dma_dev, dst_addr, size, DMA_FROM_DEVICE);
+	dma_unmap_single(dma_dev, dst_addr, buf_info->size, DMA_FROM_DEVICE);
 err_unlock:
 	mutex_unlock(&epf_mhi->lock);
 
 	return ret;
 }
 
-static int pci_epf_mhi_edma_write(struct mhi_ep_cntrl *mhi_cntrl, void *from,
-				  u64 to, size_t size)
+static int pci_epf_mhi_edma_write(struct mhi_ep_cntrl *mhi_cntrl,
+				  struct mhi_ep_buf_info *buf_info)
 {
 	struct pci_epf_mhi *epf_mhi = to_epf_mhi(mhi_cntrl);
 	struct device *dma_dev = epf_mhi->epf->epc->dev.parent;
@@ -353,13 +355,13 @@ static int pci_epf_mhi_edma_write(struct mhi_ep_cntrl *mhi_cntrl, void *from,
 	dma_addr_t src_addr;
 	int ret;
 
-	if (size < SZ_4K)
-		return pci_epf_mhi_iatu_write(mhi_cntrl, from, to, size);
+	if (buf_info->size < SZ_4K)
+		return pci_epf_mhi_iatu_write(mhi_cntrl, buf_info);
 
 	mutex_lock(&epf_mhi->lock);
 
 	config.direction = DMA_MEM_TO_DEV;
-	config.dst_addr = to;
+	config.dst_addr = buf_info->host_addr;
 
 	ret = dmaengine_slave_config(chan, &config);
 	if (ret) {
@@ -367,14 +369,16 @@ static int pci_epf_mhi_edma_write(struct mhi_ep_cntrl *mhi_cntrl, void *from,
 		goto err_unlock;
 	}
 
-	src_addr = dma_map_single(dma_dev, from, size, DMA_TO_DEVICE);
+	src_addr = dma_map_single(dma_dev, buf_info->dev_addr, buf_info->size,
+				  DMA_TO_DEVICE);
 	ret = dma_mapping_error(dma_dev, src_addr);
 	if (ret) {
 		dev_err(dev, "Failed to map remote memory\n");
 		goto err_unlock;
 	}
 
-	desc = dmaengine_prep_slave_single(chan, src_addr, size, DMA_MEM_TO_DEV,
+	desc = dmaengine_prep_slave_single(chan, src_addr, buf_info->size,
+					   DMA_MEM_TO_DEV,
 					   DMA_CTRL_ACK | DMA_PREP_INTERRUPT);
 	if (!desc) {
 		dev_err(dev, "Failed to prepare DMA\n");
@@ -401,7 +405,7 @@ static int pci_epf_mhi_edma_write(struct mhi_ep_cntrl *mhi_cntrl, void *from,
 	}
 
 err_unmap:
-	dma_unmap_single(dma_dev, src_addr, size, DMA_FROM_DEVICE);
+	dma_unmap_single(dma_dev, src_addr, buf_info->size, DMA_FROM_DEVICE);
 err_unlock:
 	mutex_unlock(&epf_mhi->lock);
 
diff --git a/include/linux/mhi_ep.h b/include/linux/mhi_ep.h
index ce85d42b685d..96f3a133540d 100644
--- a/include/linux/mhi_ep.h
+++ b/include/linux/mhi_ep.h
@@ -49,6 +49,18 @@ struct mhi_ep_db_info {
 	u32 status;
 };
 
+/**
+ * struct mhi_ep_buf_info - MHI Endpoint transfer buffer info
+ * @dev_addr: Address of the buffer in endpoint
+ * @host_addr: Address of the bufffer in host
+ * @size: Size of the buffer
+ */
+struct mhi_ep_buf_info {
+	void *dev_addr;
+	u64 host_addr;
+	size_t size;
+};
+
 /**
  * struct mhi_ep_cntrl - MHI Endpoint controller structure
  * @cntrl_dev: Pointer to the struct device of physical bus acting as the MHI
@@ -137,8 +149,8 @@ struct mhi_ep_cntrl {
 			 void __iomem **virt, size_t size);
 	void (*unmap_free)(struct mhi_ep_cntrl *mhi_cntrl, u64 pci_addr, phys_addr_t phys,
 			   void __iomem *virt, size_t size);
-	int (*read_from_host)(struct mhi_ep_cntrl *mhi_cntrl, u64 from, void *to, size_t size);
-	int (*write_to_host)(struct mhi_ep_cntrl *mhi_cntrl, void *from, u64 to, size_t size);
+	int (*read_from_host)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
+	int (*write_to_host)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
 
 	enum mhi_state mhi_state;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 491/583] PCI: epf-mhi: Fix the DMA data direction of dma_unmap_single()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (489 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 490/583] bus: mhi: ep: Pass mhi_ep_buf_info struct to read/write APIs Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 492/583] tty: early return from send_break() on TTY_DRIVER_HARDWARE_BREAK Greg Kroah-Hartman
                   ` (98 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Krzysztof Wilczyński,
	Manivannan Sadhasivam, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

[ Upstream commit 327ec5f70609cf00c6f961073c01857555c6a8eb ]

In the error path of pci_epf_mhi_edma_write() function, the DMA data
direction passed (DMA_FROM_DEVICE) doesn't match the actual direction used
for the data transfer. Fix it by passing the correct one (DMA_TO_DEVICE).

Fixes: 7b99aaaddabb ("PCI: epf-mhi: Add eDMA support")
Reviewed-by: Krzysztof Wilczyński <kw@linux.com>
Link: https://lore.kernel.org/r/20231214063328.40657-1-manivannan.sadhasivam@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/pci/endpoint/functions/pci-epf-mhi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c
index ec5f4a38178b..6dc918a8a023 100644
--- a/drivers/pci/endpoint/functions/pci-epf-mhi.c
+++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c
@@ -405,7 +405,7 @@ static int pci_epf_mhi_edma_write(struct mhi_ep_cntrl *mhi_cntrl,
 	}
 
 err_unmap:
-	dma_unmap_single(dma_dev, src_addr, buf_info->size, DMA_FROM_DEVICE);
+	dma_unmap_single(dma_dev, src_addr, buf_info->size, DMA_TO_DEVICE);
 err_unlock:
 	mutex_unlock(&epf_mhi->lock);
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 492/583] tty: early return from send_break() on TTY_DRIVER_HARDWARE_BREAK
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (490 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 491/583] PCI: epf-mhi: Fix the DMA data direction of dma_unmap_single() Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 493/583] tty: dont check for signal_pending() in send_break() Greg Kroah-Hartman
                   ` (97 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Jiri Slaby (SUSE), Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jiri Slaby (SUSE) <jirislaby@kernel.org>

[ Upstream commit 66619686d187b4a6395316b7f39881e945dce4bc ]

If the driver sets TTY_DRIVER_HARDWARE_BREAK, we leave ops->break_ctl()
to the driver and return from send_break(). But we do it using a local
variable and keep the code flowing through the end of the function.
Instead, do 'return' immediately with the ops->break_ctl()'s return
value.

This way, we don't have to stuff the 'else' branch of the 'if' with the
software break handling. And we can re-indent the function too.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230919085156.1578-14-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 66aad7d8d3ec ("usb: cdc-acm: return correct error code on unsupported break")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/tty/tty_io.c | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 8a94e5a43c6d..b6ddc1bf307b 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2475,22 +2475,24 @@ static int send_break(struct tty_struct *tty, unsigned int duration)
 		return 0;
 
 	if (tty->driver->flags & TTY_DRIVER_HARDWARE_BREAK)
-		retval = tty->ops->break_ctl(tty, duration);
-	else {
-		/* Do the work ourselves */
-		if (tty_write_lock(tty, false) < 0)
-			return -EINTR;
-		retval = tty->ops->break_ctl(tty, -1);
-		if (retval)
-			goto out;
-		if (!signal_pending(current))
-			msleep_interruptible(duration);
-		retval = tty->ops->break_ctl(tty, 0);
+		return tty->ops->break_ctl(tty, duration);
+
+	/* Do the work ourselves */
+	if (tty_write_lock(tty, false) < 0)
+		return -EINTR;
+
+	retval = tty->ops->break_ctl(tty, -1);
+	if (retval)
+		goto out;
+	if (!signal_pending(current))
+		msleep_interruptible(duration);
+	retval = tty->ops->break_ctl(tty, 0);
 out:
-		tty_write_unlock(tty);
-		if (signal_pending(current))
-			retval = -EINTR;
-	}
+	tty_write_unlock(tty);
+
+	if (signal_pending(current))
+		retval = -EINTR;
+
 	return retval;
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 493/583] tty: dont check for signal_pending() in send_break()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (491 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 492/583] tty: early return from send_break() on TTY_DRIVER_HARDWARE_BREAK Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 494/583] tty: use if in send_break() instead of goto Greg Kroah-Hartman
                   ` (96 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Jiri Slaby (SUSE), Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jiri Slaby (SUSE) <jirislaby@kernel.org>

[ Upstream commit fd99392b643b824813df2edbaebe26a2136d31e6 ]

msleep_interruptible() will check on its own. So no need to do the check
in send_break() before calling the above.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230919085156.1578-15-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 66aad7d8d3ec ("usb: cdc-acm: return correct error code on unsupported break")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/tty/tty_io.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index b6ddc1bf307b..ddcaf967f64b 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2484,8 +2484,7 @@ static int send_break(struct tty_struct *tty, unsigned int duration)
 	retval = tty->ops->break_ctl(tty, -1);
 	if (retval)
 		goto out;
-	if (!signal_pending(current))
-		msleep_interruptible(duration);
+	msleep_interruptible(duration);
 	retval = tty->ops->break_ctl(tty, 0);
 out:
 	tty_write_unlock(tty);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 494/583] tty: use if in send_break() instead of goto
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (492 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 493/583] tty: dont check for signal_pending() in send_break() Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 495/583] usb: cdc-acm: return correct error code on unsupported break Greg Kroah-Hartman
                   ` (95 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Jiri Slaby (SUSE), Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jiri Slaby (SUSE) <jirislaby@kernel.org>

[ Upstream commit 24f2cd019946fc2e88e632d2e24a34c2cc3f2be4 ]

Now, the "jumped-over" code is simple enough to be put inside an 'if'.
Do so to make it 'goto'-less.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230919085156.1578-16-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 66aad7d8d3ec ("usb: cdc-acm: return correct error code on unsupported break")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/tty/tty_io.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index ddcaf967f64b..724ebf82f2cd 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2482,11 +2482,10 @@ static int send_break(struct tty_struct *tty, unsigned int duration)
 		return -EINTR;
 
 	retval = tty->ops->break_ctl(tty, -1);
-	if (retval)
-		goto out;
-	msleep_interruptible(duration);
-	retval = tty->ops->break_ctl(tty, 0);
-out:
+	if (!retval) {
+		msleep_interruptible(duration);
+		retval = tty->ops->break_ctl(tty, 0);
+	}
 	tty_write_unlock(tty);
 
 	if (signal_pending(current))
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 495/583] usb: cdc-acm: return correct error code on unsupported break
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (493 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 494/583] tty: use if in send_break() instead of goto Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 496/583] usb: core: Fix crash w/ usb_choose_configuration() if no driver Greg Kroah-Hartman
                   ` (94 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Oliver Neukum, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Oliver Neukum <oneukum@suse.com>

[ Upstream commit 66aad7d8d3ec5a3a8ec2023841bcec2ded5f65c9 ]

In ACM support for sending breaks to devices is optional.
If a device says that it doenot support sending breaks,
the host must respect that.
Given the number of optional features providing tty operations
for each combination is not practical and errors need to be
returned dynamically if unsupported features are requested.

In case a device does not support break, we want the tty layer
to treat that like it treats drivers that statically cannot
support sending a break. It ignores the inability and does nothing.
This patch uses EOPNOTSUPP to indicate that.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Fixes: 9e98966c7bb94 ("tty: rework break handling")
Link: https://lore.kernel.org/r/20231207132639.18250-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/tty/tty_io.c        | 3 +++
 drivers/usb/class/cdc-acm.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 724ebf82f2cd..493fc4742895 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2485,6 +2485,9 @@ static int send_break(struct tty_struct *tty, unsigned int duration)
 	if (!retval) {
 		msleep_interruptible(duration);
 		retval = tty->ops->break_ctl(tty, 0);
+	} else if (retval == -EOPNOTSUPP) {
+		/* some drivers can tell only dynamically */
+		retval = 0;
 	}
 	tty_write_unlock(tty);
 
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index a1f4e1ead97f..0e7439dba8fe 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -916,6 +916,9 @@ static int acm_tty_break_ctl(struct tty_struct *tty, int state)
 	struct acm *acm = tty->driver_data;
 	int retval;
 
+	if (!(acm->ctrl_caps & USB_CDC_CAP_BRK))
+		return -EOPNOTSUPP;
+
 	retval = acm_send_break(acm, state ? 0xffff : 0);
 	if (retval < 0)
 		dev_dbg(&acm->control->dev,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 496/583] usb: core: Fix crash w/ usb_choose_configuration() if no driver
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (494 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 495/583] usb: cdc-acm: return correct error code on unsupported break Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 497/583] spmi: mtk-pmif: Serialize PMIF status check and command submission Greg Kroah-Hartman
                   ` (93 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alan Stern, Douglas Anderson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Douglas Anderson <dianders@chromium.org>

[ Upstream commit 44995e6f07028f798efd0c3c11a1efc78330f600 ]

It's possible that usb_choose_configuration() can get called when a
USB device has no driver. In this case the recent commit a87b8e3be926
("usb: core: Allow subclassed USB drivers to override
usb_choose_configuration()") can cause a crash since it dereferenced
the driver structure without checking for NULL. Let's add a check.

A USB device with no driver is an anomaly, so make
usb_choose_configuration() return immediately if there is no driver.

This was seen in the real world when usbguard got ahold of a r8152
device at the wrong time. It can also be simulated via this on a
computer with one r8152-based USB Ethernet adapter:
  cd /sys/bus/usb/drivers/r8152-cfgselector
  to_unbind="$(ls -d *-*)"
  real_dir="$(readlink -f "${to_unbind}")"
  echo "${to_unbind}" > unbind
  cd "${real_dir}"
  echo 0 > authorized
  echo 1 > authorized

Fixes: a87b8e3be926 ("usb: core: Allow subclassed USB drivers to override usb_choose_configuration()")
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20231211073237.v3.1.If27eb3bf7812f91ab83810f232292f032f4203e0@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/usb/core/generic.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c
index dcb897158228..b134bff5c3fe 100644
--- a/drivers/usb/core/generic.c
+++ b/drivers/usb/core/generic.c
@@ -59,7 +59,16 @@ int usb_choose_configuration(struct usb_device *udev)
 	int num_configs;
 	int insufficient_power = 0;
 	struct usb_host_config *c, *best;
-	struct usb_device_driver *udriver = to_usb_device_driver(udev->dev.driver);
+	struct usb_device_driver *udriver;
+
+	/*
+	 * If a USB device (not an interface) doesn't have a driver then the
+	 * kernel has no business trying to select or install a configuration
+	 * for it.
+	 */
+	if (!udev->dev.driver)
+		return -1;
+	udriver = to_usb_device_driver(udev->dev.driver);
 
 	if (usb_device_is_owned(udev))
 		return 0;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 497/583] spmi: mtk-pmif: Serialize PMIF status check and command submission
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (495 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 496/583] usb: core: Fix crash w/ usb_choose_configuration() if no driver Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 498/583] usb: gadget: webcam: Make g_webcam loadable again Greg Kroah-Hartman
                   ` (92 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nícolas F .  R .  A .  Prado,
	AngeloGioacchino Del Regno, Alexandre Mergnat, Stephen Boyd,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nícolas F. R. A. Prado <nfraprado@collabora.com>

[ Upstream commit f200fff8d019f2754f91f5d715652e3e3fdf3604 ]

Before writing the read or write command to the SPMI arbiter through the
PMIF interface, the current status of the channel is checked to ensure
it is idle. However, since the status only changes from idle when the
command is written, it is possible for two concurrent calls to determine
that the channel is idle and simultaneously send their commands. At this
point the PMIF interface hangs, with the status register no longer being
updated, and thus causing all subsequent operations to time out.

This was observed on the mt8195-cherry-tomato-r2 machine, particularly
after commit 46600ab142f8 ("regulator: Set PROBE_PREFER_ASYNCHRONOUS for
drivers between 5.10 and 5.15") was applied, since then the two MT6315
devices present on the SPMI bus would probe assynchronously and
sometimes (during probe or at a later point) read the bus
simultaneously, breaking the PMIF interface and consequently slowing
down the whole system.

To fix the issue at its root cause, introduce locking around the channel
status check and the command write, so that both become an atomic
operation, preventing race conditions between two (or more) SPMI bus
read/write operations. A spinlock is used since this is a fast bus, as
indicated by the usage of the atomic variant of readl_poll, and
'.fast_io = true' being used in the mt6315 driver, so spinlocks are
already used for the regmap access.

Fixes: b45b3ccef8c0 ("spmi: mediatek: Add support for MT6873/8192")
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20230724154739.493724-1-nfraprado@collabora.com
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20231206231733.4031901-2-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/spmi/spmi-mtk-pmif.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/spmi/spmi-mtk-pmif.c b/drivers/spmi/spmi-mtk-pmif.c
index b3c991e1ea40..54c35f5535cb 100644
--- a/drivers/spmi/spmi-mtk-pmif.c
+++ b/drivers/spmi/spmi-mtk-pmif.c
@@ -50,6 +50,7 @@ struct pmif {
 	struct clk_bulk_data clks[PMIF_MAX_CLKS];
 	size_t nclks;
 	const struct pmif_data *data;
+	raw_spinlock_t lock;
 };
 
 static const char * const pmif_clock_names[] = {
@@ -314,6 +315,7 @@ static int pmif_spmi_read_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid,
 	struct ch_reg *inf_reg;
 	int ret;
 	u32 data, cmd;
+	unsigned long flags;
 
 	/* Check for argument validation. */
 	if (sid & ~0xf) {
@@ -334,6 +336,7 @@ static int pmif_spmi_read_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid,
 	else
 		return -EINVAL;
 
+	raw_spin_lock_irqsave(&arb->lock, flags);
 	/* Wait for Software Interface FSM state to be IDLE. */
 	inf_reg = &arb->chan;
 	ret = readl_poll_timeout_atomic(arb->base + arb->data->regs[inf_reg->ch_sta],
@@ -343,6 +346,7 @@ static int pmif_spmi_read_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid,
 		/* set channel ready if the data has transferred */
 		if (pmif_is_fsm_vldclr(arb))
 			pmif_writel(arb, 1, inf_reg->ch_rdy);
+		raw_spin_unlock_irqrestore(&arb->lock, flags);
 		dev_err(&ctrl->dev, "failed to wait for SWINF_IDLE\n");
 		return ret;
 	}
@@ -350,6 +354,7 @@ static int pmif_spmi_read_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid,
 	/* Send the command. */
 	cmd = (opc << 30) | (sid << 24) | ((len - 1) << 16) | addr;
 	pmif_writel(arb, cmd, inf_reg->ch_send);
+	raw_spin_unlock_irqrestore(&arb->lock, flags);
 
 	/*
 	 * Wait for Software Interface FSM state to be WFVLDCLR,
@@ -376,7 +381,8 @@ static int pmif_spmi_write_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid,
 	struct pmif *arb = spmi_controller_get_drvdata(ctrl);
 	struct ch_reg *inf_reg;
 	int ret;
-	u32 data, cmd;
+	u32 data, wdata, cmd;
+	unsigned long flags;
 
 	if (len > 4) {
 		dev_err(&ctrl->dev, "pmif supports 1..4 bytes per trans, but:%zu requested", len);
@@ -394,6 +400,10 @@ static int pmif_spmi_write_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid,
 	else
 		return -EINVAL;
 
+	/* Set the write data. */
+	memcpy(&wdata, buf, len);
+
+	raw_spin_lock_irqsave(&arb->lock, flags);
 	/* Wait for Software Interface FSM state to be IDLE. */
 	inf_reg = &arb->chan;
 	ret = readl_poll_timeout_atomic(arb->base + arb->data->regs[inf_reg->ch_sta],
@@ -403,17 +413,17 @@ static int pmif_spmi_write_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid,
 		/* set channel ready if the data has transferred */
 		if (pmif_is_fsm_vldclr(arb))
 			pmif_writel(arb, 1, inf_reg->ch_rdy);
+		raw_spin_unlock_irqrestore(&arb->lock, flags);
 		dev_err(&ctrl->dev, "failed to wait for SWINF_IDLE\n");
 		return ret;
 	}
 
-	/* Set the write data. */
-	memcpy(&data, buf, len);
-	pmif_writel(arb, data, inf_reg->wdata);
+	pmif_writel(arb, wdata, inf_reg->wdata);
 
 	/* Send the command. */
 	cmd = (opc << 30) | BIT(29) | (sid << 24) | ((len - 1) << 16) | addr;
 	pmif_writel(arb, cmd, inf_reg->ch_send);
+	raw_spin_unlock_irqrestore(&arb->lock, flags);
 
 	return 0;
 }
@@ -488,6 +498,8 @@ static int mtk_spmi_probe(struct platform_device *pdev)
 	arb->chan.ch_send = PMIF_SWINF_0_ACC + chan_offset;
 	arb->chan.ch_rdy = PMIF_SWINF_0_VLD_CLR + chan_offset;
 
+	raw_spin_lock_init(&arb->lock);
+
 	platform_set_drvdata(pdev, ctrl);
 
 	err = spmi_controller_add(ctrl);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 498/583] usb: gadget: webcam: Make g_webcam loadable again
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (496 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 497/583] spmi: mtk-pmif: Serialize PMIF status check and command submission Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 499/583] iommu: Dont reserve 0-length IOVA region Greg Kroah-Hartman
                   ` (91 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Andrzej Pietrasiewicz, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Andrzej Pietrasiewicz <andrzej.p@collabora.com>

[ Upstream commit f1fd91a0924b6bff91ca1287461fb8e3b3b61d92 ]

commit 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")
has rendered the precomposed (aka legacy) webcam gadget unloadable.

uvc_alloc() since then has depended on certain config groups being
available in configfs tree related to the UVC function. However, legacy
gadgets do not create anything in configfs, so uvc_alloc() must fail
with -ENOENT no matter what.

This patch mimics the required configfs hierarchy to satisfy the code which
inspects formats and frames found in uvcg_streaming_header.

This has been tested with guvcview on the host side, using vivid as a
source of video stream on the device side and using the userspace program
found at https://gitlab.freedesktop.org/camera/uvc-gadget.git.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Fixes: 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")
Link: https://lore.kernel.org/r/20231215131614.29132-1-andrzej.p@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/usb/gadget/function/f_uvc.c |  45 ++--
 drivers/usb/gadget/function/u_uvc.h |   6 +
 drivers/usb/gadget/legacy/webcam.c  | 333 +++++++++++++++++++++-------
 3 files changed, 284 insertions(+), 100 deletions(-)

diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
index 3d5c03e1361e..2e6bafb2a554 100644
--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -966,7 +966,8 @@ static void uvc_free(struct usb_function *f)
 	struct uvc_device *uvc = to_uvc(f);
 	struct f_uvc_opts *opts = container_of(f->fi, struct f_uvc_opts,
 					       func_inst);
-	config_item_put(&uvc->header->item);
+	if (!opts->header)
+		config_item_put(&uvc->header->item);
 	--opts->refcnt;
 	kfree(uvc);
 }
@@ -1058,25 +1059,29 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi)
 	uvc->desc.hs_streaming = opts->hs_streaming;
 	uvc->desc.ss_streaming = opts->ss_streaming;
 
-	streaming = config_group_find_item(&opts->func_inst.group, "streaming");
-	if (!streaming)
-		goto err_config;
-
-	header = config_group_find_item(to_config_group(streaming), "header");
-	config_item_put(streaming);
-	if (!header)
-		goto err_config;
-
-	h = config_group_find_item(to_config_group(header), "h");
-	config_item_put(header);
-	if (!h)
-		goto err_config;
-
-	uvc->header = to_uvcg_streaming_header(h);
-	if (!uvc->header->linked) {
-		mutex_unlock(&opts->lock);
-		kfree(uvc);
-		return ERR_PTR(-EBUSY);
+	if (opts->header) {
+		uvc->header = opts->header;
+	} else {
+		streaming = config_group_find_item(&opts->func_inst.group, "streaming");
+		if (!streaming)
+			goto err_config;
+
+		header = config_group_find_item(to_config_group(streaming), "header");
+		config_item_put(streaming);
+		if (!header)
+			goto err_config;
+
+		h = config_group_find_item(to_config_group(header), "h");
+		config_item_put(header);
+		if (!h)
+			goto err_config;
+
+		uvc->header = to_uvcg_streaming_header(h);
+		if (!uvc->header->linked) {
+			mutex_unlock(&opts->lock);
+			kfree(uvc);
+			return ERR_PTR(-EBUSY);
+		}
 	}
 
 	uvc->desc.extension_units = &opts->extension_units;
diff --git a/drivers/usb/gadget/function/u_uvc.h b/drivers/usb/gadget/function/u_uvc.h
index 1ce58f61253c..3ac392cbb779 100644
--- a/drivers/usb/gadget/function/u_uvc.h
+++ b/drivers/usb/gadget/function/u_uvc.h
@@ -98,6 +98,12 @@ struct f_uvc_opts {
 	 */
 	struct mutex			lock;
 	int				refcnt;
+
+	/*
+	 * Only for legacy gadget. Shall be NULL for configfs-composed gadgets,
+	 * which is guaranteed by alloc_inst implementation of f_uvc doing kzalloc.
+	 */
+	struct uvcg_streaming_header	*header;
 };
 
 #endif /* U_UVC_H */
diff --git a/drivers/usb/gadget/legacy/webcam.c b/drivers/usb/gadget/legacy/webcam.c
index c06dd1af7a0c..c395438d3978 100644
--- a/drivers/usb/gadget/legacy/webcam.c
+++ b/drivers/usb/gadget/legacy/webcam.c
@@ -12,6 +12,7 @@
 #include <linux/usb/video.h>
 
 #include "u_uvc.h"
+#include "uvc_configfs.h"
 
 USB_GADGET_COMPOSITE_OPTIONS();
 
@@ -84,8 +85,6 @@ static struct usb_device_descriptor webcam_device_descriptor = {
 	.bNumConfigurations	= 0, /* dynamic */
 };
 
-DECLARE_UVC_HEADER_DESCRIPTOR(1);
-
 static const struct UVC_HEADER_DESCRIPTOR(1) uvc_control_header = {
 	.bLength		= UVC_DT_HEADER_SIZE(1),
 	.bDescriptorType	= USB_DT_CS_INTERFACE,
@@ -158,43 +157,112 @@ static const struct UVC_INPUT_HEADER_DESCRIPTOR(1, 2) uvc_input_header = {
 	.bmaControls[1][0]	= 4,
 };
 
-static const struct uvc_format_uncompressed uvc_format_yuv = {
-	.bLength		= UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_FORMAT_UNCOMPRESSED,
-	.bFormatIndex		= 1,
-	.bNumFrameDescriptors	= 2,
-	.guidFormat		=
-		{ 'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00,
-		 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71},
-	.bBitsPerPixel		= 16,
-	.bDefaultFrameIndex	= 1,
-	.bAspectRatioX		= 0,
-	.bAspectRatioY		= 0,
-	.bmInterlaceFlags	= 0,
-	.bCopyProtect		= 0,
+static const struct uvcg_color_matching uvcg_color_matching = {
+	.desc = {
+		.bLength		= UVC_DT_COLOR_MATCHING_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_COLORFORMAT,
+		.bColorPrimaries	= 1,
+		.bTransferCharacteristics	= 1,
+		.bMatrixCoefficients	= 4,
+	},
+};
+
+static struct uvcg_uncompressed uvcg_format_yuv = {
+	.fmt = {
+		.type			= UVCG_UNCOMPRESSED,
+		/* add to .frames and fill .num_frames at runtime */
+		.color_matching		= (struct uvcg_color_matching *)&uvcg_color_matching,
+	},
+	.desc = {
+		.bLength		= UVC_DT_FORMAT_UNCOMPRESSED_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_FORMAT_UNCOMPRESSED,
+		.bFormatIndex		= 1,
+		.bNumFrameDescriptors	= 2,
+		.guidFormat		= {
+			'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00,
+			 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71
+		},
+		.bBitsPerPixel		= 16,
+		.bDefaultFrameIndex	= 1,
+		.bAspectRatioX		= 0,
+		.bAspectRatioY		= 0,
+		.bmInterlaceFlags	= 0,
+		.bCopyProtect		= 0,
+	},
+};
+
+static struct uvcg_format_ptr uvcg_format_ptr_yuv = {
+	.fmt = &uvcg_format_yuv.fmt,
 };
 
 DECLARE_UVC_FRAME_UNCOMPRESSED(1);
 DECLARE_UVC_FRAME_UNCOMPRESSED(3);
 
+#define UVCG_WIDTH_360P			640
+#define UVCG_HEIGHT_360P		360
+#define UVCG_MIN_BITRATE_360P		18432000
+#define UVCG_MAX_BITRATE_360P		55296000
+#define UVCG_MAX_VIDEO_FB_SZ_360P	460800
+#define UVCG_FRM_INTERV_0_360P		666666
+#define UVCG_FRM_INTERV_1_360P		1000000
+#define UVCG_FRM_INTERV_2_360P		5000000
+#define UVCG_DEFAULT_FRM_INTERV_360P	UVCG_FRM_INTERV_0_360P
+
 static const struct UVC_FRAME_UNCOMPRESSED(3) uvc_frame_yuv_360p = {
 	.bLength		= UVC_DT_FRAME_UNCOMPRESSED_SIZE(3),
 	.bDescriptorType	= USB_DT_CS_INTERFACE,
 	.bDescriptorSubType	= UVC_VS_FRAME_UNCOMPRESSED,
 	.bFrameIndex		= 1,
 	.bmCapabilities		= 0,
-	.wWidth			= cpu_to_le16(640),
-	.wHeight		= cpu_to_le16(360),
-	.dwMinBitRate		= cpu_to_le32(18432000),
-	.dwMaxBitRate		= cpu_to_le32(55296000),
-	.dwMaxVideoFrameBufferSize	= cpu_to_le32(460800),
-	.dwDefaultFrameInterval	= cpu_to_le32(666666),
+	.wWidth			= cpu_to_le16(UVCG_WIDTH_360P),
+	.wHeight		= cpu_to_le16(UVCG_HEIGHT_360P),
+	.dwMinBitRate		= cpu_to_le32(UVCG_MIN_BITRATE_360P),
+	.dwMaxBitRate		= cpu_to_le32(UVCG_MAX_BITRATE_360P),
+	.dwMaxVideoFrameBufferSize	= cpu_to_le32(UVCG_MAX_VIDEO_FB_SZ_360P),
+	.dwDefaultFrameInterval	= cpu_to_le32(UVCG_DEFAULT_FRM_INTERV_360P),
 	.bFrameIntervalType	= 3,
-	.dwFrameInterval[0]	= cpu_to_le32(666666),
-	.dwFrameInterval[1]	= cpu_to_le32(1000000),
-	.dwFrameInterval[2]	= cpu_to_le32(5000000),
+	.dwFrameInterval[0]	= cpu_to_le32(UVCG_FRM_INTERV_0_360P),
+	.dwFrameInterval[1]	= cpu_to_le32(UVCG_FRM_INTERV_1_360P),
+	.dwFrameInterval[2]	= cpu_to_le32(UVCG_FRM_INTERV_2_360P),
+};
+
+static u32 uvcg_frame_yuv_360p_dw_frame_interval[] = {
+	[0] = UVCG_FRM_INTERV_0_360P,
+	[1] = UVCG_FRM_INTERV_1_360P,
+	[2] = UVCG_FRM_INTERV_2_360P,
+};
+
+static const struct uvcg_frame uvcg_frame_yuv_360p = {
+	.fmt_type		= UVCG_UNCOMPRESSED,
+	.frame = {
+		.b_length			= UVC_DT_FRAME_UNCOMPRESSED_SIZE(3),
+		.b_descriptor_type		= USB_DT_CS_INTERFACE,
+		.b_descriptor_subtype		= UVC_VS_FRAME_UNCOMPRESSED,
+		.b_frame_index			= 1,
+		.bm_capabilities		= 0,
+		.w_width			= UVCG_WIDTH_360P,
+		.w_height			= UVCG_HEIGHT_360P,
+		.dw_min_bit_rate		= UVCG_MIN_BITRATE_360P,
+		.dw_max_bit_rate		= UVCG_MAX_BITRATE_360P,
+		.dw_max_video_frame_buffer_size	= UVCG_MAX_VIDEO_FB_SZ_360P,
+		.dw_default_frame_interval	= UVCG_DEFAULT_FRM_INTERV_360P,
+		.b_frame_interval_type		= 3,
+	},
+	.dw_frame_interval	= uvcg_frame_yuv_360p_dw_frame_interval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_yuv_360p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_yuv_360p,
 };
+#define UVCG_WIDTH_720P			1280
+#define UVCG_HEIGHT_720P		720
+#define UVCG_MIN_BITRATE_720P		29491200
+#define UVCG_MAX_BITRATE_720P		29491200
+#define UVCG_MAX_VIDEO_FB_SZ_720P	1843200
+#define UVCG_FRM_INTERV_0_720P		5000000
+#define UVCG_DEFAULT_FRM_INTERV_720P	UVCG_FRM_INTERV_0_720P
 
 static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
 	.bLength		= UVC_DT_FRAME_UNCOMPRESSED_SIZE(1),
@@ -202,28 +270,66 @@ static const struct UVC_FRAME_UNCOMPRESSED(1) uvc_frame_yuv_720p = {
 	.bDescriptorSubType	= UVC_VS_FRAME_UNCOMPRESSED,
 	.bFrameIndex		= 2,
 	.bmCapabilities		= 0,
-	.wWidth			= cpu_to_le16(1280),
-	.wHeight		= cpu_to_le16(720),
-	.dwMinBitRate		= cpu_to_le32(29491200),
-	.dwMaxBitRate		= cpu_to_le32(29491200),
-	.dwMaxVideoFrameBufferSize	= cpu_to_le32(1843200),
-	.dwDefaultFrameInterval	= cpu_to_le32(5000000),
+	.wWidth			= cpu_to_le16(UVCG_WIDTH_720P),
+	.wHeight		= cpu_to_le16(UVCG_HEIGHT_720P),
+	.dwMinBitRate		= cpu_to_le32(UVCG_MIN_BITRATE_720P),
+	.dwMaxBitRate		= cpu_to_le32(UVCG_MAX_BITRATE_720P),
+	.dwMaxVideoFrameBufferSize	= cpu_to_le32(UVCG_MAX_VIDEO_FB_SZ_720P),
+	.dwDefaultFrameInterval	= cpu_to_le32(UVCG_DEFAULT_FRM_INTERV_720P),
 	.bFrameIntervalType	= 1,
-	.dwFrameInterval[0]	= cpu_to_le32(5000000),
+	.dwFrameInterval[0]	= cpu_to_le32(UVCG_FRM_INTERV_0_720P),
 };
 
-static const struct uvc_format_mjpeg uvc_format_mjpg = {
-	.bLength		= UVC_DT_FORMAT_MJPEG_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_FORMAT_MJPEG,
-	.bFormatIndex		= 2,
-	.bNumFrameDescriptors	= 2,
-	.bmFlags		= 0,
-	.bDefaultFrameIndex	= 1,
-	.bAspectRatioX		= 0,
-	.bAspectRatioY		= 0,
-	.bmInterlaceFlags	= 0,
-	.bCopyProtect		= 0,
+static u32 uvcg_frame_yuv_720p_dw_frame_interval[] = {
+	[0] = UVCG_FRM_INTERV_0_720P,
+};
+
+static const struct uvcg_frame uvcg_frame_yuv_720p = {
+	.fmt_type		= UVCG_UNCOMPRESSED,
+	.frame = {
+		.b_length			= UVC_DT_FRAME_UNCOMPRESSED_SIZE(1),
+		.b_descriptor_type		= USB_DT_CS_INTERFACE,
+		.b_descriptor_subtype		= UVC_VS_FRAME_UNCOMPRESSED,
+		.b_frame_index			= 2,
+		.bm_capabilities		= 0,
+		.w_width			= UVCG_WIDTH_720P,
+		.w_height			= UVCG_HEIGHT_720P,
+		.dw_min_bit_rate		= UVCG_MIN_BITRATE_720P,
+		.dw_max_bit_rate		= UVCG_MAX_BITRATE_720P,
+		.dw_max_video_frame_buffer_size	= UVCG_MAX_VIDEO_FB_SZ_720P,
+		.dw_default_frame_interval	= UVCG_DEFAULT_FRM_INTERV_720P,
+		.b_frame_interval_type		= 1,
+	},
+	.dw_frame_interval	= uvcg_frame_yuv_720p_dw_frame_interval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_yuv_720p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_yuv_720p,
+};
+
+static struct uvcg_mjpeg uvcg_format_mjpeg = {
+	.fmt = {
+		.type			= UVCG_MJPEG,
+		/* add to .frames and fill .num_frames at runtime */
+		.color_matching		= (struct uvcg_color_matching *)&uvcg_color_matching,
+	},
+	.desc = {
+		.bLength		= UVC_DT_FORMAT_MJPEG_SIZE,
+		.bDescriptorType	= USB_DT_CS_INTERFACE,
+		.bDescriptorSubType	= UVC_VS_FORMAT_MJPEG,
+		.bFormatIndex		= 2,
+		.bNumFrameDescriptors	= 2,
+		.bmFlags		= 0,
+		.bDefaultFrameIndex	= 1,
+		.bAspectRatioX		= 0,
+		.bAspectRatioY		= 0,
+		.bmInterlaceFlags	= 0,
+		.bCopyProtect		= 0,
+	},
+};
+
+static struct uvcg_format_ptr uvcg_format_ptr_mjpeg = {
+	.fmt = &uvcg_format_mjpeg.fmt,
 };
 
 DECLARE_UVC_FRAME_MJPEG(1);
@@ -235,16 +341,45 @@ static const struct UVC_FRAME_MJPEG(3) uvc_frame_mjpg_360p = {
 	.bDescriptorSubType	= UVC_VS_FRAME_MJPEG,
 	.bFrameIndex		= 1,
 	.bmCapabilities		= 0,
-	.wWidth			= cpu_to_le16(640),
-	.wHeight		= cpu_to_le16(360),
-	.dwMinBitRate		= cpu_to_le32(18432000),
-	.dwMaxBitRate		= cpu_to_le32(55296000),
-	.dwMaxVideoFrameBufferSize	= cpu_to_le32(460800),
-	.dwDefaultFrameInterval	= cpu_to_le32(666666),
+	.wWidth			= cpu_to_le16(UVCG_WIDTH_360P),
+	.wHeight		= cpu_to_le16(UVCG_HEIGHT_360P),
+	.dwMinBitRate		= cpu_to_le32(UVCG_MIN_BITRATE_360P),
+	.dwMaxBitRate		= cpu_to_le32(UVCG_MAX_BITRATE_360P),
+	.dwMaxVideoFrameBufferSize	= cpu_to_le32(UVCG_MAX_VIDEO_FB_SZ_360P),
+	.dwDefaultFrameInterval	= cpu_to_le32(UVCG_DEFAULT_FRM_INTERV_360P),
 	.bFrameIntervalType	= 3,
-	.dwFrameInterval[0]	= cpu_to_le32(666666),
-	.dwFrameInterval[1]	= cpu_to_le32(1000000),
-	.dwFrameInterval[2]	= cpu_to_le32(5000000),
+	.dwFrameInterval[0]	= cpu_to_le32(UVCG_FRM_INTERV_0_360P),
+	.dwFrameInterval[1]	= cpu_to_le32(UVCG_FRM_INTERV_1_360P),
+	.dwFrameInterval[2]	= cpu_to_le32(UVCG_FRM_INTERV_2_360P),
+};
+
+static u32 uvcg_frame_mjpeg_360p_dw_frame_interval[] = {
+	[0] = UVCG_FRM_INTERV_0_360P,
+	[1] = UVCG_FRM_INTERV_1_360P,
+	[2] = UVCG_FRM_INTERV_2_360P,
+};
+
+static const struct uvcg_frame uvcg_frame_mjpeg_360p = {
+	.fmt_type		= UVCG_MJPEG,
+	.frame = {
+		.b_length			= UVC_DT_FRAME_MJPEG_SIZE(3),
+		.b_descriptor_type		= USB_DT_CS_INTERFACE,
+		.b_descriptor_subtype		= UVC_VS_FRAME_MJPEG,
+		.b_frame_index			= 1,
+		.bm_capabilities		= 0,
+		.w_width			= UVCG_WIDTH_360P,
+		.w_height			= UVCG_HEIGHT_360P,
+		.dw_min_bit_rate		= UVCG_MIN_BITRATE_360P,
+		.dw_max_bit_rate		= UVCG_MAX_BITRATE_360P,
+		.dw_max_video_frame_buffer_size	= UVCG_MAX_VIDEO_FB_SZ_360P,
+		.dw_default_frame_interval	= UVCG_DEFAULT_FRM_INTERV_360P,
+		.b_frame_interval_type		= 3,
+	},
+	.dw_frame_interval	= uvcg_frame_mjpeg_360p_dw_frame_interval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_mjpeg_360p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_mjpeg_360p,
 };
 
 static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
@@ -253,23 +388,44 @@ static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = {
 	.bDescriptorSubType	= UVC_VS_FRAME_MJPEG,
 	.bFrameIndex		= 2,
 	.bmCapabilities		= 0,
-	.wWidth			= cpu_to_le16(1280),
-	.wHeight		= cpu_to_le16(720),
-	.dwMinBitRate		= cpu_to_le32(29491200),
-	.dwMaxBitRate		= cpu_to_le32(29491200),
-	.dwMaxVideoFrameBufferSize	= cpu_to_le32(1843200),
-	.dwDefaultFrameInterval	= cpu_to_le32(5000000),
+	.wWidth			= cpu_to_le16(UVCG_WIDTH_720P),
+	.wHeight		= cpu_to_le16(UVCG_HEIGHT_720P),
+	.dwMinBitRate		= cpu_to_le32(UVCG_MIN_BITRATE_720P),
+	.dwMaxBitRate		= cpu_to_le32(UVCG_MAX_BITRATE_720P),
+	.dwMaxVideoFrameBufferSize	= cpu_to_le32(UVCG_MAX_VIDEO_FB_SZ_720P),
+	.dwDefaultFrameInterval	= cpu_to_le32(UVCG_DEFAULT_FRM_INTERV_720P),
 	.bFrameIntervalType	= 1,
-	.dwFrameInterval[0]	= cpu_to_le32(5000000),
+	.dwFrameInterval[0]	= cpu_to_le32(UVCG_FRM_INTERV_0_720P),
 };
 
-static const struct uvc_color_matching_descriptor uvc_color_matching = {
-	.bLength		= UVC_DT_COLOR_MATCHING_SIZE,
-	.bDescriptorType	= USB_DT_CS_INTERFACE,
-	.bDescriptorSubType	= UVC_VS_COLORFORMAT,
-	.bColorPrimaries	= 1,
-	.bTransferCharacteristics	= 1,
-	.bMatrixCoefficients	= 4,
+static u32 uvcg_frame_mjpeg_720p_dw_frame_interval[] = {
+	[0] = UVCG_FRM_INTERV_0_720P,
+};
+
+static const struct uvcg_frame uvcg_frame_mjpeg_720p = {
+	.fmt_type		= UVCG_MJPEG,
+	.frame = {
+		.b_length			= UVC_DT_FRAME_MJPEG_SIZE(1),
+		.b_descriptor_type		= USB_DT_CS_INTERFACE,
+		.b_descriptor_subtype		= UVC_VS_FRAME_MJPEG,
+		.b_frame_index			= 2,
+		.bm_capabilities		= 0,
+		.w_width			= UVCG_WIDTH_720P,
+		.w_height			= UVCG_HEIGHT_720P,
+		.dw_min_bit_rate		= UVCG_MIN_BITRATE_720P,
+		.dw_max_bit_rate		= UVCG_MAX_BITRATE_720P,
+		.dw_max_video_frame_buffer_size	= UVCG_MAX_VIDEO_FB_SZ_720P,
+		.dw_default_frame_interval	= UVCG_DEFAULT_FRM_INTERV_720P,
+		.b_frame_interval_type		= 1,
+	},
+	.dw_frame_interval	= uvcg_frame_mjpeg_720p_dw_frame_interval,
+};
+
+static struct uvcg_frame_ptr uvcg_frame_ptr_mjpeg_720p = {
+	.frm = (struct uvcg_frame *)&uvcg_frame_mjpeg_720p,
+};
+
+static struct uvcg_streaming_header uvcg_streaming_header = {
 };
 
 static const struct uvc_descriptor_header * const uvc_fs_control_cls[] = {
@@ -290,40 +446,40 @@ static const struct uvc_descriptor_header * const uvc_ss_control_cls[] = {
 
 static const struct uvc_descriptor_header * const uvc_fs_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
 static const struct uvc_descriptor_header * const uvc_hs_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
 static const struct uvc_descriptor_header * const uvc_ss_streaming_cls[] = {
 	(const struct uvc_descriptor_header *) &uvc_input_header,
-	(const struct uvc_descriptor_header *) &uvc_format_yuv,
+	(const struct uvc_descriptor_header *) &uvcg_format_yuv.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_yuv_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
-	(const struct uvc_descriptor_header *) &uvc_format_mjpg,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
+	(const struct uvc_descriptor_header *) &uvcg_format_mjpeg.desc,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p,
 	(const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
-	(const struct uvc_descriptor_header *) &uvc_color_matching,
+	(const struct uvc_descriptor_header *) &uvcg_color_matching.desc,
 	NULL,
 };
 
@@ -387,6 +543,23 @@ webcam_bind(struct usb_composite_dev *cdev)
 	uvc_opts->hs_streaming = uvc_hs_streaming_cls;
 	uvc_opts->ss_streaming = uvc_ss_streaming_cls;
 
+	INIT_LIST_HEAD(&uvcg_format_yuv.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_yuv_360p.entry, &uvcg_format_yuv.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_yuv_720p.entry, &uvcg_format_yuv.fmt.frames);
+	uvcg_format_yuv.fmt.num_frames = 2;
+
+	INIT_LIST_HEAD(&uvcg_format_mjpeg.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_mjpeg_360p.entry, &uvcg_format_mjpeg.fmt.frames);
+	list_add_tail(&uvcg_frame_ptr_mjpeg_720p.entry, &uvcg_format_mjpeg.fmt.frames);
+	uvcg_format_mjpeg.fmt.num_frames = 2;
+
+	INIT_LIST_HEAD(&uvcg_streaming_header.formats);
+	list_add_tail(&uvcg_format_ptr_yuv.entry, &uvcg_streaming_header.formats);
+	list_add_tail(&uvcg_format_ptr_mjpeg.entry, &uvcg_streaming_header.formats);
+	uvcg_streaming_header.num_fmt = 2;
+
+	uvc_opts->header = &uvcg_streaming_header;
+
 	/* Allocate string descriptor numbers ... note that string contents
 	 * can be overridden by the composite_dev glue.
 	 */
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 499/583] iommu: Dont reserve 0-length IOVA region
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (497 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 498/583] usb: gadget: webcam: Make g_webcam loadable again Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 500/583] power: supply: Fix null pointer dereference in smb2_probe Greg Kroah-Hartman
                   ` (90 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ashish Mhetre, Robin Murphy,
	Joerg Roedel, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ashish Mhetre <amhetre@nvidia.com>

[ Upstream commit bb57f6705960bebeb832142ce9abf43220c3eab1 ]

When the bootloader/firmware doesn't setup the framebuffers, their
address and size are 0 in "iommu-addresses" property. If IOVA region is
reserved with 0 length, then it ends up corrupting the IOVA rbtree with
an entry which has pfn_hi < pfn_lo.
If we intend to use display driver in kernel without framebuffer then
it's causing the display IOMMU mappings to fail as entire valid IOVA
space is reserved when address and length are passed as 0.
An ideal solution would be firmware removing the "iommu-addresses"
property and corresponding "memory-region" if display is not present.
But the kernel should be able to handle this by checking for size of
IOVA region and skipping the IOVA reservation if size is 0. Also, add
a warning if firmware is requesting 0-length IOVA region reservation.

Fixes: a5bf3cfce8cb ("iommu: Implement of_iommu_get_resv_regions()")
Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/20231205065656.9544-1-amhetre@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/iommu/of_iommu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
index 47302b637cc0..42cffb0ee5e2 100644
--- a/drivers/iommu/of_iommu.c
+++ b/drivers/iommu/of_iommu.c
@@ -264,6 +264,10 @@ void of_iommu_get_resv_regions(struct device *dev, struct list_head *list)
 					prot |= IOMMU_CACHE;
 
 				maps = of_translate_dma_region(np, maps, &iova, &length);
+				if (length == 0) {
+					dev_warn(dev, "Cannot reserve IOVA region of 0 size\n");
+					continue;
+				}
 				type = iommu_resv_region_get_type(dev, &phys, iova, length);
 
 				region = iommu_alloc_resv_region(iova, length, prot, type,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 500/583] power: supply: Fix null pointer dereference in smb2_probe
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (498 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 499/583] iommu: Dont reserve 0-length IOVA region Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 501/583] vdpa: Fix an error handling path in eni_vdpa_probe() Greg Kroah-Hartman
                   ` (89 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kunwu Chan, Sebastian Reichel, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kunwu Chan <chentao@kylinos.cn>

[ Upstream commit 88f04bc3e737155e13caddf0ba8ed19db87f0212 ]

devm_kasprintf and devm_kzalloc return a pointer to dynamically
allocated memory which can be NULL upon failure.

Fixes: 8648aeb5d7b7 ("power: supply: add Qualcomm PMI8998 SMB2 Charger driver")
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Link: https://lore.kernel.org/r/20231124075021.1335289-1-chentao@kylinos.cn
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/power/supply/qcom_pmi8998_charger.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/power/supply/qcom_pmi8998_charger.c b/drivers/power/supply/qcom_pmi8998_charger.c
index 10f4dd0caca1..22c7c0e7c522 100644
--- a/drivers/power/supply/qcom_pmi8998_charger.c
+++ b/drivers/power/supply/qcom_pmi8998_charger.c
@@ -973,10 +973,14 @@ static int smb2_probe(struct platform_device *pdev)
 	supply_config.of_node = pdev->dev.of_node;
 
 	desc = devm_kzalloc(chip->dev, sizeof(smb2_psy_desc), GFP_KERNEL);
+	if (!desc)
+		return -ENOMEM;
 	memcpy(desc, &smb2_psy_desc, sizeof(smb2_psy_desc));
 	desc->name =
 		devm_kasprintf(chip->dev, GFP_KERNEL, "%s-charger",
 			       (const char *)device_get_match_data(chip->dev));
+	if (!desc->name)
+		return -ENOMEM;
 
 	chip->chg_psy =
 		devm_power_supply_register(chip->dev, desc, &supply_config);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 501/583] vdpa: Fix an error handling path in eni_vdpa_probe()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (499 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 500/583] power: supply: Fix null pointer dereference in smb2_probe Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 502/583] apparmor: Fix ref count leak in task_kill Greg Kroah-Hartman
                   ` (88 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christophe JAILLET,
	Michael S. Tsirkin, Jason Wang, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

[ Upstream commit c1b9f2c66eed3261db76cccd8a22a9affae8dcbf ]

After a successful vp_legacy_probe() call, vp_legacy_remove() should be
called in the error handling path, as already done in the remove function.

Add the missing call.

Fixes: e85087beedca ("eni_vdpa: add vDPA driver for Alibaba ENI")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Message-Id: <a7b0ef1eabd081f1c7c894e9b11de01678e85dee.1666293559.git.christophe.jaillet@wanadoo.fr>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vdpa/alibaba/eni_vdpa.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/vdpa/alibaba/eni_vdpa.c b/drivers/vdpa/alibaba/eni_vdpa.c
index 5a09a09cca70..cce3d1837104 100644
--- a/drivers/vdpa/alibaba/eni_vdpa.c
+++ b/drivers/vdpa/alibaba/eni_vdpa.c
@@ -497,7 +497,7 @@ static int eni_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	if (!eni_vdpa->vring) {
 		ret = -ENOMEM;
 		ENI_ERR(pdev, "failed to allocate virtqueues\n");
-		goto err;
+		goto err_remove_vp_legacy;
 	}
 
 	for (i = 0; i < eni_vdpa->queues; i++) {
@@ -509,11 +509,13 @@ static int eni_vdpa_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	ret = vdpa_register_device(&eni_vdpa->vdpa, eni_vdpa->queues);
 	if (ret) {
 		ENI_ERR(pdev, "failed to register to vdpa bus\n");
-		goto err;
+		goto err_remove_vp_legacy;
 	}
 
 	return 0;
 
+err_remove_vp_legacy:
+	vp_legacy_remove(&eni_vdpa->ldev);
 err:
 	put_device(&eni_vdpa->vdpa.dev);
 	return ret;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 502/583] apparmor: Fix ref count leak in task_kill
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (500 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 501/583] vdpa: Fix an error handling path in eni_vdpa_probe() Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 503/583] nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length Greg Kroah-Hartman
                   ` (87 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, John Johansen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: John Johansen <john.johansen@canonical.com>

[ Upstream commit 2cb54a19ac7153b9a26a72098c495187f64c2276 ]

apparmor_task_kill was not putting the task_cred reference tc, or the
cred_label reference tc when dealing with a passed in cred, fix this
by using a single fn exit.

Fixes: 90c436a64a6e ("apparmor: pass cred through to audit info.")
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 security/apparmor/lsm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index 6fdab1b5ede5..366cdfd6a7ba 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -839,7 +839,6 @@ static int apparmor_task_kill(struct task_struct *target, struct kernel_siginfo
 		cl = aa_get_newest_cred_label(cred);
 		error = aa_may_signal(cred, cl, tc, tl, sig);
 		aa_put_label(cl);
-		return error;
 	} else {
 		cl = __begin_current_label_crit_section();
 		error = aa_may_signal(current_cred(), cl, tc, tl, sig);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 503/583] nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (501 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 502/583] apparmor: Fix ref count leak in task_kill Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 504/583] nvmet-tcp: fix a crash in nvmet_req_complete() Greg Kroah-Hartman
                   ` (86 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Maurizio Lombardi, Sagi Grimberg,
	Keith Busch, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Maurizio Lombardi <mlombard@redhat.com>

[ Upstream commit efa56305908ba20de2104f1b8508c6a7401833be ]

If the host sends an H2CData command with an invalid DATAL,
the kernel may crash in nvmet_tcp_build_pdu_iovec().

Unable to handle kernel NULL pointer dereference at
virtual address 0000000000000000
lr : nvmet_tcp_io_work+0x6ac/0x718 [nvmet_tcp]
Call trace:
  process_one_work+0x174/0x3c8
  worker_thread+0x2d0/0x3e8
  kthread+0x104/0x110

Fix the bug by raising a fatal error if DATAL isn't coherent
with the packet size.
Also, the PDU length should never exceed the MAXH2CDATA parameter which
has been communicated to the host in nvmet_tcp_handle_icreq().

Fixes: 872d26a391da ("nvmet-tcp: add NVMe over TCP target driver")
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/target/tcp.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index 197fc2ecb164..3d171061cc0f 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -19,6 +19,7 @@
 #include "nvmet.h"
 
 #define NVMET_TCP_DEF_INLINE_DATA_SIZE	(4 * PAGE_SIZE)
+#define NVMET_TCP_MAXH2CDATA		0x400000 /* 16M arbitrary limit */
 
 static int param_store_val(const char *str, int *val, int min, int max)
 {
@@ -900,7 +901,7 @@ static int nvmet_tcp_handle_icreq(struct nvmet_tcp_queue *queue)
 	icresp->hdr.pdo = 0;
 	icresp->hdr.plen = cpu_to_le32(icresp->hdr.hlen);
 	icresp->pfv = cpu_to_le16(NVME_TCP_PFV_1_0);
-	icresp->maxdata = cpu_to_le32(0x400000); /* 16M arbitrary limit */
+	icresp->maxdata = cpu_to_le32(NVMET_TCP_MAXH2CDATA);
 	icresp->cpda = 0;
 	if (queue->hdr_digest)
 		icresp->digest |= NVME_TCP_HDR_DIGEST_ENABLE;
@@ -953,6 +954,7 @@ static int nvmet_tcp_handle_h2c_data_pdu(struct nvmet_tcp_queue *queue)
 {
 	struct nvme_tcp_data_pdu *data = &queue->pdu.data;
 	struct nvmet_tcp_cmd *cmd;
+	unsigned int plen;
 
 	if (likely(queue->nr_cmds)) {
 		if (unlikely(data->ttag >= queue->nr_cmds)) {
@@ -976,7 +978,16 @@ static int nvmet_tcp_handle_h2c_data_pdu(struct nvmet_tcp_queue *queue)
 		return -EPROTO;
 	}
 
+	plen = le32_to_cpu(data->hdr.plen);
 	cmd->pdu_len = le32_to_cpu(data->data_length);
+	if (unlikely(cmd->pdu_len != (plen - sizeof(*data)) ||
+		     cmd->pdu_len == 0 ||
+		     cmd->pdu_len > NVMET_TCP_MAXH2CDATA)) {
+		pr_err("H2CData PDU len %u is invalid\n", cmd->pdu_len);
+		/* FIXME: use proper transport errors */
+		nvmet_tcp_fatal_error(queue);
+		return -EPROTO;
+	}
 	cmd->pdu_recv = 0;
 	nvmet_tcp_build_pdu_iovec(cmd);
 	queue->cmd = cmd;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 504/583] nvmet-tcp: fix a crash in nvmet_req_complete()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (502 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 503/583] nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 505/583] perf env: Avoid recursively taking env->bpf_progs.lock Greg Kroah-Hartman
                   ` (85 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sagi Grimberg, Maurizio Lombardi,
	Keith Busch, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Maurizio Lombardi <mlombard@redhat.com>

[ Upstream commit 0849a5441358cef02586fb2d60f707c0db195628 ]

in nvmet_tcp_handle_h2c_data_pdu(), if the host sends a data_offset
different from rbytes_done, the driver ends up calling nvmet_req_complete()
passing a status error.
The problem is that at this point cmd->req is not yet initialized,
the kernel will crash after dereferencing a NULL pointer.

Fix the bug by replacing the call to nvmet_req_complete() with
nvmet_tcp_fatal_error().

Fixes: 872d26a391da ("nvmet-tcp: add NVMe over TCP target driver")
Reviewed-by: Keith Busch <kbsuch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/target/tcp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index 3d171061cc0f..7f7fa78f0698 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -973,8 +973,7 @@ static int nvmet_tcp_handle_h2c_data_pdu(struct nvmet_tcp_queue *queue)
 			data->ttag, le32_to_cpu(data->data_offset),
 			cmd->rbytes_done);
 		/* FIXME: use path and transport errors */
-		nvmet_req_complete(&cmd->req,
-			NVME_SC_INVALID_FIELD | NVME_SC_DNR);
+		nvmet_tcp_fatal_error(queue);
 		return -EPROTO;
 	}
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 505/583] perf env: Avoid recursively taking env->bpf_progs.lock
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (503 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 504/583] nvmet-tcp: fix a crash in nvmet_req_complete() Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 506/583] perf stat: Fix hard coded LL miss units Greg Kroah-Hartman
                   ` (84 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ian Rogers, Jiri Olsa, Song Liu,
	Adrian Hunter, Alexander Shishkin, Huacai Chen, Ingo Molnar,
	K Prateek Nayak, Kan Liang, Mark Rutland, Ming Wang,
	Namhyung Kim, Peter Zijlstra, Ravi Bangoria,
	Arnaldo Carvalho de Melo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ian Rogers <irogers@google.com>

[ Upstream commit 9c51f8788b5d4e9f46afbcf563255cfd355690b3 ]

Add variants of perf_env__insert_bpf_prog_info(), perf_env__insert_btf()
and perf_env__find_btf prefixed with __ to indicate the
env->bpf_progs.lock is assumed held.

Call these variants when the lock is held to avoid recursively taking it
and potentially having a thread deadlock with itself.

Fixes: f8dfeae009effc0b ("perf bpf: Show more BPF program info in print_bpf_prog_info()")
Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Song Liu <song@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ming Wang <wangming01@loongson.cn>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Link: https://lore.kernel.org/r/20231207014655.1252484-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/perf/util/bpf-event.c |  8 +++---
 tools/perf/util/bpf-event.h | 12 ++++-----
 tools/perf/util/env.c       | 50 ++++++++++++++++++++++++-------------
 tools/perf/util/env.h       |  4 +++
 tools/perf/util/header.c    |  8 +++---
 5 files changed, 50 insertions(+), 32 deletions(-)

diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c
index 38fcf3ba5749..b00b5a2634c3 100644
--- a/tools/perf/util/bpf-event.c
+++ b/tools/perf/util/bpf-event.c
@@ -542,9 +542,9 @@ int evlist__add_bpf_sb_event(struct evlist *evlist, struct perf_env *env)
 	return evlist__add_sb_event(evlist, &attr, bpf_event__sb_cb, env);
 }
 
-void bpf_event__print_bpf_prog_info(struct bpf_prog_info *info,
-				    struct perf_env *env,
-				    FILE *fp)
+void __bpf_event__print_bpf_prog_info(struct bpf_prog_info *info,
+				      struct perf_env *env,
+				      FILE *fp)
 {
 	__u32 *prog_lens = (__u32 *)(uintptr_t)(info->jited_func_lens);
 	__u64 *prog_addrs = (__u64 *)(uintptr_t)(info->jited_ksyms);
@@ -560,7 +560,7 @@ void bpf_event__print_bpf_prog_info(struct bpf_prog_info *info,
 	if (info->btf_id) {
 		struct btf_node *node;
 
-		node = perf_env__find_btf(env, info->btf_id);
+		node = __perf_env__find_btf(env, info->btf_id);
 		if (node)
 			btf = btf__new((__u8 *)(node->data),
 				       node->data_size);
diff --git a/tools/perf/util/bpf-event.h b/tools/perf/util/bpf-event.h
index 1bcbd4fb6c66..e2f0420905f5 100644
--- a/tools/perf/util/bpf-event.h
+++ b/tools/perf/util/bpf-event.h
@@ -33,9 +33,9 @@ struct btf_node {
 int machine__process_bpf(struct machine *machine, union perf_event *event,
 			 struct perf_sample *sample);
 int evlist__add_bpf_sb_event(struct evlist *evlist, struct perf_env *env);
-void bpf_event__print_bpf_prog_info(struct bpf_prog_info *info,
-				    struct perf_env *env,
-				    FILE *fp);
+void __bpf_event__print_bpf_prog_info(struct bpf_prog_info *info,
+				      struct perf_env *env,
+				      FILE *fp);
 #else
 static inline int machine__process_bpf(struct machine *machine __maybe_unused,
 				       union perf_event *event __maybe_unused,
@@ -50,9 +50,9 @@ static inline int evlist__add_bpf_sb_event(struct evlist *evlist __maybe_unused,
 	return 0;
 }
 
-static inline void bpf_event__print_bpf_prog_info(struct bpf_prog_info *info __maybe_unused,
-						  struct perf_env *env __maybe_unused,
-						  FILE *fp __maybe_unused)
+static inline void __bpf_event__print_bpf_prog_info(struct bpf_prog_info *info __maybe_unused,
+						    struct perf_env *env __maybe_unused,
+						    FILE *fp __maybe_unused)
 {
 
 }
diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
index a164164001fb..d2c7b6e6eae5 100644
--- a/tools/perf/util/env.c
+++ b/tools/perf/util/env.c
@@ -22,13 +22,19 @@ struct perf_env perf_env;
 
 void perf_env__insert_bpf_prog_info(struct perf_env *env,
 				    struct bpf_prog_info_node *info_node)
+{
+	down_write(&env->bpf_progs.lock);
+	__perf_env__insert_bpf_prog_info(env, info_node);
+	up_write(&env->bpf_progs.lock);
+}
+
+void __perf_env__insert_bpf_prog_info(struct perf_env *env, struct bpf_prog_info_node *info_node)
 {
 	__u32 prog_id = info_node->info_linear->info.id;
 	struct bpf_prog_info_node *node;
 	struct rb_node *parent = NULL;
 	struct rb_node **p;
 
-	down_write(&env->bpf_progs.lock);
 	p = &env->bpf_progs.infos.rb_node;
 
 	while (*p != NULL) {
@@ -40,15 +46,13 @@ void perf_env__insert_bpf_prog_info(struct perf_env *env,
 			p = &(*p)->rb_right;
 		} else {
 			pr_debug("duplicated bpf prog info %u\n", prog_id);
-			goto out;
+			return;
 		}
 	}
 
 	rb_link_node(&info_node->rb_node, parent, p);
 	rb_insert_color(&info_node->rb_node, &env->bpf_progs.infos);
 	env->bpf_progs.infos_cnt++;
-out:
-	up_write(&env->bpf_progs.lock);
 }
 
 struct bpf_prog_info_node *perf_env__find_bpf_prog_info(struct perf_env *env,
@@ -77,14 +81,22 @@ struct bpf_prog_info_node *perf_env__find_bpf_prog_info(struct perf_env *env,
 }
 
 bool perf_env__insert_btf(struct perf_env *env, struct btf_node *btf_node)
+{
+	bool ret;
+
+	down_write(&env->bpf_progs.lock);
+	ret = __perf_env__insert_btf(env, btf_node);
+	up_write(&env->bpf_progs.lock);
+	return ret;
+}
+
+bool __perf_env__insert_btf(struct perf_env *env, struct btf_node *btf_node)
 {
 	struct rb_node *parent = NULL;
 	__u32 btf_id = btf_node->id;
 	struct btf_node *node;
 	struct rb_node **p;
-	bool ret = true;
 
-	down_write(&env->bpf_progs.lock);
 	p = &env->bpf_progs.btfs.rb_node;
 
 	while (*p != NULL) {
@@ -96,25 +108,31 @@ bool perf_env__insert_btf(struct perf_env *env, struct btf_node *btf_node)
 			p = &(*p)->rb_right;
 		} else {
 			pr_debug("duplicated btf %u\n", btf_id);
-			ret = false;
-			goto out;
+			return false;
 		}
 	}
 
 	rb_link_node(&btf_node->rb_node, parent, p);
 	rb_insert_color(&btf_node->rb_node, &env->bpf_progs.btfs);
 	env->bpf_progs.btfs_cnt++;
-out:
-	up_write(&env->bpf_progs.lock);
-	return ret;
+	return true;
 }
 
 struct btf_node *perf_env__find_btf(struct perf_env *env, __u32 btf_id)
+{
+	struct btf_node *res;
+
+	down_read(&env->bpf_progs.lock);
+	res = __perf_env__find_btf(env, btf_id);
+	up_read(&env->bpf_progs.lock);
+	return res;
+}
+
+struct btf_node *__perf_env__find_btf(struct perf_env *env, __u32 btf_id)
 {
 	struct btf_node *node = NULL;
 	struct rb_node *n;
 
-	down_read(&env->bpf_progs.lock);
 	n = env->bpf_progs.btfs.rb_node;
 
 	while (n) {
@@ -124,13 +142,9 @@ struct btf_node *perf_env__find_btf(struct perf_env *env, __u32 btf_id)
 		else if (btf_id > node->id)
 			n = n->rb_right;
 		else
-			goto out;
+			return node;
 	}
-	node = NULL;
-
-out:
-	up_read(&env->bpf_progs.lock);
-	return node;
+	return NULL;
 }
 
 /* purge data in bpf_progs.infos tree */
diff --git a/tools/perf/util/env.h b/tools/perf/util/env.h
index 4566c51f2fd9..359eff51cb85 100644
--- a/tools/perf/util/env.h
+++ b/tools/perf/util/env.h
@@ -164,12 +164,16 @@ const char *perf_env__raw_arch(struct perf_env *env);
 int perf_env__nr_cpus_avail(struct perf_env *env);
 
 void perf_env__init(struct perf_env *env);
+void __perf_env__insert_bpf_prog_info(struct perf_env *env,
+				      struct bpf_prog_info_node *info_node);
 void perf_env__insert_bpf_prog_info(struct perf_env *env,
 				    struct bpf_prog_info_node *info_node);
 struct bpf_prog_info_node *perf_env__find_bpf_prog_info(struct perf_env *env,
 							__u32 prog_id);
 bool perf_env__insert_btf(struct perf_env *env, struct btf_node *btf_node);
+bool __perf_env__insert_btf(struct perf_env *env, struct btf_node *btf_node);
 struct btf_node *perf_env__find_btf(struct perf_env *env, __u32 btf_id);
+struct btf_node *__perf_env__find_btf(struct perf_env *env, __u32 btf_id);
 
 int perf_env__numa_node(struct perf_env *env, struct perf_cpu cpu);
 char *perf_env__find_pmu_cap(struct perf_env *env, const char *pmu_name,
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index f6035c219b41..1482567e5ac1 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1849,8 +1849,8 @@ static void print_bpf_prog_info(struct feat_fd *ff, FILE *fp)
 		node = rb_entry(next, struct bpf_prog_info_node, rb_node);
 		next = rb_next(&node->rb_node);
 
-		bpf_event__print_bpf_prog_info(&node->info_linear->info,
-					       env, fp);
+		__bpf_event__print_bpf_prog_info(&node->info_linear->info,
+						 env, fp);
 	}
 
 	up_read(&env->bpf_progs.lock);
@@ -3177,7 +3177,7 @@ static int process_bpf_prog_info(struct feat_fd *ff, void *data __maybe_unused)
 		/* after reading from file, translate offset to address */
 		bpil_offs_to_addr(info_linear);
 		info_node->info_linear = info_linear;
-		perf_env__insert_bpf_prog_info(env, info_node);
+		__perf_env__insert_bpf_prog_info(env, info_node);
 	}
 
 	up_write(&env->bpf_progs.lock);
@@ -3224,7 +3224,7 @@ static int process_bpf_btf(struct feat_fd *ff, void *data __maybe_unused)
 		if (__do_read(ff, node->data, data_size))
 			goto out;
 
-		perf_env__insert_btf(env, node);
+		__perf_env__insert_btf(env, node);
 		node = NULL;
 	}
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 506/583] perf stat: Fix hard coded LL miss units
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (504 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 505/583] perf env: Avoid recursively taking env->bpf_progs.lock Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 507/583] cxl/region: fix x9 interleave typo Greg Kroah-Hartman
                   ` (83 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Guillaume Endignoux, Kan Liang,
	Ian Rogers, Adrian Hunter, Alexander Shishkin, Ingo Molnar,
	Jiri Olsa, John Garry, Mark Rutland, Namhyung Kim,
	Peter Zijlstra, Arnaldo Carvalho de Melo, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ian Rogers <irogers@google.com>

[ Upstream commit f2567e12a090f0eb22553a4468d4c4fe04aad906 ]

Copy-paste error where LL cache misses are reported as l1i.

Fixes: 0a57b910807ad163 ("perf stat: Use counts rather than saved_value")
Suggested-by: Guillaume Endignoux <guillaumee@google.com>
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20231211181242.1721059-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/perf/util/stat-shadow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
index 1c5c3eeba4cf..e31426167852 100644
--- a/tools/perf/util/stat-shadow.c
+++ b/tools/perf/util/stat-shadow.c
@@ -264,7 +264,7 @@ static void print_ll_miss(struct perf_stat_config *config,
 	static const double color_ratios[3] = {20.0, 10.0, 5.0};
 
 	print_ratio(config, evsel, aggr_idx, misses, out, STAT_LL_CACHE, color_ratios,
-		    "of all L1-icache accesses");
+		    "of all LL-cache accesses");
 }
 
 static void print_dtlb_miss(struct perf_stat_config *config,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 507/583] cxl/region: fix x9 interleave typo
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (505 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 506/583] perf stat: Fix hard coded LL miss units Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 508/583] apparmor: fix possible memory leak in unpack_trans_table Greg Kroah-Hartman
                   ` (82 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jim Harris, Dave Jiang, Fan Ni,
	Dan Williams, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jim Harris <jim.harris@samsung.com>

[ Upstream commit c7ad3dc3649730af483ee1e78be5d0362da25bfe ]

CXL supports x3, x6 and x12 - not x9.

Fixes: 80d10a6cee050 ("cxl/region: Add interleave geometry attributes")
Signed-off-by: Jim Harris <jim.harris@samsung.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
Link: https://lore.kernel.org/r/169904271254.204936.8580772404462743630.stgit@ubuntu
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/cxl/core/region.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
index e7206367ec66..472bd510b5e2 100644
--- a/drivers/cxl/core/region.c
+++ b/drivers/cxl/core/region.c
@@ -397,7 +397,7 @@ static ssize_t interleave_ways_store(struct device *dev,
 		return rc;
 
 	/*
-	 * Even for x3, x9, and x12 interleaves the region interleave must be a
+	 * Even for x3, x6, and x12 interleaves the region interleave must be a
 	 * power of 2 multiple of the host bridge interleave.
 	 */
 	if (!is_power_of_2(val / cxld->interleave_ways) ||
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 508/583] apparmor: fix possible memory leak in unpack_trans_table
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (506 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 507/583] cxl/region: fix x9 interleave typo Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 509/583] apparmor: avoid crash when parsed profile name is empty Greg Kroah-Hartman
                   ` (81 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Fedor Pchelkin, John Johansen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Fedor Pchelkin <pchelkin@ispras.ru>

[ Upstream commit 1342ad786073e96fa813ad943c19f586157ae297 ]

If we fail to unpack the transition table then the table elements which
have been already allocated are not freed on error path.

unreferenced object 0xffff88802539e000 (size 128):
  comm "apparmor_parser", pid 903, jiffies 4294914938 (age 35.085s)
  hex dump (first 32 bytes):
    20 73 6f 6d 65 20 6e 61 73 74 79 20 73 74 72 69   some nasty stri
    6e 67 20 73 6f 6d 65 20 6e 61 73 74 79 20 73 74  ng some nasty st
  backtrace:
    [<ffffffff81ddb312>] __kmem_cache_alloc_node+0x1e2/0x2d0
    [<ffffffff81c47194>] __kmalloc_node_track_caller+0x54/0x170
    [<ffffffff81c225b9>] kmemdup+0x29/0x60
    [<ffffffff83e1ee65>] aa_unpack_strdup+0xe5/0x1b0
    [<ffffffff83e20808>] unpack_pdb+0xeb8/0x2700
    [<ffffffff83e23567>] unpack_profile+0x1507/0x4a30
    [<ffffffff83e27bfa>] aa_unpack+0x36a/0x1560
    [<ffffffff83e194c3>] aa_replace_profiles+0x213/0x33c0
    [<ffffffff83de9461>] policy_update+0x261/0x370
    [<ffffffff83de978e>] profile_replace+0x20e/0x2a0
    [<ffffffff81eac8bf>] vfs_write+0x2af/0xe00
    [<ffffffff81eaddd6>] ksys_write+0x126/0x250
    [<ffffffff88f34fb6>] do_syscall_64+0x46/0xf0
    [<ffffffff890000ea>] entry_SYSCALL_64_after_hwframe+0x6e/0x76

Call aa_free_str_table() on error path as was done before the blamed
commit. It implements all necessary checks, frees str_table if it is
available and nullifies the pointers.

Found by Linux Verification Center (linuxtesting.org).

Fixes: a0792e2ceddc ("apparmor: make transition table unpack generic so it can be reused")
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 security/apparmor/lib.c           | 1 +
 security/apparmor/policy_unpack.c | 7 +++----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/security/apparmor/lib.c b/security/apparmor/lib.c
index c87bccafff44..7182a8b821fb 100644
--- a/security/apparmor/lib.c
+++ b/security/apparmor/lib.c
@@ -41,6 +41,7 @@ void aa_free_str_table(struct aa_str_table *t)
 			kfree_sensitive(t->table[i]);
 		kfree_sensitive(t->table);
 		t->table = NULL;
+		t->size = 0;
 	}
 }
 
diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index dbc83455d900..a904bca24026 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -478,6 +478,8 @@ static bool unpack_trans_table(struct aa_ext *e, struct aa_str_table *strs)
 		if (!table)
 			goto fail;
 
+		strs->table = table;
+		strs->size = size;
 		for (i = 0; i < size; i++) {
 			char *str;
 			int c, j, pos, size2 = aa_unpack_strdup(e, &str, NULL);
@@ -520,14 +522,11 @@ static bool unpack_trans_table(struct aa_ext *e, struct aa_str_table *strs)
 			goto fail;
 		if (!aa_unpack_nameX(e, AA_STRUCTEND, NULL))
 			goto fail;
-
-		strs->table = table;
-		strs->size = size;
 	}
 	return true;
 
 fail:
-	kfree_sensitive(table);
+	aa_free_str_table(strs);
 	e->pos = saved_pos;
 	return false;
 }
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 509/583] apparmor: avoid crash when parsed profile name is empty
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (507 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 508/583] apparmor: fix possible memory leak in unpack_trans_table Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 510/583] usb: xhci-mtk: fix a short packet issue of gen1 isoc-in transfer Greg Kroah-Hartman
                   ` (80 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Fedor Pchelkin, John Johansen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Fedor Pchelkin <pchelkin@ispras.ru>

[ Upstream commit 55a8210c9e7d21ff2644809699765796d4bfb200 ]

When processing a packed profile in unpack_profile() described like

 "profile :ns::samba-dcerpcd /usr/lib*/samba/{,samba/}samba-dcerpcd {...}"

a string ":samba-dcerpcd" is unpacked as a fully-qualified name and then
passed to aa_splitn_fqname().

aa_splitn_fqname() treats ":samba-dcerpcd" as only containing a namespace.
Thus it returns NULL for tmpname, meanwhile tmpns is non-NULL. Later
aa_alloc_profile() crashes as the new profile name is NULL now.

general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 6 PID: 1657 Comm: apparmor_parser Not tainted 6.7.0-rc2-dirty #16
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014
RIP: 0010:strlen+0x1e/0xa0
Call Trace:
 <TASK>
 ? strlen+0x1e/0xa0
 aa_policy_init+0x1bb/0x230
 aa_alloc_profile+0xb1/0x480
 unpack_profile+0x3bc/0x4960
 aa_unpack+0x309/0x15e0
 aa_replace_profiles+0x213/0x33c0
 policy_update+0x261/0x370
 profile_replace+0x20e/0x2a0
 vfs_write+0x2af/0xe00
 ksys_write+0x126/0x250
 do_syscall_64+0x46/0xf0
 entry_SYSCALL_64_after_hwframe+0x6e/0x76
 </TASK>
---[ end trace 0000000000000000 ]---
RIP: 0010:strlen+0x1e/0xa0

It seems such behaviour of aa_splitn_fqname() is expected and checked in
other places where it is called (e.g. aa_remove_profiles). Well, there
is an explicit comment "a ns name without a following profile is allowed"
inside.

AFAICS, nothing can prevent unpacked "name" to be in form like
":samba-dcerpcd" - it is passed from userspace.

Deny the whole profile set replacement in such case and inform user with
EPROTO and an explaining message.

Found by Linux Verification Center (linuxtesting.org).

Fixes: 04dc715e24d0 ("apparmor: audit policy ns specified in policy load")
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 security/apparmor/policy_unpack.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index a904bca24026..d92788da6704 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -825,6 +825,10 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name)
 
 	tmpname = aa_splitn_fqname(name, strlen(name), &tmpns, &ns_len);
 	if (tmpns) {
+		if (!tmpname) {
+			info = "empty profile name";
+			goto fail;
+		}
 		*ns_name = kstrndup(tmpns, ns_len, GFP_KERNEL);
 		if (!*ns_name) {
 			info = "out of memory";
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 510/583] usb: xhci-mtk: fix a short packet issue of gen1 isoc-in transfer
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (508 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 509/583] apparmor: avoid crash when parsed profile name is empty Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 511/583] serial: imx: Correct clock error message in function probe() Greg Kroah-Hartman
                   ` (79 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, AngeloGioacchino Del Regno,
	Chunfeng Yun, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Chunfeng Yun <chunfeng.yun@mediatek.com>

[ Upstream commit 017dbfc05c31284150819890b4cc86a699cbdb71 ]

For Gen1 isoc-in transfer, host still send out unexpected ACK after device
finish the burst with a short packet, this will cause an exception on the
connected device, such as, a usb 4k camera.
It can be fixed by setting rxfifo depth less than 4k bytes, prefer to use
3k here, the side-effect is that may cause performance drop about 10%,
including bulk transfer.

Fixes: 926d60ae64a6 ("usb: xhci-mtk: modify the SOF/ITP interval for mt8195")
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20240104061640.7335-2-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/usb/host/xhci-mtk.c | 40 +++++++++++++++++++++++++++++++++++--
 drivers/usb/host/xhci-mtk.h |  2 ++
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index bbdf1b0b7be1..3252e3d2d79c 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -7,6 +7,7 @@
  *  Chunfeng Yun <chunfeng.yun@mediatek.com>
  */
 
+#include <linux/bitfield.h>
 #include <linux/dma-mapping.h>
 #include <linux/iopoll.h>
 #include <linux/kernel.h>
@@ -73,6 +74,9 @@
 #define FRMCNT_LEV1_RANG	(0x12b << 8)
 #define FRMCNT_LEV1_RANG_MASK	GENMASK(19, 8)
 
+#define HSCH_CFG1		0x960
+#define SCH3_RXFIFO_DEPTH_MASK	GENMASK(21, 20)
+
 #define SS_GEN2_EOF_CFG		0x990
 #define SSG2EOF_OFFSET		0x3c
 
@@ -114,6 +118,8 @@
 #define SSC_IP_SLEEP_EN	BIT(4)
 #define SSC_SPM_INT_EN		BIT(1)
 
+#define SCH_FIFO_TO_KB(x)	((x) >> 10)
+
 enum ssusb_uwk_vers {
 	SSUSB_UWK_V1 = 1,
 	SSUSB_UWK_V2,
@@ -165,6 +171,35 @@ static void xhci_mtk_set_frame_interval(struct xhci_hcd_mtk *mtk)
 	writel(value, hcd->regs + SS_GEN2_EOF_CFG);
 }
 
+/*
+ * workaround: usb3.2 gen1 isoc rx hw issue
+ * host send out unexpected ACK afer device fininsh a burst transfer with
+ * a short packet.
+ */
+static void xhci_mtk_rxfifo_depth_set(struct xhci_hcd_mtk *mtk)
+{
+	struct usb_hcd *hcd = mtk->hcd;
+	u32 value;
+
+	if (!mtk->rxfifo_depth)
+		return;
+
+	value = readl(hcd->regs + HSCH_CFG1);
+	value &= ~SCH3_RXFIFO_DEPTH_MASK;
+	value |= FIELD_PREP(SCH3_RXFIFO_DEPTH_MASK,
+			    SCH_FIFO_TO_KB(mtk->rxfifo_depth) - 1);
+	writel(value, hcd->regs + HSCH_CFG1);
+}
+
+static void xhci_mtk_init_quirk(struct xhci_hcd_mtk *mtk)
+{
+	/* workaround only for mt8195 */
+	xhci_mtk_set_frame_interval(mtk);
+
+	/* workaround for SoCs using SSUSB about before IPM v1.6.0 */
+	xhci_mtk_rxfifo_depth_set(mtk);
+}
+
 static int xhci_mtk_host_enable(struct xhci_hcd_mtk *mtk)
 {
 	struct mu3c_ippc_regs __iomem *ippc = mtk->ippc_regs;
@@ -448,8 +483,7 @@ static int xhci_mtk_setup(struct usb_hcd *hcd)
 		if (ret)
 			return ret;
 
-		/* workaround only for mt8195 */
-		xhci_mtk_set_frame_interval(mtk);
+		xhci_mtk_init_quirk(mtk);
 	}
 
 	ret = xhci_gen_setup(hcd, xhci_mtk_quirks);
@@ -527,6 +561,8 @@ static int xhci_mtk_probe(struct platform_device *pdev)
 	of_property_read_u32(node, "mediatek,u2p-dis-msk",
 			     &mtk->u2p_dis_msk);
 
+	of_property_read_u32(node, "rx-fifo-depth", &mtk->rxfifo_depth);
+
 	ret = usb_wakeup_of_property_parse(mtk, node);
 	if (ret) {
 		dev_err(dev, "failed to parse uwk property\n");
diff --git a/drivers/usb/host/xhci-mtk.h b/drivers/usb/host/xhci-mtk.h
index faaaf05e36ce..ac042077db8c 100644
--- a/drivers/usb/host/xhci-mtk.h
+++ b/drivers/usb/host/xhci-mtk.h
@@ -160,6 +160,8 @@ struct xhci_hcd_mtk {
 	struct regmap *uwk;
 	u32 uwk_reg_base;
 	u32 uwk_vers;
+	/* quirk */
+	u32 rxfifo_depth;
 };
 
 static inline struct xhci_hcd_mtk *hcd_to_mtk(struct usb_hcd *hcd)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 511/583] serial: imx: Correct clock error message in function probe()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (509 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 510/583] usb: xhci-mtk: fix a short packet issue of gen1 isoc-in transfer Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 512/583] serial: apbuart: fix console prompt on qemu Greg Kroah-Hartman
                   ` (78 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christoph Niedermaier,
	Uwe Kleine-König, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christoph Niedermaier <cniedermaier@dh-electronics.com>

[ Upstream commit 3e189470cad27d41a3a9dc02649f965b7ed1c90f ]

Correct the clock error message by changing the clock name.

Fixes: 1e512d45332b ("serial: imx: add error messages when .probe fails")
Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231224093209.2612-1-cniedermaier@dh-electronics.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/tty/serial/imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index c084ac3bb441..cd36251ba1c0 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2323,7 +2323,7 @@ static int imx_uart_probe(struct platform_device *pdev)
 	/* For register access, we only need to enable the ipg clock. */
 	ret = clk_prepare_enable(sport->clk_ipg);
 	if (ret) {
-		dev_err(&pdev->dev, "failed to enable per clk: %d\n", ret);
+		dev_err(&pdev->dev, "failed to enable ipg clk: %d\n", ret);
 		return ret;
 	}
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 512/583] serial: apbuart: fix console prompt on qemu
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (510 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 511/583] serial: imx: Correct clock error message in function probe() Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 513/583] perf db-export: Fix missing reference count get in call_path_from_sample() Greg Kroah-Hartman
                   ` (77 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sam Ravnborg, Andreas Larsson,
	Jiri Slaby, linux-serial, sparclinux, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sam Ravnborg <sam@ravnborg.org>

[ Upstream commit c6dcd8050fb7c2efec6946ae9c49bc186b0a7475 ]

When using a leon kernel with qemu there where no console prompt.
The root cause is the handling of the fifo size in the tx part of the
apbuart driver.

The qemu uart driver only have a very rudimentary status handling and do
not report the number of chars queued in the tx fifo in the status register.
So the driver ends up with a fifo size of 1.

In the tx path the fifo size is divided by 2 - resulting in a fifo
size of zero.

The original implementation would always try to send one char, but
after the introduction of uart_port_tx_limited() the fifo size is
respected even for the first char.

There seems to be no good reason to divide the fifo size with two - so
remove this. It looks like something copied from the original amba driver.

With qemu we now have a minimum fifo size of one char, so we show
the prompt.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Fixes: d11cc8c3c4b6 ("tty: serial: use uart_port_tx_limited()")
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc:  <linux-serial@vger.kernel.org>
Cc:  <sparclinux@vger.kernel.org>
Link: https://lore.kernel.org/r/20231226121607.GA2622970@ravnborg.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/tty/serial/apbuart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c
index d7658f380838..d3cb341f2c55 100644
--- a/drivers/tty/serial/apbuart.c
+++ b/drivers/tty/serial/apbuart.c
@@ -122,7 +122,7 @@ static void apbuart_tx_chars(struct uart_port *port)
 {
 	u8 ch;
 
-	uart_port_tx_limited(port, ch, port->fifosize >> 1,
+	uart_port_tx_limited(port, ch, port->fifosize,
 		true,
 		UART_PUT_CHAR(port, ch),
 		({}));
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 513/583] perf db-export: Fix missing reference count get in call_path_from_sample()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (511 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 512/583] serial: apbuart: fix console prompt on qemu Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 514/583] cxl/port: Fix missing target list lock Greg Kroah-Hartman
                   ` (76 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ben Gainey,
	Arnaldo Carvalho de Melo, Ian Rogers, Adrian Hunter,
	Alexander Shishkin, Ingo Molnar, Jiri Olsa, Mark Rutland,
	Namhyung Kim, Peter Zijlstra, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ben Gainey <ben.gainey@arm.com>

[ Upstream commit 1e24ce402c97dc3c0ab050593f1d5f6fde524564 ]

The addr_location map and maps fields in the inner loop were missing
calls to map__get()/maps__get(). The subsequent addr_location__exit()
call in each loop puts the map/maps fields causing use-after-free
aborts.

This issue reproduces on at least arm64 and x86_64 with something
simple like `perf record -g ls` followed by `perf script -s script.py`
with the following script:

    perf_db_export_mode = True
    perf_db_export_calls = False
    perf_db_export_callchains = True

    def sample_table(*args):
        print(f'sample_table({args})')

    def call_path_table(*args):
        print(f'call_path_table({args}')

Committer testing:

This test, just introduced by Ian Rogers, now passes, not segfaulting
anymore:

  # perf test "perf script tests"
   95: perf script tests                                               : Ok
  #

Fixes: 0dd5041c9a0eaf8c ("perf addr_location: Add init/exit/copy functions")
Signed-off-by: Ben Gainey <ben.gainey@arm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20231207140911.3240408-1-ben.gainey@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/perf/util/db-export.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/db-export.c b/tools/perf/util/db-export.c
index b9fb71ab7a73..106429155c2e 100644
--- a/tools/perf/util/db-export.c
+++ b/tools/perf/util/db-export.c
@@ -253,8 +253,8 @@ static struct call_path *call_path_from_sample(struct db_export *dbe,
 		 */
 		addr_location__init(&al);
 		al.sym = node->ms.sym;
-		al.map = node->ms.map;
-		al.maps = thread__maps(thread);
+		al.map = map__get(node->ms.map);
+		al.maps = maps__get(thread__maps(thread));
 		al.addr = node->ip;
 
 		if (al.map && !al.sym)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 514/583] cxl/port: Fix missing target list lock
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (512 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 513/583] perf db-export: Fix missing reference count get in call_path_from_sample() Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 515/583] spi: coldfire-qspi: Remove an erroneous clk_disable_unprepare() from the remove function Greg Kroah-Hartman
                   ` (75 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Alison Schofield, Dave Jiang,
	Dan Williams, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dan Williams <dan.j.williams@intel.com>

[ Upstream commit 5459e186a5c9f412334321cff58d70dcb0e48a04 ]

cxl_port_setup_targets() modifies the ->targets[] array of a switch
decoder. target_list_show() expects to be able to emit a coherent
snapshot of that array by "holding" ->target_lock for read. The
target_lock is held for write during initialization of the ->targets[]
array, but it is not held for write during cxl_port_setup_targets().

The ->target_lock() predates the introduction of @cxl_region_rwsem. That
semaphore protects changes to host-physical-address (HPA) decode which
is precisely what writes to a switch decoder's target list affects.

Replace ->target_lock with @cxl_region_rwsem.

Now the side-effect of snapshotting a unstable view of a decoder's
target list is likely benign so the Fixes: tag is presumptive.

Fixes: 27b3f8d13830 ("cxl/region: Program target lists")
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/cxl/core/port.c | 22 +++++++---------------
 drivers/cxl/cxl.h       |  2 --
 2 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
index 4081052bb385..c67cc8c9d5cc 100644
--- a/drivers/cxl/core/port.c
+++ b/drivers/cxl/core/port.c
@@ -172,14 +172,10 @@ static ssize_t target_list_show(struct device *dev,
 {
 	struct cxl_switch_decoder *cxlsd = to_cxl_switch_decoder(dev);
 	ssize_t offset;
-	unsigned int seq;
 	int rc;
 
-	do {
-		seq = read_seqbegin(&cxlsd->target_lock);
-		rc = emit_target_list(cxlsd, buf);
-	} while (read_seqretry(&cxlsd->target_lock, seq));
-
+	guard(rwsem_read)(&cxl_region_rwsem);
+	rc = emit_target_list(cxlsd, buf);
 	if (rc < 0)
 		return rc;
 	offset = rc;
@@ -1579,7 +1575,7 @@ EXPORT_SYMBOL_NS_GPL(cxl_mem_find_port, CXL);
 static int decoder_populate_targets(struct cxl_switch_decoder *cxlsd,
 				    struct cxl_port *port, int *target_map)
 {
-	int i, rc = 0;
+	int i;
 
 	if (!target_map)
 		return 0;
@@ -1589,19 +1585,16 @@ static int decoder_populate_targets(struct cxl_switch_decoder *cxlsd,
 	if (xa_empty(&port->dports))
 		return -EINVAL;
 
-	write_seqlock(&cxlsd->target_lock);
+	guard(rwsem_write)(&cxl_region_rwsem);
 	for (i = 0; i < cxlsd->cxld.interleave_ways; i++) {
 		struct cxl_dport *dport = find_dport(port, target_map[i]);
 
-		if (!dport) {
-			rc = -ENXIO;
-			break;
-		}
+		if (!dport)
+			return -ENXIO;
 		cxlsd->target[i] = dport;
 	}
-	write_sequnlock(&cxlsd->target_lock);
 
-	return rc;
+	return 0;
 }
 
 struct cxl_dport *cxl_hb_modulo(struct cxl_root_decoder *cxlrd, int pos)
@@ -1671,7 +1664,6 @@ static int cxl_switch_decoder_init(struct cxl_port *port,
 		return -EINVAL;
 
 	cxlsd->nr_targets = nr_targets;
-	seqlock_init(&cxlsd->target_lock);
 	return cxl_decoder_init(port, &cxlsd->cxld);
 }
 
diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h
index 6c6afda0e4c6..de2c250c894b 100644
--- a/drivers/cxl/cxl.h
+++ b/drivers/cxl/cxl.h
@@ -404,7 +404,6 @@ struct cxl_endpoint_decoder {
 /**
  * struct cxl_switch_decoder - Switch specific CXL HDM Decoder
  * @cxld: base cxl_decoder object
- * @target_lock: coordinate coherent reads of the target list
  * @nr_targets: number of elements in @target
  * @target: active ordered target list in current decoder configuration
  *
@@ -416,7 +415,6 @@ struct cxl_endpoint_decoder {
  */
 struct cxl_switch_decoder {
 	struct cxl_decoder cxld;
-	seqlock_t target_lock;
 	int nr_targets;
 	struct cxl_dport *target[];
 };
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 515/583] spi: coldfire-qspi: Remove an erroneous clk_disable_unprepare() from the remove function
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (513 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 514/583] cxl/port: Fix missing target list lock Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 516/583] hisi_acc_vfio_pci: Update migration data pointer correctly on saving/resume Greg Kroah-Hartman
                   ` (74 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christophe JAILLET, Mark Brown, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

[ Upstream commit 17dc11a02d8dacc7e78968daa2a8c16281eb7d1e ]

The commit in Fixes has changed a devm_clk_get()/clk_prepare_enable() into
a devm_clk_get_enabled().
It has updated the error handling path of the probe accordingly, but the
remove has been left unchanged.

Remove now the redundant clk_disable_unprepare() call from the remove
function.

Fixes: a90a987ebe00 ("spi: use devm_clk_get_enabled() in mcfqspi_probe()")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://msgid.link/r/6670aed303e1f7680e0911387606a8ae069e2cef.1704464447.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/spi/spi-coldfire-qspi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c
index f0b630fe16c3..b341b6908df0 100644
--- a/drivers/spi/spi-coldfire-qspi.c
+++ b/drivers/spi/spi-coldfire-qspi.c
@@ -441,7 +441,6 @@ static void mcfqspi_remove(struct platform_device *pdev)
 	mcfqspi_wr_qmr(mcfqspi, MCFQSPI_QMR_MSTR);
 
 	mcfqspi_cs_teardown(mcfqspi);
-	clk_disable_unprepare(mcfqspi->clk);
 }
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 516/583] hisi_acc_vfio_pci: Update migration data pointer correctly on saving/resume
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (514 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 515/583] spi: coldfire-qspi: Remove an erroneous clk_disable_unprepare() from the remove function Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 517/583] nvmet: re-fix tracing strncpy() warning Greg Kroah-Hartman
                   ` (73 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Shameer Kolothum, Jason Gunthorpe,
	Alex Williamson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>

[ Upstream commit be12ad45e15b5ee0e2526a50266ba1d295d26a88 ]

When the optional PRE_COPY support was added to speed up the device
compatibility check, it failed to update the saving/resuming data
pointers based on the fd offset. This results in migration data
corruption and when the device gets started on the destination the
following error is reported in some cases,

[  478.907684] arm-smmu-v3 arm-smmu-v3.2.auto: event 0x10 received:
[  478.913691] arm-smmu-v3 arm-smmu-v3.2.auto:  0x0000310200000010
[  478.919603] arm-smmu-v3 arm-smmu-v3.2.auto:  0x000002088000007f
[  478.925515] arm-smmu-v3 arm-smmu-v3.2.auto:  0x0000000000000000
[  478.931425] arm-smmu-v3 arm-smmu-v3.2.auto:  0x0000000000000000
[  478.947552] hisi_zip 0000:31:00.0: qm_axi_rresp [error status=0x1] found
[  478.955930] hisi_zip 0000:31:00.0: qm_db_timeout [error status=0x400] found
[  478.955944] hisi_zip 0000:31:00.0: qm sq doorbell timeout in function 2

Fixes: d9a871e4a143 ("hisi_acc_vfio_pci: Introduce support for PRE_COPY state transitions")
Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20231120091406.780-1-shameerali.kolothum.thodi@huawei.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
index b2f9778c8366..4d27465c8f1a 100644
--- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
+++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
@@ -694,6 +694,7 @@ static ssize_t hisi_acc_vf_resume_write(struct file *filp, const char __user *bu
 					size_t len, loff_t *pos)
 {
 	struct hisi_acc_vf_migration_file *migf = filp->private_data;
+	u8 *vf_data = (u8 *)&migf->vf_data;
 	loff_t requested_length;
 	ssize_t done = 0;
 	int ret;
@@ -715,7 +716,7 @@ static ssize_t hisi_acc_vf_resume_write(struct file *filp, const char __user *bu
 		goto out_unlock;
 	}
 
-	ret = copy_from_user(&migf->vf_data, buf, len);
+	ret = copy_from_user(vf_data + *pos, buf, len);
 	if (ret) {
 		done = -EFAULT;
 		goto out_unlock;
@@ -835,7 +836,9 @@ static ssize_t hisi_acc_vf_save_read(struct file *filp, char __user *buf, size_t
 
 	len = min_t(size_t, migf->total_length - *pos, len);
 	if (len) {
-		ret = copy_to_user(buf, &migf->vf_data, len);
+		u8 *vf_data = (u8 *)&migf->vf_data;
+
+		ret = copy_to_user(buf, vf_data + *pos, len);
 		if (ret) {
 			done = -EFAULT;
 			goto out_unlock;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 517/583] nvmet: re-fix tracing strncpy() warning
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (515 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 516/583] hisi_acc_vfio_pci: Update migration data pointer correctly on saving/resume Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 518/583] nvme: trace: avoid memcpy overflow warning Greg Kroah-Hartman
                   ` (72 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Arnd Bergmann, Keith Busch, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnd Bergmann <arnd@arndb.de>

[ Upstream commit 4ee7ffeb4ce50c80bc4504db6f39b25a2df6bcf4 ]

An earlier patch had tried to address a warning about a string copy with
missing zero termination:

drivers/nvme/target/trace.h:52:3: warning: ‘strncpy’ specified bound 32 equals destination size [-Wstringop-truncation]

The new version causes a different warning with some compiler versions, notably
gcc-9 and gcc-10, and also misses the zero padding that was apparently done
intentionally in the original code:

drivers/nvme/target/trace.h:56:2: error: 'strncpy' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]

Change it to use strscpy_pad() with the original length, which will give
a properly padded and zero-terminated string as well as avoiding the warning.

Fixes: d86481e924a7 ("nvmet: use min of device_path and disk len")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/target/trace.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/nvme/target/trace.h b/drivers/nvme/target/trace.h
index 6109b3806b12..155334ddc13f 100644
--- a/drivers/nvme/target/trace.h
+++ b/drivers/nvme/target/trace.h
@@ -53,8 +53,7 @@ static inline void __assign_req_name(char *name, struct nvmet_req *req)
 		return;
 	}
 
-	strncpy(name, req->ns->device_path,
-		min_t(size_t, DISK_NAME_LEN, strlen(req->ns->device_path)));
+	strscpy_pad(name, req->ns->device_path, DISK_NAME_LEN);
 }
 #endif
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 518/583] nvme: trace: avoid memcpy overflow warning
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (516 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 517/583] nvmet: re-fix tracing strncpy() warning Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 519/583] nvmet-tcp: Fix the H2C expected PDU len calculation Greg Kroah-Hartman
                   ` (71 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Arnd Bergmann, Keith Busch, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnd Bergmann <arnd@arndb.de>

[ Upstream commit a7de1dea76cd6a3707707af4ea2f8bc3cdeaeb11 ]

A previous patch introduced a struct_group() in nvme_common_command to help
stringop fortification figure out the length of the fields, but one function
is not currently using them:

In file included from drivers/nvme/target/core.c:7:
In file included from include/linux/string.h:254:
include/linux/fortify-string.h:592:4: error: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror,-Wattribute-warning]
                        __read_overflow2_field(q_size_field, size);
                        ^

Change this one to use the correct field name to avoid the warning.

Fixes: 5c629dc9609dc ("nvme: use struct group for generic command dwords")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/target/trace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/trace.h b/drivers/nvme/target/trace.h
index 155334ddc13f..974d99d47f51 100644
--- a/drivers/nvme/target/trace.h
+++ b/drivers/nvme/target/trace.h
@@ -84,7 +84,7 @@ TRACE_EVENT(nvmet_req_init,
 		__entry->flags = cmd->common.flags;
 		__entry->nsid = le32_to_cpu(cmd->common.nsid);
 		__entry->metadata = le64_to_cpu(cmd->common.metadata);
-		memcpy(__entry->cdw10, &cmd->common.cdw10,
+		memcpy(__entry->cdw10, &cmd->common.cdws,
 			sizeof(__entry->cdw10));
 	),
 	TP_printk("nvmet%s: %sqid=%d, cmdid=%u, nsid=%u, flags=%#x, "
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 519/583] nvmet-tcp: Fix the H2C expected PDU len calculation
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (517 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 518/583] nvme: trace: avoid memcpy overflow warning Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 520/583] PCI: keystone: Fix race condition when initializing PHYs Greg Kroah-Hartman
                   ` (70 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Maurizio Lombardi, Sagi Grimberg,
	Keith Busch, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Maurizio Lombardi <mlombard@redhat.com>

[ Upstream commit 9a1abc24850eb759e36a2f8869161c3b7254c904 ]

The nvmet_tcp_handle_h2c_data_pdu() function should take into
consideration the possibility that the header digest and/or the data
digests are enabled when calculating the expected PDU length, before
comparing it to the value stored in cmd->pdu_len.

Fixes: efa56305908b ("nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length")
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/target/tcp.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index 7f7fa78f0698..a4f802790ca0 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -954,7 +954,7 @@ static int nvmet_tcp_handle_h2c_data_pdu(struct nvmet_tcp_queue *queue)
 {
 	struct nvme_tcp_data_pdu *data = &queue->pdu.data;
 	struct nvmet_tcp_cmd *cmd;
-	unsigned int plen;
+	unsigned int exp_data_len;
 
 	if (likely(queue->nr_cmds)) {
 		if (unlikely(data->ttag >= queue->nr_cmds)) {
@@ -977,9 +977,13 @@ static int nvmet_tcp_handle_h2c_data_pdu(struct nvmet_tcp_queue *queue)
 		return -EPROTO;
 	}
 
-	plen = le32_to_cpu(data->hdr.plen);
+	exp_data_len = le32_to_cpu(data->hdr.plen) -
+			nvmet_tcp_hdgst_len(queue) -
+			nvmet_tcp_ddgst_len(queue) -
+			sizeof(*data);
+
 	cmd->pdu_len = le32_to_cpu(data->data_length);
-	if (unlikely(cmd->pdu_len != (plen - sizeof(*data)) ||
+	if (unlikely(cmd->pdu_len != exp_data_len ||
 		     cmd->pdu_len == 0 ||
 		     cmd->pdu_len > NVMET_TCP_MAXH2CDATA)) {
 		pr_err("H2CData PDU len %u is invalid\n", cmd->pdu_len);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 520/583] PCI: keystone: Fix race condition when initializing PHYs
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (518 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 519/583] nvmet-tcp: Fix the H2C expected PDU len calculation Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 521/583] PCI: mediatek-gen3: Fix translation window size calculation Greg Kroah-Hartman
                   ` (69 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Siddharth Vadapalli,
	Krzysztof Wilczyński, Ravi Gunasekaran, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Siddharth Vadapalli <s-vadapalli@ti.com>

[ Upstream commit c12ca110c613a81cb0f0099019c839d078cd0f38 ]

The PCI driver invokes the PHY APIs using the ks_pcie_enable_phy()
function. The PHY in this case is the Serdes. It is possible that the
PCI instance is configured for two lane operation across two different
Serdes instances, using one lane of each Serdes.

In such a configuration, if the reference clock for one Serdes is
provided by the other Serdes, it results in a race condition. After the
Serdes providing the reference clock is initialized by the PCI driver by
invoking its PHY APIs, it is not guaranteed that this Serdes remains
powered on long enough for the PHY APIs based initialization of the
dependent Serdes. In such cases, the PLL of the dependent Serdes fails
to lock due to the absence of the reference clock from the former Serdes
which has been powered off by the PM Core.

Fix this by obtaining reference to the PHYs before invoking the PHY
initialization APIs and releasing reference after the initialization is
complete.

Link: https://lore.kernel.org/linux-pci/20230927041845.1222080-1-s-vadapalli@ti.com
Fixes: 49229238ab47 ("PCI: keystone: Cleanup PHY handling")
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/pci/controller/dwc/pci-keystone.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c
index 0def919f89fa..cf3836561316 100644
--- a/drivers/pci/controller/dwc/pci-keystone.c
+++ b/drivers/pci/controller/dwc/pci-keystone.c
@@ -1218,7 +1218,16 @@ static int ks_pcie_probe(struct platform_device *pdev)
 		goto err_link;
 	}
 
+	/* Obtain references to the PHYs */
+	for (i = 0; i < num_lanes; i++)
+		phy_pm_runtime_get_sync(ks_pcie->phy[i]);
+
 	ret = ks_pcie_enable_phy(ks_pcie);
+
+	/* Release references to the PHYs */
+	for (i = 0; i < num_lanes; i++)
+		phy_pm_runtime_put_sync(ks_pcie->phy[i]);
+
 	if (ret) {
 		dev_err(dev, "failed to enable phy\n");
 		goto err_link;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 521/583] PCI: mediatek-gen3: Fix translation window size calculation
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (519 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 520/583] PCI: keystone: Fix race condition when initializing PHYs Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 522/583] ASoC: mediatek: sof-common: Add NULL check for normal_link string Greg Kroah-Hartman
                   ` (68 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jianjun Wang,
	Krzysztof Wilczyński, Bjorn Helgaas,
	AngeloGioacchino Del Regno, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jianjun Wang <jianjun.wang@mediatek.com>

[ Upstream commit 9ccc1318cf4bd90601f221268e42c3374703d681 ]

When using the fls() helper, the translation table should be a power of
two; otherwise, the resulting value will not be correct.

For example, given fls(0x3e00000) - 1 = 25, the PCIe translation window
size will be set to 0x2000000 instead of the expected size 0x3e00000.

Fix the translation window by splitting the MMIO space into multiple tables
if its size is not a power of two.

[kwilczynski: commit log]
Link: https://lore.kernel.org/linux-pci/20231023081423.18559-1-jianjun.wang@mediatek.com
Fixes: d3bf75b579b9 ("PCI: mediatek-gen3: Add MediaTek Gen3 driver for MT8192")
Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/pci/controller/pcie-mediatek-gen3.c | 85 ++++++++++++---------
 1 file changed, 50 insertions(+), 35 deletions(-)

diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c b/drivers/pci/controller/pcie-mediatek-gen3.c
index e0e27645fdf4..975b3024fb08 100644
--- a/drivers/pci/controller/pcie-mediatek-gen3.c
+++ b/drivers/pci/controller/pcie-mediatek-gen3.c
@@ -245,35 +245,60 @@ static int mtk_pcie_set_trans_table(struct mtk_gen3_pcie *pcie,
 				    resource_size_t cpu_addr,
 				    resource_size_t pci_addr,
 				    resource_size_t size,
-				    unsigned long type, int num)
+				    unsigned long type, int *num)
 {
+	resource_size_t remaining = size;
+	resource_size_t table_size;
+	resource_size_t addr_align;
+	const char *range_type;
 	void __iomem *table;
 	u32 val;
 
-	if (num >= PCIE_MAX_TRANS_TABLES) {
-		dev_err(pcie->dev, "not enough translate table for addr: %#llx, limited to [%d]\n",
-			(unsigned long long)cpu_addr, PCIE_MAX_TRANS_TABLES);
-		return -ENODEV;
-	}
+	while (remaining && (*num < PCIE_MAX_TRANS_TABLES)) {
+		/* Table size needs to be a power of 2 */
+		table_size = BIT(fls(remaining) - 1);
+
+		if (cpu_addr > 0) {
+			addr_align = BIT(ffs(cpu_addr) - 1);
+			table_size = min(table_size, addr_align);
+		}
+
+		/* Minimum size of translate table is 4KiB */
+		if (table_size < 0x1000) {
+			dev_err(pcie->dev, "illegal table size %#llx\n",
+				(unsigned long long)table_size);
+			return -EINVAL;
+		}
 
-	table = pcie->base + PCIE_TRANS_TABLE_BASE_REG +
-		num * PCIE_ATR_TLB_SET_OFFSET;
+		table = pcie->base + PCIE_TRANS_TABLE_BASE_REG + *num * PCIE_ATR_TLB_SET_OFFSET;
+		writel_relaxed(lower_32_bits(cpu_addr) | PCIE_ATR_SIZE(fls(table_size) - 1), table);
+		writel_relaxed(upper_32_bits(cpu_addr), table + PCIE_ATR_SRC_ADDR_MSB_OFFSET);
+		writel_relaxed(lower_32_bits(pci_addr), table + PCIE_ATR_TRSL_ADDR_LSB_OFFSET);
+		writel_relaxed(upper_32_bits(pci_addr), table + PCIE_ATR_TRSL_ADDR_MSB_OFFSET);
 
-	writel_relaxed(lower_32_bits(cpu_addr) | PCIE_ATR_SIZE(fls(size) - 1),
-		       table);
-	writel_relaxed(upper_32_bits(cpu_addr),
-		       table + PCIE_ATR_SRC_ADDR_MSB_OFFSET);
-	writel_relaxed(lower_32_bits(pci_addr),
-		       table + PCIE_ATR_TRSL_ADDR_LSB_OFFSET);
-	writel_relaxed(upper_32_bits(pci_addr),
-		       table + PCIE_ATR_TRSL_ADDR_MSB_OFFSET);
+		if (type == IORESOURCE_IO) {
+			val = PCIE_ATR_TYPE_IO | PCIE_ATR_TLP_TYPE_IO;
+			range_type = "IO";
+		} else {
+			val = PCIE_ATR_TYPE_MEM | PCIE_ATR_TLP_TYPE_MEM;
+			range_type = "MEM";
+		}
 
-	if (type == IORESOURCE_IO)
-		val = PCIE_ATR_TYPE_IO | PCIE_ATR_TLP_TYPE_IO;
-	else
-		val = PCIE_ATR_TYPE_MEM | PCIE_ATR_TLP_TYPE_MEM;
+		writel_relaxed(val, table + PCIE_ATR_TRSL_PARAM_OFFSET);
 
-	writel_relaxed(val, table + PCIE_ATR_TRSL_PARAM_OFFSET);
+		dev_dbg(pcie->dev, "set %s trans window[%d]: cpu_addr = %#llx, pci_addr = %#llx, size = %#llx\n",
+			range_type, *num, (unsigned long long)cpu_addr,
+			(unsigned long long)pci_addr, (unsigned long long)table_size);
+
+		cpu_addr += table_size;
+		pci_addr += table_size;
+		remaining -= table_size;
+		(*num)++;
+	}
+
+	if (remaining)
+		dev_warn(pcie->dev, "not enough translate table for addr: %#llx, limited to [%d]\n",
+			 (unsigned long long)cpu_addr, PCIE_MAX_TRANS_TABLES);
 
 	return 0;
 }
@@ -380,30 +405,20 @@ static int mtk_pcie_startup_port(struct mtk_gen3_pcie *pcie)
 		resource_size_t cpu_addr;
 		resource_size_t pci_addr;
 		resource_size_t size;
-		const char *range_type;
 
-		if (type == IORESOURCE_IO) {
+		if (type == IORESOURCE_IO)
 			cpu_addr = pci_pio_to_address(res->start);
-			range_type = "IO";
-		} else if (type == IORESOURCE_MEM) {
+		else if (type == IORESOURCE_MEM)
 			cpu_addr = res->start;
-			range_type = "MEM";
-		} else {
+		else
 			continue;
-		}
 
 		pci_addr = res->start - entry->offset;
 		size = resource_size(res);
 		err = mtk_pcie_set_trans_table(pcie, cpu_addr, pci_addr, size,
-					       type, table_index);
+					       type, &table_index);
 		if (err)
 			return err;
-
-		dev_dbg(pcie->dev, "set %s trans window[%d]: cpu_addr = %#llx, pci_addr = %#llx, size = %#llx\n",
-			range_type, table_index, (unsigned long long)cpu_addr,
-			(unsigned long long)pci_addr, (unsigned long long)size);
-
-		table_index++;
 	}
 
 	return 0;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 522/583] ASoC: mediatek: sof-common: Add NULL check for normal_link string
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (520 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 521/583] PCI: mediatek-gen3: Fix translation window size calculation Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 523/583] s390/pci: fix max size calculation in zpci_memcpy_toio() Greg Kroah-Hartman
                   ` (67 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, AngeloGioacchino Del Regno,
	Mark Brown, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

[ Upstream commit e3b3ec967a7d93b9010a5af9a2394c8b5c8f31ed ]

It's not granted that all entries of struct sof_conn_stream declare
a `normal_link` (a non-SOF, direct link) string, and this is the case
for SoCs that support only SOF paths (hence do not support both direct
and SOF usecases).

For example, in the case of MT8188 there is no normal_link string in
any of the sof_conn_stream entries and there will be more drivers
doing that in the future.

To avoid possible NULL pointer KPs, add a NULL check for `normal_link`.

Fixes: 0caf1120c583 ("ASoC: mediatek: mt8195: extract SOF common code")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://msgid.link/r/20240111105226.117603-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/mediatek/common/mtk-dsp-sof-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/mediatek/common/mtk-dsp-sof-common.c b/sound/soc/mediatek/common/mtk-dsp-sof-common.c
index 6fef16306f74..21a9403b7e92 100644
--- a/sound/soc/mediatek/common/mtk-dsp-sof-common.c
+++ b/sound/soc/mediatek/common/mtk-dsp-sof-common.c
@@ -24,7 +24,7 @@ int mtk_sof_dai_link_fixup(struct snd_soc_pcm_runtime *rtd,
 		struct snd_soc_dai_link *sof_dai_link = NULL;
 		const struct sof_conn_stream *conn = &sof_priv->conn_streams[i];
 
-		if (strcmp(rtd->dai_link->name, conn->normal_link))
+		if (conn->normal_link && strcmp(rtd->dai_link->name, conn->normal_link))
 			continue;
 
 		for_each_card_rtds(card, runtime) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 523/583] s390/pci: fix max size calculation in zpci_memcpy_toio()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (521 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 522/583] ASoC: mediatek: sof-common: Add NULL check for normal_link string Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 524/583] net: qualcomm: rmnet: fix global oob in rmnet_policy Greg Kroah-Hartman
                   ` (66 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Matthew Rosato, Niklas Schnelle,
	Alexander Gordeev, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Niklas Schnelle <schnelle@linux.ibm.com>

[ Upstream commit 80df7d6af7f6d229b34cf237b2cc9024c07111cd ]

The zpci_get_max_write_size() helper is used to determine the maximum
size a PCI store or load can use at a given __iomem address.

For the PCI block store the following restrictions apply:

1. The dst + len must not cross a 4K boundary in the (pseudo-)MMIO space
2. len must not exceed ZPCI_MAX_WRITE_SIZE
3. len must be a multiple of 8 bytes
4. The src address must be double word (8 byte) aligned
5. The dst address must be double word (8 byte) aligned

Otherwise only a normal PCI store which takes its src value from
a register can be used. For these PCI store restriction 1 still applies.
Similarly 1 also applies to PCI loads.

It turns out zpci_max_write_size() instead implements stricter
conditions which prevents PCI block stores from being used where they
can and should be used. In particular instead of conditions 4 and 5 it
wrongly enforces both dst and src to be size aligned. This indirectly
covers condition 1 but also prevents many legal PCI block stores.

On top of the functional shortcomings the zpci_get_max_write_size() is
misnamed as it is used for both read and write size calculations. Rename
it to zpci_get_max_io_size() and implement the listed conditions
explicitly.

Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Fixes: cd24834130ac ("s390/pci: base support")
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
[agordeev@linux.ibm.com replaced spaces with tabs]
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/s390/include/asm/pci_io.h | 32 ++++++++++++++++++--------------
 arch/s390/pci/pci_mmio.c       | 12 ++++++------
 2 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/arch/s390/include/asm/pci_io.h b/arch/s390/include/asm/pci_io.h
index 287bb88f7698..2686bee800e3 100644
--- a/arch/s390/include/asm/pci_io.h
+++ b/arch/s390/include/asm/pci_io.h
@@ -11,6 +11,8 @@
 /* I/O size constraints */
 #define ZPCI_MAX_READ_SIZE	8
 #define ZPCI_MAX_WRITE_SIZE	128
+#define ZPCI_BOUNDARY_SIZE	(1 << 12)
+#define ZPCI_BOUNDARY_MASK	(ZPCI_BOUNDARY_SIZE - 1)
 
 /* I/O Map */
 #define ZPCI_IOMAP_SHIFT		48
@@ -125,16 +127,18 @@ static inline int zpci_read_single(void *dst, const volatile void __iomem *src,
 int zpci_write_block(volatile void __iomem *dst, const void *src,
 		     unsigned long len);
 
-static inline u8 zpci_get_max_write_size(u64 src, u64 dst, int len, int max)
+static inline int zpci_get_max_io_size(u64 src, u64 dst, int len, int max)
 {
-	int count = len > max ? max : len, size = 1;
+	int offset = dst & ZPCI_BOUNDARY_MASK;
+	int size;
 
-	while (!(src & 0x1) && !(dst & 0x1) && ((size << 1) <= count)) {
-		dst = dst >> 1;
-		src = src >> 1;
-		size = size << 1;
-	}
-	return size;
+	size = min3(len, ZPCI_BOUNDARY_SIZE - offset, max);
+	if (IS_ALIGNED(src, 8) && IS_ALIGNED(dst, 8) && IS_ALIGNED(size, 8))
+		return size;
+
+	if (size >= 8)
+		return 8;
+	return rounddown_pow_of_two(size);
 }
 
 static inline int zpci_memcpy_fromio(void *dst,
@@ -144,9 +148,9 @@ static inline int zpci_memcpy_fromio(void *dst,
 	int size, rc = 0;
 
 	while (n > 0) {
-		size = zpci_get_max_write_size((u64 __force) src,
-					       (u64) dst, n,
-					       ZPCI_MAX_READ_SIZE);
+		size = zpci_get_max_io_size((u64 __force) src,
+					    (u64) dst, n,
+					    ZPCI_MAX_READ_SIZE);
 		rc = zpci_read_single(dst, src, size);
 		if (rc)
 			break;
@@ -166,9 +170,9 @@ static inline int zpci_memcpy_toio(volatile void __iomem *dst,
 		return -EINVAL;
 
 	while (n > 0) {
-		size = zpci_get_max_write_size((u64 __force) dst,
-					       (u64) src, n,
-					       ZPCI_MAX_WRITE_SIZE);
+		size = zpci_get_max_io_size((u64 __force) dst,
+					    (u64) src, n,
+					    ZPCI_MAX_WRITE_SIZE);
 		if (size > 8) /* main path */
 			rc = zpci_write_block(dst, src, size);
 		else
diff --git a/arch/s390/pci/pci_mmio.c b/arch/s390/pci/pci_mmio.c
index 588089332931..a90499c087f0 100644
--- a/arch/s390/pci/pci_mmio.c
+++ b/arch/s390/pci/pci_mmio.c
@@ -97,9 +97,9 @@ static inline int __memcpy_toio_inuser(void __iomem *dst,
 		return -EINVAL;
 
 	while (n > 0) {
-		size = zpci_get_max_write_size((u64 __force) dst,
-					       (u64 __force) src, n,
-					       ZPCI_MAX_WRITE_SIZE);
+		size = zpci_get_max_io_size((u64 __force) dst,
+					    (u64 __force) src, n,
+					    ZPCI_MAX_WRITE_SIZE);
 		if (size > 8) /* main path */
 			rc = __pcistb_mio_inuser(dst, src, size, &status);
 		else
@@ -242,9 +242,9 @@ static inline int __memcpy_fromio_inuser(void __user *dst,
 	u8 status;
 
 	while (n > 0) {
-		size = zpci_get_max_write_size((u64 __force) src,
-					       (u64 __force) dst, n,
-					       ZPCI_MAX_READ_SIZE);
+		size = zpci_get_max_io_size((u64 __force) src,
+					    (u64 __force) dst, n,
+					    ZPCI_MAX_READ_SIZE);
 		rc = __pcilg_mio_inuser(dst, src, size, &status);
 		if (rc)
 			break;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 524/583] net: qualcomm: rmnet: fix global oob in rmnet_policy
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (522 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 523/583] s390/pci: fix max size calculation in zpci_memcpy_toio() Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 525/583] rxrpc: Fix use of Dont Fragment flag Greg Kroah-Hartman
                   ` (65 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Lin Ma,
	Subash Abhinov Kasiviswanathan, Simon Horman, Jiri Pirko,
	Jakub Kicinski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Lin Ma <linma@zju.edu.cn>

[ Upstream commit b33fb5b801c6db408b774a68e7c8722796b59ecc ]

The variable rmnet_link_ops assign a *bigger* maxtype which leads to a
global out-of-bounds read when parsing the netlink attributes. See bug
trace below:

==================================================================
BUG: KASAN: global-out-of-bounds in validate_nla lib/nlattr.c:386 [inline]
BUG: KASAN: global-out-of-bounds in __nla_validate_parse+0x24af/0x2750 lib/nlattr.c:600
Read of size 1 at addr ffffffff92c438d0 by task syz-executor.6/84207

CPU: 0 PID: 84207 Comm: syz-executor.6 Tainted: G                 N 6.1.0 #3
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x8b/0xb3 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:284 [inline]
 print_report+0x172/0x475 mm/kasan/report.c:395
 kasan_report+0xbb/0x1c0 mm/kasan/report.c:495
 validate_nla lib/nlattr.c:386 [inline]
 __nla_validate_parse+0x24af/0x2750 lib/nlattr.c:600
 __nla_parse+0x3e/0x50 lib/nlattr.c:697
 nla_parse_nested_deprecated include/net/netlink.h:1248 [inline]
 __rtnl_newlink+0x50a/0x1880 net/core/rtnetlink.c:3485
 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3594
 rtnetlink_rcv_msg+0x43c/0xd70 net/core/rtnetlink.c:6091
 netlink_rcv_skb+0x14f/0x410 net/netlink/af_netlink.c:2540
 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
 netlink_unicast+0x54e/0x800 net/netlink/af_netlink.c:1345
 netlink_sendmsg+0x930/0xe50 net/netlink/af_netlink.c:1921
 sock_sendmsg_nosec net/socket.c:714 [inline]
 sock_sendmsg+0x154/0x190 net/socket.c:734
 ____sys_sendmsg+0x6df/0x840 net/socket.c:2482
 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536
 __sys_sendmsg+0xf3/0x1c0 net/socket.c:2565
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fdcf2072359
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fdcf13e3168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fdcf219ff80 RCX: 00007fdcf2072359
RDX: 0000000000000000 RSI: 0000000020000200 RDI: 0000000000000003
RBP: 00007fdcf20bd493 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fffbb8d7bdf R14: 00007fdcf13e3300 R15: 0000000000022000
 </TASK>

The buggy address belongs to the variable:
 rmnet_policy+0x30/0xe0

The buggy address belongs to the physical page:
page:0000000065bdeb3c refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x155243
flags: 0x200000000001000(reserved|node=0|zone=2)
raw: 0200000000001000 ffffea00055490c8 ffffea00055490c8 0000000000000000
raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffffffff92c43780: f9 f9 f9 f9 00 00 00 02 f9 f9 f9 f9 00 00 00 07
 ffffffff92c43800: f9 f9 f9 f9 00 00 00 05 f9 f9 f9 f9 06 f9 f9 f9
>ffffffff92c43880: f9 f9 f9 f9 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9
                                                 ^
 ffffffff92c43900: 00 00 00 00 00 00 00 00 07 f9 f9 f9 f9 f9 f9 f9
 ffffffff92c43980: 00 00 00 07 f9 f9 f9 f9 00 00 00 05 f9 f9 f9 f9

According to the comment of `nla_parse_nested_deprecated`, the maxtype
should be len(destination array) - 1. Hence use `IFLA_RMNET_MAX` here.

Fixes: 14452ca3b5ce ("net: qualcomm: rmnet: Export mux_id and flags to netlink")
Signed-off-by: Lin Ma <linma@zju.edu.cn>
Reviewed-by: Subash Abhinov Kasiviswanathan <quic_subashab@quicinc.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20240110061400.3356108-1-linma@zju.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
index 39d24e07f306..5b69b9268c75 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
@@ -396,7 +396,7 @@ static int rmnet_fill_info(struct sk_buff *skb, const struct net_device *dev)
 
 struct rtnl_link_ops rmnet_link_ops __read_mostly = {
 	.kind		= "rmnet",
-	.maxtype	= __IFLA_RMNET_MAX,
+	.maxtype	= IFLA_RMNET_MAX,
 	.priv_size	= sizeof(struct rmnet_priv),
 	.setup		= rmnet_vnd_setup,
 	.validate	= rmnet_rtnl_validate,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 525/583] rxrpc: Fix use of Dont Fragment flag
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (523 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 524/583] net: qualcomm: rmnet: fix global oob in rmnet_policy Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 526/583] octeontx2-af: CN10KB: Fix FIFO length calculation for RPM2 Greg Kroah-Hartman
                   ` (64 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Marc Dionne, David Howells,
	linux-afs, Paolo Abeni, Jakub Kicinski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: David Howells <dhowells@redhat.com>

[ Upstream commit 8722014311e613244f33952354956a82fa4b0472 ]

rxrpc normally has the Don't Fragment flag set on the UDP packets it
transmits, except when it has decided that DATA packets aren't getting
through - in which case it turns it off just for the DATA transmissions.
This can be a problem, however, for RESPONSE packets that convey
authentication and crypto data from the client to the server as ticket may
be larger than can fit in the MTU.

In such a case, rxrpc gets itself into an infinite loop as the sendmsg
returns an error (EMSGSIZE), which causes rxkad_send_response() to return
-EAGAIN - and the CHALLENGE packet is put back on the Rx queue to retry,
leading to the I/O thread endlessly attempting to perform the transmission.

Fix this by disabling DF on RESPONSE packets for now.  The use of DF and
best data MTU determination needs reconsidering at some point in the
future.

Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both")
Reported-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-afs@lists.infradead.org
Acked-by: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/r/1581852.1704813048@warthog.procyon.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/rxrpc/ar-internal.h  |  1 +
 net/rxrpc/local_object.c | 13 ++++++++++++-
 net/rxrpc/output.c       |  6 ++----
 net/rxrpc/rxkad.c        |  2 ++
 4 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
index e8e14c6f904d..e8b43408136a 100644
--- a/net/rxrpc/ar-internal.h
+++ b/net/rxrpc/ar-internal.h
@@ -1076,6 +1076,7 @@ void rxrpc_send_version_request(struct rxrpc_local *local,
 /*
  * local_object.c
  */
+void rxrpc_local_dont_fragment(const struct rxrpc_local *local, bool set);
 struct rxrpc_local *rxrpc_lookup_local(struct net *, const struct sockaddr_rxrpc *);
 struct rxrpc_local *rxrpc_get_local(struct rxrpc_local *, enum rxrpc_local_trace);
 struct rxrpc_local *rxrpc_get_local_maybe(struct rxrpc_local *, enum rxrpc_local_trace);
diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c
index c553a30e9c83..34d307368135 100644
--- a/net/rxrpc/local_object.c
+++ b/net/rxrpc/local_object.c
@@ -36,6 +36,17 @@ static void rxrpc_encap_err_rcv(struct sock *sk, struct sk_buff *skb, int err,
 		return ipv6_icmp_error(sk, skb, err, port, info, payload);
 }
 
+/*
+ * Set or clear the Don't Fragment flag on a socket.
+ */
+void rxrpc_local_dont_fragment(const struct rxrpc_local *local, bool set)
+{
+	if (set)
+		ip_sock_set_mtu_discover(local->socket->sk, IP_PMTUDISC_DO);
+	else
+		ip_sock_set_mtu_discover(local->socket->sk, IP_PMTUDISC_DONT);
+}
+
 /*
  * Compare a local to an address.  Return -ve, 0 or +ve to indicate less than,
  * same or greater than.
@@ -203,7 +214,7 @@ static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net)
 		ip_sock_set_recverr(usk);
 
 		/* we want to set the don't fragment bit */
-		ip_sock_set_mtu_discover(usk, IP_PMTUDISC_DO);
+		rxrpc_local_dont_fragment(local, true);
 
 		/* We want receive timestamps. */
 		sock_enable_timestamps(usk);
diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c
index 5e53429c6922..a0906145e829 100644
--- a/net/rxrpc/output.c
+++ b/net/rxrpc/output.c
@@ -494,14 +494,12 @@ int rxrpc_send_data_packet(struct rxrpc_call *call, struct rxrpc_txbuf *txb)
 	switch (conn->local->srx.transport.family) {
 	case AF_INET6:
 	case AF_INET:
-		ip_sock_set_mtu_discover(conn->local->socket->sk,
-					 IP_PMTUDISC_DONT);
+		rxrpc_local_dont_fragment(conn->local, false);
 		rxrpc_inc_stat(call->rxnet, stat_tx_data_send_frag);
 		ret = do_udp_sendmsg(conn->local->socket, &msg, len);
 		conn->peer->last_tx_at = ktime_get_seconds();
 
-		ip_sock_set_mtu_discover(conn->local->socket->sk,
-					 IP_PMTUDISC_DO);
+		rxrpc_local_dont_fragment(conn->local, true);
 		break;
 
 	default:
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c
index 1bf571a66e02..b52dedcebce0 100644
--- a/net/rxrpc/rxkad.c
+++ b/net/rxrpc/rxkad.c
@@ -724,7 +724,9 @@ static int rxkad_send_response(struct rxrpc_connection *conn,
 	serial = atomic_inc_return(&conn->serial);
 	whdr.serial = htonl(serial);
 
+	rxrpc_local_dont_fragment(conn->local, false);
 	ret = kernel_sendmsg(conn->local->socket, &msg, iov, 3, len);
+	rxrpc_local_dont_fragment(conn->local, true);
 	if (ret < 0) {
 		trace_rxrpc_tx_fail(conn->debug_id, serial, ret,
 				    rxrpc_tx_point_rxkad_response);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 526/583] octeontx2-af: CN10KB: Fix FIFO length calculation for RPM2
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (524 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 525/583] rxrpc: Fix use of Dont Fragment flag Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 527/583] net: ethernet: ti: am65-cpsw: Fix max mtu to fit ethernet frames Greg Kroah-Hartman
                   ` (63 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nithin Dabilpuram,
	Naveen Mamindlapalli, Simon Horman, Jakub Kicinski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nithin Dabilpuram <ndabilpuram@marvell.com>

[ Upstream commit a0cb76a770083a22167659e64ba69af6425b1d9b ]

RPM0 and RPM1 on the CN10KB SoC have 8 LMACs each, whereas RPM2
has only 4 LMACs. Similarly, the RPM0 and RPM1 have 256KB FIFO,
whereas RPM2 has 128KB FIFO. This patch fixes an issue with
improper TX credit programming for the RPM2 link.

Fixes: b9d0fedc6234 ("octeontx2-af: cn10kb: Add RPM_USX MAC support")
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240108073036.8766-1-naveenm@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/marvell/octeontx2/af/rpm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rpm.c b/drivers/net/ethernet/marvell/octeontx2/af/rpm.c
index 4728ba34b0e3..76218f1cb459 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rpm.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rpm.c
@@ -506,6 +506,7 @@ u32 rpm2_get_lmac_fifo_len(void *rpmd, int lmac_id)
 	rpm_t *rpm = rpmd;
 	u8 num_lmacs;
 	u32 fifo_len;
+	u16 max_lmac;
 
 	lmac_info = rpm_read(rpm, 0, RPM2_CMRX_RX_LMACS);
 	/* LMACs are divided into two groups and each group
@@ -513,7 +514,11 @@ u32 rpm2_get_lmac_fifo_len(void *rpmd, int lmac_id)
 	 * Group0 lmac_id range {0..3}
 	 * Group1 lmac_id range {4..7}
 	 */
-	fifo_len = rpm->mac_ops->fifo_len / 2;
+	max_lmac = (rpm_read(rpm, 0, CGX_CONST) >> 24) & 0xFF;
+	if (max_lmac > 4)
+		fifo_len = rpm->mac_ops->fifo_len / 2;
+	else
+		fifo_len = rpm->mac_ops->fifo_len;
 
 	if (lmac_id < 4) {
 		num_lmacs = hweight8(lmac_info & 0xF);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 527/583] net: ethernet: ti: am65-cpsw: Fix max mtu to fit ethernet frames
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (525 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 526/583] octeontx2-af: CN10KB: Fix FIFO length calculation for RPM2 Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 528/583] amt: do not use overwrapped cb area Greg Kroah-Hartman
                   ` (62 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jorge Sanjuan Garcia,
	Horatiu Vultur, Siddharth Vadapalli, Jakub Kicinski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sanjuán García, Jorge <Jorge.SanjuanGarcia@duagon.com>

[ Upstream commit 64e47d8afb5ca533b27efc006405e5bcae2c4a7b ]

The value of AM65_CPSW_MAX_PACKET_SIZE represents the maximum length
of a received frame. This value is written to the register
AM65_CPSW_PORT_REG_RX_MAXLEN.

The maximum MTU configured on the network device should then leave
some room for the ethernet headers and frame check. Otherwise, if
the network interface is configured to its maximum mtu possible,
the frames will be larger than AM65_CPSW_MAX_PACKET_SIZE and will
get dropped as oversized.

The switch supports ethernet frame sizes between 64 and 2024 bytes
(including VLAN) as stated in the technical reference manual, so
define AM65_CPSW_MAX_PACKET_SIZE with that maximum size.

Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver")
Signed-off-by: Jorge Sanjuan Garcia <jorge.sanjuangarcia@duagon.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Link: https://lore.kernel.org/r/20240105085530.14070-2-jorge.sanjuangarcia@duagon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/ti/am65-cpsw-nuss.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index 24120605502f..c62b0f99f2bc 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -56,7 +56,7 @@
 #define AM65_CPSW_MAX_PORTS	8
 
 #define AM65_CPSW_MIN_PACKET_SIZE	VLAN_ETH_ZLEN
-#define AM65_CPSW_MAX_PACKET_SIZE	(VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)
+#define AM65_CPSW_MAX_PACKET_SIZE	2024
 
 #define AM65_CPSW_REG_CTL		0x004
 #define AM65_CPSW_REG_STAT_PORT_EN	0x014
@@ -2167,7 +2167,8 @@ am65_cpsw_nuss_init_port_ndev(struct am65_cpsw_common *common, u32 port_idx)
 	eth_hw_addr_set(port->ndev, port->slave.mac_addr);
 
 	port->ndev->min_mtu = AM65_CPSW_MIN_PACKET_SIZE;
-	port->ndev->max_mtu = AM65_CPSW_MAX_PACKET_SIZE;
+	port->ndev->max_mtu = AM65_CPSW_MAX_PACKET_SIZE -
+			      (VLAN_ETH_HLEN + ETH_FCS_LEN);
 	port->ndev->hw_features = NETIF_F_SG |
 				  NETIF_F_RXCSUM |
 				  NETIF_F_HW_CSUM |
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 528/583] amt: do not use overwrapped cb area
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (526 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 527/583] net: ethernet: ti: am65-cpsw: Fix max mtu to fit ethernet frames Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 529/583] net: micrel: Fix PTP frame parsing for lan8841 Greg Kroah-Hartman
                   ` (61 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Taehee Yoo, Paolo Abeni,
	Jamal Hadi Salim, Jakub Kicinski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Taehee Yoo <ap420073@gmail.com>

[ Upstream commit bec161add35b478a7746bf58bcdea6faa19129ef ]

amt driver uses skb->cb for storing tunnel information.
This job is worked before TC layer and then amt driver load tunnel info
from skb->cb after TC layer.
So, its cb area should not be overwrapped with CB area used by TC.
In order to not use cb area used by TC, it skips the biggest cb
structure used by TC, which was qdisc_skb_cb.
But it's not anymore.
Currently, biggest structure of TC's CB is tc_skb_cb.
So, it should skip size of tc_skb_cb instead of qdisc_skb_cb.

Fixes: ec624fe740b4 ("net/sched: Extend qdisc control block with tc control block")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://lore.kernel.org/r/20240107144241.4169520-1-ap420073@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/amt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index 2d20be6ffb7e..ddd087c2c3ed 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -11,7 +11,7 @@
 #include <linux/net.h>
 #include <linux/igmp.h>
 #include <linux/workqueue.h>
-#include <net/sch_generic.h>
+#include <net/pkt_sched.h>
 #include <net/net_namespace.h>
 #include <net/ip.h>
 #include <net/udp.h>
@@ -80,11 +80,11 @@ static struct mld2_grec mldv2_zero_grec;
 
 static struct amt_skb_cb *amt_skb_cb(struct sk_buff *skb)
 {
-	BUILD_BUG_ON(sizeof(struct amt_skb_cb) + sizeof(struct qdisc_skb_cb) >
+	BUILD_BUG_ON(sizeof(struct amt_skb_cb) + sizeof(struct tc_skb_cb) >
 		     sizeof_field(struct sk_buff, cb));
 
 	return (struct amt_skb_cb *)((void *)skb->cb +
-		sizeof(struct qdisc_skb_cb));
+		sizeof(struct tc_skb_cb));
 }
 
 static void __amt_source_gc_work(void)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 529/583] net: micrel: Fix PTP frame parsing for lan8841
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (527 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 528/583] amt: do not use overwrapped cb area Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 530/583] net: phy: micrel: populate .soft_reset for KSZ9131 Greg Kroah-Hartman
                   ` (60 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Horatiu Vultur, Divya Koppera,
	Rahul Rameshbabu, David S. Miller, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Horatiu Vultur <horatiu.vultur@microchip.com>

[ Upstream commit acd66c2126eb9b5da2d89ae07dbcd73b909c2111 ]

The HW has the capability to check each frame if it is a PTP frame,
which domain it is, which ptp frame type it is, different ip address in
the frame. And if one of these checks fail then the frame is not
timestamp. Most of these checks were disabled except checking the field
minorVersionPTP inside the PTP header. Meaning that once a partner sends
a frame compliant to 8021AS which has minorVersionPTP set to 1, then the
frame was not timestamp because the HW expected by default a value of 0
in minorVersionPTP.
Fix this issue by removing this check so the userspace can decide on this.

Fixes: cafc3662ee3f ("net: micrel: Add PHC support for lan8841")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Divya Koppera <divya.koppera@microchip.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/phy/micrel.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 927d3d54658e..a345d02a9edf 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -3313,8 +3313,10 @@ static int lan8814_probe(struct phy_device *phydev)
 #define LAN8841_ADC_CHANNEL_MASK		198
 #define LAN8841_PTP_RX_PARSE_L2_ADDR_EN		370
 #define LAN8841_PTP_RX_PARSE_IP_ADDR_EN		371
+#define LAN8841_PTP_RX_VERSION			374
 #define LAN8841_PTP_TX_PARSE_L2_ADDR_EN		434
 #define LAN8841_PTP_TX_PARSE_IP_ADDR_EN		435
+#define LAN8841_PTP_TX_VERSION			438
 #define LAN8841_PTP_CMD_CTL			256
 #define LAN8841_PTP_CMD_CTL_PTP_ENABLE		BIT(2)
 #define LAN8841_PTP_CMD_CTL_PTP_DISABLE		BIT(1)
@@ -3358,6 +3360,12 @@ static int lan8841_config_init(struct phy_device *phydev)
 	phy_write_mmd(phydev, KSZ9131RN_MMD_COMMON_CTRL_REG,
 		      LAN8841_PTP_RX_PARSE_IP_ADDR_EN, 0);
 
+	/* Disable checking for minorVersionPTP field */
+	phy_write_mmd(phydev, KSZ9131RN_MMD_COMMON_CTRL_REG,
+		      LAN8841_PTP_RX_VERSION, 0xff00);
+	phy_write_mmd(phydev, KSZ9131RN_MMD_COMMON_CTRL_REG,
+		      LAN8841_PTP_TX_VERSION, 0xff00);
+
 	/* 100BT Clause 40 improvenent errata */
 	phy_write_mmd(phydev, LAN8841_MMD_ANALOG_REG,
 		      LAN8841_ANALOG_CONTROL_1,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 530/583] net: phy: micrel: populate .soft_reset for KSZ9131
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (528 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 529/583] net: micrel: Fix PTP frame parsing for lan8841 Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 531/583] ALSA: hda: Properly setup HDMI stream Greg Kroah-Hartman
                   ` (59 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Claudiu Beznea, Maxime Chevallier,
	Andrew Lunn, David S. Miller, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

[ Upstream commit e398822c4751017fe401f57409488f5948d12fb5 ]

The RZ/G3S SMARC Module has 2 KSZ9131 PHYs. In this setup, the KSZ9131 PHY
is used with the ravb Ethernet driver. It has been discovered that when
bringing the Ethernet interface down/up continuously, e.g., with the
following sh script:

$ while :; do ifconfig eth0 down; ifconfig eth0 up; done

the link speed and duplex are wrong after interrupting the bring down/up
operation even though the Ethernet interface is up. To recover from this
state the following configuration sequence is necessary (executed
manually):

$ ifconfig eth0 down
$ ifconfig eth0 up

The behavior has been identified also on the Microchip SAMA7G5-EK board
which runs the macb driver and uses the same PHY.

The order of PHY-related operations in ravb_open() is as follows:
ravb_open() ->
  ravb_phy_start() ->
    ravb_phy_init() ->
      of_phy_connect() ->
        phy_connect_direct() ->
	  phy_attach_direct() ->
	    phy_init_hw() ->
	      phydev->drv->soft_reset()
	      phydev->drv->config_init()
	      phydev->drv->config_intr()
	    phy_resume()
	      kszphy_resume()

The order of PHY-related operations in ravb_close is as follows:
ravb_close() ->
  phy_stop() ->
    phy_suspend() ->
      kszphy_suspend() ->
        genphy_suspend()
	  // set BMCR_PDOWN bit in MII_BMCR

In genphy_suspend() setting the BMCR_PDWN bit in MII_BMCR switches the PHY
to Software Power-Down (SPD) mode (according to the KSZ9131 datasheet).
Thus, when opening the interface after it has been  previously closed (via
ravb_close()), the phydev->drv->config_init() and
phydev->drv->config_intr() reach the KSZ9131 PHY driver via the
ksz9131_config_init() and kszphy_config_intr() functions.

KSZ9131 specifies that the MII management interface remains operational
during SPD (Software Power-Down), but (according to manual):
- Only access to the standard registers (0 through 31) is supported.
- Access to MMD address spaces other than MMD address space 1 is possible
  if the spd_clock_gate_override bit is set.
- Access to MMD address space 1 is not possible.

The spd_clock_gate_override bit is not used in the KSZ9131 driver.

ksz9131_config_init() configures RGMII delay, pad skews and LEDs by
accessesing MMD registers other than those in address space 1.

The datasheet for the KSZ9131 does not specify what happens if registers
from an unsupported address space are accessed while the PHY is in SPD.

To fix the issue the .soft_reset method has been instantiated for KSZ9131,
too. This resets the PHY to the default state before doing any
configurations to it, thus switching it out of SPD.

Fixes: bff5b4b37372 ("net: phy: micrel: add Microchip KSZ9131 initial driver")
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/phy/micrel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index a345d02a9edf..dfd5f8e78e29 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -4828,6 +4828,7 @@ static struct phy_driver ksphy_driver[] = {
 	.flags		= PHY_POLL_CABLE_TEST,
 	.driver_data	= &ksz9131_type,
 	.probe		= kszphy_probe,
+	.soft_reset	= genphy_soft_reset,
 	.config_init	= ksz9131_config_init,
 	.config_intr	= kszphy_config_intr,
 	.config_aneg	= ksz9131_config_aneg,
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 531/583] ALSA: hda: Properly setup HDMI stream
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (529 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 530/583] net: phy: micrel: populate .soft_reset for KSZ9131 Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 532/583] mptcp: mptcp_parse_option() fix for MPTCPOPT_MP_JOIN Greg Kroah-Hartman
                   ` (58 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Amadeusz Sławiński,
	Takashi Iwai, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>

[ Upstream commit 454abb80e26ab85323a30e52aa7b0ee9aae1d38a ]

Since commit 4005d1ba0a7e ("ASoC: soc-dai: don't call PCM audio ops if
the stream is not supported") HDMI playback is broken with avs driver.
This happens because for HDMI stream (unlike generic HDA one)
channels_min for stream is not set when creating PCMs. Fix this by
setting the value based on first available converter.

Fixes: 4005d1ba0a7e ("ASoC: soc-dai: don't call PCM audio ops if the stream is not supported")
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20240112113349.2905328-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/pci/hda/patch_hdmi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 78cee53fee02..038db8902c9e 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2301,6 +2301,7 @@ static int generic_hdmi_build_pcms(struct hda_codec *codec)
 	codec_dbg(codec, "hdmi: pcm_num set to %d\n", pcm_num);
 
 	for (idx = 0; idx < pcm_num; idx++) {
+		struct hdmi_spec_per_cvt *per_cvt;
 		struct hda_pcm *info;
 		struct hda_pcm_stream *pstr;
 
@@ -2316,6 +2317,11 @@ static int generic_hdmi_build_pcms(struct hda_codec *codec)
 		pstr = &info->stream[SNDRV_PCM_STREAM_PLAYBACK];
 		pstr->substreams = 1;
 		pstr->ops = generic_ops;
+
+		per_cvt = get_cvt(spec, 0);
+		pstr->channels_min = per_cvt->channels_min;
+		pstr->channels_max = per_cvt->channels_max;
+
 		/* pcm number is less than pcm_rec array size */
 		if (spec->pcm_used >= ARRAY_SIZE(spec->pcm_rec))
 			break;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 532/583] mptcp: mptcp_parse_option() fix for MPTCPOPT_MP_JOIN
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (530 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 531/583] ALSA: hda: Properly setup HDMI stream Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 533/583] mptcp: strict validation before using mp_opt->hmac Greg Kroah-Hartman
                   ` (57 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Florian Westphal,
	Peter Krystad, Matthieu Baerts, Mat Martineau, Geliang Tang,
	Simon Horman, Paolo Abeni, Jakub Kicinski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 89e23277f9c16df6f9f9c1a1a07f8f132339c15c ]

mptcp_parse_option() currently sets OPTIONS_MPTCP_MPJ, for the three
possible cases handled for MPTCPOPT_MP_JOIN option.

OPTIONS_MPTCP_MPJ is the combination of three flags:
- OPTION_MPTCP_MPJ_SYN
- OPTION_MPTCP_MPJ_SYNACK
- OPTION_MPTCP_MPJ_ACK

This is a problem, because backup, join_id, token, nonce and/or hmac fields
could be left uninitialized in some cases.

Distinguish the three cases, as following patches will need this step.

Fixes: f296234c98a8 ("mptcp: Add handling of incoming MP_JOIN requests")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Florian Westphal <fw@strlen.de>
Cc: Peter Krystad <peter.krystad@linux.intel.com>
Cc: Matthieu Baerts <matttbe@kernel.org>
Cc: Mat Martineau <martineau@kernel.org>
Cc: Geliang Tang <geliang.tang@linux.dev>
Reviewed-by: Simon Horman <horms@kernel.org>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Link: https://lore.kernel.org/r/20240111194917.4044654-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/mptcp/options.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index c53914012d01..d2527d189a79 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -123,8 +123,8 @@ static void mptcp_parse_option(const struct sk_buff *skb,
 		break;
 
 	case MPTCPOPT_MP_JOIN:
-		mp_opt->suboptions |= OPTIONS_MPTCP_MPJ;
 		if (opsize == TCPOLEN_MPTCP_MPJ_SYN) {
+			mp_opt->suboptions |= OPTION_MPTCP_MPJ_SYN;
 			mp_opt->backup = *ptr++ & MPTCPOPT_BACKUP;
 			mp_opt->join_id = *ptr++;
 			mp_opt->token = get_unaligned_be32(ptr);
@@ -135,6 +135,7 @@ static void mptcp_parse_option(const struct sk_buff *skb,
 				 mp_opt->backup, mp_opt->join_id,
 				 mp_opt->token, mp_opt->nonce);
 		} else if (opsize == TCPOLEN_MPTCP_MPJ_SYNACK) {
+			mp_opt->suboptions |= OPTION_MPTCP_MPJ_SYNACK;
 			mp_opt->backup = *ptr++ & MPTCPOPT_BACKUP;
 			mp_opt->join_id = *ptr++;
 			mp_opt->thmac = get_unaligned_be64(ptr);
@@ -145,11 +146,10 @@ static void mptcp_parse_option(const struct sk_buff *skb,
 				 mp_opt->backup, mp_opt->join_id,
 				 mp_opt->thmac, mp_opt->nonce);
 		} else if (opsize == TCPOLEN_MPTCP_MPJ_ACK) {
+			mp_opt->suboptions |= OPTION_MPTCP_MPJ_ACK;
 			ptr += 2;
 			memcpy(mp_opt->hmac, ptr, MPTCPOPT_HMAC_LEN);
 			pr_debug("MP_JOIN hmac");
-		} else {
-			mp_opt->suboptions &= ~OPTIONS_MPTCP_MPJ;
 		}
 		break;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 533/583] mptcp: strict validation before using mp_opt->hmac
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (531 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 532/583] mptcp: mptcp_parse_option() fix for MPTCPOPT_MP_JOIN Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 534/583] mptcp: use OPTION_MPTCP_MPJ_SYNACK in subflow_finish_connect() Greg Kroah-Hartman
                   ` (56 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Florian Westphal,
	Peter Krystad, Matthieu Baerts, Mat Martineau, Geliang Tang,
	Simon Horman, Paolo Abeni, Jakub Kicinski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit c1665273bdc7c201766c65e561c06711f2e050dc ]

mp_opt->hmac contains uninitialized data unless OPTION_MPTCP_MPJ_ACK
was set in mptcp_parse_option().

We must refine the condition before we call subflow_hmac_valid().

Fixes: f296234c98a8 ("mptcp: Add handling of incoming MP_JOIN requests")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Florian Westphal <fw@strlen.de>
Cc: Peter Krystad <peter.krystad@linux.intel.com>
Cc: Matthieu Baerts <matttbe@kernel.org>
Cc: Mat Martineau <martineau@kernel.org>
Cc: Geliang Tang <geliang.tang@linux.dev>
Reviewed-by: Simon Horman <horms@kernel.org>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Link: https://lore.kernel.org/r/20240111194917.4044654-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/mptcp/subflow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 45b8115b363b..d6ee0e52ea41 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -788,7 +788,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
 
 	} else if (subflow_req->mp_join) {
 		mptcp_get_options(skb, &mp_opt);
-		if (!(mp_opt.suboptions & OPTIONS_MPTCP_MPJ) ||
+		if (!(mp_opt.suboptions & OPTION_MPTCP_MPJ_ACK) ||
 		    !subflow_hmac_valid(req, &mp_opt) ||
 		    !mptcp_can_accept_new_subflow(subflow_req->msk)) {
 			SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINACKMAC);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 534/583] mptcp: use OPTION_MPTCP_MPJ_SYNACK in subflow_finish_connect()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (532 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 533/583] mptcp: strict validation before using mp_opt->hmac Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 535/583] mptcp: use OPTION_MPTCP_MPJ_SYN in subflow_check_req() Greg Kroah-Hartman
                   ` (55 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Florian Westphal,
	Peter Krystad, Matthieu Baerts, Mat Martineau, Geliang Tang,
	Simon Horman, Paolo Abeni, Jakub Kicinski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit be1d9d9d38da922bd4beeec5b6dd821ff5a1dfeb ]

subflow_finish_connect() uses four fields (backup, join_id, thmac, none)
that may contain garbage unless OPTION_MPTCP_MPJ_SYNACK has been set
in mptcp_parse_option()

Fixes: f296234c98a8 ("mptcp: Add handling of incoming MP_JOIN requests")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Florian Westphal <fw@strlen.de>
Cc: Peter Krystad <peter.krystad@linux.intel.com>
Cc: Matthieu Baerts <matttbe@kernel.org>
Cc: Mat Martineau <martineau@kernel.org>
Cc: Geliang Tang <geliang.tang@linux.dev>
Reviewed-by: Simon Horman <horms@kernel.org>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Link: https://lore.kernel.org/r/20240111194917.4044654-4-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/mptcp/subflow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index d6ee0e52ea41..5b37fee2a85a 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -506,7 +506,7 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb)
 	} else if (subflow->request_join) {
 		u8 hmac[SHA256_DIGEST_SIZE];
 
-		if (!(mp_opt.suboptions & OPTIONS_MPTCP_MPJ)) {
+		if (!(mp_opt.suboptions & OPTION_MPTCP_MPJ_SYNACK)) {
 			subflow->reset_reason = MPTCP_RST_EMPTCP;
 			goto do_reset;
 		}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 535/583] mptcp: use OPTION_MPTCP_MPJ_SYN in subflow_check_req()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (533 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 534/583] mptcp: use OPTION_MPTCP_MPJ_SYNACK in subflow_finish_connect() Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 536/583] mptcp: refine opt_mp_capable determination Greg Kroah-Hartman
                   ` (54 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, syzbot, Eric Dumazet,
	Florian Westphal, Peter Krystad, Matthieu Baerts, Mat Martineau,
	Geliang Tang, Simon Horman, Paolo Abeni, Jakub Kicinski,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 66ff70df1a919a066942844bb095d6fcb748d78d ]

syzbot reported that subflow_check_req() was using uninitialized data in
subflow_check_req() [1]

This is because mp_opt.token is only set when OPTION_MPTCP_MPJ_SYN is also set.

While we are are it, fix mptcp_subflow_init_cookie_req()
to test for OPTION_MPTCP_MPJ_ACK.

[1]

BUG: KMSAN: uninit-value in subflow_token_join_request net/mptcp/subflow.c:91 [inline]
 BUG: KMSAN: uninit-value in subflow_check_req+0x1028/0x15d0 net/mptcp/subflow.c:209
  subflow_token_join_request net/mptcp/subflow.c:91 [inline]
  subflow_check_req+0x1028/0x15d0 net/mptcp/subflow.c:209
  subflow_v6_route_req+0x269/0x410 net/mptcp/subflow.c:367
  tcp_conn_request+0x153a/0x4240 net/ipv4/tcp_input.c:7164
 subflow_v6_conn_request+0x3ee/0x510
  tcp_rcv_state_process+0x2e1/0x4ac0 net/ipv4/tcp_input.c:6659
  tcp_v6_do_rcv+0x11bf/0x1fe0 net/ipv6/tcp_ipv6.c:1669
  tcp_v6_rcv+0x480b/0x4fb0 net/ipv6/tcp_ipv6.c:1900
  ip6_protocol_deliver_rcu+0xda6/0x2a60 net/ipv6/ip6_input.c:438
  ip6_input_finish net/ipv6/ip6_input.c:483 [inline]
  NF_HOOK include/linux/netfilter.h:314 [inline]
  ip6_input+0x15d/0x430 net/ipv6/ip6_input.c:492
  dst_input include/net/dst.h:461 [inline]
  ip6_rcv_finish+0x5db/0x870 net/ipv6/ip6_input.c:79
  NF_HOOK include/linux/netfilter.h:314 [inline]
  ipv6_rcv+0xda/0x390 net/ipv6/ip6_input.c:310
  __netif_receive_skb_one_core net/core/dev.c:5532 [inline]
  __netif_receive_skb+0x1a6/0x5a0 net/core/dev.c:5646
  netif_receive_skb_internal net/core/dev.c:5732 [inline]
  netif_receive_skb+0x58/0x660 net/core/dev.c:5791
  tun_rx_batched+0x3ee/0x980 drivers/net/tun.c:1555
  tun_get_user+0x53af/0x66d0 drivers/net/tun.c:2002
  tun_chr_write_iter+0x3af/0x5d0 drivers/net/tun.c:2048
  call_write_iter include/linux/fs.h:2020 [inline]
  new_sync_write fs/read_write.c:491 [inline]
  vfs_write+0x8ef/0x1490 fs/read_write.c:584
  ksys_write+0x20f/0x4c0 fs/read_write.c:637
  __do_sys_write fs/read_write.c:649 [inline]
  __se_sys_write fs/read_write.c:646 [inline]
  __x64_sys_write+0x93/0xd0 fs/read_write.c:646
  do_syscall_x64 arch/x86/entry/common.c:52 [inline]
  do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

Local variable mp_opt created at:
  subflow_check_req+0x6d/0x15d0 net/mptcp/subflow.c:145
  subflow_v6_route_req+0x269/0x410 net/mptcp/subflow.c:367

CPU: 1 PID: 5924 Comm: syz-executor.3 Not tainted 6.7.0-rc8-syzkaller-00055-g5eff55d725a4 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023

Fixes: f296234c98a8 ("mptcp: Add handling of incoming MP_JOIN requests")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Florian Westphal <fw@strlen.de>
Cc: Peter Krystad <peter.krystad@linux.intel.com>
Cc: Matthieu Baerts <matttbe@kernel.org>
Cc: Mat Martineau <martineau@kernel.org>
Cc: Geliang Tang <geliang.tang@linux.dev>
Reviewed-by: Simon Horman <horms@kernel.org>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Link: https://lore.kernel.org/r/20240111194917.4044654-5-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/mptcp/subflow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 5b37fee2a85a..93f43a5cce40 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -158,7 +158,7 @@ static int subflow_check_req(struct request_sock *req,
 	mptcp_get_options(skb, &mp_opt);
 
 	opt_mp_capable = !!(mp_opt.suboptions & OPTIONS_MPTCP_MPC);
-	opt_mp_join = !!(mp_opt.suboptions & OPTIONS_MPTCP_MPJ);
+	opt_mp_join = !!(mp_opt.suboptions & OPTION_MPTCP_MPJ_SYN);
 	if (opt_mp_capable) {
 		SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_MPCAPABLEPASSIVE);
 
@@ -255,7 +255,7 @@ int mptcp_subflow_init_cookie_req(struct request_sock *req,
 	mptcp_get_options(skb, &mp_opt);
 
 	opt_mp_capable = !!(mp_opt.suboptions & OPTIONS_MPTCP_MPC);
-	opt_mp_join = !!(mp_opt.suboptions & OPTIONS_MPTCP_MPJ);
+	opt_mp_join = !!(mp_opt.suboptions & OPTION_MPTCP_MPJ_ACK);
 	if (opt_mp_capable && opt_mp_join)
 		return -EINVAL;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 536/583] mptcp: refine opt_mp_capable determination
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (534 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 535/583] mptcp: use OPTION_MPTCP_MPJ_SYN in subflow_check_req() Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 537/583] block: ensure we hold a queue reference when using queue limits Greg Kroah-Hartman
                   ` (53 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Paolo Abeni, Eric Dumazet,
	Simon Horman, Mat Martineau, Jakub Kicinski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 724b00c12957973656d312dce2a110c75ae2c680 ]

OPTIONS_MPTCP_MPC is a combination of three flags.

It would be better to be strict about testing what
flag is expected, at least for code readability.

mptcp_parse_option() already makes the distinction.

- subflow_check_req() should use OPTION_MPTCP_MPC_SYN.

- mptcp_subflow_init_cookie_req() should use OPTION_MPTCP_MPC_ACK.

- subflow_finish_connect() should use OPTION_MPTCP_MPC_SYNACK

- subflow_syn_recv_sock should use OPTION_MPTCP_MPC_ACK

Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Fixes: 74c7dfbee3e1 ("mptcp: consolidate in_opt sub-options fields in a bitmask")
Link: https://lore.kernel.org/r/20240111194917.4044654-6-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/mptcp/subflow.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 93f43a5cce40..70b7a47a53c7 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -157,7 +157,7 @@ static int subflow_check_req(struct request_sock *req,
 
 	mptcp_get_options(skb, &mp_opt);
 
-	opt_mp_capable = !!(mp_opt.suboptions & OPTIONS_MPTCP_MPC);
+	opt_mp_capable = !!(mp_opt.suboptions & OPTION_MPTCP_MPC_SYN);
 	opt_mp_join = !!(mp_opt.suboptions & OPTION_MPTCP_MPJ_SYN);
 	if (opt_mp_capable) {
 		SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_MPCAPABLEPASSIVE);
@@ -254,7 +254,7 @@ int mptcp_subflow_init_cookie_req(struct request_sock *req,
 	subflow_init_req(req, sk_listener);
 	mptcp_get_options(skb, &mp_opt);
 
-	opt_mp_capable = !!(mp_opt.suboptions & OPTIONS_MPTCP_MPC);
+	opt_mp_capable = !!(mp_opt.suboptions & OPTION_MPTCP_MPC_ACK);
 	opt_mp_join = !!(mp_opt.suboptions & OPTION_MPTCP_MPJ_ACK);
 	if (opt_mp_capable && opt_mp_join)
 		return -EINVAL;
@@ -486,7 +486,7 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb)
 
 	mptcp_get_options(skb, &mp_opt);
 	if (subflow->request_mptcp) {
-		if (!(mp_opt.suboptions & OPTIONS_MPTCP_MPC)) {
+		if (!(mp_opt.suboptions & OPTION_MPTCP_MPC_SYNACK)) {
 			MPTCP_INC_STATS(sock_net(sk),
 					MPTCP_MIB_MPCAPABLEACTIVEFALLBACK);
 			mptcp_do_fallback(sk);
@@ -783,7 +783,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
 		 * options.
 		 */
 		mptcp_get_options(skb, &mp_opt);
-		if (!(mp_opt.suboptions & OPTIONS_MPTCP_MPC))
+		if (!(mp_opt.suboptions & OPTION_MPTCP_MPC_ACK))
 			fallback = true;
 
 	} else if (subflow_req->mp_join) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 537/583] block: ensure we hold a queue reference when using queue limits
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (535 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 536/583] mptcp: refine opt_mp_capable determination Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 538/583] net: stmmac: Fix ethool link settings ops for integrated PCS Greg Kroah-Hartman
                   ` (52 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Ming Lei,
	Jens Axboe, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jens Axboe <axboe@kernel.dk>

[ Upstream commit 7b4f36cd22a65b750b4cb6ac14804fb7d6e6c67d ]

q_usage_counter is the only thing preventing us from the limits changing
under us in __bio_split_to_limits, but blk_mq_submit_bio doesn't hold
it while calling into it.

Move the splitting inside the region where we know we've got a queue
reference. Ideally this could still remain a shared section of code, but
let's keep the fix simple and defer any refactoring here to later.

Reported-by: Christoph Hellwig <hch@lst.de>
Fixes: 900e08075202 ("block: move queue enter logic into blk_mq_submit_bio()")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 block/blk-mq.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 20ecd0ab616f..6041e17492ec 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2968,12 +2968,6 @@ void blk_mq_submit_bio(struct bio *bio)
 	blk_status_t ret;
 
 	bio = blk_queue_bounce(bio, q);
-	if (bio_may_exceed_limits(bio, &q->limits)) {
-		bio = __bio_split_to_limits(bio, &q->limits, &nr_segs);
-		if (!bio)
-			return;
-	}
-
 	bio_set_ioprio(bio);
 
 	if (plug) {
@@ -2982,6 +2976,11 @@ void blk_mq_submit_bio(struct bio *bio)
 			rq = NULL;
 	}
 	if (rq) {
+		if (unlikely(bio_may_exceed_limits(bio, &q->limits))) {
+			bio = __bio_split_to_limits(bio, &q->limits, &nr_segs);
+			if (!bio)
+				return;
+		}
 		if (!bio_integrity_prep(bio))
 			return;
 		if (blk_mq_attempt_bio_merge(q, bio, nr_segs))
@@ -2992,6 +2991,11 @@ void blk_mq_submit_bio(struct bio *bio)
 	} else {
 		if (unlikely(bio_queue_enter(bio)))
 			return;
+		if (unlikely(bio_may_exceed_limits(bio, &q->limits))) {
+			bio = __bio_split_to_limits(bio, &q->limits, &nr_segs);
+			if (!bio)
+				goto fail;
+		}
 		if (!bio_integrity_prep(bio))
 			goto fail;
 	}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 538/583] net: stmmac: Fix ethool link settings ops for integrated PCS
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (536 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 537/583] block: ensure we hold a queue reference when using queue limits Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 539/583] udp: annotate data-races around up->pending Greg Kroah-Hartman
                   ` (51 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Sneh Shah, Simon Horman,
	David S. Miller, Sasha Levin, Andrew Halaney

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sneh Shah <quic_snehshah@quicinc.com>

[ Upstream commit 08300adac3b8dab9e2fd3be0155c7d3093c755f4 ]

Currently get/set_link_ksettings ethtool ops are dependent on PCS.
When PCS is integrated, it will not have separate link config.
Bypass configuring and checking PCS for integrated PCS.

Fixes: aa571b6275fb ("net: stmmac: add new switch to struct plat_stmmacenet_data")
Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8775p-ride
Signed-off-by: Sneh Shah <quic_snehshah@quicinc.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index aea5f898ebf4..419efe43951e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -311,8 +311,9 @@ static int stmmac_ethtool_get_link_ksettings(struct net_device *dev,
 {
 	struct stmmac_priv *priv = netdev_priv(dev);
 
-	if (priv->hw->pcs & STMMAC_PCS_RGMII ||
-	    priv->hw->pcs & STMMAC_PCS_SGMII) {
+	if (!(priv->plat->flags & STMMAC_FLAG_HAS_INTEGRATED_PCS) &&
+	    (priv->hw->pcs & STMMAC_PCS_RGMII ||
+	     priv->hw->pcs & STMMAC_PCS_SGMII)) {
 		struct rgmii_adv adv;
 		u32 supported, advertising, lp_advertising;
 
@@ -397,8 +398,9 @@ stmmac_ethtool_set_link_ksettings(struct net_device *dev,
 {
 	struct stmmac_priv *priv = netdev_priv(dev);
 
-	if (priv->hw->pcs & STMMAC_PCS_RGMII ||
-	    priv->hw->pcs & STMMAC_PCS_SGMII) {
+	if (!(priv->plat->flags & STMMAC_FLAG_HAS_INTEGRATED_PCS) &&
+	    (priv->hw->pcs & STMMAC_PCS_RGMII ||
+	     priv->hw->pcs & STMMAC_PCS_SGMII)) {
 		/* Only support ANE */
 		if (cmd->base.autoneg != AUTONEG_ENABLE)
 			return -EINVAL;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 539/583] udp: annotate data-races around up->pending
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (537 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 538/583] net: stmmac: Fix ethool link settings ops for integrated PCS Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 540/583] erofs: simplify compression configuration parser Greg Kroah-Hartman
                   ` (50 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, syzbot+8d482d0e407f665d9d10,
	Eric Dumazet, Jiri Pirko, David S. Miller, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 482521d8e0c6520429478aa6866cd44128b33d5d ]

up->pending can be read without holding the socket lock,
as pointed out by syzbot [1]

Add READ_ONCE() in lockless contexts, and WRITE_ONCE()
on write side.

[1]
BUG: KCSAN: data-race in udpv6_sendmsg / udpv6_sendmsg

write to 0xffff88814e5eadf0 of 4 bytes by task 15547 on cpu 1:
 udpv6_sendmsg+0x1405/0x1530 net/ipv6/udp.c:1596
 inet6_sendmsg+0x63/0x80 net/ipv6/af_inet6.c:657
 sock_sendmsg_nosec net/socket.c:730 [inline]
 __sock_sendmsg net/socket.c:745 [inline]
 __sys_sendto+0x257/0x310 net/socket.c:2192
 __do_sys_sendto net/socket.c:2204 [inline]
 __se_sys_sendto net/socket.c:2200 [inline]
 __x64_sys_sendto+0x78/0x90 net/socket.c:2200
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

read to 0xffff88814e5eadf0 of 4 bytes by task 15551 on cpu 0:
 udpv6_sendmsg+0x22c/0x1530 net/ipv6/udp.c:1373
 inet6_sendmsg+0x63/0x80 net/ipv6/af_inet6.c:657
 sock_sendmsg_nosec net/socket.c:730 [inline]
 __sock_sendmsg net/socket.c:745 [inline]
 ____sys_sendmsg+0x37c/0x4d0 net/socket.c:2586
 ___sys_sendmsg net/socket.c:2640 [inline]
 __sys_sendmmsg+0x269/0x500 net/socket.c:2726
 __do_sys_sendmmsg net/socket.c:2755 [inline]
 __se_sys_sendmmsg net/socket.c:2752 [inline]
 __x64_sys_sendmmsg+0x57/0x60 net/socket.c:2752
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

value changed: 0x00000000 -> 0x0000000a

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 15551 Comm: syz-executor.1 Tainted: G        W          6.7.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: syzbot+8d482d0e407f665d9d10@syzkaller.appspotmail.com
Link: https://lore.kernel.org/netdev/0000000000009e46c3060ebcdffd@google.com/
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv4/udp.c | 12 ++++++------
 net/ipv6/udp.c | 16 ++++++++--------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index c3ff984b6354..bd12a7658213 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -805,7 +805,7 @@ void udp_flush_pending_frames(struct sock *sk)
 
 	if (up->pending) {
 		up->len = 0;
-		up->pending = 0;
+		WRITE_ONCE(up->pending, 0);
 		ip_flush_pending_frames(sk);
 	}
 }
@@ -993,7 +993,7 @@ int udp_push_pending_frames(struct sock *sk)
 
 out:
 	up->len = 0;
-	up->pending = 0;
+	WRITE_ONCE(up->pending, 0);
 	return err;
 }
 EXPORT_SYMBOL(udp_push_pending_frames);
@@ -1069,7 +1069,7 @@ int udp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 	getfrag = is_udplite ? udplite_getfrag : ip_generic_getfrag;
 
 	fl4 = &inet->cork.fl.u.ip4;
-	if (up->pending) {
+	if (READ_ONCE(up->pending)) {
 		/*
 		 * There are pending frames.
 		 * The socket lock must be held while it's corked.
@@ -1265,7 +1265,7 @@ int udp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 	fl4->saddr = saddr;
 	fl4->fl4_dport = dport;
 	fl4->fl4_sport = inet->inet_sport;
-	up->pending = AF_INET;
+	WRITE_ONCE(up->pending, AF_INET);
 
 do_append_data:
 	up->len += ulen;
@@ -1277,7 +1277,7 @@ int udp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 	else if (!corkreq)
 		err = udp_push_pending_frames(sk);
 	else if (unlikely(skb_queue_empty(&sk->sk_write_queue)))
-		up->pending = 0;
+		WRITE_ONCE(up->pending, 0);
 	release_sock(sk);
 
 out:
@@ -1315,7 +1315,7 @@ void udp_splice_eof(struct socket *sock)
 	struct sock *sk = sock->sk;
 	struct udp_sock *up = udp_sk(sk);
 
-	if (!up->pending || udp_test_bit(CORK, sk))
+	if (!READ_ONCE(up->pending) || udp_test_bit(CORK, sk))
 		return;
 
 	lock_sock(sk);
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index f60ba4295435..f1170dcc21d9 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1134,7 +1134,7 @@ static void udp_v6_flush_pending_frames(struct sock *sk)
 		udp_flush_pending_frames(sk);
 	else if (up->pending) {
 		up->len = 0;
-		up->pending = 0;
+		WRITE_ONCE(up->pending, 0);
 		ip6_flush_pending_frames(sk);
 	}
 }
@@ -1312,7 +1312,7 @@ static int udp_v6_push_pending_frames(struct sock *sk)
 			      &inet_sk(sk)->cork.base);
 out:
 	up->len = 0;
-	up->pending = 0;
+	WRITE_ONCE(up->pending, 0);
 	return err;
 }
 
@@ -1369,7 +1369,7 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 		default:
 			return -EINVAL;
 		}
-	} else if (!up->pending) {
+	} else if (!READ_ONCE(up->pending)) {
 		if (sk->sk_state != TCP_ESTABLISHED)
 			return -EDESTADDRREQ;
 		daddr = &sk->sk_v6_daddr;
@@ -1400,8 +1400,8 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 		return -EMSGSIZE;
 
 	getfrag  =  is_udplite ?  udplite_getfrag : ip_generic_getfrag;
-	if (up->pending) {
-		if (up->pending == AF_INET)
+	if (READ_ONCE(up->pending)) {
+		if (READ_ONCE(up->pending) == AF_INET)
 			return udp_sendmsg(sk, msg, len);
 		/*
 		 * There are pending frames.
@@ -1591,7 +1591,7 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 		goto out;
 	}
 
-	up->pending = AF_INET6;
+	WRITE_ONCE(up->pending, AF_INET6);
 
 do_append_data:
 	if (ipc6.dontfrag < 0)
@@ -1605,7 +1605,7 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
 	else if (!corkreq)
 		err = udp_v6_push_pending_frames(sk);
 	else if (unlikely(skb_queue_empty(&sk->sk_write_queue)))
-		up->pending = 0;
+		WRITE_ONCE(up->pending, 0);
 
 	if (err > 0)
 		err = np->recverr ? net_xmit_errno(err) : 0;
@@ -1646,7 +1646,7 @@ static void udpv6_splice_eof(struct socket *sock)
 	struct sock *sk = sock->sk;
 	struct udp_sock *up = udp_sk(sk);
 
-	if (!up->pending || udp_test_bit(CORK, sk))
+	if (!READ_ONCE(up->pending) || udp_test_bit(CORK, sk))
 		return;
 
 	lock_sock(sk);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 540/583] erofs: simplify compression configuration parser
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (538 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 539/583] udp: annotate data-races around up->pending Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 541/583] erofs: fix inconsistent per-file compression format Greg Kroah-Hartman
                   ` (49 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Chao Yu, Gao Xiang, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Gao Xiang <hsiangkao@linux.alibaba.com>

[ Upstream commit efb4fb02cef3ab410b603c8f0e1c67f61d55f542 ]

Move erofs_load_compr_cfgs() into decompressor.c as well as introduce
a callback instead of a hard-coded switch for each algorithm for
simplicity.

Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20231022130957.11398-1-xiang@kernel.org
Stable-dep-of: 118a8cf504d7 ("erofs: fix inconsistent per-file compression format")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/erofs/compress.h             |  6 +++
 fs/erofs/decompressor.c         | 62 ++++++++++++++++++++++++++--
 fs/erofs/decompressor_deflate.c |  5 ++-
 fs/erofs/decompressor_lzma.c    |  4 +-
 fs/erofs/internal.h             | 38 +----------------
 fs/erofs/super.c                | 72 ++++-----------------------------
 6 files changed, 79 insertions(+), 108 deletions(-)

diff --git a/fs/erofs/compress.h b/fs/erofs/compress.h
index 349c3316ae6b..279933e007d2 100644
--- a/fs/erofs/compress.h
+++ b/fs/erofs/compress.h
@@ -21,6 +21,8 @@ struct z_erofs_decompress_req {
 };
 
 struct z_erofs_decompressor {
+	int (*config)(struct super_block *sb, struct erofs_super_block *dsb,
+		      void *data, int size);
 	int (*decompress)(struct z_erofs_decompress_req *rq,
 			  struct page **pagepool);
 	char *name;
@@ -92,6 +94,10 @@ int z_erofs_fixup_insize(struct z_erofs_decompress_req *rq, const char *padbuf,
 extern const struct z_erofs_decompressor erofs_decompressors[];
 
 /* prototypes for specific algorithms */
+int z_erofs_load_lzma_config(struct super_block *sb,
+			struct erofs_super_block *dsb, void *data, int size);
+int z_erofs_load_deflate_config(struct super_block *sb,
+			struct erofs_super_block *dsb, void *data, int size);
 int z_erofs_lzma_decompress(struct z_erofs_decompress_req *rq,
 			    struct page **pagepool);
 int z_erofs_deflate_decompress(struct z_erofs_decompress_req *rq,
diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c
index 332ec5f74002..e75edc8f1753 100644
--- a/fs/erofs/decompressor.c
+++ b/fs/erofs/decompressor.c
@@ -24,11 +24,11 @@ struct z_erofs_lz4_decompress_ctx {
 	unsigned int oend;
 };
 
-int z_erofs_load_lz4_config(struct super_block *sb,
-			    struct erofs_super_block *dsb,
-			    struct z_erofs_lz4_cfgs *lz4, int size)
+static int z_erofs_load_lz4_config(struct super_block *sb,
+			    struct erofs_super_block *dsb, void *data, int size)
 {
 	struct erofs_sb_info *sbi = EROFS_SB(sb);
+	struct z_erofs_lz4_cfgs *lz4 = data;
 	u16 distance;
 
 	if (lz4) {
@@ -370,19 +370,75 @@ const struct z_erofs_decompressor erofs_decompressors[] = {
 		.name = "interlaced"
 	},
 	[Z_EROFS_COMPRESSION_LZ4] = {
+		.config = z_erofs_load_lz4_config,
 		.decompress = z_erofs_lz4_decompress,
 		.name = "lz4"
 	},
 #ifdef CONFIG_EROFS_FS_ZIP_LZMA
 	[Z_EROFS_COMPRESSION_LZMA] = {
+		.config = z_erofs_load_lzma_config,
 		.decompress = z_erofs_lzma_decompress,
 		.name = "lzma"
 	},
 #endif
 #ifdef CONFIG_EROFS_FS_ZIP_DEFLATE
 	[Z_EROFS_COMPRESSION_DEFLATE] = {
+		.config = z_erofs_load_deflate_config,
 		.decompress = z_erofs_deflate_decompress,
 		.name = "deflate"
 	},
 #endif
 };
+
+int z_erofs_parse_cfgs(struct super_block *sb, struct erofs_super_block *dsb)
+{
+	struct erofs_sb_info *sbi = EROFS_SB(sb);
+	struct erofs_buf buf = __EROFS_BUF_INITIALIZER;
+	unsigned int algs, alg;
+	erofs_off_t offset;
+	int size, ret = 0;
+
+	if (!erofs_sb_has_compr_cfgs(sbi)) {
+		sbi->available_compr_algs = Z_EROFS_COMPRESSION_LZ4;
+		return z_erofs_load_lz4_config(sb, dsb, NULL, 0);
+	}
+
+	sbi->available_compr_algs = le16_to_cpu(dsb->u1.available_compr_algs);
+	if (sbi->available_compr_algs & ~Z_EROFS_ALL_COMPR_ALGS) {
+		erofs_err(sb, "unidentified algorithms %x, please upgrade kernel",
+			  sbi->available_compr_algs & ~Z_EROFS_ALL_COMPR_ALGS);
+		return -EOPNOTSUPP;
+	}
+
+	erofs_init_metabuf(&buf, sb);
+	offset = EROFS_SUPER_OFFSET + sbi->sb_size;
+	alg = 0;
+	for (algs = sbi->available_compr_algs; algs; algs >>= 1, ++alg) {
+		void *data;
+
+		if (!(algs & 1))
+			continue;
+
+		data = erofs_read_metadata(sb, &buf, &offset, &size);
+		if (IS_ERR(data)) {
+			ret = PTR_ERR(data);
+			break;
+		}
+
+		if (alg >= ARRAY_SIZE(erofs_decompressors) ||
+		    !erofs_decompressors[alg].config) {
+			erofs_err(sb, "algorithm %d isn't enabled on this kernel",
+				  alg);
+			ret = -EOPNOTSUPP;
+		} else {
+			ret = erofs_decompressors[alg].config(sb,
+					dsb, data, size);
+		}
+
+		kfree(data);
+		if (ret)
+			break;
+	}
+	erofs_put_metabuf(&buf);
+	return ret;
+}
diff --git a/fs/erofs/decompressor_deflate.c b/fs/erofs/decompressor_deflate.c
index 19e5bdeb30b6..0e1946a6bda5 100644
--- a/fs/erofs/decompressor_deflate.c
+++ b/fs/erofs/decompressor_deflate.c
@@ -77,9 +77,10 @@ int __init z_erofs_deflate_init(void)
 }
 
 int z_erofs_load_deflate_config(struct super_block *sb,
-				struct erofs_super_block *dsb,
-				struct z_erofs_deflate_cfgs *dfl, int size)
+			struct erofs_super_block *dsb, void *data, int size)
 {
+	struct z_erofs_deflate_cfgs *dfl = data;
+
 	if (!dfl || size < sizeof(struct z_erofs_deflate_cfgs)) {
 		erofs_err(sb, "invalid deflate cfgs, size=%u", size);
 		return -EINVAL;
diff --git a/fs/erofs/decompressor_lzma.c b/fs/erofs/decompressor_lzma.c
index dee10d22ada9..ba4ec73f4aae 100644
--- a/fs/erofs/decompressor_lzma.c
+++ b/fs/erofs/decompressor_lzma.c
@@ -72,10 +72,10 @@ int __init z_erofs_lzma_init(void)
 }
 
 int z_erofs_load_lzma_config(struct super_block *sb,
-			     struct erofs_super_block *dsb,
-			     struct z_erofs_lzma_cfgs *lzma, int size)
+			struct erofs_super_block *dsb, void *data, int size)
 {
 	static DEFINE_MUTEX(lzma_resize_mutex);
+	struct z_erofs_lzma_cfgs *lzma = data;
 	unsigned int dict_size, i;
 	struct z_erofs_lzma *strm, *head = NULL;
 	int err;
diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
index 4ff88d0dd980..d8de61350dc0 100644
--- a/fs/erofs/internal.h
+++ b/fs/erofs/internal.h
@@ -469,9 +469,6 @@ int __init z_erofs_init_zip_subsystem(void);
 void z_erofs_exit_zip_subsystem(void);
 int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi,
 				       struct erofs_workgroup *egrp);
-int z_erofs_load_lz4_config(struct super_block *sb,
-			    struct erofs_super_block *dsb,
-			    struct z_erofs_lz4_cfgs *lz4, int len);
 int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *map,
 			    int flags);
 void *erofs_get_pcpubuf(unsigned int requiredpages);
@@ -480,6 +477,7 @@ int erofs_pcpubuf_growsize(unsigned int nrpages);
 void __init erofs_pcpubuf_init(void);
 void erofs_pcpubuf_exit(void);
 int erofs_init_managed_cache(struct super_block *sb);
+int z_erofs_parse_cfgs(struct super_block *sb, struct erofs_super_block *dsb);
 #else
 static inline void erofs_shrinker_register(struct super_block *sb) {}
 static inline void erofs_shrinker_unregister(struct super_block *sb) {}
@@ -487,16 +485,6 @@ static inline int erofs_init_shrinker(void) { return 0; }
 static inline void erofs_exit_shrinker(void) {}
 static inline int z_erofs_init_zip_subsystem(void) { return 0; }
 static inline void z_erofs_exit_zip_subsystem(void) {}
-static inline int z_erofs_load_lz4_config(struct super_block *sb,
-				  struct erofs_super_block *dsb,
-				  struct z_erofs_lz4_cfgs *lz4, int len)
-{
-	if (lz4 || dsb->u1.lz4_max_distance) {
-		erofs_err(sb, "lz4 algorithm isn't enabled");
-		return -EINVAL;
-	}
-	return 0;
-}
 static inline void erofs_pcpubuf_init(void) {}
 static inline void erofs_pcpubuf_exit(void) {}
 static inline int erofs_init_managed_cache(struct super_block *sb) { return 0; }
@@ -505,41 +493,17 @@ static inline int erofs_init_managed_cache(struct super_block *sb) { return 0; }
 #ifdef CONFIG_EROFS_FS_ZIP_LZMA
 int __init z_erofs_lzma_init(void);
 void z_erofs_lzma_exit(void);
-int z_erofs_load_lzma_config(struct super_block *sb,
-			     struct erofs_super_block *dsb,
-			     struct z_erofs_lzma_cfgs *lzma, int size);
 #else
 static inline int z_erofs_lzma_init(void) { return 0; }
 static inline int z_erofs_lzma_exit(void) { return 0; }
-static inline int z_erofs_load_lzma_config(struct super_block *sb,
-			     struct erofs_super_block *dsb,
-			     struct z_erofs_lzma_cfgs *lzma, int size) {
-	if (lzma) {
-		erofs_err(sb, "lzma algorithm isn't enabled");
-		return -EINVAL;
-	}
-	return 0;
-}
 #endif	/* !CONFIG_EROFS_FS_ZIP_LZMA */
 
 #ifdef CONFIG_EROFS_FS_ZIP_DEFLATE
 int __init z_erofs_deflate_init(void);
 void z_erofs_deflate_exit(void);
-int z_erofs_load_deflate_config(struct super_block *sb,
-				struct erofs_super_block *dsb,
-				struct z_erofs_deflate_cfgs *dfl, int size);
 #else
 static inline int z_erofs_deflate_init(void) { return 0; }
 static inline int z_erofs_deflate_exit(void) { return 0; }
-static inline int z_erofs_load_deflate_config(struct super_block *sb,
-			struct erofs_super_block *dsb,
-			struct z_erofs_deflate_cfgs *dfl, int size) {
-	if (dfl) {
-		erofs_err(sb, "deflate algorithm isn't enabled");
-		return -EINVAL;
-	}
-	return 0;
-}
 #endif	/* !CONFIG_EROFS_FS_ZIP_DEFLATE */
 
 #ifdef CONFIG_EROFS_FS_ONDEMAND
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 3700af9ee173..cc44fb2e001e 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -156,68 +156,15 @@ void *erofs_read_metadata(struct super_block *sb, struct erofs_buf *buf,
 	return buffer;
 }
 
-#ifdef CONFIG_EROFS_FS_ZIP
-static int erofs_load_compr_cfgs(struct super_block *sb,
-				 struct erofs_super_block *dsb)
+#ifndef CONFIG_EROFS_FS_ZIP
+static int z_erofs_parse_cfgs(struct super_block *sb,
+			      struct erofs_super_block *dsb)
 {
-	struct erofs_sb_info *sbi = EROFS_SB(sb);
-	struct erofs_buf buf = __EROFS_BUF_INITIALIZER;
-	unsigned int algs, alg;
-	erofs_off_t offset;
-	int size, ret = 0;
-
-	sbi->available_compr_algs = le16_to_cpu(dsb->u1.available_compr_algs);
-	if (sbi->available_compr_algs & ~Z_EROFS_ALL_COMPR_ALGS) {
-		erofs_err(sb, "try to load compressed fs with unsupported algorithms %x",
-			  sbi->available_compr_algs & ~Z_EROFS_ALL_COMPR_ALGS);
-		return -EINVAL;
-	}
-
-	erofs_init_metabuf(&buf, sb);
-	offset = EROFS_SUPER_OFFSET + sbi->sb_size;
-	alg = 0;
-	for (algs = sbi->available_compr_algs; algs; algs >>= 1, ++alg) {
-		void *data;
-
-		if (!(algs & 1))
-			continue;
-
-		data = erofs_read_metadata(sb, &buf, &offset, &size);
-		if (IS_ERR(data)) {
-			ret = PTR_ERR(data);
-			break;
-		}
+	if (!dsb->u1.available_compr_algs)
+		return 0;
 
-		switch (alg) {
-		case Z_EROFS_COMPRESSION_LZ4:
-			ret = z_erofs_load_lz4_config(sb, dsb, data, size);
-			break;
-		case Z_EROFS_COMPRESSION_LZMA:
-			ret = z_erofs_load_lzma_config(sb, dsb, data, size);
-			break;
-		case Z_EROFS_COMPRESSION_DEFLATE:
-			ret = z_erofs_load_deflate_config(sb, dsb, data, size);
-			break;
-		default:
-			DBG_BUGON(1);
-			ret = -EFAULT;
-		}
-		kfree(data);
-		if (ret)
-			break;
-	}
-	erofs_put_metabuf(&buf);
-	return ret;
-}
-#else
-static int erofs_load_compr_cfgs(struct super_block *sb,
-				 struct erofs_super_block *dsb)
-{
-	if (dsb->u1.available_compr_algs) {
-		erofs_err(sb, "try to load compressed fs when compression is disabled");
-		return -EINVAL;
-	}
-	return 0;
+	erofs_err(sb, "compression disabled, unable to mount compressed EROFS");
+	return -EOPNOTSUPP;
 }
 #endif
 
@@ -406,10 +353,7 @@ static int erofs_read_superblock(struct super_block *sb)
 	}
 
 	/* parse on-disk compression configurations */
-	if (erofs_sb_has_compr_cfgs(sbi))
-		ret = erofs_load_compr_cfgs(sb, dsb);
-	else
-		ret = z_erofs_load_lz4_config(sb, dsb, NULL, 0);
+	ret = z_erofs_parse_cfgs(sb, dsb);
 	if (ret < 0)
 		goto out;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 541/583] erofs: fix inconsistent per-file compression format
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (539 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 540/583] erofs: simplify compression configuration parser Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 542/583] net: add more sanity check in virtio_net_hdr_to_skb() Greg Kroah-Hartman
                   ` (48 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, bugreport, Yue Hu, Gao Xiang, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Gao Xiang <hsiangkao@linux.alibaba.com>

[ Upstream commit 118a8cf504d7dfa519562d000f423ee3ca75d2c4 ]

EROFS can select compression algorithms on a per-file basis, and each
per-file compression algorithm needs to be marked in the on-disk
superblock for initialization.

However, syzkaller can generate inconsistent crafted images that use
an unsupported algorithmtype for specific inodes, e.g. use MicroLZMA
algorithmtype even it's not set in `sbi->available_compr_algs`.  This
can lead to an unexpected "BUG: kernel NULL pointer dereference" if
the corresponding decompressor isn't built-in.

Fix this by checking against `sbi->available_compr_algs` for each
m_algorithmformat request.  Incorrect !erofs_sb_has_compr_cfgs preset
bitmap is now fixed together since it was harmless previously.

Reported-by: <bugreport@ubisectech.com>
Fixes: 8f89926290c4 ("erofs: get compression algorithms directly on mapping")
Fixes: 622ceaddb764 ("erofs: lzma compression support")
Reviewed-by: Yue Hu <huyue2@coolpad.com>
Link: https://lore.kernel.org/r/20240113150602.1471050-1-hsiangkao@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/erofs/decompressor.c |  2 +-
 fs/erofs/zmap.c         | 23 +++++++++++++----------
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c
index e75edc8f1753..8d1f86487d6e 100644
--- a/fs/erofs/decompressor.c
+++ b/fs/erofs/decompressor.c
@@ -399,7 +399,7 @@ int z_erofs_parse_cfgs(struct super_block *sb, struct erofs_super_block *dsb)
 	int size, ret = 0;
 
 	if (!erofs_sb_has_compr_cfgs(sbi)) {
-		sbi->available_compr_algs = Z_EROFS_COMPRESSION_LZ4;
+		sbi->available_compr_algs = 1 << Z_EROFS_COMPRESSION_LZ4;
 		return z_erofs_load_lz4_config(sb, dsb, NULL, 0);
 	}
 
diff --git a/fs/erofs/zmap.c b/fs/erofs/zmap.c
index 7b55111fd533..7a1a24ae4a2d 100644
--- a/fs/erofs/zmap.c
+++ b/fs/erofs/zmap.c
@@ -458,7 +458,7 @@ static int z_erofs_do_map_blocks(struct inode *inode,
 		.map = map,
 	};
 	int err = 0;
-	unsigned int lclusterbits, endoff;
+	unsigned int lclusterbits, endoff, afmt;
 	unsigned long initial_lcn;
 	unsigned long long ofs, end;
 
@@ -547,17 +547,20 @@ static int z_erofs_do_map_blocks(struct inode *inode,
 			err = -EFSCORRUPTED;
 			goto unmap_out;
 		}
-		if (vi->z_advise & Z_EROFS_ADVISE_INTERLACED_PCLUSTER)
-			map->m_algorithmformat =
-				Z_EROFS_COMPRESSION_INTERLACED;
-		else
-			map->m_algorithmformat =
-				Z_EROFS_COMPRESSION_SHIFTED;
-	} else if (m.headtype == Z_EROFS_LCLUSTER_TYPE_HEAD2) {
-		map->m_algorithmformat = vi->z_algorithmtype[1];
+		afmt = vi->z_advise & Z_EROFS_ADVISE_INTERLACED_PCLUSTER ?
+			Z_EROFS_COMPRESSION_INTERLACED :
+			Z_EROFS_COMPRESSION_SHIFTED;
 	} else {
-		map->m_algorithmformat = vi->z_algorithmtype[0];
+		afmt = m.headtype == Z_EROFS_LCLUSTER_TYPE_HEAD2 ?
+			vi->z_algorithmtype[1] : vi->z_algorithmtype[0];
+		if (!(EROFS_I_SB(inode)->available_compr_algs & (1 << afmt))) {
+			erofs_err(inode->i_sb, "inconsistent algorithmtype %u for nid %llu",
+				  afmt, vi->nid);
+			err = -EFSCORRUPTED;
+			goto unmap_out;
+		}
 	}
+	map->m_algorithmformat = afmt;
 
 	if ((flags & EROFS_GET_BLOCKS_FIEMAP) ||
 	    ((flags & EROFS_GET_BLOCKS_READMORE) &&
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 542/583] net: add more sanity check in virtio_net_hdr_to_skb()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (540 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 541/583] erofs: fix inconsistent per-file compression format Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 543/583] net: netdev_queue: netdev_txq_completed_mb(): fix wake condition Greg Kroah-Hartman
                   ` (47 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, syzbot+7f4d0ea3df4d4fa9a65f,
	Eric Dumazet, Willem de Bruijn, David S. Miller, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

[ Upstream commit 9181d6f8a2bb32d158de66a84164fac05e3ddd18 ]

syzbot/KMSAN reports access to uninitialized data from gso_features_check() [1]

The repro use af_packet, injecting a gso packet and hdrlen == 0.

We could fix the issue making gso_features_check() more careful
while dealing with NETIF_F_TSO_MANGLEID in fast path.

Or we can make sure virtio_net_hdr_to_skb() pulls minimal network and
transport headers as intended.

Note that for GSO packets coming from untrusted sources, SKB_GSO_DODGY
bit forces a proper header validation (and pull) before the packet can
hit any device ndo_start_xmit(), thus we do not need a precise disection
at virtio_net_hdr_to_skb() stage.

[1]
BUG: KMSAN: uninit-value in skb_gso_segment include/net/gso.h:83 [inline]
BUG: KMSAN: uninit-value in validate_xmit_skb+0x10f2/0x1930 net/core/dev.c:3629
 skb_gso_segment include/net/gso.h:83 [inline]
 validate_xmit_skb+0x10f2/0x1930 net/core/dev.c:3629
 __dev_queue_xmit+0x1eac/0x5130 net/core/dev.c:4341
 dev_queue_xmit include/linux/netdevice.h:3134 [inline]
 packet_xmit+0x9c/0x6b0 net/packet/af_packet.c:276
 packet_snd net/packet/af_packet.c:3087 [inline]
 packet_sendmsg+0x8b1d/0x9f30 net/packet/af_packet.c:3119
 sock_sendmsg_nosec net/socket.c:730 [inline]
 __sock_sendmsg net/socket.c:745 [inline]
 ____sys_sendmsg+0x9c2/0xd60 net/socket.c:2584
 ___sys_sendmsg+0x28d/0x3c0 net/socket.c:2638
 __sys_sendmsg net/socket.c:2667 [inline]
 __do_sys_sendmsg net/socket.c:2676 [inline]
 __se_sys_sendmsg net/socket.c:2674 [inline]
 __x64_sys_sendmsg+0x307/0x490 net/socket.c:2674
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

Uninit was created at:
 slab_post_alloc_hook+0x129/0xa70 mm/slab.h:768
 slab_alloc_node mm/slub.c:3478 [inline]
 kmem_cache_alloc_node+0x5e9/0xb10 mm/slub.c:3523
 kmalloc_reserve+0x13d/0x4a0 net/core/skbuff.c:560
 __alloc_skb+0x318/0x740 net/core/skbuff.c:651
 alloc_skb include/linux/skbuff.h:1286 [inline]
 alloc_skb_with_frags+0xc8/0xbd0 net/core/skbuff.c:6334
 sock_alloc_send_pskb+0xa80/0xbf0 net/core/sock.c:2780
 packet_alloc_skb net/packet/af_packet.c:2936 [inline]
 packet_snd net/packet/af_packet.c:3030 [inline]
 packet_sendmsg+0x70e8/0x9f30 net/packet/af_packet.c:3119
 sock_sendmsg_nosec net/socket.c:730 [inline]
 __sock_sendmsg net/socket.c:745 [inline]
 ____sys_sendmsg+0x9c2/0xd60 net/socket.c:2584
 ___sys_sendmsg+0x28d/0x3c0 net/socket.c:2638
 __sys_sendmsg net/socket.c:2667 [inline]
 __do_sys_sendmsg net/socket.c:2676 [inline]
 __se_sys_sendmsg net/socket.c:2674 [inline]
 __x64_sys_sendmsg+0x307/0x490 net/socket.c:2674
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

CPU: 0 PID: 5025 Comm: syz-executor279 Not tainted 6.7.0-rc7-syzkaller-00003-gfbafc3e621c3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023

Reported-by: syzbot+7f4d0ea3df4d4fa9a65f@syzkaller.appspotmail.com
Link: https://lore.kernel.org/netdev/0000000000005abd7b060eb160cd@google.com/
Fixes: 9274124f023b ("net: stricter validation of untrusted gso packets")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/virtio_net.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 27cc1d464321..4dfa9b69ca8d 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -3,6 +3,8 @@
 #define _LINUX_VIRTIO_NET_H
 
 #include <linux/if_vlan.h>
+#include <linux/ip.h>
+#include <linux/ipv6.h>
 #include <linux/udp.h>
 #include <uapi/linux/tcp.h>
 #include <uapi/linux/virtio_net.h>
@@ -49,6 +51,7 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,
 					const struct virtio_net_hdr *hdr,
 					bool little_endian)
 {
+	unsigned int nh_min_len = sizeof(struct iphdr);
 	unsigned int gso_type = 0;
 	unsigned int thlen = 0;
 	unsigned int p_off = 0;
@@ -65,6 +68,7 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,
 			gso_type = SKB_GSO_TCPV6;
 			ip_proto = IPPROTO_TCP;
 			thlen = sizeof(struct tcphdr);
+			nh_min_len = sizeof(struct ipv6hdr);
 			break;
 		case VIRTIO_NET_HDR_GSO_UDP:
 			gso_type = SKB_GSO_UDP;
@@ -100,7 +104,8 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,
 		if (!skb_partial_csum_set(skb, start, off))
 			return -EINVAL;
 
-		p_off = skb_transport_offset(skb) + thlen;
+		nh_min_len = max_t(u32, nh_min_len, skb_transport_offset(skb));
+		p_off = nh_min_len + thlen;
 		if (!pskb_may_pull(skb, p_off))
 			return -EINVAL;
 	} else {
@@ -140,7 +145,7 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,
 
 			skb_set_transport_header(skb, keys.control.thoff);
 		} else if (gso_type) {
-			p_off = thlen;
+			p_off = nh_min_len + thlen;
 			if (!pskb_may_pull(skb, p_off))
 				return -EINVAL;
 		}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 543/583] net: netdev_queue: netdev_txq_completed_mb(): fix wake condition
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (541 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 542/583] net: add more sanity check in virtio_net_hdr_to_skb() Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 544/583] bpf: iter_udp: Retry with a larger batch size without going back to the previous bucket Greg Kroah-Hartman
                   ` (46 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Marc Kleine-Budde, Jakub Kicinski,
	David S. Miller, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Marc Kleine-Budde <mkl@pengutronix.de>

[ Upstream commit 894d7508316e7ad722df597d68b4b1797a9eee11 ]

netif_txq_try_stop() uses "get_desc >= start_thrs" as the check for
the call to netif_tx_start_queue().

Use ">=" i netdev_txq_completed_mb(), too.

Fixes: c91c46de6bbc ("net: provide macros for commonly copied lockless queue stop/wake code")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/net/netdev_queues.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/netdev_queues.h b/include/net/netdev_queues.h
index d68b0a483431..8b8ed4e13d74 100644
--- a/include/net/netdev_queues.h
+++ b/include/net/netdev_queues.h
@@ -128,7 +128,7 @@ netdev_txq_completed_mb(struct netdev_queue *dev_queue,
 		netdev_txq_completed_mb(txq, pkts, bytes);		\
 									\
 		_res = -1;						\
-		if (pkts && likely(get_desc > start_thrs)) {		\
+		if (pkts && likely(get_desc >= start_thrs)) {		\
 			_res = 1;					\
 			if (unlikely(netif_tx_queue_stopped(txq)) &&	\
 			    !(down_cond)) {				\
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 544/583] bpf: iter_udp: Retry with a larger batch size without going back to the previous bucket
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (542 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 543/583] net: netdev_queue: netdev_txq_completed_mb(): fix wake condition Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 545/583] bpf: Avoid iter->offset making backward progress in bpf_iter_udp Greg Kroah-Hartman
                   ` (45 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Aditi Ghag, Yonghong Song,
	Martin KaFai Lau, Alexei Starovoitov, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Martin KaFai Lau <martin.lau@kernel.org>

[ Upstream commit 19ca0823f6eaad01d18f664a00550abe912c034c ]

The current logic is to use a default size 16 to batch the whole bucket.
If it is too small, it will retry with a larger batch size.

The current code accidentally does a state->bucket-- before retrying.
This goes back to retry with the previous bucket which has already
been done. This patch fixed it.

It is hard to create a selftest. I added a WARN_ON(state->bucket < 0),
forced a particular port to be hashed to the first bucket,
created >16 sockets, and observed the for-loop went back
to the "-1" bucket.

Cc: Aditi Ghag <aditi.ghag@isovalent.com>
Fixes: c96dac8d369f ("bpf: udp: Implement batching for sockets iterator")
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Reviewed-by: Aditi Ghag <aditi.ghag@isovalent.com>
Link: https://lore.kernel.org/r/20240112190530.3751661-2-martin.lau@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv4/udp.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index bd12a7658213..a4857c85a020 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -3192,7 +3192,6 @@ static struct sock *bpf_iter_udp_batch(struct seq_file *seq)
 		/* After allocating a larger batch, retry one more time to grab
 		 * the whole bucket.
 		 */
-		state->bucket--;
 		goto again;
 	}
 done:
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 545/583] bpf: Avoid iter->offset making backward progress in bpf_iter_udp
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (543 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 544/583] bpf: iter_udp: Retry with a larger batch size without going back to the previous bucket Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 546/583] net: tls, fix WARNIING in __sk_msg_free Greg Kroah-Hartman
                   ` (44 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Aditi Ghag, Yonghong Song,
	Martin KaFai Lau, Alexei Starovoitov, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Martin KaFai Lau <martin.lau@kernel.org>

[ Upstream commit 2242fd537fab52d5f4d2fbb1845f047c01fad0cf ]

There is a bug in the bpf_iter_udp_batch() function that stops
the userspace from making forward progress.

The case that triggers the bug is the userspace passed in
a very small read buffer. When the bpf prog does bpf_seq_printf,
the userspace read buffer is not enough to capture the whole bucket.

When the read buffer is not large enough, the kernel will remember
the offset of the bucket in iter->offset such that the next userspace
read() can continue from where it left off.

The kernel will skip the number (== "iter->offset") of sockets in
the next read(). However, the code directly decrements the
"--iter->offset". This is incorrect because the next read() may
not consume the whole bucket either and then the next-next read()
will start from offset 0. The net effect is the userspace will
keep reading from the beginning of a bucket and the process will
never finish. "iter->offset" must always go forward until the
whole bucket is consumed.

This patch fixes it by using a local variable "resume_offset"
and "resume_bucket". "iter->offset" is always reset to 0 before
it may be used. "iter->offset" will be advanced to the
"resume_offset" when it continues from the "resume_bucket" (i.e.
"state->bucket == resume_bucket"). This brings it closer to
the bpf_iter_tcp's offset handling which does not suffer
the same bug.

Cc: Aditi Ghag <aditi.ghag@isovalent.com>
Fixes: c96dac8d369f ("bpf: udp: Implement batching for sockets iterator")
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Reviewed-by: Aditi Ghag <aditi.ghag@isovalent.com>
Link: https://lore.kernel.org/r/20240112190530.3751661-3-martin.lau@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv4/udp.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index a4857c85a020..9cb22a6ae1dc 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -3116,16 +3116,18 @@ static struct sock *bpf_iter_udp_batch(struct seq_file *seq)
 	struct bpf_udp_iter_state *iter = seq->private;
 	struct udp_iter_state *state = &iter->state;
 	struct net *net = seq_file_net(seq);
+	int resume_bucket, resume_offset;
 	struct udp_table *udptable;
 	unsigned int batch_sks = 0;
 	bool resized = false;
 	struct sock *sk;
 
+	resume_bucket = state->bucket;
+	resume_offset = iter->offset;
+
 	/* The current batch is done, so advance the bucket. */
-	if (iter->st_bucket_done) {
+	if (iter->st_bucket_done)
 		state->bucket++;
-		iter->offset = 0;
-	}
 
 	udptable = udp_get_table_seq(seq, net);
 
@@ -3145,19 +3147,19 @@ static struct sock *bpf_iter_udp_batch(struct seq_file *seq)
 	for (; state->bucket <= udptable->mask; state->bucket++) {
 		struct udp_hslot *hslot2 = &udptable->hash2[state->bucket];
 
-		if (hlist_empty(&hslot2->head)) {
-			iter->offset = 0;
+		if (hlist_empty(&hslot2->head))
 			continue;
-		}
 
+		iter->offset = 0;
 		spin_lock_bh(&hslot2->lock);
 		udp_portaddr_for_each_entry(sk, &hslot2->head) {
 			if (seq_sk_match(seq, sk)) {
 				/* Resume from the last iterated socket at the
 				 * offset in the bucket before iterator was stopped.
 				 */
-				if (iter->offset) {
-					--iter->offset;
+				if (state->bucket == resume_bucket &&
+				    iter->offset < resume_offset) {
+					++iter->offset;
 					continue;
 				}
 				if (iter->end_sk < iter->max_sk) {
@@ -3171,9 +3173,6 @@ static struct sock *bpf_iter_udp_batch(struct seq_file *seq)
 
 		if (iter->end_sk)
 			break;
-
-		/* Reset the current bucket's offset before moving to the next bucket. */
-		iter->offset = 0;
 	}
 
 	/* All done: no batch made. */
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 546/583] net: tls, fix WARNIING in __sk_msg_free
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (544 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 545/583] bpf: Avoid iter->offset making backward progress in bpf_iter_udp Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 547/583] net: ravb: Fix dma_addr_t truncation in error case Greg Kroah-Hartman
                   ` (43 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Edward Adam Davis, Jakub Kicinski,
	John Fastabend, David S. Miller, Sasha Levin,
	syzbot+f2977222e0e95cec15c8

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: John Fastabend <john.fastabend@gmail.com>

[ Upstream commit dc9dfc8dc629e42f2234e3327b75324ffc752bc9 ]

A splice with MSG_SPLICE_PAGES will cause tls code to use the
tls_sw_sendmsg_splice path in the TLS sendmsg code to move the user
provided pages from the msg into the msg_pl. This will loop over the
msg until msg_pl is full, checked by sk_msg_full(msg_pl). The user
can also set the MORE flag to hint stack to delay sending until receiving
more pages and ideally a full buffer.

If the user adds more pages to the msg than can fit in the msg_pl
scatterlist (MAX_MSG_FRAGS) we should ignore the MORE flag and send
the buffer anyways.

What actually happens though is we abort the msg to msg_pl scatterlist
setup and then because we forget to set 'full record' indicating we
can no longer consume data without a send we fallthrough to the 'continue'
path which will check if msg_data_left(msg) has more bytes to send and
then attempts to fit them in the already full msg_pl. Then next
iteration of sender doing send will encounter a full msg_pl and throw
the warning in the syzbot report.

To fix simply check if we have a full_record in splice code path and
if not send the msg regardless of MORE flag.

Reported-and-tested-by: syzbot+f2977222e0e95cec15c8@syzkaller.appspotmail.com
Reported-by: Edward Adam Davis <eadavis@qq.com>
Fixes: fe1e81d4f73b ("tls/sw: Support MSG_SPLICE_PAGES")
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/tls/tls_sw.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 27cc0f0a90e1..dba523cdc73d 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -1052,7 +1052,11 @@ static int tls_sw_sendmsg_locked(struct sock *sk, struct msghdr *msg,
 			if (ret < 0)
 				goto send_end;
 			tls_ctx->pending_open_record_frags = true;
-			if (full_record || eor || sk_msg_full(msg_pl))
+
+			if (sk_msg_full(msg_pl))
+				full_record = true;
+
+			if (full_record || eor)
 				goto copied;
 			continue;
 		}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 547/583] net: ravb: Fix dma_addr_t truncation in error case
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (545 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 546/583] net: tls, fix WARNIING in __sk_msg_free Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-22 23:59 ` [PATCH 6.6 548/583] dt-bindings: gpio: xilinx: Fix node address in gpio Greg Kroah-Hartman
                   ` (42 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Nikita Yushchenko,
	Niklas Söderlund, Sergey Shtylyov, Florian Fainelli,
	David S. Miller, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nikita Yushchenko <nikita.yoush@cogentembedded.com>

[ Upstream commit e327b2372bc0f18c30433ac40be07741b59231c5 ]

In ravb_start_xmit(), ravb driver uses u32 variable to store result of
dma_map_single() call. Since ravb hardware has 32-bit address fields in
descriptors, this works properly when mapping is successful - it is
platform's job to provide mapping addresses that fit into hardware
limitations.

However, in failure case dma_map_single() returns DMA_MAPPING_ERROR
constant that is 64-bit when dma_addr_t is 64-bit. Storing this constant
in u32 leads to truncation, and further call to dma_mapping_error()
fails to notice the error.

Fix that by storing result of dma_map_single() in a dma_addr_t
variable.

Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper")
Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/renesas/ravb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 3c2a6b23c202..8fec0dbbbe7b 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1949,7 +1949,7 @@ static netdev_tx_t ravb_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 	struct ravb_tstamp_skb *ts_skb;
 	struct ravb_tx_desc *desc;
 	unsigned long flags;
-	u32 dma_addr;
+	dma_addr_t dma_addr;
 	void *buffer;
 	u32 entry;
 	u32 len;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 548/583] dt-bindings: gpio: xilinx: Fix node address in gpio
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (546 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 547/583] net: ravb: Fix dma_addr_t truncation in error case Greg Kroah-Hartman
@ 2024-01-22 23:59 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 549/583] gpio: mlxbf3: add an error code check in mlxbf3_gpio_probe Greg Kroah-Hartman
                   ` (41 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-22 23:59 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Michal Simek, Krzysztof Kozlowski,
	Bartosz Golaszewski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Michal Simek <michal.simek@amd.com>

[ Upstream commit 314c020c4ed3de72b15603eb6892250bc4b51702 ]

Node address doesn't match reg property which is not correct.

Fixes: ba96b2e7974b ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 Documentation/devicetree/bindings/gpio/xlnx,gpio-xilinx.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/gpio/xlnx,gpio-xilinx.yaml b/Documentation/devicetree/bindings/gpio/xlnx,gpio-xilinx.yaml
index c1060e5fcef3..d3d8a2e143ed 100644
--- a/Documentation/devicetree/bindings/gpio/xlnx,gpio-xilinx.yaml
+++ b/Documentation/devicetree/bindings/gpio/xlnx,gpio-xilinx.yaml
@@ -126,7 +126,7 @@ examples:
   - |
     #include <dt-bindings/interrupt-controller/arm-gic.h>
 
-        gpio@e000a000 {
+        gpio@a0020000 {
             compatible = "xlnx,xps-gpio-1.00.a";
             reg = <0xa0020000 0x10000>;
             #gpio-cells = <2>;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 549/583] gpio: mlxbf3: add an error code check in mlxbf3_gpio_probe
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (547 preceding siblings ...)
  2024-01-22 23:59 ` [PATCH 6.6 548/583] dt-bindings: gpio: xilinx: Fix node address in gpio Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 550/583] ASoC: SOF: ipc4-loader: remove the CPC check warnings Greg Kroah-Hartman
                   ` (40 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Su Hui, Bartosz Golaszewski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Su Hui <suhui@nfschina.com>

[ Upstream commit d460e9c2075164e9b1fa9c4c95f8c05517bd8752 ]

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: cd33f216d241 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpio/gpio-mlxbf3.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpio-mlxbf3.c b/drivers/gpio/gpio-mlxbf3.c
index 7a3e1760fc5b..d5906d419b0a 100644
--- a/drivers/gpio/gpio-mlxbf3.c
+++ b/drivers/gpio/gpio-mlxbf3.c
@@ -215,6 +215,8 @@ static int mlxbf3_gpio_probe(struct platform_device *pdev)
 			gs->gpio_clr_io + MLXBF_GPIO_FW_DATA_OUT_CLEAR,
 			gs->gpio_set_io + MLXBF_GPIO_FW_OUTPUT_ENABLE_SET,
 			gs->gpio_clr_io + MLXBF_GPIO_FW_OUTPUT_ENABLE_CLEAR, 0);
+	if (ret)
+		return dev_err_probe(dev, ret, "%s: bgpio_init() failed", __func__);
 
 	gc->request = gpiochip_generic_request;
 	gc->free = gpiochip_generic_free;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 550/583] ASoC: SOF: ipc4-loader: remove the CPC check warnings
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (548 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 549/583] gpio: mlxbf3: add an error code check in mlxbf3_gpio_probe Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 551/583] drm/amdkfd: fixes for HMM mem allocation Greg Kroah-Hartman
                   ` (39 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kai Vehmanen, Pierre-Louis Bossart,
	Péter Ujfalusi, Liam Girdwood, Mark Brown, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kai Vehmanen <kai.vehmanen@linux.intel.com>

[ Upstream commit ab09fb9c629ed3aaea6a82467f08595dbc549726 ]

Warnings related to missing data in firmware manifest have
proven to be too verbose. This relates to description of
DSP module cost expressed in cycles per chunk (CPC). If
a matching value is not found in the manifest, kernel will
pass a zero value and DSP firmware will use a conservative
value in its place.

Downgrade the warnings to dev_dbg().

Fixes: d8a2c9879349 ("ASoC: SOF: ipc4-loader/topology: Query the CPC value from manifest")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://msgid.link/r/20240115092209.7184-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/sof/ipc4-loader.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/sound/soc/sof/ipc4-loader.c b/sound/soc/sof/ipc4-loader.c
index eaa04762eb11..4d37e89b592a 100644
--- a/sound/soc/sof/ipc4-loader.c
+++ b/sound/soc/sof/ipc4-loader.c
@@ -479,13 +479,10 @@ void sof_ipc4_update_cpc_from_manifest(struct snd_sof_dev *sdev,
 		msg = "No CPC match in the firmware file's manifest";
 
 no_cpc:
-	dev_warn(sdev->dev, "%s (UUID: %pUL): %s (ibs/obs: %u/%u)\n",
-		 fw_module->man4_module_entry.name,
-		 &fw_module->man4_module_entry.uuid, msg, basecfg->ibs,
-		 basecfg->obs);
-	dev_warn_once(sdev->dev, "Please try to update the firmware.\n");
-	dev_warn_once(sdev->dev, "If the issue persists, file a bug at\n");
-	dev_warn_once(sdev->dev, "https://github.com/thesofproject/sof/issues/\n");
+	dev_dbg(sdev->dev, "%s (UUID: %pUL): %s (ibs/obs: %u/%u)\n",
+		fw_module->man4_module_entry.name,
+		&fw_module->man4_module_entry.uuid, msg, basecfg->ibs,
+		basecfg->obs);
 }
 
 const struct sof_ipc_fw_loader_ops ipc4_loader_ops = {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 551/583] drm/amdkfd: fixes for HMM mem allocation
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (549 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 550/583] ASoC: SOF: ipc4-loader: remove the CPC check warnings Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 552/583] drm/amdgpu: fall back to INPUT power for AVG power via INFO IOCTL Greg Kroah-Hartman
                   ` (38 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Felix Kuehling, Dafna Hirschfeld,
	Alex Deucher, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dafna Hirschfeld <dhirschfeld@habana.ai>

[ Upstream commit 02eed83abc1395a1207591aafad9bcfc5cb1abcb ]

Fix err return value and reset pgmap->type after checking it.

Fixes: c83dee9b6394 ("drm/amdkfd: add SPM support for SVM")
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai>
Signed-off-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
index 7d82c7da223a..659313648b20 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
@@ -1021,7 +1021,7 @@ int kgd2kfd_init_zone_device(struct amdgpu_device *adev)
 	} else {
 		res = devm_request_free_mem_region(adev->dev, &iomem_resource, size);
 		if (IS_ERR(res))
-			return -ENOMEM;
+			return PTR_ERR(res);
 		pgmap->range.start = res->start;
 		pgmap->range.end = res->end;
 		pgmap->type = MEMORY_DEVICE_PRIVATE;
@@ -1037,10 +1037,10 @@ int kgd2kfd_init_zone_device(struct amdgpu_device *adev)
 	r = devm_memremap_pages(adev->dev, pgmap);
 	if (IS_ERR(r)) {
 		pr_err("failed to register HMM device memory\n");
-		/* Disable SVM support capability */
-		pgmap->type = 0;
 		if (pgmap->type == MEMORY_DEVICE_PRIVATE)
 			devm_release_mem_region(adev->dev, res->start, resource_size(res));
+		/* Disable SVM support capability */
+		pgmap->type = 0;
 		return PTR_ERR(r);
 	}
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 552/583] drm/amdgpu: fall back to INPUT power for AVG power via INFO IOCTL
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (550 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 551/583] drm/amdkfd: fixes for HMM mem allocation Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 553/583] selftests: bonding: Change script interpreter Greg Kroah-Hartman
                   ` (37 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Yang Wang, Alex Deucher, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alex Deucher <alexander.deucher@amd.com>

[ Upstream commit d02069850fc102b07ae923535d5e212f2c8a34e9 ]

For backwards compatibility with userspace.

Fixes: 47f1724db4fe ("drm/amd: Introduce `AMDGPU_PP_SENSOR_GPU_INPUT_POWER`")
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2897
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index d30dc0b718c7..58dab4f73a9a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -1026,7 +1026,12 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
 			if (amdgpu_dpm_read_sensor(adev,
 						   AMDGPU_PP_SENSOR_GPU_AVG_POWER,
 						   (void *)&ui32, &ui32_size)) {
-				return -EINVAL;
+				/* fall back to input power for backwards compat */
+				if (amdgpu_dpm_read_sensor(adev,
+							   AMDGPU_PP_SENSOR_GPU_INPUT_POWER,
+							   (void *)&ui32, &ui32_size)) {
+					return -EINVAL;
+				}
 			}
 			ui32 >>= 8;
 			break;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 553/583] selftests: bonding: Change script interpreter
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (551 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 552/583] drm/amdgpu: fall back to INPUT power for AVG power via INFO IOCTL Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 554/583] net: stmmac: ethtool: Fixed calltrace caused by unbalanced disable_irq_wake calls Greg Kroah-Hartman
                   ` (36 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hangbin Liu, Petr Machata,
	Benjamin Poirier, Przemek Kitszel, Paolo Abeni, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Benjamin Poirier <bpoirier@nvidia.com>

[ Upstream commit c2518da8e6b0e248cfff1d4b6682e14020bd4d3f ]

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: d43eff0b85ae ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../selftests/drivers/net/bonding/mode-1-recovery-updelay.sh    | 2 +-
 .../selftests/drivers/net/bonding/mode-2-recovery-updelay.sh    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/drivers/net/bonding/mode-1-recovery-updelay.sh b/tools/testing/selftests/drivers/net/bonding/mode-1-recovery-updelay.sh
index ad4c845a4ac7..b76bf5030952 100755
--- a/tools/testing/selftests/drivers/net/bonding/mode-1-recovery-updelay.sh
+++ b/tools/testing/selftests/drivers/net/bonding/mode-1-recovery-updelay.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # SPDX-License-Identifier: GPL-2.0
 
 # Regression Test:
diff --git a/tools/testing/selftests/drivers/net/bonding/mode-2-recovery-updelay.sh b/tools/testing/selftests/drivers/net/bonding/mode-2-recovery-updelay.sh
index 2330d37453f9..8c2619002147 100755
--- a/tools/testing/selftests/drivers/net/bonding/mode-2-recovery-updelay.sh
+++ b/tools/testing/selftests/drivers/net/bonding/mode-2-recovery-updelay.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # SPDX-License-Identifier: GPL-2.0
 
 # Regression Test:
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 554/583] net: stmmac: ethtool: Fixed calltrace caused by unbalanced disable_irq_wake calls
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (552 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 553/583] selftests: bonding: Change script interpreter Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 555/583] bpf: Reject variable offset alu on PTR_TO_FLOW_KEYS Greg Kroah-Hartman
                   ` (35 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Qiang Ma, Simon Horman, Paolo Abeni,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Qiang Ma <maqianga@uniontech.com>

[ Upstream commit a23aa04042187cbde16f470b49d4ad60d32e9206 ]

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: 3172d3afa998 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac.h         |  1 +
 drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 10 ++++++++--
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c    |  1 +
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index cd7a9768de5f..b8c93b881a65 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -255,6 +255,7 @@ struct stmmac_priv {
 	u32 msg_enable;
 	int wolopts;
 	int wol_irq;
+	bool wol_irq_disabled;
 	int clk_csr;
 	struct timer_list eee_ctrl_timer;
 	int lpi_irq;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index 419efe43951e..69c8c2528524 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -822,10 +822,16 @@ static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 	if (wol->wolopts) {
 		pr_info("stmmac: wakeup enable\n");
 		device_set_wakeup_enable(priv->device, 1);
-		enable_irq_wake(priv->wol_irq);
+		/* Avoid unbalanced enable_irq_wake calls */
+		if (priv->wol_irq_disabled)
+			enable_irq_wake(priv->wol_irq);
+		priv->wol_irq_disabled = false;
 	} else {
 		device_set_wakeup_enable(priv->device, 0);
-		disable_irq_wake(priv->wol_irq);
+		/* Avoid unbalanced disable_irq_wake calls */
+		if (!priv->wol_irq_disabled)
+			disable_irq_wake(priv->wol_irq);
+		priv->wol_irq_disabled = true;
 	}
 
 	mutex_lock(&priv->lock);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 69b9c71f0ede..1bfcf673b3ce 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3549,6 +3549,7 @@ static int stmmac_request_irq_multi_msi(struct net_device *dev)
 	/* Request the Wake IRQ in case of another line
 	 * is used for WoL
 	 */
+	priv->wol_irq_disabled = true;
 	if (priv->wol_irq > 0 && priv->wol_irq != dev->irq) {
 		int_name = priv->int_name_wol;
 		sprintf(int_name, "%s:%s", dev->name, "wol");
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 555/583] bpf: Reject variable offset alu on PTR_TO_FLOW_KEYS
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (553 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 554/583] net: stmmac: ethtool: Fixed calltrace caused by unbalanced disable_irq_wake calls Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 556/583] net: dsa: vsc73xx: Add null pointer check to vsc73xx_gpio_probe Greg Kroah-Hartman
                   ` (34 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Hao Sun, Daniel Borkmann,
	Yonghong Song, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hao Sun <sunhao.th@gmail.com>

[ Upstream commit 22c7fa171a02d310e3a3f6ed46a698ca8a0060ed ]

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: d58e468b1112 ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/verifier.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index ed24ad2e5bd2..97fd1766818b 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -12087,6 +12087,10 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env,
 	}
 
 	switch (base_type(ptr_reg->type)) {
+	case PTR_TO_FLOW_KEYS:
+		if (known)
+			break;
+		fallthrough;
 	case CONST_PTR_TO_MAP:
 		/* smin_val represents the known value */
 		if (known && smin_val == 0 && opcode == BPF_ADD)
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 556/583] net: dsa: vsc73xx: Add null pointer check to vsc73xx_gpio_probe
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (554 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 555/583] bpf: Reject variable offset alu on PTR_TO_FLOW_KEYS Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 557/583] LoongArch: BPF: Prevent out-of-bounds memory access Greg Kroah-Hartman
                   ` (33 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Kunwu Chan, Jakub Kicinski,
	Simon Horman, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Kunwu Chan <chentao@kylinos.cn>

[ Upstream commit 776dac5a662774f07a876b650ba578d0a62d20db ]

devm_kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure.

Fixes: 05bd97fc559d ("net: dsa: Add Vitesse VSC73xx DSA router driver")
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240111072018.75971-1-chentao@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/dsa/vitesse-vsc73xx-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c
index 4f09e7438f3b..c99fb1bd4c25 100644
--- a/drivers/net/dsa/vitesse-vsc73xx-core.c
+++ b/drivers/net/dsa/vitesse-vsc73xx-core.c
@@ -1118,6 +1118,8 @@ static int vsc73xx_gpio_probe(struct vsc73xx *vsc)
 
 	vsc->gc.label = devm_kasprintf(vsc->dev, GFP_KERNEL, "VSC%04x",
 				       vsc->chipid);
+	if (!vsc->gc.label)
+		return -ENOMEM;
 	vsc->gc.ngpio = 4;
 	vsc->gc.owner = THIS_MODULE;
 	vsc->gc.parent = vsc->dev;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 557/583] LoongArch: BPF: Prevent out-of-bounds memory access
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (555 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 556/583] net: dsa: vsc73xx: Add null pointer check to vsc73xx_gpio_probe Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 558/583] mptcp: relax check on MPC passive fallback Greg Kroah-Hartman
                   ` (32 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Tiezhu Yang, Hengqi Chen,
	Huacai Chen, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Hengqi Chen <hengqi.chen@gmail.com>

[ Upstream commit 36a87385e31c9343af9a4756598e704741250a67 ]

The test_tag test triggers an unhandled page fault:

  # ./test_tag
  [  130.640218] CPU 0 Unable to handle kernel paging request at virtual address ffff80001b898004, era == 9000000003137f7c, ra == 9000000003139e70
  [  130.640501] Oops[#3]:
  [  130.640553] CPU: 0 PID: 1326 Comm: test_tag Tainted: G      D    O       6.7.0-rc4-loong-devel-gb62ab1a397cf #47 61985c1d94084daa2432f771daa45b56b10d8d2a
  [  130.640764] Hardware name: QEMU QEMU Virtual Machine, BIOS unknown 2/2/2022
  [  130.640874] pc 9000000003137f7c ra 9000000003139e70 tp 9000000104cb4000 sp 9000000104cb7a40
  [  130.641001] a0 ffff80001b894000 a1 ffff80001b897ff8 a2 000000006ba210be a3 0000000000000000
  [  130.641128] a4 000000006ba210be a5 00000000000000f1 a6 00000000000000b3 a7 0000000000000000
  [  130.641256] t0 0000000000000000 t1 00000000000007f6 t2 0000000000000000 t3 9000000004091b70
  [  130.641387] t4 000000006ba210be t5 0000000000000004 t6 fffffffffffffff0 t7 90000000040913e0
  [  130.641512] t8 0000000000000005 u0 0000000000000dc0 s9 0000000000000009 s0 9000000104cb7ae0
  [  130.641641] s1 00000000000007f6 s2 0000000000000009 s3 0000000000000095 s4 0000000000000000
  [  130.641771] s5 ffff80001b894000 s6 ffff80001b897fb0 s7 9000000004090c50 s8 0000000000000000
  [  130.641900]    ra: 9000000003139e70 build_body+0x1fcc/0x4988
  [  130.642007]   ERA: 9000000003137f7c build_body+0xd8/0x4988
  [  130.642112]  CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE)
  [  130.642261]  PRMD: 00000004 (PPLV0 +PIE -PWE)
  [  130.642353]  EUEN: 00000003 (+FPE +SXE -ASXE -BTE)
  [  130.642458]  ECFG: 00071c1c (LIE=2-4,10-12 VS=7)
  [  130.642554] ESTAT: 00010000 [PIL] (IS= ECode=1 EsubCode=0)
  [  130.642658]  BADV: ffff80001b898004
  [  130.642719]  PRID: 0014c010 (Loongson-64bit, Loongson-3A5000)
  [  130.642815] Modules linked in: [last unloaded: bpf_testmod(O)]
  [  130.642924] Process test_tag (pid: 1326, threadinfo=00000000f7f4015f, task=000000006499f9fd)
  [  130.643062] Stack : 0000000000000000 9000000003380724 0000000000000000 0000000104cb7be8
  [  130.643213]         0000000000000000 25af8d9b6e600558 9000000106250ea0 9000000104cb7ae0
  [  130.643378]         0000000000000000 0000000000000000 9000000104cb7be8 90000000049f6000
  [  130.643538]         0000000000000090 9000000106250ea0 ffff80001b894000 ffff80001b894000
  [  130.643685]         00007ffffb917790 900000000313ca94 0000000000000000 0000000000000000
  [  130.643831]         ffff80001b894000 0000000000000ff7 0000000000000000 9000000100468000
  [  130.643983]         0000000000000000 0000000000000000 0000000000000040 25af8d9b6e600558
  [  130.644131]         0000000000000bb7 ffff80001b894048 0000000000000000 0000000000000000
  [  130.644276]         9000000104cb7be8 90000000049f6000 0000000000000090 9000000104cb7bdc
  [  130.644423]         ffff80001b894000 0000000000000000 00007ffffb917790 90000000032acfb0
  [  130.644572]         ...
  [  130.644629] Call Trace:
  [  130.644641] [<9000000003137f7c>] build_body+0xd8/0x4988
  [  130.644785] [<900000000313ca94>] bpf_int_jit_compile+0x228/0x4ec
  [  130.644891] [<90000000032acfb0>] bpf_prog_select_runtime+0x158/0x1b0
  [  130.645003] [<90000000032b3504>] bpf_prog_load+0x760/0xb44
  [  130.645089] [<90000000032b6744>] __sys_bpf+0xbb8/0x2588
  [  130.645175] [<90000000032b8388>] sys_bpf+0x20/0x2c
  [  130.645259] [<9000000003f6ab38>] do_syscall+0x7c/0x94
  [  130.645369] [<9000000003121c5c>] handle_syscall+0xbc/0x158
  [  130.645507]
  [  130.645539] Code: 380839f6  380831f9  28412bae <24000ca6> 004081ad  0014cb50  004083e8  02bff34c  58008e91
  [  130.645729]
  [  130.646418] ---[ end trace 0000000000000000 ]---

On my machine, which has CONFIG_PAGE_SIZE_16KB=y, the test failed at
loading a BPF prog with 2039 instructions:

  prog = (struct bpf_prog *)ffff80001b894000
  insn = (struct bpf_insn *)(prog->insnsi)ffff80001b894048
  insn + 2039 = (struct bpf_insn *)ffff80001b898000 <- end of the page

In the build_insn() function, we are trying to access next instruction
unconditionally, i.e. `(insn + 1)->imm`. The address lies in the next
page and can be not owned by the current process, thus an page fault is
inevitable and then segfault.

So, let's access next instruction only under `dst = imm64` context.

With this fix, we have:

  # ./test_tag
  test_tag: OK (40945 tests)

Fixes: bbfddb904df6f82 ("LoongArch: BPF: Avoid declare variables in switch-case")
Tested-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/loongarch/net/bpf_jit.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/loongarch/net/bpf_jit.c b/arch/loongarch/net/bpf_jit.c
index 00915fb3cb82..9eb7753d117d 100644
--- a/arch/loongarch/net/bpf_jit.c
+++ b/arch/loongarch/net/bpf_jit.c
@@ -461,7 +461,6 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
 	const u8 dst = regmap[insn->dst_reg];
 	const s16 off = insn->off;
 	const s32 imm = insn->imm;
-	const u64 imm64 = (u64)(insn + 1)->imm << 32 | (u32)insn->imm;
 	const bool is32 = BPF_CLASS(insn->code) == BPF_ALU || BPF_CLASS(insn->code) == BPF_JMP32;
 
 	switch (code) {
@@ -865,8 +864,12 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx, bool ext
 
 	/* dst = imm64 */
 	case BPF_LD | BPF_IMM | BPF_DW:
+	{
+		const u64 imm64 = (u64)(insn + 1)->imm << 32 | (u32)insn->imm;
+
 		move_imm(ctx, dst, imm64, is32);
 		return 1;
+	}
 
 	/* dst = *(size *)(src + off) */
 	case BPF_LDX | BPF_MEM | BPF_B:
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 558/583] mptcp: relax check on MPC passive fallback
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (556 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 557/583] LoongArch: BPF: Prevent out-of-bounds memory access Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 559/583] net: netdevsim: dont try to destroy PHC on VFs Greg Kroah-Hartman
                   ` (31 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Matthieu Baerts, Paolo Abeni,
	Eric Dumazet, David S. Miller, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Paolo Abeni <pabeni@redhat.com>

[ Upstream commit c0f5aec28edf98906d28f08daace6522adf9ee7a ]

While testing the blamed commit below, I was able to miss (!)
packetdrill failures in the fastopen test-cases.

On passive fastopen the child socket is created by incoming TCP MPC syn,
allow for both MPC_SYN and MPC_ACK header.

Fixes: 724b00c12957 ("mptcp: refine opt_mp_capable determination")
Reviewed-by: Matthieu Baerts <matttbe@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/mptcp/subflow.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 70b7a47a53c7..d3c5ecf8ddf5 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -783,7 +783,8 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
 		 * options.
 		 */
 		mptcp_get_options(skb, &mp_opt);
-		if (!(mp_opt.suboptions & OPTION_MPTCP_MPC_ACK))
+		if (!(mp_opt.suboptions &
+		      (OPTION_MPTCP_MPC_SYN | OPTION_MPTCP_MPC_ACK)))
 			fallback = true;
 
 	} else if (subflow_req->mp_join) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 559/583] net: netdevsim: dont try to destroy PHC on VFs
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (557 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 558/583] mptcp: relax check on MPC passive fallback Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 560/583] netfilter: nf_tables: reject invalid set policy Greg Kroah-Hartman
                   ` (30 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Jakub Kicinski, Simon Horman,
	David S. Miller, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jakub Kicinski <kuba@kernel.org>

[ Upstream commit ea937f77208323d35ffe2f8d8fc81b00118bfcda ]

PHC gets initialized in nsim_init_netdevsim(), which
is only called if (nsim_dev_port_is_pf()).

Create a counterpart of nsim_init_netdevsim() and
move the mock_phc_destroy() there.

This fixes a crash trying to destroy netdevsim with
VFs instantiated, as caught by running the devlink.sh test:

    BUG: kernel NULL pointer dereference, address: 00000000000000b8
    RIP: 0010:mock_phc_destroy+0xd/0x30
    Call Trace:
     <TASK>
     nsim_destroy+0x4a/0x70 [netdevsim]
     __nsim_dev_port_del+0x47/0x70 [netdevsim]
     nsim_dev_reload_destroy+0x105/0x120 [netdevsim]
     nsim_drv_remove+0x2f/0xb0 [netdevsim]
     device_release_driver_internal+0x1a1/0x210
     bus_remove_device+0xd5/0x120
     device_del+0x159/0x490
     device_unregister+0x12/0x30
     del_device_store+0x11a/0x1a0 [netdevsim]
     kernfs_fop_write_iter+0x130/0x1d0
     vfs_write+0x30b/0x4b0
     ksys_write+0x69/0xf0
     do_syscall_64+0xcc/0x1e0
     entry_SYSCALL_64_after_hwframe+0x6f/0x77

Fixes: b63e78fca889 ("net: netdevsim: use mock PHC driver")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/netdevsim/netdev.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
index 2eac92f49631..d8ca82addfe1 100644
--- a/drivers/net/netdevsim/netdev.c
+++ b/drivers/net/netdevsim/netdev.c
@@ -369,6 +369,12 @@ static int nsim_init_netdevsim_vf(struct netdevsim *ns)
 	return err;
 }
 
+static void nsim_exit_netdevsim(struct netdevsim *ns)
+{
+	nsim_udp_tunnels_info_destroy(ns->netdev);
+	mock_phc_destroy(ns->phc);
+}
+
 struct netdevsim *
 nsim_create(struct nsim_dev *nsim_dev, struct nsim_dev_port *nsim_dev_port)
 {
@@ -417,8 +423,7 @@ void nsim_destroy(struct netdevsim *ns)
 	}
 	rtnl_unlock();
 	if (nsim_dev_port_is_pf(ns->nsim_dev_port))
-		nsim_udp_tunnels_info_destroy(dev);
-	mock_phc_destroy(ns->phc);
+		nsim_exit_netdevsim(ns);
 	free_netdev(dev);
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 560/583] netfilter: nf_tables: reject invalid set policy
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (558 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 559/583] net: netdevsim: dont try to destroy PHC on VFs Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 561/583] netfilter: nft_limit: do not ignore unsupported flags Greg Kroah-Hartman
                   ` (29 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Pablo Neira Ayuso, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pablo Neira Ayuso <pablo@netfilter.org>

[ Upstream commit 0617c3de9b4026b87be12b0cb5c35f42c7c66fcb ]

Report -EINVAL in case userspace provides a unsupported set backend
policy.

Fixes: c50b960ccc59 ("netfilter: nf_tables: implement proper set selection")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/netfilter/nf_tables_api.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 5200bd804954..55cd82190888 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -4990,8 +4990,16 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
 	}
 
 	desc.policy = NFT_SET_POL_PERFORMANCE;
-	if (nla[NFTA_SET_POLICY] != NULL)
+	if (nla[NFTA_SET_POLICY] != NULL) {
 		desc.policy = ntohl(nla_get_be32(nla[NFTA_SET_POLICY]));
+		switch (desc.policy) {
+		case NFT_SET_POL_PERFORMANCE:
+		case NFT_SET_POL_MEMORY:
+			break;
+		default:
+			return -EOPNOTSUPP;
+		}
+	}
 
 	if (nla[NFTA_SET_DESC] != NULL) {
 		err = nf_tables_set_desc_parse(&desc, nla[NFTA_SET_DESC]);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 561/583] netfilter: nft_limit: do not ignore unsupported flags
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (559 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 560/583] netfilter: nf_tables: reject invalid set policy Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 562/583] netfilter: nfnetlink_log: use proper helper for fetching physinif Greg Kroah-Hartman
                   ` (28 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Pablo Neira Ayuso, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pablo Neira Ayuso <pablo@netfilter.org>

[ Upstream commit 91a139cee1202a4599a380810d93c69b5bac6197 ]

Bail out if userspace provides unsupported flags, otherwise future
extensions to the limit expression will be silently ignored by the
kernel.

Fixes: c7862a5f0de5 ("netfilter: nft_limit: allow to invert matching criteria")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/netfilter/nft_limit.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/net/netfilter/nft_limit.c b/net/netfilter/nft_limit.c
index 145dc62c6247..79039afde34e 100644
--- a/net/netfilter/nft_limit.c
+++ b/net/netfilter/nft_limit.c
@@ -58,6 +58,7 @@ static inline bool nft_limit_eval(struct nft_limit_priv *priv, u64 cost)
 static int nft_limit_init(struct nft_limit_priv *priv,
 			  const struct nlattr * const tb[], bool pkts)
 {
+	bool invert = false;
 	u64 unit, tokens;
 
 	if (tb[NFTA_LIMIT_RATE] == NULL ||
@@ -90,19 +91,23 @@ static int nft_limit_init(struct nft_limit_priv *priv,
 				 priv->rate);
 	}
 
+	if (tb[NFTA_LIMIT_FLAGS]) {
+		u32 flags = ntohl(nla_get_be32(tb[NFTA_LIMIT_FLAGS]));
+
+		if (flags & ~NFT_LIMIT_F_INV)
+			return -EOPNOTSUPP;
+
+		if (flags & NFT_LIMIT_F_INV)
+			invert = true;
+	}
+
 	priv->limit = kmalloc(sizeof(*priv->limit), GFP_KERNEL_ACCOUNT);
 	if (!priv->limit)
 		return -ENOMEM;
 
 	priv->limit->tokens = tokens;
 	priv->tokens_max = priv->limit->tokens;
-
-	if (tb[NFTA_LIMIT_FLAGS]) {
-		u32 flags = ntohl(nla_get_be32(tb[NFTA_LIMIT_FLAGS]));
-
-		if (flags & NFT_LIMIT_F_INV)
-			priv->invert = true;
-	}
+	priv->invert = invert;
 	priv->limit->last = ktime_get_ns();
 	spin_lock_init(&priv->limit->lock);
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 562/583] netfilter: nfnetlink_log: use proper helper for fetching physinif
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (560 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 561/583] netfilter: nft_limit: do not ignore unsupported flags Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 563/583] netfilter: nf_queue: remove excess nf_bridge variable Greg Kroah-Hartman
                   ` (27 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Pavel Tikhomirov, Simon Horman,
	Pablo Neira Ayuso, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>

[ Upstream commit c3f9fd54cd87233f53bdf0e191a86b3a5e960e02 ]

We don't use physindev in __build_packet_message except for getting
physinif from it. So let's switch to nf_bridge_get_physinif to get what
we want directly.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Stable-dep-of: 9874808878d9 ("netfilter: bridge: replace physindev with physinif in nf_bridge_info")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/netfilter/nfnetlink_log.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index f03f4d4d7d88..134e05d31061 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -508,7 +508,7 @@ __build_packet_message(struct nfnl_log_net *log,
 					 htonl(br_port_get_rcu(indev)->br->dev->ifindex)))
 				goto nla_put_failure;
 		} else {
-			struct net_device *physindev;
+			int physinif;
 
 			/* Case 2: indev is bridge group, we need to look for
 			 * physical device (when called from ipv4) */
@@ -516,10 +516,10 @@ __build_packet_message(struct nfnl_log_net *log,
 					 htonl(indev->ifindex)))
 				goto nla_put_failure;
 
-			physindev = nf_bridge_get_physindev(skb);
-			if (physindev &&
+			physinif = nf_bridge_get_physinif(skb);
+			if (physinif &&
 			    nla_put_be32(inst->skb, NFULA_IFINDEX_PHYSINDEV,
-					 htonl(physindev->ifindex)))
+					 htonl(physinif)))
 				goto nla_put_failure;
 		}
 #endif
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 563/583] netfilter: nf_queue: remove excess nf_bridge variable
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (561 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 562/583] netfilter: nfnetlink_log: use proper helper for fetching physinif Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 564/583] netfilter: propagate net to nf_bridge_get_physindev Greg Kroah-Hartman
                   ` (26 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Pavel Tikhomirov, Simon Horman,
	Pablo Neira Ayuso, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>

[ Upstream commit aeaa44075f8e49e2e0ad4507d925e690b7950145 ]

We don't really need nf_bridge variable here. And nf_bridge_info_exists
is better replacement for nf_bridge_info_get in case we are only
checking for existence.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Stable-dep-of: 9874808878d9 ("netfilter: bridge: replace physindev with physinif in nf_bridge_info")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/netfilter/nf_queue.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
index 63d1516816b1..3dfcb3ac5cb4 100644
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -82,10 +82,8 @@ static void __nf_queue_entry_init_physdevs(struct nf_queue_entry *entry)
 {
 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
 	const struct sk_buff *skb = entry->skb;
-	struct nf_bridge_info *nf_bridge;
 
-	nf_bridge = nf_bridge_info_get(skb);
-	if (nf_bridge) {
+	if (nf_bridge_info_exists(skb)) {
 		entry->physin = nf_bridge_get_physindev(skb);
 		entry->physout = nf_bridge_get_physoutdev(skb);
 	} else {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 564/583] netfilter: propagate net to nf_bridge_get_physindev
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (562 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 563/583] netfilter: nf_queue: remove excess nf_bridge variable Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 565/583] netfilter: bridge: replace physindev with physinif in nf_bridge_info Greg Kroah-Hartman
                   ` (25 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Pavel Tikhomirov, Simon Horman,
	Pablo Neira Ayuso, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>

[ Upstream commit a54e72197037d2c9bfcd70dddaac8c8ccb5b41ba ]

This is a preparation patch for replacing physindev with physinif on
nf_bridge_info structure. We will use dev_get_by_index_rcu to resolve
device, when needed, and it requires net to be available.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Stable-dep-of: 9874808878d9 ("netfilter: bridge: replace physindev with physinif in nf_bridge_info")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/netfilter_bridge.h           |  2 +-
 net/ipv4/netfilter/nf_reject_ipv4.c        |  2 +-
 net/ipv6/netfilter/nf_reject_ipv6.c        |  2 +-
 net/netfilter/ipset/ip_set_hash_netiface.c |  8 ++++----
 net/netfilter/nf_log_syslog.c              | 13 +++++++------
 net/netfilter/nf_queue.c                   |  2 +-
 net/netfilter/xt_physdev.c                 |  2 +-
 7 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index f980edfdd278..e927b9a15a55 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -56,7 +56,7 @@ static inline int nf_bridge_get_physoutif(const struct sk_buff *skb)
 }
 
 static inline struct net_device *
-nf_bridge_get_physindev(const struct sk_buff *skb)
+nf_bridge_get_physindev(const struct sk_buff *skb, struct net *net)
 {
 	const struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
 
diff --git a/net/ipv4/netfilter/nf_reject_ipv4.c b/net/ipv4/netfilter/nf_reject_ipv4.c
index f33aeab9424f..297000b05f18 100644
--- a/net/ipv4/netfilter/nf_reject_ipv4.c
+++ b/net/ipv4/netfilter/nf_reject_ipv4.c
@@ -289,7 +289,7 @@ void nf_send_reset(struct net *net, struct sock *sk, struct sk_buff *oldskb,
 	 * build the eth header using the original destination's MAC as the
 	 * source, and send the RST packet directly.
 	 */
-	br_indev = nf_bridge_get_physindev(oldskb);
+	br_indev = nf_bridge_get_physindev(oldskb, net);
 	if (br_indev) {
 		struct ethhdr *oeth = eth_hdr(oldskb);
 
diff --git a/net/ipv6/netfilter/nf_reject_ipv6.c b/net/ipv6/netfilter/nf_reject_ipv6.c
index 58ccdb08c0fd..0a5ef7abf583 100644
--- a/net/ipv6/netfilter/nf_reject_ipv6.c
+++ b/net/ipv6/netfilter/nf_reject_ipv6.c
@@ -354,7 +354,7 @@ void nf_send_reset6(struct net *net, struct sock *sk, struct sk_buff *oldskb,
 	 * build the eth header using the original destination's MAC as the
 	 * source, and send the RST packet directly.
 	 */
-	br_indev = nf_bridge_get_physindev(oldskb);
+	br_indev = nf_bridge_get_physindev(oldskb, net);
 	if (br_indev) {
 		struct ethhdr *oeth = eth_hdr(oldskb);
 
diff --git a/net/netfilter/ipset/ip_set_hash_netiface.c b/net/netfilter/ipset/ip_set_hash_netiface.c
index 95aeb31c60e0..30a655e5c4fd 100644
--- a/net/netfilter/ipset/ip_set_hash_netiface.c
+++ b/net/netfilter/ipset/ip_set_hash_netiface.c
@@ -138,9 +138,9 @@ hash_netiface4_data_next(struct hash_netiface4_elem *next,
 #include "ip_set_hash_gen.h"
 
 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
-static const char *get_physindev_name(const struct sk_buff *skb)
+static const char *get_physindev_name(const struct sk_buff *skb, struct net *net)
 {
-	struct net_device *dev = nf_bridge_get_physindev(skb);
+	struct net_device *dev = nf_bridge_get_physindev(skb, net);
 
 	return dev ? dev->name : NULL;
 }
@@ -177,7 +177,7 @@ hash_netiface4_kadt(struct ip_set *set, const struct sk_buff *skb,
 
 	if (opt->cmdflags & IPSET_FLAG_PHYSDEV) {
 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
-		const char *eiface = SRCDIR ? get_physindev_name(skb) :
+		const char *eiface = SRCDIR ? get_physindev_name(skb, xt_net(par)) :
 					      get_physoutdev_name(skb);
 
 		if (!eiface)
@@ -395,7 +395,7 @@ hash_netiface6_kadt(struct ip_set *set, const struct sk_buff *skb,
 
 	if (opt->cmdflags & IPSET_FLAG_PHYSDEV) {
 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
-		const char *eiface = SRCDIR ? get_physindev_name(skb) :
+		const char *eiface = SRCDIR ? get_physindev_name(skb, xt_net(par)) :
 					      get_physoutdev_name(skb);
 
 		if (!eiface)
diff --git a/net/netfilter/nf_log_syslog.c b/net/netfilter/nf_log_syslog.c
index c66689ad2b49..58402226045e 100644
--- a/net/netfilter/nf_log_syslog.c
+++ b/net/netfilter/nf_log_syslog.c
@@ -111,7 +111,8 @@ nf_log_dump_packet_common(struct nf_log_buf *m, u8 pf,
 			  unsigned int hooknum, const struct sk_buff *skb,
 			  const struct net_device *in,
 			  const struct net_device *out,
-			  const struct nf_loginfo *loginfo, const char *prefix)
+			  const struct nf_loginfo *loginfo, const char *prefix,
+			  struct net *net)
 {
 	const struct net_device *physoutdev __maybe_unused;
 	const struct net_device *physindev __maybe_unused;
@@ -121,7 +122,7 @@ nf_log_dump_packet_common(struct nf_log_buf *m, u8 pf,
 			in ? in->name : "",
 			out ? out->name : "");
 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
-	physindev = nf_bridge_get_physindev(skb);
+	physindev = nf_bridge_get_physindev(skb, net);
 	if (physindev && in != physindev)
 		nf_log_buf_add(m, "PHYSIN=%s ", physindev->name);
 	physoutdev = nf_bridge_get_physoutdev(skb);
@@ -148,7 +149,7 @@ static void nf_log_arp_packet(struct net *net, u_int8_t pf,
 		loginfo = &default_loginfo;
 
 	nf_log_dump_packet_common(m, pf, hooknum, skb, in, out, loginfo,
-				  prefix);
+				  prefix, net);
 	dump_arp_packet(m, loginfo, skb, skb_network_offset(skb));
 
 	nf_log_buf_close(m);
@@ -845,7 +846,7 @@ static void nf_log_ip_packet(struct net *net, u_int8_t pf,
 		loginfo = &default_loginfo;
 
 	nf_log_dump_packet_common(m, pf, hooknum, skb, in,
-				  out, loginfo, prefix);
+				  out, loginfo, prefix, net);
 
 	if (in)
 		dump_mac_header(m, loginfo, skb);
@@ -880,7 +881,7 @@ static void nf_log_ip6_packet(struct net *net, u_int8_t pf,
 		loginfo = &default_loginfo;
 
 	nf_log_dump_packet_common(m, pf, hooknum, skb, in, out,
-				  loginfo, prefix);
+				  loginfo, prefix, net);
 
 	if (in)
 		dump_mac_header(m, loginfo, skb);
@@ -916,7 +917,7 @@ static void nf_log_unknown_packet(struct net *net, u_int8_t pf,
 		loginfo = &default_loginfo;
 
 	nf_log_dump_packet_common(m, pf, hooknum, skb, in, out, loginfo,
-				  prefix);
+				  prefix, net);
 
 	dump_mac_header(m, loginfo, skb);
 
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
index 3dfcb3ac5cb4..e2f334f70281 100644
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -84,7 +84,7 @@ static void __nf_queue_entry_init_physdevs(struct nf_queue_entry *entry)
 	const struct sk_buff *skb = entry->skb;
 
 	if (nf_bridge_info_exists(skb)) {
-		entry->physin = nf_bridge_get_physindev(skb);
+		entry->physin = nf_bridge_get_physindev(skb, entry->state.net);
 		entry->physout = nf_bridge_get_physoutdev(skb);
 	} else {
 		entry->physin = NULL;
diff --git a/net/netfilter/xt_physdev.c b/net/netfilter/xt_physdev.c
index ec6ed6fda96c..343e65f377d4 100644
--- a/net/netfilter/xt_physdev.c
+++ b/net/netfilter/xt_physdev.c
@@ -59,7 +59,7 @@ physdev_mt(const struct sk_buff *skb, struct xt_action_param *par)
 	    (!!outdev ^ !(info->invert & XT_PHYSDEV_OP_BRIDGED)))
 		return false;
 
-	physdev = nf_bridge_get_physindev(skb);
+	physdev = nf_bridge_get_physindev(skb, xt_net(par));
 	indev = physdev ? physdev->name : NULL;
 
 	if ((info->bitmask & XT_PHYSDEV_OP_ISIN &&
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 565/583] netfilter: bridge: replace physindev with physinif in nf_bridge_info
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (563 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 564/583] netfilter: propagate net to nf_bridge_get_physindev Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 566/583] netfilter: nf_tables: do not allow mismatch field size and set key length Greg Kroah-Hartman
                   ` (24 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Florian Westphal, Pavel Tikhomirov,
	Pablo Neira Ayuso, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>

[ Upstream commit 9874808878d9eed407e3977fd11fee49de1e1d86 ]

An skb can be added to a neigh->arp_queue while waiting for an arp
reply. Where original skb's skb->dev can be different to neigh's
neigh->dev. For instance in case of bridging dnated skb from one veth to
another, the skb would be added to a neigh->arp_queue of the bridge.

As skb->dev can be reset back to nf_bridge->physindev and used, and as
there is no explicit mechanism that prevents this physindev from been
freed under us (for instance neigh_flush_dev doesn't cleanup skbs from
different device's neigh queue) we can crash on e.g. this stack:

arp_process
  neigh_update
    skb = __skb_dequeue(&neigh->arp_queue)
      neigh_resolve_output(..., skb)
        ...
          br_nf_dev_xmit
            br_nf_pre_routing_finish_bridge_slow
              skb->dev = nf_bridge->physindev
              br_handle_frame_finish

Let's use plain ifindex instead of net_device link. To peek into the
original net_device we will use dev_get_by_index_rcu(). Thus either we
get device and are safe to use it or we don't get it and drop skb.

Fixes: c4e70a87d975 ("netfilter: bridge: rename br_netfilter.c to br_netfilter_hooks.c")
Suggested-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 include/linux/netfilter_bridge.h    |  4 +--
 include/linux/skbuff.h              |  2 +-
 net/bridge/br_netfilter_hooks.c     | 42 +++++++++++++++++++++++------
 net/bridge/br_netfilter_ipv6.c      | 14 +++++++---
 net/ipv4/netfilter/nf_reject_ipv4.c |  9 ++++---
 net/ipv6/netfilter/nf_reject_ipv6.c | 11 +++++---
 6 files changed, 61 insertions(+), 21 deletions(-)

diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index e927b9a15a55..743475ca7e9d 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -42,7 +42,7 @@ static inline int nf_bridge_get_physinif(const struct sk_buff *skb)
 	if (!nf_bridge)
 		return 0;
 
-	return nf_bridge->physindev ? nf_bridge->physindev->ifindex : 0;
+	return nf_bridge->physinif;
 }
 
 static inline int nf_bridge_get_physoutif(const struct sk_buff *skb)
@@ -60,7 +60,7 @@ nf_bridge_get_physindev(const struct sk_buff *skb, struct net *net)
 {
 	const struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
 
-	return nf_bridge ? nf_bridge->physindev : NULL;
+	return nf_bridge ? dev_get_by_index_rcu(net, nf_bridge->physinif) : NULL;
 }
 
 static inline struct net_device *
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 97bfef071255..ddfe86deb4e7 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -295,7 +295,7 @@ struct nf_bridge_info {
 	u8			bridged_dnat:1;
 	u8			sabotage_in_done:1;
 	__u16			frag_max_size;
-	struct net_device	*physindev;
+	int			physinif;
 
 	/* always valid & non-NULL from FORWARD on, for physdev match */
 	struct net_device	*physoutdev;
diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c
index 033034d68f1f..92dae4c4922c 100644
--- a/net/bridge/br_netfilter_hooks.c
+++ b/net/bridge/br_netfilter_hooks.c
@@ -279,8 +279,17 @@ int br_nf_pre_routing_finish_bridge(struct net *net, struct sock *sk, struct sk_
 
 		if ((READ_ONCE(neigh->nud_state) & NUD_CONNECTED) &&
 		    READ_ONCE(neigh->hh.hh_len)) {
+			struct net_device *br_indev;
+
+			br_indev = nf_bridge_get_physindev(skb, net);
+			if (!br_indev) {
+				neigh_release(neigh);
+				goto free_skb;
+			}
+
 			neigh_hh_bridge(&neigh->hh, skb);
-			skb->dev = nf_bridge->physindev;
+			skb->dev = br_indev;
+
 			ret = br_handle_frame_finish(net, sk, skb);
 		} else {
 			/* the neighbour function below overwrites the complete
@@ -352,12 +361,18 @@ br_nf_ipv4_daddr_was_changed(const struct sk_buff *skb,
  */
 static int br_nf_pre_routing_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
 {
-	struct net_device *dev = skb->dev;
+	struct net_device *dev = skb->dev, *br_indev;
 	struct iphdr *iph = ip_hdr(skb);
 	struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
 	struct rtable *rt;
 	int err;
 
+	br_indev = nf_bridge_get_physindev(skb, net);
+	if (!br_indev) {
+		kfree_skb(skb);
+		return 0;
+	}
+
 	nf_bridge->frag_max_size = IPCB(skb)->frag_max_size;
 
 	if (nf_bridge->pkt_otherhost) {
@@ -397,7 +412,7 @@ static int br_nf_pre_routing_finish(struct net *net, struct sock *sk, struct sk_
 		} else {
 			if (skb_dst(skb)->dev == dev) {
 bridged_dnat:
-				skb->dev = nf_bridge->physindev;
+				skb->dev = br_indev;
 				nf_bridge_update_protocol(skb);
 				nf_bridge_push_encap_header(skb);
 				br_nf_hook_thresh(NF_BR_PRE_ROUTING,
@@ -410,7 +425,7 @@ static int br_nf_pre_routing_finish(struct net *net, struct sock *sk, struct sk_
 			skb->pkt_type = PACKET_HOST;
 		}
 	} else {
-		rt = bridge_parent_rtable(nf_bridge->physindev);
+		rt = bridge_parent_rtable(br_indev);
 		if (!rt) {
 			kfree_skb(skb);
 			return 0;
@@ -419,7 +434,7 @@ static int br_nf_pre_routing_finish(struct net *net, struct sock *sk, struct sk_
 		skb_dst_set_noref(skb, &rt->dst);
 	}
 
-	skb->dev = nf_bridge->physindev;
+	skb->dev = br_indev;
 	nf_bridge_update_protocol(skb);
 	nf_bridge_push_encap_header(skb);
 	br_nf_hook_thresh(NF_BR_PRE_ROUTING, net, sk, skb, skb->dev, NULL,
@@ -456,7 +471,7 @@ struct net_device *setup_pre_routing(struct sk_buff *skb, const struct net *net)
 	}
 
 	nf_bridge->in_prerouting = 1;
-	nf_bridge->physindev = skb->dev;
+	nf_bridge->physinif = skb->dev->ifindex;
 	skb->dev = brnf_get_logical_dev(skb, skb->dev, net);
 
 	if (skb->protocol == htons(ETH_P_8021Q))
@@ -553,7 +568,11 @@ static int br_nf_forward_finish(struct net *net, struct sock *sk, struct sk_buff
 		if (skb->protocol == htons(ETH_P_IPV6))
 			nf_bridge->frag_max_size = IP6CB(skb)->frag_max_size;
 
-		in = nf_bridge->physindev;
+		in = nf_bridge_get_physindev(skb, net);
+		if (!in) {
+			kfree_skb(skb);
+			return 0;
+		}
 		if (nf_bridge->pkt_otherhost) {
 			skb->pkt_type = PACKET_OTHERHOST;
 			nf_bridge->pkt_otherhost = false;
@@ -897,6 +916,13 @@ static unsigned int ip_sabotage_in(void *priv,
 static void br_nf_pre_routing_finish_bridge_slow(struct sk_buff *skb)
 {
 	struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
+	struct net_device *br_indev;
+
+	br_indev = nf_bridge_get_physindev(skb, dev_net(skb->dev));
+	if (!br_indev) {
+		kfree_skb(skb);
+		return;
+	}
 
 	skb_pull(skb, ETH_HLEN);
 	nf_bridge->bridged_dnat = 0;
@@ -906,7 +932,7 @@ static void br_nf_pre_routing_finish_bridge_slow(struct sk_buff *skb)
 	skb_copy_to_linear_data_offset(skb, -(ETH_HLEN - ETH_ALEN),
 				       nf_bridge->neigh_header,
 				       ETH_HLEN - ETH_ALEN);
-	skb->dev = nf_bridge->physindev;
+	skb->dev = br_indev;
 
 	nf_bridge->physoutdev = NULL;
 	br_handle_frame_finish(dev_net(skb->dev), NULL, skb);
diff --git a/net/bridge/br_netfilter_ipv6.c b/net/bridge/br_netfilter_ipv6.c
index 550039dfc31a..ad268bd19d5b 100644
--- a/net/bridge/br_netfilter_ipv6.c
+++ b/net/bridge/br_netfilter_ipv6.c
@@ -102,9 +102,15 @@ static int br_nf_pre_routing_finish_ipv6(struct net *net, struct sock *sk, struc
 {
 	struct nf_bridge_info *nf_bridge = nf_bridge_info_get(skb);
 	struct rtable *rt;
-	struct net_device *dev = skb->dev;
+	struct net_device *dev = skb->dev, *br_indev;
 	const struct nf_ipv6_ops *v6ops = nf_get_ipv6_ops();
 
+	br_indev = nf_bridge_get_physindev(skb, net);
+	if (!br_indev) {
+		kfree_skb(skb);
+		return 0;
+	}
+
 	nf_bridge->frag_max_size = IP6CB(skb)->frag_max_size;
 
 	if (nf_bridge->pkt_otherhost) {
@@ -122,7 +128,7 @@ static int br_nf_pre_routing_finish_ipv6(struct net *net, struct sock *sk, struc
 		}
 
 		if (skb_dst(skb)->dev == dev) {
-			skb->dev = nf_bridge->physindev;
+			skb->dev = br_indev;
 			nf_bridge_update_protocol(skb);
 			nf_bridge_push_encap_header(skb);
 			br_nf_hook_thresh(NF_BR_PRE_ROUTING,
@@ -133,7 +139,7 @@ static int br_nf_pre_routing_finish_ipv6(struct net *net, struct sock *sk, struc
 		ether_addr_copy(eth_hdr(skb)->h_dest, dev->dev_addr);
 		skb->pkt_type = PACKET_HOST;
 	} else {
-		rt = bridge_parent_rtable(nf_bridge->physindev);
+		rt = bridge_parent_rtable(br_indev);
 		if (!rt) {
 			kfree_skb(skb);
 			return 0;
@@ -142,7 +148,7 @@ static int br_nf_pre_routing_finish_ipv6(struct net *net, struct sock *sk, struc
 		skb_dst_set_noref(skb, &rt->dst);
 	}
 
-	skb->dev = nf_bridge->physindev;
+	skb->dev = br_indev;
 	nf_bridge_update_protocol(skb);
 	nf_bridge_push_encap_header(skb);
 	br_nf_hook_thresh(NF_BR_PRE_ROUTING, net, sk, skb,
diff --git a/net/ipv4/netfilter/nf_reject_ipv4.c b/net/ipv4/netfilter/nf_reject_ipv4.c
index 297000b05f18..fc761915c5f6 100644
--- a/net/ipv4/netfilter/nf_reject_ipv4.c
+++ b/net/ipv4/netfilter/nf_reject_ipv4.c
@@ -239,7 +239,6 @@ static int nf_reject_fill_skb_dst(struct sk_buff *skb_in)
 void nf_send_reset(struct net *net, struct sock *sk, struct sk_buff *oldskb,
 		   int hook)
 {
-	struct net_device *br_indev __maybe_unused;
 	struct sk_buff *nskb;
 	struct iphdr *niph;
 	const struct tcphdr *oth;
@@ -289,9 +288,13 @@ void nf_send_reset(struct net *net, struct sock *sk, struct sk_buff *oldskb,
 	 * build the eth header using the original destination's MAC as the
 	 * source, and send the RST packet directly.
 	 */
-	br_indev = nf_bridge_get_physindev(oldskb, net);
-	if (br_indev) {
+	if (nf_bridge_info_exists(oldskb)) {
 		struct ethhdr *oeth = eth_hdr(oldskb);
+		struct net_device *br_indev;
+
+		br_indev = nf_bridge_get_physindev(oldskb, net);
+		if (!br_indev)
+			goto free_nskb;
 
 		nskb->dev = br_indev;
 		niph->tot_len = htons(nskb->len);
diff --git a/net/ipv6/netfilter/nf_reject_ipv6.c b/net/ipv6/netfilter/nf_reject_ipv6.c
index 0a5ef7abf583..71d692728230 100644
--- a/net/ipv6/netfilter/nf_reject_ipv6.c
+++ b/net/ipv6/netfilter/nf_reject_ipv6.c
@@ -278,7 +278,6 @@ static int nf_reject6_fill_skb_dst(struct sk_buff *skb_in)
 void nf_send_reset6(struct net *net, struct sock *sk, struct sk_buff *oldskb,
 		    int hook)
 {
-	struct net_device *br_indev __maybe_unused;
 	struct sk_buff *nskb;
 	struct tcphdr _otcph;
 	const struct tcphdr *otcph;
@@ -354,9 +353,15 @@ void nf_send_reset6(struct net *net, struct sock *sk, struct sk_buff *oldskb,
 	 * build the eth header using the original destination's MAC as the
 	 * source, and send the RST packet directly.
 	 */
-	br_indev = nf_bridge_get_physindev(oldskb, net);
-	if (br_indev) {
+	if (nf_bridge_info_exists(oldskb)) {
 		struct ethhdr *oeth = eth_hdr(oldskb);
+		struct net_device *br_indev;
+
+		br_indev = nf_bridge_get_physindev(oldskb, net);
+		if (!br_indev) {
+			kfree_skb(nskb);
+			return;
+		}
 
 		nskb->dev = br_indev;
 		nskb->protocol = htons(ETH_P_IPV6);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 566/583] netfilter: nf_tables: do not allow mismatch field size and set key length
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (564 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 565/583] netfilter: bridge: replace physindev with physinif in nf_bridge_info Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 567/583] netfilter: nf_tables: skip dead set elements in netlink dump Greg Kroah-Hartman
                   ` (23 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Pablo Neira Ayuso, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pablo Neira Ayuso <pablo@netfilter.org>

[ Upstream commit 3ce67e3793f48c1b9635beb9bb71116ca1e51b58 ]

The set description provides the size of each field in the set whose sum
should not mismatch the set key length, bail out otherwise.

I did not manage to crash nft_set_pipapo with mismatch fields and set key
length so far, but this is UB which must be disallowed.

Fixes: f3a2181e16f1 ("netfilter: nf_tables: Support for sets with multiple ranged fields")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/netfilter/nf_tables_api.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 55cd82190888..5730f9a1f47d 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -4753,8 +4753,8 @@ static int nft_set_desc_concat_parse(const struct nlattr *attr,
 static int nft_set_desc_concat(struct nft_set_desc *desc,
 			       const struct nlattr *nla)
 {
+	u32 num_regs = 0, key_num_regs = 0;
 	struct nlattr *attr;
-	u32 num_regs = 0;
 	int rem, err, i;
 
 	nla_for_each_nested(attr, nla, rem) {
@@ -4769,6 +4769,10 @@ static int nft_set_desc_concat(struct nft_set_desc *desc,
 	for (i = 0; i < desc->field_count; i++)
 		num_regs += DIV_ROUND_UP(desc->field_len[i], sizeof(u32));
 
+	key_num_regs = DIV_ROUND_UP(desc->klen, sizeof(u32));
+	if (key_num_regs != num_regs)
+		return -EINVAL;
+
 	if (num_regs > NFT_REG32_COUNT)
 		return -E2BIG;
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 567/583] netfilter: nf_tables: skip dead set elements in netlink dump
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (565 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 566/583] netfilter: nf_tables: do not allow mismatch field size and set key length Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 568/583] netfilter: nf_tables: reject NFT_SET_CONCAT with not field length description Greg Kroah-Hartman
                   ` (22 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Pablo Neira Ayuso, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pablo Neira Ayuso <pablo@netfilter.org>

[ Upstream commit 6b1ca88e4bb63673dc9f9c7f23c899f22c3cb17a ]

Delete from packet path relies on the garbage collector to purge
elements with NFT_SET_ELEM_DEAD_BIT on.

Skip these dead elements from nf_tables_dump_setelem() path, I very
rarely see tests/shell/testcases/maps/typeof_maps_add_delete reports
[DUMP FAILED] showing a mismatch in the expected output with an element
that should not be there.

If the netlink dump happens before GC worker run, it might show dead
elements in the ruleset listing.

nft_rhash_get() already skips dead elements in nft_rhash_cmp(),
therefore, it already does not show the element when getting a single
element via netlink control plane.

Fixes: 5f68718b34a5 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/netfilter/nf_tables_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 5730f9a1f47d..1f6d5ffbe34a 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -5662,7 +5662,7 @@ static int nf_tables_dump_setelem(const struct nft_ctx *ctx,
 	const struct nft_set_ext *ext = nft_set_elem_ext(set, elem->priv);
 	struct nft_set_dump_args *args;
 
-	if (nft_set_elem_expired(ext))
+	if (nft_set_elem_expired(ext) || nft_set_elem_is_dead(ext))
 		return 0;
 
 	args = container_of(iter, struct nft_set_dump_args, iter);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 568/583] netfilter: nf_tables: reject NFT_SET_CONCAT with not field length description
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (566 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 567/583] netfilter: nf_tables: skip dead set elements in netlink dump Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 569/583] ipvs: avoid stat macros calls from preemptible context Greg Kroah-Hartman
                   ` (21 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Pablo Neira Ayuso, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pablo Neira Ayuso <pablo@netfilter.org>

[ Upstream commit 113661e07460a6604aacc8ae1b23695a89e7d4b3 ]

It is still possible to set on the NFT_SET_CONCAT flag by specifying a
set size and no field description, report EINVAL in such case.

Fixes: 1b6345d4160e ("netfilter: nf_tables: check NFT_SET_CONCAT flag if field_count is specified")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/netfilter/nf_tables_api.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 1f6d5ffbe34a..b28fbcb86e94 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -5010,8 +5010,12 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
 		if (err < 0)
 			return err;
 
-		if (desc.field_count > 1 && !(flags & NFT_SET_CONCAT))
+		if (desc.field_count > 1) {
+			if (!(flags & NFT_SET_CONCAT))
+				return -EINVAL;
+		} else if (flags & NFT_SET_CONCAT) {
 			return -EINVAL;
+		}
 	} else if (flags & NFT_SET_CONCAT) {
 		return -EINVAL;
 	}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 569/583] ipvs: avoid stat macros calls from preemptible context
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (567 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 568/583] netfilter: nf_tables: reject NFT_SET_CONCAT with not field length description Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 570/583] io_uring: adjust defer tw counting Greg Kroah-Hartman
                   ` (20 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Fedor Pchelkin, Julian Anastasov,
	Simon Horman, Pablo Neira Ayuso, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Fedor Pchelkin <pchelkin@ispras.ru>

[ Upstream commit d6938c1c76c64f42363d0d1f051e1b4641c2ad40 ]

Inside decrement_ttl() upon discovering that the packet ttl has exceeded,
__IP_INC_STATS and __IP6_INC_STATS macros can be called from preemptible
context having the following backtrace:

check_preemption_disabled: 48 callbacks suppressed
BUG: using __this_cpu_add() in preemptible [00000000] code: curl/1177
caller is decrement_ttl+0x217/0x830
CPU: 5 PID: 1177 Comm: curl Not tainted 6.7.0+ #34
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0xbd/0xe0
 check_preemption_disabled+0xd1/0xe0
 decrement_ttl+0x217/0x830
 __ip_vs_get_out_rt+0x4e0/0x1ef0
 ip_vs_nat_xmit+0x205/0xcd0
 ip_vs_in_hook+0x9b1/0x26a0
 nf_hook_slow+0xc2/0x210
 nf_hook+0x1fb/0x770
 __ip_local_out+0x33b/0x640
 ip_local_out+0x2a/0x490
 __ip_queue_xmit+0x990/0x1d10
 __tcp_transmit_skb+0x288b/0x3d10
 tcp_connect+0x3466/0x5180
 tcp_v4_connect+0x1535/0x1bb0
 __inet_stream_connect+0x40d/0x1040
 inet_stream_connect+0x57/0xa0
 __sys_connect_file+0x162/0x1a0
 __sys_connect+0x137/0x160
 __x64_sys_connect+0x72/0xb0
 do_syscall_64+0x6f/0x140
 entry_SYSCALL_64_after_hwframe+0x6e/0x76
RIP: 0033:0x7fe6dbbc34e0

Use the corresponding preemption-aware variants: IP_INC_STATS and
IP6_INC_STATS.

Found by Linux Verification Center (linuxtesting.org).

Fixes: 8d8e20e2d7bb ("ipvs: Decrement ttl")
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Acked-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Simon Horman <horms@kernel.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/netfilter/ipvs/ip_vs_xmit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index 9193e109e6b3..65e0259178da 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -271,7 +271,7 @@ static inline bool decrement_ttl(struct netns_ipvs *ipvs,
 			skb->dev = dst->dev;
 			icmpv6_send(skb, ICMPV6_TIME_EXCEED,
 				    ICMPV6_EXC_HOPLIMIT, 0);
-			__IP6_INC_STATS(net, idev, IPSTATS_MIB_INHDRERRORS);
+			IP6_INC_STATS(net, idev, IPSTATS_MIB_INHDRERRORS);
 
 			return false;
 		}
@@ -286,7 +286,7 @@ static inline bool decrement_ttl(struct netns_ipvs *ipvs,
 	{
 		if (ip_hdr(skb)->ttl <= 1) {
 			/* Tell the sender its packet died... */
-			__IP_INC_STATS(net, IPSTATS_MIB_INHDRERRORS);
+			IP_INC_STATS(net, IPSTATS_MIB_INHDRERRORS);
 			icmp_send(skb, ICMP_TIME_EXCEEDED, ICMP_EXC_TTL, 0);
 			return false;
 		}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 570/583] io_uring: adjust defer tw counting
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (568 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 569/583] ipvs: avoid stat macros calls from preemptible context Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 571/583] kdb: Fix a potential buffer overflow in kdb_local() Greg Kroah-Hartman
                   ` (19 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Pavel Begunkov, Jens Axboe, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pavel Begunkov <asml.silence@gmail.com>

[ Upstream commit dc12d1799ce710fd90abbe0ced71e7e1ae0894fc ]

The UINT_MAX work item counting bias in io_req_local_work_add() in case
of !IOU_F_TWQ_LAZY_WAKE works in a sense that we will not miss a wake up,
however it's still eerie. In particular, if we add a lazy work item
after a non-lazy one, we'll increment it and get nr_tw==0, and
subsequent adds may try to unnecessarily wake up the task, which is
though not so likely to happen in real workloads.

Half the bias, it's still large enough to be larger than any valid
->cq_wait_nr, which is limited by IORING_MAX_CQ_ENTRIES, but further
have a good enough of space before it overflows.

Fixes: 8751d15426a31 ("io_uring: reduce scheduling due to tw")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/108b971e958deaf7048342930c341ba90f75d806.1705438669.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 io_uring/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 1cc4c7b05949..ea772a02c140 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1339,7 +1339,7 @@ static inline void io_req_local_work_add(struct io_kiocb *req, unsigned flags)
 		nr_tw = nr_tw_prev + 1;
 		/* Large enough to fail the nr_wait comparison below */
 		if (!(flags & IOU_F_TWQ_LAZY_WAKE))
-			nr_tw = -1U;
+			nr_tw = INT_MAX;
 
 		req->nr_tw = nr_tw;
 		req->io_task_work.node.next = first;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 571/583] kdb: Fix a potential buffer overflow in kdb_local()
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (569 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 570/583] io_uring: adjust defer tw counting Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 572/583] arm64/ptrace: Dont flush ZA/ZT storage when writing ZA via ptrace Greg Kroah-Hartman
                   ` (18 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christophe JAILLET,
	Douglas Anderson, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

[ Upstream commit 4f41d30cd6dc865c3cbc1a852372321eba6d4e4c ]

When appending "[defcmd]" to 'kdb_prompt_str', the size of the string
already in the buffer should be taken into account.

An option could be to switch from strncat() to strlcat() which does the
correct test to avoid such an overflow.

However, this actually looks as dead code, because 'defcmd_in_progress'
can't be true here.
See a more detailed explanation at [1].

[1]: https://lore.kernel.org/all/CAD=FV=WSh7wKN7Yp-3wWiDgX4E3isQ8uh0LCzTmd1v9Cg9j+nQ@mail.gmail.com/

Fixes: 5d5314d6795f ("kdb: core for kgdb back end (1 of 2)")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/debug/kdb/kdb_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index 438b868cbfa9..35aa2e98a92a 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -1349,8 +1349,6 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs,
 		/* PROMPT can only be set if we have MEM_READ permission. */
 		snprintf(kdb_prompt_str, CMD_BUFLEN, kdbgetenv("PROMPT"),
 			 raw_smp_processor_id());
-		if (defcmd_in_progress)
-			strncat(kdb_prompt_str, "[defcmd]", CMD_BUFLEN);
 
 		/*
 		 * Fetch command from keyboard
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 572/583] arm64/ptrace: Dont flush ZA/ZT storage when writing ZA via ptrace
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (570 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 571/583] kdb: Fix a potential buffer overflow in kdb_local() Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 573/583] ethtool: netlink: Add missing ethnl_ops_begin/complete Greg Kroah-Hartman
                   ` (17 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, patches, Mark Brown, Will Deacon, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mark Brown <broonie@kernel.org>

[ Upstream commit b7c510d049049409e8945b932f4b0b357fa17415 ]

When writing ZA we currently unconditionally flush the buffer used to store
it as part of ensuring that it is allocated. Since this buffer is shared
with ZT0 this means that a write to ZA when PSTATE.ZA is already set will
corrupt the value of ZT0 on a SME2 system. Fix this by only flushing the
backing storage if PSTATE.ZA was not previously set.

This will mean that short or failed writes may leave stale data in the
buffer, this seems as correct as our current behaviour and unlikely to be
something that userspace will rely on.

Fixes: f90b529bcbe5 ("arm64/sme: Implement ZT0 ptrace support")
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240115-arm64-fix-ptrace-za-zt-v1-1-48617517028a@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/arm64/kernel/ptrace.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index 20d7ef82de90..b3f64144b5cd 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -1107,12 +1107,13 @@ static int za_set(struct task_struct *target,
 		}
 	}
 
-	/* Allocate/reinit ZA storage */
-	sme_alloc(target, true);
-	if (!target->thread.sme_state) {
-		ret = -ENOMEM;
-		goto out;
-	}
+	/*
+	 * Only flush the storage if PSTATE.ZA was not already set,
+	 * otherwise preserve any existing data.
+	 */
+	sme_alloc(target, !thread_za_enabled(&target->thread));
+	if (!target->thread.sme_state)
+		return -ENOMEM;
 
 	/* If there is no data then disable ZA */
 	if (!count) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 573/583] ethtool: netlink: Add missing ethnl_ops_begin/complete
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (571 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 572/583] arm64/ptrace: Dont flush ZA/ZT storage when writing ZA via ptrace Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 574/583] loop: fix the the direct I/O support check when used on top of block devices Greg Kroah-Hartman
                   ` (16 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ludvig Pärsson, Paolo Abeni,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ludvig Pärsson <ludvig.parsson@axis.com>

[ Upstream commit f1172f3ee3a98754d95b968968920a7d03fdebcc ]

Accessing an ethernet device that is powered off or clock gated might
cause the CPU to hang. Add ethnl_ops_begin/complete in
ethnl_set_features() to protect against this.

Fixes: 0980bfcd6954 ("ethtool: set netdev features with FEATURES_SET request")
Signed-off-by: Ludvig Pärsson <ludvig.parsson@axis.com>
Link: https://lore.kernel.org/r/20240117-etht2-v2-1-1a96b6e8c650@axis.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ethtool/features.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/net/ethtool/features.c b/net/ethtool/features.c
index a79af8c25a07..b6cb101d7f19 100644
--- a/net/ethtool/features.c
+++ b/net/ethtool/features.c
@@ -234,17 +234,20 @@ int ethnl_set_features(struct sk_buff *skb, struct genl_info *info)
 	dev = req_info.dev;
 
 	rtnl_lock();
+	ret = ethnl_ops_begin(dev);
+	if (ret < 0)
+		goto out_rtnl;
 	ethnl_features_to_bitmap(old_active, dev->features);
 	ethnl_features_to_bitmap(old_wanted, dev->wanted_features);
 	ret = ethnl_parse_bitset(req_wanted, req_mask, NETDEV_FEATURE_COUNT,
 				 tb[ETHTOOL_A_FEATURES_WANTED],
 				 netdev_features_strings, info->extack);
 	if (ret < 0)
-		goto out_rtnl;
+		goto out_ops;
 	if (ethnl_bitmap_to_features(req_mask) & ~NETIF_F_ETHTOOL_BITS) {
 		GENL_SET_ERR_MSG(info, "attempt to change non-ethtool features");
 		ret = -EINVAL;
-		goto out_rtnl;
+		goto out_ops;
 	}
 
 	/* set req_wanted bits not in req_mask from old_wanted */
@@ -281,6 +284,8 @@ int ethnl_set_features(struct sk_buff *skb, struct genl_info *info)
 	if (mod)
 		netdev_features_change(dev);
 
+out_ops:
+	ethnl_ops_complete(dev);
 out_rtnl:
 	rtnl_unlock();
 	ethnl_parse_header_dev_put(&req_info);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 574/583] loop: fix the the direct I/O support check when used on top of block devices
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (572 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 573/583] ethtool: netlink: Add missing ethnl_ops_begin/complete Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 575/583] mlxsw: spectrum_acl_erp: Fix error flow of pool allocation failure Greg Kroah-Hartman
                   ` (15 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Christoph Hellwig, Ming Lei,
	Jens Axboe, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christoph Hellwig <hch@lst.de>

[ Upstream commit baa7d536077dcdfe2b70c476a8873d1745d3de0f ]

__loop_update_dio only checks the alignment requirement for block backed
file systems, but misses them for the case where the loop device is
created directly on top of another block device.  Due to this creating
a loop device with default option plus the direct I/O flag on a > 512 byte
sector size file system will lead to incorrect I/O being submitted to the
lower block device and a lot of error from the lock layer.  This can
be seen with xfstests generic/563.

Fix the code in __loop_update_dio by factoring the alignment check into
a helper, and calling that also for the struct block_device of a block
device inode.

Also remove the TODO comment talking about dynamically switching between
buffered and direct I/O, which is a would be a recipe for horrible
performance and occasional data loss.

Fixes: 2e5ab5f379f9 ("block: loop: prepare for supporing direct IO")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20240117175901.871796-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/block/loop.c | 52 +++++++++++++++++++++-----------------------
 1 file changed, 25 insertions(+), 27 deletions(-)

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 9f2d412fc560..552f56a84a7e 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -165,39 +165,37 @@ static loff_t get_loop_size(struct loop_device *lo, struct file *file)
 	return get_size(lo->lo_offset, lo->lo_sizelimit, file);
 }
 
+/*
+ * We support direct I/O only if lo_offset is aligned with the logical I/O size
+ * of backing device, and the logical block size of loop is bigger than that of
+ * the backing device.
+ */
+static bool lo_bdev_can_use_dio(struct loop_device *lo,
+		struct block_device *backing_bdev)
+{
+	unsigned short sb_bsize = bdev_logical_block_size(backing_bdev);
+
+	if (queue_logical_block_size(lo->lo_queue) < sb_bsize)
+		return false;
+	if (lo->lo_offset & (sb_bsize - 1))
+		return false;
+	return true;
+}
+
 static void __loop_update_dio(struct loop_device *lo, bool dio)
 {
 	struct file *file = lo->lo_backing_file;
-	struct address_space *mapping = file->f_mapping;
-	struct inode *inode = mapping->host;
-	unsigned short sb_bsize = 0;
-	unsigned dio_align = 0;
+	struct inode *inode = file->f_mapping->host;
+	struct block_device *backing_bdev = NULL;
 	bool use_dio;
 
-	if (inode->i_sb->s_bdev) {
-		sb_bsize = bdev_logical_block_size(inode->i_sb->s_bdev);
-		dio_align = sb_bsize - 1;
-	}
+	if (S_ISBLK(inode->i_mode))
+		backing_bdev = I_BDEV(inode);
+	else if (inode->i_sb->s_bdev)
+		backing_bdev = inode->i_sb->s_bdev;
 
-	/*
-	 * We support direct I/O only if lo_offset is aligned with the
-	 * logical I/O size of backing device, and the logical block
-	 * size of loop is bigger than the backing device's.
-	 *
-	 * TODO: the above condition may be loosed in the future, and
-	 * direct I/O may be switched runtime at that time because most
-	 * of requests in sane applications should be PAGE_SIZE aligned
-	 */
-	if (dio) {
-		if (queue_logical_block_size(lo->lo_queue) >= sb_bsize &&
-		    !(lo->lo_offset & dio_align) &&
-		    (file->f_mode & FMODE_CAN_ODIRECT))
-			use_dio = true;
-		else
-			use_dio = false;
-	} else {
-		use_dio = false;
-	}
+	use_dio = dio && (file->f_mode & FMODE_CAN_ODIRECT) &&
+		(!backing_bdev || lo_bdev_can_use_dio(lo, backing_bdev));
 
 	if (lo->use_dio == use_dio)
 		return;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 575/583] mlxsw: spectrum_acl_erp: Fix error flow of pool allocation failure
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (573 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 574/583] loop: fix the the direct I/O support check when used on top of block devices Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 576/583] mlxsw: spectrum_acl_tcam: Fix NULL pointer dereference in error path Greg Kroah-Hartman
                   ` (14 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Amit Cohen, Ido Schimmel,
	Petr Machata, Paolo Abeni, Jakub Kicinski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Amit Cohen <amcohen@nvidia.com>

[ Upstream commit 6d6eeabcfaba2fcadf5443b575789ea606f9de83 ]

Lately, a bug was found when many TC filters are added - at some point,
several bugs are printed to dmesg [1] and the switch is crashed with
segmentation fault.

The issue starts when gen_pool_free() fails because of unexpected
behavior - a try to free memory which is already freed, this leads to BUG()
call which crashes the switch and makes many other bugs.

Trying to track down the unexpected behavior led to a bug in eRP code. The
function mlxsw_sp_acl_erp_table_alloc() gets a pointer to the allocated
index, sets the value and returns an error code. When gen_pool_alloc()
fails it returns address 0, we track it and return -ENOBUFS outside, BUT
the call for gen_pool_alloc() already override the index in erp_table
structure. This is a problem when such allocation is done as part of
table expansion. This is not a new table, which will not be used in case
of allocation failure. We try to expand eRP table and override the
current index (non-zero) with zero. Then, it leads to an unexpected
behavior when address 0 is freed twice. Note that address 0 is valid in
erp_table->base_index and indeed other tables use it.

gen_pool_alloc() fails in case that there is no space left in the
pre-allocated pool, in our case, the pool is limited to
ACL_MAX_ERPT_BANK_SIZE, which is read from hardware. When more than max
erp entries are required, we exceed the limit and return an error, this
error leads to "Failed to migrate vregion" print.

Fix this by changing erp_table->base_index only in case of a successful
allocation.

Add a test case for such a scenario. Without this fix it causes
segmentation fault:

$ TESTS="max_erp_entries_test" ./tc_flower.sh
./tc_flower.sh: line 988:  1560 Segmentation fault      tc filter del dev $h2 ingress chain $i protocol ip pref $i handle $j flower &>/dev/null

[1]:
kernel BUG at lib/genalloc.c:508!
invalid opcode: 0000 [#1] PREEMPT SMP
CPU: 6 PID: 3531 Comm: tc Not tainted 6.7.0-rc5-custom-ga6893f479f5e #1
Hardware name: Mellanox Technologies Ltd. MSN4700/VMOD0010, BIOS 5.11 07/12/2021
RIP: 0010:gen_pool_free_owner+0xc9/0xe0
...
Call Trace:
 <TASK>
 __mlxsw_sp_acl_erp_table_other_dec+0x70/0xa0 [mlxsw_spectrum]
 mlxsw_sp_acl_erp_mask_destroy+0xf5/0x110 [mlxsw_spectrum]
 objagg_obj_root_destroy+0x18/0x80 [objagg]
 objagg_obj_destroy+0x12c/0x130 [objagg]
 mlxsw_sp_acl_erp_mask_put+0x37/0x50 [mlxsw_spectrum]
 mlxsw_sp_acl_ctcam_region_entry_remove+0x74/0xa0 [mlxsw_spectrum]
 mlxsw_sp_acl_ctcam_entry_del+0x1e/0x40 [mlxsw_spectrum]
 mlxsw_sp_acl_tcam_ventry_del+0x78/0xd0 [mlxsw_spectrum]
 mlxsw_sp_flower_destroy+0x4d/0x70 [mlxsw_spectrum]
 mlxsw_sp_flow_block_cb+0x73/0xb0 [mlxsw_spectrum]
 tc_setup_cb_destroy+0xc1/0x180
 fl_hw_destroy_filter+0x94/0xc0 [cls_flower]
 __fl_delete+0x1ac/0x1c0 [cls_flower]
 fl_destroy+0xc2/0x150 [cls_flower]
 tcf_proto_destroy+0x1a/0xa0
...
mlxsw_spectrum3 0000:07:00.0: Failed to migrate vregion
mlxsw_spectrum3 0000:07:00.0: Failed to migrate vregion

Fixes: f465261aa105 ("mlxsw: spectrum_acl: Implement common eRP core")
Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/r/4cfca254dfc0e5d283974801a24371c7b6db5989.1705502064.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../mellanox/mlxsw/spectrum_acl_erp.c         |  8 +--
 .../drivers/net/mlxsw/spectrum-2/tc_flower.sh | 52 ++++++++++++++++++-
 2 files changed, 56 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c
index 4c98950380d5..d231f4d2888b 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c
@@ -301,6 +301,7 @@ mlxsw_sp_acl_erp_table_alloc(struct mlxsw_sp_acl_erp_core *erp_core,
 			     unsigned long *p_index)
 {
 	unsigned int num_rows, entry_size;
+	unsigned long index;
 
 	/* We only allow allocations of entire rows */
 	if (num_erps % erp_core->num_erp_banks != 0)
@@ -309,10 +310,11 @@ mlxsw_sp_acl_erp_table_alloc(struct mlxsw_sp_acl_erp_core *erp_core,
 	entry_size = erp_core->erpt_entries_size[region_type];
 	num_rows = num_erps / erp_core->num_erp_banks;
 
-	*p_index = gen_pool_alloc(erp_core->erp_tables, num_rows * entry_size);
-	if (*p_index == 0)
+	index = gen_pool_alloc(erp_core->erp_tables, num_rows * entry_size);
+	if (!index)
 		return -ENOBUFS;
-	*p_index -= MLXSW_SP_ACL_ERP_GENALLOC_OFFSET;
+
+	*p_index = index - MLXSW_SP_ACL_ERP_GENALLOC_OFFSET;
 
 	return 0;
 }
diff --git a/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower.sh b/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower.sh
index fb850e0ec837..7bf56ea161e3 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower.sh
@@ -10,7 +10,8 @@ lib_dir=$(dirname $0)/../../../../net/forwarding
 ALL_TESTS="single_mask_test identical_filters_test two_masks_test \
 	multiple_masks_test ctcam_edge_cases_test delta_simple_test \
 	delta_two_masks_one_key_test delta_simple_rehash_test \
-	bloom_simple_test bloom_complex_test bloom_delta_test"
+	bloom_simple_test bloom_complex_test bloom_delta_test \
+	max_erp_entries_test"
 NUM_NETIFS=2
 source $lib_dir/lib.sh
 source $lib_dir/tc_common.sh
@@ -983,6 +984,55 @@ bloom_delta_test()
 	log_test "bloom delta test ($tcflags)"
 }
 
+max_erp_entries_test()
+{
+	# The number of eRP entries is limited. Once the maximum number of eRPs
+	# has been reached, filters cannot be added. This test verifies that
+	# when this limit is reached, inserstion fails without crashing.
+
+	RET=0
+
+	local num_masks=32
+	local num_regions=15
+	local chain_failed
+	local mask_failed
+	local ret
+
+	if [[ "$tcflags" != "skip_sw" ]]; then
+		return 0;
+	fi
+
+	for ((i=1; i < $num_regions; i++)); do
+		for ((j=$num_masks; j >= 0; j--)); do
+			tc filter add dev $h2 ingress chain $i protocol ip \
+				pref $i	handle $j flower $tcflags \
+				dst_ip 192.1.0.0/$j &> /dev/null
+			ret=$?
+
+			if [ $ret -ne 0 ]; then
+				chain_failed=$i
+				mask_failed=$j
+				break 2
+			fi
+		done
+	done
+
+	# We expect to exceed the maximum number of eRP entries, so that
+	# insertion eventually fails. Otherwise, the test should be adjusted to
+	# add more filters.
+	check_fail $ret "expected to exceed number of eRP entries"
+
+	for ((; i >= 1; i--)); do
+		for ((j=0; j <= $num_masks; j++)); do
+			tc filter del dev $h2 ingress chain $i protocol ip \
+				pref $i handle $j flower &> /dev/null
+		done
+	done
+
+	log_test "max eRP entries test ($tcflags). " \
+		"max chain $chain_failed, mask $mask_failed"
+}
+
 setup_prepare()
 {
 	h1=${NETIFS[p1]}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 576/583] mlxsw: spectrum_acl_tcam: Fix NULL pointer dereference in error path
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (574 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 575/583] mlxsw: spectrum_acl_erp: Fix error flow of pool allocation failure Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 577/583] mlxsw: spectrum_acl_tcam: Fix stack corruption Greg Kroah-Hartman
                   ` (13 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Ido Schimmel, Amit Cohen,
	Jiri Pirko, Petr Machata, Paolo Abeni, Jakub Kicinski,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ido Schimmel <idosch@nvidia.com>

[ Upstream commit efeb7dfea8ee10cdec11b6b6ba4e405edbe75809 ]

When calling mlxsw_sp_acl_tcam_region_destroy() from an error path after
failing to attach the region to an ACL group, we hit a NULL pointer
dereference upon 'region->group->tcam' [1].

Fix by retrieving the 'tcam' pointer using mlxsw_sp_acl_to_tcam().

[1]
BUG: kernel NULL pointer dereference, address: 0000000000000000
[...]
RIP: 0010:mlxsw_sp_acl_tcam_region_destroy+0xa0/0xd0
[...]
Call Trace:
 mlxsw_sp_acl_tcam_vchunk_get+0x88b/0xa20
 mlxsw_sp_acl_tcam_ventry_add+0x25/0xe0
 mlxsw_sp_acl_rule_add+0x47/0x240
 mlxsw_sp_flower_replace+0x1a9/0x1d0
 tc_setup_cb_add+0xdc/0x1c0
 fl_hw_replace_filter+0x146/0x1f0
 fl_change+0xc17/0x1360
 tc_new_tfilter+0x472/0xb90
 rtnetlink_rcv_msg+0x313/0x3b0
 netlink_rcv_skb+0x58/0x100
 netlink_unicast+0x244/0x390
 netlink_sendmsg+0x1e4/0x440
 ____sys_sendmsg+0x164/0x260
 ___sys_sendmsg+0x9a/0xe0
 __sys_sendmsg+0x7a/0xc0
 do_syscall_64+0x40/0xe0
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

Fixes: 22a677661f56 ("mlxsw: spectrum: Introduce ACL core with simple TCAM implementation")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/r/fb6a4542bbc9fcab5a523802d97059bffbca7126.1705502064.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
index d50786b0a6ce..7d1e91196e94 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
@@ -681,13 +681,13 @@ static void
 mlxsw_sp_acl_tcam_region_destroy(struct mlxsw_sp *mlxsw_sp,
 				 struct mlxsw_sp_acl_tcam_region *region)
 {
+	struct mlxsw_sp_acl_tcam *tcam = mlxsw_sp_acl_to_tcam(mlxsw_sp->acl);
 	const struct mlxsw_sp_acl_tcam_ops *ops = mlxsw_sp->acl_tcam_ops;
 
 	ops->region_fini(mlxsw_sp, region->priv);
 	mlxsw_sp_acl_tcam_region_disable(mlxsw_sp, region);
 	mlxsw_sp_acl_tcam_region_free(mlxsw_sp, region);
-	mlxsw_sp_acl_tcam_region_id_put(region->group->tcam,
-					region->id);
+	mlxsw_sp_acl_tcam_region_id_put(tcam, region->id);
 	kfree(region);
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 577/583] mlxsw: spectrum_acl_tcam: Fix stack corruption
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (575 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 576/583] mlxsw: spectrum_acl_tcam: Fix NULL pointer dereference in error path Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 578/583] mlxsw: spectrum_router: Register netdevice notifier before nexthop Greg Kroah-Hartman
                   ` (12 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Orel Hagag, Ido Schimmel,
	Amit Cohen, Petr Machata, Paolo Abeni, Jakub Kicinski,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ido Schimmel <idosch@nvidia.com>

[ Upstream commit 483ae90d8f976f8339cf81066312e1329f2d3706 ]

When tc filters are first added to a net device, the corresponding local
port gets bound to an ACL group in the device. The group contains a list
of ACLs. In turn, each ACL points to a different TCAM region where the
filters are stored. During forwarding, the ACLs are sequentially
evaluated until a match is found.

One reason to place filters in different regions is when they are added
with decreasing priorities and in an alternating order so that two
consecutive filters can never fit in the same region because of their
key usage.

In Spectrum-2 and newer ASICs the firmware started to report that the
maximum number of ACLs in a group is more than 16, but the layout of the
register that configures ACL groups (PAGT) was not updated to account
for that. It is therefore possible to hit stack corruption [1] in the
rare case where more than 16 ACLs in a group are required.

Fix by limiting the maximum ACL group size to the minimum between what
the firmware reports and the maximum ACLs that fit in the PAGT register.

Add a test case to make sure the machine does not crash when this
condition is hit.

[1]
Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: mlxsw_sp_acl_tcam_group_update+0x116/0x120
[...]
 dump_stack_lvl+0x36/0x50
 panic+0x305/0x330
 __stack_chk_fail+0x15/0x20
 mlxsw_sp_acl_tcam_group_update+0x116/0x120
 mlxsw_sp_acl_tcam_group_region_attach+0x69/0x110
 mlxsw_sp_acl_tcam_vchunk_get+0x492/0xa20
 mlxsw_sp_acl_tcam_ventry_add+0x25/0xe0
 mlxsw_sp_acl_rule_add+0x47/0x240
 mlxsw_sp_flower_replace+0x1a9/0x1d0
 tc_setup_cb_add+0xdc/0x1c0
 fl_hw_replace_filter+0x146/0x1f0
 fl_change+0xc17/0x1360
 tc_new_tfilter+0x472/0xb90
 rtnetlink_rcv_msg+0x313/0x3b0
 netlink_rcv_skb+0x58/0x100
 netlink_unicast+0x244/0x390
 netlink_sendmsg+0x1e4/0x440
 ____sys_sendmsg+0x164/0x260
 ___sys_sendmsg+0x9a/0xe0
 __sys_sendmsg+0x7a/0xc0
 do_syscall_64+0x40/0xe0
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

Fixes: c3ab435466d5 ("mlxsw: spectrum: Extend to support Spectrum-2 ASIC")
Reported-by: Orel Hagag <orelh@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/r/2d91c89afba59c22587b444994ae419dbea8d876.1705502064.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../mellanox/mlxsw/spectrum_acl_tcam.c        |  2 +
 .../drivers/net/mlxsw/spectrum-2/tc_flower.sh | 56 ++++++++++++++++++-
 2 files changed, 57 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
index 7d1e91196e94..50ea1eff02b2 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
@@ -1564,6 +1564,8 @@ int mlxsw_sp_acl_tcam_init(struct mlxsw_sp *mlxsw_sp,
 	tcam->max_groups = max_groups;
 	tcam->max_group_size = MLXSW_CORE_RES_GET(mlxsw_sp->core,
 						  ACL_MAX_GROUP_SIZE);
+	tcam->max_group_size = min_t(unsigned int, tcam->max_group_size,
+				     MLXSW_REG_PAGT_ACL_MAX_NUM);
 
 	err = ops->init(mlxsw_sp, tcam->priv, tcam);
 	if (err)
diff --git a/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower.sh b/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower.sh
index 7bf56ea161e3..616d3581419c 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower.sh
@@ -11,7 +11,7 @@ ALL_TESTS="single_mask_test identical_filters_test two_masks_test \
 	multiple_masks_test ctcam_edge_cases_test delta_simple_test \
 	delta_two_masks_one_key_test delta_simple_rehash_test \
 	bloom_simple_test bloom_complex_test bloom_delta_test \
-	max_erp_entries_test"
+	max_erp_entries_test max_group_size_test"
 NUM_NETIFS=2
 source $lib_dir/lib.sh
 source $lib_dir/tc_common.sh
@@ -1033,6 +1033,60 @@ max_erp_entries_test()
 		"max chain $chain_failed, mask $mask_failed"
 }
 
+max_group_size_test()
+{
+	# The number of ACLs in an ACL group is limited. Once the maximum
+	# number of ACLs has been reached, filters cannot be added. This test
+	# verifies that when this limit is reached, insertion fails without
+	# crashing.
+
+	RET=0
+
+	local num_acls=32
+	local max_size
+	local ret
+
+	if [[ "$tcflags" != "skip_sw" ]]; then
+		return 0;
+	fi
+
+	for ((i=1; i < $num_acls; i++)); do
+		if [[ $(( i % 2 )) == 1 ]]; then
+			tc filter add dev $h2 ingress pref $i proto ipv4 \
+				flower $tcflags dst_ip 198.51.100.1/32 \
+				ip_proto tcp tcp_flags 0x01/0x01 \
+				action drop &> /dev/null
+		else
+			tc filter add dev $h2 ingress pref $i proto ipv6 \
+				flower $tcflags dst_ip 2001:db8:1::1/128 \
+				action drop &> /dev/null
+		fi
+
+		ret=$?
+		[[ $ret -ne 0 ]] && max_size=$((i - 1)) && break
+	done
+
+	# We expect to exceed the maximum number of ACLs in a group, so that
+	# insertion eventually fails. Otherwise, the test should be adjusted to
+	# add more filters.
+	check_fail $ret "expected to exceed number of ACLs in a group"
+
+	for ((; i >= 1; i--)); do
+		if [[ $(( i % 2 )) == 1 ]]; then
+			tc filter del dev $h2 ingress pref $i proto ipv4 \
+				flower $tcflags dst_ip 198.51.100.1/32 \
+				ip_proto tcp tcp_flags 0x01/0x01 \
+				action drop &> /dev/null
+		else
+			tc filter del dev $h2 ingress pref $i proto ipv6 \
+				flower $tcflags dst_ip 2001:db8:1::1/128 \
+				action drop &> /dev/null
+		fi
+	done
+
+	log_test "max ACL group size test ($tcflags). max size $max_size"
+}
+
 setup_prepare()
 {
 	h1=${NETIFS[p1]}
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 578/583] mlxsw: spectrum_router: Register netdevice notifier before nexthop
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (576 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 577/583] mlxsw: spectrum_acl_tcam: Fix stack corruption Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 579/583] selftests: mlxsw: qos_pfc: Adjust the test to support 8 lanes Greg Kroah-Hartman
                   ` (11 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Maksym Yaremchuk, Petr Machata,
	Ido Schimmel, Paolo Abeni, Jakub Kicinski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Petr Machata <petrm@nvidia.com>

[ Upstream commit 62bef63646c194e0f82b40304a0f2d060b28687b ]

If there are IPIP nexthops at the time when the driver is loaded (or the
devlink instance reloaded), the driver looks up the corresponding IPIP
entry. But IPIP entries are only created as a result of netdevice
notifications. Since the netdevice notifier is registered after the nexthop
notifier, mlxsw_sp_nexthop_type_init() never finds the IPIP entry,
registers the nexthop MLXSW_SP_NEXTHOP_TYPE_ETH, and fails to assign a CRIF
to the nexthop. Later on when the CRIF is necessary, the WARN_ON in
mlxsw_sp_nexthop_rif() triggers, causing the splat [1].

In order to fix the issue, reorder the netdevice notifier to be registered
before the nexthop one.

[1] (edited for clarity):

    WARNING: CPU: 1 PID: 1364 at drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:3245 mlxsw_sp_nexthop_rif (drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:3246 (discriminator 1)) mlxsw_spectrum
    Hardware name: Mellanox Technologies Ltd. MSN4410/VMOD0010, BIOS 5.11 01/06/2019
    Call Trace:
    ? mlxsw_sp_nexthop_rif (drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:3246 (discriminator 1)) mlxsw_spectrum
    __mlxsw_sp_nexthop_eth_update (drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:3637) mlxsw_spectrum
    mlxsw_sp_nexthop_update (drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:3679 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:3727) mlxsw_spectrum
    mlxsw_sp_nexthop_group_update (drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:3757) mlxsw_spectrum
    mlxsw_sp_nexthop_group_refresh (drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:4112) mlxsw_spectrum
    mlxsw_sp_nexthop_obj_event (drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:5118 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:5191 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:5315 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:5500) mlxsw_spectrum
    nexthops_dump (net/ipv4/nexthop.c:217 net/ipv4/nexthop.c:440 net/ipv4/nexthop.c:3609)
    register_nexthop_notifier (net/ipv4/nexthop.c:3624)
    mlxsw_sp_router_init (drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:11486) mlxsw_spectrum
    mlxsw_sp_init (drivers/net/ethernet/mellanox/mlxsw/spectrum.c:3267) mlxsw_spectrum
    __mlxsw_core_bus_device_register (drivers/net/ethernet/mellanox/mlxsw/core.c:2202) mlxsw_core
    mlxsw_devlink_core_bus_device_reload_up (drivers/net/ethernet/mellanox/mlxsw/core.c:2265 drivers/net/ethernet/mellanox/mlxsw/core.c:1603) mlxsw_core
    devlink_reload (net/devlink/dev.c:314 net/devlink/dev.c:475)
    [...]

Fixes: 9464a3d68ea9 ("mlxsw: spectrum_router: Track next hops at CRIFs")
Reported-by: Maksym Yaremchuk <maksymy@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/r/74edb8d45d004e8d8f5318eede6ccc3d786d8ba9.1705502064.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../ethernet/mellanox/mlxsw/spectrum_router.c | 24 +++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index debd2c466f11..ae2fb9efbc50 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -11458,6 +11458,13 @@ int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp,
 	if (err)
 		goto err_register_netevent_notifier;
 
+	mlxsw_sp->router->netdevice_nb.notifier_call =
+		mlxsw_sp_router_netdevice_event;
+	err = register_netdevice_notifier_net(mlxsw_sp_net(mlxsw_sp),
+					      &mlxsw_sp->router->netdevice_nb);
+	if (err)
+		goto err_register_netdev_notifier;
+
 	mlxsw_sp->router->nexthop_nb.notifier_call =
 		mlxsw_sp_nexthop_obj_event;
 	err = register_nexthop_notifier(mlxsw_sp_net(mlxsw_sp),
@@ -11473,22 +11480,15 @@ int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp,
 	if (err)
 		goto err_register_fib_notifier;
 
-	mlxsw_sp->router->netdevice_nb.notifier_call =
-		mlxsw_sp_router_netdevice_event;
-	err = register_netdevice_notifier_net(mlxsw_sp_net(mlxsw_sp),
-					      &mlxsw_sp->router->netdevice_nb);
-	if (err)
-		goto err_register_netdev_notifier;
-
 	return 0;
 
-err_register_netdev_notifier:
-	unregister_fib_notifier(mlxsw_sp_net(mlxsw_sp),
-				&mlxsw_sp->router->fib_nb);
 err_register_fib_notifier:
 	unregister_nexthop_notifier(mlxsw_sp_net(mlxsw_sp),
 				    &mlxsw_sp->router->nexthop_nb);
 err_register_nexthop_notifier:
+	unregister_netdevice_notifier_net(mlxsw_sp_net(mlxsw_sp),
+					  &router->netdevice_nb);
+err_register_netdev_notifier:
 	unregister_netevent_notifier(&mlxsw_sp->router->netevent_nb);
 err_register_netevent_notifier:
 	unregister_inet6addr_validator_notifier(&router->inet6addr_valid_nb);
@@ -11536,11 +11536,11 @@ void mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp)
 {
 	struct mlxsw_sp_router *router = mlxsw_sp->router;
 
-	unregister_netdevice_notifier_net(mlxsw_sp_net(mlxsw_sp),
-					  &router->netdevice_nb);
 	unregister_fib_notifier(mlxsw_sp_net(mlxsw_sp), &router->fib_nb);
 	unregister_nexthop_notifier(mlxsw_sp_net(mlxsw_sp),
 				    &router->nexthop_nb);
+	unregister_netdevice_notifier_net(mlxsw_sp_net(mlxsw_sp),
+					  &router->netdevice_nb);
 	unregister_netevent_notifier(&router->netevent_nb);
 	unregister_inet6addr_validator_notifier(&router->inet6addr_valid_nb);
 	unregister_inetaddr_validator_notifier(&router->inetaddr_valid_nb);
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 579/583] selftests: mlxsw: qos_pfc: Adjust the test to support 8 lanes
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (577 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 578/583] mlxsw: spectrum_router: Register netdevice notifier before nexthop Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 580/583] ipv6: mcast: fix data-race in ipv6_mc_down / mld_ifc_work Greg Kroah-Hartman
                   ` (10 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Shuah Khan, Amit Cohen,
	Ido Schimmel, Petr Machata, Paolo Abeni, Jakub Kicinski,
	Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Amit Cohen <amcohen@nvidia.com>

[ Upstream commit b34f4de6d30cbaa8fed905a5080b6eace8c84dc7 ]

'qos_pfc' test checks PFC behavior. The idea is to limit the traffic
using a shaper somewhere in the flow of the packets. In this area, the
buffer is smaller than the buffer at the beginning of the flow, so it fills
up until there is no more space left. The test configures there PFC
which is supposed to notice that the headroom is filling up and send PFC
Xoff to indicate the transmitter to stop sending traffic for the priorities
sharing this PG.

The Xon/Xoff threshold is auto-configured and always equal to
2*(MTU rounded up to cell size). Even after sending the PFC Xoff packet,
traffic will keep arriving until the transmitter receives and processes
the PFC packet. This amount of traffic is known as the PFC delay allowance.

Currently the buffer for the delay traffic is configured as 100KB. The
MTU in the test is 10KB, therefore the threshold for Xoff is about 20KB.
This allows 80KB extra to be stored in this buffer.

8-lane ports use two buffers among which the configured buffer is split,
the Xoff threshold then applies to each buffer in parallel.

The test does not take into account the behavior of 8-lane ports, when the
ports are configured to 400Gbps with 8 lanes or 800Gbps with 8 lanes,
packets are dropped and the test fails.

Check if the relevant ports use 8 lanes, in such case double the size of
the buffer, as the headroom is split half-half.

Cc: Shuah Khan <shuah@kernel.org>
Fixes: bfa804784e32 ("selftests: mlxsw: Add a PFC test")
Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/r/23ff11b7dff031eb04a41c0f5254a2b636cd8ebb.1705502064.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../selftests/drivers/net/mlxsw/qos_pfc.sh     | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/drivers/net/mlxsw/qos_pfc.sh b/tools/testing/selftests/drivers/net/mlxsw/qos_pfc.sh
index 42ce602d8d49..e71d811656bb 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/qos_pfc.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/qos_pfc.sh
@@ -120,6 +120,9 @@ h2_destroy()
 
 switch_create()
 {
+	local lanes_swp4
+	local pg1_size
+
 	# pools
 	# -----
 
@@ -229,7 +232,20 @@ switch_create()
 	dcb pfc set dev $swp4 prio-pfc all:off 1:on
 	# PG0 will get autoconfigured to Xoff, give PG1 arbitrarily 100K, which
 	# is (-2*MTU) about 80K of delay provision.
-	dcb buffer set dev $swp4 buffer-size all:0 1:$_100KB
+	pg1_size=$_100KB
+
+	setup_wait_dev_with_timeout $swp4
+
+	lanes_swp4=$(ethtool $swp4 | grep 'Lanes:')
+	lanes_swp4=${lanes_swp4#*"Lanes: "}
+
+	# 8-lane ports use two buffers among which the configured buffer
+	# is split, so double the size to get twice (20K + 80K).
+	if [[ $lanes_swp4 -eq 8 ]]; then
+		pg1_size=$((pg1_size * 2))
+	fi
+
+	dcb buffer set dev $swp4 buffer-size all:0 1:$pg1_size
 
 	# bridges
 	# -------
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 580/583] ipv6: mcast: fix data-race in ipv6_mc_down / mld_ifc_work
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (578 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 579/583] selftests: mlxsw: qos_pfc: Adjust the test to support 8 lanes Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 581/583] i2c: s3c24xx: fix read transfers in polling mode Greg Kroah-Hartman
                   ` (9 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, syzbot+a9400cabb1d784e49abf,
	Nikita Zhandarovich, Taehee Yoo, Eric Dumazet, Hangbin Liu,
	Jakub Kicinski, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nikita Zhandarovich <n.zhandarovich@fintech.ru>

[ Upstream commit 2e7ef287f07c74985f1bf2858bedc62bd9ebf155 ]

idev->mc_ifc_count can be written over without proper locking.

Originally found by syzbot [1], fix this issue by encapsulating calls
to mld_ifc_stop_work() (and mld_gq_stop_work() for good measure) with
mutex_lock() and mutex_unlock() accordingly as these functions
should only be called with mc_lock per their declarations.

[1]
BUG: KCSAN: data-race in ipv6_mc_down / mld_ifc_work

write to 0xffff88813a80c832 of 1 bytes by task 3771 on cpu 0:
 mld_ifc_stop_work net/ipv6/mcast.c:1080 [inline]
 ipv6_mc_down+0x10a/0x280 net/ipv6/mcast.c:2725
 addrconf_ifdown+0xe32/0xf10 net/ipv6/addrconf.c:3949
 addrconf_notify+0x310/0x980
 notifier_call_chain kernel/notifier.c:93 [inline]
 raw_notifier_call_chain+0x6b/0x1c0 kernel/notifier.c:461
 __dev_notify_flags+0x205/0x3d0
 dev_change_flags+0xab/0xd0 net/core/dev.c:8685
 do_setlink+0x9f6/0x2430 net/core/rtnetlink.c:2916
 rtnl_group_changelink net/core/rtnetlink.c:3458 [inline]
 __rtnl_newlink net/core/rtnetlink.c:3717 [inline]
 rtnl_newlink+0xbb3/0x1670 net/core/rtnetlink.c:3754
 rtnetlink_rcv_msg+0x807/0x8c0 net/core/rtnetlink.c:6558
 netlink_rcv_skb+0x126/0x220 net/netlink/af_netlink.c:2545
 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:6576
 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline]
 netlink_unicast+0x589/0x650 net/netlink/af_netlink.c:1368
 netlink_sendmsg+0x66e/0x770 net/netlink/af_netlink.c:1910
 ...

write to 0xffff88813a80c832 of 1 bytes by task 22 on cpu 1:
 mld_ifc_work+0x54c/0x7b0 net/ipv6/mcast.c:2653
 process_one_work kernel/workqueue.c:2627 [inline]
 process_scheduled_works+0x5b8/0xa30 kernel/workqueue.c:2700
 worker_thread+0x525/0x730 kernel/workqueue.c:2781
 ...

Fixes: 2d9a93b4902b ("mld: convert from timer to delayed work")
Reported-by: syzbot+a9400cabb1d784e49abf@syzkaller.appspotmail.com
Link: https://lore.kernel.org/all/000000000000994e09060ebcdffb@google.com/
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Acked-by: Taehee Yoo <ap420073@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
Link: https://lore.kernel.org/r/20240117172102.12001-1-n.zhandarovich@fintech.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/ipv6/mcast.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 5ce25bcb9974..f948cf7bfc44 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -2723,8 +2723,12 @@ void ipv6_mc_down(struct inet6_dev *idev)
 	synchronize_net();
 	mld_query_stop_work(idev);
 	mld_report_stop_work(idev);
+
+	mutex_lock(&idev->mc_lock);
 	mld_ifc_stop_work(idev);
 	mld_gq_stop_work(idev);
+	mutex_unlock(&idev->mc_lock);
+
 	mld_dad_stop_work(idev);
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 581/583] i2c: s3c24xx: fix read transfers in polling mode
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (579 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 580/583] ipv6: mcast: fix data-race in ipv6_mc_down / mld_ifc_work Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 582/583] i2c: s3c24xx: fix transferring more than one message " Greg Kroah-Hartman
                   ` (8 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Marek Szyprowski, Chanho Park,
	Andi Shyti, Wolfram Sang, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Marek Szyprowski <m.szyprowski@samsung.com>

[ Upstream commit 0d9cf23ed55d7ba3ab26d617a3ae507863674c8f ]

To properly handle read transfers in polling mode, no waiting for the ACK
state is needed as it will never come. Just wait a bit to ensure start
state is on the bus and continue processing next bytes.

Fixes: 117053f77a5a ("i2c: s3c2410: Add polling mode support")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Chanho Park <chanho61.park@samsung.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/i2c/busses/i2c-s3c2410.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 127eb3805fac..fdd7a4259d2c 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -216,8 +216,17 @@ static bool is_ack(struct s3c24xx_i2c *i2c)
 	int tries;
 
 	for (tries = 50; tries; --tries) {
-		if (readl(i2c->regs + S3C2410_IICCON)
-			& S3C2410_IICCON_IRQPEND) {
+		unsigned long tmp = readl(i2c->regs + S3C2410_IICCON);
+
+		if (!(tmp & S3C2410_IICCON_ACKEN)) {
+			/*
+			 * Wait a bit for the bus to stabilize,
+			 * delay estimated experimentally.
+			 */
+			usleep_range(100, 200);
+			return true;
+		}
+		if (tmp & S3C2410_IICCON_IRQPEND) {
 			if (!(readl(i2c->regs + S3C2410_IICSTAT)
 				& S3C2410_IICSTAT_LASTBIT))
 				return true;
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 582/583] i2c: s3c24xx: fix transferring more than one message in polling mode
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (580 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 581/583] i2c: s3c24xx: fix read transfers in polling mode Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  0:00 ` [PATCH 6.6 583/583] riscv: Fix wrong usage of lm_alias() when splitting a huge linear mapping Greg Kroah-Hartman
                   ` (7 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, Marek Szyprowski, Andi Shyti,
	Wolfram Sang, Sasha Levin

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Marek Szyprowski <m.szyprowski@samsung.com>

[ Upstream commit 990489e1042c6c5d6bccf56deca68f8dbeed8180 ]

To properly handle ACK on the bus when transferring more than one
message in polling mode, move the polling handling loop from
s3c24xx_i2c_message_start() to s3c24xx_i2c_doxfer(). This way
i2c_s3c_irq_nextbyte() is always executed till the end, properly
acknowledging the IRQ bits and no recursive calls to
i2c_s3c_irq_nextbyte() are made.

While touching this, also fix finishing transfers in polling mode by
using common code path and always waiting for the bus to become idle
and disabled.

Fixes: 117053f77a5a ("i2c: s3c2410: Add polling mode support")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/i2c/busses/i2c-s3c2410.c | 27 ++++++++++-----------------
 1 file changed, 10 insertions(+), 17 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index fdd7a4259d2c..c324cb3c97e2 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -279,16 +279,6 @@ static void s3c24xx_i2c_message_start(struct s3c24xx_i2c *i2c,
 
 	stat |= S3C2410_IICSTAT_START;
 	writel(stat, i2c->regs + S3C2410_IICSTAT);
-
-	if (i2c->quirks & QUIRK_POLL) {
-		while ((i2c->msg_num != 0) && is_ack(i2c)) {
-			i2c_s3c_irq_nextbyte(i2c, stat);
-			stat = readl(i2c->regs + S3C2410_IICSTAT);
-
-			if (stat & S3C2410_IICSTAT_ARBITR)
-				dev_err(i2c->dev, "deal with arbitration loss\n");
-		}
-	}
 }
 
 static inline void s3c24xx_i2c_stop(struct s3c24xx_i2c *i2c, int ret)
@@ -695,7 +685,7 @@ static void s3c24xx_i2c_wait_idle(struct s3c24xx_i2c *i2c)
 static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c,
 			      struct i2c_msg *msgs, int num)
 {
-	unsigned long timeout;
+	unsigned long timeout = 0;
 	int ret;
 
 	ret = s3c24xx_i2c_set_master(i2c);
@@ -715,16 +705,19 @@ static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c,
 	s3c24xx_i2c_message_start(i2c, msgs);
 
 	if (i2c->quirks & QUIRK_POLL) {
-		ret = i2c->msg_idx;
+		while ((i2c->msg_num != 0) && is_ack(i2c)) {
+			unsigned long stat = readl(i2c->regs + S3C2410_IICSTAT);
 
-		if (ret != num)
-			dev_dbg(i2c->dev, "incomplete xfer (%d)\n", ret);
+			i2c_s3c_irq_nextbyte(i2c, stat);
 
-		goto out;
+			stat = readl(i2c->regs + S3C2410_IICSTAT);
+			if (stat & S3C2410_IICSTAT_ARBITR)
+				dev_err(i2c->dev, "deal with arbitration loss\n");
+		}
+	} else {
+		timeout = wait_event_timeout(i2c->wait, i2c->msg_num == 0, HZ * 5);
 	}
 
-	timeout = wait_event_timeout(i2c->wait, i2c->msg_num == 0, HZ * 5);
-
 	ret = i2c->msg_idx;
 
 	/*
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 599+ messages in thread

* [PATCH 6.6 583/583] riscv: Fix wrong usage of lm_alias() when splitting a huge linear mapping
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (581 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 582/583] i2c: s3c24xx: fix transferring more than one message " Greg Kroah-Hartman
@ 2024-01-23  0:00 ` Greg Kroah-Hartman
  2024-01-23  1:50 ` [PATCH 6.6 000/583] 6.6.14-rc1 review SeongJae Park
                   ` (6 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23  0:00 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, patches, syzbot+afb726d49f84c8d95ee1,
	Alexandre Ghiti, Charlie Jenkins, Palmer Dabbelt

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alexandre Ghiti <alexghiti@rivosinc.com>

commit c29fc621e1a49949a14c7fa031dd4760087bfb29 upstream.

lm_alias() can only be used on kernel mappings since it explicitly uses
__pa_symbol(), so simply fix this by checking where the address belongs
to before.

Fixes: 311cd2f6e253 ("riscv: Fix set_memory_XX() and set_direct_map_XX() by splitting huge linear mappings")
Reported-by: syzbot+afb726d49f84c8d95ee1@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/linux-riscv/000000000000620dd0060c02c5e1@google.com/
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20231212195400.128457-1-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/riscv/mm/pageattr.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- a/arch/riscv/mm/pageattr.c
+++ b/arch/riscv/mm/pageattr.c
@@ -305,8 +305,13 @@ static int __set_memory(unsigned long ad
 				goto unlock;
 		}
 	} else if (is_kernel_mapping(start) || is_linear_mapping(start)) {
-		lm_start = (unsigned long)lm_alias(start);
-		lm_end = (unsigned long)lm_alias(end);
+		if (is_kernel_mapping(start)) {
+			lm_start = (unsigned long)lm_alias(start);
+			lm_end = (unsigned long)lm_alias(end);
+		} else {
+			lm_start = start;
+			lm_end = end;
+		}
 
 		ret = split_linear_mapping(lm_start, lm_end);
 		if (ret)



^ permalink raw reply	[flat|nested] 599+ messages in thread

* Re: [PATCH 6.6 000/583] 6.6.14-rc1 review
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (582 preceding siblings ...)
  2024-01-23  0:00 ` [PATCH 6.6 583/583] riscv: Fix wrong usage of lm_alias() when splitting a huge linear mapping Greg Kroah-Hartman
@ 2024-01-23  1:50 ` SeongJae Park
  2024-01-23  8:40 ` Luna Jernberg
                   ` (5 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: SeongJae Park @ 2024-01-23  1:50 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
	patches, lkft-triage, pavel, jonathanh, f.fainelli,
	sudipm.mukherjee, srw, rwarsow, conor, allen.lkml, damon,
	SeongJae Park

Hello,

On Mon, 22 Jan 2024 15:50:51 -0800 Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> This is the start of the stable review cycle for the 6.6.14 release.
> There are 583 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
> 
> Responses should be made by Wed, 24 Jan 2024 23:56:49 +0000.
> Anything received after that time might be too late.
> 
> The whole patch series can be found in one patch at:
> 	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.14-rc1.gz
> or in the git tree and branch at:
> 	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.6.y
> and the diffstat can be found below.

This rc kernel passes DAMON functionality test[1] on my test machine.
Attaching the test results summary below.  Please note that I retrieved the
kernel from linux-stable-rc tree[2].

Tested-by: SeongJae Park <sj@kernel.org>

[1] https://github.com/awslabs/damon-tests/tree/next/corr
[2] 8f8e522b6a7a ("Linux 6.6.14-rc1")

Thanks,
SJ

[...]

---

ok 1 selftests: damon: debugfs_attrs.sh
ok 2 selftests: damon: debugfs_schemes.sh
ok 3 selftests: damon: debugfs_target_ids.sh
ok 4 selftests: damon: debugfs_empty_targets.sh
ok 5 selftests: damon: debugfs_huge_count_read_write.sh
ok 6 selftests: damon: debugfs_duplicate_context_creation.sh
ok 7 selftests: damon: debugfs_rm_non_contexts.sh
ok 8 selftests: damon: sysfs.sh
ok 9 selftests: damon: sysfs_update_removed_scheme_dir.sh
ok 10 selftests: damon: reclaim.sh
ok 11 selftests: damon: lru_sort.sh
ok 1 selftests: damon-tests: kunit.sh
ok 2 selftests: damon-tests: huge_count_read_write.sh
ok 3 selftests: damon-tests: buffer_overflow.sh
ok 4 selftests: damon-tests: rm_contexts.sh
ok 5 selftests: damon-tests: record_null_deref.sh
ok 6 selftests: damon-tests: dbgfs_target_ids_read_before_terminate_race.sh
ok 7 selftests: damon-tests: dbgfs_target_ids_pid_leak.sh
ok 8 selftests: damon-tests: damo_tests.sh
ok 9 selftests: damon-tests: masim-record.sh
ok 10 selftests: damon-tests: build_i386.sh
ok 11 selftests: damon-tests: build_arm64.sh
ok 12 selftests: damon-tests: build_m68k.sh
ok 13 selftests: damon-tests: build_i386_idle_flag.sh
ok 14 selftests: damon-tests: build_i386_highpte.sh
ok 15 selftests: damon-tests: build_nomemcg.sh
 [33m
 [92mPASS [39m

^ permalink raw reply	[flat|nested] 599+ messages in thread

* Re: [PATCH 6.6 000/583] 6.6.14-rc1 review
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (583 preceding siblings ...)
  2024-01-23  1:50 ` [PATCH 6.6 000/583] 6.6.14-rc1 review SeongJae Park
@ 2024-01-23  8:40 ` Luna Jernberg
  2024-01-23  8:42   ` Luna Jernberg
  2024-01-23 11:46 ` Takeshi Ogasawara
                   ` (4 subsequent siblings)
  589 siblings, 1 reply; 599+ messages in thread
From: Luna Jernberg @ 2024-01-23  8:40 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
	patches, lkft-triage, pavel, jonathanh, f.fainelli,
	sudipm.mukherjee, srw, rwarsow, conor, allen.lkml

Works fine on my Skylake system model name    : Intel(R) Core(TM)
i5-6400 CPU @ 2.70GHz with Arch Linux


Tested-by: Luna Jernberg <droidbittin@gmail.com>

Den tis 23 jan. 2024 kl 03:17 skrev Greg Kroah-Hartman
<gregkh@linuxfoundation.org>:
>
> This is the start of the stable review cycle for the 6.6.14 release.
> There are 583 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Wed, 24 Jan 2024 23:56:49 +0000.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
>         https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.14-rc1.gz
> or in the git tree and branch at:
>         git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.6.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
>
> -------------
> Pseudo-Shortlog of commits:
>
> Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>     Linux 6.6.14-rc1
>
> Alexandre Ghiti <alexghiti@rivosinc.com>
>     riscv: Fix wrong usage of lm_alias() when splitting a huge linear mapping
>
> Marek Szyprowski <m.szyprowski@samsung.com>
>     i2c: s3c24xx: fix transferring more than one message in polling mode
>
> Marek Szyprowski <m.szyprowski@samsung.com>
>     i2c: s3c24xx: fix read transfers in polling mode
>
> Nikita Zhandarovich <n.zhandarovich@fintech.ru>
>     ipv6: mcast: fix data-race in ipv6_mc_down / mld_ifc_work
>
> Amit Cohen <amcohen@nvidia.com>
>     selftests: mlxsw: qos_pfc: Adjust the test to support 8 lanes
>
> Petr Machata <petrm@nvidia.com>
>     mlxsw: spectrum_router: Register netdevice notifier before nexthop
>
> Ido Schimmel <idosch@nvidia.com>
>     mlxsw: spectrum_acl_tcam: Fix stack corruption
>
> Ido Schimmel <idosch@nvidia.com>
>     mlxsw: spectrum_acl_tcam: Fix NULL pointer dereference in error path
>
> Amit Cohen <amcohen@nvidia.com>
>     mlxsw: spectrum_acl_erp: Fix error flow of pool allocation failure
>
> Christoph Hellwig <hch@lst.de>
>     loop: fix the the direct I/O support check when used on top of block devices
>
> Ludvig Pärsson <ludvig.parsson@axis.com>
>     ethtool: netlink: Add missing ethnl_ops_begin/complete
>
> Mark Brown <broonie@kernel.org>
>     arm64/ptrace: Don't flush ZA/ZT storage when writing ZA via ptrace
>
> Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>     kdb: Fix a potential buffer overflow in kdb_local()
>
> Pavel Begunkov <asml.silence@gmail.com>
>     io_uring: adjust defer tw counting
>
> Fedor Pchelkin <pchelkin@ispras.ru>
>     ipvs: avoid stat macros calls from preemptible context
>
> Pablo Neira Ayuso <pablo@netfilter.org>
>     netfilter: nf_tables: reject NFT_SET_CONCAT with not field length description
>
> Pablo Neira Ayuso <pablo@netfilter.org>
>     netfilter: nf_tables: skip dead set elements in netlink dump
>
> Pablo Neira Ayuso <pablo@netfilter.org>
>     netfilter: nf_tables: do not allow mismatch field size and set key length
>
> Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
>     netfilter: bridge: replace physindev with physinif in nf_bridge_info
>
> Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
>     netfilter: propagate net to nf_bridge_get_physindev
>
> Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
>     netfilter: nf_queue: remove excess nf_bridge variable
>
> Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
>     netfilter: nfnetlink_log: use proper helper for fetching physinif
>
> Pablo Neira Ayuso <pablo@netfilter.org>
>     netfilter: nft_limit: do not ignore unsupported flags
>
> Pablo Neira Ayuso <pablo@netfilter.org>
>     netfilter: nf_tables: reject invalid set policy
>
> Jakub Kicinski <kuba@kernel.org>
>     net: netdevsim: don't try to destroy PHC on VFs
>
> Paolo Abeni <pabeni@redhat.com>
>     mptcp: relax check on MPC passive fallback
>
> Hengqi Chen <hengqi.chen@gmail.com>
>     LoongArch: BPF: Prevent out-of-bounds memory access
>
> Kunwu Chan <chentao@kylinos.cn>
>     net: dsa: vsc73xx: Add null pointer check to vsc73xx_gpio_probe
>
> Hao Sun <sunhao.th@gmail.com>
>     bpf: Reject variable offset alu on PTR_TO_FLOW_KEYS
>
> Qiang Ma <maqianga@uniontech.com>
>     net: stmmac: ethtool: Fixed calltrace caused by unbalanced disable_irq_wake calls
>
> Benjamin Poirier <bpoirier@nvidia.com>
>     selftests: bonding: Change script interpreter
>
> Alex Deucher <alexander.deucher@amd.com>
>     drm/amdgpu: fall back to INPUT power for AVG power via INFO IOCTL
>
> Dafna Hirschfeld <dhirschfeld@habana.ai>
>     drm/amdkfd: fixes for HMM mem allocation
>
> Kai Vehmanen <kai.vehmanen@linux.intel.com>
>     ASoC: SOF: ipc4-loader: remove the CPC check warnings
>
> Su Hui <suhui@nfschina.com>
>     gpio: mlxbf3: add an error code check in mlxbf3_gpio_probe
>
> Michal Simek <michal.simek@amd.com>
>     dt-bindings: gpio: xilinx: Fix node address in gpio
>
> Nikita Yushchenko <nikita.yoush@cogentembedded.com>
>     net: ravb: Fix dma_addr_t truncation in error case
>
> John Fastabend <john.fastabend@gmail.com>
>     net: tls, fix WARNIING in __sk_msg_free
>
> Martin KaFai Lau <martin.lau@kernel.org>
>     bpf: Avoid iter->offset making backward progress in bpf_iter_udp
>
> Martin KaFai Lau <martin.lau@kernel.org>
>     bpf: iter_udp: Retry with a larger batch size without going back to the previous bucket
>
> Marc Kleine-Budde <mkl@pengutronix.de>
>     net: netdev_queue: netdev_txq_completed_mb(): fix wake condition
>
> Eric Dumazet <edumazet@google.com>
>     net: add more sanity check in virtio_net_hdr_to_skb()
>
> Gao Xiang <xiang@kernel.org>
>     erofs: fix inconsistent per-file compression format
>
> Gao Xiang <xiang@kernel.org>
>     erofs: simplify compression configuration parser
>
> Eric Dumazet <edumazet@google.com>
>     udp: annotate data-races around up->pending
>
> Sneh Shah <quic_snehshah@quicinc.com>
>     net: stmmac: Fix ethool link settings ops for integrated PCS
>
> Jens Axboe <axboe@kernel.dk>
>     block: ensure we hold a queue reference when using queue limits
>
> Eric Dumazet <edumazet@google.com>
>     mptcp: refine opt_mp_capable determination
>
> Eric Dumazet <edumazet@google.com>
>     mptcp: use OPTION_MPTCP_MPJ_SYN in subflow_check_req()
>
> Eric Dumazet <edumazet@google.com>
>     mptcp: use OPTION_MPTCP_MPJ_SYNACK in subflow_finish_connect()
>
> Eric Dumazet <edumazet@google.com>
>     mptcp: strict validation before using mp_opt->hmac
>
> Eric Dumazet <edumazet@google.com>
>     mptcp: mptcp_parse_option() fix for MPTCPOPT_MP_JOIN
>
> Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
>     ALSA: hda: Properly setup HDMI stream
>
> Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>     net: phy: micrel: populate .soft_reset for KSZ9131
>
> Horatiu Vultur <horatiu.vultur@microchip.com>
>     net: micrel: Fix PTP frame parsing for lan8841
>
> Taehee Yoo <ap420073@gmail.com>
>     amt: do not use overwrapped cb area
>
> Sanjuán García, Jorge <Jorge.SanjuanGarcia@duagon.com>
>     net: ethernet: ti: am65-cpsw: Fix max mtu to fit ethernet frames
>
> Nithin Dabilpuram <ndabilpuram@marvell.com>
>     octeontx2-af: CN10KB: Fix FIFO length calculation for RPM2
>
> David Howells <dhowells@redhat.com>
>     rxrpc: Fix use of Don't Fragment flag
>
> Lin Ma <linma@zju.edu.cn>
>     net: qualcomm: rmnet: fix global oob in rmnet_policy
>
> Niklas Schnelle <schnelle@linux.ibm.com>
>     s390/pci: fix max size calculation in zpci_memcpy_toio()
>
> AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>     ASoC: mediatek: sof-common: Add NULL check for normal_link string
>
> Jianjun Wang <jianjun.wang@mediatek.com>
>     PCI: mediatek-gen3: Fix translation window size calculation
>
> Siddharth Vadapalli <s-vadapalli@ti.com>
>     PCI: keystone: Fix race condition when initializing PHYs
>
> Maurizio Lombardi <mlombard@redhat.com>
>     nvmet-tcp: Fix the H2C expected PDU len calculation
>
> Arnd Bergmann <arnd@arndb.de>
>     nvme: trace: avoid memcpy overflow warning
>
> Arnd Bergmann <arnd@arndb.de>
>     nvmet: re-fix tracing strncpy() warning
>
> Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
>     hisi_acc_vfio_pci: Update migration data pointer correctly on saving/resume
>
> Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>     spi: coldfire-qspi: Remove an erroneous clk_disable_unprepare() from the remove function
>
> Dan Williams <dan.j.williams@intel.com>
>     cxl/port: Fix missing target list lock
>
> Ben Gainey <ben.gainey@arm.com>
>     perf db-export: Fix missing reference count get in call_path_from_sample()
>
> Sam Ravnborg <sam@ravnborg.org>
>     serial: apbuart: fix console prompt on qemu
>
> Christoph Niedermaier <cniedermaier@dh-electronics.com>
>     serial: imx: Correct clock error message in function probe()
>
> Chunfeng Yun <chunfeng.yun@mediatek.com>
>     usb: xhci-mtk: fix a short packet issue of gen1 isoc-in transfer
>
> Fedor Pchelkin <pchelkin@ispras.ru>
>     apparmor: avoid crash when parsed profile name is empty
>
> Fedor Pchelkin <pchelkin@ispras.ru>
>     apparmor: fix possible memory leak in unpack_trans_table
>
> Jim Harris <jim.harris@samsung.com>
>     cxl/region: fix x9 interleave typo
>
> Ian Rogers <irogers@google.com>
>     perf stat: Fix hard coded LL miss units
>
> Ian Rogers <irogers@google.com>
>     perf env: Avoid recursively taking env->bpf_progs.lock
>
> Maurizio Lombardi <mlombard@redhat.com>
>     nvmet-tcp: fix a crash in nvmet_req_complete()
>
> Maurizio Lombardi <mlombard@redhat.com>
>     nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length
>
> John Johansen <john.johansen@canonical.com>
>     apparmor: Fix ref count leak in task_kill
>
> Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>     vdpa: Fix an error handling path in eni_vdpa_probe()
>
> Kunwu Chan <chentao@kylinos.cn>
>     power: supply: Fix null pointer dereference in smb2_probe
>
> Ashish Mhetre <amhetre@nvidia.com>
>     iommu: Don't reserve 0-length IOVA region
>
> Andrzej Pietrasiewicz <andrzej.p@collabora.com>
>     usb: gadget: webcam: Make g_webcam loadable again
>
> Nícolas F. R. A. Prado <nfraprado@collabora.com>
>     spmi: mtk-pmif: Serialize PMIF status check and command submission
>
> Douglas Anderson <dianders@chromium.org>
>     usb: core: Fix crash w/ usb_choose_configuration() if no driver
>
> Oliver Neukum <oneukum@suse.com>
>     usb: cdc-acm: return correct error code on unsupported break
>
> Jiri Slaby (SUSE) <jirislaby@kernel.org>
>     tty: use 'if' in send_break() instead of 'goto'
>
> Jiri Slaby (SUSE) <jirislaby@kernel.org>
>     tty: don't check for signal_pending() in send_break()
>
> Jiri Slaby (SUSE) <jirislaby@kernel.org>
>     tty: early return from send_break() on TTY_DRIVER_HARDWARE_BREAK
>
> Manivannan Sadhasivam <mani@kernel.org>
>     PCI: epf-mhi: Fix the DMA data direction of dma_unmap_single()
>
> Manivannan Sadhasivam <mani@kernel.org>
>     bus: mhi: ep: Pass mhi_ep_buf_info struct to read/write APIs
>
> Manivannan Sadhasivam <mani@kernel.org>
>     bus: mhi: ep: Use slab allocator where applicable
>
> Manivannan Sadhasivam <mani@kernel.org>
>     bus: mhi: ep: Do not allocate event ring element on stack
>
> Namhyung Kim <namhyung@kernel.org>
>     perf unwind-libunwind: Fix base address for .eh_frame
>
> Namhyung Kim <namhyung@kernel.org>
>     perf unwind-libdw: Handle JIT-generated DSOs properly
>
> Namhyung Kim <namhyung@kernel.org>
>     perf genelf: Set ELF program header addresses properly
>
> Yicong Yang <yangyicong@hisilicon.com>
>     perf hisi-ptt: Fix one memory leakage in hisi_ptt_process_auxtrace_event()
>
> Yicong Yang <yangyicong@hisilicon.com>
>     perf header: Fix one memory leakage in perf_event__fprintf_event_update()
>
> Nuno Sa <nuno.sa@analog.com>
>     iio: adc: ad9467: fix scale setting
>
> Nuno Sa <nuno.sa@analog.com>
>     iio: adc: ad9467: add mutex to struct ad9467_state
>
> Nuno Sa <nuno.sa@analog.com>
>     iio: adc: ad9467: don't ignore error codes
>
> Nuno Sa <nuno.sa@analog.com>
>     iio: adc: ad9467: fix reset gpio handling
>
> Zhao Mengmeng <zhaomengmeng@kylinos.cn>
>     selftests/sgx: Skip non X86_64 platform
>
> Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
>     selftests/sgx: Include memory clobber for inline asm in test enclave
>
> Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
>     selftests/sgx: Fix uninitialized pointer dereferences in encl_get_entry
>
> Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
>     selftests/sgx: Fix uninitialized pointer dereference in error path
>
> Paul Geurts <paul_geurts@live.nl>
>     serial: imx: fix tx statemachine deadlock
>
> Sakari Ailus <sakari.ailus@linux.intel.com>
>     software node: Let args be NULL in software_node_get_reference_args
>
> Sakari Ailus <sakari.ailus@linux.intel.com>
>     acpi: property: Let args be NULL in __acpi_node_get_property_reference
>
> Gregory Price <gourry.memverge@gmail.com>
>     base/node.c: initialize the accessor list before registering
>
> Ian Rogers <irogers@google.com>
>     perf stat: Exit perf stat if parse groups fails
>
> Kan Liang <kan.liang@linux.intel.com>
>     perf mem: Fix error on hybrid related to availability of mem event in a PMU
>
> Ilkka Koskinen <ilkka@os.amperecomputing.com>
>     perf vendor events arm64 AmpereOne: Rename BPU_FLUSH_MEM_FAULT to GPC_FLUSH_MEM_FAULT
>
> Brett Creeley <brett.creeley@amd.com>
>     vfio/pds: Fix calculations in pds_vfio_dirty_sync
>
> Veronika Molnarova <vmolnaro@redhat.com>
>     perf test record user-regs: Fix mask for vg register
>
> Douglas Anderson <dianders@chromium.org>
>     r8152: Choose our USB config with choose_configuration() rather than probe()
>
> Douglas Anderson <dianders@chromium.org>
>     usb: core: Allow subclassed USB drivers to override usb_choose_configuration()
>
> Arnaldo Carvalho de Melo <acme@redhat.com>
>     libapi: Add missing linux/types.h header to get the __u64 type on io.h
>
> Adrian Hunter <adrian.hunter@intel.com>
>     perf header: Fix segfault on build_mem_topology() error path
>
> Nick Forrington <nick.forrington@arm.com>
>     perf test: Remove atomics from test_loop to avoid test failures
>
> Laurentiu Tudor <laurentiu.tudor@nxp.com>
>     iommu: Map reserved memory as cacheable if device is coherent
>
> Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>     serial: 8250: omap: Don't skip resource freeing if pm_runtime_resume_and_get() failed
>
> Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>     PCI: Avoid potential out-of-bounds read in pci_dev_for_each_resource()
>
> Su Hui <suhui@nfschina.com>
>     power: supply: bq256xx: fix some problem in bq256xx_hw_init
>
> Jan Palus <jpalus@fastmail.com>
>     power: supply: cw2015: correct time_to_empty units in sysfs
>
> Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>     MIPS: Alchemy: Fix an out-of-bound access in db1550_dev_setup()
>
> Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>     MIPS: Alchemy: Fix an out-of-bound access in db1200_dev_setup()
>
> Frederik Haxel <haxel@fzi.de>
>     riscv: Fixed wrong register in XIP_FIXUP_FLASH_OFFSET macro
>
> Alexandre Ghiti <alexghiti@rivosinc.com>
>     riscv: Fix set_direct_map_default_noflush() to reset _PAGE_EXEC
>
> Alexandre Ghiti <alexghiti@rivosinc.com>
>     riscv: Fix set_memory_XX() and set_direct_map_XX() by splitting huge linear mappings
>
> Alexandre Ghiti <alexghiti@rivosinc.com>
>     riscv: Fix module_alloc() that did not reset the linear mapping permissions
>
> Alexandre Ghiti <alexghiti@rivosinc.com>
>     riscv: Check if the code to patch lies in the exit section
>
> Vincent Whitchurch <vincent.whitchurch@axis.com>
>     um: virt-pci: fix platform map offset
>
> Serge Semin <fancer.lancer@gmail.com>
>     mips: Fix incorrect max_low_pfn adjustment
>
> Serge Semin <fancer.lancer@gmail.com>
>     mips: dmi: Fix early remap on MIPS32
>
> Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>     srcu: Use try-lock lockdep annotation for NMI-safe access.
>
> Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>     mfd: intel-lpss: Fix the fractional clock divider flags
>
> Kunwu Chan <chentao@kylinos.cn>
>     mfd: tps6594: Add null pointer check to tps6594_device_init()
>
> Martin Kurbanov <mmkurbanov@salutedevices.com>
>     leds: aw200xx: Fix write to DIM parameter
>
> Dang Huynh <danct12@riseup.net>
>     leds: aw2013: Select missing dependency REGMAP_I2C
>
> Kunwu Chan <chentao@kylinos.cn>
>     mfd: syscon: Fix null pointer dereference in of_syscon_register()
>
> Charles Keepax <ckeepax@opensource.cirrus.com>
>     mfd: cs42l43: Correct SoundWire port list
>
> Neil Armstrong <neil.armstrong@linaro.org>
>     mfd: rk8xx: fixup devices registration with PLATFORM_DEVID_AUTO
>
> Randy Dunlap <rdunlap@infradead.org>
>     ARM: 9330/1: davinci: also select PINCTRL
>
> Hugo Villeneuve <hvilleneuve@dimonoff.com>
>     serial: sc16is7xx: set safe default SPI clock frequency
>
> Hugo Villeneuve <hvilleneuve@dimonoff.com>
>     serial: sc16is7xx: add check for unsupported SPI modes during probe
>
> Jason Gerecke <jason.gerecke@wacom.com>
>     HID: wacom: Correct behavior when processing some confidence == false touches
>
> Yauhen Kharuzhy <jekhor@gmail.com>
>     HID: sensor-hub: Enable hid core report processing for all devices
>
> Marcelo Schmitt <marcelo.schmitt@analog.com>
>     iio: adc: ad7091r: Pass iio_dev to event handler
>
> Sean Christopherson <seanjc@google.com>
>     KVM: x86/pmu: Reset the PMU, i.e. stop counters, before refreshing
>
> Sean Christopherson <seanjc@google.com>
>     KVM: x86/pmu: Move PMU reset logic to common x86 code
>
> Oliver Upton <oliver.upton@linux.dev>
>     KVM: arm64: vgic-its: Avoid potential UAF in LPI translation cache
>
> Marc Zyngier <maz@kernel.org>
>     KVM: arm64: vgic-v4: Restore pending state on host userspace write
>
> Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
>     x86/kvm: Do not try to disable kvmclock if it was not enabled
>
> qizhong cheng <qizhong.cheng@mediatek.com>
>     PCI: mediatek: Clear interrupt status before dispatching handler
>
> Niklas Cassel <niklas.cassel@wdc.com>
>     PCI: dwc: endpoint: Fix dw_pcie_ep_raise_msix_irq() alignment support
>
> Bjorn Helgaas <bhelgaas@google.com>
>     x86/pci: Reserve ECAM if BIOS didn't include it in PNP0C02 _CRS
>
> Tadeusz Struk <tstruk@gigaio.com>
>     PCI/P2PDMA: Remove reference to pci_p2pdma_map_sg()
>
> Huang Ying <ying.huang@intel.com>
>     cxl/port: Fix decoder initialization when nr_targets > interleave_ways
>
> Sean Christopherson <seanjc@google.com>
>     Revert "nSVM: Check for reserved encodings of TLB_CONTROL in nested VMCB"
>
> Nicolas Dichtel <nicolas.dichtel@6wind.com>
>     Revert "net: rtnetlink: Enslave device before bringing it up"
>
> Petr Tesarik <petr@tesarici.cz>
>     net: stmmac: fix ethtool per-queue statistics
>
> David Lin <yu-hao.lin@nxp.com>
>     wifi: mwifiex: fix uninitialized firmware_stat
>
> David Lin <yu-hao.lin@nxp.com>
>     wifi: mwifiex: configure BSSID consistently when starting AP
>
> David Lin <yu-hao.lin@nxp.com>
>     wifi: mwifiex: add extra delay for firmware ready
>
> Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
>     wifi: rtlwifi: Convert LNKCTL change to PCIe cap RMW accessors
>
> Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
>     wifi: rtlwifi: Remove bogus and dangerous ASPM disable/enable code
>
> Christian Marangi <ansuelsmth@gmail.com>
>     wifi: mt76: fix broken precal loading from MTD for mt7915
>
> Isaac J. Manjarres <isaacmanjarres@google.com>
>     iommu/dma: Trace bounce buffer usage when mapping buffers
>
> Rob Clark <robdclark@chromium.org>
>     iommu/arm-smmu-qcom: Add missing GMU entry to match table
>
> Jiri Olsa <olsajiri@gmail.com>
>     bpf: Fix re-attachment branch in bpf_tracing_prog_attach
>
> Gui-Dong Han <2045gemini@gmail.com>
>     Bluetooth: Fix atomicity violation in {min,max}_key_size_set
>
> Stefan Berger <stefanb@linux.ibm.com>
>     rootfs: Fix support for rootfstype= when root= is given
>
> Bart Van Assche <bvanassche@acm.org>
>     md/raid1: Use blk_opf_t for read and write operations
>
> Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>     pwm: Fix out-of-bounds access in of_pwm_single_xlate()
>
> Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>     pwm: jz4740: Don't use dev_err_probe() in .request()
>
> Pablo Neira Ayuso <pablo@netfilter.org>
>     netfilter: nf_tables: check if catch-all set element is active in next generation
>
> Matthew Wilcox (Oracle) <willy@infradead.org>
>     block: Fix iterating over an empty bio with bio_for_each_folio_all
>
> Matthew Wilcox (Oracle) <willy@infradead.org>
>     block: Remove special-casing of compound pages
>
> Min Li <min15.li@samsung.com>
>     block: add check that partition length needs to be aligned with block size
>
> Mario Limonciello <mario.limonciello@amd.com>
>     drm/amd: Enable PCIe PME from D3
>
> Junxiao Bi <junxiao.bi@oracle.com>
>     md: bypass block throttle for superblock update
>
> Chandrakanth patil <chandrakanth.patil@broadcom.com>
>     scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable State
>
> Chandrakanth patil <chandrakanth.patil@broadcom.com>
>     scsi: mpi3mr: Clean up block devices post controller reset
>
> Chandrakanth patil <chandrakanth.patil@broadcom.com>
>     scsi: mpi3mr: Refresh sdev queue depth after controller reset
>
> Amir Goldstein <amir73il@gmail.com>
>     scsi: target: core: add missing file_{start,end}_write()
>
> Bart Van Assche <bvanassche@acm.org>
>     scsi: ufs: core: Simplify power management during async scan
>
> Nam Cao <namcao@linutronix.de>
>     fbdev: flush deferred IO before closing
>
> Nam Cao <namcao@linutronix.de>
>     fbdev: flush deferred work in fb_deferred_io_fsync()
>
> Thomas Zimmermann <tzimmermann@suse.de>
>     fbdev/acornfb: Fix name of fb_ops initializer macro
>
> Jens Axboe <axboe@kernel.dk>
>     io_uring: ensure local task_work is run on wait timeout
>
> Jens Axboe <axboe@kernel.dk>
>     io_uring/rw: ensure io->bytes_done is always initialized
>
> Pavel Begunkov <asml.silence@gmail.com>
>     io_uring: don't check iopoll if request completes
>
> Xi Ruoyao <xry111@xry111.site>
>     LoongArch: Fix and simplify fcsr initialization on execve()
>
> Eric Biggers <ebiggers@google.com>
>     ceph: select FS_ENCRYPTION_ALGS if FS_ENCRYPTION
>
> Namjae Jeon <linkinjeon@kernel.org>
>     ksmbd: only v2 leases handle the directory
>
> Namjae Jeon <linkinjeon@kernel.org>
>     ksmbd: fix UAF issue in ksmbd_tcp_new_connection()
>
> Namjae Jeon <linkinjeon@kernel.org>
>     ksmbd: validate mech token in session setup
>
> Bin Li <bin.li@canonical.com>
>     ALSA: hda/realtek: Enable headset mic on Lenovo M70 Gen5
>
> Yo-Jung Lin <leo.lin@canonical.com>
>     ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on HP ZBook
>
> Çağhan Demir <caghandemir@marun.edu.tr>
>     ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq2xxx
>
> Takashi Iwai <tiwai@suse.de>
>     ALSA: oxygen: Fix right channel of capture volume mixer
>
> Lino Sanfilippo <l.sanfilippo@kunbus.com>
>     serial: omap: do not override settings for RS485 support
>
> Lino Sanfilippo <l.sanfilippo@kunbus.com>
>     serial: 8250_exar: Set missing rs485_supported flag
>
> Christoph Niedermaier <cniedermaier@dh-electronics.com>
>     serial: imx: Ensure that imx_uart_rs485_config() is called with enabled clock
>
> Lino Sanfilippo <l.sanfilippo@kunbus.com>
>     serial: core, imx: do not set RS485 enabled if it is not supported
>
> Stefan Wahren <wahrenst@gmx.net>
>     serial: 8250_bcm2835aux: Restore clock error handling
>
> Lino Sanfilippo <l.sanfilippo@kunbus.com>
>     serial: core: make sure RS485 cannot be enabled when it is not supported
>
> Lino Sanfilippo <l.sanfilippo@kunbus.com>
>     serial: core: fix sanitizing check for RTS settings
>
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>     dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp-phy: fix path to header
>
> Gui-Dong Han <2045gemini@gmail.com>
>     usb: mon: Fix atomicity violation in mon_bin_vma_fault
>
> RD Babiera <rdbabiera@google.com>
>     usb: typec: class: fix typec_altmode_put_partner to put plugs
>
> Heikki Krogerus <heikki.krogerus@linux.intel.com>
>     Revert "usb: typec: class: fix typec_altmode_put_partner to put plugs"
>
> Frank Li <Frank.Li@nxp.com>
>     usb: cdns3: Fix uvc fail when DMA cross 4k boundery since sg enabled
>
> Frank Li <Frank.Li@nxp.com>
>     usb: cdns3: fix iso transfer error when mult is not zero
>
> Frank Li <Frank.Li@nxp.com>
>     usb: cdns3: fix uvc failure work since sg support enabled
>
> Xu Yang <xu.yang_2@nxp.com>
>     usb: chipidea: wait controller resume finished for wakeup irq
>
> Thinh Nguyen <Thinh.Nguyen@synopsys.com>
>     Revert "usb: dwc3: don't reset device side if dwc3 was configured as host-only"
>
> Thinh Nguyen <Thinh.Nguyen@synopsys.com>
>     Revert "usb: dwc3: Soft reset phy on probe for host"
>
> Wesley Cheng <quic_wcheng@quicinc.com>
>     usb: dwc3: gadget: Queue PM runtime idle on disconnect event
>
> Wesley Cheng <quic_wcheng@quicinc.com>
>     usb: dwc3: gadget: Handle EP0 request dequeuing properly
>
> Uttkarsh Aggarwal <quic_uaggarwa@quicinc.com>
>     usb: dwc: ep0: Update request status in dwc3_ep0_stall_restart
>
> Xu Yang <xu.yang_2@nxp.com>
>     usb: phy: mxs: remove CONFIG_USB_OTG condition for mxs_phy_is_otg_host()
>
> Frank Li <Frank.Li@nxp.com>
>     Revert "usb: gadget: f_uvc: change endpoint allocation in uvc_function_bind()"
>
> Heiko Carstens <hca@linux.ibm.com>
>     tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug
>
> Michael Ellerman <mpe@ellerman.id.au>
>     powerpc/64s: Increase default stack size to 32KB
>
> Tony Lindgren <tony@atomide.com>
>     clocksource/drivers/timer-ti-dm: Fix make W=n kerneldoc warnings
>
> Carlos Llamas <cmllamas@google.com>
>     binder: fix race between mmput() and do_exit()
>
> Jan Beulich <jbeulich@suse.com>
>     xen-netback: don't produce zero-size SKB frags
>
> Kaibo Ma <ent3rm4n@gmail.com>
>     Revert "drm/amdkfd: Relocate TBA/TMA to opposite side of VM hole"
>
> Matthew Maurer <mmaurer@google.com>
>     rust: Ignore preserve-most functions
>
> Hans de Goede <hdegoede@redhat.com>
>     Input: atkbd - use ab83 as id when skipping the getid command
>
> Stefan Wiehler <stefan.wiehler@nokia.com>
>     mips/smp: Call rcutree_report_cpu_starting() earlier
>
> Carlos Llamas <cmllamas@google.com>
>     binder: fix unused alloc->free_async_space
>
> Carlos Llamas <cmllamas@google.com>
>     binder: fix async space check for 0-sized buffers
>
> David Howells <dhowells@redhat.com>
>     keys, dns: Fix size check of V1 server-list header
>
> Jordan Rome <linux@jordanrome.com>
>     selftests/bpf: Add assert for user stacks in test_task_stack
>
> Tejun Heo <tj@kernel.org>
>     Revert "kernfs: convert kernfs_idr_lock to an irq safe raw spinlock"
>
> Andrea Righi <andrea.righi@canonical.com>
>     kernfs: convert kernfs_idr_lock to an irq safe raw spinlock
>
> Jing Xia <jing.xia@unisoc.com>
>     class: fix use-after-free in class_register()
>
> Geert Uytterhoeven <geert+renesas@glider.be>
>     of: unittest: Fix of_count_phandle_with_args() expected value message
>
> Dario Binacchi <dario.binacchi@amarulasolutions.com>
>     fbdev: imxfb: fix left margin setting
>
> Christian A. Ehrhardt <lk@c--e.de>
>     of: Fix double free in of_parse_phandle_with_args_map
>
> Li Nan <linan122@huawei.com>
>     ksmbd: validate the zero field of packet header
>
> Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
>     kselftest/alsa - conf: Stringify the printed errno in sysfs_get()
>
> Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
>     kselftest/alsa - mixer-test: Fix the print format specifier warning
>
> Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
>     kselftest/alsa - mixer-test: fix the number of parameters to ksft_exit_fail_msg()
>
> Arnd Bergmann <arnd@arndb.de>
>     drm/amd/display: avoid stringop-overflow warnings for dp_decide_lane_settings()
>
> Zhipeng Lu <alexious@zju.edu.cn>
>     drm/amd/pm/smu7: fix a memleak in smu7_hwmgr_backend_init
>
> Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
>     drm/amdkfd: Confirm list is non-empty before utilizing list_first_entry in kfd_topology.c
>
> Sergey Gorenko <sergeygo@nvidia.com>
>     IB/iser: Prevent invalidating wrong MR
>
> Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>     gpio: sysfs: drop the mention of gpiochip_find() from sysfs code
>
> Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>     gpiolib: provide gpio_device_find()
>
> Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>     gpiolib: make gpio_device_get() and gpio_device_put() public
>
> Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
>     drm/amdkfd: Fix type of 'dbg_flags' in 'struct kfd_process'
>
> Peter Robinson <pbrobinson@gmail.com>
>     mmc: sdhci_omap: Fix TI SoC dependencies
>
> Peter Robinson <pbrobinson@gmail.com>
>     mmc: sdhci_am654: Fix TI SoC dependencies
>
> Geoffrey D. Bennett <g@b4.vu>
>     ALSA: scarlett2: Add clamp() in scarlett2_mixer_ctl_put()
>
> Geoffrey D. Bennett <g@b4.vu>
>     ALSA: scarlett2: Add missing error checks to *_ctl_get()
>
> Geoffrey D. Bennett <g@b4.vu>
>     ALSA: scarlett2: Allow passing any output to line_out_remap()
>
> Geoffrey D. Bennett <g@b4.vu>
>     ALSA: scarlett2: Add missing error check to scarlett2_usb_set_config()
>
> Geoffrey D. Bennett <g@b4.vu>
>     ALSA: scarlett2: Add missing error check to scarlett2_config_save()
>
> Hans de Goede <hdegoede@redhat.com>
>     ASoC: rt5645: Drop double EF20 entry from dmi_platform_data[]
>
> Philipp Zabel <p.zabel@pengutronix.de>
>     pwm: stm32: Fix enable count for clk in .probe()
>
> Philipp Zabel <p.zabel@pengutronix.de>
>     pwm: stm32: Use hweight32 in stm32_pwm_detect_channels
>
> Théo Lebrun <theo.lebrun@bootlin.com>
>     clk: fixed-rate: fix clk_hw_register_fixed_rate_with_accuracy_parent_hw
>
> Konrad Dybcio <konrad.dybcio@linaro.org>
>     clk: qcom: dispcc-sm8550: Update disp PLL settings
>
> Konrad Dybcio <konrad.dybcio@linaro.org>
>     clk: qcom: gcc-sm8550: Mark RCGs shared where applicable
>
> Konrad Dybcio <konrad.dybcio@linaro.org>
>     clk: qcom: gcc-sm8550: use collapse-voting for PCIe GDSCs
>
> Konrad Dybcio <konrad.dybcio@linaro.org>
>     clk: qcom: gcc-sm8550: Mark the PCIe GDSCs votable
>
> Konrad Dybcio <konrad.dybcio@linaro.org>
>     clk: qcom: gcc-sm8550: Add the missing RETAIN_FF_ENABLE GDSC flag
>
> Xingyuan Mo <hdthky0@gmail.com>
>     accel/habanalabs: fix information leak in sec_attest_info()
>
> Nícolas F. R. A. Prado <nfraprado@collabora.com>
>     drm/mediatek: dp: Add phy_mtk_dp module as pre-dependency
>
> Gergo Koteles <soyer@irl.hu>
>     ASoC: tas2781: add support for FW version 0x0503
>
> Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>     ASoC: amd: vangogh: Drop conflicting ACPI-based probing
>
> Su Hui <suhui@nfschina.com>
>     clk: si5341: fix an error code problem in si5341_output_clk_set_rate
>
> Marek Vasut <marek.vasut+renesas@mailbox.org>
>     clk: rs9: Fix DIF OEn bit placement on 9FGV0241
>
> Vignesh Raghavendra <vigneshr@ti.com>
>     watchdog: rti_wdt: Drop runtime pm reference count when watchdog is unused
>
> Stefan Wahren <wahrenst@gmx.net>
>     watchdog: bcm2835_wdt: Fix WDIOC_SETTIMEOUT handling
>
> Jerry Hoemann <jerry.hoemann@hpe.com>
>     watchdog/hpwdt: Only claim UNKNOWN NMI if from iLO
>
> Curtis Klein <curtis.klein@hpe.com>
>     watchdog: set cdev owner before adding
>
> Jay Buddhabhatti <jay.buddhabhatti@amd.com>
>     drivers: clk: zynqmp: update divider round rate logic
>
> Jay Buddhabhatti <jay.buddhabhatti@amd.com>
>     drivers: clk: zynqmp: calculate closest mux rate
>
> Yang Yingliang <yangyingliang@huawei.com>
>     clk: sp7021: fix return value check in sp7021_clk_probe()
>
> Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
>     clk: qcom: videocc-sm8150: Add missing PLL config property
>
> Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
>     clk: qcom: videocc-sm8150: Update the videocc resets
>
> Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
>     dt-bindings: clock: Update the videocc resets for sm8150
>
> Zhiguo Niu <zhiguo.niu@unisoc.com>
>     f2fs: fix to check return value of f2fs_recover_xattr_data
>
> Zhipeng Lu <alexious@zju.edu.cn>
>     drm/amd/pm: fix a double-free in amdgpu_parse_extended_power_table
>
> Zhipeng Lu <alexious@zju.edu.cn>
>     gpu/drm/radeon: fix two memleaks in radeon_vm_init
>
> Zhipeng Lu <alexious@zju.edu.cn>
>     drivers/amd/pm: fix a use-after-free in kv_parse_power_table
>
> Zhipeng Lu <alexious@zju.edu.cn>
>     drm/amd/pm: fix a double-free in si_dpm_init
>
> Alex Deucher <alexander.deucher@amd.com>
>     drm/amdgpu/debugfs: fix error code when smc register accessors are NULL
>
> Hsiao Chien Sung <shawn.sung@mediatek.com>
>     drm/mediatek: Fix underrun in VDO1 when switches off the layer
>
> Hsiao Chien Sung <shawn.sung@mediatek.com>
>     drm/mediatek: Remove the redundant driver data for DPI
>
> Hsiao Chien Sung <shawn.sung@mediatek.com>
>     drm/mediatek: Return error if MDP RDMA failed to enable the clock
>
> Jessica Zhang <quic_jesszhan@quicinc.com>
>     drm/msm/dpu: Drop enable and frame_count parameters from dpu_hw_setup_misr()
>
> Jessica Zhang <quic_jesszhan@quicinc.com>
>     drm/msm/dpu: Set input_sel bit for INTF
>
> Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>     clk: renesas: rzg2l: Check reset monitor registers
>
> Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
>     clk: renesas: rzg2l-cpg: Reuse code in rzg2l_cpg_reset()
>
> Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>     media: dvb-frontends: m88ds3103: Fix a memory leak in an error handling path of m88ds3103_probe()
>
> Dan Carpenter <dan.carpenter@linaro.org>
>     media: dvbdev: drop refcount on error path in dvb_device_open()
>
> Chao Yu <chao@kernel.org>
>     f2fs: fix to update iostat correctly in f2fs_filemap_fault()
>
> Chao Yu <chao@kernel.org>
>     f2fs: fix to check compress file in f2fs_move_file_range()
>
> Chao Yu <chao@kernel.org>
>     f2fs: fix to wait on block writeback for post_read case
>
> Chris Morgan <macromorgan@hotmail.com>
>     drm/panel: st7701: Fix AVCL calculation
>
> Bjorn Andersson <quic_bjorande@quicinc.com>
>     drm/msm/adreno: Fix A680 chip id
>
> Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>     media: rkisp1: Fix media device memory leak
>
> Mehdi Djait <mehdi.djait@bootlin.com>
>     media: dt-bindings: media: rkisp1: Fix the port description for the parallel interface
>
> Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>     media: imx-mipi-csis: Drop extra clock enable at probe()
>
> Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>     media: imx-mipi-csis: Fix clock handling in remove()
>
> Hans Verkuil <hverkuil-cisco@xs4all.nl>
>     media: bttv: add back vbi hack
>
> Hans Verkuil <hverkuil-cisco@xs4all.nl>
>     media: bttv: start_streaming should return a proper error code
>
> Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
>     clk: qcom: gpucc-sm8150: Update the gpu_cc_pll1 config
>
> Chengchang Tang <tangchengchang@huawei.com>
>     RDMA/hns: Fix memory leak in free_mr_init()
>
> Zhipeng Lu <alexious@zju.edu.cn>
>     media: cx231xx: fix a memleak in cx231xx_init_isoc
>
> Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>     drm/bridge: tc358767: Fix return value on error case
>
> Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>     drm/bridge: cdns-mhdp8546: Fix use of uninitialized variable
>
> Zhipeng Lu <alexious@zju.edu.cn>
>     drm/radeon/trinity_dpm: fix a memleak in trinity_parse_power_table
>
> Zhipeng Lu <alexious@zju.edu.cn>
>     drm/radeon/dpm: fix a memleak in sumo_parse_power_table
>
> Yang Yingliang <yangyingliang@huawei.com>
>     drm/radeon: check the alloc_workqueue return value in radeon_crtc_init()
>
> Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>     drm/msm/dpu: correct clk bit for WB2 block
>
> AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>     drm/panfrost: Ignore core_mask for poweroff and disable PWRTRANS irq
>
> Bard Liao <yung-chuan.liao@linux.intel.com>
>     ASoC: SOF: topology: Use partial match for disconnecting DAI link and DAI widget
>
> Bard Liao <yung-chuan.liao@linux.intel.com>
>     ASoC: Intel: sof_sdw_rt_sdca_jack_common: ctx->headset_codec_dev = NULL
>
> Brent Lu <brent.lu@intel.com>
>     ASoC: Intel: glk_rt5682_max98357a: fix board id mismatch
>
> Sebastian Reichel <sre@kernel.org>
>     media: v4l: async: Fix duplicated list deletion
>
> Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>     drm/drv: propagate errors from drm_modeset_register_all()
>
> Konrad Dybcio <konrad.dybcio@linaro.org>
>     drm/msm/dsi: Use pm_runtime_resume_and_get to prevent refcnt leaks
>
> Bjorn Andersson <quic_bjorande@quicinc.com>
>     drm/msm/dpu: Add missing safe_lut_tbl in sc8180x catalog
>
> Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>     drm/msm/mdp4: flush vblank event on disable
>
> Linus Walleij <linus.walleij@linaro.org>
>     ASoC: cs35l33: Fix GPIO name and drop legacy include
>
> Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>     drm/imx/lcdc: Fix double-free of driver data
>
> Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>     drm/tidss: Fix dss reset
>
> Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>     drm/tidss: Check for K2G in in dispc_softreset()
>
> Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>     drm/tidss: Return error value from from softreset
>
> Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>     drm/tidss: Move reset to the end of dispc_init()
>
> Nikita Zhandarovich <n.zhandarovich@fintech.ru>
>     drm/radeon: check return value of radeon_ring_lock()
>
> Nikita Zhandarovich <n.zhandarovich@fintech.ru>
>     drm/radeon/r100: Fix integer overflow issues in r100_cs_track_check()
>
> Nikita Zhandarovich <n.zhandarovich@fintech.ru>
>     drm/radeon/r600_cs: Fix possible int overflows in r600_cs_check_reg()
>
> Chao Yu <chao@kernel.org>
>     f2fs: fix to avoid dirent corruption
>
> Dario Binacchi <dario.binacchi@amarulasolutions.com>
>     drm/bridge: Fix typo in post_disable() description
>
> Alexander Stein <alexander.stein@ew.tq-group.com>
>     media: amphion: Fix VPU core alias name
>
> Paul Kocialkowski <paul.kocialkowski@bootlin.com>
>     media: rkvdec: Hook the (TRY_)DECODER_CMD stateless ioctls
>
> Paul Kocialkowski <paul.kocialkowski@bootlin.com>
>     media: verisilicon: Hook the (TRY_)DECODER_CMD stateless ioctls
>
> Paul Kocialkowski <paul.kocialkowski@bootlin.com>
>     media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls
>
> Zheng Wang <zyytlz.wz@163.com>
>     media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the crash of multi-core JPEG devices
>
> Ricardo B. Marliere <ricardo@marliere.net>
>     media: pvrusb2: fix use after free on context disconnection
>
> Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>     drm/tilcdc: Fix irq free on unload
>
> Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>     drm/bridge: tpd12s015: Drop buggy __exit annotation for remove function
>
> Abhinav Singh <singhabhinav9051571833@gmail.com>
>     drm/nouveau/fence:: fix warning directly dereferencing a rcu pointer
>
> Chris Morgan <macromorgan@hotmail.com>
>     drm/panel-elida-kd35t133: hold panel in reset for unprepare
>
> Chris Morgan <macromorgan@hotmail.com>
>     drm/panel: nv3051d: Hold panel in reset for unprepare
>
> Junxian Huang <huangjunxian6@hisilicon.com>
>     RDMA/hns: Fix inappropriate err code for unsupported operations
>
> Leon Romanovsky <leon@kernel.org>
>     RDMA/usnic: Silence uninitialized symbol smatch warnings
>
> AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>     drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off()
>
> Ville Syrjälä <ville.syrjala@linux.intel.com>
>     drm/dp_mst: Fix fractional DSC bpp handling
>
> Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>     Revert "drm/omapdrm: Annotate dma-fence critical section in commit path"
>
> Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>     Revert "drm/tidss: Annotate dma-fence critical section in commit path"
>
> Arnd Bergmann <arnd@arndb.de>
>     ARM: davinci: always select CONFIG_CPU_ARM926T
>
> Eric Dumazet <edumazet@google.com>
>     ip6_tunnel: fix NEXTHDR_FRAGMENT handling in ip6_tnl_parse_tlv_enc_lim()
>
> David Howells <dhowells@redhat.com>
>     rxrpc: Fix skbuff cleanup of call's recvmsg_queue and rx_oos_queue
>
> Asmaa Mnebhi <asmaa@nvidia.com>
>     mlxbf_gige: Enable the GigE port in mlxbf_gige_open
>
> Asmaa Mnebhi <asmaa@nvidia.com>
>     mlxbf_gige: Fix intermittent no ip issue
>
> Tao Liu <taoliu828@163.com>
>     net/sched: act_ct: fix skb leak and crash on ooo frags
>
> Ming Lei <ming.lei@redhat.com>
>     blk-cgroup: fix rcu lockdep warning in blkg_lookup()
>
> Eric Dumazet <edumazet@google.com>
>     sctp: fix busy polling
>
> Eric Dumazet <edumazet@google.com>
>     sctp: support MSG_ERRQUEUE flag in recvmsg()
>
> John Fastabend <john.fastabend@gmail.com>
>     bpf: sockmap, fix proto update hook to avoid dup calls
>
> Benjamin Berg <benjamin.berg@intel.com>
>     wifi: cfg80211: parse all ML elements in an ML probe response
>
> Benjamin Berg <benjamin.berg@intel.com>
>     wifi: cfg80211: correct comment about MLD ID
>
> Andy Yan <andyshrk@163.com>
>     arm64: dts: rockchip: Fix led pinctrl of lubancat 1
>
> Christoph Hellwig <hch@lst.de>
>     null_blk: don't cap max_hw_sectors to BLK_DEF_MAX_SECTORS
>
> Francesco Dolcini <francesco.dolcini@toradex.com>
>     Bluetooth: btmtkuart: fix recv_buf() return value
>
> Francesco Dolcini <francesco.dolcini@toradex.com>
>     Bluetooth: btnxpuart: fix recv_buf() return value
>
> Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>     Bluetooth: Fix bogus check for re-auth no supported with non-ssp
>
> Pablo Neira Ayuso <pablo@netfilter.org>
>     netfilter: nf_tables: validate chain type update if available
>
> Florian Westphal <fw@strlen.de>
>     netfilter: nf_tables: mark newset as dead on transaction abort
>
> Miri Korenblit <miriam.rachel.korenblit@intel.com>
>     wifi: iwlwifi: assign phy_ctxt before eSR activation
>
> Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
>     wifi: iwlwifi: fix out of bound copy_from_user
>
> Johannes Berg <johannes.berg@intel.com>
>     wifi: iwlwifi: mvm: send TX path flush in rfkill
>
> Johannes Berg <johannes.berg@intel.com>
>     wifi: iwlwifi: mvm: set siso/mimo chains to 1 in FW SMPS request
>
> Su Hui <suhui@nfschina.com>
>     wifi: rtlwifi: rtl8192se: using calculate_bit_shift()
>
> Su Hui <suhui@nfschina.com>
>     wifi: rtlwifi: rtl8192ee: using calculate_bit_shift()
>
> Su Hui <suhui@nfschina.com>
>     wifi: rtlwifi: rtl8192de: using calculate_bit_shift()
>
> Su Hui <suhui@nfschina.com>
>     wifi: rtlwifi: rtl8192ce: using calculate_bit_shift()
>
> Su Hui <suhui@nfschina.com>
>     wifi: rtlwifi: rtl8192cu: using calculate_bit_shift()
>
> Su Hui <suhui@nfschina.com>
>     wifi: rtlwifi: rtl8192c: using calculate_bit_shift()
>
> Su Hui <suhui@nfschina.com>
>     wifi: rtlwifi: rtl8188ee: phy: using calculate_bit_shift()
>
> Su Hui <suhui@nfschina.com>
>     wifi: rtlwifi: add calculate_bit_shift()
>
> Hou Tao <houtao1@huawei.com>
>     bpf: Use c->unit_size to select target cache during free
>
> Hou Tao <houtao1@huawei.com>
>     bpf: Use pcpu_alloc_size() in bpf_mem_free{_rcu}()
>
> Hou Tao <houtao1@huawei.com>
>     bpf: Re-enable unit_size checking for global per-cpu allocator
>
> Konrad Dybcio <konrad.dybcio@linaro.org>
>     arm64: dts: qcom: sc8180x: Fix up PCIe nodes
>
> Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>     arm64: dts: qcom: sc8180x: switch PCIe QMP PHY to new style of bindings
>
> Konrad Dybcio <konrad.dybcio@linaro.org>
>     arm64: dts: qcom: sc8180x: Mark PCIe hosts cache-coherent
>
> Konrad Dybcio <konrad.dybcio@linaro.org>
>     arm64: dts: qcom: sm8550: Update idle state time requirements
>
> Konrad Dybcio <konrad.dybcio@linaro.org>
>     arm64: dts: qcom: sm8550: Separate out X3 idle state
>
> Chukun Pan <amadeus@jmu.edu.cn>
>     arm64: dts: qcom: ipq6018: fix clock rates for GCC_USB0_MOCK_UTMI_CLK
>
> Konrad Dybcio <konrad.dybcio@linaro.org>
>     arm64: dts: qcom: sc7280: Mark SDHCI hosts as cache-coherent
>
> Li Nan <linan122@huawei.com>
>     block: add check of 'minors' and 'first_minor' in device_add_disk()
>
> Abel Vesa <abel.vesa@linaro.org>
>     soc: qcom: llcc: Fix LLCC_TRP_ATTR2_CFGn offset
>
> Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>     arm64: dts: qcom: sm8150-hdk: fix SS USB regulators
>
> Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>     arm64: dts: qcom: sm8150: make dispcc cast minimal vote on MMCX
>
> Konrad Dybcio <konrad.dybcio@linaro.org>
>     arm64: dts: qcom: sm6375: Hook up MPM
>
> Johan Hovold <johan+linaro@kernel.org>
>     arm64: dts: qcom: sm6375: fix USB wakeup interrupt types
>
> Atul Dhudase <quic_adhudase@quicinc.com>
>     soc: qcom: llcc: Fix dis_cap_alloc and retain_on_pc configuration
>
> Nikita Travkin <nikita@trvn.ru>
>     arm64: dts: qcom: acer-aspire1: Correct audio codec definition
>
> Hou Tao <houtao1@huawei.com>
>     bpf: Limit the number of kprobes when attaching program to multiple kprobes
>
> Hou Tao <houtao1@huawei.com>
>     bpf: Limit the number of uprobes when attaching program to multiple uprobes
>
> Joakim Zhang <joakim.zhang@cixtech.com>
>     dma-mapping: clear dev->dma_mem to NULL after freeing it
>
> Arseniy Krasnov <avkrasnov@salutedevices.com>
>     virtio/vsock: send credit update during setting SO_RCVLOWAT
>
> Arseniy Krasnov <avkrasnov@salutedevices.com>
>     virtio/vsock: fix logic which reduces credit update messages
>
> Leone Fernando <leone4fernando@gmail.com>
>     ipmr: support IP_PKTINFO on cache report IGMP msg
>
> Hangbin Liu <liuhangbin@gmail.com>
>     selftests/net: fix grep checking for fib_nexthop_multiprefix
>
> Yonghong Song <yonghong.song@linux.dev>
>     bpf: Fix a race condition between btf_put() and map_free()
>
> Ahmad Fatoum <a.fatoum@pengutronix.de>
>     ARM: dts: stm32: don't mix SCMI and non-SCMI board compatibles
>
> Yihang Li <liyihang9@huawei.com>
>     scsi: hisi_sas: Correct the number of global debugfs registers
>
> Yihang Li <liyihang9@huawei.com>
>     scsi: hisi_sas: Rollback some operations if FLR failed
>
> Yihang Li <liyihang9@huawei.com>
>     scsi: hisi_sas: Check before using pointer variables
>
> Yihang Li <liyihang9@huawei.com>
>     scsi: hisi_sas: Replace with standard error code return value
>
> Manivannan Sadhasivam <mani@kernel.org>
>     scsi: ufs: qcom: Fix the return value when platform_get_resource_byname() fails
>
> Manivannan Sadhasivam <mani@kernel.org>
>     scsi: ufs: qcom: Fix the return value of ufs_qcom_ice_program_key()
>
> Adam Ford <aford173@gmail.com>
>     arm64: dts: imx8mm: Reduce GPU to nominal speed
>
> Geert Uytterhoeven <geert+renesas@glider.be>
>     arm64: dts: renesas: white-hawk-cpu: Fix missing serial console pin control
>
> Rob Herring <robh@kernel.org>
>     arm64: dts: xilinx: Apply overlays to base dtbs
>
> Li Nan <linan122@huawei.com>
>     block: Set memalloc_noio to false on device_add_disk() error path
>
> YiFei Zhu <zhuyifei@google.com>
>     selftests/bpf: Relax time_tai test for equal timestamps in tai_forward
>
> Miri Korenblit <miriam.rachel.korenblit@intel.com>
>     wifi: iwlwifi: don't support triggered EHT CQI feedback
>
> Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
>     wifi: mt76: mt7921: fix country count limitation for CLC
>
> Eugen Hristev <eugen.hristev@collabora.com>
>     arm64: dts: mediatek: mt8186: fix address warning for ADSP mailboxes
>
> Chen-Yu Tsai <wenst@chromium.org>
>     arm64: dts: mediatek: mt8186: Fix alias prefix for ovl_2l0
>
> Moudy Ho <moudy.ho@mediatek.com>
>     arm64: dts: mediatek: mt8195: revise VDOSYS RDMA node name
>
> Moudy Ho <moudy.ho@mediatek.com>
>     arm64: dts: mediatek: mt8183: correct MDP3 DMA-related nodes
>
> Moudy Ho <moudy.ho@mediatek.com>
>     dt-bindings: media: mediatek: mdp3: correct RDMA and WROT node with generic names
>
> Andrei Matei <andreimatei1@gmail.com>
>     bpf: Fix accesses to uninit stack slots
>
> Andrei Matei <andreimatei1@gmail.com>
>     bpf: Guard stack limits against 32bit overflow
>
> Johan Hovold <johan+linaro@kernel.org>
>     arm64: dts: hisilicon: hikey970-pmic: fix regulator cells properties
>
> Andrei Matei <andreimatei1@gmail.com>
>     bpf: Fix verification of indirect var-off stack access
>
> Wang Zhao <wang.zhao@mediatek.com>
>     wifi: mt76: mt7921s: fix workqueue problem causes STA association fail
>
> StanleyYP Wang <StanleyYP.Wang@mediatek.com>
>     wifi: mt76: mt7915: also MT7981 is 3T3R but nss2 on 5 GHz band
>
> StanleyYP Wang <StanleyYP.Wang@mediatek.com>
>     wifi: mt76: mt7915: fix EEPROM offset of TSSI flag on MT7981
>
> MeiChia Chiu <meichia.chiu@mediatek.com>
>     wifi: mt76: mt7996: fix rate usage of inband discovery frames
>
> Sujuan Chen <sujuan.chen@mediatek.com>
>     wifi: mt76: mt7996: fix the size of struct bss_rate_tlv
>
> Lorenzo Bianconi <lorenzo@kernel.org>
>     wifi: mt76: mt7915: fallback to non-wed mode if platform_get_resource fails in mt7915_mmio_wed_init()
>
> Christian Marangi <ansuelsmth@gmail.com>
>     wifi: mt76: fix typo in mt76_get_of_eeprom_from_nvmem function
>
> Johan Hovold <johan+linaro@kernel.org>
>     arm64: dts: qcom: sm8550: fix USB wakeup interrupt types
>
> Johan Hovold <johan+linaro@kernel.org>
>     arm64: dts: qcom: sc7280: fix usb_2 wakeup interrupt types
>
> Johan Hovold <johan+linaro@kernel.org>
>     arm64: dts: qcom: sa8775p: fix USB wakeup interrupt types
>
> Konrad Dybcio <konrad.dybcio@linaro.org>
>     arm64: dts: qcom: sc7280: Mark Adreno SMMU as DMA coherent
>
> Konrad Dybcio <konrad.dybcio@linaro.org>
>     arm64: dts: qcom: sc7280: Fix up GPU SIDs
>
> Nia Espera <nespera@igalia.com>
>     arm64: dts: qcom: sm8350: Fix DMA0 address
>
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>     arm64: dts: qcom: sm6125: add interrupts to DWC3 USB controller
>
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>     arm64: dts: qcom: sdm845-db845c: correct LED panic indicator
>
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>     arm64: dts: qcom: qrb5165-rb5: correct LED panic indicator
>
> Caleb Connolly <caleb.connolly@linaro.org>
>     arm64: dts: qcom: qrb2210-rb1: use USB host mode
>
> Konrad Dybcio <konrad.dybcio@linaro.org>
>     arm64: dts: qcom: qrb2210-rb1: Hook up USB3
>
> Artem Chernyshev <artem.chernyshev@red-soft.ru>
>     scsi: fnic: Return error if vmalloc() failed
>
> Andrii Nakryiko <andrii@kernel.org>
>     bpf: fix check for attempt to corrupt spilled pointer
>
> Hangbin Liu <liuhangbin@gmail.com>
>     selftests/net: specify the interface when do arping
>
> Hou Tao <houtao1@huawei.com>
>     bpf: Defer the free of inner map when necessary
>
> Hou Tao <houtao1@huawei.com>
>     bpf: Add map and need_defer parameters to .map_fd_put_ptr()
>
> Douglas Anderson <dianders@chromium.org>
>     arm64: dts: qcom: sm6350: Make watchdog bark interrupt edge triggered
>
> Douglas Anderson <dianders@chromium.org>
>     arm64: dts: qcom: sc8280xp: Make watchdog bark interrupt edge triggered
>
> Douglas Anderson <dianders@chromium.org>
>     arm64: dts: qcom: sa8775p: Make watchdog bark interrupt edge triggered
>
> Douglas Anderson <dianders@chromium.org>
>     arm64: dts: qcom: sm8250: Make watchdog bark interrupt edge triggered
>
> Douglas Anderson <dianders@chromium.org>
>     arm64: dts: qcom: sm8150: Make watchdog bark interrupt edge triggered
>
> Douglas Anderson <dianders@chromium.org>
>     arm64: dts: qcom: sdm845: Make watchdog bark interrupt edge triggered
>
> Douglas Anderson <dianders@chromium.org>
>     arm64: dts: qcom: sc7280: Make watchdog bark interrupt edge triggered
>
> Luca Weiss <luca.weiss@fairphone.com>
>     arm64: dts: qcom: sc7280: Mark some nodes as 'reserved'
>
> Douglas Anderson <dianders@chromium.org>
>     arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered
>
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>     arm64: dts: qcom: sm8550: correct TX Soundwire clock
>
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>     arm64: dts: qcom: sm8450: correct TX Soundwire clock
>
> Bjorn Andersson <quic_bjorande@quicinc.com>
>     arm64: dts: qcom: sc8180x-primus: Fix HALL_INT polarity
>
> Stephen Boyd <swboyd@chromium.org>
>     dt-bindings: arm: qcom: Fix html link
>
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>     ARM: dts: qcom: sdx65: correct SPMI node name
>
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>     ARM: dts: qcom: sdx65: correct PCIe EP phy-names
>
> Andrii Nakryiko <andrii@kernel.org>
>     bpf: enforce precision of R0 on callback return
>
> Yu Kuai <yukuai3@huawei.com>
>     md: synchronize flush io with array reconfiguration
>
> Jeroen van Ingen Schenau <jeroen.vaningenschenau@novoserve.com>
>     selftests/bpf: Fix erroneous bitmask operation
>
> Martin Blumenstingl <martin.blumenstingl@googlemail.com>
>     wifi: rtw88: sdio: Honor the host max_req_size in the RX path
>
> Jan Kiszka <jan.kiszka@siemens.com>
>     arm64: dts: ti: iot2050: Re-add aliases
>
> Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>     arm64: dts: ti: k3-am65-main: Fix DSS irq trigger type
>
> Nitin Yadav <n-yadav@ti.com>
>     arm64: dts: ti: k3-am62a-main: Fix GPIO pin count in DT nodes
>
> Su Hui <suhui@nfschina.com>
>     wifi: rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior
>
> Bart Van Assche <bvanassche@acm.org>
>     scsi: bfa: Use the proper data type for BLIST flags
>
> Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>     firmware: ti_sci: Fix an off-by-one in ti_sci_debugfs_create()
>
> Peter Delevoryas <peter@pjd.dev>
>     net/ncsi: Fix netlink major/minor version numbers
>
> Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>     ARM: dts: qcom: apq8064: correct XOADC register address
>
> Arnd Bergmann <arnd@arndb.de>
>     wifi: libertas: stop selecting wext
>
> Luca Weiss <luca.weiss@fairphone.com>
>     wifi: ath11k: Defer on rproc_get failure
>
> Jordan Rome <jordalgo@meta.com>
>     bpf: Add crosstask check to __bpf_get_stack
>
> Florian Lehner <dev@der-flo.net>
>     bpf, lpm: Fix check prefixlen before walking trie
>
> Chih-Kang Chang <gary.chang@realtek.com>
>     wifi: rtw88: fix RX filter in FIF_ALLMULTI flag
>
> Dan Carpenter <dan.carpenter@linaro.org>
>     wifi: plfxlc: check for allocation failure in plfxlc_usb_wreq_async()
>
> Luca Weiss <luca@z3ntu.xyz>
>     ARM: dts: qcom: msm8226: provide dsi phy clocks to mmcc
>
> Johan Hovold <johan+linaro@kernel.org>
>     arm64: dts: qcom: sc8280xp-x13s: add missing camera LED pin config
>
> Konrad Dybcio <konrad.dybcio@linaro.org>
>     arm64: dts: qcom: sc8280xp-x13s: Use the correct DP PHY compatible
>
> Caleb Connolly <caleb.connolly@linaro.org>
>     arm64: dts: qcom: qrb4210-rb2: don't force usb peripheral mode
>
> David McKay <david.mckay@codasip.com>
>     asm-generic: Fix 32 bit __generic_cmpxchg_local
>
> Trond Myklebust <trond.myklebust@hammerspace.com>
>     pNFS: Fix the pnfs block driver's calculation of layoutget size
>
> Olga Kornievskaia <kolga@netapp.com>
>     SUNRPC: fix _xprt_switch_find_current_entry logic
>
> Trond Myklebust <trond.myklebust@hammerspace.com>
>     NFSv4.1/pnfs: Ensure we handle the error NFS4ERR_RETURNCONFLICT
>
> Scott Mayhew <smayhew@redhat.com>
>     NFS: Use parent's objective cred in nfs_access_login_time()
>
> Benjamin Coddington <bcodding@redhat.com>
>     blocklayoutdriver: Fix reference leak of pnfs_device_node
>
> Arnd Bergmann <arnd@arndb.de>
>     csky: fix arch_jump_label_transform_static override
>
> Chengming Zhou <zhouchengming@bytedance.com>
>     crypto: scomp - fix req->dst buffer overflow
>
> Ovidiu Panait <ovidiu.panait@windriver.com>
>     crypto: sahara - do not resize req->src when doing hash operations
>
> Ovidiu Panait <ovidiu.panait@windriver.com>
>     crypto: sahara - fix processing hash requests with req->nbytes < sg->length
>
> Ovidiu Panait <ovidiu.panait@windriver.com>
>     crypto: sahara - improve error handling in sahara_sha_process()
>
> Ovidiu Panait <ovidiu.panait@windriver.com>
>     crypto: sahara - fix wait_for_completion_timeout() error handling
>
> Ovidiu Panait <ovidiu.panait@windriver.com>
>     crypto: sahara - fix ahash reqsize
>
> Ovidiu Panait <ovidiu.panait@windriver.com>
>     crypto: sahara - handle zero-length aes requests
>
> Ovidiu Panait <ovidiu.panait@windriver.com>
>     crypto: sahara - avoid skcipher fallback code duplication
>
> wangyangxin <wangyangxin1@huawei.com>
>     crypto: virtio - Wait for tasklet to complete on device remove
>
> Alexander Aring <aahringo@redhat.com>
>     dlm: fix format seq ops type 4
>
> Edward Adam Davis <eadavis@qq.com>
>     gfs2: fix kernel BUG in gfs2_quota_cleanup
>
> Osama Muhammad <osmtendev@gmail.com>
>     gfs2: Fix kernel NULL pointer dereference in gfs2_rgrp_dump
>
> Christian Brauner <brauner@kernel.org>
>     fs: indicate request originates from old mount API
>
> Gao Xiang <xiang@kernel.org>
>     erofs: fix memory leak on short-lived bounced pages
>
> Sergey Shtylyov <s.shtylyov@omp.ru>
>     pstore: ram_core: fix possible overflow in persistent_ram_init_ecc()
>
> Zhiqi Song <songzhiqi1@huawei.com>
>     crypto: hisilicon/zip - save capability registers in probe process
>
> Zhiqi Song <songzhiqi1@huawei.com>
>     crypto: hisilicon/sec2 - save capability registers in probe process
>
> Zhiqi Song <songzhiqi1@huawei.com>
>     crypto: hisilicon/hpre - save capability registers in probe process
>
> Wenkai Lin <linwenkai6@hisilicon.com>
>     crypto: hisilicon/qm - add a function to set qm algs
>
> Chenghai Huang <huangchenghai2@huawei.com>
>     crypto: hisilicon/zip - add zip comp high perf mode configuration
>
> Zhiqi Song <songzhiqi1@huawei.com>
>     crypto: hisilicon/qm - save capability registers in qm init process
>
> Ovidiu Panait <ovidiu.panait@windriver.com>
>     crypto: sahara - fix error handling in sahara_hw_descriptor_create()
>
> Ovidiu Panait <ovidiu.panait@windriver.com>
>     crypto: sahara - fix processing requests with cryptlen < sg->length
>
> Ovidiu Panait <ovidiu.panait@windriver.com>
>     crypto: sahara - fix ahash selftest failure
>
> Ovidiu Panait <ovidiu.panait@windriver.com>
>     crypto: sahara - fix cbc selftest failure
>
> Ovidiu Panait <ovidiu.panait@windriver.com>
>     crypto: sahara - remove FLAGS_NEW_KEY logic
>
> Nikita Zhandarovich <n.zhandarovich@fintech.ru>
>     crypto: safexcel - Add error handling for dma_map_sg() calls
>
> Herbert Xu <herbert@gondor.apana.org.au>
>     crypto: af_alg - Disallow multiple in-flight AIO requests
>
> Dinghao Liu <dinghao.liu@zju.edu.cn>
>     crypto: ccp - fix memleak in ccp_init_dm_workarea
>
> Chen Ni <nichen@iscas.ac.cn>
>     crypto: sa2ul - Return crypto_aead_setkey to transfer the error
>
> Gonglei (Arei) <arei.gonglei@huawei.com>
>     crypto: virtio - Handle dataq logic with tasklet
>
> Chanho Park <chanho61.park@samsung.com>
>     crypto: jh7110 - Correct deferred probe return
>
> Dan Carpenter <dan.carpenter@linaro.org>
>     crypto: rsa - add a check for allocation failure
>
> Mickaël Salaün <mic@digikod.net>
>     selinux: Fix error priority for bind with AF_UNSPEC on PF_INET6 socket
>
> Binbin Zhou <zhoubinbin@loongson.cn>
>     drivers/thermal/loongson2_thermal: Fix incorrect PTR_ERR() judgment
>
> Borislav Petkov (AMD) <bp@alien8.de>
>     cpuidle: haltpoll: Do not enable interrupts when entering idle
>
> ZhaoLong Wang <wangzhaolong1@huawei.com>
>     mtd: Fix gluebi NULL pointer dereference caused by ftl notifier
>
> Richard Fitzgerald <rf@opensource.cirrus.com>
>     kunit: debugfs: Fix unchecked dereference in debugfs_print_results()
>
> Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>     thermal: core: Fix NULL pointer dereference in zone registration error path
>
> Tony Luck <tony.luck@intel.com>
>     ACPI: extlog: Clear Extended Error Log status when RAS_CEC handled the error
>
> Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>     ACPI: LPSS: Fix the fractional clock divider flags
>
> Wolfram Sang <wsa+renesas@sang-engineering.com>
>     spi: sh-msiof: Enforce fixed DTDL for R-Car H3
>
> Ard Biesheuvel <ardb@kernel.org>
>     efivarfs: Free s_fs_info on unmount
>
> Ilias Apalodimas <ilias.apalodimas@linaro.org>
>     efivarfs: force RO when remounting if SetVariable is not supported
>
> Gavrilov Ilia <Ilia.Gavrilov@infotecs.ru>
>     calipso: fix memory leak in netlbl_calipso_add_pass()
>
> Alexandra Diupina <adiupina@astralinux.ru>
>     cpufreq: scmi: process the result of devm_of_clk_add_hw_provider()
>
> David E. Box <david.e.box@linux.intel.com>
>     platform/x86/intel/vsec: Fix xa_alloc memory leak
>
> Yang Yingliang <yangyingliang@huawei.com>
>     spi: cadence-quadspi: add missing clk_disable_unprepare() in cqspi_probe()
>
> Chen Ni <nichen@iscas.ac.cn>
>     KEYS: encrypted: Add check for strsep
>
> Nikita Kiryushin <kiryushin@ancud.ru>
>     ACPI: LPIT: Avoid u32 multiplication overflow
>
> Nikita Kiryushin <kiryushin@ancud.ru>
>     ACPI: video: check for error while searching for backlight device parent
>
> Ronald Monthero <debug.penguin32@gmail.com>
>     mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response
>
> Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
>     spi: spi-zynqmp-gqspi: fix driver kconfig dependencies
>
> Alexander Antonov <alexander.antonov@linux.intel.com>
>     perf/x86/intel/uncore: Fix NULL pointer dereference issue in upi_fill_topology()
>
> Yiwei Lin <s921975628@gmail.com>
>     sched/fair: Update min_vruntime for reweight_entity() correctly
>
> Kunwu Chan <chentao@kylinos.cn>
>     powerpc/imc-pmu: Add a null pointer check in update_events_in_group()
>
> Kunwu Chan <chentao@kylinos.cn>
>     powerpc/powernv: Add a null pointer check in opal_powercap_init()
>
> Kunwu Chan <chentao@kylinos.cn>
>     powerpc/powernv: Add a null pointer check in opal_event_init()
>
> Kunwu Chan <chentao@kylinos.cn>
>     powerpc/powernv: Add a null pointer check to scom_debug_init_one()
>
> Nathan Lynch <nathanl@linux.ibm.com>
>     powerpc/rtas: Avoid warning on invalid token argument to sys_rtas()
>
> Kajol Jain <kjain@linux.ibm.com>
>     powerpc/hv-gpci: Add return value check in affinity_domain_via_partition_show function
>
> Michael Ellerman <mpe@ellerman.id.au>
>     selftests/powerpc: Fix error handling in FPU/VMX preemption tests
>
> Nicholas Piggin <npiggin@gmail.com>
>     KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE
>
> Jordan Niethe <jniethe5@gmail.com>
>     KVM: PPC: Book3S HV: Introduce low level MSR accessor
>
> Jordan Niethe <jniethe5@gmail.com>
>     KVM: PPC: Book3S HV: Use accessors for VCPU registers
>
> Junhao He <hejunhao3@huawei.com>
>     drivers/perf: hisi: Fix some event id for HiSilicon UC pmu
>
> Robin Murphy <robin.murphy@arm.com>
>     perf/arm-cmn: Fix HN-F class_occup_id events
>
> Nathan Lynch <nathanl@linux.ibm.com>
>     powerpc/pseries/memhp: Fix access beyond end of drmem array
>
> Randy Dunlap <rdunlap@infradead.org>
>     powerpc/44x: select I2C for CURRITUCK
>
> Peter Zijlstra <peterz@infradead.org>
>     x86: Fix CPUIDLE_FLAG_IRQ_ENABLE leaking timer reprogram
>
> Masahiro Yamada <masahiroy@kernel.org>
>     powerpc: add crtsavres.o to always-y instead of extra-y
>
> Arnd Bergmann <arnd@arndb.de>
>     EDAC/thunderx: Fix possible out-of-bounds string access
>
> Yazen Ghannam <yazen.ghannam@amd.com>
>     x86/mce/inject: Clear test status value
>
> Colin Ian King <colin.i.king@gmail.com>
>     x86/lib: Fix overflow when counting digits
>
>
> -------------
>
> Diffstat:
>
>  Documentation/devicetree/bindings/arm/qcom.yaml    |   2 +-
>  .../devicetree/bindings/gpio/xlnx,gpio-xilinx.yaml |   2 +-
>  .../bindings/media/mediatek,mdp3-rdma.yaml         |  29 +-
>  .../bindings/media/mediatek,mdp3-wrot.yaml         |  23 +-
>  .../devicetree/bindings/media/rockchip-isp1.yaml   |  11 +-
>  .../phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml         |   4 +-
>  Documentation/driver-api/pci/p2pdma.rst            |  16 +-
>  Makefile                                           |   4 +-
>  arch/arm/boot/dts/qcom/qcom-apq8064.dtsi           |   2 +-
>  arch/arm/boot/dts/qcom/qcom-msm8226.dtsi           |   4 +-
>  arch/arm/boot/dts/qcom/qcom-sdx65.dtsi             |   4 +-
>  arch/arm/boot/dts/st/stm32mp157a-dk1-scmi.dts      |   2 +-
>  arch/arm/boot/dts/st/stm32mp157c-dk2-scmi.dts      |   2 +-
>  arch/arm/boot/dts/st/stm32mp157c-ed1-scmi.dts      |   2 +-
>  arch/arm/boot/dts/st/stm32mp157c-ev1-scmi.dts      |   3 +-
>  arch/arm/mach-davinci/Kconfig                      |   2 +
>  arch/arm64/boot/dts/freescale/imx8mm.dtsi          |   4 +-
>  arch/arm64/boot/dts/hisilicon/hikey970-pmic.dtsi   |   3 -
>  arch/arm64/boot/dts/mediatek/mt8183.dtsi           |   6 +-
>  arch/arm64/boot/dts/mediatek/mt8186.dtsi           |   6 +-
>  arch/arm64/boot/dts/mediatek/mt8195.dtsi           |  24 +-
>  arch/arm64/boot/dts/qcom/ipq6018.dtsi              |   2 +-
>  arch/arm64/boot/dts/qcom/qrb2210-rb1.dts           |  10 +
>  arch/arm64/boot/dts/qcom/qrb4210-rb2.dts           |   1 -
>  arch/arm64/boot/dts/qcom/qrb5165-rb5.dts           |   2 +-
>  arch/arm64/boot/dts/qcom/sa8775p.dtsi              |  14 +-
>  arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts   |  17 +-
>  arch/arm64/boot/dts/qcom/sc7180.dtsi               |   2 +-
>  arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi |  24 ++
>  arch/arm64/boot/dts/qcom/sc7280.dtsi               |  20 +-
>  arch/arm64/boot/dts/qcom/sc8180x-primus.dts        |   2 +-
>  arch/arm64/boot/dts/qcom/sc8180x.dtsi              | 152 ++++------
>  .../dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts     |  11 +
>  arch/arm64/boot/dts/qcom/sc8280xp.dtsi             |   2 +-
>  arch/arm64/boot/dts/qcom/sdm845-db845c.dts         |   2 +-
>  arch/arm64/boot/dts/qcom/sdm845.dtsi               |   2 +-
>  arch/arm64/boot/dts/qcom/sm6125.dtsi               |   4 +
>  arch/arm64/boot/dts/qcom/sm6350.dtsi               |   2 +-
>  arch/arm64/boot/dts/qcom/sm6375.dtsi               |  41 ++-
>  arch/arm64/boot/dts/qcom/sm8150-hdk.dts            |  12 +-
>  arch/arm64/boot/dts/qcom/sm8150.dtsi               |   3 +-
>  arch/arm64/boot/dts/qcom/sm8250.dtsi               |   2 +-
>  arch/arm64/boot/dts/qcom/sm8350.dtsi               |   4 +-
>  arch/arm64/boot/dts/qcom/sm8450.dtsi               |   2 +-
>  arch/arm64/boot/dts/qcom/sm8550.dtsi               |  38 ++-
>  .../boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi  |   3 +
>  arch/arm64/boot/dts/rockchip/rk3566-lubancat-1.dts |   2 +-
>  arch/arm64/boot/dts/ti/k3-am62a-main.dtsi          |   4 +-
>  arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi |  10 +
>  arch/arm64/boot/dts/ti/k3-am65-main.dtsi           |   2 +-
>  arch/arm64/boot/dts/xilinx/Makefile                |   9 +-
>  arch/arm64/kernel/ptrace.c                         |  13 +-
>  arch/arm64/kvm/vgic/vgic-its.c                     |   5 +
>  arch/arm64/kvm/vgic/vgic-mmio-v3.c                 |  27 +-
>  arch/csky/include/asm/jump_label.h                 |   5 +
>  arch/loongarch/include/asm/elf.h                   |   5 -
>  arch/loongarch/kernel/elf.c                        |   5 -
>  arch/loongarch/kernel/process.c                    |   1 +
>  arch/loongarch/net/bpf_jit.c                       |   5 +-
>  arch/mips/alchemy/devboards/db1200.c               |   2 +-
>  arch/mips/alchemy/devboards/db1550.c               |   2 +-
>  arch/mips/include/asm/dmi.h                        |   2 +-
>  arch/mips/kernel/setup.c                           |   4 +-
>  arch/mips/kernel/smp.c                             |   4 +-
>  arch/powerpc/Kconfig                               |   1 +
>  arch/powerpc/kernel/rtas.c                         |  19 +-
>  arch/powerpc/kvm/book3s_64_mmu_hv.c                |   5 +-
>  arch/powerpc/kvm/book3s_64_mmu_radix.c             |   5 +-
>  arch/powerpc/kvm/book3s_hv.c                       | 198 ++++++------
>  arch/powerpc/kvm/book3s_hv.h                       |  68 +++++
>  arch/powerpc/kvm/book3s_hv_builtin.c               |   5 +-
>  arch/powerpc/lib/Makefile                          |   2 +-
>  arch/powerpc/perf/hv-gpci.c                        |   3 +
>  arch/powerpc/perf/imc-pmu.c                        |   6 +
>  arch/powerpc/platforms/44x/Kconfig                 |   1 +
>  arch/powerpc/platforms/powernv/opal-irqchip.c      |   2 +
>  arch/powerpc/platforms/powernv/opal-powercap.c     |   6 +
>  arch/powerpc/platforms/powernv/opal-xscom.c        |   5 +
>  arch/powerpc/platforms/pseries/hotplug-memory.c    |   9 +-
>  arch/riscv/include/asm/sections.h                  |   1 +
>  arch/riscv/include/asm/xip_fixup.h                 |   2 +-
>  arch/riscv/kernel/module.c                         |   3 +-
>  arch/riscv/kernel/patch.c                          |  11 +-
>  arch/riscv/kernel/vmlinux-xip.lds.S                |   2 +
>  arch/riscv/kernel/vmlinux.lds.S                    |   2 +
>  arch/riscv/mm/pageattr.c                           | 275 ++++++++++++++---
>  arch/s390/include/asm/pci_io.h                     |  32 +-
>  arch/s390/pci/pci_mmio.c                           |  12 +-
>  arch/um/drivers/virt-pci.c                         |   2 +-
>  arch/x86/events/intel/uncore_snbep.c               |  10 +-
>  arch/x86/include/asm/kvm-x86-pmu-ops.h             |   2 +-
>  arch/x86/include/asm/mwait.h                       |  11 +-
>  arch/x86/kernel/cpu/mce/inject.c                   |   1 +
>  arch/x86/kernel/kvmclock.c                         |  12 +-
>  arch/x86/kvm/pmu.c                                 |  63 +++-
>  arch/x86/kvm/pmu.h                                 |  18 --
>  arch/x86/kvm/svm/nested.c                          |  15 -
>  arch/x86/kvm/svm/pmu.c                             |  16 -
>  arch/x86/kvm/vmx/pmu_intel.c                       |  20 --
>  arch/x86/lib/misc.c                                |   2 +-
>  arch/x86/pci/mmconfig-shared.c                     |  13 +-
>  block/bio.c                                        |  46 +--
>  block/blk-cgroup.h                                 |   3 +-
>  block/blk-mq.c                                     |  16 +-
>  block/genhd.c                                      |   5 +-
>  block/ioctl.c                                      |  11 +-
>  crypto/af_alg.c                                    |  14 +-
>  crypto/rsa.c                                       |   2 +
>  crypto/scompress.c                                 |   6 +
>  drivers/accel/habanalabs/common/habanalabs_ioctl.c |   2 +-
>  drivers/acpi/acpi_extlog.c                         |   7 +-
>  drivers/acpi/acpi_lpit.c                           |   2 +-
>  drivers/acpi/acpi_lpss.c                           |   3 +-
>  drivers/acpi/acpi_video.c                          |  12 +-
>  drivers/acpi/property.c                            |   4 +
>  drivers/android/binder_alloc.c                     |  22 +-
>  drivers/base/class.c                               |   1 +
>  drivers/base/node.c                                |   9 +-
>  drivers/base/swnode.c                              |   3 +
>  drivers/block/loop.c                               |  52 ++--
>  drivers/block/null_blk/main.c                      |  12 +-
>  drivers/bluetooth/btmtkuart.c                      |  11 +-
>  drivers/bluetooth/btnxpuart.c                      |   7 +-
>  drivers/bus/mhi/ep/main.c                          | 139 ++++++---
>  drivers/bus/mhi/ep/ring.c                          |  41 +--
>  drivers/clk/clk-renesas-pcie.c                     |   2 +-
>  drivers/clk/clk-si5341.c                           |   4 +-
>  drivers/clk/clk-sp7021.c                           |  12 +-
>  drivers/clk/qcom/dispcc-sm8550.c                   |   8 +
>  drivers/clk/qcom/gcc-sm8550.c                      | 110 +++----
>  drivers/clk/qcom/gpucc-sm8150.c                    |   4 +-
>  drivers/clk/qcom/videocc-sm8150.c                  |   5 +
>  drivers/clk/renesas/rzg2l-cpg.c                    |  91 +++---
>  drivers/clk/zynqmp/clk-mux-zynqmp.c                |   2 +-
>  drivers/clk/zynqmp/divider.c                       |  66 +---
>  drivers/clocksource/timer-ti-dm.c                  |   4 +-
>  drivers/cpufreq/scmi-cpufreq.c                     |   7 +-
>  drivers/cpuidle/cpuidle-haltpoll.c                 |   9 +-
>  drivers/crypto/ccp/ccp-ops.c                       |   5 +-
>  drivers/crypto/hisilicon/hpre/hpre_main.c          | 122 ++++----
>  drivers/crypto/hisilicon/qm.c                      |  98 +++++-
>  drivers/crypto/hisilicon/sec2/sec.h                |   7 +
>  drivers/crypto/hisilicon/sec2/sec_crypto.c         |  13 +-
>  drivers/crypto/hisilicon/sec2/sec_main.c           |  70 +++--
>  drivers/crypto/hisilicon/zip/zip_main.c            | 175 ++++++++---
>  drivers/crypto/inside-secure/safexcel_cipher.c     |  19 +-
>  drivers/crypto/sa2ul.c                             |   3 +-
>  drivers/crypto/sahara.c                            | 248 +++++++--------
>  drivers/crypto/starfive/jh7110-cryp.c              |  10 +-
>  drivers/crypto/virtio/virtio_crypto_common.h       |   2 +
>  drivers/crypto/virtio/virtio_crypto_core.c         |  26 +-
>  drivers/cxl/core/port.c                            |  24 +-
>  drivers/cxl/core/region.c                          |   2 +-
>  drivers/cxl/cxl.h                                  |   2 -
>  drivers/edac/thunderx_edac.c                       |  10 +-
>  drivers/firmware/ti_sci.c                          |  10 +-
>  drivers/gpio/gpio-mlxbf3.c                         |   2 +
>  drivers/gpio/gpiolib-sysfs.c                       |   2 +-
>  drivers/gpio/gpiolib.c                             |  95 ++++--
>  drivers/gpio/gpiolib.h                             |  10 -
>  drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c        |   4 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c            |   2 +
>  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c            |   7 +-
>  drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c       |  26 +-
>  drivers/gpu/drm/amd/amdkfd/kfd_migrate.c           |   6 +-
>  drivers/gpu/drm/amd/amdkfd/kfd_priv.h              |   2 +-
>  drivers/gpu/drm/amd/amdkfd/kfd_topology.c          |  21 +-
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |   2 +-
>  .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c    |   2 +-
>  .../display/dc/link/protocols/link_dp_training.c   |   2 +-
>  .../display/dc/link/protocols/link_dp_training.h   |   2 +-
>  drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c         |   4 +-
>  drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c     |  52 +---
>  drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c         |   5 +-
>  .../gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c    |   6 +-
>  .../gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c    |   3 +-
>  drivers/gpu/drm/bridge/tc358767.c                  |   2 +-
>  drivers/gpu/drm/bridge/ti-tpd12s015.c              |   4 +-
>  drivers/gpu/drm/display/drm_dp_mst_topology.c      |  20 +-
>  drivers/gpu/drm/drm_drv.c                          |  10 +-
>  drivers/gpu/drm/i915/display/intel_dp_mst.c        |   5 +-
>  drivers/gpu/drm/imx/lcdc/imx-lcdc.c                |   9 -
>  drivers/gpu/drm/mediatek/mtk_disp_merge.c          |   2 +-
>  drivers/gpu/drm/mediatek/mtk_dp.c                  |   1 +
>  drivers/gpu/drm/mediatek/mtk_dpi.c                 |  16 +-
>  drivers/gpu/drm/mediatek/mtk_mdp_rdma.c            |   3 +-
>  drivers/gpu/drm/msm/adreno/adreno_device.c         |   2 +-
>  .../drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h    |   1 +
>  .../gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h |   2 +-
>  .../gpu/drm/msm/disp/dpu1/catalog/dpu_6_2_sc7180.h |   2 +-
>  .../gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h |   2 +-
>  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c           |   4 +-
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c        |   4 +-
>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c        |   6 +-
>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h        |   4 +-
>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c          |   6 +-
>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h          |   3 +-
>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c        |  20 +-
>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h        |   8 +-
>  drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c          |   9 +
>  drivers/gpu/drm/msm/dsi/phy/dsi_phy.c              |   4 +-
>  drivers/gpu/drm/nouveau/dispnv50/disp.c            |   3 +-
>  drivers/gpu/drm/nouveau/nv04_fence.c               |   2 +-
>  drivers/gpu/drm/omapdrm/omap_drv.c                 |   9 +-
>  drivers/gpu/drm/panel/panel-elida-kd35t133.c       |   2 +
>  drivers/gpu/drm/panel/panel-newvision-nv3051d.c    |   2 +
>  drivers/gpu/drm/panel/panel-sitronix-st7701.c      |   2 +-
>  drivers/gpu/drm/panfrost/panfrost_gpu.c            |  70 +++--
>  drivers/gpu/drm/radeon/r100.c                      |   4 +-
>  drivers/gpu/drm/radeon/r600_cs.c                   |   4 +-
>  drivers/gpu/drm/radeon/radeon_display.c            |   7 +-
>  drivers/gpu/drm/radeon/radeon_vm.c                 |   8 +-
>  drivers/gpu/drm/radeon/si.c                        |   4 +
>  drivers/gpu/drm/radeon/sumo_dpm.c                  |   4 +-
>  drivers/gpu/drm/radeon/trinity_dpm.c               |   4 +-
>  drivers/gpu/drm/tests/drm_dp_mst_helper_test.c     |   6 +-
>  drivers/gpu/drm/tidss/tidss_dispc.c                |  63 +++-
>  drivers/gpu/drm/tidss/tidss_kms.c                  |   4 -
>  drivers/gpu/drm/tilcdc/tilcdc_drv.c                |   2 +-
>  drivers/hid/hid-sensor-hub.c                       |   2 +-
>  drivers/hid/wacom_wac.c                            |  32 +-
>  drivers/i2c/busses/i2c-s3c2410.c                   |  40 +--
>  drivers/idle/intel_idle.c                          |  19 +-
>  drivers/iio/adc/ad7091r-base.c                     |   6 +-
>  drivers/iio/adc/ad9467.c                           | 112 +++++--
>  drivers/iio/adc/adi-axi-adc.c                      |  74 +----
>  drivers/infiniband/hw/hns/hns_roce_hw_v2.c         |   6 +-
>  drivers/infiniband/hw/hns/hns_roce_pd.c            |   2 +-
>  drivers/infiniband/hw/mthca/mthca_cmd.c            |   4 +-
>  drivers/infiniband/hw/mthca/mthca_main.c           |   2 +-
>  drivers/infiniband/ulp/iser/iscsi_iser.h           |   2 -
>  drivers/infiniband/ulp/iser/iser_initiator.c       |   5 +-
>  drivers/infiniband/ulp/iser/iser_memory.c          |   8 +-
>  drivers/infiniband/ulp/iser/iser_verbs.c           |   1 -
>  drivers/input/keyboard/atkbd.c                     |  12 +-
>  drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c         |   1 +
>  drivers/iommu/dma-iommu.c                          |   3 +
>  drivers/iommu/of_iommu.c                           |   7 +
>  drivers/leds/Kconfig                               |   1 +
>  drivers/leds/leds-aw200xx.c                        |   7 +-
>  drivers/md/md.c                                    |  29 +-
>  drivers/md/raid1.c                                 |  12 +-
>  drivers/media/dvb-core/dvbdev.c                    |   2 +
>  drivers/media/dvb-frontends/m88ds3103.c            |   7 +-
>  drivers/media/pci/bt8xx/bttv-driver.c              |  27 +-
>  drivers/media/pci/bt8xx/bttv-vbi.c                 |   8 +-
>  drivers/media/platform/amphion/vpu_core.c          |   2 +-
>  .../media/platform/mediatek/jpeg/mtk_jpeg_core.c   |   1 -
>  drivers/media/platform/nxp/imx-mipi-csis.c         |  17 +-
>  .../media/platform/rockchip/rkisp1/rkisp1-dev.c    |   6 +-
>  drivers/media/platform/verisilicon/hantro_drv.c    |   2 +
>  drivers/media/platform/verisilicon/hantro_v4l2.c   |   3 +
>  drivers/media/test-drivers/visl/visl-video.c       |   3 +
>  drivers/media/usb/cx231xx/cx231xx-core.c           |   2 +
>  drivers/media/usb/pvrusb2/pvrusb2-context.c        |   3 +-
>  drivers/media/v4l2-core/v4l2-async.c               |   1 -
>  drivers/mfd/cs42l43-sdw.c                          |  74 ++---
>  drivers/mfd/intel-lpss.c                           |   2 +-
>  drivers/mfd/rk8xx-core.c                           |  34 +--
>  drivers/mfd/syscon.c                               |   4 +
>  drivers/mfd/tps6594-core.c                         |   3 +
>  drivers/mmc/host/Kconfig                           |  10 +-
>  drivers/mtd/mtd_blkdevs.c                          |   4 +-
>  drivers/mtd/nand/raw/fsl_ifc_nand.c                |   2 +-
>  drivers/net/amt.c                                  |   6 +-
>  drivers/net/dsa/vitesse-vsc73xx-core.c             |   2 +
>  drivers/net/ethernet/marvell/octeontx2/af/rpm.c    |   7 +-
>  .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c |  26 +-
>  .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c   |   6 +-
>  .../net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c |   8 +-
>  .../ethernet/mellanox/mlxsw/spectrum_acl_tcam.c    |   6 +-
>  .../net/ethernet/mellanox/mlxsw/spectrum_router.c  |  24 +-
>  drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c |   2 +-
>  drivers/net/ethernet/renesas/ravb_main.c           |   2 +-
>  drivers/net/ethernet/stmicro/stmmac/stmmac.h       |   1 +
>  .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c   |  29 +-
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |   1 +
>  drivers/net/ethernet/ti/am65-cpsw-nuss.c           |   5 +-
>  drivers/net/netdevsim/netdev.c                     |   9 +-
>  drivers/net/phy/micrel.c                           |   9 +
>  drivers/net/usb/r8152.c                            |  16 +-
>  drivers/net/wireless/ath/ath11k/ahb.c              |   4 +-
>  drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c |   3 +-
>  drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c   |   2 +-
>  .../net/wireless/intel/iwlwifi/mvm/mld-mac80211.c  |   6 +-
>  drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c  |  11 -
>  drivers/net/wireless/intel/iwlwifi/mvm/tx.c        |   2 +-
>  drivers/net/wireless/marvell/libertas/Kconfig      |   2 -
>  drivers/net/wireless/marvell/mwifiex/cfg80211.c    |   2 +
>  drivers/net/wireless/marvell/mwifiex/fw.h          |   1 +
>  drivers/net/wireless/marvell/mwifiex/ioctl.h       |   1 +
>  drivers/net/wireless/marvell/mwifiex/sdio.c        |  21 +-
>  drivers/net/wireless/marvell/mwifiex/sdio.h        |   2 +
>  drivers/net/wireless/marvell/mwifiex/uap_cmd.c     |   8 +
>  drivers/net/wireless/mediatek/mt76/eeprom.c        |   6 +-
>  drivers/net/wireless/mediatek/mt76/mt76.h          |   3 +-
>  drivers/net/wireless/mediatek/mt76/mt7615/sdio.c   |   2 +-
>  drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h |   3 +-
>  drivers/net/wireless/mediatek/mt76/mt7915/main.c   |   5 +-
>  drivers/net/wireless/mediatek/mt76/mt7915/mmio.c   |   2 +-
>  drivers/net/wireless/mediatek/mt76/mt7921/mcu.c    |  11 +-
>  drivers/net/wireless/mediatek/mt76/mt7921/sdio.c   |   4 +-
>  .../net/wireless/mediatek/mt76/mt7921/sdio_mac.c   |   3 +-
>  drivers/net/wireless/mediatek/mt76/mt7996/mac.c    |   4 +-
>  drivers/net/wireless/mediatek/mt76/mt7996/mcu.h    |   2 +-
>  drivers/net/wireless/mediatek/mt76/sdio.c          |  18 +-
>  drivers/net/wireless/purelifi/plfxlc/usb.c         |   5 +-
>  drivers/net/wireless/realtek/rtlwifi/pci.c         |  79 +----
>  drivers/net/wireless/realtek/rtlwifi/pci.h         |   5 -
>  .../net/wireless/realtek/rtlwifi/rtl8188ee/phy.c   |  14 +-
>  .../wireless/realtek/rtlwifi/rtl8192c/phy_common.c |  12 +-
>  .../wireless/realtek/rtlwifi/rtl8192c/phy_common.h |   1 -
>  .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.c   |   6 +-
>  .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.h   |   1 -
>  .../net/wireless/realtek/rtlwifi/rtl8192cu/phy.c   |   6 +-
>  .../net/wireless/realtek/rtlwifi/rtl8192de/phy.c   |  15 +-
>  .../net/wireless/realtek/rtlwifi/rtl8192ee/phy.c   |  16 +-
>  .../net/wireless/realtek/rtlwifi/rtl8192se/phy.c   |  15 +-
>  .../net/wireless/realtek/rtlwifi/rtl8821ae/phy.c   |   5 +-
>  drivers/net/wireless/realtek/rtlwifi/wifi.h        |   7 +
>  drivers/net/wireless/realtek/rtw88/mac80211.c      |   4 +-
>  drivers/net/wireless/realtek/rtw88/sdio.c          |  35 ++-
>  drivers/net/xen-netback/netback.c                  |  44 ++-
>  drivers/nvme/target/tcp.c                          |  20 +-
>  drivers/nvme/target/trace.h                        |   5 +-
>  drivers/of/base.c                                  |   1 +
>  drivers/of/unittest-data/tests-phandle.dtsi        |  10 +-
>  drivers/of/unittest.c                              |  74 +++--
>  drivers/pci/controller/dwc/pci-keystone.c          |   9 +
>  drivers/pci/controller/dwc/pcie-designware-ep.c    |   1 +
>  drivers/pci/controller/pcie-mediatek-gen3.c        |  85 +++---
>  drivers/pci/controller/pcie-mediatek.c             |  10 +-
>  drivers/pci/endpoint/functions/pci-epf-mhi.c       |  66 ++--
>  drivers/perf/arm-cmn.c                             |   2 +-
>  drivers/perf/hisilicon/hisi_uncore_uc_pmu.c        |   4 +-
>  drivers/platform/x86/intel/vsec.c                  |  25 +-
>  drivers/platform/x86/intel/vsec.h                  |   1 +
>  drivers/power/supply/bq256xx_charger.c             |   5 +-
>  drivers/power/supply/cw2015_battery.c              |   2 +-
>  drivers/power/supply/qcom_pmi8998_charger.c        |   4 +
>  drivers/pwm/core.c                                 |   2 +-
>  drivers/pwm/pwm-jz4740.c                           |   7 +-
>  drivers/pwm/pwm-stm32.c                            |  31 +-
>  drivers/scsi/bfa/bfad_bsg.c                        |   2 +-
>  drivers/scsi/fnic/fnic_debugfs.c                   |   3 +-
>  drivers/scsi/hisi_sas/hisi_sas_main.c              |  11 +-
>  drivers/scsi/hisi_sas/hisi_sas_v3_hw.c             |   9 +-
>  drivers/scsi/mpi3mr/mpi3mr_app.c                   |  16 +
>  drivers/scsi/mpi3mr/mpi3mr_os.c                    |  19 +-
>  drivers/soc/qcom/llcc-qcom.c                       |  10 +-
>  drivers/spi/Kconfig                                |   3 +-
>  drivers/spi/spi-cadence-quadspi.c                  |   4 +-
>  drivers/spi/spi-coldfire-qspi.c                    |   1 -
>  drivers/spi/spi-sh-msiof.c                         |  17 ++
>  drivers/spmi/spmi-mtk-pmif.c                       |  20 +-
>  drivers/staging/media/rkvdec/rkvdec.c              |   3 +
>  drivers/target/target_core_file.c                  |  10 +-
>  drivers/thermal/loongson2_thermal.c                |   2 +-
>  drivers/thermal/thermal_core.c                     |   1 -
>  drivers/tty/serial/8250/8250_bcm2835aux.c          |   2 +
>  drivers/tty/serial/8250/8250_exar.c                |   5 +-
>  drivers/tty/serial/8250/8250_omap.c                |   2 +-
>  drivers/tty/serial/apbuart.c                       |   2 +-
>  drivers/tty/serial/imx.c                           |  36 +--
>  drivers/tty/serial/omap-serial.c                   |  27 +-
>  drivers/tty/serial/sc16is7xx.c                     |   8 +-
>  drivers/tty/serial/serial_core.c                   |  33 +-
>  drivers/tty/tty_io.c                               |  31 +-
>  drivers/ufs/core/ufshcd.c                          |   7 +-
>  drivers/ufs/host/ufs-qcom.c                        |   4 +-
>  drivers/usb/cdns3/cdns3-gadget.c                   | 142 ++++++---
>  drivers/usb/cdns3/cdns3-gadget.h                   |   3 +
>  drivers/usb/chipidea/core.c                        |   7 +
>  drivers/usb/class/cdc-acm.c                        |   3 +
>  drivers/usb/core/generic.c                         |  16 +
>  drivers/usb/dwc3/core.c                            |  39 +--
>  drivers/usb/dwc3/ep0.c                             |   5 +-
>  drivers/usb/dwc3/gadget.c                          |  19 +-
>  drivers/usb/gadget/function/f_uvc.c                |  63 ++--
>  drivers/usb/gadget/function/u_uvc.h                |   6 +
>  drivers/usb/gadget/legacy/webcam.c                 | 333 ++++++++++++++++-----
>  drivers/usb/host/xhci-mtk.c                        |  40 ++-
>  drivers/usb/host/xhci-mtk.h                        |   2 +
>  drivers/usb/mon/mon_bin.c                          |   7 +-
>  drivers/usb/phy/phy-mxs-usb.c                      |   3 +-
>  drivers/usb/typec/class.c                          |   4 +-
>  drivers/vdpa/alibaba/eni_vdpa.c                    |   6 +-
>  drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c     |   7 +-
>  drivers/vfio/pci/pds/dirty.c                       |   6 +-
>  drivers/vhost/vsock.c                              |   1 +
>  drivers/video/fbdev/acornfb.c                      |   2 +-
>  drivers/video/fbdev/core/fb_defio.c                |   8 +-
>  drivers/video/fbdev/imxfb.c                        |  27 +-
>  drivers/watchdog/bcm2835_wdt.c                     |   3 +-
>  drivers/watchdog/hpwdt.c                           |   2 +-
>  drivers/watchdog/rti_wdt.c                         |  13 +-
>  drivers/watchdog/watchdog_dev.c                    |   3 +-
>  fs/ceph/Kconfig                                    |   1 +
>  fs/dlm/debug_fs.c                                  |   2 +-
>  fs/efivarfs/super.c                                |  15 +
>  fs/erofs/compress.h                                |   6 +
>  fs/erofs/decompressor.c                            |  62 +++-
>  fs/erofs/decompressor_deflate.c                    |   5 +-
>  fs/erofs/decompressor_lzma.c                       |   4 +-
>  fs/erofs/internal.h                                |  38 +--
>  fs/erofs/super.c                                   |  72 +----
>  fs/erofs/zdata.c                                   |   5 +-
>  fs/erofs/zmap.c                                    |  23 +-
>  fs/f2fs/data.c                                     |   7 +-
>  fs/f2fs/file.c                                     |   7 +-
>  fs/f2fs/namei.c                                    |   2 +-
>  fs/f2fs/node.c                                     |   6 +-
>  fs/f2fs/xattr.c                                    |  11 +-
>  fs/gfs2/quota.c                                    |   3 +-
>  fs/gfs2/rgrp.c                                     |   2 +-
>  fs/namespace.c                                     |  11 +
>  fs/nfs/blocklayout/blocklayout.c                   |   7 +-
>  fs/nfs/dir.c                                       |   2 +-
>  fs/nfs/direct.c                                    |   5 +-
>  fs/nfs/internal.h                                  |   2 +-
>  fs/nfs/nfs4proc.c                                  |   3 +
>  fs/nfs/pnfs.c                                      |   3 +-
>  fs/pstore/ram_core.c                               |   2 +-
>  fs/smb/server/asn1.c                               |   5 +
>  fs/smb/server/connection.c                         |   6 -
>  fs/smb/server/connection.h                         |   2 +-
>  fs/smb/server/oplock.c                             |   6 +
>  fs/smb/server/smb2pdu.c                            |  22 +-
>  fs/smb/server/smb_common.c                         |   6 +-
>  fs/smb/server/transport_rdma.c                     |  11 +-
>  fs/smb/server/transport_tcp.c                      |  13 +-
>  include/asm-generic/cmpxchg-local.h                |   2 +-
>  include/crypto/if_alg.h                            |   3 +
>  include/drm/display/drm_dp_mst_helper.h            |   2 +-
>  include/drm/drm_bridge.h                           |   2 +-
>  include/dt-bindings/clock/qcom,videocc-sm8150.h    |   4 +
>  include/linux/bio.h                                |   9 +-
>  include/linux/bpf.h                                |  13 +-
>  include/linux/bpf_mem_alloc.h                      |   1 +
>  include/linux/clk-provider.h                       |   4 +-
>  include/linux/gpio/driver.h                        |   6 +
>  include/linux/hisi_acc_qm.h                        |  20 +-
>  include/linux/iio/adc/adi-axi-adc.h                |   4 +
>  include/linux/mhi_ep.h                             |  19 +-
>  include/linux/netfilter_bridge.h                   |   6 +-
>  include/linux/pci.h                                |  12 +-
>  include/linux/rcupdate.h                           |   6 +
>  include/linux/skbuff.h                             |   2 +-
>  include/linux/srcu.h                               |   2 +-
>  include/linux/usb.h                                |   6 +
>  include/linux/virtio_net.h                         |   9 +-
>  include/linux/virtio_vsock.h                       |   1 +
>  include/net/af_vsock.h                             |   2 +-
>  include/net/bluetooth/hci_core.h                   |   1 -
>  include/net/netdev_queues.h                        |   2 +-
>  include/uapi/linux/bpf.h                           |   3 +
>  init/do_mounts.c                                   |   9 +-
>  io_uring/io_uring.c                                |  22 +-
>  io_uring/rw.c                                      |  10 +-
>  kernel/bpf/arraymap.c                              |  12 +-
>  kernel/bpf/hashtab.c                               |   6 +-
>  kernel/bpf/lpm_trie.c                              |   3 +
>  kernel/bpf/map_in_map.c                            |  13 +-
>  kernel/bpf/map_in_map.h                            |   2 +-
>  kernel/bpf/memalloc.c                              |  94 +-----
>  kernel/bpf/stackmap.c                              |  11 +-
>  kernel/bpf/syscall.c                               |  47 ++-
>  kernel/bpf/verifier.c                              |  96 +++---
>  kernel/debug/kdb/kdb_main.c                        |   2 -
>  kernel/dma/coherent.c                              |   4 +-
>  kernel/sched/fair.c                                |  20 +-
>  kernel/time/tick-sched.c                           |   5 +
>  kernel/trace/bpf_trace.c                           |   7 +
>  lib/kunit/debugfs.c                                |   4 +-
>  net/bluetooth/hci_conn.c                           |   8 +-
>  net/bluetooth/hci_debugfs.c                        |  12 +-
>  net/bluetooth/hci_event.c                          |  11 +-
>  net/bridge/br_netfilter_hooks.c                    |  42 ++-
>  net/bridge/br_netfilter_ipv6.c                     |  14 +-
>  net/core/rtnetlink.c                               |  14 +-
>  net/dns_resolver/dns_key.c                         |   2 +-
>  net/ethtool/features.c                             |   9 +-
>  net/ipv4/af_inet.c                                 |   1 +
>  net/ipv4/ipmr.c                                    |  13 +-
>  net/ipv4/netfilter/nf_reject_ipv4.c                |   9 +-
>  net/ipv4/udp.c                                     |  34 +--
>  net/ipv6/ip6_tunnel.c                              |  26 +-
>  net/ipv6/mcast.c                                   |   4 +
>  net/ipv6/netfilter/nf_reject_ipv6.c                |  11 +-
>  net/ipv6/udp.c                                     |  16 +-
>  net/mptcp/options.c                                |   6 +-
>  net/mptcp/subflow.c                                |  17 +-
>  net/ncsi/internal.h                                |   7 +-
>  net/ncsi/ncsi-netlink.c                            |   4 +-
>  net/ncsi/ncsi-pkt.h                                |   7 +-
>  net/ncsi/ncsi-rsp.c                                |  26 +-
>  net/netfilter/ipset/ip_set_hash_netiface.c         |   8 +-
>  net/netfilter/ipvs/ip_vs_xmit.c                    |   4 +-
>  net/netfilter/nf_log_syslog.c                      |  13 +-
>  net/netfilter/nf_queue.c                           |   6 +-
>  net/netfilter/nf_tables_api.c                      |  38 ++-
>  net/netfilter/nfnetlink_log.c                      |   8 +-
>  net/netfilter/nft_limit.c                          |  19 +-
>  net/netfilter/xt_physdev.c                         |   2 +-
>  net/netlabel/netlabel_calipso.c                    |  49 +--
>  net/rxrpc/ar-internal.h                            |   1 +
>  net/rxrpc/call_object.c                            |   4 +-
>  net/rxrpc/local_object.c                           |  13 +-
>  net/rxrpc/output.c                                 |   6 +-
>  net/rxrpc/rxkad.c                                  |   2 +
>  net/sched/act_ct.c                                 |  12 +-
>  net/sctp/socket.c                                  |  13 +-
>  net/sunrpc/xprtmultipath.c                         |   2 +-
>  net/tls/tls_sw.c                                   |   6 +-
>  net/unix/unix_bpf.c                                |  21 +-
>  net/vmw_vsock/af_vsock.c                           |   9 +-
>  net/vmw_vsock/hyperv_transport.c                   |   4 +-
>  net/vmw_vsock/virtio_transport.c                   |   1 +
>  net/vmw_vsock/virtio_transport_common.c            |  43 ++-
>  net/vmw_vsock/vsock_loopback.c                     |   1 +
>  net/wireless/scan.c                                |  47 ++-
>  rust/bindgen_parameters                            |   4 +
>  security/apparmor/lib.c                            |   1 +
>  security/apparmor/lsm.c                            |   1 -
>  security/apparmor/policy_unpack.c                  |  11 +-
>  security/keys/encrypted-keys/encrypted.c           |   4 +
>  security/selinux/hooks.c                           |   7 +
>  sound/pci/hda/patch_hdmi.c                         |   6 +
>  sound/pci/hda/patch_realtek.c                      |   3 +
>  sound/pci/oxygen/oxygen_mixer.c                    |   2 +-
>  sound/soc/amd/vangogh/acp5x-mach.c                 |  35 +--
>  sound/soc/codecs/cs35l33.c                         |   4 +-
>  sound/soc/codecs/rt5645.c                          |   8 -
>  sound/soc/codecs/tas2781-fmwlib.c                  |   1 +
>  .../soc/intel/boards/sof_sdw_rt_sdca_jack_common.c |   1 +
>  sound/soc/intel/common/soc-acpi-intel-glk-match.c  |  14 +-
>  sound/soc/mediatek/common/mtk-dsp-sof-common.c     |   2 +-
>  sound/soc/sof/ipc4-loader.c                        |  11 +-
>  sound/soc/sof/topology.c                           |   2 +-
>  sound/usb/mixer_scarlett_gen2.c                    | 223 +++++++++-----
>  tools/include/uapi/linux/bpf.h                     |   3 +
>  tools/lib/api/io.h                                 |   1 +
>  tools/perf/builtin-stat.c                          |  18 +-
>  .../arch/arm64/ampere/ampereone/core-imp-def.json  |   2 +-
>  .../attr/test-record-user-regs-no-sve-aarch64      |   2 +-
>  .../tests/attr/test-record-user-regs-sve-aarch64   |   2 +-
>  tools/perf/tests/workloads/thloop.c                |   4 +-
>  tools/perf/util/bpf-event.c                        |   8 +-
>  tools/perf/util/bpf-event.h                        |  12 +-
>  tools/perf/util/db-export.c                        |   4 +-
>  tools/perf/util/env.c                              |  50 ++--
>  tools/perf/util/env.h                              |   4 +
>  tools/perf/util/genelf.c                           |   6 +-
>  tools/perf/util/header.c                           |  17 +-
>  tools/perf/util/hisi-ptt.c                         |   1 +
>  tools/perf/util/mem-events.c                       |  25 +-
>  tools/perf/util/stat-shadow.c                      |   2 +-
>  tools/perf/util/unwind-libdw.c                     |  21 +-
>  tools/perf/util/unwind-libunwind-local.c           |   2 +-
>  tools/testing/selftests/alsa/conf.c                |   2 +-
>  tools/testing/selftests/alsa/mixer-test.c          |   4 +-
>  tools/testing/selftests/bpf/prog_tests/bpf_iter.c  |   2 +
>  tools/testing/selftests/bpf/prog_tests/time_tai.c  |   2 +-
>  .../selftests/bpf/progs/bpf_iter_task_stack.c      |   5 +
>  .../selftests/bpf/progs/test_global_func16.c       |   2 +-
>  .../selftests/bpf/progs/verifier_basic_stack.c     |   8 +-
>  .../testing/selftests/bpf/progs/verifier_int_ptr.c |   5 +-
>  .../selftests/bpf/progs/verifier_raw_stack.c       |   5 +-
>  .../testing/selftests/bpf/progs/verifier_var_off.c |  62 +++-
>  .../selftests/bpf/progs/xdp_synproxy_kern.c        |   4 +-
>  .../selftests/bpf/verifier/atomic_cmpxchg.c        |  11 -
>  tools/testing/selftests/bpf/verifier/calls.c       |   4 +-
>  .../drivers/net/bonding/mode-1-recovery-updelay.sh |   2 +-
>  .../drivers/net/bonding/mode-2-recovery-updelay.sh |   2 +-
>  .../testing/selftests/drivers/net/mlxsw/qos_pfc.sh |  18 +-
>  .../drivers/net/mlxsw/spectrum-2/tc_flower.sh      | 106 ++++++-
>  .../selftests/net/arp_ndisc_untracked_subnets.sh   |   2 +-
>  .../selftests/net/fib_nexthop_multiprefix.sh       |   4 +-
>  tools/testing/selftests/powerpc/math/fpu_preempt.c |   9 +-
>  tools/testing/selftests/powerpc/math/vmx_preempt.c |  10 +-
>  tools/testing/selftests/sgx/Makefile               |   2 +-
>  tools/testing/selftests/sgx/load.c                 |   9 +-
>  tools/testing/selftests/sgx/sigstruct.c            |   5 +-
>  tools/testing/selftests/sgx/test_encl.c            |   8 +-
>  584 files changed, 5326 insertions(+), 3284 deletions(-)
>
>
>

^ permalink raw reply	[flat|nested] 599+ messages in thread

* Re: [PATCH 6.6 000/583] 6.6.14-rc1 review
  2024-01-23  8:40 ` Luna Jernberg
@ 2024-01-23  8:42   ` Luna Jernberg
  0 siblings, 0 replies; 599+ messages in thread
From: Luna Jernberg @ 2024-01-23  8:42 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
	patches, lkft-triage, pavel, jonathanh, f.fainelli,
	sudipm.mukherjee, srw, rwarsow, conor, allen.lkml

HP 550-323no

Den tis 23 jan. 2024 kl 09:40 skrev Luna Jernberg <droidbittin@gmail.com>:
>
> Works fine on my Skylake system model name    : Intel(R) Core(TM)
> i5-6400 CPU @ 2.70GHz with Arch Linux
>
>
> Tested-by: Luna Jernberg <droidbittin@gmail.com>
>
> Den tis 23 jan. 2024 kl 03:17 skrev Greg Kroah-Hartman
> <gregkh@linuxfoundation.org>:
> >
> > This is the start of the stable review cycle for the 6.6.14 release.
> > There are 583 patches in this series, all will be posted as a response
> > to this one.  If anyone has any issues with these being applied, please
> > let me know.
> >
> > Responses should be made by Wed, 24 Jan 2024 23:56:49 +0000.
> > Anything received after that time might be too late.
> >
> > The whole patch series can be found in one patch at:
> >         https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.14-rc1.gz
> > or in the git tree and branch at:
> >         git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.6.y
> > and the diffstat can be found below.
> >
> > thanks,
> >
> > greg k-h
> >
> > -------------
> > Pseudo-Shortlog of commits:
> >
> > Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >     Linux 6.6.14-rc1
> >
> > Alexandre Ghiti <alexghiti@rivosinc.com>
> >     riscv: Fix wrong usage of lm_alias() when splitting a huge linear mapping
> >
> > Marek Szyprowski <m.szyprowski@samsung.com>
> >     i2c: s3c24xx: fix transferring more than one message in polling mode
> >
> > Marek Szyprowski <m.szyprowski@samsung.com>
> >     i2c: s3c24xx: fix read transfers in polling mode
> >
> > Nikita Zhandarovich <n.zhandarovich@fintech.ru>
> >     ipv6: mcast: fix data-race in ipv6_mc_down / mld_ifc_work
> >
> > Amit Cohen <amcohen@nvidia.com>
> >     selftests: mlxsw: qos_pfc: Adjust the test to support 8 lanes
> >
> > Petr Machata <petrm@nvidia.com>
> >     mlxsw: spectrum_router: Register netdevice notifier before nexthop
> >
> > Ido Schimmel <idosch@nvidia.com>
> >     mlxsw: spectrum_acl_tcam: Fix stack corruption
> >
> > Ido Schimmel <idosch@nvidia.com>
> >     mlxsw: spectrum_acl_tcam: Fix NULL pointer dereference in error path
> >
> > Amit Cohen <amcohen@nvidia.com>
> >     mlxsw: spectrum_acl_erp: Fix error flow of pool allocation failure
> >
> > Christoph Hellwig <hch@lst.de>
> >     loop: fix the the direct I/O support check when used on top of block devices
> >
> > Ludvig Pärsson <ludvig.parsson@axis.com>
> >     ethtool: netlink: Add missing ethnl_ops_begin/complete
> >
> > Mark Brown <broonie@kernel.org>
> >     arm64/ptrace: Don't flush ZA/ZT storage when writing ZA via ptrace
> >
> > Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> >     kdb: Fix a potential buffer overflow in kdb_local()
> >
> > Pavel Begunkov <asml.silence@gmail.com>
> >     io_uring: adjust defer tw counting
> >
> > Fedor Pchelkin <pchelkin@ispras.ru>
> >     ipvs: avoid stat macros calls from preemptible context
> >
> > Pablo Neira Ayuso <pablo@netfilter.org>
> >     netfilter: nf_tables: reject NFT_SET_CONCAT with not field length description
> >
> > Pablo Neira Ayuso <pablo@netfilter.org>
> >     netfilter: nf_tables: skip dead set elements in netlink dump
> >
> > Pablo Neira Ayuso <pablo@netfilter.org>
> >     netfilter: nf_tables: do not allow mismatch field size and set key length
> >
> > Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
> >     netfilter: bridge: replace physindev with physinif in nf_bridge_info
> >
> > Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
> >     netfilter: propagate net to nf_bridge_get_physindev
> >
> > Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
> >     netfilter: nf_queue: remove excess nf_bridge variable
> >
> > Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
> >     netfilter: nfnetlink_log: use proper helper for fetching physinif
> >
> > Pablo Neira Ayuso <pablo@netfilter.org>
> >     netfilter: nft_limit: do not ignore unsupported flags
> >
> > Pablo Neira Ayuso <pablo@netfilter.org>
> >     netfilter: nf_tables: reject invalid set policy
> >
> > Jakub Kicinski <kuba@kernel.org>
> >     net: netdevsim: don't try to destroy PHC on VFs
> >
> > Paolo Abeni <pabeni@redhat.com>
> >     mptcp: relax check on MPC passive fallback
> >
> > Hengqi Chen <hengqi.chen@gmail.com>
> >     LoongArch: BPF: Prevent out-of-bounds memory access
> >
> > Kunwu Chan <chentao@kylinos.cn>
> >     net: dsa: vsc73xx: Add null pointer check to vsc73xx_gpio_probe
> >
> > Hao Sun <sunhao.th@gmail.com>
> >     bpf: Reject variable offset alu on PTR_TO_FLOW_KEYS
> >
> > Qiang Ma <maqianga@uniontech.com>
> >     net: stmmac: ethtool: Fixed calltrace caused by unbalanced disable_irq_wake calls
> >
> > Benjamin Poirier <bpoirier@nvidia.com>
> >     selftests: bonding: Change script interpreter
> >
> > Alex Deucher <alexander.deucher@amd.com>
> >     drm/amdgpu: fall back to INPUT power for AVG power via INFO IOCTL
> >
> > Dafna Hirschfeld <dhirschfeld@habana.ai>
> >     drm/amdkfd: fixes for HMM mem allocation
> >
> > Kai Vehmanen <kai.vehmanen@linux.intel.com>
> >     ASoC: SOF: ipc4-loader: remove the CPC check warnings
> >
> > Su Hui <suhui@nfschina.com>
> >     gpio: mlxbf3: add an error code check in mlxbf3_gpio_probe
> >
> > Michal Simek <michal.simek@amd.com>
> >     dt-bindings: gpio: xilinx: Fix node address in gpio
> >
> > Nikita Yushchenko <nikita.yoush@cogentembedded.com>
> >     net: ravb: Fix dma_addr_t truncation in error case
> >
> > John Fastabend <john.fastabend@gmail.com>
> >     net: tls, fix WARNIING in __sk_msg_free
> >
> > Martin KaFai Lau <martin.lau@kernel.org>
> >     bpf: Avoid iter->offset making backward progress in bpf_iter_udp
> >
> > Martin KaFai Lau <martin.lau@kernel.org>
> >     bpf: iter_udp: Retry with a larger batch size without going back to the previous bucket
> >
> > Marc Kleine-Budde <mkl@pengutronix.de>
> >     net: netdev_queue: netdev_txq_completed_mb(): fix wake condition
> >
> > Eric Dumazet <edumazet@google.com>
> >     net: add more sanity check in virtio_net_hdr_to_skb()
> >
> > Gao Xiang <xiang@kernel.org>
> >     erofs: fix inconsistent per-file compression format
> >
> > Gao Xiang <xiang@kernel.org>
> >     erofs: simplify compression configuration parser
> >
> > Eric Dumazet <edumazet@google.com>
> >     udp: annotate data-races around up->pending
> >
> > Sneh Shah <quic_snehshah@quicinc.com>
> >     net: stmmac: Fix ethool link settings ops for integrated PCS
> >
> > Jens Axboe <axboe@kernel.dk>
> >     block: ensure we hold a queue reference when using queue limits
> >
> > Eric Dumazet <edumazet@google.com>
> >     mptcp: refine opt_mp_capable determination
> >
> > Eric Dumazet <edumazet@google.com>
> >     mptcp: use OPTION_MPTCP_MPJ_SYN in subflow_check_req()
> >
> > Eric Dumazet <edumazet@google.com>
> >     mptcp: use OPTION_MPTCP_MPJ_SYNACK in subflow_finish_connect()
> >
> > Eric Dumazet <edumazet@google.com>
> >     mptcp: strict validation before using mp_opt->hmac
> >
> > Eric Dumazet <edumazet@google.com>
> >     mptcp: mptcp_parse_option() fix for MPTCPOPT_MP_JOIN
> >
> > Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
> >     ALSA: hda: Properly setup HDMI stream
> >
> > Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> >     net: phy: micrel: populate .soft_reset for KSZ9131
> >
> > Horatiu Vultur <horatiu.vultur@microchip.com>
> >     net: micrel: Fix PTP frame parsing for lan8841
> >
> > Taehee Yoo <ap420073@gmail.com>
> >     amt: do not use overwrapped cb area
> >
> > Sanjuán García, Jorge <Jorge.SanjuanGarcia@duagon.com>
> >     net: ethernet: ti: am65-cpsw: Fix max mtu to fit ethernet frames
> >
> > Nithin Dabilpuram <ndabilpuram@marvell.com>
> >     octeontx2-af: CN10KB: Fix FIFO length calculation for RPM2
> >
> > David Howells <dhowells@redhat.com>
> >     rxrpc: Fix use of Don't Fragment flag
> >
> > Lin Ma <linma@zju.edu.cn>
> >     net: qualcomm: rmnet: fix global oob in rmnet_policy
> >
> > Niklas Schnelle <schnelle@linux.ibm.com>
> >     s390/pci: fix max size calculation in zpci_memcpy_toio()
> >
> > AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> >     ASoC: mediatek: sof-common: Add NULL check for normal_link string
> >
> > Jianjun Wang <jianjun.wang@mediatek.com>
> >     PCI: mediatek-gen3: Fix translation window size calculation
> >
> > Siddharth Vadapalli <s-vadapalli@ti.com>
> >     PCI: keystone: Fix race condition when initializing PHYs
> >
> > Maurizio Lombardi <mlombard@redhat.com>
> >     nvmet-tcp: Fix the H2C expected PDU len calculation
> >
> > Arnd Bergmann <arnd@arndb.de>
> >     nvme: trace: avoid memcpy overflow warning
> >
> > Arnd Bergmann <arnd@arndb.de>
> >     nvmet: re-fix tracing strncpy() warning
> >
> > Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
> >     hisi_acc_vfio_pci: Update migration data pointer correctly on saving/resume
> >
> > Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> >     spi: coldfire-qspi: Remove an erroneous clk_disable_unprepare() from the remove function
> >
> > Dan Williams <dan.j.williams@intel.com>
> >     cxl/port: Fix missing target list lock
> >
> > Ben Gainey <ben.gainey@arm.com>
> >     perf db-export: Fix missing reference count get in call_path_from_sample()
> >
> > Sam Ravnborg <sam@ravnborg.org>
> >     serial: apbuart: fix console prompt on qemu
> >
> > Christoph Niedermaier <cniedermaier@dh-electronics.com>
> >     serial: imx: Correct clock error message in function probe()
> >
> > Chunfeng Yun <chunfeng.yun@mediatek.com>
> >     usb: xhci-mtk: fix a short packet issue of gen1 isoc-in transfer
> >
> > Fedor Pchelkin <pchelkin@ispras.ru>
> >     apparmor: avoid crash when parsed profile name is empty
> >
> > Fedor Pchelkin <pchelkin@ispras.ru>
> >     apparmor: fix possible memory leak in unpack_trans_table
> >
> > Jim Harris <jim.harris@samsung.com>
> >     cxl/region: fix x9 interleave typo
> >
> > Ian Rogers <irogers@google.com>
> >     perf stat: Fix hard coded LL miss units
> >
> > Ian Rogers <irogers@google.com>
> >     perf env: Avoid recursively taking env->bpf_progs.lock
> >
> > Maurizio Lombardi <mlombard@redhat.com>
> >     nvmet-tcp: fix a crash in nvmet_req_complete()
> >
> > Maurizio Lombardi <mlombard@redhat.com>
> >     nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length
> >
> > John Johansen <john.johansen@canonical.com>
> >     apparmor: Fix ref count leak in task_kill
> >
> > Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> >     vdpa: Fix an error handling path in eni_vdpa_probe()
> >
> > Kunwu Chan <chentao@kylinos.cn>
> >     power: supply: Fix null pointer dereference in smb2_probe
> >
> > Ashish Mhetre <amhetre@nvidia.com>
> >     iommu: Don't reserve 0-length IOVA region
> >
> > Andrzej Pietrasiewicz <andrzej.p@collabora.com>
> >     usb: gadget: webcam: Make g_webcam loadable again
> >
> > Nícolas F. R. A. Prado <nfraprado@collabora.com>
> >     spmi: mtk-pmif: Serialize PMIF status check and command submission
> >
> > Douglas Anderson <dianders@chromium.org>
> >     usb: core: Fix crash w/ usb_choose_configuration() if no driver
> >
> > Oliver Neukum <oneukum@suse.com>
> >     usb: cdc-acm: return correct error code on unsupported break
> >
> > Jiri Slaby (SUSE) <jirislaby@kernel.org>
> >     tty: use 'if' in send_break() instead of 'goto'
> >
> > Jiri Slaby (SUSE) <jirislaby@kernel.org>
> >     tty: don't check for signal_pending() in send_break()
> >
> > Jiri Slaby (SUSE) <jirislaby@kernel.org>
> >     tty: early return from send_break() on TTY_DRIVER_HARDWARE_BREAK
> >
> > Manivannan Sadhasivam <mani@kernel.org>
> >     PCI: epf-mhi: Fix the DMA data direction of dma_unmap_single()
> >
> > Manivannan Sadhasivam <mani@kernel.org>
> >     bus: mhi: ep: Pass mhi_ep_buf_info struct to read/write APIs
> >
> > Manivannan Sadhasivam <mani@kernel.org>
> >     bus: mhi: ep: Use slab allocator where applicable
> >
> > Manivannan Sadhasivam <mani@kernel.org>
> >     bus: mhi: ep: Do not allocate event ring element on stack
> >
> > Namhyung Kim <namhyung@kernel.org>
> >     perf unwind-libunwind: Fix base address for .eh_frame
> >
> > Namhyung Kim <namhyung@kernel.org>
> >     perf unwind-libdw: Handle JIT-generated DSOs properly
> >
> > Namhyung Kim <namhyung@kernel.org>
> >     perf genelf: Set ELF program header addresses properly
> >
> > Yicong Yang <yangyicong@hisilicon.com>
> >     perf hisi-ptt: Fix one memory leakage in hisi_ptt_process_auxtrace_event()
> >
> > Yicong Yang <yangyicong@hisilicon.com>
> >     perf header: Fix one memory leakage in perf_event__fprintf_event_update()
> >
> > Nuno Sa <nuno.sa@analog.com>
> >     iio: adc: ad9467: fix scale setting
> >
> > Nuno Sa <nuno.sa@analog.com>
> >     iio: adc: ad9467: add mutex to struct ad9467_state
> >
> > Nuno Sa <nuno.sa@analog.com>
> >     iio: adc: ad9467: don't ignore error codes
> >
> > Nuno Sa <nuno.sa@analog.com>
> >     iio: adc: ad9467: fix reset gpio handling
> >
> > Zhao Mengmeng <zhaomengmeng@kylinos.cn>
> >     selftests/sgx: Skip non X86_64 platform
> >
> > Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
> >     selftests/sgx: Include memory clobber for inline asm in test enclave
> >
> > Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
> >     selftests/sgx: Fix uninitialized pointer dereferences in encl_get_entry
> >
> > Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>
> >     selftests/sgx: Fix uninitialized pointer dereference in error path
> >
> > Paul Geurts <paul_geurts@live.nl>
> >     serial: imx: fix tx statemachine deadlock
> >
> > Sakari Ailus <sakari.ailus@linux.intel.com>
> >     software node: Let args be NULL in software_node_get_reference_args
> >
> > Sakari Ailus <sakari.ailus@linux.intel.com>
> >     acpi: property: Let args be NULL in __acpi_node_get_property_reference
> >
> > Gregory Price <gourry.memverge@gmail.com>
> >     base/node.c: initialize the accessor list before registering
> >
> > Ian Rogers <irogers@google.com>
> >     perf stat: Exit perf stat if parse groups fails
> >
> > Kan Liang <kan.liang@linux.intel.com>
> >     perf mem: Fix error on hybrid related to availability of mem event in a PMU
> >
> > Ilkka Koskinen <ilkka@os.amperecomputing.com>
> >     perf vendor events arm64 AmpereOne: Rename BPU_FLUSH_MEM_FAULT to GPC_FLUSH_MEM_FAULT
> >
> > Brett Creeley <brett.creeley@amd.com>
> >     vfio/pds: Fix calculations in pds_vfio_dirty_sync
> >
> > Veronika Molnarova <vmolnaro@redhat.com>
> >     perf test record user-regs: Fix mask for vg register
> >
> > Douglas Anderson <dianders@chromium.org>
> >     r8152: Choose our USB config with choose_configuration() rather than probe()
> >
> > Douglas Anderson <dianders@chromium.org>
> >     usb: core: Allow subclassed USB drivers to override usb_choose_configuration()
> >
> > Arnaldo Carvalho de Melo <acme@redhat.com>
> >     libapi: Add missing linux/types.h header to get the __u64 type on io.h
> >
> > Adrian Hunter <adrian.hunter@intel.com>
> >     perf header: Fix segfault on build_mem_topology() error path
> >
> > Nick Forrington <nick.forrington@arm.com>
> >     perf test: Remove atomics from test_loop to avoid test failures
> >
> > Laurentiu Tudor <laurentiu.tudor@nxp.com>
> >     iommu: Map reserved memory as cacheable if device is coherent
> >
> > Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >     serial: 8250: omap: Don't skip resource freeing if pm_runtime_resume_and_get() failed
> >
> > Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >     PCI: Avoid potential out-of-bounds read in pci_dev_for_each_resource()
> >
> > Su Hui <suhui@nfschina.com>
> >     power: supply: bq256xx: fix some problem in bq256xx_hw_init
> >
> > Jan Palus <jpalus@fastmail.com>
> >     power: supply: cw2015: correct time_to_empty units in sysfs
> >
> > Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> >     MIPS: Alchemy: Fix an out-of-bound access in db1550_dev_setup()
> >
> > Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> >     MIPS: Alchemy: Fix an out-of-bound access in db1200_dev_setup()
> >
> > Frederik Haxel <haxel@fzi.de>
> >     riscv: Fixed wrong register in XIP_FIXUP_FLASH_OFFSET macro
> >
> > Alexandre Ghiti <alexghiti@rivosinc.com>
> >     riscv: Fix set_direct_map_default_noflush() to reset _PAGE_EXEC
> >
> > Alexandre Ghiti <alexghiti@rivosinc.com>
> >     riscv: Fix set_memory_XX() and set_direct_map_XX() by splitting huge linear mappings
> >
> > Alexandre Ghiti <alexghiti@rivosinc.com>
> >     riscv: Fix module_alloc() that did not reset the linear mapping permissions
> >
> > Alexandre Ghiti <alexghiti@rivosinc.com>
> >     riscv: Check if the code to patch lies in the exit section
> >
> > Vincent Whitchurch <vincent.whitchurch@axis.com>
> >     um: virt-pci: fix platform map offset
> >
> > Serge Semin <fancer.lancer@gmail.com>
> >     mips: Fix incorrect max_low_pfn adjustment
> >
> > Serge Semin <fancer.lancer@gmail.com>
> >     mips: dmi: Fix early remap on MIPS32
> >
> > Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> >     srcu: Use try-lock lockdep annotation for NMI-safe access.
> >
> > Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >     mfd: intel-lpss: Fix the fractional clock divider flags
> >
> > Kunwu Chan <chentao@kylinos.cn>
> >     mfd: tps6594: Add null pointer check to tps6594_device_init()
> >
> > Martin Kurbanov <mmkurbanov@salutedevices.com>
> >     leds: aw200xx: Fix write to DIM parameter
> >
> > Dang Huynh <danct12@riseup.net>
> >     leds: aw2013: Select missing dependency REGMAP_I2C
> >
> > Kunwu Chan <chentao@kylinos.cn>
> >     mfd: syscon: Fix null pointer dereference in of_syscon_register()
> >
> > Charles Keepax <ckeepax@opensource.cirrus.com>
> >     mfd: cs42l43: Correct SoundWire port list
> >
> > Neil Armstrong <neil.armstrong@linaro.org>
> >     mfd: rk8xx: fixup devices registration with PLATFORM_DEVID_AUTO
> >
> > Randy Dunlap <rdunlap@infradead.org>
> >     ARM: 9330/1: davinci: also select PINCTRL
> >
> > Hugo Villeneuve <hvilleneuve@dimonoff.com>
> >     serial: sc16is7xx: set safe default SPI clock frequency
> >
> > Hugo Villeneuve <hvilleneuve@dimonoff.com>
> >     serial: sc16is7xx: add check for unsupported SPI modes during probe
> >
> > Jason Gerecke <jason.gerecke@wacom.com>
> >     HID: wacom: Correct behavior when processing some confidence == false touches
> >
> > Yauhen Kharuzhy <jekhor@gmail.com>
> >     HID: sensor-hub: Enable hid core report processing for all devices
> >
> > Marcelo Schmitt <marcelo.schmitt@analog.com>
> >     iio: adc: ad7091r: Pass iio_dev to event handler
> >
> > Sean Christopherson <seanjc@google.com>
> >     KVM: x86/pmu: Reset the PMU, i.e. stop counters, before refreshing
> >
> > Sean Christopherson <seanjc@google.com>
> >     KVM: x86/pmu: Move PMU reset logic to common x86 code
> >
> > Oliver Upton <oliver.upton@linux.dev>
> >     KVM: arm64: vgic-its: Avoid potential UAF in LPI translation cache
> >
> > Marc Zyngier <maz@kernel.org>
> >     KVM: arm64: vgic-v4: Restore pending state on host userspace write
> >
> > Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> >     x86/kvm: Do not try to disable kvmclock if it was not enabled
> >
> > qizhong cheng <qizhong.cheng@mediatek.com>
> >     PCI: mediatek: Clear interrupt status before dispatching handler
> >
> > Niklas Cassel <niklas.cassel@wdc.com>
> >     PCI: dwc: endpoint: Fix dw_pcie_ep_raise_msix_irq() alignment support
> >
> > Bjorn Helgaas <bhelgaas@google.com>
> >     x86/pci: Reserve ECAM if BIOS didn't include it in PNP0C02 _CRS
> >
> > Tadeusz Struk <tstruk@gigaio.com>
> >     PCI/P2PDMA: Remove reference to pci_p2pdma_map_sg()
> >
> > Huang Ying <ying.huang@intel.com>
> >     cxl/port: Fix decoder initialization when nr_targets > interleave_ways
> >
> > Sean Christopherson <seanjc@google.com>
> >     Revert "nSVM: Check for reserved encodings of TLB_CONTROL in nested VMCB"
> >
> > Nicolas Dichtel <nicolas.dichtel@6wind.com>
> >     Revert "net: rtnetlink: Enslave device before bringing it up"
> >
> > Petr Tesarik <petr@tesarici.cz>
> >     net: stmmac: fix ethtool per-queue statistics
> >
> > David Lin <yu-hao.lin@nxp.com>
> >     wifi: mwifiex: fix uninitialized firmware_stat
> >
> > David Lin <yu-hao.lin@nxp.com>
> >     wifi: mwifiex: configure BSSID consistently when starting AP
> >
> > David Lin <yu-hao.lin@nxp.com>
> >     wifi: mwifiex: add extra delay for firmware ready
> >
> > Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> >     wifi: rtlwifi: Convert LNKCTL change to PCIe cap RMW accessors
> >
> > Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> >     wifi: rtlwifi: Remove bogus and dangerous ASPM disable/enable code
> >
> > Christian Marangi <ansuelsmth@gmail.com>
> >     wifi: mt76: fix broken precal loading from MTD for mt7915
> >
> > Isaac J. Manjarres <isaacmanjarres@google.com>
> >     iommu/dma: Trace bounce buffer usage when mapping buffers
> >
> > Rob Clark <robdclark@chromium.org>
> >     iommu/arm-smmu-qcom: Add missing GMU entry to match table
> >
> > Jiri Olsa <olsajiri@gmail.com>
> >     bpf: Fix re-attachment branch in bpf_tracing_prog_attach
> >
> > Gui-Dong Han <2045gemini@gmail.com>
> >     Bluetooth: Fix atomicity violation in {min,max}_key_size_set
> >
> > Stefan Berger <stefanb@linux.ibm.com>
> >     rootfs: Fix support for rootfstype= when root= is given
> >
> > Bart Van Assche <bvanassche@acm.org>
> >     md/raid1: Use blk_opf_t for read and write operations
> >
> > Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >     pwm: Fix out-of-bounds access in of_pwm_single_xlate()
> >
> > Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >     pwm: jz4740: Don't use dev_err_probe() in .request()
> >
> > Pablo Neira Ayuso <pablo@netfilter.org>
> >     netfilter: nf_tables: check if catch-all set element is active in next generation
> >
> > Matthew Wilcox (Oracle) <willy@infradead.org>
> >     block: Fix iterating over an empty bio with bio_for_each_folio_all
> >
> > Matthew Wilcox (Oracle) <willy@infradead.org>
> >     block: Remove special-casing of compound pages
> >
> > Min Li <min15.li@samsung.com>
> >     block: add check that partition length needs to be aligned with block size
> >
> > Mario Limonciello <mario.limonciello@amd.com>
> >     drm/amd: Enable PCIe PME from D3
> >
> > Junxiao Bi <junxiao.bi@oracle.com>
> >     md: bypass block throttle for superblock update
> >
> > Chandrakanth patil <chandrakanth.patil@broadcom.com>
> >     scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable State
> >
> > Chandrakanth patil <chandrakanth.patil@broadcom.com>
> >     scsi: mpi3mr: Clean up block devices post controller reset
> >
> > Chandrakanth patil <chandrakanth.patil@broadcom.com>
> >     scsi: mpi3mr: Refresh sdev queue depth after controller reset
> >
> > Amir Goldstein <amir73il@gmail.com>
> >     scsi: target: core: add missing file_{start,end}_write()
> >
> > Bart Van Assche <bvanassche@acm.org>
> >     scsi: ufs: core: Simplify power management during async scan
> >
> > Nam Cao <namcao@linutronix.de>
> >     fbdev: flush deferred IO before closing
> >
> > Nam Cao <namcao@linutronix.de>
> >     fbdev: flush deferred work in fb_deferred_io_fsync()
> >
> > Thomas Zimmermann <tzimmermann@suse.de>
> >     fbdev/acornfb: Fix name of fb_ops initializer macro
> >
> > Jens Axboe <axboe@kernel.dk>
> >     io_uring: ensure local task_work is run on wait timeout
> >
> > Jens Axboe <axboe@kernel.dk>
> >     io_uring/rw: ensure io->bytes_done is always initialized
> >
> > Pavel Begunkov <asml.silence@gmail.com>
> >     io_uring: don't check iopoll if request completes
> >
> > Xi Ruoyao <xry111@xry111.site>
> >     LoongArch: Fix and simplify fcsr initialization on execve()
> >
> > Eric Biggers <ebiggers@google.com>
> >     ceph: select FS_ENCRYPTION_ALGS if FS_ENCRYPTION
> >
> > Namjae Jeon <linkinjeon@kernel.org>
> >     ksmbd: only v2 leases handle the directory
> >
> > Namjae Jeon <linkinjeon@kernel.org>
> >     ksmbd: fix UAF issue in ksmbd_tcp_new_connection()
> >
> > Namjae Jeon <linkinjeon@kernel.org>
> >     ksmbd: validate mech token in session setup
> >
> > Bin Li <bin.li@canonical.com>
> >     ALSA: hda/realtek: Enable headset mic on Lenovo M70 Gen5
> >
> > Yo-Jung Lin <leo.lin@canonical.com>
> >     ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on HP ZBook
> >
> > Çağhan Demir <caghandemir@marun.edu.tr>
> >     ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq2xxx
> >
> > Takashi Iwai <tiwai@suse.de>
> >     ALSA: oxygen: Fix right channel of capture volume mixer
> >
> > Lino Sanfilippo <l.sanfilippo@kunbus.com>
> >     serial: omap: do not override settings for RS485 support
> >
> > Lino Sanfilippo <l.sanfilippo@kunbus.com>
> >     serial: 8250_exar: Set missing rs485_supported flag
> >
> > Christoph Niedermaier <cniedermaier@dh-electronics.com>
> >     serial: imx: Ensure that imx_uart_rs485_config() is called with enabled clock
> >
> > Lino Sanfilippo <l.sanfilippo@kunbus.com>
> >     serial: core, imx: do not set RS485 enabled if it is not supported
> >
> > Stefan Wahren <wahrenst@gmx.net>
> >     serial: 8250_bcm2835aux: Restore clock error handling
> >
> > Lino Sanfilippo <l.sanfilippo@kunbus.com>
> >     serial: core: make sure RS485 cannot be enabled when it is not supported
> >
> > Lino Sanfilippo <l.sanfilippo@kunbus.com>
> >     serial: core: fix sanitizing check for RTS settings
> >
> > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >     dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp-phy: fix path to header
> >
> > Gui-Dong Han <2045gemini@gmail.com>
> >     usb: mon: Fix atomicity violation in mon_bin_vma_fault
> >
> > RD Babiera <rdbabiera@google.com>
> >     usb: typec: class: fix typec_altmode_put_partner to put plugs
> >
> > Heikki Krogerus <heikki.krogerus@linux.intel.com>
> >     Revert "usb: typec: class: fix typec_altmode_put_partner to put plugs"
> >
> > Frank Li <Frank.Li@nxp.com>
> >     usb: cdns3: Fix uvc fail when DMA cross 4k boundery since sg enabled
> >
> > Frank Li <Frank.Li@nxp.com>
> >     usb: cdns3: fix iso transfer error when mult is not zero
> >
> > Frank Li <Frank.Li@nxp.com>
> >     usb: cdns3: fix uvc failure work since sg support enabled
> >
> > Xu Yang <xu.yang_2@nxp.com>
> >     usb: chipidea: wait controller resume finished for wakeup irq
> >
> > Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> >     Revert "usb: dwc3: don't reset device side if dwc3 was configured as host-only"
> >
> > Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> >     Revert "usb: dwc3: Soft reset phy on probe for host"
> >
> > Wesley Cheng <quic_wcheng@quicinc.com>
> >     usb: dwc3: gadget: Queue PM runtime idle on disconnect event
> >
> > Wesley Cheng <quic_wcheng@quicinc.com>
> >     usb: dwc3: gadget: Handle EP0 request dequeuing properly
> >
> > Uttkarsh Aggarwal <quic_uaggarwa@quicinc.com>
> >     usb: dwc: ep0: Update request status in dwc3_ep0_stall_restart
> >
> > Xu Yang <xu.yang_2@nxp.com>
> >     usb: phy: mxs: remove CONFIG_USB_OTG condition for mxs_phy_is_otg_host()
> >
> > Frank Li <Frank.Li@nxp.com>
> >     Revert "usb: gadget: f_uvc: change endpoint allocation in uvc_function_bind()"
> >
> > Heiko Carstens <hca@linux.ibm.com>
> >     tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug
> >
> > Michael Ellerman <mpe@ellerman.id.au>
> >     powerpc/64s: Increase default stack size to 32KB
> >
> > Tony Lindgren <tony@atomide.com>
> >     clocksource/drivers/timer-ti-dm: Fix make W=n kerneldoc warnings
> >
> > Carlos Llamas <cmllamas@google.com>
> >     binder: fix race between mmput() and do_exit()
> >
> > Jan Beulich <jbeulich@suse.com>
> >     xen-netback: don't produce zero-size SKB frags
> >
> > Kaibo Ma <ent3rm4n@gmail.com>
> >     Revert "drm/amdkfd: Relocate TBA/TMA to opposite side of VM hole"
> >
> > Matthew Maurer <mmaurer@google.com>
> >     rust: Ignore preserve-most functions
> >
> > Hans de Goede <hdegoede@redhat.com>
> >     Input: atkbd - use ab83 as id when skipping the getid command
> >
> > Stefan Wiehler <stefan.wiehler@nokia.com>
> >     mips/smp: Call rcutree_report_cpu_starting() earlier
> >
> > Carlos Llamas <cmllamas@google.com>
> >     binder: fix unused alloc->free_async_space
> >
> > Carlos Llamas <cmllamas@google.com>
> >     binder: fix async space check for 0-sized buffers
> >
> > David Howells <dhowells@redhat.com>
> >     keys, dns: Fix size check of V1 server-list header
> >
> > Jordan Rome <linux@jordanrome.com>
> >     selftests/bpf: Add assert for user stacks in test_task_stack
> >
> > Tejun Heo <tj@kernel.org>
> >     Revert "kernfs: convert kernfs_idr_lock to an irq safe raw spinlock"
> >
> > Andrea Righi <andrea.righi@canonical.com>
> >     kernfs: convert kernfs_idr_lock to an irq safe raw spinlock
> >
> > Jing Xia <jing.xia@unisoc.com>
> >     class: fix use-after-free in class_register()
> >
> > Geert Uytterhoeven <geert+renesas@glider.be>
> >     of: unittest: Fix of_count_phandle_with_args() expected value message
> >
> > Dario Binacchi <dario.binacchi@amarulasolutions.com>
> >     fbdev: imxfb: fix left margin setting
> >
> > Christian A. Ehrhardt <lk@c--e.de>
> >     of: Fix double free in of_parse_phandle_with_args_map
> >
> > Li Nan <linan122@huawei.com>
> >     ksmbd: validate the zero field of packet header
> >
> > Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
> >     kselftest/alsa - conf: Stringify the printed errno in sysfs_get()
> >
> > Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
> >     kselftest/alsa - mixer-test: Fix the print format specifier warning
> >
> > Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
> >     kselftest/alsa - mixer-test: fix the number of parameters to ksft_exit_fail_msg()
> >
> > Arnd Bergmann <arnd@arndb.de>
> >     drm/amd/display: avoid stringop-overflow warnings for dp_decide_lane_settings()
> >
> > Zhipeng Lu <alexious@zju.edu.cn>
> >     drm/amd/pm/smu7: fix a memleak in smu7_hwmgr_backend_init
> >
> > Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
> >     drm/amdkfd: Confirm list is non-empty before utilizing list_first_entry in kfd_topology.c
> >
> > Sergey Gorenko <sergeygo@nvidia.com>
> >     IB/iser: Prevent invalidating wrong MR
> >
> > Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >     gpio: sysfs: drop the mention of gpiochip_find() from sysfs code
> >
> > Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >     gpiolib: provide gpio_device_find()
> >
> > Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >     gpiolib: make gpio_device_get() and gpio_device_put() public
> >
> > Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
> >     drm/amdkfd: Fix type of 'dbg_flags' in 'struct kfd_process'
> >
> > Peter Robinson <pbrobinson@gmail.com>
> >     mmc: sdhci_omap: Fix TI SoC dependencies
> >
> > Peter Robinson <pbrobinson@gmail.com>
> >     mmc: sdhci_am654: Fix TI SoC dependencies
> >
> > Geoffrey D. Bennett <g@b4.vu>
> >     ALSA: scarlett2: Add clamp() in scarlett2_mixer_ctl_put()
> >
> > Geoffrey D. Bennett <g@b4.vu>
> >     ALSA: scarlett2: Add missing error checks to *_ctl_get()
> >
> > Geoffrey D. Bennett <g@b4.vu>
> >     ALSA: scarlett2: Allow passing any output to line_out_remap()
> >
> > Geoffrey D. Bennett <g@b4.vu>
> >     ALSA: scarlett2: Add missing error check to scarlett2_usb_set_config()
> >
> > Geoffrey D. Bennett <g@b4.vu>
> >     ALSA: scarlett2: Add missing error check to scarlett2_config_save()
> >
> > Hans de Goede <hdegoede@redhat.com>
> >     ASoC: rt5645: Drop double EF20 entry from dmi_platform_data[]
> >
> > Philipp Zabel <p.zabel@pengutronix.de>
> >     pwm: stm32: Fix enable count for clk in .probe()
> >
> > Philipp Zabel <p.zabel@pengutronix.de>
> >     pwm: stm32: Use hweight32 in stm32_pwm_detect_channels
> >
> > Théo Lebrun <theo.lebrun@bootlin.com>
> >     clk: fixed-rate: fix clk_hw_register_fixed_rate_with_accuracy_parent_hw
> >
> > Konrad Dybcio <konrad.dybcio@linaro.org>
> >     clk: qcom: dispcc-sm8550: Update disp PLL settings
> >
> > Konrad Dybcio <konrad.dybcio@linaro.org>
> >     clk: qcom: gcc-sm8550: Mark RCGs shared where applicable
> >
> > Konrad Dybcio <konrad.dybcio@linaro.org>
> >     clk: qcom: gcc-sm8550: use collapse-voting for PCIe GDSCs
> >
> > Konrad Dybcio <konrad.dybcio@linaro.org>
> >     clk: qcom: gcc-sm8550: Mark the PCIe GDSCs votable
> >
> > Konrad Dybcio <konrad.dybcio@linaro.org>
> >     clk: qcom: gcc-sm8550: Add the missing RETAIN_FF_ENABLE GDSC flag
> >
> > Xingyuan Mo <hdthky0@gmail.com>
> >     accel/habanalabs: fix information leak in sec_attest_info()
> >
> > Nícolas F. R. A. Prado <nfraprado@collabora.com>
> >     drm/mediatek: dp: Add phy_mtk_dp module as pre-dependency
> >
> > Gergo Koteles <soyer@irl.hu>
> >     ASoC: tas2781: add support for FW version 0x0503
> >
> > Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> >     ASoC: amd: vangogh: Drop conflicting ACPI-based probing
> >
> > Su Hui <suhui@nfschina.com>
> >     clk: si5341: fix an error code problem in si5341_output_clk_set_rate
> >
> > Marek Vasut <marek.vasut+renesas@mailbox.org>
> >     clk: rs9: Fix DIF OEn bit placement on 9FGV0241
> >
> > Vignesh Raghavendra <vigneshr@ti.com>
> >     watchdog: rti_wdt: Drop runtime pm reference count when watchdog is unused
> >
> > Stefan Wahren <wahrenst@gmx.net>
> >     watchdog: bcm2835_wdt: Fix WDIOC_SETTIMEOUT handling
> >
> > Jerry Hoemann <jerry.hoemann@hpe.com>
> >     watchdog/hpwdt: Only claim UNKNOWN NMI if from iLO
> >
> > Curtis Klein <curtis.klein@hpe.com>
> >     watchdog: set cdev owner before adding
> >
> > Jay Buddhabhatti <jay.buddhabhatti@amd.com>
> >     drivers: clk: zynqmp: update divider round rate logic
> >
> > Jay Buddhabhatti <jay.buddhabhatti@amd.com>
> >     drivers: clk: zynqmp: calculate closest mux rate
> >
> > Yang Yingliang <yangyingliang@huawei.com>
> >     clk: sp7021: fix return value check in sp7021_clk_probe()
> >
> > Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
> >     clk: qcom: videocc-sm8150: Add missing PLL config property
> >
> > Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
> >     clk: qcom: videocc-sm8150: Update the videocc resets
> >
> > Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
> >     dt-bindings: clock: Update the videocc resets for sm8150
> >
> > Zhiguo Niu <zhiguo.niu@unisoc.com>
> >     f2fs: fix to check return value of f2fs_recover_xattr_data
> >
> > Zhipeng Lu <alexious@zju.edu.cn>
> >     drm/amd/pm: fix a double-free in amdgpu_parse_extended_power_table
> >
> > Zhipeng Lu <alexious@zju.edu.cn>
> >     gpu/drm/radeon: fix two memleaks in radeon_vm_init
> >
> > Zhipeng Lu <alexious@zju.edu.cn>
> >     drivers/amd/pm: fix a use-after-free in kv_parse_power_table
> >
> > Zhipeng Lu <alexious@zju.edu.cn>
> >     drm/amd/pm: fix a double-free in si_dpm_init
> >
> > Alex Deucher <alexander.deucher@amd.com>
> >     drm/amdgpu/debugfs: fix error code when smc register accessors are NULL
> >
> > Hsiao Chien Sung <shawn.sung@mediatek.com>
> >     drm/mediatek: Fix underrun in VDO1 when switches off the layer
> >
> > Hsiao Chien Sung <shawn.sung@mediatek.com>
> >     drm/mediatek: Remove the redundant driver data for DPI
> >
> > Hsiao Chien Sung <shawn.sung@mediatek.com>
> >     drm/mediatek: Return error if MDP RDMA failed to enable the clock
> >
> > Jessica Zhang <quic_jesszhan@quicinc.com>
> >     drm/msm/dpu: Drop enable and frame_count parameters from dpu_hw_setup_misr()
> >
> > Jessica Zhang <quic_jesszhan@quicinc.com>
> >     drm/msm/dpu: Set input_sel bit for INTF
> >
> > Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> >     clk: renesas: rzg2l: Check reset monitor registers
> >
> > Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> >     clk: renesas: rzg2l-cpg: Reuse code in rzg2l_cpg_reset()
> >
> > Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> >     media: dvb-frontends: m88ds3103: Fix a memory leak in an error handling path of m88ds3103_probe()
> >
> > Dan Carpenter <dan.carpenter@linaro.org>
> >     media: dvbdev: drop refcount on error path in dvb_device_open()
> >
> > Chao Yu <chao@kernel.org>
> >     f2fs: fix to update iostat correctly in f2fs_filemap_fault()
> >
> > Chao Yu <chao@kernel.org>
> >     f2fs: fix to check compress file in f2fs_move_file_range()
> >
> > Chao Yu <chao@kernel.org>
> >     f2fs: fix to wait on block writeback for post_read case
> >
> > Chris Morgan <macromorgan@hotmail.com>
> >     drm/panel: st7701: Fix AVCL calculation
> >
> > Bjorn Andersson <quic_bjorande@quicinc.com>
> >     drm/msm/adreno: Fix A680 chip id
> >
> > Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> >     media: rkisp1: Fix media device memory leak
> >
> > Mehdi Djait <mehdi.djait@bootlin.com>
> >     media: dt-bindings: media: rkisp1: Fix the port description for the parallel interface
> >
> > Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> >     media: imx-mipi-csis: Drop extra clock enable at probe()
> >
> > Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> >     media: imx-mipi-csis: Fix clock handling in remove()
> >
> > Hans Verkuil <hverkuil-cisco@xs4all.nl>
> >     media: bttv: add back vbi hack
> >
> > Hans Verkuil <hverkuil-cisco@xs4all.nl>
> >     media: bttv: start_streaming should return a proper error code
> >
> > Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
> >     clk: qcom: gpucc-sm8150: Update the gpu_cc_pll1 config
> >
> > Chengchang Tang <tangchengchang@huawei.com>
> >     RDMA/hns: Fix memory leak in free_mr_init()
> >
> > Zhipeng Lu <alexious@zju.edu.cn>
> >     media: cx231xx: fix a memleak in cx231xx_init_isoc
> >
> > Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> >     drm/bridge: tc358767: Fix return value on error case
> >
> > Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> >     drm/bridge: cdns-mhdp8546: Fix use of uninitialized variable
> >
> > Zhipeng Lu <alexious@zju.edu.cn>
> >     drm/radeon/trinity_dpm: fix a memleak in trinity_parse_power_table
> >
> > Zhipeng Lu <alexious@zju.edu.cn>
> >     drm/radeon/dpm: fix a memleak in sumo_parse_power_table
> >
> > Yang Yingliang <yangyingliang@huawei.com>
> >     drm/radeon: check the alloc_workqueue return value in radeon_crtc_init()
> >
> > Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >     drm/msm/dpu: correct clk bit for WB2 block
> >
> > AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> >     drm/panfrost: Ignore core_mask for poweroff and disable PWRTRANS irq
> >
> > Bard Liao <yung-chuan.liao@linux.intel.com>
> >     ASoC: SOF: topology: Use partial match for disconnecting DAI link and DAI widget
> >
> > Bard Liao <yung-chuan.liao@linux.intel.com>
> >     ASoC: Intel: sof_sdw_rt_sdca_jack_common: ctx->headset_codec_dev = NULL
> >
> > Brent Lu <brent.lu@intel.com>
> >     ASoC: Intel: glk_rt5682_max98357a: fix board id mismatch
> >
> > Sebastian Reichel <sre@kernel.org>
> >     media: v4l: async: Fix duplicated list deletion
> >
> > Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >     drm/drv: propagate errors from drm_modeset_register_all()
> >
> > Konrad Dybcio <konrad.dybcio@linaro.org>
> >     drm/msm/dsi: Use pm_runtime_resume_and_get to prevent refcnt leaks
> >
> > Bjorn Andersson <quic_bjorande@quicinc.com>
> >     drm/msm/dpu: Add missing safe_lut_tbl in sc8180x catalog
> >
> > Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >     drm/msm/mdp4: flush vblank event on disable
> >
> > Linus Walleij <linus.walleij@linaro.org>
> >     ASoC: cs35l33: Fix GPIO name and drop legacy include
> >
> > Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >     drm/imx/lcdc: Fix double-free of driver data
> >
> > Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> >     drm/tidss: Fix dss reset
> >
> > Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> >     drm/tidss: Check for K2G in in dispc_softreset()
> >
> > Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> >     drm/tidss: Return error value from from softreset
> >
> > Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> >     drm/tidss: Move reset to the end of dispc_init()
> >
> > Nikita Zhandarovich <n.zhandarovich@fintech.ru>
> >     drm/radeon: check return value of radeon_ring_lock()
> >
> > Nikita Zhandarovich <n.zhandarovich@fintech.ru>
> >     drm/radeon/r100: Fix integer overflow issues in r100_cs_track_check()
> >
> > Nikita Zhandarovich <n.zhandarovich@fintech.ru>
> >     drm/radeon/r600_cs: Fix possible int overflows in r600_cs_check_reg()
> >
> > Chao Yu <chao@kernel.org>
> >     f2fs: fix to avoid dirent corruption
> >
> > Dario Binacchi <dario.binacchi@amarulasolutions.com>
> >     drm/bridge: Fix typo in post_disable() description
> >
> > Alexander Stein <alexander.stein@ew.tq-group.com>
> >     media: amphion: Fix VPU core alias name
> >
> > Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> >     media: rkvdec: Hook the (TRY_)DECODER_CMD stateless ioctls
> >
> > Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> >     media: verisilicon: Hook the (TRY_)DECODER_CMD stateless ioctls
> >
> > Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> >     media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls
> >
> > Zheng Wang <zyytlz.wz@163.com>
> >     media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the crash of multi-core JPEG devices
> >
> > Ricardo B. Marliere <ricardo@marliere.net>
> >     media: pvrusb2: fix use after free on context disconnection
> >
> > Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> >     drm/tilcdc: Fix irq free on unload
> >
> > Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >     drm/bridge: tpd12s015: Drop buggy __exit annotation for remove function
> >
> > Abhinav Singh <singhabhinav9051571833@gmail.com>
> >     drm/nouveau/fence:: fix warning directly dereferencing a rcu pointer
> >
> > Chris Morgan <macromorgan@hotmail.com>
> >     drm/panel-elida-kd35t133: hold panel in reset for unprepare
> >
> > Chris Morgan <macromorgan@hotmail.com>
> >     drm/panel: nv3051d: Hold panel in reset for unprepare
> >
> > Junxian Huang <huangjunxian6@hisilicon.com>
> >     RDMA/hns: Fix inappropriate err code for unsupported operations
> >
> > Leon Romanovsky <leon@kernel.org>
> >     RDMA/usnic: Silence uninitialized symbol smatch warnings
> >
> > AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> >     drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off()
> >
> > Ville Syrjälä <ville.syrjala@linux.intel.com>
> >     drm/dp_mst: Fix fractional DSC bpp handling
> >
> > Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> >     Revert "drm/omapdrm: Annotate dma-fence critical section in commit path"
> >
> > Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> >     Revert "drm/tidss: Annotate dma-fence critical section in commit path"
> >
> > Arnd Bergmann <arnd@arndb.de>
> >     ARM: davinci: always select CONFIG_CPU_ARM926T
> >
> > Eric Dumazet <edumazet@google.com>
> >     ip6_tunnel: fix NEXTHDR_FRAGMENT handling in ip6_tnl_parse_tlv_enc_lim()
> >
> > David Howells <dhowells@redhat.com>
> >     rxrpc: Fix skbuff cleanup of call's recvmsg_queue and rx_oos_queue
> >
> > Asmaa Mnebhi <asmaa@nvidia.com>
> >     mlxbf_gige: Enable the GigE port in mlxbf_gige_open
> >
> > Asmaa Mnebhi <asmaa@nvidia.com>
> >     mlxbf_gige: Fix intermittent no ip issue
> >
> > Tao Liu <taoliu828@163.com>
> >     net/sched: act_ct: fix skb leak and crash on ooo frags
> >
> > Ming Lei <ming.lei@redhat.com>
> >     blk-cgroup: fix rcu lockdep warning in blkg_lookup()
> >
> > Eric Dumazet <edumazet@google.com>
> >     sctp: fix busy polling
> >
> > Eric Dumazet <edumazet@google.com>
> >     sctp: support MSG_ERRQUEUE flag in recvmsg()
> >
> > John Fastabend <john.fastabend@gmail.com>
> >     bpf: sockmap, fix proto update hook to avoid dup calls
> >
> > Benjamin Berg <benjamin.berg@intel.com>
> >     wifi: cfg80211: parse all ML elements in an ML probe response
> >
> > Benjamin Berg <benjamin.berg@intel.com>
> >     wifi: cfg80211: correct comment about MLD ID
> >
> > Andy Yan <andyshrk@163.com>
> >     arm64: dts: rockchip: Fix led pinctrl of lubancat 1
> >
> > Christoph Hellwig <hch@lst.de>
> >     null_blk: don't cap max_hw_sectors to BLK_DEF_MAX_SECTORS
> >
> > Francesco Dolcini <francesco.dolcini@toradex.com>
> >     Bluetooth: btmtkuart: fix recv_buf() return value
> >
> > Francesco Dolcini <francesco.dolcini@toradex.com>
> >     Bluetooth: btnxpuart: fix recv_buf() return value
> >
> > Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> >     Bluetooth: Fix bogus check for re-auth no supported with non-ssp
> >
> > Pablo Neira Ayuso <pablo@netfilter.org>
> >     netfilter: nf_tables: validate chain type update if available
> >
> > Florian Westphal <fw@strlen.de>
> >     netfilter: nf_tables: mark newset as dead on transaction abort
> >
> > Miri Korenblit <miriam.rachel.korenblit@intel.com>
> >     wifi: iwlwifi: assign phy_ctxt before eSR activation
> >
> > Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
> >     wifi: iwlwifi: fix out of bound copy_from_user
> >
> > Johannes Berg <johannes.berg@intel.com>
> >     wifi: iwlwifi: mvm: send TX path flush in rfkill
> >
> > Johannes Berg <johannes.berg@intel.com>
> >     wifi: iwlwifi: mvm: set siso/mimo chains to 1 in FW SMPS request
> >
> > Su Hui <suhui@nfschina.com>
> >     wifi: rtlwifi: rtl8192se: using calculate_bit_shift()
> >
> > Su Hui <suhui@nfschina.com>
> >     wifi: rtlwifi: rtl8192ee: using calculate_bit_shift()
> >
> > Su Hui <suhui@nfschina.com>
> >     wifi: rtlwifi: rtl8192de: using calculate_bit_shift()
> >
> > Su Hui <suhui@nfschina.com>
> >     wifi: rtlwifi: rtl8192ce: using calculate_bit_shift()
> >
> > Su Hui <suhui@nfschina.com>
> >     wifi: rtlwifi: rtl8192cu: using calculate_bit_shift()
> >
> > Su Hui <suhui@nfschina.com>
> >     wifi: rtlwifi: rtl8192c: using calculate_bit_shift()
> >
> > Su Hui <suhui@nfschina.com>
> >     wifi: rtlwifi: rtl8188ee: phy: using calculate_bit_shift()
> >
> > Su Hui <suhui@nfschina.com>
> >     wifi: rtlwifi: add calculate_bit_shift()
> >
> > Hou Tao <houtao1@huawei.com>
> >     bpf: Use c->unit_size to select target cache during free
> >
> > Hou Tao <houtao1@huawei.com>
> >     bpf: Use pcpu_alloc_size() in bpf_mem_free{_rcu}()
> >
> > Hou Tao <houtao1@huawei.com>
> >     bpf: Re-enable unit_size checking for global per-cpu allocator
> >
> > Konrad Dybcio <konrad.dybcio@linaro.org>
> >     arm64: dts: qcom: sc8180x: Fix up PCIe nodes
> >
> > Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >     arm64: dts: qcom: sc8180x: switch PCIe QMP PHY to new style of bindings
> >
> > Konrad Dybcio <konrad.dybcio@linaro.org>
> >     arm64: dts: qcom: sc8180x: Mark PCIe hosts cache-coherent
> >
> > Konrad Dybcio <konrad.dybcio@linaro.org>
> >     arm64: dts: qcom: sm8550: Update idle state time requirements
> >
> > Konrad Dybcio <konrad.dybcio@linaro.org>
> >     arm64: dts: qcom: sm8550: Separate out X3 idle state
> >
> > Chukun Pan <amadeus@jmu.edu.cn>
> >     arm64: dts: qcom: ipq6018: fix clock rates for GCC_USB0_MOCK_UTMI_CLK
> >
> > Konrad Dybcio <konrad.dybcio@linaro.org>
> >     arm64: dts: qcom: sc7280: Mark SDHCI hosts as cache-coherent
> >
> > Li Nan <linan122@huawei.com>
> >     block: add check of 'minors' and 'first_minor' in device_add_disk()
> >
> > Abel Vesa <abel.vesa@linaro.org>
> >     soc: qcom: llcc: Fix LLCC_TRP_ATTR2_CFGn offset
> >
> > Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >     arm64: dts: qcom: sm8150-hdk: fix SS USB regulators
> >
> > Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >     arm64: dts: qcom: sm8150: make dispcc cast minimal vote on MMCX
> >
> > Konrad Dybcio <konrad.dybcio@linaro.org>
> >     arm64: dts: qcom: sm6375: Hook up MPM
> >
> > Johan Hovold <johan+linaro@kernel.org>
> >     arm64: dts: qcom: sm6375: fix USB wakeup interrupt types
> >
> > Atul Dhudase <quic_adhudase@quicinc.com>
> >     soc: qcom: llcc: Fix dis_cap_alloc and retain_on_pc configuration
> >
> > Nikita Travkin <nikita@trvn.ru>
> >     arm64: dts: qcom: acer-aspire1: Correct audio codec definition
> >
> > Hou Tao <houtao1@huawei.com>
> >     bpf: Limit the number of kprobes when attaching program to multiple kprobes
> >
> > Hou Tao <houtao1@huawei.com>
> >     bpf: Limit the number of uprobes when attaching program to multiple uprobes
> >
> > Joakim Zhang <joakim.zhang@cixtech.com>
> >     dma-mapping: clear dev->dma_mem to NULL after freeing it
> >
> > Arseniy Krasnov <avkrasnov@salutedevices.com>
> >     virtio/vsock: send credit update during setting SO_RCVLOWAT
> >
> > Arseniy Krasnov <avkrasnov@salutedevices.com>
> >     virtio/vsock: fix logic which reduces credit update messages
> >
> > Leone Fernando <leone4fernando@gmail.com>
> >     ipmr: support IP_PKTINFO on cache report IGMP msg
> >
> > Hangbin Liu <liuhangbin@gmail.com>
> >     selftests/net: fix grep checking for fib_nexthop_multiprefix
> >
> > Yonghong Song <yonghong.song@linux.dev>
> >     bpf: Fix a race condition between btf_put() and map_free()
> >
> > Ahmad Fatoum <a.fatoum@pengutronix.de>
> >     ARM: dts: stm32: don't mix SCMI and non-SCMI board compatibles
> >
> > Yihang Li <liyihang9@huawei.com>
> >     scsi: hisi_sas: Correct the number of global debugfs registers
> >
> > Yihang Li <liyihang9@huawei.com>
> >     scsi: hisi_sas: Rollback some operations if FLR failed
> >
> > Yihang Li <liyihang9@huawei.com>
> >     scsi: hisi_sas: Check before using pointer variables
> >
> > Yihang Li <liyihang9@huawei.com>
> >     scsi: hisi_sas: Replace with standard error code return value
> >
> > Manivannan Sadhasivam <mani@kernel.org>
> >     scsi: ufs: qcom: Fix the return value when platform_get_resource_byname() fails
> >
> > Manivannan Sadhasivam <mani@kernel.org>
> >     scsi: ufs: qcom: Fix the return value of ufs_qcom_ice_program_key()
> >
> > Adam Ford <aford173@gmail.com>
> >     arm64: dts: imx8mm: Reduce GPU to nominal speed
> >
> > Geert Uytterhoeven <geert+renesas@glider.be>
> >     arm64: dts: renesas: white-hawk-cpu: Fix missing serial console pin control
> >
> > Rob Herring <robh@kernel.org>
> >     arm64: dts: xilinx: Apply overlays to base dtbs
> >
> > Li Nan <linan122@huawei.com>
> >     block: Set memalloc_noio to false on device_add_disk() error path
> >
> > YiFei Zhu <zhuyifei@google.com>
> >     selftests/bpf: Relax time_tai test for equal timestamps in tai_forward
> >
> > Miri Korenblit <miriam.rachel.korenblit@intel.com>
> >     wifi: iwlwifi: don't support triggered EHT CQI feedback
> >
> > Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
> >     wifi: mt76: mt7921: fix country count limitation for CLC
> >
> > Eugen Hristev <eugen.hristev@collabora.com>
> >     arm64: dts: mediatek: mt8186: fix address warning for ADSP mailboxes
> >
> > Chen-Yu Tsai <wenst@chromium.org>
> >     arm64: dts: mediatek: mt8186: Fix alias prefix for ovl_2l0
> >
> > Moudy Ho <moudy.ho@mediatek.com>
> >     arm64: dts: mediatek: mt8195: revise VDOSYS RDMA node name
> >
> > Moudy Ho <moudy.ho@mediatek.com>
> >     arm64: dts: mediatek: mt8183: correct MDP3 DMA-related nodes
> >
> > Moudy Ho <moudy.ho@mediatek.com>
> >     dt-bindings: media: mediatek: mdp3: correct RDMA and WROT node with generic names
> >
> > Andrei Matei <andreimatei1@gmail.com>
> >     bpf: Fix accesses to uninit stack slots
> >
> > Andrei Matei <andreimatei1@gmail.com>
> >     bpf: Guard stack limits against 32bit overflow
> >
> > Johan Hovold <johan+linaro@kernel.org>
> >     arm64: dts: hisilicon: hikey970-pmic: fix regulator cells properties
> >
> > Andrei Matei <andreimatei1@gmail.com>
> >     bpf: Fix verification of indirect var-off stack access
> >
> > Wang Zhao <wang.zhao@mediatek.com>
> >     wifi: mt76: mt7921s: fix workqueue problem causes STA association fail
> >
> > StanleyYP Wang <StanleyYP.Wang@mediatek.com>
> >     wifi: mt76: mt7915: also MT7981 is 3T3R but nss2 on 5 GHz band
> >
> > StanleyYP Wang <StanleyYP.Wang@mediatek.com>
> >     wifi: mt76: mt7915: fix EEPROM offset of TSSI flag on MT7981
> >
> > MeiChia Chiu <meichia.chiu@mediatek.com>
> >     wifi: mt76: mt7996: fix rate usage of inband discovery frames
> >
> > Sujuan Chen <sujuan.chen@mediatek.com>
> >     wifi: mt76: mt7996: fix the size of struct bss_rate_tlv
> >
> > Lorenzo Bianconi <lorenzo@kernel.org>
> >     wifi: mt76: mt7915: fallback to non-wed mode if platform_get_resource fails in mt7915_mmio_wed_init()
> >
> > Christian Marangi <ansuelsmth@gmail.com>
> >     wifi: mt76: fix typo in mt76_get_of_eeprom_from_nvmem function
> >
> > Johan Hovold <johan+linaro@kernel.org>
> >     arm64: dts: qcom: sm8550: fix USB wakeup interrupt types
> >
> > Johan Hovold <johan+linaro@kernel.org>
> >     arm64: dts: qcom: sc7280: fix usb_2 wakeup interrupt types
> >
> > Johan Hovold <johan+linaro@kernel.org>
> >     arm64: dts: qcom: sa8775p: fix USB wakeup interrupt types
> >
> > Konrad Dybcio <konrad.dybcio@linaro.org>
> >     arm64: dts: qcom: sc7280: Mark Adreno SMMU as DMA coherent
> >
> > Konrad Dybcio <konrad.dybcio@linaro.org>
> >     arm64: dts: qcom: sc7280: Fix up GPU SIDs
> >
> > Nia Espera <nespera@igalia.com>
> >     arm64: dts: qcom: sm8350: Fix DMA0 address
> >
> > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >     arm64: dts: qcom: sm6125: add interrupts to DWC3 USB controller
> >
> > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >     arm64: dts: qcom: sdm845-db845c: correct LED panic indicator
> >
> > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >     arm64: dts: qcom: qrb5165-rb5: correct LED panic indicator
> >
> > Caleb Connolly <caleb.connolly@linaro.org>
> >     arm64: dts: qcom: qrb2210-rb1: use USB host mode
> >
> > Konrad Dybcio <konrad.dybcio@linaro.org>
> >     arm64: dts: qcom: qrb2210-rb1: Hook up USB3
> >
> > Artem Chernyshev <artem.chernyshev@red-soft.ru>
> >     scsi: fnic: Return error if vmalloc() failed
> >
> > Andrii Nakryiko <andrii@kernel.org>
> >     bpf: fix check for attempt to corrupt spilled pointer
> >
> > Hangbin Liu <liuhangbin@gmail.com>
> >     selftests/net: specify the interface when do arping
> >
> > Hou Tao <houtao1@huawei.com>
> >     bpf: Defer the free of inner map when necessary
> >
> > Hou Tao <houtao1@huawei.com>
> >     bpf: Add map and need_defer parameters to .map_fd_put_ptr()
> >
> > Douglas Anderson <dianders@chromium.org>
> >     arm64: dts: qcom: sm6350: Make watchdog bark interrupt edge triggered
> >
> > Douglas Anderson <dianders@chromium.org>
> >     arm64: dts: qcom: sc8280xp: Make watchdog bark interrupt edge triggered
> >
> > Douglas Anderson <dianders@chromium.org>
> >     arm64: dts: qcom: sa8775p: Make watchdog bark interrupt edge triggered
> >
> > Douglas Anderson <dianders@chromium.org>
> >     arm64: dts: qcom: sm8250: Make watchdog bark interrupt edge triggered
> >
> > Douglas Anderson <dianders@chromium.org>
> >     arm64: dts: qcom: sm8150: Make watchdog bark interrupt edge triggered
> >
> > Douglas Anderson <dianders@chromium.org>
> >     arm64: dts: qcom: sdm845: Make watchdog bark interrupt edge triggered
> >
> > Douglas Anderson <dianders@chromium.org>
> >     arm64: dts: qcom: sc7280: Make watchdog bark interrupt edge triggered
> >
> > Luca Weiss <luca.weiss@fairphone.com>
> >     arm64: dts: qcom: sc7280: Mark some nodes as 'reserved'
> >
> > Douglas Anderson <dianders@chromium.org>
> >     arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered
> >
> > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >     arm64: dts: qcom: sm8550: correct TX Soundwire clock
> >
> > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >     arm64: dts: qcom: sm8450: correct TX Soundwire clock
> >
> > Bjorn Andersson <quic_bjorande@quicinc.com>
> >     arm64: dts: qcom: sc8180x-primus: Fix HALL_INT polarity
> >
> > Stephen Boyd <swboyd@chromium.org>
> >     dt-bindings: arm: qcom: Fix html link
> >
> > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >     ARM: dts: qcom: sdx65: correct SPMI node name
> >
> > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >     ARM: dts: qcom: sdx65: correct PCIe EP phy-names
> >
> > Andrii Nakryiko <andrii@kernel.org>
> >     bpf: enforce precision of R0 on callback return
> >
> > Yu Kuai <yukuai3@huawei.com>
> >     md: synchronize flush io with array reconfiguration
> >
> > Jeroen van Ingen Schenau <jeroen.vaningenschenau@novoserve.com>
> >     selftests/bpf: Fix erroneous bitmask operation
> >
> > Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> >     wifi: rtw88: sdio: Honor the host max_req_size in the RX path
> >
> > Jan Kiszka <jan.kiszka@siemens.com>
> >     arm64: dts: ti: iot2050: Re-add aliases
> >
> > Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> >     arm64: dts: ti: k3-am65-main: Fix DSS irq trigger type
> >
> > Nitin Yadav <n-yadav@ti.com>
> >     arm64: dts: ti: k3-am62a-main: Fix GPIO pin count in DT nodes
> >
> > Su Hui <suhui@nfschina.com>
> >     wifi: rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior
> >
> > Bart Van Assche <bvanassche@acm.org>
> >     scsi: bfa: Use the proper data type for BLIST flags
> >
> > Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> >     firmware: ti_sci: Fix an off-by-one in ti_sci_debugfs_create()
> >
> > Peter Delevoryas <peter@pjd.dev>
> >     net/ncsi: Fix netlink major/minor version numbers
> >
> > Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >     ARM: dts: qcom: apq8064: correct XOADC register address
> >
> > Arnd Bergmann <arnd@arndb.de>
> >     wifi: libertas: stop selecting wext
> >
> > Luca Weiss <luca.weiss@fairphone.com>
> >     wifi: ath11k: Defer on rproc_get failure
> >
> > Jordan Rome <jordalgo@meta.com>
> >     bpf: Add crosstask check to __bpf_get_stack
> >
> > Florian Lehner <dev@der-flo.net>
> >     bpf, lpm: Fix check prefixlen before walking trie
> >
> > Chih-Kang Chang <gary.chang@realtek.com>
> >     wifi: rtw88: fix RX filter in FIF_ALLMULTI flag
> >
> > Dan Carpenter <dan.carpenter@linaro.org>
> >     wifi: plfxlc: check for allocation failure in plfxlc_usb_wreq_async()
> >
> > Luca Weiss <luca@z3ntu.xyz>
> >     ARM: dts: qcom: msm8226: provide dsi phy clocks to mmcc
> >
> > Johan Hovold <johan+linaro@kernel.org>
> >     arm64: dts: qcom: sc8280xp-x13s: add missing camera LED pin config
> >
> > Konrad Dybcio <konrad.dybcio@linaro.org>
> >     arm64: dts: qcom: sc8280xp-x13s: Use the correct DP PHY compatible
> >
> > Caleb Connolly <caleb.connolly@linaro.org>
> >     arm64: dts: qcom: qrb4210-rb2: don't force usb peripheral mode
> >
> > David McKay <david.mckay@codasip.com>
> >     asm-generic: Fix 32 bit __generic_cmpxchg_local
> >
> > Trond Myklebust <trond.myklebust@hammerspace.com>
> >     pNFS: Fix the pnfs block driver's calculation of layoutget size
> >
> > Olga Kornievskaia <kolga@netapp.com>
> >     SUNRPC: fix _xprt_switch_find_current_entry logic
> >
> > Trond Myklebust <trond.myklebust@hammerspace.com>
> >     NFSv4.1/pnfs: Ensure we handle the error NFS4ERR_RETURNCONFLICT
> >
> > Scott Mayhew <smayhew@redhat.com>
> >     NFS: Use parent's objective cred in nfs_access_login_time()
> >
> > Benjamin Coddington <bcodding@redhat.com>
> >     blocklayoutdriver: Fix reference leak of pnfs_device_node
> >
> > Arnd Bergmann <arnd@arndb.de>
> >     csky: fix arch_jump_label_transform_static override
> >
> > Chengming Zhou <zhouchengming@bytedance.com>
> >     crypto: scomp - fix req->dst buffer overflow
> >
> > Ovidiu Panait <ovidiu.panait@windriver.com>
> >     crypto: sahara - do not resize req->src when doing hash operations
> >
> > Ovidiu Panait <ovidiu.panait@windriver.com>
> >     crypto: sahara - fix processing hash requests with req->nbytes < sg->length
> >
> > Ovidiu Panait <ovidiu.panait@windriver.com>
> >     crypto: sahara - improve error handling in sahara_sha_process()
> >
> > Ovidiu Panait <ovidiu.panait@windriver.com>
> >     crypto: sahara - fix wait_for_completion_timeout() error handling
> >
> > Ovidiu Panait <ovidiu.panait@windriver.com>
> >     crypto: sahara - fix ahash reqsize
> >
> > Ovidiu Panait <ovidiu.panait@windriver.com>
> >     crypto: sahara - handle zero-length aes requests
> >
> > Ovidiu Panait <ovidiu.panait@windriver.com>
> >     crypto: sahara - avoid skcipher fallback code duplication
> >
> > wangyangxin <wangyangxin1@huawei.com>
> >     crypto: virtio - Wait for tasklet to complete on device remove
> >
> > Alexander Aring <aahringo@redhat.com>
> >     dlm: fix format seq ops type 4
> >
> > Edward Adam Davis <eadavis@qq.com>
> >     gfs2: fix kernel BUG in gfs2_quota_cleanup
> >
> > Osama Muhammad <osmtendev@gmail.com>
> >     gfs2: Fix kernel NULL pointer dereference in gfs2_rgrp_dump
> >
> > Christian Brauner <brauner@kernel.org>
> >     fs: indicate request originates from old mount API
> >
> > Gao Xiang <xiang@kernel.org>
> >     erofs: fix memory leak on short-lived bounced pages
> >
> > Sergey Shtylyov <s.shtylyov@omp.ru>
> >     pstore: ram_core: fix possible overflow in persistent_ram_init_ecc()
> >
> > Zhiqi Song <songzhiqi1@huawei.com>
> >     crypto: hisilicon/zip - save capability registers in probe process
> >
> > Zhiqi Song <songzhiqi1@huawei.com>
> >     crypto: hisilicon/sec2 - save capability registers in probe process
> >
> > Zhiqi Song <songzhiqi1@huawei.com>
> >     crypto: hisilicon/hpre - save capability registers in probe process
> >
> > Wenkai Lin <linwenkai6@hisilicon.com>
> >     crypto: hisilicon/qm - add a function to set qm algs
> >
> > Chenghai Huang <huangchenghai2@huawei.com>
> >     crypto: hisilicon/zip - add zip comp high perf mode configuration
> >
> > Zhiqi Song <songzhiqi1@huawei.com>
> >     crypto: hisilicon/qm - save capability registers in qm init process
> >
> > Ovidiu Panait <ovidiu.panait@windriver.com>
> >     crypto: sahara - fix error handling in sahara_hw_descriptor_create()
> >
> > Ovidiu Panait <ovidiu.panait@windriver.com>
> >     crypto: sahara - fix processing requests with cryptlen < sg->length
> >
> > Ovidiu Panait <ovidiu.panait@windriver.com>
> >     crypto: sahara - fix ahash selftest failure
> >
> > Ovidiu Panait <ovidiu.panait@windriver.com>
> >     crypto: sahara - fix cbc selftest failure
> >
> > Ovidiu Panait <ovidiu.panait@windriver.com>
> >     crypto: sahara - remove FLAGS_NEW_KEY logic
> >
> > Nikita Zhandarovich <n.zhandarovich@fintech.ru>
> >     crypto: safexcel - Add error handling for dma_map_sg() calls
> >
> > Herbert Xu <herbert@gondor.apana.org.au>
> >     crypto: af_alg - Disallow multiple in-flight AIO requests
> >
> > Dinghao Liu <dinghao.liu@zju.edu.cn>
> >     crypto: ccp - fix memleak in ccp_init_dm_workarea
> >
> > Chen Ni <nichen@iscas.ac.cn>
> >     crypto: sa2ul - Return crypto_aead_setkey to transfer the error
> >
> > Gonglei (Arei) <arei.gonglei@huawei.com>
> >     crypto: virtio - Handle dataq logic with tasklet
> >
> > Chanho Park <chanho61.park@samsung.com>
> >     crypto: jh7110 - Correct deferred probe return
> >
> > Dan Carpenter <dan.carpenter@linaro.org>
> >     crypto: rsa - add a check for allocation failure
> >
> > Mickaël Salaün <mic@digikod.net>
> >     selinux: Fix error priority for bind with AF_UNSPEC on PF_INET6 socket
> >
> > Binbin Zhou <zhoubinbin@loongson.cn>
> >     drivers/thermal/loongson2_thermal: Fix incorrect PTR_ERR() judgment
> >
> > Borislav Petkov (AMD) <bp@alien8.de>
> >     cpuidle: haltpoll: Do not enable interrupts when entering idle
> >
> > ZhaoLong Wang <wangzhaolong1@huawei.com>
> >     mtd: Fix gluebi NULL pointer dereference caused by ftl notifier
> >
> > Richard Fitzgerald <rf@opensource.cirrus.com>
> >     kunit: debugfs: Fix unchecked dereference in debugfs_print_results()
> >
> > Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >     thermal: core: Fix NULL pointer dereference in zone registration error path
> >
> > Tony Luck <tony.luck@intel.com>
> >     ACPI: extlog: Clear Extended Error Log status when RAS_CEC handled the error
> >
> > Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >     ACPI: LPSS: Fix the fractional clock divider flags
> >
> > Wolfram Sang <wsa+renesas@sang-engineering.com>
> >     spi: sh-msiof: Enforce fixed DTDL for R-Car H3
> >
> > Ard Biesheuvel <ardb@kernel.org>
> >     efivarfs: Free s_fs_info on unmount
> >
> > Ilias Apalodimas <ilias.apalodimas@linaro.org>
> >     efivarfs: force RO when remounting if SetVariable is not supported
> >
> > Gavrilov Ilia <Ilia.Gavrilov@infotecs.ru>
> >     calipso: fix memory leak in netlbl_calipso_add_pass()
> >
> > Alexandra Diupina <adiupina@astralinux.ru>
> >     cpufreq: scmi: process the result of devm_of_clk_add_hw_provider()
> >
> > David E. Box <david.e.box@linux.intel.com>
> >     platform/x86/intel/vsec: Fix xa_alloc memory leak
> >
> > Yang Yingliang <yangyingliang@huawei.com>
> >     spi: cadence-quadspi: add missing clk_disable_unprepare() in cqspi_probe()
> >
> > Chen Ni <nichen@iscas.ac.cn>
> >     KEYS: encrypted: Add check for strsep
> >
> > Nikita Kiryushin <kiryushin@ancud.ru>
> >     ACPI: LPIT: Avoid u32 multiplication overflow
> >
> > Nikita Kiryushin <kiryushin@ancud.ru>
> >     ACPI: video: check for error while searching for backlight device parent
> >
> > Ronald Monthero <debug.penguin32@gmail.com>
> >     mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response
> >
> > Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
> >     spi: spi-zynqmp-gqspi: fix driver kconfig dependencies
> >
> > Alexander Antonov <alexander.antonov@linux.intel.com>
> >     perf/x86/intel/uncore: Fix NULL pointer dereference issue in upi_fill_topology()
> >
> > Yiwei Lin <s921975628@gmail.com>
> >     sched/fair: Update min_vruntime for reweight_entity() correctly
> >
> > Kunwu Chan <chentao@kylinos.cn>
> >     powerpc/imc-pmu: Add a null pointer check in update_events_in_group()
> >
> > Kunwu Chan <chentao@kylinos.cn>
> >     powerpc/powernv: Add a null pointer check in opal_powercap_init()
> >
> > Kunwu Chan <chentao@kylinos.cn>
> >     powerpc/powernv: Add a null pointer check in opal_event_init()
> >
> > Kunwu Chan <chentao@kylinos.cn>
> >     powerpc/powernv: Add a null pointer check to scom_debug_init_one()
> >
> > Nathan Lynch <nathanl@linux.ibm.com>
> >     powerpc/rtas: Avoid warning on invalid token argument to sys_rtas()
> >
> > Kajol Jain <kjain@linux.ibm.com>
> >     powerpc/hv-gpci: Add return value check in affinity_domain_via_partition_show function
> >
> > Michael Ellerman <mpe@ellerman.id.au>
> >     selftests/powerpc: Fix error handling in FPU/VMX preemption tests
> >
> > Nicholas Piggin <npiggin@gmail.com>
> >     KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE
> >
> > Jordan Niethe <jniethe5@gmail.com>
> >     KVM: PPC: Book3S HV: Introduce low level MSR accessor
> >
> > Jordan Niethe <jniethe5@gmail.com>
> >     KVM: PPC: Book3S HV: Use accessors for VCPU registers
> >
> > Junhao He <hejunhao3@huawei.com>
> >     drivers/perf: hisi: Fix some event id for HiSilicon UC pmu
> >
> > Robin Murphy <robin.murphy@arm.com>
> >     perf/arm-cmn: Fix HN-F class_occup_id events
> >
> > Nathan Lynch <nathanl@linux.ibm.com>
> >     powerpc/pseries/memhp: Fix access beyond end of drmem array
> >
> > Randy Dunlap <rdunlap@infradead.org>
> >     powerpc/44x: select I2C for CURRITUCK
> >
> > Peter Zijlstra <peterz@infradead.org>
> >     x86: Fix CPUIDLE_FLAG_IRQ_ENABLE leaking timer reprogram
> >
> > Masahiro Yamada <masahiroy@kernel.org>
> >     powerpc: add crtsavres.o to always-y instead of extra-y
> >
> > Arnd Bergmann <arnd@arndb.de>
> >     EDAC/thunderx: Fix possible out-of-bounds string access
> >
> > Yazen Ghannam <yazen.ghannam@amd.com>
> >     x86/mce/inject: Clear test status value
> >
> > Colin Ian King <colin.i.king@gmail.com>
> >     x86/lib: Fix overflow when counting digits
> >
> >
> > -------------
> >
> > Diffstat:
> >
> >  Documentation/devicetree/bindings/arm/qcom.yaml    |   2 +-
> >  .../devicetree/bindings/gpio/xlnx,gpio-xilinx.yaml |   2 +-
> >  .../bindings/media/mediatek,mdp3-rdma.yaml         |  29 +-
> >  .../bindings/media/mediatek,mdp3-wrot.yaml         |  23 +-
> >  .../devicetree/bindings/media/rockchip-isp1.yaml   |  11 +-
> >  .../phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml         |   4 +-
> >  Documentation/driver-api/pci/p2pdma.rst            |  16 +-
> >  Makefile                                           |   4 +-
> >  arch/arm/boot/dts/qcom/qcom-apq8064.dtsi           |   2 +-
> >  arch/arm/boot/dts/qcom/qcom-msm8226.dtsi           |   4 +-
> >  arch/arm/boot/dts/qcom/qcom-sdx65.dtsi             |   4 +-
> >  arch/arm/boot/dts/st/stm32mp157a-dk1-scmi.dts      |   2 +-
> >  arch/arm/boot/dts/st/stm32mp157c-dk2-scmi.dts      |   2 +-
> >  arch/arm/boot/dts/st/stm32mp157c-ed1-scmi.dts      |   2 +-
> >  arch/arm/boot/dts/st/stm32mp157c-ev1-scmi.dts      |   3 +-
> >  arch/arm/mach-davinci/Kconfig                      |   2 +
> >  arch/arm64/boot/dts/freescale/imx8mm.dtsi          |   4 +-
> >  arch/arm64/boot/dts/hisilicon/hikey970-pmic.dtsi   |   3 -
> >  arch/arm64/boot/dts/mediatek/mt8183.dtsi           |   6 +-
> >  arch/arm64/boot/dts/mediatek/mt8186.dtsi           |   6 +-
> >  arch/arm64/boot/dts/mediatek/mt8195.dtsi           |  24 +-
> >  arch/arm64/boot/dts/qcom/ipq6018.dtsi              |   2 +-
> >  arch/arm64/boot/dts/qcom/qrb2210-rb1.dts           |  10 +
> >  arch/arm64/boot/dts/qcom/qrb4210-rb2.dts           |   1 -
> >  arch/arm64/boot/dts/qcom/qrb5165-rb5.dts           |   2 +-
> >  arch/arm64/boot/dts/qcom/sa8775p.dtsi              |  14 +-
> >  arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts   |  17 +-
> >  arch/arm64/boot/dts/qcom/sc7180.dtsi               |   2 +-
> >  arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi |  24 ++
> >  arch/arm64/boot/dts/qcom/sc7280.dtsi               |  20 +-
> >  arch/arm64/boot/dts/qcom/sc8180x-primus.dts        |   2 +-
> >  arch/arm64/boot/dts/qcom/sc8180x.dtsi              | 152 ++++------
> >  .../dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts     |  11 +
> >  arch/arm64/boot/dts/qcom/sc8280xp.dtsi             |   2 +-
> >  arch/arm64/boot/dts/qcom/sdm845-db845c.dts         |   2 +-
> >  arch/arm64/boot/dts/qcom/sdm845.dtsi               |   2 +-
> >  arch/arm64/boot/dts/qcom/sm6125.dtsi               |   4 +
> >  arch/arm64/boot/dts/qcom/sm6350.dtsi               |   2 +-
> >  arch/arm64/boot/dts/qcom/sm6375.dtsi               |  41 ++-
> >  arch/arm64/boot/dts/qcom/sm8150-hdk.dts            |  12 +-
> >  arch/arm64/boot/dts/qcom/sm8150.dtsi               |   3 +-
> >  arch/arm64/boot/dts/qcom/sm8250.dtsi               |   2 +-
> >  arch/arm64/boot/dts/qcom/sm8350.dtsi               |   4 +-
> >  arch/arm64/boot/dts/qcom/sm8450.dtsi               |   2 +-
> >  arch/arm64/boot/dts/qcom/sm8550.dtsi               |  38 ++-
> >  .../boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi  |   3 +
> >  arch/arm64/boot/dts/rockchip/rk3566-lubancat-1.dts |   2 +-
> >  arch/arm64/boot/dts/ti/k3-am62a-main.dtsi          |   4 +-
> >  arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi |  10 +
> >  arch/arm64/boot/dts/ti/k3-am65-main.dtsi           |   2 +-
> >  arch/arm64/boot/dts/xilinx/Makefile                |   9 +-
> >  arch/arm64/kernel/ptrace.c                         |  13 +-
> >  arch/arm64/kvm/vgic/vgic-its.c                     |   5 +
> >  arch/arm64/kvm/vgic/vgic-mmio-v3.c                 |  27 +-
> >  arch/csky/include/asm/jump_label.h                 |   5 +
> >  arch/loongarch/include/asm/elf.h                   |   5 -
> >  arch/loongarch/kernel/elf.c                        |   5 -
> >  arch/loongarch/kernel/process.c                    |   1 +
> >  arch/loongarch/net/bpf_jit.c                       |   5 +-
> >  arch/mips/alchemy/devboards/db1200.c               |   2 +-
> >  arch/mips/alchemy/devboards/db1550.c               |   2 +-
> >  arch/mips/include/asm/dmi.h                        |   2 +-
> >  arch/mips/kernel/setup.c                           |   4 +-
> >  arch/mips/kernel/smp.c                             |   4 +-
> >  arch/powerpc/Kconfig                               |   1 +
> >  arch/powerpc/kernel/rtas.c                         |  19 +-
> >  arch/powerpc/kvm/book3s_64_mmu_hv.c                |   5 +-
> >  arch/powerpc/kvm/book3s_64_mmu_radix.c             |   5 +-
> >  arch/powerpc/kvm/book3s_hv.c                       | 198 ++++++------
> >  arch/powerpc/kvm/book3s_hv.h                       |  68 +++++
> >  arch/powerpc/kvm/book3s_hv_builtin.c               |   5 +-
> >  arch/powerpc/lib/Makefile                          |   2 +-
> >  arch/powerpc/perf/hv-gpci.c                        |   3 +
> >  arch/powerpc/perf/imc-pmu.c                        |   6 +
> >  arch/powerpc/platforms/44x/Kconfig                 |   1 +
> >  arch/powerpc/platforms/powernv/opal-irqchip.c      |   2 +
> >  arch/powerpc/platforms/powernv/opal-powercap.c     |   6 +
> >  arch/powerpc/platforms/powernv/opal-xscom.c        |   5 +
> >  arch/powerpc/platforms/pseries/hotplug-memory.c    |   9 +-
> >  arch/riscv/include/asm/sections.h                  |   1 +
> >  arch/riscv/include/asm/xip_fixup.h                 |   2 +-
> >  arch/riscv/kernel/module.c                         |   3 +-
> >  arch/riscv/kernel/patch.c                          |  11 +-
> >  arch/riscv/kernel/vmlinux-xip.lds.S                |   2 +
> >  arch/riscv/kernel/vmlinux.lds.S                    |   2 +
> >  arch/riscv/mm/pageattr.c                           | 275 ++++++++++++++---
> >  arch/s390/include/asm/pci_io.h                     |  32 +-
> >  arch/s390/pci/pci_mmio.c                           |  12 +-
> >  arch/um/drivers/virt-pci.c                         |   2 +-
> >  arch/x86/events/intel/uncore_snbep.c               |  10 +-
> >  arch/x86/include/asm/kvm-x86-pmu-ops.h             |   2 +-
> >  arch/x86/include/asm/mwait.h                       |  11 +-
> >  arch/x86/kernel/cpu/mce/inject.c                   |   1 +
> >  arch/x86/kernel/kvmclock.c                         |  12 +-
> >  arch/x86/kvm/pmu.c                                 |  63 +++-
> >  arch/x86/kvm/pmu.h                                 |  18 --
> >  arch/x86/kvm/svm/nested.c                          |  15 -
> >  arch/x86/kvm/svm/pmu.c                             |  16 -
> >  arch/x86/kvm/vmx/pmu_intel.c                       |  20 --
> >  arch/x86/lib/misc.c                                |   2 +-
> >  arch/x86/pci/mmconfig-shared.c                     |  13 +-
> >  block/bio.c                                        |  46 +--
> >  block/blk-cgroup.h                                 |   3 +-
> >  block/blk-mq.c                                     |  16 +-
> >  block/genhd.c                                      |   5 +-
> >  block/ioctl.c                                      |  11 +-
> >  crypto/af_alg.c                                    |  14 +-
> >  crypto/rsa.c                                       |   2 +
> >  crypto/scompress.c                                 |   6 +
> >  drivers/accel/habanalabs/common/habanalabs_ioctl.c |   2 +-
> >  drivers/acpi/acpi_extlog.c                         |   7 +-
> >  drivers/acpi/acpi_lpit.c                           |   2 +-
> >  drivers/acpi/acpi_lpss.c                           |   3 +-
> >  drivers/acpi/acpi_video.c                          |  12 +-
> >  drivers/acpi/property.c                            |   4 +
> >  drivers/android/binder_alloc.c                     |  22 +-
> >  drivers/base/class.c                               |   1 +
> >  drivers/base/node.c                                |   9 +-
> >  drivers/base/swnode.c                              |   3 +
> >  drivers/block/loop.c                               |  52 ++--
> >  drivers/block/null_blk/main.c                      |  12 +-
> >  drivers/bluetooth/btmtkuart.c                      |  11 +-
> >  drivers/bluetooth/btnxpuart.c                      |   7 +-
> >  drivers/bus/mhi/ep/main.c                          | 139 ++++++---
> >  drivers/bus/mhi/ep/ring.c                          |  41 +--
> >  drivers/clk/clk-renesas-pcie.c                     |   2 +-
> >  drivers/clk/clk-si5341.c                           |   4 +-
> >  drivers/clk/clk-sp7021.c                           |  12 +-
> >  drivers/clk/qcom/dispcc-sm8550.c                   |   8 +
> >  drivers/clk/qcom/gcc-sm8550.c                      | 110 +++----
> >  drivers/clk/qcom/gpucc-sm8150.c                    |   4 +-
> >  drivers/clk/qcom/videocc-sm8150.c                  |   5 +
> >  drivers/clk/renesas/rzg2l-cpg.c                    |  91 +++---
> >  drivers/clk/zynqmp/clk-mux-zynqmp.c                |   2 +-
> >  drivers/clk/zynqmp/divider.c                       |  66 +---
> >  drivers/clocksource/timer-ti-dm.c                  |   4 +-
> >  drivers/cpufreq/scmi-cpufreq.c                     |   7 +-
> >  drivers/cpuidle/cpuidle-haltpoll.c                 |   9 +-
> >  drivers/crypto/ccp/ccp-ops.c                       |   5 +-
> >  drivers/crypto/hisilicon/hpre/hpre_main.c          | 122 ++++----
> >  drivers/crypto/hisilicon/qm.c                      |  98 +++++-
> >  drivers/crypto/hisilicon/sec2/sec.h                |   7 +
> >  drivers/crypto/hisilicon/sec2/sec_crypto.c         |  13 +-
> >  drivers/crypto/hisilicon/sec2/sec_main.c           |  70 +++--
> >  drivers/crypto/hisilicon/zip/zip_main.c            | 175 ++++++++---
> >  drivers/crypto/inside-secure/safexcel_cipher.c     |  19 +-
> >  drivers/crypto/sa2ul.c                             |   3 +-
> >  drivers/crypto/sahara.c                            | 248 +++++++--------
> >  drivers/crypto/starfive/jh7110-cryp.c              |  10 +-
> >  drivers/crypto/virtio/virtio_crypto_common.h       |   2 +
> >  drivers/crypto/virtio/virtio_crypto_core.c         |  26 +-
> >  drivers/cxl/core/port.c                            |  24 +-
> >  drivers/cxl/core/region.c                          |   2 +-
> >  drivers/cxl/cxl.h                                  |   2 -
> >  drivers/edac/thunderx_edac.c                       |  10 +-
> >  drivers/firmware/ti_sci.c                          |  10 +-
> >  drivers/gpio/gpio-mlxbf3.c                         |   2 +
> >  drivers/gpio/gpiolib-sysfs.c                       |   2 +-
> >  drivers/gpio/gpiolib.c                             |  95 ++++--
> >  drivers/gpio/gpiolib.h                             |  10 -
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c        |   4 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c            |   2 +
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c            |   7 +-
> >  drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c       |  26 +-
> >  drivers/gpu/drm/amd/amdkfd/kfd_migrate.c           |   6 +-
> >  drivers/gpu/drm/amd/amdkfd/kfd_priv.h              |   2 +-
> >  drivers/gpu/drm/amd/amdkfd/kfd_topology.c          |  21 +-
> >  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |   2 +-
> >  .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c    |   2 +-
> >  .../display/dc/link/protocols/link_dp_training.c   |   2 +-
> >  .../display/dc/link/protocols/link_dp_training.h   |   2 +-
> >  drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c         |   4 +-
> >  drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c     |  52 +---
> >  drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c         |   5 +-
> >  .../gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c    |   6 +-
> >  .../gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c    |   3 +-
> >  drivers/gpu/drm/bridge/tc358767.c                  |   2 +-
> >  drivers/gpu/drm/bridge/ti-tpd12s015.c              |   4 +-
> >  drivers/gpu/drm/display/drm_dp_mst_topology.c      |  20 +-
> >  drivers/gpu/drm/drm_drv.c                          |  10 +-
> >  drivers/gpu/drm/i915/display/intel_dp_mst.c        |   5 +-
> >  drivers/gpu/drm/imx/lcdc/imx-lcdc.c                |   9 -
> >  drivers/gpu/drm/mediatek/mtk_disp_merge.c          |   2 +-
> >  drivers/gpu/drm/mediatek/mtk_dp.c                  |   1 +
> >  drivers/gpu/drm/mediatek/mtk_dpi.c                 |  16 +-
> >  drivers/gpu/drm/mediatek/mtk_mdp_rdma.c            |   3 +-
> >  drivers/gpu/drm/msm/adreno/adreno_device.c         |   2 +-
> >  .../drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h    |   1 +
> >  .../gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h |   2 +-
> >  .../gpu/drm/msm/disp/dpu1/catalog/dpu_6_2_sc7180.h |   2 +-
> >  .../gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h |   2 +-
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c           |   4 +-
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c        |   4 +-
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c        |   6 +-
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h        |   4 +-
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c          |   6 +-
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h          |   3 +-
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c        |  20 +-
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h        |   8 +-
> >  drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c          |   9 +
> >  drivers/gpu/drm/msm/dsi/phy/dsi_phy.c              |   4 +-
> >  drivers/gpu/drm/nouveau/dispnv50/disp.c            |   3 +-
> >  drivers/gpu/drm/nouveau/nv04_fence.c               |   2 +-
> >  drivers/gpu/drm/omapdrm/omap_drv.c                 |   9 +-
> >  drivers/gpu/drm/panel/panel-elida-kd35t133.c       |   2 +
> >  drivers/gpu/drm/panel/panel-newvision-nv3051d.c    |   2 +
> >  drivers/gpu/drm/panel/panel-sitronix-st7701.c      |   2 +-
> >  drivers/gpu/drm/panfrost/panfrost_gpu.c            |  70 +++--
> >  drivers/gpu/drm/radeon/r100.c                      |   4 +-
> >  drivers/gpu/drm/radeon/r600_cs.c                   |   4 +-
> >  drivers/gpu/drm/radeon/radeon_display.c            |   7 +-
> >  drivers/gpu/drm/radeon/radeon_vm.c                 |   8 +-
> >  drivers/gpu/drm/radeon/si.c                        |   4 +
> >  drivers/gpu/drm/radeon/sumo_dpm.c                  |   4 +-
> >  drivers/gpu/drm/radeon/trinity_dpm.c               |   4 +-
> >  drivers/gpu/drm/tests/drm_dp_mst_helper_test.c     |   6 +-
> >  drivers/gpu/drm/tidss/tidss_dispc.c                |  63 +++-
> >  drivers/gpu/drm/tidss/tidss_kms.c                  |   4 -
> >  drivers/gpu/drm/tilcdc/tilcdc_drv.c                |   2 +-
> >  drivers/hid/hid-sensor-hub.c                       |   2 +-
> >  drivers/hid/wacom_wac.c                            |  32 +-
> >  drivers/i2c/busses/i2c-s3c2410.c                   |  40 +--
> >  drivers/idle/intel_idle.c                          |  19 +-
> >  drivers/iio/adc/ad7091r-base.c                     |   6 +-
> >  drivers/iio/adc/ad9467.c                           | 112 +++++--
> >  drivers/iio/adc/adi-axi-adc.c                      |  74 +----
> >  drivers/infiniband/hw/hns/hns_roce_hw_v2.c         |   6 +-
> >  drivers/infiniband/hw/hns/hns_roce_pd.c            |   2 +-
> >  drivers/infiniband/hw/mthca/mthca_cmd.c            |   4 +-
> >  drivers/infiniband/hw/mthca/mthca_main.c           |   2 +-
> >  drivers/infiniband/ulp/iser/iscsi_iser.h           |   2 -
> >  drivers/infiniband/ulp/iser/iser_initiator.c       |   5 +-
> >  drivers/infiniband/ulp/iser/iser_memory.c          |   8 +-
> >  drivers/infiniband/ulp/iser/iser_verbs.c           |   1 -
> >  drivers/input/keyboard/atkbd.c                     |  12 +-
> >  drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c         |   1 +
> >  drivers/iommu/dma-iommu.c                          |   3 +
> >  drivers/iommu/of_iommu.c                           |   7 +
> >  drivers/leds/Kconfig                               |   1 +
> >  drivers/leds/leds-aw200xx.c                        |   7 +-
> >  drivers/md/md.c                                    |  29 +-
> >  drivers/md/raid1.c                                 |  12 +-
> >  drivers/media/dvb-core/dvbdev.c                    |   2 +
> >  drivers/media/dvb-frontends/m88ds3103.c            |   7 +-
> >  drivers/media/pci/bt8xx/bttv-driver.c              |  27 +-
> >  drivers/media/pci/bt8xx/bttv-vbi.c                 |   8 +-
> >  drivers/media/platform/amphion/vpu_core.c          |   2 +-
> >  .../media/platform/mediatek/jpeg/mtk_jpeg_core.c   |   1 -
> >  drivers/media/platform/nxp/imx-mipi-csis.c         |  17 +-
> >  .../media/platform/rockchip/rkisp1/rkisp1-dev.c    |   6 +-
> >  drivers/media/platform/verisilicon/hantro_drv.c    |   2 +
> >  drivers/media/platform/verisilicon/hantro_v4l2.c   |   3 +
> >  drivers/media/test-drivers/visl/visl-video.c       |   3 +
> >  drivers/media/usb/cx231xx/cx231xx-core.c           |   2 +
> >  drivers/media/usb/pvrusb2/pvrusb2-context.c        |   3 +-
> >  drivers/media/v4l2-core/v4l2-async.c               |   1 -
> >  drivers/mfd/cs42l43-sdw.c                          |  74 ++---
> >  drivers/mfd/intel-lpss.c                           |   2 +-
> >  drivers/mfd/rk8xx-core.c                           |  34 +--
> >  drivers/mfd/syscon.c                               |   4 +
> >  drivers/mfd/tps6594-core.c                         |   3 +
> >  drivers/mmc/host/Kconfig                           |  10 +-
> >  drivers/mtd/mtd_blkdevs.c                          |   4 +-
> >  drivers/mtd/nand/raw/fsl_ifc_nand.c                |   2 +-
> >  drivers/net/amt.c                                  |   6 +-
> >  drivers/net/dsa/vitesse-vsc73xx-core.c             |   2 +
> >  drivers/net/ethernet/marvell/octeontx2/af/rpm.c    |   7 +-
> >  .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c |  26 +-
> >  .../ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c   |   6 +-
> >  .../net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c |   8 +-
> >  .../ethernet/mellanox/mlxsw/spectrum_acl_tcam.c    |   6 +-
> >  .../net/ethernet/mellanox/mlxsw/spectrum_router.c  |  24 +-
> >  drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c |   2 +-
> >  drivers/net/ethernet/renesas/ravb_main.c           |   2 +-
> >  drivers/net/ethernet/stmicro/stmmac/stmmac.h       |   1 +
> >  .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c   |  29 +-
> >  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  |   1 +
> >  drivers/net/ethernet/ti/am65-cpsw-nuss.c           |   5 +-
> >  drivers/net/netdevsim/netdev.c                     |   9 +-
> >  drivers/net/phy/micrel.c                           |   9 +
> >  drivers/net/usb/r8152.c                            |  16 +-
> >  drivers/net/wireless/ath/ath11k/ahb.c              |   4 +-
> >  drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c |   3 +-
> >  drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c   |   2 +-
> >  .../net/wireless/intel/iwlwifi/mvm/mld-mac80211.c  |   6 +-
> >  drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c  |  11 -
> >  drivers/net/wireless/intel/iwlwifi/mvm/tx.c        |   2 +-
> >  drivers/net/wireless/marvell/libertas/Kconfig      |   2 -
> >  drivers/net/wireless/marvell/mwifiex/cfg80211.c    |   2 +
> >  drivers/net/wireless/marvell/mwifiex/fw.h          |   1 +
> >  drivers/net/wireless/marvell/mwifiex/ioctl.h       |   1 +
> >  drivers/net/wireless/marvell/mwifiex/sdio.c        |  21 +-
> >  drivers/net/wireless/marvell/mwifiex/sdio.h        |   2 +
> >  drivers/net/wireless/marvell/mwifiex/uap_cmd.c     |   8 +
> >  drivers/net/wireless/mediatek/mt76/eeprom.c        |   6 +-
> >  drivers/net/wireless/mediatek/mt76/mt76.h          |   3 +-
> >  drivers/net/wireless/mediatek/mt76/mt7615/sdio.c   |   2 +-
> >  drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h |   3 +-
> >  drivers/net/wireless/mediatek/mt76/mt7915/main.c   |   5 +-
> >  drivers/net/wireless/mediatek/mt76/mt7915/mmio.c   |   2 +-
> >  drivers/net/wireless/mediatek/mt76/mt7921/mcu.c    |  11 +-
> >  drivers/net/wireless/mediatek/mt76/mt7921/sdio.c   |   4 +-
> >  .../net/wireless/mediatek/mt76/mt7921/sdio_mac.c   |   3 +-
> >  drivers/net/wireless/mediatek/mt76/mt7996/mac.c    |   4 +-
> >  drivers/net/wireless/mediatek/mt76/mt7996/mcu.h    |   2 +-
> >  drivers/net/wireless/mediatek/mt76/sdio.c          |  18 +-
> >  drivers/net/wireless/purelifi/plfxlc/usb.c         |   5 +-
> >  drivers/net/wireless/realtek/rtlwifi/pci.c         |  79 +----
> >  drivers/net/wireless/realtek/rtlwifi/pci.h         |   5 -
> >  .../net/wireless/realtek/rtlwifi/rtl8188ee/phy.c   |  14 +-
> >  .../wireless/realtek/rtlwifi/rtl8192c/phy_common.c |  12 +-
> >  .../wireless/realtek/rtlwifi/rtl8192c/phy_common.h |   1 -
> >  .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.c   |   6 +-
> >  .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.h   |   1 -
> >  .../net/wireless/realtek/rtlwifi/rtl8192cu/phy.c   |   6 +-
> >  .../net/wireless/realtek/rtlwifi/rtl8192de/phy.c   |  15 +-
> >  .../net/wireless/realtek/rtlwifi/rtl8192ee/phy.c   |  16 +-
> >  .../net/wireless/realtek/rtlwifi/rtl8192se/phy.c   |  15 +-
> >  .../net/wireless/realtek/rtlwifi/rtl8821ae/phy.c   |   5 +-
> >  drivers/net/wireless/realtek/rtlwifi/wifi.h        |   7 +
> >  drivers/net/wireless/realtek/rtw88/mac80211.c      |   4 +-
> >  drivers/net/wireless/realtek/rtw88/sdio.c          |  35 ++-
> >  drivers/net/xen-netback/netback.c                  |  44 ++-
> >  drivers/nvme/target/tcp.c                          |  20 +-
> >  drivers/nvme/target/trace.h                        |   5 +-
> >  drivers/of/base.c                                  |   1 +
> >  drivers/of/unittest-data/tests-phandle.dtsi        |  10 +-
> >  drivers/of/unittest.c                              |  74 +++--
> >  drivers/pci/controller/dwc/pci-keystone.c          |   9 +
> >  drivers/pci/controller/dwc/pcie-designware-ep.c    |   1 +
> >  drivers/pci/controller/pcie-mediatek-gen3.c        |  85 +++---
> >  drivers/pci/controller/pcie-mediatek.c             |  10 +-
> >  drivers/pci/endpoint/functions/pci-epf-mhi.c       |  66 ++--
> >  drivers/perf/arm-cmn.c                             |   2 +-
> >  drivers/perf/hisilicon/hisi_uncore_uc_pmu.c        |   4 +-
> >  drivers/platform/x86/intel/vsec.c                  |  25 +-
> >  drivers/platform/x86/intel/vsec.h                  |   1 +
> >  drivers/power/supply/bq256xx_charger.c             |   5 +-
> >  drivers/power/supply/cw2015_battery.c              |   2 +-
> >  drivers/power/supply/qcom_pmi8998_charger.c        |   4 +
> >  drivers/pwm/core.c                                 |   2 +-
> >  drivers/pwm/pwm-jz4740.c                           |   7 +-
> >  drivers/pwm/pwm-stm32.c                            |  31 +-
> >  drivers/scsi/bfa/bfad_bsg.c                        |   2 +-
> >  drivers/scsi/fnic/fnic_debugfs.c                   |   3 +-
> >  drivers/scsi/hisi_sas/hisi_sas_main.c              |  11 +-
> >  drivers/scsi/hisi_sas/hisi_sas_v3_hw.c             |   9 +-
> >  drivers/scsi/mpi3mr/mpi3mr_app.c                   |  16 +
> >  drivers/scsi/mpi3mr/mpi3mr_os.c                    |  19 +-
> >  drivers/soc/qcom/llcc-qcom.c                       |  10 +-
> >  drivers/spi/Kconfig                                |   3 +-
> >  drivers/spi/spi-cadence-quadspi.c                  |   4 +-
> >  drivers/spi/spi-coldfire-qspi.c                    |   1 -
> >  drivers/spi/spi-sh-msiof.c                         |  17 ++
> >  drivers/spmi/spmi-mtk-pmif.c                       |  20 +-
> >  drivers/staging/media/rkvdec/rkvdec.c              |   3 +
> >  drivers/target/target_core_file.c                  |  10 +-
> >  drivers/thermal/loongson2_thermal.c                |   2 +-
> >  drivers/thermal/thermal_core.c                     |   1 -
> >  drivers/tty/serial/8250/8250_bcm2835aux.c          |   2 +
> >  drivers/tty/serial/8250/8250_exar.c                |   5 +-
> >  drivers/tty/serial/8250/8250_omap.c                |   2 +-
> >  drivers/tty/serial/apbuart.c                       |   2 +-
> >  drivers/tty/serial/imx.c                           |  36 +--
> >  drivers/tty/serial/omap-serial.c                   |  27 +-
> >  drivers/tty/serial/sc16is7xx.c                     |   8 +-
> >  drivers/tty/serial/serial_core.c                   |  33 +-
> >  drivers/tty/tty_io.c                               |  31 +-
> >  drivers/ufs/core/ufshcd.c                          |   7 +-
> >  drivers/ufs/host/ufs-qcom.c                        |   4 +-
> >  drivers/usb/cdns3/cdns3-gadget.c                   | 142 ++++++---
> >  drivers/usb/cdns3/cdns3-gadget.h                   |   3 +
> >  drivers/usb/chipidea/core.c                        |   7 +
> >  drivers/usb/class/cdc-acm.c                        |   3 +
> >  drivers/usb/core/generic.c                         |  16 +
> >  drivers/usb/dwc3/core.c                            |  39 +--
> >  drivers/usb/dwc3/ep0.c                             |   5 +-
> >  drivers/usb/dwc3/gadget.c                          |  19 +-
> >  drivers/usb/gadget/function/f_uvc.c                |  63 ++--
> >  drivers/usb/gadget/function/u_uvc.h                |   6 +
> >  drivers/usb/gadget/legacy/webcam.c                 | 333 ++++++++++++++++-----
> >  drivers/usb/host/xhci-mtk.c                        |  40 ++-
> >  drivers/usb/host/xhci-mtk.h                        |   2 +
> >  drivers/usb/mon/mon_bin.c                          |   7 +-
> >  drivers/usb/phy/phy-mxs-usb.c                      |   3 +-
> >  drivers/usb/typec/class.c                          |   4 +-
> >  drivers/vdpa/alibaba/eni_vdpa.c                    |   6 +-
> >  drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c     |   7 +-
> >  drivers/vfio/pci/pds/dirty.c                       |   6 +-
> >  drivers/vhost/vsock.c                              |   1 +
> >  drivers/video/fbdev/acornfb.c                      |   2 +-
> >  drivers/video/fbdev/core/fb_defio.c                |   8 +-
> >  drivers/video/fbdev/imxfb.c                        |  27 +-
> >  drivers/watchdog/bcm2835_wdt.c                     |   3 +-
> >  drivers/watchdog/hpwdt.c                           |   2 +-
> >  drivers/watchdog/rti_wdt.c                         |  13 +-
> >  drivers/watchdog/watchdog_dev.c                    |   3 +-
> >  fs/ceph/Kconfig                                    |   1 +
> >  fs/dlm/debug_fs.c                                  |   2 +-
> >  fs/efivarfs/super.c                                |  15 +
> >  fs/erofs/compress.h                                |   6 +
> >  fs/erofs/decompressor.c                            |  62 +++-
> >  fs/erofs/decompressor_deflate.c                    |   5 +-
> >  fs/erofs/decompressor_lzma.c                       |   4 +-
> >  fs/erofs/internal.h                                |  38 +--
> >  fs/erofs/super.c                                   |  72 +----
> >  fs/erofs/zdata.c                                   |   5 +-
> >  fs/erofs/zmap.c                                    |  23 +-
> >  fs/f2fs/data.c                                     |   7 +-
> >  fs/f2fs/file.c                                     |   7 +-
> >  fs/f2fs/namei.c                                    |   2 +-
> >  fs/f2fs/node.c                                     |   6 +-
> >  fs/f2fs/xattr.c                                    |  11 +-
> >  fs/gfs2/quota.c                                    |   3 +-
> >  fs/gfs2/rgrp.c                                     |   2 +-
> >  fs/namespace.c                                     |  11 +
> >  fs/nfs/blocklayout/blocklayout.c                   |   7 +-
> >  fs/nfs/dir.c                                       |   2 +-
> >  fs/nfs/direct.c                                    |   5 +-
> >  fs/nfs/internal.h                                  |   2 +-
> >  fs/nfs/nfs4proc.c                                  |   3 +
> >  fs/nfs/pnfs.c                                      |   3 +-
> >  fs/pstore/ram_core.c                               |   2 +-
> >  fs/smb/server/asn1.c                               |   5 +
> >  fs/smb/server/connection.c                         |   6 -
> >  fs/smb/server/connection.h                         |   2 +-
> >  fs/smb/server/oplock.c                             |   6 +
> >  fs/smb/server/smb2pdu.c                            |  22 +-
> >  fs/smb/server/smb_common.c                         |   6 +-
> >  fs/smb/server/transport_rdma.c                     |  11 +-
> >  fs/smb/server/transport_tcp.c                      |  13 +-
> >  include/asm-generic/cmpxchg-local.h                |   2 +-
> >  include/crypto/if_alg.h                            |   3 +
> >  include/drm/display/drm_dp_mst_helper.h            |   2 +-
> >  include/drm/drm_bridge.h                           |   2 +-
> >  include/dt-bindings/clock/qcom,videocc-sm8150.h    |   4 +
> >  include/linux/bio.h                                |   9 +-
> >  include/linux/bpf.h                                |  13 +-
> >  include/linux/bpf_mem_alloc.h                      |   1 +
> >  include/linux/clk-provider.h                       |   4 +-
> >  include/linux/gpio/driver.h                        |   6 +
> >  include/linux/hisi_acc_qm.h                        |  20 +-
> >  include/linux/iio/adc/adi-axi-adc.h                |   4 +
> >  include/linux/mhi_ep.h                             |  19 +-
> >  include/linux/netfilter_bridge.h                   |   6 +-
> >  include/linux/pci.h                                |  12 +-
> >  include/linux/rcupdate.h                           |   6 +
> >  include/linux/skbuff.h                             |   2 +-
> >  include/linux/srcu.h                               |   2 +-
> >  include/linux/usb.h                                |   6 +
> >  include/linux/virtio_net.h                         |   9 +-
> >  include/linux/virtio_vsock.h                       |   1 +
> >  include/net/af_vsock.h                             |   2 +-
> >  include/net/bluetooth/hci_core.h                   |   1 -
> >  include/net/netdev_queues.h                        |   2 +-
> >  include/uapi/linux/bpf.h                           |   3 +
> >  init/do_mounts.c                                   |   9 +-
> >  io_uring/io_uring.c                                |  22 +-
> >  io_uring/rw.c                                      |  10 +-
> >  kernel/bpf/arraymap.c                              |  12 +-
> >  kernel/bpf/hashtab.c                               |   6 +-
> >  kernel/bpf/lpm_trie.c                              |   3 +
> >  kernel/bpf/map_in_map.c                            |  13 +-
> >  kernel/bpf/map_in_map.h                            |   2 +-
> >  kernel/bpf/memalloc.c                              |  94 +-----
> >  kernel/bpf/stackmap.c                              |  11 +-
> >  kernel/bpf/syscall.c                               |  47 ++-
> >  kernel/bpf/verifier.c                              |  96 +++---
> >  kernel/debug/kdb/kdb_main.c                        |   2 -
> >  kernel/dma/coherent.c                              |   4 +-
> >  kernel/sched/fair.c                                |  20 +-
> >  kernel/time/tick-sched.c                           |   5 +
> >  kernel/trace/bpf_trace.c                           |   7 +
> >  lib/kunit/debugfs.c                                |   4 +-
> >  net/bluetooth/hci_conn.c                           |   8 +-
> >  net/bluetooth/hci_debugfs.c                        |  12 +-
> >  net/bluetooth/hci_event.c                          |  11 +-
> >  net/bridge/br_netfilter_hooks.c                    |  42 ++-
> >  net/bridge/br_netfilter_ipv6.c                     |  14 +-
> >  net/core/rtnetlink.c                               |  14 +-
> >  net/dns_resolver/dns_key.c                         |   2 +-
> >  net/ethtool/features.c                             |   9 +-
> >  net/ipv4/af_inet.c                                 |   1 +
> >  net/ipv4/ipmr.c                                    |  13 +-
> >  net/ipv4/netfilter/nf_reject_ipv4.c                |   9 +-
> >  net/ipv4/udp.c                                     |  34 +--
> >  net/ipv6/ip6_tunnel.c                              |  26 +-
> >  net/ipv6/mcast.c                                   |   4 +
> >  net/ipv6/netfilter/nf_reject_ipv6.c                |  11 +-
> >  net/ipv6/udp.c                                     |  16 +-
> >  net/mptcp/options.c                                |   6 +-
> >  net/mptcp/subflow.c                                |  17 +-
> >  net/ncsi/internal.h                                |   7 +-
> >  net/ncsi/ncsi-netlink.c                            |   4 +-
> >  net/ncsi/ncsi-pkt.h                                |   7 +-
> >  net/ncsi/ncsi-rsp.c                                |  26 +-
> >  net/netfilter/ipset/ip_set_hash_netiface.c         |   8 +-
> >  net/netfilter/ipvs/ip_vs_xmit.c                    |   4 +-
> >  net/netfilter/nf_log_syslog.c                      |  13 +-
> >  net/netfilter/nf_queue.c                           |   6 +-
> >  net/netfilter/nf_tables_api.c                      |  38 ++-
> >  net/netfilter/nfnetlink_log.c                      |   8 +-
> >  net/netfilter/nft_limit.c                          |  19 +-
> >  net/netfilter/xt_physdev.c                         |   2 +-
> >  net/netlabel/netlabel_calipso.c                    |  49 +--
> >  net/rxrpc/ar-internal.h                            |   1 +
> >  net/rxrpc/call_object.c                            |   4 +-
> >  net/rxrpc/local_object.c                           |  13 +-
> >  net/rxrpc/output.c                                 |   6 +-
> >  net/rxrpc/rxkad.c                                  |   2 +
> >  net/sched/act_ct.c                                 |  12 +-
> >  net/sctp/socket.c                                  |  13 +-
> >  net/sunrpc/xprtmultipath.c                         |   2 +-
> >  net/tls/tls_sw.c                                   |   6 +-
> >  net/unix/unix_bpf.c                                |  21 +-
> >  net/vmw_vsock/af_vsock.c                           |   9 +-
> >  net/vmw_vsock/hyperv_transport.c                   |   4 +-
> >  net/vmw_vsock/virtio_transport.c                   |   1 +
> >  net/vmw_vsock/virtio_transport_common.c            |  43 ++-
> >  net/vmw_vsock/vsock_loopback.c                     |   1 +
> >  net/wireless/scan.c                                |  47 ++-
> >  rust/bindgen_parameters                            |   4 +
> >  security/apparmor/lib.c                            |   1 +
> >  security/apparmor/lsm.c                            |   1 -
> >  security/apparmor/policy_unpack.c                  |  11 +-
> >  security/keys/encrypted-keys/encrypted.c           |   4 +
> >  security/selinux/hooks.c                           |   7 +
> >  sound/pci/hda/patch_hdmi.c                         |   6 +
> >  sound/pci/hda/patch_realtek.c                      |   3 +
> >  sound/pci/oxygen/oxygen_mixer.c                    |   2 +-
> >  sound/soc/amd/vangogh/acp5x-mach.c                 |  35 +--
> >  sound/soc/codecs/cs35l33.c                         |   4 +-
> >  sound/soc/codecs/rt5645.c                          |   8 -
> >  sound/soc/codecs/tas2781-fmwlib.c                  |   1 +
> >  .../soc/intel/boards/sof_sdw_rt_sdca_jack_common.c |   1 +
> >  sound/soc/intel/common/soc-acpi-intel-glk-match.c  |  14 +-
> >  sound/soc/mediatek/common/mtk-dsp-sof-common.c     |   2 +-
> >  sound/soc/sof/ipc4-loader.c                        |  11 +-
> >  sound/soc/sof/topology.c                           |   2 +-
> >  sound/usb/mixer_scarlett_gen2.c                    | 223 +++++++++-----
> >  tools/include/uapi/linux/bpf.h                     |   3 +
> >  tools/lib/api/io.h                                 |   1 +
> >  tools/perf/builtin-stat.c                          |  18 +-
> >  .../arch/arm64/ampere/ampereone/core-imp-def.json  |   2 +-
> >  .../attr/test-record-user-regs-no-sve-aarch64      |   2 +-
> >  .../tests/attr/test-record-user-regs-sve-aarch64   |   2 +-
> >  tools/perf/tests/workloads/thloop.c                |   4 +-
> >  tools/perf/util/bpf-event.c                        |   8 +-
> >  tools/perf/util/bpf-event.h                        |  12 +-
> >  tools/perf/util/db-export.c                        |   4 +-
> >  tools/perf/util/env.c                              |  50 ++--
> >  tools/perf/util/env.h                              |   4 +
> >  tools/perf/util/genelf.c                           |   6 +-
> >  tools/perf/util/header.c                           |  17 +-
> >  tools/perf/util/hisi-ptt.c                         |   1 +
> >  tools/perf/util/mem-events.c                       |  25 +-
> >  tools/perf/util/stat-shadow.c                      |   2 +-
> >  tools/perf/util/unwind-libdw.c                     |  21 +-
> >  tools/perf/util/unwind-libunwind-local.c           |   2 +-
> >  tools/testing/selftests/alsa/conf.c                |   2 +-
> >  tools/testing/selftests/alsa/mixer-test.c          |   4 +-
> >  tools/testing/selftests/bpf/prog_tests/bpf_iter.c  |   2 +
> >  tools/testing/selftests/bpf/prog_tests/time_tai.c  |   2 +-
> >  .../selftests/bpf/progs/bpf_iter_task_stack.c      |   5 +
> >  .../selftests/bpf/progs/test_global_func16.c       |   2 +-
> >  .../selftests/bpf/progs/verifier_basic_stack.c     |   8 +-
> >  .../testing/selftests/bpf/progs/verifier_int_ptr.c |   5 +-
> >  .../selftests/bpf/progs/verifier_raw_stack.c       |   5 +-
> >  .../testing/selftests/bpf/progs/verifier_var_off.c |  62 +++-
> >  .../selftests/bpf/progs/xdp_synproxy_kern.c        |   4 +-
> >  .../selftests/bpf/verifier/atomic_cmpxchg.c        |  11 -
> >  tools/testing/selftests/bpf/verifier/calls.c       |   4 +-
> >  .../drivers/net/bonding/mode-1-recovery-updelay.sh |   2 +-
> >  .../drivers/net/bonding/mode-2-recovery-updelay.sh |   2 +-
> >  .../testing/selftests/drivers/net/mlxsw/qos_pfc.sh |  18 +-
> >  .../drivers/net/mlxsw/spectrum-2/tc_flower.sh      | 106 ++++++-
> >  .../selftests/net/arp_ndisc_untracked_subnets.sh   |   2 +-
> >  .../selftests/net/fib_nexthop_multiprefix.sh       |   4 +-
> >  tools/testing/selftests/powerpc/math/fpu_preempt.c |   9 +-
> >  tools/testing/selftests/powerpc/math/vmx_preempt.c |  10 +-
> >  tools/testing/selftests/sgx/Makefile               |   2 +-
> >  tools/testing/selftests/sgx/load.c                 |   9 +-
> >  tools/testing/selftests/sgx/sigstruct.c            |   5 +-
> >  tools/testing/selftests/sgx/test_encl.c            |   8 +-
> >  584 files changed, 5326 insertions(+), 3284 deletions(-)
> >
> >
> >

^ permalink raw reply	[flat|nested] 599+ messages in thread

* Re: [PATCH 6.6 328/583] gpiolib: provide gpio_device_find()
  2024-01-22 23:56 ` [PATCH 6.6 328/583] gpiolib: provide gpio_device_find() Greg Kroah-Hartman
@ 2024-01-23  9:56   ` Bartosz Golaszewski
  2024-01-23 12:14     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 599+ messages in thread
From: Bartosz Golaszewski @ 2024-01-23  9:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: stable, patches, Linus Walleij, Sasha Levin

On Tue, 23 Jan 2024 at 03:03, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> 6.6-stable review patch.  If anyone has any objections, please let me know.
>
> ------------------
>
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> [ Upstream commit cfe102f63308c8c8e01199a682868a64b83f653e ]
>
> gpiochip_find() is wrong and its kernel doc is misleading as the
> function doesn't return a reference to the gpio_chip but just a raw
> pointer. The chip itself is not guaranteed to stay alive, in fact it can
> be deleted at any point. Also: other than GPIO drivers themselves,
> nobody else has any business accessing gpio_chip structs.
>
> Provide a new gpio_device_find() function that returns a real reference
> to the opaque gpio_device structure that is guaranteed to stay alive for
> as long as there are active users of it.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> Stable-dep-of: 48e1b4d369cf ("gpiolib: remove the GPIO device from the list when it's unregistered")
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---

Greg,

I think there's something not quite right with the system for picking
up patches into stable lately. This is the third email where I'm
stopping Sasha or you from picking up changes that are clearly new
features and not fixes suitable for backporting.

Providing a new, improved function to replace an old interface should
not be considered for stable branches IMO. Please drop it.

Bartosz

^ permalink raw reply	[flat|nested] 599+ messages in thread

* Re: [PATCH 6.6 000/583] 6.6.14-rc1 review
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (584 preceding siblings ...)
  2024-01-23  8:40 ` Luna Jernberg
@ 2024-01-23 11:46 ` Takeshi Ogasawara
  2024-01-23 15:41 ` Jon Hunter
                   ` (3 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Takeshi Ogasawara @ 2024-01-23 11:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
	patches, lkft-triage, pavel, jonathanh, f.fainelli,
	sudipm.mukherjee, srw, rwarsow, conor, allen.lkml

Hi Greg

On Tue, Jan 23, 2024 at 11:17 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> This is the start of the stable review cycle for the 6.6.14 release.
> There are 583 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Wed, 24 Jan 2024 23:56:49 +0000.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
>         https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.14-rc1.gz
> or in the git tree and branch at:
>         git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.6.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h

6.6.14-rc1 tested.

Build successfully completed.
Boot successfully completed.
No dmesg regressions.
Video output normal.
Sound output normal.

Lenovo ThinkPad X1 Carbon Gen10(Intel i7-1260P(x86_64) arch linux)

[    0.000000] Linux version 6.6.14-rc1rv
(takeshi@ThinkPadX1Gen10J0764) (gcc (GCC) 13.2.1 20230801, GNU ld (GNU
Binutils) 2.41.0) #1 SMP PREEMPT_DYNAMIC Tue Jan 23 20:11:26 JST 2024

Thanks

Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com>

^ permalink raw reply	[flat|nested] 599+ messages in thread

* Re: [PATCH 6.6 328/583] gpiolib: provide gpio_device_find()
  2024-01-23  9:56   ` Bartosz Golaszewski
@ 2024-01-23 12:14     ` Greg Kroah-Hartman
  2024-01-23 13:13       ` Bartosz Golaszewski
  0 siblings, 1 reply; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23 12:14 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: stable, patches, Linus Walleij, Sasha Levin

On Tue, Jan 23, 2024 at 10:56:50AM +0100, Bartosz Golaszewski wrote:
> On Tue, 23 Jan 2024 at 03:03, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > 6.6-stable review patch.  If anyone has any objections, please let me know.
> >
> > ------------------
> >
> > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >
> > [ Upstream commit cfe102f63308c8c8e01199a682868a64b83f653e ]
> >
> > gpiochip_find() is wrong and its kernel doc is misleading as the
> > function doesn't return a reference to the gpio_chip but just a raw
> > pointer. The chip itself is not guaranteed to stay alive, in fact it can
> > be deleted at any point. Also: other than GPIO drivers themselves,
> > nobody else has any business accessing gpio_chip structs.
> >
> > Provide a new gpio_device_find() function that returns a real reference
> > to the opaque gpio_device structure that is guaranteed to stay alive for
> > as long as there are active users of it.
> >
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> > Stable-dep-of: 48e1b4d369cf ("gpiolib: remove the GPIO device from the list when it's unregistered")
> > Signed-off-by: Sasha Levin <sashal@kernel.org>
> > ---
> 
> Greg,
> 
> I think there's something not quite right with the system for picking
> up patches into stable lately. This is the third email where I'm
> stopping Sasha or you from picking up changes that are clearly new
> features and not fixes suitable for backporting.
> 
> Providing a new, improved function to replace an old interface should
> not be considered for stable branches IMO. Please drop it.

Even if it is required for a valid bugfix that affects users?  This is a
dependency of the commit 48e1b4d369cf ("gpiolib: remove the GPIO device
from the list when it's unregistered"), shouldn't that be backported to
all affected kernels properly?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 599+ messages in thread

* Re: [PATCH 6.6 328/583] gpiolib: provide gpio_device_find()
  2024-01-23 12:14     ` Greg Kroah-Hartman
@ 2024-01-23 13:13       ` Bartosz Golaszewski
  2024-01-23 14:32         ` Greg Kroah-Hartman
  0 siblings, 1 reply; 599+ messages in thread
From: Bartosz Golaszewski @ 2024-01-23 13:13 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: stable, patches, Linus Walleij, Sasha Levin

On Tue, 23 Jan 2024 at 13:48, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Tue, Jan 23, 2024 at 10:56:50AM +0100, Bartosz Golaszewski wrote:
> > On Tue, 23 Jan 2024 at 03:03, Greg Kroah-Hartman
> > <gregkh@linuxfoundation.org> wrote:
> > >
> > > 6.6-stable review patch.  If anyone has any objections, please let me know.
> > >
> > > ------------------
> > >
> > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > >
> > > [ Upstream commit cfe102f63308c8c8e01199a682868a64b83f653e ]
> > >
> > > gpiochip_find() is wrong and its kernel doc is misleading as the
> > > function doesn't return a reference to the gpio_chip but just a raw
> > > pointer. The chip itself is not guaranteed to stay alive, in fact it can
> > > be deleted at any point. Also: other than GPIO drivers themselves,
> > > nobody else has any business accessing gpio_chip structs.
> > >
> > > Provide a new gpio_device_find() function that returns a real reference
> > > to the opaque gpio_device structure that is guaranteed to stay alive for
> > > as long as there are active users of it.
> > >
> > > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> > > Stable-dep-of: 48e1b4d369cf ("gpiolib: remove the GPIO device from the list when it's unregistered")
> > > Signed-off-by: Sasha Levin <sashal@kernel.org>
> > > ---
> >
> > Greg,
> >
> > I think there's something not quite right with the system for picking
> > up patches into stable lately. This is the third email where I'm
> > stopping Sasha or you from picking up changes that are clearly new
> > features and not fixes suitable for backporting.
> >
> > Providing a new, improved function to replace an old interface should
> > not be considered for stable branches IMO. Please drop it.
>
> Even if it is required for a valid bugfix that affects users?  This is a
> dependency of the commit 48e1b4d369cf ("gpiolib: remove the GPIO device
> from the list when it's unregistered"), shouldn't that be backported to
> all affected kernels properly?
>
> thanks,
>
> greg k-h

Eh... It is technically a fix but also this has been like it since
2014 and nobody ever hit the bug (or bothered to report it). Ok do as
you wish with this one.

Bartosz

^ permalink raw reply	[flat|nested] 599+ messages in thread

* Re: [PATCH 6.6 328/583] gpiolib: provide gpio_device_find()
  2024-01-23 13:13       ` Bartosz Golaszewski
@ 2024-01-23 14:32         ` Greg Kroah-Hartman
  2024-01-23 14:57           ` Bartosz Golaszewski
  0 siblings, 1 reply; 599+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-23 14:32 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: stable, patches, Linus Walleij, Sasha Levin

On Tue, Jan 23, 2024 at 02:13:40PM +0100, Bartosz Golaszewski wrote:
> On Tue, 23 Jan 2024 at 13:48, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > On Tue, Jan 23, 2024 at 10:56:50AM +0100, Bartosz Golaszewski wrote:
> > > On Tue, 23 Jan 2024 at 03:03, Greg Kroah-Hartman
> > > <gregkh@linuxfoundation.org> wrote:
> > > >
> > > > 6.6-stable review patch.  If anyone has any objections, please let me know.
> > > >
> > > > ------------------
> > > >
> > > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > > >
> > > > [ Upstream commit cfe102f63308c8c8e01199a682868a64b83f653e ]
> > > >
> > > > gpiochip_find() is wrong and its kernel doc is misleading as the
> > > > function doesn't return a reference to the gpio_chip but just a raw
> > > > pointer. The chip itself is not guaranteed to stay alive, in fact it can
> > > > be deleted at any point. Also: other than GPIO drivers themselves,
> > > > nobody else has any business accessing gpio_chip structs.
> > > >
> > > > Provide a new gpio_device_find() function that returns a real reference
> > > > to the opaque gpio_device structure that is guaranteed to stay alive for
> > > > as long as there are active users of it.
> > > >
> > > > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > > > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> > > > Stable-dep-of: 48e1b4d369cf ("gpiolib: remove the GPIO device from the list when it's unregistered")
> > > > Signed-off-by: Sasha Levin <sashal@kernel.org>
> > > > ---
> > >
> > > Greg,
> > >
> > > I think there's something not quite right with the system for picking
> > > up patches into stable lately. This is the third email where I'm
> > > stopping Sasha or you from picking up changes that are clearly new
> > > features and not fixes suitable for backporting.
> > >
> > > Providing a new, improved function to replace an old interface should
> > > not be considered for stable branches IMO. Please drop it.
> >
> > Even if it is required for a valid bugfix that affects users?  This is a
> > dependency of the commit 48e1b4d369cf ("gpiolib: remove the GPIO device
> > from the list when it's unregistered"), shouldn't that be backported to
> > all affected kernels properly?
> >
> > thanks,
> >
> > greg k-h
> 
> Eh... It is technically a fix but also this has been like it since
> 2014 and nobody ever hit the bug (or bothered to report it). Ok do as
> you wish with this one.

You all marked the commit as a fix for an issue, so that's why we
backported all of this.  If something is NOT a fix, don't tag it as
such?  :)

Or, if you want, we can ignore all patches in the gpio subsystem that
are NOT explicitly tagged with a cc: stable@ tag, if you agree that you
will properly tag everything.  Some other subsytems do this, but that
increases the responsibility on the maintainers of the subsystem, which
is not something I would ever ask anyone to do.

Heck, for my subsystems, I miss tagging stable a lot, but the scripts
pick up those that get Fixes: tags, so it's a good back-stop to solve
problems.

Again, if you want us to ignore any portion of the tree that you are the
maintainer, just let me know the directory(ies) that you want and I can
add it to the "ignore list" or you can send a patch for this file:
	https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/tree/ignore_list

thanks!

gre gk-h

^ permalink raw reply	[flat|nested] 599+ messages in thread

* Re: [PATCH 6.6 328/583] gpiolib: provide gpio_device_find()
  2024-01-23 14:32         ` Greg Kroah-Hartman
@ 2024-01-23 14:57           ` Bartosz Golaszewski
  0 siblings, 0 replies; 599+ messages in thread
From: Bartosz Golaszewski @ 2024-01-23 14:57 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: stable, patches, Linus Walleij, Sasha Levin

On Tue, 23 Jan 2024 at 15:32, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Tue, Jan 23, 2024 at 02:13:40PM +0100, Bartosz Golaszewski wrote:
> > On Tue, 23 Jan 2024 at 13:48, Greg Kroah-Hartman
> > <gregkh@linuxfoundation.org> wrote:
> > >
> > > On Tue, Jan 23, 2024 at 10:56:50AM +0100, Bartosz Golaszewski wrote:
> > > > On Tue, 23 Jan 2024 at 03:03, Greg Kroah-Hartman
> > > > <gregkh@linuxfoundation.org> wrote:
> > > > >
> > > > > 6.6-stable review patch.  If anyone has any objections, please let me know.
> > > > >
> > > > > ------------------
> > > > >
> > > > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > > > >
> > > > > [ Upstream commit cfe102f63308c8c8e01199a682868a64b83f653e ]
> > > > >
> > > > > gpiochip_find() is wrong and its kernel doc is misleading as the
> > > > > function doesn't return a reference to the gpio_chip but just a raw
> > > > > pointer. The chip itself is not guaranteed to stay alive, in fact it can
> > > > > be deleted at any point. Also: other than GPIO drivers themselves,
> > > > > nobody else has any business accessing gpio_chip structs.
> > > > >
> > > > > Provide a new gpio_device_find() function that returns a real reference
> > > > > to the opaque gpio_device structure that is guaranteed to stay alive for
> > > > > as long as there are active users of it.
> > > > >
> > > > > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > > > > Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> > > > > Stable-dep-of: 48e1b4d369cf ("gpiolib: remove the GPIO device from the list when it's unregistered")
> > > > > Signed-off-by: Sasha Levin <sashal@kernel.org>
> > > > > ---
> > > >
> > > > Greg,
> > > >
> > > > I think there's something not quite right with the system for picking
> > > > up patches into stable lately. This is the third email where I'm
> > > > stopping Sasha or you from picking up changes that are clearly new
> > > > features and not fixes suitable for backporting.
> > > >
> > > > Providing a new, improved function to replace an old interface should
> > > > not be considered for stable branches IMO. Please drop it.
> > >
> > > Even if it is required for a valid bugfix that affects users?  This is a
> > > dependency of the commit 48e1b4d369cf ("gpiolib: remove the GPIO device
> > > from the list when it's unregistered"), shouldn't that be backported to
> > > all affected kernels properly?
> > >
> > > thanks,
> > >
> > > greg k-h
> >
> > Eh... It is technically a fix but also this has been like it since
> > 2014 and nobody ever hit the bug (or bothered to report it). Ok do as
> > you wish with this one.
>
> You all marked the commit as a fix for an issue, so that's why we
> backported all of this.  If something is NOT a fix, don't tag it as
> such?  :)
>
> Or, if you want, we can ignore all patches in the gpio subsystem that
> are NOT explicitly tagged with a cc: stable@ tag, if you agree that you
> will properly tag everything.  Some other subsytems do this, but that
> increases the responsibility on the maintainers of the subsystem, which
> is not something I would ever ask anyone to do.
>
> Heck, for my subsystems, I miss tagging stable a lot, but the scripts
> pick up those that get Fixes: tags, so it's a good back-stop to solve
> problems.
>
> Again, if you want us to ignore any portion of the tree that you are the
> maintainer, just let me know the directory(ies) that you want and I can
> add it to the "ignore list" or you can send a patch for this file:
>         https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/tree/ignore_list
>
> thanks!
>
> gre gk-h

No, I don't want you to ignore the commits without Cc: stable. I may
have been too eager to react but earlier today I saw Sasha pick up
patches that were clearly adding new features and *did not* have any
Fixes tags on them.

Nevermind this message.

Thanks
Bartosz

^ permalink raw reply	[flat|nested] 599+ messages in thread

* Re: [PATCH 6.6 000/583] 6.6.14-rc1 review
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (585 preceding siblings ...)
  2024-01-23 11:46 ` Takeshi Ogasawara
@ 2024-01-23 15:41 ` Jon Hunter
  2024-01-23 17:23 ` Allen
                   ` (2 subsequent siblings)
  589 siblings, 0 replies; 599+ messages in thread
From: Jon Hunter @ 2024-01-23 15:41 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Greg Kroah-Hartman, patches, linux-kernel, torvalds, akpm, linux,
	shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
	sudipm.mukherjee, srw, rwarsow, conor, allen.lkml, linux-tegra,
	stable

On Mon, 22 Jan 2024 15:50:51 -0800, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 6.6.14 release.
> There are 583 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
> 
> Responses should be made by Wed, 24 Jan 2024 23:56:49 +0000.
> Anything received after that time might be too late.
> 
> The whole patch series can be found in one patch at:
> 	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.14-rc1.gz
> or in the git tree and branch at:
> 	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.6.y
> and the diffstat can be found below.
> 
> thanks,
> 
> greg k-h

Failures detected for Tegra ...

Test results for stable-v6.6:
    10 builds:	10 pass, 0 fail
    28 boots:	26 pass, 2 fail
    96 tests:	96 pass, 0 fail

Linux version:	6.6.14-rc1-g8f8e522b6a7a
Boards tested:	tegra124-jetson-tk1, tegra186-p2771-0000,
                tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
                tegra20-ventana, tegra210-p2371-2180,
                tegra210-p3450-0000, tegra30-cardhu-a04

Boot failures:	tegra210-p2371-2180

Jon

^ permalink raw reply	[flat|nested] 599+ messages in thread

* Re: [PATCH 6.6 000/583] 6.6.14-rc1 review
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (586 preceding siblings ...)
  2024-01-23 15:41 ` Jon Hunter
@ 2024-01-23 17:23 ` Allen
  2024-01-24  0:19 ` Justin Forbes
  2024-01-24  9:27 ` Harshit Mogalapalli
  589 siblings, 0 replies; 599+ messages in thread
From: Allen @ 2024-01-23 17:23 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
	patches, lkft-triage, pavel, jonathanh, f.fainelli,
	sudipm.mukherjee, srw, rwarsow, conor

> This is the start of the stable review cycle for the 6.6.14 release.
> There are 583 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Wed, 24 Jan 2024 23:56:49 +0000.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
>         https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.14-rc1.gz
> or in the git tree and branch at:
>         git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.6.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
>

Compiled and booted on my x86_64 and ARM64 test systems. No errors or
regressions.

Tested-by: Allen Pais <apais@linux.microsoft.com>

Thanks.

^ permalink raw reply	[flat|nested] 599+ messages in thread

* Re: [PATCH 6.6 000/583] 6.6.14-rc1 review
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (587 preceding siblings ...)
  2024-01-23 17:23 ` Allen
@ 2024-01-24  0:19 ` Justin Forbes
  2024-01-24  9:27 ` Harshit Mogalapalli
  589 siblings, 0 replies; 599+ messages in thread
From: Justin Forbes @ 2024-01-24  0:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
	patches, lkft-triage, pavel, jonathanh, f.fainelli,
	sudipm.mukherjee, srw, rwarsow, conor, allen.lkml

On Mon, Jan 22, 2024 at 03:50:51PM -0800, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 6.6.14 release.
> There are 583 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
> 
> Responses should be made by Wed, 24 Jan 2024 23:56:49 +0000.
> Anything received after that time might be too late.
> 
> The whole patch series can be found in one patch at:
> 	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.14-rc1.gz
> or in the git tree and branch at:
> 	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.6.y
> and the diffstat can be found below.
> 
> thanks,
> 
> greg k-h

Tested rc1 against the Fedora build system (aarch64, ppc64le, s390x,
x86_64), and boot tested x86_64. No regressions noted.

Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>

^ permalink raw reply	[flat|nested] 599+ messages in thread

* Re: [PATCH 6.6 000/583] 6.6.14-rc1 review
  2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
                   ` (588 preceding siblings ...)
  2024-01-24  0:19 ` Justin Forbes
@ 2024-01-24  9:27 ` Harshit Mogalapalli
  589 siblings, 0 replies; 599+ messages in thread
From: Harshit Mogalapalli @ 2024-01-24  9:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman, stable
  Cc: patches, linux-kernel, torvalds, akpm, linux, shuah, patches,
	lkft-triage, pavel, jonathanh, f.fainelli, sudipm.mukherjee, srw,
	rwarsow, conor, allen.lkml, Vegard Nossum, Darren Kenny

Hi Greg,

On 23/01/24 5:20 am, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 6.6.14 release.
> There are 583 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
> 
> Responses should be made by Wed, 24 Jan 2024 23:56:49 +0000.
> Anything received after that time might be too late.
>

No problems seen on x86_64 and aarch64 with our testing.

Tested-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>

Thanks,
Harshit


> The whole patch series can be found in one patch at:
> 	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.14-rc1.gz
> or in the git tree and branch at:
> 	git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.6.y
> and the diffstat can be found below.
> 
> thanks,
> 
> greg k-h
> 

^ permalink raw reply	[flat|nested] 599+ messages in thread

end of thread, other threads:[~2024-01-24  9:27 UTC | newest]

Thread overview: 599+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-22 23:50 [PATCH 6.6 000/583] 6.6.14-rc1 review Greg Kroah-Hartman
2024-01-22 23:50 ` [PATCH 6.6 001/583] x86/lib: Fix overflow when counting digits Greg Kroah-Hartman
2024-01-22 23:50 ` [PATCH 6.6 002/583] x86/mce/inject: Clear test status value Greg Kroah-Hartman
2024-01-22 23:50 ` [PATCH 6.6 003/583] EDAC/thunderx: Fix possible out-of-bounds string access Greg Kroah-Hartman
2024-01-22 23:50 ` [PATCH 6.6 004/583] powerpc: add crtsavres.o to always-y instead of extra-y Greg Kroah-Hartman
2024-01-22 23:50 ` [PATCH 6.6 005/583] x86: Fix CPUIDLE_FLAG_IRQ_ENABLE leaking timer reprogram Greg Kroah-Hartman
2024-01-22 23:50 ` [PATCH 6.6 006/583] powerpc/44x: select I2C for CURRITUCK Greg Kroah-Hartman
2024-01-22 23:50 ` [PATCH 6.6 007/583] powerpc/pseries/memhp: Fix access beyond end of drmem array Greg Kroah-Hartman
2024-01-22 23:50 ` [PATCH 6.6 008/583] perf/arm-cmn: Fix HN-F class_occup_id events Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 009/583] drivers/perf: hisi: Fix some event id for HiSilicon UC pmu Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 010/583] KVM: PPC: Book3S HV: Use accessors for VCPU registers Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 011/583] KVM: PPC: Book3S HV: Introduce low level MSR accessor Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 012/583] KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 013/583] selftests/powerpc: Fix error handling in FPU/VMX preemption tests Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 014/583] powerpc/hv-gpci: Add return value check in affinity_domain_via_partition_show function Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 015/583] powerpc/rtas: Avoid warning on invalid token argument to sys_rtas() Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 016/583] powerpc/powernv: Add a null pointer check to scom_debug_init_one() Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 017/583] powerpc/powernv: Add a null pointer check in opal_event_init() Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 018/583] powerpc/powernv: Add a null pointer check in opal_powercap_init() Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 019/583] powerpc/imc-pmu: Add a null pointer check in update_events_in_group() Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 020/583] sched/fair: Update min_vruntime for reweight_entity() correctly Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 021/583] perf/x86/intel/uncore: Fix NULL pointer dereference issue in upi_fill_topology() Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 022/583] spi: spi-zynqmp-gqspi: fix driver kconfig dependencies Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 023/583] mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 024/583] ACPI: video: check for error while searching for backlight device parent Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 025/583] ACPI: LPIT: Avoid u32 multiplication overflow Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 026/583] KEYS: encrypted: Add check for strsep Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 027/583] spi: cadence-quadspi: add missing clk_disable_unprepare() in cqspi_probe() Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 028/583] platform/x86/intel/vsec: Fix xa_alloc memory leak Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 029/583] cpufreq: scmi: process the result of devm_of_clk_add_hw_provider() Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 030/583] calipso: fix memory leak in netlbl_calipso_add_pass() Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 031/583] efivarfs: force RO when remounting if SetVariable is not supported Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 032/583] efivarfs: Free s_fs_info on unmount Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 033/583] spi: sh-msiof: Enforce fixed DTDL for R-Car H3 Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 034/583] ACPI: LPSS: Fix the fractional clock divider flags Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 035/583] ACPI: extlog: Clear Extended Error Log status when RAS_CEC handled the error Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 036/583] thermal: core: Fix NULL pointer dereference in zone registration error path Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 037/583] kunit: debugfs: Fix unchecked dereference in debugfs_print_results() Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 038/583] mtd: Fix gluebi NULL pointer dereference caused by ftl notifier Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 039/583] cpuidle: haltpoll: Do not enable interrupts when entering idle Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 040/583] drivers/thermal/loongson2_thermal: Fix incorrect PTR_ERR() judgment Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 041/583] selinux: Fix error priority for bind with AF_UNSPEC on PF_INET6 socket Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 042/583] crypto: rsa - add a check for allocation failure Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 043/583] crypto: jh7110 - Correct deferred probe return Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 044/583] crypto: virtio - Handle dataq logic with tasklet Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 045/583] crypto: sa2ul - Return crypto_aead_setkey to transfer the error Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 046/583] crypto: ccp - fix memleak in ccp_init_dm_workarea Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 047/583] crypto: af_alg - Disallow multiple in-flight AIO requests Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 048/583] crypto: safexcel - Add error handling for dma_map_sg() calls Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 049/583] crypto: sahara - remove FLAGS_NEW_KEY logic Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 050/583] crypto: sahara - fix cbc selftest failure Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 051/583] crypto: sahara - fix ahash " Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 052/583] crypto: sahara - fix processing requests with cryptlen < sg->length Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 053/583] crypto: sahara - fix error handling in sahara_hw_descriptor_create() Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 054/583] crypto: hisilicon/qm - save capability registers in qm init process Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 055/583] crypto: hisilicon/zip - add zip comp high perf mode configuration Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 056/583] crypto: hisilicon/qm - add a function to set qm algs Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 057/583] crypto: hisilicon/hpre - save capability registers in probe process Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 058/583] crypto: hisilicon/sec2 " Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 059/583] crypto: hisilicon/zip " Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 060/583] pstore: ram_core: fix possible overflow in persistent_ram_init_ecc() Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 061/583] erofs: fix memory leak on short-lived bounced pages Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 062/583] fs: indicate request originates from old mount API Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 063/583] gfs2: Fix kernel NULL pointer dereference in gfs2_rgrp_dump Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 064/583] gfs2: fix kernel BUG in gfs2_quota_cleanup Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 065/583] dlm: fix format seq ops type 4 Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 066/583] crypto: virtio - Wait for tasklet to complete on device remove Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 067/583] crypto: sahara - avoid skcipher fallback code duplication Greg Kroah-Hartman
2024-01-22 23:51 ` [PATCH 6.6 068/583] crypto: sahara - handle zero-length aes requests Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 069/583] crypto: sahara - fix ahash reqsize Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 070/583] crypto: sahara - fix wait_for_completion_timeout() error handling Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 071/583] crypto: sahara - improve error handling in sahara_sha_process() Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 072/583] crypto: sahara - fix processing hash requests with req->nbytes < sg->length Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 073/583] crypto: sahara - do not resize req->src when doing hash operations Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 074/583] crypto: scomp - fix req->dst buffer overflow Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 075/583] csky: fix arch_jump_label_transform_static override Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 076/583] blocklayoutdriver: Fix reference leak of pnfs_device_node Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 077/583] NFS: Use parents objective cred in nfs_access_login_time() Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 078/583] NFSv4.1/pnfs: Ensure we handle the error NFS4ERR_RETURNCONFLICT Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 079/583] SUNRPC: fix _xprt_switch_find_current_entry logic Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 080/583] pNFS: Fix the pnfs block drivers calculation of layoutget size Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 081/583] asm-generic: Fix 32 bit __generic_cmpxchg_local Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 082/583] arm64: dts: qcom: qrb4210-rb2: dont force usb peripheral mode Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 083/583] arm64: dts: qcom: sc8280xp-x13s: Use the correct DP PHY compatible Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 084/583] arm64: dts: qcom: sc8280xp-x13s: add missing camera LED pin config Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 085/583] ARM: dts: qcom: msm8226: provide dsi phy clocks to mmcc Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 086/583] wifi: plfxlc: check for allocation failure in plfxlc_usb_wreq_async() Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 087/583] wifi: rtw88: fix RX filter in FIF_ALLMULTI flag Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 088/583] bpf, lpm: Fix check prefixlen before walking trie Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 089/583] bpf: Add crosstask check to __bpf_get_stack Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 090/583] wifi: ath11k: Defer on rproc_get failure Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 091/583] wifi: libertas: stop selecting wext Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 092/583] ARM: dts: qcom: apq8064: correct XOADC register address Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 093/583] net/ncsi: Fix netlink major/minor version numbers Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 094/583] firmware: ti_sci: Fix an off-by-one in ti_sci_debugfs_create() Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 095/583] scsi: bfa: Use the proper data type for BLIST flags Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 096/583] wifi: rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 097/583] arm64: dts: ti: k3-am62a-main: Fix GPIO pin count in DT nodes Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 098/583] arm64: dts: ti: k3-am65-main: Fix DSS irq trigger type Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 099/583] arm64: dts: ti: iot2050: Re-add aliases Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 100/583] wifi: rtw88: sdio: Honor the host max_req_size in the RX path Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 101/583] selftests/bpf: Fix erroneous bitmask operation Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 102/583] md: synchronize flush io with array reconfiguration Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 103/583] bpf: enforce precision of R0 on callback return Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 104/583] ARM: dts: qcom: sdx65: correct PCIe EP phy-names Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 105/583] ARM: dts: qcom: sdx65: correct SPMI node name Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 106/583] dt-bindings: arm: qcom: Fix html link Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 107/583] arm64: dts: qcom: sc8180x-primus: Fix HALL_INT polarity Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 108/583] arm64: dts: qcom: sm8450: correct TX Soundwire clock Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 109/583] arm64: dts: qcom: sm8550: " Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 110/583] arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 111/583] arm64: dts: qcom: sc7280: Mark some nodes as reserved Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 112/583] arm64: dts: qcom: sc7280: Make watchdog bark interrupt edge triggered Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 113/583] arm64: dts: qcom: sdm845: " Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 114/583] arm64: dts: qcom: sm8150: " Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 115/583] arm64: dts: qcom: sm8250: " Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 116/583] arm64: dts: qcom: sa8775p: " Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 117/583] arm64: dts: qcom: sc8280xp: " Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 118/583] arm64: dts: qcom: sm6350: " Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 119/583] bpf: Add map and need_defer parameters to .map_fd_put_ptr() Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 120/583] bpf: Defer the free of inner map when necessary Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 121/583] selftests/net: specify the interface when do arping Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 122/583] bpf: fix check for attempt to corrupt spilled pointer Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 123/583] scsi: fnic: Return error if vmalloc() failed Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 124/583] arm64: dts: qcom: qrb2210-rb1: Hook up USB3 Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 125/583] arm64: dts: qcom: qrb2210-rb1: use USB host mode Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 126/583] arm64: dts: qcom: qrb5165-rb5: correct LED panic indicator Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 127/583] arm64: dts: qcom: sdm845-db845c: " Greg Kroah-Hartman
2024-01-22 23:52 ` [PATCH 6.6 128/583] arm64: dts: qcom: sm6125: add interrupts to DWC3 USB controller Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 129/583] arm64: dts: qcom: sm8350: Fix DMA0 address Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 130/583] arm64: dts: qcom: sc7280: Fix up GPU SIDs Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 131/583] arm64: dts: qcom: sc7280: Mark Adreno SMMU as DMA coherent Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 132/583] arm64: dts: qcom: sa8775p: fix USB wakeup interrupt types Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 133/583] arm64: dts: qcom: sc7280: fix usb_2 " Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 134/583] arm64: dts: qcom: sm8550: fix USB " Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 135/583] wifi: mt76: fix typo in mt76_get_of_eeprom_from_nvmem function Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 136/583] wifi: mt76: mt7915: fallback to non-wed mode if platform_get_resource fails in mt7915_mmio_wed_init() Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 137/583] wifi: mt76: mt7996: fix the size of struct bss_rate_tlv Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 138/583] wifi: mt76: mt7996: fix rate usage of inband discovery frames Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 139/583] wifi: mt76: mt7915: fix EEPROM offset of TSSI flag on MT7981 Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 140/583] wifi: mt76: mt7915: also MT7981 is 3T3R but nss2 on 5 GHz band Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 141/583] wifi: mt76: mt7921s: fix workqueue problem causes STA association fail Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 142/583] bpf: Fix verification of indirect var-off stack access Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 143/583] arm64: dts: hisilicon: hikey970-pmic: fix regulator cells properties Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 144/583] bpf: Guard stack limits against 32bit overflow Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 145/583] bpf: Fix accesses to uninit stack slots Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 146/583] dt-bindings: media: mediatek: mdp3: correct RDMA and WROT node with generic names Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 147/583] arm64: dts: mediatek: mt8183: correct MDP3 DMA-related nodes Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 148/583] arm64: dts: mediatek: mt8195: revise VDOSYS RDMA node name Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 149/583] arm64: dts: mediatek: mt8186: Fix alias prefix for ovl_2l0 Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 150/583] arm64: dts: mediatek: mt8186: fix address warning for ADSP mailboxes Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 151/583] wifi: mt76: mt7921: fix country count limitation for CLC Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 152/583] wifi: iwlwifi: dont support triggered EHT CQI feedback Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 153/583] selftests/bpf: Relax time_tai test for equal timestamps in tai_forward Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 154/583] block: Set memalloc_noio to false on device_add_disk() error path Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 155/583] arm64: dts: xilinx: Apply overlays to base dtbs Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 156/583] arm64: dts: renesas: white-hawk-cpu: Fix missing serial console pin control Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 157/583] arm64: dts: imx8mm: Reduce GPU to nominal speed Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 158/583] scsi: ufs: qcom: Fix the return value of ufs_qcom_ice_program_key() Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 159/583] scsi: ufs: qcom: Fix the return value when platform_get_resource_byname() fails Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 160/583] scsi: hisi_sas: Replace with standard error code return value Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 161/583] scsi: hisi_sas: Check before using pointer variables Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 162/583] scsi: hisi_sas: Rollback some operations if FLR failed Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 163/583] scsi: hisi_sas: Correct the number of global debugfs registers Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 164/583] ARM: dts: stm32: dont mix SCMI and non-SCMI board compatibles Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 165/583] bpf: Fix a race condition between btf_put() and map_free() Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 166/583] selftests/net: fix grep checking for fib_nexthop_multiprefix Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 167/583] ipmr: support IP_PKTINFO on cache report IGMP msg Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 168/583] virtio/vsock: fix logic which reduces credit update messages Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 169/583] virtio/vsock: send credit update during setting SO_RCVLOWAT Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 170/583] dma-mapping: clear dev->dma_mem to NULL after freeing it Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 171/583] bpf: Limit the number of uprobes when attaching program to multiple uprobes Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 172/583] bpf: Limit the number of kprobes when attaching program to multiple kprobes Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 173/583] arm64: dts: qcom: acer-aspire1: Correct audio codec definition Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 174/583] soc: qcom: llcc: Fix dis_cap_alloc and retain_on_pc configuration Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 175/583] arm64: dts: qcom: sm6375: fix USB wakeup interrupt types Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 176/583] arm64: dts: qcom: sm6375: Hook up MPM Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 177/583] arm64: dts: qcom: sm8150: make dispcc cast minimal vote on MMCX Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 178/583] arm64: dts: qcom: sm8150-hdk: fix SS USB regulators Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 179/583] soc: qcom: llcc: Fix LLCC_TRP_ATTR2_CFGn offset Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 180/583] block: add check of minors and first_minor in device_add_disk() Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 181/583] arm64: dts: qcom: sc7280: Mark SDHCI hosts as cache-coherent Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 182/583] arm64: dts: qcom: ipq6018: fix clock rates for GCC_USB0_MOCK_UTMI_CLK Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 183/583] arm64: dts: qcom: sm8550: Separate out X3 idle state Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 184/583] arm64: dts: qcom: sm8550: Update idle state time requirements Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 185/583] arm64: dts: qcom: sc8180x: Mark PCIe hosts cache-coherent Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 186/583] arm64: dts: qcom: sc8180x: switch PCIe QMP PHY to new style of bindings Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 187/583] arm64: dts: qcom: sc8180x: Fix up PCIe nodes Greg Kroah-Hartman
2024-01-22 23:53 ` [PATCH 6.6 188/583] bpf: Re-enable unit_size checking for global per-cpu allocator Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 189/583] bpf: Use pcpu_alloc_size() in bpf_mem_free{_rcu}() Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 190/583] bpf: Use c->unit_size to select target cache during free Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 191/583] wifi: rtlwifi: add calculate_bit_shift() Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 192/583] wifi: rtlwifi: rtl8188ee: phy: using calculate_bit_shift() Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 193/583] wifi: rtlwifi: rtl8192c: " Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 194/583] wifi: rtlwifi: rtl8192cu: " Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 195/583] wifi: rtlwifi: rtl8192ce: " Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 196/583] wifi: rtlwifi: rtl8192de: " Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 197/583] wifi: rtlwifi: rtl8192ee: " Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 198/583] wifi: rtlwifi: rtl8192se: " Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 199/583] wifi: iwlwifi: mvm: set siso/mimo chains to 1 in FW SMPS request Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 200/583] wifi: iwlwifi: mvm: send TX path flush in rfkill Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 201/583] wifi: iwlwifi: fix out of bound copy_from_user Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 202/583] wifi: iwlwifi: assign phy_ctxt before eSR activation Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 203/583] netfilter: nf_tables: mark newset as dead on transaction abort Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 204/583] netfilter: nf_tables: validate chain type update if available Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 205/583] Bluetooth: Fix bogus check for re-auth no supported with non-ssp Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 206/583] Bluetooth: btnxpuart: fix recv_buf() return value Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 207/583] Bluetooth: btmtkuart: " Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 208/583] null_blk: dont cap max_hw_sectors to BLK_DEF_MAX_SECTORS Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 209/583] arm64: dts: rockchip: Fix led pinctrl of lubancat 1 Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 210/583] wifi: cfg80211: correct comment about MLD ID Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 211/583] wifi: cfg80211: parse all ML elements in an ML probe response Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 212/583] bpf: sockmap, fix proto update hook to avoid dup calls Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 213/583] sctp: support MSG_ERRQUEUE flag in recvmsg() Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 214/583] sctp: fix busy polling Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 215/583] blk-cgroup: fix rcu lockdep warning in blkg_lookup() Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 216/583] net/sched: act_ct: fix skb leak and crash on ooo frags Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 217/583] mlxbf_gige: Fix intermittent no ip issue Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 218/583] mlxbf_gige: Enable the GigE port in mlxbf_gige_open Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 219/583] rxrpc: Fix skbuff cleanup of calls recvmsg_queue and rx_oos_queue Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 220/583] ip6_tunnel: fix NEXTHDR_FRAGMENT handling in ip6_tnl_parse_tlv_enc_lim() Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 221/583] ARM: davinci: always select CONFIG_CPU_ARM926T Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 222/583] Revert "drm/tidss: Annotate dma-fence critical section in commit path" Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 223/583] Revert "drm/omapdrm: " Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 224/583] drm/dp_mst: Fix fractional DSC bpp handling Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 225/583] drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off() Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 226/583] RDMA/usnic: Silence uninitialized symbol smatch warnings Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 227/583] RDMA/hns: Fix inappropriate err code for unsupported operations Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 228/583] drm/panel: nv3051d: Hold panel in reset for unprepare Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 229/583] drm/panel-elida-kd35t133: hold " Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 230/583] drm/nouveau/fence:: fix warning directly dereferencing a rcu pointer Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 231/583] drm/bridge: tpd12s015: Drop buggy __exit annotation for remove function Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 232/583] drm/tilcdc: Fix irq free on unload Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 233/583] media: pvrusb2: fix use after free on context disconnection Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 234/583] media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the crash of multi-core JPEG devices Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 235/583] media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 236/583] media: verisilicon: " Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 237/583] media: rkvdec: " Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 238/583] media: amphion: Fix VPU core alias name Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 239/583] drm/bridge: Fix typo in post_disable() description Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 240/583] f2fs: fix to avoid dirent corruption Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 241/583] drm/radeon/r600_cs: Fix possible int overflows in r600_cs_check_reg() Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 242/583] drm/radeon/r100: Fix integer overflow issues in r100_cs_track_check() Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 243/583] drm/radeon: check return value of radeon_ring_lock() Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 244/583] drm/tidss: Move reset to the end of dispc_init() Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 245/583] drm/tidss: Return error value from from softreset Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 246/583] drm/tidss: Check for K2G in in dispc_softreset() Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 247/583] drm/tidss: Fix dss reset Greg Kroah-Hartman
2024-01-22 23:54 ` [PATCH 6.6 248/583] drm/imx/lcdc: Fix double-free of driver data Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 249/583] ASoC: cs35l33: Fix GPIO name and drop legacy include Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 250/583] drm/msm/mdp4: flush vblank event on disable Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 251/583] drm/msm/dpu: Add missing safe_lut_tbl in sc8180x catalog Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 252/583] drm/msm/dsi: Use pm_runtime_resume_and_get to prevent refcnt leaks Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 253/583] drm/drv: propagate errors from drm_modeset_register_all() Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 254/583] media: v4l: async: Fix duplicated list deletion Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 255/583] ASoC: Intel: glk_rt5682_max98357a: fix board id mismatch Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 256/583] ASoC: Intel: sof_sdw_rt_sdca_jack_common: ctx->headset_codec_dev = NULL Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 257/583] ASoC: SOF: topology: Use partial match for disconnecting DAI link and DAI widget Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 258/583] drm/panfrost: Ignore core_mask for poweroff and disable PWRTRANS irq Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 259/583] drm/msm/dpu: correct clk bit for WB2 block Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 260/583] drm/radeon: check the alloc_workqueue return value in radeon_crtc_init() Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 261/583] drm/radeon/dpm: fix a memleak in sumo_parse_power_table Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 262/583] drm/radeon/trinity_dpm: fix a memleak in trinity_parse_power_table Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 263/583] drm/bridge: cdns-mhdp8546: Fix use of uninitialized variable Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 264/583] drm/bridge: tc358767: Fix return value on error case Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 265/583] media: cx231xx: fix a memleak in cx231xx_init_isoc Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 266/583] RDMA/hns: Fix memory leak in free_mr_init() Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 267/583] clk: qcom: gpucc-sm8150: Update the gpu_cc_pll1 config Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 268/583] media: bttv: start_streaming should return a proper error code Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 269/583] media: bttv: add back vbi hack Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 270/583] media: imx-mipi-csis: Fix clock handling in remove() Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 271/583] media: imx-mipi-csis: Drop extra clock enable at probe() Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 272/583] media: dt-bindings: media: rkisp1: Fix the port description for the parallel interface Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 273/583] media: rkisp1: Fix media device memory leak Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 274/583] drm/msm/adreno: Fix A680 chip id Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 275/583] drm/panel: st7701: Fix AVCL calculation Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 276/583] f2fs: fix to wait on block writeback for post_read case Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 277/583] f2fs: fix to check compress file in f2fs_move_file_range() Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 278/583] f2fs: fix to update iostat correctly in f2fs_filemap_fault() Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 279/583] media: dvbdev: drop refcount on error path in dvb_device_open() Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 280/583] media: dvb-frontends: m88ds3103: Fix a memory leak in an error handling path of m88ds3103_probe() Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 281/583] clk: renesas: rzg2l-cpg: Reuse code in rzg2l_cpg_reset() Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 282/583] clk: renesas: rzg2l: Check reset monitor registers Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 283/583] drm/msm/dpu: Set input_sel bit for INTF Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 284/583] drm/msm/dpu: Drop enable and frame_count parameters from dpu_hw_setup_misr() Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 285/583] drm/mediatek: Return error if MDP RDMA failed to enable the clock Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 286/583] drm/mediatek: Remove the redundant driver data for DPI Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 287/583] drm/mediatek: Fix underrun in VDO1 when switches off the layer Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 288/583] drm/amdgpu/debugfs: fix error code when smc register accessors are NULL Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 289/583] drm/amd/pm: fix a double-free in si_dpm_init Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 290/583] drivers/amd/pm: fix a use-after-free in kv_parse_power_table Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 291/583] gpu/drm/radeon: fix two memleaks in radeon_vm_init Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 292/583] drm/amd/pm: fix a double-free in amdgpu_parse_extended_power_table Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 293/583] f2fs: fix to check return value of f2fs_recover_xattr_data Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 294/583] dt-bindings: clock: Update the videocc resets for sm8150 Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 295/583] clk: qcom: videocc-sm8150: Update the videocc resets Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 296/583] clk: qcom: videocc-sm8150: Add missing PLL config property Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 297/583] clk: sp7021: fix return value check in sp7021_clk_probe() Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 298/583] drivers: clk: zynqmp: calculate closest mux rate Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 299/583] drivers: clk: zynqmp: update divider round rate logic Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 300/583] watchdog: set cdev owner before adding Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 301/583] watchdog/hpwdt: Only claim UNKNOWN NMI if from iLO Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 302/583] watchdog: bcm2835_wdt: Fix WDIOC_SETTIMEOUT handling Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 303/583] watchdog: rti_wdt: Drop runtime pm reference count when watchdog is unused Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 304/583] clk: rs9: Fix DIF OEn bit placement on 9FGV0241 Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 305/583] clk: si5341: fix an error code problem in si5341_output_clk_set_rate Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 306/583] ASoC: amd: vangogh: Drop conflicting ACPI-based probing Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 307/583] ASoC: tas2781: add support for FW version 0x0503 Greg Kroah-Hartman
2024-01-22 23:55 ` [PATCH 6.6 308/583] drm/mediatek: dp: Add phy_mtk_dp module as pre-dependency Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 309/583] accel/habanalabs: fix information leak in sec_attest_info() Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 310/583] clk: qcom: gcc-sm8550: Add the missing RETAIN_FF_ENABLE GDSC flag Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 311/583] clk: qcom: gcc-sm8550: Mark the PCIe GDSCs votable Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 312/583] clk: qcom: gcc-sm8550: use collapse-voting for PCIe GDSCs Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 313/583] clk: qcom: gcc-sm8550: Mark RCGs shared where applicable Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 314/583] clk: qcom: dispcc-sm8550: Update disp PLL settings Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 315/583] clk: fixed-rate: fix clk_hw_register_fixed_rate_with_accuracy_parent_hw Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 316/583] pwm: stm32: Use hweight32 in stm32_pwm_detect_channels Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 317/583] pwm: stm32: Fix enable count for clk in .probe() Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 318/583] ASoC: rt5645: Drop double EF20 entry from dmi_platform_data[] Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 319/583] ALSA: scarlett2: Add missing error check to scarlett2_config_save() Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 320/583] ALSA: scarlett2: Add missing error check to scarlett2_usb_set_config() Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 321/583] ALSA: scarlett2: Allow passing any output to line_out_remap() Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 322/583] ALSA: scarlett2: Add missing error checks to *_ctl_get() Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 323/583] ALSA: scarlett2: Add clamp() in scarlett2_mixer_ctl_put() Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 324/583] mmc: sdhci_am654: Fix TI SoC dependencies Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 325/583] mmc: sdhci_omap: " Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 326/583] drm/amdkfd: Fix type of dbg_flags in struct kfd_process Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 327/583] gpiolib: make gpio_device_get() and gpio_device_put() public Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 328/583] gpiolib: provide gpio_device_find() Greg Kroah-Hartman
2024-01-23  9:56   ` Bartosz Golaszewski
2024-01-23 12:14     ` Greg Kroah-Hartman
2024-01-23 13:13       ` Bartosz Golaszewski
2024-01-23 14:32         ` Greg Kroah-Hartman
2024-01-23 14:57           ` Bartosz Golaszewski
2024-01-22 23:56 ` [PATCH 6.6 329/583] gpio: sysfs: drop the mention of gpiochip_find() from sysfs code Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 330/583] IB/iser: Prevent invalidating wrong MR Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 331/583] drm/amdkfd: Confirm list is non-empty before utilizing list_first_entry in kfd_topology.c Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 332/583] drm/amd/pm/smu7: fix a memleak in smu7_hwmgr_backend_init Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 333/583] drm/amd/display: avoid stringop-overflow warnings for dp_decide_lane_settings() Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 334/583] kselftest/alsa - mixer-test: fix the number of parameters to ksft_exit_fail_msg() Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 335/583] kselftest/alsa - mixer-test: Fix the print format specifier warning Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 336/583] kselftest/alsa - conf: Stringify the printed errno in sysfs_get() Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 337/583] ksmbd: validate the zero field of packet header Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 338/583] of: Fix double free in of_parse_phandle_with_args_map Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 339/583] fbdev: imxfb: fix left margin setting Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 340/583] of: unittest: Fix of_count_phandle_with_args() expected value message Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 341/583] class: fix use-after-free in class_register() Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 342/583] kernfs: convert kernfs_idr_lock to an irq safe raw spinlock Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 343/583] Revert "kernfs: convert kernfs_idr_lock to an irq safe raw spinlock" Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 344/583] selftests/bpf: Add assert for user stacks in test_task_stack Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 345/583] keys, dns: Fix size check of V1 server-list header Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 346/583] binder: fix async space check for 0-sized buffers Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 347/583] binder: fix unused alloc->free_async_space Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 348/583] mips/smp: Call rcutree_report_cpu_starting() earlier Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 349/583] Input: atkbd - use ab83 as id when skipping the getid command Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 350/583] rust: Ignore preserve-most functions Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 351/583] Revert "drm/amdkfd: Relocate TBA/TMA to opposite side of VM hole" Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 352/583] xen-netback: dont produce zero-size SKB frags Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 353/583] binder: fix race between mmput() and do_exit() Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 354/583] clocksource/drivers/timer-ti-dm: Fix make W=n kerneldoc warnings Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 355/583] powerpc/64s: Increase default stack size to 32KB Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 356/583] tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 357/583] Revert "usb: gadget: f_uvc: change endpoint allocation in uvc_function_bind()" Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 358/583] usb: phy: mxs: remove CONFIG_USB_OTG condition for mxs_phy_is_otg_host() Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 359/583] usb: dwc: ep0: Update request status in dwc3_ep0_stall_restart Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 360/583] usb: dwc3: gadget: Handle EP0 request dequeuing properly Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 361/583] usb: dwc3: gadget: Queue PM runtime idle on disconnect event Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 362/583] Revert "usb: dwc3: Soft reset phy on probe for host" Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 363/583] Revert "usb: dwc3: dont reset device side if dwc3 was configured as host-only" Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 364/583] usb: chipidea: wait controller resume finished for wakeup irq Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 365/583] usb: cdns3: fix uvc failure work since sg support enabled Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 366/583] usb: cdns3: fix iso transfer error when mult is not zero Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 367/583] usb: cdns3: Fix uvc fail when DMA cross 4k boundery since sg enabled Greg Kroah-Hartman
2024-01-22 23:56 ` [PATCH 6.6 368/583] Revert "usb: typec: class: fix typec_altmode_put_partner to put plugs" Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 369/583] usb: typec: class: fix typec_altmode_put_partner to put plugs Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 370/583] usb: mon: Fix atomicity violation in mon_bin_vma_fault Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 371/583] dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp-phy: fix path to header Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 372/583] serial: core: fix sanitizing check for RTS settings Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 373/583] serial: core: make sure RS485 cannot be enabled when it is not supported Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 374/583] serial: 8250_bcm2835aux: Restore clock error handling Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 375/583] serial: core, imx: do not set RS485 enabled if it is not supported Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 376/583] serial: imx: Ensure that imx_uart_rs485_config() is called with enabled clock Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 377/583] serial: 8250_exar: Set missing rs485_supported flag Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 378/583] serial: omap: do not override settings for RS485 support Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 379/583] ALSA: oxygen: Fix right channel of capture volume mixer Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 380/583] ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq2xxx Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 381/583] ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on HP ZBook Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 382/583] ALSA: hda/realtek: Enable headset mic on Lenovo M70 Gen5 Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 383/583] ksmbd: validate mech token in session setup Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 384/583] ksmbd: fix UAF issue in ksmbd_tcp_new_connection() Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 385/583] ksmbd: only v2 leases handle the directory Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 386/583] ceph: select FS_ENCRYPTION_ALGS if FS_ENCRYPTION Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 387/583] LoongArch: Fix and simplify fcsr initialization on execve() Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 388/583] io_uring: dont check iopoll if request completes Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 389/583] io_uring/rw: ensure io->bytes_done is always initialized Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 390/583] io_uring: ensure local task_work is run on wait timeout Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 391/583] fbdev/acornfb: Fix name of fb_ops initializer macro Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 392/583] fbdev: flush deferred work in fb_deferred_io_fsync() Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 393/583] fbdev: flush deferred IO before closing Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 394/583] scsi: ufs: core: Simplify power management during async scan Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 395/583] scsi: target: core: add missing file_{start,end}_write() Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 396/583] scsi: mpi3mr: Refresh sdev queue depth after controller reset Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 397/583] scsi: mpi3mr: Clean up block devices post " Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 398/583] scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable State Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 399/583] md: bypass block throttle for superblock update Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 400/583] drm/amd: Enable PCIe PME from D3 Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 401/583] block: add check that partition length needs to be aligned with block size Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 402/583] block: Remove special-casing of compound pages Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 403/583] block: Fix iterating over an empty bio with bio_for_each_folio_all Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 404/583] netfilter: nf_tables: check if catch-all set element is active in next generation Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 405/583] pwm: jz4740: Dont use dev_err_probe() in .request() Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 406/583] pwm: Fix out-of-bounds access in of_pwm_single_xlate() Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 407/583] md/raid1: Use blk_opf_t for read and write operations Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 408/583] rootfs: Fix support for rootfstype= when root= is given Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 409/583] Bluetooth: Fix atomicity violation in {min,max}_key_size_set Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 410/583] bpf: Fix re-attachment branch in bpf_tracing_prog_attach Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 411/583] iommu/arm-smmu-qcom: Add missing GMU entry to match table Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 412/583] iommu/dma: Trace bounce buffer usage when mapping buffers Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 413/583] wifi: mt76: fix broken precal loading from MTD for mt7915 Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 414/583] wifi: rtlwifi: Remove bogus and dangerous ASPM disable/enable code Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 415/583] wifi: rtlwifi: Convert LNKCTL change to PCIe cap RMW accessors Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 416/583] wifi: mwifiex: add extra delay for firmware ready Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 417/583] wifi: mwifiex: configure BSSID consistently when starting AP Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 418/583] wifi: mwifiex: fix uninitialized firmware_stat Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 419/583] net: stmmac: fix ethtool per-queue statistics Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 420/583] Revert "net: rtnetlink: Enslave device before bringing it up" Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 421/583] Revert "nSVM: Check for reserved encodings of TLB_CONTROL in nested VMCB" Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 422/583] cxl/port: Fix decoder initialization when nr_targets > interleave_ways Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 423/583] PCI/P2PDMA: Remove reference to pci_p2pdma_map_sg() Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 424/583] x86/pci: Reserve ECAM if BIOS didnt include it in PNP0C02 _CRS Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 425/583] PCI: dwc: endpoint: Fix dw_pcie_ep_raise_msix_irq() alignment support Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 426/583] PCI: mediatek: Clear interrupt status before dispatching handler Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 427/583] x86/kvm: Do not try to disable kvmclock if it was not enabled Greg Kroah-Hartman
2024-01-22 23:57 ` [PATCH 6.6 428/583] KVM: arm64: vgic-v4: Restore pending state on host userspace write Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 429/583] KVM: arm64: vgic-its: Avoid potential UAF in LPI translation cache Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 430/583] KVM: x86/pmu: Move PMU reset logic to common x86 code Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 431/583] KVM: x86/pmu: Reset the PMU, i.e. stop counters, before refreshing Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 432/583] iio: adc: ad7091r: Pass iio_dev to event handler Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 433/583] HID: sensor-hub: Enable hid core report processing for all devices Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 434/583] HID: wacom: Correct behavior when processing some confidence == false touches Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 435/583] serial: sc16is7xx: add check for unsupported SPI modes during probe Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 436/583] serial: sc16is7xx: set safe default SPI clock frequency Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 437/583] ARM: 9330/1: davinci: also select PINCTRL Greg Kroah-Hartman
2024-01-22 23:58   ` Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 438/583] mfd: rk8xx: fixup devices registration with PLATFORM_DEVID_AUTO Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 439/583] mfd: cs42l43: Correct SoundWire port list Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 440/583] mfd: syscon: Fix null pointer dereference in of_syscon_register() Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 441/583] leds: aw2013: Select missing dependency REGMAP_I2C Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 442/583] leds: aw200xx: Fix write to DIM parameter Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 443/583] mfd: tps6594: Add null pointer check to tps6594_device_init() Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 444/583] mfd: intel-lpss: Fix the fractional clock divider flags Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 445/583] srcu: Use try-lock lockdep annotation for NMI-safe access Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 446/583] mips: dmi: Fix early remap on MIPS32 Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 447/583] mips: Fix incorrect max_low_pfn adjustment Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 448/583] um: virt-pci: fix platform map offset Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 449/583] riscv: Check if the code to patch lies in the exit section Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 450/583] riscv: Fix module_alloc() that did not reset the linear mapping permissions Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 451/583] riscv: Fix set_memory_XX() and set_direct_map_XX() by splitting huge linear mappings Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 452/583] riscv: Fix set_direct_map_default_noflush() to reset _PAGE_EXEC Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 453/583] riscv: Fixed wrong register in XIP_FIXUP_FLASH_OFFSET macro Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 454/583] MIPS: Alchemy: Fix an out-of-bound access in db1200_dev_setup() Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 455/583] MIPS: Alchemy: Fix an out-of-bound access in db1550_dev_setup() Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 456/583] power: supply: cw2015: correct time_to_empty units in sysfs Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 457/583] power: supply: bq256xx: fix some problem in bq256xx_hw_init Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 458/583] PCI: Avoid potential out-of-bounds read in pci_dev_for_each_resource() Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 459/583] serial: 8250: omap: Dont skip resource freeing if pm_runtime_resume_and_get() failed Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 460/583] iommu: Map reserved memory as cacheable if device is coherent Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 461/583] perf test: Remove atomics from test_loop to avoid test failures Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 462/583] perf header: Fix segfault on build_mem_topology() error path Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 463/583] libapi: Add missing linux/types.h header to get the __u64 type on io.h Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 464/583] usb: core: Allow subclassed USB drivers to override usb_choose_configuration() Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 465/583] r8152: Choose our USB config with choose_configuration() rather than probe() Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 466/583] perf test record user-regs: Fix mask for vg register Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 467/583] vfio/pds: Fix calculations in pds_vfio_dirty_sync Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 468/583] perf vendor events arm64 AmpereOne: Rename BPU_FLUSH_MEM_FAULT to GPC_FLUSH_MEM_FAULT Greg Kroah-Hartman
2024-01-22 23:58   ` Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 469/583] perf mem: Fix error on hybrid related to availability of mem event in a PMU Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 470/583] perf stat: Exit perf stat if parse groups fails Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 471/583] base/node.c: initialize the accessor list before registering Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 472/583] acpi: property: Let args be NULL in __acpi_node_get_property_reference Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 473/583] software node: Let args be NULL in software_node_get_reference_args Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 474/583] serial: imx: fix tx statemachine deadlock Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 475/583] selftests/sgx: Fix uninitialized pointer dereference in error path Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 476/583] selftests/sgx: Fix uninitialized pointer dereferences in encl_get_entry Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 477/583] selftests/sgx: Include memory clobber for inline asm in test enclave Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 478/583] selftests/sgx: Skip non X86_64 platform Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 479/583] iio: adc: ad9467: fix reset gpio handling Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 480/583] iio: adc: ad9467: dont ignore error codes Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 481/583] iio: adc: ad9467: add mutex to struct ad9467_state Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 482/583] iio: adc: ad9467: fix scale setting Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 483/583] perf header: Fix one memory leakage in perf_event__fprintf_event_update() Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 484/583] perf hisi-ptt: Fix one memory leakage in hisi_ptt_process_auxtrace_event() Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 485/583] perf genelf: Set ELF program header addresses properly Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 486/583] perf unwind-libdw: Handle JIT-generated DSOs properly Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 487/583] perf unwind-libunwind: Fix base address for .eh_frame Greg Kroah-Hartman
2024-01-22 23:58 ` [PATCH 6.6 488/583] bus: mhi: ep: Do not allocate event ring element on stack Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 489/583] bus: mhi: ep: Use slab allocator where applicable Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 490/583] bus: mhi: ep: Pass mhi_ep_buf_info struct to read/write APIs Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 491/583] PCI: epf-mhi: Fix the DMA data direction of dma_unmap_single() Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 492/583] tty: early return from send_break() on TTY_DRIVER_HARDWARE_BREAK Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 493/583] tty: dont check for signal_pending() in send_break() Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 494/583] tty: use if in send_break() instead of goto Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 495/583] usb: cdc-acm: return correct error code on unsupported break Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 496/583] usb: core: Fix crash w/ usb_choose_configuration() if no driver Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 497/583] spmi: mtk-pmif: Serialize PMIF status check and command submission Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 498/583] usb: gadget: webcam: Make g_webcam loadable again Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 499/583] iommu: Dont reserve 0-length IOVA region Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 500/583] power: supply: Fix null pointer dereference in smb2_probe Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 501/583] vdpa: Fix an error handling path in eni_vdpa_probe() Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 502/583] apparmor: Fix ref count leak in task_kill Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 503/583] nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 504/583] nvmet-tcp: fix a crash in nvmet_req_complete() Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 505/583] perf env: Avoid recursively taking env->bpf_progs.lock Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 506/583] perf stat: Fix hard coded LL miss units Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 507/583] cxl/region: fix x9 interleave typo Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 508/583] apparmor: fix possible memory leak in unpack_trans_table Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 509/583] apparmor: avoid crash when parsed profile name is empty Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 510/583] usb: xhci-mtk: fix a short packet issue of gen1 isoc-in transfer Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 511/583] serial: imx: Correct clock error message in function probe() Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 512/583] serial: apbuart: fix console prompt on qemu Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 513/583] perf db-export: Fix missing reference count get in call_path_from_sample() Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 514/583] cxl/port: Fix missing target list lock Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 515/583] spi: coldfire-qspi: Remove an erroneous clk_disable_unprepare() from the remove function Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 516/583] hisi_acc_vfio_pci: Update migration data pointer correctly on saving/resume Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 517/583] nvmet: re-fix tracing strncpy() warning Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 518/583] nvme: trace: avoid memcpy overflow warning Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 519/583] nvmet-tcp: Fix the H2C expected PDU len calculation Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 520/583] PCI: keystone: Fix race condition when initializing PHYs Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 521/583] PCI: mediatek-gen3: Fix translation window size calculation Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 522/583] ASoC: mediatek: sof-common: Add NULL check for normal_link string Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 523/583] s390/pci: fix max size calculation in zpci_memcpy_toio() Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 524/583] net: qualcomm: rmnet: fix global oob in rmnet_policy Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 525/583] rxrpc: Fix use of Dont Fragment flag Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 526/583] octeontx2-af: CN10KB: Fix FIFO length calculation for RPM2 Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 527/583] net: ethernet: ti: am65-cpsw: Fix max mtu to fit ethernet frames Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 528/583] amt: do not use overwrapped cb area Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 529/583] net: micrel: Fix PTP frame parsing for lan8841 Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 530/583] net: phy: micrel: populate .soft_reset for KSZ9131 Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 531/583] ALSA: hda: Properly setup HDMI stream Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 532/583] mptcp: mptcp_parse_option() fix for MPTCPOPT_MP_JOIN Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 533/583] mptcp: strict validation before using mp_opt->hmac Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 534/583] mptcp: use OPTION_MPTCP_MPJ_SYNACK in subflow_finish_connect() Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 535/583] mptcp: use OPTION_MPTCP_MPJ_SYN in subflow_check_req() Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 536/583] mptcp: refine opt_mp_capable determination Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 537/583] block: ensure we hold a queue reference when using queue limits Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 538/583] net: stmmac: Fix ethool link settings ops for integrated PCS Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 539/583] udp: annotate data-races around up->pending Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 540/583] erofs: simplify compression configuration parser Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 541/583] erofs: fix inconsistent per-file compression format Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 542/583] net: add more sanity check in virtio_net_hdr_to_skb() Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 543/583] net: netdev_queue: netdev_txq_completed_mb(): fix wake condition Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 544/583] bpf: iter_udp: Retry with a larger batch size without going back to the previous bucket Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 545/583] bpf: Avoid iter->offset making backward progress in bpf_iter_udp Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 546/583] net: tls, fix WARNIING in __sk_msg_free Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 547/583] net: ravb: Fix dma_addr_t truncation in error case Greg Kroah-Hartman
2024-01-22 23:59 ` [PATCH 6.6 548/583] dt-bindings: gpio: xilinx: Fix node address in gpio Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 549/583] gpio: mlxbf3: add an error code check in mlxbf3_gpio_probe Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 550/583] ASoC: SOF: ipc4-loader: remove the CPC check warnings Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 551/583] drm/amdkfd: fixes for HMM mem allocation Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 552/583] drm/amdgpu: fall back to INPUT power for AVG power via INFO IOCTL Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 553/583] selftests: bonding: Change script interpreter Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 554/583] net: stmmac: ethtool: Fixed calltrace caused by unbalanced disable_irq_wake calls Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 555/583] bpf: Reject variable offset alu on PTR_TO_FLOW_KEYS Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 556/583] net: dsa: vsc73xx: Add null pointer check to vsc73xx_gpio_probe Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 557/583] LoongArch: BPF: Prevent out-of-bounds memory access Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 558/583] mptcp: relax check on MPC passive fallback Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 559/583] net: netdevsim: dont try to destroy PHC on VFs Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 560/583] netfilter: nf_tables: reject invalid set policy Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 561/583] netfilter: nft_limit: do not ignore unsupported flags Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 562/583] netfilter: nfnetlink_log: use proper helper for fetching physinif Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 563/583] netfilter: nf_queue: remove excess nf_bridge variable Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 564/583] netfilter: propagate net to nf_bridge_get_physindev Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 565/583] netfilter: bridge: replace physindev with physinif in nf_bridge_info Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 566/583] netfilter: nf_tables: do not allow mismatch field size and set key length Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 567/583] netfilter: nf_tables: skip dead set elements in netlink dump Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 568/583] netfilter: nf_tables: reject NFT_SET_CONCAT with not field length description Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 569/583] ipvs: avoid stat macros calls from preemptible context Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 570/583] io_uring: adjust defer tw counting Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 571/583] kdb: Fix a potential buffer overflow in kdb_local() Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 572/583] arm64/ptrace: Dont flush ZA/ZT storage when writing ZA via ptrace Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 573/583] ethtool: netlink: Add missing ethnl_ops_begin/complete Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 574/583] loop: fix the the direct I/O support check when used on top of block devices Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 575/583] mlxsw: spectrum_acl_erp: Fix error flow of pool allocation failure Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 576/583] mlxsw: spectrum_acl_tcam: Fix NULL pointer dereference in error path Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 577/583] mlxsw: spectrum_acl_tcam: Fix stack corruption Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 578/583] mlxsw: spectrum_router: Register netdevice notifier before nexthop Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 579/583] selftests: mlxsw: qos_pfc: Adjust the test to support 8 lanes Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 580/583] ipv6: mcast: fix data-race in ipv6_mc_down / mld_ifc_work Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 581/583] i2c: s3c24xx: fix read transfers in polling mode Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 582/583] i2c: s3c24xx: fix transferring more than one message " Greg Kroah-Hartman
2024-01-23  0:00 ` [PATCH 6.6 583/583] riscv: Fix wrong usage of lm_alias() when splitting a huge linear mapping Greg Kroah-Hartman
2024-01-23  1:50 ` [PATCH 6.6 000/583] 6.6.14-rc1 review SeongJae Park
2024-01-23  8:40 ` Luna Jernberg
2024-01-23  8:42   ` Luna Jernberg
2024-01-23 11:46 ` Takeshi Ogasawara
2024-01-23 15:41 ` Jon Hunter
2024-01-23 17:23 ` Allen
2024-01-24  0:19 ` Justin Forbes
2024-01-24  9:27 ` Harshit Mogalapalli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.