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
     

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
     

09 Apr, 2016

1 commit

  • * pm-cpufreq:
    cpufreq: dt: Drop stale comment
    cpufreq: intel_pstate: Documenation for structures
    cpufreq: intel_pstate: fix inconsistency in setting policy limits
    intel_pstate: Avoid extra invocation of intel_pstate_sample()
    intel_pstate: Do not set utilization update hook too early

    * pm-cpuidle:
    intel_idle: Add KBL support
    intel_idle: Add SKX support
    intel_idle: Clean up all registered devices on exit.
    intel_idle: Propagate hot plug errors.
    intel_idle: Don't overreact to a cpuidle registration failure.
    intel_idle: Setup the timer broadcast only on successful driver load.
    intel_idle: Avoid a double free of the per-CPU data.
    intel_idle: Fix dangling registration on error path.
    intel_idle: Fix deallocation order on the driver exit path.
    intel_idle: Remove redundant initialization calls.
    intel_idle: Fix a helper function's return value.
    intel_idle: remove useless return from void function.

    * acpi-cppc:
    mailbox: pcc: Don't access an unmapped memory address space

    Rafael J. Wysocki
     

07 Apr, 2016

1 commit

  • The acpi_pcc_probe() may end up accessing memory outside of the PCCT
    table space causing the kernel panic(). Increment the pcct_entry
    pointer after parsing 'HW-reduced Communications Subspace' to fix
    the problem. This change also enables the parsing of subtable at
    index 0.

    Signed-off-by: Shanker Donthineni
    Acked-by: Ashwin Chaugule
    Signed-off-by: Rafael J. Wysocki

    Shanker Donthineni
     

14 Mar, 2016

1 commit

  • * acpi-processor:
    ACPI / sleep: move acpi_processor_sleep to sleep.c
    ACPI / processor : add support for ACPI0010 processor container
    ACPI / processor_idle: replace PREFIX with pr_fmt

    * acpi-cppc:
    ACPI / CPPC: use MRTT/MPAR to decide if/when a req can be sent
    ACPI / CPPC: replace writeX/readX to PCC with relaxed version
    mailbox: pcc: optimized pcc_send_data
    ACPI / CPPC: optimized cpc_read and cpc_write
    ACPI / CPPC: Optimize PCC Read Write operations

    Rafael J. Wysocki
     

10 Mar, 2016

1 commit

  • pcc_send_data() can be invoked during the execution of performance
    critical code as in cppc_cpufreq driver. With acpi_* APIs, the
    doorbell register accessed in pcc_send_data() if present in system
    memory will be searched (in cached virt to phys addr mapping),
    mapped, read/written and then unmapped. These operations take
    significant amount of time.

    This patch maps the performance critical doorbell register
    during init and then reads/writes to it directly using the
    mapped virtual address. This patch + similar changes to CPPC
    acpi driver reduce the time per freq. transition from around
    200us to about 20us for the CPPC cpufreq driver

    Signed-off-by: Prashanth Prakash
    Acked-by: Ashwin Chaugule
    Signed-off-by: Rafael J. Wysocki

    Prakash, Prashanth
     

02 Feb, 2016

1 commit

  • This patch fixes the calculation of pcc_chan for non-zero id.
    After the compiler ignores the (unsigned long) cast the
    pcc_mbox_channels pointer is type-cast and then the type-cast
    offset is added which results in address outside of the range
    leading to the kernel crashing.

    We might add braces and make it:

    pcc_chan = (struct mbox_chan *)
    ((unsigned long) pcc_mbox_channels +
    (id * sizeof(*pcc_chan)));

    but let's go with array approach here and use id as index.

    Tested on Juno board.

    Signed-off-by: Alexey Klimov
    Acked-by: Sudeep Holla
    Acked-by: Ashwin Chaugule
    Signed-off-by: Jassi Brar

    Alexey Klimov
     

16 Oct, 2015

1 commit


25 Aug, 2015

1 commit

  • This change initializes the PCC Mailbox earlier than
    the ACPI processor driver. This enables drivers introduced
    in follow up patches (e.g. CPPC) to be probed via the ACPI
    processor driver interface. The CPPC probe requires the PCC
    channel to be initialized for it to query each CPUs performance
    capabilities.

    Signed-off-by: Ashwin Chaugule
    Reviewed-by: Al Stone
    Signed-off-by: Rafael J. Wysocki

    Ashwin Chaugule
     

12 May, 2015

1 commit

  • The mailbox controller's channel ops ought to be read-only. Update
    all the mailbox drivers to make their mbox_chan_ops const as well.

    Signed-off-by: Andrew Bresticker
    Cc: Ashwin Chaugule
    Cc: Ley Foon Tan
    Acked-by: Suman Anna
    Signed-off-by: Jassi Brar

    Andrew Bresticker
     

04 Mar, 2015

1 commit

  • Previously the PCC driver depended on the client
    side to map the communication space base address. This region
    was was then used in the PCC driver and the client side.
    The client side used this region to read and write its data
    and the PCC driver used it to only write the PCC command.
    Removing this split simplifies the PCC driver a lot. This patch
    moves all communication region read/writes to the client side.
    The PCC clients can now drive the PCC mailbox controller via the
    mbox_client_txdone() method.

    Signed-off-by: Ashwin Chaugule

    Ashwin Chaugule
     

12 Feb, 2015

1 commit


06 Feb, 2015

1 commit


05 Feb, 2015

1 commit


27 Nov, 2014

1 commit

  • ACPI 5.0+ spec defines a generic mode of communication
    between the OS and a platform such as the BMC. This medium
    (PCC) is typically used by CPPC (ACPI CPU Performance management),
    RAS (ACPI reliability protocol) and MPST (ACPI Memory power
    states).

    This patch adds PCC support as a Mailbox Controller. As of
    ACPI v5.1 there is no provision for clients to lookup mailbox
    controllers in a way that Linux expects. e.g. in DT the clients
    can list the mailboxes they can associate with in the DT binding
    and then provide a unique index to lookup a channel within a mailbox.
    Since the ACPI spec doesn't have anything similar, we introduce a
    mailbox controller specific API so that when the client calls it,
    we know to lookup in the context of a specific controller. This
    also helps in keeping a consistent interface across DT and ACPI
    for such drivers.

    This patch implements basic PCC support using the ACPI v5.1
    structures. IRQ mode support will be provided as follow up patches.

    Signed-off-by: Ashwin Chaugule
    Reviewed-by: Mark Brown
    Reviewed-by: Arnd Bergmann
    Signed-off-by: Jassi Brar

    Ashwin Chaugule