Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1318633lqp; Fri, 22 Mar 2024 11:12:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXxqDGoCMfywhzFWHpWgsPYsIGYIB4/9wO73zEmSu0tdJ9Xd/gmibbWk2ka4jHc6ZlYWhzS7Rl/X1hWCQ57Xm+qp7vMkLeooCi+N4qQCA== X-Google-Smtp-Source: AGHT+IFcYNq/KN71fiaLvxltt8MnFCcuO12T8ztz3djJVbWC4EiV/qay1wWx7vXtTaKNXO2QkFzN X-Received: by 2002:a05:6a20:3f1e:b0:1a3:4979:f25e with SMTP id az30-20020a056a203f1e00b001a34979f25emr334066pzb.59.1711131149778; Fri, 22 Mar 2024 11:12:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711131149; cv=pass; d=google.com; s=arc-20160816; b=zxkAykMJl4Nyz6hc7+DGtIJR4Ed1NWV7dXpatPUQIcGQ5MYIVcKP0E73sJ32TEWXZB NW8214SgXADzS8v8GYWPud7RvKdMli4NEjadUp/I0LtneUTMz/ohFiUuYbH58mbznRhf 9Kb/yEpzR5ZolYPyZL1SXJ+IbsvfjV5EI0FxIKJ7h0S6nqfNd+4a3MYedT1bf012KdtR o5sl9jllyA7tYcN1jdDeH9jivK1V/jSaYIR2vwfhU0paGmMRIUN9IZUzU6EHvU47Wp2o p5JrTnvBz865y93BpIlj60min2voBtCRz/mu6ZVxOR9mQNm25rqat4q5hWl/1CfQHpiR tYnw== 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; bh=cEZZ6UcF/6OqdxUtwoFvFV4fTYOsnaX6cU4CeHgJMEE=; fh=4L2f+/6l+KWbqDOAQvrgBkPYw7HmnsyObzFPI1/hw9Y=; b=U38/8kCoyqUnWaPPl0WxRKk2MtztARrmiQQ3afgyV0JLmIpveFeaL3/fW0k7SW0MPq 3G8uzZEBqTqonTK1mk+SyFJUJ3GlMOapvrDqegXX0DoVOqJttKWH9LwRgzsfh6S8JGTG sL810H9BwFXXycbZy7y/xGOg5JFwled1yNcrcX47/m7ags0B2bbSCQMJS7vcig1UxWZc vPoarM9bl3WdnInrGjhppqhtAi9q2cV/+tKjas8pOvE5uEYDSUBciNW8b1h95UZaYYeQ b8odFJEPbt3UxbQUVysAowcUo/w/ElVFuLVyK5e2gkBtCQRbCyUC94jwgqhSyb35NPGI otTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-111922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111922-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i30-20020a63131e000000b005e842a59daesi2420581pgl.864.2024.03.22.11.12.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 11:12:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-111922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111922-linux.lists.archive=gmail.com@vger.kernel.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 71B6C2819D1 for ; Fri, 22 Mar 2024 18:12:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 686C462A04; Fri, 22 Mar 2024 18:12:21 +0000 (UTC) Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (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 45403629E1; Fri, 22 Mar 2024 18:12:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711131140; cv=none; b=t42tDmnf0x8LeXB3RDr9W/2FBrw67SXSVhblcSFd6NwnE1GuMzonFdIUmUqYdTSTTlJXFJiDOhoIRMeHaZjAlbsyybqzkuZQHhHPXKn2zpoEGSpNVR6IYBszUT22Q44hH1EWBJpC0NVSn1GMyKvU9sMHXqpUuXZxuZY8MxeDCzQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711131140; c=relaxed/simple; bh=0hrvSYNToT8Eq5YXROkXYwZEAFnql+3JchMf3WGhKIE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Icn7e4vjsKqlySrxO/Fj7uLOlJXSiTQJ3j7BkyoSwnsBtHElyHuVmFXmyMmWg/FpZDlGJvdcP/R/RMRMJXR/v5lgNqVKD1SW7ydZXNVmK7yuf/PO3Pxv8hOB9EsroHBacnwAvb7wJWN0t/xzFs5A864znizhq2L8bmShwfp5raI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96.2) (envelope-from ) id 1rnjMx-0005ca-2P; Fri, 22 Mar 2024 18:11:55 +0000 Date: Fri, 22 Mar 2024 18:11:51 +0000 From: Daniel Golle To: Bart Van Assche Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ulf Hansson , Jens Axboe , Dave Chinner , Jan Kara , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Damien Le Moal , Li Lingfeng , Christian Brauner , Christian Heusel , Min Li , Adrian Hunter , Avri Altman , Hannes Reinecke , Christian Loehle , Bean Huo , Yeqi Fu , Victor Shih , Christophe JAILLET , Dominique Martinet , "Ricardo B. Marliere" , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-block@vger.kernel.org Subject: Re: [PATCH 4/8] block: implement NVMEM provider Message-ID: References: <7555db6eb71d4ccb2b9d5ebe3b41dc34088c6316.1711048433.git.daniel@makrotopia.org> <99874d1e-ff5c-4e8a-9922-752207119147@acm.org> 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: <99874d1e-ff5c-4e8a-9922-752207119147@acm.org> On Fri, Mar 22, 2024 at 10:52:36AM -0700, Bart Van Assche wrote: > On 3/21/24 13:22, Daniel Golle wrote: > > On Thu, Mar 21, 2024 at 12:44:19PM -0700, Bart Van Assche wrote: > > > Why to add this functionality to the block layer instead of somewhere > > > in the drivers/ directory? > > > > Simply because we need notifications about appearing and disappearing > > block devices, or a way to iterate over all block devices in a system. > > For both there isn't currently any other interface than using a > > class_interface for that, and that requires access to &block_class > > which is considered a block subsystem internal. > > That's an argument for adding an interface to the block layer that > implements this functionality but not for adding this code in the block > layer. Fine with me. I can implement such an interface, similar to how it is implemented for MTD devices or UBI volumes for the block layer. I would basically add a subscription and callback interface utilizing a class_interface inside the block subsystem similar to how the same is done in this series for registering block-device-backed NVMEM providers. However, given that this is a bigger task, I'd like to know from more than one block subsystem maintainer that this approach would be agreeable before spending time and effort in this direction. Also note that obviously it would be much more intrusive and affect *all* users of the block subsystem, while the current approach would only affect those users who got CONFIG_BLOCK_NVMEM enabled.