Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp798580img; Fri, 22 Mar 2019 08:47:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRFd/sUGygnAuQaxmxrG6PbhV+QRxseKhmfyRVQNdDJDVo3NFJeTOFYSGlFWJHttGylBJM X-Received: by 2002:a17:902:694b:: with SMTP id k11mr10456325plt.288.1553269677478; Fri, 22 Mar 2019 08:47:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553269677; cv=none; d=google.com; s=arc-20160816; b=ZC7zAl486Zi4lyisDwud13/I07k8qq1YW33y3diiifFsqSKswCdibZM6RIgjTD6ojR A5xdYKBBQclpqq6x0sEwcHzJa/6j9SzSw+NRJVZeJF+JFa9anABwsKWSGfb//+bfmkTe 5a/fdbTc2QKUuKvmpZda5sahm3MHe0FTR/XD4XgupwfjRiKElkLDnJE9+7XlHwjadGlz WLQoqB/p1RdSW3upa8X/R8URw++ilby7hWE2PUcT3MLv3Z6CXaEHx6nbwYg4Xb12xYQJ wfQnKhOY7waQXmdZSBzbttAi+8kKzonjLyyV5CZikLVNx6+DxixB7fFMJBmUgxL8GhBu sp+Q== 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; bh=t4LrdMcGGiBcX7Q01YJM/2R+cdRqWLXLHLgf8G2RcjM=; b=UAyPX0cWLxAQRuGVEpvPIQ1MIIL271DKIgaWEe2OtmG2gMYITVzTy893uorT8gjkGJ Zx+TQWjsr7VHEVsFJfzm9kVYJNvZz4msO65Oqu3UMCWulbSN3d74EBNLMlZUAGe5TNJk VEzkl++47EWb1sykrR5KiOpqkTwwQEz3Hr7Pyd1PuxTTIHWYCw8oEpSy7ljYaocLMFu5 FeBDeHBv3j2I0OqyBgrbNdYFPwLBN5JCg9Q+fHT1/re2O/2v9G+hTjrPLlOvZueBfCgJ ey6z8uJkr+uoP2QSG62gSlJPZRHOcfzLjJ5TG1CtDJiQe/Vvk6wCXt/oY5XNu8vxCJWH LF8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u14si6936224pgh.561.2019.03.22.08.47.40; Fri, 22 Mar 2019 08:47: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; 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 S1727755AbfCVPql (ORCPT + 99 others); Fri, 22 Mar 2019 11:46:41 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:45691 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727251AbfCVPqk (ORCPT ); Fri, 22 Mar 2019 11:46:40 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1MnpwC-1gfVXC0zBS-00pKgq; Fri, 22 Mar 2019 16:45:08 +0100 From: Arnd Bergmann To: stable@vger.kernel.org, Vinod Koul , Jaroslav Kysela , Takashi Iwai Cc: Ravindra Lokhande , Vinod Koul , Takashi Iwai , Arnd Bergmann , Mark Brown , Srinivas Kandagatla , Joe Perches , Dan Carpenter , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.4.y 02/25] ALSA: compress: add support for 32bit calls in a 64bit kernel Date: Fri, 22 Mar 2019 16:43:53 +0100 Message-Id: <20190322154425.3852517-3-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190322154425.3852517-1-arnd@arndb.de> References: <20190322154425.3852517-1-arnd@arndb.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:qdmoVgn5qRBXiX0rd6Jjr6hDFLSAzZ7K8GEgzOoBTJ7z24e4UWD RjKLEBCA6OW0mDWPPMZuNQ0nofk8g9w/lw97NF0CYfqxbdatuEs1E/WFUeMImyuAmTRweg8 VS7I91GhVWgKkiLqm740IaYAOQU3cFPKM+JkraWNkzIt5H0WbCXp6os0vwagWMGQNljHAdb p/Z2CFCmOWedlw7LF25tQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Ctb8eMkV2xI=:Q7CpqNFjF8sfLZetR/lwPI dIAMil0TxiU1g3D27dOwhRGZ6fHDZRML4J32+m4sRNxFGQWtIQMf96SsXVxx0VuqrGdV3RVBu 3FXGN2+HmJDkSOx/YaAP5tjLVSj1ZWO0YSgFDg/McX61rwyn9XA7YBMv7NVNvLh+ev26NKoff DdLXd6WiT7F2pcs4JPkg/sQNfYM9ej71b7TH26P7CpiR7RSpm6wXDVXmmgYOeb8otUosJOcAF 9TJlnQLIvmBQETigdnHcOePeKKtccrkDWE4qXryEezqE51gFnTZ0WGqPF3xVqK+RtD6FXMOPD QIABs0JOPdNubjvuzSwl46x/VumGHJa8NN35aAHS/lnNAOgTi4fAQ+e0JHRqxnPKQ6p/wqh1V tkAVJOaiMKq0GMr8ZnCfQXqY3vyjqTO8bn/6JhL2qZw47NmgNxf0OMUyigubdBZLQKSTKf4zT UK4wulxOvRCttye8f8O5fNUR8h1Tbb1gVwA+xnwL2PgnYtnRjHY845QAJVYEjn/nleEG7zAHw EKiURZvOJj4GwFYKj3cyCJTW3nFg35TNwelxaT+yueAgbKScTBcIoZEsCeyUahqhat5hhWIge HLcQo7dkK/gZ38Z1uMD04o2z5OHO9++iBEkvWWeutqCoS3CcxGyrHHLRTCDTXw/a/OHTUZvN4 kleH6Yae12LIR7P0/9S7h4df+Fu30EioWPAYnN86hglLv5wXh/d8ZeFZRd5+IOYoQeYcKIqam SuC83ORPZKj5YF7OBWsWcMmR2EHnq+EBpwlZPw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ravindra Lokhande Compress offload does not support ioctl calls from a 32bit userspace in a 64 bit kernel. This patch adds support for ioctls from a 32bit userspace in a 64bit kernel Signed-off-by: Ravindra Lokhande Acked-by: Vinod Koul Signed-off-by: Takashi Iwai (cherry picked from commit c10368897e104c008c610915a218f0fe5fa4ec96) Signed-off-by: Arnd Bergmann --- sound/core/compress_offload.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 6163bf3e8177..33d40d6fa3f1 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -858,6 +859,15 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg) return retval; } +/* support of 32bit userspace on 64bit platforms */ +#ifdef CONFIG_COMPAT +static long snd_compr_ioctl_compat(struct file *file, unsigned int cmd, + unsigned long arg) +{ + return snd_compr_ioctl(file, cmd, (unsigned long)compat_ptr(arg)); +} +#endif + static const struct file_operations snd_compr_file_ops = { .owner = THIS_MODULE, .open = snd_compr_open, @@ -865,6 +875,9 @@ static const struct file_operations snd_compr_file_ops = { .write = snd_compr_write, .read = snd_compr_read, .unlocked_ioctl = snd_compr_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = snd_compr_ioctl_compat, +#endif .mmap = snd_compr_mmap, .poll = snd_compr_poll, }; -- 2.20.0