From patchwork Thu Mar 28 13:41:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 161308 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp732838jan; Thu, 28 Mar 2019 06:46:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlYILn74bjMWRQ7CKQ6A9gGXUKckW0af1kQEzm16NQDsrtK7nP6GWoAce2bVBOz1Bt3XT3 X-Received: by 2002:adf:f6c8:: with SMTP id y8mr7820068wrp.61.1553780762464; Thu, 28 Mar 2019 06:46:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553780762; cv=none; d=google.com; s=arc-20160816; b=zT7rCsDZvbt/euUqdBoQnqfTXvY4Ga8bXN4MFwUq4dtriVf3oqjRiwUw1e3kuiUxgm ozRpS7PTyPbNPqK7SHngLom2huQNIHycO706vX1YHo6bn2bHqj996pVS6HeI9zAdkQNw sWmJ9LvsCBnvqoTIpP5ayAIf3MUMaVSPtcZVlM7HFblxan6P8Z3QKbI94g9Qm5cXtLDY 4WlHYjDr+DG8ed8H6nrh25ZqSkIXDcxlkA0OzhtCtHCK1XoB4JttRhmP67RgevWEeltE tD327l2dYScmhP4VLQhF01vRmMeMBRvYCpRLl1QgcfEujquK86MZyD89o+oeVrmz2PCp 7Fag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-filter:delivered-to:dkim-signature:dkim-filter; bh=y3lpewKxZty5HD6sLkDeG4A6vXWWYzPjDDu9JiNKOXo=; b=JvUVUotBlQTpyonqSW1ePUn+5R8YNqokwKWYC+YY0kTNixF7IBdDbjULR2IwPtq/D0 L/KcnG3xYYjUvLJX5PrQWrTmAPbpXW4HU9qSjWx47riu75M6fRz6K+FdYIf4DQkhExPP YtfOMo5nnvTgem5xU7dcZj4rF1d7Rv3VUmR80QzmbCPQRCWKWqi03gix9C69wdKj5hIr 61Z0+czBo5PGABp2EWk+CeyB4oKaU73786ptKFSLgD3QqmkbjjrViI/I8vBCLWsZT3XX 4fCmVkkgEnl1DUPf9lCAF4Vjn4VYax17C+PQuMVac5sqfHWJR2Z4Mds1zyPsvI6dHhF3 1cHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alsa-project.org header.s=default header.b=FR2DjOx3; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=b9QC1xEY; 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 ESMTPS id y5si7178201wrs.98.2019.03.28.06.46.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2019 06:46:02 -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=pass header.i=@alsa-project.org header.s=default header.b=FR2DjOx3; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=b9QC1xEY; 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 alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 902ED875; Thu, 28 Mar 2019 14:45:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 902ED875 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1553780761; bh=Gk9gpXebte1aUdEd/j+J8FIWwFjQ4aeGPz8lLrfWwLk=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FR2DjOx3YZxGxc4sZh3C0lURmZnpwxLCEk3/54LHleGWYDkLP/PcrLpQsy1ESoBez BY3vvQohlKc9v1U27vbAnsX192hkuGjNEki82Lj30ggLkIfiz05ewqUualhlnfPqC4 ootruUJDPXxxztwpTPPT+UNXe+23V4HH/q21ox44= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DD483F89720; Thu, 28 Mar 2019 14:42:14 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id C4F42F89673; Thu, 28 Mar 2019 14:42:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0FC7EF89708 for ; Thu, 28 Mar 2019 14:42:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0FC7EF89708 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="b9QC1xEY" Received: by mail-wr1-x441.google.com with SMTP id r4so15273203wrq.8 for ; Thu, 28 Mar 2019 06:42:05 -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 :mime-version:content-transfer-encoding; bh=qmgZw2FIQ5XbbByZFztSXm12h7POpv6imcOhVfmNnxw=; b=b9QC1xEYXuoz7/MXJEushMDYuWZpkxppL+UVS9dR0t51gMvSfFHsS4h01jN2rJbdkh bFIL4pRqTpIVDUsdT1ntHHcOIzWd1npa7KJ0D+5Fgm4Kcy6Kde85mN8bJaKlL/INFd1q SuDkUf63if30r5pECMBt7ESQIMhqBVA5dNb7lnn8UMpcRtryg7ayjAZZ0PLTFaPX6RF3 eZ2kbZb/oi3C2EfH4iGnKVWejuWhD6zwKw06axJlhbiLszm9iQ4tZgVjgMx3flSC2ErZ WTr24yeyuLob9T3MSTqpvqVzwGq9Ku9XwbC5VhrkaLIZloRDvn/QYb/hlOw21ZCQC4y6 6riQ== 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:mime-version:content-transfer-encoding; bh=qmgZw2FIQ5XbbByZFztSXm12h7POpv6imcOhVfmNnxw=; b=pcGfYUAaQWKAG+DlR3P1Is4fyD2Cx1aVJ9zUF94xYbWwU4d6I3l4/CiPediczFsorW YfpgjRx1MW6c5iXZgz0kKT1lvPaPVkSPOxKHzls+ptqv8mwJBvkTEo6tRDUo/htk0xvm NMNHvUL7SZEUMYUVuyXCUhz3fE1CHueXC+3j0dqs5nA3ThXcXxFtkMvR4zNfUEkI2vNf NvW0ylP8EXupvixSNl02WFAj/fBBFFYoGL9cImH206q/2VKb1URwpBuWSwp4JtPL54lT UaJe2OoGCbs0pVOcBJDlkB2xbU3xdOcFZZ+VDq+fbVrF5Og081SFjq44U/ZV8cpxClCe 9n8g== X-Gm-Message-State: APjAAAUr64Y4O0XL3ItZSNlqMaQgfJeCJ6hNt203KBMmeTeV8IEG4wkR iDpRS6Y4oZ5WxOCHAPT9gtc4Sw== X-Received: by 2002:adf:f88c:: with SMTP id u12mr26320629wrp.235.1553780524954; Thu, 28 Mar 2019 06:42:04 -0700 (PDT) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id e193sm5956374wmg.18.2019.03.28.06.42.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Mar 2019 06:42:03 -0700 (PDT) From: Srinivas Kandagatla To: vkoul@kernel.org Date: Thu, 28 Mar 2019 13:41:33 +0000 Message-Id: <20190328134134.22479-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190328134134.22479-1-srinivas.kandagatla@linaro.org> References: <20190328134134.22479-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Cc: sanyog.r.kale@intel.com, Srinivas Kandagatla , pierre-louis.bossart@linux.intel.com, alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 3/4] soundwire: bus: check if pm runtime is enabled before calling X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Check the device has pm runtime enabled before returning error. Signed-off-by: Srinivas Kandagatla --- drivers/soundwire/bus.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) -- 2.21.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index 1cbfedfc20ef..101562a6fb0d 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -327,9 +327,11 @@ int sdw_nread(struct sdw_slave *slave, u32 addr, size_t count, u8 *val) if (ret < 0) return ret; - ret = pm_runtime_get_sync(slave->bus->dev); - if (ret < 0) - return ret; + if (pm_runtime_enabled(slave->bus->dev)) { + ret = pm_runtime_get_sync(slave->bus->dev); + if (ret < 0) + return ret; + } ret = sdw_transfer(slave->bus, &msg); pm_runtime_put(slave->bus->dev); @@ -355,9 +357,11 @@ int sdw_nwrite(struct sdw_slave *slave, u32 addr, size_t count, u8 *val) if (ret < 0) return ret; - ret = pm_runtime_get_sync(slave->bus->dev); - if (ret < 0) - return ret; + if (pm_runtime_enabled(slave->bus->dev)) { + ret = pm_runtime_get_sync(slave->bus->dev); + if (ret < 0) + return ret; + } ret = sdw_transfer(slave->bus, &msg); pm_runtime_put(slave->bus->dev);