16 Oct, 2020

1 commit

  • Pull dma-mapping updates from Christoph Hellwig:

    - rework the non-coherent DMA allocator

    - move private definitions out of

    - lower CMA_ALIGNMENT (Paul Cercueil)

    - remove the omap1 dma address translation in favor of the common code

    - make dma-direct aware of multiple dma offset ranges (Jim Quinlan)

    - support per-node DMA CMA areas (Barry Song)

    - increase the default seg boundary limit (Nicolin Chen)

    - misc fixes (Robin Murphy, Thomas Tai, Xu Wang)

    - various cleanups

    * tag 'dma-mapping-5.10' of git://git.infradead.org/users/hch/dma-mapping: (63 commits)
    ARM/ixp4xx: add a missing include of dma-map-ops.h
    dma-direct: simplify the DMA_ATTR_NO_KERNEL_MAPPING handling
    dma-direct: factor out a dma_direct_alloc_from_pool helper
    dma-direct check for highmem pages in dma_direct_alloc_pages
    dma-mapping: merge into
    dma-mapping: move large parts of to kernel/dma
    dma-mapping: move dma-debug.h to kernel/dma/
    dma-mapping: remove
    dma-mapping: merge into
    dma-contiguous: remove dma_contiguous_set_default
    dma-contiguous: remove dev_set_cma_area
    dma-contiguous: remove dma_declare_contiguous
    dma-mapping: split
    cma: decrease CMA_ALIGNMENT lower limit to 2
    firewire-ohci: use dma_alloc_pages
    dma-iommu: implement ->alloc_noncoherent
    dma-mapping: add new {alloc,free}_noncoherent dma_map_ops methods
    dma-mapping: add a new dma_alloc_pages API
    dma-mapping: remove dma_cache_sync
    53c700: convert to dma_alloc_noncoherent
    ...

    Linus Torvalds
     

25 Sep, 2020

1 commit


18 Sep, 2020

1 commit

  • The new field 'dma_range_map' in struct device is used to facilitate the
    use of single or multiple offsets between mapping regions of cpu addrs and
    dma addrs. It subsumes the role of "dev->dma_pfn_offset" which was only
    capable of holding a single uniform offset and had no region bounds
    checking.

    The function of_dma_get_range() has been modified so that it takes a single
    argument -- the device node -- and returns a map, NULL, or an error code.
    The map is an array that holds the information regarding the DMA regions.
    Each range entry contains the address offset, the cpu_start address, the
    dma_start address, and the size of the region.

    of_dma_configure() is the typical manner to set range offsets but there are
    a number of ad hoc assignments to "dev->dma_pfn_offset" in the kernel
    driver code. These cases now invoke the function
    dma_direct_set_offset(dev, cpu_addr, dma_addr, size).

    Signed-off-by: Jim Quinlan
    [hch: various interface cleanups]
    Signed-off-by: Christoph Hellwig
    Reviewed-by: Mathieu Poirier
    Tested-by: Mathieu Poirier
    Tested-by: Nathan Chancellor

    Jim Quinlan
     

14 Sep, 2020

1 commit


11 Sep, 2020

1 commit

  • Fix kernel-doc warning in :

    ../include/linux/device.h:613: warning: Function parameter or member 'em_pd' not described in 'device'

    Fixes: 1bc138c62295 ("PM / EM: add support for other devices than CPUs in Energy Model")
    Signed-off-by: Randy Dunlap
    Reviewed-by: Lukasz Luba
    Signed-off-by: Rafael J. Wysocki

    Randy Dunlap
     

09 Sep, 2020

1 commit

  • This reverts commit e1f82a0dcf388d98bcc7ad195c03bd812405e6b2 as it's
    already starting to cause build warnings in linux-next for things that
    are "obviously correct".

    It's up to driver authors do "do the right thing" here with this
    function, and if they don't want to call it as the last line of a
    function, that's up to them, otherwise code that looks like:
    ret = dev_err_probe(..., ret, ...);
    does look really "odd".

    Reported-by: Stephen Rothwell
    Reported-by: Krzysztof Kozlowski
    Fixes: e1f82a0dcf38 ("driver core: Annotate dev_err_probe() with __must_check")
    Cc: Andy Shevchenko
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

08 Sep, 2020

2 commits

  • Implement the managed variant of krealloc(). This function works with
    all memory allocated by devm_kmalloc() (or devres functions using it
    implicitly like devm_kmemdup(), devm_kstrdup() etc.).

    Managed realloc'ed chunks can be manually released with devm_kfree().

    Signed-off-by: Bartosz Golaszewski
    Reviewed-by: Andy Shevchenko
    Link: https://lore.kernel.org/r/20200824173859.4910-2-brgl@bgdev.pl
    Signed-off-by: Greg Kroah-Hartman

    Bartosz Golaszewski
     
  • The function is now only a helper that searches the
    connection from device graph and then by checking if the
    supplied connection identifier matches a property that
    contains reference.

    Signed-off-by: Heikki Krogerus
    Link: https://lore.kernel.org/r/20200907120532.37611-2-heikki.krogerus@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Heikki Krogerus
     

07 Sep, 2020

4 commits


06 Aug, 2020

2 commits

  • Pull Devicetree updates from Rob Herring:

    - Improve device links cycle detection and breaking. Add more bindings
    for device link dependencies.

    - Refactor parsing 'no-map' in __reserved_mem_alloc_size()

    - Improve DT unittest 'ranges' and 'dma-ranges' test case to check
    differing cell sizes

    - Various http to https link conversions

    - Add a schema check to prevent 'syscon' from being used by itself
    without a more specific compatible

    - A bunch more DT binding conversions to schema

    * tag 'devicetree-for-5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (55 commits)
    of: reserved-memory: remove duplicated call to of_get_flat_dt_prop() for no-map node
    of: unittest: Use bigger address cells to catch parser regressions
    dt-bindings: memory-controllers: Convert mmdc to json-schema
    dt-bindings: mtd: Convert imx nand to json-schema
    dt-bindings: mtd: Convert gpmi nand to json-schema
    dt-bindings: iio: io-channel-mux: Fix compatible string in example code
    of: property: Add device link support for pinctrl-0 through pinctrl-8
    of: property: Add device link support for multiple DT bindings
    dt-bindings: phy: ti: phy-gmii-sel: convert bindings to json-schema
    dt-bindings: mux: mux.h: drop a duplicated word
    dt-bindings: misc: Convert olpc,xo1.75-ec to json-schema
    dt-bindings: aspeed-lpc: Replace HTTP links with HTTPS ones
    dt-bindings: drm/bridge: Replace HTTP links with HTTPS ones
    drm/tilcdc: Replace HTTP links with HTTPS ones
    dt-bindings: iommu: renesas,ipmmu-vmsa: Add r8a774e1 support
    dt-bindings: fpga: Replace HTTP links with HTTPS ones
    dt-bindings: virtio: Replace HTTP links with HTTPS ones
    dt-bindings: media: imx274: Add optional input clock and supplies
    dt-bindings: i2c-gpio: Use 'deprecated' keyword on deprecated properties
    dt-bindings: interrupt-controller: Fix typos in loongson,liointc.yaml
    ...

    Linus Torvalds
     
  • Pull driver core updates from Greg KH:
    "Here is the "big" set of changes to the driver core, and some drivers
    using the changes, for 5.9-rc1.

    "Biggest" thing in here is the device link exposure in sysfs, to help
    to tame the madness that is SoC device tree representations and driver
    interactions with it.

    Other stuff in here that is interesting is:

    - device probe log helper so that drivers can report problems in a
    unified way easier.

    - devres functions added

    - DEVICE_ATTR_ADMIN_* macro added to make it harder to write
    incorrect sysfs file permissions

    - documentation cleanups

    - ability for debugfs to be present in the kernel, yet not exposed to
    userspace. Needed for systems that want it enabled, but do not
    trust users, so they can still use some kernel functions that were
    otherwise disabled.

    - other minor fixes and cleanups

    The patches outside of drivers/base/ all have acks from the respective
    subsystem maintainers to go through this tree instead of theirs.

    All of these have been in linux-next with no reported issues"

    * tag 'driver-core-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (39 commits)
    drm/bridge: lvds-codec: simplify error handling
    drm/bridge/sii8620: fix resource acquisition error handling
    driver core: add deferring probe reason to devices_deferred property
    driver core: add device probe log helper
    driver core: Avoid binding drivers to dead devices
    Revert "test_firmware: Test platform fw loading on non-EFI systems"
    firmware_loader: EFI firmware loader must handle pre-allocated buffer
    selftest/firmware: Add selftest timeout in settings
    test_firmware: Test platform fw loading on non-EFI systems
    driver core: Change delimiter in devlink device's name to "--"
    debugfs: Add access restriction option
    tracefs: Remove unnecessary debug_fs checks.
    driver core: Fix probe_count imbalance in really_probe()
    kobject: remove unused KOBJ_MAX action
    driver core: Fix sleeping in invalid context during device link deletion
    driver core: Add waiting_for_supplier sysfs file for devices
    driver core: Add state_synced sysfs file for devices that support it
    driver core: Expose device link details in sysfs
    driver core: Drop mention of obsolete bus rwsem from kernel-doc
    debugfs: file: Remove unnecessary cast in kfree()
    ...

    Linus Torvalds
     

05 Aug, 2020

1 commit

  • Pull dma-mapping updates from Christoph Hellwig:

    - make support for dma_ops optional

    - move more code out of line

    - add generic support for a dma_ops bypass mode

    - misc cleanups

    * tag 'dma-mapping-5.9' of git://git.infradead.org/users/hch/dma-mapping:
    dma-contiguous: cleanup dma_alloc_contiguous
    dma-debug: use named initializers for dir2name
    powerpc: use the generic dma_ops_bypass mode
    dma-mapping: add a dma_ops_bypass flag to struct device
    dma-mapping: make support for dma ops optional
    dma-mapping: inline the fast path dma-direct calls
    dma-mapping: move the remaining DMA API calls out of line

    Linus Torvalds
     

03 Aug, 2020

1 commit

  • * pm-em:
    OPP: refactor dev_pm_opp_of_register_em() and update related drivers
    Documentation: power: update Energy Model description
    PM / EM: change name of em_pd_energy to em_cpu_energy
    PM / EM: remove em_register_perf_domain
    PM / EM: add support for other devices than CPUs in Energy Model
    PM / EM: update callback structure and add device pointer
    PM / EM: introduce em_dev_register_perf_domain function
    PM / EM: change naming convention from 'capacity' to 'performance'

    * pm-core:
    mmc: jz4740: Use pm_ptr() macro
    PM: Make *_DEV_PM_OPS macros use __maybe_unused
    PM: core: introduce pm_ptr() macro

    Rafael J. Wysocki
     

30 Jul, 2020

1 commit

  • During probe every time driver gets resource it should usually check for
    error printk some message if it is not -EPROBE_DEFER and return the error.
    This pattern is simple but requires adding few lines after any resource
    acquisition code, as a result it is often omitted or implemented only
    partially.
    dev_err_probe helps to replace such code sequences with simple call,
    so code:
    if (err != -EPROBE_DEFER)
    dev_err(dev, ...);
    return err;
    becomes:
    return dev_err_probe(dev, err, ...);

    Signed-off-by: Andrzej Hajda
    Reviewed-by: Rafael J. Wysocki
    Reviewed-by: Mark Brown
    Reviewed-by: Andy Shevchenko
    Link: https://lore.kernel.org/r/20200713144324.23654-2-a.hajda@samsung.com
    Signed-off-by: Greg Kroah-Hartman

    Andrzej Hajda
     

20 Jul, 2020

1 commit


19 Jul, 2020

2 commits


10 Jul, 2020

3 commits

  • It's helpful to be able to look at device link details from sysfs. So,
    expose it in sysfs.

    Say device-A is supplier of device-B. These are the additional files
    this patch would create:

    /sys/class/devlink/device-A:device-B/
    auto_remove_on
    consumer/ -> .../device-B/
    runtime_pm
    status
    supplier/ -> .../device-A/
    sync_state_only

    /sys/devices/.../device-A/
    consumer:device-B/ -> /sys/class/devlink/device-A:device-B/

    /sys/devices/.../device-B/
    supplier:device-A/ -> /sys/class/devlink/device-A:device-B/

    That way:
    To get a list of all the device link in the system:
    ls /sys/class/devlink/

    To get the consumer names and links of a device:
    ls -d /sys/devices/.../device-X/consumer:*

    To get the supplier names and links of a device:
    ls -d /sys/devices/.../device-X/supplier:*

    Signed-off-by: Saravana Kannan
    Link: https://lore.kernel.org/r/20200521191800.136035-2-saravanak@google.com
    Signed-off-by: Greg Kroah-Hartman

    Saravana Kannan
     
  • With the earlier patch in this series, all devices that deferred probe
    due to fw_devlink_pause() will have their probes delayed till the
    deferred probe thread is kicked off during late_initcall. This will also
    affect all their consumers.

    This delayed probing in unnecessary. So this patch just keeps track of
    the devices that had their probe deferred due to fw_devlink_pause() and
    attempts to probe them once during fw_devlink_resume().

    Fixes: 716a7a259690 ("driver core: fw_devlink: Add support for batching fwnode parsing")
    Signed-off-by: Saravana Kannan
    Tested-by: Geert Uytterhoeven
    Link: https://lore.kernel.org/r/20200701194259.3337652-4-saravanak@google.com
    Signed-off-by: Greg Kroah-Hartman

    Saravana Kannan
     
  • The defer_sync field is used as a hook to add the device to the
    deferred_sync list. Rename it so that it's more meaningful for the next
    patch that'll also use this field as a hook to a deferred_fw_devlink
    list.

    Signed-off-by: Saravana Kannan
    Reviewed-by: Rafael J. Wysocki
    Tested-by: Geert Uytterhoeven
    Link: https://lore.kernel.org/r/20200701194259.3337652-3-saravanak@google.com
    Signed-off-by: Greg Kroah-Hartman

    Saravana Kannan
     

02 Jul, 2020

2 commits

  • Functions are declared 'extern' implicitly by the compiler. There's no
    reason to prepend every prototype with it. Remove the 'extern' keyword
    from all function declarations in linux/device.h.

    Signed-off-by: Bartosz Golaszewski
    Link: https://lore.kernel.org/r/20200629065008.27620-4-brgl@bgdev.pl
    Signed-off-by: Greg Kroah-Hartman

    Bartosz Golaszewski
     
  • A common pattern for using plain DEVICE_ATTR() instead of
    DEVICE_ATTR_RO() and DEVICE_ATTR_RW() is for attributes that want to
    limit read to only root. I.e. many users of DEVICE_ATTR() are
    specifying 0400 or 0600 for permissions.

    Given the expectation that CAP_SYS_ADMIN is needed to access these
    sensitive attributes and an explicit helper with the _ADMIN_ identifier
    for DEVICE_ATTR_ADMIN_{RO,RW}.

    Cc: "Rafael J. Wysocki"
    Signed-off-by: Dan Williams
    Link: https://lore.kernel.org/r/159312906372.1850128.11611897078988158727.stgit@dwillia2-desk3.amr.corp.intel.com
    Signed-off-by: Greg Kroah-Hartman

    Dan Williams
     

24 Jun, 2020

1 commit


18 Jun, 2020

1 commit


10 May, 2020

1 commit


09 Apr, 2020

1 commit

  • Pull iommu updates from Joerg Roedel:

    - ARM-SMMU support for the TLB range invalidation command in SMMUv3.2

    - ARM-SMMU introduction of command batching helpers to batch up CD and
    ATC invalidation

    - ARM-SMMU support for PCI PASID, along with necessary PCI symbol
    exports

    - Introduce a generic (actually rename an existing) IOMMU related
    pointer in struct device and reduce the IOMMU related pointers

    - Some fixes for the OMAP IOMMU driver to make it build on 64bit
    architectures

    - Various smaller fixes and improvements

    * tag 'iommu-updates-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (39 commits)
    iommu: Move fwspec->iommu_priv to struct dev_iommu
    iommu/virtio: Use accessor functions for iommu private data
    iommu/qcom: Use accessor functions for iommu private data
    iommu/mediatek: Use accessor functions for iommu private data
    iommu/renesas: Use accessor functions for iommu private data
    iommu/arm-smmu: Use accessor functions for iommu private data
    iommu/arm-smmu: Refactor master_cfg/fwspec usage
    iommu/arm-smmu-v3: Use accessor functions for iommu private data
    iommu: Introduce accessors for iommu private data
    iommu/arm-smmu: Fix uninitilized variable warning
    iommu: Move iommu_fwspec to struct dev_iommu
    iommu: Rename struct iommu_param to dev_iommu
    iommu/tegra-gart: Remove direct access of dev->iommu_fwspec
    drm/msm/mdp5: Remove direct access of dev->iommu_fwspec
    ACPI/IORT: Remove direct access of dev->iommu_fwspec
    iommu: Define dev_iommu_fwspec_get() for !CONFIG_IOMMU_API
    iommu/virtio: Reject IOMMU page granule larger than PAGE_SIZE
    iommu/virtio: Fix freeing of incomplete domains
    iommu/virtio: Fix sparse warning
    iommu/vt-d: Add build dependency on IOASID
    ...

    Linus Torvalds
     

27 Mar, 2020

3 commits


13 Mar, 2020

1 commit


04 Mar, 2020

1 commit


27 Feb, 2020

1 commit

  • Add a helper to change the owner of a device's sysfs entries. This
    needs to happen when the ownership of a device is changed, e.g. when
    moving network devices between network namespaces.
    This function will be used to correctly account for ownership changes,
    e.g. when moving network devices between network namespaces.

    Reviewed-by: Greg Kroah-Hartman
    Signed-off-by: Christian Brauner
    Signed-off-by: David S. Miller

    Christian Brauner
     

16 Dec, 2019

5 commits

  • device.h has everything and the kitchen sink when it comes to struct
    device things, so split out the struct driver things things to a
    separate .h file to make things easier to maintain and manage over time.

    Cc: "Rafael J. Wysocki"
    Cc: Suzuki K Poulose
    Cc: Saravana Kannan
    Cc: Heikki Krogerus
    Link: https://lore.kernel.org/r/20191209193303.1694546-7-gregkh@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • device.h has everything and the kitchen sink when it comes to struct
    device things, so split out the struct class things things to a separate
    .h file to make things easier to maintain and manage over time.

    Cc: "Rafael J. Wysocki"
    Cc: Suzuki K Poulose
    Cc: Saravana Kannan
    Cc: Heikki Krogerus
    Link: https://lore.kernel.org/r/20191209193303.1694546-6-gregkh@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • device.h has everything and the kitchen sink when it comes to struct
    device things, so split out the struct bus things things to a separate
    .h file to make things easier to maintain and manage over time.

    Cc: "Rafael J. Wysocki"
    Cc: Suzuki K Poulose
    Cc: Saravana Kannan
    Cc: Heikki Krogerus
    Link: https://lore.kernel.org/r/20191209193303.1694546-5-gregkh@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • device.h has everything and the kitchen sink when it comes to struct
    device things, so split out the printk-specific things to a separate .h
    file to make things easier to maintain and manage over time.

    Cc: Suzuki K Poulose
    Cc: "Rafael J. Wysocki"
    Cc: Saravana Kannan
    Cc: Heikki Krogerus
    Link: https://lore.kernel.org/r/20191209193303.1694546-4-gregkh@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • The devtmpfs functions do not need to be in device.h as only the driver
    core uses them, so move them to the private .h file for the driver core.

    Cc: "Rafael J. Wysocki"
    Cc: Suzuki K Poulose
    Cc: Saravana Kannan
    Cc: Heikki Krogerus
    Link: https://lore.kernel.org/r/20191209193303.1694546-3-gregkh@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman