From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.19 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796155698; b=TTf20XL9KHzOApj02Zj8YSkU3JbxHoAaC5UGkxSQT8zj6oZSYLyXO1y1T5A6TWPF0C+J OEdaPr8m3264oyWq7AKq4bpBxc7UIsff+VKsoka4HGeuIcz6thwakh6tWdmQqo6Vy3pwm Pre39k/2rM5dx4ujVzAYx3FnqM9rORK/PPRJ2e1EV5714XWGvTr3rq7vFvcArrBGgZ4Xj 7Y4W9Zhl6shV8rlZKPf2jybphItNNGrNGcnY1EdpLDm+ifQUA8O9Nj+zJErEOvgoNLl85 JdmMNGcM1GqbKUGlc/ypy6/VoJ5Udb7JP8wEpX8qWBFtGAKUb1w4OFGdN4dfqTWdjWA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796155698; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Message-ID:Subject: From:To:Cc:Date:In-Reply-To:References:Content-Type: Content-Transfer-Encoding:User-Agent:MIME-Version; bh=XW6dFFtNC/PqD67EI97Tc7PQasCTiKt1noYq89LCmpo=; b=hSvxscr6W+j/zndWMb4Aa/NNtH/L6mELI+JBtPkPvsawKbRdUh5ql+Xex7OJAXQjXXkY NcRe3E7nXM/0NlaR947d2isBaPRmUU2iODuMgKABeTcBnbxMy4kFWBTtgsuE5CQ+KrPI/ KULLLGj/jjBy0yoNdJTAJyo2ia3EzygjU3OtOiP83B1Zy/YxfMNDKiyt+HyD/8SxhAr9v 6m5xRy/8rVzeUEgyq73cAX8koBOaQehfbWus4n3KqV+MrQK9NxFPuXJ5T4aVwR2ArOO2Z BH/guh/SY+blNeV50np0C/8voDQUVJwaNHn6iavgpAaCqkPaoXnen/uKE1/pI27wsGA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b="FRaBr/gJ"; arc=none smtp.remote-ip=192.198.163.19 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76ABA606A329; Tue, 1 Dec 2026 20:08:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 76ABA606A329 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=FRaBr/gJ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796155698; x=1827691698; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=XW6dFFtNC/PqD67EI97Tc7PQasCTiKt1noYq89LCmpo=; b=FRaBr/gJd1xqBBvdbQKBuQH4nWET6aRGS3wmTwJwfSJxfgjfZMBdThI8 qS08e285DyDaD6/J0Gvg+PipYdipcAm9/LAtFemIToR+7vrfK4cy9B2GA NjpBTRxi9dX5tol7hYN+BBARdEQPeps18p4Vkm3Tdy7PyS4eQLSDwDCkY 2OGadQ27ZnwQGWKVpDxdRg1YKOU2L3os87dadU/KZ7EyIjW3IVj/RRW+Q anYluohynYg2vaXZ3QpzgQu90+3qLuc7ZkLKqucs81i+EqXzul13QjuiE I4o9faLnrv8zDRHCvRsqhSb2B3gRfsyn6OIT+vsGKTyMJUa0Xxbcx7zmH w==; X-CSE-ConnectionGUID: eKIWeKEpQrCB2NIf/787bg== X-CSE-MsgGUID: 7i2nQQo0Q+WHZPF/gjxRLg== X-IronPort-AV: E=McAfee;i="6800,10657,11983"; a="5070116" X-IronPort-AV: E=Sophos;i="6.27,245,1787036400"; d="scan'208";a="5070116" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 12:08:17 -0800 X-CSE-ConnectionGUID: OpZo6q+/ThCInIllksTLaA== X-CSE-MsgGUID: PE1YyxUvQ4mu92BYlHkGvg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,245,1787036400"; d="scan'208";a="13826003" Received: from spandruv-mobl5.amr.corp.intel.com (HELO [10.124.221.178]) ([10.124.221.178]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 12:08:16 -0800 Message-ID: Subject: Re: iio: hid-sensor-trigger: unclamped msleep_interruptible(poll_value * 2) stalls runtime PM for hours on Chicony 04F2:B872 secondary proximity sensor From: Srinivas Pandruvada To: Shan Rizvi , Jonathan Cameron , Jiri Kosina , Benjamin Tissoires Cc: linux-iio@vger.kernel.org, linux-input@vger.kernel.org Date: Tue, 01 Dec 2026 12:08:15 -0800 In-Reply-To: <179615474253.3247684.5807786149742177755@rizvi.nu> References: <179591783777.39.15448655394533903125@rizvi.nu> <179597320466.39.13133294134105261462@rizvi.nu> <179597990855.41.2142056846322501706@rizvi.nu> <62dfb2d336378b0df89799e6c944ba4728a2b37c.camel@linux.intel.com> <179606075544.1070896.11410129502695294348@rizvi.nu> <4c44d7f40b820dd1cb78b77d46747d291a4fc5de.camel@linux.intel.com> <179615474253.3247684.5807786149742177755@rizvi.nu> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.60.2 (3.60.2-3.fc44) X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 On Tue, 2026-12-01 at 14:52 -0500, Shan Rizvi wrote: > On Mon, 2026-11-30 at 11:03 -0800, Srinivas Pandruvada wrote: > > Changed the order, please try. >=20 > Works here (HP 8EA2, Chicony 04F2:B872, 7.2.15). First read of > in_proximity0_raw takes 4.0 s, two concurrent reads 6 ms, a read > after > autosuspend 4.0 s. No hung task, no runtime PM underflow. >=20 > But I owe you a correction: the order doesn't matter. I ran the > previous patch and this one back to back with the same debug prints > and they behave identically. The 9.5 s reads and the 0.5 Hz I > reported > last time don't reproduce. The hub started logging "control queue > full" a few minutes after that run, so I suspect it was misbehaving > and sysfs was showing the cached value, but I can't prove that now. > Sorry for the noise. >=20 > While checking why the readback never changes, I dumped the feature > reports through hidraw. The interval isn't really huge. Report 17 > doesn't match its descriptor. From offset 5, where both reports > declare > Report Interval and then Minimum Report Interval as 32 bits each: >=20 > =C2=A0 report 1 (working prox), 128 bytes, as declared: > =C2=A0=C2=A0=C2=A0 64 00 00 00 64 00 00 00 a0 0f 32 00 c8 00 32 00 ... >=20 > =C2=A0 report 17 (this sensor), 119 bytes, 121 declared: > =C2=A0=C2=A0=C2=A0 d0 07 64 00 00 00 a0 0f 32 00 19 00 32 00 ... >=20 > Report 17 is 2 bytes short, and it only lines up with report 1 if > Report Interval is 16 bits on the wire: 2000, then Minimum Report > Interval 100, then 4000 and 50 as in report 1. So the driver reads > interval | (100 << 16), which is 6553600 ms or more whatever the > interval is. Writing sampling_frequency changes only the low 16 bits: >=20 > =C2=A0 10 Hz=C2=A0 -> 64 00 64 00 > =C2=A0 1 Hz=C2=A0=C2=A0 -> e8 03 64 00 > =C2=A0 0.5 Hz -> d0 07 64 00 >=20 > (The 2000 above is left over from my earlier tests. I don't know what > the firmware starts with.) >=20 > So with the patch the SET of 2000 does reach the device, but the > value > read back is always above the limit, and this sensor gets the write > and the 4 s wait on every power on. A descriptor fixup for 04F2:B872 > would be the real fix for this device. I can test one or send one if > you want. >=20 > Tested-by: Shan Rizvi I will submit v1 only as that order makes more sense. First set the parameters like report interval and then power on. Thanks, Srinivas >=20 > Thanks, > Shan