From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754388AbcBNXDv (ORCPT ); Sun, 14 Feb 2016 18:03:51 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44169 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754261AbcBNW7Q (ORCPT ); Sun, 14 Feb 2016 17:59:16 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Biedl , Bjorn Helgaas Subject: [PATCH 3.14 23/76] PCI: Fix minimum allocation address overwrite Date: Sun, 14 Feb 2016 14:22:50 -0800 Message-Id: <20160214222219.594092218@linuxfoundation.org> X-Mailer: git-send-email 2.7.1 In-Reply-To: <20160214222218.658495779@linuxfoundation.org> References: <20160214222218.658495779@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christoph Biedl commit 3460baa620685c20f5ee19afb6d99d26150c382c upstream. Commit 36e097a8a297 ("PCI: Split out bridge window override of minimum allocation address") claimed to do no functional changes but unfortunately did: The "min" variable is altered. At least the AVM A1 PCMCIA adapter was no longer detected, breaking ISDN operation. Use a local copy of "min" to restore the previous behaviour. [bhelgaas: avoid gcc "?:" extension for portability and readability] Fixes: 36e097a8a297 ("PCI: Split out bridge window override of minimum allocation address") Signed-off-by: Christoph Biedl Signed-off-by: Bjorn Helgaas Signed-off-by: Greg Kroah-Hartman --- drivers/pci/bus.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -147,6 +147,8 @@ static int pci_bus_alloc_from_region(str type_mask |= IORESOURCE_IO | IORESOURCE_MEM; pci_bus_for_each_resource(bus, r, i) { + resource_size_t min_used = min; + if (!r) continue; @@ -170,12 +172,12 @@ static int pci_bus_alloc_from_region(str * overrides "min". */ if (avail.start) - min = avail.start; + min_used = avail.start; max = avail.end; /* Ok, try it out.. */ - ret = allocate_resource(r, res, size, min, max, + ret = allocate_resource(r, res, size, min_used, max, align, alignf, alignf_data); if (ret == 0) return 0;