From: Peng Fan <van.freenix@gmail.com> To: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Peng Fan <peng.fan@nxp.com>, hch@lst.de, robin.murphy@arm.com, gregkh@linuxfoundation.org, robh+dt@kernel.org, frowand.list@gmail.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [RFC 2/2] drivers: dma-mapping: parse per device reserved mem at probe time Date: Mon, 27 Nov 2017 16:37:15 +0800 [thread overview] Message-ID: <20171127083713.clh6oz5sgere4usq@linux-u7w5.ap.freescale.net> (raw) In-Reply-To: <875c3a8c-a857-823e-0243-487d1dd9bee7@samsung.com> Hi Marek, On Mon, Nov 27, 2017 at 09:31:00AM +0100, Marek Szyprowski wrote: >Hi > >On 2017-11-26 14:13, Peng Fan wrote: >> Invoke of_reserved_mem_device_init at dma_configure, then >> there is no need to call of_reserved_mem_device_init in device >> specific probe function. >> >> Signed-off-by: Peng Fan <peng.fan@nxp.com> > >This has been already tried long time ago, without success: >http://patches.linaro.org/patch/33558/ Thanks for the info. I should first search mail list before sending out patches. Thanks, Peng. > >> --- >> drivers/base/dma-mapping.c | 6 +++++- >> 1 file changed, 5 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/base/dma-mapping.c b/drivers/base/dma-mapping.c >> index e584eddef0a7..55dca06a7b55 100644 >> --- a/drivers/base/dma-mapping.c >> +++ b/drivers/base/dma-mapping.c >> @@ -12,6 +12,7 @@ >> #include <linux/export.h> >> #include <linux/gfp.h> >> #include <linux/of_device.h> >> +#include <linux/of_reserved_mem.h> >> #include <linux/slab.h> >> #include <linux/vmalloc.h> >> @@ -351,7 +352,9 @@ int dma_configure(struct device *dev) >> } >> if (dma_dev->of_node) { >> - ret = of_dma_configure(dev, dma_dev->of_node); >> + ret = of_reserved_mem_device_init(dev); >> + if (ret) >> + ret = of_dma_configure(dev, dma_dev->of_node); >> } else if (has_acpi_companion(dma_dev)) { >> attr = acpi_get_dma_attr(to_acpi_device_node(dma_dev->fwnode)); >> if (attr != DEV_DMA_NOT_SUPPORTED) >> @@ -367,5 +370,6 @@ int dma_configure(struct device *dev) >> void dma_deconfigure(struct device *dev) >> { >> of_dma_deconfigure(dev); >> + of_reserved_mem_device_release(dev); >> acpi_dma_deconfigure(dev); >> } > >Best regards >-- >Marek Szyprowski, PhD >Samsung R&D Institute Poland > --
WARNING: multiple messages have this Message-ID (diff)
From: Peng Fan <van.freenix-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: Marek Szyprowski <m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Peng Fan <peng.fan-3arQi8VN3Tc@public.gmane.org>, frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, hch-jcswGhMUV9g@public.gmane.org Subject: Re: [RFC 2/2] drivers: dma-mapping: parse per device reserved mem at probe time Date: Mon, 27 Nov 2017 16:37:15 +0800 [thread overview] Message-ID: <20171127083713.clh6oz5sgere4usq@linux-u7w5.ap.freescale.net> (raw) In-Reply-To: <875c3a8c-a857-823e-0243-487d1dd9bee7-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> Hi Marek, On Mon, Nov 27, 2017 at 09:31:00AM +0100, Marek Szyprowski wrote: >Hi > >On 2017-11-26 14:13, Peng Fan wrote: >> Invoke of_reserved_mem_device_init at dma_configure, then >> there is no need to call of_reserved_mem_device_init in device >> specific probe function. >> >> Signed-off-by: Peng Fan <peng.fan-3arQi8VN3Tc@public.gmane.org> > >This has been already tried long time ago, without success: >http://patches.linaro.org/patch/33558/ Thanks for the info. I should first search mail list before sending out patches. Thanks, Peng. > >> --- >> drivers/base/dma-mapping.c | 6 +++++- >> 1 file changed, 5 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/base/dma-mapping.c b/drivers/base/dma-mapping.c >> index e584eddef0a7..55dca06a7b55 100644 >> --- a/drivers/base/dma-mapping.c >> +++ b/drivers/base/dma-mapping.c >> @@ -12,6 +12,7 @@ >> #include <linux/export.h> >> #include <linux/gfp.h> >> #include <linux/of_device.h> >> +#include <linux/of_reserved_mem.h> >> #include <linux/slab.h> >> #include <linux/vmalloc.h> >> @@ -351,7 +352,9 @@ int dma_configure(struct device *dev) >> } >> if (dma_dev->of_node) { >> - ret = of_dma_configure(dev, dma_dev->of_node); >> + ret = of_reserved_mem_device_init(dev); >> + if (ret) >> + ret = of_dma_configure(dev, dma_dev->of_node); >> } else if (has_acpi_companion(dma_dev)) { >> attr = acpi_get_dma_attr(to_acpi_device_node(dma_dev->fwnode)); >> if (attr != DEV_DMA_NOT_SUPPORTED) >> @@ -367,5 +370,6 @@ int dma_configure(struct device *dev) >> void dma_deconfigure(struct device *dev) >> { >> of_dma_deconfigure(dev); >> + of_reserved_mem_device_release(dev); >> acpi_dma_deconfigure(dev); >> } > >Best regards >-- >Marek Szyprowski, PhD >Samsung R&D Institute Poland > --
next prev parent reply other threads:[~2017-11-27 8:37 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-11-26 13:13 [RFC 1/2] of: reserved_mem: check return value of_dma_configure Peng Fan 2017-11-26 13:13 ` Peng Fan 2017-11-26 13:13 ` [RFC 2/2] drivers: dma-mapping: parse per device reserved mem at probe time Peng Fan 2017-11-26 13:13 ` Peng Fan 2017-11-27 8:31 ` Marek Szyprowski 2017-11-27 8:31 ` Marek Szyprowski 2017-11-27 8:37 ` Peng Fan [this message] 2017-11-27 8:37 ` Peng Fan 2017-11-27 8:44 ` Marek Szyprowski 2017-11-27 8:44 ` Marek Szyprowski 2017-11-27 9:04 ` Peng Fan 2017-11-27 9:04 ` Peng Fan 2017-12-07 12:01 ` Marek Szyprowski 2017-11-27 4:15 ` [RFC 1/2] of: reserved_mem: check return value of_dma_configure Peng Fan 2017-11-27 4:15 ` Peng Fan
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20171127083713.clh6oz5sgere4usq@linux-u7w5.ap.freescale.net \ --to=van.freenix@gmail.com \ --cc=devicetree@vger.kernel.org \ --cc=frowand.list@gmail.com \ --cc=gregkh@linuxfoundation.org \ --cc=hch@lst.de \ --cc=iommu@lists.linux-foundation.org \ --cc=linux-kernel@vger.kernel.org \ --cc=m.szyprowski@samsung.com \ --cc=peng.fan@nxp.com \ --cc=robh+dt@kernel.org \ --cc=robin.murphy@arm.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.