From patchwork Sat Apr 23 22:16:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bean Huo X-Patchwork-Id: 565667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD07EC433EF for ; Sat, 23 Apr 2022 22:16:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235965AbiDWWTe (ORCPT ); Sat, 23 Apr 2022 18:19:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230148AbiDWWTd (ORCPT ); Sat, 23 Apr 2022 18:19:33 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30A4E14DEAA; Sat, 23 Apr 2022 15:16:35 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id i27so22735766ejd.9; Sat, 23 Apr 2022 15:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uUchkhWvkEdTq0frz8pj3bluHZsr2d70PH8hnHJ4qQE=; b=pIR+fGp4CoBhD71wEothWHCI3q8bux9vPYD9xiKAVLynsPNi2U7WW44Iea0uOJjVwl kx/wRp8bDOZ+OHMc0VSp8M3hOY89/Dbb8Gr+GQ3G+2nXKGsDa2/4FshSgxk1N63IOPrK YDyVKdM2cTF1usMdnndU1VezA0ViJy7ARYYt0d4RtofpUxdBxBxU+ic9lGDZAUwdOu0S c16tEJzCyFSMLiowBc8Pk2zh/ySOmfJQh2cztQgVMQRoMyRovmDRHEBZrDLRREue1Yj5 vvbgACIIcL3yTTCJSLrJbBZ5+b06h1jXq+d6sArkrjrsqWXrXb5rvxcfi3LaUJJw0pwM ULSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uUchkhWvkEdTq0frz8pj3bluHZsr2d70PH8hnHJ4qQE=; b=BKwgjYOgbZB0fuKs45ejNRU7C2o5tBu8oNGxqkCkegqpz9lJXJ5WY4yO1GdGivHEbr 2l6H5qtVtZaD9AAgl8my3dPV8LXy3Dthcnn4V1mxCLkGwyu6UV8MSVQHXlE1DcCwRzGK 2ITbnxSbiTMA0rWYytAITHhzOVpF78nxKAIJgQjHT5mFuynunHAWpf4lq0RGSz9VgyB5 l3LiAezcVQexDztNAiTb7dU1P56qrVLMcnyIcBQ5ZE2r2a6bzciw/pGsuSHfqDmrjUar RFn4rJNJnRuM4L/uWybXusZoIgCQQpAJkOfNcvn76h8Y5RQDAtFlrQayNCs2iBhp9vKi 9WKQ== X-Gm-Message-State: AOAM533rqmXe//1xDy0ewzslOKqio2wqDsC9rgxL5qbH5w1GjKTJBYiE U5fbES8T4FHVXC+Y3omDuvq5DJt3CVC7Zw== X-Google-Smtp-Source: ABdhPJzoZs+jikSWzpDyWjVfhyKV/vsg4M3aq9tJEtl8OBYl0wk8FuSfrjaG4fy2yRx42jUVs1VsuA== X-Received: by 2002:a17:906:6a0d:b0:6e8:c927:663 with SMTP id qw13-20020a1709066a0d00b006e8c9270663mr9953431ejc.394.1650752193821; Sat, 23 Apr 2022 15:16:33 -0700 (PDT) Received: from linux.. (p5dd1ed70.dip0.t-ipconnect.de. [93.209.237.112]) by smtp.gmail.com with ESMTPSA id s1-20020a056402036100b004240a3fc6b4sm2669484edw.82.2022.04.23.15.16.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Apr 2022 15:16:33 -0700 (PDT) From: Bean Huo To: ulf.hansson@linaro.org, adrian.hunter@intel.com, linus.walleij@linaro.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: beanhuo@micron.com Subject: [PATCH v1 1/2] mmc: sdhci-omap: Use of_device_get_match_data() helper Date: Sun, 24 Apr 2022 00:16:22 +0200 Message-Id: <20220423221623.1074556-2-huobean@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220423221623.1074556-1-huobean@gmail.com> References: <20220423221623.1074556-1-huobean@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Bean Huo Only the device data is needed, not the entire struct of_device_id. Use of_device_get_match_data() instead of open coding of_match_device(). Signed-off-by: Bean Huo --- drivers/mmc/host/sdhci-omap.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index 64e27c2821f9..86e867ffbb10 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -1219,16 +1219,11 @@ static int sdhci_omap_probe(struct platform_device *pdev) struct sdhci_pltfm_host *pltfm_host; struct sdhci_omap_host *omap_host; struct mmc_host *mmc; - const struct of_device_id *match; - struct sdhci_omap_data *data; + const struct sdhci_omap_data *data; const struct soc_device_attribute *soc; struct resource *regs; - match = of_match_device(omap_sdhci_match, dev); - if (!match) - return -EINVAL; - - data = (struct sdhci_omap_data *)match->data; + data = of_device_get_match_data(&pdev->dev); if (!data) { dev_err(dev, "no sdhci omap data\n"); return -EINVAL; From patchwork Sat Apr 23 22:16:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bean Huo X-Patchwork-Id: 565455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7714FC433FE for ; Sat, 23 Apr 2022 22:16:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229863AbiDWWTh (ORCPT ); Sat, 23 Apr 2022 18:19:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230337AbiDWWTe (ORCPT ); Sat, 23 Apr 2022 18:19:34 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC3C614DEA4; Sat, 23 Apr 2022 15:16:35 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id ks6so22816992ejb.1; Sat, 23 Apr 2022 15:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SeT9VKBABGE3+M59+/LdCRTy+y0q+UOFIghRmJw7JEU=; b=ghEvrTo/Mw/dGr730gI9vebowZJO7rKTe/+ShB6UWGyegdMld1T8uMV4Je5P9dfyw2 FF0/6gg7Pq8QIUkYjBJaAQToDMVr6y4Lk1yxvod3bAS+Z+yeSYR0mkj1Ai1qNYJLf23P 0Cl7H1phs9RQtEd6La3Pjydygqw1rO1bvXGsopDhNMx1mBVK1s7ZPA/ebq/SQNddFPzN YjDBj+/wdKcy/GbiazuxWlDGrXea9t7I+Runba6n1mF7NYeuABbsjkM0x6tOFQ8/0D03 UbciJXa8UhsSA5BC/dFwoJQmOpQ7+/wtz/zu7SDUka5/NlXyHhQMQVPIdW2Zg4BDBBPI OSpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SeT9VKBABGE3+M59+/LdCRTy+y0q+UOFIghRmJw7JEU=; b=bmGBOJH/lc/gwK4IRA/YMT63SDG3Xo24+OzlPIAT7O2UQpqKyYlv/hQceUTvYA1uHU zxOhRsVOVgXZLlXuwlFk64NxyiBoQw91Q2On7CUwKa4Um4oHA8xvobAton4fbIh+7KDn /AAIYjttwqHprdduPSoeagS/A+9OKRLhMCtGQg1F3lvk9yDgGRUEiTuxs9AH6PqSm+vz oOy8NW9mslWfm+vDamBgYviH0v07ZdmRjjqX2/OrkZI06Z14PeCf3/mszF6gpe1Bdgez O4HhMocc+u2VdlfvBbYvbM6nb7FJlHMn5wbBz2cvwTR2QYha2rd75dSHO64gys9K1Cp4 55hA== X-Gm-Message-State: AOAM5327vzHFSRnN4QsAISBeWtJ9+j6BOTuaFtCdDRFLavwTM42JdEeR XCYQ0xRg53w5QaQTxON1Bt8= X-Google-Smtp-Source: ABdhPJwhbEa7xhj18dQkE7o4UxIXO6J5D9LIESZfSOfibr5uduO1+Zize1piovEhzJALerxZ5LhLoA== X-Received: by 2002:a17:906:c0d6:b0:6ca:457e:f1b7 with SMTP id bn22-20020a170906c0d600b006ca457ef1b7mr9540974ejb.399.1650752194502; Sat, 23 Apr 2022 15:16:34 -0700 (PDT) Received: from linux.. (p5dd1ed70.dip0.t-ipconnect.de. [93.209.237.112]) by smtp.gmail.com with ESMTPSA id s1-20020a056402036100b004240a3fc6b4sm2669484edw.82.2022.04.23.15.16.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Apr 2022 15:16:34 -0700 (PDT) From: Bean Huo To: ulf.hansson@linaro.org, adrian.hunter@intel.com, linus.walleij@linaro.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: beanhuo@micron.com, stable Subject: [PATCH v1 2/2] mmc: core: Allows to override the timeout value for ioctl() path Date: Sun, 24 Apr 2022 00:16:23 +0200 Message-Id: <20220423221623.1074556-3-huobean@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220423221623.1074556-1-huobean@gmail.com> References: <20220423221623.1074556-1-huobean@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Bean Huo Occasionally, user-land applications initiate longer timeout values for certain commands through ioctl() system call. But so far we are still using a fixed timeout of 10 seconds in mmc_poll_for_busy() on the ioctl() path, even if a custom timeout is specified in the userspace application. This patch allows custom timeout values to override this default timeout values on the ioctl path. Cc: stable Signed-off-by: Bean Huo Acked-by: Avri Altman --- drivers/mmc/core/block.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index b35e7a95798b..6cb701aa1abc 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -609,11 +609,11 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md, if (idata->rpmb || (cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B) { /* - * Ensure RPMB/R1B command has completed by polling CMD13 - * "Send Status". + * Ensure RPMB/R1B command has completed by polling CMD13 "Send Status". Here we + * allow to override the default timeout value if a custom timeout is specified. */ - err = mmc_poll_for_busy(card, MMC_BLK_TIMEOUT_MS, false, - MMC_BUSY_IO); + err = mmc_poll_for_busy(card, idata->ic.cmd_timeout_ms ? : MMC_BLK_TIMEOUT_MS, + false, MMC_BUSY_IO); } return err;