From: Terry Bowman <Terry.Bowman@amd.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
Jean Delvare <jdelvare@suse.de>
Cc: Guenter Roeck <linux@roeck-us.net>,
linux-watchdog@vger.kernel.org,
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 v4 9/9] i2c: piix4: Enable EFCH MMIO for Family 17h+
Date: Tue, 8 Feb 2022 15:00:45 -0600 [thread overview]
Message-ID: <ad8b8beb-85be-a0b2-57b3-d8e3b8acda51@amd.com> (raw)
In-Reply-To: <CAHp75VfjQv=k4fG0GOSRRqTmpTkXe8chRQqjBaY3caHzdnhEKw@mail.gmail.com>
Hi Andy,
On 2/8/22 14:10, Andy Shevchenko wrote:
> On Tue, Feb 8, 2022 at 6:33 PM Jean Delvare <jdelvare@suse.de> wrote:
>> On Sun, 30 Jan 2022 12:41:30 -0600, Terry Bowman wrote:
>
> ...
>
>>> +#define AMD_PCI_SMBUS_REVISION_MMIO 0x51
>>
>> I don't think that was worth a define. You only use the value once, in
>> a context where the symbolic name doesn't add much value IMHO.
>
> I don't remember the code context here, but it would be nice in such a
> case to convert this definition to a comment (if it's not crystal
> clear what this magic number is about).
>
>
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index 239df17ce02b..218ed8efb83e 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -229,6 +229,13 @@ static void piix4_sb800_region_release(struct device *dev,
release_region(SB800_PIIX4_SMB_IDX, SB800_PIIX4_SMB_MAP_SIZE);
}
+static bool piix4_sb800_use_mmio(struct pci_dev *PIIX4_dev)
+{
+ return (PIIX4_dev->vendor == PCI_VENDOR_ID_AMD &&
+ PIIX4_dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS &&
+ PIIX4_dev->revision >= AMD_PCI_SMBUS_REVISION_MMIO);
+}
+
static int piix4_setup(struct pci_dev *PIIX4_dev,
const struct pci_device_id *id)
{
----
I added the context above. I'll add a comment in v5 to describe what and
why 0x51 is used.
Regards,
Terry
next prev parent reply other threads:[~2022-02-08 22:24 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 [this message]
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
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=ad8b8beb-85be-a0b2-57b3-d8e3b8acda51@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox