Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5071130rwd; Tue, 30 May 2023 14:16:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ430yQCewd2vcRW0aI6Zd+V2778NS0kiOHTt8ZpnVx4rhgOhqFGiuIAICD/MgHKzxQqEZsS X-Received: by 2002:a05:6a00:1146:b0:63b:8778:99e4 with SMTP id b6-20020a056a00114600b0063b877899e4mr3898379pfm.2.1685481393355; Tue, 30 May 2023 14:16:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685481393; cv=none; d=google.com; s=arc-20160816; b=TPla+1fY8Hexwvwz7e6gC21bLt0L5EdcwkAlHu2RiKRbLhsN5g4Zo4q/RRQt8TCNgc PyoQPlqO1HIkeb4fIe+6M87+xr5JBz6ABcqak14fudn779Kvox31bnarS4Osk7RnVsZB fdkzwVa5NSdZ5ZAy/Yv8Mj0EQZNJF9+UUnAraUyJPPawqX5Y9QL2CDDxqEdCd4sYqQlf QADzpG7ZkWt5pLgh7p71GbDYdQsZxk+pkjqLMlRjvFC3Ij9lAx+YEqtpW8d3otgFqMUq BgtnXK3G4CmHIRTCO/3jRBsDVWj/MeJZSkADlRVljdlIHamSjlZZhK68TDLH2bsykxnM pbwg== 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:references:message-id:subject:cc :to:date:from:dkim-signature; bh=g/W4+fMbLyvPTIx2245PdFuagwhAk+C64FSemMkW2UM=; b=ktfeavn/dZGioBd45WnIRaxlBp1E9d92AlBlWPl30+pp9fG5VAUWXibIcRPOPK9iTV pOfuYImacjCHryFrnBQAwoig93o8rlgwHX1XlkPKlBBdbHLVapyO3ddn+JTM4towmngh lonl0QeTiZSzqvHemQlt5ilBnjbL4vA+z3s8R4ZVGR8S+e9p9rWTsVGXvcWtGE9eMEI/ 3j84QiulfbrY0xTHVi58TvWOAwc2RQYSZqZSrxx7NeZd4l+EQQcN8CarY6nNCagPaKpy Szms8SWFYyRliZmWaKjBDh0SNyjBLh/qiqJj32R9filjv3R55wU6ZSWsZ2SdFRbgIw76 BgVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GWTEm3W1; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t4-20020a63b244000000b0053fa2f589aesi2597002pgo.884.2023.05.30.14.16.21; Tue, 30 May 2023 14:16:33 -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=@chromium.org header.s=google header.b=GWTEm3W1; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229945AbjE3VGY (ORCPT + 99 others); Tue, 30 May 2023 17:06:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230154AbjE3VGX (ORCPT ); Tue, 30 May 2023 17:06:23 -0400 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8892BC9 for ; Tue, 30 May 2023 14:06:20 -0700 (PDT) Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-33b7d2526d9so3410675ab.1 for ; Tue, 30 May 2023 14:06:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1685480780; x=1688072780; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:from:to :cc:subject:date:message-id:reply-to; bh=g/W4+fMbLyvPTIx2245PdFuagwhAk+C64FSemMkW2UM=; b=GWTEm3W1HqO2zGOjVcoEgEy8JTHYtvWUdHsreZW0kzb5sX2O/2mKJoPeFA/q0ynbvH SqdFJVTAlD6PuHRf5Vh/J4AFD4vDpdGBWp9LRLFmaSAf80rNKNo91WEGzfrEB2nnGLgN QO06IclO39iDE+D9XO3ZPyF2thLdc+Q4+0W18= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685480780; x=1688072780; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=g/W4+fMbLyvPTIx2245PdFuagwhAk+C64FSemMkW2UM=; b=lYT4S859mP4qjTb80Hw5KlN0oKbQhwEaiIW2Ein7lNqTiCQV5VPTvsfS7lTR6w+y2O rb42ux1NIC3qUPToZtzZ9+e+wvhoO0QkVQ4ijrgGpvUzKp0s61TowoXMw+9ZIdUD9PJR Hj1e8bEqvbRJbzdvgbvKnxzQt5TmHNr9ZiG9PqrjyQHvSknqvHrl17Z2QQD1SV30HLl6 m86Buu8tnrbjorA1zXDNrtRe8ecqHUumb3WAReKAWmshFp0w0IA5FL+8mX2xBWzl4ciu NIsbepINRtwNy4TcaaCr2mI7tBy2sbBPCBVrAnEEzwA24ZtZ2dOXIjt2iqgHk7/hYiUN WNGg== X-Gm-Message-State: AC+VfDzMltaJqCMJSiLlAWs+r023WMf615r3kKsGaHbCtQa+QseO2vc3 6EMZfiXxh8/vzZqHA1q2rSt/2A== X-Received: by 2002:a92:4b08:0:b0:335:fc8:9b4 with SMTP id m8-20020a924b08000000b003350fc809b4mr485691ilg.19.1685480779840; Tue, 30 May 2023 14:06:19 -0700 (PDT) Received: from localhost (30.23.70.34.bc.googleusercontent.com. [34.70.23.30]) by smtp.gmail.com with UTF8SMTPSA id dj10-20020a0566384b8a00b00411af6e8091sm1006419jab.66.2023.05.30.14.06.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 May 2023 14:06:19 -0700 (PDT) From: Matthias Kaehlcke X-Google-Original-From: Matthias Kaehlcke Date: Tue, 30 May 2023 21:06:19 +0000 To: =?utf-8?B?5qWK5a6X57+w?= Cc: Bjorn Helgaas , LKML , Bob Moragues , Abner Yen , Doug Anderson , Stephen Boyd , Harvey , Gavin Lee , Bjorn Helgaas , linux-pci@vger.kernel.org Subject: Re: [PATCH v1] drivers: pci: quirks: Add suspend fixup for SSD on sc7280 Message-ID: References: <20230525163448.v1.1.Id388e4e2aa48fc56f9cd2d413aabd461ff81d615@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Mon, May 29, 2023 at 02:24:53PM +0800, 楊宗翰 wrote: > Hi Bjorn, > > Thanks for your kind directions. > >   - Subject line in style of the file (use "git log --oneline >     drivers/pci/quirks.c"). > Done, and I resend in topic "[PATCH v1] PCI: Add suspend fixup for SSD >  on sc7280", please review it. > >   - Format commit log correctly (fill 75 columns, no leading spaces). > Done. > >   - Description of incorrect behavior.  What does the user see?  If >     there's a bug report, include a link to it. > This issue seems to be discovered in ChromeOS only. SSD will randomly  > crashed at 100~250+ suspend/resume cycle. Phison and Qualcomm  > found that its due to NVMe entering D3cold instead of L1ss. It should be noted that D3cold (or whatever condition that causes the issue) is not always entered, but only in the failure case (at least that was the case for the Kioxia NVMe, which has a similar issue). >   - Multi-line code comments in style of the file (look at existing >     comments in the file). > Done. > >   - Details of "the correct ASPM state".  ASPM may be enabled or >     disabled by the user, so you can't assume any particular ASPM >     configuration. > According to Qualcomm. This issue has been found last year and they have > attempt to submit some patches to fix the pci suspend behavior.  > (ref:https://patchwork.kernel.org/project/linux-arm-msm/list/? > series=665060&state=%2A&archive=both).  > But somehow these patches were rejected because of its complexity. And  > we've got advise from Google that it will be more efficient that we implement  > a quirks to fix this issue. IIRC the primary goal of this series was to be able to turn off the PCI clocks during suspend, to allow the SoC to enter a lower power state. This fixing element for NVMe with the issue described above is the the retry loop of "PCI: qcom: Add retry logic for link to be stable in L1ss" [1]. It is currently unclear why *some* NVMe *sometimes* need a longer time to enter the L1 sub-state. That's something Qualcomm and the vendors of impacted NVMes should figure out. [1] https://patchwork.kernel.org/project/linux-arm-msm/patch/1659526134-22978-4-git-send-email-quic_krichai@quicinc.com/ >   - Details on the Qualcomm sc7280 connection.  This quirk would >     affect Phison SSDs on *all* platforms, not just sc7280.  I don't >     want to slow down suspend on all platforms just for a sc7280 >     issue. As of now the issue has only been observed on QC SC7280, I don't know if ECS has tried this part on other platforms. The issue could be QC/SC7280-specific or not. > The DECLARE_PCI_FIXUP_SUSPEND function has already specify the PCI device  > ID. And this SSD will only be used at our Chromebook device only. It could be used in devices that are produced by other manufacturers. A dedicated Kconfig option for the Phison NVMe could be an option. Or a QC specific #ifdef (ugh ...) with a comment explaining that the issue has been only observed on QC SC7280 *so far*.