From patchwork Tue May 28 14:48:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2625241 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 60B58DFB78 for ; Tue, 28 May 2013 14:49:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934379Ab3E1OtF (ORCPT ); Tue, 28 May 2013 10:49:05 -0400 Received: from mail-pb0-f42.google.com ([209.85.160.42]:48736 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934327Ab3E1OtE (ORCPT ); Tue, 28 May 2013 10:49:04 -0400 Received: by mail-pb0-f42.google.com with SMTP id uo1so7976249pbc.1 for ; Tue, 28 May 2013 07:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=7mgrkW7MVztfwgqmPiqE0ybPMCET59tdoAPJZ2epOD0=; b=qaA4oNGc4oKwvCte7+IUflbMfMJdT1iZEsrjrpNSkqe4yVETrrMrcwfUcB5wCqRehF 8ys9PsCMNKpPXuTg1ZD1jqgIWbIV9ggp7TAXqd/AZ7A+MXxVpGJlTuw36cuI9TLxp3gD qNTOl0ah5Si7+6ld/qtWtWYbZYqlSUHSiRh01QeSobk+j6jLaIPBWi6O3MztEaj7UXAx g7yCuLWl7XCGjhdK5FPut9SxolCp/+1qiZWXiuX7dlkFJeW1j+yMPIiGMoCHFGgsHoHd i7jk4x1aqohtZcrzM8sulQ9fzRYb8zPzTChmzm7efHt4v/EaBbVlxvG37rw8TGHLuzBP vuoQ== X-Received: by 10.66.232.9 with SMTP id tk9mr10873921pac.20.1369752542719; Tue, 28 May 2013 07:49:02 -0700 (PDT) Received: from [192.168.2.79] (pppoe146.47.east.tokyo.dcn.ne.jp. [219.105.47.146]) by mx.google.com with ESMTPSA id cd2sm33152755pbd.35.2013.05.28.07.48.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 May 2013 07:49:01 -0700 (PDT) Message-ID: <51A4C3D9.7070402@gmail.com> Date: Tue, 28 May 2013 22:48:57 +0800 From: Liu Jiang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130404 Thunderbird/17.0.5 MIME-Version: 1.0 To: Yinghai Lu CC: Bjorn Helgaas , Jiang Liu , "Rafael J . Wysocki" , Greg Kroah-Hartman , Gu Zheng , Toshi Kani , Myron Stowe , Yijing Wang , "linux-pci@vger.kernel.org" , Linux Kernel Mailing List , Donald Dutile , Ram Pai Subject: Re: [PATCH v3, part1 09/10] PCI, IOV: simplify IOV implementation References: <1369489718-25869-1-git-send-email-jiang.liu@huawei.com> <1369489718-25869-10-git-send-email-jiang.liu@huawei.com> In-Reply-To: Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Tue 28 May 2013 10:00:26 AM CST, Yinghai Lu wrote: > On Sat, May 25, 2013 at 6:48 AM, Jiang Liu wrote: >> Trivial changes to IOV: .... >> @@ -136,7 +123,8 @@ failed1: >> pci_dev_put(dev); >> mutex_lock(&iov->dev->sriov->lock); >> pci_stop_and_remove_bus_device(virtfn); >> - virtfn_remove_bus(dev->bus, virtfn_bus(dev, id)); >> + virtfn_remove_bus(dev->bus, bus); >> +failed0: > > need to swap above two lines. otherwise virtual bus could not be removed. Hi Yinghai, Good catch, will merge following patch in next version. --- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 3e33499..bf0a32e 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -123,8 +123,9 @@ failed1: pci_dev_put(dev); mutex_lock(&iov->dev->sriov->lock); pci_stop_and_remove_bus_device(virtfn); - virtfn_remove_bus(dev->bus, bus); failed0: + if (bus) + virtfn_remove_bus(dev->bus, bus); mutex_unlock(&iov->dev->sriov->lock); return rc;