From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 573D7389472 for ; Thu, 26 Feb 2026 08:25:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772094339; cv=none; b=LT4lOC8quwZcLIGWjNFkdFHXWu2zaEhJTgdxIpBrnPVNP3bwK4tXk/EaCW0SR9FBfpfAwQpnR6phdatAQ084N7/gLSk48wmyX7nvsKCcY4qSfYTG752ivYodo5H/lsz3ZEZwUqPy4HOrx6DA8q3eeBNMSFq3rxfeJ0DV6/UBT54= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772094339; c=relaxed/simple; bh=XIwS/j6OrQcSxL2M4z+3WsXzvqEIK9l8BmiQ7ezW8Cc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TyKjWTpt8xqjIeXj9O0VxQKtY9YKRFPnhfY8o1+B0pi/yOUsqJY3Xn93RRqyuM6uVJ5iTOeZIDVwM6TaTPR8QRPvcY3SPDY6RqapZTv+TeutTj2Op4tm/8FqVmsk5OY36NWaDkhjhrO6OFv3EYrpN6sFizBzvXspRfBbKE+VMzo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fnwduvEP; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fnwduvEP" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-43991cc3155so552440f8f.0 for ; Thu, 26 Feb 2026 00:25:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772094337; x=1772699137; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XIwS/j6OrQcSxL2M4z+3WsXzvqEIK9l8BmiQ7ezW8Cc=; b=fnwduvEP2Xm0RD6HDuPmGyUS6qxBT/40ju2d72GzrJCv2aSTZW4Y4WHQOWShSn6IOE NZA0PKdCEIqhVhUUO4Mze61RuO9yrkdp6RbkEzO1JieO8DJh4w2KFjbvLr9SeD+ZSEwD lrS30Hkw+rVM5NW2WEuX3MR/UsKdgu/Gf11wA0ujRxBxDGOk5pkMzHt9998C4E1Dtvr9 7tN95MLs7YHIDKckpsmjAk+CnjJCYklNNQG6VuFXW/erKUJyH+PRjvnE0CixREc2taLn YVN3AbwTTWP479wDXZgmg+T6mFAfyeU/uxcctTF74KM1mqjK0khIu+GjH/7a8KyLxGJ6 hCOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772094337; x=1772699137; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=XIwS/j6OrQcSxL2M4z+3WsXzvqEIK9l8BmiQ7ezW8Cc=; b=svjGH4QZgszInVb4cO7iOqoaKTiPGfeTAOEBhd5PNz1uzr1W3NL4D+R3v34ljvFfPl pf7U4rAxjxnEkTmfdqPwujV1toRWG4c82OCUhmN5lk2/TjaNSUe2AEpgzwK9O+OXlglx b7ILvZH3eS8SmyBo92/RArV6u1u5Pw90oaSE549vHiSU7BGn0f1w4HCNXjjBLQwQOePZ ljtKLPShaW5l3Y7C7371voQ9D7daxb0bMWZ37uFZIv8d1nw+ECCrkrIq7lw0H+e9lkwF 2WH3TcKMg5Dw6B2/VO6MbLVID+sDPx4KMtnJi0Gz59sZHrohH0VOyfjcGiG3gthfuZMm eM/Q== X-Forwarded-Encrypted: i=1; AJvYcCUfdLtdZdJ3lfxElQ6yePKdzZh5PkRFuilpeUNDhB/XCR/SQy5gbAp1Vyubukn/JOAoVeDdSFTVkuLdlPc=@vger.kernel.org X-Gm-Message-State: AOJu0YyNc1VdmGJTBqrNYyR8eTcyxoqD+KquKjq/pZe4CGEa6uqbr6Ao VFN7zQ85jE5rRtxadewRY3KgeB3VRadOpiU1xpKwd6vlzOW2zrqTeiOO X-Gm-Gg: ATEYQzzFno11dJuiKEX/+vt2NTvkHZLrUPnCirSdnlOQpald+wjR6JmnKfFn8p7lYg5 dbIMGv2oEFK8bapMdbkMDVru6vcPr+Pt4UhXxOTrc5oHHeOjsHDif84UcS6c6IRXALGpEJqRiHu hsqi6V96o4tej46CE1gl2j764pl+eTGCzJB0x1M+mIAHcDHEROIov/vk764ThY7GpZpY1W8xZ1g Ot4LK0i0ujwLBbAh2P8ST9IGas/8hZV5DLzur0vr4Hp++1FsCs4DCskTLecSSEwWVaFm9xReKNG 8AHht76pmNHSfQcb1OWwWUfvDx/6s5w4MIde/Sp2VEAJWxNSI14OKdppCsacqZ7lIkon1RCYJWL AZmLaT0WCvTvSjCElqFq+MYN4inV+atEZi0HDmiBQVAi+AgQM59OT5ZCkwxrHtgLqQcl4XUUbOM V0v224cC/x X-Received: by 2002:a05:6000:4007:b0:430:f301:3e6c with SMTP id ffacd0b85a97d-43997f30fb2mr2644203f8f.34.1772094336607; Thu, 26 Feb 2026 00:25:36 -0800 (PST) Received: from kimsufi.. ([2001:41d0:303:6f54::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d4c60bsm38896093f8f.27.2026.02.26.00.25.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 00:25:36 -0800 (PST) From: Ruslan Valiyev To: Andy Shevchenko Cc: Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich , Greg Kroah-Hartman , David Lechner , Nuno Sa , linux-iio@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Ruslan Valiyev Subject: Re: [PATCH] staging: iio: adc: ad7816: add timeout to busy-wait loop Date: Thu, 26 Feb 2026 08:25:35 +0000 Message-ID: <20260226082535.69503-1-linuxoid@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20260226052615.65734-1-linuxoid@gmail.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=UTF-8 Content-Transfer-Encoding: 8bit On Thu, Feb 26, 2026 at 05:26:15AM +0000, Andy Shevchenko wrote: > Have you able to test this? No, I don't have AD7816 hardware, compile-tested only. > Have you investigated the code? It was an atomic, now it's sleeping. > This is a huge behavioural change. See my first Q. You're right, the sleeping change was unnecessary. ad7816_spi_read() is only called from ad7816_show_value(), a sysfs show callback, so it runs in process context. But for a wait of at most 27 us per the datasheet, there's no benefit to sleeping. The atomic variant adds the timeout protection while preserving the original busy-wait semantics. I've respun as v2 using read_poll_timeout_atomic(). Also fixed the commit message: v1 incorrectly said the original loop treated negative gpiod_get_value() errors as "not-busy", it's the opposite, negative is non-zero so the loop treats it as busy and spins forever. Ruslan