Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp357482rwr; Wed, 19 Apr 2023 07:26:38 -0700 (PDT) X-Google-Smtp-Source: AKy350Yr1wyj5oLdfAp+YDtOe/Ay+w7VjrUrj3lsDtqyb8xg9WFXLvLARh94NkGZOCWowQfsAYtY X-Received: by 2002:a05:6a00:13a2:b0:63b:877f:ee53 with SMTP id t34-20020a056a0013a200b0063b877fee53mr4329041pfg.17.1681914398507; Wed, 19 Apr 2023 07:26:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681914398; cv=none; d=google.com; s=arc-20160816; b=yZjqXKJsR7s1T4a+/25MZDewpzF7LfkMXquugngE587M3vEbNHg+NlGhv87Bw6vbdn 0WA8+32BmlcOeQ+PQModZrGVX7i13HL/TfmZGxZkDKCuc60IjdnQE2h/RWVWQTmoTPpU jsK5Jgke/PdFP/yM0/+wjMhwooUMgFQpp1lfQj7JahvhbHMtipDQFbtN6Sh9VBsf44bH 8lpt52MIYz8PI4SIPz14rdOAN4iSSmOcr7KCS/7tfdx+ygx+rwZaiQyVacr+hKYkfISL 0l0CrrwSlU+voe3bxYmGVaKdQrPMlvuuHSD4QTRfk/xRox0innFWdpXwD1LYd1w4/afh jQ3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=+1WTh5tAbWrd9+DY82MbH//HicCuqopdYUorpC0WJeI=; b=N+w1wRVLQbpBnVnvTfYmGYTeh2m7GvIwPWvZ0M3u5l9ZT3W5twZN7Ei3aef1LzWFlR 08hZWQ6cxnT3IqFEGBowCQqhCIxyrsNbX6xgG1oWdN9EGgx73XrJP8yJXe2fe/uA0rba 0IN8UsdWlvvpSlo/OPTgwkamGM9V2GC6+OgmaEfuIjybm9wrtTHMNBVmRVpb+vrT8udr pDGX3hib/xfavrjx0oZI8KLXDTtVADuu0GrrcYnrZnlOmJvee5zogGDcGHSTqJgl4f4e 3hPMCqj1zSM7BFrharPTD4QK2K64gEoowEJ2KCAbXOxWOpBFF/y8gRz1NXeJp+3EPfnd tTvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=aL0NggV3; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j16-20020a63e750000000b00518b499da58si16643992pgk.677.2023.04.19.07.26.26; Wed, 19 Apr 2023 07:26:38 -0700 (PDT) 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=@gmail.com header.s=20221208 header.b=aL0NggV3; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232753AbjDSOYz (ORCPT + 99 others); Wed, 19 Apr 2023 10:24:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232606AbjDSOYm (ORCPT ); Wed, 19 Apr 2023 10:24:42 -0400 Received: from mail-ua1-x92e.google.com (mail-ua1-x92e.google.com [IPv6:2607:f8b0:4864:20::92e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1205976A5; Wed, 19 Apr 2023 07:24:06 -0700 (PDT) Received: by mail-ua1-x92e.google.com with SMTP id v18so11658030uak.8; Wed, 19 Apr 2023 07:24:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681914239; x=1684506239; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=+1WTh5tAbWrd9+DY82MbH//HicCuqopdYUorpC0WJeI=; b=aL0NggV3xngUc/myEWqZ8Lqe3xTihoNP1mh0oyQmYj5CTAM9w6utd8P6PKieuJ15UQ nEYBRykLlkr4OSG9xMZB9Tbi1Hs4osdnoMicliQMd5cB0tw54A3R7bgmM4mYMuTuSiT+ 8aHHChZEbWsmjXPkGqH0XV9z2atkh1YayZag87tLWMk15NeSJmPk7AJkmBE6TiJUKR+f BOzi9gNI7f293MQNHVcuJbihPbwtBYDXbRga/CEv4/YgkQzU3GskB10/dzPzTmqxwftQ czlzSUlTKpaRiGjlMVQvBP5WqJgJk5ipNUcF78Ft1cwfTwrlTEDU52h764TbuuHFAYnj Oc6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681914239; x=1684506239; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+1WTh5tAbWrd9+DY82MbH//HicCuqopdYUorpC0WJeI=; b=PVxpD7joEyjejw2T/ZT9ND5gPOFNW+6LTxDfIMK3a2Syp1AD0Dr1Y7izAPddnI71UI VfnMR1fUFQK0ND5Y7zuU1H6BV97Q5fSGYB2+eSCsDhvDJ999ovsvoMpnYxpoOgA9mpTA v75MsknEGO5CUr0at8eiJbIfnowj5uJVlvFloN5xMWlpYe9p+eLwW8fblkXkraN2y0mD 6x9AoHPp8Vno2uiwXWEgvpJT738hVhQ9oQITSz/YYg1VZ2nTbW1sFIElHAmKjRqm646w wUp5EFD63BWg6kpl3TkWgQNFnZUCi1EQlFKIC5ffmkTe4slojlXLVxpC7dbEqieh1tgM Otmg== X-Gm-Message-State: AAQBX9dSsgBSNbjQbPtafKdiyL2VIBXShx9WT0QIpBhJ9sR48qFA+rCu XgbkRSBVp+XWTpW3uy7pgt4NOHmm8fSzlfNemmE= X-Received: by 2002:a1f:4305:0:b0:43b:eed8:98a4 with SMTP id q5-20020a1f4305000000b0043beed898a4mr99817vka.7.1681914239159; Wed, 19 Apr 2023 07:23:59 -0700 (PDT) MIME-Version: 1.0 References: <20230411165919.23955-1-jim2101024@gmail.com> <20230411165919.23955-3-jim2101024@gmail.com> <20230413143935.pmbyjk2boxl3rwne@mraw.org> <20230413200646.ddgsoqgmaae343nl@mraw.org> <85a1cca1-f59b-6a0c-dee3-9d9ed5d6b6d1@gmail.com> <20230414161907.zfd2ibshfx4rz56j@mraw.org> In-Reply-To: <20230414161907.zfd2ibshfx4rz56j@mraw.org> From: Jim Quinlan Date: Wed, 19 Apr 2023 10:23:47 -0400 Message-ID: Subject: Re: [PATCH v2 2/3] PCI: brcmstb: CLKREQ# accomodations of downstream device To: Cyril Brulebois Cc: Florian Fainelli , linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Bjorn Helgaas , Lorenzo Pieralisi , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, james.quinlan@broadcom.com, Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , open list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Fri, Apr 14, 2023 at 12:19=E2=80=AFPM Cyril Brulebois = wrote: > > Florian Fainelli (2023-04-14): > > Cyril, based upon the table and logs you provided whereby you have used= the > > following: > > > > - Raspberry Pi Compute Module 4 (Rev 1.0, 8G RAM, 32G storage) > > - Raspberry Pi Compute Module 4 IO Board > > - SupaHub PCIe-to-multiple-USB adapter, reference PCE6U1C-R02, VER 006S > > > > in the before/unpatched case we have a PCIe link down and in the > > after/patched we have a PCIe link up but a kernel panic. Neither are gr= eat > > nor resulting in a fully functional PCIe device. > > Based on Jim's feedback, I'm attaching a new dmesg for the aforementioned > setup, with an unpatched kernel (dmesg-unpatched-pcie-link-up.txt). Hello Cyril, I'm still seeing things in the logs that do not make sense to me. First, the "unpatched" version logs -- including the Raspian case -- all have the following lines: [ 0.000000] Movable zone start for each node /* ... */ [ 0.000000] pcpu-alloc: s88232 r8192 d30552 u126976 alloc=3D31*4096 [ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 The above lines are also in my logs. But they are missing from your "after patch" logs -- what did you change to have these lines disappear on the patched logs? Second, you say that you used a different "CM4" from the one used in the Bugzilla report -- what do you mean by that? Are you referring to the CM4 module proper, whose only change was going from 4GB to 8GB, or the IO board being used? My testing is done with a standard RPi CM4 and standard RPi IO board. Before this patch series, the only way this standard configuration can work for most hobbyist PCI cards (i.e. floating CLKREQ# pin) is by using Raspian AND adding "brcm,enable-l1ss" to the DT node. I'm guessing that you are using the configuration that you described to me in a personal email: "[the] chip is embedded directly on the modified PCB, as opposed to plugged into the PCIe slot on the official CM4 IO Board". If true, you are testing on a configuration that (a) is unique to you and your group and (b) must be doing something with the CLKREQ# signal so that your "before" case does not panic. Is this the case? Finally, and this is a big one, is the fact that in both of the "before" and "after" cases the value written to the internal Brcm CLKREQ# register is the same. This is evident by this line in the "after" patch: "brcm-pcie fd500000.pcie: uni-dir CLKREQ# for ASPM". This mode is the only mode supported by the "before" case. Now there are some other things going on in the patch series -- reading two registers and extending the timeout value of a completion abort, but I'm having a hard time imagining how they could cause a panic. Regards, Jim PS Can you please include in your logs the output of "sudo lspci -vvv" for those cases that boot to prompt? > > I fear that initially I might have not waited enough before power off and > power on when replugging the SupaHub adapter, and I've only seen the PCIe > link down a few times (now that I'm actively paying attention to that > part). I'm indeed seeing PCIe link up consistently (100%) when using the > following method: > > for i in $(seq 1 20); do > # power on, let the system boot up and settle: > sispmctl -t 4; sleep 2m > ssh cm4 sh -c "dmesg > dmesg-$i.txt; poweroff" > # let the system power down, and power off: > sleep 30; sispmctl -t 4 > # wait before power cycling: > sleep 10 > done > > > Looking at: > > https://www.amazon.co.uk/SupaHub-Express-BandWidth-Capable-Expanding/dp= /B092ZQWG5B > > > > it would appear that it can accept an external power supply, do you hav= e one > > connected to that USB expansion card by any chance? > > With the patched kernel, I have tried several things (leaving the regular > 12V adapter plugged in all the time): > - No external power supply (that's what I've been using in all previous > attempts). > - Using a 5V PSU with 2 pins (ground and 5V) plugged on the Ext PSU > 4-pin header on the IO Board. > - Using a 5V PSU with a SATA connector plugged directly onto the SupaHub > adapter. > > I'm getting the same trace in all cases. > > > Are you able to boot the kernel before/after if you disconnect any USB > > peripheral? > > The trace is obtained without any USB peripheral (on the extension card o= r > on the onboard USB slots). Besides the SupaHub adapter on the PCIe slot, = I > only have Ethernet and HDMI plugged in (I'm getting traces via serial > console, and operating the system over SSH when it boots fine). > > As soon as I unplug the SupaHub board itself, the system boots fine. > > > Does that SupaHub board plugged to the CM4 1.0 system work fine in the > > Raspberry Pi kernel tree? > > With the Raspberry Pi OS (64-bit) > Raspberry Pi OS Lite image > (2023-02-21-raspios-bullseye-arm64-lite.img.xz), the system at least > boots fine; I haven't tried adding devices to the mix just yet, trying > to stick with that particular setup. > > A full dmesg is attached (dmesg-raspios.txt). > > > Cheers, > -- > Cyril Brulebois (kibi@debian.org) > D-I release manager -- Release team member -- Freelance Consultant