ASoC: rsnd: add interrupt support for SSI BUSIF buffer
Subsystems (3)
PATCH 1/1 ASoC: rsnd: add interrupt support for SSI BUSIF buffer
SSI BUSIF buffer is possible to overflow or underflow, especially in a hypervisor environment. If there is no interrupt support, it will eventually lead to errors in pcm data.
This patch adds overflow and underflow interrupt support for SSI BUSIF buffer.
Changes since v0 (thanks for the feedback Morimoto):
- Replace the value of a register variable
--- sound/soc/sh/rcar/gen.c | 8 +++ sound/soc/sh/rcar/rsnd.h | 9 +++ sound/soc/sh/rcar/ssi.c | 142 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 159 insertions(+)
sound/soc/sh/rcar/gen.c +8 -0
@@ -224,6 +224,14 @@ static int rsnd_gen2_probe(struct rsnd_priv *priv)RSND_GEN_S_REG (SSI_SYS_STATUS5 ,0x884 ),RSND_GEN_S_REG (SSI_SYS_STATUS6 ,0x888 ),RSND_GEN_S_REG (SSI_SYS_STATUS7 ,0x88c ), +RSND_GEN_S_REG (SSI_SYS_INT_ENABLE0 ,0x850 ), +RSND_GEN_S_REG (SSI_SYS_INT_ENABLE1 ,0x854 ), +RSND_GEN_S_REG (SSI_SYS_INT_ENABLE2 ,0x858 ), +RSND_GEN_S_REG (SSI_SYS_INT_ENABLE3 ,0x85c ), +RSND_GEN_S_REG (SSI_SYS_INT_ENABLE4 ,0x890 ), +RSND_GEN_S_REG (SSI_SYS_INT_ENABLE5 ,0x894 ), +RSND_GEN_S_REG (SSI_SYS_INT_ENABLE6 ,0x898 ), +RSND_GEN_S_REG (SSI_SYS_INT_ENABLE7 ,0x89c ),RSND_GEN_S_REG (HDMI0_SEL ,0x9e0 ), RSND_GEN_S_REG(HDMI1_SEL, 0x9e4),
sound/soc/sh/rcar/rsnd.h +9 -0
@@ -189,6 +189,14 @@ enum rsnd_reg {SSI_SYS_STATUS5 ,SSI_SYS_STATUS6 ,SSI_SYS_STATUS7 , +SSI_SYS_INT_ENABLE0 , +SSI_SYS_INT_ENABLE1 , +SSI_SYS_INT_ENABLE2 , +SSI_SYS_INT_ENABLE3 , +SSI_SYS_INT_ENABLE4 , +SSI_SYS_INT_ENABLE5 , +SSI_SYS_INT_ENABLE6 , +SSI_SYS_INT_ENABLE7 ,HDMI0_SEL ,HDMI1_SEL , SSI9_BUSIF0_MODE,
@@ -237,6 +245,7 @@ enum rsnd_reg {#define SSI9_BUSIF_ADINR (i) (SSI9_BUSIF0_ADINR + (i))#define SSI9_BUSIF_DALIGN (i) (SSI9_BUSIF0_DALIGN + (i))#define SSI_SYS_STATUS (i) (SSI_SYS_STATUS0 + (i)) +#define SSI_SYS_INT_ENABLE (i) (SSI_SYS_INT_ENABLE0 + (i))struct rsnd_priv ;
sound/soc/sh/rcar/ssi.c +142 -0
190 lines not on this page · raw message
Signature · 1 line
2.26.2
Mark Brown
maintainerQuoted 4 lines · Yongbo Zhang
SSI BUSIF buffer is possible to overflow or underflow, especially in a hypervisor environment. If there is no interrupt support, it will eventually lead to errors in pcm data.
This patch adds overflow and underflow interrupt support for SSI BUSIF buffer.
This introduces loads of build errors on for-5.8 with an x86 allmodconfig:
/mnt/kernel/sound/soc/sh/rcar/ssi.c: In function 'rsnd_ssi_quit':/mnt/kernel/sound/soc/sh/rcar/ssi.c:596:12: error: invalid storage class for function 'rsnd_ssi_hw_params'
static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
^~~~~~~~~~~~~~~~~~
/mnt/kernel/sound/soc/sh/rcar/ssi.c:596:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
^~~~~~
and so on for ages. Probably just needs a rebase I guess?
PATCH v2 1/1 SoC: rsnd: add interrupt support for SSI BUSIF buffer
SSI BUSIF buffer is possible to overflow or underflow, especially in a hypervisor environment. If there is no interrupt support, it will eventually lead to errors in pcm data.
This patch adds overflow and underflow interrupt support for SSI BUSIF buffer.
Changes since v1:
- Fix build errors for sound/soc/sh/rcar/ssi.c
Changes since v0 (thanks for the feedback Morimoto):
- Replace the value of a register variable
--- sound/soc/sh/rcar/gen.c | 8 +++ sound/soc/sh/rcar/rsnd.h | 9 +++ sound/soc/sh/rcar/ssi.c | 145 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 162 insertions(+)
sound/soc/sh/rcar/gen.c +8 -0
@@ -224,6 +224,14 @@ static int rsnd_gen2_probe(struct rsnd_priv *priv)RSND_GEN_S_REG (SSI_SYS_STATUS5 ,0x884 ),RSND_GEN_S_REG (SSI_SYS_STATUS6 ,0x888 ),RSND_GEN_S_REG (SSI_SYS_STATUS7 ,0x88c ), +RSND_GEN_S_REG (SSI_SYS_INT_ENABLE0 ,0x850 ), +RSND_GEN_S_REG (SSI_SYS_INT_ENABLE1 ,0x854 ), +RSND_GEN_S_REG (SSI_SYS_INT_ENABLE2 ,0x858 ), +RSND_GEN_S_REG (SSI_SYS_INT_ENABLE3 ,0x85c ), +RSND_GEN_S_REG (SSI_SYS_INT_ENABLE4 ,0x890 ), +RSND_GEN_S_REG (SSI_SYS_INT_ENABLE5 ,0x894 ), +RSND_GEN_S_REG (SSI_SYS_INT_ENABLE6 ,0x898 ), +RSND_GEN_S_REG (SSI_SYS_INT_ENABLE7 ,0x89c ),RSND_GEN_S_REG (HDMI0_SEL ,0x9e0 ), RSND_GEN_S_REG(HDMI1_SEL, 0x9e4),
sound/soc/sh/rcar/rsnd.h +9 -0
@@ -189,6 +189,14 @@ enum rsnd_reg {SSI_SYS_STATUS5 ,SSI_SYS_STATUS6 ,SSI_SYS_STATUS7 , +SSI_SYS_INT_ENABLE0 , +SSI_SYS_INT_ENABLE1 , +SSI_SYS_INT_ENABLE2 , +SSI_SYS_INT_ENABLE3 , +SSI_SYS_INT_ENABLE4 , +SSI_SYS_INT_ENABLE5 , +SSI_SYS_INT_ENABLE6 , +SSI_SYS_INT_ENABLE7 ,HDMI0_SEL ,HDMI1_SEL , SSI9_BUSIF0_MODE,
@@ -237,6 +245,7 @@ enum rsnd_reg {#define SSI9_BUSIF_ADINR (i) (SSI9_BUSIF0_ADINR + (i))#define SSI9_BUSIF_DALIGN (i) (SSI9_BUSIF0_DALIGN + (i))#define SSI_SYS_STATUS (i) (SSI_SYS_STATUS0 + (i)) +#define SSI_SYS_INT_ENABLE (i) (SSI_SYS_INT_ENABLE0 + (i))struct rsnd_priv ;
sound/soc/sh/rcar/ssi.c +145 -0
193 lines not on this page · raw message
Signature · 1 line
2.26.2
Mark Brown
maintainerRe: [PATCH v2] SoC: rsnd: add interrupt support for SSI BUSIF buffer
Quoted 1 line · Yongbo Zhang
Acked-by Mark Brown <[email protected]>
I didn't send an Acked-by...
Quoted 6 lines
Changes since v1:
- Fix build errors forsound/soc/sh/rcar/ssi.cChanges since v0 (thanks for the feedback Morimoto):
- Replace the value of a register variable
---
As covered in submitting-patches.rst the inter-version changelog should come after the --- so they get automatically dropped by the tools when the patches are applied.
Mark Brown
maintainerRe: [PATCH v2] SoC: rsnd: add interrupt support for SSI BUSIF buffer
In reply to Yongbo ZhangQuoted 5 lines · Yongbo Zhang
SSI BUSIF buffer is possible to overflow or underflow, especially in a hypervisor environment. If there is no interrupt support, it will eventually lead to errors in pcm data.
This patch adds overflow and underflow interrupt support for SSI BUSIF buffer.
Quoted 7 lines
Reported-by Chen Li <[email protected]>Signed-off-by Yongbo Zhang <[email protected]>Tested-by Chen Li <[email protected]>Acked-by Mark Brown <[email protected]>[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.8
Thanks!
[1/1] SoC: rsnd: add interrupt support for SSI BUSIF buffer
commit: 66c705d07d784fb6b4622c6e47b6acae357472db
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
Mark Brown
maintainerQuoted 11 lines · Yongbo Zhang
SSI BUSIF buffer is possible to overflow or underflow, especially in a hypervisor environment. If there is no interrupt support, it will eventually lead to errors in pcm data.
This patch adds overflow and underflow interrupt support for SSI BUSIF buffer.Reported-by Chen Li <[email protected]>Signed-off-by Yongbo Zhang <[email protected]>Tested-by Chen Li <[email protected]>[...]
Applied to
local tree spi/for-5.7
Thanks!
[1/1] ASoC: rsnd: add interrupt support for SSI BUSIF buffer
(no commit info)
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
Mark Brown
maintainerQuoted 9 lines · Mark Brown
Quoted 4 lines · Yongbo Zhang
SSI BUSIF buffer is possible to overflow or underflow, especially in a hypervisor environment. If there is no interrupt support, it will eventually lead to errors in pcm data.
This patch adds overflow and underflow interrupt support for SSI BUSIF buffer.Applied to
local tree spi/for-5.7
No, it wasn't - sorry for the noise here.
kbuild test robot
build botThank you for the patch! Perhaps something to improve:
Hi Yongbo,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on asoc/for-next]
[also build test WARNING on v5.7-rc5 next-20200511]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Yongbo-Zhang/ASoC-rsnd-add-interrupt-support-for-SSI-BUSIF-buffer/20200511-184903 base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next reproduce: # apt-get install sparse # sparse version: v0.6.1-191-gc51a0382-dirty make ARCH=x86_64 allmodconfig make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' :::::: branch date: 8 hours ago :::::: commit date: 8 hours ago
If you fix the issue, kindly add following tag as appropriate
sparse warnings: (new ones prefixed by >>)
sound/soc/sh/rcar/ssi.c:596:1: sparse: sparse: mixing declarations and code include/sound/pcm_params.h:377:0: sparse: sparse: Expected } at end of function include/sound/pcm_params.h:377:0: sparse: sparse: got end-of-input
>> sound/soc/sh/rcar/ssi.c:798:56: sparse: sparse: not enough arguments for function rsnd_mod_write
# https://github.com/0day-ci/linux/commit/23aaae15fe2b41fd05caf5e0773d41021bc03e27
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 23aaae15fe2b41fd05caf5e0773d41021bc03e27
vim +798 sound/soc/sh/rcar/ssi.c
615fb6c7b13b7f Kuninori Morimoto 2016-02-18 733
d8d9b9730cd62c Kuninori Morimoto 2017-12-11 734 static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
d8d9b9730cd62c Kuninori Morimoto 2017-12-11 735 struct rsnd_dai_stream *io);
bfc0cfe6b7acb1 Kuninori Morimoto 2015-06-15 736 static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
bfc0cfe6b7acb1 Kuninori Morimoto 2015-06-15 737 struct rsnd_dai_stream *io)
ae5c322303fff5 Kuninori Morimoto 2013-07-21 738 {
690602fcd85385 Kuninori Morimoto 2015-01-15 739 struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
2b62786951ca38 Kuninori Morimoto 2018-02-13 740 struct device *dev = rsnd_priv_to_dev(priv);
765ae7c8dda7d0 Kuninori Morimoto 2015-01-15 741 int is_dma = rsnd_ssi_is_dma_mode(mod);
02299d9875bab5 Kuninori Morimoto 2015-05-21 742 u32 status;
75defee0f1b3fc Kuninori Morimoto 2015-06-15 743 bool elapsed = false;
6a25c8da00284f Kuninori Morimoto 2016-01-26 744 bool stop = false;
23aaae15fe2b41 Yongbo Zhang 2020-05-11 745 int is_tdm, is_tdm_split;
23aaae15fe2b41 Yongbo Zhang 2020-05-11 746
23aaae15fe2b41 Yongbo Zhang 2020-05-11 747 is_tdm = rsnd_runtime_is_tdm(io);
23aaae15fe2b41 Yongbo Zhang 2020-05-11 748 is_tdm_split = rsnd_runtime_is_tdm_split(io);
02299d9875bab5 Kuninori Morimoto 2015-05-21 749
02299d9875bab5 Kuninori Morimoto 2015-05-21 750 spin_lock(&priv->lock);
ae5c322303fff5 Kuninori Morimoto 2013-07-21 751
02299d9875bab5 Kuninori Morimoto 2015-05-21 752 /* ignore all cases if not working */
d5bbe7de563ccc Kuninori Morimoto 2015-06-15 753 if (!rsnd_io_is_working(io))
02299d9875bab5 Kuninori Morimoto 2015-05-21 754 goto rsnd_ssi_interrupt_out;
02299d9875bab5 Kuninori Morimoto 2015-05-21 755
6a25c8da00284f Kuninori Morimoto 2016-01-26 756 status = rsnd_ssi_status_get(mod);
4e7d606cd52aa8 Kuninori Morimoto 2014-11-27 757
4e7d606cd52aa8 Kuninori Morimoto 2014-11-27 758 /* PIO only */
d8d9b9730cd62c Kuninori Morimoto 2017-12-11 759 if (!is_dma && (status & DIRQ))
d8d9b9730cd62c Kuninori Morimoto 2017-12-11 760 elapsed = rsnd_ssi_pio_interrupt(mod, io);
ae5c322303fff5 Kuninori Morimoto 2013-07-21 761
12927a8f802642 Kuninori Morimoto 2015-06-15 762 /* DMA only */
2b62786951ca38 Kuninori Morimoto 2018-02-13 763 if (is_dma && (status & (UIRQ | OIRQ))) {
c0ea089dbad47a Kuninori Morimoto 2018-10-30 764 rsnd_dbg_irq_status(dev, "%s err status : 0x%08x\n",
c0ea089dbad47a Kuninori Morimoto 2018-10-30 765 rsnd_mod_name(mod), status);
2b62786951ca38 Kuninori Morimoto 2018-02-13 766
6a25c8da00284f Kuninori Morimoto 2016-01-26 767 stop = true;
2b62786951ca38 Kuninori Morimoto 2018-02-13 768 }
69e32a58bde674 Kuninori Morimoto 2015-10-26 769
23aaae15fe2b41 Yongbo Zhang 2020-05-11 770 status = 0;
23aaae15fe2b41 Yongbo Zhang 2020-05-11 771
23aaae15fe2b41 Yongbo Zhang 2020-05-11 772 if (is_tdm || is_tdm_split) {
23aaae15fe2b41 Yongbo Zhang 2020-05-11 773 switch (id) {
23aaae15fe2b41 Yongbo Zhang 2020-05-11 774 case 0:
23aaae15fe2b41 Yongbo Zhang 2020-05-11 775 case 1:
23aaae15fe2b41 Yongbo Zhang 2020-05-11 776 case 2:
23aaae15fe2b41 Yongbo Zhang 2020-05-11 777 case 3:
23aaae15fe2b41 Yongbo Zhang 2020-05-11 778 case 4:
23aaae15fe2b41 Yongbo Zhang 2020-05-11 779 for (i = 0; i < 4; i++) {
23aaae15fe2b41 Yongbo Zhang 2020-05-11 780 status = rsnd_mod_read(mod,
23aaae15fe2b41 Yongbo Zhang 2020-05-11 781 SSI_SYS_STATUS(i * 2));
23aaae15fe2b41 Yongbo Zhang 2020-05-11 782 status &= 0xf << (id * 4);
23aaae15fe2b41 Yongbo Zhang 2020-05-11 783
23aaae15fe2b41 Yongbo Zhang 2020-05-11 784 if (status) {
23aaae15fe2b41 Yongbo Zhang 2020-05-11 785 rsnd_dbg_irq_status(dev,
23aaae15fe2b41 Yongbo Zhang 2020-05-11 786 "%s err status : 0x%08x\n",
23aaae15fe2b41 Yongbo Zhang 2020-05-11 787 rsnd_mod_name(mod), status);
23aaae15fe2b41 Yongbo Zhang 2020-05-11 788 rsnd_mod_write(mod,
23aaae15fe2b41 Yongbo Zhang 2020-05-11 789 SSI_SYS_STATUS(i * 2),
23aaae15fe2b41 Yongbo Zhang 2020-05-11 790 0xf << (id * 4));
23aaae15fe2b41 Yongbo Zhang 2020-05-11 791 stop = true;
23aaae15fe2b41 Yongbo Zhang 2020-05-11 792 break;
23aaae15fe2b41 Yongbo Zhang 2020-05-11 793 }
23aaae15fe2b41 Yongbo Zhang 2020-05-11 794 }
23aaae15fe2b41 Yongbo Zhang 2020-05-11 795 break;
23aaae15fe2b41 Yongbo Zhang 2020-05-11 796 case 9:
23aaae15fe2b41 Yongbo Zhang 2020-05-11 797 for (i = 0; i < 4; i++) {
23aaae15fe2b41 Yongbo Zhang 2020-05-11 @798 status = rsnd_mod_write(mod,
23aaae15fe2b41 Yongbo Zhang 2020-05-11 799 SSI_SYS_STATUS((i * 2) + 1));
23aaae15fe2b41 Yongbo Zhang 2020-05-11 800 status &= 0xf << 4;
23aaae15fe2b41 Yongbo Zhang 2020-05-11 801
23aaae15fe2b41 Yongbo Zhang 2020-05-11 802 if (status) {
23aaae15fe2b41 Yongbo Zhang 2020-05-11 803 rsnd_dbg_irq_status(dev,
23aaae15fe2b41 Yongbo Zhang 2020-05-11 804 "%s err status : 0x%08x\n",
23aaae15fe2b41 Yongbo Zhang 2020-05-11 805 rsnd_mod_name(mod), status);
23aaae15fe2b41 Yongbo Zhang 2020-05-11 806 rsnd_mod_write(mod,
23aaae15fe2b41 Yongbo Zhang 2020-05-11 807 SSI_SYS_STATUS((i * 2) + 1),
23aaae15fe2b41 Yongbo Zhang 2020-05-11 808 0xf << 4);
23aaae15fe2b41 Yongbo Zhang 2020-05-11 809 stop = true;
23aaae15fe2b41 Yongbo Zhang 2020-05-11 810 break;
23aaae15fe2b41 Yongbo Zhang 2020-05-11 811 }
23aaae15fe2b41 Yongbo Zhang 2020-05-11 812 }
23aaae15fe2b41 Yongbo Zhang 2020-05-11 813 break;
23aaae15fe2b41 Yongbo Zhang 2020-05-11 814 }
23aaae15fe2b41 Yongbo Zhang 2020-05-11 815 }
23aaae15fe2b41 Yongbo Zhang 2020-05-11 816
5342dff2326393 Kuninori Morimoto 2015-11-26 817 rsnd_ssi_status_clear(mod);
02299d9875bab5 Kuninori Morimoto 2015-05-21 818 rsnd_ssi_interrupt_out:
02299d9875bab5 Kuninori Morimoto 2015-05-21 819 spin_unlock(&priv->lock);
02299d9875bab5 Kuninori Morimoto 2015-05-21 820
75defee0f1b3fc Kuninori Morimoto 2015-06-15 821 if (elapsed)
75defee0f1b3fc Kuninori Morimoto 2015-06-15 822 rsnd_dai_period_elapsed(io);
6a25c8da00284f Kuninori Morimoto 2016-01-26 823
6a25c8da00284f Kuninori Morimoto 2016-01-26 824 if (stop)
6a25c8da00284f Kuninori Morimoto 2016-01-26 825 snd_pcm_stop_xrun(io->substream);
6a25c8da00284f Kuninori Morimoto 2016-01-26 826 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]