From patchwork Fri Jul 28 11:28:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13331735 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04D96C00528 for ; Fri, 28 Jul 2023 11:30:50 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 77F2F83E; Fri, 28 Jul 2023 13:29:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 77F2F83E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690543847; bh=Pd039UjLSgfEOIJ6mOul7cpS/BFBpKy1AjDe6AZ0SWc=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=b7+mn5pTp59c8ExClyt3DakCSBx0NRPPMpNitDdgx40Zfdbv8QZK0M/Ln4PUOu2vd Y9zfOZ/fO/rJiPWj1GbX13rTvgHH+x/ucbm3iiSKlcGYaG1A52MSkvvIx4U5OcDpdA gA/C6aDfIxxgnX3FXbBSUfaAo0MXB9IfRKBYR0gs= Received: by alsa1.perex.cz (Postfix, from userid 50401) id F0036F80544; Fri, 28 Jul 2023 13:29:06 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 8AD8CF80551; Fri, 28 Jul 2023 13:29:06 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 197EEF8019B; Fri, 28 Jul 2023 13:29:03 +0200 (CEST) Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EBDD1F800C7 for ; Fri, 28 Jul 2023 13:28:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EBDD1F800C7 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=bOkI9D8d Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fbc77e76abso20239475e9.1 for ; Fri, 28 Jul 2023 04:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690543731; x=1691148531; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=BQ34vB3coODdnCqDRzNfJbwKt6237pIU9W1p9j3eoLQ=; b=bOkI9D8dNzJpn9aOYEnooCIj1cr2YtJDjjbFmyJvdCWIILWwPhp3mgLj6I3/vayjFC wm93ZBG78NEwwxCQWagNXxT98EUSP1Kmvy5PwxiJdEnbrPE4FGZBcFgXP0Yr7sOkbsnb NsHP1lST+OyJwaINFmtQOPSJcjS3xHQgvfSeVcfwOCnke2d7tDVwoqTjEGxlCd8hh0+w 7sNLdIkAcxXjGUtlPX+twW7fjeEhGre1tWsekg9KAjwPfjFP8Kkp849K/We9epd30M4b VN6K4Z99oOCGYx0jhqtjxrRwiv7sTEmRPuQTWKB+1Qj0bzWcL367ad9bgsczm97PCDuQ y/+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690543731; x=1691148531; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BQ34vB3coODdnCqDRzNfJbwKt6237pIU9W1p9j3eoLQ=; b=Sys2bN/z6n6GdC4MrFgEP7aa0YUCk7CYxf0ENpQ0RiiIUjRs6UPtQpciFra5vhCJ7z 91HqfFnE7W79uw+Z7vPLhV9g50y3wuPVxaxK60q/EI8fdH2WlsiEbvm/Uvjm1BNwXjDt DcWW8AhX6kn914JZPcum8JZB0y9YfHOULGvfUP7wLoeEiaNtYxmWmy24HdXMEflYGtqe k4VyCQJaCwl8XHQKvuV7GOA7U415BLBeF7pSPU30fpxA9QUwpOYnwOL/tcSX7X38KEwX chrU5RLoK0LCpFqOz5FYLzeeNi8+fSah2eKpVl0Bsovw2+Ol/hctf8pXuiVdCE5+/Te9 bm0Q== X-Gm-Message-State: ABy/qLZ9SwwtKe4zOLatEfOVUnnjd9Fh52SedFVwf4mI4vWDJgYc0Exh IZxQHZ3biXU0r2upw4/jwp1Kfw== X-Google-Smtp-Source: APBJJlHXUGNVhjNXkYvUnBfA5cPneRuKYRGzxZjx6jl9lNQLLXcdU37HddGAzCimNmmjr1yI9PQOkw== X-Received: by 2002:a05:600c:2208:b0:3fc:a49:4c05 with SMTP id z8-20020a05600c220800b003fc0a494c05mr1355381wml.40.1690543731305; Fri, 28 Jul 2023 04:28:51 -0700 (PDT) Received: from krzk-bin.. ([178.197.223.104]) by smtp.gmail.com with ESMTPSA id q10-20020a1cf30a000000b003fbb618f7adsm4011911wmq.15.2023.07.28.04.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 04:28:50 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Bard Liao , Pierre-Louis Bossart , Sanyog Kale , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 1/2] soundwire: qcom: use newer link status tregister on v2.0.0 Date: Fri, 28 Jul 2023 13:28:47 +0200 Message-Id: <20230728112848.67092-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Message-ID-Hash: P2D2Q6PLT6HFRLUJHW54UWTOASSFGB7D X-Message-ID-Hash: P2D2Q6PLT6HFRLUJHW54UWTOASSFGB7D X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Soundwire v2.0.0 comes with a new register LINK_STATUS for the FRAME_GEN_ENABLED field (bit indicating that an active frame is running). The old register COMP_STATUS is still there and still works, although the new one is preferred in downstream sources. Probably because it allows to choose Soundwire instance per CPU. Most of the code allowing to use new register for Soundwire v2.0.0 was already there as part of commit 312355a6a9f6 ("soundwire: qcom: add support for v2.0.0 controller"), so switch to it in swrm_wait_for_frame_gen_enabled() function. This should not have functional impact, because the old register still behaves correctly. Signed-off-by: Krzysztof Kozlowski --- drivers/soundwire/qcom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index f8fd2eb4a2bb..3ae3e5896308 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -817,8 +817,8 @@ static bool swrm_wait_for_frame_gen_enabled(struct qcom_swrm_ctrl *ctrl) int comp_sts; do { - ctrl->reg_read(ctrl, SWRM_COMP_STATUS, &comp_sts); - + ctrl->reg_read(ctrl, ctrl->reg_layout[SWRM_REG_FRAME_GEN_ENABLED], + &comp_sts); if (comp_sts & SWRM_FRM_GEN_ENABLED) return true; From patchwork Fri Jul 28 11:28:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13331734 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86224C0015E for ; Fri, 28 Jul 2023 11:30:05 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E7528827; Fri, 28 Jul 2023 13:29:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E7528827 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690543803; bh=RutGFLL00nwxj/1qF/OsAfHR18eTjgSNwXfD/wWVVHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=RldWswcDqfAAZX0eb7Yp6lovlGkOzotZJQMy85bmo2hVt10rKzFTq89J4HmkWSnw4 FATckXJJF/WdseX+NTmJ+rsjFdRm+MjqdIr+legfZOM/Tj6PuCh2u/IvYnOOyJrHRw 3lis1+gSkh71h7Nb6yX8UF7LQ5RFrB0fGeV5cml0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 75B37F80535; Fri, 28 Jul 2023 13:29:06 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id F4011F800C7; Fri, 28 Jul 2023 13:29:05 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C7895F801F5; Fri, 28 Jul 2023 13:29:00 +0200 (CEST) Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BB1BCF80153 for ; Fri, 28 Jul 2023 13:28:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BB1BCF80153 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=S9h7ZBuC Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4fbb281eec6so3472436e87.1 for ; Fri, 28 Jul 2023 04:28:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690543733; x=1691148533; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K2Jmh76fX0cC8X5svQlpl0lqLBg/8T7Qn+TkbmMn87g=; b=S9h7ZBuCSi0Nut2p7zcsCvS49l7LMk2fQUD6ZCtk3vzETaAV/v/RbDrvVLeqW6KtKX dFAfEfF+YpNY7jutfP9MhLts8g94NsTU2yWUwRGiZDREjalRpF72DjJUPD87fuXOvpek db6axTaetmJVobJsOdNh5bVSpdIJv91xiwvfV/QM5cj6DSoRqW9bFjMI00ROFMcbfYXY gmuy4+XDI8AEPi445GKoex3AnU7NMRn2YNVDHokT7AK2CgHmvAvEFOtcnQepRhBqzCta JyO8cCRAr/7b6jIOi5nrjAtbUjeYzzvLQfXIf+AXNlV++0sKT1rDq/R7UI5nDKpfy64n uuWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690543733; x=1691148533; 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:message-id:reply-to; bh=K2Jmh76fX0cC8X5svQlpl0lqLBg/8T7Qn+TkbmMn87g=; b=WSH3Wv7kO8hW96IqH+2ttl6yy0uxLJM7ZU8THwMJXL4RHwVKhhAbvzIr0WyCtxHFim 47X3mOjtenSNdYtneJUrAfGij6Jr+2bZbDMCNObIQJd2vUvIqMCHqZsXYYVdb/X4084x xBH8oED76ekwf9CxR096YQnJ0VGjqAeFVAyUIf0TGEKpqebdTSpVm0p4E76EKPOEmC+9 iM5Iou3pdb0o6cGSsZvIn+F8aANpceMMuKbqE2GI4d8aOhROl4rtkz6O7syV3d9qhXVM 9evkMw67XWbc8D5pXvgl3/Jj/iOC0BgXuaNbfpijcJcZduL0PcLD3a2IGEf3IGL5zCSL xSiQ== X-Gm-Message-State: ABy/qLa4ACytn8+hMx03zyJr3aMVBpQEk6CYJNgZ3PCtXPvGmvB/fWQE OyCNKwXDmTEwfqEu9Fy1sYh/eQ== X-Google-Smtp-Source: APBJJlE8LHHYDebc1KhpOSqEnYawJSpwTyAliGv5Ek3/yrFTWhjeqVKhn92X3qglPd/utyr8ietUhA== X-Received: by 2002:a05:6512:348f:b0:4fb:8616:7a03 with SMTP id v15-20020a056512348f00b004fb86167a03mr1331586lfr.4.1690543733205; Fri, 28 Jul 2023 04:28:53 -0700 (PDT) Received: from krzk-bin.. ([178.197.223.104]) by smtp.gmail.com with ESMTPSA id q10-20020a1cf30a000000b003fbb618f7adsm4011911wmq.15.2023.07.28.04.28.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 04:28:52 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Bard Liao , Pierre-Louis Bossart , Sanyog Kale , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 2/2] soundwire: qcom: handle command ignored interrupt Date: Fri, 28 Jul 2023 13:28:48 +0200 Message-Id: <20230728112848.67092-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230728112848.67092-1-krzysztof.kozlowski@linaro.org> References: <20230728112848.67092-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: MMKVQDEYGYPGIYFYKBGO5Z75QSRO6CRI X-Message-ID-Hash: MMKVQDEYGYPGIYFYKBGO5Z75QSRO6CRI X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Qualcomm Soundwire v2.0.0 controller comes with new interrupt bit for ignored commands. Add code to handle it in the interrupt service routine. Signed-off-by: Krzysztof Kozlowski --- drivers/soundwire/qcom.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index 3ae3e5896308..3061db6adac7 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -61,6 +61,7 @@ #define SWRM_INTERRUPT_STATUS_BUS_RESET_FINISHED_V2 BIT(13) #define SWRM_INTERRUPT_STATUS_CLK_STOP_FINISHED_V2 BIT(14) #define SWRM_INTERRUPT_STATUS_EXT_CLK_STOP_WAKEUP BIT(16) +#define SWRM_INTERRUPT_STATUS_CMD_IGNORED_AND_EXEC_CONTINUED BIT(19) #define SWRM_INTERRUPT_MAX 17 #define SWRM_V1_3_INTERRUPT_MASK_ADDR 0x204 #define SWRM_V1_3_INTERRUPT_CLEAR 0x208 @@ -792,6 +793,17 @@ static irqreturn_t qcom_swrm_irq_handler(int irq, void *dev_id) break; case SWRM_INTERRUPT_STATUS_EXT_CLK_STOP_WAKEUP: break; + case SWRM_INTERRUPT_STATUS_CMD_IGNORED_AND_EXEC_CONTINUED: + ctrl->reg_read(ctrl, + ctrl->reg_layout[SWRM_REG_CMD_FIFO_STATUS], + &value); + dev_err(ctrl->dev, + "%s: SWR CMD ignored, fifo status %x\n", + __func__, value); + + /* Wait 3.5ms to clear */ + usleep_range(3500, 3505); + break; default: dev_err_ratelimited(ctrl->dev, "%s: SWR unknown interrupt value: %d\n",