From patchwork Mon Sep 20 16:40:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 514351 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2303002jao; Mon, 20 Sep 2021 11:05:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOKZLFSqkerzdQLjT4cw9ofguLAU6/VP0Dfq6N/WDIJL6UW+O482uOAU0a48O4pWOqpVjs X-Received: by 2002:a05:6e02:1e0d:: with SMTP id g13mr7828943ila.265.1632161150900; Mon, 20 Sep 2021 11:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632161150; cv=none; d=google.com; s=arc-20160816; b=ecH+/9frezw+eUAGz9/55FBqiXuHmb2sBXGMZRnoj2Zp8Ump3M2UZiKlnb5JSsHaAd L0qOZusjZ8NbZycnlX7ZdmXsvwI9k7yLGislWS62R850y8OEIAMICVAGyn+qUhS+N4o7 Ck86Esa6oYrRjIHYrBYlSFXOpiIVq+kEu4UZr3FnNeURYwFIpoH9ebJUHkfUmj9zB4my IZQP7BHITiQ4CYNqakLBkq/zg3h/AaDXCUE60h4NCCsoMxNEP0pIOz6MktIq4YfdTqbz 2EjqgqA9MTESyXlUl1lCFUfiU5Mn9SO+1+4yHN4NAT1TRxtlRTbziPFCwQpZWCW3yMHy C+Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kDTuQA7ks3xmtiPuLNuScHvJHxac63su0nuT1jmi2q8=; b=D6Qq8zCH0cTYwOCkzff3/eoOqvRh8jZbtboUBGgkO9t5CZEneLCvuneWGjHyo64+LO JxtuVmlaNfUMSA4n2E7nIy4KR4isiVTcKc/pChksjL2/1EoURB6rOWivAQaFPjHIGP/K vVe3bFbMOUMhXK0pIzIK7ccuggwfeGlhqexlv1T78/TXiiF0Fnia/UGP5ysSBSMNGwaU G6ofKyhHD/7/u4oQZfYAVzKIYMxsjmf2rcTv3dFiJHM2iUoN5EGgyyBJIRCAqOd1UKKS u1KxhuxO54xmjtoC4Tl1rbmKiyI9cvtqNbnwbIPzCA/XDQWzsS/4Y0r+p9zZCaHstEmR 16Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kmk7rfT6; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n13si13723864ilo.25.2021.09.20.11.05.50; Mon, 20 Sep 2021 11:05:50 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kmk7rfT6; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358382AbhITSGZ (ORCPT + 11 others); Mon, 20 Sep 2021 14:06:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:58224 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356974AbhITSCg (ORCPT ); Mon, 20 Sep 2021 14:02:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8ED2663230; Mon, 20 Sep 2021 17:16:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158189; bh=OtYyeNVEmiHOkCZyO54XEpO15PXrjbdloWEzf05+4KI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kmk7rfT6XpU2pXb3xd6bJ7KNwrX09EZHimVC0X+eQ0et8qN2SBy+7W0NuOr16VCdb PZHcH1sSVWdDEjjlOUKOEd1R1u621n59irHCA929ae+3M04JEiStiamT0McFXUoxNf Cfe2Q9ppazsxEaIkrsqxv/oJ5KgiG9ZIYP7Z36qA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manivannan Sadhasivam , Bjorn Andersson Subject: [PATCH 5.4 014/260] soc: qcom: aoss: Fix the out of bound usage of cooling_devs Date: Mon, 20 Sep 2021 18:40:32 +0200 Message-Id: <20210920163931.606307946@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Manivannan Sadhasivam commit a89f355e469dcda129c2522be4fdba00c1c74c83 upstream. In "qmp_cooling_devices_register", the count value is initially QMP_NUM_COOLING_RESOURCES, which is 2. Based on the initial count value, the memory for cooling_devs is allocated. Then while calling the "qmp_cooling_device_add" function, count value is post-incremented for each child node. This makes the out of bound access to the cooling_dev array. Fix it by passing the QMP_NUM_COOLING_RESOURCES definition to devm_kzalloc() and initializing the count to 0. While at it, let's also free the memory allocated to cooling_dev if no cooling device is found in DT and during unroll phase. Cc: stable@vger.kernel.org # 5.4 Fixes: 05589b30b21a ("soc: qcom: Extend AOSS QMP driver to support resources that are used to wake up the SoC.") Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20210629153249.73428-1-manivannan.sadhasivam@linaro.org Signed-off-by: Bjorn Andersson Signed-off-by: Greg Kroah-Hartman --- drivers/soc/qcom/qcom_aoss.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/soc/qcom/qcom_aoss.c +++ b/drivers/soc/qcom/qcom_aoss.c @@ -472,12 +472,12 @@ static int qmp_cooling_device_add(struct static int qmp_cooling_devices_register(struct qmp *qmp) { struct device_node *np, *child; - int count = QMP_NUM_COOLING_RESOURCES; + int count = 0; int ret; np = qmp->dev->of_node; - qmp->cooling_devs = devm_kcalloc(qmp->dev, count, + qmp->cooling_devs = devm_kcalloc(qmp->dev, QMP_NUM_COOLING_RESOURCES, sizeof(*qmp->cooling_devs), GFP_KERNEL); @@ -493,12 +493,16 @@ static int qmp_cooling_devices_register( goto unroll; } + if (!count) + devm_kfree(qmp->dev, qmp->cooling_devs); + return 0; unroll: while (--count >= 0) thermal_cooling_device_unregister (qmp->cooling_devs[count].cdev); + devm_kfree(qmp->dev, qmp->cooling_devs); return ret; } From patchwork Mon Sep 20 16:42:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 514353 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2312017jao; Mon, 20 Sep 2021 11:16:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxwIdd/Y4nN7pcFFS2Xik1U63WdoLmBkKFPBGNdE+h0eS2Cd4YGdrg5S89uhX5CwRCiNoh X-Received: by 2002:a17:907:7848:: with SMTP id lb8mr29333120ejc.494.1632161762594; Mon, 20 Sep 2021 11:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632161762; cv=none; d=google.com; s=arc-20160816; b=I+eVcFkK9GnVFd+s6xx+x7WRyQWRM373zZOfJNqPuQjOBVHN7dZzttdJ747Rh6LpoJ 7noatm6YmMxN62ZFRtd1a95v3FhnzCbxxbWjBDCT1IWd2Estf2UuBwR67bgRQVc3hP9L Ov6OLkmLHKboDqTzpklVvNwcrhh/oHgQnkWAQMtVe/MGyUmggmzjucQVp0o25ekdTfVi JQQVwNRkcPZTQmDRCN6Wmy/6tTGXe/ge1D9QDmk9uhLmSWnyfzrcQQk7K80yRyxxefVM 7mKZrd6dpgjS/kSjRGY5vDzqCiLcZvCEYYvFjCrRt4XSz9MYjzSgBpy0CshLc62OdGk1 kGXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TWz4dHPcQpUqc3PZJJeZKAXiYwX24a+hvBWNYYAUoaA=; b=T71fhhRzpXGfIcrKIjyEW13WC26lT68OcMb6/dVVTDolHvSQ/U4k5GfPK701cOILCm c9C5Errts550HzTGrc6JsZ/jAfKx/CeoR1Aml3cPs0BOwb7kGTxSsmsuSjy8xkVG3NZM YUaZ1mt9jxQWe9hT00SmsFHpJK7oA1sxqzdNDYj17HpZHxqeBeuidJ2OA9P59M8B2M3+ d+uC73fZ9BuyZRGrDOOAe9jUbDKZxSmn03b9T1LI/HDEy8EP9juHFd8GRxuyZSXK4ux2 ltD1PqTI4mkml5Yrscw4CAhJSUlMgkMsx7a0Np7myzHbR0ZsqlB8VMQsVsiN6L5gtnDu O2Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vcmM5NpU; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n7si16605055ejl.237.2021.09.20.11.16.02; Mon, 20 Sep 2021 11:16:02 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vcmM5NpU; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351194AbhITSPy (ORCPT + 11 others); Mon, 20 Sep 2021 14:15:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:35778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376366AbhITSMJ (ORCPT ); Mon, 20 Sep 2021 14:12:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E346C613D0; Mon, 20 Sep 2021 17:20:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158436; bh=VWA7NHbf1w0hEdSW9ID9USH1LNKqF5N+aY34kK5m2BE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vcmM5NpU3o2nFvKOX/b9r/B4mAluNNQ5xiJOI4Z1FGV17gyNQYLo7F2TtdVVys8w9 KoKiDxYJ9ahvYxfdnDeRFm4c75tv2UiWl2ZgzVppFyZ41so2CYHcX5yp5/+NLag6x7 r+BLDeowJ9eGFlrbFoUYYPpuAorhx6dcks5l1oX0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vinod Koul , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.4 123/260] arm64: dts: qcom: sdm660: use reg value for memory node Date: Mon, 20 Sep 2021 18:42:21 +0200 Message-Id: <20210920163935.301152292@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Vinod Koul [ Upstream commit c81210e38966cfa1c784364e4035081c3227cf5b ] memory node like other node should be node@reg, which is missing in this case, so fix it up arch/arm64/boot/dts/qcom/ipq8074-hk01.dt.yaml: /: memory: False schema does not allow {'device_type': ['memory'], 'reg': [[0, 1073741824, 0, 536870912]]} Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20210308060826.3074234-18-vkoul@kernel.org Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- arch/arm64/boot/dts/qcom/ipq8074-hk01.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.30.2 diff --git a/arch/arm64/boot/dts/qcom/ipq8074-hk01.dts b/arch/arm64/boot/dts/qcom/ipq8074-hk01.dts index 70be3f95209b..830d9f2c1e5f 100644 --- a/arch/arm64/boot/dts/qcom/ipq8074-hk01.dts +++ b/arch/arm64/boot/dts/qcom/ipq8074-hk01.dts @@ -20,7 +20,7 @@ chosen { stdout-path = "serial0"; }; - memory { + memory@40000000 { device_type = "memory"; reg = <0x0 0x40000000 0x0 0x20000000>; }; From patchwork Mon Sep 20 16:42:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 514352 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2308184jao; Mon, 20 Sep 2021 11:11:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3lAMuG6gmXXhcWrqMwb+k/C43JJUORc5y1/3rDsefR1WeB02AjQ2LXLb2sZPieSFc83Ic X-Received: by 2002:a02:cc21:: with SMTP id o1mr17666892jap.110.1632161491490; Mon, 20 Sep 2021 11:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632161491; cv=none; d=google.com; s=arc-20160816; b=ZJEjo4cGuAViWe/5CJ2c3XnLfH1rdMft2W5FihKRTuJCKdoMEF5HfN5/CinsSGwFXz eiH0snbX8DS7C9nfETdC58sfHoYTjM00/Jof9oCc522/fuHqZZjrG6LZA/B2R/wOz8if GVSUTv1mkkoAFRuxQUq6YxY1W+68MuLPCJJzWdRTzPJAevLjJ2/4y2Z5Ln1/NyawU3wF IqNFSd3NTJ+ud5ADxt9jwGCVUkwnNxe1IoT8xgRfOP4gX5GpapMhEdakwYC191IrFn10 wwQooK9rgfNTNpaEbAG75RPPaCGbiBlmVoh+yLCHrK9tJ5Ft7z6fdizN6+rPefT5/0Uj GrFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IJSFF0YryHnbJO95HmNHHUb0FUxYpRksvBV0bpgkCLg=; b=PB5FIbLiOalc080/rkE3J5Boiulfi3VPNq6VyU76qxMOMRdpd5zWrWM+Mb0HdeXEJj 5PPLipmFqZsO0JUwh+w+v/dZeq+iBsb9kCkwc9BhDiRHOXJZ60I1o26NsYE7ubev5GSX 8XtnASwZDWq4dRC/AlGm5VwvP4YumTb4Yyu55QgmUVvLCVcuzJLspPHgCBIF6/y1/5UV IH57QL4mvz9PhF1bvsxNTeeIdDKj/j5MEJjfKZiiRWcdnYqboS17gaSDJvwqkkgoT2OH JD0THP9YUA1+eyQ3r5Z/PvWy4dzH7PunXufW6tnzV9ZI7Uw5ofZ18gyfghtCWTAXW7WR vYwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2novm93n; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m10si2994830ioh.48.2021.09.20.11.11.31; Mon, 20 Sep 2021 11:11:31 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2novm93n; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376528AbhITSMv (ORCPT + 11 others); Mon, 20 Sep 2021 14:12:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:35758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350976AbhITSLy (ORCPT ); Mon, 20 Sep 2021 14:11:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B3B036327B; Mon, 20 Sep 2021 17:20:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158421; bh=8DU1iuGYv74LnsIoiQnBgxC46+p/xTgoTDxSj+Xr8tw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2novm93nW9XM4vOjGRES4QbKNNo2mxh/6/ITPcprR5MkJAAXyUUW3Y/2IfW6mynk2 Xzc/6MiKzsKyE2r8eKIeWiLL8WPVGGdarnkdBOkQZ19/kzfav00Kx0y2dj0mQf4Stu 6W/FvFljNOpJsmJ68XnZuFSFFCu95Sd9k3fRuFgs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Greg Ungerer , Sasha Levin Subject: [PATCH 5.4 147/260] m68knommu: only set CONFIG_ISA_DMA_API for ColdFire sub-arch Date: Mon, 20 Sep 2021 18:42:45 +0200 Message-Id: <20210920163936.109686269@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit db87db65c1059f3be04506d122f8ec9b2fa3b05e ] > Hi Arnd, > > First bad commit (maybe != root cause): > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > head: 2f73937c9aa561e2082839bc1a8efaac75d6e244 > commit: 47fd22f2b84765a2f7e3f150282497b902624547 [4771/5318] cs89x0: rework driver configuration > config: m68k-randconfig-c003-20210804 (attached as .config) > compiler: m68k-linux-gcc (GCC) 10.3.0 > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=47fd22f2b84765a2f7e3f150282497b902624547 > git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > git fetch --no-tags linux-next master > git checkout 47fd22f2b84765a2f7e3f150282497b902624547 > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=m68k > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > > All errors (new ones prefixed by >>): > > In file included from include/linux/kernel.h:19, > from include/linux/list.h:9, > from include/linux/module.h:12, > from drivers/net/ethernet/cirrus/cs89x0.c:51: > drivers/net/ethernet/cirrus/cs89x0.c: In function 'net_open': > drivers/net/ethernet/cirrus/cs89x0.c:897:20: error: implicit declaration of function 'isa_virt_to_bus'; did you mean 'virt_to_bus'? [-Werror=implicit-function-declaration] > 897 | (unsigned long)isa_virt_to_bus(lp->dma_buff)); > | ^~~~~~~~~~~~~~~ > include/linux/printk.h:141:17: note: in definition of macro 'no_printk' > 141 | printk(fmt, ##__VA_ARGS__); \ > | ^~~~~~~~~~~ > drivers/net/ethernet/cirrus/cs89x0.c:86:3: note: in expansion of macro 'pr_debug' > 86 | pr_##level(fmt, ##__VA_ARGS__); \ > | ^~~ > drivers/net/ethernet/cirrus/cs89x0.c:894:3: note: in expansion of macro 'cs89_dbg' > 894 | cs89_dbg(1, debug, "%s: dma %lx %lx\n", > | ^~~~~~~~ > >> drivers/net/ethernet/cirrus/cs89x0.c:914:3: error: implicit declaration of function 'disable_dma'; did you mean 'disable_irq'? [-Werror=implicit-function-declaration] As far as I can tell, this is a bug with the m68kmmu architecture, not with my driver: The CONFIG_ISA_DMA_API option is provided for coldfire, which implements it, but dragonball also sets the option as a side-effect, without actually implementing the interfaces. The patch below should fix it. Signed-off-by: Arnd Bergmann Signed-off-by: Greg Ungerer Signed-off-by: Sasha Levin --- arch/m68k/Kconfig.bus | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.30.2 diff --git a/arch/m68k/Kconfig.bus b/arch/m68k/Kconfig.bus index 9d0a3a23d50e..355c51309ed8 100644 --- a/arch/m68k/Kconfig.bus +++ b/arch/m68k/Kconfig.bus @@ -63,7 +63,7 @@ source "drivers/zorro/Kconfig" endif -if !MMU +if COLDFIRE config ISA_DMA_API def_bool !M5272 From patchwork Mon Sep 20 16:43:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 514354 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2315804jao; Mon, 20 Sep 2021 11:20:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJ51xPJxzM8Sm1pcSgBP3p4LSu1gDOnZyMdSGFucUZs/aqWzsDrK2g7LRTLlP5SNZ7UNVE X-Received: by 2002:a17:906:7fc4:: with SMTP id r4mr31211812ejs.75.1632162021958; Mon, 20 Sep 2021 11:20:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632162021; cv=none; d=google.com; s=arc-20160816; b=ZL7BB/zKQfvlDmhjPPnmfK8lTqZug9Tv7l6+Qfte2bv4PM0gaTdV4HNjHuy6iVZhLa gT0MMuw36fczWqDcgOO3UiU9x8Oe8vd8c44lQDiX4ilP2pdqCdfgcrTZ64gyb+25k4LQ 4FNC84eYsn6COgS/a0mRMnsp3mBePUrgfMUGc8zghRFvmqG9gOpw0uZ+31oaKFVyUtpQ AMXSZuh3e2B46jMHoNiMrhozbi6oIO8kFkU/nj39vxnv/kqxRs27nENNgyQtGBnSuVAE YHCES/b57Nhytp9EMUH+vWiB4jXQaY6xv3ALgsm7LTFOrehX2XDLjRCjnS52Etn1fhm9 SQ8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dXnfEh7ZsgGPGNE3s4YRkCxMgFfs8Mcxcg3okfpUptc=; b=gbHv62vADIioXuh+2P5dEcxlvXsdJ0hpUMge2/N+Pisy/vhMqbK0YPfNWaT312oegi QiDcugbKW1JtsOq6GGQZ9VANpz7TjK6dLKsn2DRVtmOjMQqnYCMipVHwsC39VQzoasrI ivbiw/PXfY+N33u+qH7nSLD4hCLZjYT0DDxooqNKFY26BM/pUnqMnEtIxVLdLt6hXPL1 4VyACF2fqijTt9Y/rnMTKRYIbQKQY4akh4F+ET8/2VZSFXenmzKpVxQ9I10p75NTThK0 t1HmlwvoeBESEoWxWhga4vv5S7D9kQ9JfgnB+cYrseMtYUPgfQGxyEtDMJIlh+p19XiW irZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RklfHSS0; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n7si16605055ejl.237.2021.09.20.11.20.21; Mon, 20 Sep 2021 11:20:21 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RklfHSS0; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377793AbhITSU6 (ORCPT + 11 others); Mon, 20 Sep 2021 14:20:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:40990 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344009AbhITSS5 (ORCPT ); Mon, 20 Sep 2021 14:18:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A6DF9632AB; Mon, 20 Sep 2021 17:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158593; bh=nFgCtX4TUZ4Is7S8X4Jxx5TU8pPnTOTTKO3PHLhqnzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RklfHSS0yBz1QEEi3ZNwrA9Lh9/qWxkf0TOOJjLMee1nR5ai/yxYzNpIwC2/sZw5t u7Z1bozKHIv9YIgoIqKS+rXhVRrpMUUzGzfyAk8hTWFEyP7vRG50ko/xSCGhaPLTL+ kbE+nQVZnXb8fkcC6p4aBiFRnOi3hCGfjHz1i3yo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown , Catalin Marinas Subject: [PATCH 5.4 195/260] arm64/sve: Use correct size when reinitialising SVE state Date: Mon, 20 Sep 2021 18:43:33 +0200 Message-Id: <20210920163937.737954530@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mark Brown commit e35ac9d0b56e9efefaeeb84b635ea26c2839ea86 upstream. When we need a buffer for SVE register state we call sve_alloc() to make sure that one is there. In order to avoid repeated allocations and frees we keep the buffer around unless we change vector length and just memset() it to ensure a clean register state. The function that deals with this takes the task to operate on as an argument, however in the case where we do a memset() we initialise using the SVE state size for the current task rather than the task passed as an argument. This is only an issue in the case where we are setting the register state for a task via ptrace and the task being configured has a different vector length to the task tracing it. In the case where the buffer is larger in the traced process we will leak old state from the traced process to itself, in the case where the buffer is smaller in the traced process we will overflow the buffer and corrupt memory. Fixes: bc0ee4760364 ("arm64/sve: Core task context handling") Cc: # 4.15.x Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210909165356.10675-1-broonie@kernel.org Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/fpsimd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -498,7 +498,7 @@ size_t sve_state_size(struct task_struct void sve_alloc(struct task_struct *task) { if (task->thread.sve_state) { - memset(task->thread.sve_state, 0, sve_state_size(current)); + memset(task->thread.sve_state, 0, sve_state_size(task)); return; } From patchwork Mon Sep 20 16:44:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 514355 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2316410jao; Mon, 20 Sep 2021 11:21:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzD5jbupX+QGx/1P7ok/UrgjqABhKabxqj7qgedWtzXbJG56lgWr+kxYE0Q1Gl31TkpTwtc X-Received: by 2002:aa7:d954:: with SMTP id l20mr30662141eds.149.1632162065749; Mon, 20 Sep 2021 11:21:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632162065; cv=none; d=google.com; s=arc-20160816; b=bQmL05BvZQb8ro8lAg1FyYQO9sMWGGpY8aYfo331x1H3oO2QoIunoiB/Iqqfrh8hh6 sYGfmd6ITC0UBnMnalZ7WB+F3C896RBuXp405CQpklgThv/biYUh1WpfTEGHArrnO+et +9oZ7wJ+6lgQ7vaBr36Udy7lqyW+HPIMg3x2hE77WhgAvFjTgwsgK8d5hUSXEaY2/Xrs nbr6xFvG/iShfrXPPQVlf9YyGybOw4xOBh91Nedl7LtP1Eg9EOIbc25fKN6LwHeFpcVD OxfVK7O6TQ3ms2EGkLfH9r8J+AZRalGp33JVsuPDdHQ3kFXP71daK51XNy7EXmsELFSM StJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TA4X4oEV9w9li6lNgDISeqIO6hIb+xYU2G1kAO7w0tQ=; b=NvWbs+KEUowo+tNPzdAWpJKljE7Yfh6DaLzv8QCmZ/Hr14YbdS4AQD0T2iJW1BS6zv vriVmVmMIXYiEcrt844LBq9u0iBMVYDvXFBa0IXEpsCZ/nMKxp6qdI9ybK43T5t0AwPs kSht0j6XJydFBCL0tdQXH1UjKqDqWbRrqLMDjTszX5vsu0ZlPgyGvOBn2Urd9LZhVl9+ sXJLS9pBtY3jlmr1iPv+x+OcslxVEngknqkcDz4yomIRgR28diUw9xVlQnYWqARSbvIh wBmd5scjKo0sk+9f8YTSIZDMd7yRW9QqrhxyHN8gfB72hPPaOW1naBPl0sz18hDawy2Y pcbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UsPDKIPZ; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n7si16605055ejl.237.2021.09.20.11.21.05; Mon, 20 Sep 2021 11:21:05 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UsPDKIPZ; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378013AbhITSW2 (ORCPT + 11 others); Mon, 20 Sep 2021 14:22:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:40368 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377563AbhITSUT (ORCPT ); Mon, 20 Sep 2021 14:20:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 145BB61A8C; Mon, 20 Sep 2021 17:23:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158606; bh=ZWcDGK7J3ICcqK6E0ld5xmH3Dpj8mEOLl71Gkvr1t7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UsPDKIPZQv2yT2TIuWtkHr6Q6KTxlu4tBRG7a3QYwATu8LfytFElssE7bLXr0vGMH iHOsv+y5qd4RQtB47OMDhNsj4kVM2/calZ6SBYhjIx1zspj5KT8xxDouJ3xbLl1YY+ OC6rnm/TzzUhSgXGsZEX0yGWUgeplPXTjZkgu3/s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, phone-devel@vger.kernel.org, Linus Walleij , Lee Jones , Sasha Levin Subject: [PATCH 5.4 234/260] mfd: db8500-prcmu: Adjust map to reality Date: Mon, 20 Sep 2021 18:44:12 +0200 Message-Id: <20210920163939.073100257@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Walleij [ Upstream commit ec343111c056ec3847800302f6dbc57281f833fa ] These are the actual frequencies reported by the PLL, so let's report these. The roundoffs are inappropriate, we should round to the frequency that the clock will later report. Drop some whitespace at the same time. Cc: phone-devel@vger.kernel.org Signed-off-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/db8500-prcmu.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) -- 2.30.2 diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index dfac6afa82ca..f1f2ad9ff0b3 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -1695,22 +1695,20 @@ static long round_clock_rate(u8 clock, unsigned long rate) } static const unsigned long db8500_armss_freqs[] = { - 200000000, - 400000000, - 800000000, + 199680000, + 399360000, + 798720000, 998400000 }; /* The DB8520 has slightly higher ARMSS max frequency */ static const unsigned long db8520_armss_freqs[] = { - 200000000, - 400000000, - 800000000, + 199680000, + 399360000, + 798720000, 1152000000 }; - - static long round_armss_rate(unsigned long rate) { unsigned long freq = 0; From patchwork Mon Sep 20 16:44:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 514357 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2316534jao; Mon, 20 Sep 2021 11:21:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytip8iZuvAARbNAqNS2OiLNE6eJV2g2FNUmlVUHzf4qwyNvf+vx2zguAxz9iccYY1bSr6Y X-Received: by 2002:a17:906:6403:: with SMTP id d3mr29124714ejm.37.1632162072712; Mon, 20 Sep 2021 11:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632162072; cv=none; d=google.com; s=arc-20160816; b=voz67FdBrmE0KgOyrtEkMxpsoSfWUvz75Tu+GsjeNKMWIxpNIUumMx6eP4un8wlwjv 7IjDnmDRO/BkYM74HejLbCYGrOZJ/KNVn6AxtNoIb7xJV9sBp38KOA7eQEQEE0oN3uQ5 +EDeMW2/Pa+Zro5YsT/0xHTPb9ubFrpNGLQJeZEBoZzbYpki238bEW/sNcbhT62hd9XE 2meeQTznYyqe0gwQotAM3Oiy07CKG5wIYWZo4MFTG/akhvl9LBum6AKAf+tmhCDlWBch UCbmwwCKw8Ve9cfQ/VfD9P5762y0NHtn18WLxMYYZCP/zI4ta1+R5Q6iwZMdR8lji858 hwYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OILVr2lQFGfc8Qq9rdTjT4H34ykPZSRs25yCzeaXNfs=; b=FaJa9j5h2+Kn8+TwPVVdN6YEdny5CblL1mKDQs5b1dXbnWnC/MuF/wcJJFAKY7Zwbp J+MkEgftk/FZbcFlQys7nDhkNYuDLjkoR+xHCcu0zRde+l4e+wxSXYruDmas46RVxOUj XyPI6nX/EVd4+f8ahidZRIJivm1kfl6MpYHuNGnJOPu5gV8a1cjz2kR+cjKkvek2fAxY L4CLm9DOeHpaQkUEXhtIK+tQgYGIJVpOU87F0au6CSeEaxLNIhJhokrETqlrgpU55OIS VsQrNiXgHXM3MR69gaFCnbUMeM2Qn3DE5MXzWzDs7/9HvHKZP0X0ljlkLEQ2CYY8XgP9 K/ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CYBqONid; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n7si16605055ejl.237.2021.09.20.11.21.11; Mon, 20 Sep 2021 11:21:12 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CYBqONid; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348502AbhITSWe (ORCPT + 11 others); Mon, 20 Sep 2021 14:22:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:40362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377691AbhITSUT (ORCPT ); Mon, 20 Sep 2021 14:20:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CD9C461A7C; Mon, 20 Sep 2021 17:23:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158615; bh=rtcvs5HMu9q01rWUoi8xJjRkKkdZQY1gh9P0IvRgNXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CYBqONidH16qa/Jdnt0bs/fgiq0MUXoDs1GcFIk176UfzRapCYyfH3uTfRLGeyBAQ yb0U633Fco2RzvaXRqL5LIKKQ2sp/K7yk2bXYsGEWybyzQq3XzlPOk1b8B5wSEudy5 rsqXQ+KTqYZ6Nry2dloTM00WnAqjdYyQNDXvklxs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masami Hiramatsu , "Steven Rostedt (VMware)" , Sasha Levin Subject: [PATCH 5.4 238/260] tracing/probes: Reject events which have the same name of existing one Date: Mon, 20 Sep 2021 18:44:16 +0200 Message-Id: <20210920163939.220752766@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masami Hiramatsu [ Upstream commit 8e242060c6a4947e8ae7d29794af6a581db08841 ] Since kprobe_events and uprobe_events only check whether the other same-type probe event has the same name or not, if the user gives the same name of the existing tracepoint event (or the other type of probe events), it silently fails to create the tracefs entry (but registered.) as below. /sys/kernel/tracing # ls events/task/task_rename enable filter format hist id trigger /sys/kernel/tracing # echo p:task/task_rename vfs_read >> kprobe_events [ 113.048508] Could not create tracefs 'task_rename' directory /sys/kernel/tracing # cat kprobe_events p:task/task_rename vfs_read To fix this issue, check whether the existing events have the same name or not in trace_probe_register_event_call(). If exists, it rejects to register the new event. Link: https://lkml.kernel.org/r/162936876189.187130.17558311387542061930.stgit@devnote2 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Sasha Levin --- kernel/trace/trace_kprobe.c | 6 +++++- kernel/trace/trace_probe.c | 25 +++++++++++++++++++++++++ kernel/trace/trace_probe.h | 1 + kernel/trace/trace_uprobe.c | 6 +++++- 4 files changed, 36 insertions(+), 2 deletions(-) -- 2.30.2 diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index 233322c77b76..5de084dab4fa 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c @@ -646,7 +646,11 @@ static int register_trace_kprobe(struct trace_kprobe *tk) /* Register new event */ ret = register_kprobe_event(tk); if (ret) { - pr_warn("Failed to register probe event(%d)\n", ret); + if (ret == -EEXIST) { + trace_probe_log_set_index(0); + trace_probe_log_err(0, EVENT_EXIST); + } else + pr_warn("Failed to register probe event(%d)\n", ret); goto end; } diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c index f98d6d94cbbf..23e85cb15134 100644 --- a/kernel/trace/trace_probe.c +++ b/kernel/trace/trace_probe.c @@ -1029,11 +1029,36 @@ error: return ret; } +static struct trace_event_call * +find_trace_event_call(const char *system, const char *event_name) +{ + struct trace_event_call *tp_event; + const char *name; + + list_for_each_entry(tp_event, &ftrace_events, list) { + if (!tp_event->class->system || + strcmp(system, tp_event->class->system)) + continue; + name = trace_event_name(tp_event); + if (!name || strcmp(event_name, name)) + continue; + return tp_event; + } + + return NULL; +} + int trace_probe_register_event_call(struct trace_probe *tp) { struct trace_event_call *call = trace_probe_event_call(tp); int ret; + lockdep_assert_held(&event_mutex); + + if (find_trace_event_call(trace_probe_group_name(tp), + trace_probe_name(tp))) + return -EEXIST; + ret = register_trace_event(&call->event); if (!ret) return -ENODEV; diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h index a0ff9e200ef6..bab9e0dba9af 100644 --- a/kernel/trace/trace_probe.h +++ b/kernel/trace/trace_probe.h @@ -410,6 +410,7 @@ extern int traceprobe_define_arg_fields(struct trace_event_call *event_call, C(NO_EVENT_NAME, "Event name is not specified"), \ C(EVENT_TOO_LONG, "Event name is too long"), \ C(BAD_EVENT_NAME, "Event name must follow the same rules as C identifiers"), \ + C(EVENT_EXIST, "Given group/event name is already used by another event"), \ C(RETVAL_ON_PROBE, "$retval is not available on probe"), \ C(BAD_STACK_NUM, "Invalid stack number"), \ C(BAD_ARG_NUM, "Invalid argument number"), \ diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index 5294843de6ef..b515db036bec 100644 --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c @@ -514,7 +514,11 @@ static int register_trace_uprobe(struct trace_uprobe *tu) ret = register_uprobe_event(tu); if (ret) { - pr_warn("Failed to register probe event(%d)\n", ret); + if (ret == -EEXIST) { + trace_probe_log_set_index(0); + trace_probe_log_err(0, EVENT_EXIST); + } else + pr_warn("Failed to register probe event(%d)\n", ret); goto end; } From patchwork Mon Sep 20 16:44:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 514356 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2316418jao; Mon, 20 Sep 2021 11:21:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytOtB2sh2ci4ACK8p0cgJNtGIvss67SkruVVdUY3CDU0oCzRlJAPUSD4mGR24HbjU7E3En X-Received: by 2002:a05:6402:1011:: with SMTP id c17mr30968567edu.144.1632162066380; Mon, 20 Sep 2021 11:21:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632162066; cv=none; d=google.com; s=arc-20160816; b=O5oA1GFOei+b0xm0RM1sTxZ9WqsuH/q104/H80iHINaWldvjMxlXhE8eCnrxTGtcZd yuAF0pZsCUtGZ3CON44LsdHXmoY3uzfcwK/g96BsKg6+Wvdrzhz0kTW8ys6JiEUIgCYR RFrxMLw/gSXQAUI1p8gl1LD/JtIUhRAN9Lw0teL6YJLyuiaxZo3Y7X81jwfMywzB65nk rxffysLYJUzf1XSbcCeNqpIpgpNRphzNm7Yk23BXVqIO7azM0kdAaFVky7NcaTfq1puz NE5lLy1t9L21D802klWKiJ16xvoJNNsG/sIV8xVJ70WM2ZblpL75OPRh2NCGHdBV4daF vOMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZW3Ro1SAoZW8OlB7As6oM/WacLzZhgl4wwKacOR85h8=; b=gWUbxFdRV56i7WdwkIE68W5vEB5RsaIGb3IIVzqAugvUkxG6q+sCY+eT0Jr2wrymTu Om9TQcFHfX2lQI6QZaYW45wm5S8o7lv2IysAFOcurszZRS8yiNak2MSevO/akEO1nfMz vuA9oUdYk0VpJM5oRKL6f1IuZr0bqbdbTKKEj8woOY7rQDn+LjfATgDpgjdZlgaIqzq3 nMPp56y1c0GAhogMmnV6UI2csaAA5TmscE//tTFdlMDmfZVhVMOUgHUoVqbhBHFwvYZE 5fuC+GkDzGHdub29xn+hhmF6wdCd+RaHBzEH5+TaiH5RFjBJaIyvRnjtWCtxJ0cRL1yE Ynhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KBqrhjHr; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n7si16605055ejl.237.2021.09.20.11.21.05; Mon, 20 Sep 2021 11:21:06 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KBqrhjHr; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376692AbhITSW2 (ORCPT + 11 others); Mon, 20 Sep 2021 14:22:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:40570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377713AbhITSUZ (ORCPT ); Mon, 20 Sep 2021 14:20:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9DE6C632B2; Mon, 20 Sep 2021 17:23:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158626; bh=4D7BOZ3sSydsNKGX4MRKuDj3nyP3kE/+lJpPsxELm9A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KBqrhjHrO9vuNydqYUkqmxu4IkX7yToHLYkEqn6Hc2R1e8kxMUbXY8P8/4TaUTBmr AUgGkaiNQCLTsmcqRGlq4B9LaAkyVDZL6SaCHndBAG2tvv8XSlcKcp07Y3n64pfY5a McD4hB6109CnOV6EdabNyOvI6tgtmXuQL2rBo6Oc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Davide Zini , Paolo Valente , Jens Axboe , Sasha Levin Subject: [PATCH 5.4 242/260] block, bfq: honor already-setup queue merges Date: Mon, 20 Sep 2021 18:44:20 +0200 Message-Id: <20210920163939.350851487@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Paolo Valente [ Upstream commit 2d52c58b9c9bdae0ca3df6a1eab5745ab3f7d80b ] The function bfq_setup_merge prepares the merging between two bfq_queues, say bfqq and new_bfqq. To this goal, it assigns bfqq->new_bfqq = new_bfqq. Then, each time some I/O for bfqq arrives, the process that generated that I/O is disassociated from bfqq and associated with new_bfqq (merging is actually a redirection). In this respect, bfq_setup_merge increases new_bfqq->ref in advance, adding the number of processes that are expected to be associated with new_bfqq. Unfortunately, the stable-merging mechanism interferes with this setup. After bfqq->new_bfqq has been set by bfq_setup_merge, and before all the expected processes have been associated with bfqq->new_bfqq, bfqq may happen to be stably merged with a different queue than the current bfqq->new_bfqq. In this case, bfqq->new_bfqq gets changed. So, some of the processes that have been already accounted for in the ref counter of the previous new_bfqq will not be associated with that queue. This creates an unbalance, because those references will never be decremented. This commit fixes this issue by reestablishing the previous, natural behaviour: once bfqq->new_bfqq has been set, it will not be changed until all expected redirections have occurred. Signed-off-by: Davide Zini Signed-off-by: Paolo Valente Link: https://lore.kernel.org/r/20210802141352.74353-2-paolo.valente@linaro.org Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/bfq-iosched.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) -- 2.30.2 diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 73bffd7af15c..8dee243e639f 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -2523,6 +2523,15 @@ bfq_setup_merge(struct bfq_queue *bfqq, struct bfq_queue *new_bfqq) * are likely to increase the throughput. */ bfqq->new_bfqq = new_bfqq; + /* + * The above assignment schedules the following redirections: + * each time some I/O for bfqq arrives, the process that + * generated that I/O is disassociated from bfqq and + * associated with new_bfqq. Here we increases new_bfqq->ref + * in advance, adding the number of processes that are + * expected to be associated with new_bfqq as they happen to + * issue I/O. + */ new_bfqq->ref += process_refs; return new_bfqq; } @@ -2582,6 +2591,10 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq, { struct bfq_queue *in_service_bfqq, *new_bfqq; + /* if a merge has already been setup, then proceed with that first */ + if (bfqq->new_bfqq) + return bfqq->new_bfqq; + /* * Do not perform queue merging if the device is non * rotational and performs internal queueing. In fact, such a @@ -2636,9 +2649,6 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq, if (bfq_too_late_for_merging(bfqq)) return NULL; - if (bfqq->new_bfqq) - return bfqq->new_bfqq; - if (!io_struct || unlikely(bfqq == &bfqd->oom_bfqq)) return NULL;