All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Terry Bowman <terry.bowman@amd.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
	linux-watchdog@vger.kernel.org, Jean Delvare <jdelvare@suse.com>,
	linux-i2c <linux-i2c@vger.kernel.org>,
	Wolfram Sang <wsa@kernel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	Robert Richter <rrichter@amd.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	sudheesh.mavila@amd.com, "Shah,
	Nehal-bakulchandra" <Nehal-bakulchandra.Shah@amd.com>,
	Basavaraj Natikar <Basavaraj.Natikar@amd.com>,
	Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
	Mario Limonciello <Mario.Limonciello@amd.com>
Subject: Re: [PATCH v3 0/9] i2c: piix4: Replace cd6h/cd7h port I/O accesses with MMIO accesses
Date: Thu, 20 Jan 2022 13:30:40 +0200	[thread overview]
Message-ID: <CAHp75VcUVY+51o0DFhvYTjpydfF=L_rTGan74sZRMPDMmXtsQg@mail.gmail.com> (raw)
In-Reply-To: <20220119230626.31560-1-terry.bowman@amd.com>

On Thu, Jan 20, 2022 at 1:06 AM Terry Bowman <terry.bowman@amd.com> wrote:
>
> This series changes the piix4_smbus driver's cd6h/cd7h port I/O accesses
> to use MMIO instead. This is necessary because cd6h/cd7h port I/O may be
> disabled on later AMD processors.
>
> This series includes patches with MMIO accesses to registers
> FCH::PM::DECODEEN and FCH::PM::ISACONTROL. The same registers are also
> accessed by the sp5100_tco driver.[1] Synchronization to the MMIO
> registers is required in both drivers.
>
> The first patch creates a macro to request MMIO region using the 'muxed'
> retry logic. This is used in patch 6 to synchronize accesses to EFCH MMIO.
>
> The second patch replaces a hardcoded region size with a #define. This is
> to improve maintainability and was requested from v2 review.
>
> The third patch moves duplicated region request/release code into
> functions. This locates related code into functions and reduces code line
> count. This will also make adding MMIO support in patch 6 easier.
>
> The fourth patch moves SMBus controller address detection into a function.
> This is in preparation for adding MMIO region support.
>
> The fifth patch moves EFCH port selection into a function. This is in
> preparation for adding MMIO region support.
>
> The sixth patch adds MMIO support for region requesting/releasing and
> mapping. This is necessary for using MMIO to detect SMBus controller
> address, enable SMBbus controller region, and control the port select.
>
> The seventh patch updates the SMBus controller address detection to support
> using MMIO. This is necessary because the driver accesses registers
> FCH::PM::DECODEEN and FCH::PM::ISACONTOL during initialization and they are
> only available using MMIO on later AMD processors.
>
> The eighth patch updates the SMBus port selection to support MMIO. This is
> required because port selection control resides in the
> FCH::PM::DECODEEN[smbus0sel] and is only accessible using MMIO on later AMD
> processors.
>
> The ninth patch enables the EFCH MMIO functionality added earlier in this
> series. The SMBus controller's PCI revision ID is used to check if EFCH
> MMIO is supported by HW and should be enabled in the driver.

In general looks good to me, but I believe it will be much better if
we agreed on converting driver to use iomap_port() +
ioreadXX()/iowriteXX() (means dropping I/O accessor _p variants for
good). This would make the series cleaner and less invasive.

-- 
With Best Regards,
Andy Shevchenko

      parent reply	other threads:[~2022-01-20 11:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19 23:06 [PATCH v3 0/9] i2c: piix4: Replace cd6h/cd7h port I/O accesses with MMIO accesses Terry Bowman
2022-01-19 23:06 ` [PATCH v3 1/9] kernel/resource: Introduce request_muxed_mem_region() Terry Bowman
2022-01-20 11:16   ` Andy Shevchenko
2022-01-20 13:53     ` Terry Bowman
2022-01-19 23:06 ` [PATCH v3 2/9] i2c: piix4: Replace hardcoded memory map size with a #define Terry Bowman
2022-01-19 23:06 ` [PATCH v3 3/9] i2c: piix4: Move port I/O region request/release code into functions Terry Bowman
2022-01-19 23:06 ` [PATCH v3 4/9] i2c: piix4: Move SMBus controller base address detect into function Terry Bowman
2022-01-19 23:06 ` [PATCH v3 5/9] i2c: piix4: Move SMBus port selection " Terry Bowman
2022-01-19 23:06 ` [PATCH v3 6/9] i2c: piix4: Add EFCH MMIO support to region request and release Terry Bowman
2022-01-19 23:06 ` [PATCH v3 7/9] i2c: piix4: Add EFCH MMIO support to SMBus base address detect Terry Bowman
2022-01-20 11:27   ` Andy Shevchenko
2022-01-20 13:59     ` Terry Bowman
2022-01-24 21:04     ` Terry Bowman
2022-01-27 21:35       ` Wolfram Sang
2022-01-19 23:06 ` [PATCH v3 8/9] i2c: piix4: Add EFCH MMIO support for SMBus port select Terry Bowman
2022-01-20 11:28   ` Andy Shevchenko
2022-01-20 14:00     ` Terry Bowman
2022-01-21 21:02     ` Terry Bowman
2022-01-21 21:07       ` Wolfram Sang
2022-01-19 23:06 ` [PATCH v3 9/9] i2c: piix4: Enable EFCH MMIO for Family 17h+ Terry Bowman
2022-01-20 11:30 ` Andy Shevchenko [this message]

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='CAHp75VcUVY+51o0DFhvYTjpydfF=L_rTGan74sZRMPDMmXtsQg@mail.gmail.com' \
    --to=andy.shevchenko@gmail.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=jdelvare@suse.com \
    --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=terry.bowman@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.