public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: "Mario Limonciello (AMD) (kernel.org)" <superm1@kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Jan Dabros <jsd@semihalf.com>, Andi Shyti <andi.shyti@kernel.org>,
	Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	Kees Cook <kees@kernel.org>,
	Sami Tolvanen <samitolvanen@google.com>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH] i2c: designware: Remove i2c_dw_remove_lock_support()
Date: Tue, 14 Oct 2025 17:53:06 -0500	[thread overview]
Message-ID: <20251014225306.GA915466@bhelgaas> (raw)
In-Reply-To: <20251014223955.GB3575477@ax162>

On Tue, Oct 14, 2025 at 03:39:55PM -0700, Nathan Chancellor wrote:
> On Tue, Oct 14, 2025 at 04:58:56PM -0500, Mario Limonciello (AMD) (kernel.org) wrote:
> > On 10/14/2025 3:33 PM, Bjorn Helgaas wrote:
> > > I'm totally fine with the patch itself, but I think the commit log
> > > could be trimmed to something like the following with no loss:
> > > 
> > >    Remove struct i2c_dw_semaphore_callbacks.remove() and
> > >    i2c_dw_remove_lock_support().
> > > 
> > >    440da737cf8d ("i2c: designware: Use PCI PSP driver for
> > >    communication") removed the last place that set
> > >    i2c_dw_semaphore_callbacks.remove(), which made
> > >    i2c_dw_remove_lock_support() a no-op.
> > > 
> > >    This has the side effect of avoiding this kCFI warning (see Link):
> > > 
> > >      dw_i2c_plat_remove+0x3c: no-cfi indirect call!
> > > 
> > >    Link: https://lore.kernel.org/r/20251013-dw_i2c_plat_remove-avoid-objtool-no-cfi-warning-v1-1-8cc4842967bf@kernel.org
> > > 
> > > FWIW,
> > > Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
> > 
> > I echo Bjorn's comments on the lengthy commit message.
> > Code change looks fine.
> > 
> > Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> 
> I have no objections to trimming the commit message if so desired but I
> think the solution (removing unused code) is more tangential to the
> problem (potentially accessing an array out of bounds). I am sometimes
> looking at changes from ten years ago where something was done to avoid
> a problem but the problem was never mentioned in the message but may
> have been elsewhere. Maybe nobody ever needs .remove() again but what if
> new IP comes out that necessitates it and they go to revert this change
> without avoiding this problem? I could try to make the analysis shorter
> if that would help.

OK, I missed that there was an out-of-bounds array access involved.
Maybe that warrants more details.

Bjorn

  reply	other threads:[~2025-10-14 22:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-14  1:05 [PATCH] i2c: designware: Remove i2c_dw_remove_lock_support() Nathan Chancellor
2025-10-14 20:33 ` Bjorn Helgaas
2025-10-14 21:58   ` Mario Limonciello (AMD) (kernel.org)
2025-10-14 22:39     ` Nathan Chancellor
2025-10-14 22:53       ` Bjorn Helgaas [this message]
2025-10-14 21:10 ` Kees Cook
2025-10-15 20:47 ` Andi Shyti
2025-10-23  6:29 ` Andy Shevchenko
2025-10-23 16:37   ` Nathan Chancellor

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=20251014225306.GA915466@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=andi.shyti@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jsd@semihalf.com \
    --cc=justinstitt@google.com \
    --cc=kees@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mika.westerberg@linux.intel.com \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=samitolvanen@google.com \
    --cc=superm1@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