From patchwork Tue Jun 19 16:12:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 139196 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5397417lji; Tue, 19 Jun 2018 09:13:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKoVKeEhJz3WT+WqrCbHqu7hGpHMyPtESMZBj++9oSP2Li+0ExuCmJbzSYvP8eeeFPVwLBp X-Received: by 2002:adf:fb43:: with SMTP id c3-v6mr15433549wrs.32.1529424811796; Tue, 19 Jun 2018 09:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529424811; cv=none; d=google.com; s=arc-20160816; b=dhX+tQz+5PwN/xpcSt+V7MONQ8dMeB8dzYAdBlMKDe29tk12i1pYSpRxmS8AcIOKMQ iK67wuyU404ZjS1MHgjvzuU0MMzu3/UgvNsobAFGHS0KiHPAnAXKiRqKDkHeKqq9IuFZ SclDCr98Py+NyroG4XiUajhuWNm7yNR5XFK057wxuqS0yPnLj5Q8eKEeXf9G9izUom+0 Mya9kxULfnajwInmzXaTZ7Rt29G1vDXMpTS5Bp3AHIA4eWgQfYXICYobJEWdRZsgejLg 2W8D/ZjRxCGawEhgMV5lzlRCJLo9lG+KC6zPzknEE8e+dThGnF93sLLh5WVMQjbRz5mL ByBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to:arc-authentication-results; bh=Ec58Hu8yitihYDyskG5RVGdRGkHlnD3bDX1PCknkBks=; b=epTlDWoBNw8ck2mT7o3b2amgKFUCP79r7Uz5TPBb6gf4bea0ynQ3jOd5tdotMlf5Nd 0PTMHvGlJwotEqWvttLXcVE1ZQ6VnFDOClpM0ErqXWgH8PpYSx+DqKcn4MRRCxjppcJR 8m/J1vxbZDKMbVX1oqnGnKlZhiZ0RiXCCfzPr6dtGodhIjADmDaHKcjHdElqHlLpm2ZG 5DWSgvrN6hnStY4LhFm4uES5kAu0xSWuvbHtQg4q324ysIm55SoF7K86XthuSgPnD/Xy le+kbpcS6cJxvN+0U55VEZqRSTgYXesMan7f87Af+drrN1ovlabqFI8bZxkT2L83zWp5 J/lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=jTDyWxM6; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id t197-v6si313680wmt.220.2018.06.19.09.13.31; Tue, 19 Jun 2018 09:13:31 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=jTDyWxM6; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 41EF52676EB; Tue, 19 Jun 2018 18:13:19 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 34CB32675FB; Tue, 19 Jun 2018 18:13:11 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=disabled version=3.4.0 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by alsa0.perex.cz (Postfix) with ESMTP id 10C752675EC for ; Tue, 19 Jun 2018 18:13:08 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id v16-v6so1302880wmh.5 for ; Tue, 19 Jun 2018 09:13:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WHl8y2e/CNxRLOFMGZ23TuP+wCFFLpgrtDsLMJiqlxg=; b=jTDyWxM67bZIvl1zbpKV9K/r0m1UzwrXuvlTj4lwzpgChSzcoO+KRl1P6I1dCAXngJ VoUXAwxliDPFZM6O8AVW56KBiejXwYXrtRWVhHCD/j/k6Wg0QIsqzmEEGNj3mVRCvY6W IgkWnsVbV4X6Z/RImmc7h5PiMTEVLz3lRGUe8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WHl8y2e/CNxRLOFMGZ23TuP+wCFFLpgrtDsLMJiqlxg=; b=bZjbggQ/5QKZ4yvr65Ma+66pYQoBmymInrfQINbP2jkFrPjpM5yW+5JbdbgWq7OOC+ wwQInykIRf7OO/VsSaasd0ZDzP7LlHvoFudf6oy7XfvSKtpbLCTfCMIYeOZHLw8yIIKy lemyRDo2YxHiUmiRwVUBdVyGpaS6DSXPt21YUaZfa5HGbBrnMzWob6CEKZGd7/COzL4L 2MZBYg7pYvLwE7y6KKDbgYCDTnTTDUU4vXsseVT1/1Cy1PFLjV2G0e+/mMCMXQh4xbnX M/vEAb0fUQeAQN5HCWwRqIH2QjhvvorbwIxeoH2Ee5e5GMwhjO52PR89rZWmxP5KVWkz HX9w== X-Gm-Message-State: APt69E2yqb6VDQZuWdHy9tCC/9JBSoxIZnm1REa96BMeosloJAhPQI+f bfMlqiySgbu994Zh5oxOekubFg== X-Received: by 2002:a1c:17d4:: with SMTP id 203-v6mr11849072wmx.75.1529424788535; Tue, 19 Jun 2018 09:13:08 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id r5-v6sm47248wrp.59.2018.06.19.09.13.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jun 2018 09:13:07 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Date: Tue, 19 Jun 2018 17:12:58 +0100 Message-Id: <20180619161301.4556-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180619161301.4556-1-srinivas.kandagatla@linaro.org> References: <20180619161301.4556-1-srinivas.kandagatla@linaro.org> Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, broonie@kernel.org, kramasub@codeaurora.org, Srinivas Kandagatla , sdharia@quicinc.com Subject: [alsa-devel] [PATCH v4 2/5] slimbus: core: rearrange slim_eaddr structure X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org Rearrange struct slim_eaddr so that the structure is packed correctly to be able to send in SLIMBus messages. Signed-off-by: Srinivas Kandagatla --- include/linux/slimbus.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.16.2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/include/linux/slimbus.h b/include/linux/slimbus.h index efa36a852dc3..63801bcc5e60 100644 --- a/include/linux/slimbus.h +++ b/include/linux/slimbus.h @@ -14,16 +14,16 @@ extern struct bus_type slimbus_bus; /** * struct slim_eaddr - Enumeration address for a SLIMbus device - * @manf_id: Manufacturer Id for the device - * @prod_code: Product code - * @dev_index: Device index * @instance: Instance value + * @dev_index: Device index + * @prod_code: Product code + * @manf_id: Manufacturer Id for the device */ struct slim_eaddr { - u16 manf_id; - u16 prod_code; - u8 dev_index; u8 instance; + u8 dev_index; + u16 prod_code; + u16 manf_id; } __packed; /** From patchwork Tue Jun 19 16:12:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 139197 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5397570lji; Tue, 19 Jun 2018 09:13:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIp1KetoirCF6oGoeSWNDNafywq3uw0kB49y2EH3Q6RMyZs24tbGA/JTxieOWDgnzgaZHLr X-Received: by 2002:adf:a148:: with SMTP id r8-v6mr14220020wrr.104.1529424821231; Tue, 19 Jun 2018 09:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529424821; cv=none; d=google.com; s=arc-20160816; b=mfMp59JJX5ZzMdlBOdpmL/jPFXSiZKaXwcYDRhtFyW7s35nVOmiQ4tX5NtH5jWWEm0 TOKtdECWoNVg6trCin5vUxaPNuFsySHfn77WtoTaxxPKTANZgptrDYLJbs/ukYUON25a 7QflZoL24neFYhTWbgAP42ot4UoZQzM2ta9QnG4OjeNcCwaVUE6E3fwSmz54PcpotmgK PCoV5+C77eeTI4Omk2OWneQxEmko8gh1gtvnxGhX/Nf6xz9d+jSPYzopUV7PmUaj/U02 HtmcCfWKUYHRXUD6NVa/KJugioRhXR3AHjky3QhLRjKde1Heh7kXw413Zv959GOgJeY2 n7ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to:arc-authentication-results; bh=O7lUFYPNncEO5KKe3V9qruLzmODvALzyidzIV1iKnEM=; b=SRwIW14D2OP+HsBLdnlWI5yVxAI1OpXCwR2xZ7ujxjDMIKfvelRtI/Fe9Q+G1Sn7fW KK5qCrVsC9RddKbmxo6ojwuRuVuYFzrpWuFg87e13AL24u2ZsRwZn/GAlgGdOfaHSPkj aqomFfSVyfB4AU+v3GMG0jlVI/ilKnyFtjRsH5tKkSdiXTiZRL40Hk2GmXHrfl5Q7r6q OTmm5c1xBtwFU+Jz8MxYQADky4pXuPXRHy6hvoGpPKUOGnsydEwmcIRyAXWR3I91jGMr yLqC4cX2m8XHxysZYc/BGt9KU2MN3LHhwKGuzmpOl8h6oeCj4879htv3Bt+VeTDO7yLp KBRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=d3crgxRb; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id j8-v6si48897wrh.398.2018.06.19.09.13.41; Tue, 19 Jun 2018 09:13:41 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=d3crgxRb; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id AC77E2676FA; Tue, 19 Jun 2018 18:13:20 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 95BE02675EC; Tue, 19 Jun 2018 18:13:11 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=disabled version=3.4.0 Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by alsa0.perex.cz (Postfix) with ESMTP id F1727266D4C for ; Tue, 19 Jun 2018 18:13:09 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id e16-v6so1345410wmd.0 for ; Tue, 19 Jun 2018 09:13:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/hk81tJs0U8+gliTNmT2DEM7iWq6ptBWABuzVXdd4kw=; b=d3crgxRbgUJ3t1ILCZfGHJTpUuUiNfu027+yhgImA6FqQAb51J/KYErKJAULAxnEJX P8l8lvQNBFHNo4KWiIige6J64iUD3r0VFYO7wvacO5E/bDs1Qn0XboxbJB3oRlhFPJTz MgltP8Ay/yY3pmVnCgT1fs0javbG2IFuqNDJA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/hk81tJs0U8+gliTNmT2DEM7iWq6ptBWABuzVXdd4kw=; b=il9TEfeD016Vb9rHpZ7BYsRs7FDDGRu8CC8VBOvyi+EgevO4QFsmcAGGmHispVQ7FO RuIzYXJ0r8CLmEmAmlF4D47GCP/syGbZN66FD34yOOLaRVj7hsjfsdGt93UbK9kbRdum gLyoguEppJy8gVm69D+1QlHbI1qwYaypk7NLJjCylmRQOsG4Hq7zyYKdJ60shqJDBDk1 m5JufaLU1/eaX4BLhnUkEZyPzNKjxkI6btKChtd6YylD5SF7M27g48KJVJze/n3F6xVn J66aIKdjG0GNFQHTFKuT3at/alOOvr67TjfC2DJoMxvoOnuhM8yjnjaVfzPHsN5ZJT9G nX4A== X-Gm-Message-State: APt69E3XzAr+Xdu1LIh6oSaoJes0XVeFX5gpf+iPQ3BoouvUSyBtCtUw 9EdBnlwOowcWkfUY8O01lumN/w== X-Received: by 2002:a1c:a010:: with SMTP id j16-v6mr11803065wme.61.1529424789545; Tue, 19 Jun 2018 09:13:09 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id r5-v6sm47248wrp.59.2018.06.19.09.13.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jun 2018 09:13:09 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Date: Tue, 19 Jun 2018 17:12:59 +0100 Message-Id: <20180619161301.4556-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180619161301.4556-1-srinivas.kandagatla@linaro.org> References: <20180619161301.4556-1-srinivas.kandagatla@linaro.org> Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, broonie@kernel.org, kramasub@codeaurora.org, Srinivas Kandagatla , sdharia@quicinc.com Subject: [alsa-devel] [PATCH v4 3/5] slimbus: messaging: add slim_alloc/free_txn_tid() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org This patch adds slim_alloc_txn_tid() and slim_free_txn_tid() api to allow controllers like ngd to allocate tids for user specific commands. This also cleans up the existing code to use single place for tid allocations and free. This patch also make the tid allocation cyclic one, its very useful to track the transactions back during debug. Signed-off-by: Srinivas Kandagatla --- drivers/slimbus/messaging.c | 74 +++++++++++++++++++++++++++++++-------------- drivers/slimbus/slimbus.h | 2 ++ 2 files changed, 54 insertions(+), 22 deletions(-) -- 2.16.2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/drivers/slimbus/messaging.c b/drivers/slimbus/messaging.c index e3605ed1c459..d5879142dbef 100644 --- a/drivers/slimbus/messaging.c +++ b/drivers/slimbus/messaging.c @@ -29,22 +29,19 @@ void slim_msg_response(struct slim_controller *ctrl, u8 *reply, u8 tid, u8 len) spin_lock_irqsave(&ctrl->txn_lock, flags); txn = idr_find(&ctrl->tid_idr, tid); - if (txn == NULL) { - spin_unlock_irqrestore(&ctrl->txn_lock, flags); + spin_unlock_irqrestore(&ctrl->txn_lock, flags); + + if (txn == NULL) return; - } msg = txn->msg; if (msg == NULL || msg->rbuf == NULL) { dev_err(ctrl->dev, "Got response to invalid TID:%d, len:%d\n", tid, len); - spin_unlock_irqrestore(&ctrl->txn_lock, flags); return; } - idr_remove(&ctrl->tid_idr, tid); - spin_unlock_irqrestore(&ctrl->txn_lock, flags); - + slim_free_txn_tid(ctrl, txn); memcpy(msg->rbuf, reply, len); if (txn->comp) complete(txn->comp); @@ -55,6 +52,48 @@ void slim_msg_response(struct slim_controller *ctrl, u8 *reply, u8 tid, u8 len) } EXPORT_SYMBOL_GPL(slim_msg_response); +/** + * slim_alloc_txn_tid() - Allocate a tid to txn + * + * @ctrl: Controller handle + * @txn: transaction to be allocated with tid. + * + * Return: zero on success with valid txn->tid and error code on failures. + */ +int slim_alloc_txn_tid(struct slim_controller *ctrl, struct slim_msg_txn *txn) +{ + unsigned long flags; + int ret = 0; + + spin_lock_irqsave(&ctrl->txn_lock, flags); + ret = idr_alloc_cyclic(&ctrl->tid_idr, txn, 0, + SLIM_MAX_TIDS, GFP_ATOMIC); + if (ret < 0) { + spin_unlock_irqrestore(&ctrl->txn_lock, flags); + return ret; + } + txn->tid = ret; + spin_unlock_irqrestore(&ctrl->txn_lock, flags); + return 0; +} +EXPORT_SYMBOL_GPL(slim_alloc_txn_tid); + +/** + * slim_free_txn_tid() - Freee tid of txn + * + * @ctrl: Controller handle + * @txn: transaction whose tid should be freed + */ +void slim_free_txn_tid(struct slim_controller *ctrl, struct slim_msg_txn *txn) +{ + unsigned long flags; + + spin_lock_irqsave(&ctrl->txn_lock, flags); + idr_remove(&ctrl->tid_idr, txn->tid); + spin_unlock_irqrestore(&ctrl->txn_lock, flags); +} +EXPORT_SYMBOL_GPL(slim_free_txn_tid); + /** * slim_do_transfer() - Process a SLIMbus-messaging transaction * @@ -72,8 +111,7 @@ int slim_do_transfer(struct slim_controller *ctrl, struct slim_msg_txn *txn) { DECLARE_COMPLETION_ONSTACK(done); bool need_tid = false, clk_pause_msg = false; - unsigned long flags; - int ret, tid, timeout; + int ret, timeout; /* * do not vote for runtime-PM if the transactions are part of clock @@ -97,34 +135,26 @@ int slim_do_transfer(struct slim_controller *ctrl, struct slim_msg_txn *txn) need_tid = slim_tid_txn(txn->mt, txn->mc); if (need_tid) { - spin_lock_irqsave(&ctrl->txn_lock, flags); - tid = idr_alloc(&ctrl->tid_idr, txn, 0, - SLIM_MAX_TIDS, GFP_ATOMIC); - txn->tid = tid; + ret = slim_alloc_txn_tid(ctrl, txn); + if (ret) + return ret; if (!txn->msg->comp) txn->comp = &done; else txn->comp = txn->comp; - - spin_unlock_irqrestore(&ctrl->txn_lock, flags); - - if (tid < 0) - return tid; } ret = ctrl->xfer_msg(ctrl, txn); - if (ret && need_tid && !txn->msg->comp) { + if (!ret && need_tid && !txn->msg->comp) { unsigned long ms = txn->rl + HZ; timeout = wait_for_completion_timeout(txn->comp, msecs_to_jiffies(ms)); if (!timeout) { ret = -ETIMEDOUT; - spin_lock_irqsave(&ctrl->txn_lock, flags); - idr_remove(&ctrl->tid_idr, tid); - spin_unlock_irqrestore(&ctrl->txn_lock, flags); + slim_free_txn_tid(ctrl, txn); } } diff --git a/drivers/slimbus/slimbus.h b/drivers/slimbus/slimbus.h index 79f8e05d92dd..2ba6545fa716 100644 --- a/drivers/slimbus/slimbus.h +++ b/drivers/slimbus/slimbus.h @@ -240,6 +240,8 @@ int slim_unregister_controller(struct slim_controller *ctrl); void slim_msg_response(struct slim_controller *ctrl, u8 *reply, u8 tid, u8 l); int slim_do_transfer(struct slim_controller *ctrl, struct slim_msg_txn *txn); int slim_ctrl_clk_pause(struct slim_controller *ctrl, bool wakeup, u8 restart); +int slim_alloc_txn_tid(struct slim_controller *ctrl, struct slim_msg_txn *txn); +void slim_free_txn_tid(struct slim_controller *ctrl, struct slim_msg_txn *txn); static inline bool slim_tid_txn(u8 mt, u8 mc) { From patchwork Tue Jun 19 16:13:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 139199 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5397771lji; Tue, 19 Jun 2018 09:13:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIVczhWEulwtnis8SSA9S6BVUxK5yTygrmNAWgx/ko/+9CcSwfZatRds13Rim+jGR2FigMO X-Received: by 2002:a1c:58d1:: with SMTP id m200-v6mr13297681wmb.160.1529424831123; Tue, 19 Jun 2018 09:13:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529424831; cv=none; d=google.com; s=arc-20160816; b=s6LaPqPh+r90A97L15VNsOoTETqVtl4dQELc6RH1gqPwSd2Bf0mV16UbcYddcA3U1v 4Nq8Pbd/rVFYIlv0ugH/XRQQwAI7jAowdgUKv5iCGw+doP6l5UGJ7dqNKBqPnev6FKyb 1Ll3pJT+gO++/F8Vlir+m00+H8mHKt2blhu10vSjkg4zVjhiyCs5dsnHe/RimtU4yVGD keua9Xp7IX7aMAa7FUs1h3b2rURUbxps4Xo4GpDjbJmeOOEAtGyHW9kn/fFml2T5KWZy 4ZoAyFR9Hroi+bxCcXrrbOw5k7DF7BsXqMP8ZAOk0diX2FPocdFQ9RcUiOnYoJnOLANB uVhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to:arc-authentication-results; bh=atNGwfVo+TYjFXc/OSr9HnxEKL+qMcf2yyEMsQPfSGE=; b=IdGYx8xH4TaQShhdH1e3gfFS0Y38IAwD4FZpzbfJd/VS1K22qoKPIEB1/93gISmnIa B6/H6VnEPkCsvw8gXSJfKAW3incnW0xHJyti1VHvzukSnVq+5a5LcJoPR1P4xm/PTUV1 CZQoO5wVMRVqQNQA5Hy2ZcoC+FqxzdpZ2jUWeNL1fBJcK8iFkn1m8PWxhBhF8pVevJXi tF8ITacz3SuaT7NUJ+uRmUCsofRzSMWfIFVUrw6ZfKMzJ+lnKNtcfyGS6qVZJWkurCUB tVkx2p9USVU9gvVocxnR3r+3hR+YOYrsAnaDbsjB8N+j3ZiviJyE/SSiPXTIQBch9Ef/ yBYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ghs8WsKz; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id p9-v6si64184wrg.306.2018.06.19.09.13.50; Tue, 19 Jun 2018 09:13:51 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ghs8WsKz; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6632D2676FE; Tue, 19 Jun 2018 18:13:24 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 086AF2675EC; Tue, 19 Jun 2018 18:13:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=disabled version=3.4.0 Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by alsa0.perex.cz (Postfix) with ESMTP id 2D4FC266D4C for ; Tue, 19 Jun 2018 18:13:10 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id l10-v6so258410wrn.2 for ; Tue, 19 Jun 2018 09:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PJdsAyA3boANJ8Oig23dpaUGq6oUImWdAfDoOGWfLfE=; b=ghs8WsKz1qg3X17IJAAOgGVu3bkBS3d/CF2oSzS04FPZR8GX3W2LJ3e5Qp8anIP+hm OQo2dM7eow0wrmgzZnpBoZy7kXuXG0bgdxO5coQw24It9KQhmKuRgq59JpYHT7AwRXex RXFTUMHCIPn0DtDtTQnCpnzBzavCiopp0lujk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PJdsAyA3boANJ8Oig23dpaUGq6oUImWdAfDoOGWfLfE=; b=HnH1jOaRrZs0MotCEwNS4AeLkZnRx4AF6vgUJN1sQQ5xH0CrRbthcoyvN4iz2hr2/H yty44t4C6JMOeWonP8qYnrzxZnL516hYQDe1s1fiLB/OhAYhmsX+3A8E19JwrewmVC99 Vj7+eEdPT0s0bucjX9UKvN358j3A++no2lDohBa/P9mbeHv5AQOg1GFjYb6y76BGwGKR 52l4WcHWEXxLAY9ZMURBpy1CBmFBVqX2K4tjt1uNLgUWa1TJcCl0ghrZ5K2g+ttO1919 jid/iy+hHuqtgEa1qutVjvqytMLde9c4a+FvKEM/MnepzmJexWrRf0zs4V9BRKkSz9W1 6soQ== X-Gm-Message-State: APt69E2GpuqpYuhJJgOxqOpvoGef8Qsq/CaK2mmw7mxH2l7d59+0uwQb iY5ynHCOzCS3uy0gfAsmZfEO0g== X-Received: by 2002:adf:afe3:: with SMTP id y35-v6mr16031859wrd.176.1529424790628; Tue, 19 Jun 2018 09:13:10 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id r5-v6sm47248wrp.59.2018.06.19.09.13.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jun 2018 09:13:10 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Date: Tue, 19 Jun 2018 17:13:00 +0100 Message-Id: <20180619161301.4556-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180619161301.4556-1-srinivas.kandagatla@linaro.org> References: <20180619161301.4556-1-srinivas.kandagatla@linaro.org> Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, broonie@kernel.org, kramasub@codeaurora.org, Srinivas Kandagatla , sdharia@quicinc.com Subject: [alsa-devel] [PATCH v4 4/5] slimbus: ngd: dt-bindings: Add slim ngd dt bindings X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org This patch adds bindings for Qualcomm SLIMBus NGD controller. SLIMBus NGD controller is a light-weight driver responsible for communicating with SLIMBus slaves directly over the bus using messaging interface and communicating with master component residing on ADSP for bandwidth and data-channel management Signed-off-by: Srinivas Kandagatla Reviewed-by: Rob Herring Tested-by: Craig Tatlor Reviewed-by: Vinod Koul --- .../bindings/slimbus/slim-ngd-qcom-ctrl.txt | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 Documentation/devicetree/bindings/slimbus/slim-ngd-qcom-ctrl.txt -- 2.16.2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/Documentation/devicetree/bindings/slimbus/slim-ngd-qcom-ctrl.txt b/Documentation/devicetree/bindings/slimbus/slim-ngd-qcom-ctrl.txt new file mode 100644 index 000000000000..e94a2ad3a710 --- /dev/null +++ b/Documentation/devicetree/bindings/slimbus/slim-ngd-qcom-ctrl.txt @@ -0,0 +1,84 @@ +Qualcomm SLIMBus Non Generic Device (NGD) Controller binding + +SLIMBus NGD controller is a light-weight driver responsible for communicating +with SLIMBus slaves directly over the bus using messaging interface and +communicating with master component residing on ADSP for bandwidth and +data-channel management + +Please refer to slimbus/bus.txt for details of the common SLIMBus bindings. + +- compatible: + Usage: required + Value type: + Definition: must be "qcom,slim-ngd-v.." + must be one of the following. + "qcom,slim-ngd-v1.5.0" for MSM8996 + "qcom,slim-ngd-v2.1.0" for SDM845 + +- reg: + Usage: required + Value type: + Definition: must specify the base address and size of the controller + register space. +- dmas + Usage: required + Value type: + Definition: List of rx and tx dma channels + +- dma-names + Usage: required + Value type: + Definition: must be "rx" and "tx". + +- interrupts: + Usage: required + Value type: + Definition: must list controller IRQ. + +#address-cells + Usage: required + Value type: + Definition: Should be 1, reflecting the instance id of ngd. + +#size-cells + Usage: required + Value type: + Definition: Should be 0 + += NGD Devices +Each subnode represents an instance of NGD, must contain the following +properties: + +- reg: + Usage: required + Value type: + Definition: Should be instance id of ngd. + +#address-cells + Usage: required + Refer to slimbus/bus.txt for details of the common SLIMBus bindings. + +#size-cells + Usage: required + Refer to slimbus/bus.txt for details of the common SLIMBus bindings. + += EXAMPLE + +slim@91c0000 { + compatible = "qcom,slim-ngd-v1.5.0"; + reg = <0x91c0000 0x2c000>; + interrupts = <0 163 0>; + dmas = <&slimbam 3>, <&slimbam 4>; + dma-names = "rx", "tx"; + #address-cells = <1>; + #size-cells = <0>; + ngd@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <1>; + codec@1 { + compatible = "slim217,1a0"; + reg = <1 0>; + }; + }; +};