[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANg-bXANgkrF4T4X_VgeVejA2wH3GrUiFORyRC4AZfgYrE+7DQ@mail.gmail.com>
Date: Wed, 22 Mar 2023 11:01:44 -0600
From: Mark Hasemeyer <markhas@...omium.org>
To: Mario Limonciello <mario.limonciello@....com>
Cc: Grzegorz Bernacki <gjb@...ihalf.com>,
Jarkko Nikula <jarkko.nikula@...ux.intel.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Jan Dabros <jsd@...ihalf.com>, Held Felix <Felix.Held@....com>,
linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 3/3] i2c: designware: Add doorbell support for Mendocino
> +static int psp_send_i2c_req_mendocino(enum psp_i2c_req_type i2c_req_type)
> +{
> + int status, ret;
> +
> + ret = read_poll_timeout(psp_ring_platform_doorbell, status,
> + (status != -EBUSY),
> + PSP_I2C_REQ_RETRY_DELAY_US,
> + PSP_I2C_REQ_RETRY_CNT * PSP_I2C_REQ_RETRY_DELAY_US,
> + 0, i2c_req_type);
> + if (ret)
> + dev_err(psp_i2c_dev, "Timed out waiting for PSP to %s I2C bus\n",
> + (i2c_req_type == PSP_I2C_REQ_ACQUIRE) ?
> + "release" : "acquire");
> +
> + return ret ? ret : status;
> +}
I think we need the value of the PSP_CMDRESP_STS field returned to the caller
and its status checked like in psp_send_i2c_req_cezanne. Otherwise the function
won't continue to poll when the PSP_I2C_REQ_STS_BUS_BUSY bit is set.
FYI - there's a test on ChromeOS to stress test I2C bus arbitration:
https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/tast-tests/src/chromiumos/tast/local/bundles/cros/hwsec/tpm_contest.go
I can try to run it assuming the ToT kernel runs on skyrim.
Powered by blists - more mailing lists