From patchwork Tue Jul 31 13:02:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 143183 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5305526ljj; Tue, 31 Jul 2018 06:02:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc2c09mGM5M4DXVsiMlVzAiunV2DKx/kd7zG925yN4sny+PWCQ5e3CNAgHhXlSc9HSDGAah X-Received: by 2002:a63:d704:: with SMTP id d4-v6mr20423554pgg.312.1533042149682; Tue, 31 Jul 2018 06:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533042149; cv=none; d=google.com; s=arc-20160816; b=mvRye5Nf3tVOIBz7ib0zPFYT70xfF0TSbeAQHS26YP1pyy7WpyXK7ua8m69L8whJjd cWbbfgauJt9fbBi4DrSNtzK/Dqfz84o5e7+p2FMWTmLvwTDUakD9lwE0IGWbKMUwVt2c l8dJ9U1vW+rFa3vSpV44CqwIcU5trGFceIta4R0YYzIPd5xe6ef4zdiq9ynVkY8WFVG8 F5+RTVL0eabt15W35i2DgxRNAPgfPRi5ivfn+VIcY4tQAOVEXpJ8Vt81P/idjU1oYv5H ANagQ9lGvhSCxhygye60JR1YNXzIlQ5RvRp6JjUbsw3p6jDE1V+mgR+GhvOJiOzl6Thk fx5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=KLVRiVka3xPJAFL9cc5hyTRA6PYA8JSGZz58zSHFrCw=; b=yMj6J9n7oO+3U1Gpkhuo22rdk390XfVWuroa4ymYTM8qxB6If2qCCzjyFczXh6y+kg vC01MlTA7zGAjA4BaOoGaBXJltFzAXTwvunqAQKEC+HyeAt1hB0rGA7YPYaBAH6+MHxm hObYiZJGS1vlJtGuxQonZOBGfqI7NSFL9RafIVbCnO15EKvz3UmJURyWT6F/yoIPEpWM eyFaMoD6t5Rjnus7PF7X0SHQYQiB1M3kIsYyDjYk/FQVMfUY4dzNDQGOEpa1rkQB9nmJ FspBsx9pocXmJ64y6ZsHGSBIxwqHqTbLUu4KHEgz/F7NKYrPkuH2nz4QAjyUmzgAPKxq BuAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dD2WK6ko; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u35-v6si13052722pgl.237.2018.07.31.06.02.29; Tue, 31 Jul 2018 06:02:29 -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=@linaro.org header.s=google header.b=dD2WK6ko; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732024AbeGaOmm (ORCPT + 13 others); Tue, 31 Jul 2018 10:42:42 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33653 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731962AbeGaOmm (ORCPT ); Tue, 31 Jul 2018 10:42:42 -0400 Received: by mail-pg1-f194.google.com with SMTP id r5-v6so9055454pgv.0 for ; Tue, 31 Jul 2018 06:02:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=KLVRiVka3xPJAFL9cc5hyTRA6PYA8JSGZz58zSHFrCw=; b=dD2WK6koP4D9OwXP2oukEGZZ+al/i3FR1TPBLK4o1D0AmpH+0d2/YBAXSOxBZV8lB5 ji1ACciCHIafL2D7xpdFU/LyPozbTgQr25GRQs8z0nDiwwTwrXUwibAiW2429MPOOWdf UQxGBuiCyvD59xuzvc2D8WfxXB/egBocdjJ98= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KLVRiVka3xPJAFL9cc5hyTRA6PYA8JSGZz58zSHFrCw=; b=Vz8KN75u1hkWOv2/JGIRE15uBvlPjaiKiDmxNWcJapp38izfyDq6LQWzb5kk0Eqs2G CirrWR1ZrPnnoiSFW2cQN1i7gv+nJnrtFwodMm2DaR/lqS070gEx252FFDSSkIkaYQL+ 4a5aA9+b0cN1lNFRNcBDBitRGfZvTekX0SYyS/ow8yLDf+vfKF/6bKQqa1TPt9vUqeUV JjMrJEUSysYgTrAIKA4Ujf2gnX/cJuE616aeoWsMk1iRnWJtYom8tO9aALfzU3PUDxN3 If2Qxl+kcsyP2eYyuOnyZWfhqv9sTjJOCAVy+DkTt4tnHXRddwhagAtloPTqdK6GeS6Q TXhA== X-Gm-Message-State: AOUpUlEwb2YzndGO8l37yja23mTbmkN9kSqqubqxYiCFPVklT2oqJFtU mKkYkG2avytU2rPMcdIgqmiN1FuTBvQ= X-Received: by 2002:a65:40ca:: with SMTP id u10-v6mr19854690pgp.2.1533042147200; Tue, 31 Jul 2018 06:02:27 -0700 (PDT) Received: from localhost.localdomain ([106.51.18.123]) by smtp.gmail.com with ESMTPSA id f23-v6sm23048473pgl.5.2018.07.31.06.02.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Jul 2018 06:02:25 -0700 (PDT) From: Amit Pundir To: Greg KH , Stable Cc: Fabio Estevam , Boris Brezillon Subject: [PATCH for-4.14.y 1/5] mtd: nand: qcom: Add a NULL check for devm_kasprintf() Date: Tue, 31 Jul 2018 18:32:17 +0530 Message-Id: <1533042142-8681-1-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Fabio Estevam commit 069f05346d01e7298939f16533953cdf52370be3 upstream. devm_kasprintf() may fail, so we should better add a NULL check and propagate an error on failure. Signed-off-by: Fabio Estevam Signed-off-by: Boris Brezillon Signed-off-by: Amit Pundir --- Cherry-picked from lede tree https://git.lede-project.org/?p=source.git Please apply it on 4.9.y as well. Not applicable for 4.4.y and 3.18.y drivers/mtd/nand/qcom_nandc.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.7.4 diff --git a/drivers/mtd/nand/qcom_nandc.c b/drivers/mtd/nand/qcom_nandc.c index 3baddfc997d1..b49ca02b399d 100644 --- a/drivers/mtd/nand/qcom_nandc.c +++ b/drivers/mtd/nand/qcom_nandc.c @@ -2544,6 +2544,9 @@ static int qcom_nand_host_init(struct qcom_nand_controller *nandc, nand_set_flash_node(chip, dn); mtd->name = devm_kasprintf(dev, GFP_KERNEL, "qcom_nand.%d", host->cs); + if (!mtd->name) + return -ENOMEM; + mtd->owner = THIS_MODULE; mtd->dev.parent = dev; From patchwork Tue Jul 31 13:02:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 143184 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5305615ljj; Tue, 31 Jul 2018 06:02:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcAuqFKwAknzNoe9pYKaTsZiM7mmX6p1YtYD/tDk7JG2rvgmTpr9YoZ+PO+WLx2Cn59Vc60 X-Received: by 2002:a65:5106:: with SMTP id f6-v6mr20113575pgq.72.1533042152635; Tue, 31 Jul 2018 06:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533042152; cv=none; d=google.com; s=arc-20160816; b=poDJJYlzFykscWUQMtJPixkBXfxrTun1HY39FUlqaiccclPCb8jG75p2qDOY6ac8Qz cNwjlsZmuSxwp5qeQWGDbn7SCresO8k345XdSTfGaL5+Vo/jlC8rSogGZ8NrOiHXz57+ NkIrRfQcckqQDwboQXWb3d2jDozdkgL/H6VeaILYnPoxsGKZhSmi+X/dwFDUYlnhGRdi nADhjnWgM85chDLb4W0jc5cu/8W3VRr7TgjlNAQeGtMfB00F1jqtiOuIaa4IJ5xwAVgN Vg4ps+NRGdrCCB98glZ5BDMmoIeq+40jgUO3CFgBlac+MWXM5p3i1XQtbizwIEYpu9Sw gFog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=KpyOQJ7ztep8OwyTLvj+iU1mrJk2OPG4g/+gD6L0wrA=; b=eKnn4pMzy3XLY2cHHIujnzVGWu/yYH0Zhxdufr13HnqsYydHLupoCTSE1vBJcFpbz6 Iwe/OMBFD82Ki8GadchZjpkTGAp8llYfIvdkETVQZEU95gqfXLNGz0vQBhX4ZlSX7HmR jAZUvW5znATYKc0Tpf7YLD6NoikK6YoP8TZ0cvGcvitX/9qKWZY1KnweuX9XTt00WZAb ei791m50Jrr3g62tHo4InDDJSALfsrikkzAZbPiwMVWs+cjOFCu15ekoCMql/qcCPl7V LqbIPkI9oQ+g8grxn8n2WxD39+AwK+FJrUnJfxrdPTUlpoQb3mm6QzsVxZPXGI2GOvya neUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="M/xiTx9z"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u35-v6si13052722pgl.237.2018.07.31.06.02.32; Tue, 31 Jul 2018 06:02:32 -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=@linaro.org header.s=google header.b="M/xiTx9z"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732144AbeGaOmp (ORCPT + 13 others); Tue, 31 Jul 2018 10:42:45 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33659 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731962AbeGaOmp (ORCPT ); Tue, 31 Jul 2018 10:42:45 -0400 Received: by mail-pg1-f194.google.com with SMTP id r5-v6so9055548pgv.0 for ; Tue, 31 Jul 2018 06:02:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KpyOQJ7ztep8OwyTLvj+iU1mrJk2OPG4g/+gD6L0wrA=; b=M/xiTx9zaCAItsd5gUIw3elL+JJI8Y+YRc5ELHdLF5jdV0geudNW3FxUuoBWnbLoxN T02VrtglK6zUCGTNM58IQoKvXu79PZBIeWxQT+xc7unUh22PNCvvhlN3yq0N0rq5ApCz QjHuMI9I4ru/TARDJOFvO0gPMjwFMUpsNmPjs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KpyOQJ7ztep8OwyTLvj+iU1mrJk2OPG4g/+gD6L0wrA=; b=nYNnsiB/kK18NtDNPBINTFPuK9NywCFB+kcBAyYuelaQJTWlLeCIHNAuXRxbPL1h6z 3jMfxZ/+0YlzOFFJUDfpO/T17/s6riQmZqzq2dYKsc6fOSE9ZaMBHIJOLNu74WZMVC4H 2ApsDk9M4HZ8Bgl1jD+J/awNLJQgMVc28NpLDMcMyLdPfXlq+BfImKnMkPrUPcswNHdH IscagP5LJDdSZxfyJ16SGj9cg2zmAh32vcqAe9lLODb6AyYzkiT5oqdluKcxRbps0xh/ pgMVTaH9ivP2DtBsJ5jEzNWbSEbjVGXYC/yER7ObJwz08fjfF0MsV01pieXzd/8Ezve7 /VZQ== X-Gm-Message-State: AOUpUlGC6dkh4IrYj0ngKGWSz/7XXSTvaynotWBjFbUT+fu3ntJQ5lGh rx2zsHLE8zUFZEDqjyMKe8I4wQ== X-Received: by 2002:a62:f909:: with SMTP id o9-v6mr22279881pfh.141.1533042149917; Tue, 31 Jul 2018 06:02:29 -0700 (PDT) Received: from localhost.localdomain ([106.51.18.123]) by smtp.gmail.com with ESMTPSA id f23-v6sm23048473pgl.5.2018.07.31.06.02.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Jul 2018 06:02:28 -0700 (PDT) From: Amit Pundir To: Greg KH , Stable Cc: Chunfeng Yun , Kishon Vijay Abraham I Subject: [PATCH for-4.14.y 2/5] phy: phy-mtk-tphy: use auto instead of force to bypass utmi signals Date: Tue, 31 Jul 2018 18:32:18 +0530 Message-Id: <1533042142-8681-2-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533042142-8681-1-git-send-email-amit.pundir@linaro.org> References: <1533042142-8681-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Chunfeng Yun commit 00c0092c5f62147b7d85f0c6f1cf245a0a1ff3b6 upstream. When system is running, if usb2 phy is forced to bypass utmi signals, all PLL will be turned off, and it can't detect device connection anymore, so replace force mode with auto mode which can bypass utmi signals automatically if no device attached for normal flow. But keep the force mode to fix RX sensitivity degradation issue. Signed-off-by: Chunfeng Yun Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Amit Pundir --- Cherry-picked from lede tree https://git.lede-project.org/?p=source.git Not applicable for 4.9.y, 4.4.y and 3.18.y drivers/phy/mediatek/phy-mtk-tphy.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) -- 2.7.4 diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c index 721a2a1c97ef..a63bba12aee4 100644 --- a/drivers/phy/mediatek/phy-mtk-tphy.c +++ b/drivers/phy/mediatek/phy-mtk-tphy.c @@ -438,9 +438,9 @@ static void u2_phy_instance_init(struct mtk_tphy *tphy, u32 index = instance->index; u32 tmp; - /* switch to USB function. (system register, force ip into usb mode) */ + /* switch to USB function, and enable usb pll */ tmp = readl(com + U3P_U2PHYDTM0); - tmp &= ~P2C_FORCE_UART_EN; + tmp &= ~(P2C_FORCE_UART_EN | P2C_FORCE_SUSPENDM); tmp |= P2C_RG_XCVRSEL_VAL(1) | P2C_RG_DATAIN_VAL(0); writel(tmp, com + U3P_U2PHYDTM0); @@ -500,10 +500,8 @@ static void u2_phy_instance_power_on(struct mtk_tphy *tphy, u32 index = instance->index; u32 tmp; - /* (force_suspendm=0) (let suspendm=1, enable usb 480MHz pll) */ tmp = readl(com + U3P_U2PHYDTM0); - tmp &= ~(P2C_FORCE_SUSPENDM | P2C_RG_XCVRSEL); - tmp &= ~(P2C_RG_DATAIN | P2C_DTM0_PART_MASK); + tmp &= ~(P2C_RG_XCVRSEL | P2C_RG_DATAIN | P2C_DTM0_PART_MASK); writel(tmp, com + U3P_U2PHYDTM0); /* OTG Enable */ @@ -538,7 +536,6 @@ static void u2_phy_instance_power_off(struct mtk_tphy *tphy, tmp = readl(com + U3P_U2PHYDTM0); tmp &= ~(P2C_RG_XCVRSEL | P2C_RG_DATAIN); - tmp |= P2C_FORCE_SUSPENDM; writel(tmp, com + U3P_U2PHYDTM0); /* OTG Disable */ @@ -546,18 +543,16 @@ static void u2_phy_instance_power_off(struct mtk_tphy *tphy, tmp &= ~PA6_RG_U2_OTG_VBUSCMP_EN; writel(tmp, com + U3P_USBPHYACR6); - /* let suspendm=0, set utmi into analog power down */ - tmp = readl(com + U3P_U2PHYDTM0); - tmp &= ~P2C_RG_SUSPENDM; - writel(tmp, com + U3P_U2PHYDTM0); - udelay(1); - tmp = readl(com + U3P_U2PHYDTM1); tmp &= ~(P2C_RG_VBUSVALID | P2C_RG_AVALID); tmp |= P2C_RG_SESSEND; writel(tmp, com + U3P_U2PHYDTM1); if (tphy->pdata->avoid_rx_sen_degradation && index) { + tmp = readl(com + U3P_U2PHYDTM0); + tmp &= ~(P2C_RG_SUSPENDM | P2C_FORCE_SUSPENDM); + writel(tmp, com + U3P_U2PHYDTM0); + tmp = readl(com + U3D_U2PHYDCR0); tmp &= ~P2C_RG_SIF_U2PLL_FORCE_ON; writel(tmp, com + U3D_U2PHYDCR0); From patchwork Tue Jul 31 13:02:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 143185 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5305662ljj; Tue, 31 Jul 2018 06:02:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf0jbABr44uCPSkLwUBCMvbb7wdPi9SSANlf1jcT31wREmeTW4mnySjaQfaBUJ+YvMa/QFK X-Received: by 2002:a65:620b:: with SMTP id d11-v6mr20632471pgv.429.1533042155164; Tue, 31 Jul 2018 06:02:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533042155; cv=none; d=google.com; s=arc-20160816; b=lu0h83qIncwNVWJCRx2wDp6ZfL+RQwf25HeWNWcSngwHdt47SwEV0zTxVShtNeO3Lj xOEY5lUCh1sz0CxFpKAuKYOTeCeNLHu3eLjG+cJR7TkK5RbnFXR/kWMDviXJUuvCFOmi nLAAfivrXOyQU7WcDx1Bk9SHMSgwj4aIjNFRzOylSOwzH1oPusqdjebOp+V/Jyay70sa Ym10GWDyNk4oryOv4S2L3oJDDGChB+21OkKEn0Owe6RxppEYPTe+/axNhYijdHrXDGGS Q9F0ULxcXwyEsLSI1LbVoe5Z9U8qImKrCoQLep1xKC3hmlx9HdTyZKDOWdjqpY1k/ZU9 mhYA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=987NmzXJOVTqgVWJb0hdwtteXyJIlYGzfVaZ2wsqqUM=; b=0FlQTidGTxgQKxGSxCcczZzFTOh2zP+SsEoDwN6V+j+IC4kk6N47KC2MO1FLF+9A+D GoqZxIhWAlqWlGCo3OL1yB0+7Y3JMAFqpRSHHiaHeJPT3mCz2LyDzqaM3Lvw27JIlo9W iU1AVjQrUGwiJzdE0SIQHakcDW9ocEs8wf+6YB6EDqzPH5/3mScdt4RyOWSWlloWd6OE HaC7iB6VAR6AQaFASest5YHHgkGRoYZtHIkv8cVjwaGXsf8WxfNxyygvbG7bdV7YGQYA cl7jDdvTkmwSao1HEKtxJNkKL9NB70886Pidus1ZxCOr/hW37pq8rp3kuhhBkARh/248 BLfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cz89+h4z; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u35-v6si13052722pgl.237.2018.07.31.06.02.34; Tue, 31 Jul 2018 06:02:35 -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=@linaro.org header.s=google header.b=cz89+h4z; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732163AbeGaOms (ORCPT + 13 others); Tue, 31 Jul 2018 10:42:48 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:38491 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731962AbeGaOmr (ORCPT ); Tue, 31 Jul 2018 10:42:47 -0400 Received: by mail-pl0-f67.google.com with SMTP id u11-v6so1581745plq.5 for ; Tue, 31 Jul 2018 06:02:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=987NmzXJOVTqgVWJb0hdwtteXyJIlYGzfVaZ2wsqqUM=; b=cz89+h4zi9LiNMHizj85yso2vywqxgSYLgVHqZTYICZRuD/qFHxG+3L+j234QhwfQb GNqsFLTduK+aVTeq4cBJltH5Z34/tpVje8SplnR1Xb/s3pGevzPCugdT3fbZUFLK5CBj /01zxuQNwxv6v/UNtXvAfhVJYw9UJBL9/fFCc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=987NmzXJOVTqgVWJb0hdwtteXyJIlYGzfVaZ2wsqqUM=; b=dTY8pfEC7Jam5azDuyZWG/OkCpQ2ws0gEr4QmXJ/jI88+SkQAbxCBPq/yKXB3HgTrJ aW8Uj76NPSHv3gql75/mKI32rYyvPB/Fc7Bqqs4+OCia5uxwvI9KQ96f4UjmDoszJlVj VXbMJEWHJ1c40RS2qGCDmD8IHe7tey/6EZqXsEvW6FxCuJVSNM8+ukEAjD7b9WOKA4l0 mI1Dw81Hh74Zpol+ZJbMa2jZH1v73sU4pbIz1Kw0W+MrqILfAvT2HRg2k4vj7TSS4WHc o/vaU0qWAawRNhEERPwOZp077glqULScJTS3Nww5Z6gCuS/nn917IkjXeJZLjNI6UyKm 37ug== X-Gm-Message-State: AOUpUlHPLD9OY5ECFfQN79kpEVYeoFS0HqPkk0GhSKXwfxRUa2c0lDau vLGB1vzXI3elEXCld4LgHnmXLK0Q0KY= X-Received: by 2002:a17:902:6105:: with SMTP id t5-v6mr20522265plj.92.1533042152859; Tue, 31 Jul 2018 06:02:32 -0700 (PDT) Received: from localhost.localdomain ([106.51.18.123]) by smtp.gmail.com with ESMTPSA id f23-v6sm23048473pgl.5.2018.07.31.06.02.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Jul 2018 06:02:31 -0700 (PDT) From: Amit Pundir To: Greg KH , Stable Cc: =?utf-8?q?Ronald_Tschal=C3=A4r?= , Marcel Holtmann Subject: [PATCH for-4.14.y 3/5] Bluetooth: hci_ldisc: Allow sleeping while proto locks are held. Date: Tue, 31 Jul 2018 18:32:19 +0530 Message-Id: <1533042142-8681-3-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533042142-8681-1-git-send-email-amit.pundir@linaro.org> References: <1533042142-8681-1-git-send-email-amit.pundir@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ronald Tschalär commit 67d2f8781b9f00d1089aafcfa3dc09fcd0f343e2 upstream. Commit dec2c92880cc5435381d50e3045ef018a762a917 ("Bluetooth: hci_ldisc: Use rwlocking to avoid closing proto races") introduced locks in hci_ldisc that are held while calling the proto functions. These locks are rwlock's, and hence do not allow sleeping while they are held. However, the proto functions that hci_bcm registers use mutexes and hence need to be able to sleep. In more detail: hci_uart_tty_receive() and hci_uart_dequeue() both acquire the rwlock, after which they call proto->recv() and proto->dequeue(), respectively. In the case of hci_bcm these point to bcm_recv() and bcm_dequeue(). The latter both acquire the bcm_device_lock, which is a mutex, so doing so results in a call to might_sleep(). But since we're holding a rwlock in hci_ldisc, that results in the following BUG (this for the dequeue case - a similar one for the receive case is omitted for brevity): BUG: sleeping function called from invalid context at kernel/locking/mutex.c in_atomic(): 1, irqs_disabled(): 0, pid: 7303, name: kworker/7:3 INFO: lockdep is turned off. CPU: 7 PID: 7303 Comm: kworker/7:3 Tainted: G W OE 4.13.2+ #17 Hardware name: Apple Inc. MacBookPro13,3/Mac-A5C67F76ED83108C, BIOS MBP133.8 Workqueue: events hci_uart_write_work [hci_uart] Call Trace: dump_stack+0x8e/0xd6 ___might_sleep+0x164/0x250 __might_sleep+0x4a/0x80 __mutex_lock+0x59/0xa00 ? lock_acquire+0xa3/0x1f0 ? lock_acquire+0xa3/0x1f0 ? hci_uart_write_work+0xd3/0x160 [hci_uart] mutex_lock_nested+0x1b/0x20 ? mutex_lock_nested+0x1b/0x20 bcm_dequeue+0x21/0xc0 [hci_uart] hci_uart_write_work+0xe6/0x160 [hci_uart] process_one_work+0x253/0x6a0 worker_thread+0x4d/0x3b0 kthread+0x133/0x150 We can't replace the mutex in hci_bcm, because there are other calls there that might sleep. Therefore this replaces the rwlock's in hci_ldisc with rw_semaphore's (which allow sleeping). This is a safer approach anyway as it reduces the restrictions on the proto callbacks. Also, because acquiring write-lock is very rare compared to acquiring the read-lock, the percpu variant of rw_semaphore is used. Lastly, because hci_uart_tx_wakeup() may be called from an IRQ context, we can't block (sleep) while trying acquire the read lock there, so we use the trylock variant. Signed-off-by: Ronald Tschalär Reviewed-by: Lukas Wunner Signed-off-by: Marcel Holtmann Signed-off-by: Amit Pundir --- Not applicable for 4.9.y, 4.4.y and 3.18.y drivers/bluetooth/hci_ldisc.c | 38 ++++++++++++++++++++++---------------- drivers/bluetooth/hci_uart.h | 2 +- 2 files changed, 23 insertions(+), 17 deletions(-) -- 2.7.4 diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index 6aef3bde10d7..c823914b3a80 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c @@ -115,12 +115,12 @@ static inline struct sk_buff *hci_uart_dequeue(struct hci_uart *hu) struct sk_buff *skb = hu->tx_skb; if (!skb) { - read_lock(&hu->proto_lock); + percpu_down_read(&hu->proto_lock); if (test_bit(HCI_UART_PROTO_READY, &hu->flags)) skb = hu->proto->dequeue(hu); - read_unlock(&hu->proto_lock); + percpu_up_read(&hu->proto_lock); } else { hu->tx_skb = NULL; } @@ -130,7 +130,14 @@ static inline struct sk_buff *hci_uart_dequeue(struct hci_uart *hu) int hci_uart_tx_wakeup(struct hci_uart *hu) { - read_lock(&hu->proto_lock); + /* This may be called in an IRQ context, so we can't sleep. Therefore + * we try to acquire the lock only, and if that fails we assume the + * tty is being closed because that is the only time the write lock is + * acquired. If, however, at some point in the future the write lock + * is also acquired in other situations, then this must be revisited. + */ + if (!percpu_down_read_trylock(&hu->proto_lock)) + return 0; if (!test_bit(HCI_UART_PROTO_READY, &hu->flags)) goto no_schedule; @@ -145,7 +152,7 @@ int hci_uart_tx_wakeup(struct hci_uart *hu) schedule_work(&hu->write_work); no_schedule: - read_unlock(&hu->proto_lock); + percpu_up_read(&hu->proto_lock); return 0; } @@ -247,12 +254,12 @@ static int hci_uart_flush(struct hci_dev *hdev) tty_ldisc_flush(tty); tty_driver_flush_buffer(tty); - read_lock(&hu->proto_lock); + percpu_down_read(&hu->proto_lock); if (test_bit(HCI_UART_PROTO_READY, &hu->flags)) hu->proto->flush(hu); - read_unlock(&hu->proto_lock); + percpu_up_read(&hu->proto_lock); return 0; } @@ -275,15 +282,15 @@ static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb) BT_DBG("%s: type %d len %d", hdev->name, hci_skb_pkt_type(skb), skb->len); - read_lock(&hu->proto_lock); + percpu_down_read(&hu->proto_lock); if (!test_bit(HCI_UART_PROTO_READY, &hu->flags)) { - read_unlock(&hu->proto_lock); + percpu_up_read(&hu->proto_lock); return -EUNATCH; } hu->proto->enqueue(hu, skb); - read_unlock(&hu->proto_lock); + percpu_up_read(&hu->proto_lock); hci_uart_tx_wakeup(hu); @@ -486,7 +493,7 @@ static int hci_uart_tty_open(struct tty_struct *tty) INIT_WORK(&hu->init_ready, hci_uart_init_work); INIT_WORK(&hu->write_work, hci_uart_write_work); - rwlock_init(&hu->proto_lock); + percpu_init_rwsem(&hu->proto_lock); /* Flush any pending characters in the driver */ tty_driver_flush_buffer(tty); @@ -503,7 +510,6 @@ static void hci_uart_tty_close(struct tty_struct *tty) { struct hci_uart *hu = tty->disc_data; struct hci_dev *hdev; - unsigned long flags; BT_DBG("tty %p", tty); @@ -518,9 +524,9 @@ static void hci_uart_tty_close(struct tty_struct *tty) hci_uart_close(hdev); if (test_bit(HCI_UART_PROTO_READY, &hu->flags)) { - write_lock_irqsave(&hu->proto_lock, flags); + percpu_down_write(&hu->proto_lock); clear_bit(HCI_UART_PROTO_READY, &hu->flags); - write_unlock_irqrestore(&hu->proto_lock, flags); + percpu_up_write(&hu->proto_lock); cancel_work_sync(&hu->write_work); @@ -582,10 +588,10 @@ static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data, if (!hu || tty != hu->tty) return; - read_lock(&hu->proto_lock); + percpu_down_read(&hu->proto_lock); if (!test_bit(HCI_UART_PROTO_READY, &hu->flags)) { - read_unlock(&hu->proto_lock); + percpu_up_read(&hu->proto_lock); return; } @@ -593,7 +599,7 @@ static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data, * tty caller */ hu->proto->recv(hu, data, count); - read_unlock(&hu->proto_lock); + percpu_up_read(&hu->proto_lock); if (hu->hdev) hu->hdev->stat.byte_rx += count; diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h index d9cd95d81149..66e8c68e4607 100644 --- a/drivers/bluetooth/hci_uart.h +++ b/drivers/bluetooth/hci_uart.h @@ -87,7 +87,7 @@ struct hci_uart { struct work_struct write_work; const struct hci_uart_proto *proto; - rwlock_t proto_lock; /* Stop work for proto close */ + struct percpu_rw_semaphore proto_lock; /* Stop work for proto close */ void *priv; struct sk_buff *tx_skb; From patchwork Tue Jul 31 13:02:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 143186 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5305788ljj; Tue, 31 Jul 2018 06:02:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd00nyatd79y70Qkvbo+Ph0vIWefEkg2eRioAX9Zqt+Xw0sRCZo8tHxwXGB10e+kigyytCd X-Received: by 2002:a62:455b:: with SMTP id s88-v6mr22140760pfa.203.1533042159309; Tue, 31 Jul 2018 06:02:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533042159; cv=none; d=google.com; s=arc-20160816; b=H22vKvxyfxTcdwZ0wzpBgaEfE6BG3JDBoYMS5KSDsplcchp3EgV/rrzS+Czto2i0Xm ptHtLnwMn5t0LqJnj0z3KYxBi4C7Y2iC/PkCF5pznTVzPoeFmrXW+GrPemqx3LkhvcAU a2QyYpxIEr8DP0KV1Bm9mjtVTAuijanzH0IzskV5f5GWtZOCur2+ZJmFnllJra7bk4oU V1dSnUKWWUETnf2twrNd93oZgRwMYsurC7js/CYWF+gci4fyr3yQ2E1AMg/U9M2Zmm0T +mNGiVxmug3ay086WSPRr2jsI0vFtVrn9vIyr9AW8qQkLVCDRpv1Id8924G+ShRpiIu0 nmWw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=BLylbrWFPqQ6/45540HtTrWBHCtjOTrCwrf/rexRW/c=; b=eq16K8VTZgmt7080xoCA1kxhCZQrH3ERlkRCHmDyaTL0Uijo879XyyuAqaWt8StgMZ ovRxA/7i/7iN/tIMw8/Tq1evWVKABFSNhToDvaeftgVi6h2Aq/Pu4laAxoVI/q1gkiQq mSG/ZcNEKZZ24iNRU+Nv8/kTr9eiCmnuIu1WOsl/AhUpND/UczzjOukp+mZcalamDqR9 XxkvYfPGw4FBLNEQBxMHY/2tgI6kJkPznLEzHDJvnJLWK8FZv4+XbH+nY0ErISo5jVRQ q47jTLrH0lQMZmc4Ate4vs4V28UTf60kL8JGvhwwcMxfZngmAFAVFpmYGUFbp8o2H8HQ kHbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="S1A/5s42"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u35-v6si13052722pgl.237.2018.07.31.06.02.38; Tue, 31 Jul 2018 06:02:39 -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=@linaro.org header.s=google header.b="S1A/5s42"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732233AbeGaOmw (ORCPT + 13 others); Tue, 31 Jul 2018 10:42:52 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:34170 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731962AbeGaOmv (ORCPT ); Tue, 31 Jul 2018 10:42:51 -0400 Received: by mail-pf1-f196.google.com with SMTP id k19-v6so6080712pfi.1 for ; Tue, 31 Jul 2018 06:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BLylbrWFPqQ6/45540HtTrWBHCtjOTrCwrf/rexRW/c=; b=S1A/5s42f+HuHG2Mzj0mBeV+hawXzC/Ic+/BZyAjFL6wWamv+KwL34R0j63wHro9kk Zjg8+bXcKQvQWh2BFpN/2gqe9+/qbco5bT5vHNyZrVeGbFjTLobQ1MLk902L7A9plPK+ AGt2vdOKgbAyS1bSyOA6fMk2CVhTievbHv4/U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BLylbrWFPqQ6/45540HtTrWBHCtjOTrCwrf/rexRW/c=; b=NQIWkKRbEST2ApNt4IhsGDJocOY06D9hf/32CXu0+Eaawv048SAfRmUCWyaxW2BoTD tu7VlWz9ttnXfeOQBe0+mNICySSBWfIFSje4smDeJHCv+jG2bvi6N6DzFpSgkzgCcyX3 VEkf2FekwjYL0eqJWZ7mdR1VUgFjw17q82BvJyopkr/EhU4KnRTrmnDEgW4Jg9PRA6+I VqfgGr7WweNuAAcYJdtXjDXxDRtmh+fZI8qpvxa5h8YPpxFAxxapAHnIEr2sCvZAN33f 7sgXxACnuSwvHhl40+RR/4oHErf3oSvQDSr/Q2IG2DL1EJvc8vFUlJixI8mx1cNJihBG Et4w== X-Gm-Message-State: AOUpUlE12Gh6hac8qeTF++AqcC1/6xSEp8+XCnvt98SAJ4Z9Ux7AnhA3 2LwH1Xi5ToBMwzHo3/WHj1iKaw== X-Received: by 2002:a63:2013:: with SMTP id g19-v6mr20327938pgg.68.1533042157047; Tue, 31 Jul 2018 06:02:37 -0700 (PDT) Received: from localhost.localdomain ([106.51.18.123]) by smtp.gmail.com with ESMTPSA id f23-v6sm23048473pgl.5.2018.07.31.06.02.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Jul 2018 06:02:35 -0700 (PDT) From: Amit Pundir To: Greg KH , Stable Cc: Lukas Wunner , =?utf-8?q?Ronald_Tschal=C3=A4r?= , Rob Herring , Sumit Semwal , Marcel Holtmann Subject: [PATCH for-4.14.y 4/5] Bluetooth: hci_serdev: Init hci_uart proto_lock to avoid oops Date: Tue, 31 Jul 2018 18:32:20 +0530 Message-Id: <1533042142-8681-4-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533042142-8681-1-git-send-email-amit.pundir@linaro.org> References: <1533042142-8681-1-git-send-email-amit.pundir@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Lukas Wunner commit d73e172816652772114827abaa2dbc053eecbbd7 upstream. John Stultz reports a boot time crash with the HiKey board (which uses hci_serdev) occurring in hci_uart_tx_wakeup(). That function is contained in hci_ldisc.c, but also called from the newer hci_serdev.c. It acquires the proto_lock in struct hci_uart and it turns out that we forgot to init the lock in the serdev code path, thus causing the crash. John bisected the crash to commit 67d2f8781b9f ("Bluetooth: hci_ldisc: Allow sleeping while proto locks are held"), but the issue was present before and the commit merely exposed it. (Perhaps by luck, the crash did not occur with rwlocks.) Init the proto_lock in the serdev code path to avoid the oops. Stack trace for posterity: Unable to handle kernel read from unreadable memory at 406f127000 [000000406f127000] user address but active_mm is swapper Internal error: Oops: 96000005 [#1] PREEMPT SMP Hardware name: HiKey Development Board (DT) Call trace: hci_uart_tx_wakeup+0x38/0x148 hci_uart_send_frame+0x28/0x38 hci_send_frame+0x64/0xc0 hci_cmd_work+0x98/0x110 process_one_work+0x134/0x330 worker_thread+0x130/0x468 kthread+0xf8/0x128 ret_from_fork+0x10/0x18 Link: https://lkml.org/lkml/2017/11/15/908 Reported-and-tested-by: John Stultz Cc: Ronald Tschalär Cc: Rob Herring Cc: Sumit Semwal Signed-off-by: Lukas Wunner Signed-off-by: Marcel Holtmann Signed-off-by: Amit Pundir --- Not applicable for 4.9.y, 4.4.y and 3.18.y drivers/bluetooth/hci_serdev.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 diff --git a/drivers/bluetooth/hci_serdev.c b/drivers/bluetooth/hci_serdev.c index b725ac4f7ff6..52e6d4d1608e 100644 --- a/drivers/bluetooth/hci_serdev.c +++ b/drivers/bluetooth/hci_serdev.c @@ -304,6 +304,7 @@ int hci_uart_register_device(struct hci_uart *hu, hci_set_drvdata(hdev, hu); INIT_WORK(&hu->write_work, hci_uart_write_work); + percpu_init_rwsem(&hu->proto_lock); /* Only when vendor specific setup callback is provided, consider * the manufacturer information valid. This avoids filling in the From patchwork Tue Jul 31 13:02:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 143187 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5305845ljj; Tue, 31 Jul 2018 06:02:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfe0rik6fR40IWrKI1SYw4vSn53FCV9Ln5mfh5Rtk+cimUrt3Dv4qfhsQHEsvfhdF5QPjgK X-Received: by 2002:a17:902:b587:: with SMTP id a7-v6mr16285036pls.19.1533042161687; Tue, 31 Jul 2018 06:02:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533042161; cv=none; d=google.com; s=arc-20160816; b=xcYu8g2LVHWsU9cv8e+XU9h8IkK+DIO+MWYnUHqOtnsPUAHq3o9lqkSfHPIvx7pC5u uf57XxhI8RGGL/PujRxhC+/vcAXqFPi3wZ3HzXW6s0yXSg0XCq449NmUxayGxC1To4hJ E7i0YA2LivYjSqnnKv9lt2LYJW6gPmGkJ1vo+BO5WEqJBTTpJkcYBBMjqBSaD3uotcSS 6iMYTZ2AnuuyFKh3DGVHJfKPuX8aNMR0Vu9Aq79K5pf5dqbPZHftwG+tBIX493Fy15Eg j/L8o3o8KdA9TPnwJXxb1CErS3xWrjgDX3KS9gTB+VGCViOZI+IyMEa1QHo1ZhfBtt/k Rs3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=X5/gn8kB/5/Un1+ulZx0SZsCobLo2fP32iBJp8Ea/7I=; b=GHdqO5yCWoUYLhK6uePDJpIeQnXvaW8L1ddc19xgm4hCdSlTd8Q7zOGbyg/omMyrpN nLgfR0rJRP4FAlhsLsbNmkpIzUBVLFlBb/xylq2IcWxGT/Yg0fOYa5PeyobPRRT42Lpg 5NrYVtgwMdQQmked4lVjsuYgNRcBVl9dy2LytzXwRxtjebSxUs12O51MHNTwKjoUzrLa BNGToVrPiY6PsBn7t43uAzaKkelzXnBe8RfhT67c1dP60vxIahy8mjeqgABLOx+q+0yL +HLIrOCwzLSHSA4xQx+ACjW8uFYH+wT3YF2w5aI/B2HLvDsjqCvvFCDNAeaLull1cSBc YQrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hlkLbPDq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u35-v6si13052722pgl.237.2018.07.31.06.02.41; Tue, 31 Jul 2018 06:02:41 -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=@linaro.org header.s=google header.b=hlkLbPDq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732037AbeGaOmy (ORCPT + 13 others); Tue, 31 Jul 2018 10:42:54 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:46331 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731962AbeGaOmy (ORCPT ); Tue, 31 Jul 2018 10:42:54 -0400 Received: by mail-pl0-f68.google.com with SMTP id t17-v6so7116096ply.13 for ; Tue, 31 Jul 2018 06:02:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=X5/gn8kB/5/Un1+ulZx0SZsCobLo2fP32iBJp8Ea/7I=; b=hlkLbPDqmNJpQgjnu1DfQ3UFtpXOtvAqpJuoZB1q7wiH/GsFmbw7MnT1UXK03kriKJ /708HvuMNZBtBILKkCkFXLr0fr6U9l1zXtKx1iW/1QE2hfqfx5mwuIA6uOG30bQTD+Py 7ne38mhIGX8x4lF9e3A/d/xWW+gzE4WfV4Vr4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=X5/gn8kB/5/Un1+ulZx0SZsCobLo2fP32iBJp8Ea/7I=; b=XT5jNNWxu5Cl2/H0pIVGVKp6Lu4HO8B/uM6eCMVyE1FsayAaDhUBcHNtEQou1OnboH pthflhjmIoqHjssfXA6WuWGA8pbo6ExZ3iOk3ysCy0embTZCR45A9+u73jCXVjopPwuH BUZadOWk9xyZd0GS7I4Y8Q7zW7VV/qV/amX0AoXW8OlnLQhzHXvVc5V6b+3UOAilPIDj 3t2IsqUu1B2HaIs8M7XbZZppH9TnceBorG2NEl5KrVYf6yb1Iu5jXOPyaoaNsH+qVnGO /GX8ydrG6Xpx15cFhw5LL2+pxlnPsNI46mzuHRzWki3xpTPCbiluMtsZ7pKdCxqMz0JM JrhQ== X-Gm-Message-State: AOUpUlGXtXMb46OeI8WPa1JEQBdXG6ETSh4+hVAt3jvcYdet+hSVDmJd Zn/jKpr6parz1T+xkAHuEpVssw== X-Received: by 2002:a17:902:583:: with SMTP id f3-v6mr20493270plf.115.1533042160193; Tue, 31 Jul 2018 06:02:40 -0700 (PDT) Received: from localhost.localdomain ([106.51.18.123]) by smtp.gmail.com with ESMTPSA id f23-v6sm23048473pgl.5.2018.07.31.06.02.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Jul 2018 06:02:38 -0700 (PDT) From: Amit Pundir To: Greg KH , Stable Cc: Oleksij Rempel , Shawn Guo Subject: [PATCH for-4.14.y 5/5] ARM: dts: imx6sx: fix irq for pcie bridge Date: Tue, 31 Jul 2018 18:32:21 +0530 Message-Id: <1533042142-8681-5-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533042142-8681-1-git-send-email-amit.pundir@linaro.org> References: <1533042142-8681-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Oleksij Rempel commit 1bcfe0564044be578841744faea1c2f46adc8178 upstream. Use the correct IRQ line for the MSI controller in the PCIe host controller. Apparently a different IRQ line is used compared to other i.MX6 variants. Without this change MSI IRQs aren't properly propagated to the upstream interrupt controller. Signed-off-by: Oleksij Rempel Reviewed-by: Lucas Stach Fixes: b1d17f68e5c5 ("ARM: dts: imx: add initial imx6sx device tree source") Signed-off-by: Shawn Guo [AmitP: Rebased for Stable] Signed-off-by: Amit Pundir --- Please cherry-pick it on 4.9.y, 4.4.y and 3.18.y as well. arch/arm/boot/dts/imx6sx.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi index 6c7eb54be9e2..d64438bfa68b 100644 --- a/arch/arm/boot/dts/imx6sx.dtsi +++ b/arch/arm/boot/dts/imx6sx.dtsi @@ -1305,7 +1305,7 @@ 0x82000000 0 0x08000000 0x08000000 0 0x00f00000>; bus-range = <0x00 0xff>; num-lanes = <1>; - interrupts = ; + interrupts = ; clocks = <&clks IMX6SX_CLK_PCIE_REF_125M>, <&clks IMX6SX_CLK_PCIE_AXI>, <&clks IMX6SX_CLK_LVDS1_OUT>,