From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH 1/3] iommu/fsl: Fix PAMU window size check. Date: Fri, 4 Jul 2014 12:44:30 +0200 Message-ID: <20140704104430.GD13434@8bytes.org> References: <1403618237-26248-1-git-send-email-Varun.Sethi@freescale.com> <1403618237-26248-2-git-send-email-Varun.Sethi@freescale.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1403618237-26248-2-git-send-email-Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Varun Sethi Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: iommu@lists.linux-foundation.org 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.8bytes.org (8bytes.org [IPv6:2a01:238:4242:f000:64f:6c43:3523:e535]) by lists.ozlabs.org (Postfix) with ESMTP id 6DB421A00EF for ; Fri, 4 Jul 2014 20:49:49 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.8bytes.org (Postfix) with SMTP id 024D212B0A2 for ; Fri, 4 Jul 2014 12:44:31 +0200 (CEST) Date: Fri, 4 Jul 2014 12:44:30 +0200 From: Joerg Roedel To: Varun Sethi Subject: Re: [PATCH 1/3] iommu/fsl: Fix PAMU window size check. Message-ID: <20140704104430.GD13434@8bytes.org> References: <1403618237-26248-1-git-send-email-Varun.Sethi@freescale.com> <1403618237-26248-2-git-send-email-Varun.Sethi@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <1403618237-26248-2-git-send-email-Varun.Sethi@freescale.com> Cc: alex.williamson@redhat.com, iommu@lists.linux-foundation.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964893AbaGDKoe (ORCPT ); Fri, 4 Jul 2014 06:44:34 -0400 Received: from 8bytes.org ([85.214.48.195]:42328 "EHLO mail.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752631AbaGDKod (ORCPT ); Fri, 4 Jul 2014 06:44:33 -0400 Date: Fri, 4 Jul 2014 12:44:30 +0200 From: Joerg Roedel To: Varun Sethi Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, alex.williamson@redhat.com Subject: Re: [PATCH 1/3] iommu/fsl: Fix PAMU window size check. Message-ID: <20140704104430.GD13434@8bytes.org> References: <1403618237-26248-1-git-send-email-Varun.Sethi@freescale.com> <1403618237-26248-2-git-send-email-Varun.Sethi@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1403618237-26248-2-git-send-email-Varun.Sethi@freescale.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Fri Jul 4 12:44:32 2014 X-DSPAM-Confidence: 0.9994 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 53b6859020861579610763 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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