Re: [RFC V2] iommu: correct group reference count

2015-11-09 Thread Peng Fan
Hi Will, On Mon, Nov 09, 2015 at 10:10:59AM +, Will Deacon wrote: >On Mon, Nov 09, 2015 at 02:13:28PM +0800, Peng Fan wrote: >> The basic flow for iommu_group_for_dev is: >> iommu_group_get_for_dev >> |-> iommu_group_get : increase reference count by 1. >

Re: [RFC V2] iommu: correct group reference count

2015-11-09 Thread Peng Fan
Hi Alex, On Mon, Nov 09, 2015 at 08:28:09AM -0700, Alex Williamson wrote: >On Mon, 2015-11-09 at 14:13 +0800, Peng Fan wrote: >> The basic flow for iommu_group_for_dev is: >> iommu_group_get_for_dev >> |-> iommu_group_get : increase reference count by 1. >

[RFC V2] iommu: correct group reference count

2015-11-08 Thread Peng Fan
nly increase reference count by 1. Signed-off-by: Peng Fan <van.free...@gmail.com> Cc: Joerg Roedel <j...@8bytes.org> Cc: Will Deacon <will.dea...@arm.com> --- V1 thread: https://lkml.org/lkml/2015/11/3/304 Changes V2: I did not see the update about device_group when I wor

Re: [RFC] iommu: arm-smmu: correct reference count

2015-11-08 Thread Peng Fan
Hi Will, On Fri, Nov 06, 2015 at 12:23:39PM +, Will Deacon wrote: >On Wed, Nov 04, 2015 at 10:48:28AM +0800, Peng Fan wrote: >> On Tue, Nov 03, 2015 at 01:17:34PM +, Will Deacon wrote: >> >On Tue, Nov 03, 2015 at 08:59:17PM +0800, Peng Fan wrote: >> >> iom

Re: Question about arm smmu

2015-11-04 Thread Peng Fan
Hi Robin, Will, On Wed, Nov 04, 2015 at 03:31:55PM +, Robin Murphy wrote: >On 04/11/15 14:43, Will Deacon wrote: >>On Wed, Nov 04, 2015 at 09:44:40PM +0800, Peng Fan wrote: >>>Hi Will, >> >>Hello, >> >>>I am trying to enable SMMU(mmu500) on an

Question about arm smmu

2015-11-04 Thread Peng Fan
Hi Will, I am trying to enable SMMU(mmu500) on an platform. My platform support only 32 SIDs, but it have more than 100 masters. So I need to let different masters share one SID. I read current arm-smmu.c, but it needs each master has unique SID. Do you have some suggestions about how to let

[RFC] iommu: arm-smmu: correct reference count

2015-11-04 Thread Peng Fan
iommu_group_alloc will initialize the reference count for group to 1. iommu_group_add_device also increase the group reference count, if nothing bad happends. And we need to add iommu_group_put to decrease the reference count for group. Signed-off-by: Peng Fan <van.free...@gmail.com&

Re: [RFC] iommu: arm-smmu: correct reference count

2015-11-03 Thread Peng Fan
Hi Will, On Tue, Nov 03, 2015 at 01:17:34PM +, Will Deacon wrote: >On Tue, Nov 03, 2015 at 08:59:17PM +0800, Peng Fan wrote: >> iommu_group_alloc will initialize the reference count for group to 1. >> iommu_group_add_device also increase the group reference count, >> if

Re: [RFC V4] iommu: arm-smmu: correct group reference count

2015-11-20 Thread Peng Fan
>Since we are adding one device, the flow is (2) and the group reference >count will be increased by 2. So, we need to add iommu_group_put at the >end of arm_smmu_add_device to decrease the count by 1. > >Also take the failure path into consideration when fail to add a device. >

Re: [RFC V3] iommu: arm-smmu: correct group reference count

2015-11-19 Thread Peng Fan
Hi Will, On Tue, Nov 17, 2015 at 04:17:46PM +, Will Deacon wrote: >On Tue, Nov 10, 2015 at 09:56:26AM +0800, Peng Fan wrote: >> The basic flow for add a device: >> arm_smmu_add_device >> |->iommu_group_get_for_dev >> |->iommu_group_get >

[PATCH] iommu/arm-smmu: clear cache lock bit of ACR

2016-05-03 Thread Peng Fan
According MMU-500 TRM, section 3.7.1 Auxiliary Control registers, You can modify ACTLR only when the ACR.CACHE_LOCK bit is 0. So before clearing ARM_MMU500_ACTLR_CPRE of each context bank, need clear CACHE_LOCK bit of ACR register first. Signed-off-by: Peng Fan <van.free...@gmail.com&

Re: [PATCH] iommu/arm-smmu: clear cache lock bit of ACR

2016-05-03 Thread Peng Fan
Hi Robin, On Tue, May 03, 2016 at 12:15:52PM +0100, Robin Murphy wrote: >On 03/05/16 11:15, Peng Fan wrote: >>According MMU-500 TRM, section 3.7.1 Auxiliary Control registers, >>You can modify ACTLR only when the ACR.CACHE_LOCK bit is 0. >> >>So before clearing AR

[PATCH V2] iommu: arm-smmu: drop devm_free_irq when driver detach

2016-07-12 Thread Peng Fan
There is no need to call devm_free_irq when driver detach. devres_release_all which is called after 'drv->remove' will release all managed resources. Signed-off-by: Peng Fan <van.free...@gmail.com> Reviewed-by: Robin Murphy <robin.mur...@arm.com> Cc: Will Deacon <will.dea..

[PATCH] iommu: arm-smmu: drop devm_free_irq when driver detach

2016-07-11 Thread Peng Fan
There is no need to call devm_free_irq when driver detach. devres_release_all which is called after 'drv->remove' will release all managed resources. Signed-off-by: Peng Fan <van.free...@gmail.com> Cc: Will Deacon <will.dea...@arm.com> Cc: Robin Murphy <robin.mur...@arm.com&g

Re: [PATCH] iommu: arm-smmu: use devm_request_irq and devm_free_irq

2016-07-11 Thread Peng Fan
Hi Robin, On Mon, Jul 11, 2016 at 11:32:55AM +0100, Robin Murphy wrote: >On 04/07/16 10:38, Peng Fan wrote: >> Use devm_request_irq to simplify error handling path, >> when probe smmu device. >> >> Also devm_{request|free}_irq when init or destroy domain context. >

[PATCH] iommu: arm-smmu: correct sid to mask

2017-04-21 Thread Peng Fan
>From code "SMR mask 0x%x out of range for SMMU", so, we need to use mask, not sid. Signed-off-by: Peng Fan <peng@nxp.com> Cc: Will Deacon <will.dea...@arm.com> Cc: Robin Murphy <robin.mur...@arm.com> --- drivers/iommu/arm-smmu.c | 2 +- 1 file changed, 1 in

RE: [RFC 1/2] of: reserved_mem: check return value of_dma_configure

2017-11-26 Thread Peng Fan
> -Original Message- > From: Peng Fan > Sent: Sunday, November 26, 2017 9:14 PM > To: h...@lst.de; m.szyprow...@samsung.com; robin.mur...@arm.com; > gre...@linuxfoundation.org; robh...@kernel.org; frowand.l...@gmail.com > Cc: iommu@lists.linux-foundation.org; linux-ker.

[RFC 2/2] drivers: dma-mapping: parse per device reserved mem at probe time

2017-11-26 Thread Peng Fan
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@nxp.com> --- drivers/base/dma-mapping.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff

[RFC 1/2] of: reserved_mem: check return value of_dma_configure

2017-11-26 Thread Peng Fan
reserved memory for a device which needs iommu. Signed-off-by: Peng Fan <peng@nxp.com> --- drivers/of/of_reserved_mem.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 22b75c82e377..61523819b50

Re: [RFC 2/2] drivers: dma-mapping: parse per device reserved mem at probe time

2017-11-27 Thread Peng Fan
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

Re: [RFC 2/2] drivers: dma-mapping: parse per device reserved mem at probe time

2017-11-27 Thread Peng Fan
Hi Marek, On Mon, Nov 27, 2017 at 09:44:20AM +0100, Marek Szyprowski wrote: >Hi Peng, > >On 2017-11-27 09:37, Peng Fan wrote: >> Hi Marek, >> >> On Mon, Nov 27, 2017 at 09:31:00AM +0100, Marek Szyprowski wrote: >> > Hi >> > >> &

[PATCH] xen/swiotlb: correct the check for xen_destroy_contiguous_region

2020-04-28 Thread peng . fan
From: Peng Fan When booting xen on i.MX8QM, met: " [3.602128] Unable to handle kernel paging request at virtual address 00272d40 [3.610804] Mem abort info: [3.613905] ESR = 0x9604 [3.617332] EC = 0x25: DABT (current EL), IL = 32 bits [3.623211] SET = 0

RE: [PATCH] xen/swiotlb: correct the check for xen_destroy_contiguous_region

2020-04-28 Thread Peng Fan
age_boundary(phys, size) are true, it will create > > contiguous region. So when free, we need to free contiguous region use > > upper check condition. > > > > Signed-off-by: Peng Fan > > --- > > drivers/xen/swiotlb-xen.c | 4 ++-- > > 1 file changed, 2 ins

RE: [PATCH] xen/swiotlb: correct the check for xen_destroy_contiguous_region

2020-04-28 Thread Peng Fan
> Subject: Re: [PATCH] xen/swiotlb: correct the check for > xen_destroy_contiguous_region > > On 28.04.20 09:33, peng@nxp.com wrote: > > From: Peng Fan > > > > When booting xen on i.MX8QM, met: > > " > > [3.602128] Unable to

RE: [PATCH] xen: introduce xen_vring_use_dma

2020-06-29 Thread Peng Fan
> Subject: RE: [PATCH] xen: introduce xen_vring_use_dma > > On Mon, 29 Jun 2020, Peng Fan wrote: > > > > If that is the case, how is it possible that virtio breaks on ARM > > > > using the default dma_ops? The breakage is not Xen related (except > > >

RE: [PATCH] xen: introduce xen_vring_use_dma

2020-07-12 Thread Peng Fan
> Subject: Re: [PATCH] xen: introduce xen_vring_use_dma > > Sorry for the late reply -- a couple of conferences kept me busy. > > > On Wed, 1 Jul 2020, Michael S. Tsirkin wrote: > > On Wed, Jul 01, 2020 at 10:34:53AM -0700, Stefano Stabellini wrote: > > > Would you be in favor of a more

[PATCH] xen: introduce xen_vring_use_dma

2020-06-24 Thread Peng Fan
Export xen_swiotlb for all platforms using xen swiotlb Use xen_swiotlb to determine when vring should use dma APIs to map the ring: when xen_swiotlb is enabled the dma API is required. When it is disabled, it is not required. Signed-off-by: Peng Fan --- V2: This is a modified version from

RE: [PATCH] xen: introduce xen_vring_use_dma

2020-06-28 Thread Peng Fan
> On Wed, 24 Jun 2020, Michael S. Tsirkin wrote: > > > > > On Wed, Jun 24, 2020 at 10:59:47AM -0700, Stefano Stabellini wrote: > > > > > > On Wed, 24 Jun 2020, Michael S. Tsirkin wrote: > > > > > > > On Wed, Jun 24, 2020 at 05:17:32PM +08

RE: [PATCH] xen: introduce xen_vring_use_dma

2020-06-28 Thread Peng Fan
4, 2020 at 10:59:47AM -0700, Stefano Stabellini wrote: > > > > > On Wed, 24 Jun 2020, Michael S. Tsirkin wrote: > > > > > > On Wed, Jun 24, 2020 at 05:17:32PM +0800, Peng Fan wrote: > > > > > > > Export xen_swiotlb for all platforms using xen swiot

RE: [PATCH] xen: introduce xen_vring_use_dma

2020-06-29 Thread Peng Fan
> Subject: Re: [PATCH] xen: introduce xen_vring_use_dma > > On Mon, Jun 29, 2020 at 03:05:19AM +0000, Peng Fan wrote: > > > Subject: Re: [PATCH] xen: introduce xen_vring_use_dma > > > > > > On Thu, Jun 25, 2020 at 10:31:27AM -0700, Stefano Stabellini wrote: &g

RE: [PATCH] xen: introduce xen_vring_use_dma

2020-06-29 Thread Peng Fan
> Subject: Re: [PATCH] xen: introduce xen_vring_use_dma > > On Mon, Jun 29, 2020 at 06:25:41AM +0000, Peng Fan wrote: > > > > > > Anyway, re-reading the last messages of the original thread > > > > > > [1], it looks like Peng had a clear idea

RE: [PATCH v1 0/2] Fix console probe delay due to fw_devlink

2022-06-22 Thread Peng Fan
i.MX8MP-EVK, works well now. Tested-by: Peng Fan #i.MX8MP-EVK Thanks, Peng. > > -Saravana > > Cc: Sascha Hauer > Cc: Peng Fan > Cc: Kevin Hilman > Cc: Ulf Hansson > Cc: Len Brown > Cc: Pavel Machek > Cc: Joerg Roedel > Cc: Will Deacon > Cc: Andrew Lun