Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1142195rdb; Fri, 2 Feb 2024 15:38:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IE6TcGVO2ZEUgJV879onhl64okPm4mBCCoi5rxYzgjLtazB3Nl4gX+L3VGEg+8p3ESufSz7 X-Received: by 2002:a17:902:7c8a:b0:1d7:163:54be with SMTP id y10-20020a1709027c8a00b001d7016354bemr6169617pll.59.1706917096911; Fri, 02 Feb 2024 15:38:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706917096; cv=pass; d=google.com; s=arc-20160816; b=O4MGmoWFW3ClpLRZ6qjVxpPr70zEREo5pwHSibljfX8i1bqP1ptuusBZqzjSK28vGs 935IOjsVklIK2EfM4qCMH64ls7Dgx93FcoYu+CaX3ot+dRgrdNoubrJJeLilhzSrFOuG LKJmBhg0I/ZdarSYf7ZbKBPSSNO3rPH2tRxn2IJWvE2bHxS5GPiWaplPNZmgd2B/r/Mu M8sqfEM1Ch9zityDgbvzWBca09fFSDwHB88PkumxSqo97t5B5+oQYHMB+oJZL911uETV /cfvwp0OQC0nPlWcvvSBUQX/UXRooX3Mx24t7cRa2Pg36o0Yn9zs26kXlkttQ9FNiNcy hraQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=aGafW+AuanYuQZedcyvo9CsIkWE3LqB3BWtfCaod+iA=; fh=vqShKIxxX2avPKaZzb/WZDZFY12eg19UGFYaGVQdHjs=; b=Ijw0He6DsQ4lRPfhLvIu6yDl8WKoYlzu6Is7dbr5dI4eNqf1JCcGa7Y9icL1gXoqN9 /uuxwWfJlV+5bJ0rZQZ4rdUNo3LJ8v45wLF6e8wN/BA4cOGPL2f9uU0pcemCe2Ur5zWj IKS6NcCd76PYGVtfhAXLssBWKCv/vqUJZ/82pvkYWJmNzlVvhgq5TI3nTAe4yRWk67YO YBhk8MA/CcyqV/eOHPpSas0exidvwt2lk9DWIVC8QiPLsUd7ZrHK1xo/cqcW9V6nTM1O NJQx6kUjs65w3J8T8otcWNvJnnbfMX/05exEScQ0Ib1Px1znPVRbl9h8x3VCZDa87Hqn maPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="yB/e/tJf"; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-50714-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50714-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org X-Forwarded-Encrypted: i=1; AJvYcCX5p8Zal+hnGptD+LMMyMb7wEwa7TSJDg6Fujou92yink2at4IDw316wTFl/P4QvukiqFflawhRsPKZfGVkUTTQ8N0l06cuS899B6GK8Q== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p8-20020a170902bd0800b001d74bf99a3bsi2348814pls.575.2024.02.02.15.38.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 15:38:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50714-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="yB/e/tJf"; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-50714-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50714-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9127D28612E for ; Fri, 2 Feb 2024 23:38:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B17012C81F; Fri, 2 Feb 2024 23:38:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yB/e/tJf" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2EA7C5B697; Fri, 2 Feb 2024 23:38:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706917088; cv=none; b=bOeBO75rWJFqYS5C0zbgmWTbaxznpT0DlFgKxOfM6RAwUfvufr1u+Ac/HPhk/9gfHhOa6ZZ7cb03Ra6nMFBJUfKEmKmK2+AdH1u8uVyrxU+OxWqZQedbNt7XptXEUBeoZH1O7t8Q22dbJT32uRY17bpNkqoBIlloLGm4hkPqx0g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706917088; c=relaxed/simple; bh=aGafW+AuanYuQZedcyvo9CsIkWE3LqB3BWtfCaod+iA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ukc2+DrZEj9BJzs4ZBfxA2iNLH8m+4M++/Yt8Od9TozOeryGhfScOKQjhddKyGjL/W5VuxhYRYZ3smICHEYf/3MSciJpx0J8Q/A05s6IJOlvoKT+TYjV8QAVLHxE46TlmpBl3edRDCp7nPM59oICx33FZpbH940D7UQC8viOKOw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yB/e/tJf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E89AC433C7; Fri, 2 Feb 2024 23:38:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1706917087; bh=aGafW+AuanYuQZedcyvo9CsIkWE3LqB3BWtfCaod+iA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=yB/e/tJfVi4GSFcStZoVf6gdrzwDzzBD/18SbsHCvLff+CA24l2sk2KGeTooU2Aov pf0f3eJC7DiBXU/4wBBUxNaTgEpZg0PMy4e+2BUnwTfsM6oN+Z/rIKzcuehkwjLNuz FsBBYxoj0PWvI3k4Pzocj0rHAD8140unw5fPmQ90= Date: Fri, 2 Feb 2024 15:38:06 -0800 From: Greg Kroah-Hartman To: Hamza Mahfooz Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, "Rafael J. Wysocki" , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Bjorn Helgaas , Mario Limonciello , Lijo Lazar , Srinivasan Shanmugam , Le Ma , =?iso-8859-1?Q?Andr=E9?= Almeida , James Zhu , Aurabindo Pillai , Joerg Roedel , Iwona Winiarska , Robin Murphy , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-pci@vger.kernel.org Subject: Re: [PATCH 1/3] driver core: bus: introduce can_remove() Message-ID: <2024020224-unsoiled-velcro-86af@gregkh> References: <20240202222603.141240-1-hamza.mahfooz@amd.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=us-ascii Content-Disposition: inline In-Reply-To: <20240202222603.141240-1-hamza.mahfooz@amd.com> On Fri, Feb 02, 2024 at 05:25:54PM -0500, Hamza Mahfooz wrote: > Currently, drivers have no mechanism to block requests to unbind > devices. And that is by design. > However, this can cause resource leaks and leave the device in > an inconsistent state, such that rebinding the device may cause a hang > or otherwise prevent the device from being rebound. That is a driver bug, please fix your driver. > So, introduce the can_remove() callback to allow drivers to indicate > if it isn't appropriate to remove a device at the given time. Nope, sorry, the driver needs to be fixed. What broken driver are you needing this for? Also realize, only root can unbind drivers (and it can also unload modules), so if the root user really wants to do this, it can, and should be possible to. sorry, greg k-h