From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41DCEC43458 for ; Wed, 1 Jul 2026 20:06:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1rQIijaRhUEi6jSrf3KgWlkL+YyCNTfvZsWKQUqEONU=; b=r2Uq/r9D9w85pU 51f7DDZgBo732ifQnuOSNNRPzKnX/jvnSJ1ZybrPGQXY0/7G5QjE+aCxXBqsTnRL6/NB7zS1hrp1T KNL3js6y+oc88Ua+VAMcTb6/jYw+AeKj1HnuuHOcjmRfoO6GKQAY+BUoXeEdmtdlKWwnz1lLezCId 3ytwpZq/fVHA8uveeXx4BPUNUCiWjn/yqoXplMuJqPFL7Ve02TgW21xOVH1mbOtqCf18/Ak4sP6JQ GUcK0cItrw3oKqEp2AzLZh7F2Hoxb4s33+vUnPAhgPEfSOBTrA4LqnHTsSDi8P6dVe7yuwehiikYT rF6lt+0OQ/ISbWR7TmOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wf1CO-00000002wXK-077t; Wed, 01 Jul 2026 20:06:20 +0000 Received: from mgamail.intel.com ([192.198.163.15]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wf1CL-00000002wRb-0Wcc for linux-i3c@lists.infradead.org; Wed, 01 Jul 2026 20:06:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1782936377; x=1814472377; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VTAvYFO3S4nTpXuNRTDSeK7JhvfP65YCWkQJ/dIE6tQ=; b=hhjD/m1YHM/0VLz+JXv6PRPaEn3vgV55ruKGrGvbQf7mcalavXjv2Bs3 HTfGK4MAWLL15YGDY2rEVtNbEMgYQScZ2lLtDnqJ7GkK8EgkY13l7RyOG O2q3xiA1ecp5GVNuh8QqnqmtIDK2/zANBp0kYtM2zXnUzN6Ph9+lLpTjh fy5XK0pIrwkNzkPkZTtdLm9iEQFbFW9noip19uo4xosk0VRcTYbsmDUDD nKe65Kr3pYLwyN2JgI0ZgP87m0KlKGi7B0s9DQUCS1eY5aYl8oEH4QaiX WZeVwQFIMQrrqb68xf/J5HFIK0IwJqPkVCXtStOGIEFWT50PNdQBaKNGH w==; X-CSE-ConnectionGUID: bLnKsdnfR4CRR2o70RJXKg== X-CSE-MsgGUID: lpja2U8kRM6PAAXVVYG/vg== X-IronPort-AV: E=McAfee;i="6800,10657,11834"; a="83812929" X-IronPort-AV: E=Sophos;i="6.25,142,1779174000"; d="scan'208";a="83812929" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2026 13:06:17 -0700 X-CSE-ConnectionGUID: /N6jfqurQauDGM6gwgbNjA== X-CSE-MsgGUID: /KJf6aXnQfus7oyZhRRaBA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,142,1779174000"; d="scan'208";a="252805038" Received: from conormcd-mobl2.ger.corp.intel.com (HELO ahunter6-desk) ([10.245.244.30]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2026 13:06:15 -0700 From: Adrian Hunter To: alexandre.belloni@bootlin.com Cc: Frank.Li@nxp.com, rafael@kernel.org, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@lists.infradead.org, linux-pm@lists.infradead.org Subject: [PATCH RFC 4/7] i3c: master: Reject IBI requests from non-IBI-capable devices Date: Wed, 1 Jul 2026 23:05:49 +0300 Message-ID: <20260701200552.220042-5-adrian.hunter@intel.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260701200552.220042-1-adrian.hunter@intel.com> References: <20260701200552.220042-1-adrian.hunter@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo, Business Identity Code: 0357606 - 4, Domiciled in Helsinki X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260701_130617_175787_E64A880C X-CRM114-Status: GOOD ( 10.82 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org i3c_device_request_ibi() does not verify that a device advertises IBI support before attempting to set up IBI handling. Add a check for I3C_BCR_IBI_REQ_CAP and fail with -EOPNOTSUPP when IBI support is not reported by the device. This keeps IBI setup consistent with other IBI-related functionality, such as exposing wakeup capability only for IBI-capable devices. Signed-off-by: Adrian Hunter --- drivers/i3c/device.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/i3c/device.c b/drivers/i3c/device.c index 101eaa77de68..307ca6dc04ca 100644 --- a/drivers/i3c/device.c +++ b/drivers/i3c/device.c @@ -205,12 +205,14 @@ int i3c_device_request_ibi(struct i3c_device *dev, return ret; i3c_bus_normaluse_lock(dev->bus); - if (dev->desc) { + if (!dev->desc) { + ret = -ENOENT; + } else if (!(dev->desc->info.bcr & I3C_BCR_IBI_REQ_CAP)) { + ret = -EOPNOTSUPP; + } else { mutex_lock(&dev->desc->ibi_lock); ret = i3c_dev_request_ibi_locked(dev->desc, req); mutex_unlock(&dev->desc->ibi_lock); - } else { - ret = -ENOENT; } i3c_bus_normaluse_unlock(dev->bus); -- 2.53.0 -- linux-i3c mailing list linux-i3c@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-i3c