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=-3.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 7FBD8C433E2 for ; Fri, 11 Sep 2020 02:35:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41B7020732 for ; Fri, 11 Sep 2020 02:35:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VPw5s7kk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725825AbgIKCf4 (ORCPT ); Thu, 10 Sep 2020 22:35:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725300AbgIKCfz (ORCPT ); Thu, 10 Sep 2020 22:35:55 -0400 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E48C7C061573; Thu, 10 Sep 2020 19:35:53 -0700 (PDT) Received: by mail-io1-xd41.google.com with SMTP id r9so9501445ioa.2; Thu, 10 Sep 2020 19:35:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GLDGTHB0Vy6RWLw3amMhOLqk1tJytCqyFKQIvhrZNns=; b=VPw5s7kkd9VXg+7GkI431vyBAGb+qG1x8R1FpoEuiUd7pM5xJnIMSMU/4O3Gp/afKH NP/Yfe2XwgyT/TouC5k0PSfho7jcayFu4gtGlNvwULftvHZ6SivjVef5Vm37B+zPAG8o lsqHVXJxWLYUOwhDBao2X8yXkXFi1eSJn+c536SvNB0+Izekk+/QUebji9qBRFSFc2cQ yc9yzIeS8yPMakpfsiH9WJ3r6fDRphSP5/elqAYTrlPq0npnTRk4E8IFRltnrzHyO/pi ++NOOTAWU68KuZXippX1HoauDT3C8opz03CbRjQ0gu3iToGXUu+HZoNiX9N74hlMpdGc Ru8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GLDGTHB0Vy6RWLw3amMhOLqk1tJytCqyFKQIvhrZNns=; b=tSdFf4iNqWzIZFbSdq5CM+rcNsfBLq3rfGY37G47MqcjUTPu14UnDKNVmvdRN+NpIv mh/sQdwkw/oV2LDZpF5hizVTXEYTjiVCI2ndaDv8JLfhKtFgbnLLIPkdD4FILwVMh3ek 1UR0e7ZPuDetY7EF+AdooLHGtZlenglY7t0LmZZjVLA9GHFrdnXIr5QTKT59MgO53IG3 hD16+lkq40tMUMpb6ftxozhAziwQT+PLMe/KbzStxVIcavy6Y2QcObdRyqNe/6yUipl8 fgkH4oljSKaPaEyBxCJcetW56vzzdpHJEr20cob2eAbG0VRwTGVBg5B9xC7X05HB7jxe GO6A== X-Gm-Message-State: AOAM533CRdkUXVOC8y0moTKW4ZOZvfK6qbbhs6pWnZWP4dydJI+HT+kn rZFs/cUx4DjtRGgbOoLbkfkzF16SpVrwpFEP52I= X-Google-Smtp-Source: ABdhPJxCArdw93rlVIk7k/3JCu4ZsL4A/XRNFH2fkgVjBjdjlQF//xYp2rj7Ce1enzL53jDVyqx6XmsOEJLEFsjrqLc= X-Received: by 2002:a5e:890c:: with SMTP id k12mr61362ioj.75.1599791753153; Thu, 10 Sep 2020 19:35:53 -0700 (PDT) MIME-Version: 1.0 References: <20200910202106.GA811000@bjorn-Precision-5520> In-Reply-To: From: "Oliver O'Halloran" Date: Fri, 11 Sep 2020 12:35:41 +1000 Message-ID: Subject: Re: [RFC PATCH] PCI/portdrv: No need to call pci_disable_device() during shutdown To: Tiezhu Yang Cc: Bjorn Helgaas , Bjorn Helgaas , linux-pci , Linux Kernel Mailing List , "Rafael J. Wysocki" , Xuefeng Li , Huacai Chen , Jiaxun Yang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 11, 2020 at 11:55 AM Tiezhu Yang wrote: > > On 09/11/2020 04:21 AM, Bjorn Helgaas wrote: > > [+cc Huacai] > > > > On Thu, Sep 10, 2020 at 02:41:39PM -0500, Bjorn Helgaas wrote: > >> On Sat, Sep 05, 2020 at 04:33:26PM +0800, Tiezhu Yang wrote: > >>> After commit 745be2e700cd ("PCIe: portdrv: call pci_disable_device > >>> during remove") and commit cc27b735ad3a ("PCI/portdrv: Turn off PCIe > >>> services during shutdown"), it also calls pci_disable_device() during > >>> shutdown, this seems unnecessary, so just remove it. > >> I would like to get rid of the portdrv completely by folding its > >> functionality into the PCI core itself, so there would be no portdrv > >> probe or remove. > >> > >> Does this solve a problem? > > Yes, sometimes it can not shutdown or reboot normally with > pci_disable_device(). Do you have any more details about what goes wrong here? Leaving devices enabled when actually shutting down probably doesn't matter. However, .shutdown() is also used when kexec()ing into a new kernel and we probably should be disabling devices before handing over to the new kernel. Is the real issue that we're closing the bridge windows before the endpoint drivers have had a chance to clean up? Oliver