26 Dec, 2016

1 commit

  • ktime_set(S,N) was required for the timespec storage type and is still
    useful for situations where a Seconds and Nanoseconds part of a time value
    needs to be converted. For anything where the Seconds argument is 0, this
    is pointless and can be replaced with a simple assignment.

    Signed-off-by: Thomas Gleixner
    Cc: Peter Zijlstra

    Thomas Gleixner
     

23 Dec, 2016

1 commit

  • Pull more ACPI updates from Rafael Wysocki:
    "Here are new versions of two ACPICA changes that were deferred
    previously due to a problem they had introduced, two cleanups on top
    of them and the removal of a useless warning message from the ACPI
    core.

    Specifics:

    - Move some Linux-specific functionality to upstream ACPICA and
    update the in-kernel users of it accordingly (Lv Zheng)

    - Drop a useless warning (triggered by the lack of an optional
    object) from the ACPI namespace scanning code (Zhang Rui)"

    * tag 'acpi-extra-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    ACPI / osl: Remove deprecated acpi_get_table_with_size()/early_acpi_os_unmap_memory()
    ACPI / osl: Remove acpi_get_table_with_size()/early_acpi_os_unmap_memory() users
    ACPICA: Tables: Allow FADT to be customized with virtual address
    ACPICA: Tables: Back port acpi_get_table_with_size() and early_acpi_os_unmap_memory() from Linux kernel
    ACPI: do not warn if _BQC does not exist

    Linus Torvalds
     

22 Dec, 2016

1 commit

  • * acpica:
    ACPI / osl: Remove deprecated acpi_get_table_with_size()/early_acpi_os_unmap_memory()
    ACPI / osl: Remove acpi_get_table_with_size()/early_acpi_os_unmap_memory() users
    ACPICA: Tables: Allow FADT to be customized with virtual address
    ACPICA: Tables: Back port acpi_get_table_with_size() and early_acpi_os_unmap_memory() from Linux kernel

    * acpi-scan:
    ACPI: do not warn if _BQC does not exist

    Rafael J. Wysocki
     

21 Dec, 2016

2 commits

  • This patch removes the users of the deprectated APIs:
    acpi_get_table_with_size()
    early_acpi_os_unmap_memory()
    The following APIs should be used instead of:
    acpi_get_table()
    acpi_put_table()

    The deprecated APIs are invented to be a replacement of acpi_get_table()
    during the early stage so that the early mapped pointer will not be stored
    in ACPICA core and thus the late stage acpi_get_table() won't return a
    wrong pointer. The mapping size is returned just because it is required by
    early_acpi_os_unmap_memory() to unmap the pointer during early stage.

    But as the mapping size equals to the acpi_table_header.length
    (see acpi_tb_init_table_descriptor() and acpi_tb_validate_table()), when
    such a convenient result is returned, driver code will start to use it
    instead of accessing acpi_table_header to obtain the length.

    Thus this patch cleans up the drivers by replacing returned table size with
    acpi_table_header.length, and should be a no-op.

    Reported-by: Dan Williams
    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • Pull mailbox updates from Jassi Brar:

    - new features (poll and SRAM usage) added to the mailbox-test driver

    - major update of Broadcom's PDC controller driver

    - minor fix for auto-loading test and STI driver modules

    * 'mailbox-for-next' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
    mailbox: mailbox-test: allow reserved areas in SRAM
    mailbox: mailbox-test: add support for fasync/poll
    mailbox: bcm-pdc: Remove unnecessary void* casts
    mailbox: bcm-pdc: Simplify interrupt handler logic
    mailbox: bcm-pdc: Performance improvements
    mailbox: bcm-pdc: Don't use iowrite32 to write DMA descriptors
    mailbox: bcm-pdc: Convert from threaded IRQ to tasklet
    mailbox: bcm-pdc: Try to improve branch prediction
    mailbox: bcm-pdc: streamline rx code
    mailbox: bcm-pdc: Convert from interrupts to poll for tx done
    mailbox: bcm-pdc: PDC driver leaves debugfs files after removal
    mailbox: bcm-pdc: Changes so mbox client can be removed / re-inserted
    mailbox: bcm-pdc: Use octal permissions rather than symbolic
    mailbox: sti: Fix module autoload for OF registration
    mailbox: mailbox-test: Fix module autoload

    Linus Torvalds
     

19 Dec, 2016

15 commits

  • When CONFIG_SRAM is enable and the SRAM region is found, the entire SRAM
    region resource is requested and marked as occupied by SRAM driver even
    if certain parts of regions is marked reserved.

    It's quite possible that a small region of the SRAM is reserved for all
    the mailbox communication and hence it may fail to request the region
    as it's already marked busy region.

    This patch tries to just do a ioremap of this mailbox memory region if
    it finds it busy.

    Cc: Lee Jones
    Signed-off-by: Sudeep Holla
    Signed-off-by: Jassi Brar

    Sudeep Holla
     
  • Currently the read operation on the message debug file returns error if
    there's no data ready to be read. It expects the userspace to retry if
    it fails. Since the mailbox response could be asynchronous, it would be
    good to add support to block the read until the data is available.

    We can also implement poll file operations so that the userspace can
    wait to become ready to perform any I/O.

    This patch implements the poll and fasync file operation callback for
    the test mailbox device.

    Cc: Lee Jones
    Signed-off-by: Sudeep Holla
    Signed-off-by: Jassi Brar

    Sudeep Holla
     
  • Remove unnecessary void* casts in register writes. Fix two other
    minor formatting issues.

    Signed-off-by: Rob Rice
    Reviewed-by: Andy Gospodarek
    Reviewed-by: Jon Mason
    Signed-off-by: Jassi Brar

    Rob Rice
     
  • Earlier versions of the PDC driver registered for both
    transmit and receive interrupts. The hard IRQ handler had to
    communicate to the soft handler which interrupt(s) had occurred.
    The PDC driver no longer registers for tx interrupts. So there is
    no reason to save the intstatus. So remove the intstatus member
    of the PDC state.

    Signed-off-by: Rob Rice
    Reviewed-by: Andy Gospodarek
    Signed-off-by: Jassi Brar

    Rob Rice
     
  • Three changes to improve performance in the PDC driver:
    - disable and reenable interrupts while the interrupt handler is
    running
    - update rxin and txin descriptor indexes more efficiently
    - group receive descriptor context into a structure and keep
    context in a single array rather than five to improve locality
    of reference

    Signed-off-by: Rob Rice
    Reviewed-by: Andy Gospodarek
    Signed-off-by: Jassi Brar

    Rob Rice
     
  • In PDC driver, it is not necessary to use iowrite32()
    when writing DMA descriptors to the transmit and receive rings.
    The ring memory is in host memory. So convert to normal
    assignment statements.

    Signed-off-by: Rob Rice
    Reviewed-by: Andy Gospodarek
    Signed-off-by: Jassi Brar

    Rob Rice
     
  • Previously used threaded IRQs in the PDC driver to defer
    processing the rx DMA ring after getting an rx done interrupt.
    Instead, use a tasklet at normal priority for deferred processing.

    Signed-off-by: Rob Rice
    Reviewed-by: Andy Gospodarek
    Signed-off-by: Jassi Brar

    Rob Rice
     
  • Use likely/unlikely directives to improve branch prediction.

    Signed-off-by: Rob Rice
    Reviewed-by: Andy Gospodarek
    Signed-off-by: Jassi Brar

    Rob Rice
     
  • Remove the unnecessary rmb() from the receive path.

    If the rx ring has multiple messages ready, avoid reading
    last_rx_curr multiple times from the register.

    Signed-off-by: Rob Rice
    Reviewed-by: Andy Gospodarek
    Signed-off-by: Jassi Brar

    Rob Rice
     
  • The PDC driver is a mailbox controller. A mailbox controller
    can report that a mailbox message has been "transmitted" either when
    a tx interrupt fires or by having the mailbox framework poll. This
    commit converts the PDC driver to the poll method. We found that the
    tx interrupt happens when the descriptors are read by the SPU hw. Thus,
    the interrupt method does not allow more than one tx message in the PDC
    tx DMA ring at a time. To keep the SPU hw busy, we would like to keep
    the tx ring full under heavy load.

    With the poll method, the PDC driver responds that the previous message
    has been transmitted if the tx ring has space for another message.
    SPU request messages take a variable number of descriptors. If 15
    descriptors are available, there is a good chance another message will
    fit. Also increased the ring size from 128 to 512 descriptors.

    With this change, I found the PDC driver hangs on its spinlock under
    heavy load. The PDC spinlock is not required; so I removed it. Calls
    to pdc_send_data() are already synchronized because of the channel
    spinlock in the mailbox framework. Other references to ring indexes
    should not require locking because they only written on either the
    tx or rx side.

    Signed-off-by: Rob Rice
    Reviewed-by: Andy Gospodarek
    Signed-off-by: Jassi Brar

    Rob Rice
     
  • Minor fix to ensure that debugfs stats pseudo-files are
    removed when driver module is unloaded. Previously, the call to
    debugfs_remove_recursive() was never being called since the
    directory was not empty, and a seg fault would occur if another
    process tried to access these leftover files.

    Signed-off-by: Steve Lin
    Signed-off-by: Rob Rice
    Reviewed-by: Andy Gospodarek
    Signed-off-by: Jassi Brar

    Steve Lin
     
  • Ensure that DMA is disabled, and pointers reset, when changing
    DMA base addresses in pdc_ring_init(). This allows a mailbox client
    to be re-inserted after being removed. Otherwise, the DMA doesn't
    restart so the client hangs while being reinserted.

    Signed-off-by: Steve Lin
    Signed-off-by: Rob Rice
    Reviewed-by: Andy Gospodarek
    Signed-off-by: Jassi Brar

    Steve Lin
     
  • When creating the debugfs files for the PDC driver, use
    octal file permissions rather than symbolic file permissions.

    Signed-off-by: Rob Rice
    Reviewed-by: Andy Gospodarek
    Signed-off-by: Jassi Brar

    Rob Rice
     
  • If the driver is built as a module, autoload won't work because the module
    alias information is not filled. So user-space can't match the registered
    device with the corresponding module.

    Export the module alias information using the MODULE_DEVICE_TABLE() macro.

    Before this patch:

    $ modinfo drivers/mailbox/mailbox-sti.ko | grep alias
    alias: platform:mailbox-sti

    After this patch:

    $ modinfo drivers/mailbox/mailbox-sti.ko | grep alias
    alias: platform:mailbox-sti
    alias: of:N*T*Cst,stih407-mailboxC*
    alias: of:N*T*Cst,stih407-mailbox

    Signed-off-by: Javier Martinez Canillas
    Acked-by: Lee Jones
    Signed-off-by: Jassi Brar

    Javier Martinez Canillas
     
  • If the driver is built as a module, autoload won't work because the module
    alias information is not filled. So user-space can't match the registered
    device with the corresponding module.

    Export the module alias information using the MODULE_DEVICE_TABLE() macro.

    Before this patch:

    $ modinfo drivers/mailbox/mailbox-test.ko | grep alias
    $

    After this patch:

    $ modinfo drivers/mailbox/mailbox-test.ko | grep alias
    alias: of:N*T*Cmailbox-testC*
    alias: of:N*T*Cmailbox-test

    Signed-off-by: Javier Martinez Canillas
    Acked-by: Lee Jones
    Signed-off-by: Jassi Brar

    Javier Martinez Canillas
     

16 Dec, 2016

1 commit

  • Pull ARM SoC driver updates from Arnd Bergmann:
    "Driver updates for ARM SoCs, including a couple of newly added
    drivers:

    - A new driver for the power management controller on TI Keystone

    - Support for the prerelease "SCPI" firmware protocol that ended up
    being shipped by Amlogic in their GXBB SoC.

    - A soc_device can now be matched using a glob from inside the
    kernel, when another driver wants to know the specific chip it is
    running on and cannot find out from DT, firmware or hardware.

    - Renesas SoCs now support identification through the soc_device
    interface, both in user space and kernel.

    - Renesas r8a7743 and r8a7745 gain support for their system
    controller

    - A new checking module for the ARM "PSCI" (not to be confused with
    "SCPI" mentioned above) firmware interface.

    - A new driver for the Tegra GMI memory interface

    - Support for the Tegra firmware interfaces with their power
    management controllers

    As usual, the updates for the reset controller framework are merged
    here, as they tend to touch multiple SoCs as well, including a new
    driver for the Oxford (now Broadcom) OX820 chip and the Tegra bpmp
    interface.

    The existing drivers for Atmel, Qualcomm, NVIDIA, TI Davinci, and
    Rockchips SoCs see some further updates"

    * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (76 commits)
    misc: sram: remove useless #ifdef
    drivers: psci: Allow PSCI node to be disabled
    drivers: psci: PSCI checker module
    soc: renesas: Identify SoC and register with the SoC bus
    firmware: qcom: scm: Return PTR_ERR when devm_clk_get fails
    firmware: qcom: scm: Remove core, iface and bus clocks dependency
    dt-bindings: firmware: scm: Add MSM8996 DT bindings
    memory: da8xx-ddrctl: drop the call to of_flat_dt_get_machine_name()
    bus: da8xx-mstpri: drop the call to of_flat_dt_get_machine_name()
    ARM: shmobile: Document DT bindings for Product Register
    soc: renesas: rcar-sysc: add R8A7745 support
    reset: Add Tegra BPMP reset driver
    dt-bindings: firmware: Allow child nodes inside the Tegra BPMP
    dt-bindings: Add power domains to Tegra BPMP firmware
    firmware: tegra: Add BPMP support
    firmware: tegra: Add IVC library
    dt-bindings: firmware: Add bindings for Tegra BPMP
    mailbox: tegra-hsp: Use after free in tegra_hsp_remove_doorbells()
    mailbox: Add Tegra HSP driver
    firmware: arm_scpi: add support for pre-v1.0 SCPI compatible
    ...

    Linus Torvalds
     

18 Nov, 2016

2 commits

  • We have to use the _safe version of list_for_each() because we're
    freeing the pointer as we go along. (This might not show up testing
    depending on what config options you have enabled).

    Fixes: 0fe88461a0ec ("mailbox: Add Tegra HSP driver")
    Signed-off-by: Dan Carpenter
    Signed-off-by: Thierry Reding

    Dan Carpenter
     
  • This driver exposes a mailbox interface for interprocessor communication
    using the Hardware Synchronization Primitives (HSP) module's doorbell
    mechanism. There are multiple HSP instances and they provide additional
    features such as shared mailboxes, shared and arbitrated semaphores.

    A driver for a remote processor can use the mailbox client provided by
    the HSP driver and build an IPC protocol on top of this synchronization
    mechanism.

    Based on work by Joseph Lo .

    Acked-by: Jassi Brar
    Signed-off-by: Thierry Reding

    Thierry Reding
     

15 Nov, 2016

1 commit

  • This patch fixes the lockdep warning below

    DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))
    ------------[ cut here ]------------
    WARNING: CPU: 1 PID: 1 at linux-next/kernel/locking/lockdep.c:2876 lockdep_trace_alloc+0xe0/0xf0
    Modules linked in:

    CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.8.0-11756-g86c5152 #46
    ...
    Call trace:
    Exception stack(0xffff8007da837890 to 0xffff8007da8379c0)
    7880: ffff8007da834000 0001000000000000
    78a0: ffff8007da837a70 ffff0000081111a0 00000000600000c5 000000000000003d
    78c0: 9374bc6a7f3c7832 0000000000381878 ffff000009db7ab8 000000000000002f
    78e0: ffff00000811aabc ffff000008be2548 ffff8007da837990 ffff00000811adf8
    7900: ffff8007da834000 00000000024080c0 00000000000000c0 ffff000009021000
    7920: 0000000000000000 0000000000000000 ffff000008c8f7c8 ffff8007da579810
    7940: 000000000000002f ffff8007da858000 0000000000000000 0000000000000001
    7960: 0000000000000001 0000000000000000 ffff00000811a468 0000000000000002
    7980: 656c62617369645f 0000000000038187 00000000000000ee ffff8007da837850
    79a0: ffff000009db50c0 ffff000009db569d 0000000000000006 ffff000089db568f
    [] lockdep_trace_alloc+0xe0/0xf0
    [] __kmalloc_track_caller+0x50/0x250
    [] devres_alloc_node+0x28/0x60
    [] devm_request_threaded_irq+0x50/0xe0
    [] pcc_mbox_request_channel+0x110/0x170
    [] acpi_cppc_processor_probe+0x264/0x414
    [] __acpi_processor_start+0x28/0xa0
    [] acpi_processor_start+0x44/0x54
    [] driver_probe_device+0x1fc/0x2b0
    [] __driver_attach+0xb4/0xc0
    [] bus_for_each_dev+0x5c/0xa0
    [] driver_attach+0x20/0x30
    [] bus_add_driver+0x110/0x230
    [] driver_register+0x60/0x100
    [] acpi_processor_driver_init+0x2c/0xb0
    [] do_one_initcall+0x38/0x130
    [] kernel_init_freeable+0x210/0x2b4
    [] kernel_init+0x10/0x110
    [] ret_from_fork+0x10/0x50

    It's because the spinlock inside pcc_mbox_request_channel() is
    kept too long. This patch releases spinlock before request_irq()
    and free_irq() to fix this issue as spinlock is only needed to
    protect the channel data.

    Signed-off-by: Hoan Tran
    Reviewed-by: Prashanth Prakash
    Signed-off-by: Rafael J. Wysocki

    Hoan Tran
     

07 Oct, 2016

1 commit


02 Oct, 2016

1 commit

  • * acpi-x86:
    x86: ACPI: make variable names clearer in acpi_parse_madt_lapic_entries()
    x86: ACPI: remove extraneous white space after semicolon

    * acpi-cppc:
    ACPI / CPPC: Support PCC with interrupt flag
    ACPI / CPPC: Add prefix cppc to cpudata structure name
    ACPI / CPPC: Add support for functional fixed hardware address
    ACPI / CPPC: Don't return on CPPC probe failure
    ACPI / CPPC: Allow build with ACPI_CPU_FREQ_PSS config
    ACPI / CPPC: check for error bit in PCC status field
    ACPI / CPPC: move all PCC related information into pcc_data
    ACPI / CPPC: add sysfs support to compute delivered performance
    ACPI / CPPC: set a non-zero value for transition_latency
    ACPI / CPPC: support for batching CPPC requests
    ACPI / CPPC: acquire pcc_lock only while accessing PCC subspace
    ACPI / CPPC: restructure read/writes for efficient sys mapped reg ops
    mailbox: pcc: Support HW-Reduced Communication Subspace type 2

    * acpi-soc:
    ACPI / APD: constify local structures
    ACPI / APD: Add device HID for Vulcan SPI controller

    Rafael J. Wysocki
     

07 Sep, 2016

1 commit


31 Aug, 2016

1 commit

  • ACPI 6.1 has a PCC HW-Reduced Communication Subspace type 2 intended for
    use on HW-Reduce ACPI Platform, which requires read-modify-write sequence
    to acknowledge doorbell interrupt. This patch provides the implementation
    for the Communication Subspace Type 2.

    Signed-off-by: Hoan Tran
    Reviewed-by: Prashanth Prakash
    Signed-off-by: Rafael J. Wysocki

    hotran
     

29 Aug, 2016

3 commits


28 Jul, 2016

2 commits


24 Jun, 2016

1 commit

  • The use of __raw IO accesors is not endian safe and should be used
    sparingly. The relaxed variants should be as lightweight and also
    are endian safe.

    Note, this has not been run-time tested.

    Signed-off-by: Ben Dooks
    Acked-by: Rob Herring
    Signed-off-by: Jassi Brar

    Ben Dooks
     

12 Jun, 2016

1 commit

  • tdev->signal is not set NULL after it's freed. This will cause random
    exceptions when the stale pointer is accessed after tdev->signal is
    freed. Also, since tdev->signal allocation is skipped the next time
    it's written, this leads to continuous fault finally leading to the
    total death of the system.

    Fixes: d1c2f87c9a8f ("mailbox: mailbox-test: Prevent memory leak")
    Signed-off-by: Sudeep Holla
    Acked-by: Lee Jones
    Signed-off-by: Jassi Brar

    Sudeep Holla
     

09 May, 2016

1 commit


26 Apr, 2016

4 commits

  • The omap_mbox_save_ctx() and omap_mbox_restore_ctx() API were
    previously provided to OMAP mailbox clients to save and restore
    the mailbox context during system suspend/resume. The save and
    restore functionality is now implemented through System PM driver
    callbacks, and there is no need for these functions, so kill these
    API.

    Signed-off-by: Suman Anna
    Signed-off-by: Jassi Brar

    Suman Anna
     
  • The OMAP mailbox driver is used by clients to communicate with remote
    processors in general. The mailbox clients are expected to have stopped
    communicating with these remote processors during a system suspend. The
    OMAP mailbox fifos are expected to not have any messages as such. Add a
    check for any pending unprocessed messages in the suspend callback, to
    detect any communication protocol issues of the mailbox clients. The
    system suspend is aborted if any messages are found.

    Signed-off-by: Suman Anna
    Signed-off-by: Jassi Brar

    Suman Anna
     
  • Support has been added to the OMAP mailbox driver to allow it
    to work across a system suspend/resume. The OMAP mailbox driver
    requires only the interrupt configuration registers to be saved
    and restored, and this is done in the suspend/resume callbacks.
    The registers need to be saved only if there are active clients
    at the time of suspend. The enabling and disabling of the mailbox
    clocks is done automatically by the omap_device layer.

    Signed-off-by: Suman Anna
    Signed-off-by: Jassi Brar

    Suman Anna
     
  • The interrupt type used for identifying the layout of the interrupt
    configuration registers between OMAP4+ SoCs and older SoCs is stored
    only in the sub-mailbox structures for easier access. Store this type
    in the the omap_mbox_device structure as well along with the other
    global variables. This is being done to facilitate the context save
    and restore of appropriate registers during system suspend/resume.

    Signed-off-by: Suman Anna
    Signed-off-by: Jassi Brar

    Suman Anna