Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp798011img; Fri, 22 Mar 2019 08:47:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9d6YpqEmLJn3GHpUvYhzxtoCX0jY6wG/rjD6m6sjO9wvrW5yXL2Dgeh3tzdnYhOmJrMgX X-Received: by 2002:aa7:90c1:: with SMTP id k1mr9756478pfk.202.1553269628621; Fri, 22 Mar 2019 08:47:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553269628; cv=none; d=google.com; s=arc-20160816; b=JO+wLyj2ISp8EzyU6eS28xRECUdQQs10hBnc5LBq/sArf2015JU94UnJqspz+zReq6 Shn6pqO1T/jIB4g5a0X+1/xttfFnU0rdA4DtMFEe3kZgC7bMsoRkTvnoY1laSLvyj4i9 uOy/vro+/FIyKWpT7cgTH0XjvWacjaTKpwJp629e4eahxWEWbuhM8+WhaZdZicuVcGf7 qHJkQwUZn2joOn9G8d+lZLr3GrkxUP8iqJy4wn6zVdoHipjoRYc/+TtZTHT4xyjox5AH 6qTHkP6DREljZ3uYSlfHODvIXsXDHrpLsqU22ze6rrXOQ4vhGuc1q1GnuQEiIoKbq0Vv BQlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=7/ctW/yItTKgpMFEfod3AoJPalWYZip850rcRbHhKxg=; b=p/jiHIQY77ehgU+04n/zymL/je/QTm7s5zo7DQMy+3RTI5KB1GdRLN3SWphuxXpt4s 59FPUG4+UUJPdVWySrG4x5taS9+lY+NvNuLb2V3tV5dBGPW+doi+vTborktnrGywVFZl szcxiPd045pa73yQo43M77MNfLhgBfPUVzELIh0PCvu/YKIE3BhNKyqh3bPgnHm+WaQA kNXDpg7ouqI0O2oKTw7L7dfzd7hzysgEi+FDJt4MZgy4AjwyPTXlh81BOn/5a4Bku8FR T+4/TRAD1ld9gdosgAtlWdEd7ajMPQy6qTPwpONXrHzBhIJW7x1bh1cqtCcFppL290Um 6ubA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21si6577352pgv.28.2019.03.22.08.46.53; Fri, 22 Mar 2019 08:47:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727609AbfCVPqE (ORCPT + 99 others); Fri, 22 Mar 2019 11:46:04 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:55939 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727244AbfCVPqE (ORCPT ); Fri, 22 Mar 2019 11:46:04 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1M89TB-1h3FUl0ZQx-005ERN; Fri, 22 Mar 2019 16:45:56 +0100 From: Arnd Bergmann To: stable@vger.kernel.org, Ulf Hansson Cc: Chuanxiao Dong , Yuan Juntao , Pawel Wodkowski , Arnd Bergmann , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.4.y 05/25] mmc: debugfs: Add a restriction to mmc debugfs clock setting Date: Fri, 22 Mar 2019 16:43:56 +0100 Message-Id: <20190322154425.3852517-6-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190322154425.3852517-1-arnd@arndb.de> References: <20190322154425.3852517-1-arnd@arndb.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:rNgMA6KuyisLXRfCfenSe1Wq9wIOuO34n904IfRUOVdG701BO8N BsWka5aFdovs3ew+Atu2vZWxg2WBWaFa1PfkL7gqK4/urtKXNZzjMx9p075htozU3cz4MKv FDXFRMP33vZohqA/5KGjaaY7zwUXCbtHbvArBIyuJz8TESWvwKg1hI3Y9EYIK7NlLkcV+kx xRhUoIfRl9jIlvCxXAU8g== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:zFe/6JXOYhA=:acYPAqDC7pVn98rLvZMSES 4THsCAGfnVUZdV33tqRBRvFIdFNieDIkxhcrQQmTL0gXyMx6EH2BfZgj8Tg2/NqHFf6H3Pza4 MK31PMRC6MqlDc7CUs4xJb/10ChMv7QPJcTUORNK/WBxCTgD/o05lWUCkAbHIZzXBaRlCvkue 43jgkIU2E/aa44EpNzMUNO7FeUzKejJANjDiJYfj8IAR96i0XVy6hsUOVErbkS1cxJvf6c63f 8JIp321mrCl9VEDUC3mCZLKOhlnWnOeIR7Y+6vzwOh4zLVxUaiDnZNN/8MSlo6SUlxbpcPKWF RTLuMKwEWX31ao4qqHM1rbxVTcbUW9Ph9TW5rngLeVnO4netSEkBLP5Wx8Pa2zkeBetw7ItYu N770UisrdkNy06VMvXGwN9ijs/9ZONfFxkgy/MgxdWeKEERG9h436seFiUcBJeh2CxEqtB2pg 1iJ39mxln+0S/JO6NLFc2op1X9h0I0M+20Q+MacNGiErMRDTaEgKCoE1XlyflqJ2VWO/tmPJL jS2h6VyEGIfk9h1wTFrz+4hPpr9hCbK7XAnsr7vBRTTVtGIATQ3QmoJ4I1n6hLH9T0qGO+5Mu K2t50KugpzaJHaXx7bXoZ4RYZEFwKqhNJTpkoMImgnMOvc6jx41jL+lbdzPbSQhQ4ReXioBD6 qs0JyYJzNuTowuraliXuZWmWRYTrk/YJkiFIzH/H1FDkjhDxijpZFpZL5b/y8rclYyNZ7XZ75 EgYpTtfyCOntmVn61fyx4BrT+qMzBbRmE9UUeA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chuanxiao Dong Clock frequency values written to an mmc host should not be less than the minimum clock frequency which the mmc host supports. Signed-off-by: Yuan Juntao Signed-off-by: Pawel Wodkowski Signed-off-by: Ulf Hansson (cherry picked from commit e5905ff1281f0a0f5c9863c430ac1ed5faaf5707) Signed-off-by: Arnd Bergmann --- drivers/mmc/core/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c index 154aced0b91b..705586dcd9fa 100644 --- a/drivers/mmc/core/debugfs.c +++ b/drivers/mmc/core/debugfs.c @@ -220,7 +220,7 @@ static int mmc_clock_opt_set(void *data, u64 val) struct mmc_host *host = data; /* We need this check due to input value is u64 */ - if (val > host->f_max) + if (val != 0 && (val > host->f_max || val < host->f_min)) return -EINVAL; mmc_claim_host(host); -- 2.20.0