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=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 57661C636C8 for ; Tue, 20 Jul 2021 13:53:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 328CE6113A for ; Tue, 20 Jul 2021 13:53:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237311AbhGTNM7 (ORCPT ); Tue, 20 Jul 2021 09:12:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:33478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238600AbhGTNHk (ORCPT ); Tue, 20 Jul 2021 09:07:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 36E7D61164; Tue, 20 Jul 2021 13:48:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626788899; bh=5p+n+PS0ikQhy+HBLFOc7WHd4BkzD4jVZiIU0FOW0/I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YjIU/fe5Gl9Qt3kNiBSpbrJakePv6KLJIPZEJVD3+EMoZHIHgw1dBkW8QPgh2rBzm ZDF7tE0VWGfNRyj1EYq41M6gS962kzZUdRIqi+/tX9PUAKBGPGiZTX5gOf1B4qPneG mdLajN+8jQzJNb3vCqdBTRAUJ8CmzeEeLJpY4ABTZS7Pb1eOZt/CevjimQN77Qs1er krkjJ8FjZ9rV9UwYrwKx8jJfVBX+a2YqA4zI0Wibx/3R+AvATXuV8VeYQTX1EYQx6o 5MEdANQ3Sj+WlNDf6EDTkALvc/pPxfc1G5UnJwz/IdoprUxHNUy2/iVzhTqeXIz01I VItQy/Nzu9L4A== Date: Tue, 20 Jul 2021 19:18:15 +0530 From: Vinod Koul To: Dave Jiang Cc: dmaengine@vger.kernel.org, dan.j.williams@intel.com Subject: Re: [PATCH] dmaengine: idxd: fix sequence for pci driver remove() and shutdown() Message-ID: References: <162629983901.395844.17964803190905549615.stgit@djiang5-desk3.ch.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <162629983901.395844.17964803190905549615.stgit@djiang5-desk3.ch.intel.com> Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org On 14-07-21, 14:57, Dave Jiang wrote: > ->shutdown() call should only be responsible for quiescing the device. > Currently it is doing PCI device tear down. This causes issue when things > like MMIO mapping is removed while idxd_unregister_devices() will trigger > removal of idxd device sub-driver and still initiates MMIO writes to the > device. Another issue is with the unregistering of idxd 'struct device', > the memory context gets freed. So the teardown calls are accessing freed > memory and can cause kernel oops. Move all the teardown bits that doesn't > belong in shutdown to ->remove() call. Move unregistering of the idxd > conf_dev 'struct device' to after doing all the teardown to free all > the memory that's no longer needed. Applied to fixes, thanks -- ~Vinod