Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1616040lqm; Fri, 3 May 2024 00:29:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWuavzh6R7ScMIoeVQb44YKsVQwA4371IwTzFba7rbbnVx7WU78OsCHZqvBmJmXs//21nMX6g3po63WAntGdS+agn+YZblF6Yp0TtHBig== X-Google-Smtp-Source: AGHT+IFbXvqZVm12lS9Ql36UHNZtXYXOmiv+56jMdZrWnBjh+X+3rQn30dU9gR5YWStOcgKDGPMm X-Received: by 2002:a9d:7c90:0:b0:6ed:f048:dae1 with SMTP id q16-20020a9d7c90000000b006edf048dae1mr2350818otn.17.1714721347401; Fri, 03 May 2024 00:29:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714721347; cv=pass; d=google.com; s=arc-20160816; b=L7LmglqC+5ybfPKNp/ldI8Gv2hG8bxfunrtQqBViNj7ZS0dd+cjDSG6q5J29tp2uqz 3okya8TDd85IOOkLVE/HgwZt+n4fobQID6xr8Mj6IuS1cxi9FhPI9lsCGrSbAzjVGGrh Yp+wWa2+KkFvZFPl3O4sTZ+YRM7HeCSfItsuV4jPTvqICU0sNTuhY2LiPMVzhiZQ3TPh TgAm+qdFEuZWVX6VpjA84VjDhrESR2PBnHQavCi7KxU7dXNssm9RAFqKv7gupn4ByL9K GwZCoScCx0DfVfOlOwP0FEjczEbvo4bBuzwuCbYvkHzE6Cxz6MaeiD1+/2cfttiSlhqt +N4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Hn+kibtNuVGY16LR1Tui4J9dCha04H++GGopC0OUDOA=; fh=DIdtnCGRzRhRKNJ0PaAVeY803FyrX1Ny4/GnqYlKgFE=; b=nNIa7tkKoJ2MGmudY9Wm8RAwtHACgH/x3NSV4zSZ5sktqU2s8n++j0Ig8bCzagTd3I zrD8k0zhnvR5GEGVkLg8bTD0XUvrlHGk7woXPVDpOO/VFFUKUBGpsmkI9saEaPiEYAO8 MWDZRdBXTtopywmfWE0YdK621Ty8fyNoT18zb8F1s3Z/w97MZW8QHXBsRGl1iRDQL7s9 BQf0CrGtLLNkX1stzoKFZk1ELUascCQp8NRL30ovJRzM13ZAx3H09qkwagnMoYFK+5tz /QZJi/Mr2E+pVhcs/Scobq7D2LGXcw0xc4s6lRIGb23IQAdLMdCXM6c7CjlUwDYwU25C FmqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bWCxnhYi; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-167318-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167318-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id w18-20020a639352000000b0061a6efa2c93si2074266pgm.74.2024.05.03.00.29.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 00:29:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167318-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bWCxnhYi; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-167318-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167318-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0EB81B21C5C for ; Fri, 3 May 2024 07:29:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CDDF51474B4; Fri, 3 May 2024 07:28:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bWCxnhYi" Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) (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 73078146D54 for ; Fri, 3 May 2024 07:28:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714721336; cv=none; b=blecJSvBVmlWS2YvJLS0YBN1zNhzqTCqaJt59qYV/X19S5HLpKkf7NYFbjakakXJSA5r4wwk/EFj/ZHo2wfHEH4ja4pz7n91YkENR+HK0g3URq/iK6amjaaHG9QbMI4rymi8EGzwaN+rH6pmRVjZWd5VkM6S7kkBfnKbE2L7jD4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714721336; c=relaxed/simple; bh=Hn+kibtNuVGY16LR1Tui4J9dCha04H++GGopC0OUDOA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=PBDTDnV7wydIBAyLY/vv/PTS5Nu8zK8hfBR/zo6nDd8RhgCrkYclI5YPtO98jAfljAV6biiMvOPOCggZqKe4U21x74nYnD4ywA3vQEbynYdw6RFyPOUHCFkXGBZkJpNpfbIGwfS1aaNFZQ7UkxUGHgaFqIUHOHYWITXu57Ymv+s= 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=bWCxnhYi; arc=none smtp.client-ip=209.85.219.169 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 Received: by mail-yb1-f169.google.com with SMTP id 3f1490d57ef6-de462f3d992so9345733276.2 for ; Fri, 03 May 2024 00:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714721332; x=1715326132; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Hn+kibtNuVGY16LR1Tui4J9dCha04H++GGopC0OUDOA=; b=bWCxnhYi1vzW7akPHe39Sq0l65OBVtnxZfGzJmGAVxFKRT8QpSInC5K9T8Uj1at039 JNC5tHoPar9bSAoQasXba6ZWaFA9NKZFei2ThX655NfNkUxBqRo1igwSDyoJsEsoyjFV k4BxBmx+7gPWX5RoJo4C469uIC2EGbWstwzYaDrXFJT6l3KF8jNyV0JLskKyl1BBAJNI wqw/qFCgXY6lJkVAKmB7s5CQcHtVOD8qkU5yVCDaSmaTHog9/lPfCJ+e+7ty0YFKXdty MWJFFvkhHtfmmivbA+WqevsBGzrXpbmQiBBOXsU4EpCnz2trDDM/Vc5ahIlvuYchXD/S b3tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714721332; x=1715326132; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hn+kibtNuVGY16LR1Tui4J9dCha04H++GGopC0OUDOA=; b=sxKo8eACwybxTPbCjXfH6aJNb/Uu4jVg9O1QvUeJYQ253Rz3ZttYG2yfWgG8dyKSkB /eEhwGm7lC472+ZqTXJHVOKijQ1zVu3Di4ZH1F2GBL0pFutClQJ0vQrOWXQ3rdZxsSY+ oauawM3/Wxxb3Ji3WOdyUcapDCKuh0uS40zm3KTnJXLfdmQPjuFDQkLB+7jW03xxloPa 9Xrvg3LgHC09Ba/becmea8CBeeRs2MMI1k6mf6ZQHM7wEit3UBfHE28o7inFLtRs3s4O Qd+k7+EXzKbVqGsXWgsED+fjP17wZC8Q1Pj3LRHrnza1GiFTpx854dvTIIvEnLAmJiDC gIPw== X-Forwarded-Encrypted: i=1; AJvYcCXO3vlQT1XKe9Fvlx7TJvkEE7+7Pafm+95sNFNQV5fMXjiyPBGEgI1hYru0TyP90B6sFKfym+5CH+6zXuisvXTxgAkO4oDTOx68ePcp X-Gm-Message-State: AOJu0Yx68AlsShtQgpZDVRiJpKA0I1nbENt/u9mcPbhy3teanyC1S92C TfMnX7ZkzAhU7IEMZWM/GBKtJHUCjeFUOIp1/8Po8kxbSdbXKectu8O5+CzOb2aKypoeXN7zFLC zaKFmk28HvcAVd/FNL44eD9Jp0wGJjv4DAqTGmA== X-Received: by 2002:a25:dc08:0:b0:de6:723:3035 with SMTP id y8-20020a25dc08000000b00de607233035mr2121144ybe.13.1714721332503; Fri, 03 May 2024 00:28:52 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240424-tlmm-open-drain-v1-1-9dd2041f0532@quicinc.com> In-Reply-To: <20240424-tlmm-open-drain-v1-1-9dd2041f0532@quicinc.com> From: Linus Walleij Date: Fri, 3 May 2024 09:28:41 +0200 Message-ID: Subject: Re: [PATCH] pinctrl: qcom: Fix behavior in abscense of open-drain support To: Bjorn Andersson Cc: Bjorn Andersson , Brian Norris , Jaiganesh Narayanan , Johan Hovold , Doug Anderson , linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Apr 25, 2024 at 5:46=E2=80=AFAM Bjorn Andersson wrote: > When a GPIO is configured as OPEN_DRAIN gpiolib will in > gpiod_direction_output() attempt to configure the open-drain property of > the hardware and if this fails fall back to software emulation of this > state. > > The TLMM block in most Qualcomm platform does not implement such > functionality, so this call would be expected to fail. But due to lack > of checks for this condition, the zero-initialized od_bit will cause > this request to silently corrupt the lowest bit in the config register > (which typically is part of the bias configuration) and happily continue > on. > > Fix this by checking if the od_bit value is unspecified and if so fail > the request to avoid the unexpected state, and to make sure the software > fallback actually kicks in. > > It is assumed for now that no implementation will come into existence > with BIT(0) being the open-drain bit, simply for convenience sake. > > Fixes: 13355ca35cd1 ("pinctrl: qcom: ipq4019: add open drain support") > Signed-off-by: Bjorn Andersson I tried to follow the discussion but couldn't get to a verdict on this patc= h, should it be applied or not, and if it should be applied, should the Fixes: tag be dropped or left and considered a nonurgent fix as it does not affect current behaviour? Yours, Linus Walleij