Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1330755rwb; Thu, 8 Dec 2022 09:16:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf7TsrZJBuW/N2ZKH7qDTgwULQpWZdeA/QVU6pyFy0r/1JJPXrpe4n7pXOtpbIBVWd5VULl9 X-Received: by 2002:a05:6402:1f0a:b0:459:b29:d896 with SMTP id b10-20020a0564021f0a00b004590b29d896mr82000755edb.9.1670519762865; Thu, 08 Dec 2022 09:16:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670519762; cv=none; d=google.com; s=arc-20160816; b=lt6yVFDlckoGJQENUjhC+IK52sCLU2AnSZMm0CxUbEWXXpzHlR171DjlethvfbKFyD yS8AQvxMKA3DoaxDbsK3fu9awNgIod6Gzobr5reQP/aTinMA8VS/Av7eBvSFzoGEkZXZ siEoj6Ep8MHu1jryfAoSdfCeakBP4fTIzXTBa4r8Pw9pwnt/sPFfp4Bw9VuGVaRvB2IR pJMOLO0wDxaj2QCLeMvMtgpwTkjWw2WVu/DOyGwcIYJEZ5iivKUWgqwzJ972YIp+C52U 6b8Z+EzEC5QypgHTjIjuZGFTVy9CsecyM0IC9T1AJqnA+dpPH8sZnBhcfjByeKfkEJLc Mf0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=4KI9BsR+uGxtHdKXlxgYjG5dVBiYEdB/kgc/+CV4RP4=; b=as78gn9DZzhsjHSaa9DY6/xsojBjhe5HdE7mARyX80Cc2R2dxmIyRGTAcd0WAmlrT4 jQbF0i0mz0vN/p9iJi67Dy6Bg0Keo3IyN8bz2nSeDg1Egb6if586YOFqeyiASkQ38gJR b6vz8y26kPHDUnsGOrukSWjFrvshxinWPgeuvKR74382+Q6CSIU95J4bfwLFHF0x3url kR5zR7I73qKt9wWTmQuP1t05BzPyijNAx853NN7pGIHWYpE9MyTLAL9F3LV4QK/jCv8z KS/ry3QnbrUnJE5R74kplmO6g1TCGZPa3E1z4e1qqVd0MULPv01Jfwk06BN3mvNHpVP9 80kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="o/rzSXE0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg7-20020a170907970700b00781132a4ca6si19507678ejc.850.2022.12.08.09.15.45; Thu, 08 Dec 2022 09:16:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="o/rzSXE0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230294AbiLHQza (ORCPT + 72 others); Thu, 8 Dec 2022 11:55:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230265AbiLHQz2 (ORCPT ); Thu, 8 Dec 2022 11:55:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9922176802; Thu, 8 Dec 2022 08:55:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4FA8EB82437; Thu, 8 Dec 2022 16:55:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDC0EC433D2; Thu, 8 Dec 2022 16:55:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670518525; bh=yBtV+NuqkDFfk82CWvSm04mo6CBnIuWYTKuRN6NUuaQ=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=o/rzSXE0uWwq5cISLxM3T9+MQufbYq8D8mHX2TwewdzsHqlyPpVbKv2s7R5qPxL+T 3JBkpwICDexZ8ecasB+yQhsQbu5LmAXBQCmlwYupgrMMbBzNUp9SK2+mKoyNIG79Zd JBzaaMZjV/R5oi0t1dYbiZYA+nY8JOqWNmWaFuTpbgTmhzgoRJ6ROJidZsYBgV40kE WIupQV0qjBXVh+bm8+C2Cqmoabsn+g38voN9w5J+45vTOW/7rSFeGO5j98xl75H0Po XXpzAh2ghuGRKbukp7Dd6JE9EPy4wuVH9RsNgo4LK+Jy6iJ6iuiC4+uZpGKdmlCW33 Lm848OAjIoyAw== Date: Thu, 8 Dec 2022 10:55:23 -0600 From: Bjorn Helgaas To: Stephen Kitt Cc: linux-kernel@vger.kernel.org, Bjorn Helgaas , linux-pci@vger.kernel.org, Jan Rueth Subject: Re: [PATCH] PCI/ASPM: Call pcie_aspm_sanity_check() as late as possible Message-ID: <20221208165523.GA1548682@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221208090017.132db7bd@heffalump.sk2.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 08, 2022 at 09:00:17AM +0100, Stephen Kitt wrote: > Hi Bjorn, > > On Wed, 7 Dec 2022 15:56:08 -0600, Bjorn Helgaas wrote: > > On Thu, Oct 06, 2022 at 01:59:50PM +0200, Stephen Kitt wrote: > > > In pcie_aspm_init_link_state(), a number of checks are made to > > > determine whether the function should proceed, before the result of > > > the call to pcie_aspm_sanity_check() is actually used. The latter > > > function doesn't change any state, it only reports a result, so > > > calling it later doesn't make any difference to the state of the > > > devices or the information we have about them. But having the call > > > early reportedly can cause null-pointer dereferences; see > > > https://unix.stackexchange.com/q/322337 for one example with > > > pcie_aspm=off (this was reported in 2016, but the relevant code hasn't > > > changed since then). > > > > Thanks, Stephen! > > > > That stackexchange report doesn't have much information, but it looks > > similar to this old report from Jan Rueth, which I'm sorry to say I > > never got resolved: > > > > https://bugzilla.kernel.org/show_bug.cgi?id=187731 > > https://lore.kernel.org/all/4cec62c2-218a-672b-8c12-d44e8df56aae@comsys.rwth-aachen.de/#t > > > > And Jan's patch is almost identical to yours :) > > > > I hope to get this resolved, but I don't have time to work on it > > before the upcoming merge window, which will probably open Sunday. > > And then it's holiday time, so it may be January before I get back to > > it. I'm just dropping the links here as breadcrumbs for picking this > > back up. > > Thanks for the update! I was somewhat bemused by the dereference here, I’m > reassured to see I’m not the only one. Unfortunately I don’t have hardware > which exhibits this problem, Yeah, that's a weird thing about this. This shouldn't be a platform-specific thing, but both stackexchange and Jan's patch mention IBM x3850. Maybe both came from a single source, or maybe there's something deeper going on. > I submitted the patch because it seemed > reasonably sensible even though as you say there is probably something else > going on here. Of course if this approach is useful, Jan’s patch should go in > rather than mine. > > Anyway, it’s been six years, so a few more weeks won’t make any difference > ;-). > > Enjoy the holiday season! > > Regards, > > Stephen