From patchwork Wed Sep 18 06:18:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 173951 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2066449ill; Tue, 17 Sep 2019 23:29:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXiMRa/EQTDKcJvw80fOmgf4Lw6e7yuoTlItiswMTMehT9AXuYYJ7KTCs/f/DUwwN/TJ4d X-Received: by 2002:a17:906:ecea:: with SMTP id qt10mr8250922ejb.23.1568788197786; Tue, 17 Sep 2019 23:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568788197; cv=none; d=google.com; s=arc-20160816; b=m08ZInI5waf/xrO77g5qN7Yxi/y+1KbS72hZAQRzTGuwLmNLPEtMYBirDuehYqnmOF o7QjEwQbqTchPgoddvaWIRG6h8J6FzS6/I3pPrUiEdRdx6eGqzDVrEnIhmHadwnAMjXY 1rvVqdXlx3sZXS9GEPtKFk9O3KGOgbDAxQk3mgE0p4cxPr+Y/I/sWWZvIHePwgTjJHcp YWM12YgkCPQZuNjC5D0Jj5W0Gd6tzuLeItj8H/vQEsrgvnyrObJYFKLPti++saBTOnjw GdRk8LY7jbf3Wz/lDYET7Gobj+xkZkTiH0nCR5caXfbdXdzruiW6mrPVRD6ZYUZKLr00 SBNA== 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=qp0rzK091pZLIVzmkFX8vFmx5GwTwnpG5ES3Qn3Ec/E=; b=STrB8sWzdMtErNcx2j7PL+QuRXdmgdce20OX568u2LlCwxCgQ2ZVattEjw0yJ7uv2b vuLyCdNv9D35HKMlsT/uaE2DhsMIHA++HlYqwOpvSpKf3buwz/5Yk+tnrpSZTSuXMKoa Pz73/BXe5qFc/LcJhnseoyWJnd0uTCNSxNkKe0liWl/MIlUXllScx3zEmR9uK9A/FyGj 4ed7pQeH6J25PfCzwry4YoY5o8zf20ev9x9u4c4lJUuGzQMtirGu+zw6QWzXUz+EMqQZ R2D/haWFukRWdbjW3G6UugQXcl4+jfW65yxQ95II/w7spUcUQaQ/QmvXyJ2hPWrQ9Wl8 nEPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0NFQBDEm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jz5si2219314ejb.119.2019.09.17.23.29.57; Tue, 17 Sep 2019 23:29:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0NFQBDEm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730050AbfIRGZY (ORCPT + 27 others); Wed, 18 Sep 2019 02:25:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:46264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729345AbfIRGZV (ORCPT ); Wed, 18 Sep 2019 02:25:21 -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 58AF821924; Wed, 18 Sep 2019 06:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568787919; bh=7HJG+tyke0aMUoyf9Jd+F8sWEbOTMi+IfHKsAHxKB3w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0NFQBDEmuYAFm3EByUGNC6mET7y5UKh3vxl+Z/qLAXVoWJMiPriOI6/qpPIjoi5TI jIgoIFwgiB0oyAfo6bgrsr6bzAO413mINL/SDyXFyx6IbW/aJtVTJJKF46AHS0v7/G NPe1UcSb0wmVywkCNZgc2zgbz/PflltHAK1DKZvk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ulf Hansson , Geert Uytterhoeven Subject: [PATCH 5.2 31/85] mmc: tmio: Fixup runtime PM management during remove Date: Wed, 18 Sep 2019 08:18:49 +0200 Message-Id: <20190918061235.139292345@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190918061234.107708857@linuxfoundation.org> References: <20190918061234.107708857@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ulf Hansson commit 87b5d602a1cc76169b8d81ec2c74c8d95d9350dc upstream. Accessing the device when it may be runtime suspended is a bug, which is the case in tmio_mmc_host_remove(). Let's fix the behaviour. Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson Tested-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/tmio_mmc_core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1284,12 +1284,11 @@ void tmio_mmc_host_remove(struct tmio_mm struct platform_device *pdev = host->pdev; struct mmc_host *mmc = host->mmc; + pm_runtime_get_sync(&pdev->dev); + if (host->pdata->flags & TMIO_MMC_SDIO_IRQ) sd_ctrl_write16(host, CTL_TRANSACTION_CTL, 0x0000); - if (!host->native_hotplug) - pm_runtime_get_sync(&pdev->dev); - dev_pm_qos_hide_latency_limit(&pdev->dev); mmc_remove_host(mmc); @@ -1298,6 +1297,8 @@ void tmio_mmc_host_remove(struct tmio_mm tmio_mmc_release_dma(host); pm_runtime_dont_use_autosuspend(&pdev->dev); + if (host->native_hotplug) + pm_runtime_put_noidle(&pdev->dev); pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); } From patchwork Wed Sep 18 06:18:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 173949 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2062895ill; Tue, 17 Sep 2019 23:25:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKmuuemZ7IttaA8EdulxxxObLuv1pNCgxq5dFva68p3w8INMIMQQg/4/uTS58Q0eQuBFP1 X-Received: by 2002:a17:906:255b:: with SMTP id j27mr8126878ejb.96.1568787937335; Tue, 17 Sep 2019 23:25:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568787937; cv=none; d=google.com; s=arc-20160816; b=t+SR3aaRuzJY+BVwNkRUr/W6YKzAjYyF6gKKSFAkarNqybDmGXc5mnlXQynRO2RWfh JEM0XuVWXWj1y0wLt5zFJ17WssL5lMY6XldIKzK887M4cyj0VnNUKdZnKwbVCT6kQ1VQ PRpQfOnlgGHUHJM5TnjXo343fq57AWN0xa1VgfDJJIzeRKSFnBA7YPqiL+YgkkM8d3WA 0DI3KGkZqw7yjjIFNlB5Rnf1qH2gwFeZf2N5qUzHrZbaa/CoPFNVjn5KFyJr+fQbpZa8 Bf07AMmfJDnoNJ+L4MBn05mwSiHUE6Xc/DLFRx6dVQVXhZTqaXSwyowMqMKdb4niQzXm hCfQ== 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=Gn3sq8tJGzV+zoHKjGglt6L++4tfyfIu9KiSxosybSI=; b=CYp+iT/W7zE5CiAbiwIi6wBgBLE4Ba+HvQIWx1MUP6aeNOO6PU6WzKI1fe2K2oafHs wQB4ZlBLRyCe2JcGOF+9T3Yos8Qd8pTvJt0utLonotUzjCEhrXsIMsvKDt0JduXqH7fx JB22tnu56161lcC4OpqBtz4vEvFua/jYhgiO1dbkTkttn3mUfaiYaHDMw6t8tB3j7DE7 1heNzWTkTfRHgSUvoN61zcyAtHL6drX9Tv/M/BeRwpWWyP4m6+D+mLlp6K1KCLac82e1 MI0/ZgPy+XGReTEZAz/5z4gTVEiLPZFQjoIufBvIZGa+8t5f0Dv/39VaX/wW1LsHC2UI QtlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ifcxeVZn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12si2548822edq.437.2019.09.17.23.25.37; Tue, 17 Sep 2019 23:25:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ifcxeVZn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730151AbfIRGZf (ORCPT + 27 others); Wed, 18 Sep 2019 02:25:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:46506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727374AbfIRGZa (ORCPT ); Wed, 18 Sep 2019 02:25:30 -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 9836E21924; Wed, 18 Sep 2019 06:25:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568787930; bh=wauRTjmGo+4c67cB3j2p7Ym9wqqe6uvtDzztz9dU+UE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ifcxeVZnhR7JWelXAyZzUTqgjHH+zPH2Fhbum2O7Gqc9vTQ+G/SaGZRmy9uNH8cKe FHPfwhNk+qq+VH7JSQ8L162+6IijnwanJl4s1f9lk2v1AAtfAzfplQwZ6g8rEsxoxC I2u1ApMt/pRBoQ1adsHNnpyU4nYqGT9+X61oGSBU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vincent Chen , Greentime Hu , Yoshinori Sato , Guan Xuetao , Stafford Horne , Jonas Bonn , Stefan Kristiansson , Ley Foon Tan , Richard Kuo , Mark Salter , Aurelien Jacquiot , Guo Ren , Arnd Bergmann Subject: [PATCH 5.2 35/85] ipc: fix semtimedop for generic 32-bit architectures Date: Wed, 18 Sep 2019 08:18:53 +0200 Message-Id: <20190918061235.256229463@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190918061234.107708857@linuxfoundation.org> References: <20190918061234.107708857@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann commit 78e05972c5e6c8e9ca4c00ccc6985409da69f904 upstream. As Vincent noticed, the y2038 conversion of semtimedop in linux-5.1 broke when commit 00bf25d693e7 ("y2038: use time32 syscall names on 32-bit") changed all system calls on all architectures that take a 32-bit time_t to point to the _time32 implementation, but left out semtimedop in the asm-generic header. This affects all 32-bit architectures using asm-generic/unistd.h: h8300, unicore32, openrisc, nios2, hexagon, c6x, arc, nds32 and csky. The notable exception is riscv32, which has dropped support for the time32 system calls entirely. Reported-by: Vincent Chen Cc: stable@vger.kernel.org Cc: Vincent Chen Cc: Greentime Hu Cc: Yoshinori Sato Cc: Guan Xuetao Cc: Stafford Horne Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: Ley Foon Tan Cc: Richard Kuo Cc: Mark Salter Cc: Aurelien Jacquiot Cc: Guo Ren Fixes: 00bf25d693e7 ("y2038: use time32 syscall names on 32-bit") Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- include/uapi/asm-generic/unistd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -569,7 +569,7 @@ __SYSCALL(__NR_semget, sys_semget) __SC_COMP(__NR_semctl, sys_semctl, compat_sys_semctl) #if defined(__ARCH_WANT_TIME32_SYSCALLS) || __BITS_PER_LONG != 32 #define __NR_semtimedop 192 -__SC_COMP(__NR_semtimedop, sys_semtimedop, sys_semtimedop_time32) +__SC_3264(__NR_semtimedop, sys_semtimedop_time32, sys_semtimedop) #endif #define __NR_semop 193 __SYSCALL(__NR_semop, sys_semop) From patchwork Wed Sep 18 06:18:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 173950 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2066363ill; Tue, 17 Sep 2019 23:29:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpcxMlI44JMekVUO1PCgx1c+sfX9KRcQQiCLp4ieZW4iXavO+m4+6j7ncP9iGeXuR7/OwS X-Received: by 2002:a17:907:214e:: with SMTP id rk14mr8173021ejb.60.1568788191587; Tue, 17 Sep 2019 23:29:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568788191; cv=none; d=google.com; s=arc-20160816; b=Zs5fqOr5n23IurCTAmk2PYajZI9Wwh7vBsRGmN62WzQ5/qlysmP8ny4mJutwLbFDW1 5x/etceU/p7VKgfv+x4tME9fS9fWLo0Viv5CKLL6n5u5VZaGrdW5s5krhSB52DEgxz65 LB/n+voomLcq/ONXL8caaBFU6FBfsceZ4rDSXDP1lSXRgfydvOAlVARcqdGkurpL5HWT 8FxzynvehJMOcy7lhiuzdOiHctuMgu/BVAzPwJM5as9y9S6+VNVyc0bVlcXueZMoXKRB +WG4ewJXNsfSNvbg3ExIAE2lhXN19qEsOG4nyk/gePY+kjMJ1pQoHRQPqG6tyM5OIc3A wgUA== 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=N4jWjugfrHetYwyBLmjy0aBZHM6PMPvU0yrYAaV+IYk=; b=WxflQEZKiVGPzvpQh93ktnQEQnnTw3foqBOAQYKVWNoTgSKv7e8GaBqFifiRoaXcfA PxQY0PwO3t05ye5cruRVHeebY8ir+imAmpvIzPeYcvR0QtMSk7LH49v8nZZsDJ0B1Up1 L3jxZNuJ6FYn40efNSSRaE+qqAdjvR4IoOIHMPA2c0yaByunktUVjd4DQdgzBYtK9yi9 0GnhsV5nXsBXd7oKUlgPpV1k6dFx2lo0jokRt6FYKMigdubmTE4VDnVZ56tp5/ElE/i2 4rR7I+cUmI7oXQk1VV9/fJUMUtUb1pbE4AGke+H5X5d/KL6kFdZGcR1naxd6BKLzj+2e oHPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aYdGR7MV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h19si2370497ejd.142.2019.09.17.23.29.51; Tue, 17 Sep 2019 23:29:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aYdGR7MV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730159AbfIRGZj (ORCPT + 27 others); Wed, 18 Sep 2019 02:25:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:46598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727598AbfIRGZd (ORCPT ); Wed, 18 Sep 2019 02:25: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 40F4A21920; Wed, 18 Sep 2019 06:25:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568787932; bh=VuHNiLvCe8DWb60mOj+Qp0dPZ5HLt47rLlkOTRkmYR8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aYdGR7MV0PA9RVTbljLKzcxgtoh+/bifvRA/NHoRq+bsgLFWU6uJgE0WUU2bWgh4+ G6Hw9DJwBbpsGZsschom4t5NdFv0jASrNhMjrgaeovFT6waws70MipKxZmd5A290at r6QrcBkVAD0qTDQNPrb1/Fx9e8GcOHU8EzoGqwEw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matt Turner , Anatoly Pugachev , Arnd Bergmann Subject: [PATCH 5.2 36/85] ipc: fix sparc64 ipc() wrapper Date: Wed, 18 Sep 2019 08:18:54 +0200 Message-Id: <20190918061235.288080697@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190918061234.107708857@linuxfoundation.org> References: <20190918061234.107708857@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann commit fb377eb80c80339b580831a3c0fcce34a4c9d1ad upstream. Matt bisected a sparc64 specific issue with semctl, shmctl and msgctl to a commit from my y2038 series in linux-5.1, as I missed the custom sys_ipc() wrapper that sparc64 uses in place of the generic version that I patched. The problem is that the sys_{sem,shm,msg}ctl() functions in the kernel now do not allow being called with the IPC_64 flag any more, resulting in a -EINVAL error when they don't recognize the command. Instead, the correct way to do this now is to call the internal ksys_old_{sem,shm,msg}ctl() functions to select the API version. As we generally move towards these functions anyway, change all of sparc_ipc() to consistently use those in place of the sys_*() versions, and move the required ksys_*() declarations into linux/syscalls.h The IS_ENABLED(CONFIG_SYSVIPC) check is required to avoid link errors when ipc is disabled. Reported-by: Matt Turner Fixes: 275f22148e87 ("ipc: rename old-style shmctl/semctl/msgctl syscalls") Cc: stable@vger.kernel.org Tested-by: Matt Turner Tested-by: Anatoly Pugachev Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- arch/sparc/kernel/sys_sparc_64.c | 33 ++++++++++++++++++--------------- include/linux/syscalls.h | 19 +++++++++++++++++++ ipc/util.h | 25 ++----------------------- 3 files changed, 39 insertions(+), 38 deletions(-) --- a/arch/sparc/kernel/sys_sparc_64.c +++ b/arch/sparc/kernel/sys_sparc_64.c @@ -336,25 +336,28 @@ SYSCALL_DEFINE6(sparc_ipc, unsigned int, { long err; + if (!IS_ENABLED(CONFIG_SYSVIPC)) + return -ENOSYS; + /* No need for backward compatibility. We can start fresh... */ if (call <= SEMTIMEDOP) { switch (call) { case SEMOP: - err = sys_semtimedop(first, ptr, - (unsigned int)second, NULL); + err = ksys_semtimedop(first, ptr, + (unsigned int)second, NULL); goto out; case SEMTIMEDOP: - err = sys_semtimedop(first, ptr, (unsigned int)second, + err = ksys_semtimedop(first, ptr, (unsigned int)second, (const struct __kernel_timespec __user *) - (unsigned long) fifth); + (unsigned long) fifth); goto out; case SEMGET: - err = sys_semget(first, (int)second, (int)third); + err = ksys_semget(first, (int)second, (int)third); goto out; case SEMCTL: { - err = sys_semctl(first, second, - (int)third | IPC_64, - (unsigned long) ptr); + err = ksys_old_semctl(first, second, + (int)third | IPC_64, + (unsigned long) ptr); goto out; } default: @@ -365,18 +368,18 @@ SYSCALL_DEFINE6(sparc_ipc, unsigned int, if (call <= MSGCTL) { switch (call) { case MSGSND: - err = sys_msgsnd(first, ptr, (size_t)second, + err = ksys_msgsnd(first, ptr, (size_t)second, (int)third); goto out; case MSGRCV: - err = sys_msgrcv(first, ptr, (size_t)second, fifth, + err = ksys_msgrcv(first, ptr, (size_t)second, fifth, (int)third); goto out; case MSGGET: - err = sys_msgget((key_t)first, (int)second); + err = ksys_msgget((key_t)first, (int)second); goto out; case MSGCTL: - err = sys_msgctl(first, (int)second | IPC_64, ptr); + err = ksys_old_msgctl(first, (int)second | IPC_64, ptr); goto out; default: err = -ENOSYS; @@ -396,13 +399,13 @@ SYSCALL_DEFINE6(sparc_ipc, unsigned int, goto out; } case SHMDT: - err = sys_shmdt(ptr); + err = ksys_shmdt(ptr); goto out; case SHMGET: - err = sys_shmget(first, (size_t)second, (int)third); + err = ksys_shmget(first, (size_t)second, (int)third); goto out; case SHMCTL: - err = sys_shmctl(first, (int)second | IPC_64, ptr); + err = ksys_old_shmctl(first, (int)second | IPC_64, ptr); goto out; default: err = -ENOSYS; --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -1397,4 +1397,23 @@ static inline unsigned int ksys_personal return old; } +/* for __ARCH_WANT_SYS_IPC */ +long ksys_semtimedop(int semid, struct sembuf __user *tsops, + unsigned int nsops, + const struct __kernel_timespec __user *timeout); +long ksys_semget(key_t key, int nsems, int semflg); +long ksys_old_semctl(int semid, int semnum, int cmd, unsigned long arg); +long ksys_msgget(key_t key, int msgflg); +long ksys_old_msgctl(int msqid, int cmd, struct msqid_ds __user *buf); +long ksys_msgrcv(int msqid, struct msgbuf __user *msgp, size_t msgsz, + long msgtyp, int msgflg); +long ksys_msgsnd(int msqid, struct msgbuf __user *msgp, size_t msgsz, + int msgflg); +long ksys_shmget(key_t key, size_t size, int shmflg); +long ksys_shmdt(char __user *shmaddr); +long ksys_old_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); +long compat_ksys_semtimedop(int semid, struct sembuf __user *tsems, + unsigned int nsops, + const struct old_timespec32 __user *timeout); + #endif --- a/ipc/util.h +++ b/ipc/util.h @@ -276,29 +276,7 @@ static inline int compat_ipc_parse_versi *cmd &= ~IPC_64; return version; } -#endif - -/* for __ARCH_WANT_SYS_IPC */ -long ksys_semtimedop(int semid, struct sembuf __user *tsops, - unsigned int nsops, - const struct __kernel_timespec __user *timeout); -long ksys_semget(key_t key, int nsems, int semflg); -long ksys_old_semctl(int semid, int semnum, int cmd, unsigned long arg); -long ksys_msgget(key_t key, int msgflg); -long ksys_old_msgctl(int msqid, int cmd, struct msqid_ds __user *buf); -long ksys_msgrcv(int msqid, struct msgbuf __user *msgp, size_t msgsz, - long msgtyp, int msgflg); -long ksys_msgsnd(int msqid, struct msgbuf __user *msgp, size_t msgsz, - int msgflg); -long ksys_shmget(key_t key, size_t size, int shmflg); -long ksys_shmdt(char __user *shmaddr); -long ksys_old_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); -/* for CONFIG_ARCH_WANT_OLD_COMPAT_IPC */ -long compat_ksys_semtimedop(int semid, struct sembuf __user *tsems, - unsigned int nsops, - const struct old_timespec32 __user *timeout); -#ifdef CONFIG_COMPAT long compat_ksys_old_semctl(int semid, int semnum, int cmd, int arg); long compat_ksys_old_msgctl(int msqid, int cmd, void __user *uptr); long compat_ksys_msgrcv(int msqid, compat_uptr_t msgp, compat_ssize_t msgsz, @@ -306,6 +284,7 @@ long compat_ksys_msgrcv(int msqid, compa long compat_ksys_msgsnd(int msqid, compat_uptr_t msgp, compat_ssize_t msgsz, int msgflg); long compat_ksys_old_shmctl(int shmid, int cmd, void __user *uptr); -#endif /* CONFIG_COMPAT */ + +#endif #endif