- 17 Aug, 2017 3 commits
-
-
spiiroin authored
It seems that kernels in many if not all devices ignore writing of empty string to ffs function control file - the function list is left as it were and this can cause subtle issues on the next cable connect. On the other hand writing a non-existing "function" will clear the function list, but causes write error to be reported. Treat attempts to clear function list as a special case so that non-empty string gets written and the resulting write error is ignored under normal logging verbosity. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
When debugging order and timing of issues related to several processes it is handy to have signals emitted by usb-moded in the journal along with the other related logging. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
When debugging usb-moded it is time consuming to find where the various debug messages originate from. When logging to stderr, prefix the messages with source code position info similar as gcc uses for reporting compilation issues. This allows browsing usb-moded code with jump to the next error functionality available in many text editors. Since the amount of information passed to logging functions is significantly increased, check whether the message would be emitted or not before evaluating formatting parameters etc. Also make variables relating to logging level, type, etc available only via accessor functions. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 05 May, 2017 2 commits
-
-
spiiroin authored
-
- 26 Apr, 2017 11 commits
-
-
spiiroin authored
Some dsmesock disconnect issues were found from mce code tree. As the usb-moded code is derived from mce, similar fixes need to be made also here. Avoid recursive process watchdog quits during disconnect by doing the quitting only once / connect after removal of socket io watch. Drop reconnect attempts on I/O error situations as they are unlikely to do any good and can lead to further recursive behavior. Do not initiate new dsmesock connections while device is shutting down. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
-
spiiroin authored
Check if there are unexpected changes to sysfs values that are supposed to be controlled by usb-moded when handling dsme process watchdog ping-pong. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
When porting to new devices it is easy to miss usb related control actions taken for example by android init scripts and the resulting conflicts with usb-moded logic might be difficult to spot and/or debug. Keep track of sysfs values written by usb-moded and add functionality for checking if something else has overruled the settings made by usb-moded. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
When debugging configuration issues, it is sometimes hard to tell where the various sysfs control writes are made from. To ease debugging, log also call site when logging sysfs writes. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
In addition to ensuring that usb-moded gets restarted in case it gets stuck, the process watchdog ping-pong allows scheduling of maintenance tasks at times when system is going to be active anyway. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
While android initialization scripts typically set up the usb serial number, it might happen at wrong time from usb-moded point of view and we in general want to minimize the amount of android init that is needed/used for running sfos. Use usb serial number parsed from kernel command line when initializing default usb properties. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Use of "none" string as no-usb-function place holder causes journal spamming as kernels are likely to return EINVAL error when it is actually used. Substitute "none" with empty string when written to usb function control file. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
The idea seems to be that when usb-moded is executed in "normal manner" it logs warnings / more server issues to syslog and possible output from subprocesses executed by usb-moded gets redirected to /dev/null to avoid journal spamming. However, now the redirection happens also when explicitly requesting logging to stderr. Redirect standard outputs only when neither debug logging nor logging to stderr is requested. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
The systemd development packages have changed and there are build time warnings like: sd_notify was moved to libsystemd. Do not use libsystemd-daemon. Use libsystemd as instructed. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 24 Mar, 2017 7 commits
-
-
spiiroin authored
-
spiiroin authored
Since usb-moded is using Type=Notify, specifying a BusName leads to systemd complaining: "usb-moded.service: Service has a D-Bus service name specified, but is not of type dbus. Ignoring." Remove BusName specification from the usb-moded.service file. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Calling popen() function indicates that usb-moded mainloop is blocked until the subprocess finishes and it is difficult to tell whether such things occur or not. When in verbose mode, log subprocesses executed via popen(). Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Calling the likes of sleep() function blocks usb-moded mainloop. Whether the sleeps add up to something significant is difficult to tell. When in verbose mode, log all blocking sleeps made by usb-moded. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Calling system() function blocks usb-moded mainloop until the subprocess finishes. Additionally usb-moded mostly does not check whether the calls succeeded or not. When in verbose mode, log execution of subprocesses. If system() returns non-zero exit value, log a warning to indicate potentially failed command execution. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
When doing code tweaking and manual builds with mb script, unconditionally running autogen and configure leads to unnecessary full rebuilds every time. Skip autogen and configure steps if they have already been done (based on the existence of Makefile). Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 13 Mar, 2017 4 commits
-
-
spiiroin authored
-
spiiroin authored
Undocumented structures cause warnings during documentation generation. Add missing doxygen documentation comments for structures. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
The is_in_user_state() is used unconditionally, but it is available only when --enable-meegodevlock option has been passed to configure. Also, the related "usb_moded-dsme.h" is included both unconditionally and from withing a #ifdef MEEGOLOCK block - which hides the configuration problem until build proceeds to linking phase. Make the call is_in_user_state() only if MEEGOLOCK is defined. Remove the extraneous "usb_moded-dsme.h" include to make such errors visible already in compilation stage due to missing prototypes. Also, make sure the "usb_moded-dsme.h" can't be included without warnings unless MEEGOLOCK is defined. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 06 Mar, 2017 1 commit
-
-
Matti Kosola authored
Update project URL See merge request !22
-
- 14 Feb, 2017 6 commits
-
-
spiiroin authored
-
spiiroin authored
Whether and when we can switch for example from charging fallback to developer mode depends on multiple triggers - the order of which might vary from one device/bootup to another. Using custom state evaluation code at each possible trigger location easily causes unexpected results like device staying in fallback charging mode until the cable is re-attached. Add a state evaluation function and call it from those triggers that potentially allow exit from the charging fallback mode. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
It is confusing to have a function called usb_moded_get_export_permission() that returns true when exporting is *not* permitted. Flip the return value to increase code readability. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Having possibility to log wakelocking activity is useful in some special circumstance, but it creates a lot of noise and usb-moded is lacking fine tuned logging control. Disable wakelock logging altogether by default. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
spiiroin authored
Remove -Wdeclaration-after-statement as first using -std=gnu99 to allow c99 features and then explicitly requesting warnings about using c99 features makes little sense. Remove -W option as it is just backwards compatibility alias for -Wextra. Remove -Wformat as it is implied by having -Wall present. Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
-
- 31 Jan, 2017 3 commits
-
-
spiiroin authored
-
Andrew den Exter authored
-
- 07 Dec, 2016 3 commits
-
-
Lourens-Rich authored
-
spiiroin authored
Forgot to add bug ref to commit, so 0.86.0+mer8 got rejected by ci-bot. Make a dummy version bump and add bug ref to make ci-bot happy. [ssu] Use ssusysinfo instead of SSU D-Bus interface. Fixes JB#36841
-
spiiroin authored
-