Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932115AbcLLTf0 (ORCPT ); Mon, 12 Dec 2016 14:35:26 -0500 Received: from smtprelay0110.hostedemail.com ([216.40.44.110]:44037 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752807AbcLLTfY (ORCPT ); Mon, 12 Dec 2016 14:35:24 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 10,1,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:2716:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3872:4250:4321:5007:10004:10400:10848:11026:11232:11658:11783:11914:12740:13069:13161:13229:13311:13357:13439:13894:14659:14721:21080:30054:30055:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: paste53_2ea994443665f X-Filterd-Recvd-Size: 2083 Message-ID: <1481571319.1764.32.camel@perches.com> Subject: Re: [PATCH V3] i2c: designware: fix wrong tx/rx fifo for ACPI From: Joe Perches To: Mika Westerberg , Andy Shevchenko Cc: Tin Huynh , Jarkko Nikula , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Loc Ho , Thang Nguyen , Phong Vo , patches@apm.com Date: Mon, 12 Dec 2016 11:35:19 -0800 In-Reply-To: <20161212192113.GA1460@lahna.fi.intel.com> References: <1481531810-31695-1-git-send-email-tnhuynh@apm.com> <1481569373.7188.48.camel@linux.intel.com> <20161212192113.GA1460@lahna.fi.intel.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.1-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 905 Lines: 22 On Mon, 2016-12-12 at 21:21 +0200, Mika Westerberg wrote: > On Mon, Dec 12, 2016 at 09:02:53PM +0200, Andy Shevchenko wrote: > > > + tx_fifo_depth = ((param1 >> 16) & 0xff) + 1; > > > + rx_fifo_depth = ((param1 >> 8)??& 0xff) + 1; > > > + if (!dev->tx_fifo_depth) { > > > + dev->tx_fifo_depth = tx_fifo_depth; > > > + dev->rx_fifo_depth = rx_fifo_depth; > > > + } else if (tx_fifo_depth) { > > > + dev->tx_fifo_depth = min_t(u32, dev->tx_fifo_depth, > > > + tx_fifo_depth); > > > + dev->rx_fifo_depth = min_t(u32, dev->rx_fifo_depth, > > > + rx_fifo_depth); > > > + } > > > > So, let's clarify here: > > Is it possible to have an IP without parameter block enabled? I mean to > > read something arbitrary (or zeroes, or all-ones) from param1. > > Yes and it is Intel IP. Haswell IIRC and it returned zeroes. The "+ 1" in the first set of tx_fifo_depth makes the "else if" check unnecessary.