From nobody Wed Apr 15 02:41:09 2026 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 E0441C19F29 for ; Wed, 27 Jul 2022 09:06:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229964AbiG0JGB (ORCPT ); Wed, 27 Jul 2022 05:06:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229544AbiG0JFz (ORCPT ); Wed, 27 Jul 2022 05:05:55 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C454243337 for ; Wed, 27 Jul 2022 02:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1658912755; x=1690448755; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NVXOybPJqEwP6MHqK15Tsb+Wcp2uLtsdOnoZ40Pv0zw=; b=yYE3dqHv1/Kum2eHQxutk0Qgp8BmQaJVVmiPtt/6E9XtIfkKa0OEPWkt iFsD/zhNyaLJfdA3NBFLaoM2KpfQ6wYi1Vn6ehSI9LRrMDltIHeBIRNqR L+DyWuPdSjhdSbCtjnYyDueG51FvhssS28yyhJm8ZMNsXpqwiTBhNIBt2 Qzh8Mn3SdE8nFRyNtWrRTUrogHvsUz7rd0U2zAljWdX7vs4i10VQlc1PB Dv+aNRgr5fvcWa9vnYGIdfMonyatxKD/N/V+4UbmUs8C4LFcgjRjlW9Xp hSGF7DhDox91GTagpnBC48MugeOhWCZV9RAkMNEYFojg7/snTAaSdpqN8 A==; X-IronPort-AV: E=Sophos;i="5.93,195,1654585200"; d="scan'208";a="183930488" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Jul 2022 02:05:54 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 27 Jul 2022 02:05:53 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Wed, 27 Jul 2022 02:05:51 -0700 From: Claudiu Beznea To: , , , , , CC: , , , Claudiu Beznea Subject: [PATCH v3 1/2] ASoC: mchp-spdifrx: disable end of block interrupt on failures Date: Wed, 27 Jul 2022 12:08:13 +0300 Message-ID: <20220727090814.2446111-2-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220727090814.2446111-1-claudiu.beznea@microchip.com> References: <20220727090814.2446111-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Disable end of block interrupt in case of wait for completion timeout or errors to undo previously enable operation (done in mchp_spdifrx_isr_blockend_en()). Otherwise we can end up with an unbalanced reference counter for this interrupt. Fixes: ef265c55c1ac ("ASoC: mchp-spdifrx: add driver for SPDIF RX") Signed-off-by: Claudiu Beznea --- sound/soc/atmel/mchp-spdifrx.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sound/soc/atmel/mchp-spdifrx.c b/sound/soc/atmel/mchp-spdifrx.c index 85d1d92a21db..ec0705cc40fa 100644 --- a/sound/soc/atmel/mchp-spdifrx.c +++ b/sound/soc/atmel/mchp-spdifrx.c @@ -288,15 +288,17 @@ static void mchp_spdifrx_isr_blockend_en(struct mchp_= spdifrx_dev *dev) spin_unlock_irqrestore(&dev->blockend_lock, flags); } =20 -/* called from atomic context only */ +/* called from atomic/non-atomic context */ static void mchp_spdifrx_isr_blockend_dis(struct mchp_spdifrx_dev *dev) { - spin_lock(&dev->blockend_lock); + unsigned long flags; + + spin_lock_irqsave(&dev->blockend_lock, flags); dev->blockend_refcount--; /* don't enable BLOCKEND interrupt if it's already enabled */ if (dev->blockend_refcount =3D=3D 0) regmap_write(dev->regmap, SPDIFRX_IDR, SPDIFRX_IR_BLOCKEND); - spin_unlock(&dev->blockend_lock); + spin_unlock_irqrestore(&dev->blockend_lock, flags); } =20 static irqreturn_t mchp_spdif_interrupt(int irq, void *dev_id) @@ -575,6 +577,7 @@ static int mchp_spdifrx_subcode_ch_get(struct mchp_spdi= frx_dev *dev, if (ret <=3D 0) { dev_dbg(dev->dev, "user data for channel %d timeout\n", channel); + mchp_spdifrx_isr_blockend_dis(dev); return ret; } =20 --=20 2.34.1 From nobody Wed Apr 15 02:41:09 2026 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 3008CC04A68 for ; Wed, 27 Jul 2022 09:06:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230314AbiG0JGG (ORCPT ); Wed, 27 Jul 2022 05:06:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbiG0JF6 (ORCPT ); Wed, 27 Jul 2022 05:05:58 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99ACF4333D for ; Wed, 27 Jul 2022 02:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1658912757; x=1690448757; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CIUopwxdZIlwqjXMsHY6dSEUUehkgUCOaiTv2Ru/m5M=; b=Xn+4mlvMguuQUXijWrHjsZSnnvXbR57GoS/g/+E6R7o3w0+ZmZ5Ozo9v fMo2Wlqkz6ktxAtaanfHhhvXpztqFWsRVYTw6Ox2NJXezXTYQtG+HN9eV Q2OizPhtN1DZs3ydwEvo4fdEvq1CoUj9NWdQ/HtQMcuOGH+8YEKi+igdl +fVzlWUdIJLl+SmuH5rgTR2cyW+wXKffhOdKUMpml1cHumCX8qzg39k8b mSByFyA8QXokn+l1YZidGBnrJUMOsmCCR7kxwddo4YqlHElZ5a/Fpg7Qd U2R2vz5y+EOO2gCRM9im8zgRRGbAFi6Un8xh2D0NGoEKSwUnt9wIlds6G w==; X-IronPort-AV: E=Sophos;i="5.93,195,1654585200"; d="scan'208";a="169710970" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Jul 2022 02:05:56 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 27 Jul 2022 02:05:56 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Wed, 27 Jul 2022 02:05:54 -0700 From: Claudiu Beznea To: , , , , , CC: , , , Claudiu Beznea Subject: [PATCH v3 2/2] ASoC: mchp-spdiftx: remove references to mchp_i2s_caps Date: Wed, 27 Jul 2022 12:08:14 +0300 Message-ID: <20220727090814.2446111-3-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220727090814.2446111-1-claudiu.beznea@microchip.com> References: <20220727090814.2446111-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Remove references to struct mchp_i2s_caps as they are not used. Signed-off-by: Claudiu Beznea --- sound/soc/atmel/mchp-spdiftx.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sound/soc/atmel/mchp-spdiftx.c b/sound/soc/atmel/mchp-spdiftx.c index cb4d0140dfe0..4850a177803d 100644 --- a/sound/soc/atmel/mchp-spdiftx.c +++ b/sound/soc/atmel/mchp-spdiftx.c @@ -196,7 +196,6 @@ struct mchp_spdiftx_dev { struct clk *pclk; struct clk *gclk; unsigned int fmt; - const struct mchp_i2s_caps *caps; int gclk_enabled:1; }; =20 @@ -765,8 +764,6 @@ MODULE_DEVICE_TABLE(of, mchp_spdiftx_dt_ids); =20 static int mchp_spdiftx_probe(struct platform_device *pdev) { - struct device_node *np =3D pdev->dev.of_node; - const struct of_device_id *match; struct mchp_spdiftx_dev *dev; struct resource *mem; struct regmap *regmap; @@ -780,11 +777,6 @@ static int mchp_spdiftx_probe(struct platform_device *= pdev) if (!dev) return -ENOMEM; =20 - /* Get hardware capabilities. */ - match =3D of_match_node(mchp_spdiftx_dt_ids, np); - if (match) - dev->caps =3D match->data; - /* Map I/O registers. */ base =3D devm_platform_get_and_ioremap_resource(pdev, 0, &mem); if (IS_ERR(base)) --=20 2.34.1