From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 CD43B399032 for ; Thu, 26 Feb 2026 09:20:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772097658; cv=none; b=LJVe9Sa8ilSkxCvo9vSil9eTKo+pRLxOecEwmow4JuOwUARc3KhKWv3KszhSBvb+Tu53PuqrUPAoZ5vA0g4SddezJb//iBg6vljc0I1HVHLCTz9HZVc6//RJ2TpgyagSZN8noojKuM72A0uydTZvy+5/SNUALHZKb//9UZ98hP4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772097658; c=relaxed/simple; bh=8qs6x4Pv9y+qF2DuVeJ8w+TpvkUvEUks+sRLZeSXwYE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=b3JRF5HlvjUtwC8OdeZuJ8NpebyQ/ohX3x4lYZbT/UW/CTIc9c/dTQc2AdIbPOxNm8U1ba91yliEwtF2lWmVmngbwCvmqb1wcvsnRffxicRhte6yJiDavy81v7DxRb5HjYDY/uVmr3n88e00MmBikkBWfF3l6nQuMqcYjkNkMVI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=SMF5eK/B; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SMF5eK/B" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-43767807cf3so400354f8f.1 for ; Thu, 26 Feb 2026 01:20:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1772097655; x=1772702455; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=SEN2Mxya0NO2eS3wMKqR810X2FDpQZBHPAnpB8bwU1I=; b=SMF5eK/BqQtbDbxRy4NP88bOyVXmZg5KJOe1SuUownqsqmtjy3bNvqrBhpqYSoX3TN x/tgnFzRmKK/Lqda5j0mpb83uAB/6ZdYT+qZTCXK9fEFyZoROtjZTes3WWaoiuh7lKO7 9gz4qqmceP12637akan2NetFQbYW+8RZY/H5i3SYY+ftbEulYzJTFhHSNLf+SbI3pmT4 fuRpBTjUXC2McQ0e6gFWyph13SG1UOsLxcwyQ0Oy9P/nI60KQH15+k1+LqeAQWTpV/fe b4uBFuZuAuHgY32DppZd4GPO+3ThCTYk9LEXH6lImXDClO779Xt/iNbTrR5fAEfN3qvW UC/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772097655; x=1772702455; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SEN2Mxya0NO2eS3wMKqR810X2FDpQZBHPAnpB8bwU1I=; b=eqb31B52ooRylNzqxGiFtf5T/BUwyk6qfjQ1eDar6j7VOBDokYtVjy0vD1cl5Inx/a R61y3VfZrhNXAtSH0kwGWtVGQwhBpFXFK0EwXyV6my4YvLFAGTW65STawAITSdqcZKYA dSsWPslap15LC4WQaCSsi4QIdGbtqDI511ZkIiWbE2qGlSPj9JMeuwuDMCyPQKUaJk14 wRSAIcveq54RQziQLnx72q1DdlehF6TKllMfsRp/G2f9x0VfeYB2yKjyGacFLezEdX+E pBeB4AbQ/pEv9FQDavNwa8sVQWCx4Kn8SlcTBAVCbykRyn0d0w5fhlSaCbvoeyK2I458 rSEQ== X-Forwarded-Encrypted: i=1; AJvYcCU78Wj+vIBkovcbxPq7JWkw+HuBoXn753N5gcrG+bcBp5C4DnAN0g8v/sn2Flv+kVYD37+bM/1SBwK9HVw=@vger.kernel.org X-Gm-Message-State: AOJu0Yz0zqHoL2UPjo7zG7ReutjHCyWnkWOd8E44mEijWgfzNCUQikBt mHIirrR1nurmFLkwZObSVEmn7biCiFpLkIe65RfUvzq8quJOQn8xtB1B58LZ1VUfJd4= X-Gm-Gg: ATEYQzx5Ley1DCBznhU0Z8luLBQtNXgI+CkI9OWk+7gdm7FZOTthSPseY4HmFhoP9OB B+IgaKYfZKdTMGfRdxgRLgmZrUwtVUPoIL4b3KROQhcIKJo6cTuhvyf+p/eKQtQdqRic2wNOXiT XX7MQdn2SFwQ/s+8nRV1Sac4T/qoAxcqgnLRhExezFq5YtPud35cqChjAGMcLqIIKtGlRPaIyo6 ADqsxEmFczbjf66PhzeINXTgfvhif21ExMoN2raY/w9S1ZSvxxptbvTU2iiLr97xeto9c7tRmDp AH1f5hlSmSpPL/3JbeYqBJe4dKGNh9uHFgCLEk/sa/d4Z9SBw0oUHq7KjMoclWXxqxRgz5235tY 7m6ItU8Zvgo+YrsO08ebeHYexo2IAzQDq4fV/zH+SbBGLQpBWFM9w8fa3afkycMX96FUdHrgCD6 nabiQihjU9WKdz2OQVfvXVCcK4gxKq X-Received: by 2002:a05:6000:288d:b0:436:1a2e:9f1c with SMTP id ffacd0b85a97d-439942aa2c7mr6219113f8f.19.1772097655070; Thu, 26 Feb 2026 01:20:55 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d5463dsm36575369f8f.34.2026.02.26.01.20.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 01:20:54 -0800 (PST) Date: Thu, 26 Feb 2026 12:20:51 +0300 From: Dan Carpenter To: Ruslan Valiyev Cc: Andy Shevchenko , 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 Subject: Re: [PATCH] staging: iio: adc: ad7816: add timeout to busy-wait loop Message-ID: References: <20260226052615.65734-1-linuxoid@gmail.com> <20260226082535.69503-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=us-ascii Content-Disposition: inline In-Reply-To: <20260226082535.69503-1-linuxoid@gmail.com> On Thu, Feb 26, 2026 at 08:25:35AM +0000, Ruslan Valiyev wrote: > 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. > So this is only from reading the datasheet and the code? I had assumed this was something you experienced yourself in real life. regards, dan carpenter