From patchwork Sat Jan 18 14:35:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 3508471 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 CB45A9F2E9 for ; Sat, 18 Jan 2014 14:36:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 00F2820121 for ; Sat, 18 Jan 2014 14:36:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2CDF72011B for ; Sat, 18 Jan 2014 14:36:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752766AbaAROfw (ORCPT ); Sat, 18 Jan 2014 09:35:52 -0500 Received: from mail-ie0-f175.google.com ([209.85.223.175]:58821 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752942AbaAROfY (ORCPT ); Sat, 18 Jan 2014 09:35:24 -0500 Received: by mail-ie0-f175.google.com with SMTP id ar20so1951402iec.34 for ; Sat, 18 Jan 2014 06:35:24 -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=Dul2AYfY/UUz4Y8UNaSOCOox23EjRIZSYA1xo73stf8=; b=WocmtHtnRLYXmNdUP6hGlFZcd7auZsQo7gsuZMC978RxRxmUcF8uu88R7ppcg21L65 +VY5xZHzJOH6FCkcWYICBZDfoHrnHAg1fZ5VFy4SDCdaT/MKZfhbHeir+IrdU5KpWiiH 8mHiHFJIr7ol6sf/M3Ao5UUSZBXAHRliM06kXExS8uHvE0C5HKjRpD5VCUdQBqr8GMDj k47xzDHVMt1FwIkJyCEZm6tI7tuLez5OHJEORWJXGp7hnPyYVi/MiJ6EK5Hn09asU3+e uDz1g0vjUORNEcpCUAEjrEOg5sPNi3pNBbOItIBP2Ff/ue8nRqGRx/oN4I/Y+tS1Dtjr 7lUw== 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=Dul2AYfY/UUz4Y8UNaSOCOox23EjRIZSYA1xo73stf8=; b=c0l4NlPif52z4seSkeuYgOsrBDO15+RAWNglT+AnWBfwAjyL3+Va9SRVgdJ89WCUYF C3PRYFZZ/MGG3JUBKGB9WX1sdSPW8jF/bulDexgHaYjHK8hvdE/hRKFR529Vb/OoR0BB +9fFXzTLFAAbej4Odv3vUZXTwIMLh+Ofe5zJqs8E9iLfVEkJgPzVCR6fkmDju4U+sGJr 9cEWwvWcAzOfYcVKIm9BtymycEMJ05zs6VkcCGDt80WLBlhUM91GLWRh2GcrxQfw5Afj 3FQO/SpEnoP+fD9vvWoDDtxDArbs4ue9W6dCp42Z8Wm9N+7+kpBmaBUSzlmf9/3xazgX oBDQ== X-Gm-Message-State: ALoCoQmdyxX9VENdOOJtJTvRB4+2wvI4AFPIKAUsySDZeyE9l9/wi6DaNwgEKLc3VmwB+sFKIGoda+cZgBJ6OZsKiY5Q6LZVkIfi5LcbeJruzdG+SpOksut0rxHDmzzrh/umqkGoe1NN3iOzPXTf8IGgoWKozBbt031LiiZcqa3uVvKqd1i9zrHn4U8uhXJT1A+mrzIu1W58FpQPCYLUm8x+CPSiFriAFA== X-Received: by 10.43.140.77 with SMTP id iz13mr1541097icc.47.1390055724321; Sat, 18 Jan 2014 06:35:24 -0800 (PST) Received: from localhost ([172.16.49.147]) by mx.google.com with ESMTPSA id d18sm9437681igz.0.2014.01.18.06.35.23 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 18 Jan 2014 06:35:23 -0800 (PST) Subject: [PATCH 2/2] Revert "EISA: Initialize device before its resources" To: linux-kernel@vger.kernel.org From: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Joseph Salisbury Date: Sat, 18 Jan 2014 07:35:23 -0700 Message-ID: <20140118143523.32751.41079.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20140118143308.32751.27410.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <20140118143308.32751.27410.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=-7.2 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=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 This reverts commit 26abfeed4341872364386c6a52b9acef8c81a81a. In the eisa_probe() force_probe path, if we were unable to request slot resources (e.g., [io 0x800-0x8ff]), we skipped the slot with "Cannot allocate resource for EISA slot %d" before reading the EISA signature in eisa_init_device(). Commit 26abfeed4341 moved eisa_init_device() earlier, so we tried to read the EISA signature before requesting the slot resources, and this caused hangs during boot. Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1251816 Signed-off-by: Bjorn Helgaas CC: stable@vger.kernel.org # v3.10+ a2080d0c561c: Revert "EISA: Log device resources in dmesg" --- drivers/eisa/eisa-bus.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 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/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c index 1b86fe0c2e80..612afeaec3cb 100644 --- a/drivers/eisa/eisa-bus.c +++ b/drivers/eisa/eisa-bus.c @@ -277,11 +277,13 @@ static int __init eisa_request_resources(struct eisa_root_device *root, } if (slot) { + edev->res[i].name = NULL; edev->res[i].start = SLOT_ADDRESS(root, slot) + (i * 0x400); edev->res[i].end = edev->res[i].start + 0xff; edev->res[i].flags = IORESOURCE_IO; } else { + edev->res[i].name = NULL; edev->res[i].start = SLOT_ADDRESS(root, slot) + EISA_VENDOR_ID_OFFSET; edev->res[i].end = edev->res[i].start + 3; @@ -327,19 +329,20 @@ static int __init eisa_probe(struct eisa_root_device *root) return -ENOMEM; } - if (eisa_init_device(root, edev, 0)) { + if (eisa_request_resources(root, edev, 0)) { + dev_warn(root->dev, + "EISA: Cannot allocate resource for mainboard\n"); kfree(edev); if (!root->force_probe) - return -ENODEV; + return -EBUSY; goto force_probe; } - if (eisa_request_resources(root, edev, 0)) { - dev_warn(root->dev, - "EISA: Cannot allocate resource for mainboard\n"); + if (eisa_init_device(root, edev, 0)) { + eisa_release_resources(edev); kfree(edev); if (!root->force_probe) - return -EBUSY; + return -ENODEV; goto force_probe; } @@ -362,11 +365,6 @@ static int __init eisa_probe(struct eisa_root_device *root) continue; } - if (eisa_init_device(root, edev, i)) { - kfree(edev); - continue; - } - if (eisa_request_resources(root, edev, i)) { dev_warn(root->dev, "Cannot allocate resource for EISA slot %d\n", @@ -375,6 +373,12 @@ static int __init eisa_probe(struct eisa_root_device *root) continue; } + if (eisa_init_device(root, edev, i)) { + eisa_release_resources(edev); + kfree(edev); + continue; + } + if (edev->state == (EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED)) enabled_str = " (forced enabled)"; else if (edev->state == EISA_CONFIG_FORCED)