Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3001049imm; Thu, 17 May 2018 01:26:49 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrKLcZN1IyuuHxOdmNNkyi4g2Kvc1IO0+bE4hKbJYbKZyJVTAQVkrESW8bJnC2LrcXjP94Q X-Received: by 2002:a63:9c3:: with SMTP id 186-v6mr3425914pgj.357.1526545609289; Thu, 17 May 2018 01:26:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526545609; cv=none; d=google.com; s=arc-20160816; b=oHc7uuJW199A2S2NN0fu3mhL/hz0/dd31u3561vFVehpidcfqD/VWBueFYW/+JZM9h GDIvvw206XCLVhbZnsO2pBtVWDaJYWLzQiSVLssIkse0GQOrNAXG6WguqGt1SEZtqQ9S E+JD4drjbT0zszxfYz29N6pY+in5zjVLg5pW7uc95M45g9dSeLxm0jeUvGpd9mUNAGol 9xOalhSvQbTY5cnwvNgy1U7r1slxBxkyqHtlCmsa78x6ciMtxLMWraw67PbreTrH0ZwD AM8pLPkHq0u2Egz79WGg4cIfijo1UTKYgymlDgPv1ngq1aeM9GljDIgIOMjZIM+/Tia2 VBFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date :arc-authentication-results; bh=ANbjpDS6T8Hli0eZ0Jjpf6BjSro+TCbCiVR3sZuPGiY=; b=zhtZ9W7J2z0wuJjiXkgkmZPwrA2Pcnd0F+oBGXX8RlJvXSKGpt9x2GLpr3PmHnrBfw gFHsV1tjb7dqG4ZmvqAWhZ+DDZTqrnMNgtOBsT0U6J9Q1e8m7nsTB0d3B7Fx46qdpu4t eSbRJupt5nTJEoo9L33XzRskFBuoKTCkpGpwUg6ynH94fhdshsfK8mrIdDQ+ZSC734W7 8Uml7ykv2qM6IX4qeRJ6FDvovFEEDSB6XHWC7JjmvhMY7AIdvb4u8S5vifd+HRTe82M+ komiqxEzG/h8cuLokRxB1flY/kLQFae3xb0qMTcZDxJfrO1MndOc1Qq2uW/pXI20GU8a Mlow== 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 j6-v6si3771023pgc.509.2018.05.17.01.26.34; Thu, 17 May 2018 01:26:49 -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 S1752303AbeEQI0K (ORCPT + 99 others); Thu, 17 May 2018 04:26:10 -0400 Received: from mx2.suse.de ([195.135.220.15]:37738 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752173AbeEQI0H (ORCPT ); Thu, 17 May 2018 04:26:07 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DB0C7ABF3; Thu, 17 May 2018 08:26:06 +0000 (UTC) Date: Thu, 17 May 2018 10:26:05 +0200 Message-ID: From: Takashi Iwai To: Stuart Hayes Cc: Andrew Morton , linux-kernel@vger.kernel.org, charles_rose@dell.com Subject: Re: [PATCH RESENT v4] dell_rbu: make firmware payload memory uncachable In-Reply-To: <848a3ac6-4781-dd54-0b4a-d4839d902284@gmail.com> References: <20180418054634.10289-1-tiwai@suse.de> <848a3ac6-4781-dd54-0b4a-d4839d902284@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") 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 On Wed, 09 May 2018 17:17:45 +0200, Stuart Hayes wrote: > > > On 4/18/2018 12:46 AM, Takashi Iwai wrote: > > From: Stuart Hayes > > > > The dell_rbu driver takes firmware update payloads and puts them in memory so > > the system BIOS can find them after a reboot. This sometimes fails (though > > rarely), because the memory containing the payload is in the CPU cache but > > never gets written back to main memory before the system is rebooted (CPU > > cache contents are lost on reboot). > > > > With this patch, the payload memory will be changed to uncachable to ensure > > that the payload is actually in main memory before the system is rebooted. > > > > Signed-off-by: Stuart Hayes > > Reviewed-by: Takashi Iwai > > Signed-off-by: Takashi Iwai > > --- > > v2 Added include, removed extra parentheses > > v3 Corrected formatting and include line > > v4 Moved set_memory_uc() outside the while loop so that the memory is > > definitely allocated before it is set to uncachable > > > > Andrew, could you pick up this orphan one? Thanks! > > > > diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c > > index 2f452f1f7c8a..53f27a6e2d76 100644 > > --- a/drivers/firmware/dell_rbu.c > > +++ b/drivers/firmware/dell_rbu.c > > @@ -45,6 +45,7 @@ > > #include > > #include > > #include > > +#include > > > > MODULE_AUTHOR("Abhay Salunke "); > > MODULE_DESCRIPTION("Driver for updating BIOS image on DELL systems"); > > @@ -181,6 +182,11 @@ static int create_packet(void *data, size_t length) > > packet_data_temp_buf = NULL; > > } > > } > > + /* > > + * set to uncachable or it may never get written back before reboot > > + */ > > + set_memory_uc((unsigned long)packet_data_temp_buf, 1 << ordernum); > > + > > spin_lock(&rbu_data.lock); > > > > newpacket->data = packet_data_temp_buf; > > @@ -349,6 +355,8 @@ static void packet_empty_list(void) > > * to make sure there are no stale RBU packets left in memory > > */ > > memset(newpacket->data, 0, rbu_data.packetsize); > > + set_memory_wb((unsigned long)newpacket->data, > > + 1 << newpacket->ordernum); > > free_pages((unsigned long) newpacket->data, > > newpacket->ordernum); > > kfree(newpacket); > > > > Just a reminder... I don't think this has been picked up yet. Please let me know if there's anything I could do. Another gentle reminder ping. Andrew, if it's not suitable to your tree, just let me know. If so, I'll either submit directly to Linus or create a new tree for the misc stuff. thanks, Takashi