From patchwork Thu May 23 19:05:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 165055 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2613973ili; Thu, 23 May 2019 12:21:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+12R5auDM0mfwulPVBMnZWXyj24yYyyRy4VYeg+n3pGhIOE3gkXgCpIOEfmaDQMT33fK3 X-Received: by 2002:a17:902:7d83:: with SMTP id a3mr101714464plm.305.1558639297497; Thu, 23 May 2019 12:21:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558639297; cv=none; d=google.com; s=arc-20160816; b=qC8UcQx1NzAWnl+Dh654MQXUQeNugyzok0d9Q4xizRZ7KW5pHp0ppkQ6V75MXC0Bmm iI4mw91CZMB/DgHBOkjNBzJ9Nkg5nK2LFAPLOU8kIKpIEUD6loxlOAo3EMj1wLoIH3YT +3aMdwLnnN/bFv6Qc98LJn8QNGz3ui3QKFqmPbm8KKaUhEwogl+WrfPU1MTBrCLB3uiQ V9JEzvumNKaxBTp9seJcwrEpyGBWOgX8mQgJUoCSQyn99w1uvtdyPU+qSriwVTJfE8BZ jEFyGzlJpMdhLudFCf62ZNap6F605NJN8F561y6hExrdkNcskVETqNc4KlywjaerUphJ Dhvw== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KEVtfQ2jsJB44mlpJnX7tOxN1Z5OXLllYNaE7aqT4pU=; b=zQ6sztp8QczHztHzDQJNTkIfBC8CBnlc73yVx5b+iiMD8iXH/7rI2Nvadx+Oni9OBG LAe253ZWtTpQeN3NCwGnqoSgF7k0c3+TtaNDU7cW0kTa/KukvcmMB+8dVe/rH8HLz9Q2 YGFe9r9uA1NYNoxY0mkRdX3uEOjOghhjEIz9Jc07uHBGBaA65+UW5q0IHrA1dWss6e8I dHRrFL+ZVWSgoEsQzKvxZZ1+ZIpQOV2vx/D//sTaWVFzAd17YXUm2NlvFQQXFOud4IKd Z9fh0h6meOUq6au3Kerha+pp4HAy/2F3VIvRQYxZrBD0BEmLjblA95Fwf26A62/f9Xof 8/kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vRqZ8KPI; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 a33si601445plc.283.2019.05.23.12.21.37; Thu, 23 May 2019 12:21:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b=vRqZ8KPI; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389923AbfEWTVg (ORCPT + 14 others); Thu, 23 May 2019 15:21:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:58968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390290AbfEWTVd (ORCPT ); Thu, 23 May 2019 15:21:33 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ACACF20863; Thu, 23 May 2019 19:21:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558639293; bh=HiFtAIKrl+Yj/b7btEiQx9X+/cf8POcNBsL9C668gKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vRqZ8KPIOWKOwGzI8nAWoepsHZ+j/K4g9QIdG5Lx4wR8uQwxLxPd3Ao+J7UAsJHfg keJ0xBQ5NSt0lEfm23EyYfR1qWOfXDsTd/xns9stDwawjNAJEe/suZmQk3NYjbmtiB F7uzGUTx7Vcrhju0E4DI/KwR7BvEU89K1xBt/xX8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhong Kaihua , John Stultz , Zhangfei Gao , Dong Zhang , Leo Yan , Stephen Boyd Subject: [PATCH 5.0 051/139] clk: hi3660: Mark clk_gate_ufs_subsys as critical Date: Thu, 23 May 2019 21:05:39 +0200 Message-Id: <20190523181727.303517530@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181720.120897565@linuxfoundation.org> References: <20190523181720.120897565@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Leo Yan commit 9f77a60669d13ed4ddfa6cd7374c9d88da378ffa upstream. clk_gate_ufs_subsys is a system bus clock, turning off it will introduce lockup issue during system suspend flow. Let's mark clk_gate_ufs_subsys as critical clock, thus keeps it on during system suspend and resume. Fixes: d374e6fd5088 ("clk: hisilicon: Add clock driver for hi3660 SoC") Cc: stable@vger.kernel.org Cc: Zhong Kaihua Cc: John Stultz Cc: Zhangfei Gao Suggested-by: Dong Zhang Signed-off-by: Leo Yan Signed-off-by: Stephen Boyd Signed-off-by: Greg Kroah-Hartman --- drivers/clk/hisilicon/clk-hi3660.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/clk/hisilicon/clk-hi3660.c +++ b/drivers/clk/hisilicon/clk-hi3660.c @@ -163,8 +163,12 @@ static const struct hisi_gate_clock hi36 "clk_isp_snclk_mux", CLK_SET_RATE_PARENT, 0x50, 17, 0, }, { HI3660_CLK_GATE_ISP_SNCLK2, "clk_gate_isp_snclk2", "clk_isp_snclk_mux", CLK_SET_RATE_PARENT, 0x50, 18, 0, }, + /* + * clk_gate_ufs_subsys is a system bus clock, mark it as critical + * clock and keep it on for system suspend and resume. + */ { HI3660_CLK_GATE_UFS_SUBSYS, "clk_gate_ufs_subsys", "clk_div_sysbus", - CLK_SET_RATE_PARENT, 0x50, 21, 0, }, + CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, 0x50, 21, 0, }, { HI3660_PCLK_GATE_DSI0, "pclk_gate_dsi0", "clk_div_cfgbus", CLK_SET_RATE_PARENT, 0x50, 28, 0, }, { HI3660_PCLK_GATE_DSI1, "pclk_gate_dsi1", "clk_div_cfgbus", From patchwork Thu May 23 19:06:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 165062 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2632539ili; Thu, 23 May 2019 12:38:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6nhuJL9f4ED9H1B++PPN60dQPSWSmkV2yaSfbN17Q4vod103kK/ElAKlMEz7B4nGA0hJj X-Received: by 2002:a63:8dc9:: with SMTP id z192mr54587140pgd.6.1558640300163; Thu, 23 May 2019 12:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558640300; cv=none; d=google.com; s=arc-20160816; b=NnOePq/5LiI5BsqJbjQenMgWTvHLAKfVQ1IfuHE4/K+lwbKHbbDkrIyjLsIYNpQI6h 7kzHi052Oy6oY6+9PBTO3vcuEVzAL22ViEzvxksejqBtdzvidwvDgpU6LpwaGNB8mftg Ms/RoOgyQFdcoWTdrkaGVnOnLK/YKM3r3HwaApwmzS1IMi7iqU7t1B1d8jceothAAg6E /luFmwMj2ajRZBW2TaJpadR+F8jzN7rxPnOHR7yempAXtpvM7spNtfBkUyQfhZhZddyz zCReh6SFiNYnJbCwvOQevTmU8v6yl5FGpU8/SCiZJkJ4gSH/Q1Bh10jkopc9Uqs5zORB bbbg== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lRqkBUqu5IDPL1mH/DqJlmad9bbm3eTPUBXnW7/rUiU=; b=B6UmH1ByY5JzKPxxrD27Pa2nqNSdkaq2geTvh54uvt9B5flAFBgMdCGhXlP+5nNF00 OP6ZxDa8xg96Ci/BgVBXAhqZIJqcqFH1Ig54WLvilK/CyZWKEx5floidycbGnpH2ArXE 2ldrH/rGaHjJUI5TGns4tIHFqZC1qNq4EgTCFMTn7gmQD7pBnphjEmISm2TZERoAMgED 8xTke6zf9wmNmnVKgBPKlE9DgAiBE4WS1Y2CAKrOkWO2zEzKxRtUSsLhLbtiCEnR1Nsb HvGopXAvyPOk1aG66ETxINwBG93K/vic3F12LgynF0p2skEPX4oiiSBNksU2C0oUKx/N t+8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Hb+8msRb; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 33si648403pgp.199.2019.05.23.12.38.19; Thu, 23 May 2019 12:38:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b=Hb+8msRb; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390905AbfEWTiT (ORCPT + 14 others); Thu, 23 May 2019 15:38:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:33760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390689AbfEWTXY (ORCPT ); Thu, 23 May 2019 15:23:24 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C78DB2133D; Thu, 23 May 2019 19:23:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558639403; bh=OGUu2Sgn161BC2t3viF5PL0nsPJFqDhoMlU0WpAaogM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hb+8msRb3vaKvREwcdjpzVP7jZt5fWFbuZyxaL1gnc5igJTDgDWHGfUzwosFna/Bz KVSQGbatpXItnP8U0Iawz7UCUz3NQLZgtTRDPHeibBSoZ/PQXHJ6l4CRC0ctVqZ2+E lIPxEP1W6D/MJ2LsIElVV35Va1plIAMNbnnEecZ8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Hilliard , Ard Biesheuvel , Borislav Petkov , James Morse , Linus Torvalds , Matt Fleming , Peter Jones , Peter Zijlstra , Thomas Gleixner , linux-efi@vger.kernel.org, Ingo Molnar Subject: [PATCH 5.0 076/139] fbdev/efifb: Ignore framebuffer memmap entries that lack any memory types Date: Thu, 23 May 2019 21:06:04 +0200 Message-Id: <20190523181730.726918040@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181720.120897565@linuxfoundation.org> References: <20190523181720.120897565@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ard Biesheuvel commit f8585539df0a1527c78b5d760665c89fe1c105a9 upstream. The following commit: 38ac0287b7f4 ("fbdev/efifb: Honour UEFI memory map attributes when mapping the FB") updated the EFI framebuffer code to use memory mappings for the linear framebuffer that are permitted by the memory attributes described by the EFI memory map for the particular region, if the framebuffer happens to be covered by the EFI memory map (which is typically only the case for framebuffers in shared memory). This is required since non-x86 systems may require cacheable attributes for memory mappings that are shared with other masters (such as GPUs), and this information cannot be described by the Graphics Output Protocol (GOP) EFI protocol itself, and so we rely on the EFI memory map for this. As reported by James, this breaks some x86 systems: [ 1.173368] efifb: probing for efifb [ 1.173386] efifb: abort, cannot remap video memory 0x1d5000 @ 0xcf800000 [ 1.173395] Trying to free nonexistent resource <00000000cf800000-00000000cf9d4bff> [ 1.173413] efi-framebuffer: probe of efi-framebuffer.0 failed with error -5 The problem turns out to be that the memory map entry that describes the framebuffer has no memory attributes listed at all, and so we end up with a mem_flags value of 0x0. So work around this by ensuring that the memory map entry's attribute field has a sane value before using it to mask the set of usable attributes. Reported-by: James Hilliard Tested-by: James Hilliard Signed-off-by: Ard Biesheuvel Cc: # v4.19+ Cc: Borislav Petkov Cc: James Morse Cc: Linus Torvalds Cc: Matt Fleming Cc: Peter Jones Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Fixes: 38ac0287b7f4 ("fbdev/efifb: Honour UEFI memory map attributes when ...") Link: http://lkml.kernel.org/r/20190516213159.3530-2-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- drivers/video/fbdev/efifb.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -476,8 +476,12 @@ static int efifb_probe(struct platform_d * If the UEFI memory map covers the efifb region, we may only * remap it using the attributes the memory map prescribes. */ - mem_flags |= EFI_MEMORY_WT | EFI_MEMORY_WB; - mem_flags &= md.attribute; + md.attribute &= EFI_MEMORY_UC | EFI_MEMORY_WC | + EFI_MEMORY_WT | EFI_MEMORY_WB; + if (md.attribute) { + mem_flags |= EFI_MEMORY_WT | EFI_MEMORY_WB; + mem_flags &= md.attribute; + } } if (mem_flags & EFI_MEMORY_WC) info->screen_base = ioremap_wc(efifb_fix.smem_start,