Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933206AbbHZBtt (ORCPT ); Tue, 25 Aug 2015 21:49:49 -0400 Received: from mail-by2on0114.outbound.protection.outlook.com ([207.46.100.114]:40512 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751859AbbHZBtr (ORCPT ); Tue, 25 Aug 2015 21:49:47 -0400 From: Zhao Qiang To: Scott Wood CC: Laura Abbott , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "lauraa@codeaurora.org" , Xiaobo Xie , "benh@kernel.crashing.org" , Li Leo , "paulus@samba.org" Subject: RE: [PATCH v6 3/3] qe_common: add qe_muram_ functions to manage muram Thread-Topic: [PATCH v6 3/3] qe_common: add qe_muram_ functions to manage muram Thread-Index: AQHQ3lE08qg+K0DuDEa/oy40LAO0yp4bzaWAgAA3LDCAABe8AIAAMajwgACZwICAAJxV0A== Date: Wed, 26 Aug 2015 01:49:38 +0000 Message-ID: References: <1440408703-6113-1-git-send-email-qiang.zhao@freescale.com> <1440408703-6113-3-git-send-email-qiang.zhao@freescale.com> <55DBA98D.1070202@redhat.com> <55DBEBBE.30702@redhat.com> <1440519775.16577.4.camel@freescale.com> In-Reply-To: <1440519775.16577.4.camel@freescale.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=qiang.zhao@freescale.com; x-originating-ip: [192.158.241.86] x-microsoft-exchange-diagnostics: 1;DM2PR0301MB0734;5:XW4RVch1FQGcc1kQM1y/0n+xY+V8JLGDgffErsLTD7alLw3LhgaLCWM2q56iP2sNFy9EHIVK0EAn9viHiZVNjb6pwP6ECwUydW/nTE/BTPKQoGk4iamNlJCWl8cJyJIdTVXVZkFv7E0nTbMed7towQ==;24:DZ6A1VaSdsOTCh8qMN8ghaffsDuAq0JxuHV3qywGDZ9nsPuc1ZBRb8YcNvAYg6BLS8pDK8aeEs0gJG53QAp+cmzD1AaRrt/tpxnzZSAmxpg=;20:KPuzF7lM38UkQNBnXKbDlI5zLk9Ez+JoZfRXfrwaWV9RkNxspIYHCUob+CTu+JqH0v0020nXdovNGN3kQFDZEA== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0734; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(8121501046)(3002001);SRVR:DM2PR0301MB0734;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0734; x-forefront-prvs: 0680FADD48 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(377424004)(479174004)(199003)(189002)(377454003)(13464003)(24454002)(33656002)(77156002)(106116001)(93886004)(50986999)(5003600100002)(101416001)(5001860100001)(189998001)(76576001)(4001450100002)(5004730100002)(87936001)(5007970100001)(2656002)(62966003)(5001960100002)(110136002)(76176999)(5002640100001)(66066001)(105586002)(99286002)(97736004)(10400500002)(2900100001)(92566002)(102836002)(46102003)(2950100001)(5001830100001)(74316001)(122556002)(68736005)(19580405001)(106356001)(81156007)(77096005)(54356999)(4001540100001)(86362001)(64706001)(19580395003)(40100003);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR0301MB0734;H:SN1PR0301MB1550.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Aug 2015 01:49:38.4160 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0734 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id t7Q1ns4J022193 Content-Length: 2829 Lines: 64 > -----Original Message----- > From: Wood Scott-B07421 > Sent: Wednesday, August 26, 2015 12:23 AM > To: Zhao Qiang-B45475 > Cc: Laura Abbott; linux-kernel@vger.kernel.org; linuxppc- > dev@lists.ozlabs.org; lauraa@codeaurora.org; Xie Xiaobo-R63061; > benh@kernel.crashing.org; Li Yang-Leo-R58472; paulus@samba.org > Subject: Re: [PATCH v6 3/3] qe_common: add qe_muram_ functions to manage > muram > > On Tue, 2015-08-25 at 02:19 -0500, Zhao Qiang-B45475 wrote: > > On 08/25/2015 12:15 PM, Laura Abbott wrote > > > -----Original Message----- > > > From: Laura Abbott [mailto:labbott@redhat.com] > > > Sent: Tuesday, August 25, 2015 12:15 PM > > > To: Zhao Qiang-B45475; Wood Scott-B07421 > > > Cc: linux-kernel@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; > > > lauraa@codeaurora.org; Xie Xiaobo-R63061; benh@kernel.crashing.org; > > > Li Yang-Leo-R58472; paulus@samba.org > > > Subject: Re: [PATCH v6 3/3] qe_common: add qe_muram_ functions to > > > manage muram > > > > > > On 08/24/2015 08:03 PM, Zhao Qiang wrote: > > > > > > > > > -----Original Message----- > > > > > From: Laura Abbott [mailto:labbott@redhat.com] > > > > > Sent: Tuesday, August 25, 2015 7:32 AM > > > > > To: Zhao Qiang-B45475; Wood Scott-B07421 > > > > > Cc: linux-kernel@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; > > > > > lauraa@codeaurora.org; Xie Xiaobo-R63061; > > > > > benh@kernel.crashing.org; Li Yang-Leo-R58472; paulus@samba.org > > > > > Subject: Re: [PATCH v6 3/3] qe_common: add qe_muram_ functions > > > > > to manage muram > > > > > > > > > > There doesn't seem to be a check for allocation failure from the > > > > > gen_alloc. > > > > > > > > gen_pool_alloc will return 0 if there is error, but if the address > > > > returned is just 0x0, it can't distinguish it is address or error. > > > > > > > > > > Yes, that's a bad limitation of gen_pool. Maybe one day that will > > > get fixed. > > > In a previous out of tree driver, I worked around this by offsetting > > > the gen_pool_add by a constant so any return value was non-zero and > > > out of memory was zero and then subtracting the constant off of the > return value. > > > Not sure if that's better or worse than just fixing gen_alloc. > > > > > > > The workaround works for non alignment allocation, but for alignment > > allocation, It need to align bytes to addr 0, offsetting the > > gen_pool_add maybe make wrong alignment > > It would work if the offset you add is a multiple of the size of muram. The QE apps ask different bytes alignment for different use due to hardware restriction. Why don’t we deal with it in gen_pool_alloc func instead of a workaround? It is more reasonable. > > -Scott ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?