Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2204554iof; Tue, 7 Jun 2022 23:08:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYqmTPeXyciVDP4BPaxWpo2BE+q1rFDyA9AR4Nmv5MHflhIyGZyeqjC+lDFJlmu8Mb8UlS X-Received: by 2002:a17:902:b692:b0:14c:935b:2b03 with SMTP id c18-20020a170902b69200b0014c935b2b03mr32479091pls.81.1654668508741; Tue, 07 Jun 2022 23:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668508; cv=none; d=google.com; s=arc-20160816; b=icopEeb2goKQjEP2h5np8ohQrRoBHvIMzN0JBlErw3+kD0vlH46BmsMZJNpvFfgvFT 4cdz3wCs6iF5TXtH+rfMZEnmfsSc4Yc/demSisje4Co0hmbuDsYnkPMklH+2eB00y4zl tNY+oJiUlqSYPwwtLq45dFfIpvmvVtsc8MS8dsp9EGncC+fRTc7DOlYL5aH5CSTAAhGs 4FdjF/+PfiVSa2xTd2iALEYb395sQv3I/DlE7121PoYSTo+KU24mK9FQPSNV7k8AO8N5 d8C9Au9bjuAOH6upcCZo/PgWD2dVSLkvypTrf/iCnFS3QmINr4niD97uOPG0+QSrUGTO eNow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3FRNRdYN3V4iFbw0+jim8FJqG/69yUZbqDUXhPuDh/4=; b=HV4Ge1RrJ1z2/LiqCqGJpswJCehCmdpcXekRs9XQWji0+GZBzouz4zvqRvRRW0zl/X 6Z7/EcNyPLTqFLvv8O6x2NAs9B+3AUPzucz/d9NFaZmPhgZMJdR5c9DkOJvEQonHZjF8 y+YYOV7keTjwwAv7Iuj/CsrEd2eMWRXeJSl350sX6BnJSL+oUvLNhjU0LwDTQU4XGlLh 74w1jg6szbvycRZU3HYzAKuKXU4+77oEIGxaioqtoy1YguSAJgBFTnpL64IBNC2g6qNZ GHM8OQ1s5H0cxItD0uLWmB0Fdn1Bgzn5ejQ/NB/ckHno8tFDlNOwG72wGlwazehD1/hG J1Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BxrZoiS9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k16-20020aa792d0000000b0051c10b55b92si9979388pfa.187.2022.06.07.23.08.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:08:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BxrZoiS9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AE4E348E57C; Tue, 7 Jun 2022 22:31:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385227AbiFHBgM (ORCPT + 99 others); Tue, 7 Jun 2022 21:36:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385170AbiFGWbS (ORCPT ); Tue, 7 Jun 2022 18:31:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 962AE278522; Tue, 7 Jun 2022 12:24:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0CFB1B823DA; Tue, 7 Jun 2022 19:24:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D2E3C34115; Tue, 7 Jun 2022 19:24:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629865; bh=bEMjmt/fs8kRVG7tWEi/Vb+6ioSU5XDC+V8l26sZGkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BxrZoiS96TNEGyb7Kq+lI6cVKgPnRSfAaj1IzrQ+013heaceRwb4QeRfLF7ehEkSm ZbzhBp162X5Mxo+wbXINN0E8PZ+nTx5uKNSB7T7EIg75+hUyRv8so/2mQJQKcz7BZz UBxXtMOW7SiFtMyENg8QCrVvzKCTI/95dWHIQEjk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bean Huo , Avri Altman , Linus Walleij , Ulf Hansson Subject: [PATCH 5.18 808/879] mmc: core: Allows to override the timeout value for ioctl() path Date: Tue, 7 Jun 2022 19:05:26 +0200 Message-Id: <20220607165026.310241617@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Bean Huo commit 23e09be254f95a5b75cd87f91a4014f3b46dda3f upstream. 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 Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220423221623.1074556-3-huobean@gmail.com Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/core/block.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -609,11 +609,11 @@ static int __mmc_blk_ioctl_cmd(struct mm 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;