From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA832331A7E; Thu, 28 May 2026 20:49:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780001341; cv=none; b=Ghm/6Yra7dPkEi0GviS1KCyhLG6ge0DaXuHC/+4msKIzZ3sCxzpHYrE52s2Uqgbn7E5WvODdR/KoBUXp+ZToIvWCJFV183A7Z1QC3qFBFpNVH+I91wFKEgB92CHoz8SBFFZT/ERJ13VdJwShodgRr5WagbQxV51oqHBEdAvKaaE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780001341; c=relaxed/simple; bh=ce3v0R623KFVef7qgG8yWjlD/P/1XHgeAKgeyDCHaNk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kvOpkoG8amxIPBXBMRzvW2GaiO/bORE0PQ/l6HagkxLGuehxeRVdfOLippr3KWxLjnFfLspQR4ZbONOhvaBCi45lyU+3EQMnkOi85p2OPixKz4w0l9c8n+5r/IJ8/HbZonVX1B+QKxTif4qb4YaNb23se0t1oPGw5SL4hqm5R+M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nbThu16l; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="nbThu16l" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14AEF1F000E9; Thu, 28 May 2026 20:48:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780001340; bh=uhUaGPWkCGYFD9Y5lHk0nZ3jl9UKwdyDZY6qAVZaouM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nbThu16ltGlQ88quOTyp2PifOHzVjUjadJdBg+IHDwxhUNczOg8NVRA7Ybz+dmiUn xB+q4qyvcckeN4xqzK/eEcuNMp4Tgvu+eJmw0fEauxPBNJJTBADOAD51dXLau8pcnT xgS0oHLjJIryntPOOPXKAIMio9MJ/gPrLwz0G/rI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Abdurrahman Hussain , Bartosz Golaszewski , Linus Walleij , Guenter Roeck Subject: [PATCH 6.6 093/186] hwmon: (pmbus/adm1266) dont clobber GPIO bits before PDIO read in get_multiple Date: Thu, 28 May 2026 21:49:33 +0200 Message-ID: <20260528194931.447314392@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528194928.941004471@linuxfoundation.org> References: <20260528194928.941004471@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Abdurrahman Hussain commit 3327a12aee9e10ffa903e28b8445dfd1af5307c0 upstream. adm1266_gpio_get_multiple() zeroes *bits before the GPIO_STATUS loop and then a second time before the PDIO_STATUS loop: *bits = 0; for_each_set_bit(gpio_nr, mask, ADM1266_GPIO_NR) { ... set_bit(gpio_nr, bits); } ret = i2c_smbus_read_block_data(data->client, ADM1266_PDIO_STATUS, ...); ... *bits = 0; for_each_set_bit_from(gpio_nr, mask, ADM1266_GPIO_NR + ADM1266_PDIO_NR) { ... set_bit(gpio_nr, bits); } The second *bits = 0 throws away every GPIO bit the first loop just populated, so callers asking for any combination of GPIO and PDIO pins always see the GPIO portion of the returned bits as zero. Drop the redundant second assignment so both halves of the result survive. Fixes: d98dfad35c38 ("hwmon: (pmbus/adm1266) Add support for GPIOs") Cc: stable@vger.kernel.org Signed-off-by: Abdurrahman Hussain Reviewed-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20260518-adm1266-gpio-fixes-v3-2-e425e4f88139@nexthop.ai Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/pmbus/adm1266.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/hwmon/pmbus/adm1266.c +++ b/drivers/hwmon/pmbus/adm1266.c @@ -211,7 +211,6 @@ static int adm1266_gpio_get_multiple(str status = read_buf[0] + (read_buf[1] << 8); - *bits = 0; for_each_set_bit_from(gpio_nr, mask, ADM1266_GPIO_NR + ADM1266_PDIO_NR) { if (test_bit(gpio_nr - ADM1266_GPIO_NR, &status)) set_bit(gpio_nr, bits);