Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp475859pxb; Wed, 24 Feb 2021 07:08:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMou57a7gYT6oXEAIRfHSIsM35oo+171MLZzqBaD1ytKlcClHwahFVyJleadhgdwUTXwwB X-Received: by 2002:a17:906:398c:: with SMTP id h12mr32028924eje.469.1614179323066; Wed, 24 Feb 2021 07:08:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614179323; cv=none; d=google.com; s=arc-20160816; b=rzFl0EwbZY7BpUQOfi03G6xhZ++WPo8s4cdvfDhl27QYaeAztY+nHvB4L5VBDFvfEh K1wN8MVRoOLRrFlRXmo8ocKAXG9FuLreAxGaEj5f+4HTBkYh0HPOMfK7CI6/OnWdqPsN 06ilWvPH0wBAEDcO1ozSwFPFi5pJlU/apnwiQNh3o8aN5gC4E8SwlpmlMCxPm+Hz9D7h 6R3a38FbQ3lQwURhI2h4vGXlHoXR8jHLbr0phsCx9DADviJG+EGE9rHlNqt8zF//dt3F IhvzOmlrjW78fGaY0voUajVZYg5csHSjKrnQED0ZFCcP3NBMcMRMihfsKwOdHeR7w9Hl 9JOQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=rp6xFbMVcSNr3U+KePG0/i37RYbSH1lUEiS0Y/RzdOU=; b=iqGjEFI6IwKA1joF23SfC7voSX0Qp2woxJDvX76trdPYlwh7K9Bfccr1ermTywkCHt h4teTyKTHD3yImDiJOAi6Xg8Ihq8Vb7AMAFYkT5hZk9+KbCKjNeooItee1cp58byyTtt NXJKR7yqyTUj1ean4/FVvIMGcysVdp4KZcvcVxKHMNqf55yw/sPH1TKNWYBP3Z6fEIGG uXkTXrYXad5nEuS0GDfpGer1xZWYxexz0vQzeHviKV0eSoeixqpK0gRmDc1+scePx8nm 2J+K1jS+4MbfAU4AUPuFK6GVyaxKCaUTLb7nI7/b859GhpnBOMCpECGFwtjgpq7BqU1B HURg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si1334083ejt.198.2021.02.24.07.07.56; Wed, 24 Feb 2021 07:08:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238291AbhBXPFx (ORCPT + 99 others); Wed, 24 Feb 2021 10:05:53 -0500 Received: from mail-lj1-f170.google.com ([209.85.208.170]:42600 "EHLO mail-lj1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234674AbhBXOK5 (ORCPT ); Wed, 24 Feb 2021 09:10:57 -0500 Received: by mail-lj1-f170.google.com with SMTP id v17so2516675ljj.9; Wed, 24 Feb 2021 06:10:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rp6xFbMVcSNr3U+KePG0/i37RYbSH1lUEiS0Y/RzdOU=; b=gLuRYKwqytwVlTdgWXXJZGidDRnz4Fq29+G/1/flO15N0gKUMgEgdtXga3QlbUdhdx 2nbXjOtv1bGb+REQO11xyYEq00wC3qRRZeHrND2lmlKF+sfsF+ZL9+7yrXDxejvX1AkO JwTGbgeNI6JnjvwKp+L+YqUUb7BcHVmTNDukhLvtBK7QohEDbs2aDlsf4Jja4lJCfSuO bDKE/xtVflpjc9OVBfdCSP53EQEntJfmWMCQ/8MsUrY1fzaoECuaws+yahPIH0vclkM/ /WPLOSYcRKKkEtf+insaqVgK+gah4whRrIgiqgM+Idpqr3aKlqCxkTn1yb9qevR5FoYO 2kQw== X-Gm-Message-State: AOAM531PS8BCMUWAQ1LAfbAyu4fBnwLHl1Rx+28OA4H1RJvdjuVxC1Pe Jt4LUOmFsqmHRQCS45RY/iU= X-Received: by 2002:a2e:7409:: with SMTP id p9mr19032678ljc.404.1614175815511; Wed, 24 Feb 2021 06:10:15 -0800 (PST) Received: from rocinante ([95.155.85.46]) by smtp.gmail.com with ESMTPSA id n13sm509705lfu.265.2021.02.24.06.10.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 06:10:15 -0800 (PST) Date: Wed, 24 Feb 2021 15:10:13 +0100 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: Jianjun Wang Cc: Bjorn Helgaas , Rob Herring , maz@kernel.org, Lorenzo Pieralisi , Ryder Lee , Philipp Zabel , Matthias Brugger , linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sj Huang , youlin.pei@mediatek.com, chuanjia.liu@mediatek.com, qizhong.cheng@mediatek.com, sin_jieyang@mediatek.com, drinkcat@chromium.org, Rex-BC.Chen@mediatek.com, anson.chuang@mediatek.com Subject: Re: [v8,6/7] PCI: mediatek-gen3: Add system PM support Message-ID: References: <20210224061132.26526-1-jianjun.wang@mediatek.com> <20210224061132.26526-7-jianjun.wang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210224061132.26526-7-jianjun.wang@mediatek.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jianjun, > Add suspend_noirq and resume_noirq callback functions to implement > PM system suspend hooks for MediaTek Gen3 PCIe controller. So, "systems suspend" and "resume" hooks, correct? > When system suspend, trigger the PCIe link to L2 state and pull down It probably would be "the system suspends". [...] > When system resum, the PCIe link should be re-established and the > related control register values should be restored. Similarly to the above: "the system resumes". [...] > + if (err) { > + dev_err(port->dev, "can not enter L2 state\n"); > + return err; > + } Most likely you want "cannot" or "can't" in the above error message. > + /* Pull down the PERST# pin */ > + val = readl_relaxed(port->base + PCIE_RST_CTRL_REG); > + val |= PCIE_PE_RSTB; > + writel_relaxed(val, port->base + PCIE_RST_CTRL_REG); > + > + dev_dbg(port->dev, "enter L2 state success"); Just a nitpick. What about "entered L2 states successfully"? [...] > + if (err) { > + dev_err(port->dev, "resume failed\n"); > + return err; > + } This error message does not quite convey that the mtk_pcie_startup_port() was the function that failed, which is only a part of what you have to do to successfully resume. > + dev_dbg(port->dev, "resume done\n"); A nitpick. Probably not needed, as lack of error message would mean that the device resumed successfully after being suspended. Krzysztof