public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Asmaa Mnebhi <asmaa@nvidia.com>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	Khalil Blaiech <kblaiech@nvidia.com>
Subject: Re: [PATCH v3 5/9] i2c-mlxbf.c: support lock mechanism
Date: Sat, 17 Sep 2022 20:25:30 +0200	[thread overview]
Message-ID: <YyYRGuXeXAT4FH0L@shikoro> (raw)
In-Reply-To: <20220908173544.32615-6-asmaa@nvidia.com>

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


> +	/* Try to acquire the smbus gw lock before any reads of the GW register since
> +	 * a read sets the lock.
> +	 */

Please use kernel multiline comment style.

> @@ -792,6 +824,8 @@ mlxbf_i2c_smbus_start_transaction(struct mlxbf_i2c_priv *priv,
>  			priv->smbus->io + MLXBF_I2C_SMBUS_MASTER_FSM);
>  	}

Dunno if this is taste, but I think it is easier to follow the locking
when we have central acquire and release points for it. So, I'd suggest
to add something like

out_unlock:

here and then goto to this place from the other locations.

What do you think?

>  
> +	mlxbf_i2c_smbus_master_unlock(priv);
> +
>  	return ret;

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-09-17 18:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 17:35 [PATCH v3 0/9] i2c-mlxbf.c: bug fixes and new feature support Asmaa Mnebhi
2022-09-08 17:35 ` [PATCH v3 1/9] i2c-mlxbf.c: Fix frequency calculation Asmaa Mnebhi
2022-09-17 18:07   ` Wolfram Sang
2022-09-08 17:35 ` [PATCH v3 2/9] i2c-mlxbf.c: remove IRQF_ONESHOT Asmaa Mnebhi
2022-09-17 18:21   ` Wolfram Sang
2022-09-08 17:35 ` [PATCH v3 3/9] i2c-mlxbf.c: incorrect base address passed during io write Asmaa Mnebhi
2022-09-17 18:12   ` Wolfram Sang
2022-09-08 17:35 ` [PATCH v3 4/9] i2c-mlxbf: prevent stack overflow in mlxbf_i2c_smbus_start_transaction() Asmaa Mnebhi
2022-09-17 18:14   ` Wolfram Sang
2022-09-08 17:35 ` [PATCH v3 5/9] i2c-mlxbf.c: support lock mechanism Asmaa Mnebhi
2022-09-17 18:25   ` Wolfram Sang [this message]
2022-09-19 12:50     ` Asmaa Mnebhi
2022-09-08 17:35 ` [PATCH v3 6/9] i2c-mlxbf.c: Update SPDX license Asmaa Mnebhi
2022-09-17 18:30   ` Wolfram Sang
2022-09-19 12:51     ` Asmaa Mnebhi
2022-09-08 17:35 ` [PATCH v3 7/9] i2c-mlxbf: add multi slave functionality Asmaa Mnebhi
2022-09-08 17:35 ` [PATCH v3 8/9] i2c-mlxbf.c: support BlueField-3 SoC Asmaa Mnebhi
2022-09-08 17:35 ` [PATCH v3 9/9] i2c-mlxbf.c: Update binding devicetree Asmaa Mnebhi
2022-09-17 18:34   ` Wolfram Sang

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=YyYRGuXeXAT4FH0L@shikoro \
    --to=wsa+renesas@sang-engineering.com \
    --cc=asmaa@nvidia.com \
    --cc=kblaiech@nvidia.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.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