From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-path: Received: from mga14.intel.com ([192.55.52.115]:3149 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932386AbeAKUm6 (ORCPT ); Thu, 11 Jan 2018 15:42:58 -0500 Subject: Re: [PATCH linux dev-4.10 3/6] drivers/misc: Add driver for Aspeed PECI and generic PECI headers To: Benjamin Herrenschmidt , joel@jms.id.au, andrew@aj.id.au, arnd@arndb.de, gregkh@linuxfoundation.org, jdelvare@suse.com, linux@roeck-us.net Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-arm-kernel@lists.infradead.org, openbmc@lists.ozlabs.org References: <20180109223126.13093-1-jae.hyun.yoo@linux.intel.com> <20180109223126.13093-4-jae.hyun.yoo@linux.intel.com> <1515661583.31850.34.camel@kernel.crashing.org> From: Jae Hyun Yoo Message-ID: <7a038bd0-b2e0-2261-deea-f37a3e1810ba@linux.intel.com> Date: Thu, 11 Jan 2018 12:42:57 -0800 MIME-Version: 1.0 In-Reply-To: <1515661583.31850.34.camel@kernel.crashing.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-hwmon-owner@vger.kernel.org List-Id: linux-hwmon@vger.kernel.org On 1/11/2018 1:06 AM, Benjamin Herrenschmidt wrote: > On Tue, 2018-01-09 at 14:31 -0800, Jae Hyun Yoo wrote: >> +struct peci_rd_ia_msr_msg { >> + unsigned char target; >> + unsigned char thread_id; >> + unsigned short address; >> + unsigned long value; >> +}; > > Those types are representing messages on the wire ? > > In that case those types aren't suitable. For example "long" will have > a different size and alignment for 32 and 64-bit userspace. There are > size-explicit userspace types available. > > Also I didn't see any endianness annotations in there. Is that expected > ? IE are those wire format packets ? > > Cheers, > Ben. > Only the 'peci_xfer_msg' struct is representing messages on the wire. All userspace messages which is using other struct definitions will be copied into the 'peci_xfer_msg' for each member variable in driver, but anyway, type definitions of each member variable should be fixed as you said. Will fix it. Thanks, Jae From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jae Hyun Yoo Subject: Re: [PATCH linux dev-4.10 3/6] drivers/misc: Add driver for Aspeed PECI and generic PECI headers Date: Thu, 11 Jan 2018 12:42:57 -0800 Message-ID: <7a038bd0-b2e0-2261-deea-f37a3e1810ba@linux.intel.com> References: <20180109223126.13093-1-jae.hyun.yoo@linux.intel.com> <20180109223126.13093-4-jae.hyun.yoo@linux.intel.com> <1515661583.31850.34.camel@kernel.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1515661583.31850.34.camel-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> Content-Language: en-US Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Benjamin Herrenschmidt , joel-U3u1mxZcP9KHXe+LvDLADg@public.gmane.org, andrew-zrmu5oMJ5Fs@public.gmane.org, arnd-r2nGTMty4D4@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, jdelvare-IBi9RG/b67k@public.gmane.org, linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-hwmon-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, openbmc-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org List-Id: devicetree@vger.kernel.org On 1/11/2018 1:06 AM, Benjamin Herrenschmidt wrote: > On Tue, 2018-01-09 at 14:31 -0800, Jae Hyun Yoo wrote: >> +struct peci_rd_ia_msr_msg { >> + unsigned char target; >> + unsigned char thread_id; >> + unsigned short address; >> + unsigned long value; >> +}; > > Those types are representing messages on the wire ? > > In that case those types aren't suitable. For example "long" will have > a different size and alignment for 32 and 64-bit userspace. There are > size-explicit userspace types available. > > Also I didn't see any endianness annotations in there. Is that expected > ? IE are those wire format packets ? > > Cheers, > Ben. > Only the 'peci_xfer_msg' struct is representing messages on the wire. All userspace messages which is using other struct definitions will be copied into the 'peci_xfer_msg' for each member variable in driver, but anyway, type definitions of each member variable should be fixed as you said. Will fix it. Thanks, Jae -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: jae.hyun.yoo@linux.intel.com (Jae Hyun Yoo) Date: Thu, 11 Jan 2018 12:42:57 -0800 Subject: [PATCH linux dev-4.10 3/6] drivers/misc: Add driver for Aspeed PECI and generic PECI headers In-Reply-To: <1515661583.31850.34.camel@kernel.crashing.org> References: <20180109223126.13093-1-jae.hyun.yoo@linux.intel.com> <20180109223126.13093-4-jae.hyun.yoo@linux.intel.com> <1515661583.31850.34.camel@kernel.crashing.org> Message-ID: <7a038bd0-b2e0-2261-deea-f37a3e1810ba@linux.intel.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 1/11/2018 1:06 AM, Benjamin Herrenschmidt wrote: > On Tue, 2018-01-09 at 14:31 -0800, Jae Hyun Yoo wrote: >> +struct peci_rd_ia_msr_msg { >> + unsigned char target; >> + unsigned char thread_id; >> + unsigned short address; >> + unsigned long value; >> +}; > > Those types are representing messages on the wire ? > > In that case those types aren't suitable. For example "long" will have > a different size and alignment for 32 and 64-bit userspace. There are > size-explicit userspace types available. > > Also I didn't see any endianness annotations in there. Is that expected > ? IE are those wire format packets ? > > Cheers, > Ben. > Only the 'peci_xfer_msg' struct is representing messages on the wire. All userspace messages which is using other struct definitions will be copied into the 'peci_xfer_msg' for each member variable in driver, but anyway, type definitions of each member variable should be fixed as you said. Will fix it. Thanks, Jae