Received: by 10.223.185.116 with SMTP id b49csp2216970wrg; Thu, 15 Feb 2018 08:15:03 -0800 (PST) X-Google-Smtp-Source: AH8x2254B+9nOh5R9w9ULD4Uak7VHTNV7Fih5rvzSZNr+Fz4dHcmMdzTZ6YYdC1X6SBbfZSWj15d X-Received: by 2002:a17:902:3281:: with SMTP id z1-v6mr3018520plb.431.1518711303704; Thu, 15 Feb 2018 08:15:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518711303; cv=none; d=google.com; s=arc-20160816; b=X8Y9+jw/mDwQGKaQY7O4ArcPuIsGQH/NiMjBfTxpICeAdI5iXcPMoHqqf4aI1alPuv iCrcFQNwL79tWF/luga82TU9JTODV4zXtY0pEZXT6Wt6hte4O3lXg/zxPMd05PETTX3w eN1Xd6RBKmDuFy1BYXglvqSe0ThjK21r3aQBmSVTzKvfK8kAVCZTaXENf41rxIfNLnBy ovNl+5qz/GzOVdQo81flP73Jmba9RS+iINYHiYiWlRhaYZ07q9b5MbOuI8iuh6gE9uqi LYI1jCcQpnBTbh3T0eTapjGOPDMai/c7OET5meV3vD/8Zx1DkNr4iEMGU0MX036YXHNR OXTQ== 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:message-id:date:subject:cc:to:from :arc-authentication-results; bh=rNmUSKzhKM2eiiUjxhO4l6mPkf6NsrDu9zwzLwQWttw=; b=x/g1t5X+264pJyfHi1ZqDdLvTBoe2aNpyEOuZunrvBis8+jlCx2huNCsJFpDjVhnz+ ihd0a/CrTVy13T2aLRqaRFMOwsfekD8Zead/qr2oPB+jp0QPIMpE+fEhwknazjpKgHmb Vlc2AIwfDSCyKu7LEKjw87LJ5VUMNq2gLoCzsidcZw8VZxkkJJ4nnzsiuS3WA1MyqXzF d16lvJf6RonCtHdbCmTCY6Z71DeXx3+H1OZEsktgsfDH33+Row+jGBWRtDqnjtIevbVZ qgXrPEvzOz6d6or/IxP1iXmGuIRU/F9IkJljLpeZorNTtUHyoVRbBz9c5S1IOLHxf3bV KoyQ== 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 k7si4354002pgp.153.2018.02.15.08.14.48; Thu, 15 Feb 2018 08:15:03 -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 S1034017AbeBOPo7 (ORCPT + 99 others); Thu, 15 Feb 2018 10:44:59 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:34756 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033989AbeBOPo4 (ORCPT ); Thu, 15 Feb 2018 10:44:56 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1A35611B3; Thu, 15 Feb 2018 15:44:55 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai , Mark Brown Subject: [PATCH 4.15 139/202] ASoC: skl: Fix kernel warning due to zero NHTL entry Date: Thu, 15 Feb 2018 16:17:19 +0100 Message-Id: <20180215151720.365039969@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Iwai commit 20a1ea2222e7cbf96e9bf8579362e971491e6aea upstream. I got the following kernel warning when loading snd-soc-skl module on Dell Latitude 7270 laptop: memremap attempted on mixed range 0x0000000000000000 size: 0x0 WARNING: CPU: 0 PID: 484 at kernel/memremap.c:98 memremap+0x8a/0x180 Call Trace: skl_nhlt_init+0x82/0xf0 [snd_soc_skl] skl_probe+0x2ee/0x7c0 [snd_soc_skl] .... It seems that the machine doesn't support the SKL DSP gives the empty NHLT entry, and it triggers the warning. For avoiding it, let do the zero check before calling memremap(). Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/intel/skylake/skl-nhlt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/sound/soc/intel/skylake/skl-nhlt.c +++ b/sound/soc/intel/skylake/skl-nhlt.c @@ -43,7 +43,8 @@ struct nhlt_acpi_table *skl_nhlt_init(st obj = acpi_evaluate_dsm(handle, &osc_guid, 1, 1, NULL); if (obj && obj->type == ACPI_TYPE_BUFFER) { nhlt_ptr = (struct nhlt_resource_desc *)obj->buffer.pointer; - nhlt_table = (struct nhlt_acpi_table *) + if (nhlt_ptr->length) + nhlt_table = (struct nhlt_acpi_table *) memremap(nhlt_ptr->min_addr, nhlt_ptr->length, MEMREMAP_WB); ACPI_FREE(obj);