From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 35CB42DAFBB for ; Tue, 26 May 2026 20:46:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779828406; cv=none; b=ZpcUAymBSgO0t5+ZrmKsUmaGc1oEuhFZ6ezMJukgkM41+bYTCemFoFfuOIrz4RAapBd3SzGGG2dyWcon2c2V/FzVwzrts8KctRlW6lZ1/Yb2uZhHiMn3Kuv9Apqz7eCp2haSbIg4TtGDpGHwz56CvVHpEmQCz09xijCYOnCPHaQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779828406; c=relaxed/simple; bh=2z5bTtd/HxPEU8eYLMrzRgawfNVrHqvpf4qq3+29xt4=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=bRCV4O/y40fz/LWQt8/aCgbuR6nu4eT1gmoFf1AiR20YSQ0RUGmJfOdd1db/keHCb6VJmEV5qYzsCwdZnIEzamPlG0//M+YmMT47gjybe11Wubbs4U9JKAnN3IhLUajOhiU9B9DVBhmvmimySO2LluSBIC5S7e2UYdqquhKwBjU= 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=SWhLAaYz; arc=none smtp.client-ip=209.85.128.51 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="SWhLAaYz" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-48a563e4ef7so80703905e9.0 for ; Tue, 26 May 2026 13:46:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779828403; x=1780433203; darn=vger.kernel.org; h=in-reply-to:references:from:to:cc:subject:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Sw9iPfDQzt8bW0KV99nuWsMFk8LtY4w/e81ccwJ3ovc=; b=SWhLAaYzSI/gcN1IvuSPrKabWDPi91V5uIzMGxNEXVoCd7ATx3iW3DHasA0aStYG4K W9BCc486WSrOd0hdiIQ3vF32+orXOicbi6DdsQQDYA4TwLVlzL92q8rlcSIIRse9gVw7 2/BwX19aWvUeEaQ7XQ+AREZXkbJ02jEkkDT4OdY8HPLohlWkECP69yfZGzBMeHEXwRym kF9k2Rpf+LGth5BFHQBMW3+DczDrOmVigPr1hXO6wWcrhsUNMcEnFR/KGdBL09Z7mbCK T+WNzS93yO5OtxdP/sC+YrWri/kDvsNYRD40ZJwaVAP6yXHx95cc8RKUi9GYYrJBffx3 dCqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779828403; x=1780433203; h=in-reply-to:references:from:to:cc:subject:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Sw9iPfDQzt8bW0KV99nuWsMFk8LtY4w/e81ccwJ3ovc=; b=XrqqDfcx38IJGHmehonna+G8yqnJzA7YdRdKJsYNUpb04TCpUjceF0uT4JdSntsKjR svcBdH5usj3ABG1KQQkWE+CPUe8k0217wmvONU0vkmT4P/wTict3DGbjuulGcKATmhx8 5/Ypx3X+84PRl26UJhM073HVXVv1VW9zgtZ+131n/U+MvqOVYi2xce8kzbk7IPefXz9i dEWhvw9RUwb+rWIDQFCgVHs9qL4LiDV0+8sesiAj9fKnq7lf0M82NlAShHZf2Ai/F6mz iJr96inJkWGRAna7o4GHNNsTD1PzCa3wj25otY8l5xZ78eOwdUZNYytjXka6k7gtzKFB c+lA== X-Forwarded-Encrypted: i=1; AFNElJ9NGKSdUB0I4HcfNot3GLu4RPIbMP6N19dieP4Khzk6KGW+votlg/P3/Yh3MFT4Ki3MG2BF3iOtH4T8vS0=@vger.kernel.org X-Gm-Message-State: AOJu0YxdOrin2LcMoXdkN43nB3BFa5YH57QVaiWYCw8vxJaswvAXu05L 99mxrwL4Vp+BwItZiSz7Y2I+BQBhOEEJVzFdDsNPvdAfJ8F6Yrhg800m X-Gm-Gg: Acq92OFcufvmZI8e7U/n+fXo7otJM9TX0OuwoB2SWbzVVzIVpAZngLxX141aEaK4ago Son/5+VM7TmT3CjG9CrPaxQGBadMksMXIj6IPfLIKqhxb7Cv9hDgpLrkoDjL7bTlrt41inbYBUZ f6cUNZT2j52S3rMJoJYaFBBKT/hhDoxacQYxJ4JZzbskhGeg8kCiiKpnAwGFrkzuEDWVmVl3rHu TdAsj/yo2Y0zRjhaco6zlcUMrmKUmwDT3Q+M7ka7v5vsa+dZiEOwhSmGMi/6kl49cbpRZu6cAyB zOyTRJA2TDo9HCXmGQa/x1pH7JKNcGMtTFB+IhP13VRH0Foz00/uqNp5ij3AMrCuYfc7UF9nhCG 1/wVV5xe6V40uwIDHmfqPj78ByKa84Z//AuDA7owLJ3SMJL4irwtn8zVtLM3yXOkgWmhxQJTWqK HubdAitbPXKkOzSaQ5DV8UXhyg1kOAEom2rbT8+ZLpIqAxewY= X-Received: by 2002:a05:600c:4f88:b0:490:50eb:b777 with SMTP id 5b1f17b1804b1-49050ebb9e0mr298822445e9.5.1779828403347; Tue, 26 May 2026 13:46:43 -0700 (PDT) Received: from localhost ([2001:4bb8:19a:6947:136e:fa14:24f7:1e97]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49045284855sm356054775e9.0.2026.05.26.13.46.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 May 2026 13:46:42 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 26 May 2026 22:46:40 +0200 Message-Id: Subject: Re: [PATCH v3 2/4] iio: light: add support for veml6031x00 ALS series Cc: "Lars-Peter Clausen" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Rishi Gupta" , "David Lechner" , =?utf-8?q?Nuno_S=C3=A1?= , "Andy Shevchenko" , "Matti Vaittinen" , , , To: "Jonathan Cameron" , "Javier Carrasco" From: "Javier Carrasco" X-Mailer: aerc 0.21.0-143-g2f3a2e260c09 References: <20260524-veml6031x00-v3-0-29165609b2b5@gmail.com> <20260524-veml6031x00-v3-2-29165609b2b5@gmail.com> <20260526185933.0084679f@jic23-huawei> <20260526190528.0efe80c6@jic23-huawei> In-Reply-To: <20260526190528.0efe80c6@jic23-huawei> On Tue May 26, 2026 at 8:05 PM CEST, Jonathan Cameron wrote: > On Tue, 26 May 2026 18:59:33 +0100 > Jonathan Cameron wrote: > >> On Sun, 24 May 2026 23:53:56 +0200 >> Javier Carrasco wrote: >> >> > These sensors provide two light channels (ALS and IR), I2C communicati= on >> > and a multiplexed interrupt line to signal data ready and configurable >> > threshold alarms. >> > >> > This first implementation provides basic functionality (measurement >> > configuration, raw reads and ID validation) and defines the different >> > register regions in preparation for extended features in the subsequen= t >> > patches of the series. >> > >> > Signed-off-by: Javier Carrasco >> >> A few things inline. Biggest one is that device driver specific state n= eeds >> local well documented locking. Here the whole complex gain handling mean= s there >> are a bunch of register field where the accesses to each set of them nee= d >> to appear atomic. > The sashiko comment on underflowing pm counters also looks plausible > so check that as well. Hi Jonathan, thanks for your review to this and the other patches of the series. I will go through all your comments within the next days. I replied to its comment on the PM underflow, but as I only replied to it, and then I forwarded the message, it might have gone unseen. I believe Sashiko is misinterpreting how this pattern works (not introduced by me, it is already available upstream in drivers/spi/atmel-quadspi.c). Decrementing the usage counter is fine because the devres action uses pm_runtime_put_noidle(), which in turns uses atomic_add_unless(usage_count, -1, 0) to avoid decrementing the usage_count if it is already 0. Otherwise the devm_ variant would be unusable because it would not be possible to put the device in autosuspend for the same reason Sashiko is complaining. Best regards, Javier