Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1891617rdb; Wed, 31 Jan 2024 12:16:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IHbT0/tqGAtlDvR9E0ofCD6PL8g8JrRtVlLmtMRTQvjTQQkT9GjSKn8Hc0ylDzf3ACcnpcP X-Received: by 2002:ad4:5fce:0:b0:68c:521f:707b with SMTP id jq14-20020ad45fce000000b0068c521f707bmr3037013qvb.64.1706732202546; Wed, 31 Jan 2024 12:16:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706732202; cv=pass; d=google.com; s=arc-20160816; b=N/5Tbf5exigillPS/Wdl7cBcKePitbK3rRzbeY2IvQPN4vIqh5nakt21Ncr3Q6ef8L V9kRpgeuQ3nGdDIOc6LdLXqv4ibrKJiUhuBIFHakDa9LYVZJo+26Xzxo/VPJ0UFuxJH4 r2UU5KdUWTK6qxtHO/efbeGt08hoCOYK8T23WVIVFASigXoD7WngEAnYwj1dYxMzPi0d 1AmE52BLoKso1c8s5vla3mednHIpCrm+rNRUKpHqXhKIi4WZdVVVbV7ILRIMuilV1QoS RS5zY3kGNySwK2e8hWyRVvq0VHPSwLKQcccykwGaE6PQ7vAz6veOyle5WkwQbp95ZmlF wpZQ== 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=JbKC+73posjGFpYb9gcbTa9LruZ7n6Vqx9LSCaLAvaY=; fh=n35JuuDUakjfI84MlaY2pdCrLrmW4AhLNclI3a6E/Vw=; b=o/X31O8cuowGThE0rKnujRph9kMEnSBO1sQ/aMxoqm0fKfinHajDp0ufHsFqm+xkkX MNP6X3d0ztO5RL4zzOdXd1VxeAQA/cZIGaTOck67RqQ55Y4HaVLPa3JZ1ZN+MAhVobnq rI9T9UT9Ai2mIGhV2ZG8vIOcX0xcoZAU0jUSnNBWQW3NTRu7pVeSV8xXAXKV++pGPXNH QY7LewA3F9szQhhWw06F60mGXBnI9X1xw42m3W8CNBx7/CVhSctsDOSnDpjmnebYQ6EL 6DZuNPXNTAnNerkKowlFC2M072mDk77iUnD3g/qM2YKQaGbPbptce05J4swWZ18DcwKM Q2BQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uFLOS68i; 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-47054-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47054-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=1; AJvYcCUeECKagjZnxAdEp7GfSeQml1gBPK7uleqDomSnTOuJoMkFzufB7PEx42GNbFkW+T0TrUiLP/R0VKp+tyvB9DNeCeVQqnSjAaThYvY9dA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id iw7-20020a0562140f2700b0068c4088317dsi10058288qvb.49.2024.01.31.12.16.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 12:16:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47054-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uFLOS68i; 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-47054-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47054-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3B38D1C22AD8 for ; Wed, 31 Jan 2024 20:16:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B91EB3EA9B; Wed, 31 Jan 2024 20:16:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="uFLOS68i" Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) (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 566CC3FB10 for ; Wed, 31 Jan 2024 20:16:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732193; cv=none; b=tOY1IsG5Zhw6V8qaIP8/Z0u44qDKMp2+Qz9AbRLhGSRhGiLZ5tb/K93kbyXgNrywTTx3oyFCftYS9Cu25GiHeQ8EYyO8Tru8EzKiy5IUTepapREi/psiEy3Th95bTPX8X4V6R8RrjSxh7dqxzxnEBFCp4j3ZmfAT2FoUtiFvVy0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706732193; c=relaxed/simple; bh=JbKC+73posjGFpYb9gcbTa9LruZ7n6Vqx9LSCaLAvaY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=scVH6AEKmFprUOhmR1LI8imr9CTnASlgg2hJxNf126qbvJ5sIX6bukZewx8gjSUUwzTFAPADXinkGZkr+/fCFo0fvEEN4akUaBT/3WFDoimVtW2NITjc12mFVLo3ljNM6t/7PQq+U9IlauAaq7HEu9bAScIEaTbMPXhUcCALVGA= 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=uFLOS68i; arc=none smtp.client-ip=209.85.128.175 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-yw1-f175.google.com with SMTP id 00721157ae682-5edfcba97e3so1903537b3.2 for ; Wed, 31 Jan 2024 12:16:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706732190; x=1707336990; 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=JbKC+73posjGFpYb9gcbTa9LruZ7n6Vqx9LSCaLAvaY=; b=uFLOS68i/yyrVqC7VDAnP6ksgbG4HLyLifc/V0kmd2Gi4kvUcbqagat7WEUvA5eYNf vUE4zX93cyvIn79qtesy0ZwQ7z0N8cmuca3ucB5HFk/W7XJgBezZmI9f8Iv9QaRe3DGO Ir2nnCrWKhQiu9zEfXxYutSBXBH3s+MS7+Yesm/Wi+0s7w/YtAqcbnlTj5ZNapUwDJT0 /9vj2LXQbyiLD+iS3lPP4NnVmjvPCPfxFL9Te8fcCjJ7AXDto+emsliwu9q/rmTi0UJo zfhXQQsR4mKj8emMjuypeyvpmxzUTyXqpKhO5kcc3r2gbuJJZ2HnbmviU5sBcHwZuTHU hCeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706732190; x=1707336990; 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=JbKC+73posjGFpYb9gcbTa9LruZ7n6Vqx9LSCaLAvaY=; b=XHmfqu5llzNn7LHl+H7RWpIWhYVk5sawmqlqpCqFBu3q4hYu1eRhklusUqhEpju8Js Beyjnup+5LQrKeEHrwuNc5m51lKIBANqNNOoySYo/xvEFYFkG1ntVineA6wvoaa5EUta pqS0besbl/wyBvAoo+LkngC7myK8nWVsZma4msUfqmwjUmNqMQWo4qs2liT7l7rw7JQu 3hEX7JjBZt5DbxAOxAx0fXjxtPD9LgFoLt4uOHLzrGL06wCOkv6A7pPD8ABOpCH0U+hh SSOgFRUq1f36v+lcfOH91mfe5jDfMQw3O9R9Numq/v/LAGJi0iMWRLrLxZT8h/0sRv5r OvSQ== X-Gm-Message-State: AOJu0Yz2/u4mBhNXvzukm+vnRufhlpMGWEBubLhV1ph6kWId1wxnN39P iEzyKDDkkZMP+Hgrc50T3Klyf2U5CDNiUazcvIWPmLUucsPpx1FxZtIcVQMzX3ebyy6nUAexmsM OQ2ao5Ccsiw9RDQpF7i7lYms3SMxdZIOuj1ZdPp9p6HuHvvEQ X-Received: by 2002:a0d:d60b:0:b0:5ff:83f7:57e7 with SMTP id y11-20020a0dd60b000000b005ff83f757e7mr2547764ywd.31.1706732189732; Wed, 31 Jan 2024 12:16:29 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240130124828.14678-1-brgl@bgdev.pl> <20240130124828.14678-17-brgl@bgdev.pl> In-Reply-To: <20240130124828.14678-17-brgl@bgdev.pl> From: Linus Walleij Date: Wed, 31 Jan 2024 21:16:18 +0100 Message-ID: Subject: Re: [PATCH 16/22] gpio: reduce the functionality of validate_desc() To: Bartosz Golaszewski Cc: Kent Gibson , Alex Elder , Geert Uytterhoeven , "Paul E . McKenney" , Andy Shevchenko , Wolfram Sang , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 30, 2024 at 1:48=E2=80=AFPM Bartosz Golaszewski = wrote: > From: Bartosz Golaszewski > > Checking desc->gdev->chip for NULL without holding it in place with some > serializing mechanism is pointless. Remove this check. Also don't check > desc->gdev for NULL as it can never happen. > > Signed-off-by: Bartosz Golaszewski I don't know if I agree that it is pointless. It will work on any single-CP= U system and 99.9% of other cases. On the other hand: what it is supposed to protect against is userspace doing calls to a gpio_device through the character device, while the backing struct gpio_chip is gone (e.g. a GPIO expander on USB, and someone pulled the cable), i.e. it became NULL, and this is why the error message says "backing device is gone". But I want to see where the series is going, maybe you fix this problem in the end, so I can come back and ACK this. Yours, Linus Walleij