From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965770AbbBCOV7 (ORCPT ); Tue, 3 Feb 2015 09:21:59 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:54863 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753473AbbBCOV6 (ORCPT ); Tue, 3 Feb 2015 09:21:58 -0500 Message-ID: <54D0D979.30307@roeck-us.net> Date: Tue, 03 Feb 2015 06:21:45 -0800 From: Guenter Roeck User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Mark Brown CC: Lars-Peter Clausen , Robert Rosengren , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jean Delvare Subject: Re: [PATCH] regmap: Fix i2c word access when using SMBus access functions References: <1422834481-6936-1-git-send-email-linux@roeck-us.net> <54CF50CF.7040601@metafoo.de> <20150202115638.GK21293@sirena.org.uk> <54CF89EA.9040206@roeck-us.net> <20150203114210.GG21293@sirena.org.uk> In-Reply-To: <20150203114210.GG21293@sirena.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-CTCH-PVer: 0000001 X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: 0 X-CTCH-RefID: str=0001.0A020204.54D0D984.01A3,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-CTCH-Score: 0.001 X-CTCH-ScoreCust: 0.000 X-CTCH-Rules: C_4847, X-CTCH-SenderID: linux@roeck-us.net X-CTCH-SenderID-Flags: 0 X-CTCH-SenderID-TotalMessages: 3 X-CTCH-SenderID-TotalSpam: 0 X-CTCH-SenderID-TotalSuspected: 0 X-CTCH-SenderID-TotalConfirmed: 0 X-CTCH-SenderID-TotalBulk: 0 X-CTCH-SenderID-TotalVirus: 0 X-CTCH-SenderID-TotalRecipients: 0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: mailgid no entry from get_relayhosts_entry X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/03/2015 03:42 AM, Mark Brown wrote: > On Mon, Feb 02, 2015 at 06:30:02AM -0800, Guenter Roeck wrote: >> On 02/02/2015 03:56 AM, Mark Brown wrote: > >>> Yes, we really ought to handle _NATIVE too (though the chances of it >>> being used with I2C are minimal, it's mostly for MMIO). This also feels > >> Well, we do; it is handled similar to the big endian case with the current >> code. Do you think it should be handled differently ? If yes, how ? > > Perhaps it just needs to be more explicit about how it's handling native > endian? I didn't spot it. > Thinking about it, we should actually reject requests for _NATIVE. SMBus 16 bit accesses are either little endian or big endian. >>> like it's something that should be being handled further up the stack in >>> the serialization code but given that there's direct functions for this >>> in the smbus code perhaps it's better here. Or perhaps the smbus >>> support ought to be transitioned to use the bus interface and set >>> reg_write() and reg_read() operations now that we can do that, it seems >>> like a better fit though it might break compatibility with wierd devices. > >> I thought about that, but since the smbus functions perform endianness >> conversion it would mean that I would have to undo that conversion just >> to have it done again. > > No, the whole point is that by doing this you avoid any endianness > conversions or formatting in the framework at all so you can just use > the smbus functions to handle the formatting. > Ah, guess I got confused. The SMBus accesses are already using reg_read and reg_write. Thanks, Guenter