Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp246938pxf; Thu, 11 Mar 2021 03:00:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwvj6RSzgZd+4qC7MYeIo+3O4t82YIJNalMTG79NpiCCnPRWdHq0M4ccbSIVyy5sQzb4ztb X-Received: by 2002:a17:906:311a:: with SMTP id 26mr2486227ejx.395.1615460425217; Thu, 11 Mar 2021 03:00:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615460425; cv=none; d=google.com; s=arc-20160816; b=xIsSVAoDXCMa3/6yZy7SuLpnG55FgvyRTrJcDjc1blHlaHmKXY5bfvuakiEiVxApZN lvvMn/UzxOcmC/dGEb5fMQjS0c9HjGBt2m11U2zV2kn2C20XiTCpyzUwaP8no80QPLc8 2dbZEa+8XBQ/Z8EKq8oJ7QU/NdoQzZ6Uxlj3eqPlaYKlKSlRdXHh9VBw3miZqFEe2MW/ ZCrfR5P6aeHjUlRApuVrc3kJ1NdJ/22cpN2hy/uztOk7d4a/k4o1X51TXthVr6AdIfup eUK/npJqvovhX+E9HwZtrFH5mhunzrk8okKeGJFI4gn2FOJOVRdlloFO95CF90wBr0u9 Ikog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VhCbRq6AtdBjwnonZsJCwx9bYEGLYFxfv2gxi80ch5g=; b=XcM4LBCsCR8catYsCM5dPF7x5SbPiQBlzXKk7/BCDIetLl91ZRQKQhZKQO2zWCh7ng 7dNq99SJ44Cb9f0iQOIGfW6GoE9vjLPPVa18AUhn2jrFDFrjPcII0jH6CpU9sNCuaA4Z CFw38oUmj5ButqOizTA2zeW09aUSdmSJo3c+pSUJymtYcYWOlOhjHYZOW9NXCp1HoXF4 JArAYWbnj+Mdziec35GEs8rz9eSauRGWp6+x/88z7KpNI8wblzJQJNkjTb3t6rkZu8GE D5fcpS7LUg0MIzetwkg3u3bTBOgk74t3TZJ5Aqt73xBUuZuArqt/X39zxkLBDgzm2Rra rNuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="A2FKRP/D"; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o9si1159860edc.244.2021.03.11.03.00.02; Thu, 11 Mar 2021 03:00:25 -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=@linaro.org header.s=google header.b="A2FKRP/D"; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232402AbhCKK6K (ORCPT + 99 others); Thu, 11 Mar 2021 05:58:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232546AbhCKK5k (ORCPT ); Thu, 11 Mar 2021 05:57:40 -0500 Received: from mail-ua1-x934.google.com (mail-ua1-x934.google.com [IPv6:2607:f8b0:4864:20::934]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07C63C061760 for ; Thu, 11 Mar 2021 02:57:40 -0800 (PST) Received: by mail-ua1-x934.google.com with SMTP id j19so460243uax.2 for ; Thu, 11 Mar 2021 02:57:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VhCbRq6AtdBjwnonZsJCwx9bYEGLYFxfv2gxi80ch5g=; b=A2FKRP/DcTnXGGgsgddrySXuzsbPZRlNQhQF3iwzKnBnE8ZwwbZxalj5RUy8f6s3Gf FL2z8W7tqUSj9r7w4514AUhGbgmXHASELTA21v72joswHcSvFbmagXJqL+IAAeCj9rh0 fqCd6GB9IGngabrbDCNNJr4N/HAFTPqHIPRUqZrmZ8LZ0ZY16S+qLmltKC2CxbG43ad2 0mPrPMDt9Z8XU+wpWaJmmRN+FBCBLpiN9JMHWOuOyJBykDgn1MeKgeavq6xm+185izn6 sPI5FZB8voNHacbM9a67BsE6kE/HtnzOGzdhXiVA8CNHtbUKlDlXJJ+qY7s+AyIs2+j1 1xMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VhCbRq6AtdBjwnonZsJCwx9bYEGLYFxfv2gxi80ch5g=; b=IACd/yFK2N9MQtAhRXx4+65K1SLHGfvstPm7VqjH5h1C51EIaSxq99K7cJO5jVvtHu Eno9B1F6crd54PR8OQb/WwsAdyhddgMgvt8TOQpqtXDMSqQmudk1JR8ehvheGkFIJyt5 o8OqxDb3c6hP6Utgw+K0TFlK4fS6GOemtX9BTTo0ix2ehWQ1K4ihKO3V7rYzJqjwnEw/ 6if7bA9dYJRDJpgDL3zGDBDhrliWPm8wkx+DB7cwzDiCHGpfihPUnMK3Z6sIoyAPmNwW X0TyrxHMBQ3yih8q2VK3wFrjdIDpIq93F7gFziFqHrNGLe9W76yvgJfBm5HRgJbtyS5A FBEQ== X-Gm-Message-State: AOAM531QHOdKf23HKwMyIsAt8rFQxlpDqDiv1lWcOV3GwkFYCEFIUbDY VIYv99ENzoMRUlpmr7th0gm7WX4bDyNMNDLL2oA04u3GmB0V40x4 X-Received: by 2002:a9f:3546:: with SMTP id o64mr4683366uao.129.1615460259190; Thu, 11 Mar 2021 02:57:39 -0800 (PST) MIME-Version: 1.0 References: <20210311174046.597d1951@xhacker.debian> In-Reply-To: <20210311174046.597d1951@xhacker.debian> From: Ulf Hansson Date: Thu, 11 Mar 2021 11:57:03 +0100 Message-ID: Subject: Re: [PATCH] mmc: sdhci: Use "mmc" directly rather than "host->mmc" To: Jisheng Zhang Cc: Adrian Hunter , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 11 Mar 2021 at 10:40, Jisheng Zhang wrote: > > Clean up the code to use the "mmc" directly instead of "host->mmc". > If the code sits in hot code path, this clean up also brings trvial > performance improvement. Take the sdhci_post_req() for example: > > before the patch: > ... > 8d0: a9be7bfd stp x29, x30, [sp, #-32]! > 8d4: 910003fd mov x29, sp > 8d8: f9000bf3 str x19, [sp, #16] > 8dc: f9400833 ldr x19, [x1, #16] > 8e0: b9404261 ldr w1, [x19, #64] > 8e4: 34000161 cbz w1, 910 > 8e8: f9424400 ldr x0, [x0, #1160] > 8ec: d2800004 mov x4, #0x0 // #0 > 8f0: b9401a61 ldr w1, [x19, #24] > 8f4: b9403262 ldr w2, [x19, #48] > 8f8: f9400000 ldr x0, [x0] > 8fc: f278003f tst x1, #0x100 > 900: f9401e61 ldr x1, [x19, #56] > 904: 1a9f17e3 cset w3, eq // eq = none > 908: 11000463 add w3, w3, #0x1 > 90c: 94000000 bl 0 > ... > > After the patch: > ... > 8d0: a9be7bfd stp x29, x30, [sp, #-32]! > 8d4: 910003fd mov x29, sp > 8d8: f9000bf3 str x19, [sp, #16] > 8dc: f9400833 ldr x19, [x1, #16] > 8e0: b9404261 ldr w1, [x19, #64] > 8e4: 34000141 cbz w1, 90c > 8e8: b9401a61 ldr w1, [x19, #24] > 8ec: d2800004 mov x4, #0x0 // #0 > 8f0: b9403262 ldr w2, [x19, #48] > 8f4: f9400000 ldr x0, [x0] > 8f8: f278003f tst x1, #0x100 > 8fc: f9401e61 ldr x1, [x19, #56] > 900: 1a9f17e3 cset w3, eq // eq = none > 904: 11000463 add w3, w3, #0x1 > 908: 94000000 bl 0 > ... > > We saved one ldr instruction: "ldr x0, [x0, #1160]" Nice! Even if I think the cleanup of code makes sense alone. > > Signed-off-by: Jisheng Zhang > --- > drivers/mmc/host/sdhci.c | 33 ++++++++++++++++----------------- > 1 file changed, 16 insertions(+), 17 deletions(-) > [...] > @@ -2489,14 +2489,14 @@ void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) > unsigned long flags; > > if (enable) > - pm_runtime_get_noresume(host->mmc->parent); > + pm_runtime_get_noresume(mmc->parent); Maybe use mmc_dev(mmc) instead? At least I think I would appreciate consistency in the entire c-file, today it seems like both "mmc->parent" and mmc_dev(mmc) are being used. [...] Kind regards Uffe