From patchwork Fri Jul 2 13:42:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 469550 Delivered-To: patches@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1400674jao; Fri, 2 Jul 2021 06:42:43 -0700 (PDT) X-Received: by 2002:a05:6512:3891:: with SMTP id n17mr4033477lft.333.1625233363031; Fri, 02 Jul 2021 06:42:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625233363; cv=none; d=google.com; s=arc-20160816; b=sNQeKlpnUcO/eNvkSVRxWC60asmNL+THaUPD1Kqfg6qntHnwqHmnYrO2ZdKCmt3KxD 72AoESgVoUf9jh/PRCR8b9GVfeGx/9dQdfyeyXzSmeoLEEyB78xIugcYm25ZEUdDcxzX VZHRtx11JbspEbaXaFAUV7ww9OHkPrccmPwys3eynSM3gvSDhYGH4ZLJkq65LSiEk+cM th/ORcBL6itu7EpYdsAAA2S9XYDLc3BXK0OTi73ogiaiOYvd95eksdRpy1D+H4rR9qTR vsRpg3bC+6uEu8eVH2zxkVS4n0zHAmfqCv5l/7HPyqUQDo07eCTjt8lvpuA4dIcsR8/7 LWYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=xVOZh1Cyt+07lU9O98eURJiMyRJpRRmLjbR5+r7Bs5M=; b=sBuVN2xtQi88wEts9aXrwhvSWq+lLhzBiSJTnVOZbndroMLdDbo6geJdbdsDzta9xV H8zgYEvOWwVTHfch0OALqfAbzy6yFZ7IxqzdTuYHML17YOyCgpio3HRFcKD7LBujXDAo VW7eCe//XaA9CRI69k7fbJQ+qB+NnTDrIiolMaOUCZ7PbDwoxvpJUKIpbD4fS2TG1zrD UwBMvli5llcjmJnbxf8a+oQtP1TJRRoDR/g044rQrWT8JhuPYTauUwgrfz5WwPADd9Mc Znp7lo9jmF9Cp5j8H3Kj72Gb9IXxvIJoA+ALf4uZvZsa5XaSsbdL9piBMdKxy56kamIK tbOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jAt+dM5o; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id c28sor822384lfj.127.2021.07.02.06.42.42 for (Google Transport Security); Fri, 02 Jul 2021 06:42:43 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jAt+dM5o; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xVOZh1Cyt+07lU9O98eURJiMyRJpRRmLjbR5+r7Bs5M=; b=jAt+dM5oVAYDBU0YQrQEVGxLKdNpeJf/biXJmdCuKv1sQ//oc8AEzfKyPn8mxBXGw0 D4OA5YAYdk78b30jXnMy+/bzQ8vs0SXofaIw8ljB+wy+mMNJVQ9n8hJKoHDo9puWVZEn d+hU97pzOEZRxdLxAKm1SO3DRpx4WoBzL4Uc79i9aJKcdPfn1WnRy8Ob/gHSCdSo28yX PU0xE5VObmwmxeh0OqaW93JLDdwFhhM6X3OAGQHfFiZQWKOfvXhsqAz0Sd6VLTGOLirO n+C/y3Hm/g3AJOt2c2Qc+/Noa0WC9pwU/Off9co0jphM42nzMaWkbd0fLTCdGjDbwlRL /Wdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xVOZh1Cyt+07lU9O98eURJiMyRJpRRmLjbR5+r7Bs5M=; b=J9691j7cJLcoS8SnuAhHKRQ0j09V2O+CvwiL9W8zr60gfTNCo7+ynVTmqGFDshCOAs ZzYgMYTci3H9xQ8GWwm1yeheN7pC9CFUK8m9kD+CKtPjphsb+uJuwEMn/2hzcclvACni eTmTWtutz2Nm9OcVj46WvPmP9Bz1c7FP+a+IXbwe2HXDzTBcFrn2v2r2R9P6oI1lki3Z y8V7PVAF0fZ0UhKb80ySGb7BJrByZYr9NjJNDLoZfKXMj+Jb0NImBX7p2V9yx1EJ2oEm FCiHAxyeiQN9FXt3Z7w7VItu23COLCYL5UOhmIbYiUvM3x+RB/nT6IGdb/FF3DOzHub5 nw8Q== X-Gm-Message-State: AOAM533Jk5EcMxkXvqjcP19XKhPhr62ATukpfeq23nyIVAeQ515avROg 5eU3YmVtwYJLVVNMCfKgqlD3E6UK X-Google-Smtp-Source: ABdhPJwmVwuogUgru4yT15rfARUTm9NBF9wGR2QDq8PHLusnmKd8f7EOwcoVQB5Nz9bIa9CfLwqfsw== X-Received: by 2002:ac2:46cc:: with SMTP id p12mr3859067lfo.357.1625233362575; Fri, 02 Jul 2021 06:42:42 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-155-4-129-146.NA.cust.bahnhof.se. [155.4.129.146]) by smtp.gmail.com with ESMTPSA id u5sm277486lfg.268.2021.07.02.06.42.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jul 2021 06:42:41 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Adrian Hunter , Linus Walleij , Wolfram Sang , Shawn Lin , Christian Lohle , linux-kernel@vger.kernel.org Subject: [PATCH 0/3] mmc: core: Avoid hogging the CPU while polling for busy Date: Fri, 2 Jul 2021 15:42:26 +0200 Message-Id: <20210702134229.357717-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Step by step, code that have been dealing sending CMD13 to poll the card for busy, have been moved to use the common mmc_poll_for_busy() loop. This helps to avoid hogging the CPU, for example, as it inserts a small delay in between each polling attempt. Additionally, it avoids open coding. This series takes the next and final step, by moving the mmc block device layer from its own busy polling loop, into using the common code. Please test and review! Kind regards Uffe Ulf Hansson (3): mmc: core: Avoid hogging the CPU while polling for busy in the I/O err path mmc: core: Avoid hogging the CPU while polling for busy for mmc ioctls mmc: core: Avoid hogging the CPU while polling for busy after I/O writes drivers/mmc/core/block.c | 74 +++++++++++++++++--------------------- drivers/mmc/core/mmc_ops.c | 5 ++- drivers/mmc/core/mmc_ops.h | 1 + 3 files changed, 37 insertions(+), 43 deletions(-) -- 2.25.1 Reviewed-by: Shawn Lin