From patchwork Wed Feb 26 23:42:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 3729131 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6F1D2BF13A for ; Wed, 26 Feb 2014 23:42:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9108D201FE for ; Wed, 26 Feb 2014 23:42:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0B6C201D3 for ; Wed, 26 Feb 2014 23:42:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754582AbaBZXmV (ORCPT ); Wed, 26 Feb 2014 18:42:21 -0500 Received: from mail-ie0-f169.google.com ([209.85.223.169]:58366 "EHLO mail-ie0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754558AbaBZXmS (ORCPT ); Wed, 26 Feb 2014 18:42:18 -0500 Received: by mail-ie0-f169.google.com with SMTP id at1so1404543iec.28 for ; Wed, 26 Feb 2014 15:42:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=z/MjtkxeWnSaZkyWWZRI58EKZMzQrtb5vpaRSUy5XBQ=; b=QulV9khvkiQBeVc2pCNImO5yJ5zA1vin/7ckOdTeSyudBHl52pzim9Z7dlh44W0jqG 6WTd4+oOHjYmOk5GkRjWLQZT820TJoP4RHyJH0nfnyXUAjg05xBU7R6bmK3Db1Bv8cLj ILLYJXjXXBy1/bXw2mQLZmI3cqxNtzM+QEwTopqYA6UgGKBvrUNYPq0dQR2SBrjR34c9 JPwj3SC1a0Dr1z3jH7gPgjKz6G0yh04gz6j1t5dQvQ5LFgV8UOT4uixerI7NJM3aFHau TiBzfNasPp358WSZYmM53EOdHjj9T9DwXuHgjxWN5YXWH8Q6W2qWQTodDanw6TSVCUm9 hwEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=z/MjtkxeWnSaZkyWWZRI58EKZMzQrtb5vpaRSUy5XBQ=; b=NLZATY+zQV8l625ChWyD9SAHhIeZGo8JrHHSQzD9K2Jk9pYfx5kVMO3lkEkgVf/3GE LD/k3tK3TkUpvZCjp6Yy1xiZmP+11krhh1Mo+ign7wDzRazqmXTtdeZQRV8NPW31EQ13 0vi05XwfIpEyCAcErncfQVxnfskiHOPwKQZ2PYPG3blikMR4cWjlG2inlgejfF8cQztE bPlw+SscB2X6o+EA64oCiV7SI4ABGNkkoQ+Rw/sobFvFm1yscyQa+CxbjEEvBSJn+aY9 mGL+FC/mOMbPp0xfy8OwlMR1TqhvjnExfWcXpvCQ+g/wKQguUn2jGrcXgLh1x+nWiAwu mUug== X-Gm-Message-State: ALoCoQm3kRTBxdQWyE86f7N4TZWFyfUmITooqP6MrAibh8TRondDRLQdoeWWa+CslO+raNk1incuxY8mbSMqkRiDD3xyFa8jflApRFImfU6keUTSjLsHGxUoH9tfNvIdfnj6luGLZynxOYybBQSG94qFgwdD1VTaKggOdTXy7kHdIRisvOvyLlH7cKdnndpfZi6z3uyZOULhgILhedcWhyL/fadmiYd40bazQ3BkChhVr8cQDkp60dI= X-Received: by 10.42.62.143 with SMTP id y15mr2233559ich.14.1393458137894; Wed, 26 Feb 2014 15:42:17 -0800 (PST) Received: from localhost ([172.16.49.60]) by mx.google.com with ESMTPSA id qk2sm107546igc.1.2014.02.26.15.42.17 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 26 Feb 2014 15:42:17 -0800 (PST) Subject: [PATCH 7/7] s390/PCI: Use generic pci_enable_resources() To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: Jan Glauber , Heiko Carstens , Sebastian Ott , linux-kernel@vger.kernel.org, Martin Schwidefsky , linux390@de.ibm.com Date: Wed, 26 Feb 2014 16:42:15 -0700 Message-ID: <20140226234215.18970.1743.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20140226233541.18970.83328.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <20140226233541.18970.83328.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.16 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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 The generic pci_enable_resources() does essentially the same thing as the code in the s390 version of pcibios_enable_device(). There are differences, but I don't think any of them are a problem. The generic code: - Checks everything up to PCI_NUM_RESOURCES, not PCI_BAR_COUNT (6), so we'll now check the ROM resource, IOV resources, and bridge windows. - Checks for res->flags & IORESOURCE_UNSET. The s390 code never sets IORESOURCE_UNSET, so this isn't a problem. - Checks res->parent. The s390 pcibios_add_device() calls pci_claim_resource() on all BARs (except ROM, IOV, and bridge windows) so this isn't a problem either. Signed-off-by: Bjorn Helgaas CC: Martin Schwidefsky CC: Heiko Carstens CC: Sebastian Ott CC: Jan Glauber CC: linux390@de.ibm.com --- arch/s390/pci/pci.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) -- 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/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index 66670ff262a0..7d5fcaed3361 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c @@ -695,18 +695,7 @@ int pcibios_enable_device(struct pci_dev *pdev, int mask) zpci_fmb_enable_device(zdev); zpci_map_resources(zdev); - pci_read_config_word(pdev, PCI_COMMAND, &cmd); - for (i = 0; i < PCI_BAR_COUNT; i++) { - res = &pdev->resource[i]; - - if (res->flags & IORESOURCE_IO) - return -EINVAL; - - if (res->flags & IORESOURCE_MEM) - cmd |= PCI_COMMAND_MEMORY; - } - pci_write_config_word(pdev, PCI_COMMAND, cmd); - return 0; + return pci_enable_resources(pdev, mask); } void pcibios_disable_device(struct pci_dev *pdev)