From nobody@FreeBSD.org  Wed Jul 19 06:01:08 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id C07C116A4DD
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 19 Jul 2006 06:01:08 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 41C3443D88
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 19 Jul 2006 06:01:00 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k6J610nn068459
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 19 Jul 2006 06:01:00 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k6J610GD068458;
	Wed, 19 Jul 2006 06:01:00 GMT
	(envelope-from nobody)
Message-Id: <200607190601.k6J610GD068458@www.freebsd.org>
Date: Wed, 19 Jul 2006 06:01:00 GMT
From: Arthur Hartwig <arthur.hartwig@nokia.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Inconsistent definition of SMBus addresses in SMBus drivers
X-Send-Pr-Version: www-2.3

>Number:         100513
>Category:       kern
>Synopsis:       [smbus] Inconsistent definition of SMBus addresses in SMBus drivers
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    jhb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 19 06:10:17 GMT 2006
>Closed-Date:    Mon Oct 11 19:00:52 UTC 2010
>Last-Modified:  Mon Oct 11 19:00:52 UTC 2010
>Originator:     Arthur Hartwig
>Release:        6.0
>Organization:
Nokia
>Environment:
FreeBSD xxx.nokia.com 6.0-RELEASE FreeBSD 6.0-RELEASE #3: Wed Mar  1 10:46:02 EST 2006     hartwig@xxx.nokia.com:/usr/src/sys/i386/compile/oz-net-10  i386

>Description:
The intpm driver takes the user specified address in the slave field of
the smbcmd structure and or's in the read/write bit. At least some of the
other smbus drivers take the user specified address, left shift it one bit
then or in the read/write bit. Consequently, an application accessing an
eeprom at address 0x55 on the SMBus needs to specify the slave field as
0xaa if intpm drives the SMBus while the application needs to specify the
slave field as 0x55 if amdpm or ichsmb drives the  SMBus.

I think intpu should be changed to accept addresses in the same form as
most of the other SMBus drivers.


>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:

From: Andriy Gapon <avg@icyb.net.ua>
To: bug-followup@FreeBSD.org, arthur.hartwig@nokia.com
Cc:  
Subject: Re: kern/100513: [smbus] Inconsistent definition of SMBus addresses
 in SMBus drivers
Date: Sat, 10 Jan 2009 18:34:49 +0200

 I've encountered the same problem while migrating some code from a
 platform using intpm to a platform with ichsmb.
 I looked through the code and it seems that ichsmb is the only driver
 that explicitly shifts slave address. All others seem to pass slave
 address as-is to the hardware. But there might be some subtleties - some
 hardware might expect the address to be in "unshifted" form.
 
 Arthur, if you are still interested and can verify this, are you sure
 that amdpm driver expects address to be in "unshifted" form (0x55 in
 your example)?
 I'd rather expect ichsmb to be the only "black sheep".
 
 -- 
 Andriy Gapon
State-Changed-From-To: open->patched 
State-Changed-By: jhb 
State-Changed-When: Tue Feb 10 13:32:39 UTC 2009 
State-Changed-Why:  
I've recently changed ichsmb to be consistent with all the other SMBus 
controller drivers to require "left-adjusted" slave addresses (i.e. bit 
0 is reserved and always 0).  I've also documented this in smb(4).  If 
you find that other smbus drivers are not following this standard, then 
we should fix those as well. 


Responsible-Changed-From-To: freebsd-bugs->jhb 
Responsible-Changed-By: jhb 
Responsible-Changed-When: Tue Feb 10 13:32:39 UTC 2009 
Responsible-Changed-Why:  
I've recently changed ichsmb to be consistent with all the other SMBus 
controller drivers to require "left-adjusted" slave addresses (i.e. bit 
0 is reserved and always 0).  I've also documented this in smb(4).  If 
you find that other smbus drivers are not following this standard, then 
we should fix those as well. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=100513 
State-Changed-From-To: patched->closed 
State-Changed-By: jhb 
State-Changed-When: Mon Oct 11 19:00:27 UTC 2010 
State-Changed-Why:  
Fixed in 7.x and later. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=100513 
>Unformatted:
