From patchwork Wed May 16 11:36:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 135994 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp804948lji; Wed, 16 May 2018 04:39:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqSukwrQBvPLGBgbV7IQFHKyVVPNaXWiBeyKJzAqM6ki0uwOYP585JlJdPRG3aU4CySDn3I X-Received: by 2002:a65:5a4a:: with SMTP id z10-v6mr448125pgs.243.1526470757880; Wed, 16 May 2018 04:39:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526470757; cv=none; d=google.com; s=arc-20160816; b=V2n1ArghF4H7kqBhhulFyg2YgPLZfbmktOlm1n1+Ijq51dlEgalePhGufs3NttNVyB 1bGfamaLiyLp/cK3Vz9hcuXUIhMomQpNX9fgk/T7eT+CMIwrQGezQL2g7vJspyWVC8E/ vWFmJzkNJPC23AhrnqgHyNNUFyCyoXY7haMD/a54Iec55+2Qu4xiWqOmWiY6I/A4ls8W tTS/W3TrAO+PQTBN/jFGi4U+b7dltrwyPlGoDCrm7dFRrjZZvQ8pY+JfuSvLBljUcun9 pFF4Bl9jb54QgyFGg2mzG2TlZU5P8HSbp9+x+pX9EbuabeWWeIQpIsLhS/SSSg3wemmm 78rA== 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=WHl8y2e/CNxRLOFMGZ23TuP+wCFFLpgrtDsLMJiqlxg=; b=sNJxeNLPhgF5gcqni7ptvp9BaBbNt2skzQ8H/Y4AfXD7wnmnr+EeCMcBEQxY7oUZ3Q a5NQUOM+QphKp3UtbNbKDfAhzs0Zo0KP7i/HcpMigddS/jgdZvZ5XJpsSaxjvoTqVsx3 ZUC/aEEonernnmZ+pjVJxGng908mBqgp3ECCIz4cEi0lG8NJMh+6wEWrUmuewoFYrLCr GOyTqcJQy7NL4IL5QJYHi3gyQFa+Kso8ftuc0r2kshdEnLUkXIn44368TmdIAJoQ8Hs2 netZ1H94phn/aFfXnZ9Ds1IzxLuqS8jQahhk8p2OamYPbIDVDHIHuJ3VuqC1ieDZ9135 F3IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q5lhRHcG; 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 f3-v6si2367502pld.513.2018.05.16.04.39.17; Wed, 16 May 2018 04:39:17 -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=Q5lhRHcG; 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 S1752528AbeEPLjN (ORCPT + 29 others); Wed, 16 May 2018 07:39:13 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:37263 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752274AbeEPLjL (ORCPT ); Wed, 16 May 2018 07:39:11 -0400 Received: by mail-wr0-f194.google.com with SMTP id h5-v6so566591wrm.4 for ; Wed, 16 May 2018 04:39: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=WHl8y2e/CNxRLOFMGZ23TuP+wCFFLpgrtDsLMJiqlxg=; b=Q5lhRHcGTAFeoDuRl3r3Okf92yUZ3UWKqOJwE/SNHSVkdUPOdCrTD3MxVKTXLL6Kdv P3Z057VUWk51+KD5g2Ayivfjv+1/Ecv1k0+mpMyrjv4ZOGPsj+G/dzeMVOjdTD75wlZT puZqILmt8pqID324/9Gkv0QZtXXIIWgPLeA0g= 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=CeQpwO74U5y+8usVQzNfRlyrWsJIcM/b5CDae8sBq7/mUaU4ChSTNr4MZlmuWCTZyj dZiLxP8CsYsJ0Qv6FXs7jzUm+QhFu67Nil432rLL+haFQw1DwhwegbpoUPFMgkck3u7k WDHXFa0/coN4naTE453ZwloA2583NOl6gNh1T+mz+ehFl3GyROquQ/j05EZKOOqQdSGj bQy4V6OD6lP8BGcccSqma3HQgXc3RFbbVFxiVDcNU30i6NsAfkjbhqQBF3kj5BQM97Fj NCZE7ua+FyaAeAU3DvM3d5cjgWIYYF3E+oS77Lj18FXoKSABpH+MXIUfSpCUNtVOAwt9 AgrA== X-Gm-Message-State: ALKqPweRcZCNXdbXoxixlKDz6YtDoAyEsqhcl9ctAIQLIaMRURUMzbdF z41aRc1Sk9iS7xNRI1SsgXbrDw== X-Received: by 2002:adf:a108:: with SMTP id o8-v6mr543790wro.106.1526470749975; Wed, 16 May 2018 04:39: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 k126-v6sm4504263wmd.45.2018.05.16.04.39.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 May 2018 04:39:09 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Srinivas Kandagatla Subject: [PATCH 2/7] slimbus: core: rearrange slim_eaddr structure Date: Wed, 16 May 2018 12:36:37 +0100 Message-Id: <20180516113642.28136-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180516113642.28136-1-srinivas.kandagatla@linaro.org> References: <20180516113642.28136-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 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 Wed May 16 11:36:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 135995 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp805012lji; Wed, 16 May 2018 04:39:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrNCuMYWrrGWwJwBVP4KJodZy0d6PSS2wH2ZSwQBLZcSmOpCfJT3WjyZD+Jr82Wc8pSrkSJ X-Received: by 2002:a65:49c3:: with SMTP id t3-v6mr453357pgs.65.1526470760956; Wed, 16 May 2018 04:39:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526470760; cv=none; d=google.com; s=arc-20160816; b=P+yNsK21dGYvH45M7Ngr0ioMITQBGvIU0x60GFWwH8AgB4KPoBrTU9maRYSMZR1DlW qzPQVvTu9hgVdD7lHuoYQCnRKJmwzBd/SDBtuHLurDkic9nNID1xwqag8k87et3le3wv +QI3Tukhc4r8B5eaJ55d4MN26YzUDLbW6R3H9J7P4B41Iv4660YBJwLMrQimqe9ZwTAV mN0M/Kyv63B72d5GxNUWSZZ3mz4vCqRluieP1k1Kh25pT1A2xOlEg3YJdF/Gh3xpf1/r 0M+uDzCwUxPN3iQYkkIFUC2zP8yojCUhLe/bKL1fy4l94KjcgPz7i+nrzJyJpuDz5oAp HLiw== 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=W6uYmgHxTWzfDftIQnpPK6qurtIUOyuIABrSN4ITJSQ=; b=PHnwmrNSLKpUiExjqmk0QGgzCysuqEzfIqfQgy1wSUYqR8xSMqKm9IK4EdcC98hwN/ ReWzkMVhDAMEzRB00BZeVnubqgsacegS+U7K6vnZp+VRuVaJRIqDj8T7VxgU6l8XHvaF j8RaGn+Gw1+Vr7k0GE7VEtfsbEr4ksNtzR2tHi/1iedWkTOJSKGHs6PtUFhuyMpiajwD HxouTt8qNoUo+wUUAKprzT80RR6tz4q/ihCC/qnqLgOBsrIcDJKnkaYYkOXS443d75TZ SLWGZOM4GBNyEydXmloKdHb0dWm4JhbU6GD8sP6kUXRtW1cUGS8XpG9+QuBUPHyB6gRn O1GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I6zFDkxw; 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 h4-v6si1916979pgq.603.2018.05.16.04.39.20; Wed, 16 May 2018 04:39:20 -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=I6zFDkxw; 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 S1752573AbeEPLjS (ORCPT + 29 others); Wed, 16 May 2018 07:39:18 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:44368 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752530AbeEPLjO (ORCPT ); Wed, 16 May 2018 07:39:14 -0400 Received: by mail-wr0-f195.google.com with SMTP id y15-v6so550992wrg.11 for ; Wed, 16 May 2018 04:39:13 -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=W6uYmgHxTWzfDftIQnpPK6qurtIUOyuIABrSN4ITJSQ=; b=I6zFDkxwvFW+lgto2/wRVS0ZT5fQOjV4bs0PEF/l8AS4kt+1vAdzvkfc8aGzENDce4 6j/8aPzOD2G+omgoLosjAq4PyKGDCVSSeE3yQZwFpxYFkHEPqkFhskxVGFewBKPbBmz4 0NP+EqatS+p40XLvYk46kin/sYgI6zVHSwYv8= 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=W6uYmgHxTWzfDftIQnpPK6qurtIUOyuIABrSN4ITJSQ=; b=NLyFVbqYDVzhQVaVF179yx60X0IWcPRWtB+l68mGX6Db3HAJJCaZXResQtfMqBO5PU DOJVAkDcyt1NyGbOMa1OaWzCyvJwSUn43MxyYXPVIc2azMJrElsAvLW8Yb4zbNP1yJ0r jSPxAVsLOLyWJDK+JKdNGzV5z1AdJH/pEoOjZEBJ0HBJ3wRx21KTPrX8Z4z7vijcyASw tSlI+hBzQCp3ZqYQ6FvAQvAclJ8ZtDLW2b+dZcf7RAos0lrr+86GBUgyvwlgyLUYUh4w nC7cQTKhZEDZzlaQl+b7WERdL40FrGd6LexXkGW5S246zH5cpEgKezusGR1kHsrU893d 9JIA== X-Gm-Message-State: ALKqPwcJ8bo72pqV6FMs2xJdja5rpCaaTgZCr7FWySVhn1Mb/D2TktaI pVYYqxfRl/xrJqJT25K9eZvCUw== X-Received: by 2002:adf:968b:: with SMTP id u11-v6mr543407wrb.184.1526470752921; Wed, 16 May 2018 04:39:12 -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 k126-v6sm4504263wmd.45.2018.05.16.04.39.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 May 2018 04:39:12 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Srinivas Kandagatla Subject: [PATCH 5/7] slimbus: messaging: remove multiple calls to pm_runtime_mark_last_busy Date: Wed, 16 May 2018 12:36:40 +0100 Message-Id: <20180516113642.28136-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180516113642.28136-1-srinivas.kandagatla@linaro.org> References: <20180516113642.28136-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There seems to be a multiple calls to pm_runtime_mark_last_busy(), which looks like a typo. Fix this by properly adding pm_runtime_put_autosuspend to put controller in auto suspend state. Signed-off-by: Srinivas Kandagatla --- drivers/slimbus/messaging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.16.2 diff --git a/drivers/slimbus/messaging.c b/drivers/slimbus/messaging.c index 5a2ff01b394c..1c57b631031a 100644 --- a/drivers/slimbus/messaging.c +++ b/drivers/slimbus/messaging.c @@ -139,7 +139,7 @@ int slim_do_transfer(struct slim_controller *ctrl, struct slim_msg_txn *txn) * if there was error during this transaction */ pm_runtime_mark_last_busy(ctrl->dev); - pm_runtime_mark_last_busy(ctrl->dev); + pm_runtime_put_autosuspend(ctrl->dev); } return ret; } From patchwork Wed May 16 11:36:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 135998 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp805313lji; Wed, 16 May 2018 04:39:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpGBWMKCmxcJiNwfHrBb4a7qjsVZ1XtJGa1fQDTMFjsSM41FPQUvhmeikto393Sdz39DT6c X-Received: by 2002:a17:902:8d8c:: with SMTP id v12-v6mr587808plo.366.1526470774541; Wed, 16 May 2018 04:39:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526470774; cv=none; d=google.com; s=arc-20160816; b=Jhty5cnEeACT6SXunWFz1z3dsFiWr1P+BkWyON+JkOqUJqT037+gCRZXPm/HA/K1bW 0MFBc3gWyhrQXVMALIbHLAqMMA5xxkLwAuZzkCPuOVfi0jhCBqYEzAMdn7WF8Me4NYjB DS6X8l+peSqcMu5muLVGQjr8D95Lab8I2E9sB/bpCdA8HFdFHBA+p1m53df8IFQjKUBR +W5aIj+EZ0VONqmaNPW/+qjqzDT+vw/w+rUYMiOY/R/nhXKOglddixtmT+6AL0HV9jbV RBZd/ENbLpDegejt7XGs33grU6i6Awu9pP60mdh4usS9YJVhzaMSFRBU0/lHoxdQf/WH QUfw== 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=h+yKZBsymFyOLdBuFEX4Ykm1mvdtJ0VJ4kvjsob+kQI=; b=cMHKYY14+OIaYcI8KlPmmzydK84ryPkVSkWmkbnhOA+7NHhwYBPEDJgPUmd2kQsFLP z3KBCoQkn/uoBJs94sZRsxYwhQNqapgClxOeYTqzkqeAI7euI/lf7AHZGo5srfow21SV 3N/gWearKWLhrXSufB2p31Yel6Jt/1ZMZvfo1N3NPoEzkVL+M/7aSRoEf2IXmT0esaHc x46ecTmwn28ZYGoewzZOIOU2/sQu1VdKd2HhC5AHuxC812mWD0E9a7DXO5vYOG+s3XcS DHqvhr/HyfbV/NEweDnThT3rvegozzqGeiAgbHorE/WApVarqfs8tm1V64IVnMWpM0o9 8Wyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mxuqsvkb; 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 g34-v6si2372565pld.411.2018.05.16.04.39.34; Wed, 16 May 2018 04:39: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=Mxuqsvkb; 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 S1752644AbeEPLjb (ORCPT + 29 others); Wed, 16 May 2018 07:39:31 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:41736 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752274AbeEPLjP (ORCPT ); Wed, 16 May 2018 07:39:15 -0400 Received: by mail-wr0-f194.google.com with SMTP id g21-v6so561084wrb.8 for ; Wed, 16 May 2018 04:39:14 -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=h+yKZBsymFyOLdBuFEX4Ykm1mvdtJ0VJ4kvjsob+kQI=; b=MxuqsvkbeC7wagRMa2luw0M82AuyzMLDGaUh09icfZfE0BKe1GjhsjJb9OiUqc6sIj jCwKrXX+jfTqlUB6xxc0P0mnvez39zpxFI9wtESI10Y/a+8VyoJhgiQ96g+M6CzcIOd5 K4tTfmK/uhTacFLzD4rG0nMxIgLR9MqGvzrLQ= 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=h+yKZBsymFyOLdBuFEX4Ykm1mvdtJ0VJ4kvjsob+kQI=; b=Og9s4NC13nVBncqXcmexw8maQUi2+pAHC2OO6cifbGqS48C7dDFRnERYnZofGAoH/u tBlUbYY8zUSm0VToqeVKOY2OIPnSMcnUBs1ijkaAC6xDI+Rs6ZOXA2lUBfUPr0x2tFJ9 dHOuMVIpyTBM8mp3Zic2LpH4lYpkUVNqMInXDBfNAw+9crjYR0UnCQQbidZPFOjDbjgW /dg9ovkD5t8xdY7rTDrdLx2WIeYBdZJsgrtCrODzna465wBria2VkFAioILS6K9VXFS/ wkPNHUP4Rj90HQVmd81PPaw73m1ERN++DVH7yKQ32n4mjHxxmJcYyoMfTc9T1WqC08wO GX3w== X-Gm-Message-State: ALKqPwcH38mW3yNu4iAxymNRwzqNpmxYUSOWMksGJTXNJPCoTuov9N/W O5iYcw/GER8Wqt+/OsBIbv945ySuovc= X-Received: by 2002:adf:ac4f:: with SMTP id v73-v6mr501725wrc.5.1526470753812; Wed, 16 May 2018 04:39:13 -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 k126-v6sm4504263wmd.45.2018.05.16.04.39.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 May 2018 04:39:13 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Srinivas Kandagatla Subject: [PATCH 6/7] slimbus: messaging: add slim_prepare_txn() helper function Date: Wed, 16 May 2018 12:36:41 +0100 Message-Id: <20180516113642.28136-7-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180516113642.28136-1-srinivas.kandagatla@linaro.org> References: <20180516113642.28136-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 ffb46f915334..0783fb11c702 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 c0450f469e07..67e774b2b2dd 100644 --- a/drivers/slimbus/slimbus.h +++ b/drivers/slimbus/slimbus.h @@ -241,6 +241,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 Wed May 16 11:36:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 135997 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp805245lji; Wed, 16 May 2018 04:39:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr/EiT2HabccoqIKGcGQTTzG2aDGSqXFbEKyaUsh2DU6cgic8YHxCyp5rC9j6PZAEdqqdor X-Received: by 2002:a17:902:968d:: with SMTP id n13-v6mr594079plp.168.1526470771772; Wed, 16 May 2018 04:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526470771; cv=none; d=google.com; s=arc-20160816; b=EyfbmgM7BWCdrMR1sovK1AiCBmGM/z00r3GGVEQqrLHFsaoWATvhG80by/ARvJFuJU 5pPy4ABs0GQ/Y6IRGzhaQVxB1IzlXO55NCl02NedWT73M4UrqWo9b/wY5pDjukz4CLTE lUDKzWCUQCOhoV89Vk1WvGaYi06qhwI0hI4FVHVimZ1yjOA9gxoGbIEcNANgdtRMydUd lEGZP25jpjyLVPHbvjgzMcQzOuYCtYVJTykrKT70ckYthDyadz2WD0J1jR7cNcv4Dy2V Pk1Z9vJiRV5CfSS5dnTb/+yXbCCAE6tIDWRGQnkiYQKshzeynBRbikcZj3u9hek+MWpj IWSA== 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=Ya5HpzU9C+Szh+mYvTHmRL6N7SBqcfRiI6kCbiJFayiddEyBNvFVw0ZhfVocJ9bezZ AC6Yx/Z6RPTjFQOmFgWFyLtVyiEAFijHdFJxKfuOa3LgvKVjISZyPefNQyEj5XioH6x/ NVidE2zS9LEeX7X6K/1rEhsUGe1hvJS7f1bzhNS/ToEaXC95yQ02qS8eulU4QBygbjKE NOD5vfnnllz/pnj/GfPx+A2ariG0Hnmlwf3DkgjH921GOotVEoKy3QX48s9kLzKFOkaq QdoTiLizXfRJoUnP+j0u6g2bgdbxrZ0cCQzHQFBiS9UHlWhIZngtlrSbdfjuakAiON6Y lgCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WdwPjHet; 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 h4-v6si1916979pgq.603.2018.05.16.04.39.31; Wed, 16 May 2018 04:39:31 -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=WdwPjHet; 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 S1752614AbeEPLj3 (ORCPT + 29 others); Wed, 16 May 2018 07:39:29 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:39754 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752406AbeEPLjP (ORCPT ); Wed, 16 May 2018 07:39:15 -0400 Received: by mail-wr0-f196.google.com with SMTP id q3-v6so565376wrj.6 for ; Wed, 16 May 2018 04:39:15 -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=WdwPjHetvnTVq6o1rsnlvg60OfK4ZbuNlpSfy1+aThjdbgWz+saOvJ/OpiPnOJvS8r ITo6k9PjIIw9shrmQlupBpCRJRtVLNOIXcDWxz13afw81+EAR/qv+Jc1xg5wJZHNjZSj 1FxrgtKDFGHD/MhnY0wtSiwPR8bxamWgLrCls= 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=nW/G/4yiCPOvlUAYHoN4aNmv1yPF1xHDA6j/+8IBkWPx9oseVEiyF+JroDTEPkER6j MZug9Y8S6EqAACCuiQjGqXOEA/y/7QXK++lFjh/dXJCnOHTFzFHu4BJEytov9nx5CoK3 UO1BSFXkMBJkj21CFXPGrNUKx6H85FM6lCzzYn9LjugT5autxKI3RERj1XKJntyQYzrl PKKKqrztJnV+22Qp9VOoIp4Ni4IffEd9096HFmpmIw3LeAaEnziqq1dk4KlADxKS6F6/ 0zgN3L0/9faZuTB1HGAqpBDveLlGPXm7PgWQjG82sVD/JJDNNOs2YXwrWnGgCxsHtyhA 2C3g== X-Gm-Message-State: ALKqPwek7IEjKdvtktOEDuIkB26KbncJjrVYAftleE7rAcMq326Scw1a hpfW0zGZXsm8eDvwJhL+JEyZW0F00Y8= X-Received: by 2002:adf:dc90:: with SMTP id r16-v6mr519008wrj.218.1526470754637; Wed, 16 May 2018 04:39:14 -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 k126-v6sm4504263wmd.45.2018.05.16.04.39.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 May 2018 04:39:14 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Srinivas Kandagatla Subject: [PATCH 7/7] slimbus: messaging: initialize completion correctly Date: Wed, 16 May 2018 12:36:42 +0100 Message-Id: <20180516113642.28136-8-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180516113642.28136-1-srinivas.kandagatla@linaro.org> References: <20180516113642.28136-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; } /**