Received: by 10.223.185.116 with SMTP id b49csp4971094wrg; Tue, 27 Feb 2018 05:52:16 -0800 (PST) X-Google-Smtp-Source: AH8x226V0ukK5lreyuBnkJYF/RiFv2UWBtJ2QAFkzL+FIoVeTc/PZOHmckh1SuNUAOhZDLO8EQx2 X-Received: by 10.101.73.7 with SMTP id p7mr11253495pgs.250.1519739536202; Tue, 27 Feb 2018 05:52:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519739536; cv=none; d=google.com; s=arc-20160816; b=sc0lWHG4kEQLftZ6NIkRRzcGZLUiFdGeznYNEGtIC8v+gbVosWRlFaf/sgYekqchkB fjAJbVProYSCq4lVfz9XtnPbD1q9vmvul6Vm2NTQ+pghGDJerTwZAQAgZEpTSG3zQg3/ KMAaEtq+PZmIY75NhlzoUd7Xgu9HBk99FWEdtEelHOCql4+mBkNgidSppfMeKGjo8vfA lDUt4jpGwgHRh4mlIx7dd5CYlYzJIo2+qltu9FU3qJhj8HE6FTsTwUOk3E4rqoYFYQGY j7IfSV0pju54b4ED1pXEpUOseOq4RN9cEVaE6yT8t5vz5k2RgVTwfry9ZaVDSR7EiUR5 BalA== 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:in-reply-to :mime-version:user-agent:date:message-id:from:references:to:subject :cc:arc-authentication-results; bh=9EtCtk7FeYpwlhP181FtwsRxJONda4ZMgbfjGu84yiY=; b=XQGOk+AAYTANuZZvhacOGin7FJfBEsBFqtNzfZqXls6bra/qDEYVxTOy5mY6cyiGDX pg837oyI9hu8IFJMfrKpqXQsbqz5YahUCVo4R7BbJMMBE93kuV4CE/uDLrw16NYAuzvx NyrCAyFRttR9ZY5L5LqjAwAh7p9NzvfbqGOEz+CNTw3UFQ3s/yNAH6suGE9dUvko+3j8 JyG/jFsvKYwlBv3Y+CaXh39IG1RSFO5Uq6gQ+CAz48AlLWXtDbdHaDo2BFYWAl0TXNVQ OvygpWizP5yN9s/bu+o6umHYZzeyEjBaI6p5pEmlKa08cmAlwcztl+BKyVr0QtfDsiCa kDRw== 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 v1-v6si3192461plb.281.2018.02.27.05.52.01; Tue, 27 Feb 2018 05:52:16 -0800 (PST) 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 S1753263AbeB0NvV (ORCPT + 99 others); Tue, 27 Feb 2018 08:51:21 -0500 Received: from lucky1.263xmail.com ([211.157.147.131]:43626 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752621AbeB0NvT (ORCPT ); Tue, 27 Feb 2018 08:51:19 -0500 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.224]) by lucky1.263xmail.com (Postfix) with ESMTP id E8A7696A9C; Tue, 27 Feb 2018 21:51:07 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from [192.168.1.105] (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 5CA6C381; Tue, 27 Feb 2018 21:51:09 +0800 (CST) X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 220.200.5.149 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: lintao@rock-chips.com X-DNS-TYPE: 0 Received: from [192.168.1.105] (unknown [220.200.5.149]) by smtp.263.net (Postfix) whith ESMTP id 739EPHHNR; Tue, 27 Feb 2018 21:51:10 +0800 (CST) Cc: ulf.hansson@linaro.org, linus.walleij@linaro.org, shawn.lin@rock-chips.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mmc: card: Don't show eMMC RPMB and BOOT areas in /proc/partitions To: Harish Jenny K N , adrian.hunter@intel.com References: <1519731229-19141-1-git-send-email-harish_kandiga@mentor.com> From: Shawn Lin Message-ID: <2994915e-18ff-1589-53b2-e726aa3fd872@rock-chips.com> Date: Tue, 27 Feb 2018 21:51:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1519731229-19141-1-git-send-email-harish_kandiga@mentor.com> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ?? 2018/2/27 19:33, Harish Jenny K N ะด??: > From: Andrew Gabbasov > > Since RPMB area is accessible via special ioctl only and boot areas > are unlikely to contain any partitions, exclude them all from listing > in /proc/partitions. This will hide them from various user-level > software (e.g. fdisk), thus avoiding unnecessary access attempts. > > Signed-off-by: Andrew Gabbasov > Signed-off-by: Harish Jenny K N > --- > drivers/mmc/core/block.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c > index 20135a5..376e47e 100644 > --- a/drivers/mmc/core/block.c > +++ b/drivers/mmc/core/block.c > @@ -2341,7 +2341,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, > set_disk_ro(md->disk, md->read_only || default_ro); > md->disk->flags = GENHD_FL_EXT_DEVT; > if (area_type & (MMC_BLK_DATA_AREA_RPMB | MMC_BLK_DATA_AREA_BOOT)) > - md->disk->flags |= GENHD_FL_NO_PART_SCAN; > + md->disk->flags |= GENHD_FL_NO_PART_SCAN > + | GENHD_FL_SUPPRESS_PARTITION_INFO; I would prefer using GENHD_FL_HIDDEN instead of adding all these two flags. > > /* > * As discussed on lkml, GENHD_FL_REMOVABLE should: > -- Best Regards Shawn Lin