linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Goswami, Sanket" <Sanket.Goswami@amd.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: jarkko.nikula@linux.intel.com, mika.westerberg@linux.intel.com,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
	Nehal Bakulchandra Shah <Nehal-Bakulchandra.shah@amd.com>
Subject: Re: [PATCH] i2c: add i2c bus driver for amd navi gpu
Date: Fri, 26 Mar 2021 15:53:34 +0530	[thread overview]
Message-ID: <617d0164-1290-250f-ae34-828c6b4b390a@amd.com> (raw)
In-Reply-To: <YFzC19IiGZdmLCOR@smile.fi.intel.com>

Hi Andy,

On 25-Mar-21 22:35, Andy Shevchenko wrote:
> [CAUTION: External Email]
> 
> On Mon, Mar 22, 2021 at 10:26:55PM +0530, Goswami, Sanket wrote:
>> On 09-Mar-21 19:56, Andy Shevchenko wrote:
>>> On Tue, Mar 09, 2021 at 07:01:47PM +0530, Sanket Goswami wrote:
> 
> ...
> 
>>>> +static int amd_i2c_dw_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num_msgs)
>>>
>>> Why do you need a custom function for that? Can it be generic and not AMD
>>> specific?
>> This function takes care of AMD Specific bus configuration for the transfer and
>> also addresses the IP issue of i2c transactions hence it is kept as custom.
> 
> Can you a bit elaborate this? IT would be nice to have a comment in the code
> explaining what is the difference with a generic approach.

This will be addressed in v3.
> 
> ...
> 
>>>> +     /* Enable ucsi interrupt */
>>>> +     if (dev->flags & AMD_NON_INTR_MODE)
>>>> +             regmap_write(dev->map, AMD_UCSI_INTR_REG, AMD_UCSI_INTR_EN);
>>>
>>> This is looks like a hack. Why is it here?
>> In order to enable the interrupt for UCSI i.e. AMD NAVI GPU card,
>> it is mandatory to set the right value in specific register
>> (offset:0x474) as per the hardware IP specification.
> 
> Why it can not be done outside of this function?


This will be addressed in v3.
> 
> ...
> 
>>>> +     if (dev->flags & AMD_NON_INTR_MODE)
>>>> +             return amd_i2c_dw_master_xfer(adap, msgs, num);
>>>
>>> Ditto.
>> Initiate I2C message transfer when AMD NAVI GPU card is enabled,
>> As it is polling based transfer mechanism, which does not support
>> interrupt based functionalities of existing DesignWare driver.
> 
> Ditto.
> 
> And I think I already have told you that I prefer to see rather MODEL_ quirk.

I did not find MODEL_ quirk reference in the PCI device tree, It is actually
used in platform device tree which is completely different from our PCI
based configuration, can you please provide some reference of MODEL_ quirk
which will be part of the PCI device tree?
> 
> ...
> 
>>> Also why (1) and this can't be instantiated from ACPI / DT?
>> It is in line with the existing PCIe-based DesignWare driver,
>> A similar approach is used by the various vendors.
> 
> Here is no answer to the question. What prevents you to fix your ACPI tables or
> DT?
> 
> We already got rid of FIFO hard coded values, timings are harder to achieve,
> but we expect that new firmwares will provide values in the ACPI tables.

AMD NAVI GPU card is the PCI initiated driver, not ACPI initiated, and also
It does not contain a corresponding ACPI match table. Moreover, AMD  NAVI GPU
based products are already in the commercial market hence going by this
approach will break the functionalities for the same.
> 
> --
> With Best Regards,
> Andy Shevchenko
> 
> 
Thanks,
Sanket

  reply	other threads:[~2021-03-26 10:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 13:31 [PATCH] i2c: add i2c bus driver for amd navi gpu Sanket Goswami
2021-03-09 14:23 ` kernel test robot
2021-03-09 14:26 ` Andy Shevchenko
2021-03-22 16:56   ` Goswami, Sanket
2021-03-25 17:05     ` Andy Shevchenko
2021-03-26 10:23       ` Goswami, Sanket [this message]
2021-03-26 10:40         ` Andy Shevchenko
2021-03-29  5:55           ` Goswami, Sanket
2021-03-29 12:36             ` Andy Shevchenko
2021-03-09 15:35 ` kernel test robot
2021-03-09 15:36 ` kernel test robot

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=617d0164-1290-250f-ae34-828c6b4b390a@amd.com \
    --to=sanket.goswami@amd.com \
    --cc=Nehal-Bakulchandra.shah@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).