Re: unmap memory mapped with devm_ioremap_resource

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 9, 2022 at 9:14 AM Adrian Fiergolski
<adrian.fiergolski@xxxxxxxxxxxxx> wrote:
>
> Hi,
>
> Does the community have any other ideas? Or I am wrong, and devm_iounmap is enough?
>

I dunno, but it says you asked ~4 hrs ago.
I bet you could just try it and get an answer faster.
Do feel free to report back.

> Regards,
> Adrian
>
> On 6.12.2022 22:23, Adrian Fiergolski wrote:
>
> Hi Costa,
>
> Thank you for your reply.
>
> I saw 'devm_iounmap' , but, correct me if I am wrong, I think is not enough.
>
> devm_ioremap_resource calls __devm_ioremap_resource (link) which calls eventually __devm_request_region (link) and __devm_ioremap (link). Those two will allocate 2 devres: devm_region_release and devm_ioremap_release.
>
> The proposed devm_iounmap (link) seems to destroy only devm_ioremap_release devres.
>
> Regards,
> Adrian
>
> On 2.12.2022 19:01, Constantine Shulyupin wrote:
>
> Hi,
>
> I suppose you are looking for `devm_iounmap`.
> You can find example of usage in `drivers/fpga/dfl.c`:
>
> ...
>                         feature->ioaddr =
>                                devm_ioremap_resource(binfo->dev,
>                                                      &finfo->mmio_res);
> ...
>
> static void build_info_complete(struct build_feature_devs_info *binfo)
> {
>        devm_iounmap(binfo->dev, binfo->ioaddr);
>        devm_release_mem_region(binfo->dev, binfo->start, binfo->len);
> }
>
> Regards,
> Costa
>
>
> On Fri, 2 Dec 2022 at 19:25, Adrian Fiergolski
> <adrian.fiergolski@xxxxxxxxxxxxx> wrote:
>
> Hello,
>
> I am extending xilinx-hls driver
> (https://github.com/Xilinx/linux-xlnx/blob/master/drivers/media/platform/xilinx/xilinx-hls.c)
> to support of_overlay.
>
> In order to reflect in the driver changes being applied by the overlay
> to the device tree, I need to unmap first the memory mapped with
> devm_ioremap_resource. How to do it properly?
>
> I think it's uncommon, as normally kernel (devm_* functions) manages
> those resources itself with devres, so I can't find inspiration in other
> drivers.
>
> Regards,
> Adrian
>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux