All of lore.kernel.org
 help / color / mirror / Atom feed
From: fetzerch <fetzer.ch@gmail.com>
To: Jean Delvare <jdelvare@suse.de>, Christian Fetzer <fetzer.ch@gmail.com>
Cc: linux-i2c@vger.kernel.org, jarkko.nikula@linux.intel.com,
	andriy.shevchenko@linux.intel.com,
	mika.westerberg@linux.intel.com, wsa@the-dreams.de,
	galandilias@gmail.com
Subject: Re: [PATCH v5 0/3] Support multiplexed main SMBus interface on SB800
Date: Sat, 23 Jan 2016 14:47:27 +0100	[thread overview]
Message-ID: <56A3846F.9000908@googlemail.com> (raw)
In-Reply-To: <20160122135040.6db7b66b@endymion.delvare>

Hi Jean,

On 22.01.2016 13:50, Jean Delvare wrote:
> Hi Christian,
> 
> On Thu, 19 Nov 2015 20:13:46 +0100, Christian Fetzer wrote:
>> This is an attempt to upstream the patches created by Thomas Brandon and
>> Eddi De Pieri to support the multiplexed main SMBus interface on the SB800
>> chipset. (https://www.mail-archive.com/linux-i2c@vger.kernel.org/msg06757.html)
>>
>> I have mainly rebased the latest patch version and tested the driver on a
>> HP ProLiant MicroServer G7 N54L (where this patch allows to access sensor data
>> from a w83795adg).
>>
>> The patched driver is running stable on the machine, given that ic2_piix4 is
>> loaded before jc42 and w83795. If jc42 is loaded before i2c_piix4 calling
>> sensors triggers some errors:
>>     ERROR: Can't get value of subfeature temp1_min_alarm: Can't read
>>
>> While the kernel log shows:
>>     i2c i2c-1: Transaction (pre): CNT=0c, CMD=05, ADD=31, DAT0=03, DAT1=c0
>>     i2c i2c-1: Error: no response!
>>     i2c i2c-1: Transaction (post): CNT=0c, CMD=05, ADD=31, DAT0=ff, DAT1=ff
>> Unfortunately I don't know how to tackle this specific issue.
> 
> I think I can explain it. In piix4_setup_sb800() you touch the
> SB800_PIIX4_SMB_IDX port without first taking the mutex that protects
> it. You only take the mutex on transactions (in piix4_access_sb800) not
> during initialization. If self-probing I2C device drivers such as jc42
> are already loaded before you load i2c-piix4, then as soon as the first
> SMBus port is registered, i2c-core will try to attach I2C devices to
> it, while at the same time i2c-piix4 is registering the second SMBus
> port. So SB800_PIIX4_SMB_IDX is changed while piix4_access_sb800
> accesses it and chaos happens.
> 
> I think if we had proper locking in piix4_setup_sb800() then you should
> be able to load jc42 first and then i2c-piix4 and it should work fine.
> 

Since the problem remains even after your patch, I'll try to provide
more information about the issue.

If i2c_piix4 is loaded before jc42 and w83795 things work as they should
and sensors prints values from all modules.

If w83795 is loaded before i2c_piix4, the w83795adg is not detected. I'm
not sure though if this is because of i2c_piix4 or just a shortcoming in
the w83795 module.

If jc42 is loaded before i2c_piix4 then the problem described above
occurs. It seems that jc42 tries to read from all multiplexed ports.
This is the full sensors output:

jc42-i2c-0-18
Adapter: SMBus PIIX4 adapter SDA0 at 0b00
RAM1 Temp:    +26.8°C  (low  =  +0.0°C)
                       (high = +60.0°C, hyst = +54.0°C)
                       (crit = +70.0°C, hyst = +64.0°C)

jc42-i2c-0-19
Adapter: SMBus PIIX4 adapter SDA0 at 0b00
RAM2 Temp:    +26.5°C  (low  =  +0.0°C)
                       (high = +60.0°C, hyst = +54.0°C)
                       (crit = +70.0°C, hyst = +64.0°C)

k10temp-pci-00c3
Adapter: PCI adapter
CPU Temp:     +30.6°C  (high = +70.0°C)
                       (crit = +100.0°C, hyst = +95.0°C)

jc42-i2c-1-18
Adapter: SMBus PIIX4 adapter SDA2 at 0b00
ERROR: Can't get value of subfeature temp1_min_alarm: Can't read
ERROR: Can't get value of subfeature temp1_max_alarm: Can't read
ERROR: Can't get value of subfeature temp1_crit_alarm: Can't read
ERROR: Can't get value of subfeature temp1_min: Can't read
ERROR: Can't get value of subfeature temp1_max: Can't read
ERROR: Can't get value of subfeature temp1_max_hyst: Can't read
ERROR: Can't get value of subfeature temp1_crit: Can't read
ERROR: Can't get value of subfeature temp1_crit_hyst: Can't read
temp1:            N/A  (low  =  +0.0°C)
                       (high =  +0.0°C, hyst =  +0.0°C)
                       (crit =  +0.0°C, hyst =  +0.0°C)

jc42-i2c-1-19
Adapter: SMBus PIIX4 adapter SDA2 at 0b00
ERROR: Can't get value of subfeature temp1_min_alarm: Can't read
ERROR: Can't get value of subfeature temp1_max_alarm: Can't read
ERROR: Can't get value of subfeature temp1_crit_alarm: Can't read
ERROR: Can't get value of subfeature temp1_min: Can't read
ERROR: Can't get value of subfeature temp1_max: Can't read
ERROR: Can't get value of subfeature temp1_max_hyst: Can't read
ERROR: Can't get value of subfeature temp1_crit: Can't read
ERROR: Can't get value of subfeature temp1_crit_hyst: Can't read
temp1:            N/A  (low  =  +0.0°C)
                       (high =  +0.0°C, hyst =  +0.0°C)
                       (crit =  +0.0°C, hyst =  +0.0°C)

jc42-i2c-2-18
Adapter: SMBus PIIX4 adapter SDA3 at 0b00
ERROR: Can't get value of subfeature temp1_min_alarm: Can't read
ERROR: Can't get value of subfeature temp1_max_alarm: Can't read
ERROR: Can't get value of subfeature temp1_crit_alarm: Can't read
ERROR: Can't get value of subfeature temp1_min: Can't read
ERROR: Can't get value of subfeature temp1_max: Can't read
ERROR: Can't get value of subfeature temp1_max_hyst: Can't read
ERROR: Can't get value of subfeature temp1_crit: Can't read
ERROR: Can't get value of subfeature temp1_crit_hyst: Can't read
temp1:            N/A  (low  =  +0.0°C)
                       (high =  +0.0°C, hyst =  +0.0°C)
                       (crit =  +0.0°C, hyst =  +0.0°C)

jc42-i2c-2-19
Adapter: SMBus PIIX4 adapter SDA3 at 0b00
ERROR: Can't get value of subfeature temp1_min_alarm: Can't read
ERROR: Can't get value of subfeature temp1_max_alarm: Can't read
ERROR: Can't get value of subfeature temp1_crit_alarm: Can't read
ERROR: Can't get value of subfeature temp1_min: Can't read
ERROR: Can't get value of subfeature temp1_max: Can't read
ERROR: Can't get value of subfeature temp1_max_hyst: Can't read
ERROR: Can't get value of subfeature temp1_crit: Can't read
ERROR: Can't get value of subfeature temp1_crit_hyst: Can't read
temp1:            N/A  (low  =  +0.0°C)
                       (high =  +0.0°C, hyst =  +0.0°C)
                       (crit =  +0.0°C, hyst =  +0.0°C)

jc42-i2c-3-18
Adapter: SMBus PIIX4 adapter SDA4 at 0b00
ERROR: Can't get value of subfeature temp1_min_alarm: Can't read
ERROR: Can't get value of subfeature temp1_max_alarm: Can't read
ERROR: Can't get value of subfeature temp1_crit_alarm: Can't read
ERROR: Can't get value of subfeature temp1_min: Can't read
ERROR: Can't get value of subfeature temp1_max: Can't read
ERROR: Can't get value of subfeature temp1_max_hyst: Can't read
ERROR: Can't get value of subfeature temp1_crit: Can't read
ERROR: Can't get value of subfeature temp1_crit_hyst: Can't read
temp1:            N/A  (low  =  +0.0°C)
                       (high =  +0.0°C, hyst =  +0.0°C)
                       (crit =  +0.0°C, hyst =  +0.0°C)

jc42-i2c-3-19
Adapter: SMBus PIIX4 adapter SDA4 at 0b00
ERROR: Can't get value of subfeature temp1_min_alarm: Can't read
ERROR: Can't get value of subfeature temp1_max_alarm: Can't read
ERROR: Can't get value of subfeature temp1_crit_alarm: Can't read
ERROR: Can't get value of subfeature temp1_min: Can't read
ERROR: Can't get value of subfeature temp1_max: Can't read
ERROR: Can't get value of subfeature temp1_max_hyst: Can't read
ERROR: Can't get value of subfeature temp1_crit: Can't read
ERROR: Can't get value of subfeature temp1_crit_hyst: Can't read
temp1:            N/A  (low  =  +0.0°C)
                       (high =  +0.0°C, hyst =  +0.0°C)
                       (crit =  +0.0°C, hyst =  +0.0°C)

  reply	other threads:[~2016-01-23 13:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-19 19:13 [PATCH v5 0/3] Support multiplexed main SMBus interface on SB800 Christian Fetzer
2015-11-19 19:13 ` [PATCH v5 1/3] i2c-piix4: Convert piix4_main_adapter to array Christian Fetzer
2015-11-19 19:13 ` [PATCH v5 2/3] i2c-piix4: Add support for multiplexed main adapter in SB800 Christian Fetzer
2015-11-19 19:13 ` [PATCH v5 3/3] i2c-piix4: Add adapter port name support for SB800 chipset Christian Fetzer
2016-01-22 13:20   ` Jean Delvare
2015-11-30 13:37 ` [PATCH v5 0/3] Support multiplexed main SMBus interface on SB800 Wolfram Sang
2016-01-22 12:50 ` Jean Delvare
2016-01-23 13:47   ` fetzerch [this message]
2016-01-24  9:16     ` Jean Delvare
2016-01-24 12:07       ` Rudolf Marek
2016-01-25 11:13     ` Jean Delvare
2016-01-25 21:53       ` Christian Fetzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56A3846F.9000908@googlemail.com \
    --to=fetzer.ch@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=galandilias@gmail.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=jdelvare@suse.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.