From patchwork Fri Mar 22 15:43:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 160921 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp960936jan; Fri, 22 Mar 2019 08:46:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4dxsO6+hIdxSn5jqtLGeWaSxdP1wu+q/FIpCN1J2wf+Jq5m7gnNTzunOCiMyJGw/H+5S8 X-Received: by 2002:aa7:938b:: with SMTP id t11mr2754992pfe.67.1553269603633; Fri, 22 Mar 2019 08:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553269603; cv=none; d=google.com; s=arc-20160816; b=xIMTJi7fkeFCVWNezZgSJs4kqTOWCAsWd+qmvzwuXGEo7PMMFn1V2MJgSkLUn0WJZc aNCemPm7ceYOwwfVyf9X/TiG5g/2DueJLMhR2DUNNdhJPj7e4X06dhixXBOVJ+oEmwgB fYuuRN1E+rnOM6Anpv/pCvEQ9tr0ikCWPU0+QblI27DhqmPyBIlpwe9oEJ2lfDJvozL7 xdo06if4QQIL5eCaKoptkRTXFQID6wXN05AySFx3PB8L+5zSw7m2beFFdximMB23Dttz EXUz3f/flWGJwBSePIDl3Xunkleq4AKJKh8ge2rf+ATGEmQ49IreFhA9XwEHTIEWqnV1 CTOw== 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 e4si7183434pfe.4.2019.03.22.08.46.43; Fri, 22 Mar 2019 08:46:43 -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 S1727764AbfCVPql (ORCPT + 31 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 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(+) -- 2.20.0 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, };