mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aaron Sierra <asierra@xes-inc.com>
To: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter@roeck-us.net>,
	Peter Tyser <ptyser@xes-inc.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3 v4] mfd: Add LPC driver for Intel ICH chipsets
Date: Tue, 21 Feb 2012 16:21:12 -0600 (CST)	[thread overview]
Message-ID: <14262b0b-3937-45c0-bc01-93de9e2b4113@zimbra> (raw)
In-Reply-To: <20120221152853.054855fe@endymion.delvare>

> On Mon, 20 Feb 2012 14:36:27 -0600 (CST), Aaron Sierra wrote:
> > > > +	}
> > > > +
> > > > +	/* Enable LPC ACPI space */
> > > > +	pci_read_config_byte(dev, ACPICTRL, &reg_save);
> > > > +	pci_write_config_byte(dev, ACPICTRL, reg_save | 0x10);
> > > > +	lpc_ich_acpi_save = reg_save;
> > > > +
> > > > +pm_done:
> > > > +	/* Setup GPIO base register */
> > > > +	pci_read_config_dword(dev, GPIOBASE, &base_addr_cfg);
> > > > +	base_addr = base_addr_cfg & 0x0000ff80;
> > > > +	if (!base_addr) {
> > > > +		dev_err(&dev->dev, "I/O space for GPIO uninitialized\n");
> > > > +		/* GPIO in power-management space may still be available */
> > > > +		goto gpio_reg;
> > > > +	}
> > > > +
> > > > +	gpio_ich_res[ICH_RES_GPIO].start = base_addr;
> > > > +	gpio_ich_res[ICH_RES_GPIO].end = base_addr + GPIOBASE_IO_SIZE
> > > > -
> > > > 1;
> > > > +	ret =
> > > > acpi_check_resource_conflict(&gpio_ich_res[ICH_RES_GPIO]);
> > > > +	if (ret) {
> > > > +		/* this isn't necessarily fatal for the GPIO */
> > > > +		gpio_ich_res[ICH_RES_GPIO].start = 0;
> > > > +		gpio_ich_res[ICH_RES_GPIO].end = 0;
> > > 
> > > I don't quite get how this can be non-fatal, given that the
> > > gpio-ich driver's probe function will return -ENODEV in this
> > > case. So if this resource is mandatory, let's make it exactly
> > > that.
> > 
> > The necessity for the ICH_RES_GPIO resource to exist is an issue I
> > thought better left to the gpio-ich driver. The way that driver is
> > currently written it is mandatory, but it doesn't *have* to be
> > written that way. For chipsets that have GPE0 and GPIO space, only
> > one needs to be present to have some usable GPIO.
> 
> Ah, OK, I had misunderstood this, I thought GPIO was always
> mandatory.
> 
> We're only talking about the ICH6 and 3100, right? I find it
> questionable that you even attempt to request and enable the GPE0
> space on all other chips then. This could cause error messages
> that are not relevant at all.

You'll see in the V5 patch that I followed your suggestion and now
treat the GPIO space as mandatory. The local version I have
prepared for V6 only looks for GPE0 space for ICH6 and i3100
devices.

> > Otherwise, the only optimization (fix) I see is that
> > ACPIBASE_GPE0_BASE should be 0x28, not 0x20 and gpe0_sts_ofs
> > in gpio-ich should be removed. Currently, that portion of
> > gpio-ich appears to be broken.
> 
> If you only need the I/O port at offset 0x28, then indeed it might
> make sense to only request that one to limit the risk of resource
> conflicts.

I addressed this with V5.

> > > > +	lpc_ich_finalize_cell(&lpc_ich_cells[LPC_GPIO], id);
> > > > +	ret = mfd_add_devices(&dev->dev, 0, &lpc_ich_cells[LPC_GPIO],
> > > > +				1, NULL, 0);
> > > > +	if (!ret)
> > > > +		cell_added = true;
> > > > +
> > > > +	if (acpi_conflict)
> > > > +		dev_info(&dev->dev, "ACPI resource conflicts found; "
> > > > +				"consider using acpi_enforce_resources=lax?\n");
> > > 
> > > I'm not sure if it really makes sense to report this. ACPI
> > > resource
> > > conflicts are already reported quite loudly by the acpi core. And
> > > passing acpi_enforce_resources=lax blindly isn't quite
> > > recommended,
> > > so I'm not sure if we really want to mention it here, it might do
> > > more
> > > harm than help.
> > 
> > So the question mark doesn't imply strongly enough that it's not an
> > action that should definitely be taken. Would you prefer a warning
> > summarizing which drivers are affected by the detected resource
> > conflicts or no additional warning at all?
> 
> I wouldn't put any additional warning at all. But maybe that's just
> me.

In V5, I added warnings indicating which drivers are affected by
conflicts, since it was trivial with the way that I compartmentalized
gpio and watchdog mfd cell creation in that version.

-Aaron S.

  reply	other threads:[~2012-02-21 22:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c68928fc-816e-4738-9108-ee3dfbf6427b@zimbra>
2012-02-17 23:28 ` Aaron Sierra
2012-02-18 17:31   ` Jean Delvare
2012-02-20 20:36     ` Aaron Sierra
2012-02-21 14:28       ` Jean Delvare
2012-02-21 22:21         ` Aaron Sierra [this message]
2012-02-18 19:44   ` 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=14262b0b-3937-45c0-bc01-93de9e2b4113@zimbra \
    --to=asierra@xes-inc.com \
    --cc=grant.likely@secretlab.ca \
    --cc=guenter@roeck-us.net \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ptyser@xes-inc.com \
    /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

all inboxes | Powered by JetHome®