public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Wolfram Sang <wsa@kernel.org>, Andi Shyti <andi.shyti@kernel.org>,
	linux-i2c@vger.kernel.org
Subject: Re: [PATCH v2] i2c: i801: fix cleanup code in remove() and error path of probe()
Date: Wed, 6 Sep 2023 13:47:45 +0200	[thread overview]
Message-ID: <20230906134745.24dfa076@endymion.delvare> (raw)
In-Reply-To: <3d5143c3-9a6c-2107-62e4-5f328ce7ea26@gmail.com>

Hi Heiner, Wolfram,

On Sat, 02 Sep 2023 22:06:14 +0200, Heiner Kallweit wrote:
> Jean pointed out that the referenced patch resulted in the remove()
> path not having the reverse order of calls in probe(). I think there's
> more to be done to ensure proper cleanup.
> Especially cleanup in the probe() error path has to be extended.
> Not every step there may be strictly needed, but it's in line with
> remove() now.

This last sentence no longer applies to this version of the patch.

> Fixes: 9b5bf5878138 ("i2c: i801: Restore INTREN on unload")
> Fixes: 9424693035a5 ("i2c: i801: Create iTCO device on newer Intel PCHs")
> Cc: stable@vger.kernel.org

I wouldn't cc stable. For one thing, this patch doesn't fix a bug that
actually bothers people. Error paths are rarely taken, and driver
removal isn't that frequent either. Consequences are also rather
harmless (one-time resource leak, race condition which is quite
unlikely to trigger).

For another, this patch is a mix of 2 bug fixes (SMBHSTCNT being
restored too early in i801_remove, resource leak in error path of
i801_probe) which have been added in very different kernel versions
(v5.16 and v4.3, respectively), and tidying up (the reordering of some
of the statements in i801_remove is nice for consistency but is not
actually fixing any bug).

If you really want to push the fixes to stable, you'd have to split the
patch in 3 pieces, one for each fix (going to stable), and one for the
remainder (not going to stable). Otherwise it makes backporting to
older kernels error-prone and time-consuming. Considering how harmless
the bugs are in the first place, my position is that the extra work is
simply not worth it.

> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> v2:
> - add Fixes tag for 9424693035a5
> - remove restoring SMBHSTCNT from probe error path
> - move restoring SMBHSTCNT to the end in remove/shutdown
> ---
>  drivers/i2c/busses/i2c-i801.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> (...)

That being said, the patch itself looks good to me, and I have tested
it too.

Reviewed-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jean Delvare <jdelvare@suse.de>

Thanks,
-- 
Jean Delvare
SUSE L3 Support

  reply	other threads:[~2023-09-06 11:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-02 20:06 [PATCH v2] i2c: i801: fix cleanup code in remove() and error path of probe() Heiner Kallweit
2023-09-06 11:47 ` Jean Delvare [this message]
2023-09-06 14:13   ` Andi Shyti
2023-09-06 15:47     ` Jean Delvare
2023-09-06 18:25       ` Andi Shyti
2023-09-07  5:45         ` Heiner Kallweit
2023-09-14 21:05           ` Heiner Kallweit

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=20230906134745.24dfa076@endymion.delvare \
    --to=jdelvare@suse.de \
    --cc=andi.shyti@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=linux-i2c@vger.kernel.org \
    --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