Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-pci@vger.kernel.org
Subject: Re: [NEEDS-REVIEW] [PATCH v1 1/2] x86/PCI: Get rid of custom x86 model comparison
Date: Tue, 14 Jul 2020 12:35:56 +0300	[thread overview]
Message-ID: <20200714093556.GH3703480@smile.fi.intel.com> (raw)
In-Reply-To: <c59df703-48af-a981-2934-7e4394e04baa@intel.com>

On Mon, Jul 13, 2020 at 01:59:55PM -0700, Dave Hansen wrote:
> On 7/13/20 12:44 PM, Andy Shevchenko wrote:
> > -	switch (intel_mid_identify_cpu()) {
> > -	case INTEL_MID_CPU_CHIP_TANGIER:
> > +	id = x86_match_cpu(intel_mid_cpu_ids);
> > +	if (id)
> > +		model = id->model;
> > +
> > +	switch (model) {
> > +	case INTEL_FAM6_ATOM_SILVERMONT_MID:
> >  		polarity = IOAPIC_POL_HIGH;
> 
> The diff makes it _look_ like there's a behavior change, swapping
> silvermont and tangier.  It appears from intel_mid_arch_setup() that
> INTEL_FAM6_ATOM_SILVERMONT_MID and tangier are related:
> 
> #define INTEL_FAM6_ATOM_SILVERMONT_MID  0x4A /* Merriefield */
> 
> ...
>         case 0x3C:
>         case 0x4A:
>                 __intel_mid_cpu_chip = INTEL_MID_CPU_CHIP_TANGIER;
>                 x86_platform.legacy.rtc = 1;
>                 break;

Yes. The original code is too old and was submitted without relying on existing
kernel helpers.

> But that's probably worth a note in the changelog.  If you added a patch
>  to intel_mid_arch_setup() to this series to use the intel-family.h
> #defines, this would be much more self explanatory.

No, I'm not going to do that at all. The idea behind is to get rid of this ugly
customisation.

> This also all makes me wonder if intel_mid_identify_cpu() is really even
> necessary.

Exactly!

> Does this fix any kinds of problems?  It's a diffstat-challenged cleanup
> if not:

>  arch/x86/pci/intel_mid_pci.c | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> That's not usually how cleanups look. :)

I understand. This will help to do a real clean up in the future.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2020-07-14  9:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13 19:44 [PATCH v1 1/2] x86/PCI: Get rid of custom x86 model comparison Andy Shevchenko
2020-07-13 19:44 ` [PATCH v1 2/2] x86/PCI: Describe @reg for type1_access_ok() Andy Shevchenko
2020-07-13 19:59   ` Bjorn Helgaas
2020-07-13 20:03     ` Andy Shevchenko
2020-07-13 21:02       ` Bjorn Helgaas
2020-07-14  9:09         ` Andy Shevchenko
2020-07-13 20:59 ` [NEEDS-REVIEW] [PATCH v1 1/2] x86/PCI: Get rid of custom x86 model comparison Dave Hansen
2020-07-14  9:35   ` Andy Shevchenko [this message]
2020-07-13 21:02 ` Bjorn Helgaas
2020-07-14  9:38   ` Andy Shevchenko
2020-07-14 19:02     ` Bjorn Helgaas
2020-07-14 19:29       ` Andy Shevchenko

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=20200714093556.GH3703480@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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