Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757405AbcJXUk2 (ORCPT ); Mon, 24 Oct 2016 16:40:28 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:39109 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756963AbcJXUkZ (ORCPT ); Mon, 24 Oct 2016 16:40:25 -0400 Subject: Re: [PATCH 2/6] sparc64: Add ATU (new IOMMU) support To: David Miller References: <1476123127-24314-1-git-send-email-tushar.n.dave@oracle.com> <1476123127-24314-3-git-send-email-tushar.n.dave@oracle.com> <20161024.134645.2216722602983259081.davem@davemloft.net> Cc: chris.hyser@oracle.com, sowmini.varadhan@oracle.com, vgupta@synopsys.com, robin.murphy@arm.com, jroedel@suse.de, egtvedt@samfundet.no, krzk@kernel.org, rkuo@codeaurora.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org From: tndave Message-ID: <1be31752-6f6d-e28e-9e30-835c8b7b8395@oracle.com> Date: Mon, 24 Oct 2016 13:40:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20161024.134645.2216722602983259081.davem@davemloft.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 892 Lines: 37 On 10/24/2016 10:46 AM, David Miller wrote: > From: Tushar Dave > Date: Mon, 10 Oct 2016 11:12:03 -0700 > >> + /* calculate size of IOTSB */ >> + table_size = (atu->size / IO_PAGE_SIZE) * 8; >> + table = kzalloc(table_size, GFP_KERNEL); >> + if (!table) { >> + err = -ENOMEM; >> + goto table_failed; >> + } >> + table = (void *)IO_PAGE_ALIGN((u64)table); > > If you use the page allocator directly you can avoid all of these > funny alignment calculations. Okay. I will look into this. > >> @@ -931,8 +1046,10 @@ static int pci_sun4v_probe(struct platform_device *op) >> struct pci_pbm_info *pbm; >> struct device_node *dp; >> struct iommu *iommu; >> + struct atu *atu; >> u32 devhandle; >> int i, err = -ENODEV; >> + static bool hv_atu = 1; > > Please use true/false with boolean variables. Sure. > >> + hv_atu = 0; > > Likewise. > Thanks. -Tushar