Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp304321pxb; Wed, 4 Nov 2020 23:50:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyYLOXgeZ95a7MiHlhxBlZ7I3j4Qr87ErJglmfOzRPMO8BkF644z/VW2/uaWttAXTLzSVpF X-Received: by 2002:aa7:c7cf:: with SMTP id o15mr1220280eds.15.1604562603979; Wed, 04 Nov 2020 23:50:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604562603; cv=none; d=google.com; s=arc-20160816; b=dq6LzlJWnJeYuR82FFb/+wFYai3vTKTer3f0RxwbTytKTvdhJHUcKqjcMb+YDxhEKY iMw/BZu/MjheeZCfzIGKzda2gmj+XO6x0vvwvEqtaSkUrN879Y7rO+hf2klMsgU/I5M1 u+L8ZqhDL3U4fy8JtczEg8HnE1dSaJmf0Xdn8Jn6RuaYX7+fn1/j4FmlGswYN3MKbQWM eIgtiBEY72oQl7T7ASoeKFiZfdUbFouJ5ObPLukxsWtQO3HX0Qvrwterb1c+inmrWsSP GRUUTM1e7DG51h9lIBMb2JZEF/u9/UKO5RrQ8DmljveeExTzNTVBofC6QgYEQs6E2hqx 50Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature:dkim-filter; bh=+4vC5pdHWhZcsC4RLqsaXzruecfzwJvr9SPbBGML92k=; b=ToqcK1zsp0sX/IRTEQRBCofyuH6w8WszuEyUQwvddmtvti4b37IoIKmDMzhDG/4seh 9dt/V/VU0jUKif7Cr99sLemado1e+wU9dUwBX6KjcXWWXjsitpU0zmxcUK9GLLnwX3xH MzJyxNGjvTt8cQLZmLg9bzNlS7QACXCBKCTD9GtGrWx9xrKa5hO3ZI5sP/U5QwY0ur+Y DwAegLXUFYJ8NYrm0Sg2AngLhtrrX6fj993cl49Aw+yKQ3493FS2qpSyVXXeAI08PiKx i+SFvqCfHXyf+RsCl9VW8bBb2l7/lnrQ9pGju9sRwMYhxRUD7Xg4BVR/yNCN3YHP1pHB Nl+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=PUIS5sSO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si689597ejm.389.2020.11.04.23.49.41; Wed, 04 Nov 2020 23:50:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=PUIS5sSO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729068AbgKEHqq (ORCPT + 99 others); Thu, 5 Nov 2020 02:46:46 -0500 Received: from linux.microsoft.com ([13.77.154.182]:49522 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725320AbgKEHqq (ORCPT ); Thu, 5 Nov 2020 02:46:46 -0500 Received: by linux.microsoft.com (Postfix, from userid 1046) id 5B48D20B4905; Wed, 4 Nov 2020 23:46:45 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5B48D20B4905 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1604562405; bh=+4vC5pdHWhZcsC4RLqsaXzruecfzwJvr9SPbBGML92k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PUIS5sSOund47b2bGCatf6rcJhvYsR39zR8hdPoD83WmfHmrpB6rxs14MbPhsoEd0 KFNmGAaZHP9tI4uCmlbnRUskomHcymw9Iya0xpHsON9Wgsm0Eu8BBtKoryEpgkXCdR nF4PlSCGPSYxyH65Bt0DWHlMENv9ctS8mwcvB7R0= From: Dhananjay Phadke To: ray.jui@broadcom.com Cc: andriy.shevchenko@linux.intel.com, bcm-kernel-feedback-list@broadcom.com, brendanhiggins@google.com, dphadke@linux.microsoft.com, f.fainelli@gmail.com, linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, lori.hikichi@broadcom.com, rayagonda.kokatanur@broadcom.com, rjui@broadcom.com, sbranden@broadcom.com, wsa@kernel.org Subject: Re: [PATCH v3 5/6] i2c: iproc: handle master read request Date: Wed, 4 Nov 2020 23:46:45 -0800 Message-Id: <1604562405-25414-1-git-send-email-dphadke@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <97a8d7bf-e877-c03a-f789-16cac9bb2643@broadcom.com> References: <97a8d7bf-e877-c03a-f789-16cac9bb2643@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Nov 2020 10:01:06 -0800, Ray Jui wrote: >>>> +#define MAX_SLAVE_RX_PER_INT 10 >>>> >>> >>>> In patch [3/6], you've enabled IS_S_RX_THLD_SHIFT in slave ISR bitmask, >>>> however it's not actually used in processing rx events. >>>> >>>> Instead of hardcoding this threshold here, it's better to add a >>>> device-tree knob for rx threshold, program it in controller and handle >>>> that RX_THLD interrupt. This will give more flexibility to drain the rx >>>> fifo earlier than - >>>> (1) waiting for FIFO_FULL interrupt for transactions > 64B. >>>> (2) waiting for start of read transaction in case of master write-read. >> >> Yes this is one way to implement. >> But do you see any issue in batching 64 bytes at a time in case of >> transaction > 64 Bytes. >> I feel batching will be more efficient as it avoids more number of >> interrupts and hence context switch. >> >>> >>> The Device Tree is really intended to describe the hardware FIFO size, >>> not watermarks, as those tend to be more of a policy/work load decision. >>> Maybe this is something that can be added as a module parameter, or >>> configurable via ioctl() at some point. >> > >Yes, DT can have properties to describe the FIFO size, if there happens >to be some variants in the HW blocks in different versions. But that is >not the case here. DT should not be used to control SW/use case specific >behavior. So the suggestion was to set HW threshold for rx fifo interrupt, not really a SW property. By setting it in DT, makes it easier to customize for target system, module param needs or ioctl makes it dependent on userpsace to configure it. The need for tasklet seems to arise from the fact that many bytes are left in the fifo. If there's a common problem here, such tasklet would be needed in i2c subsys rather than controller specific tweak, akin to how networking uses NAPI or adding block transactions to the interface? For master write-read event, it seems both IS_S_RD_EVENT_SHIFT and IS_S_RX_EVENT_SHIFT are detected, which implies that core is late to drain rx fifo i.e. write is complete and the read has started on the bus? Thanks, Dhananjay