Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2186807pxb; Tue, 23 Feb 2021 00:07:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzfovrjZvpy45c9uVJsmJ+IXWepheUkY0m/vH0mNcku41XgdXp+KFo/567/UP95DVRXWtLw X-Received: by 2002:aa7:d145:: with SMTP id r5mr16960520edo.246.1614067653946; Tue, 23 Feb 2021 00:07:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614067653; cv=none; d=google.com; s=arc-20160816; b=tOxcaNP1wNJyD65QvYXIxiGf1vf6Z73EfiIBLeV+ANP1tamdZ+/7eZzoP77A0/nOsW 5ybyaib76T5S7Cr5agQm8U4K9fHkogrMiZop+HS5ThzA0zXXIdOFlhyVxHTgzwJn8HmJ /VYDHTxXv9nIITVzawYq+GPtxP2qqrxE2BicNXh1p8QBJQpruX9XSF21rltq4FjRB08W fB+MK7eJ7ObC2GMeHPR8q0qbl9/OkakQXmRHo7XAs575YsAbbImjRgffLMyUtmJcsH5U wRWe9HNWPEAegvEc3V6Fdgmdlf7q7LWZOp/6zmhf3BwacqvtbjYombZYYxuzwpoXtrOA 8W+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mY2Jzz0RXC1o46ED4Btlusk6BUIOV1idd/2vbylU+w4=; b=SdKjOKGjFAB6MJPMrAz26sMyaYnqKwUaGHum768/s4LMda+Y20Y9uGVMJWJceD30b4 A059bC3GbEvJBKJ08iOhd2fC0sOb/Ig+kRpaFyZlonm2F4htXfZfBLlyy25eqS/aneg8 4sLdjFUTPg3yggTeHwvLccOCUyDz1M6FShp49HcVL3tBryvbBPDbj5gZt5VahA1w4+Cp emf/MzYVF9GeCXQkBpDzy+d/OCPOt+l5kxuvw5te37PVvI5FOrYpx4P9+PBWQGELrbjT t/NKYGUIBZs21aVtEDPL6XsUvlt2piiJPMIv3zw7QcmG0r7dLWEmGiVEliEgK3PP26Lf afoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YAQTMxw9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k7si13842683ejz.76.2021.02.23.00.07.09; Tue, 23 Feb 2021 00:07:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YAQTMxw9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231969AbhBWIEe (ORCPT + 99 others); Tue, 23 Feb 2021 03:04:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:40122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232147AbhBWIDl (ORCPT ); Tue, 23 Feb 2021 03:03:41 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C976264DAF; Tue, 23 Feb 2021 08:02:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614067381; bh=jPx4LV2bldX3/+xhN+fFDKFW8lIjZrChpQM5Wnm09qQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YAQTMxw9sO/cekq6q7hkeSF9CuLk9KpT6pOH/OQcYRvwNWGOAIi5b4stdL9qLr2FJ MAr2cxJ0XMh0jyNPWgJ4yjgqLP2i9WHzk9zdRSw8u/xl+run4OV9mA2bCsdOAkyuyW M22hTM3begRWf8Uh731HentmfuP09gIg7wBoioqIRmuSnHX9YIuRBn2hcbXPF7JX/r mXDlG+3r59M5d+g79YGJmNUuRToBeYO6Ybfza7C1EQIlkVrsGxoO9rnfpWBDdWiKDP O+unDD0TL7w4MxTYAtSpkHl4F0zSxVAJRGDVtAWCDaXn/8KLPhC8ml/iZhlkRltpdY 75p+g2z6DMmkw== Date: Tue, 23 Feb 2021 09:02:54 +0100 From: Robert Richter To: Dejin Zheng Cc: corbet@lwn.net, jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, bhelgaas@google.com, wsa@kernel.org, linux-doc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/4] PCI: Introduce pcim_alloc_irq_vectors() Message-ID: References: <20210218150458.798347-1-zhengdejin5@gmail.com> <20210218150458.798347-2-zhengdejin5@gmail.com> <20210219164649.GA814637@nuc8i5> <20210222151415.GA896979@nuc8i5> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210222151415.GA896979@nuc8i5> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.02.21 23:14:15, Dejin Zheng wrote: > On Mon, Feb 22, 2021 at 11:56:08AM +0100, Robert Richter wrote: > > On 20.02.21 00:46:49, Dejin Zheng wrote: > > > > On 18.02.21 23:04:55, Dejin Zheng wrote: > > > > > > > + if (!dr || !dr->enabled) > > > here checks whether the pci device is enabled. > > > > What is the purpose of this? The device "is_managed" or not. > > > The device is managed or not by check whether "dr" is NULL. And > check the "dr->enabled" is for the PCI device enable. I think it > may not make sense to apply for irq vectors when PCI device is not > enabled. I don't see how a disabled device affects in any way the release of the irq vectors during device removal. dr is always non-null in case the device is managed, a check isn't needed for that. -Robert