public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Jan Dabros <jsd@semihalf.com>
Cc: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org,
	jarkko.nikula@linux.intel.com, mika.westerberg@linux.intel.com,
	hdegoede@redhat.com, wsa@kernel.org, rrangel@chromium.org,
	mw@semihalf.com, jaz@semihalf.com, upstream@semihalf.com,
	thomas.lendacky@amd.com, alexander.deucher@amd.com,
	Nimesh.Easow@amd.com, mario.limonciello@amd.com
Subject: Re: [PATCH v4 2/2] i2c: designware: Add AMD PSP I2C bus support
Date: Wed, 9 Feb 2022 17:27:31 +0200	[thread overview]
Message-ID: <YgPdYw6hDoN198Hf@smile.fi.intel.com> (raw)
In-Reply-To: <20220208141218.2049591-3-jsd@semihalf.com>

On Tue, Feb 08, 2022 at 03:12:18PM +0100, Jan Dabros wrote:

...

I have noticed code duplication.

> +	status = psp_send_i2c_req(PSP_I2C_REQ_ACQUIRE);
> +	if (status) {
> +		if (status == -ETIMEDOUT)
> +			dev_err(psp_i2c_dev, "Timed out waiting for PSP to release I2C bus\n");
> +		else
> +			dev_err(psp_i2c_dev, "PSP communication error\n");
> +
> +		dev_err(psp_i2c_dev, "Assume i2c bus is for exclusive host usage\n");
> +		psp_i2c_mbox_fail = true;
> +		goto cleanup;
> +	}

> +	/* Send a release command to PSP */
> +	status = psp_send_i2c_req(PSP_I2C_REQ_RELEASE);
> +	if (status) {
> +		if (status == -ETIMEDOUT)
> +			dev_err(psp_i2c_dev, "Timed out waiting for PSP to acquire I2C bus\n");
> +		else
> +			dev_err(psp_i2c_dev, "PSP communication error\n");
> +
> +		dev_err(psp_i2c_dev, "Assume i2c bus is for exclusive host usage\n");
> +		psp_i2c_mbox_fail = true;
> +		goto cleanup;
> +	}

If you are going to update the series, consider to introduce a common helper.
Otherwise, consider a follow up.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2022-02-09 15:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 14:12 [PATCH v4 0/2] i2c-designware: Add support for AMD PSP semaphore Jan Dabros
2022-02-08 14:12 ` [PATCH v4 1/2] i2c: designware: Add missing locks Jan Dabros
2022-02-09 15:01   ` Jarkko Nikula
2022-02-09 15:23   ` Andy Shevchenko
2022-02-10 22:08   ` Wolfram Sang
2022-02-10 23:05     ` Jan Dąbroś
2022-02-08 14:12 ` [PATCH v4 2/2] i2c: designware: Add AMD PSP I2C bus support Jan Dabros
2022-02-09 15:27   ` Andy Shevchenko [this message]
2022-02-10  8:18     ` Jan Dąbroś
2022-02-10 14:43       ` Jarkko Nikula
2022-02-10 15:04         ` Jan Dąbroś
2022-02-10 22:09   ` Wolfram Sang
2022-02-10 23:05     ` Jan Dąbroś
2022-02-11  9:56       ` Wolfram Sang
2022-02-09 15:11 ` [PATCH v4 0/2] i2c-designware: Add support for AMD PSP semaphore Jarkko Nikula
2022-02-10  8:13   ` Jan Dąbroś

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=YgPdYw6hDoN198Hf@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=Nimesh.Easow@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=hdegoede@redhat.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=jaz@semihalf.com \
    --cc=jsd@semihalf.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=mw@semihalf.com \
    --cc=rrangel@chromium.org \
    --cc=thomas.lendacky@amd.com \
    --cc=upstream@semihalf.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