linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sinan Kaya <okaya@codeaurora.org>
To: wim@djo.tudelft.nl
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	perex@perex.cz, linux-pci@vger.kernel.org,
	Takashi Iwai <tiwai@suse.com>,
	linux-pci-owner@vger.kernel.org
Subject: Re: kernel-4.7 bug in Intel sound and/or ACPI
Date: Thu, 23 Jun 2016 11:45:47 -0400	[thread overview]
Message-ID: <576C042B.20507@codeaurora.org> (raw)
In-Reply-To: <576BF86E.8060302@codeaurora.org>

[-- Attachment #1: Type: text/plain, Size: 1367 bytes --]

On 6/23/2016 10:55 AM, Sinan Kaya wrote:
> On 6/23/2016 10:12 AM, Wim Osterholt wrote:
>> On Wed, Jun 22, 2016 at 11:54:39PM -0400, okaya@codeaurora.org wrote:
>>> On 2016-06-21 18:13, Wim Osterholt wrote:
>>>>>
>>>>> 	pr_info("%s:%d irq = %d penalty = %d\n", __func__, __LINE__, irq,
>>>>> 		penalty);
>>>>>
>>>>
>>>> This produced some 60 lines extra....
>>>
>>> Thanks, let's go back to 4.6 and add a very similar printf to every 
>>> single place where the array is modified and also right before the 
>>> enabled message.
>>>
>>
>> I don't get this right.
>> Assuming that you're still talking about the same file, I find a few
>> instances of 'enabled', most of them in if-statements and one where it might
>> be set, so it looks. However, that's already in a printk statement.
>> I don't know about arrays and even less where these are set. Even worse, I
>> don't know what to put in a 'similar' line if you don't mean 'exactly the
>> same'.
>> So please state file and line numbers and the line to be inserted.
>>
> 
> Sure, let me get a patch for you. I was hoping to do it yesterday. 
> I ran out of time. I typed the message from my phone. 
> 

Here it is



-- 
Sinan Kaya
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

[-- Attachment #2: irq_link.patch --]
[-- Type: text/plain, Size: 3183 bytes --]

diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index ededa90..228b61f 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -487,15 +487,18 @@ int __init acpi_irq_penalty_init(void)
 			    link->irq.possible_count;
 
 			for (i = 0; i < link->irq.possible_count; i++) {
-				if (link->irq.possible[i] < ACPI_MAX_ISA_IRQ)
+				if (link->irq.possible[i] < ACPI_MAX_ISA_IRQ) {
 					acpi_irq_penalty[link->irq.
 							 possible[i]] +=
 					    penalty;
+					pr_info("%s:%d acpi_irq_penalty[%d] = 0x%x\n", __func__, __LINE__, link->irq.possible[i], acpi_irq_penalty[link->irq.possible[i]]);
+				}
 			}
 
 		} else if (link->irq.active) {
 			acpi_irq_penalty[link->irq.active] +=
 			    PIRQ_PENALTY_PCI_POSSIBLE;
+			pr_info("%s:%d acpi_irq_penalty[%d] = 0x%x\n", __func__, __LINE__, link->irq.active, acpi_irq_penalty[link->irq.active]);
 		}
 	}
 
@@ -548,8 +551,11 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
 		 */
 		for (i = (link->irq.possible_count - 1); i >= 0; i--) {
 			if (acpi_irq_penalty[irq] >
-			    acpi_irq_penalty[link->irq.possible[i]])
+			    acpi_irq_penalty[link->irq.possible[i]]) {
+				    pr_info("%s:%d acpi_irq_penalty[irq=%d](0x%x) vs. acpi_irq_penalty[%d](0x%x)\n",
+					    __func__, __LINE__, irq, acpi_irq_penalty[irq], link->irq.possible[i], acpi_irq_penalty[link->irq.possible[i]]);
 				irq = link->irq.possible[i];
+			    }
 		}
 	}
 	if (acpi_irq_penalty[irq] >= PIRQ_PENALTY_ISA_ALWAYS) {
@@ -569,6 +575,7 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
 		return -ENODEV;
 	} else {
 		acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_USING;
+		pr_info("%s:%d acpi_irq_penalty[%d] = 0x%x\n", __func__, __LINE__, link->irq.active, acpi_irq_penalty[link->irq.active]);
 		printk(KERN_WARNING PREFIX "%s [%s] enabled at IRQ %d\n",
 		       acpi_device_name(link->device),
 		       acpi_device_bid(link->device), link->irq.active);
@@ -804,6 +811,8 @@ static int __init acpi_irq_penalty_update(char *str, int used)
 		else
 			acpi_irq_penalty[irq] = PIRQ_PENALTY_PCI_AVAILABLE;
 
+		pr_info("%s:%d acpi_irq_penalty[%d] = 0x%x\n", __func__, __LINE__, irq, acpi_irq_penalty[irq]);
+
 		if (retval != 2)	/* no next number */
 			break;
 	}
@@ -824,11 +833,16 @@ void acpi_penalize_isa_irq(int irq, int active)
 			acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED;
 		else
 			acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING;
+
+		pr_info("%s:%d acpi_irq_penalty[%d] = 0x%x\n", __func__, __LINE__, irq, acpi_irq_penalty[irq]);
 	}
 }
 
 bool acpi_isa_irq_available(int irq)
 {
+	if (irq >= 0 && (irq < ARRAY_SIZE(acpi_irq_penalty)))
+		pr_info("%s:%d acpi_irq_penalty[%d] = 0x%x\n", __func__, __LINE__, irq, acpi_irq_penalty[irq]);
+
 	return irq >= 0 && (irq >= ARRAY_SIZE(acpi_irq_penalty) ||
 			    acpi_irq_penalty[irq] < PIRQ_PENALTY_ISA_ALWAYS);
 }
@@ -846,6 +860,8 @@ void acpi_penalize_sci_irq(int irq, int trigger, int polarity)
 			acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_ALWAYS;
 		else
 			acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING;
+
+		pr_info("%s:%d acpi_irq_penalty[%d] = 0x%x\n", __func__, __LINE__, irq, acpi_irq_penalty[irq]);
 	}
 }
 

  reply	other threads:[~2016-06-23 15:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160620003530.GA19571@djo.tudelft.nl>
2016-06-20  1:02 ` kernel-4.7 bug in Intel sound and/or ACPI Rafael J. Wysocki
2016-06-20 21:25   ` Bjorn Helgaas
2016-06-20 22:25     ` Sinan Kaya
2016-06-21 12:47       ` Wim Osterholt
2016-06-21 13:40         ` Sinan Kaya
2016-06-21 22:13           ` Wim Osterholt
2016-06-23  3:54             ` okaya
2016-06-23 14:12               ` Wim Osterholt
2016-06-23 14:55                 ` Sinan Kaya
2016-06-23 15:45                   ` Sinan Kaya [this message]
2016-06-23 16:21                     ` Bjorn Helgaas
2016-06-23 17:05                       ` Alex Williamson
2016-06-23 23:25                     ` Wim Osterholt
2016-06-24  6:09                       ` Sinan Kaya
2016-06-25  1:39                         ` Wim Osterholt
2016-06-25  8:51                           ` okaya
2016-06-27  6:27                             ` Wim Osterholt
2016-06-27  8:22                               ` okaya
2016-06-27 13:04                                 ` Wim Osterholt
2016-06-27 21:05                                   ` okaya
2016-06-29  8:34                                     ` Sinan Kaya
2016-06-30  2:30                                       ` Wim Osterholt
2016-06-30  9:43                                         ` okaya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=576C042B.20507@codeaurora.org \
    --to=okaya@codeaurora.org \
    --cc=helgaas@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci-owner@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=rjw@rjwysocki.net \
    --cc=tiwai@suse.com \
    --cc=wim@djo.tudelft.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).