17 Aug, 2022

1 commit

  • [ Upstream commit bd734481e172b4827af09c9ab06c51d2ab7201e6 ]

    max_node_id not equal to the ARRAY_SIZE of node array, need increase 1,
    otherwise xlate will fail for the last entry. And rename max_node_id
    to num_nodes to reflect the reality.

    Fixes: f0d8048525d7d ("interconnect: Add imx core driver")
    Reviewed-by: Laurent Pinchart
    Signed-off-by: Peng Fan
    Link: https://lore.kernel.org/r/20220703091132.1412063-5-peng.fan@oss.nxp.com
    Signed-off-by: Georgi Djakov
    Signed-off-by: Sasha Levin

    Peng Fan
     

09 Jun, 2022

2 commits

  • commit b95b668eaaa2574e8ee72f143c52075e9955177e upstream.

    We're only adding BCMs to the commit list in aggregate(), but there are
    cases where pre_aggregate() is called without subsequently calling
    aggregate(). In particular, in icc_sync_state() when a node with initial
    BW has zero requests. Since BCMs aren't added to the commit list in
    these cases, we don't actually send the zero BW request to HW. So the
    resources remain on unnecessarily.

    Add BCMs to the commit list in pre_aggregate() instead, which is always
    called even when there are no requests.

    Signed-off-by: Mike Tipton
    [georgi: remove icc_sync_state for platforms with incomplete support]
    Link: https://lore.kernel.org/r/20211125174751.25317-1-djakov@kernel.org
    Signed-off-by: Georgi Djakov
    Signed-off-by: Stephen Boyd
    Signed-off-by: Greg Kroah-Hartman

    Mike Tipton
     
  • commit 2f3724930eb4bba74f7d10bc3bef5bb22dd323df upstream.

    The IPA BCM resource ("IP0") on sc7180 was moved to the clk-rpmh driver
    in commit bcd63d222b60 ("clk: qcom: rpmh: Add IPA clock for SC7180") and
    modeled as a clk, but this interconnect driver still had it modeled as
    an interconnect. This was mostly OK because nobody used the interconnect
    definition, until the interconnect framework started dropping bandwidth
    requests on interconnects that aren't used via the sync_state callback
    in commit 7d3b0b0d8184 ("interconnect: qcom: Use icc_sync_state"). Once
    that patch was applied the IP0 resource was going to be controlled from
    two places, the clk framework and the interconnect framework.

    Even then, things were probably going to be OK, because commit
    b95b668eaaa2 ("interconnect: qcom: icc-rpmh: Add BCMs to commit list in
    pre_aggregate") was needed to actually drop bandwidth requests on unused
    interconnects, of which the IPA was one of the interconnect that wasn't
    getting dropped to zero. Combining the three commits together leads to
    bad behavior where the interconnect framework is disabling the IP0
    resource because it has no users while the clk framework thinks the IP0
    resource is on because the only user, the IPA driver, has turned it on
    via clk_prepare_enable(). Depending on when sync_state is called, we can
    get into a situation like below:

    IPA driver probes
    IPA driver gets notified modem started
    runtime PM get()
    IPA clk enabled -> IP0 resource is ON
    sync_state runs
    interconnect zeroes out the IP0 resource -> IP0 resource is off
    IPA driver tries to access a register and blows up

    The crash is an unclocked access that manifest as an SError.

    SError Interrupt on CPU0, code 0xbe000011 -- SError
    CPU: 0 PID: 3595 Comm: mmdata_mgr Not tainted 5.17.1+ #166
    Hardware name: Google Lazor (rev1 - 2) with LTE (DT)
    pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    pc : mutex_lock+0x4c/0x80
    lr : mutex_lock+0x30/0x80
    sp : ffffffc00da9b9c0
    x29: ffffffc00da9b9c0 x28: 0000000000000000 x27: 0000000000000000
    x26: ffffffc00da9bc90 x25: ffffff80c2024010 x24: ffffff80c2024000
    x23: ffffff8083100000 x22: ffffff80831000d0 x21: ffffff80831000a8
    x20: ffffff80831000a8 x19: ffffff8083100070 x18: 00000000ffff0a00
    x17: 000000002f7254f1 x16: 0000000000000100 x15: 0000000000000000
    x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
    x11: 000000000001f0b8 x10: ffffffc00931f0b8 x9 : 0000000000000000
    x8 : 0000000000000000 x7 : fefefefefeff2f60 x6 : 0000808080808080
    x5 : 0000000000000000 x4 : 8080808080800000 x3 : ffffff80d2d4ee28
    x2 : ffffff808c1d6e40 x1 : 0000000000000000 x0 : ffffff8083100070
    Kernel panic - not syncing: Asynchronous SError Interrupt
    CPU: 0 PID: 3595 Comm: mmdata_mgr Not tainted 5.17.1+ #166
    Hardware name: Google Lazor (rev1 - 2) with LTE (DT)
    Call trace:
    dump_backtrace+0xf4/0x114
    show_stack+0x24/0x30
    dump_stack_lvl+0x64/0x7c
    dump_stack+0x18/0x38
    panic+0x150/0x38c
    nmi_panic+0x88/0xa0
    arm64_serror_panic+0x74/0x80
    do_serror+0x0/0x80
    do_serror+0x58/0x80
    el1h_64_error_handler+0x34/0x4c
    el1h_64_error+0x78/0x7c
    mutex_lock+0x4c/0x80
    __gsi_channel_start+0x50/0x17c
    gsi_channel_start+0x54/0x90
    ipa_endpoint_enable_one+0x34/0xc0
    ipa_open+0x4c/0x120

    Remove all IP0 resource management from the interconnect driver so that
    clk-rpmh is the sole owner. This fixes the issue by preventing the
    interconnect driver from overwriting the IP0 resource data that the
    clk-rpmh driver wrote.

    Cc: Alex Elder
    Cc: Bjorn Andersson
    Cc: Taniya Das
    Cc: Mike Tipton
    Fixes: b95b668eaaa2 ("interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate")
    Fixes: bcd63d222b60 ("clk: qcom: rpmh: Add IPA clock for SC7180")
    Fixes: 7d3b0b0d8184 ("interconnect: qcom: Use icc_sync_state")
    Signed-off-by: Stephen Boyd
    Tested-by: Alex Elder
    Reviewed-by: Alex Elder
    Reviewed-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/20220412220033.1273607-2-swboyd@chromium.org
    Signed-off-by: Georgi Djakov
    Signed-off-by: Greg Kroah-Hartman

    Stephen Boyd
     

18 May, 2022

1 commit

  • [ Upstream commit 20ce30fb4750f2ffc130cdcb26232b1dd87cd0a5 ]

    Ignore compatible strings for the IPA virt drivers that were removed in
    commits 2fb251c26560 ("interconnect: qcom: sdx55: Drop IP0
    interconnects") and 2f3724930eb4 ("interconnect: qcom: sc7180: Drop IP0
    interconnects") so that the sync state logic can kick in again.
    Otherwise all the interconnects in the system will stay pegged at max
    speeds because 'providers_count' is always going to be one larger than
    the number of drivers that will ever probe on sc7180 or sdx55. This
    fixes suspend on sc7180 and sdx55 devices when you don't have a
    devicetree patch to remove the ipa-virt compatible node.

    Cc: Bjorn Andersson
    Cc: Doug Anderson
    Cc: Alex Elder
    Cc: Taniya Das
    Cc: Mike Tipton
    Fixes: 2fb251c26560 ("interconnect: qcom: sdx55: Drop IP0 interconnects")
    Fixes: 2f3724930eb4 ("interconnect: qcom: sc7180: Drop IP0 interconnects")
    Signed-off-by: Stephen Boyd
    Reviewed-by: Alex Elder
    Reviewed-by: Douglas Anderson
    Link: https://lore.kernel.org/r/20220427013226.341209-1-swboyd@chromium.org
    Signed-off-by: Georgi Djakov
    Signed-off-by: Sasha Levin

    Stephen Boyd
     

09 May, 2022

1 commit

  • [ Upstream commit 2fb251c265608636fc961b7d38e1a03937e57371 ]

    Similar to the sc7180 commit, let's drop the IP0 interconnects here
    because the IP0 resource is also used in the clk-rpmh driver on sdx55.
    It's bad to have the clk framework and interconnect framework control
    the same RPMh resource without any coordination. The rpmh driver in the
    kernel doesn't aggregate resources between clients either, so leaving
    control to clk-rpmh avoids any issues with unused interconnects turning
    off IP0 behind the back of the clk framework.

    Cc: Alex Elder
    Cc: Manivannan Sadhasivam
    Cc: Bjorn Andersson
    Cc: Taniya Das
    Cc: Mike Tipton
    Fixes: b2150cab9a97 ("clk: qcom: rpmh: add support for SDX55 rpmh IPA clock")
    Signed-off-by: Stephen Boyd
    Reviewed-by: Alex Elder
    Acked-by: Manivannan Sadhasivam
    Reviewed-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/20220412220033.1273607-3-swboyd@chromium.org
    Signed-off-by: Georgi Djakov
    Signed-off-by: Sasha Levin

    Stephen Boyd
     

27 Jan, 2022

1 commit

  • [ Upstream commit a7d9436a6c85fcb8843c910fd323dcd7f839bf63 ]

    Using icc-rpm on ARM32 currently results in clk_set_rate() errors during
    boot, e.g. "bus clk_set_rate error: -22". This is very similar to commit
    7381e27b1e56 ("interconnect: qcom: msm8974: Prevent integer overflow in rate")
    where the u64 is converted to a signed long during clock rate rounding,
    resulting in an overflow on 32-bit platforms.

    Let's fix it similarly by making sure that the rate does not exceed
    LONG_MAX. Such high clock rates will surely result in the maximum
    frequency of the bus anyway.

    Signed-off-by: Stephan Gerhold
    Link: https://lore.kernel.org/r/20211206114542.45325-1-stephan@gerhold.net
    Signed-off-by: Georgi Djakov
    Signed-off-by: Sasha Levin

    Stephan Gerhold
     

13 Sep, 2021

3 commits

  • It adds the missing a2noc clocks required for QoS registers programming
    per downstream kernel[1]. Otherwise, qcom_icc_noc_set_qos_priority()
    call on mas_ufs or mas_usb_hs node will simply result in a hardware hang
    on SDM660 SoC.

    [1] https://source.codeaurora.org/quic/la/kernel/msm-4.4/tree/arch/arm/boot/dts/qcom/sdm660-bus.dtsi?h=LA.UM.8.2.r1-04800-sdm660.0#n43

    Signed-off-by: Shawn Guo
    Tested-by: Bjorn Andersson
    Reviewed-by: AngeloGioacchino Del Regno
    Link: https://lore.kernel.org/r/20210824043435.23190-3-shawn.guo@linaro.org
    Signed-off-by: Georgi Djakov

    Shawn Guo
     
  • The NOC_QOS_PRIORITY shift and mask do not match what vendor kernel
    defines [1]. Correct them per vendor kernel. As the result of
    NOC_QOS_PRIORITY_P0_SHIFT being 0, the definition can be dropped and
    regmap_update_bits() call on P0 can be simplified a bit.

    [1] https://source.codeaurora.org/quic/la/kernel/msm-4.4/tree/drivers/soc/qcom/msm_bus/msm_bus_noc_adhoc.c?h=LA.UM.8.2.r1-04800-sdm660.0#n37

    Fixes: f80a1d414328 ("interconnect: qcom: Add SDM660 interconnect provider driver")
    Signed-off-by: Shawn Guo
    Reviewed-by: Dmitry Baryshkov
    Reviewed-by: AngeloGioacchino Del Regno
    Link: https://lore.kernel.org/r/20210902054915.28689-1-shawn.guo@linaro.org
    Signed-off-by: Georgi Djakov

    Shawn Guo
     
  • The id of slv_cnoc_mnoc_cfg node is mistakenly coded as id of
    slv_blsp_1. It causes the following warning on slv_blsp_1 node adding.
    Correct the id of slv_cnoc_mnoc_cfg node.

    [ 1.948180] ------------[ cut here ]------------
    [ 1.954122] WARNING: CPU: 2 PID: 7 at drivers/interconnect/core.c:962 icc_node_add+0xe4/0xf8
    [ 1.958994] Modules linked in:
    [ 1.967399] CPU: 2 PID: 7 Comm: kworker/u16:0 Not tainted 5.14.0-rc6-next-20210818 #21
    [ 1.970275] Hardware name: Xiaomi Redmi Note 7 (DT)
    [ 1.978169] Workqueue: events_unbound deferred_probe_work_func
    [ 1.982945] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    [ 1.988849] pc : icc_node_add+0xe4/0xf8
    [ 1.995699] lr : qnoc_probe+0x350/0x438
    [ 1.999519] sp : ffff80001008bb10
    [ 2.003337] x29: ffff80001008bb10 x28: 000000000000001a x27: ffffb83ddc61ee28
    [ 2.006818] x26: ffff2fe341d44080 x25: ffff2fe340f3aa80 x24: ffffb83ddc98f0e8
    [ 2.013938] x23: 0000000000000024 x22: ffff2fe3408b7400 x21: 0000000000000000
    [ 2.021054] x20: ffff2fe3408b7410 x19: ffff2fe341d44080 x18: 0000000000000010
    [ 2.028173] x17: ffff2fe3bdd0aac0 x16: 0000000000000281 x15: ffff2fe3400f5528
    [ 2.035290] x14: 000000000000013f x13: ffff2fe3400f5528 x12: 00000000ffffffea
    [ 2.042410] x11: ffffb83ddc9109d0 x10: ffffb83ddc8f8990 x9 : ffffb83ddc8f89e8
    [ 2.049527] x8 : 0000000000017fe8 x7 : c0000000ffffefff x6 : 0000000000000001
    [ 2.056645] x5 : 0000000000057fa8 x4 : 0000000000000000 x3 : ffffb83ddc9903b0
    [ 2.063764] x2 : 1a1f6fde34d45500 x1 : ffff2fe340f3a880 x0 : ffff2fe340f3a880
    [ 2.070882] Call trace:
    [ 2.077989] icc_node_add+0xe4/0xf8
    [ 2.080247] qnoc_probe+0x350/0x438
    [ 2.083718] platform_probe+0x68/0xd8
    [ 2.087191] really_probe+0xb8/0x300
    [ 2.091011] __driver_probe_device+0x78/0xe0
    [ 2.094659] driver_probe_device+0x80/0x110
    [ 2.098911] __device_attach_driver+0x90/0xe0
    [ 2.102818] bus_for_each_drv+0x78/0xc8
    [ 2.107331] __device_attach+0xf0/0x150
    [ 2.110977] device_initial_probe+0x14/0x20
    [ 2.114796] bus_probe_device+0x9c/0xa8
    [ 2.118963] deferred_probe_work_func+0x88/0xc0
    [ 2.122784] process_one_work+0x1a4/0x338
    [ 2.127296] worker_thread+0x1f8/0x420
    [ 2.131464] kthread+0x150/0x160
    [ 2.135107] ret_from_fork+0x10/0x20
    [ 2.138495] ---[ end trace 5eea8768cb620e87 ]---

    Signed-off-by: Shawn Guo
    Reviewed-by: Bjorn Andersson
    Fixes: f80a1d414328 ("interconnect: qcom: Add SDM660 interconnect provider driver")
    Link: https://lore.kernel.org/r/20210823014003.31391-1-shawn.guo@linaro.org
    Signed-off-by: Georgi Djakov

    Shawn Guo
     

24 Aug, 2021

1 commit

  • …/icc into char-misc-next

    Georgi writes:

    interconnect changes for 5.15

    Here are changes for the 5.15-rc1 merge window consisting of interconnect
    core and driver updates.

    Framework change:
    - Add sanity check to detect if node is already added to provider.

    Driver changes:
    - RPMh drivers probe function consolidation
    - Add driver for SC8180x platforms
    - Add support for SC8180x OSM L3
    - Use driver-specific naming in OSM L3

    Signed-off-by: Georgi Djakov <djakov@kernel.org>

    * tag 'icc-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc:
    interconnect: qcom: osm-l3: Use driver-specific naming
    interconnect: qcom: osm-l3: Add sc8180x support
    dt-bindings: interconnect: Add SC8180x to OSM L3 DT binding
    interconnect: qcom: Add SC8180x providers
    dt-bindings: interconnect: Add Qualcomm SC8180x DT bindings
    interconnect: Sanity check that node isn't already on list
    interconnect: qcom: icc-rpmh: Consolidate probe functions

    Greg Kroah-Hartman
     

12 Aug, 2021

1 commit

  • This reverts commit f84f5b6f72e68bbaeb850b58ac167e4a3a47532a, which is
    causing regressions on some platforms, preventing them to boot or do a
    clean reboot. This is because the above commit is sending also all the
    zero bandwidth requests to turn off any resources that might be enabled
    unnecessarily, but currently this may turn off interconnects that are
    enabled by default, but with no consumer to keep them on.

    Let's revert this for now as some platforms are not ready for such
    change yet. In the future we can introduce some _ignore_unused option
    that could keep also the unused resources on platforms that have only
    partial interconnect support and also add .shutdown callbacks to deal
    with disabling the resources in the right order.

    Reported-by: Stephen Boyd
    Reported-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/CAE-0n52iVgX0JjjnYi=NDg49xP961p=+W5R2bmO+2xwRceFhfA@mail.gmail.com
    Signed-off-by: Georgi Djakov

    Georgi Djakov
     

10 Aug, 2021

1 commit

  • In situations were the developer screws up by e.g. not giving the OSM
    nodes unique identifiers the interconnect framework might mix up nodes
    between the OSM L3 provider and e.g. the RPMh provider.

    The resulting callstack contains "qcom_icc_set", which is not unique to
    the OSM L3 provider driver. Once the faulting qcom_icc_set() is
    identified it's further confusing that "qcom_icc_node" is different
    between the different drivers.

    To avoid this confusion, rename the node struct and the setter in the
    OSM L3 driver to include "osm_l3" in their names.

    Signed-off-by: Bjorn Andersson
    Tested-by: Steev Klimaszewski
    Reviewed-by: Stephen Boyd
    Link: https://lore.kernel.org/r/20210725031414.3961227-1-bjorn.andersson@linaro.org
    Signed-off-by: Georgi Djakov

    Bjorn Andersson
     

09 Aug, 2021

2 commits


02 Aug, 2021

1 commit

  • The expression sizeof(**ptr) for the void **ptr is just 1 rather than
    the size of a pointer. Fix this by using sizeof(*ptr).

    Addresses-Coverity: ("Wrong sizeof argument")
    Fixes: e145d9a184f2 ("interconnect: Add devm_of_icc_get() as exported API for users")
    Signed-off-by: Colin Ian King
    Link: https://lore.kernel.org/r/20210730075408.19945-1-colin.king@canonical.com
    Signed-off-by: Georgi Djakov

    Colin Ian King
     

30 Jul, 2021

2 commits

  • We're only adding BCMs to the commit list in aggregate(), but there are
    cases where pre_aggregate() is called without subsequently calling
    aggregate(). In particular, in icc_sync_state() when a node with initial
    BW has zero requests. Since BCMs aren't added to the commit list in
    these cases, we don't actually send the zero BW request to HW. So the
    resources remain on unnecessarily.

    Add BCMs to the commit list in pre_aggregate() instead, which is always
    called even when there are no requests.

    Fixes: 976daac4a1c5 ("interconnect: qcom: Consolidate interconnect RPMh support")
    Signed-off-by: Mike Tipton
    Link: https://lore.kernel.org/r/20210721175432.2119-5-mdtipton@codeaurora.org
    Signed-off-by: Georgi Djakov

    Mike Tipton
     
  • We currently only enforce BW floors for a subset of nodes in a path.
    All BCMs that need updating are queued in the pre_aggregate/aggregate
    phase. The first set() commits all queued BCMs and subsequent set()
    calls short-circuit without committing anything. Since the floor BW
    isn't set in sum_avg/max_peak until set(), then some BCMs are committed
    before their associated nodes reflect the floor.

    Set the floor as each node is being aggregated. This ensures that all
    all relevant floors are set before the BCMs are committed.

    Fixes: 266cd33b5913 ("interconnect: qcom: Ensure that the floor bandwidth value is enforced")
    Signed-off-by: Mike Tipton
    Link: https://lore.kernel.org/r/20210721175432.2119-4-mdtipton@codeaurora.org
    [georgi: Removed unused variable]
    Signed-off-by: Georgi Djakov

    Mike Tipton
     

22 Jul, 2021

4 commits

  • The pre_aggregate callback isn't called in all cases before calling
    aggregate. Add the missing calls so providers can rely on consistent
    framework behavior.

    Fixes: d3703b3e255f ("interconnect: Aggregate before setting initial bandwidth")
    Signed-off-by: Mike Tipton
    Link: https://lore.kernel.org/r/20210721175432.2119-3-mdtipton@codeaurora.org
    Signed-off-by: Georgi Djakov

    Mike Tipton
     
  • The initial BW values may be used by providers to enforce floors. Zero
    these values after sync-state so that providers know when to stop
    enforcing them.

    Fixes: b1d681d8d324 ("interconnect: Add sync state support")
    Signed-off-by: Mike Tipton
    Link: https://lore.kernel.org/r/20210721175432.2119-2-mdtipton@codeaurora.org
    Signed-off-by: Georgi Djakov

    Mike Tipton
     
  • Broken interconnect providers might add the same node multiple times or
    in multiple providers, which causes strange errors as the provider's
    node list is later traversed.

    Detect that a node already has an associated provider, complain and
    reject the addition of the node, to aid the developer.

    Signed-off-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/20210625234903.1324755-1-bjorn.andersson@linaro.org
    Signed-off-by: Georgi Djakov

    Bjorn Andersson
     
  • The current probe/remove functions are implemented separately for each
    target, but they are almost identical. Replace them with common
    functions that can be used across all rpmh targets.

    Signed-off-by: Mike Tipton
    Reviewed-by: Matthias Kaehlcke
    Link: https://lore.kernel.org/r/20210621214241.13521-1-mdtipton@codeaurora.org
    Signed-off-by: Georgi Djakov

    Mike Tipton
     

23 Jun, 2021

1 commit

  • …/icc into char-misc-next

    Georgi writes:

    interconnect changes for 5.14

    Here are changes for the 5.14-rc1 merge window consisting of interconnect
    driver updates.

    Driver changes:
    - New driver for SC7280 platforms.

    Signed-off-by: Georgi Djakov <djakov@kernel.org>

    * tag 'icc-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc:
    interconnect: qcom: Add SC7280 interconnect provider driver
    dt-bindings: interconnect: Add Qualcomm SC7280 DT bindings

    Greg Kroah-Hartman
     

11 May, 2021

3 commits

  • Add driver for the Qualcomm interconnect buses found in SC7280 based
    platforms. The topology consists of several NoCs that are controlled by
    a remote processor that collects the aggregated bandwidth for each
    master-slave pairs.

    Signed-off-by: Odelu Kukatla
    Link: https://lore.kernel.org/r/1619517059-12109-3-git-send-email-okukatla@codeaurora.org
    Signed-off-by: Georgi Djakov

    Odelu Kukatla
     
  • This patch adds missing MODULE_DEVICE_TABLE definition which generates
    correct modalias for automatic loading of this driver when it is built
    as an external module.

    Reported-by: Hulk Robot
    Signed-off-by: Zou Wei
    Link: https://lore.kernel.org/r/1620704673-104205-1-git-send-email-zou_wei@huawei.com
    Fixes: 976daac4a1c5 ("interconnect: qcom: Consolidate interconnect RPMh support")
    Signed-off-by: Georgi Djakov

    Zou Wei
     
  • Add a missing of_node_put() in of_bcm_voter_get() to avoid the
    reference leak.

    Signed-off-by: Subbaraman Narayanamurthy
    Reviewed-by: Matthias Kaehlcke
    Link: https://lore.kernel.org/r/1619116570-13308-1-git-send-email-subbaram@codeaurora.org
    Fixes: 976daac4a1c5 ("interconnect: qcom: Consolidate interconnect RPMh support")
    Signed-off-by: Georgi Djakov

    Subbaraman Narayanamurthy
     

28 Apr, 2021

1 commit

  • Pull CFI on arm64 support from Kees Cook:
    "This builds on last cycle's LTO work, and allows the arm64 kernels to
    be built with Clang's Control Flow Integrity feature. This feature has
    happily lived in Android kernels for almost 3 years[1], so I'm excited
    to have it ready for upstream.

    The wide diffstat is mainly due to the treewide fixing of mismatched
    list_sort prototypes. Other things in core kernel are to address
    various CFI corner cases. The largest code portion is the CFI runtime
    implementation itself (which will be shared by all architectures
    implementing support for CFI). The arm64 pieces are Acked by arm64
    maintainers rather than coming through the arm64 tree since carrying
    this tree over there was going to be awkward.

    CFI support for x86 is still under development, but is pretty close.
    There are a handful of corner cases on x86 that need some improvements
    to Clang and objtool, but otherwise works well.

    Summary:

    - Clean up list_sort prototypes (Sami Tolvanen)

    - Introduce CONFIG_CFI_CLANG for arm64 (Sami Tolvanen)"

    * tag 'cfi-v5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
    arm64: allow CONFIG_CFI_CLANG to be selected
    KVM: arm64: Disable CFI for nVHE
    arm64: ftrace: use function_nocfi for ftrace_call
    arm64: add __nocfi to __apply_alternatives
    arm64: add __nocfi to functions that jump to a physical address
    arm64: use function_nocfi with __pa_symbol
    arm64: implement function_nocfi
    psci: use function_nocfi for cpu_resume
    lkdtm: use function_nocfi
    treewide: Change list_sort to use const pointers
    bpf: disable CFI in dispatcher functions
    kallsyms: strip ThinLTO hashes from static functions
    kthread: use WARN_ON_FUNCTION_MISMATCH
    workqueue: use WARN_ON_FUNCTION_MISMATCH
    module: ensure __cfi_check alignment
    mm: add generic function_nocfi macro
    cfi: add __cficanonical
    add support for Clang CFI

    Linus Torvalds
     

15 Apr, 2021

1 commit

  • …/icc into char-misc-next

    Georgi writes:

    interconnect changes for 5.13

    These are the interconnect changes for the 5.13-rc1 merge window
    with the highlights being drivers for two new platforms.

    Driver changes:
    - New driver for SM8350 platforms.
    - New driver for SDM660 platforms.

    Signed-off-by: Georgi Djakov <djakov@kernel.org>

    * tag 'icc-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc:
    interconnect: qcom: sm8350: Add missing link between nodes
    interconnect: qcom: sm8350: Use the correct ids
    interconnect: qcom: sdm660: Fix kerneldoc warning
    MAINTAINERS: icc: add interconnect tree
    interconnect: qcom: Add SM8350 interconnect provider driver
    dt-bindings: interconnect: Add Qualcomm SM8350 DT bindings
    interconnect: qcom: icc-rpm: record slave RPM id in error log
    interconnect: qcom: Add SDM660 interconnect provider driver
    dt-bindings: interconnect: Add bindings for Qualcomm SDM660 NoC

    Greg Kroah-Hartman
     

09 Apr, 2021

1 commit

  • list_sort() internally casts the comparison function passed to it
    to a different type with constant struct list_head pointers, and
    uses this pointer to call the functions, which trips indirect call
    Control-Flow Integrity (CFI) checking.

    Instead of removing the consts, this change defines the
    list_cmp_func_t type and changes the comparison function types of
    all list_sort() callers to use const pointers, thus avoiding type
    mismatches.

    Suggested-by: Nick Desaulniers
    Signed-off-by: Sami Tolvanen
    Reviewed-by: Nick Desaulniers
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Kees Cook
    Tested-by: Nick Desaulniers
    Tested-by: Nathan Chancellor
    Signed-off-by: Kees Cook
    Link: https://lore.kernel.org/r/20210408182843.1754385-10-samitolvanen@google.com

    Sami Tolvanen
     

02 Apr, 2021

5 commits

  • This adds interconnect support for SM8350 SoC.

    * icc-sm8350
    dt-bindings: interconnect: Add Qualcomm SM8350 DT bindings
    interconnect: qcom: Add SM8350 interconnect provider driver
    interconnect: qcom: sm8350: Use the correct ids
    interconnect: qcom: sm8350: Add missing link between nodes

    Link: https://lore.kernel.org/r/20210318094617.951212-1-vkoul@kernel.org
    Signed-off-by: Georgi Djakov

    Georgi Djakov
     
  • This patch series adds the SDM660 interconnect provider driver in
    order to stop some timeouts and achieve some decent performance by
    avoiding to be NoC limited.
    It's also providing some power consumption improvement, but I have
    only measured that as less heat, which is quite important when
    working on thermally constrained devices like smartphones.

    Please note that this driver's yaml binding is referring to a MMCC
    clock, so this series does depend on the SDM660 MMCC driver that I
    have sent separately.
    The multimedia clock is required only for the Multimedia NoC (mnoc).

    This patch series has been tested against the following devices:
    - Sony Xperia XA2 Ultra (SDM630 Nile Discovery)
    - Sony Xperia 10 (SDM630 Ganges Kirin)
    - Sony Xperia 10 Plus (SDM636 Ganges Mermaid)

    * icc-sdm660
    dt-bindings: interconnect: Add bindings for Qualcomm SDM660 NoC
    interconnect: qcom: Add SDM660 interconnect provider driver
    interconnect: qcom: sdm660: Fix kerneldoc warning

    Link: https://lore.kernel.org/r/20201017133718.31327-1-kholk11@gmail.com
    Signed-off-by: Georgi Djakov

    Georgi Djakov
     
  • There is a link between the GEM NoC and C NoC nodes, which is currently
    missing from the topology. Let's add it to allow consumers request paths
    that use this link.

    Reported-by: Alex Elder
    Tested-by: Alex Elder
    Link: https://lore.kernel.org/r/20210401094435.28937-1-georgi.djakov@linaro.org
    Signed-off-by: Georgi Djakov

    Georgi Djakov
     
  • For creating an array with the members for each NoC, we should be using
    a local indexes, as otherwise unnecessary large arrays would be created.
    Using an incorrect indexes will also result error for the consumers when
    they try to find a valid path between the endpoints. Let's fix this and
    use the correct ids.

    Reported-by: Alex Elder
    Acked-by: Alex Elder
    Link: https://lore.kernel.org/r/20210401094334.28871-1-georgi.djakov@linaro.org
    Signed-off-by: Georgi Djakov

    Georgi Djakov
     
  • Fix the following warning:

    sdm660.c:191:warning: Function parameter or member 'regmap'
    not described in 'qcom_icc_provider'

    Link: https://lore.kernel.org/r/20210401094714.29075-1-georgi.djakov@linaro.org
    Signed-off-by: Georgi Djakov

    Georgi Djakov
     

27 Mar, 2021

1 commit

  • Add driver for the Qualcomm interconnect buses found in SM8350 based
    platforms. The topology consists of several NoCs that are controlled by
    a remote processor that collects the aggregated bandwidth for each
    master-slave pairs.

    Generated from downstream interconnect driver written by David Dai

    Signed-off-by: Vinod Koul
    Link: https://lore.kernel.org/r/20210318094617.951212-3-vkoul@kernel.org
    Signed-off-by: Georgi Djakov

    Vinod Koul
     

19 Mar, 2021

1 commit

  • Fix the following warning:
    drivers/interconnect/bulk.c:63: warning: expecting prototype for
    icc_bulk_set(). Prototype was for icc_bulk_set_bw() instead

    Link: https://lore.kernel.org/r/20210318163415.30941-1-georgi.djakov@linaro.org
    Signed-off-by: Georgi Djakov

    Georgi Djakov
     

08 Mar, 2021

4 commits

  • Add slave RPM ID to assist with identifying incorrect RPM config.

    Signed-off-by: Benjamin Li
    Reviewed-by: Jun Nie
    Link: https://lore.kernel.org/r/20210205015205.22947-2-benl@squareup.com
    Signed-off-by: Georgi Djakov

    Benjamin Li
     
  • Introduce a driver for the Qualcomm interconnect busses found in
    the SDM630/SDM636/SDM660 SoCs.
    The topology consists of several NoCs that are controlled by a
    remote processor that collects the aggregated bandwidth for each
    master-slave pairs.

    On a note, these chips are managing the "bus QoS" in a "hybrid"
    fashion: some of the paths in the topology are managed through
    (and by, of course) the RPM uC, while some others are "AP Owned",
    meaning that the AP shall do direct writes to the appropriate
    QoS registers for the specific paths and ports, instead of sending
    an indication to the RPM and leaving the job to that one.

    Signed-off-by: AngeloGioacchino Del Regno
    Link: https://lore.kernel.org/r/20201017133718.31327-3-kholk11@gmail.com
    Signed-off-by: Georgi Djakov

    AngeloGioacchino Del Regno
     
  • When krealloc() fails and new is NULL, no error return code of
    icc_link_destroy() is assigned.
    To fix this bug, ret is assigned with -ENOMEM hen new is NULL.

    Reported-by: TOTE Robot
    Signed-off-by: Jia-Ju Bai
    Link: https://lore.kernel.org/r/20210306132857.17020-1-baijiaju1990@gmail.com
    Signed-off-by: Georgi Djakov

    Jia-Ju Bai
     
  • Some nodes are incorrectly marked as RPM-controlled (they have RPM
    master and slave ids assigned), but are actually controlled by the
    application CPU instead. The RPM complains when we send requests for
    resources that it can't control. Let's fix this by replacing the IDs,
    with the default "-1" in which case no requests are sent.

    See commit c497f9322af9 ("interconnect: qcom: msm8916: Remove rpm-ids
    from non-RPM nodes") where this was done for msm8916.

    Signed-off-by: Benjamin Li
    Reviewed-by: Jun Nie
    Link: https://lore.kernel.org/r/20210205015205.22947-3-benl@squareup.com
    Signed-off-by: Georgi Djakov

    Benjamin Li
     

01 Feb, 2021

1 commit

  • Add interconnect driver support for SDX55 platform for scaling the
    bandwidth requirements over RPMh.

    * icc-sdx55
    dt-bindings: interconnect: Add Qualcomm SDX55 DT bindings
    interconnect: qcom: Add SDX55 interconnect provider driver

    Link: https://lore.kernel.org/r/20210121053254.8355-1-manivannan.sadhasivam@linaro.org
    Signed-off-by: Georgi Djakov

    Georgi Djakov