From patchwork Wed Mar 4 20:09:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 11420675 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AA8EB921 for ; Wed, 4 Mar 2020 20:10:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 833A820870 for ; Wed, 4 Mar 2020 20:10:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="Zw21P0Jq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729302AbgCDUKC (ORCPT ); Wed, 4 Mar 2020 15:10:02 -0500 Received: from mail26.static.mailgun.info ([104.130.122.26]:38110 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728512AbgCDUKA (ORCPT ); Wed, 4 Mar 2020 15:10:00 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1583352600; h=Content-Transfer-Encoding: MIME-Version: Message-Id: Date: Subject: Cc: To: From: Sender; bh=sZmIFlGZBeat1Ll+2F6AmavEXhbPfB5wINYjsBaLDaI=; b=Zw21P0JqvmGv9YisV9hpEbLp7BUk66lngh5v3IFdr8yF7Jg+Wqj6eKT/gWwxlEEF2CVCAKNU tncGmB4pZDQnq63AzSrHnmIGX1hKFFmeU+uNx1jV8InA6gzbC2t3KDDICvbnwZNu3ZR/sVc9 W95WhwO5jrlQUsbxZYza3hHOvpM= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI4ZWZiZiIsICJsaW51eC1yZW1vdGVwcm9jQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e600afa.7f4b774d47d8-smtp-out-n05; Wed, 04 Mar 2020 20:09:30 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 8C564C447A3; Wed, 4 Mar 2020 20:09:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis) by smtp.codeaurora.org (Postfix) with ESMTPSA id 48978C43383; Wed, 4 Mar 2020 20:09:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 48978C43383 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=sibis@codeaurora.org From: Sibi Sankar To: bjorn.andersson@linaro.org, srinivas.kandagatla@linaro.org Cc: agross@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, tsoni@codeaurora.org, vnkgutta@codeaurora.org, Sibi Sankar Subject: [PATCH v6 0/3] Introduce Protection Domain Restart (PDR) Helpers Date: Thu, 5 Mar 2020 01:39:08 +0530 Message-Id: <20200304200911.15415-1-sibis@codeaurora.org> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org Qualcomm SoCs (starting with MSM8998) allow for multiple protection domains (PDs) to run on the same Q6 sub-system. This allows for services like AVS AUDIO to have their own separate address space and crash/recover without disrupting the other PDs running on the same Q6 ADSP. This patch series introduces pdr helper library and adds PD tracking functionality for "avs/audio" allowing apr services to register themselves asynchronously once the dependent PDs are up. V6: * Fix minor compilation error introduced in V5 * Pick up Rob's R-b V5: * Pick up Bjorn's R-b * Service all pending lookup, notifier_register and notifier_remove requests. * Propagate error from pdr_register_listener * Remove notifier_init_complete flag workaround with the introduction of in-kernel ns. * Remove depends-on in Kconfig and add module license. V4: * Drop handling db_rev_count error handling since it remains unused in upstream/downstream pd-mapper * Fixup dt bindings and examples. [Rob] * Dropping r-b from Bjorn/Srini for the dt bindings. * Privatize pdr_service/pdr_handle. [Srini/Bjorn] * Introduce notifier_init_complete to deal with cases where qmi_handle_net_reset is not enough to reset the port. This is to deal with cases where qrtr-ns starts after the adsp. * Introduce per addr per pds to deal with multiple service_paths per pdr_handle. * Uniformly rename servreg -> notifier, servloc -> locator. [Narendra] * Drop pdr_servreg_link_create tracking the service_path tracks all pds associated with it. [Bjorn] * Remove safe traversal for all cases where list is left unmodified. [Bjorn] * Address review comments in the apr driver and add comments. [Bjorn] * Other misc fixes. [Narendra/Bjorn] V3: * patches 2 and 3 remain unchanged. * reset servloc_addr/servreg_addr. * fixup the helpers to handle servloc_work/servreg_work asynchronously. * fixup useage of list_lock across traversals, insertions and deletions. * fixup the helpers to use a single lookup list. * skip waiting for response on ind_ack send. * introduce pdr_servreg_link_create to re-use existing qmi connection to servreg instances. This helps tracking PDs running on the same remote processor. * have a per node curr_state in pdr_list_node to preserve all state updates during indack_cb. * introduce additional servreg_service_state values to help the client distinguish between a fatal and non-fatal pdr_lookup errors. * re-order pdr_handle_release sequence. * fixup "!ind_msg->service_path returns true always" warning. * fixup comments. V2: * fixup pd_status callback to return void. * return 0 from pdr_get_domain_list on success. * introduce status_lock to linearize the pd_status reported back to the clients. * use the correct service name length across various string operations performed. * service locator will now schedule the pending lookups registered when it comes up. * other minor cleanups that Bjorn suggested. * use pr_warn to indicate that the wait for service locator timed out. * add Bjorn/Srini's "Reviewed-by" for the dt-bindings. Depends on in-kernel ns fixes: https://patchwork.kernel.org/cover/11414841/ Sibi Sankar (3): soc: qcom: Introduce Protection Domain Restart helpers dt-bindings: soc: qcom: apr: Add protection domain bindings soc: qcom: apr: Add avs/audio tracking functionality .../devicetree/bindings/soc/qcom/qcom,apr.txt | 50 ++ drivers/soc/qcom/Kconfig | 5 + drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/apr.c | 123 ++- drivers/soc/qcom/pdr_interface.c | 754 ++++++++++++++++++ drivers/soc/qcom/pdr_internal.h | 379 +++++++++ include/linux/soc/qcom/apr.h | 1 + include/linux/soc/qcom/pdr.h | 30 + include/linux/soc/qcom/qmi.h | 1 + 9 files changed, 1335 insertions(+), 9 deletions(-) create mode 100644 drivers/soc/qcom/pdr_interface.c create mode 100644 drivers/soc/qcom/pdr_internal.h create mode 100644 include/linux/soc/qcom/pdr.h