From patchwork Thu May 17 08:58:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 136123 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2011633lji; Thu, 17 May 2018 02:01:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqauPWKm64w6dheheK0UPiQvpHZ8r91R7b/Gt2DLFMtivJhsYPYdAd9ePSFVY3tYxkbG2sp X-Received: by 2002:a62:404f:: with SMTP id n76-v6mr4391983pfa.185.1526547669322; Thu, 17 May 2018 02:01:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526547669; cv=none; d=google.com; s=arc-20160816; b=fykFxGga9LfR7XnDY4/rEu1wEjYFg6ad4k37X9MLYpgpMUDRwBiSi3Ws47EiSIdcBS c6ESty9571A8aPgyJx3aDlf7AypO0ziB6wQ0kc8b+nKGhbgoPr0DKv9DA1n9leF/E3/p vIBw/VONZ3+utzChWKaPMvRkxCDJIkGbOEawH5/mtP/Iqg839ysGqsonmccv9KdKqOea cG5VkbvgkNN4LxaZ9Lc/eaZgO/m4cTILuH8z85nFNxCQ+tYYxPYeIlsF0BclfEuBdP5B 9cgooNaqgbktOlGmZFPuwWb64q0j3/UP7V7PyneWnVhIk4+TQaU1CN8ZCMmKAore3WzO iWWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=0NJFO6su7aIrVN5C6zfM1WIOBkuoLZrsN0oLxSCKfNI=; b=uT1Sww6FQeVSLQrF4mZAP709DA2x9V4BgQKa9OtVpCpeRhuYYYTDdKGFJa9sLPLQc0 +YhIc6Yb3SMmmkvLVyhZeCvC6K6Sr3BDv5sloL646vVt+gb5QN4AZOEHwhAKig7CWPZU rlAxfrRf+2PV1Vgi6/MyVjNaWtOZLDWa74pYE0zdsv0/jK4ZM6VdwgH0yMVMECi4LgHv NcVHk12wcf1SdD2BIX3+4of5kGAZdsQkclOcfX56qfH7UdwKEquhhzpW7eqco2u0wNCb /6AMWnD7OD7i/qqZbnWuaUbscrViU3BSeGh46buKu331b6y+0Rz9GVivnxdbnTANag5Q z5Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LNAT8DdD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1-v6si4715445pfe.79.2018.05.17.02.01.09; Thu, 17 May 2018 02:01:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LNAT8DdD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752096AbeEQJBD (ORCPT + 29 others); Thu, 17 May 2018 05:01:03 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:37125 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751233AbeEQJBA (ORCPT ); Thu, 17 May 2018 05:01:00 -0400 Received: by mail-wr0-f194.google.com with SMTP id h5-v6so4819568wrm.4 for ; Thu, 17 May 2018 02:00:59 -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=0NJFO6su7aIrVN5C6zfM1WIOBkuoLZrsN0oLxSCKfNI=; b=LNAT8DdDiXUAFhEVgrAqI2+2Mj5PUAwPyUYCX80wROlrrz+BuH61cMW6dbB9nUu78/ A7+LvsSZKHLccAbji49UWJS5+JmMg5C4iJgILq2H+aLAsRMAimc5dsuzMcDfKylC1gi0 PlNDq+RHKGXtQAnkhgr16OvzX2e7BRCV2/MP0= 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=0NJFO6su7aIrVN5C6zfM1WIOBkuoLZrsN0oLxSCKfNI=; b=P0PdBN9XWY/xxihBaL1rPliddc8J6+eYIByCCHPe7Puerkh0BSZynmrwhA6V37G3ys 0fCXuiQr1LNB37eieTu7aZV/a8nd2zIu+JedZUIoJ6ZNnzsOdNBYFF4ZMypzTvwueQQC KqQ3fd3SRbrKGqCDoVYzP6hZ3tlcQxkkPBBNrELOMw3l6G/QxUEkw/mIi4RWKp3K0LiE rAdtk969qC+FAbAReWTiGqQ+q6r1SXnXGaBAv7P9aLGDZawgMSzH5UGKMNZpIOipSmLB VEBcV8SrcuVJ3MB+qvNqr/Rq4T5H7KYYt9DErdzhQBlJqfSkBaqLJxacPII5asnRPLvB RxJg== X-Gm-Message-State: ALKqPwd8HyuFehm7O/IXj184NIdhTHsrPaYoxQwvjGqjAQCTr5giJhZc /PPmFA8YHNThPsGfumBwlxdp+A== X-Received: by 2002:adf:b083:: with SMTP id i3-v6mr3304123wra.52.1526547659265; Thu, 17 May 2018 02:00:59 -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 y84-v6sm4123098wmg.44.2018.05.17.02.00.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 May 2018 02:00:58 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, srinivas.kandagatla@linaro.org Subject: [PATCH v2 3/8] slimbus: core: add need_tid flag to slim_msg_txn Date: Thu, 17 May 2018 09:58:45 +0100 Message-Id: <20180517085850.14276-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180517085850.14276-1-srinivas.kandagatla@linaro.org> References: <20180517085850.14276-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add need_tid flag to txn, this flag can be set before start of transcation. Having this flag would avoid calling slim_tid_txn() multiple times on the same txn. Also it is handy for controller drivers too. Signed-off-by: Srinivas Kandagatla --- drivers/slimbus/slimbus.h | 2 ++ 1 file changed, 2 insertions(+) -- 2.16.2 diff --git a/drivers/slimbus/slimbus.h b/drivers/slimbus/slimbus.h index 79f8e05d92dd..3ec5a85fba8e 100644 --- a/drivers/slimbus/slimbus.h +++ b/drivers/slimbus/slimbus.h @@ -102,6 +102,7 @@ struct slim_framer { * @msg: Elemental access message to be read/written * @comp: completion if read/write is synchronous, used internally * for tid based transactions. + * @need_tid: flag indicating if a tid is required for this txn */ struct slim_msg_txn { u8 rl; @@ -113,6 +114,7 @@ struct slim_msg_txn { u8 la; struct slim_val_inf *msg; struct completion *comp; + bool need_tid; }; /* Frequently used message transaction structures */ From patchwork Thu May 17 08:58:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 136124 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2011725lji; Thu, 17 May 2018 02:01:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpaStPZfbc1S3t1uhnDjS/1zvsrB5CMIP/2WMNfA7hUjGTU/piJl6QZwhhpuRF+p6nQn4Ob X-Received: by 2002:a17:902:b60c:: with SMTP id b12-v6mr4550400pls.44.1526547672600; Thu, 17 May 2018 02:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526547672; cv=none; d=google.com; s=arc-20160816; b=LjqfgEApMOwkfHrlcSTTHUnsQiSheS6PKHN7J1LXgPC1Yc5270ivdcJPU5hBEvZ0Ze q4DN95hweSjE5VIWF+PMNli4D+4vK3Dj5pmgXFrU5FZUuhWYbQBO4bi76foe4twM/B9D bFCzTY4ugWmWkOyetLX4A4uwK1+mIPCDZmnII3jZTRhIa2eq6Ic0bDEp7UHH/NqCGqFh 15+bWsBjSchRgyA6bLecos7wIJTOCWJoK1RWGUItXqWUnhEcBuLePdd9qDErmwg8EjmB 2X0ielASnofD00tPH6fHIMmdZsAn7Eg1PQVZxbyS2DQGW4xUFkTg7m6rDH2JMKNezRBQ nC3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=GCf7pULtQuJ722oAoYhjTrAvrZ1qmDthf/krvZpChUE=; b=WROWoQI/ps6ApqyLUMaleAKRlGHnY/80JTY/SJSMtscI2JDD1ZGOCV1KlBgn/C4jrU ZcnoZDV8Kc64OkL+1UTP3hBJh8OeoUE9vTpYlY4AuDxfjD9YapxxQtSU1jJrmjpz59VE jAFcgxvILtRijgp4DRMqwDHuaFLuOvPYQpX9WBKKu4FXa20GAv4d4XWGdFch0t+ou9m/ 9dn4x/siC2OgRAukzwatybJ9Q3+97jeHXFQJchARb97yMD70aWP2kPy8ObTCUlirqCsm bsCRKN5wKByB81lWIx1QSQXOJnwSjvuZQmNJOie8r0M0VtqOBgCTzlXZ1CFlQWNXu/uJ wx3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gq9sZgC6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12-v6si4696514plo.551.2018.05.17.02.01.12; Thu, 17 May 2018 02:01:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gq9sZgC6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752136AbeEQJBI (ORCPT + 29 others); Thu, 17 May 2018 05:01:08 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:40413 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752030AbeEQJBD (ORCPT ); Thu, 17 May 2018 05:01:03 -0400 Received: by mail-wr0-f196.google.com with SMTP id v60-v6so4814653wrc.7 for ; Thu, 17 May 2018 02:01:02 -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=GCf7pULtQuJ722oAoYhjTrAvrZ1qmDthf/krvZpChUE=; b=Gq9sZgC6sASV9b+cQwxGpekMXq+1pUyVJw50riDiN5FRvtssdfjjssJhEsTsEBUGmn SgkNsqgfLgpIMS8rwMd9rwfdi8ldgwU/xeQNyn/aH2q1VrAEs2DEC7GUeLjMMnGateTC PEEbTWkDlVShem7GH5XOuvRtg3d70iflkbvGc= 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=GCf7pULtQuJ722oAoYhjTrAvrZ1qmDthf/krvZpChUE=; b=FuqHxmNn1y2mzJcHSXjZ0BNcR/T0V2zUgIEnHNjJ7iFxWkRckHf5ztvCWp7K4ZQvmr m6UVbgr2he7aU4DXBQVfzRxI4sIhCEGYHWGH4/23i79pp7q5d3YMZx88TpI2lsRgW8zU W8nSTrV1xDIRy+MaTkb7LEm+fK9SvvfvqQ/eyJbzLpVzNaePqeg+j2iEiN/qOftSsySb W/5k0YbEBjAQa7/jaNCKt7aLtBy6Qn6IUznDl9NjG6VOFjeFhFvByi5lRCHMPmZ3/cOv 2UcE9Sx/yJDSQHs3ic1Rqcbbw8qBFBdXBWWrv/KbJBARUKjBkLl4cI4yfMytLVJk+7gO EaLQ== X-Gm-Message-State: ALKqPwdLZq8ZZQ7u+57fwg9DYs4Oos+78nDgq7X9J3QVezhfF83Tvscz pPZyqKf4Pn6Jpf42mcLbjedtbZN4l7c= X-Received: by 2002:adf:b685:: with SMTP id j5-v6mr3685359wre.10.1526547662081; Thu, 17 May 2018 02:01:02 -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 y84-v6sm4123098wmg.44.2018.05.17.02.01.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 May 2018 02:01:01 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, srinivas.kandagatla@linaro.org Subject: [PATCH v2 6/8] slimbus: messaging: add slim_prepare_txn() helper function Date: Thu, 17 May 2018 09:58:48 +0100 Message-Id: <20180517085850.14276-7-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180517085850.14276-1-srinivas.kandagatla@linaro.org> References: <20180517085850.14276-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds slim_prepare_txn() to allow controllers to prepare controller specific transaction. If not each controllers will duplicate the same code from core. Signed-off-by: Srinivas Kandagatla --- drivers/slimbus/messaging.c | 89 ++++++++++++++++++++++++++++++--------------- drivers/slimbus/qcom-ctrl.c | 7 +++- drivers/slimbus/slimbus.h | 2 + 3 files changed, 68 insertions(+), 30 deletions(-) -- 2.16.2 diff --git a/drivers/slimbus/messaging.c b/drivers/slimbus/messaging.c index 1c57b631031a..fd0788019357 100644 --- a/drivers/slimbus/messaging.c +++ b/drivers/slimbus/messaging.c @@ -55,6 +55,50 @@ void slim_msg_response(struct slim_controller *ctrl, u8 *reply, u8 tid, u8 len) } EXPORT_SYMBOL_GPL(slim_msg_response); +/** + * slim_prepare_txn() - Prepare a transaction + * + * @ctrl: Controller handle + * @txn: transaction to be prepared + * @done: completion for transaction + * @need_tid: flag to indicate if tid is required for this txn + * + * Called by controller to prepare a transaction + * + * Return: zero on success and error code on failures. + */ +int slim_prepare_txn(struct slim_controller *ctrl, struct slim_msg_txn *txn, + struct completion *done, bool need_tid) +{ + unsigned long flags; + int ret = 0; + + spin_lock_irqsave(&ctrl->txn_lock, flags); + + if (need_tid) { + ret = idr_alloc(&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; + txn->need_tid = true; + } else { + txn->need_tid = false; + } + + if (!txn->msg->comp) + txn->comp = done; + else + txn->comp = txn->msg->comp; + + spin_unlock_irqrestore(&ctrl->txn_lock, flags); + + return 0; +} +EXPORT_SYMBOL_GPL(slim_prepare_txn); + /** * slim_do_transfer() - Process a SLIMbus-messaging transaction * @@ -70,10 +114,9 @@ EXPORT_SYMBOL_GPL(slim_msg_response); */ 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; + bool 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 @@ -94,28 +137,8 @@ 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; - - 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 && txn->need_tid && !txn->msg->comp) { unsigned long ms = txn->rl + HZ; timeout = wait_for_completion_timeout(txn->comp, @@ -123,7 +146,7 @@ int slim_do_transfer(struct slim_controller *ctrl, struct slim_msg_txn *txn) if (!timeout) { ret = -ETIMEDOUT; spin_lock_irqsave(&ctrl->txn_lock, flags); - idr_remove(&ctrl->tid_idr, tid); + idr_remove(&ctrl->tid_idr, txn->tid); spin_unlock_irqrestore(&ctrl->txn_lock, flags); } } @@ -133,13 +156,12 @@ int slim_do_transfer(struct slim_controller *ctrl, struct slim_msg_txn *txn) txn->mt, txn->mc, txn->la, ret); slim_xfer_err: - if (!clk_pause_msg && (!need_tid || ret == -ETIMEDOUT)) { + if (!clk_pause_msg && (!txn->need_tid || ret == -ETIMEDOUT)) { /* * remove runtime-pm vote if this was TX only, or * if there was error during this transaction */ pm_runtime_mark_last_busy(ctrl->dev); - pm_runtime_put_autosuspend(ctrl->dev); } return ret; } @@ -169,6 +191,7 @@ static int slim_val_inf_sanity(struct slim_controller *ctrl, if (msg->rbuf != NULL && msg->wbuf != NULL) return 0; break; + } reterr: if (msg) @@ -205,6 +228,8 @@ int slim_xfer_msg(struct slim_device *sbdev, struct slim_val_inf *msg, DEFINE_SLIM_LDEST_TXN(txn_stack, mc, 6, sbdev->laddr, msg); struct slim_msg_txn *txn = &txn_stack; struct slim_controller *ctrl = sbdev->ctrl; + DECLARE_COMPLETION_ONSTACK(done); + bool need_tid = false; int ret; u16 sl; @@ -232,10 +257,16 @@ int slim_xfer_msg(struct slim_device *sbdev, struct slim_val_inf *msg, break; } - if (slim_tid_txn(txn->mt, txn->mc)) + if (slim_tid_txn(txn->mt, txn->mc)) { txn->rl++; + need_tid = true; + } - return slim_do_transfer(ctrl, txn); + ret = slim_prepare_txn(ctrl, txn, &done, need_tid); + if (!ret) + return slim_do_transfer(ctrl, txn); + + return ret; } EXPORT_SYMBOL_GPL(slim_xfer_msg); diff --git a/drivers/slimbus/qcom-ctrl.c b/drivers/slimbus/qcom-ctrl.c index bb36a8fbc9b1..412a60a314b1 100644 --- a/drivers/slimbus/qcom-ctrl.c +++ b/drivers/slimbus/qcom-ctrl.c @@ -397,6 +397,7 @@ static int qcom_set_laddr(struct slim_controller *sctrl, u8 instance; u8 laddr; } __packed p; + DECLARE_COMPLETION_ONSTACK(done); struct slim_val_inf msg = {0}; DEFINE_SLIM_EDEST_TXN(txn, SLIM_MSG_MC_ASSIGN_LOGICAL_ADDRESS, 10, laddr, &msg); @@ -410,7 +411,11 @@ static int qcom_set_laddr(struct slim_controller *sctrl, msg.wbuf = (void *)&p; msg.num_bytes = 7; - ret = slim_do_transfer(&ctrl->ctrl, &txn); + + ret = slim_prepare_txn(&ctrl->ctrl, &txn, &done, + slim_tid_txn(txn.mt, txn.mc)); + if (!ret) + ret = slim_do_transfer(&ctrl->ctrl, &txn); if (ret) dev_err(ctrl->dev, "set LA:0x%x failed:ret:%d\n", diff --git a/drivers/slimbus/slimbus.h b/drivers/slimbus/slimbus.h index 3ec5a85fba8e..8266e53535cb 100644 --- a/drivers/slimbus/slimbus.h +++ b/drivers/slimbus/slimbus.h @@ -242,6 +242,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_prepare_txn(struct slim_controller *ctrl, struct slim_msg_txn *txn, + struct completion *done, bool need_tid); static inline bool slim_tid_txn(u8 mt, u8 mc) { From patchwork Thu May 17 08:58:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 136126 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2012162lji; Thu, 17 May 2018 02:01:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqwJMkgiNi+uy437xJt6c/DsJEYI031avNZy3CEpBNUn53r3kKeXyTu3a5YYn8q5vVfxCN8 X-Received: by 2002:a17:902:3a5:: with SMTP id d34-v6mr4461371pld.103.1526547694383; Thu, 17 May 2018 02:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526547694; cv=none; d=google.com; s=arc-20160816; b=inKz8pQ4Q8KO5vqQ0LwtE76vCjbBsn/fCfrwrEePtTEpXGxaw448Cj7WnBvelTd+op EuGzgexIbWRPzOlu11wUSOiphaqJMrL0PkSlnoEk6fFaT98NFRcqhqxxQ/Lqog3w9oby J2mKX86judbQaK0RRAEPqoJdhW51OzchLlvwTi07Zjj3SAtJt79V/fBb6jwKQmOSEQpL 35ugdn76oOQ9S3ZdTI0khaiUh5G0mz4iA8K8xRQs/pxNBGj0mUZsJmqZzz3oQsI9cWje PTJw93gX1Xxxi66aQtYmS5BsvlphbGi6T3//cONFSy9PDqeE9FRziTT/X/t43O11pkW5 HYZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=wO/3Vwe2w+OXBq8uJE10e6m5PMua/N0ytj4b2qk2ZkA=; b=KPyi/Tzzte9yY+xJq5iRKBn/d3kWF/x6+aRL5Tk8rMgcvY/cjNUkFYOaLkBJFxe2Kh 82sZDJBhMcW22p7DfNz1FRE+V3fCbyd+Ndj3iAodZwusOMCc2rTsOpBj4ePchPt0G+0P dixRl3REoEIY+yrTR2kKewsJH1MqAiAx+Ol5RixZF2XUJNw9TB4fv15ychZrnW/xWWb+ G09Gj1MuzI6cqoQ2WFiqLl+0Iv2AmCWQNcosVICvTEMPXIj3QoBFOcSNMJQwhosD279g tkel3hHSV1YO2/62Cl09JMRbuNfWE86z6gy6ky4kWZFEgJ3qFL3tdAw8eUhaw2g1qeb3 ptAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NK9bNcLQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6-v6si3845365pgr.72.2018.05.17.02.01.34; Thu, 17 May 2018 02:01:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NK9bNcLQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752165AbeEQJB3 (ORCPT + 29 others); Thu, 17 May 2018 05:01:29 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:40456 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751233AbeEQJBE (ORCPT ); Thu, 17 May 2018 05:01:04 -0400 Received: by mail-wm0-f65.google.com with SMTP id j5-v6so7534886wme.5 for ; Thu, 17 May 2018 02:01:03 -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=wO/3Vwe2w+OXBq8uJE10e6m5PMua/N0ytj4b2qk2ZkA=; b=NK9bNcLQmV2Vp7oN8/PJf65GxaStmlZXuOjPDj1luMk71/CTVWwPkcG/19ZtbkutYO imY+8rMjCwnLtxfT7/PVf+wimiMrMfRaQGcHyev7bqL3IBnnIGu0+5A/8OX+eXGWtlki zlYp77whilkKgLRdP1rxu3E6HxHQA90JkquCI= 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=wO/3Vwe2w+OXBq8uJE10e6m5PMua/N0ytj4b2qk2ZkA=; b=rVnJgPwO9fTV4ZRRFyLVlntzU/zECescJVjx+FQT+c88z82YyQcDVOyhxS14PNLmlz cVML5CNYdBysgTSnudML7rYZpg//TBekZHMmxRhTf9gJR223z8hQtd5nIcEdEDzx9Sgf iEjmo1qUtkO3Lf9SJCBk4zvIgJ3iUIX7rjsdfrU8Q2OkxLMQkMQbdT3Q7gZqmE/SHd5q NR+OHbfwoLz8HU1SGJqQW4TY39RQIw+tq6J7QawnH/becojJvlPjoX0DthwHhg0AfriP 46XxQGXc/nSk8wm0KZcHprkkpL6DhvYojth7z2YUDwn1uezOrIn14nOkEDQpOQoV2UBi cgyg== X-Gm-Message-State: ALKqPweMTnxgsvCcfkEFzVxGm0RPE/4XIPiB4XEwtN3NzTG6dyGi81tM fXVro837M0nd6KlniRIfd3yBBhJLijA= X-Received: by 2002:a1c:4843:: with SMTP id v64-v6mr1074462wma.159.1526547663231; Thu, 17 May 2018 02:01:03 -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 y84-v6sm4123098wmg.44.2018.05.17.02.01.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 May 2018 02:01:02 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, srinivas.kandagatla@linaro.org Subject: [PATCH v2 7/8] slimbus: messaging: initialize completion correctly Date: Thu, 17 May 2018 09:58:49 +0100 Message-Id: <20180517085850.14276-8-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180517085850.14276-1-srinivas.kandagatla@linaro.org> References: <20180517085850.14276-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org slim_val_inf can contain random value from stack, make sure the completion is initialized to NULL while filling the msg. Signed-off-by: Srinivas Kandagatla --- drivers/slimbus/messaging.c | 1 + 1 file changed, 1 insertion(+) -- 2.16.2 diff --git a/drivers/slimbus/messaging.c b/drivers/slimbus/messaging.c index fd0788019357..2635eaaadf4a 100644 --- a/drivers/slimbus/messaging.c +++ b/drivers/slimbus/messaging.c @@ -277,6 +277,7 @@ static void slim_fill_msg(struct slim_val_inf *msg, u32 addr, msg->num_bytes = count; msg->rbuf = rbuf; msg->wbuf = wbuf; + msg->comp = NULL; } /** From patchwork Thu May 17 08:58:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 136129 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2012794lji; Thu, 17 May 2018 02:02:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpkuO3ZvjQpFo7/jmxy2XGs9W5ooAv5iFPuSEwZlhBA8o5altG7/vGfrk19UdlZqiXUDGvR X-Received: by 2002:a62:578e:: with SMTP id i14-v6mr4456544pfj.119.1526547725543; Thu, 17 May 2018 02:02:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526547725; cv=none; d=google.com; s=arc-20160816; b=q29CF4fRCRLEEtmM1HvM3roeV9KjUe1BpoyODWsW3O0ULOJ8AW0Bai5dX69mKbkOhP c5tKiJVVZdQs7jK4LzmYvHlYdDCoTMam6apEYxlL1icFPYmze7/6D9Zo6W/3v8eKa9mw FVvNcKt76yQrD3yuddhcTewhln8BAVN3m7pNeyr4GtWBn+jbGxqBGw/GRL8jIB7K34Mp 42UhHwKSmI+lp6dWwa/K5r78RmZd5NScTI3Yx34Te2OmUungxY3/3qKorX45l9cg77DQ t0yWqIWUQLfxTGlReOeDA4AvIQhMLbrSSfS5QAk6mNfM9radC8pPBzCUQgOuLPeCVSw3 8r0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=RCKGTvrqrdNij3T1TJhcCnK0Po9h/heawlL2PdS3fb0=; b=CJcSSEYq0erC6qLl+Fz78SGA3VQ8KGMwemLFBjNwL4m49CS8X0TkdvuVnxV3HTkugU rBGALYBCAmE2JF/CWm8jTo+m6cC4SSEf2l99W+Ptayr+9UieHR7qjaxgBBUr6OrDN7ng MOVtde0kvXfeEIiQ4HSnezoRE02zThEuYXRdu5RIt0SWXKsr629AOrgIeTEvjnOwzn2R x0yNl/GU+dCC8kHVL8YNPvJnHFEfE4fVrFW1tPtgqxgLyFbbPM1fIwmBN+6s8iheaXmG iY1DtEAay7Mr9BXxGWG+zk7LH0el9wzgfK+obfhhZQKi4qN5jyNO9BvaeJoB1X39GZmf SKHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ys1Imite; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g30-v6si3859063pgn.529.2018.05.17.02.02.05; Thu, 17 May 2018 02:02:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ys1Imite; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751976AbeEQJB1 (ORCPT + 29 others); Thu, 17 May 2018 05:01:27 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:38921 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752098AbeEQJBF (ORCPT ); Thu, 17 May 2018 05:01:05 -0400 Received: by mail-wr0-f196.google.com with SMTP id w18-v6so1060277wrn.6 for ; Thu, 17 May 2018 02:01:04 -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=RCKGTvrqrdNij3T1TJhcCnK0Po9h/heawlL2PdS3fb0=; b=Ys1ImiteTm4Gr4oYhw6F5NWeDaezZ9vQg23ngdtEjiNIDl2eNCgF/Kx63bygaFWVJ0 NlQ/eLuXgMWcd9X98zH2X3deRiC9brt94uTIEj7tP+AvWUREhj0YHKkrWqEVAVFunJ6v bMfbvCGcWSk/XmcqDQHXQdPk9jGTCxiWNTdWo= 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=RCKGTvrqrdNij3T1TJhcCnK0Po9h/heawlL2PdS3fb0=; b=Nm14tbUHsNpins9MEOGW7g4Ymy2b3ER4oMFWuakANeGoYLcY9W97VBf8tg/ehlq+XS lQtiqoIpl6S2ZrYaKaBBaK1JCKeaFYZpben+zdAbkPEgWqtq99r0mUHaEiAIPeuRO+cG 6SBogANe4dBIuzDTEouwYUGlxQ2dD2C7oG2stGmkeOYFHKWxBzKv8jK3H3OMTFuNBwE9 tiuVMSx6NLH98Dql3OeZAJkFC6GbIOKgd42NyQhH97ZN5WFahoPR3Un4PeQL7QZS9lir pLoRGu2nQuaZ2uynG+p0rUmjUnrnDGv3QAaBxSk0PMnAbalnANuFHEDqol7zQjnUGyhY 5LSw== X-Gm-Message-State: ALKqPwd/wTgsoaSj0Xba3cxo2HWb941bkiyF4vg1321/XNpZZ7NJIyvL uJuD4TFeS9pRHzaQ+t4rbLkMPg== X-Received: by 2002:adf:a6f8:: with SMTP id t111-v6mr3396187wrc.161.1526547664209; Thu, 17 May 2018 02:01:04 -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 y84-v6sm4123098wmg.44.2018.05.17.02.01.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 May 2018 02:01:03 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, srinivas.kandagatla@linaro.org Subject: [PATCH v2 8/8] slimbus: qcom: remove redundant depends in Kconfig Date: Thu, 17 May 2018 09:58:50 +0100 Message-Id: <20180517085850.14276-9-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180517085850.14276-1-srinivas.kandagatla@linaro.org> References: <20180517085850.14276-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org QCOM SLIMBus controller is already under a 'if SLIMBUS' in Kconfig, having depends on SLIMBUS is totally redundant. Just remove it. Signed-off-by: Srinivas Kandagatla --- drivers/slimbus/Kconfig | 1 - 1 file changed, 1 deletion(-) -- 2.16.2 diff --git a/drivers/slimbus/Kconfig b/drivers/slimbus/Kconfig index 1a632fad597e..bfb78d9a6583 100644 --- a/drivers/slimbus/Kconfig +++ b/drivers/slimbus/Kconfig @@ -15,7 +15,6 @@ if SLIMBUS # SLIMbus controllers config SLIM_QCOM_CTRL tristate "Qualcomm SLIMbus Manager Component" - depends on SLIMBUS depends on HAS_IOMEM help Select driver if Qualcomm's SLIMbus Manager Component is