From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94B5EC2BA83 for ; Thu, 13 Feb 2020 17:11:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6A6DC206DB for ; Thu, 13 Feb 2020 17:11:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728102AbgBMRLD (ORCPT ); Thu, 13 Feb 2020 12:11:03 -0500 Received: from mga09.intel.com ([134.134.136.24]:49263 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727690AbgBMRLC (ORCPT ); Thu, 13 Feb 2020 12:11:02 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2020 09:11:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,437,1574150400"; d="scan'208";a="227296925" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga008.jf.intel.com with ESMTP; 13 Feb 2020 09:11:00 -0800 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1j2I10-001Auk-Pw; Thu, 13 Feb 2020 19:11:02 +0200 Date: Thu, 13 Feb 2020 19:11:02 +0200 From: Andy Shevchenko To: Wolfram Sang Cc: Jarkko Nikula , linux-i2c@vger.kernel.org, Mika Westerberg , stable@vger.kernel.org Subject: Re: [PATCH] i2c: designware-pci: Fix BUG_ON during device removal Message-ID: <20200213171102.GC10400@smile.fi.intel.com> References: <20200213151503.545269-1-jarkko.nikula@linux.intel.com> <20200213161854.GA5929@ninjato> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200213161854.GA5929@ninjato> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Thu, Feb 13, 2020 at 05:18:54PM +0100, Wolfram Sang wrote: > On Thu, Feb 13, 2020 at 05:15:03PM +0200, Jarkko Nikula wrote: > > Function i2c_dw_pci_remove() -> pci_free_irq_vectors() -> > > pci_disable_msi() -> free_msi_irqs() will throw a BUG_ON() for MSI > > enabled device since the driver has not released the requested IRQ before > > calling the pci_free_irq_vectors(). > > > > Here driver requests an IRQ using devm_request_irq() but automatic > > release happens only after remove callback. Fix this by explicitly > > freeing the IRQ before calling pci_free_irq_vectors(). > > Does it make sense to keep devm for irq handling, then? Only for sake of better error handling in error path in the ->probe(). -- With Best Regards, Andy Shevchenko