]> git.ipfire.org Git - people/ms/linux.git/log
people/ms/linux.git
3 years agogfs2: stop using generic_writepages in gfs2_ail1_start_one
Christoph Hellwig [Fri, 22 Jul 2022 17:59:15 +0000 (10:59 -0700)] 
gfs2: stop using generic_writepages in gfs2_ail1_start_one

Use filemap_fdatawrite_wbc instead of generic_writepages in
gfs2_ail1_start_one so that the functin can also cope with address_space
operations that only implement ->writepages and to properly account
for cgroup writeback.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
3 years agoxfs: Fix typo 'the the' in comment
Slark Xiao [Fri, 22 Jul 2022 17:58:17 +0000 (10:58 -0700)] 
xfs: Fix typo 'the the' in comment

Replace 'the the' with 'the' in the comment.

Signed-off-by: Slark Xiao <slark_xiao@163.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
3 years agoxfs: Fix comment typo
Xin Gao [Fri, 22 Jul 2022 02:47:13 +0000 (19:47 -0700)] 
xfs: Fix comment typo

The double `the' is duplicated in line 552, remove one.

Signed-off-by: Xin Gao <gaoxin@cdjrlc.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
3 years agoiavf: Check for duplicate TC flower filter before parsing
Avinash Dayanand [Tue, 21 Jun 2022 18:39:33 +0000 (14:39 -0400)] 
iavf: Check for duplicate TC flower filter before parsing

Record of all the TC flower filters are kept for local book keeping, so
take advantage of that and check for duplicate filter even before sending
a request to the PF driver.

Signed-off-by: Avinash Dayanand <avinash.dayanand@intel.com>
Signed-off-by: Jun Zhang <xuejun.zhang@intel.com>
Tested-by: Bharathi Sreenivas <bharathi.sreenivas@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
3 years agobpf/selftests: Fix couldn't retrieve pinned program in xdp veth test
Jie2x Zhou [Tue, 19 Jul 2022 08:24:30 +0000 (16:24 +0800)] 
bpf/selftests: Fix couldn't retrieve pinned program in xdp veth test

Before change:

  selftests: bpf: test_xdp_veth.sh
  Couldn't retrieve pinned program '/sys/fs/bpf/test_xdp_veth/progs/redirect_map_0': No such file or directory
  selftests: xdp_veth [SKIP]
  ok 20 selftests: bpf: test_xdp_veth.sh # SKIP

After change:

  PING 10.1.1.33 (10.1.1.33) 56(84) bytes of data.
  64 bytes from 10.1.1.33: icmp_seq=1 ttl=64 time=0.320 ms
  --- 10.1.1.33 ping statistics ---
  1 packets transmitted, 1 received, 0% packet loss, time 0ms
  rtt min/avg/max/mdev = 0.320/0.320/0.320/0.000 ms
  selftests: xdp_veth [PASS]

For the test case, the following can be found:

  ls /sys/fs/bpf/test_xdp_veth/progs/redirect_map_0
  ls: cannot access '/sys/fs/bpf/test_xdp_veth/progs/redirect_map_0': No such file or directory
  ls /sys/fs/bpf/test_xdp_veth/progs/
  xdp_redirect_map_0  xdp_redirect_map_1  xdp_redirect_map_2

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jie2x Zhou <jie2x.zhou@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220719082430.9916-1-jie2x.zhou@intel.com
3 years agoMerge tag 'rcu-urgent.2022.07.21a' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 22 Jul 2022 17:01:20 +0000 (10:01 -0700)] 
Merge tag 'rcu-urgent.2022.07.21a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu

Pull RCU fix from Paul McKenney:
 "This contains a pair of commits that fix 282d8998e997 ("srcu: Prevent
  expedited GPs and blocking readers from consuming CPU"), which was
  itself a fix to an SRCU expedited grace-period problem that could
  prevent kernel live patching (KLP) from completing.

  That SRCU fix for KLP introduced large (as in minutes) boot-time
  delays to embedded Linux kernels running on qemu/KVM. These delays
  were due to the emulation of certain MMIO operations controlling
  memory layout, which were emulated with one expedited grace period per
  access. Common configurations required thousands of boot-time MMIO
  accesses, and thus thousands of boot-time expedited SRCU grace
  periods.

  In these configurations, the occasional sleeps that allowed KLP to
  proceed caused excessive boot delays. These commits preserve enough
  sleeps to permit KLP to proceed, but few enough that the virtual
  embedded kernels still boot reasonably quickly.

  This represents a regression introduced in the v5.19 merge window, and
  the bug is causing significant inconvenience"

* tag 'rcu-urgent.2022.07.21a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu:
  srcu: Make expedited RCU grace periods block even less frequently
  srcu: Block less aggressively for expedited grace periods

3 years agoi40e: Refactor tc mqprio checks
Przemyslaw Patynowski [Wed, 8 Jun 2022 11:52:48 +0000 (13:52 +0200)] 
i40e: Refactor tc mqprio checks

Refactor bitwise checks for whether TC MQPRIO is enabled
into one single method for improved readability.

Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com>
Tested-by: Bharathi Sreenivas <bharathi.sreenivas@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
3 years agoi2c: brcmstb: Use dev_name() for adapter name
Florian Fainelli [Tue, 19 Jul 2022 04:06:10 +0000 (21:06 -0700)] 
i2c: brcmstb: Use dev_name() for adapter name

This make it easier to disambiguate the different i2c controllers
present in a system, and then correlating with /proc/interrupts allows
to know which instance is interrupt driven and which one is not.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
3 years agoi2c: Add Renesas RZ/V2M controller
Phil Edworthy [Fri, 8 Jul 2022 10:03:50 +0000 (11:03 +0100)] 
i2c: Add Renesas RZ/V2M controller

Yet another i2c controller from Renesas that is found on the RZ/V2M
(r9a09g011) SoC. It can support only 100kHz and 400KHz operation.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
[wsa: removed superfluous class type and renamed a function]
Signed-off-by: Wolfram Sang <wsa@kernel.org>
3 years agodt-bindings: i2c: Document RZ/V2M I2C controller
Phil Edworthy [Fri, 8 Jul 2022 10:03:49 +0000 (11:03 +0100)] 
dt-bindings: i2c: Document RZ/V2M I2C controller

Document Renesas RZ/V2M (r9a09g011) I2C controller bindings.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
3 years agommu_gather: fix the CONFIG_MMU_GATHER_NO_RANGE case
Linus Torvalds [Fri, 22 Jul 2022 16:28:34 +0000 (09:28 -0700)] 
mmu_gather: fix the CONFIG_MMU_GATHER_NO_RANGE case

Sudip reports that alpha doesn't build properly, with errors like

  include/asm-generic/tlb.h:401:1: error: redefinition of 'tlb_update_vma_flags'
    401 | tlb_update_vma_flags(struct mmu_gather *tlb, struct vm_area_struct *vma)
        | ^~~~~~~~~~~~~~~~~~~~
  include/asm-generic/tlb.h:372:1: note: previous definition of 'tlb_update_vma_flags' with type 'void(struct mmu_gather *, struct vm_area_struct *)'
    372 | tlb_update_vma_flags(struct mmu_gather *tlb, struct vm_area_struct *vma) { }

the cause being that We have this odd situation where some architectures
were never converted to the newer TLB flushing interfaces that have a
range for the flush.  Instead people left them alone, and we have them
select the MMU_GATHER_NO_RANGE config option to make the tlb header
files account for this.

Peter Zijlstra cleaned some of these nasty header file games up in
commits

  1e9fdf21a433 ("mmu_gather: Remove per arch tlb_{start,end}_vma()")
  18ba064e42df ("mmu_gather: Let there be one tlb_{start,end}_vma() implementation")

but tlb_update_vma_flags() was left alone, and then commit b67fbebd4cf9
("mmu_gather: Force tlb-flush VM_PFNMAP vmas") ended up removing only
_one_ of the two stale duplicate dummy inline functions.

This removes the other stale one.

Somebody braver than me should try to remove MMU_GATHER_NO_RANGE
entirely, but it requires fixing up the oddball architectures that use
it: alpha, m68k, microblaze, nios2 and openrisc.

The fixups should be fairly straightforward ("fix the build errors it
exposes by adding the appropriate range arguments"), but the reason this
wasn't done in the first place is that so few people end up working on
those architectures.  But it could be done one architecture at a time,
hint, hint.

Reported-by: Sudip Mukherjee (Codethink) <sudipm.mukherjee@gmail.com>
Fixes: b67fbebd4cf9 ("mmu_gather: Force tlb-flush VM_PFNMAP vmas")
Link: https://lore.kernel.org/all/YtpXh0QHWwaEWVAY@debian/
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Nick Piggin <npiggin@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 years agobpf: Fix build error in case of !CONFIG_DEBUG_INFO_BTF
Kumar Kartikeya Dwivedi [Fri, 22 Jul 2022 11:36:05 +0000 (13:36 +0200)] 
bpf: Fix build error in case of !CONFIG_DEBUG_INFO_BTF

BTF_ID_FLAGS macro needs to be able to take 0 or 1 args, so make it a
variable argument. BTF_SET8_END is incorrect, it should just be empty.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: ab21d6063c01 ("bpf: Introduce 8-byte BTF set")
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20220722113605.6513-1-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
3 years agokcsan: test: Add a .kunitconfig to run KCSAN tests
David Gow [Fri, 15 Jul 2022 06:40:52 +0000 (14:40 +0800)] 
kcsan: test: Add a .kunitconfig to run KCSAN tests

Add a .kunitconfig file, which provides a default, working config for
running the KCSAN tests. Note that it needs to run on an SMP machine, so
to run under kunit_tool, the --qemu_args option should be used (on a
supported architecture, like x86_64). For example:
./tools/testing/kunit/kunit.py run --arch=x86_64 --qemu_args='-smp 8'
--kunitconfig=kernel/kcsan

Signed-off-by: David Gow <davidgow@google.com>
Reviewed-by: Marco Elver <elver@google.com>
Acked-by: Brendan Higgins <brendanhiggins@google.com>
Tested-by: Daniel Latypov <dlatypov@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
3 years agoublk_drv: make sure that correct flags(features) returned to userspace
Ming Lei [Fri, 22 Jul 2022 10:38:17 +0000 (18:38 +0800)] 
ublk_drv: make sure that correct flags(features) returned to userspace

Userspace may support more features or new added flags, but the driver
side can be old, so make sure correct flags(features) returned to
userpsace, then userspace can work as expected.

Also mark the 2nd flags as reversed, just use the 1st one. When we run
out of flags, the reserved one can be handled at that time.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: ZiyangZhang <ZiyangZhang@linux.alibaba.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20220722103817.631258-3-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 years agoublk_drv: fix error handling of ublk_add_dev
Christoph Hellwig [Fri, 22 Jul 2022 10:38:16 +0000 (18:38 +0800)] 
ublk_drv: fix error handling of ublk_add_dev

__ublk_destroy_dev() is called for handling error in ublk_add_dev(),
but either tagset isn't allocated or mutex isn't initialized.

So fix the issue by letting replacing ublk_add_dev with a
ublk_add_tag_set function that is much more limited in scope and
instead unwind every single step directly in ublk_ctrl_add_dev.
To allow for this refactor the device freeing so that there is
a helper for freeing the device number instead of coupling that
with freeing the mutex and the memory.

Note that this now copies the dev_info to userspace before adding
the character device.  This not only simplifies the erro handling
in ublk_ctrl_add_dev, but also means that the character device
can only be seen by userspace if the device addition succeeded.

Based on a patch from Ming Lei.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20220722103817.631258-2-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 years agoswiotlb: clean up some coding style and minor issues
Tianyu Lan [Fri, 22 Jul 2022 03:38:46 +0000 (23:38 -0400)] 
swiotlb: clean up some coding style and minor issues

- Fix the used field of struct io_tlb_area wasn't initialized
- Set area number to be 0 if input area number parameter is 0
- Use array_size() to calculate io_tlb_area array size
- Make parameters of swiotlb_do_find_slots() more reasonable

Fixes: 26ffb91fa5e0 ("swiotlb: split up the global swiotlb lock")
Signed-off-by: Tianyu Lan <tiala@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
3 years agoALSA: usb-audio: Add quirk for Behringer UMC202HD
Takashi Iwai [Fri, 22 Jul 2022 14:39:48 +0000 (16:39 +0200)] 
ALSA: usb-audio: Add quirk for Behringer UMC202HD

Just like other Behringer models, UMC202HD (USB ID 1397:0507) requires
the quirk for the stable streaming, too.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215934
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220722143948.29804-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
3 years agodma-mapping: update comment after dmabounce removal
Lukas Bulwahn [Wed, 20 Jul 2022 19:02:08 +0000 (21:02 +0200)] 
dma-mapping: update comment after dmabounce removal

Commit e3217540c271 ("ARM/dma-mapping: remove dmabounce") removes the
config DMABOUNCE. A comment to the function __dma_page_cpu_to_dev() refers
to this removed config DMABOUNCE.

Remove the obsolete explanation, but keep the recommendation not to use
__dma_page_cpu_to_dev() and use dma_sync_* functions instead.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
3 years agoscsi: sd: Add a comment about limiting max_sectors to shost optimal limit
John Garry [Tue, 19 Jul 2022 09:51:04 +0000 (17:51 +0800)] 
scsi: sd: Add a comment about limiting max_sectors to shost optimal limit

Add a comment about limiting the default the SCSI disk request_queue
max_sectors initial value to that of the SCSI host optimal sectors limit.

Suggested-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
3 years agoRDMA: Fix comment typo
Xin Gao [Fri, 22 Jul 2022 02:18:33 +0000 (10:18 +0800)] 
RDMA: Fix comment typo

The double `get' is duplicated, remove one.

Link: https://lore.kernel.org/r/20220722021833.15669-1-gaoxin@cdjrlc.com
Signed-off-by: Xin Gao <gaoxin@cdjrlc.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
3 years agoIB: Fix repeated words 'the the' comments
Slark Xiao [Thu, 21 Jul 2022 08:52:32 +0000 (16:52 +0800)] 
IB: Fix repeated words 'the the' comments

Replace 'the the' with 'the' in the comments.

Signed-off-by: Slark Xiao <slark_xiao@163.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
3 years agoARM: dts: lan966x: Enable network driver on pcb8291
Horatiu Vultur [Tue, 19 Jul 2022 20:11:58 +0000 (22:11 +0200)] 
ARM: dts: lan966x: Enable network driver on pcb8291

The pcb8291 has 2 ports that are connected to the internal ports
of the switch. Enable them in DT.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
[claudiu.beznea: moved status ="okay" at the end for port0 and port1]
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20220719201158.1696168-4-horatiu.vultur@microchip.com
3 years agodrivers: iommu: fix clang -wformat warning
Justin Stitt [Thu, 21 Jul 2022 21:03:31 +0000 (14:03 -0700)] 
drivers: iommu: fix clang -wformat warning

When building with Clang we encounter the following warning:
| drivers/iommu/msm_iommu.c:603:6: error: format specifies type 'unsigned
| short' but the argument has type 'int' [-Werror,-Wformat] sid);

`sid` is an int, use the proper format specifier `%x`.

Link: https://github.com/ClangBuiltLinux/linux/issues/378
Reported-by: Nathan Chancellor <nathan@kernel.org>
Suggested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Justin Stitt <justinstitt@google.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20220721210331.4012015-1-justinstitt@google.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
3 years agoMerge tag 'arm-smmu-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/will...
Joerg Roedel [Fri, 22 Jul 2022 14:33:13 +0000 (16:33 +0200)] 
Merge tag 'arm-smmu-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into arm/smmu

Arm SMMU updates for 5.20

- Add even more Qualcomm device-tree compatible strings

- Support dumping of IMP DEF Qualcomm registers on TLB sync timeout

- Fix reference count leak on device tree node in Qualcomm driver

3 years agoerofs: get rid of the leftover PAGE_SIZE in dir.c
Gao Xiang [Sun, 19 Jun 2022 15:09:40 +0000 (23:09 +0800)] 
erofs: get rid of the leftover PAGE_SIZE in dir.c

Convert the last hardcoded PAGE_SIZEs of uncompressed cases.

Reviewed-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20220619150940.121005-1-hsiangkao@linux.alibaba.com
3 years agoerofs: get rid of erofs_prepare_dio() helper
Gao Xiang [Wed, 20 Jul 2022 08:22:29 +0000 (16:22 +0800)] 
erofs: get rid of erofs_prepare_dio() helper

Fold in erofs_prepare_dio() in order to simplify the code.

Reviewed-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20220720082229.12172-1-hsiangkao@linux.alibaba.com
3 years agoerofs: introduce multi-reference pclusters (fully-referenced)
Gao Xiang [Fri, 15 Jul 2022 15:42:03 +0000 (23:42 +0800)] 
erofs: introduce multi-reference pclusters (fully-referenced)

Let's introduce multi-reference pclusters at runtime. In details,
if one pcluster is requested by multiple extents at almost the same
time (even belong to different files), the longest extent will be
decompressed as representative and the other extents are actually
copied from the longest one in one round.

After this patch, fully-referenced extents can be correctly handled
and the full decoding check needs to be bypassed for
partial-referenced extents.

Acked-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20220715154203.48093-17-hsiangkao@linux.alibaba.com
3 years agoHID: apple: Add "GANSS" to the non-Apple list
Hilton Chain [Thu, 21 Jul 2022 14:34:23 +0000 (22:34 +0800)] 
HID: apple: Add "GANSS" to the non-Apple list

While using the name "SONiX USB DEVICE" for wired mode, my GANSS keyboard
uses "GANSS" for bluetooth mode as well, so adding this to the list.

Signed-off-by: Hilton Chain <hako@ultrarare.space>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
3 years agoARM: pxa2xx: Fix GPIO descriptor tables
Linus Walleij [Fri, 22 Jul 2022 11:46:11 +0000 (13:46 +0200)] 
ARM: pxa2xx: Fix GPIO descriptor tables

Laurence reports:

"Kernel >5.18 on Zaurus has a bug where the power management code can't
talk to devices, emitting the following errors:

sharpsl-pm sharpsl-pm: Error: AC check failed: voltage -22.
sharpsl-pm sharpsl-pm: Charging Error!
sharpsl-pm sharpsl-pm: Warning: Cannot read main battery!

Looking at the recent changes, I found that commit 31455bbda208 ("spi:
pxa2xx_spi: Convert to use GPIO descriptors") replaced the deprecated
SPI chip select platform device code with a gpiod lookup table. However,
this didn't seem to work until I changed the `dev_id` member from the
device name to the bus id. I'm not entirely sure why this is necessary,
but I suspect it is related to the fact that in sysfs SPI devices are
attached under /sys/devices/.../dev_name/spi_master/spiB/spiB.C, rather
than directly to the device."

After reviewing the change I conclude that the same fix is needed
for all affected boards.

Fixes: 31455bbda208 ("spi: pxa2xx_spi: Convert to use GPIO descriptors")
Reported-by: Laurence de Bruxelles <lfdebrux@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220722114611.1517414-1-linus.walleij@linaro.org'
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoHID: alps: Declare U1_UNICORN_LEGACY support
Artem Borisov [Tue, 19 Jul 2022 14:53:24 +0000 (17:53 +0300)] 
HID: alps: Declare U1_UNICORN_LEGACY support

U1_UNICORN_LEGACY id was added to the driver, but was not declared
in the device id table, making it impossible to use.

Fixes: 640e403 ("HID: alps: Add AUI1657 device ID")
Signed-off-by: Artem Borisov <dedsa2002@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
3 years agoasm-generic: remove a broken and needless ifdef conditional
Lukas Bulwahn [Fri, 22 Jul 2022 11:07:11 +0000 (13:07 +0200)] 
asm-generic: remove a broken and needless ifdef conditional

Commit 527701eda5f1 ("lib: Add a generic version of devmem_is_allowed()")
introduces the config symbol GENERIC_LIB_DEVMEM_IS_ALLOWED, but then
falsely refers to CONFIG_GENERIC_DEVMEM_IS_ALLOWED (note the missing LIB
in the reference) in ./include/asm-generic/io.h.

Luckily, ./scripts/checkkconfigsymbols.py warns on non-existing configs:

GENERIC_DEVMEM_IS_ALLOWED
Referencing files: include/asm-generic/io.h

The actual fix, though, is simply to not to make this function declaration
dependent on any kernel config. For architectures that intend to use
the generic version, the arch's 'select GENERIC_LIB_DEVMEM_IS_ALLOWED' will
lead to picking the function definition, and for other architectures, this
function is simply defined elsewhere.

The wrong '#ifndef' on a non-existing config symbol also always had the
same effect (although more by mistake than by intent). So, there is no
functional change.

Remove this broken and needless ifdef conditional.

Fixes: 527701eda5f1 ("lib: Add a generic version of devmem_is_allowed()")
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoMAINTAINERS: rectify entry for ARM/NUVOTON NPCM ARCHITECTURE
Lukas Bulwahn [Fri, 22 Jul 2022 10:31:29 +0000 (12:31 +0200)] 
MAINTAINERS: rectify entry for ARM/NUVOTON NPCM ARCHITECTURE

Commit 08e950449c62 ("dt-binding: clk: npcm845: Add binding for Nuvoton
NPCM8XX Clock") obviously adds nuvoton,npcm845-clk.h, but the file entry in
MAINTAINERS, added with commit 3670d2ec13ee ("arm64: npcm: Add support for
Nuvoton NPCM8XX BMC SoC") then refers to nuvoton,npcm8xx-clock.h.

Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a
broken reference.

Repair this file reference in ARM/NUVOTON NPCM ARCHITECTURE.

Fixes: 3670d2ec13ee ("arm64: npcm: Add support for Nuvoton NPCM8XX BMC SoC")
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agouapi: asm-generic: fcntl: Fix typo 'the the' in comment
Slark Xiao [Fri, 22 Jul 2022 10:31:58 +0000 (18:31 +0800)] 
uapi: asm-generic: fcntl: Fix typo 'the the' in comment

Replace 'the the' with 'the' in the comment.

Signed-off-by: Slark Xiao <slark_xiao@163.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoASoC: Intel: avs: Use lookup table to create modules
Amadeusz SÅ‚awiÅ„ski [Fri, 22 Jul 2022 11:19:59 +0000 (13:19 +0200)] 
ASoC: Intel: avs: Use lookup table to create modules

As reported by Nathan, when building avs driver using clang with:
  CONFIG_COMPILE_TEST=y
  CONFIG_FORTIFY_SOURCE=y
  CONFIG_KASAN=y
  CONFIG_PCI=y
  CONFIG_SOUND=y
  CONFIG_SND=y
  CONFIG_SND_SOC=y
  CONFIG_SND_SOC_INTEL_AVS=y

there are reports of too big stack use, like:
  sound/soc/intel/avs/path.c:815:18: error: stack frame size (2176) exceeds limit (2048) in 'avs_path_create' [-Werror,-Wframe-larger-than]
  struct avs_path *avs_path_create(struct avs_dev *adev, u32 dma_id,
                   ^
  1 error generated.

This is apparently caused by inlining many calls to guid_equal which
inlines fortified memcpy, using 2 size_t variables.

Instead of hardcoding many calls to guid_equal, use lookup table with
one call, this improves stack usage.

Link: https://lore.kernel.org/alsa-devel/YtlzY9aYdbS4Y3+l@dev-arch.thelio-3990X/T/
Link: https://github.com/ClangBuiltLinux/linux/issues/1642
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reported-by: Nathan Chancellor <nathan@kernel.org>
Build-tested-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220722111959.2588597-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: vangogh: Use non-legacy DAI naming for cs35l41
Cristian Ciocaltea [Fri, 22 Jul 2022 09:27:00 +0000 (12:27 +0300)] 
ASoC: amd: vangogh: Use non-legacy DAI naming for cs35l41

Unlike most CODEC drivers, the CS35L41 driver did not have the
non_legacy_dai_naming set, meaning the corresponding DAI has been
traditionally registered using the legacy naming: spi-VLV1776:0x

The recent migration to the new legacy DAI naming style has implicitly
corrected that behavior and DAI gets now registered via the non-legacy
naming, i.e. cs35l41-pcm.

The problem is the acp5x platform driver is now broken as it continues
to refer to the above mentioned codec using the legacy DAI naming in
function acp5x_cs35l41_hw_params() and, therefore, the related setup
is not being executed anymore.

Let's fix that by replacing the obsolete DAI name with the correct one.

Fixes: 129f055a2144 ("ASoC: core: Switch core to new DAI naming flag")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220722092700.8269-1-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agofirmware: cs_dsp: Add memory chunk helpers
Charles Keepax [Fri, 22 Jul 2022 09:48:51 +0000 (10:48 +0100)] 
firmware: cs_dsp: Add memory chunk helpers

Add helpers that can be layered on top of a buffer read from or to be
written to the DSP to faciliate accessing datastructures within the DSP
memory. These functions handle adding the padding bytes for the DSP,
converting to big endian, and packing arbitrary length data.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220722094851.92521-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agofirmware: cs_dsp: Add pre_stop callback
Charles Keepax [Fri, 22 Jul 2022 09:48:50 +0000 (10:48 +0100)] 
firmware: cs_dsp: Add pre_stop callback

The code already has a post_stop callback, add a matching pre_stop
callback to the client_ops that is called before execution is stopped.
This callback provides a convenient place for the client code to
communicate with the DSP before it is stopped.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220722094851.92521-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoEDAC/synopsys: Re-enable the error interrupts on v3 hw
Sherry Sun [Wed, 27 Apr 2022 01:51:37 +0000 (09:51 +0800)] 
EDAC/synopsys: Re-enable the error interrupts on v3 hw

zynqmp_get_error_info() writes 0 to the ECC_CLR_OFST register after
an interrupt for a {un-,}correctable error is raised, which disables
the error interrupts. Then the interrupt handler will be called only
once. Therefore, re-enable the error interrupt line at the end of
intr_handler() for v3.x Synopsys EDAC DDR.

Fixes: f7824ded4149 ("EDAC/synopsys: Add support for version 3 of the Synopsys EDAC DDR")
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Shubhrajyoti Datta <Shubhrajyoti.datta@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220427015137.8406-3-sherry.sun@nxp.com
3 years agoEDAC/synopsys: Use the correct register to disable the error interrupt on v3 hw
Sherry Sun [Wed, 27 Apr 2022 01:51:36 +0000 (09:51 +0800)] 
EDAC/synopsys: Use the correct register to disable the error interrupt on v3 hw

v3.x Synopsys EDAC DDR doesn't have the QOS Interrupt register. Use the
ECC Clear Register to disable the error interrupts instead.

Fixes: f7824ded4149 ("EDAC/synopsys: Add support for version 3 of the Synopsys EDAC DDR")
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Shubhrajyoti Datta <Shubhrajyoti.datta@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220427015137.8406-2-sherry.sun@nxp.com
3 years agowifi: mac80211: fix link data leak
Johannes Berg [Fri, 22 Jul 2022 09:15:20 +0000 (11:15 +0200)] 
wifi: mac80211: fix link data leak

During the code reshuffling, I accidentally set this to
NULL before using it, fix that to fix the link data leak.

Fixes: d3e2439b0f33 ("wifi: mac80211: fix link manipulation")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: mlme: fix disassoc with MLO
Johannes Berg [Fri, 22 Jul 2022 09:01:18 +0000 (11:01 +0200)] 
wifi: mac80211: mlme: fix disassoc with MLO

In MLO we shouldn't call ieee80211_bss_info_change_notify(),
call that only (for backward compatibility) without MLO, and
otherwise ieee80211_vif_cfg_change_notify().

Similarly, ieee80211_reset_erp_info() only applies to the
current link, and in MLO we assume the driver doesn't really
need that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: add macros to loop over active links
Gregory Greenman [Tue, 12 Jul 2022 09:22:50 +0000 (12:22 +0300)] 
wifi: mac80211: add macros to loop over active links

Add a preliminary version which will be updated later
to loop over vif's and sta's active links.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: remove erroneous sband/link validation
Johannes Berg [Thu, 21 Jul 2022 22:07:29 +0000 (00:07 +0200)] 
wifi: mac80211: remove erroneous sband/link validation

In sta_apply_parameters(), we really no longer need to
check that the link or sband exists, in fact, that's
harmful if link 0 doesn't exist, since then this will
fail.

Just remove this check, it was added for validation of
the sband where used, but it's not used here, it's now
only used in sta_link_apply_parameters() which has an
own lookup and check.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: mlme: transmit assoc frame with address translation
Johannes Berg [Thu, 21 Jul 2022 21:35:21 +0000 (23:35 +0200)] 
wifi: mac80211: mlme: transmit assoc frame with address translation

To transmit the association frame to the right station and
with address translation, use the correct addresses there
and set up the AP address in the configuration earlier so
it's applied during the transmit of auth/assoc frames.

Fixes: 81151ce462e5 ("wifi: mac80211: support MLO authentication/association with one link")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: verify link addresses are different
Johannes Berg [Thu, 21 Jul 2022 17:54:20 +0000 (19:54 +0200)] 
wifi: mac80211: verify link addresses are different

When adding multiple links, verify that they all have
different addresses.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: rx: track link in RX data
Johannes Berg [Thu, 21 Jul 2022 11:08:13 +0000 (13:08 +0200)] 
wifi: mac80211: rx: track link in RX data

We'll need the link e.g. for decrypt, and shouldn't be
looking it up all the time later, so track it in the RX
data.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: optionally implement MLO multicast TX
Johannes Berg [Thu, 21 Jul 2022 08:56:48 +0000 (10:56 +0200)] 
wifi: mac80211: optionally implement MLO multicast TX

For drivers using software encryption for multicast TX, such
as mac80211_hwsim, mac80211 needs to duplicate the multicast
frames on each link, if MLO is enabled. Do this, but don't
just make it dependent on the key but provide a separate flag
for drivers to opt out of this.

This is not very efficient, I expect that drivers will do it
in firmware/hardware or at least with DMA engine assistence,
so this is mostly for hwsim.

To make this work, also implement the SNS11 sequence number
space that an AP MLD shall have, and modify the API to the
__ieee80211_subif_start_xmit() function to always require the
link ID bits to be set.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: expand ieee80211_mgmt_tx() for MLO
Johannes Berg [Mon, 18 Jul 2022 19:36:08 +0000 (21:36 +0200)] 
wifi: mac80211: expand ieee80211_mgmt_tx() for MLO

There are a couple of new things that should be possible
with MLO:
 * selecting the link to transmit to a station by link ID,
   which a previous patch added to the nl80211 API
 * selecting the link by frequency, similarly
 * allowing transmittion to an MLD without specifying any
   channel or link ID, with MLD addresses

Enable these use cases. Also fix the address comparison
in client mode to use the AP (MLD) address.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: nl80211: add MLO link ID to the NL80211_CMD_FRAME TX API
Johannes Berg [Mon, 18 Jul 2022 10:13:46 +0000 (12:13 +0200)] 
wifi: nl80211: add MLO link ID to the NL80211_CMD_FRAME TX API

Allow optionally specifying the link ID to transmit on,
which can be done instead of the link frequency, on an
MLD addressed frame. Both can also be omitted in which
case the frame must be MLD addressed and link selection
(and address translation) will be done on lower layers.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: report link ID to cfg80211 on mgmt RX
Johannes Berg [Mon, 18 Jul 2022 08:42:19 +0000 (10:42 +0200)] 
wifi: mac80211: report link ID to cfg80211 on mgmt RX

For frames received on an MLD, report the link ID to
userspace.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: cfg80211: report link ID in NL80211_CMD_FRAME
Johannes Berg [Mon, 18 Jul 2022 08:40:44 +0000 (10:40 +0200)] 
wifi: cfg80211: report link ID in NL80211_CMD_FRAME

If given by the underlying driver, report the link ID for
MLO in NL80211_CMD_FRAME.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: add hardware timestamps for RX and TX
Avraham Stern [Wed, 26 Jan 2022 09:15:31 +0000 (11:15 +0200)] 
wifi: mac80211: add hardware timestamps for RX and TX

When the low level driver reports hardware timestamps for frame
TX status or frame RX, pass the timestamps to cfg80211.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: cfg80211: add hardware timestamps to frame RX info
Avraham Stern [Thu, 27 Jan 2022 11:56:29 +0000 (13:56 +0200)] 
wifi: cfg80211: add hardware timestamps to frame RX info

Add hardware timestamps to management frame RX info.
This shall be used by drivers that support hardware timestamping for
Timing measurement and Fine timing measurement action frames RX.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: cfg80211/nl80211: move rx management data into a struct
Avraham Stern [Sun, 30 Jan 2022 16:17:51 +0000 (18:17 +0200)] 
wifi: cfg80211/nl80211: move rx management data into a struct

The functions for reporting rx management take many arguments.
Collect all the arguments into a struct, which also make it easier
to add more arguments if needed.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: cfg80211: add a function for reporting TX status with hardware timestamps
Avraham Stern [Wed, 26 Jan 2022 17:13:47 +0000 (19:13 +0200)] 
wifi: cfg80211: add a function for reporting TX status with hardware timestamps

Add a function for reporting TX status with hardware timestamps. This
function shall be used for reporting the TX status of Timing
measurement and Fine timing measurement action frames by devices that
support reporting hardware timestamps.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: nl80211: add RX and TX timestamp attributes
Avraham Stern [Wed, 26 Jan 2022 14:06:35 +0000 (16:06 +0200)] 
wifi: nl80211: add RX and TX timestamp attributes

Add attributes for reporting hardware timestamps for management frames
RX and TX. These attributes will be used for reporting hardware
timestamps for Timing measurement and Fine Timing Measurement action
frames, which will allow userspace applications to measure the path
delay between devices and sync clocks.

For TX, these attributes are used for reporting the frame RX time and
the ack TX time. For TX, they are used for reporting the frame TX time
and the ack RX time.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: ieee80211: add helper functions for detecting TM/FTM frames
Avraham Stern [Thu, 27 Jan 2022 12:39:46 +0000 (14:39 +0200)] 
wifi: ieee80211: add helper functions for detecting TM/FTM frames

Add helper functions for detection timing measurement
and fine timing measurement frames.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211_hwsim: handle links for wmediumd/virtio
Johannes Berg [Wed, 20 Jul 2022 20:35:44 +0000 (22:35 +0200)] 
wifi: mac80211_hwsim: handle links for wmediumd/virtio

For wmediumd/virtio, handle both the RX channel for links,
as well as the link addresses when links are added/removed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: sta_info: fix link_sta insertion
Johannes Berg [Tue, 19 Jul 2022 10:08:29 +0000 (12:08 +0200)] 
wifi: mac80211: sta_info: fix link_sta insertion

When inserting a link STA, make sure it doesn't exist first
and add lockdep assertions that we cannot modify the hash
table without holding the sta_mtx, so this check is really
correct.

Also return without hashing if the driver failed, and warn
if the hashing fails, which shouldn't happen due to the
check described above.

Fixes: cb71f1d136a6 ("wifi: mac80211: add sta link addition/removal")
Fixes: ba6ddab94fc6 ("wifi: mac80211: maintain link-sta hash table")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: mlme: fix link_sta setup
Johannes Berg [Tue, 19 Jul 2022 10:06:17 +0000 (12:06 +0200)] 
wifi: mac80211: mlme: fix link_sta setup

We need to copy the address to both the private and public
portion of the link_sta (the private one is needed for the
hash table). Fix this.

Fixes: bbe90107e1d9 ("wifi: mac80211: mlme: refactor link station setup")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: nl80211/mac80211: clarify link ID in control port TX
Johannes Berg [Tue, 19 Jul 2022 08:26:50 +0000 (10:26 +0200)] 
wifi: nl80211/mac80211: clarify link ID in control port TX

Clarify the link ID behaviour in control port TX, we need it
to select the link to transmit on for both MLD and non-MLD
receivers, but select the link address as the SA only if the
receiver is not an MLD.

Fixes: 67207bab9341 ("wifi: cfg80211/mac80211: Support control port TX from specific link")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: return error from control port TX for drops
Johannes Berg [Tue, 19 Jul 2022 07:37:59 +0000 (09:37 +0200)] 
wifi: mac80211: return error from control port TX for drops

If the frame is going to be dropped anyway because
ieee80211_lookup_ra_sta() returned an error (and
even though it's a bit racy, it will likely continue
to do so), return the error out instead of just
silently dropping the frame.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: nl80211: require MLD address on link STA add/modify
Johannes Berg [Tue, 19 Jul 2022 06:44:25 +0000 (08:44 +0200)] 
wifi: nl80211: require MLD address on link STA add/modify

We always need the MLD address and link ID to add or
modify the link STA, so require it in the API.

Fixes: 577e5b8c3924 ("wifi: cfg80211: add API to add/modify/remove a link station")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: more station handling sanity checks
Johannes Berg [Mon, 18 Jul 2022 21:01:19 +0000 (23:01 +0200)] 
wifi: mac80211: more station handling sanity checks

Add more sanity checks to the API handling, we shouldn't
be able to create a station without links, nor should we
be able to add a link to a station that wasn't created as
an MLD with links in the first place.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: fix link sta hash table handling
Johannes Berg [Mon, 18 Jul 2022 20:54:27 +0000 (22:54 +0200)] 
wifi: mac80211: fix link sta hash table handling

There are two issues here: we unhash the link stations only
directly before freeing the station they belong to, and we
also don't unhash all the links correctly in all cases. Fix
these issues.

Fixes: ba6ddab94fc6 ("wifi: mac80211: maintain link-sta hash table")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: validate link address doesn't change
Johannes Berg [Mon, 18 Jul 2022 20:23:53 +0000 (22:23 +0200)] 
wifi: mac80211: validate link address doesn't change

When modifying a link station, validate that the link address
doesn't change, except the first time the link is created.

Fixes: b95eb7f0eee4 ("wifi: cfg80211/mac80211: separate link params from station params")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: mlme: set sta.mlo to mlo state
Johannes Berg [Mon, 18 Jul 2022 14:04:05 +0000 (16:04 +0200)] 
wifi: mac80211: mlme: set sta.mlo to mlo state

At this point, we've already changed link_id to be zero for
a non-MLO connection, so use the 'mlo' variable rather than
link ID to determine the MLO status of the station.

Fixes: bd363ee53302 ("wifi: mac80211: mlme: set sta.mlo correctly")
Fixes: 81151ce462e5 ("wifi: mac80211: support MLO authentication/association with one link")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: fast-xmit: handle non-MLO clients
Johannes Berg [Mon, 18 Jul 2022 14:58:18 +0000 (16:58 +0200)] 
wifi: mac80211: fast-xmit: handle non-MLO clients

If there's a non-MLO client, the A2 must be set to the BSSID
of the link since no translation will happen in lower layers
and it's needed that way for encryption.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211_hwsim: fix address translation for MLO
Johannes Berg [Mon, 18 Jul 2022 14:45:50 +0000 (16:45 +0200)] 
wifi: mac80211_hwsim: fix address translation for MLO

There are two issues here: we need to do the translation
even in case mac80211 selected a link, and we should only
translate the A3 if it's the BSSID. Fix both.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: fix RX MLD address translation
Johannes Berg [Mon, 18 Jul 2022 14:40:36 +0000 (16:40 +0200)] 
wifi: mac80211: fix RX MLD address translation

We should only translate addr3 here if it's the BSSID.

Fixes: 42fb9148c078 ("wifi: mac80211: do link->MLD address translation on RX")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: fix NULL pointer deref with non-MLD STA
Johannes Berg [Mon, 18 Jul 2022 07:14:30 +0000 (09:14 +0200)] 
wifi: mac80211: fix NULL pointer deref with non-MLD STA

If we have a non-MLD STA on an AP MLD, we crash while
adding the station. Fix that, in this case we need to
use the STA's address also on the link data structure.

Fixes: f36fe0a2df03 ("wifi: mac80211: fix up link station creation/insertion")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: mlme: fix override calculation
Johannes Berg [Sun, 17 Jul 2022 16:16:51 +0000 (18:16 +0200)] 
wifi: mac80211: mlme: fix override calculation

In my previous changes here, I neglected to take the old
conn_flags into account that might still be present from
the authentication, and thus ieee80211_setup_assoc_link()
can misbehave, as well as the override calculation being
wrong. Fix that by ORing in the old flags.

Fixes: 1845c1d4a455 ("wifi: mac80211: mlme: refactor assoc link setup")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agowifi: mac80211: tx: use AP address in some places for MLO
Johannes Berg [Fri, 15 Jul 2022 13:37:23 +0000 (15:37 +0200)] 
wifi: mac80211: tx: use AP address in some places for MLO

In a few places we need to use the AP (MLD) address, not the
deflink BSSID, the link address translation will happen later.

To make that work properly for fast-xmit, set up the ap_addr
in the vif.cfg earlier.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
3 years agoARM: cns3xxx: add CONFIG_UNUSED_BOARD_FILES dependency
Arnd Bergmann [Mon, 18 Jul 2022 20:58:47 +0000 (22:58 +0200)] 
ARM: cns3xxx: add CONFIG_UNUSED_BOARD_FILES dependency

Krzysztof Halasa has kept the cns3xxx platform working for a long time
but has moved away from working on it. The OpenWRT port was dropped in
2020, and support for the Gateworks Laguna platform never made it into
the mainline kernel, which only supports the reference design.

Further, the ARM11MPCore has an unresolved issue with instruction cache
coherency, and removing support for the remaining platforms using this
core would be the easiest solution.

Mark the entire platform as unused now, to be removed in early 2023 if
no users show up.

Cc: Krzysztof Halasa <khalasa@piap.pl>
Link: https://lore.kernel.org/lkml/20210616152326.GG22278@shell.armlinux.org.uk/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoARM: iop32x: mark as unused
Arnd Bergmann [Tue, 19 Jul 2022 12:59:06 +0000 (14:59 +0200)] 
ARM: iop32x: mark as unused

The iop32x platform has recently been converted to be part of
the multiplatform configuration, and it should be possible to
keep it alive for longer by making it boot from devicetree like
we did for the related ixp4xx platform.

However, it appears that no users remain at this point, so just
mark the entire platform depending on CONFIG_UNUSED_BOARD_FILES,
with the intention of removing it in early 2023.

If any users remain, please speak up now.

Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoARM: s3c: mark most board files as unused
Arnd Bergmann [Mon, 18 Jul 2022 20:13:16 +0000 (22:13 +0200)] 
ARM: s3c: mark most board files as unused

The s3c24xx platform is already scheduled for removal in early 2023,
with s3c64xx meeting the same fate a year later.

Most of the s3c64xx board files appear to be unused, as the better
maintained ones already got converted to DT. The main exception is
the Wolfson Cragganmore board, which remains in use as the reference
design for Wolfson/Cirrus devices. As the other boards get removed,
this one stays around along with the DT based machines.

The s3c6400_defconfig file now disables the unused boards, while the
s3c24xx defconfig files all turn on CONFIG_UNUSED_BOARD_FILES to
remain usable.

Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: linux-samsung-soc@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoARM: omap1: add Kconfig dependencies for unused boards
Arnd Bergmann [Mon, 18 Jul 2022 19:39:23 +0000 (21:39 +0200)] 
ARM: omap1: add Kconfig dependencies for unused boards

Legacy board files with no known users are planned to get removed in
early 2023, and this covers the majority of the omap1 boards as well.

According to Tony, the actual users are all on OSK, Nokia770, and
AMS-Delta. Additionally, the sx1 and palmte boards are supported by qemu,
which is convenient for testing, so all five stay around past the initial
board removal.

As omap1 is now part of the multiplatform build and uses the common-clk
framework, it has become easier to convert these to use devicetree
based booting in the future.

Cc: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org
Acked-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoARM: sa1100: mark most boards as unused
Arnd Bergmann [Mon, 18 Jul 2022 19:26:45 +0000 (21:26 +0200)] 
ARM: sa1100: mark most boards as unused

Most Arm board files are unused and will be removed in early
2023 if no remaining users show up. For the sa1100 platform,
the machines that are still in use are:

 - Russell's Assabet development board
 - Linus' H3600 iPaq PocketPC
 - Collie as the only qemu-supported board, to allow
   testing by others

All remaining sa1100 boards are marked to depend on
CONFIG_UNUSED_BOARD_FILES to give potential users a
last chance to speak up.

Cc: Kristoffer Ericson <kristoffer.ericson@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agos390/docs: fix warnings for vfio_ap driver doc
Alexander Gordeev [Thu, 21 Jul 2022 13:59:36 +0000 (15:59 +0200)] 
s390/docs: fix warnings for vfio_ap driver doc

Fix multiple warnings produced by make htmldocs

Fixes: cb269e0aba7c ("s390/vfio-ap: update docs to include dynamic config support")
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 years agos390/docs: fix warnings for vfio_ap driver lock usage doc
Alexander Gordeev [Thu, 21 Jul 2022 13:29:05 +0000 (15:29 +0200)] 
s390/docs: fix warnings for vfio_ap driver lock usage doc

Fix multiple warnings produced by make htmldocs

Fixes: e32d3827f3d5 ("s390/Docs: new doc describing lock usage by the vfio_ap device driver")
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
3 years agonet: add missing includes and forward declarations under net/
Jakub Kicinski [Wed, 20 Jul 2022 23:57:58 +0000 (16:57 -0700)] 
net: add missing includes and forward declarations under net/

This patch adds missing includes to headers under include/net.
All these problems are currently masked by the existing users
including the missing dependency before the broken header.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agocaif: Fix bitmap data type in "struct caifsock"
Christophe JAILLET [Wed, 20 Jul 2022 19:49:46 +0000 (21:49 +0200)] 
caif: Fix bitmap data type in "struct caifsock"

Bitmap are "unsigned long", so use it instead of a "u32" to make things
more explicit.

While at it, remove some useless cast (and leading spaces) when using the
bitmap API.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'sfc-E100-VF-respresenters'
David S. Miller [Fri, 22 Jul 2022 11:50:07 +0000 (12:50 +0100)] 
Merge branch 'sfc-E100-VF-respresenters'

Edward Cree says:

====================
sfc: VF representors for EF100

This series adds representor netdevices for EF100 VFs, as a step towards
 supporting TC offload and vDPA usecases in future patches.
In this first series is basic netdevice creation and packet TX; the
 following series will add the RX path.

v3: dropped massive mcdi_pcol.h patch which was applied separately.
v2: converted comments on struct efx_nic members added in patch #4 to
 kernel-doc (Jakub).  While at it, also gave struct efx_rep its own kdoc
 since several members had comments on them.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: attach/detach EF100 representors along with their owning PF
Edward Cree [Wed, 20 Jul 2022 18:33:49 +0000 (19:33 +0100)] 
sfc: attach/detach EF100 representors along with their owning PF

Since representors piggy-back on the PF's queues for TX, they can
 only accept new TXes while the PF is up.  Thus, any operation which
 detaches the PF must first detach all its VFreps.

Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: hook up ef100 representor TX
Edward Cree [Wed, 20 Jul 2022 18:33:48 +0000 (19:33 +0100)] 
sfc: hook up ef100 representor TX

Implement .ndo_start_xmit() by calling into the parent PF's TX path.

Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: support passing a representor to the EF100 TX path
Edward Cree [Wed, 20 Jul 2022 18:33:47 +0000 (19:33 +0100)] 
sfc: support passing a representor to the EF100 TX path

A non-null efv in __ef100_enqueue_skb() indicates that the packet is
 from that representor, should be transmitted with a suitable option
 descriptor (to instruct the switch to deliver it to the representee),
 and should not be accounted to the parent PF's stats or BQL.

Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: determine representee m-port for EF100 representors
Edward Cree [Wed, 20 Jul 2022 18:29:34 +0000 (19:29 +0100)] 
sfc: determine representee m-port for EF100 representors

An MAE port, or m-port, is a port (source/destination for traffic) on
 the Match-Action Engine (the internal switch on EF100).
Representors will use their representee's m-port for two purposes: as
 a destination override on TX from the representor, and as a source
 match in 'default rules' to steer representee traffic (when not
 matched by e.g. a TC flower rule) to representor RX via the parent
 PF's receive queue.

Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: phys port/switch identification for ef100 reps
Edward Cree [Wed, 20 Jul 2022 18:29:33 +0000 (19:29 +0100)] 
sfc: phys port/switch identification for ef100 reps

Requires storing VF index in struct efx_rep.

Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: add basic ethtool ops to ef100 reps
Edward Cree [Wed, 20 Jul 2022 18:29:30 +0000 (19:29 +0100)] 
sfc: add basic ethtool ops to ef100 reps

Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: add skeleton ef100 VF representors
Edward Cree [Wed, 20 Jul 2022 18:29:28 +0000 (19:29 +0100)] 
sfc: add skeleton ef100 VF representors

No net_device_ops yet, just a placeholder netdev created per VF.

Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: detect ef100 MAE admin privilege/capability at probe time
Edward Cree [Wed, 20 Jul 2022 18:29:26 +0000 (19:29 +0100)] 
sfc: detect ef100 MAE admin privilege/capability at probe time

One PCIe function per network port (more precisely, per m-port group) is
 responsible for configuring the Match-Action Engine which performs
 switching and packet modification in the slice to support flower/OVS
 offload.  The GRP_MAE bit in the privilege mask indicates whether a
 given function has this capability.
At probe time, call MCDIs to read the calling function's privilege mask,
 and store the GRP_MAE bit in a new ef100_nic_data member.

Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: update EF100 register descriptions
Edward Cree [Wed, 20 Jul 2022 18:29:24 +0000 (19:29 +0100)] 
sfc: update EF100 register descriptions

Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoping: support ipv6 ping socket flow labels
Alan Brady [Wed, 20 Jul 2022 18:13:10 +0000 (11:13 -0700)] 
ping: support ipv6 ping socket flow labels

Ping sockets don't appear to make any attempt to preserve flow labels
created and set by userspace using IPV6_FLOWINFO_SEND. Instead they are
clobbered by autolabels (if enabled) or zero.

Grab the flowlabel out of the msghdr similar to how rawv6_sendmsg does
it and move the memset up so it doesn't get zeroed after.

Signed-off-by: Alan Brady <alan.brady@intel.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agodt-bindings: net: fsl,fec: Add missing types to phy-reset-* properties
Rob Herring [Tue, 19 Jul 2022 21:51:08 +0000 (15:51 -0600)] 
dt-bindings: net: fsl,fec: Add missing types to phy-reset-* properties

The phy-reset-* properties are missing type definitions and are not common
properties. Even though they are deprecated, a type is needed.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agodt-bindings: net: ethernet-controller: Rework 'fixed-link' schema
Rob Herring [Tue, 19 Jul 2022 21:50:59 +0000 (15:50 -0600)] 
dt-bindings: net: ethernet-controller: Rework 'fixed-link' schema

While the if/then schemas mostly work, there's a few issues. The 'allOf'
schema will also be true if 'fixed-link' is not an array or object as a
false 'if' schema (without an 'else') will be true. In the array case
doesn't set the type (uint32-array) in the 'then' clause. In the node case,
'additionalProperties' is missing.

Rework the schema to use oneOf with each possible type.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: marvell: prestera: use netif_is_any_bridge_port instead of open code
Juhee Kang [Thu, 21 Jul 2022 10:26:48 +0000 (19:26 +0900)] 
net: marvell: prestera: use netif_is_any_bridge_port instead of open code

The open code which is netif_is_bridge_port() || netif_is_ovs_port() is
defined as a new helper function on netdev.h like netif_is_any_bridge_port
that can check both IFF flags in 1 go. So use netif_is_any_bridge_port()
function instead of open code. This patch doesn't change logic.

Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomlxsw: use netif_is_any_bridge_port() instead of open code
Juhee Kang [Thu, 21 Jul 2022 10:26:47 +0000 (19:26 +0900)] 
mlxsw: use netif_is_any_bridge_port() instead of open code

The open code which is netif_is_bridge_port() || netif_is_ovs_port() is
defined as a new helper function on netdev.h like netif_is_any_bridge_port
that can check both IFF flags in 1 go. So use netif_is_any_bridge_port()
function instead of open code. This patch doesn't change logic.

Signed-off-by: Juhee Kang <claudiajkang@gmail.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoASoC: fsl: Fix sparse warning
Mark Brown [Fri, 22 Jul 2022 11:30:59 +0000 (12:30 +0100)] 
ASoC: fsl: Fix sparse warning

Merge series from Shengjiu Wang <shengjiu.wang@nxp.com>:

Fix sparse warnings in various fsl drivers.

3 years agoARM: footbridge: mark cats board for removal
Arnd Bergmann [Mon, 18 Jul 2022 18:37:09 +0000 (20:37 +0200)] 
ARM: footbridge: mark cats board for removal

There are three remaining footbridge boards, as the CO285 and the HP
personal server got removed already over the years.

Russell still uses his ebsa285, while both Linus and Marc have a NetWinder
that they use for testing. Nobody so far replied that they are using cats,
so it goes on the long list of machines to be removed in early 2023 if
it stays like this.

Cc: Russell King <linux@armlinux.org.uk>
Cc: Linus Walleij <linusw@kernel.org>
Cc: Marc Zyngier <maz@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
3 years agoARM: mmp: mark all board files for removal
Arnd Bergmann [Mon, 18 Jul 2022 18:15:01 +0000 (20:15 +0200)] 
ARM: mmp: mark all board files for removal

The mmp platform supports both ATAGS based board files and DT
booting, but it appears that nobody has been interested in
board files for a long time.

Mark all of them for removal in early 2023 with a dependency
on CONFIG_UNUSED_BOARD_FILES, leaving only the DT support
for the future, unless someone pops up who uses them.

Cc: Lubomir Rintel <lkundrak@v3.sk>
Cc: Haojian Zhuang <haojian.zhuang@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>