Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 351376 - genkernel: enable CONFIG_PM_RUNTIME and CONFIG_USB_SUSPEND
Summary: genkernel: enable CONFIG_PM_RUNTIME and CONFIG_USB_SUSPEND
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2011-01-11 17:28 UTC by Clemente Aguiar
Modified: 2011-01-31 14:56 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Clemente Aguiar 2011-01-11 17:28:21 UTC
I have GNOME desktop, and if I selected "Safely Remove Drive" on a USB pen drive I would get an error similar to this:
-----
unable to stop drive

Error detaching: helper exited with exit code 1: Detaching device /dev/sde
USB device: /sys/devices/pci0000:00/0000:00:1d.7/usb5/5-6)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: OK
Unbinding USB interface driver: OK
Suspending USB device: FAILED: Cannot open /sys/devices/pci0000:00/0000:00:1d.7/usb5/5-6/power/level for writing: No such file or directory
------
After I rebuild the kernel with CONFIG_PM_RUNTIME and CONFIG_USB_SUSPEND enabled, as per suggestion in this forum http://forums.gentoo.org/viewtopic-t-831606-start-0.html, it worked.

Reproducible: Always




$ eix -I genkernel
[I] sys-kernel/genkernel
     Available versions:  3.4.10-r1 3.4.10-r2 3.4.10.906{tbz2} 3.4.10.907{tbz2} ~3.4.10.907-r1 ~3.4.10.908 **9999 **99999 {bash-completion ibm selinux}
     Installed versions:  3.4.10.907{tbz2}(11:57:37 14-09-2010)(-bash-completion -ibm -selinux)
     Homepage:            http://www.gentoo.org
     Description:         Gentoo automatic kernel building scripts

$ emerge --info
Portage 2.1.9.25 (default/linux/amd64/10.0/desktop/gnome, gcc-4.4.4, glibc-2.11.2-r3, 2.6.36-gentoo-r5 x86_64)
=================================================================
System uname: Linux-2.6.36-gentoo-r5-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E6750_@_2.66GHz-with-gentoo-1.12.14
Timestamp of tree: Mon, 10 Jan 2011 23:50:01 +0000
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11-r1
dev-lang/python:     2.6.6-r1, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.14-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=nocona -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/openvpn/easy-rsa /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=nocona -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y"
FEATURES="assume-digests binpkg-logs buildpkg distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="pt_PT.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="pt_PT pt en"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/sunrise /usr/local/portage"
SYNC="rsync://mero.madeiratecnopolo.pt/gentoo-portage"
USE="X a52 aac acl acpi ads alsa amd64 avahi berkdb bluetooth branding bzip2 cairo cdda cddb cdio cdparanoia cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr eds emboss encode evo exif fam ffmpeg firefox flac fortran gdbm gdu gif gnome gnome-keyring gnome-print gpm gstreamer gtk h323 iconv id3tag ipv6 ithreads java jpeg kerberos lame lcms ldap libnotify live logrotate mad matroska mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib musepac musepack nautilus ncurses network networkmanager nls nptl nptlonly nsplugin nvidia ogg opengl openmp pam pango pcre pdf perl png policykit ppds pppd python qt3support qt4 quicktime readline samba sdl session sip smp spell sse sse2 ssl ssse3 startup-notification svg sysfs tcpd theora threads tiff truetype tta udev unicode usb vorbis wav wavpack wma wmf x264 xcb xml xorg xulrunner xv xvid xvmc zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pt_PT pt en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia vga" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2011-01-12 11:24:47 UTC
I'd just like to add:

- It's sys-fs/udisks that need CONFIG_USB_SUSPEND. The udisks ebuild has a check for it. This would be an issue for GNOME too, since gvfs is using gnome-disk-utility which is using udisks.

- On x86 and x86_64, kernel's default config has =y for CONFIG_USB_SUSPEND. Does genkernel somehow disable the kernel defaults? I really don't know, I've never used genkernel myself.
Comment 2 Sebastian Pipping gentoo-dev 2011-01-22 00:35:55 UTC
It seems that if you're on x86 or amd64 you currently get a kernel with CONFIG_USB_SUSPEND disabled from genkernel:

# fgrep -R CONFIG_USB_SUSPEND .
./defaults/kernel-config:# CONFIG_USB_SUSPEND is not set
./arch/ppc/kernel-config:CONFIG_USB_SUSPEND=y
./arch/x86_64/kernel-config:# CONFIG_USB_SUSPEND is not set
./arch/ia64/kernel-config:# CONFIG_USB_SUSPEND is not set
./arch/x86/kernel-config:# CONFIG_USB_SUSPEND is not set

# fgrep -R CONFIG_PM_RUNTIME .

I have now enabled CONFIG_USB_SUSPEN on x86/amd64 for you.
Please test by emerging genkernel-99999 (five nines).

http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commitdiff;h=954670ea2ffafa55e29c2b50aaf83a85eb3bf265

If needed, please re-open this bug.
Comment 3 Clemente Aguiar 2011-01-24 16:07:52 UTC
I have emerged genkernel-9999 and tested it, but unfortunately it is still not working for me.

I am using latest stable gentoo-sources kernel (sys-kernel/gentoo-sources-2.6.36-r5)

I run:
$ genkernel all

If I grep the config files in /usr/src/linux I get the following:

$ grep CONFIG_PM_RUNTIME .config*
.config:# CONFIG_PM_RUNTIME is not set

The .config file has neither CONFIG_PM_RUNTIME nor CONFIG_USB_SUSPEND enabled.

$ grep CONFIG_USB_SUSPEND .config*
.config.old:CONFIG_USB_SUSPEND=y

The .config.old file has the CONFIG_USB_SUSPEND enabled, but not CONFIG_PM_RUNTIME.


When I look at the help for CONFIG_USB_SUSPEND of the "make menuconfig" I get the following information:

Symbol: USB_SUSPEND [=n]
Type  : boolean
Prompt: USB runtime power management (autosuspend) and wakeup
Defined at drivers/usb/core/Kconfig:93
Depends on: USB_SUPPORT [=y] && USB [=m] && PM_RUNTIME [=y]
Location: 
-> Device Drivers
-> USB support (USB_SUPPORT [=y])
-> Support for Host-side USB (USB [=m]) 


From this I gather that CONFIG_USB_SUSPEND is dependent of CONFIG_PM_RUNTIME, which means that CONFIG_PM_RUNTIME has also to be enabled in genkernel, is this not so?
Comment 4 Sebastian Pipping gentoo-dev 2011-01-30 01:13:59 UTC
I have applied "make oldconfig" of 2.6.36-gentoo-r5 to the config of x86_64 now

http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commitdiff;h=43a68e89d1d2727b55093061ac1fa8688e4abb6c

and enabled both switches using "make menuconfig"

http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commitdiff;h=f0b5065d61578883f88d9623b0febe504591de06

Please re-emerge genkernel-99999 (five nines) and report back.
Comment 5 Sebastian Pipping gentoo-dev 2011-01-30 22:38:38 UTC
genkernel 3.4.12.5 just hit the main tree, patches included.
Please re-open this bug as needed.
Comment 6 Clemente Aguiar 2011-01-31 14:56:38 UTC
Tried both genkernel 99999 and 3.4.12.5 and now it is ok.

$ grep CONFIG_PM_RUNTIME .config*
.config:CONFIG_PM_RUNTIME=y
.config.old:CONFIG_PM_RUNTIME=y

$ grep CONFIG_USB_SUSPEND .config*
.config:CONFIG_USB_SUSPEND=y
.config.old:CONFIG_USB_SUSPEND=y

thanks