Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp524678lqg; Fri, 1 Mar 2024 12:15:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWt4CVCz1SsQrtHo6TyFClvVrzeDFUC7+RYsGK4mlPcLWCqFPwewr7Juw7pNRaU4H/kgFH/sCqYKdXiHHn+jZWPlkrcJ+Fi9dpr2NPthw== X-Google-Smtp-Source: AGHT+IH1M8EzoHif7LSxd6BvM05RQhLNm2+Hdc/HojXeXCJDQtN+RAhcaOCv+mba5cJWh3bMQWkB X-Received: by 2002:a50:85cb:0:b0:564:ae07:e539 with SMTP id q11-20020a5085cb000000b00564ae07e539mr2038774edh.25.1709324153722; Fri, 01 Mar 2024 12:15:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709324153; cv=pass; d=google.com; s=arc-20160816; b=P0KVkBg9rTSXnaOy4vzYxB6ritLqYD8z4WsHrb729733h0aHrL/tvPPDqqiXZ0Gz9f 6sDoeXb/7riOpW6652C+iKG9IfhM8uuy3FoUHUUw11P9IQwERs4c66/lfJRbF3GT7Bn6 lF32O+6WxLKb0B8Zzp8dFPKaGer8NB75XwbFoS4JDy5RSZ3Ll1zsvSwDc8sD4r/O9Uvb ExdNeWWi+yUjILJ5puJSu4mt6rEwxajPo65n76rbsZV4Lzmdk3GKbmRwMAMRchu/J/rj NtqzAkb27CJ2/N9VJILvFjNlZspCScuF/o0l1W7S200z9DO6GjXhWjF+T7qr1cBKqvCu GrRw== 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=m/rG4i/FaFpZq2EPobCeet278rbB92a2rTRXgYLGseE=; fh=raYnR4/v4HMNERlxF9S8IuGwxP3b9RuMDnSlNrBxS/4=; b=nzOCeadOqwAxLQGnklfyfGUKTTb4vqw/9uyIoh5FzH/iMlDPw32ZsUjAZIv4oumqEf N9ABpwZX74lVdn0wQJ69Di+UJRyyvs6KiaCypOgcS0FDRcKg3KiiOJ8jqlDTgcMhMN4M oO1njNajVP9vw8/u9TbI8lYnqlNUQeWSkXRTbomKqb4C1yvX7kF87Z9H/NWCWdjVPVVI u63suukehRqjDo1C1/nDSqtFf0Om0mjD2I8ysLdactLvaS5TnYaoWg+uBbqYetNGIuyH RFyA5wt1unIeArRGgCTCikdAlhhp1csvzSLbprAvediR9xujUcapb6EAMv9Tx9q9T1Rd MDfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n0hhgXzx; 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-89065-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89065-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g25-20020a50d5d9000000b005665e0d9350si1660644edj.388.2024.03.01.12.15.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 12:15:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89065-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n0hhgXzx; 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-89065-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89065-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 404D21F25C6E for ; Fri, 1 Mar 2024 20:15:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E8A473C484; Fri, 1 Mar 2024 20:15:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="n0hhgXzx" Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) (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 880183BBCD for ; Fri, 1 Mar 2024 20:15:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709324146; cv=none; b=MjH1fD8hCyMoZeI+c9wIN5lbib6ZktIWIgLpY5V5k2/lfO9gj2U6g6fRxQMYbGuP/hw0GsEBljj76hBjpCgulR/3welizadwFdoqZ1iaHcUDHLAxAfNMAVxKHYXa/0c09qBRcGXVdMO4PceoWokzwWm607tyZ+EHPa8+BEPAa/c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709324146; c=relaxed/simple; bh=m/rG4i/FaFpZq2EPobCeet278rbB92a2rTRXgYLGseE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=nLYchjgdxWEuk+GG62cEcP9+TxUGCzfQ3E51A5eQswjdC96ki3Pc8kXbVJ8nB58r1EkR1Qsom00AdXrWpvSxc02wUgpVFzIkjuqZg3uM4savYG8Y/KIL+rN8IS76wBbMGEMlbBLsk2JPX/QvF//2anOZb81HdqeE53zZnJpNLZo= 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=n0hhgXzx; arc=none smtp.client-ip=209.85.219.179 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-f179.google.com with SMTP id 3f1490d57ef6-dcbcea9c261so2805785276.3 for ; Fri, 01 Mar 2024 12:15:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709324143; x=1709928943; 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=m/rG4i/FaFpZq2EPobCeet278rbB92a2rTRXgYLGseE=; b=n0hhgXzxAPedWBcLJ0y06BsJcEHZGv5TzG8KnQo+7i09T8CieKlFIeXknl0IhvENqM 8dxLrDZFfC0OOfFNFHnf0Zqv+wyQ+GOWpBcKbmm2gMbNPUtecHNw7b0cmPmn8OB4oiru kv6bnlTbL1VqC83wOk6YHkwdvgOQsmQqC0U9No61Ul6XjiGRo4Hd7L3AMXvDDmrU+/u+ gdzLIbNHpszXRGb5Y1m6vc2XZXTGX6Iew/JO5SIqE7vLJmAtwdX9uptBPdhaWNRCnZrR q3r0gHv9NaFs0JfhKDWVB4HKDoIaogpLlKQEd8MDkhXcN6HFS6yEULIPO7FBVW//GiA1 /Law== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709324143; x=1709928943; 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=m/rG4i/FaFpZq2EPobCeet278rbB92a2rTRXgYLGseE=; b=UydSrMevHpT1txbamxAMndTiV9ugB9wZ1bRjugoc8Z0N7u+5l1J2bwYp9hiV4cbxQR oedJLehq5H2pDK/rOoC9beRja3j8iRP+LQm3mw+G7m7NEOtbAwrqHWRBJOMD4lEA37zT ywC+qBPqu+lBYhrEGBrmEu+Cvl7uwnz2c8xv8UZXimPFGKR8fD9UxaklCpqG0uRFq4eN 8Uq9iF9dPFkNDIeyXBMuqCSson6y7xCUSPdZ0OgJkbmk82PoQh+rLM99L43CEFXzNDBo jR9sK8PiLc4SccLqxboln/HrewKGBD7haVQ33S13M7/65e5C4feO1kwuy3/XmkkCO3vd 2ctw== X-Forwarded-Encrypted: i=1; AJvYcCWBngK7ZW02vgpGWpIg43HO+6jpOTReXNXjFCSNM/WJsyKd7fvhWEPIetcczfP3UufqI8yB79jQtWJB3S8yY1nbKIupEjPdpHIs5b/0 X-Gm-Message-State: AOJu0YyHiq8ajJLMA/IJfWZYTsmj2oQxi8jjMdLIsgrsCsSvHpyNj+KM l1FJJeB+TdohsZ++MzfwwWst6A9eGjPZXXxZaty32F6Cf/aF4oj82NfhivuEf3/7/h4ag/ezoVD qSUvCXl4RY46N4pDjyUngqToHf4tM0/Rz+P07VywGj99PoYSc X-Received: by 2002:a25:b47:0:b0:dc3:696f:167e with SMTP id 68-20020a250b47000000b00dc3696f167emr2301713ybl.64.1709324143460; Fri, 01 Mar 2024 12:15:43 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240227113426.253232-1-herve.codina@bootlin.com> In-Reply-To: From: Linus Walleij Date: Fri, 1 Mar 2024 21:15:32 +0100 Message-ID: Subject: Re: [PATCH v2 0/2] gpio-cdev: Release IRQ used by gpio-cdev on gpio chip removal To: Bartosz Golaszewski Cc: Herve Codina , Kent Gibson , Saravana Kannan , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli , Thomas Petazzoni Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Mar 1, 2024 at 8:21=E2=80=AFAM Bartosz Golaszewski = wrote: > Agreed and the big picture - just like with the reason behind the SRCU > rework - is the fact that even static GPIO chips defined in ACPI or DT > can be unbound. Unless you want to make the decision that we > arbitrarily suppress_bind_attrs for all GPIO chips which I don't think > you do. > > I have shown in the discussion under the previous iteration that a > static GPIO chip defined in DT that is also marked as an > interrupt-controller may have interrupts requested directly from its > irq domain bypassing the .to_irq() callback. As long as this GPIO chip > may be unbound (and we do not restrict this) it means the splat > mentioned here can be triggered from user-space with a simple rmmod > because a requested irq does not increase the module reference count > nor do device links seem to work for interrupts not associated with a > struct device explicitly. > > I DO want to fix it, don't get me wrong. I don't want to just leave it > like this, especially since we've made so much progress with > hotpluggability recently. I just don't believe this is the right fix, > I will try to come up with a solution that addresses the issue > globally. OK I trust you to come up with something better for sure! With regards to the ability to unbind/rebind drivers from sysfs, true. I have heard about that as a counterargument to many things. The problem is that I have never heard about a user unbinding/binding a driver from sysfs for anything but debugging a drivers ability to bind/unbind. Partly I feel that thing should just be moved to debugfs given the usecase and because it just looks like a way for attackers to provoke crashes given how some drivers look. Yours, Linus Walleij