From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f66.google.com (mail-dl1-f66.google.com [74.125.82.66]) (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 8E38A338932 for ; Thu, 19 Feb 2026 08:58:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.66 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771491482; cv=none; b=iWJujC0uTGLVjNNdLhk/pzb9XcmjK84GZBlsvuJkL19/2oBL9xS8UobcYyOIoPZZEOoNmMLSWOb7RhA5MdA1GBpa4+1Y9i+y1trbRwqmLkQ9IBsortwdPO+TUP8BjHYzcrt/G8mSFtrb+af0hZotfxjczXijhVLGBKig/WxFXWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771491482; c=relaxed/simple; bh=RaU7x6gSN3yYDniJgRhFDMbiZ8LZTpqr9r4GDly3Xhk=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=hlNDG3iEzQV/rfV43hDfoBvWsS8r3+G6wnzDmUcJzfmjuoknOaRZie1ehOp2Su5i4OrzdNjEQefZurN3+ZWOigNbcDi3VgLsN2Ez643dNCsNpVRQvC+vggCp73XkoeZhj70ZTDUrWv+kbdKnW5K7LMWqvOKyLHF+Y4IESAiZFs8= 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=nI9sL68S; arc=none smtp.client-ip=74.125.82.66 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="nI9sL68S" Received: by mail-dl1-f66.google.com with SMTP id a92af1059eb24-126ea4e9694so1787882c88.1 for ; Thu, 19 Feb 2026 00:58:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771491480; x=1772096280; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=w9QckPjYVpC7XREf2SsBK4wtYoxkxE+nJ3fOgUmSovk=; b=nI9sL68Su4BXNPdhkPvW+mUNhSF1mcbv/sx4CSzy7QsV57YxPoLosvbVAhEFgVWpRS zX5OTSfyE2TkStm4EaLaFs1vmC+2UMUdd8jHCQmDv2ovwOuKjVzZr8VlbOBy3Lf8Rc14 Q17NqjH/1SW42GxFLcQNq5zGC0NGYbUaWV5otEv2YUmT71EhlRnv7QiY3Vn00MD0rCgQ kgjkkxaRkflvsDAKnpmvu7ef1ATQFeASjbzeGwi1ex5e8Mq/AgGBTkNrGLwF3jwIimq7 ka4l2/xEgvCgreGIEi8fP5p6V3oTHCZvmVEqqdZkEpBG9CKmiQNWqkQRP2/3jFAkwxDo 7OKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771491480; x=1772096280; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w9QckPjYVpC7XREf2SsBK4wtYoxkxE+nJ3fOgUmSovk=; b=waGG468hacYtHMzq7XqDbIMdhCHBOHtZuUbgVnHMq79u6ws7hYsgJFbd38HagTSgH7 JSUetU1lO4Qkatnu4YIdt5CcwFyovzlpFPl9aVwF1qf1a8HkV0TkbHza1FX451SA2nXx YSHS1Ub0bkCgImYC+b08adtAKCt0JM4m3RSFGnMI080OVUjbvxZhPiMbBdDmPLYgzgZx eDtLJeulTQiSFvdv0Kah7J6VcX+RWX4pdpLGFux9G3ql8EIcO0/u8njtWsiMyVJ7zwG7 yuJ52OajJ3NI6mczKddT5VvRA+4IETTZWzCTFZNYN1guIX5GaGXucQb4YAQTVIQQBIxs ZCpw== X-Forwarded-Encrypted: i=1; AJvYcCUB4OyMaxvC+rupQq4ePGjAHBYWpsg9qfuE88fJkbs3K3w8XOvbyvlZgO5MTtz+5SwJSHBmvXqplQv9ppU=@vger.kernel.org X-Gm-Message-State: AOJu0YyMB/DlyDkRVrCIske/Ccl2W2tI38H/RaJQSiNtwUVtidJhPAsO 0aYLbguliJs5VH0L6zmm+dD/6BWzuhkQyf/eueuEYYOQh3SdxcfZLxHY X-Gm-Gg: AZuq6aIPk7gorXYN2UfYuV4EI9XWXaIer72350lFFiIRQ/V9E4a6ufaaiG1kBvg94K/ bdiFVKjh8f2QEgTrrR6OyBvGX9MbJ22rR0F7UzTQh6Fk+zFN/x57aODG4clS3wdKuY9fEmeQFyu bvRk7wj4bs6nuSfVdajazwYNg29oOwVAILOIqTBoP4EiPaaiRqb3lONwlANzOUCvZgH9s/3ObPg ym0mIxaKetvYh1O3hyfHkxz/eULLWcJAd8UQBKroQUZCGvus6GI/W+tD8+71TF7oxOybxwjrUtM QqbxHOrscexzJkPWMZH1zVnEDV+ijciUnXKODVgOmTMmiizlgSTIxB1E9l5m+lfndmq2q+jJ94S 2IMWXUwTwosAtChEaZMfb2Z+0GI7KC49nHzWfAx3t5j2+x4PTFWiBAhehKGkppNfoZQJc2EqMUm sMwtU5/7aHvyn8jssZ4T1ufDsEoxnHPRqrfOFOBKfRk10= X-Received: by 2002:a05:7022:f9d:b0:121:a01a:8e2f with SMTP id a92af1059eb24-1273ae688f2mr9613531c88.42.1771491479596; Thu, 19 Feb 2026 00:57:59 -0800 (PST) Received: from ehlo.thunderbird.net ([2601:647:5e00:4acd:97bd:bbcc:96e6:7f02]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12742b62455sm25648107c88.1.2026.02.19.00.57.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Feb 2026 00:57:58 -0800 (PST) Date: Thu, 19 Feb 2026 00:57:58 -0800 From: Dmitry Torokhov To: Bartosz Golaszewski , Linus Walleij , Bartosz Golaszewski CC: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: =?US-ASCII?Q?Re=3A_=5BPATCH=5D_gpiolib=3A_normalize_the_return_v?= =?US-ASCII?Q?alue_of_gc-=3Eset=28=29_on_behalf_of_buggy_drivers?= User-Agent: K-9 Mail for Android In-Reply-To: <20260219-gpiolib-set-normalize-v1-1-f0d53a009db4@oss.qualcomm.com> References: <20260219-gpiolib-set-normalize-v1-1-f0d53a009db4@oss.qualcomm.com> Message-ID: <48629460-701F-438F-8E1A-6F428C49FF6E@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: quoted-printable On February 19, 2026 12:52:37 AM PST, Bartosz Golaszewski wrote: >Commit 86ef402d805d ("gpiolib: sanitize the return value of >gpio_chip::get()") started checking the return value of the =2Eset() >callback in struct gpio_chip=2E Now - almost a year later - it turns out >that there are quite a few drivers in tree that can break with this >change=2E Partially revert it: normalize the return value in GPIO core bu= t >also emit a warning=2E > >Cc: stable@vger=2Ekernel=2Eorg >Fixes: 86ef402d805d ("gpiolib: sanitize the return value of gpio_chip::ge= t()") >Reported-by: Dmitry Torokhov >Closes: https://lore=2Ekernel=2Eorg/all/aZSkqGTqMp_57qC7@google=2Ecom/ >Signed-off-by: Bartosz Golaszewski >--- > drivers/gpio/gpiolib=2Ec | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/drivers/gpio/gpiolib=2Ec b/drivers/gpio/gpiolib=2Ec >index c52200eaaaff82b12f22dd1ee8459bdd8ec10d81=2E=2E9f7a1a1ebd8365fe933c9= 89caf9e8c544fd9ba0f 100644 >--- a/drivers/gpio/gpiolib=2Ec >+++ b/drivers/gpio/gpiolib=2Ec >@@ -2914,8 +2914,12 @@ static int gpiochip_set(struct gpio_chip *gc, unsi= gned int offset, int value) > return -EOPNOTSUPP; >=20 > ret =3D gc->set(gc, offset, value); >- if (ret > 0) >- ret =3D -EBADE; >+ if (ret > 0) { >+ gpiochip_warn(gc, >+ "invalid return value from gc->set(): %d, consider fixing the driver\= n", >+ ret); >+ ret =3D !!ret; >+ } >=20 > return ret; > } You want to patch gpiochip_get()=2E It could be that set() is similarly tr= oublesome, but the report is about get() not working=2E Thanks=2E=20 Hi Bartosz,=20 --=20 Dmitry