mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ray Jui <ray.jui@broadcom.com>
To: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>,
	Florian Fainelli <f.fainelli@gmail.com>
Cc: Dhananjay Phadke <dphadke@linux.microsoft.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
	Brendan Higgins <brendanhiggins@google.com>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
	linux-i2c <linux-i2c@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lori Hikichi <lori.hikichi@broadcom.com>,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	Wolfram Sang <wsa@kernel.org>
Subject: Re: [PATCH v3 5/6] i2c: iproc: handle master read request
Date: Wed, 4 Nov 2020 10:01:06 -0800	[thread overview]
Message-ID: <97a8d7bf-e877-c03a-f789-16cac9bb2643@broadcom.com> (raw)
In-Reply-To: <CAHO=5PGdcN2V8XOKdtTHwUBJW9eB2mjQ-CeMvwK4Rem7KBy5GA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3141 bytes --]



On 11/3/2020 7:57 PM, Rayagonda Kokatanur wrote:
> On Wed, Nov 4, 2020 at 9:05 AM Florian Fainelli <f.fainelli@gmail.com> wrote:
>>
>>
>>
>> On 11/2/2020 10:19 PM, Dhananjay Phadke wrote:
>>> On Mon,  2 Nov 2020 09:24:32 +0530, Rayagonda Kokatanur wrote:
>>>
>>>> Handle single or multi byte master read request with or without
>>>> repeated start.
>>>>
>>>> Fixes: c245d94ed106 ("i2c: iproc: Add multi byte read-write support for slave mode")
>>>> Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
>>>> ---
>>>>  drivers/i2c/busses/i2c-bcm-iproc.c | 215 +++++++++++++++++++++++------
>>>>  1 file changed, 170 insertions(+), 45 deletions(-)
>>>>
>>>> diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c
>>>> index 7a235f9f5884..22e04055b447 100644
>>>> --- a/drivers/i2c/busses/i2c-bcm-iproc.c
>>>> +++ b/drivers/i2c/busses/i2c-bcm-iproc.c
>>>> @@ -160,6 +160,11 @@
>>>>
>>>>  #define IE_S_ALL_INTERRUPT_SHIFT     21
>>>>  #define IE_S_ALL_INTERRUPT_MASK      0x3f
>>>> +/*
>>>> + * It takes ~18us to reading 10bytes of data, hence to keep tasklet
>>>> + * running for less time, max slave read per tasklet is set to 10 bytes.
>>>> + */
>>>> +#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.


> #define MAX_SLAVE_RX_PER_INT         10
> 
> is not hw fifo threshold level, it is a kind of watermark for the
> tasklet to process the max number of packets in single run.
> The intention to add the macro is to make sure the tasklet does not
> run more than 20us.
> If we keep this as a module parameter or dt parameter then there is a
> good possibility that the number can be set to higher value.
> This will make the tasklet run more than 20us and defeat the purpose.
> 
> This number is constant and not variable to change
> 
> Please feel free to add your comments.
> 
> Best regards,
> Rayagonda
> 
>> --
>> Florian

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4151 bytes --]

  reply	other threads:[~2020-11-04 18:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-02  3:54 [PATCH v3 0/6] fix iproc driver to " Rayagonda Kokatanur
2020-11-02  3:54 ` [PATCH v3 1/6] i2c: iproc: handle Master aborted error Rayagonda Kokatanur
2020-11-02  3:54 ` [PATCH v3 2/6] i2c: iproc: handle only slave interrupts which are enabled Rayagonda Kokatanur
2020-11-02  3:54 ` [PATCH v3 3/6] i2c: iproc: update slave isr mask (ISR_MASK_SLAVE) Rayagonda Kokatanur
2020-11-02  3:54 ` [PATCH v3 4/6] i2c: iproc: fix typo in slave_isr function Rayagonda Kokatanur
2020-11-02  3:54 ` [PATCH v3 5/6] i2c: iproc: handle master read request Rayagonda Kokatanur
2020-11-03  6:19   ` Dhananjay Phadke
2020-11-04  3:35   ` Florian Fainelli
2020-11-04  3:57     ` Rayagonda Kokatanur
2020-11-04 18:01       ` Ray Jui [this message]
2020-11-05  7:46         ` Dhananjay Phadke
2020-11-05  9:43           ` Rayagonda Kokatanur
2020-11-06 17:41             ` Dhananjay Phadke
2020-11-10  4:23               ` Rayagonda Kokatanur
2020-11-10 19:24                 ` Ray Jui
2020-11-14  1:17                   ` Dhananjay Phadke
     [not found]                     ` <CAHO=5PFzd9KTR93ntUvAX5dqzxqJQpVXEirs5uoXdvcnZ7hL4g@mail.gmail.com>
2020-12-02 14:35                       ` Wolfram Sang
2020-12-02 17:44                         ` Ray Jui
2020-12-17  4:08                           ` Rayagonda Kokatanur
2020-12-17 19:11                             ` Ray Jui
2020-12-20  7:13                               ` Rayagonda Kokatanur
2021-01-05 16:21                                 ` Wolfram Sang
2021-01-05 17:46                                   ` Florian Fainelli
2021-01-05 20:50                                     ` Wolfram Sang
2020-12-02 17:43                       ` Ray Jui
2020-11-02  3:54 ` [PATCH v3 6/6] i2c: iproc: handle rx fifo full interrupt Rayagonda Kokatanur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=97a8d7bf-e877-c03a-f789-16cac9bb2643@broadcom.com \
    --to=ray.jui@broadcom.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=brendanhiggins@google.com \
    --cc=dphadke@linux.microsoft.com \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lori.hikichi@broadcom.com \
    --cc=rayagonda.kokatanur@broadcom.com \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome