From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 491BE14AD20 for ; Thu, 14 Nov 2024 01:53:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731549204; cv=none; b=JXNpv2xpInLgjsM350s4j+IWKjlhzXSNv4BoliLlSI2JruOvLPsUQ+d29DyWz500UnUZxRyZes98V5/RxknoDv5lQ27jnQWk2XHQMqVsTQJWhkcHg01MXqcA0Ia28EMwx51gN3aHRSo2JbsP9TzhDXFeaYbFo9pokvFkIhstH30= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731549204; c=relaxed/simple; bh=R7x7pjybJYVTt7xbgrbtqtCIwgd0awU+glBfxSo59DM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Rg7y00MnALiOq3pkceSdtddU+1qqAl1/bH6PlzBAhcJRAlBE1VnbP8A/DNr1NgE9hSf8bLo7ougjwPfAVW8mic6YRAN0v+69Sa1MM8lnQbSi+Ewz2Mut6HQzbK0eXfn9o0K78OfggoJ0d1MbMJB0RdSC9tMKxvNeWKTgO0rDtCc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=jUif+tmU; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="jUif+tmU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731549201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=d7VonX42shxT96KYGey0nbt1GczZThNx0w3qXBIrjLI=; b=jUif+tmUIGScIAj1JDi01bEI+N39PtGd3HN/lGLHJl3nKQ0tvOmIXgrKb8Lw0OgYAZapb2 UXPrYqV2YzixBpmTEoie0O7MZ/X31f61e1BbnFe//aEy7ja1HaKYEX2yxTLNtO6nJrSATf XK7RuX/st6IOSagPInvnFex1bB5si1I= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-668--0qIiGIwN9e1f3wh8DP2LQ-1; Wed, 13 Nov 2024 20:53:19 -0500 X-MC-Unique: -0qIiGIwN9e1f3wh8DP2LQ-1 X-Mimecast-MFC-AGG-ID: -0qIiGIwN9e1f3wh8DP2LQ Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EE08E1956048; Thu, 14 Nov 2024 01:53:14 +0000 (UTC) Received: from fedora (unknown [10.72.116.113]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D5A181956054; Thu, 14 Nov 2024 01:53:00 +0000 (UTC) Date: Thu, 14 Nov 2024 09:52:55 +0800 From: Ming Lei To: Daniel Wagner Cc: Jens Axboe , Bjorn Helgaas , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , Eugenio =?iso-8859-1?Q?P=E9rez?= , "Martin K. Petersen" , Keith Busch , Christoph Hellwig , Sagi Grimberg , John Garry , Greg Kroah-Hartman , Hannes Reinecke , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, virtualization@lists.linux.dev, linux-scsi@vger.kernel.org, megaraidlinux.pdl@broadcom.com, mpi3mr-linuxdrv.pdl@broadcom.com, MPT-FusionLinux.pdl@broadcom.com, storagedev@microchip.com, linux-nvme@lists.infradead.org Subject: Re: [PATCH v4 02/10] driver core: add irq_get_affinity callback device_driver Message-ID: References: <20241113-refactor-blk-affinity-helpers-v4-0-dd3baa1e267f@kernel.org> <20241113-refactor-blk-affinity-helpers-v4-2-dd3baa1e267f@kernel.org> Precedence: bulk X-Mailing-List: virtualization@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241113-refactor-blk-affinity-helpers-v4-2-dd3baa1e267f@kernel.org> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 On Wed, Nov 13, 2024 at 03:26:16PM +0100, Daniel Wagner wrote: > Introducing a callback in struct device_driver so that a device driver > can hook up the getters directly. This approach avoids exposing random > getters in drivers. > > Signed-off-by: Daniel Wagner > --- > include/linux/device/driver.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h > index 5c04b8e3833b995f9fd4d65b8732b3dfce2eba7e..0d1aee423f6c076ae102bdd0536233c259947fac 100644 > --- a/include/linux/device/driver.h > +++ b/include/linux/device/driver.h > @@ -74,6 +74,7 @@ enum probe_type { > * @suspend: Called to put the device to sleep mode. Usually to a > * low power state. > * @resume: Called to bring a device from sleep mode. > + * @irq_get_affinity: Get IRQ affinity mask for the device. > * @groups: Default attributes that get created by the driver core > * automatically. > * @dev_groups: Additional attributes attached to device instance once > @@ -112,6 +113,8 @@ struct device_driver { > void (*shutdown) (struct device *dev); > int (*suspend) (struct device *dev, pm_message_t state); > int (*resume) (struct device *dev); > + const struct cpumask *(*irq_get_affinity)(struct device *dev, > + unsigned int irq_vec); > const struct attribute_group **groups; > const struct attribute_group **dev_groups; The patch looks fine, but if you put 1, 2 and 5 into single patch, it will become much easier to review, anyway: Reviewed-by: Ming Lei -- Ming