RE: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.

2014-07-04 Thread Varun Sethi
bject: Re: [PATCH 1/3] iommu/fsl: Fix PAMU window size check. > > On Tue, Jun 24, 2014 at 07:27:15PM +0530, Varun Sethi wrote: > > /* window size is 2^(WSE+1) bytes */ > > - return __ffs(addrspace_size) - 1; > > + return fls64(addrspace_size) - 2; > > This look

Re: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.

2014-07-04 Thread Joerg Roedel
On Tue, Jun 24, 2014 at 07:27:15PM +0530, Varun Sethi wrote: > /* window size is 2^(WSE+1) bytes */ > - return __ffs(addrspace_size) - 1; > + return fls64(addrspace_size) - 2; This looks bogus, why do you replace ffs (find-first-bit) by fls (find-last-bit)? Joerg

Re: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.

2014-07-03 Thread Emil Medve
On 06/24/2014 08:57 AM, Varun Sethi wrote: > is_power_of_2 requires an unsigned long parameter which would > lead to truncation of 64 bit values on 32 bit architectures. > > __ffs also expects an unsigned long parameter thus won't work > for 64 bit values on 32 bit architectures. > > Signed-off-b

RE: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.

2014-07-02 Thread Varun Sethi
.org; alex.william...@redhat.com > Subject: Re: [PATCH 1/3] iommu/fsl: Fix PAMU window size check. > > On 06/24/2014 08:57 AM, Varun Sethi wrote: > > is_power_of_2 requires an unsigned long parameter which would lead to > > truncation of 64 bit values on 32 bit architectures.