Takashi Iwai: How can we treat staging drivers better?

September 13, 2018

Related Material:

  1. Will staging lose its Lustre?.
  2. staging tree.
  3. The Linux Staging tree, what it is and is not.

Additional Participants: Andrew Lunn, Dan Carpenter, Daniel Vetter, Greg KH, James Bottomley, Joe Perches, Jonathan Cameron, Laurent Pinchart, Mauro Carvalho Chehab, Sean Paul, and Shuah Khan, Takashi Iwai.

Takashi called out some concerns about the staging tree:

Takashi would like to hear about how the staging tree can be improved.

Dan Carpenter asked if Takashi had another “forever in staging” example aside from the Comedi driver. Dan agreed that wireless drivers have been subjected to surface-only changes, but feels that this is at least partially due to the complexity of the conversion to mac80211. Dan feels that other drivers are doing better. Dan also asked which drivers surprised Takashi via grep. Takashi claimed no examples, counts, or statistics, but felt that drivers sometimes remained in staging longer than necessary. Takashi also suggested looking at non-wireless drivers to learn from any good examples. Finally, Takashi said that his main interest was in sound, and that there was often no proper takers in the subsystem where one might expect a staging driver to go. Greg KH stated that he drops things from staging every few kernel releases, and that sometimes no one notices. Greg agreed that the Comedi driver needs to move out, and gave speakup as another too-long-in-staging example, but noted that something moves from staging to the main kernel almost every kernel release. Greg suspects that many people don't notice the moves from staging because the drivers are not for hardware that they care about. Greg also believes that the most and bcm2835 sound drivers are making progress, and asked if Takashi had other examples. Finally, Greg stated that he either hands things off to the appropriate maintainer on the one hand, or has the developers become the maintainers on the other, so wonders what Takashi means by “no proper taker”. Takashi agreed that he might be suffering from false impressions, but suggested that it would be better to inform the subsystem maintainers of the addition of staging drivers in their area sooner rather than later. Shuah Khan found some staging drivers that did not include an L: entry for the corresponding subsystem mailing list, and suggested that this might be remedied.

Andrew Lunn said that he looks at all new networking drivers, but that there was little interaction between netdev people and those working on staging drivers. Thus, it is not unusual for his first look at a driver to be the move from staging, and when those patches are created with git format-patch -M the actual code is invisible. Andrew believes that it would be good to get a shot at reviewing the code before it moves from staging, suggesting “get out of staging” documentation with such review as part of the process. Joe Perches called out this example, agreeing that the subsystem maintainers should have been involved earlier.

Sean Paul noted that various Android components have “been in a constant state of almost graduating for a while now”. Sean also noted that subsystem refactors sometimes miss drivers in staging, and also that it is tricky to coordinate refactors across the drm and staging trees, to the point that the drm folks have been trying to dissuade people from taking new drm code through staging. Sean said that vboxvideo won't be accepted in drm because it is not an atomic driver, leaving it stuck in staging. Greg suggested that if it was never merged, it should be dropped, to which Sean agreed. Sean also acknowledged that the drm folks had been informed of this driver going into staging. Finally, Sean stated that although staging was fine for subsystems with less churn and surrounding infrastructure, that these conditions do not hold for drm. Daniel Vetter confessed to having acked this driver for staging. He said that he now has regrets, but allowed as how he would probably be just as gullible next time around. Daniel noted that although vboxvideo does get attention in staging, the one and only thing required, conversion to atomic, never seems to happen. Daniel believes that now that there is an in-subsystem driver for each kind of display IP out there, future drivers should be much easier to add, as they would likely be variants of the same hardware.

James Bottomley stated that the main issue for new SCSI drivers was substantive command interaction issues, so that whitespace polishing in staging isn't all that helpful. Daniel agreed that looking at very un-kernel coding styles was worthwhile in allowing fundamental course corrections to take place early on. Daniel is OK merging code that “violates half of the checkpatch.pl bikesheds” as long as it is up-to-date with the latest drm helpers and concepts.

Mauro Carvalho Chehab has the drivers/staging/media/ in his subsystem MAINTAINERS entry, thus getting notifications when things in staging change. Mauro said that they had successfully moved driver both from and to staging, but agreed that sometimes things get stuck in staging. Mauro suggests a robot that notifies people of things stuck in staging for too long, and automatically dropping them if no action is taken. Jonathan Cameron said that IIO staging driver patches are also handled on the same mailing list as non-staging patches, and suggests use of this more generally. Takashi agreed that this approach could be quite useful (twice!), but feels that it should be decided on a maintainer-by-maintainer basis. Takashi would like more sharing of experiences, both patterns and anti-patterns. Laurent Pinchart gave an anti-pattern in the form of a large driver that was dropped into staging and then left to bitrot. Tim Bird wondered if Greg's Free Linux Driver project was still active, though he did wonder if the driver in question would really qualify, given that it was produced by a large corporation. Laurent hinted that the fact that this driver comprised more than 200K lines of code spread across 920 files might indeed disqualify it. Laurent said that he felt that this was a case of staging working to the community's benefit in that the dump-and-run for this driver occurred in staging rather than in the main subsystem. Mauro guessed that although the submitter might have intended to maintain the driver, perhaps Spectre and Meltdown had other ideas. Mauro nevertheless is in favor of dropping drivers from staging when they are not getting any attention. Greg confirmed that the Free Linux Driver project is still active. He also said that the large driver really had been abandoned, and had therefore been removed from staging. Greg thus agreed that this was a case of staging working properly.