Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3626880pxm; Tue, 1 Mar 2022 02:04:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9mH0aot/gUCLx8bU8sbk25Ri9+1QQH/hKRq2u/vqtRxGOuvVIj/SutHVISd5l3OHmYYJS X-Received: by 2002:a17:906:434e:b0:6d0:ed9c:68bc with SMTP id z14-20020a170906434e00b006d0ed9c68bcmr17797888ejm.70.1646129090202; Tue, 01 Mar 2022 02:04:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646129090; cv=none; d=google.com; s=arc-20160816; b=OfixkCyPPXlwfcCP9q/2XNtutnHlohGhmnmHojvDCODJ7ips2GE1mFxGpdqzOTm1Hv x7ehoyI1b1BoiLhHzEuWZ+eorY2YeQenyF/1HNdxTv/3FKG2yIeeqxOWy74bck4ijF20 p7gD/Cck76oXoyzop/5tTXFRCy4r7MBq68pNRGwLzijaPaiy1UvpSgcFwqZD9b4RNLPN ZO3u4XEbtcwQmf9XDQnvJcM4Y29T8syis/HaWzERdfcxmwguAI2r5hUs4vM6dMvHbXuI MYVgM2LMG7R1VXo6mrkT0PM46kpAitJy+oF66CQjCxjpv7Qjsvbv+NXrd1ezEXDlSCdO S9qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wdZJvOtv+3rTFadAMPoyxH0rr5b/EDO1+/QplrVqSks=; b=q1vY6OfXYddY9hnoGwxOW9tbpDZ23/Sxr4/FYtg7HqTEbfR1CuJ75gEbLOxwRNMYMc HMqWeV1vqsc1xcEVQa46pcJBO4dKrbup/tdyqwp3o+9QptCcWef2ckU3YoSOQTDLi/WD /+vNXHWyOIePeGnzVDzkXT4aSqVKyt7f8SjP/cPk25j04TEv5lm5G4bo70jdQrM24NBt FfbINEyK4qDcovEQ6Wd8n2o2FHLYFShsGo1X5PgMhcKQI0eDsGw/qUd1LmSthjNe2Zke /dWzsBI5WU0QgUeNCgCX0OL4T5kF6x3Si0Y52LMyi/e0IZQBgQdNHD0eeYx/AhhDc+y7 zZMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rPEdBVeP; 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 gx1-20020a1709068a4100b006d08cb5cf27si7978548ejc.91.2022.03.01.02.04.25; Tue, 01 Mar 2022 02:04:50 -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=rPEdBVeP; 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 S233947AbiCAJvR (ORCPT + 99 others); Tue, 1 Mar 2022 04:51:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231785AbiCAJvP (ORCPT ); Tue, 1 Mar 2022 04:51:15 -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 3419D434BD; Tue, 1 Mar 2022 01:50:35 -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 CEB66B817D0; Tue, 1 Mar 2022 09:50:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58F51C340EE; Tue, 1 Mar 2022 09:50:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646128232; bh=lOOsSw7Tk3bXo6gVmqcvsCoSXzM9PQBSIvg1gEmMSoQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rPEdBVePmBJHXmE+N8egu9mj/nL23kiZe+v7tqCnT+vpjUQuOgSHSpPF/1dMX0+tc wT78dPr/klG9dHslrMfoZuMis72pLmhRlJWPQUafPHXwx3bWlZik4L20i5uerbJwFF N4ndm2yNIyjwlcgmNTI3QChvL1naCwiyef7bvnHyMuRsGVUZ+rS0WEWRV6N5R7jndO qRkBKvluUFRJ9e7KSI8vNymdWp1fgmrfp2ceNtJ0ZFUVqpoT/5j24jO/XV9CrmqXDM +C0B2C8TcbEldyOWYSlAXRhMK9y+Ob7VzG5v04FlQgu6Rr6x4B7NppCDVR6MsscTaV WnBc0wHZmeXlw== Received: by pali.im (Postfix) id B2C6AC77; Tue, 1 Mar 2022 10:50:29 +0100 (CET) Date: Tue, 1 Mar 2022 10:50:29 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Bjorn Helgaas Cc: Lorenzo Pieralisi , Bjorn Helgaas , Rob Herring , Andrew Lunn , Thomas Petazzoni , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Marek =?utf-8?B?QmVow7pu?= , Russell King , Gregory Clement , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/6] PCI: mvebu: Add support for sending Set_Slot_Power_Limit message Message-ID: <20220301095029.sihzfk2vextf7gpz@pali> References: <20220225125407.wglplhyisgges3zk@pali> <20220225170225.GA363593@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220225170225.GA363593@bhelgaas> User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-7.5 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,T_SCC_BODY_TEXT_LINE 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 Friday 25 February 2022 11:02:25 Bjorn Helgaas wrote: > On Fri, Feb 25, 2022 at 01:54:07PM +0100, Pali Rohár wrote: > > On Thursday 24 February 2022 15:28:11 Bjorn Helgaas wrote: > > > On Tue, Feb 22, 2022 at 05:31:57PM +0100, Pali Rohár wrote: > > > > This PCIe message is sent automatically by mvebu HW when link changes > > > > status from down to up. > > > > PCIe r6.0, sec 2.2.8.5 and 7.5.3.9, also say Set_Slot_Power_Limit must > > > be sent on a config write to Slot Capabilities. I don't really > > > understand that, since AFAICS, everything in that register is > > > read-only. But there must be some use case for forcing a message. > > > > I understood it in this way: Capabilities register is read-only hw-init > > and so firmware / driver can write initialization values into this > > register. And when firmware / driver is doing this write then Root port > > should send that Set_Slot_Power_Limit message. > > Sec 7.5.3.9 describes the behavior of Slot Capabilities in config > space, where it must be read-only. Firmware (or the mvebu driver) > must use a different mechanism to initialize the values. > > FWIW, I found this implementation note in PCIe r6.0, sec 6.9 that > explains why config writes to this read-only register would be useful: > > IMPLEMENTATION NOTE: AUTO SLOT POWER LIMIT DISABLE > > In some environments host software may wish to directly manage the > transmission of a Set_Slot_Power_Limit message by performing a > Configuration Write to the Slot Capabilities register rather than > have the transmission automatically occur when the Link transitions > from a non-DL_Up to a DL_Up status. This allows host software to > limit power supply surge current by staggering the transition of > Endpoints to a higher power state following a Link Down or when > multiple Endpoints are simultaneously hot-added due to cable or > adapter insertion. > > Bjorn Hm... I did not understand from this description what should happen when write operation is performed to the slot capabilities register. It is allowed to change content of this register? Or better question, what should write hook in pci-mvebu.c driver for slot capabilities do?