From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756786AbbICPK2 (ORCPT ); Thu, 3 Sep 2015 11:10:28 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:5688 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754752AbbICPKY (ORCPT ); Thu, 3 Sep 2015 11:10:24 -0400 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Thu, 03 Sep 2015 08:06:13 -0700 Subject: Re: [RFC PATCH] mmc: block: Add new ioctl to send combo commands To: Grant Grundler , Olof Johansson References: <1441203711-19538-1-git-send-email-jonathanh@nvidia.com> CC: Ulf Hansson , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Olof Johansson , Seshagiri Holi From: Jon Hunter Message-ID: <55E862DA.1080509@nvidia.com> Date: Thu, 3 Sep 2015 16:10:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.21.132.159] X-ClientProxiedBy: UKMAIL101.nvidia.com (10.26.138.13) To UKMAIL101.nvidia.com (10.26.138.13) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/09/15 23:08, Grant Grundler wrote: > [resending text-only] > > On Wed, Sep 2, 2015 at 3:07 PM, Grant Grundler wrote: >> >> >> On Wed, Sep 2, 2015 at 11:28 AM, Olof Johansson wrote: >> ... >>>> +/** >>>> + * struct mmc_ioc_combo_cmd - combo command information >>>> + * @num_of_cmds: number of commands to send >>>> + * @mmc_ioc_cmd_list: pointer to list of commands >>>> + */ >>>> +struct mmc_ioc_combo_cmd { >>>> + uint8_t num_of_cmds; >>>> + struct mmc_ioc_cmd *mmc_ioc_cmd_list; >>>> +}; >>> >>> The size of this struct will depend on the pointer size of userspace. >>> >>> It might be better to use a u64 for the pointer instead. Otherwise >>> you'd need a compat ioctl wrapper to copy a 32-bit pointer over on a >>> 64-bit kernel. >> >> If alignment matters, then maybe swap the fields? >> Or declare num_of_cmds as u64 as well? Thanks. I did swap them in the updated version as this seems to make sense. However, I left num_of_cmds as an 8-bit value unless someone has a need for more than 256 commands ;-) Jon