From patchwork Wed Oct 9 14:33:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Delvare X-Patchwork-Id: 3009191 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 996339F1E1 for ; Wed, 9 Oct 2013 14:33:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 85FFB2024F for ; Wed, 9 Oct 2013 14:33:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0049120233 for ; Wed, 9 Oct 2013 14:33:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754116Ab3JIOdK (ORCPT ); Wed, 9 Oct 2013 10:33:10 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52996 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753855Ab3JIOdJ (ORCPT ); Wed, 9 Oct 2013 10:33:09 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1FB7FA4EB7; Wed, 9 Oct 2013 16:33:08 +0200 (CEST) Date: Wed, 9 Oct 2013 16:33:04 +0200 From: Jean Delvare To: linux-pci@vger.kernel.org Cc: Bjorn Helgaas , Takashi Iwai Subject: [PATCH] PCI/portdrv: Set master earlier Message-ID: <20131009163304.62b439a9@endymion.delvare> Organization: Suse Linux X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.18; x86_64-suse-linux-gnu) Mime-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since kernel 3.12-rc3, I get the following warning messages at boot: pcieport 0000:00:07.0: driver skip pci_set_master, fix it! pcieport 0000:00:01.0: driver skip pci_set_master, fix it! These are: 00:01.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 1 (rev 13) 00:07.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 7 (rev 13) Calling pci_set_master() immediately after pci_enable_device() makes the warning messages go away. Signed-off-by: Jean Delvare Cc: Bjorn Helgaas --- Please note that I am far from certain that this is the correct fix. Another approach would be to disable the device if get_port_device_capability() returns no capabilities. I suppose the device would then be re-enabled later if really needed. What's the best approach? drivers/pci/pcie/portdrv_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- linux-3.12-rc4.orig/drivers/pci/pcie/portdrv_core.c 2013-09-24 00:41:09.000000000 +0200 +++ linux-3.12-rc4/drivers/pci/pcie/portdrv_core.c 2013-10-09 15:43:54.205943783 +0200 @@ -366,13 +366,13 @@ int pcie_port_device_register(struct pci status = pci_enable_device(dev); if (status) return status; + pci_set_master(dev); /* Get and check PCI Express port services */ capabilities = get_port_device_capability(dev); if (!capabilities) return 0; - pci_set_master(dev); /* * Initialize service irqs. Don't use service devices that * require interrupts if there is no way to generate them.