Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752512AbcCBIGG (ORCPT ); Wed, 2 Mar 2016 03:06:06 -0500 Received: from mail-sn1nam02on0057.outbound.protection.outlook.com ([104.47.36.57]:30496 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750977AbcCBIGD (ORCPT ); Wed, 2 Mar 2016 03:06:03 -0500 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Subject: Re: [RFC PATCH] drivers: ata: Read Rx water mark value from device-tree To: Anurag Kumar Vulisha , Rob Herring , Arnd Bergmann , =?UTF-8?Q?S=c3=b6ren_Brinkmann?= References: <1455974302-7082-1-git-send-email-anuragku@xilinx.com> <18251200.Xfr10N5eWq@wuerfel> <3802E9A6666DF54886E2B9CBF743BA9825E01009@XAP-PVEXMBX01.xlnx.xilinx.com> <8540232.vQE3WQTD95@wuerfel> <3802E9A6666DF54886E2B9CBF743BA9825E0117F@XAP-PVEXMBX01.xlnx.xilinx.com> <20160223192942.GA6235@rob-hp-laptop> <3802E9A6666DF54886E2B9CBF743BA9825E025F6@XAP-PVEXMBX01.xlnx.xilinx.com> CC: "pawel.moll@arm.com" , "mark.rutland@arm.com" , "ijc+devicetree@hellion.org.uk" , "galak@codeaurora.org" , "tj@kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-ide@vger.kernel.org" , Anirudha Sarangi , Srikanth Vemula , "Punnaiah Choudary Kalluri" From: Michal Simek Message-ID: <56D69EDD.40400@xilinx.com> Date: Wed, 2 Mar 2016 09:05:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <3802E9A6666DF54886E2B9CBF743BA9825E025F6@XAP-PVEXMBX01.xlnx.xilinx.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22166.006 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.100;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(377454003)(199003)(24454002)(76104003)(189002)(13464003)(164054003)(50466002)(11100500001)(4001350100001)(36756003)(5001770100001)(5008740100001)(83506001)(19580395003)(6806005)(19580405001)(3900700001)(2950100001)(87936001)(93886004)(106466001)(230700001)(76176999)(65806001)(47776003)(65956001)(77096005)(1220700001)(586003)(4001450100002)(107886002)(92566002)(4001430100002)(54356999)(23746002)(5001960100004)(33656002)(64126003)(189998001)(50986999)(63266004)(1096002)(86362001)(2906002)(81156009)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1NAM02HT201;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;MLV:sfv;A:1;MX:1;LANG:en; X-MS-Office365-Filtering-Correlation-Id: c38916a2-5574-4dcd-1fb9-08d342717e2b X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501002);SRVR:CY1NAM02HT201; X-Microsoft-Antispam-PRVS: <1d820a97fb954aadb6324016af8c7da8@CY1NAM02HT201.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(13018025)(13017025)(8121501046)(13015025)(13023025)(13024025)(3002001)(10201501046);SRVR:CY1NAM02HT201;BCL:0;PCL:0;RULEID:;SRVR:CY1NAM02HT201; X-Forefront-PRVS: 086943A159 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2016 08:05:59.8927 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1NAM02HT201 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4515 Lines: 107 Hi Rob and Arnd, On 2.3.2016 06:53, Anurag Kumar Vulisha wrote: > + Michal > >> -----Original Message----- >> From: Anurag Kumar Vulisha >> Sent: Friday, February 26, 2016 7:18 PM >> To: 'Rob Herring' >> Cc: Arnd Bergmann; pawel.moll@arm.com; mark.rutland@arm.com; >> ijc+devicetree@hellion.org.uk; galak@codeaurora.org; tj@kernel.org; >> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux- >> ide@vger.kernel.org; Anirudha Sarangi; Srikanth Vemula; Punnaiah Choudary >> Kalluri >> Subject: RE: [RFC PATCH] drivers: ata: Read Rx water mark value from device- >> tree >> >> Hi Rob, >> >>> -----Original Message----- >>> From: Rob Herring [mailto:robh@kernel.org] >>> Sent: Wednesday, February 24, 2016 1:00 AM >>> To: Anurag Kumar Vulisha >>> Cc: Arnd Bergmann; pawel.moll@arm.com; mark.rutland@arm.com; >>> ijc+devicetree@hellion.org.uk; galak@codeaurora.org; tj@kernel.org; >>> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux- >>> ide@vger.kernel.org; Anirudha Sarangi; Srikanth Vemula; Punnaiah >>> Choudary Kalluri >>> Subject: Re: [RFC PATCH] drivers: ata: Read Rx water mark value from >>> device- tree >>> >>> On Tue, Feb 23, 2016 at 03:29:55PM +0000, Anurag Kumar Vulisha wrote: >>>> Hi Arnd, >>>> >>>>> -----Original Message----- >>>>> From: Arnd Bergmann [mailto:arnd@arndb.de] >>>>> Sent: Tuesday, February 23, 2016 3:51 PM >>>>> To: Anurag Kumar Vulisha >>>>> Cc: robh+dt@kernel.org; pawel.moll@arm.com; >> mark.rutland@arm.com; >>>>> ijc+devicetree@hellion.org.uk; galak@codeaurora.org; >>>>> ijc+tj@kernel.org; >>>>> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux- >>>>> ide@vger.kernel.org; Anirudha Sarangi; Srikanth Vemula; Punnaiah >>>>> Choudary Kalluri >>>>> Subject: Re: [RFC PATCH] drivers: ata: Read Rx water mark value >>>>> from >>>>> device- tree >>>>> >>>>> On Tuesday 23 February 2016 05:58:32 Anurag Kumar Vulisha wrote: >>>>>>> >>>>>>> I don't know what is appropriate because I have no idea what >>>>>>> Rxwatermark is good for. Can you try describing why we can't >>>>>>> just set it to the correct value for everyone automatically? >>>>>>> >>>>>> >>>>>> This RX watermark level sets the minimum number of free >>>>>> locations within the RX FIFO .When the rx fifo level crosses the >>>>>> programmed watermark level ,sata controller will transmit HOLDS >>>>>> to the device asking it >>>>> to wait. This happens when dma reads the rx fifo data slower than >>>>> the device is sending the data. Note that it can take some time >>>>> for the HOLDs to get to the other end and in the time there must >>>>> be enough room in the FIFO to absorb all data that could arrive >>>>> from the >>> device. >>>>>> Currently we are using 0x40 for this value, which works fine >>>>>> with all hardware designs we are currently having. But hoping >>>>>> that this value may vary for future silicon versions, I wanted >>>>>> to make this as a configurable >>>>> value. So for this reason I thought of moving it either to >>>>> device-tree or making it as a module_param() property. >>>>>> >>>>> >>>>> Ok, so if this depends on the silicon version, your initial >>>>> approach would be better than the module_param. >>>>> >>>>> I would probably make this dependent on the compatible string >>>>> instead, and have a table in the device driver that uses a >>>>> specific value for each variant of the device, but either way should be >> fine. >>>>> >>>>> Having a separate property is most appropriate if for each >>>>> hardware revision there is exactly one ideal value, while a table >>>>> in the driver makes more sense if this takes a bit of tuning and >>>>> the driver might choose to optimize it differently based on other >>>>> constraints, such as its own interrupt handler implementation. that 0x40 is value choose based on testing that it is not causing any visible problem and this is used as default value in the driver (PTC_RX_WM_VAL - ahci_ceva.c) Values which you can setup are in range 0x0 - 0x7f (7bits). It means hardware fifo size is probably 0x80. And this dt/module parameter is IMHO just sw setting setup by user. It means I am not quite sure that this is DT parameter because it is just SW setting. I expect this range will be valid for all silicon revisions. If happen that any silicon revision can't setup certain level because of HW bug we can handle it via DT parameter or specific compatible string. But setting up watermark SW level via DT doesn't look correct to me. Please let me know what you think. Thanks, Michal