[Intel-gfx] [PATCH v2 1/9] vfio/ccw: Use functions for alloc/free of the vfio_ccw_private

Jason Gunthorpe jgg at nvidia.com
Tue Sep 14 18:03:50 UTC 2021


On Tue, Sep 14, 2021 at 05:50:25PM +0200, Cornelia Huck wrote:
> On Fri, Sep 10 2021, Christoph Hellwig <hch at infradead.org> wrote:
> 
> > On Thu, Sep 09, 2021 at 04:38:41PM -0300, Jason Gunthorpe wrote:
> >> +
> >> +	private = kzalloc(sizeof(*private), GFP_KERNEL | GFP_DMA);
> >> +	if (!private)
> >> +		return ERR_PTR(-ENOMEM);
> >
> > Nit: there is no need to add GFP_KERNEL when using GFP_DMA.
> >
> > Also a question to the s390 maintainers: why do we need 31-bit
> > addressability for the main private data structure?
> 
> I don't think we need it anymore since c98e16b2fa12 ("s390/cio: Convert
> ccw_io_region to pointer") and probably should just drop the GFP_DMA.

I added this to the series:

>From 0d40f9c57430400a81aa60920b70761535967048 Mon Sep 17 00:00:00 2001
From: Jason Gunthorpe <jgg at nvidia.com>
Date: Tue, 14 Sep 2021 14:21:49 -0300
Subject: [PATCH] vfio/ccw: Remove unneeded GFP_DMA

Since the ccw_io_region was split out of the private the allocation no
longer needs the GFP_DMA. Remove it.

Reported-by: Christoph Hellwig <hch at infradead.org>
Fixes: c98e16b2fa12 ("s390/cio: Convert ccw_io_region to pointer")
Signed-off-by: Jason Gunthorpe <jgg at nvidia.com>
---
 drivers/s390/cio/vfio_ccw_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/cio/vfio_ccw_drv.c b/drivers/s390/cio/vfio_ccw_drv.c
index 76099bcb765b45..371558ec92045d 100644
--- a/drivers/s390/cio/vfio_ccw_drv.c
+++ b/drivers/s390/cio/vfio_ccw_drv.c
@@ -161,7 +161,7 @@ static int vfio_ccw_sch_probe(struct subchannel *sch)
 		return -ENODEV;
 	}
 
-	private = kzalloc(sizeof(*private), GFP_KERNEL | GFP_DMA);
+	private = kzalloc(sizeof(*private), GFP_KERNEL);
 	if (!private)
 		return -ENOMEM;
 
-- 
2.33.0




More information about the Intel-gfx mailing list