All of lore.kernel.org
 help / color / mirror / Atom feed
From: Terry Bowman <Terry.Bowman@amd.com>
To: Jean Delvare <jdelvare@suse.de>
Cc: linux@roeck-us.net, linux-watchdog@vger.kernel.org,
	linux-i2c@vger.kernel.org, wsa@kernel.org,
	andy.shevchenko@gmail.com, rafael.j.wysocki@intel.com,
	linux-kernel@vger.kernel.org, wim@linux-watchdog.org,
	rrichter@amd.com, thomas.lendacky@amd.com,
	sudheesh.mavila@amd.com, Nehal-bakulchandra.Shah@amd.com,
	Basavaraj.Natikar@amd.com, Shyam-sundar.S-k@amd.com,
	Mario.Limonciello@amd.com
Subject: Re: [PATCH v4 0/9] i2c: piix4: Replace cd6h/cd7h port I/O accesses with MMIO accesses
Date: Tue, 8 Feb 2022 17:03:09 -0600	[thread overview]
Message-ID: <27e60021-30cb-3b1c-f429-2618bf891e5e@amd.com> (raw)
In-Reply-To: <20220208224653.6a62ba22@endymion.delvare>

Hi Jean,

On 2/8/22 15:46, Jean Delvare wrote:
> On Tue, 8 Feb 2022 13:36:55 -0600, Terry Bowman wrote:
>> On 2/8/22 11:11, Jean Delvare wrote:
>>> Unfortunately I'm not really able to test this series. While I do have
>>> an AMD-based laptop which uses the i2c-piix4 driver, the SMBus has
>>> never been usable on it. The driver creates 3 i2c buses (port 0 at
>>> 0b00, port 2 at 0b00 and port 1 at 0b20). The first 2 do not seem to
>>> have any device on them (i2cdetect returns empty). The last one must
>>> have some devices on it, I see address 0x1c answers the ping,
>>> unfortunately as soon as probing reaches address 0x2c, all later pings
>>> return success, regardless of the address. It seems that some I2C
>>> device (probably the one at 0x2c, but I don't know what it is) is
>>> holding SDA low forever, therefore preventing any use of the whole
>>> SMBus port until the next reboot.
>>
>> My understanding is the OEM may have different i2c devices because it
>> is mainboard specific.
> 
> Yes, the devices on the SMBus could be anything Lenovo decided to use.
> Tomorrow I'll try to scan the SMBus but skipping the problematic
> address, to see if it works around the problem.
> 
>>>> (...)
>>>> Changes in v4:
>>>> (...)
>>>>  - Removed iowrite32(ioread32(...), ...). Unnecessary because MMIO is
>>>>    already enabled. (Terry Bowman)  
>>>
>>> I'm curious, how can you be sure of that actually?
>>
>> The removed code was using a MMIO region to write 1 to 'mmioen'. This was 
>> using the MMIO region to enable same MMIO region.
> 
> Ah ah, I get it now. Nice chicken or the egg situation :-)
> 
>> Programmer's manual shows FCH::PM::ISACONTROL[mmioen] has a '1' reset value.
>> Per programmer's manual, FCH::PM::ISACONTROL[mmioen] enables MMIO mapping 
>> at FED8_0000h..FED8_1FFFh. The FCH::PM::ISACONTROL register is MMIO 
>> mapped at FED8_0304h. 'mmioen' was intended to be set using port I/O to 
>> enable MMIO but, port I/O access to these registers is now disabled.
> 
> Is my understanding correct that there is some overlapping of the
> access methods and there are certain chipsets where both legacy I/O and
> MMIO access is possible?
> 
Yes. 

> If so, while there's indeed nothing to be done for the most recent
> systems where only MMIO access is possible, you may still need to
> enable MMIO access through legacy I/O if you try to use MMIO on
> chipsets where both are possible. I'm not sure what exactly where you
> set the limit. In the last patch you say that 0x51 is the first
> revision of the family 17h CPUs, but is family 17h the first where MMIO
> is available, or the first where legacy I/O isn't?
> 
Family 17h, SMBus PCI ID >= 0x51 is the first where cd6h/cd7h port I/O is disabled. 
If SMBus PCI ID < 0x51 then cd6h/cd7h port I/O is used. 
  
Regards,
Terry


  reply	other threads:[~2022-02-08 23:03 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-30 18:41 [PATCH v4 0/9] i2c: piix4: Replace cd6h/cd7h port I/O accesses with MMIO accesses Terry Bowman
2022-01-30 18:41 ` [PATCH v4 1/9] kernel/resource: Introduce request_mem_region_muxed() Terry Bowman
2022-01-30 18:41 ` [PATCH v4 2/9] i2c: piix4: Replace hardcoded memory map size with a #define Terry Bowman
2022-01-30 18:41 ` [PATCH v4 3/9] i2c: piix4: Move port I/O region request/release code into functions Terry Bowman
2022-02-08 14:45   ` Jean Delvare
2022-02-08 15:15     ` Terry Bowman
2022-01-30 18:41 ` [PATCH v4 4/9] i2c: piix4: Move SMBus controller base address detect into function Terry Bowman
2022-02-08 15:09   ` Jean Delvare
2022-01-30 18:41 ` [PATCH v4 5/9] i2c: piix4: Move SMBus port selection " Terry Bowman
2022-02-08 15:29   ` Jean Delvare
2022-01-30 18:41 ` [PATCH v4 6/9] i2c: piix4: Add EFCH MMIO support to region request and release Terry Bowman
2022-02-08 15:49   ` Jean Delvare
2022-01-30 18:41 ` [PATCH v4 7/9] i2c: piix4: Add EFCH MMIO support to SMBus base address detect Terry Bowman
2022-01-30 18:41 ` [PATCH v4 8/9] i2c: piix4: Add EFCH MMIO support for SMBus port select Terry Bowman
2022-02-08 16:19   ` Jean Delvare
2022-01-30 18:41 ` [PATCH v4 9/9] i2c: piix4: Enable EFCH MMIO for Family 17h+ Terry Bowman
2022-02-08 16:33   ` Jean Delvare
2022-02-08 20:10     ` Andy Shevchenko
2022-02-08 21:00       ` Terry Bowman
2022-01-31 11:01 ` [PATCH v4 0/9] i2c: piix4: Replace cd6h/cd7h port I/O accesses with MMIO accesses Andy Shevchenko
2022-02-01 15:21   ` Terry Bowman
2022-02-07 12:08 ` Wolfram Sang
2022-02-08 17:11 ` Jean Delvare
2022-02-08 19:36   ` Terry Bowman
2022-02-08 21:46     ` Jean Delvare
2022-02-08 23:03       ` Terry Bowman [this message]
2022-02-09  7:04         ` Jean Delvare

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=27e60021-30cb-3b1c-f429-2618bf891e5e@amd.com \
    --to=terry.bowman@amd.com \
    --cc=Basavaraj.Natikar@amd.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=Nehal-bakulchandra.Shah@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=jdelvare@suse.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rrichter@amd.com \
    --cc=sudheesh.mavila@amd.com \
    --cc=thomas.lendacky@amd.com \
    --cc=wim@linux-watchdog.org \
    --cc=wsa@kernel.org \
    /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.