Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1356634rdb; Mon, 19 Feb 2024 12:39:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVCLrDyTiC1OwJVFtZEB/7h0lF0JvK/Ud8jq6GlPmai416sSAwCC7XqetkEUYZph0/YwAxpbotScbp2m1b4NhEjdlHkuBflHIOKx1041w== X-Google-Smtp-Source: AGHT+IHYTFXsIvORPjL5MsLy6fvvXols3Jn794/HujoYZeY6N6m+DAjoO+SkP12zRQRGJZxNPO16 X-Received: by 2002:a05:6808:bd4:b0:3c1:559b:4289 with SMTP id o20-20020a0568080bd400b003c1559b4289mr4778903oik.8.1708375139859; Mon, 19 Feb 2024 12:38:59 -0800 (PST) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id if9-20020a0562141c4900b0068f5c3cb247si4428427qvb.191.2024.02.19.12.38.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 12:38:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71973-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-71973-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71973-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 86C841C21A10 for ; Mon, 19 Feb 2024 20:38:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A05E05339E; Mon, 19 Feb 2024 20:38:53 +0000 (UTC) Received: from fgw21-7.mail.saunalahti.fi (fgw21-7.mail.saunalahti.fi [62.142.5.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CF5746B9F for ; Mon, 19 Feb 2024 20:38:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.82 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708375133; cv=none; b=hJf/2fL2jWhQsggkDAZuihmKKdU+o02ECgEnngr2U5NbzV05eR0ATg/j7/ieq92ha9sSn63pCf6gSPhwqpnoieWS5KIEw5TBgOZwuUCCHmpwfcfqcKJsvQnMwNs2lZPoVXqq1JMWXgceTyKWMRBO7rdgPVeQLjrs8ePTJ0gvP44= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708375133; c=relaxed/simple; bh=82r9TO8c5dIxa0Cxd/xkQJ+Q/ndiSntYWwZ4IKipPAQ=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FQ6MPTgq8TMqqdI1rJGWpIyI7A6uNO4cpatP9+Ig7pjW99eOX7ljgANGSUHG6qplBWmyC0AX4htz6M/urtzviul/+PsjXgk7YGuSzElBsZGx3bNQGLOb3Malbsd1qzF9efTh1Q0A5CSBdGo9XKyh6WMLnELtJNDtcE1gD0G7jVM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id b80b1d33-cf66-11ee-abf4-005056bdd08f; Mon, 19 Feb 2024 22:37:40 +0200 (EET) From: andy.shevchenko@gmail.com Date: Mon, 19 Feb 2024 22:37:37 +0200 To: Dylan Hung 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 Message-ID: References: <20240119054547.983693-1-dylan_hung@aspeedtech.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 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