Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1093442pxb; Fri, 21 Jan 2022 09:42:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJIkJ9duSSUhnp8XoCdvPL2tyXhA+YKp3zR/9oOo3aU6Cv/Bixga5jmfxcnv5+FyXC1KrR X-Received: by 2002:a05:6a00:a90:b0:4bd:320a:d579 with SMTP id b16-20020a056a000a9000b004bd320ad579mr4700768pfl.47.1642786952805; Fri, 21 Jan 2022 09:42:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642786952; cv=none; d=google.com; s=arc-20160816; b=fRcM8QMq5MaIaSLe31viUxvAB+wPsdyTQLobaHTbP2CoQ59ZdbbFETT0O8CmJktzpm lx6F/7zq6AOXTy/LzrG8N5jJqttZIhCqxQo0g5oJvQqZAVn18QlV4xzq7kIn6b6fFz6G 3LxgaJyhalDxkxGX4Z0m04HpsA9qoE4pBxwxjcM99rdKXGEzPo5aSVxWQP67TCiEpcwN 6i43ywJ0IwV+dhBn8IKRgxqkUyaDCUo+XQoZZCWG2N46Xn991ccCTHqUoJb0f8SmOMyb i3Ecfs7Q8cisHmwtqxjrGZjxVnCiQe29V/pjUyzrFIgLdYtBYDhgEsmmz70P+DOM7P4+ rPlg== 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:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=4qGM2PfWPk6RGTVLrrFSHYqmCik/v9iLb4ZUp6ZvJnw=; b=lKDUqQ6FzpNJ2EKdyW/zBBK9ZFi7QoFCWtIbfSTH+3aExZoXkotxOdNnmV885pAPbA kcO3L+cxeeobfFx8WBt7rBVnoR83fwgr/oLbZ8Uzf4DK1+El0sLkxrJDI4s7GLPIK+rG FJPvYBM604j9yZmOJp4S/MzWtVcIy8CxQC8jcoVbkKl8w2xJ6OLnNKwxgkChAU//AgoQ h+Obx7CrKH84/QkRYJQVmYwejTJyObSsyKSV+0uHZwjSqEd2Fi5RY0Kcg4NMaO2sP0oV t2+mknxfTmUtvkL3rOw8quGFfNWv6vBRnz37xnK2YXvCCouGDUjvtxjYsWoD9Pna8MH1 HJOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NnxaFzVW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e19si1723663pgl.870.2022.01.21.09.41.58; Fri, 21 Jan 2022 09:42:32 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NnxaFzVW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345658AbiASGtk (ORCPT + 99 others); Wed, 19 Jan 2022 01:49:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345647AbiASGte (ORCPT ); Wed, 19 Jan 2022 01:49:34 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0EF8C061574; Tue, 18 Jan 2022 22:49:33 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id m1so5373100lfq.4; Tue, 18 Jan 2022 22:49:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=4qGM2PfWPk6RGTVLrrFSHYqmCik/v9iLb4ZUp6ZvJnw=; b=NnxaFzVW7dVtK/7bDW/MwUcZfru0yFMo1fnaIQZHCUiblkQmRt/V5WqnrtmbuX2w/v 5zgYuqibtmKjNA4Fh1AB+tkKs/Z/bcf6BrB0nut9GhN2JJjSAaZWqesrMAHYQR+5ZJ0Q 3kYPRJEXHSiAick74qhTVLnNxLL5SBiaDPbySbuG7YkvafPWrHeMOONUhdjmCuLBICqr tPNOf1qsnivsLVQtUMXwC5Mh9cGVlfNcm1H+y/Ed1PjExvhBxY3cAqskg/90Ckm89hVy 5l/xh2EGQgMC006XiLoIFn4Wexx+JLO0tE3h4cGgcCFWgItZuG9es2UpT2YTEQu4I7ZO 1BTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=4qGM2PfWPk6RGTVLrrFSHYqmCik/v9iLb4ZUp6ZvJnw=; b=yFEo2I69A//phjAnIjRjFHU9nM9wnipePNq8T1MKNQaPKHnlFwwBiRC0j97QKujgpz DM2+f/gW3eco0VNRTmy7Nzjsw/pB83I9uiypVAnMVW+IzpBWJ9Zg//oGXVPzAgWEv51D CrUQJE46bpZmL+2457JNuJ+28ll7jzXB2NXM/Wq208dwSerbWCREg8WAuZjZTE6XL/gi NmKi5dS8zfe814vngAmbEJeVDJSZoy4C/0uAZ6jZGsNJ/QLw9OgnzZDIh8GVhHfeQiAt ocrc7aSh7PpynRArBvJNMr6rXS1SXb+k5g6aANq11CBMgD8DKipKJw7pwojlZYCIy06D r+Bg== X-Gm-Message-State: AOAM530bwrhtIvlQl0BZYnqWBe4JidFnpCwEqIK7xkk81sBYT/tB4dMo FyaYg8Tfd3cvJI+qBYexP28= X-Received: by 2002:a05:6512:787:: with SMTP id x7mr25529594lfr.647.1642574971753; Tue, 18 Jan 2022 22:49:31 -0800 (PST) Received: from localhost ([2a05:3580:f312:6c01:1b6d:df4d:cbec:e4a2]) by smtp.gmail.com with ESMTPSA id b23sm1756726lfv.22.2022.01.18.22.49.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jan 2022 22:49:31 -0800 (PST) Date: Wed, 19 Jan 2022 09:49:30 +0300 From: Andrey Skvortsov To: Ulf Hansson Cc: Arnaud Ferraris , Linus Walleij , Avri Altman , Shawn Lin , Huijin Park , Christian =?utf-8?B?TMO2aGxl?= , Yue Hu , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mmc: core: Wait for command setting 'Power Off Notification' bit to complete Message-ID: Mail-Followup-To: Andrey Skvortsov , Ulf Hansson , Arnaud Ferraris , Linus Walleij , Avri Altman , Shawn Lin , Huijin Park , Christian =?utf-8?B?TMO2aGxl?= , Yue Hu , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220115121447.641524-1-andrej.skvortzov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Ulf On 22-01-18 19:48, Ulf Hansson wrote: > On Sat, 15 Jan 2022 at 13:15, Andrey Skvortsov > wrote: > > > > SD card is allowed to signal busy on DAT0 up to 1s after the > > CMD49. According to SD spec (version 6.0 section 5.8.1.3) first host > > waits until busy of CMD49 is released and only then polls Power > > Management Status register up to 1s until the card indicates ready to > > power off. > > > > Without waiting for busy before polling status register sometimes card > > becomes unresponsive and system fails to suspend: > > > > [ 205.907459] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. > > [ 206.421274] sunxi-mmc 1c0f000.mmc: data error, sending stop command > > [ 206.421321] sunxi-mmc 1c0f000.mmc: send stop command failed > > [ 206.421347] mmc0: error -110 reading status reg of PM func > > [ 206.421366] PM: dpm_run_callback(): mmc_bus_suspend+0x0/0x74 returns -110 > > [ 206.421402] mmcblk mmc0:aaaa: PM: failed to suspend async: error -110 > > [ 206.437064] PM: Some devices failed to suspend, or early wake event detected > > Thanks for your patch! > > I recall I was hesitating on adding another busy completion check for > this, but thought polling the status register for the power management > function should be sufficient. > > > > > Tested with Sandisk Extreme PRO A2 64GB on Allwinner A64 system. > > I will give this patch a try too, to make sure it still works on my > side. Assuming that works fine, I will queue this up for fixes and by > adding a fixes/stable tag. Thank you! More testing would be certainly great, because only one of my SD-cards supports "Power Notification". -- Best regards, Andrey Skvortsov