* [PATCH v3 0/2] ASoC: atmel: one fix and one cleanup
@ 2022-07-27 9:08 ` Claudiu Beznea
0 siblings, 0 replies; 12+ messages in thread
From: Claudiu Beznea @ 2022-07-27 9:08 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai, nicolas.ferre, alexandre.belloni
Cc: alsa-devel, linux-arm-kernel, linux-kernel, Claudiu Beznea
Hi,
The series adds one fix for mchp-spdifrx and one cleanups for
mchp-spdifrx and mchp-spdifrx drivers.
Thank you,
Claudiu Beznea
Changes in v3:
- changed cover letter title s/few/one, s/cleanups/cleanup
- fix compilation error and warnings
- keep only patch 1/5 and patch 3/5 from previous version as the rest
of them were integrated
Changes in v2:
- s/tag/tab in the title of patch 2/5
Claudiu Beznea (2):
ASoC: mchp-spdifrx: disable end of block interrupt on failures
ASoC: mchp-spdiftx: remove references to mchp_i2s_caps
sound/soc/atmel/mchp-spdifrx.c | 9 ++++++---
sound/soc/atmel/mchp-spdiftx.c | 8 --------
2 files changed, 6 insertions(+), 11 deletions(-)
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3 0/2] ASoC: atmel: one fix and one cleanup
@ 2022-07-27 9:08 ` Claudiu Beznea
0 siblings, 0 replies; 12+ messages in thread
From: Claudiu Beznea @ 2022-07-27 9:08 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai, nicolas.ferre, alexandre.belloni
Cc: alsa-devel, linux-kernel, linux-arm-kernel, Claudiu Beznea
Hi,
The series adds one fix for mchp-spdifrx and one cleanups for
mchp-spdifrx and mchp-spdifrx drivers.
Thank you,
Claudiu Beznea
Changes in v3:
- changed cover letter title s/few/one, s/cleanups/cleanup
- fix compilation error and warnings
- keep only patch 1/5 and patch 3/5 from previous version as the rest
of them were integrated
Changes in v2:
- s/tag/tab in the title of patch 2/5
Claudiu Beznea (2):
ASoC: mchp-spdifrx: disable end of block interrupt on failures
ASoC: mchp-spdiftx: remove references to mchp_i2s_caps
sound/soc/atmel/mchp-spdifrx.c | 9 ++++++---
sound/soc/atmel/mchp-spdiftx.c | 8 --------
2 files changed, 6 insertions(+), 11 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3 1/2] ASoC: mchp-spdifrx: disable end of block interrupt on failures
2022-07-27 9:08 ` Claudiu Beznea
(?)
@ 2022-07-27 9:08 ` Claudiu Beznea
-1 siblings, 0 replies; 12+ messages in thread
From: Claudiu Beznea @ 2022-07-27 9:08 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai, nicolas.ferre, alexandre.belloni
Cc: alsa-devel, linux-arm-kernel, linux-kernel, Claudiu Beznea
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 <claudiu.beznea@microchip.com>
---
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);
}
-/* 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 == 0)
regmap_write(dev->regmap, SPDIFRX_IDR, SPDIFRX_IR_BLOCKEND);
- spin_unlock(&dev->blockend_lock);
+ spin_unlock_irqrestore(&dev->blockend_lock, flags);
}
static irqreturn_t mchp_spdif_interrupt(int irq, void *dev_id)
@@ -575,6 +577,7 @@ static int mchp_spdifrx_subcode_ch_get(struct mchp_spdifrx_dev *dev,
if (ret <= 0) {
dev_dbg(dev->dev, "user data for channel %d timeout\n",
channel);
+ mchp_spdifrx_isr_blockend_dis(dev);
return ret;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 1/2] ASoC: mchp-spdifrx: disable end of block interrupt on failures
@ 2022-07-27 9:08 ` Claudiu Beznea
0 siblings, 0 replies; 12+ messages in thread
From: Claudiu Beznea @ 2022-07-27 9:08 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai, nicolas.ferre, alexandre.belloni
Cc: alsa-devel, linux-arm-kernel, linux-kernel, Claudiu Beznea
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 <claudiu.beznea@microchip.com>
---
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);
}
-/* 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 == 0)
regmap_write(dev->regmap, SPDIFRX_IDR, SPDIFRX_IR_BLOCKEND);
- spin_unlock(&dev->blockend_lock);
+ spin_unlock_irqrestore(&dev->blockend_lock, flags);
}
static irqreturn_t mchp_spdif_interrupt(int irq, void *dev_id)
@@ -575,6 +577,7 @@ static int mchp_spdifrx_subcode_ch_get(struct mchp_spdifrx_dev *dev,
if (ret <= 0) {
dev_dbg(dev->dev, "user data for channel %d timeout\n",
channel);
+ mchp_spdifrx_isr_blockend_dis(dev);
return ret;
}
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 1/2] ASoC: mchp-spdifrx: disable end of block interrupt on failures
@ 2022-07-27 9:08 ` Claudiu Beznea
0 siblings, 0 replies; 12+ messages in thread
From: Claudiu Beznea @ 2022-07-27 9:08 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai, nicolas.ferre, alexandre.belloni
Cc: alsa-devel, linux-kernel, linux-arm-kernel, Claudiu Beznea
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 <claudiu.beznea@microchip.com>
---
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);
}
-/* 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 == 0)
regmap_write(dev->regmap, SPDIFRX_IDR, SPDIFRX_IR_BLOCKEND);
- spin_unlock(&dev->blockend_lock);
+ spin_unlock_irqrestore(&dev->blockend_lock, flags);
}
static irqreturn_t mchp_spdif_interrupt(int irq, void *dev_id)
@@ -575,6 +577,7 @@ static int mchp_spdifrx_subcode_ch_get(struct mchp_spdifrx_dev *dev,
if (ret <= 0) {
dev_dbg(dev->dev, "user data for channel %d timeout\n",
channel);
+ mchp_spdifrx_isr_blockend_dis(dev);
return ret;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 2/2] ASoC: mchp-spdiftx: remove references to mchp_i2s_caps
2022-07-27 9:08 ` Claudiu Beznea
(?)
@ 2022-07-27 9:08 ` Claudiu Beznea
-1 siblings, 0 replies; 12+ messages in thread
From: Claudiu Beznea @ 2022-07-27 9:08 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai, nicolas.ferre, alexandre.belloni
Cc: alsa-devel, linux-arm-kernel, linux-kernel, Claudiu Beznea
Remove references to struct mchp_i2s_caps as they are not used.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
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;
};
@@ -765,8 +764,6 @@ MODULE_DEVICE_TABLE(of, mchp_spdiftx_dt_ids);
static int mchp_spdiftx_probe(struct platform_device *pdev)
{
- struct device_node *np = 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;
- /* Get hardware capabilities. */
- match = of_match_node(mchp_spdiftx_dt_ids, np);
- if (match)
- dev->caps = match->data;
-
/* Map I/O registers. */
base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
if (IS_ERR(base))
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 2/2] ASoC: mchp-spdiftx: remove references to mchp_i2s_caps
@ 2022-07-27 9:08 ` Claudiu Beznea
0 siblings, 0 replies; 12+ messages in thread
From: Claudiu Beznea @ 2022-07-27 9:08 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai, nicolas.ferre, alexandre.belloni
Cc: alsa-devel, linux-arm-kernel, linux-kernel, Claudiu Beznea
Remove references to struct mchp_i2s_caps as they are not used.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
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;
};
@@ -765,8 +764,6 @@ MODULE_DEVICE_TABLE(of, mchp_spdiftx_dt_ids);
static int mchp_spdiftx_probe(struct platform_device *pdev)
{
- struct device_node *np = 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;
- /* Get hardware capabilities. */
- match = of_match_node(mchp_spdiftx_dt_ids, np);
- if (match)
- dev->caps = match->data;
-
/* Map I/O registers. */
base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
if (IS_ERR(base))
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v3 2/2] ASoC: mchp-spdiftx: remove references to mchp_i2s_caps
@ 2022-07-27 9:08 ` Claudiu Beznea
0 siblings, 0 replies; 12+ messages in thread
From: Claudiu Beznea @ 2022-07-27 9:08 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai, nicolas.ferre, alexandre.belloni
Cc: alsa-devel, linux-kernel, linux-arm-kernel, Claudiu Beznea
Remove references to struct mchp_i2s_caps as they are not used.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
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;
};
@@ -765,8 +764,6 @@ MODULE_DEVICE_TABLE(of, mchp_spdiftx_dt_ids);
static int mchp_spdiftx_probe(struct platform_device *pdev)
{
- struct device_node *np = 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;
- /* Get hardware capabilities. */
- match = of_match_node(mchp_spdiftx_dt_ids, np);
- if (match)
- dev->caps = match->data;
-
/* Map I/O registers. */
base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
if (IS_ERR(base))
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v3 0/2] ASoC: atmel: one fix and one cleanup
2022-07-27 9:08 ` Claudiu Beznea
(?)
@ 2022-07-28 0:22 ` Mark Brown
-1 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2022-07-28 0:22 UTC (permalink / raw)
To: perex, lgirdwood, Claudiu Beznea, tiwai, nicolas.ferre,
alexandre.belloni
Cc: linux-arm-kernel, alsa-devel, linux-kernel
On Wed, 27 Jul 2022 12:08:12 +0300, Claudiu Beznea wrote:
> The series adds one fix for mchp-spdifrx and one cleanups for
> mchp-spdifrx and mchp-spdifrx drivers.
>
> Thank you,
> Claudiu Beznea
>
> Changes in v3:
> - changed cover letter title s/few/one, s/cleanups/cleanup
> - fix compilation error and warnings
> - keep only patch 1/5 and patch 3/5 from previous version as the rest
> of them were integrated
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] ASoC: mchp-spdifrx: disable end of block interrupt on failures
commit: 768ac4f12ca0fda935f58eb8c5120e9d795bc6e3
[2/2] ASoC: mchp-spdiftx: remove references to mchp_i2s_caps
commit: 403fcb5118a0f4091001a537e76923031fb45eaf
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 0/2] ASoC: atmel: one fix and one cleanup
@ 2022-07-28 0:22 ` Mark Brown
0 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2022-07-28 0:22 UTC (permalink / raw)
To: perex, lgirdwood, Claudiu Beznea, tiwai, nicolas.ferre,
alexandre.belloni
Cc: linux-arm-kernel, alsa-devel, linux-kernel
On Wed, 27 Jul 2022 12:08:12 +0300, Claudiu Beznea wrote:
> The series adds one fix for mchp-spdifrx and one cleanups for
> mchp-spdifrx and mchp-spdifrx drivers.
>
> Thank you,
> Claudiu Beznea
>
> Changes in v3:
> - changed cover letter title s/few/one, s/cleanups/cleanup
> - fix compilation error and warnings
> - keep only patch 1/5 and patch 3/5 from previous version as the rest
> of them were integrated
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] ASoC: mchp-spdifrx: disable end of block interrupt on failures
commit: 768ac4f12ca0fda935f58eb8c5120e9d795bc6e3
[2/2] ASoC: mchp-spdiftx: remove references to mchp_i2s_caps
commit: 403fcb5118a0f4091001a537e76923031fb45eaf
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v3 0/2] ASoC: atmel: one fix and one cleanup
@ 2022-07-28 0:22 ` Mark Brown
0 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2022-07-28 0:22 UTC (permalink / raw)
To: perex, lgirdwood, Claudiu Beznea, tiwai, nicolas.ferre,
alexandre.belloni
Cc: alsa-devel, linux-kernel, linux-arm-kernel
On Wed, 27 Jul 2022 12:08:12 +0300, Claudiu Beznea wrote:
> The series adds one fix for mchp-spdifrx and one cleanups for
> mchp-spdifrx and mchp-spdifrx drivers.
>
> Thank you,
> Claudiu Beznea
>
> Changes in v3:
> - changed cover letter title s/few/one, s/cleanups/cleanup
> - fix compilation error and warnings
> - keep only patch 1/5 and patch 3/5 from previous version as the rest
> of them were integrated
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] ASoC: mchp-spdifrx: disable end of block interrupt on failures
commit: 768ac4f12ca0fda935f58eb8c5120e9d795bc6e3
[2/2] ASoC: mchp-spdiftx: remove references to mchp_i2s_caps
commit: 403fcb5118a0f4091001a537e76923031fb45eaf
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 12+ messages in thread