From patchwork Fri Sep 23 15:57:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 608637 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27687C6FA82 for ; Fri, 23 Sep 2022 15:58:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229891AbiIWP6y (ORCPT ); Fri, 23 Sep 2022 11:58:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232887AbiIWP6b (ORCPT ); Fri, 23 Sep 2022 11:58:31 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A32C147CE8 for ; Fri, 23 Sep 2022 08:57:49 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id i26so928930lfp.11 for ; Fri, 23 Sep 2022 08:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=hOgaSJV/qvshW50YoXul8vltWjgqBUI4d7EfeiEA4BM=; b=MKPUXAAvaHSrIM4Us8EwlpoRHPY3EvytcNQ8V3FJPDu62QIfKK6mI4892tWNP6yehZ erE4WyAyNalnxfDd0xlZnH3CMUresc4WdqtqUf9OTfZP+N68rTDd6KH4jCfX/YOvGtTJ nOreixgDnKWdczMNGBvh89puBhDNp6OubPGDI9I7PlcdEjvXcrC801omCmI7XnzwmZYy ll3q3W3p8htZqu9vWdSfGGHl2uHMBjU44UdMnMmWNLIZlCHzZqJtMxTigiymKohb03/t ykKlSKpek5vY+sibK/yXD1+exLoXM2nKkv4Gpv9UI8wtAjPoK5coIKiyCYSpfRcVhrFq 1+DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=hOgaSJV/qvshW50YoXul8vltWjgqBUI4d7EfeiEA4BM=; b=tOk+mDtMEgyN5NbBhQkmyX2VmOY0wYgVk0eaOlTCyFUdhwe9KaT0ZKosqzHcHviJhg ujGpJnqZ/GWybTe+UNOa2MwfyOHjL80OMlHc1zGuDYOXtkyGkVFXD/Cpa53vsDm73fJP 69dXkxLF8ycaf/x8lYKR/mkEWvoWgXgmAQFTqnTZXUU01XAPcmBW5QPGn9hiiH1CDMsu RAinepdTYq7g036VIFI4a+1RGhLoAlhIUyFzq14WrCEzS1L3txS+43o+3GLKXNJjX4XD jlEiL1F9DGD31vvk9fH6h+K+82Ic3yi983i324T89zCK3+kmM3ejZGM2nkIV4Y/t7dKm AxWA== X-Gm-Message-State: ACrzQf2KIf+HUdHurRK/0SUxyVnrrberppzaQwYc3HLftAMZGIZn8B3A F3YRtkwfKUoEiE1MkBDAmWrWx7q0g/mQmA== X-Google-Smtp-Source: AMsMyM6a0qhq/H+1+xSmcaZG6QjlDYqHTpFfeGibPe6fhDBAO3rpFsP92G7Vzpexp0uDV9zvPHflWw== X-Received: by 2002:a05:6512:3f90:b0:48a:826d:f727 with SMTP id x16-20020a0565123f9000b0048a826df727mr3317397lfa.281.1663948667475; Fri, 23 Sep 2022 08:57:47 -0700 (PDT) Received: from krzk-bin.. (78-11-189-27.static.ip.netia.com.pl. [78.11.189.27]) by smtp.gmail.com with ESMTPSA id be17-20020a056512251100b0049a4862966fsm1502286lfb.146.2022.09.23.08.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 08:57:47 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 1/5] slimbus: stream: add checks for invalid unprepare/disable usage Date: Fri, 23 Sep 2022 17:57:36 +0200 Message-Id: <20220923155740.422411-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org slim_disable_stream() and slim_stream_unprepare() are exported, so add sanity checks preventing unmatched/invalid calls. Signed-off-by: Krzysztof Kozlowski --- drivers/slimbus/stream.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/slimbus/stream.c b/drivers/slimbus/stream.c index 75f87b3d8b95..7bb073ca6006 100644 --- a/drivers/slimbus/stream.c +++ b/drivers/slimbus/stream.c @@ -407,6 +407,9 @@ int slim_stream_disable(struct slim_stream_runtime *stream) struct slim_controller *ctrl = stream->dev->ctrl; int ret, i; + if (!stream->ports || !stream->num_ports) + return -EINVAL; + if (ctrl->disable_stream) ctrl->disable_stream(stream); @@ -438,6 +441,9 @@ int slim_stream_unprepare(struct slim_stream_runtime *stream) { int i; + if (!stream->ports || !stream->num_ports) + return -EINVAL; + for (i = 0; i < stream->num_ports; i++) slim_disconnect_port(stream, &stream->ports[i]); From patchwork Fri Sep 23 15:57:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 608897 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4691AC6FA8B for ; Fri, 23 Sep 2022 15:58:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232023AbiIWP6y (ORCPT ); Fri, 23 Sep 2022 11:58:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232890AbiIWP6c (ORCPT ); Fri, 23 Sep 2022 11:58:32 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AC0A11A23 for ; Fri, 23 Sep 2022 08:57:50 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id b6so531802ljr.10 for ; Fri, 23 Sep 2022 08:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=QErVhPRsr6N34SxJtyWhiwnyHyeW0kuOVw7a/uaJPXU=; b=K90C3hBC6wd5wX5fUY+1rT0FrcxSVMtXeBam2xxfpXbCDnmo2fyDcdgG9nSnADKhgc o2OWb061x6VWvbk9dEQrp/ePFAimAEzue6BUNwKD8D+jnciw5fX8KSljEMbkxJ4ubc5+ JcsV14M4u1b4vcTxCWhY/vF4t5qB+ONaqEsca+a0xJ8LewPoup13Tr+JooMVwEw/6NfW VL9HsHhxI9BEbeBoZsgPhA7P5nhbAvydwvQo8DZ9hwF9uZ+OY35lyF9WSCg/iLLERh1O Hy6hTcAaGuVVEh5xCawr/KmXvG54ToUvvcdhRwVK6HCyTvcjHApHE4dAHP4Q5DniMhzR lwUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=QErVhPRsr6N34SxJtyWhiwnyHyeW0kuOVw7a/uaJPXU=; b=JTVgqKC3ZcFhRxTOOm6Tu7U/sIgEHhoLbG89eTD2CNT4GG9qYWT6NKcQY0PVHd8RqV 6m8iCeVsQbzJ6Af2gPVh/WwyVoUHREtPB+JUoW4TGy8mKiGNftUhKwVjkPl1k25hS+tk b54l0+vMEUY3TvUEnbmJ4XIvZzX8A1lOPkuANdp9fkQJnYqZcR1BSNC9SDXBO8+iXfeR sCz9HP7srZyYiTm0imCOJywlIaj8W5HNPDMi8qIOI1OErOzO4I9Fmo/Ia0OWSLJrBxrs qkMxa+1DkxZ/KoyeICHyb8HoeeuncZG1OAqq6nyYrKxvBgLuL9L4L/ifQa75FCRH10R/ dhow== X-Gm-Message-State: ACrzQf3bnB3R436PUk2s0Zoe0yytLbql7wkXcwzlAJ6d2goiPDuHQeY7 1BnpbMY/Lm+gk+lAkl3nEA3B/Q== X-Google-Smtp-Source: AMsMyM75V1fMGaL7US5/aDsMjZmatRFTONq2M7J8EAALYekOySKgoE+XfmX2rP9Y0C4bmxwyKYSNYQ== X-Received: by 2002:a2e:9dd3:0:b0:26c:3c23:a7e0 with SMTP id x19-20020a2e9dd3000000b0026c3c23a7e0mr3014306ljj.22.1663948668446; Fri, 23 Sep 2022 08:57:48 -0700 (PDT) Received: from krzk-bin.. (78-11-189-27.static.ip.netia.com.pl. [78.11.189.27]) by smtp.gmail.com with ESMTPSA id be17-20020a056512251100b0049a4862966fsm1502286lfb.146.2022.09.23.08.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 08:57:48 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 2/5] slimbus: qcom-ctrl: drop unneeded qcom,apq8064-slim compatible Date: Fri, 23 Sep 2022 17:57:37 +0200 Message-Id: <20220923155740.422411-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220923155740.422411-1-krzysztof.kozlowski@linaro.org> References: <20220923155740.422411-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Bindings require usage of fallback "qcom,slim" compatible, so "qcom,apq8064-slim" is redundant. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Neil Armstrong --- drivers/slimbus/qcom-ctrl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/slimbus/qcom-ctrl.c b/drivers/slimbus/qcom-ctrl.c index c0c4f895d76e..bb106eab8ae2 100644 --- a/drivers/slimbus/qcom-ctrl.c +++ b/drivers/slimbus/qcom-ctrl.c @@ -718,7 +718,6 @@ static const struct dev_pm_ops qcom_slim_dev_pm_ops = { static const struct of_device_id qcom_slim_dt_match[] = { { .compatible = "qcom,slim", }, - { .compatible = "qcom,apq8064-slim", }, {} }; From patchwork Fri Sep 23 15:57:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 608636 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11967ECAAD8 for ; Fri, 23 Sep 2022 15:58:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232614AbiIWP64 (ORCPT ); Fri, 23 Sep 2022 11:58:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232904AbiIWP6d (ORCPT ); Fri, 23 Sep 2022 11:58:33 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9573D149D01 for ; Fri, 23 Sep 2022 08:57:51 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id z20so572230ljq.3 for ; Fri, 23 Sep 2022 08:57:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=VC1ShBinIqlUH1hwjZ0lvI11uSYreZCKq6nMNs4Lha8=; b=LUo2rWaB9RNZIuVN22URCpGUShqbj1RtLH4LDikewtvOqTAqfJXZ01/q3OA4cQFe2r rmUX/Io+HB42E1wsgx5NxXzKex2A/vixXIowzZLEWZjHCRloK5+O9EUhyfIX+/vNZb53 lklZ7ezAUeV1hCBlHn6bRJlhOwCUNkLvsTB/O5c4RgPfhl9Y0upBqM2dhbvCDCtKrWzH GrDjXjpo6MnoBc6peM6sM28l5HVHBxTC4AwGz5i0xlIhVSIUOLfPgsr4IX3G6vgPqNG4 U0BMxk37eVSn9j23UnDYMTdJjDhYnda4EXC0jnndchsujS//ZjuMAJ8d4SEL0PH5BalV LqqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=VC1ShBinIqlUH1hwjZ0lvI11uSYreZCKq6nMNs4Lha8=; b=htdDGTglzM63xp5EiO8z76tmnWWIosdRt7SXgf0Mw/eNB8nSTuJtmoaP5DTMsP0Ab2 6KOYEQigb5SFXYhQvuAix+S/51/5G1s1tOLxX6/xStjlk2LyyFVOwxqOlUPbV6IRpPa8 Hl80a3vjjz+FwkZu73ScdPr0LhFQ02oelori91N07A44CQTWCDXhCZy9+QDUZ5FN0/I9 SxAYpjy/LRSlVyhXTPkdxRhw7lVMVa9swyncwDL7Ro8eYxzPEePK5zVuxXztX4b7omjJ 7MBIPLAY6dShi8KYYvKQU2q7HWgAfrOKhWg+0+UyTvMr8ZiAI0Lw3pj6uWDnJAxnHUhM DWvg== X-Gm-Message-State: ACrzQf0Xt31fU5QODO+kes3/fhRBCKEv7KSNrpGnQIODWbFTANGpX2tF HnYycXeTRuUPcENg64zBPiI5sg== X-Google-Smtp-Source: AMsMyM7NzE8WlaF6baserwi0wmCOiMlgLtJ9FQsC9L9lPmRslOyURxlpjODRw+Jo6rE4joL576SKYA== X-Received: by 2002:a2e:a9a9:0:b0:26c:6ec5:290 with SMTP id x41-20020a2ea9a9000000b0026c6ec50290mr2944124ljq.186.1663948669439; Fri, 23 Sep 2022 08:57:49 -0700 (PDT) Received: from krzk-bin.. (78-11-189-27.static.ip.netia.com.pl. [78.11.189.27]) by smtp.gmail.com with ESMTPSA id be17-20020a056512251100b0049a4862966fsm1502286lfb.146.2022.09.23.08.57.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 08:57:49 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 3/5] slimbus: qcom-ctrl: use devm_platform_ioremap_resource_byname() Date: Fri, 23 Sep 2022 17:57:38 +0200 Message-Id: <20220923155740.422411-3-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220923155740.422411-1-krzysztof.kozlowski@linaro.org> References: <20220923155740.422411-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Simplify the code with devm_platform_ioremap_resource_byname(). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Neil Armstrong --- drivers/slimbus/qcom-ctrl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/slimbus/qcom-ctrl.c b/drivers/slimbus/qcom-ctrl.c index bb106eab8ae2..400b7b385a44 100644 --- a/drivers/slimbus/qcom-ctrl.c +++ b/drivers/slimbus/qcom-ctrl.c @@ -488,7 +488,6 @@ static int qcom_slim_probe(struct platform_device *pdev) { struct qcom_slim_ctrl *ctrl; struct slim_controller *sctrl; - struct resource *slim_mem; int ret, ver; ctrl = devm_kzalloc(&pdev->dev, sizeof(*ctrl), GFP_KERNEL); @@ -519,8 +518,7 @@ static int qcom_slim_probe(struct platform_device *pdev) platform_set_drvdata(pdev, ctrl); dev_set_drvdata(ctrl->dev, ctrl); - slim_mem = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctrl"); - ctrl->base = devm_ioremap_resource(ctrl->dev, slim_mem); + ctrl->base = devm_platform_ioremap_resource_byname(pdev, "ctrl"); if (IS_ERR(ctrl->base)) return PTR_ERR(ctrl->base); From patchwork Fri Sep 23 15:57:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 608896 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1396C6FA91 for ; Fri, 23 Sep 2022 15:59:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232813AbiIWP67 (ORCPT ); Fri, 23 Sep 2022 11:58:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232916AbiIWP6f (ORCPT ); Fri, 23 Sep 2022 11:58:35 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02047149D07 for ; Fri, 23 Sep 2022 08:57:52 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id a10so623647ljq.0 for ; Fri, 23 Sep 2022 08:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=9pEICJNZ5nO4P1+qOCCLWpWUXxTuEVpFceB0baO81JE=; b=NxT9e5oCLYKT3a6UU77vYEEwrXRUDdJCwgbS+hOxcuLdlHIMlTMMxhSgdQnrZzyEly JHxvA7uR2vuZXCbjYsfLJ+AyHAJiFgQ1vFYG01HGsmhe/BN4RcBkH2iPXCgoN492oL+m ++JDv5Oy+UDcW3Ne7acj8VTsu7SavjAnbCTaZ1e/VREnOGufN1N9whgAGD87ZcOupuvF LVDjVzNcmPZ8TfenVaL/R3n7vmimEBiW7S070ZDPd8MdF9hddErFB14sjuNi2DsPa8os uIhn3RSCCCxjbwVQlx5094CsuZ8I77E5lmPFDmFyIdwsrXquoMGN4iLqfbZFhZppZpjc O00Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=9pEICJNZ5nO4P1+qOCCLWpWUXxTuEVpFceB0baO81JE=; b=E4p1Xj5uJ4ch82O3MIDJ3ixHiolA2WD3riL4BPL1FQ0bheDOmrBgZD3OoraSrt3nh/ LMNoj4zn7aPiFNX0YRDcxMp+zsoLOrmyba26PmyYUfFYkPCtzIPE26WoBLsXhwoLoy+K Db4WzHA2luYYR+YIVWnGnoHRikEMNbieuBah9uoI7OUOYeuy5OP4MKUbipYfP0SiVwaE +rge3UP0qMz6gQ+R9M5z0sgXv69OXH6TwGxOWpP9V4Whqx0/cP9UOffFiUKR22UFxX9c Fvi5CHweF11XON/taxu5iKqla2eTetUyGsdJJGPlajbiINjmUqlRKM6gG/icwfykC1he /OCw== X-Gm-Message-State: ACrzQf2SUy068SO3QuBNIGjDydE54sf32JscfKr8z3vRyPFYoW4qUiH2 r1aQIfTjRJZUiqltcXfrnJYNfA== X-Google-Smtp-Source: AMsMyM5oOoFxS2EKXFonjqhk3x8OIxrbxXsljwIAKoZi/K/SCJqMWRX+2YH61wuqXvRvi2m8t9zeOg== X-Received: by 2002:a2e:b889:0:b0:26c:22e0:71aa with SMTP id r9-20020a2eb889000000b0026c22e071aamr3188671ljp.501.1663948670392; Fri, 23 Sep 2022 08:57:50 -0700 (PDT) Received: from krzk-bin.. (78-11-189-27.static.ip.netia.com.pl. [78.11.189.27]) by smtp.gmail.com with ESMTPSA id be17-20020a056512251100b0049a4862966fsm1502286lfb.146.2022.09.23.08.57.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 08:57:49 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 4/5] slimbus: qcom-ngd-ctrl: use devm_platform_get_and_ioremap_resource() Date: Fri, 23 Sep 2022 17:57:39 +0200 Message-Id: <20220923155740.422411-4-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220923155740.422411-1-krzysztof.kozlowski@linaro.org> References: <20220923155740.422411-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Simplify the code with devm_platform_get_and_ioremap_resource(). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Neil Armstrong --- drivers/slimbus/qcom-ngd-ctrl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index cec11aa106bf..548dd7661334 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1522,7 +1522,6 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct qcom_slim_ngd_ctrl *ctrl; - struct resource *res; int ret; struct pdr_service *pds; @@ -1532,8 +1531,7 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev) dev_set_drvdata(dev, ctrl); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - ctrl->base = devm_ioremap_resource(dev, res); + ctrl->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); if (IS_ERR(ctrl->base)) return PTR_ERR(ctrl->base); From patchwork Fri Sep 23 15:57:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 608635 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D91EFC6FA82 for ; Fri, 23 Sep 2022 15:58:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232797AbiIWP65 (ORCPT ); Fri, 23 Sep 2022 11:58:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232915AbiIWP6f (ORCPT ); Fri, 23 Sep 2022 11:58:35 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02735147CE7 for ; Fri, 23 Sep 2022 08:57:53 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id a2so970095lfb.6 for ; Fri, 23 Sep 2022 08:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=oMr0u4U4uB857JftbbkRJcLFLiEsse/bULU+XmmO99c=; b=DSFhUhEI5jIJ0l79fZ/RpiMJcCABCZt41//uZqQbhGP+SMHboZlWew64YaUL1Zt6N1 WROtxtQ0pjiBJrz3Wwk+Z4gL6aQmsyhW2wZg/WwUBlp0wdev6ge4JNVSnEcEPt68091w cZGTSk4LWL3RB3uOZXbgOKMNCpVqIEBTwkJzSXYfiUAfKN96zhSkqOh2/hbanYKv6qYI kM5t9xA10/DXsmypKJulAM6TKIfLSMN67PwQ/1h6RDXckeoIKj4WEA+fnzbArU+kBCh1 bQu6GcdEMfLxrIVD5Z1e3hxwW1meD2gZDnV8/5c3YFVQeKDDeWpq9kh4UORGoymDNHE3 mSeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=oMr0u4U4uB857JftbbkRJcLFLiEsse/bULU+XmmO99c=; b=4KTTDS1K6/go18TclyQo4CsG6HBIhYVVeV0Rb+wLMzQBmGpfVJZJaWfxo9KO6+1t9P kR8faM4UVjiZh2rnlVzwQrz5za5BORiSV8Hmx1BkpWZOrcUvMlGFjpclTqG1YeMkywbL 4BUzljSlUz44/wTPaAPle9dsPxmuAV8wIcfGasG0S02NcprO5ZsbICNILAPOOP92VRms aFyh5tU0rPhXQZT8jIxnTsINUD2XYypDLEx1f2PYUHafdrRFJxC+aX5oBoezNTJHE6fo JBAK4p7q5F1LZkLgAlPudhKvfFQ2GQQ8JRnXATa1Vvaj6v0m4fkOEx86HmTKsugBVN9a hrNg== X-Gm-Message-State: ACrzQf2nsOM6Y/FqG9DWG+cLg3K3G0hvj+gvRyBBE9KDA/JKI+YVrfKA FWFB8mk+YZPXcmP3FdiohH29AYjvKrUG9g== X-Google-Smtp-Source: AMsMyM6SHmdPjbUQmqQLrTntDA+yJrodNrgqKTD0Yq6Gwj0hUWQkPwkCKVr0Q4Ko35CpEspD8KIpAw== X-Received: by 2002:a05:6512:1590:b0:49a:9db4:5a31 with SMTP id bp16-20020a056512159000b0049a9db45a31mr3367232lfb.667.1663948671660; Fri, 23 Sep 2022 08:57:51 -0700 (PDT) Received: from krzk-bin.. (78-11-189-27.static.ip.netia.com.pl. [78.11.189.27]) by smtp.gmail.com with ESMTPSA id be17-20020a056512251100b0049a4862966fsm1502286lfb.146.2022.09.23.08.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 08:57:50 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 5/5] slimbus: qcom-ngd-ctrl: reinit the reconf completion flag Date: Fri, 23 Sep 2022 17:57:40 +0200 Message-Id: <20220923155740.422411-5-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220923155740.422411-1-krzysztof.kozlowski@linaro.org> References: <20220923155740.422411-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Reinitialize the reconf completion flag when ngd registers are not retainied or when enumeration is lost for ngd. Signed-off-by: Krzysztof Kozlowski --- drivers/slimbus/qcom-ngd-ctrl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index 548dd7661334..e8ebfcd0655c 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1136,6 +1136,12 @@ static int qcom_slim_ngd_power_up(struct qcom_slim_ngd_ctrl *ctrl) return 0; } + /* + * Reinitialize only when registers are not retained or when enumeration + * is lost for ngd. + */ + reinit_completion(&ctrl->reconf); + writel_relaxed(DEF_NGD_INT_MASK, ngd->base + NGD_INT_EN); rx_msgq = readl_relaxed(ngd->base + NGD_RX_MSGQ_CFG);