* [PATCH] staging: most: Convert to the common vmalloc memalloc
@ 2019-11-08 16:45 ` Takashi Iwai
0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2019-11-08 16:45 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: devel, linux-kernel
The recent change (*) in the ALSA memalloc core allows us to drop the
special vmalloc-specific allocation and page handling. This patch
coverts to the common code.
(*) 1fe7f397cfe2: ALSA: memalloc: Add vmalloc buffer allocation
support
7e8edae39fd1: ALSA: pcm: Handle special page mapping in the
default mmap handler
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
Since the prerequisite commits above are found only on for-next branch
of sound git tree, please give ACK if the patch is OK; then I'll apply
it on top of my branch. Thanks!
drivers/staging/most/sound/sound.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/most/sound/sound.c b/drivers/staging/most/sound/sound.c
index 79817061fcfa..add16997f129 100644
--- a/drivers/staging/most/sound/sound.c
+++ b/drivers/staging/most/sound/sound.c
@@ -344,8 +344,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
pr_err("Requested number of channels not supported.\n");
return -EINVAL;
}
- return snd_pcm_lib_alloc_vmalloc_buffer(substream,
- params_buffer_bytes(hw_params));
+ return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
}
/**
@@ -359,7 +358,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
*/
static int pcm_hw_free(struct snd_pcm_substream *substream)
{
- return snd_pcm_lib_free_vmalloc_buffer(substream);
+ return snd_pcm_lib_free_pages(substream);
}
/**
@@ -469,7 +468,6 @@ static const struct snd_pcm_ops pcm_ops = {
.prepare = pcm_prepare,
.trigger = pcm_trigger,
.pointer = pcm_pointer,
- .page = snd_pcm_lib_get_vmalloc_page,
};
static int split_arg_list(char *buf, u16 *ch_num, char **sample_res)
@@ -663,6 +661,8 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id,
pcm->private_data = channel;
strscpy(pcm->name, device_name, sizeof(pcm->name));
snd_pcm_set_ops(pcm, direction, &pcm_ops);
+ snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_VMALLOC,
+ NULL, 0, 0);
return 0;
--
2.16.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] staging: most: Convert to the common vmalloc memalloc
@ 2019-11-08 16:45 ` Takashi Iwai
0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2019-11-08 16:45 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: devel, linux-kernel
The recent change (*) in the ALSA memalloc core allows us to drop the
special vmalloc-specific allocation and page handling. This patch
coverts to the common code.
(*) 1fe7f397cfe2: ALSA: memalloc: Add vmalloc buffer allocation
support
7e8edae39fd1: ALSA: pcm: Handle special page mapping in the
default mmap handler
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
Since the prerequisite commits above are found only on for-next branch
of sound git tree, please give ACK if the patch is OK; then I'll apply
it on top of my branch. Thanks!
drivers/staging/most/sound/sound.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/most/sound/sound.c b/drivers/staging/most/sound/sound.c
index 79817061fcfa..add16997f129 100644
--- a/drivers/staging/most/sound/sound.c
+++ b/drivers/staging/most/sound/sound.c
@@ -344,8 +344,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
pr_err("Requested number of channels not supported.\n");
return -EINVAL;
}
- return snd_pcm_lib_alloc_vmalloc_buffer(substream,
- params_buffer_bytes(hw_params));
+ return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
}
/**
@@ -359,7 +358,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
*/
static int pcm_hw_free(struct snd_pcm_substream *substream)
{
- return snd_pcm_lib_free_vmalloc_buffer(substream);
+ return snd_pcm_lib_free_pages(substream);
}
/**
@@ -469,7 +468,6 @@ static const struct snd_pcm_ops pcm_ops = {
.prepare = pcm_prepare,
.trigger = pcm_trigger,
.pointer = pcm_pointer,
- .page = snd_pcm_lib_get_vmalloc_page,
};
static int split_arg_list(char *buf, u16 *ch_num, char **sample_res)
@@ -663,6 +661,8 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id,
pcm->private_data = channel;
strscpy(pcm->name, device_name, sizeof(pcm->name));
snd_pcm_set_ops(pcm, direction, &pcm_ops);
+ snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_VMALLOC,
+ NULL, 0, 0);
return 0;
--
2.16.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: most: Convert to the common vmalloc memalloc
2019-11-08 16:45 ` Takashi Iwai
@ 2019-11-08 16:53 ` Greg Kroah-Hartman
-1 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2019-11-08 16:53 UTC (permalink / raw)
To: Takashi Iwai; +Cc: devel, linux-kernel
On Fri, Nov 08, 2019 at 05:45:28PM +0100, Takashi Iwai wrote:
> The recent change (*) in the ALSA memalloc core allows us to drop the
> special vmalloc-specific allocation and page handling. This patch
> coverts to the common code.
> (*) 1fe7f397cfe2: ALSA: memalloc: Add vmalloc buffer allocation
> support
> 7e8edae39fd1: ALSA: pcm: Handle special page mapping in the
> default mmap handler
>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
>
> ---
>
> Since the prerequisite commits above are found only on for-next branch
> of sound git tree, please give ACK if the patch is OK; then I'll apply
> it on top of my branch. Thanks!
>
>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: most: Convert to the common vmalloc memalloc
@ 2019-11-08 16:53 ` Greg Kroah-Hartman
0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2019-11-08 16:53 UTC (permalink / raw)
To: Takashi Iwai; +Cc: devel, linux-kernel
On Fri, Nov 08, 2019 at 05:45:28PM +0100, Takashi Iwai wrote:
> The recent change (*) in the ALSA memalloc core allows us to drop the
> special vmalloc-specific allocation and page handling. This patch
> coverts to the common code.
> (*) 1fe7f397cfe2: ALSA: memalloc: Add vmalloc buffer allocation
> support
> 7e8edae39fd1: ALSA: pcm: Handle special page mapping in the
> default mmap handler
>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
>
> ---
>
> Since the prerequisite commits above are found only on for-next branch
> of sound git tree, please give ACK if the patch is OK; then I'll apply
> it on top of my branch. Thanks!
>
>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: most: Convert to the common vmalloc memalloc
2019-11-08 16:45 ` Takashi Iwai
(?)
(?)
@ 2019-11-12 22:19 ` kbuild test robot
-1 siblings, 0 replies; 5+ messages in thread
From: kbuild test robot @ 2019-11-12 22:19 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 5840 bytes --]
Hi Takashi,
I love your patch! Yet something to improve:
[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v5.4-rc7]
[cannot apply to next-20191112]
[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/Takashi-Iwai/staging-most-Convert-to-the-common-vmalloc-memalloc/20191110-060926
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git b79967a27f347d39a6e0b85b49bd11963cacf5c1
config: i386-randconfig-h004-201945 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/staging//most/sound/sound.c: In function 'audio_probe_channel':
>> drivers/staging//most/sound/sound.c:664:45: error: 'SNDRV_DMA_TYPE_VMALLOC' undeclared (first use in this function); did you mean 'SNDRV_DMA_TYPE_DEV_UC'?
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_VMALLOC,
^~~~~~~~~~~~~~~~~~~~~~
SNDRV_DMA_TYPE_DEV_UC
drivers/staging//most/sound/sound.c:664:45: note: each undeclared identifier is reported only once for each function it appears in
vim +664 drivers/staging//most/sound/sound.c
558
559 /**
560 * audio_probe_channel - probe function of the driver module
561 * @iface: pointer to interface instance
562 * @channel_id: channel index/ID
563 * @cfg: pointer to actual channel configuration
564 * @arg_list: string that provides the name of the device to be created in /dev
565 * plus the desired audio resolution
566 *
567 * Creates sound card, pcm device, sets pcm ops and registers sound card.
568 *
569 * Returns 0 on success or error code otherwise.
570 */
571 static int audio_probe_channel(struct most_interface *iface, int channel_id,
572 struct most_channel_config *cfg,
573 char *device_name, char *arg_list)
574 {
575 struct channel *channel;
576 struct sound_adapter *adpt;
577 struct snd_pcm *pcm;
578 int playback_count = 0;
579 int capture_count = 0;
580 int ret;
581 int direction;
582 u16 ch_num;
583 char *sample_res;
584 char arg_list_cpy[STRING_SIZE];
585
586 if (!iface)
587 return -EINVAL;
588
589 if (cfg->data_type != MOST_CH_SYNC) {
590 pr_err("Incompatible channel type\n");
591 return -EINVAL;
592 }
593 strlcpy(arg_list_cpy, arg_list, STRING_SIZE);
594 ret = split_arg_list(arg_list_cpy, &ch_num, &sample_res);
595 if (ret < 0)
596 return ret;
597
598 list_for_each_entry(adpt, &adpt_list, list) {
599 if (adpt->iface != iface)
600 continue;
601 if (adpt->registered)
602 return -ENOSPC;
603 adpt->pcm_dev_idx++;
604 goto skip_adpt_alloc;
605 }
606 adpt = kzalloc(sizeof(*adpt), GFP_KERNEL);
607 if (!adpt)
608 return -ENOMEM;
609
610 adpt->iface = iface;
611 INIT_LIST_HEAD(&adpt->dev_list);
612 iface->priv = adpt;
613 list_add_tail(&adpt->list, &adpt_list);
614 ret = snd_card_new(iface->driver_dev, -1, "INIC", THIS_MODULE,
615 sizeof(*channel), &adpt->card);
616 if (ret < 0)
617 goto err_free_adpt;
618 snprintf(adpt->card->driver, sizeof(adpt->card->driver),
619 "%s", DRIVER_NAME);
620 snprintf(adpt->card->shortname, sizeof(adpt->card->shortname),
621 "Microchip INIC");
622 snprintf(adpt->card->longname, sizeof(adpt->card->longname),
623 "%s at %s", adpt->card->shortname, iface->description);
624 skip_adpt_alloc:
625 if (get_channel(iface, channel_id)) {
626 pr_err("channel (%s:%d) is already linked\n",
627 iface->description, channel_id);
628 return -EINVAL;
629 }
630
631 if (cfg->direction == MOST_CH_TX) {
632 playback_count = 1;
633 direction = SNDRV_PCM_STREAM_PLAYBACK;
634 } else {
635 capture_count = 1;
636 direction = SNDRV_PCM_STREAM_CAPTURE;
637 }
638 channel = kzalloc(sizeof(*channel), GFP_KERNEL);
639 if (!channel) {
640 ret = -ENOMEM;
641 goto err_free_adpt;
642 }
643 channel->card = adpt->card;
644 channel->cfg = cfg;
645 channel->iface = iface;
646 channel->id = channel_id;
647 init_waitqueue_head(&channel->playback_waitq);
648 list_add_tail(&channel->list, &adpt->dev_list);
649
650 ret = audio_set_hw_params(&channel->pcm_hardware, ch_num, sample_res,
651 cfg);
652 if (ret)
653 goto err_free_adpt;
654
655 ret = snd_pcm_new(adpt->card, device_name, adpt->pcm_dev_idx,
656 playback_count, capture_count, &pcm);
657
658 if (ret < 0)
659 goto err_free_adpt;
660
661 pcm->private_data = channel;
662 strscpy(pcm->name, device_name, sizeof(pcm->name));
663 snd_pcm_set_ops(pcm, direction, &pcm_ops);
> 664 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_VMALLOC,
665 NULL, 0, 0);
666
667 return 0;
668
669 err_free_adpt:
670 release_adapter(adpt);
671 return ret;
672 }
673
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28398 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-11-12 22:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-08 16:45 [PATCH] staging: most: Convert to the common vmalloc memalloc Takashi Iwai
2019-11-08 16:45 ` Takashi Iwai
2019-11-08 16:53 ` Greg Kroah-Hartman
2019-11-08 16:53 ` Greg Kroah-Hartman
2019-11-12 22:19 ` kbuild test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.