2018-02-12 20:22:11

by Stefan Wahren

[permalink] [raw]
Subject: [PATCH] usb: dwc2: Print error if unable to set DMA coherent mask

We better print an error in case probing of dwc2 fails on
setting the DMA coherent mask.

Signed-off-by: Stefan Wahren <[email protected]>
---
drivers/usb/dwc2/platform.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index 4703478..4ddbdbd 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -382,8 +382,10 @@ static int dwc2_driver_probe(struct platform_device *dev)
if (!dev->dev.dma_mask)
dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
retval = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));
- if (retval)
+ if (retval) {
+ dev_err(&dev->dev, "can't set coherent DMA mask: %d\n", retval);
return retval;
+ }

res = platform_get_resource(dev, IORESOURCE_MEM, 0);
hsotg->regs = devm_ioremap_resource(&dev->dev, res);
--
2.7.4



2018-03-08 17:33:26

by Stefan Wahren

[permalink] [raw]
Subject: Re: [PATCH] usb: dwc2: Print error if unable to set DMA coherent mask


> Stefan Wahren <[email protected]> hat am 12. Februar 2018 um 21:20 geschrieben:
>
>
> We better print an error in case probing of dwc2 fails on
> setting the DMA coherent mask.
>
> Signed-off-by: Stefan Wahren <[email protected]>
> ---
> drivers/usb/dwc2/platform.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
> index 4703478..4ddbdbd 100644
> --- a/drivers/usb/dwc2/platform.c
> +++ b/drivers/usb/dwc2/platform.c
> @@ -382,8 +382,10 @@ static int dwc2_driver_probe(struct platform_device *dev)
> if (!dev->dev.dma_mask)
> dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
> retval = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));
> - if (retval)
> + if (retval) {
> + dev_err(&dev->dev, "can't set coherent DMA mask: %d\n", retval);
> return retval;
> + }
>
> res = platform_get_resource(dev, IORESOURCE_MEM, 0);
> hsotg->regs = devm_ioremap_resource(&dev->dev, res);
> --
> 2.7.4
>

ping ...

2018-03-09 09:12:06

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH] usb: dwc2: Print error if unable to set DMA coherent mask

Stefan Wahren <[email protected]> writes:

>> Stefan Wahren <[email protected]> hat am 12. Februar 2018 um 21:20 geschrieben:
>>
>>
>> We better print an error in case probing of dwc2 fails on
>> setting the DMA coherent mask.
>>
>> Signed-off-by: Stefan Wahren <[email protected]>
>> ---
>> drivers/usb/dwc2/platform.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
>> index 4703478..4ddbdbd 100644
>> --- a/drivers/usb/dwc2/platform.c
>> +++ b/drivers/usb/dwc2/platform.c
>> @@ -382,8 +382,10 @@ static int dwc2_driver_probe(struct platform_device *dev)
>> if (!dev->dev.dma_mask)
>> dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
>> retval = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));
>> - if (retval)
>> + if (retval) {
>> + dev_err(&dev->dev, "can't set coherent DMA mask: %d\n", retval);
>> return retval;
>> + }
>>
>> res = platform_get_resource(dev, IORESOURCE_MEM, 0);
>> hsotg->regs = devm_ioremap_resource(&dev->dev, res);
>> --
>> 2.7.4
>>
>
> ping ...

https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git/commit/?h=testing/next&id=57b1d49d4b9c6cde9fbe95c1a211b6bbea61c6fc

--
balbi


Attachments:
signature.asc (847.00 B)