All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@kernel.org>
To: Robert Hancock <robert.hancock@calian.com>
Cc: Michal Simek <michal.simek@amd.com>,
	Andi Shyti <andi.shyti@kernel.org>,
	Shubhrajyoti Datta <shubhraj@xilinx.com>,
	Marek Vasut <marex@denx.de>,
	linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i2c: xiic: Don't try to handle more interrupt events after error
Date: Thu, 6 Jul 2023 21:33:03 +0200	[thread overview]
Message-ID: <ZKcW7yh4gGKUCRvS@shikoro> (raw)
In-Reply-To: <20230606182558.1301413-1-robert.hancock@calian.com>

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

On Tue, Jun 06, 2023 at 12:25:58PM -0600, Robert Hancock wrote:
> In xiic_process, it is possible that error events such as arbitration
> lost or TX error can be raised in conjunction with other interrupt flags
> such as TX FIFO empty or bus not busy. Error events result in the
> controller being reset and the error returned to the calling request,
> but the function could potentially try to keep handling the other
> events, such as by writing more messages into the TX FIFO. Since the
> transaction has already failed, this is not helpful and will just cause
> issues.
> 
> This problem has been present ever since:
> 
> commit 7f9906bd7f72 ("i2c: xiic: Service all interrupts in isr")
> 
> which allowed non-error events to be handled after errors, but became
> more obvious after:
> 
> commit 743e227a8959 ("i2c: xiic: Defer xiic_wakeup() and
> __xiic_start_xfer() in xiic_process()")
> 
> which reworked the code to add a WARN_ON which triggers if both the
> xfer_more and wakeup_req flags were set, since this combination is
> not supposed to happen, but was occurring in this scenario.
> 
> Skip further interrupt handling after error flags are detected to avoid
> this problem.
> 
> Fixes: 7f9906bd7f72 ("i2c: xiic: Service all interrupts in isr")
> Signed-off-by: Robert Hancock <robert.hancock@calian.com>

Applied to for-current, thanks!


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

WARNING: multiple messages have this Message-ID (diff)
From: Wolfram Sang <wsa@kernel.org>
To: Robert Hancock <robert.hancock@calian.com>
Cc: Michal Simek <michal.simek@amd.com>,
	Andi Shyti <andi.shyti@kernel.org>,
	Shubhrajyoti Datta <shubhraj@xilinx.com>,
	Marek Vasut <marex@denx.de>,
	linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i2c: xiic: Don't try to handle more interrupt events after error
Date: Thu, 6 Jul 2023 21:33:03 +0200	[thread overview]
Message-ID: <ZKcW7yh4gGKUCRvS@shikoro> (raw)
In-Reply-To: <20230606182558.1301413-1-robert.hancock@calian.com>


[-- Attachment #1.1: Type: text/plain, Size: 1385 bytes --]

On Tue, Jun 06, 2023 at 12:25:58PM -0600, Robert Hancock wrote:
> In xiic_process, it is possible that error events such as arbitration
> lost or TX error can be raised in conjunction with other interrupt flags
> such as TX FIFO empty or bus not busy. Error events result in the
> controller being reset and the error returned to the calling request,
> but the function could potentially try to keep handling the other
> events, such as by writing more messages into the TX FIFO. Since the
> transaction has already failed, this is not helpful and will just cause
> issues.
> 
> This problem has been present ever since:
> 
> commit 7f9906bd7f72 ("i2c: xiic: Service all interrupts in isr")
> 
> which allowed non-error events to be handled after errors, but became
> more obvious after:
> 
> commit 743e227a8959 ("i2c: xiic: Defer xiic_wakeup() and
> __xiic_start_xfer() in xiic_process()")
> 
> which reworked the code to add a WARN_ON which triggers if both the
> xfer_more and wakeup_req flags were set, since this combination is
> not supposed to happen, but was occurring in this scenario.
> 
> Skip further interrupt handling after error flags are detected to avoid
> this problem.
> 
> Fixes: 7f9906bd7f72 ("i2c: xiic: Service all interrupts in isr")
> Signed-off-by: Robert Hancock <robert.hancock@calian.com>

Applied to for-current, thanks!


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

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2023-07-06 19:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06 18:25 [PATCH] i2c: xiic: Don't try to handle more interrupt events after error Robert Hancock
2023-06-06 18:25 ` Robert Hancock
2023-06-06 19:24 ` Andi Shyti
2023-06-06 19:24   ` Andi Shyti
2023-06-06 19:40   ` Robert Hancock
2023-06-06 19:40     ` Robert Hancock
2023-06-06 21:20     ` Andi Shyti
2023-06-06 21:20       ` Andi Shyti
2023-06-09 15:32       ` wsa
2023-06-09 15:32         ` wsa
2023-06-09 21:25         ` Andi Shyti
2023-06-09 21:25           ` Andi Shyti
2023-06-27 16:13           ` Robert Hancock
2023-06-27 16:13             ` Robert Hancock
2023-06-27 21:25             ` wsa
2023-06-27 21:25               ` wsa
2023-07-06 19:33 ` Wolfram Sang [this message]
2023-07-06 19:33   ` 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=ZKcW7yh4gGKUCRvS@shikoro \
    --to=wsa@kernel.org \
    --cc=andi.shyti@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=michal.simek@amd.com \
    --cc=robert.hancock@calian.com \
    --cc=shubhraj@xilinx.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.