drivers: rtl818x: request DMA-able memory
Subsystems (3)
PATCH 1/1 drivers: rtl818x: request DMA-able memory
Despite the indicated intention in comment, the kmalloc() call was not explicitly requesting memory from ZONE_DMA.
--- drivers/net/wireless/rtl818x/rtl8187_dev.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/wireless/rtl818x/rtl8187_dev.c +2 -1
@@ -1343,7 +1343,8 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, priv->is_rtl8187b = (id->driver_info ==DEVICE_RTL8187B );/* allocate "DMA aware" buffer for register accesses */ - priv->io_dmabuf =kmalloc (sizeof (*priv->io_dmabuf),GFP_KERNEL ); + priv->io_dmabuf =kmalloc (sizeof (*priv->io_dmabuf), +GFP_DMA |GFP_KERNEL );if (!priv->io_dmabuf) { err = -ENOMEM ; goto err_free_dev;
Signature · 1 line
1.7.1
Quoted 13 lines · Serafeim Zanikolas
Despite the indicated intention in comment, the
kmalloc()call was not explicitly requesting memory fromZONE_DMA.Signed-off-by Serafeim Zanikolas <[email protected]>--- drivers/net/wireless/rtl818x/rtl8187_dev.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)drivers/net/wireless/rtl818x/rtl8187_dev.c +0
-0
drivers/net/wireless/rtl818x/rtl8187_dev.c static int __devinit rtl8187_probe(struct usb_interface *intf, · line 1350
Quoted 9 lines
drivers/net/wireless/rtl818x/rtl8187_dev.c +2
-1@@ -1343,7 +1343,8 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, priv->is_rtl8187b = (id->driver_info ==DEVICE_RTL8187B );/* allocate "DMA aware" buffer for register accesses */ - priv->io_dmabuf =kmalloc (sizeof (*priv->io_dmabuf),GFP_KERNEL ); + priv->io_dmabuf =kmalloc (sizeof (*priv->io_dmabuf), +GFP_DMA |GFP_KERNEL );if (!priv->io_dmabuf) { err = -ENOMEM ; goto err_free_dev;
ACK.
Larry
Hin-Tak Leung
Acked-byQuoted 26 lines · Larry Finger
Quoted 13 lines · Serafeim Zanikolas
Despite the indicated intention in comment, the
kmalloc()call was not explicitly requesting memory fromZONE_DMA.Signed-off-by Serafeim Zanikolas <[email protected]>--- drivers/net/wireless/rtl818x/rtl8187_dev.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)drivers/net/wireless/rtl818x/rtl8187_dev.c +0
-0drivers/net/wireless/rtl818x/rtl8187_dev.c static int __devinit rtl8187_probe(struct usb_interface *intf, · line 1350
Quoted 9 lines
drivers/net/wireless/rtl818x/rtl8187_dev.c +2
-1@@ -1343,7 +1343,8 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, priv->is_rtl8187b = (id->driver_info ==DEVICE_RTL8187B );/* allocate "DMA aware" buffer for register accesses */ - priv->io_dmabuf =kmalloc (sizeof (*priv->io_dmabuf),GFP_KERNEL ); + priv->io_dmabuf =kmalloc (sizeof (*priv->io_dmabuf), +GFP_DMA |GFP_KERNEL );if (!priv->io_dmabuf) { err = -ENOMEM ; goto err_free_dev;ACK.
Quoted 1 line
Larry
I had a quick look for similiar constructs and AFAIK only the b43/b43legacy drivers uses DMA buffers. Seems to be a rare practice. Is that something we should or should not do?
Hin-Tak
Johannes Berg
maintainerQuoted 6 lines · Hin-Tak Leung
Quoted 2 lines
Quoted 2 lines
Despite the indicated intention in comment, the
kmalloc()call was not explicitly requesting memory fromZONE_DMA.I had a quick look for similiar constructs and AFAIK only the b43/b43legacy drivers uses DMA buffers. Seems to be a rare practice. Is that something we should or should not do?
I think there's some confusion here about ZONE_DMA vs. DMA-able memory. All memory you get with kmalloc can be used for DMA, GFP_DMA means using ZONE_DMA which is a hack for ISA (and in b43 maybe PCMCIA/Cardbus) devices to put memory into something they can address. I don't think the latter is necessary for USB devices.
johannes
Quoted 28 lines · Hin-Tak Leung
Quoted 25 lines · Larry Finger
Quoted 13 lines · Serafeim Zanikolas
Despite the indicated intention in comment, the
kmalloc()call was not explicitly requesting memory fromZONE_DMA.Signed-off-by Serafeim Zanikolas <[email protected]>---
drivers/net/wireless/rtl818x/rtl8187_dev.c| 3 ++-1 files changed, 2 insertions(+), 1 deletions(-)drivers/net/wireless/rtl818x/rtl8187_dev.c +0
-0drivers/net/wireless/rtl818x/rtl8187_dev.c static int __devinit rtl8187_probe(struct usb_interface *intf, · line 1349
Quoted 8 lines
drivers/net/wireless/rtl818x/rtl8187_dev.c +2
-1@@ -1343,7 +1343,8 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, priv->is_rtl8187b = (id->driver_info ==DEVICE_RTL8187B );/* allocate "DMA aware" buffer for register accesses */ - priv->io_dmabuf =kmalloc (sizeof (*priv->io_dmabuf),GFP_KERNEL ); + priv->io_dmabuf =kmalloc (sizeof (*priv->io_dmabuf), +GFP_DMA |GFP_KERNEL );if (!priv->io_dmabuf) { err = -ENOMEM ; goto err_free_dev;ACK.
Quoted 7 lines
Quoted 1 line
Larry
Acked-by Hin-Tak Leung <[email protected]>I had a quick look for similiar constructs and AFAIK only the b43/b43legacy drivers uses DMA buffers. Seems to be a rare practice. Is that something we should or should not do?
It doesn't mean what you think it means. It is a relic of the past, used to indicate memory below 16MB so that ISA devices could do DMA.
John
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.
Quoted 10 lines · John W. Linville
Quoted 1 line
I had a quick look for similiar constructs and AFAIK
only the
Quoted 1 line
b43/b43legacy drivers uses DMA buffers. Seems to be a
rare practice.
Quoted 1 line
Is that something we should or should not do?
It doesn't mean what you think it means. It is a relic of the past,
used to indicate memory below 16MB so that ISA devices could do DMA.
okay - sorry about the confusion - I was grep'ing for GFP_DMA and only b43/b43lagacy have it and it is relatively rare. AFAIK none of the rtl8187 devices are non-USB... probably a NACK then, but I should ask Serafeim if there is a reason for him to submit this patch? (other than "it says dma"...)
Hin-tak
Quoted 2 lines · Hin-Tak Leung
okay - sorry about the confusion - I was grep'ing for
GFP_DMAand only b43/b43lagacy have it and it is relatively rare. AFAIK none of the rtl8187 devices are non-USB... probably a NACK then, but I should ask Serafeim if there is a reason for him to submit this patch? (other than "it says dma"...)
There are some devices driven by b43/b43legacy that implement only 24-bit DMA. For that reason, they need to allocate DMA buffers in the low 16 MB of RAM. For rtl8187, that consideration does not apply.
Larry
Quoted 31 lines · John W. Linville
Quoted 30 lines · Hin-Tak Leung
Quoted 26 lines · Larry Finger
Quoted 13 lines · Serafeim Zanikolas
Despite the indicated intention in comment, the
kmalloc()call was not explicitly requesting memory fromZONE_DMA.Signed-off-by Serafeim Zanikolas <[email protected]>---
drivers/net/wireless/rtl818x/rtl8187_dev.c| 3 ++-1 files changed, 2 insertions(+), 1 deletions(-)drivers/net/wireless/rtl818x/rtl8187_dev.c +0
-0drivers/net/wireless/rtl818x/rtl8187_dev.c static int __devinit rtl8187_probe(struct usb_interface *intf, · line 1349
Quoted 8 lines
drivers/net/wireless/rtl818x/rtl8187_dev.c +2
-1@@ -1343,7 +1343,8 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, priv->is_rtl8187b = (id->driver_info ==DEVICE_RTL8187B );/* allocate "DMA aware" buffer for register accesses */ - priv->io_dmabuf =kmalloc (sizeof (*priv->io_dmabuf),GFP_KERNEL ); + priv->io_dmabuf =kmalloc (sizeof (*priv->io_dmabuf), +GFP_DMA |GFP_KERNEL );if (!priv->io_dmabuf) { err = -ENOMEM ; goto err_free_dev;ACK.
Larry
Quoted 8 lines
Quoted 5 lines
Acked-by Hin-Tak Leung <[email protected]>I had a quick look for similiar constructs and AFAIK only the b43/b43legacy drivers uses DMA buffers. Seems to be a rare practice. Is that something we should or should not do?
It doesn't mean what you think it means. It is a relic of the past, used to indicate memory below 16MB so that ISA devices could do DMA.
Right. Sorry for the noise.
-S
Quoted 13 lines · Serafeim Zanikolas
Despite the indicated intention in comment, the
kmalloc()call was not explicitly requesting memory fromZONE_DMA.Signed-off-by Serafeim Zanikolas <[email protected]>--- drivers/net/wireless/rtl818x/rtl8187_dev.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)drivers/net/wireless/rtl818x/rtl8187_dev.c +0
-0
drivers/net/wireless/rtl818x/rtl8187_dev.c static int __devinit rtl8187_probe(struct usb_interface *intf, · line 1350
Quoted 9 lines
drivers/net/wireless/rtl818x/rtl8187_dev.c +2
-1@@ -1343,7 +1343,8 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, priv->is_rtl8187b = (id->driver_info ==DEVICE_RTL8187B );/* allocate "DMA aware" buffer for register accesses */ - priv->io_dmabuf =kmalloc (sizeof (*priv->io_dmabuf),GFP_KERNEL ); + priv->io_dmabuf =kmalloc (sizeof (*priv->io_dmabuf), +GFP_DMA |GFP_KERNEL );if (!priv->io_dmabuf) { err = -ENOMEM ; goto err_free_dev;
Are you sure about this? Are there USB controllers out there with the ISA 16MB limitation for DMA?
John
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.