Re: [RFC v2 3/5] PCIe, Add runtime PM support to PCIe port

From: Rafael J. Wysocki
Date: Mon May 07 2012 - 17:01:46 EST


On Saturday, May 05, 2012, huang ying wrote:
> On Sat, May 5, 2012 at 4:55 AM, Rafael J. Wysocki <rjw@xxxxxxx> wrote:
> > On Friday, May 04, 2012, Bjorn Helgaas wrote:
> >> On Fri, May 4, 2012 at 2:13 AM, Huang Ying <ying.huang@xxxxxxxxx> wrote:
> >> > From: Zheng Yan <zheng.z.yan@xxxxxxxxx>
> >> >
> >> > This patch adds runtime PM support to PCIe port. This is needed by
> >> > PCIe D3cold support, where PCIe device in slot may be powered on/off
> >> > by PCIe port.
> >>
> >> I assume this works for integrated PCIe devices as well as those that
> >> are plugged into a slot and can be physically removed -- maybe the
> >> text "in slot" is superfluous?
> >>
> >> > Because runtime suspend is broken for some chipset, a white list is
> >> > used to enable runtime PM support for only chipset known to work.
> >>
> >> A whitelist requires perpetual maintenance. Every time a new working
> >> chipset comes out, you have to update the whitelist. That doesn't
> >> seem right.
> >
> > Well, we can't possibly enable the feature for all PCIe ports in existence
> > either, because some of them will not work with it (almost surely).
>
> What do you think about the idea from Bjorn to use some kind of blacklist here?

Whitelists are much better than blacklists for new features IMO, because they
allow the feature to be enabled on more and more existing systems over time
(as they are tested) and it's easy to revert wrong enablements (eg. if
a system is added to a whitelist and it turns out not to work afterward, it's
sufficient to remove the whitelist entry to fix the problem).

A general rule for adding new features should be that the feature is only
enabled on systems where it is _known_ to work or at the user's request.

Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/