The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: andy.shevchenko@gmail.com
To: Dylan Hung <dylan_hung@aspeedtech.com>
Cc: alexandre.belloni@bootlin.com, jk@codeconstruct.com.au,
	joel@jms.id.au, u.kleine-koenig@pengutronix.de,
	gustavoars@kernel.org, krzysztof.kozlowski@linaro.org,
	zenghuchen@google.com, matt@codeconstruct.com.au,
	linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org,
	BMC-SW@aspeedtech.com
Subject: Re: [PATCH] i3c: dw: Disable IBI IRQ depends on hot-join and SIR enabling
Date: Mon, 19 Feb 2024 22:37:37 +0200	[thread overview]
Message-ID: <ZdO8EST8yJ377jXL@surfacebook.localdomain> (raw)
In-Reply-To: <20240119054547.983693-1-dylan_hung@aspeedtech.com>

Fri, Jan 19, 2024 at 01:45:47PM +0800, Dylan Hung kirjoitti:
> Disable IBI IRQ signal and status only when hot-join and SIR enabling of
> all target devices attached to the bus are disabled.

> Fixes: e389b1d72a62 ("i3c: dw: Add support for in-band interrupts")
> 
> Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>

Tag block is not supposed to have blank lines.

...

> @@ -1163,8 +1163,10 @@ static void dw_i3c_master_set_sir_enabled(struct dw_i3c_master *master,
>  		global = reg == 0xffffffff;
>  		reg &= ~BIT(idx);
>  	} else {
> -		global = reg == 0;
> +		bool hj_rejected = !!(readl(master->regs + DEVICE_CTRL) & DEV_CTRL_HOT_JOIN_NACK);

'!!()' is redundant.

> +
>  		reg |= BIT(idx);
> +		global = (reg == 0xffffffff) && hj_rejected;
>  	}

Moreover, you can refactor a bit both branches, like

	bool hj_rejected = true;
	...
	if (...) {
		...
	} else {
		hj_rejected = readl(master->regs + DEVICE_CTRL) & DEV_CTRL_HOT_JOIN_NACK;
		...
	}
	global = (reg == 0xffffffff) && hj_rejected;


-- 
With Best Regards,
Andy Shevchenko



  parent reply	other threads:[~2024-02-19 20:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-19  5:45 [PATCH] i3c: dw: Disable IBI IRQ depends on hot-join and SIR enabling Dylan Hung
2024-02-18 23:32 ` Alexandre Belloni
2024-02-19 20:37 ` andy.shevchenko [this message]
2024-05-01  6:22 ` Jeremy Kerr
2024-05-02  5:24   ` Dylan Hung
2024-05-06  5:09     ` Jeremy Kerr
2024-05-06  5:48       ` Dylan Hung
2024-05-06  6:58         ` Jeremy Kerr

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=ZdO8EST8yJ377jXL@surfacebook.localdomain \
    --to=andy.shevchenko@gmail.com \
    --cc=BMC-SW@aspeedtech.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=dylan_hung@aspeedtech.com \
    --cc=gustavoars@kernel.org \
    --cc=jk@codeconstruct.com.au \
    --cc=joel@jms.id.au \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeconstruct.com.au \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=zenghuchen@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox