From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CD5D43173 for ; Sat, 12 Oct 2024 18:39:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728758343; cv=none; b=bggOfhDWSewFM+2yIYhtb15Nbq4tXdK57EJR2H3CcPs113XKaHpBzGeWaAI1ibnf3BVVb5HgLYMkwVBRFC8XlvVZG/BWl4XRAUI9rD7WJwV/rTbCzn6QjkV5kNJsB7lrQmmsA17YvMN5oXpcmQ6E5EiKKk0m1LkqpBFyuiVofhw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728758343; c=relaxed/simple; bh=PQjdQUW1m0VGtx+RjDDjD5UPzXvmqOokhZTruCnEUS8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=rQTeBcjjqy0/aQcfh3E1+JTU5hLrE6rg8UZ7efKgQTqIBtamXGgLHM6m68G+zuoABSe49tbSJLgywSpzPQrkTBtPL5cMI5TqaytguvFcaJxMgmbNmQviEdnsI3Jkfpg6+H8W21HmEHd0AOEtJWg9F0TbXH6KEY9VE1PmIUHzWks= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=MFbDg4rL; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MFbDg4rL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728758339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5yZK/yvBCLzERH6zINZdBHu/5E+6P2BqC7o8qaheiHY=; b=MFbDg4rL/AfOf2uTjo4ilVNfPmox5wIek/WR1s3wfGPkrSvPFzRH4NVZobt8A5yQAVjYDp /JI8tpS0PZYj+QFUcsWG/Mo2ibCrxsjlwm+GL0yy2a4eHpVMTeSaGdXbay4n2zLLDAWPtm NmfkI7Mf9zEbvAm4cOC9Y3Lm9amTrMg= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-270-qvZCaHa6M_KZmuKeAZNzng-1; Sat, 12 Oct 2024 14:38:58 -0400 X-MC-Unique: qvZCaHa6M_KZmuKeAZNzng-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a99345b8a29so207363666b.3 for ; Sat, 12 Oct 2024 11:38:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728758337; x=1729363137; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5yZK/yvBCLzERH6zINZdBHu/5E+6P2BqC7o8qaheiHY=; b=kCnQX21gMFvQGECNtV36r3s+7VQyGiqVKjn1044Q+tNWOgYOE8h4VhC9rcCZ4w+r1q enuzN9iC0CPrYEo8XTYc0+XLcPodwFHD1M/Zwxl9k4qVPMwtKKH6gJLmrsSIF19VVDMQ cpR1gnXMolYrWLUz6+o/Ip1cueR55mXlF3dOL3XQBNFlEDTziRdH7Ug6ZBbxFkVHG481 lkAzYwZZoE8bjfGIrTLuYCxeiyk9HSQnqb93MlLuIO7ux6psxHhqKLTIBrp1Ga5NTu6G 6mINzodu227D37ZFZoh1O2gvEU9/kt6ZmXKRN8KHIFSf2TQ8hUWKqKaAMbbYV4bHXIjj CDXQ== X-Gm-Message-State: AOJu0Yy3UUyQ3Erq87SxkCSmvXmYpJ2rW8N7S2zV+PNNjbxrJmGwo8EB M0DJevcyvjSISmjJWOopNpgLu5Pdci5+wfC8zvrqSvcLSiUm/orCXwmSBRRlN/e+LLMYF06YJJ9 IZ0JqynbHdHCDaXbJbFegmJecfBFmMvwv69Afr5TcOZ3PDYBqGZHUh55ViHDBIg== X-Received: by 2002:a17:907:1c15:b0:a99:f1eb:8deb with SMTP id a640c23a62f3a-a99f1eb8e5cmr198993066b.62.1728758337030; Sat, 12 Oct 2024 11:38:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqB5CLNW+SMyZyTg1PZ4OhDpXJCXiKSrqcy8TbFNdFya1pznauy04x0FXfWpM1RduvY21JtA== X-Received: by 2002:a17:907:1c15:b0:a99:f1eb:8deb with SMTP id a640c23a62f3a-a99f1eb8e5cmr198991766b.62.1728758336575; Sat, 12 Oct 2024 11:38:56 -0700 (PDT) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99a7f5cebdsm352248366b.93.2024.10.12.11.38.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 12 Oct 2024 11:38:55 -0700 (PDT) Message-ID: <1cc25b5f-edd9-4520-b89b-9b7f833fbb4c@redhat.com> Date: Sat, 12 Oct 2024 20:38:55 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Regression in PMC code in 6.12-rc1 To: =?UTF-8?Q?Marek_Ma=C5=9Blanka?= Cc: linux-kernel@vger.kernel.org, daniel.lezcano@linaro.org, Luca Coelho References: <40555604c3f4be43bf72e72d5409eaece4be9320.camel@coelho.fi> <331d3a2e-d66a-4118-a6b8-cb0cfbb9b3cf@redhat.com> Content-Language: en-US, nl From: Hans de Goede In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi Marek, On 12-Oct-24 8:30 PM, Marek Maślanka wrote: > Hi Hans, > > On Thu, Oct 10, 2024 at 4:12 PM Hans de Goede wrote: >> >> Hi Marek, >> >> On 10-Oct-24 4:09 PM, Marek Maślanka wrote: >>> Hi Franz, >> >> Franz? I guess you are trying to address me (Hans) ? > > Yes! Forgive me for this mistake! No problem / no worries. >>> I need to redesign this patch. The pmcdev->lock in the >>> pmc_core_acpi_pm_timer_suspend_resume might already be held by the >>> pmc_core_mphy_pg_show or pmc_core_pll_show if the userspace gets >>> frozen when these functions are being executed, this will cause a hang. >>> >>> Can you instruct me how to revert this patch? Or you can just do it? >> >> Please submit a revert based on top of: >> >> https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=fixes >> >> with a commit message explaining why this needs to be reverted for now >> and then I will merge the revert into the fixes branch and include >> it in the next fixes pull-request to Torvalds. > > Done. Thank you. I'll apply this and send it on its way to Linus some time next week. Regards, Hans >>> On Mon, Oct 7, 2024 at 12:57 PM Marek Maślanka > wrote: >>> >>> Hi Luca, >>> >>> Thanks for the report. >>> >>> Seems that the tick_freeze function in the kernel/time/tick-common.c >>> is helding the spinlock so the pmc_core_acpi_pm_timer_suspend_resume >>> shouldn't try to take the mutex lock. I'll look for the solution. >>> >>> Marek >>> >>> >>> On Mon, Oct 7, 2024 at 11:17 AM Luca Coelho > wrote: >>> > >>> > Hi Marek et al, >>> > >>> > We have been facing some errors when running some of our Display CI >>> > tests that seem to have been introduced by the following commit: >>> > >>> > e86c8186d03a ("platform/x86:intel/pmc: Enable the ACPI PM Timer to be turned off when suspended") >>> > >>> > The errors we are getting look like this: >>> > >>> > <4> [222.857770] ============================= >>> > <4> [222.857771] [ BUG: Invalid wait context ] >>> > <4> [222.857772] 6.12.0-rc1-xe #1 Not tainted >>> > <4> [222.857773] ----------------------------- >>> > <4> [222.857774] swapper/4/0 is trying to lock: >>> > <4> [222.857775] ffff8881174c88c8 (&pmcdev->lock){+.+.}-{3:3}, at: pmc_core_acpi_pm_timer_suspend_resume+0x50/0xe0 [intel_pmc_core] >>> > <4> [222.857782] other info that might help us debug this: >>> > <4> [222.857783] context-{4:4} >>> > <4> [222.857784] 1 lock held by swapper/4/0: >>> > <4> [222.857785] #0: ffffffff83452258 (tick_freeze_lock){....}-{2:2}, at: tick_freeze+0x16/0x110 >>> > <4> [222.857791] stack backtrace: >>> > <4> [222.857793] CPU: 4 UID: 0 PID: 0 Comm: swapper/4 Not tainted 6.12.0-rc1-xe #1 >>> > <4> [222.857794] Hardware name: Intel Corporation Alder Lake Client Platform/AlderLake-P DDR5 RVP, BIOS RPLPFWI1.R00.4035.A00.2301200723 01/20/2023 >>> > <4> [222.857796] Call Trace: >>> > <4> [222.857797] >>> > <4> [222.857798] dump_stack_lvl+0x80/0xc0 >>> > <4> [222.857802] dump_stack+0x10/0x20 >>> > <4> [222.857805] __lock_acquire+0x943/0x2800 >>> > <4> [222.857808] ? stack_trace_save+0x4b/0x70 >>> > <4> [222.857812] lock_acquire+0xc5/0x2f0 >>> > <4> [222.857814] ? pmc_core_acpi_pm_timer_suspend_resume+0x50/0xe0 [intel_pmc_core] >>> > <4> [222.857817] __mutex_lock+0xbe/0xc70 >>> > <4> [222.857819] ? pmc_core_acpi_pm_timer_suspend_resume+0x50/0xe0 [intel_pmc_core] >>> > <4> [222.857822] ? pmc_core_acpi_pm_timer_suspend_resume+0x50/0xe0 [intel_pmc_core] >>> > <4> [222.857825] mutex_lock_nested+0x1b/0x30 >>> > <4> [222.857827] ? mutex_lock_nested+0x1b/0x30 >>> > <4> [222.857828] pmc_core_acpi_pm_timer_suspend_resume+0x50/0xe0 [intel_pmc_core] >>> > <4> [222.857831] acpi_pm_suspend+0x23/0x40 >>> > <4> [222.857834] clocksource_suspend+0x2b/0x50 >>> > <4> [222.857836] timekeeping_suspend+0x22a/0x360 >>> > <4> [222.857839] tick_freeze+0x89/0x110 >>> > <4> [222.857840] enter_s2idle_proper+0x34/0x1d0 >>> > <4> [222.857843] cpuidle_enter_s2idle+0xaa/0x120 >>> > <4> [222.857845] ? tsc_verify_tsc_adjust+0x42/0x100 >>> > <4> [222.857849] do_idle+0x221/0x250 >>> > <4> [222.857852] cpu_startup_entry+0x29/0x30 >>> > <4> [222.857854] start_secondary+0x12e/0x160 >>> > <4> [222.857856] common_startup_64+0x13e/0x141 >>> > <4> [222.857859] >>> > >>> > And the full logs can be found, for example, here: >>> > >>> > https://intel-gfx-ci.01.org/tree/intel-xe/xe-2016-92d12099cc768f36cf676ee1b014442a5c5ba965/shard-adlp-3/igt@kms_flip@flip-vs-suspend-interruptible.html >>> > >>> > >>> > Reverting this commit seems to prevent the problem. Do you have any >>> > idea what could be causing this and, more importantly, how to fix it? >>> > :) >>> > >>> > Thanks! >>> > >>> > -- >>> > Cheers, >>> > Luca. >>> >> >