Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2466043rwb; Fri, 16 Dec 2022 02:23:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Bf4Ny3NMSTnBElS0TAVkmLAK+T8lcdtjulEl+k8rGN3V6PvPIWwy4TigVs67zKmBELiFa X-Received: by 2002:aa7:9012:0:b0:566:900d:466c with SMTP id m18-20020aa79012000000b00566900d466cmr36188627pfo.6.1671186223565; Fri, 16 Dec 2022 02:23:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671186223; cv=none; d=google.com; s=arc-20160816; b=tbwc+6yRm0XQH6e5b0K7BKevkUQvFW05WeS/zNil8CF2YPJC4KyKw4OtXbulNCLOGR d/0N6GSqJHrBrO8gNr5TRTTF5yjkmqEM/ymPsTfrNnyS5q2vkYHy5DRCLmUEiwMS6NlT FoCRdmHASsqp9vIPwTgbpZvSvYWqZR2kYVBbdeDpOax5IQ0yLxqZTzhenZfaqhbeRv8B CIXjqUzXOqmVBHBoVbOD6t+5nCciiQ0dFcZ2YT8YjO+0q9KsqGY9Fp0wESspOWG8gp8z 9THXjj/MM1gp+UNIOH6t1vzHn4qYnJ7ci0dOZjlwzbhC5ODfbY/G+yT8YCjNc5E3IYII O15w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Sh31PThuoks4nXqvrVl6+04wK4zAVvwbF2buQNrRLMc=; b=P30vEyRzg9NykCTRrKYO1CInvNvtj2WFjb1XXB7H5V2jqVAUP6NNJ7hbx5zKMWDHyA hdoYNRN7zQDOZjrbv1Qkvip9gknypL7CUcJO5mzVD5RK2a1mEVO/idIsd3+LsaPItXPs AwdcFGnpJrSWTP2XIYmSpfzR9Hj/MZKbIjrHh/3I8h9mHedLrnHXv2FunNPWgXXReXpH eow9i8BmEfZC9eLqhR0BTQ+f2nR/Ing6QG2lYP6qO+KlF52R5ufRgO5hgLQLhHBXvHGz PDbH63KwW5LsDAXsEeCAQ0aDsdrC75iR3WhnJO80LbDFgU4Mpr1XWrBnhXSuJikL8iBS m/tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=f7TLxXs3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h15-20020a056a00218f00b0056aafb43783si2116026pfi.155.2022.12.16.02.23.34; Fri, 16 Dec 2022 02:23:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=f7TLxXs3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230176AbiLPJi6 (ORCPT + 68 others); Fri, 16 Dec 2022 04:38:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230170AbiLPJix (ORCPT ); Fri, 16 Dec 2022 04:38:53 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E297046675; Fri, 16 Dec 2022 01:38:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671183531; x=1702719531; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=IY7vY5n7yGY6h3AEjtKjdblFwlLaoZs4ETO5gdM+BpY=; b=f7TLxXs3AMrOkx212uMp/tP3nfpRNF0AJjhE+moEWW27bFst/YXIcNPh xRi56h5GzOlT0N3THalVO8Htm32U4c3CA/891abvpAWOxqsLlIc6GqQOu 318E6H5KVtaKfJeJicexYHpfrugEob4QOIhT5lgyjQo0DSHOehwKjbdLm vMw0FIGm4l+tGB5bEoulH0QPCTzLn33qaV+bGcIKsttYeFZyqjfhajT2d gtjootIvLbhJ3f7bInWFu2xzSR3bsXnPLKgID7zoyk7er+VFn+quM7An3 0ufr/yrGjYGSGWmJWCmQ9aoPE5p47Eh9TvGcLHj/PtlvCPHkZK3p+782q g==; X-IronPort-AV: E=McAfee;i="6500,9779,10562"; a="317626649" X-IronPort-AV: E=Sophos;i="5.96,249,1665471600"; d="scan'208";a="317626649" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2022 01:38:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10562"; a="895172654" X-IronPort-AV: E=Sophos;i="5.96,249,1665471600"; d="scan'208";a="895172654" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga006.fm.intel.com with ESMTP; 16 Dec 2022 01:38:47 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1p67Ay-00Am6T-0S; Fri, 16 Dec 2022 11:38:44 +0200 Date: Fri, 16 Dec 2022 11:38:43 +0200 From: Andy Shevchenko To: Tharunkumar.Pasumarthi@microchip.com Cc: Kumaravel.Thiagarajan@microchip.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, ilpo.jarvinen@linux.intel.com, macro@orcam.me.uk, cang1@live.co.uk, colin.i.king@gmail.com, phil.edworthy@renesas.com, biju.das.jz@bp.renesas.com, geert+renesas@glider.be, lukas@wunner.de, u.kleine-koenig@pengutronix.de, wander@redhat.com, etremblay@distech-controls.com, jk@ozlabs.org, UNGLinuxDriver@microchip.com Subject: Re: [PATCH v9 tty-next 2/4] serial: 8250_pci1xxxx: Add driver for quad-uart support Message-ID: References: <20221216052656.2098100-1-kumaravel.thiagarajan@microchip.com> <20221216052656.2098100-3-kumaravel.thiagarajan@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 16, 2022 at 09:30:42AM +0000, Tharunkumar.Pasumarthi@microchip.com wrote: > > From: Andy Shevchenko > > Sent: Friday, December 16, 2022 1:56 PM ... > > > > > + pci_iounmap(pdev, priv->membase); > > > > > > > > Here is inconsistency on how you interpret pci_*() calls when > > > > pcim_enable_device() has been used. I.e. for IRQ you don't > > > > deallocate resources explicitly (yes, it's done automatically > > > > anyway), but you explicitly call pci_iounmap(). Choose a single approach > > for all of them. > > > > > > AFAIK call to pci_iounmap cannot be avoided since pci_ioremap_bar is not > > 'managed' API. > > > You suggest calling pci_free_irq_vectors (even though it is not mandatory)? > > > > Why is it not mandatory? > > Following is the reason why I felt calling pci_free_irq_vectors is not > mandatory. Correct me if my understanding is wrong. > > Following is the Callback Sequence (from 6.1 kernel) that gets executed upon > calling pci_alloc_irq_vectors: > pci_alloc_irq_vectors => > pci_alloc_irq_vectors_affinity => > __pci_enable_msi_range => > pci_setup_msi_context => > pcim_setup_msi_release => > > devm_add_action(&dev->dev, pcim_msi_release, dev); > > Inside pcim_msi_release: (called since pcim_enable_device is used) > pci_free_irq_vectors(dev); > > From this sequence, it seemed like, kernel takes care of freeing irq and > calling pci_free_irq_vectors is not required. Technically you are correct, but... read this discussion, and pay attention to what Christoph said there: https://lore.kernel.org/linux-serial/0250c46e-da6c-71f3-50ae-b7c17fd0bd2c@siemens.com/ -- With Best Regards, Andy Shevchenko