17 Nov, 2020

1 commit

  • Commit 7f832645d0e5 ("dmaengine: ioatdma: remove ioatdma v2 registration")
    missed to remove dca2_tag_map_valid() during its removal. Hence, since
    then, dca2_tag_map_valid() is unused and make CC=clang W=1 warns:

    drivers/dma/ioat/dca.c:44:19:
    warning: unused function 'dca2_tag_map_valid' [-Wunused-function]

    So, remove this unused function and get rid of a -Wused-function warning.

    Signed-off-by: Lukas Bulwahn
    Reviewed-by: Nathan Chancellor
    Link: https://lore.kernel.org/r/20201113081248.26416-1-lukas.bulwahn@gmail.com
    Signed-off-by: Vinod Koul

    Lukas Bulwahn
     

05 Oct, 2020

1 commit

  • dma_alloc_coherent() is called with a fixed SZ_2M size, but frees happen
    with IOAT_CHUNK_SIZE. Recently, IOAT_CHUNK_SIZE was reduced to 512M but
    the allocation did not change. To fix, change to using the
    IOAT_CHUNK_SIZE define.

    This was caught with the upcoming patchset for converting Intel platforms to the
    dma-iommu implementation. It has a warning when the unmapped size differs from
    the mapped size.

    Fixes: a02254f8a676 ("dmaengine: ioat: Decreasing allocation chunk size 2M->512K")
    Suggested-by: Robin Murphy
    Signed-off-by: Logan Gunthorpe
    Acked-by: Dave Jiang
    Cc: Vinod Koul
    Cc: Dave Jiang
    Cc: Dan Williams
    Link: https://lore.kernel.org/intel-gfx/776771a2-247a-d1be-d882-bee02d919ae0@deltatee.com/
    Link: https://lore.kernel.org/r/20200922200844.2982-1-logang@deltatee.com
    Signed-off-by: Vinod Koul

    Logan Gunthorpe
     

01 Oct, 2020

1 commit


18 Sep, 2020

2 commits

  • This eliminates the following sparse warning:

    drivers/dma/ioat/dma.c:29:5: warning: symbol 'completion_timeout' was
    not declared. Should it be static?
    drivers/dma/ioat/dma.c:33:5: warning: symbol 'idle_timeout' was not
    declared. Should it be static?

    Reported-by: Hulk Robot
    Signed-off-by: Jason Yan
    Acked-by: Dave Jiang
    Link: https://lore.kernel.org/r/20200912072158.602585-1-yanaijie@huawei.com
    Signed-off-by: Vinod Koul

    Jason Yan
     
  • In preparation for unconditionally passing the
    struct tasklet_struct pointer to all tasklet
    callbacks, switch to using the new tasklet_setup()
    and from_tasklet() to pass the tasklet pointer explicitly.

    Signed-off-by: Romain Perier
    Signed-off-by: Allen Pais
    Acked-by: Dave Jiang
    Link: https://lore.kernel.org/r/20200831103542.305571-10-allen.lkml@gmail.com
    Signed-off-by: Vinod Koul

    Allen Pais
     

08 Aug, 2020

1 commit

  • Pull PCI updates from Bjorn Helgaas:
    "Enumeration:
    - Fix pci_cfg_wait queue locking problem (Bjorn Helgaas)
    - Convert PCIe capability PCIBIOS errors to errno (Bolarinwa Olayemi
    Saheed)
    - Align PCIe capability and PCI accessor return values (Bolarinwa
    Olayemi Saheed)
    - Fix pci_create_slot() reference count leak (Qiushi Wu)
    - Announce device after early fixups (Tiezhu Yang)

    PCI device hotplug:
    - Make rpadlpar functions static (Wei Yongjun)

    Driver binding:
    - Add device even if driver attach failed (Rajat Jain)

    Virtualization:
    - xen: Remove redundant initialization of irq (Colin Ian King)

    IOMMU:
    - Add pci_pri_supported() to check device or associated PF (Ashok Raj)
    - Release IVRS table in AMD ACS quirk (Hanjun Guo)
    - Mark AMD Navi10 GPU rev 0x00 ATS as broken (Kai-Heng Feng)
    - Treat "external-facing" devices themselves as internal (Rajat Jain)

    MSI:
    - Forward MSI-X error code in pci_alloc_irq_vectors_affinity() (Piotr
    Stankiewicz)

    Error handling:
    - Clear PCIe Device Status errors only if OS owns AER (Jonathan
    Cameron)
    - Log correctable errors as warning, not error (Matt Jolly)
    - Use 'pci_channel_state_t' instead of 'enum pci_channel_state' (Luc
    Van Oostenryck)

    Peer-to-peer DMA:
    - Allow P2PDMA on AMD Zen and newer CPUs (Logan Gunthorpe)

    ASPM:
    - Add missing newline in sysfs 'policy' (Xiongfeng Wang)

    Native PCIe controllers:
    - Convert to devm_platform_ioremap_resource_byname() (Dejin Zheng)
    - Convert to devm_platform_ioremap_resource() (Dejin Zheng)
    - Remove duplicate error message from devm_pci_remap_cfg_resource()
    callers (Dejin Zheng)
    - Fix runtime PM imbalance on error (Dinghao Liu)
    - Remove dev_err() when handing an error from platform_get_irq()
    (Krzysztof Wilczyński)
    - Use pci_host_bridge.windows list directly instead of splicing in a
    temporary list for cadence, mvebu, host-common (Rob Herring)
    - Use pci_host_probe() instead of open-coding all the pieces for
    altera, brcmstb, iproc, mobiveil, rcar, rockchip, tegra, v3,
    versatile, xgene, xilinx, xilinx-nwl (Rob Herring)
    - Default host bridge parent device to the platform device (Rob
    Herring)
    - Use pci_is_root_bus() instead of tracking root bus number
    separately in aardvark, designware (imx6, keystone,
    designware-host), mobiveil, xilinx-nwl, xilinx, rockchip, rcar (Rob
    Herring)
    - Set host bridge bus number in pci_scan_root_bus_bridge() instead of
    each driver for aardvark, designware-host, host-common, mediatek,
    rcar, tegra, v3-semi (Rob Herring)
    - Move DT resource setup into devm_pci_alloc_host_bridge() (Rob
    Herring)
    - Set bridge map_irq and swizzle_irq to default functions; drivers
    that don't support legacy IRQs (iproc) need to undo this (Rob
    Herring)

    ARM Versatile PCIe controller driver:
    - Drop flag PCI_ENABLE_PROC_DOMAINS (Rob Herring)

    Cadence PCIe controller driver:
    - Use "dma-ranges" instead of "cdns,no-bar-match-nbits" property
    (Kishon Vijay Abraham I)
    - Remove "mem" from reg binding (Kishon Vijay Abraham I)
    - Fix cdns_pcie_{host|ep}_setup() error path (Kishon Vijay Abraham I)
    - Convert all r/w accessors to perform only 32-bit accesses (Kishon
    Vijay Abraham I)
    - Add support to start link and verify link status (Kishon Vijay
    Abraham I)
    - Allow pci_host_bridge to have custom pci_ops (Kishon Vijay Abraham I)
    - Add new *ops* for CPU addr fixup (Kishon Vijay Abraham I)
    - Fix updating Vendor ID and Subsystem Vendor ID register (Kishon
    Vijay Abraham I)
    - Use bridge resources for outbound window setup (Rob Herring)
    - Remove private bus number and range storage (Rob Herring)

    Cadence PCIe endpoint driver:
    - Add MSI-X support (Alan Douglas)

    HiSilicon PCIe controller driver:
    - Remove non-ECAM HiSilicon hip05/hip06 driver (Rob Herring)

    Intel VMD host bridge driver:
    - Use Shadow MEMBAR registers for QEMU/KVM guests (Jon Derrick)

    Loongson PCIe controller driver:
    - Use DECLARE_PCI_FIXUP_EARLY for bridge_class_quirk() (Tiezhu Yang)

    Marvell Aardvark PCIe controller driver:
    - Indicate error in 'val' when config read fails (Pali Rohár)
    - Don't touch PCIe registers if no card connected (Pali Rohár)

    Marvell MVEBU PCIe controller driver:
    - Setup BAR0 in order to fix MSI (Shmuel Hazan)

    Microsoft Hyper-V host bridge driver:
    - Fix a timing issue which causes kdump to fail occasionally (Wei Hu)
    - Make some functions static (Wei Yongjun)

    NVIDIA Tegra PCIe controller driver:
    - Revert tegra124 raw_violation_fixup (Nicolas Chauvet)
    - Remove PLL power supplies (Thierry Reding)

    Qualcomm PCIe controller driver:
    - Change duplicate PCI reset to phy reset (Abhishek Sahu)
    - Add missing ipq806x clocks in PCIe driver (Ansuel Smith)
    - Add missing reset for ipq806x (Ansuel Smith)
    - Add ext reset (Ansuel Smith)
    - Use bulk clk API and assert on error (Ansuel Smith)
    - Add support for tx term offset for rev 2.1.0 (Ansuel Smith)
    - Define some PARF params needed for ipq8064 SoC (Ansuel Smith)
    - Add ipq8064 rev2 variant (Ansuel Smith)
    - Support PCI speed set for ipq806x (Sham Muthayyan)

    Renesas R-Car PCIe controller driver:
    - Use devm_pci_alloc_host_bridge() (Rob Herring)
    - Use struct pci_host_bridge.windows list directly (Rob Herring)
    - Convert rcar-gen2 to use modern host bridge probe functions (Rob
    Herring)

    TI J721E PCIe driver:
    - Add TI J721E PCIe host and endpoint driver (Kishon Vijay Abraham I)

    Xilinx Versal CPM PCIe controller driver:
    - Add Versal CPM Root Port driver and YAML schema (Bharat Kumar
    Gogada)

    MicroSemi Switchtec management driver:
    - Add missing __iomem and __user tags to fix sparse warnings (Logan
    Gunthorpe)

    Miscellaneous:
    - Replace http:// links with https:// (Alexander A. Klimov)
    - Replace lkml.org, spinics, gmane with lore.kernel.org (Bjorn
    Helgaas)
    - Remove unused pci_lost_interrupt() (Heiner Kallweit)
    - Move PCI_VENDOR_ID_REDHAT definition to pci_ids.h (Huacai Chen)
    - Fix kerneldoc warnings (Krzysztof Kozlowski)"

    * tag 'pci-v5.9-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (113 commits)
    PCI: Fix kerneldoc warnings
    PCI: xilinx-cpm: Add Versal CPM Root Port driver
    PCI: xilinx-cpm: Add YAML schemas for Versal CPM Root Port
    PCI: Set bridge map_irq and swizzle_irq to default functions
    PCI: Move DT resource setup into devm_pci_alloc_host_bridge()
    PCI: rcar-gen2: Convert to use modern host bridge probe functions
    PCI: Remove dev_err() when handing an error from platform_get_irq()
    MAINTAINERS: Add Kishon Vijay Abraham I for TI J721E SoC PCIe
    misc: pci_endpoint_test: Add J721E in pci_device_id table
    PCI: j721e: Add TI J721E PCIe driver
    PCI: switchtec: Add missing __iomem tag to fix sparse warnings
    PCI: switchtec: Add missing __iomem and __user tags to fix sparse warnings
    PCI: rpadlpar: Make functions static
    PCI/P2PDMA: Allow P2PDMA on AMD Zen and newer CPUs
    PCI: Release IVRS table in AMD ACS quirk
    PCI: Announce device after early fixups
    PCI: Mark AMD Navi10 GPU rev 0x00 ATS as broken
    PCI: Remove unused pci_lost_interrupt()
    dt-bindings: PCI: Add EP mode dt-bindings for TI's J721E SoC
    dt-bindings: PCI: Add host mode dt-bindings for TI's J721E SoC
    ...

    Linus Torvalds
     

06 Aug, 2020

1 commit

  • - Convert PCIe capability PCIBIOS errors to errno (Bolarinwa Olayemi
    Saheed)

    - Align PCIe capability and PCI accessor return values (Bolarinwa Olayemi
    Saheed)

    - Replace http:// links with https:// (Alexander A. Klimov)

    - Replace lkml.org, spinics, gmane with lore.kernel.org (Bjorn Helgaas)

    - Update panic message to mention kzalloc(), not kmalloc() (Liao Pingfang)

    - Move PCI_VENDOR_ID_REDHAT definition to pci_ids.h (Huacai Chen)

    - Remove unused pci_lost_interrupt() (Heiner Kallweit)

    * pci/misc:
    PCI: Remove unused pci_lost_interrupt()
    PCI: Move PCI_VENDOR_ID_REDHAT definition to pci_ids.h
    PCI: Fix error in panic message
    PCI: Replace lkml.org, spinics, gmane with lore.kernel.org
    PCI: Replace http:// links with https://
    PCI: Align PCIe capability and PCI accessor return values
    PCI: Convert PCIe capability PCIBIOS errors to errno

    Bjorn Helgaas
     

05 Aug, 2020

1 commit


15 Jul, 2020

2 commits

  • Fixes the following W=1 kernel build warning(s):

    drivers/dma/ioat/dma.c:202: warning: Function parameter or member 'ioat_chan' not described in 'ioat_update_pending'
    drivers/dma/ioat/dma.c:202: warning: Excess function parameter 'ioat' description in 'ioat_update_pending'
    drivers/dma/ioat/dma.c:465: warning: Function parameter or member 'ioat_chan' not described in 'ioat_check_space_lock'
    drivers/dma/ioat/dma.c:465: warning: Excess function parameter 'ioat' description in 'ioat_check_space_lock'
    drivers/dma/ioat/dma.c:591: warning: Function parameter or member 'ioat_chan' not described in '__cleanup'
    drivers/dma/ioat/dma.c:591: warning: Function parameter or member 'phys_complete' not described in '__cleanup'
    drivers/dma/ioat/dma.c:591: warning: Excess function parameter 'ioat' description in '__cleanup'

    Signed-off-by: Lee Jones
    Cc: Dave Jiang
    Cc: Leonid Ravich
    Link: https://lore.kernel.org/r/20200714111546.1755231-18-lee.jones@linaro.org
    Signed-off-by: Vinod Koul

    Lee Jones
     
  • Fixes the following W=1 kernel build warning(s):

    drivers/dma/ioat/init.c:608: warning: Function parameter or member 'c' not described in 'ioat_free_chan_resources'
    drivers/dma/ioat/init.c:608: warning: Excess function parameter 'chan' description in 'ioat_free_chan_resources'

    Signed-off-by: Lee Jones
    Cc: Logan Gunthorpe
    Link: https://lore.kernel.org/r/20200714111546.1755231-17-lee.jones@linaro.org
    Signed-off-by: Vinod Koul

    Lee Jones
     

08 Jul, 2020

1 commit

  • The method struct pci_error_handlers.error_detected() is defined and
    documented as taking an 'enum pci_channel_state' for the second argument,
    but most drivers use 'pci_channel_state_t' instead.

    This 'pci_channel_state_t' is not a typedef for the enum but a typedef for
    a bitwise type in order to have better/stricter typechecking.

    Consolidate everything by using 'pci_channel_state_t' in the method's
    definition, in the related helpers and in the drivers.

    Enforce use of 'pci_channel_state_t' by replacing 'enum pci_channel_state'
    with an anonymous 'enum'.

    Note: Currently, from a typechecking point of view this patch changes
    nothing because only the constants defined by the enum are bitwise, not the
    enum itself (sparse doesn't have the notion of 'bitwise enum'). This may
    change in some not too far future, hence the patch.

    [bhelgaas: squash in
    https://lore.kernel.org/r/20200702162651.49526-3-luc.vanoostenryck@gmail.com
    https://lore.kernel.org/r/20200702162651.49526-4-luc.vanoostenryck@gmail.com]
    Link: https://lore.kernel.org/r/20200702162651.49526-2-luc.vanoostenryck@gmail.com
    Signed-off-by: Luc Van Oostenryck
    Signed-off-by: Bjorn Helgaas

    Luc Van Oostenryck
     

06 Jul, 2020

1 commit

  • DMA transaction time to completion is a function of PCI bandwidth,
    transaction size and a queue depth. So hard coded value for timeouts
    might be wrong for some scenarios.

    Signed-off-by: Leonid Ravich
    Reviewed-by: Dave Jiang
    Link: https://lore.kernel.org/r/20200701184816.29138-1-leonid.ravich@dell.com
    Signed-off-by: Vinod Koul

    Leonid Ravich
     

27 Jun, 2020

1 commit

  • The PCI config accessors (pci_read_config_word(), et al) return
    PCIBIOS_SUCCESSFUL (zero) or positive error values like
    PCIBIOS_FUNC_NOT_SUPPORTED.

    The PCIe capability accessors (pcie_capability_read_word(), et al)
    similarly return PCIBIOS errors, but some callers assume they return
    generic errno values like -EINVAL.

    For example, the Myri-10G probe function returns a positive PCIBIOS error
    if the pcie_capability_clear_and_set_word() in pcie_set_readrq() fails:

    myri10ge_probe
    status = pcie_set_readrq
    return pcie_capability_clear_and_set_word
    if (status)
    return status

    A positive return from a PCI driver probe function would cause a "Driver
    probe function unexpectedly returned" warning from local_pci_probe()
    instead of the desired probe failure.

    Convert PCIBIOS errors to generic errno for all callers of:

    pcie_capability_read_word
    pcie_capability_read_dword
    pcie_capability_write_word
    pcie_capability_write_dword
    pcie_capability_set_word
    pcie_capability_set_dword
    pcie_capability_clear_word
    pcie_capability_clear_dword
    pcie_capability_clear_and_set_word
    pcie_capability_clear_and_set_dword

    that check the return code for anything other than zero.

    [bhelgaas: commit log, squash together]
    Suggested-by: Bjorn Helgaas
    Link: https://lore.kernel.org/r/20200615073225.24061-1-refactormyself@gmail.com
    Signed-off-by: Bolarinwa Olayemi Saheed
    Signed-off-by: Bjorn Helgaas

    Bolarinwa Olayemi Saheed
     

23 Apr, 2020

3 commits


17 Apr, 2020

2 commits


19 Feb, 2020

1 commit

  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Link: https://lore.kernel.org/r/20200214171302.GA20586@embeddedor
    Signed-off-by: Vinod Koul

    Gustavo A. R. Silva
     

28 Jan, 2020

1 commit

  • Pull dmaengine updates from Vinod Koul:
    "This time we have a bunch of core changes to support dynamic channels,
    hotplug of controllers, new apis for metadata ops etc along with new
    drivers for Intel data accelerators, TI K3 UDMA, PLX DMA engine and
    hisilicon Kunpeng DMA engine. Also usual assorted updates to drivers.

    Core:
    - Support for dynamic channels
    - Removal of various slave wrappers
    - Make few slave request APIs as private to dmaengine
    - Symlinks between channels and slaves
    - Support for hotplug of controllers
    - Support for metadata_ops for dma_async_tx_descriptor
    - Reporting DMA cached data amount
    - Virtual dma channel locking updates

    New drivers/device/feature support support:
    - Driver for Intel data accelerators
    - Driver for TI K3 UDMA
    - Driver for PLX DMA engine
    - Driver for hisilicon Kunpeng DMA engine
    - Support for eDMA support for QorIQ LS1028A in fsl edma driver
    - Support for cyclic dma in sun4i driver
    - Support for X1830 in JZ4780 driver"

    * tag 'dmaengine-5.6-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (62 commits)
    dmaengine: Create symlinks between DMA channels and slaves
    dmaengine: hisilicon: Add Kunpeng DMA engine support
    dmaengine: idxd: add char driver to expose submission portal to userland
    dmaengine: idxd: connect idxd to dmaengine subsystem
    dmaengine: idxd: add descriptor manipulation routines
    dmaengine: idxd: add sysfs ABI for idxd driver
    dmaengine: idxd: add configuration component of driver
    dmaengine: idxd: Init and probe for Intel data accelerators
    dmaengine: add support to dynamic register/unregister of channels
    dmaengine: break out channel registration
    x86/asm: add iosubmit_cmds512() based on MOVDIR64B CPU instruction
    dmaengine: ti: k3-udma: fix spelling mistake "limted" -> "limited"
    dmaengine: s3c24xx-dma: fix spelling mistake "to" -> "too"
    dmaengine: Move dma_get_{,any_}slave_channel() to private dmaengine.h
    dmaengine: Remove dma_request_slave_channel_compat() wrapper
    dmaengine: Remove dma_device_satisfies_mask() wrapper
    dt-bindings: fsl-imx-sdma: Add i.MX8MM/i.MX8MN/i.MX8MP compatible string
    dmaengine: zynqmp_dma: fix burst length configuration
    dmaengine: sun4i: Add support for cyclic requests with dedicated DMA
    dmaengine: fsl-qdma: fix duplicated argument to &&
    ...

    Linus Torvalds
     

27 Dec, 2019

1 commit

  • If dma_alloc_coherent() returns NULL in ioat_alloc_ring(), ring
    allocation must not proceed.

    Until now, if the first call to dma_alloc_coherent() in
    ioat_alloc_ring() returned NULL, the processing could proceed, failing
    with NULL-pointer dereferencing further down the line.

    Signed-off-by: Alexander Barabash
    Acked-by: Dave Jiang
    Link: https://lore.kernel.org/r/75e9c0e84c3345d693c606c64f8b9ab5@x13pwhopdag1307.AMER.DELL.COM
    Signed-off-by: Vinod Koul

    Alexander.Barabash@dell.com
     

24 Dec, 2019

1 commit

  • Don't allocate memory using the devm infrastructure and instead call
    kfree with the new dmaengine device_release call back. This ensures
    the structures are available until the last reference is dropped.

    We also need to ensure we call ioat_shutdown() in ioat_remove() so
    that all the channels are quiesced and further transaction fails.

    Signed-off-by: Logan Gunthorpe
    Acked-by: Dave Jiang
    Link: https://lore.kernel.org/r/20191216190120.21374-6-logang@deltatee.com
    Signed-off-by: Vinod Koul

    Logan Gunthorpe
     

04 Sep, 2019

1 commit

  • One of the more common cases of allocation size calculations is finding
    the size of a structure that has a zero-sized array at the end, along
    with memory for some number of elements for that array. For example:

    struct ioat_dca_priv {
    ...
    struct ioat_dca_slot req_slots[0];
    };

    Make use of the struct_size() helper instead of an open-coded version
    in order to avoid any potential type mistakes.

    So, replace the following form:

    sizeof(*ioatdca) + (sizeof(struct ioat_dca_slot) * slots)

    with:

    struct_size(ioatdca, req_slots, slots)

    This code was detected with the help of Coccinelle.

    Signed-off-by: Gustavo A. R. Silva
    Acked-by: Dave Jiang
    Link: https://lore.kernel.org/r/20190828184015.GA4273@embeddedor
    Signed-off-by: Vinod Koul

    Gustavo A. R. Silva
     

05 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms and conditions of the gnu general public license
    version 2 as published by the free software foundation this program
    is distributed in the hope it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details the full gnu general public license is included in
    this distribution in the file called copying

    this program is free software you can redistribute it and or modify
    it under the terms and conditions of the gnu general public license
    version 2 as published by the free software foundation this program
    is distributed in the hope [that] it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details the full gnu general public license is included in
    this distribution in the file called copying

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 57 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141901.515993066@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

2 commits

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details the full
    gnu general public license is included in this distribution in the
    file called copying

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 9 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Steve Winslow
    Reviewed-by: Kate Stewart
    Reviewed-by: Jilayne Lovejoy
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190519154041.244154651@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Add SPDX license identifiers to all Make/Kconfig files which:

    - Have no license information of any form

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

25 Feb, 2019

4 commits


25 Oct, 2018

1 commit

  • Pull PCI updates from Bjorn Helgaas:

    - Fix ASPM link_state teardown on removal (Lukas Wunner)

    - Fix misleading _OSC ASPM message (Sinan Kaya)

    - Make _OSC optional for PCI (Sinan Kaya)

    - Don't initialize ASPM link state when ACPI_FADT_NO_ASPM is set
    (Patrick Talbert)

    - Remove x86 and arm64 node-local allocation for host bridge structures
    (Punit Agrawal)

    - Pay attention to device-specific _PXM node values (Jonathan Cameron)

    - Support new Immediate Readiness bit (Felipe Balbi)

    - Differentiate between pciehp surprise and safe removal (Lukas Wunner)

    - Remove unnecessary pciehp includes (Lukas Wunner)

    - Drop pciehp hotplug_slot_ops wrappers (Lukas Wunner)

    - Tolerate PCIe Slot Presence Detect being hardwired to zero to
    workaround broken hardware, e.g., the Wilocity switch/wireless device
    (Lukas Wunner)

    - Unify pciehp controller & slot structs (Lukas Wunner)

    - Constify hotplug_slot_ops (Lukas Wunner)

    - Drop hotplug_slot_info (Lukas Wunner)

    - Embed hotplug_slot struct into users instead of allocating it
    separately (Lukas Wunner)

    - Initialize PCIe port service drivers directly instead of relying on
    initcall ordering (Keith Busch)

    - Restore PCI config state after a slot reset (Keith Busch)

    - Save/restore DPC config state along with other PCI config state
    (Keith Busch)

    - Reference count devices during AER handling to avoid race issue with
    concurrent hot removal (Keith Busch)

    - If an Upstream Port reports ERR_FATAL, don't try to read the Port's
    config space because it is probably unreachable (Keith Busch)

    - During error handling, use slot-specific reset instead of secondary
    bus reset to avoid link up/down issues on hotplug ports (Keith Busch)

    - Restore previous AER/DPC handling that does not remove and
    re-enumerate devices on ERR_FATAL (Keith Busch)

    - Notify all drivers that may be affected by error recovery resets
    (Keith Busch)

    - Always generate error recovery uevents, even if a driver doesn't have
    error callbacks (Keith Busch)

    - Make PCIe link active reporting detection generic (Keith Busch)

    - Support D3cold in PCIe hierarchies during system sleep and runtime,
    including hotplug and Thunderbolt ports (Mika Westerberg)

    - Handle hpmemsize/hpiosize kernel parameters uniformly, whether slots
    are empty or occupied (Jon Derrick)

    - Remove duplicated include from pci/pcie/err.c and unused variable
    from cpqphp (YueHaibing)

    - Remove driver pci_cleanup_aer_uncorrect_error_status() calls (Oza
    Pawandeep)

    - Uninline PCI bus accessors for better ftracing (Keith Busch)

    - Remove unused AER Root Port .error_resume method (Keith Busch)

    - Use kfifo in AER instead of a local version (Keith Busch)

    - Use threaded IRQ in AER bottom half (Keith Busch)

    - Use managed resources in AER core (Keith Busch)

    - Reuse pcie_port_find_device() for AER injection (Keith Busch)

    - Abstract AER interrupt handling to disconnect error injection (Keith
    Busch)

    - Refactor AER injection callbacks to simplify future improvments
    (Keith Busch)

    - Remove unused Netronome NFP32xx Device IDs (Jakub Kicinski)

    - Use bitmap_zalloc() for dma_alias_mask (Andy Shevchenko)

    - Add switch fall-through annotations (Gustavo A. R. Silva)

    - Remove unused Switchtec quirk variable (Joshua Abraham)

    - Fix pci.c kernel-doc warning (Randy Dunlap)

    - Remove trivial PCI wrappers for DMA APIs (Christoph Hellwig)

    - Add Intel GPU device IDs to spurious interrupt quirk (Bin Meng)

    - Run Switchtec DMA aliasing quirk only on NTB endpoints to avoid
    useless dmesg errors (Logan Gunthorpe)

    - Update Switchtec NTB documentation (Wesley Yung)

    - Remove redundant "default n" from Kconfig (Bartlomiej Zolnierkiewicz)

    - Avoid panic when drivers enable MSI/MSI-X twice (Tonghao Zhang)

    - Add PCI support for peer-to-peer DMA (Logan Gunthorpe)

    - Add sysfs group for PCI peer-to-peer memory statistics (Logan
    Gunthorpe)

    - Add PCI peer-to-peer DMA scatterlist mapping interface (Logan
    Gunthorpe)

    - Add PCI configfs/sysfs helpers for use by peer-to-peer users (Logan
    Gunthorpe)

    - Add PCI peer-to-peer DMA driver writer's documentation (Logan
    Gunthorpe)

    - Add block layer flag to indicate driver support for PCI peer-to-peer
    DMA (Logan Gunthorpe)

    - Map Infiniband scatterlists for peer-to-peer DMA if they contain P2P
    memory (Logan Gunthorpe)

    - Register nvme-pci CMB buffer as PCI peer-to-peer memory (Logan
    Gunthorpe)

    - Add nvme-pci support for PCI peer-to-peer memory in requests (Logan
    Gunthorpe)

    - Use PCI peer-to-peer memory in nvme (Stephen Bates, Steve Wise,
    Christoph Hellwig, Logan Gunthorpe)

    - Cache VF config space size to optimize enumeration of many VFs
    (KarimAllah Ahmed)

    - Remove unnecessary include (Bjorn Helgaas)

    - Fix VMD AERSID quirk Device ID matching (Jon Derrick)

    - Fix Cadence PHY handling during probe (Alan Douglas)

    - Signal Cadence Endpoint interrupts via AXI region 0 instead of last
    region (Alan Douglas)

    - Write Cadence Endpoint MSI interrupts with 32 bits of data (Alan
    Douglas)

    - Remove redundant controller tests for "device_type == pci" (Rob
    Herring)

    - Document R-Car E3 (R8A77990) bindings (Tho Vu)

    - Add device tree support for R-Car r8a7744 (Biju Das)

    - Drop unused mvebu PCIe capability code (Thomas Petazzoni)

    - Add shared PCI bridge emulation code (Thomas Petazzoni)

    - Convert mvebu to use shared PCI bridge emulation (Thomas Petazzoni)

    - Add aardvark Root Port emulation (Thomas Petazzoni)

    - Support 100MHz/200MHz refclocks for i.MX6 (Lucas Stach)

    - Add initial power management for i.MX7 (Leonard Crestez)

    - Add PME_Turn_Off support for i.MX7 (Leonard Crestez)

    - Fix qcom runtime power management error handling (Bjorn Andersson)

    - Update TI dra7xx unaligned access errata workaround for host mode as
    well as endpoint mode (Vignesh R)

    - Fix kirin section mismatch warning (Nathan Chancellor)

    - Remove iproc PAXC slot check to allow VF support (Jitendra Bhivare)

    - Quirk Keystone K2G to limit MRRS to 256 (Kishon Vijay Abraham I)

    - Update Keystone to use MRRS quirk for host bridge instead of open
    coding (Kishon Vijay Abraham I)

    - Refactor Keystone link establishment (Kishon Vijay Abraham I)

    - Simplify and speed up Keystone link training (Kishon Vijay Abraham I)

    - Remove unused Keystone host_init argument (Kishon Vijay Abraham I)

    - Merge Keystone driver files into one (Kishon Vijay Abraham I)

    - Remove redundant Keystone platform_set_drvdata() (Kishon Vijay
    Abraham I)

    - Rename Keystone functions for uniformity (Kishon Vijay Abraham I)

    - Add Keystone device control module DT binding (Kishon Vijay Abraham
    I)

    - Use SYSCON API to get Keystone control module device IDs (Kishon
    Vijay Abraham I)

    - Clean up Keystone PHY handling (Kishon Vijay Abraham I)

    - Use runtime PM APIs to enable Keystone clock (Kishon Vijay Abraham I)

    - Clean up Keystone config space access checks (Kishon Vijay Abraham I)

    - Get Keystone outbound window count from DT (Kishon Vijay Abraham I)

    - Clean up Keystone outbound window configuration (Kishon Vijay Abraham
    I)

    - Clean up Keystone DBI setup (Kishon Vijay Abraham I)

    - Clean up Keystone ks_pcie_link_up() (Kishon Vijay Abraham I)

    - Fix Keystone IRQ status checking (Kishon Vijay Abraham I)

    - Add debug messages for all Keystone errors (Kishon Vijay Abraham I)

    - Clean up Keystone includes and macros (Kishon Vijay Abraham I)

    - Fix Mediatek unchecked return value from devm_pci_remap_iospace()
    (Gustavo A. R. Silva)

    - Fix Mediatek endpoint/port matching logic (Honghui Zhang)

    - Change Mediatek Root Port Class Code to PCI_CLASS_BRIDGE_PCI (Honghui
    Zhang)

    - Remove redundant Mediatek PM domain check (Honghui Zhang)

    - Convert Mediatek to pci_host_probe() (Honghui Zhang)

    - Fix Mediatek MSI enablement (Honghui Zhang)

    - Add Mediatek system PM support for MT2712 and MT7622 (Honghui Zhang)

    - Add Mediatek loadable module support (Honghui Zhang)

    - Detach VMD resources after stopping root bus to prevent orphan
    resources (Jon Derrick)

    - Convert pcitest build process to that used by other tools (iio, perf,
    etc) (Gustavo Pimentel)

    * tag 'pci-v4.20-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (140 commits)
    PCI/AER: Refactor error injection fallbacks
    PCI/AER: Abstract AER interrupt handling
    PCI/AER: Reuse existing pcie_port_find_device() interface
    PCI/AER: Use managed resource allocations
    PCI: pcie: Remove redundant 'default n' from Kconfig
    PCI: aardvark: Implement emulated root PCI bridge config space
    PCI: mvebu: Convert to PCI emulated bridge config space
    PCI: mvebu: Drop unused PCI express capability code
    PCI: Introduce PCI bridge emulated config space common logic
    PCI: vmd: Detach resources after stopping root bus
    nvmet: Optionally use PCI P2P memory
    nvmet: Introduce helper functions to allocate and free request SGLs
    nvme-pci: Add support for P2P memory in requests
    nvme-pci: Use PCI p2pmem subsystem to manage the CMB
    IB/core: Ensure we map P2P memory correctly in rdma_rw_ctx_[init|destroy]()
    block: Add PCI P2P flag for request queue
    PCI/P2PDMA: Add P2P DMA driver writer's documentation
    docs-rst: Add a new directory for PCI documentation
    PCI/P2PDMA: Introduce configfs/sysfs enable attribute helpers
    PCI/P2PDMA: Add PCI p2pmem DMA mappings to adjust the bus offset
    ...

    Linus Torvalds
     

05 Oct, 2018

1 commit


03 Oct, 2018

1 commit

  • After bfcb79fca19d ("PCI/ERR: Run error recovery callbacks for all affected
    devices"), AER errors are always cleared by the PCI core and drivers don't
    need to do it themselves.

    Remove calls to pci_cleanup_aer_uncorrect_error_status() from device
    driver error recovery functions.

    Signed-off-by: Oza Pawandeep
    [bhelgaas: changelog, remove PCI core changes, remove unused variables]
    Signed-off-by: Bjorn Helgaas

    Oza Pawandeep
     

19 Sep, 2018

1 commit

  • The following lockdep splat was observed:

    [ 1222.241750] ======================================================
    [ 1222.271301] WARNING: possible circular locking dependency detected
    [ 1222.301060] 4.16.0-10.el8+5.x86_64+debug #1 Not tainted
    [ 1222.326659] ------------------------------------------------------
    [ 1222.356565] systemd-shutdow/1 is trying to acquire lock:
    [ 1222.382660] ((&ioat_chan->timer)){+.-.}, at: [] del_timer_sync+0x5/0xf0
    [ 1222.422928]
    [ 1222.422928] but task is already holding lock:
    [ 1222.451743] (&(&ioat_chan->prep_lock)->rlock){+.-.}, at: [] ioat_shutdown+0x86/0x100 [ioatdma]
    :
    [ 1223.524987] Chain exists of:
    [ 1223.524987] (&ioat_chan->timer) --> &(&ioat_chan->cleanup_lock)->rlock --> &(&ioat_chan->prep_lock)->rlock
    [ 1223.524987]
    [ 1223.594082] Possible unsafe locking scenario:
    [ 1223.594082]
    [ 1223.622630] CPU0 CPU1
    [ 1223.645080] ---- ----
    [ 1223.667404] lock(&(&ioat_chan->prep_lock)->rlock);
    [ 1223.691535] lock(&(&ioat_chan->cleanup_lock)->rlock);
    [ 1223.728657] lock(&(&ioat_chan->prep_lock)->rlock);
    [ 1223.765122] lock((&ioat_chan->timer));
    [ 1223.784095]
    [ 1223.784095] *** DEADLOCK ***
    [ 1223.784095]
    [ 1223.813492] 4 locks held by systemd-shutdow/1:
    [ 1223.834677] #0: (reboot_mutex){+.+.}, at: [] SYSC_reboot+0x10f/0x300
    [ 1223.873310] #1: (&dev->mutex){....}, at: [] device_shutdown+0x1c8/0x660
    [ 1223.913604] #2: (&dev->mutex){....}, at: [] device_shutdown+0x1d6/0x660
    [ 1223.954000] #3: (&(&ioat_chan->prep_lock)->rlock){+.-.}, at: [] ioat_shutdown+0x86/0x100 [ioatdma]

    In the ioat_shutdown() function:

    spin_lock_bh(&ioat_chan->prep_lock);
    set_bit(IOAT_CHAN_DOWN, &ioat_chan->state);
    del_timer_sync(&ioat_chan->timer);
    spin_unlock_bh(&ioat_chan->prep_lock);

    According to the synchronization rule for the del_timer_sync() function,
    the caller must not hold locks which would prevent completion of the
    timer's handler.

    The timer structure has its own lock that manages its synchronization.
    Setting the IOAT_CHAN_DOWN bit should prevent other CPUs from
    trying to use that device anyway, there is probably no need to call
    del_timer_sync() while holding the prep_lock. So the del_timer_sync()
    call is now moved outside of the prep_lock critical section to prevent
    the circular lock dependency.

    Signed-off-by: Waiman Long
    Reviewed-by: Dave Jiang
    Signed-off-by: Vinod Koul

    Waiman Long
     

19 Jun, 2018

1 commit


13 Jun, 2018

1 commit

  • The kzalloc() function has a 2-factor argument form, kcalloc(). This
    patch replaces cases of:

    kzalloc(a * b, gfp)

    with:
    kcalloc(a * b, gfp)

    as well as handling cases of:

    kzalloc(a * b * c, gfp)

    with:

    kzalloc(array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    kzalloc_array(array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    kzalloc(4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    type TYPE;
    expression THING, E;
    @@

    (
    kzalloc(
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    kzalloc(
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    kzalloc(
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    identifier SIZE, COUNT;
    @@

    - kzalloc
    + kcalloc
    (
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    kzalloc(
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    kzalloc(
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    kzalloc(
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    kzalloc(sizeof(THING) * C2, ...)
    |
    kzalloc(sizeof(TYPE) * C2, ...)
    |
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(C1 * C2, ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

03 Jan, 2018

1 commit

  • …k/linux-rcu into core/rcu

    Pull RCU updates from Paul E. McKenney:

    - Updates to use cond_resched() instead of cond_resched_rcu_qs()
    where feasible (currently everywhere except in kernel/rcu and
    in kernel/torture.c). Also a couple of fixes to avoid sending
    IPIs to offline CPUs.

    - Updates to simplify RCU's dyntick-idle handling.

    - Updates to remove almost all uses of smp_read_barrier_depends()
    and read_barrier_depends().

    - Miscellaneous fixes.

    - Torture-test updates.

    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar
     

06 Dec, 2017

1 commit

  • Now that READ_ONCE() implies smp_read_barrier_depends(), the
    __cleanup() and ioat_abort_descs() functions no longer need their
    smp_read_barrier_depends() calls, which this commit removes.
    It is actually not entirely clear why this driver ever included
    smp_read_barrier_depends() given that it appears to be x86-only and
    given that smp_read_barrier_depends() has no effect whatsoever except
    on DEC Alpha.

    Signed-off-by: Paul E. McKenney
    Cc: Vinod Koul
    Cc: Dan Williams
    Cc:

    Paul E. McKenney
     

29 Nov, 2017

1 commit


24 Oct, 2017

1 commit