[PATCH 0/9] use GFP_KERNEL
Platform_driver and pci_driver probe functions aren't called with locks held and thus don't need GFP_ATOMIC. Use GFP_KERNEL instead.
All changes have been compile-tested.
---
drivers/ata/pata_mpc52xx.c | 2 +- drivers/crypto/ux500/cryp/cryp_core.c | 2 +- drivers/crypto/ux500/hash/hash_core.c | 2 +- drivers/media/pci/cx18/cx18-driver.c | 2 +- drivers/media/platform/fsl-viu.c | 2 +- drivers/message/fusion/mptspi.c | 2 +- drivers/mfd/sta2x11-mfd.c | 2 +- drivers/mtd/devices/spear_smi.c | 2 +- drivers/net/ethernet/moxa/moxart_ether.c | 4 ++-- sound/soc/intel/boards/bytcr_wm5102.c | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-)
Platform_driver probe functions aren't called with locks held and thus don't need GFP_ATOMIC. Use GFP_KERNEL instead.
Problem found with Coccinelle.
Signed-off-by: Julia Lawall Julia.Lawall@inria.fr
--- sound/soc/intel/boards/bytcr_wm5102.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/boards/bytcr_wm5102.c b/sound/soc/intel/boards/bytcr_wm5102.c index 504ef4cab111..8d8e96e3cd2d 100644 --- a/sound/soc/intel/boards/bytcr_wm5102.c +++ b/sound/soc/intel/boards/bytcr_wm5102.c @@ -389,7 +389,7 @@ static int snd_byt_wm5102_mc_probe(struct platform_device *pdev) bool sof_parent; int ret;
- priv = devm_kzalloc(dev, sizeof(*priv), GFP_ATOMIC); + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM;
On 2/10/22 14:42, Julia Lawall wrote:
Platform_driver probe functions aren't called with locks held and thus don't need GFP_ATOMIC. Use GFP_KERNEL instead.
Problem found with Coccinelle.
Thanks Julia, indeed it's the only case where GFP_ATOMIC is used for machine drivers.
This was already present in the initial Android driver from Intel (2013) [1] and missed in the multiple passes to get this upstream.
Acked-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
[1] https://github.com/lenovo-yt2-dev/android_kernel_lenovo_baytrail/blob/cm-12....
Signed-off-by: Julia Lawall Julia.Lawall@inria.fr
sound/soc/intel/boards/bytcr_wm5102.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/boards/bytcr_wm5102.c b/sound/soc/intel/boards/bytcr_wm5102.c index 504ef4cab111..8d8e96e3cd2d 100644 --- a/sound/soc/intel/boards/bytcr_wm5102.c +++ b/sound/soc/intel/boards/bytcr_wm5102.c @@ -389,7 +389,7 @@ static int snd_byt_wm5102_mc_probe(struct platform_device *pdev) bool sof_parent; int ret;
- priv = devm_kzalloc(dev, sizeof(*priv), GFP_ATOMIC);
- priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM;
Hi,
On 2/11/22 01:20, Pierre-Louis Bossart wrote:
On 2/10/22 14:42, Julia Lawall wrote:
Platform_driver probe functions aren't called with locks held and thus don't need GFP_ATOMIC. Use GFP_KERNEL instead.
Problem found with Coccinelle.
Thanks Julia, indeed it's the only case where GFP_ATOMIC is used for machine drivers.
This was already present in the initial Android driver from Intel (2013) [1] and missed in the multiple passes to get this upstream.
Acked-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
Yeah I should have caught this when I upstreamed the machine driver:
Reviewed-by: Hans de Goede hdegoede@redhat.com
Regards,
Hans
[1] https://github.com/lenovo-yt2-dev/android_kernel_lenovo_baytrail/blob/cm-12....
Signed-off-by: Julia Lawall Julia.Lawall@inria.fr
sound/soc/intel/boards/bytcr_wm5102.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/boards/bytcr_wm5102.c b/sound/soc/intel/boards/bytcr_wm5102.c index 504ef4cab111..8d8e96e3cd2d 100644 --- a/sound/soc/intel/boards/bytcr_wm5102.c +++ b/sound/soc/intel/boards/bytcr_wm5102.c @@ -389,7 +389,7 @@ static int snd_byt_wm5102_mc_probe(struct platform_device *pdev) bool sof_parent; int ret;
- priv = devm_kzalloc(dev, sizeof(*priv), GFP_ATOMIC);
- priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM;
On Thu, 10 Feb 2022 21:42:14 +0100, Julia Lawall wrote:
Platform_driver and pci_driver probe functions aren't called with locks held and thus don't need GFP_ATOMIC. Use GFP_KERNEL instead.
All changes have been compile-tested.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[3/9] ASoC: Intel: bytcr_wm5102: use GFP_KERNEL commit: 695c105933cfa04ccf84088342193ae43e37e0f5
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
On Thu, 10 Feb 2022 21:42:14 +0100, Julia Lawall wrote:
Platform_driver and pci_driver probe functions aren't called with locks held and thus don't need GFP_ATOMIC. Use GFP_KERNEL instead.
All changes have been compile-tested.
Applied to 5.18/scsi-queue, thanks!
[8/9] mptfusion: use GFP_KERNEL https://git.kernel.org/mkp/scsi/c/f69b0791df1d
participants (5)
-
Hans de Goede
-
Julia Lawall
-
Mark Brown
-
Martin K. Petersen
-
Pierre-Louis Bossart