Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5159120imm; Tue, 9 Oct 2018 10:32:32 -0700 (PDT) X-Google-Smtp-Source: ACcGV60G/IKlVxVV2XuAtjm3kwwxyDLjF1w0j10mlLhmFL1yA1jQMPwyQT7wzumQyqplSoPClsWG X-Received: by 2002:aa7:850d:: with SMTP id v13-v6mr31354317pfn.83.1539106352267; Tue, 09 Oct 2018 10:32:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539106352; cv=none; d=google.com; s=arc-20160816; b=dETVZhDfhSRjQp0ZmGaWn3iyKnrhodMtaV1OPa1GExn4n2zQCgp48ZiRozi+1clqHw o8861fFrbb5dymzMDxEiY3bi/yXWlyVmuIVxiKFtbqfrK+1WILEEAyON9m/5/GdV+tWG +DB6E7kOYJlQGzoe/SfkuIPj1VpPdfUkw+qR+brzwTpjiVrX+B+G5nyFO8IRe0r2ONLd Tz/48hPw5//fWrGacpJLhAkBqEBeVsBjRgDiEpYa8Ix6Vgdftqj3P5BW2RIBpAo0bxEa ayeap5gAj+hIk2W6lyiQAMFJtmiwLUA+/XWRCfMQjbYNVPs54KDhYg8DA/qELBo3OYiu XnDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:mime-version :dkim-signature; bh=WZfKZ9mFsu/vTwKnPT3eAzz4AisFJiTsIBVv1y3D8mI=; b=L0hCtlLV0POJX1MfF2uf9lgxVbJjF9YpNcMa9ar7aH8PyffuMFrdiZBjeGBCe+U8NL 5tTyXGWuvRq0DS4Cfgan+dFVh/Q5vRyVhfbSrIpfABn4meY9kGd4n5SEBahGyhaWkMC/ 0EEVJgkXyuJFcO51oXe6hqqLEFEMBzjFpj8wu+LOs/TdrPz/tb8wRTU8bZe8Vwov2Xj5 LZwZMdy6vCqxGxKOMP5+tNdiasOOmjEtgdZTsJGlTCjqU6QKzjYGDs/WTln3FR2ZmpwP wf3nPyHw2D2eC4cQGFcsojEsFghKNSjRbXrX+IRwbIBDi8iTx6VZiFldEiqXDPdqFpLF zQnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nanometrics.ca header.s=google header.b=iEUX2VIx; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=nanometrics.ca Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w3-v6si21575075plq.198.2018.10.09.10.32.17; Tue, 09 Oct 2018 10:32:32 -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; dkim=pass header.i=@nanometrics.ca header.s=google header.b=iEUX2VIx; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=nanometrics.ca Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727421AbeJJAtd (ORCPT + 99 others); Tue, 9 Oct 2018 20:49:33 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:50793 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbeJJAta (ORCPT ); Tue, 9 Oct 2018 20:49:30 -0400 Received: by mail-it1-f194.google.com with SMTP id j81-v6so3911064ite.0 for ; Tue, 09 Oct 2018 10:31:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nanometrics.ca; s=google; h=mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=WZfKZ9mFsu/vTwKnPT3eAzz4AisFJiTsIBVv1y3D8mI=; b=iEUX2VIxr9Pju08ZhQ97lwRt5s/z4g1dKSKNKSR0AGNW4v2qO5ZskBbGAhNG0nMLn3 nYw+1TuItf7LEORjaQa3Ly9GR8j9tiopYxV5oY9smfSWxb0ZbrG97do1B5D+ScWcnW9I Ov8viMASBDD+Az3vF/M5CVH9Z+fJoDa693TLY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=WZfKZ9mFsu/vTwKnPT3eAzz4AisFJiTsIBVv1y3D8mI=; b=GwkrFbaGvcHJgp+FF1Yp3AGYhEgYb3wwGs9cGc/7Rn94eeBByF7xR2hOJRn6Rwm/ub cUM0oFRL6i+H8828kR5LT5t8eewLn9NCLTVrI3fT42iQ6y4AgFY7ZVH+zmDzN8iKA6ov wj7khjhf6anKWCIcu5U7XA20Y69eeCdoJqtEJ455vz23BYVKgw3P4BienvD8XZKdPxoO CM3XAHGuo7acKf09mFyVJqKVgE8n/XRYUVjTBgoCjZyZyh841alfiSE3TsefEao+rEEc 11pgwnNC/2ZL16k0AbfYTyUKJsRaeM/Dp4RK2/XPK4THUcEC5jxfWxcook2k1ghamxCE YiDw== X-Gm-Message-State: ABuFfojdWUivwZSaso07ifs8xFKUIEfa4xkyKJqsJ7E0xDpVwjdowX/E PIgsGnZx0R9BmyeM/T2XXjpjwKc8vjCp0tGnhh7ziVFBATFFnLSIEmqggzBxkZRBE1c9MJ6+i1A BCSMIx2/28J9xW/4W+Ls/Lg== MIME-Version: 1.0 X-Received: by 2002:a24:76c6:: with SMTP id z189-v6mr2804214itb.5.1539106288287; Tue, 09 Oct 2018 10:31:28 -0700 (PDT) Received: from jamesnuss-kubuntu.nanometrics.ca ([72.142.127.130]) by smtp.gmail.com with ESMTPSA id c24-v6sm6321018iod.44.2018.10.09.10.31.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Oct 2018 10:31:27 -0700 (PDT) From: James Nuss To: linux-mmc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 5/7] mmc-utils: remove write_reliability set command Date: Tue, 9 Oct 2018 13:31:09 -0400 Message-Id: <212d6c6557b21584f9e3254ff72d57ca2682e2b2.1539103468.git.jamesnuss@nanometrics.ca> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Content-Type: text/plain; charset="US-ASCII" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The "write_reliability set" command is dangerous since it will only set write-reliability on one partition per command and this command is a one-time programmable action. This makes it impossible to set write-reliability on multiple partitions. Remove the command so it cannot be used in the future. Use "write_reliability set_register" instead. Signed-off-by: James Nuss --- mmc.c | 5 ----- mmc_cmds.c | 67 -------------------------------------------------------------- mmc_cmds.h | 1 - 3 files changed, 73 deletions(-) diff --git a/mmc.c b/mmc.c index aaefd3d..655546b 100644 --- a/mmc.c +++ b/mmc.c @@ -97,11 +97,6 @@ static struct Command commands[] = { "Enable the enhanced user area for the .\nDry-run only unless -y or -c is passed.\nUse -c if more partitioning settings are still to come.\nNOTE! This is a one-time programmable (unreversible) change.", NULL }, - { do_write_reliability_set, -2, - "write_reliability set", "<-y|-n|-c> " " " "\n" - "Enable write reliability per partition for the .\nDry-run only unless -y or -c is passed.\nUse -c if more partitioning settings are still to come.\nNOTE! This is a one-time programmable (unreversible) change.", - NULL - }, { do_write_reliability_set_register, -2, "write_reliability set_register", " " "\n" "Set the write-reliability register (WR_REL_SET) for the .\n" diff --git a/mmc_cmds.c b/mmc_cmds.c index 68c73ef..9565bc9 100644 --- a/mmc_cmds.c +++ b/mmc_cmds.c @@ -1303,73 +1303,6 @@ int do_write_reliability_set_register(int nargs, char **argv) return 0; } -int do_write_reliability_set(int nargs, char **argv) -{ - __u8 value; - __u8 ext_csd[512]; - int fd, ret; - - int dry_run = 1; - int partition; - char *device; - - if (nargs != 4) { - fprintf(stderr,"Usage: mmc write_reliability set <-y|-n|-c> \n"); - exit(1); - } - - if (!strcmp("-y", argv[1])) { - dry_run = 0; - } else if (!strcmp("-c", argv[1])) { - dry_run = 2; - } - - partition = strtol(argv[2], NULL, 10); - device = argv[3]; - - fd = open(device, O_RDWR); - if (fd < 0) { - perror("open"); - exit(1); - } - - ret = read_extcsd(fd, ext_csd); - if (ret) { - fprintf(stderr, "Could not read EXT_CSD from %s\n", device); - exit(1); - } - - /* assert not PARTITION_SETTING_COMPLETED */ - if (ext_csd[EXT_CSD_PARTITION_SETTING_COMPLETED]) - { - printf(" Device is already partitioned\n"); - exit(1); - } - - /* assert HS_CTRL_REL */ - if (!(ext_csd[EXT_CSD_WR_REL_PARAM] & HS_CTRL_REL)) { - printf("Cannot set write reliability parameters, WR_REL_SET is " - "read-only\n"); - exit(1); - } - - value = ext_csd[EXT_CSD_WR_REL_SET] | (1<