Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753812AbbGaPnU (ORCPT ); Fri, 31 Jul 2015 11:43:20 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:59043 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752635AbbGaPnS (ORCPT ); Fri, 31 Jul 2015 11:43:18 -0400 Date: Fri, 31 Jul 2015 23:43:03 +0800 From: joeyli To: Pavel Machek Cc: "Lee, Chun-Yi" , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, linux-pm@vger.kernel.org, "Rafael J. Wysocki" , Matthew Garrett , Len Brown , Josh Boyer , Vojtech Pavlik , Matt Fleming , Jiri Kosina , "H. Peter Anvin" Subject: Re: [RFC PATCH 09/16] PM / hibernate: Reserve swsusp key and earse footprints Message-ID: <20150731154303.GF2067@linux-rxt1.site> References: <1437056730-15247-1-git-send-email-jlee@suse.com> <1437056730-15247-10-git-send-email-jlee@suse.com> <20150728123523.GD12681@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150728123523.GD12681@amd> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1884 Lines: 75 On Tue, Jul 28, 2015 at 02:35:23PM +0200, Pavel Machek wrote: > Typo in patch subject. > > > And for earsing footbprints, the codes in this patch remove setup > > And two typos here. > Sorry for subject and above typos, I will fix it. Thanks. > > data that carried swsusp key, and clean the memory space that > > And don't call it swsusp. Please fix globally. > OK~ > > +++ b/arch/x86/power/hibernate_keys.c > > @@ -0,0 +1,79 @@ > > +/* Swsusp keys handler > > + * > > + * Copyright (C) 2015 SUSE Linux Products GmbH. All rights > > Are you sure? > Thank for your finding here, I will change the Copyright to me with my company mail address. > > +static int __init init_hibernate_keys(void) > > +{ > > + struct swsusp_keys *keys; > > + int ret = 0; > > + > > + if (!keys_phys_addr) > > + return -ENODEV; > > + > > + keys = early_memremap(keys_phys_addr, sizeof(struct swsusp_keys)); > > + > > + /* Copy swsusp keys to a allocated page */ > > + swsusp_keys = (struct swsusp_keys *)get_zeroed_page(GFP_KERNEL); > > + if (swsusp_keys) { > > + *swsusp_keys = *keys; > > + } else { > > + pr_err("PM: Allocate swsusp keys page failed\n"); > > + ret = -ENOMEM; > > + } > > + > > + /* Earse keys data no matter copy success or failed */ > > + memset(keys, 0, sizeof(struct swsusp_keys)); > > + early_memunmap(keys, sizeof(struct swsusp_keys)); > > + memblock_free(keys_phys_addr, sizeof(struct swsusp_keys)); > > + keys_phys_addr = 0; > > + > > + return ret; > > +} > > + > > +late_initcall(init_hibernate_keys); > > init_hibernation_keys. > > > Pavel I will change the function name. Thanks a lot! Joey Lee -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/