From patchwork Fri Jun 24 06:09:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9196717 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CA84460871 for ; Fri, 24 Jun 2016 06:09:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B516F28495 for ; Fri, 24 Jun 2016 06:09:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6C4728498; Fri, 24 Jun 2016 06:09:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A08EE28495 for ; Fri, 24 Jun 2016 06:09:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751010AbcFXGJV (ORCPT ); Fri, 24 Jun 2016 02:09:21 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:34762 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750927AbcFXGJU (ORCPT ); Fri, 24 Jun 2016 02:09:20 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 9C6F9613A5; Fri, 24 Jun 2016 06:09:19 +0000 (UTC) Received: from [10.38.241.57] (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2809661384; Fri, 24 Jun 2016 06:09:17 +0000 (UTC) Subject: Re: kernel-4.7 bug in Intel sound and/or ACPI To: wim@djo.tudelft.nl References: <2999417.fp4mqtxYS2@vostro.rjw.lan> <20160620212507.GA24086@localhost> <57686D67.8010201@codeaurora.org> <20160621124715.GB3528@djo.tudelft.nl> <576943BA.1000001@codeaurora.org> <20160621221347.GA28603@djo.tudelft.nl> <72eb7b76d449f906d9b2b1bb15d995bf@codeaurora.org> <20160623141234.GA14662@djo.tudelft.nl> <576BF86E.8060302@codeaurora.org> <576C042B.20507@codeaurora.org> <20160623232533.GA14984@djo.tudelft.nl> Cc: Bjorn Helgaas , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, perex@perex.cz, linux-pci@vger.kernel.org, Takashi Iwai , linux-pci-owner@vger.kernel.org, Alex Williamson From: Sinan Kaya Message-ID: Date: Fri, 24 Jun 2016 02:09:15 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160623232533.GA14984@djo.tudelft.nl> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 6/23/2016 7:25 PM, Wim Osterholt wrote: > On Thu, Jun 23, 2016 at 11:45:47AM -0400, Sinan Kaya wrote: >>> >>> Sure, let me get a patch for you. >> >> Here it is > > http://webserver.djo.tudelft.nl/dmesg460+printpatch2 > Thanks, this was very helpful. I was able to fix the problem by using the values in your log. Can you give it a try? > >> I am trying to find a system with similar characteristics for debug > > All from the same laptop, Dell Inspiron 4100. > The same problem arises at a Dell Inspiron 510m. > I've not seen it on a workstation Dell XW4300. > > > > Groeten, Wim. > > > ----- wim@djo.tudelft.nl ----- > > -- > 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 > Tested-by: Wim Osterholt. diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index b2a4e2a..3cd6983 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c @@ -396,6 +396,7 @@ int __init pci_acpi_init(void) return -ENODEV; printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n"); + acpi_irq_penalty_init(); pcibios_enable_irq = acpi_pci_irq_enable; pcibios_disable_irq = acpi_pci_irq_disable; x86_init.pci.init_irq = x86_init_noop; diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index f2b69e3..714ba4d 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -517,6 +517,42 @@ static int acpi_irq_get_penalty(int irq) return penalty; } +int __init acpi_irq_penalty_init(void) +{ + struct acpi_pci_link *link; + int i; + + /* + * Update penalties to facilitate IRQ balancing. + */ + list_for_each_entry(link, &acpi_link_list, list) { + + /* + * reflect the possible and active irqs in the penalty table -- + * useful for breaking ties. + */ + if (link->irq.possible_count) { + int penalty = + PIRQ_PENALTY_PCI_POSSIBLE / + link->irq.possible_count; + + for (i = 0; i < link->irq.possible_count; i++) { + if (link->irq.possible[i] < ACPI_MAX_ISA_IRQS) + acpi_isa_irq_penalty[link->irq. + possible[i]] += + penalty; + } + + } else if (link->irq.active && + (link->irq.active < ACPI_MAX_ISA_IRQS)) { + acpi_isa_irq_penalty[link->irq.active] += + PIRQ_PENALTY_PCI_POSSIBLE; + } + } + + return 0; +} + static int acpi_irq_balance = -1; /* 0: static, 1: balance */ static int acpi_pci_link_allocate(struct acpi_pci_link *link) diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 797ae2e..29c6912 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -78,6 +78,7 @@ /* ACPI PCI Interrupt Link (pci_link.c) */ +int acpi_irq_penalty_init(void); int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering, int *polarity, char **name); int acpi_pci_link_free_irq(acpi_handle handle);