From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (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 1EC40412261 for ; Wed, 1 Jul 2026 20:06:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782936378; cv=none; b=FDAyDQ4CdpZf1hlEHrG9iEJKCUZ8vu+3GcQqkfhrXYdPVgBo+2AmwuhXXlVocogDREEGCqDHPFFTTfFzIwAD1Usi/eGqUouFR446JNMeFb7a1Ua6jVC4yTdg3O61OfIieotGng7acoyyYjrF7YgicBzTxWJxfrySHXjcDSjUroM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782936378; c=relaxed/simple; bh=VTAvYFO3S4nTpXuNRTDSeK7JhvfP65YCWkQJ/dIE6tQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F2u/qScc+YDUJ/qSbOKdJNzUJoYUDmGpz5nKkVhgs8bfxTy0WDjRFQrPok+yoOdVptRfsth28zpDrN7itAOYDALphsWZq4ymHHE1vs/dpoiRs9gVRjTIEvltLtjLdx23dODn5Kc0W/eauguyeoiMQPAtUvuf2SLkmzHduXsAYW4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=hhjD/m1Y; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hhjD/m1Y" 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: HFJCKOxpTGO5f9aBKn+x9A== X-CSE-MsgGUID: Pw3t6kTsSGKvHmi9DPIVkg== X-IronPort-AV: E=McAfee;i="6800,10657,11834"; a="83812928" X-IronPort-AV: E=Sophos;i="6.25,142,1779174000"; d="scan'208";a="83812928" 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 Content-Transfer-Encoding: 8bit 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