[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4da2b68-e6e3-e068-cd6e-9e638aa67889@roeck-us.net>
Date: Thu, 13 Sep 2018 20:48:09 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Cédric Le Goater <clg@...d.org>
Cc: Jae Hyun Yoo <jae.hyun.yoo@...ux.intel.com>,
Joel Stanley <joel@....id.au>, linux-aspeed@...ts.ozlabs.org,
Vernon Mauery <vernon.mauery@...ux.intel.com>,
OpenBMC Maillist <openbmc@...ts.ozlabs.org>,
Brendan Higgins <brendanhiggins@...gle.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-i2c@...r.kernel.org, jarkko.nikula@...ux.intel.com,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
James Feist <james.feist@...ux.intel.com>
Subject: Re: [PATCH i2c-next v6] i2c: aspeed: Handle master/slave combined irq
events properly
On 09/13/2018 09:35 AM, Cédric Le Goater wrote:
> On 09/13/2018 05:57 PM, Guenter Roeck wrote:
>> On Thu, Sep 13, 2018 at 05:48:59PM +0200, Cédric Le Goater wrote:
>>> On 09/13/2018 03:33 PM, Guenter Roeck wrote:
>> [ ... ]
>>>>>> /*
>>>>>> * The state machine needs some refinement. It is only used to track
>>>>>> * invalid STOP commands for the moment.
>>>>>> @@ -188,7 +215,7 @@ static void aspeed_i2c_bus_handle_cmd(AspeedI2CBus *bus, uint64_t value)
>>>>>> {
>>>>>> bus->cmd &= ~0xFFFF;
>>>>>> bus->cmd |= value & 0xFFFF;
>>>>>> - bus->intr_status = 0;> + bus->intr_status &= I2CD_INTR_RX_DONE;
>>>>>
>>>>> it deserves a comment to understand which scenario we are trying to handle.
>>>>>
>>>>
>>>> Ok. FWIW, I wonder if intr_status should be touched here in the first place,
>>>> but I neither have the hardware nor a datasheet, so I don't know if any bits
>>>> are auto-cleared.
>>>
>>> I just pushed a patch on my branch with some more explanation :
>>>
>>> https://github.com/legoater/qemu/commits/aspeed-3.1
>>>
>> That seems to suggest that none of the status bits auto-clears, and that
>> the above code clearing intr_status should be removed entirely.
>> Am I missing something ?
>
> You are right. I just pushed another version of the previous patch with this
> new hunk :
>
> @@ -188,7 +200,6 @@ static void aspeed_i2c_bus_handle_cmd(As
> {
> bus->cmd &= ~0xFFFF;
> bus->cmd |= value & 0xFFFF;
> - bus->intr_status = 0;
>
> if (bus->cmd & I2CD_M_START_CMD) {
> uint8_t state = aspeed_i2c_get_state(bus) & I2CD_MACTIVE ?
>
>
> The QEMU palmetto and witherspoon machines seem to behave fine. Can you give
> it a try ?
>
Works fine for me for all affected qemu platforms.
How do you want to proceed with the qemu patches ? I attached my patches
for reference. Maybe you can add them to your tree if they are ok and submit
the entire series together to the qemu mailing list ?
Thanks,
Guenter
View attachment "0001-aspeed-i2c-Handle-receive-command-in-separate-functi.patch" of type "text/x-patch" (2454 bytes)
View attachment "0002-aspeed-i2c-Fix-receive-done-interrupt-handling.patch" of type "text/x-patch" (2349 bytes)
Powered by blists - more mailing lists