Viresh Kumar [Wed, 3 Aug 2016 22:52:10 +0000 (15:52 -0700)]
greybus: gpio: create irqdomain before registering gpio controller
If a gpio line is getting used for an irq, gpio core will create
/proc/irq/X/gpiolib/ directory for it. This directory gets removed while
the gpio controller is unregistered.
In case of greybus, gb_gpio_irqchip_add() creates an irqdomain and
creates irq mappings for the gpio lines. Currently they are added after
registering the gpio controller and removed before the gpio controller
is removed. On the removal path, while the core tries to remove the irq
directory (/proc/irq/X), it finds that the irq is still getting used and
a "gpiolib" directory is present within it and so it gives this warning:
Steps to reproduce:
$ cd /sys/class/gpio
$ echo X > export
$ echo both > gpioX/edge
$ echo <interface-number> > /sys/bus/greybus/devices/1-svc/intf_eject
Also note that registering the gpio controller before creating irqdomain
is incorrect as well and may lead to kernel panic, as a gpio may get
requested as an interrupt source right after the controller is
registered, and the greybus gpio driver wouldn't be fully ready by then.
This patch changes the sequence in both probe() and remove() to fix it.
We only care about one bulk out endpoint, the first one, so remove
the pretense of keeping an array of these things. Just grab the first
one in the list and run away!
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Philip Yang [Wed, 31 Aug 2016 03:11:18 +0000 (11:11 +0800)]
greybus: power_supply: Add runtime pm support
Modify Power_supply greybus driver to support runtime PM framework.
During charging state, the driver will block remote device of suspending,
and then enables runtime suspend when remote device is in none chargin
state.
Testing Done: Compiled and verified on EVT2, EVT2 1x2 GPB test module
and Device class daughter board.
Signed-off-by: Philip Yang <yang_philip@projectara.com> Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Now jack-button are registered to snd framework based on capabilities
populated by codec module's topology data. Thus, valid ids for button
events can also vary for different modules. This patch modifies existing
button reporting mechanism to avoid reporting spurious button events for
invalid button ids.
Now jack & jack-buttons are registered to snd_jack framework based on
the capability shared by module's topology data. Thus, jack events
should be reported to above snd framework only in case corresponding
jack type is registered. This patch adds additional checks to avoid
reporting fake jack events.
greybus: audio: Fetch jack_mask, button_mask from module's topology data
Added extra fields namely jack_mask & button_mask for each module_info.
These fields are required while registering jack & reporting jack
events.
Earlier, these were hard coded values assuming fixed capabilities say
HEADSET, LINEOUT, etc. supported by GB-codec driver. Now these are
computed dynamically based on module's jack capability shared via
topology data.
greybus: audio: Added jack_type support in topology struct
This patch adds extra field jack_type to gb_audio_topology struct. Also,
it defines bit fields to be used by module while defining it's jack and
jack-button capabilities.
Currently, module can populate a single jack and associated buttons. In
case multiple jacks are supported data routing (say duplicating, etc.)
should be handled within module's FW. It can populate additional mixer
controls to do so.
greybus: audio: Remove unnecessary num_jack field from module_info
snd_jack will be registered based on real capabilities shared by
module's FW instead of parsing widgets and register it with fixed
capabilities. Remove module_info->num_jack, since it is no more
required.
Johan Hovold [Fri, 26 Aug 2016 10:55:47 +0000 (12:55 +0200)]
greybus: es2: implement flush callback
Implement the flush callback which is called as part of connection tear
down to flush host-device queues and stop any ongoing transfers.
Note that this should be considered an optimisation of sort since if
the CPort is stuck waiting for credit, the CPort is likely still stuck
when we try to send the cport_shutdown request over it after the
callback returns.
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Rui Miguel Silva [Fri, 26 Aug 2016 10:52:05 +0000 (11:52 +0100)]
greybus: power_supply: fix name setting location
We were checking for existing power supply names in the wrong place,
i.e, we were checking before any of the module power supply were
registered, because of that of course no name collision was detected.
Move the check to the register loop and with that we guarantee that this
mechanism works for greybus power supply naming.
Tested: using gbsim and using power supply with the same name and check
that: 1. no problems creating sysfs entries; 2. naming is done following
the desired rules.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Kris Huang [Thu, 25 Aug 2016 08:57:14 +0000 (16:57 +0800)]
greybus: lights: Control runtime pm suspend/resume on AP side
According to runtime pm architecture, the kernel side driver should be
as smart as needed to know when the module is idle or active, so that it can
issue the suspend/resume operations to the firmware side at the right time.
To add logics prevents AP from issuing the suspend request to the firmware
when a channel turning to active state, and put it to suspend if the state
is going to inactive with still holding a reference.
Testing Done: Compiled and verified on EVT2 and gpbridge-test module
with device class daughter board.
David Lin [Mon, 22 Aug 2016 22:51:11 +0000 (15:51 -0700)]
greybus: light: fix incorrect led attribute files allocation
Fix incorrect attribute size when the channel supports fader, as well as
fixing the issue that the attribute list is not null terminated.
Testing Done:
- Verified by setting brightness and color on red/green/blue leds
of the device class test board.
Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Mark Greer [Sat, 20 Aug 2016 23:25:06 +0000 (16:25 -0700)]
greybus: audio: Fix incorrect direction value when enabling RX
The direction value passed to gb_audio_apbridgea_register_cport()
in the gbaudio_module_enable_rx() routine is TX and not RX like
it should be so fix it.
Testing Done: Recorded microphone data from a headset.
Signed-off-by: Mark Greer <mgreer@animalcreek.com> Fixes: c80e7c6fafa5 ("audio: Split helper APIs based on stream direction") Tested-by: Vaibhav Agarwal <vaibhav.agarwal@linaro.org> Reviewd-by: Vaibhav Agarwal <vaibhav.agarwal@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Johan Hovold [Fri, 19 Aug 2016 07:42:21 +0000 (09:42 +0200)]
greybus: svc: drop unnecessary symbol exports
The svc functions are only supposed to be called by core and should not
be exported.
Most of these functions should never have been exported in the first
place, while a few no longer needs to be (e.g. since core gained support
for offloaded connections).
The only remaining exception is gb_svc_intf_set_power_mode() which is
needed by the camera driver until proper link management is in place.
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Johan Hovold [Thu, 18 Aug 2016 15:43:22 +0000 (17:43 +0200)]
greybus: svc: drop all symbol exports
The svc functions are only supposed to be called by core and should not
be exported.
Most of these functions should never have been exported in the first
place, while a few no longer needs to be (e.g. since core gained support
for offloaded connections).
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Rui Miguel Silva [Tue, 16 Aug 2016 21:31:57 +0000 (22:31 +0100)]
greybus: power_supply: invalidate cache at update request
When we receive a update request we shall not trust the cache mechanism
and for that we need a way to invalidate the cache. Add a field that
will control the cache status and refactor the code to check if cache is
valid in a helper function.
This will fix the scenario where an update request is received within
the cache expiration time after a previous update as happened and would
be ignored.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Rui Miguel Silva [Tue, 16 Aug 2016 21:31:56 +0000 (22:31 +0100)]
greybus: power_supply: fix update interval check at request handler
We use the update interval to control the remove path and we set it to
zero when we do not want to have more updates in transit. That means
that the check in the request handler needs to be for interval update
zero to discard the newly received request and not the other way around
like it is.
This will fix the issue that all incoming requests were being discard.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Rui Miguel Silva [Tue, 16 Aug 2016 21:31:55 +0000 (22:31 +0100)]
greybus: power_supply: add callback to handle power supply changes
When checking for property changes we may need to act upon that change
besides reporting it using power_supply_changed. So, add a function that
will be call if the specific property changed.
As at it, adjust some indentation of the psy_props_changes array.
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Vaibhav Agarwal [Tue, 16 Aug 2016 07:06:50 +0000 (12:36 +0530)]
greybus: audio: Add check for invalid index while mapping control
While mapping control id to define DAPM routes, invalid control index
may cause kernel oops. Add extra check to validate index while mapping
names to control_id.
Ann Chen [Wed, 17 Aug 2016 08:38:56 +0000 (16:38 +0800)]
greybus: Add workqueue to handle vibrator timeout
In the beginning, module side can control the vibrator timeout value,
it can disable vibrator until timeout. But after Runtime PM control added
in, AP side didn't know when module can be suspended, the vibrator
task will be interrupted by suspending event.
Because of this problem, the module can not be in charge of counting down
the timeout value, it is now up to the AP to manage this. So add workqueue
to handle the vibrator timeout.
Jacopo Mondi [Fri, 12 Aug 2016 08:05:41 +0000 (10:05 +0200)]
greybus: camera: Remove support for legacy modules
Remove support for module implementing legacy version of camera bandwidth
requirements specifications, now that all available camera modules have
been updated to use the new version
Viresh Kumar [Thu, 11 Aug 2016 20:27:25 +0000 (13:27 -0700)]
greybus: firmware: add comment to show size calculations
The firmware file name's maximum length is set to 56 right now, but it
isn't very much readable how we got to that value (unless someone reads
that line).
Johan Hovold [Wed, 10 Aug 2016 10:58:46 +0000 (12:58 +0200)]
greybus: control: make disconnecting a core operation
Make the control-protocol disconnecting operation a "core" operation.
This is needed to be able to use the operation in the new connection
tear-down sequence of control connections, which moves disconnecting
after the flush barrier.
Johan Hovold [Wed, 10 Aug 2016 10:58:45 +0000 (12:58 +0200)]
greybus: hd: add cport_shutdown callback
Add a host-device cport_shutdown callback which will be called as part
of the new connection tear-down sequence for offloaded connection in
order to do a cport_shutdown operation on behalf of the AP.
Johan Hovold [Wed, 10 Aug 2016 10:58:43 +0000 (12:58 +0200)]
greybus: hd/es2: add cport_quiesce callback and ARPC
Add a host-device cport_quiesce callback, which will be called as part
of the new connection tear-down sequence to disable flow control after
first making sure that enough peer buffer space is available for the
next messages about to be sent.
Johan Hovold [Wed, 10 Aug 2016 10:58:42 +0000 (12:58 +0200)]
greybus: hd/es2: add cport_connected callback and ARPC
Add a host-device cport_connected callback, which will be called after a
connection has been created and that can be used by the host-device
driver to make sure its internal state is updated to match the CPort
attributes set by the SVC.
This callback will eventually replace the cport_features_enable
callback.
Kris Huang [Tue, 9 Aug 2016 03:28:37 +0000 (11:28 +0800)]
greybus: lights: enable multi color LED support
A backport (commit 79c4de08c0e5a26b04a4ac9e6543dad6379f0b40) was
applied in kernel which adding attribute-group support in led-class.
Remove the LED_HAVE_GROUPS flag check entirely that allow led
drivers to create custom attributes like color/fade_in/fade_out.
Testing Done: Compiled and verified on EVT2 and gpbridge-test module
with device class daughter board.
Georgi Dobrev [Tue, 9 Aug 2016 21:37:32 +0000 (14:37 -0700)]
greybus: greybus-driver: Add intf_oops operation
Add intf_oops operation to SVC Protocol. This
operation will notify the AP about a fatal error
in a module. The request has two arguments:
-u8 intf - the interface in question
-u8 reason - reason of the error
The response has no payload.
Upon receiving the Request, the driver disables
the Interface.
Adjust maximum segment size of the sg list to meet the maximum request
size, this will allow to have less segments which increase the
performance of data movement during transfer operations.
Test Done: using mmc_test with best-case read/write performance and see
that only one segment is used and that the results are better (288KiB vs
300KiB in read operation).
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
When enabling an interface, control device should be registered after
having successfully added the timesync. Similarly for the interface
disable path, control device should be removed first before removing
timesync.
Testing Done:
- Enable and disable the interface
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Suggested-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: David Lin <dtwlin@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Vaibhav Agarwal [Fri, 5 Aug 2016 12:46:30 +0000 (18:16 +0530)]
greybus: audio: Report jack removal along with module removal
For GB module with jack slot supported, headset/headphone can still
be inserted at the time of module removal. In this case, above layer is
unaware about jack removal event which happened due to module removal.
This may lead to inconsistent state in above HAL layer. Fix this by
reporting jack removal event explicitly.
Kris Huang [Fri, 5 Aug 2016 04:59:08 +0000 (12:59 +0800)]
greybus: lights: Add runtime pm support
Modify Lights greybus driver to support runtime PM framework.
The suspend and resume function have been tested with gpbridge-test
image by sysfs. Lights functions work well on suspend/resume.
Testing Done: Compiled and verified on EVT2 and gpbridge-test module
with device class daughter board.
Jackson Chang [Fri, 5 Aug 2016 02:22:02 +0000 (10:22 +0800)]
greybus: SDIO: Add runtime pm support
Modify SDIO greybus driver to support runtime PM framework.
To enable SDIO runtime PM, it needs to remove MMC_CAP_NEEDS_POLL
and add MMC_CAP2_CORE_RUNTIME_PM in set_host_caps().
The suspend function and resume function have been tested
with micron-sdio image by sysfs. SDIO functions work well
on suspend/resume.
Testing Done: Compiled and verified on EVT2.0 + Micron ARA
SD module with USB connector
Signed-off-by: Jackson Chang <chang_jackson@projectara.com> Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Vaibhav Agarwal [Thu, 4 Aug 2016 09:44:39 +0000 (15:14 +0530)]
greybus: audio: Maintain module stream state for each data connection
For SPK module, each data connection corresponds to codec DAI. Now
stream state is maintained for each DAI. So, need to maintain stream
state for each DAI/data connection for individual module as well.
Vaibhav Agarwal [Thu, 4 Aug 2016 09:44:38 +0000 (15:14 +0530)]
greybus: audio: Maintain runtime stream params for each DAI
Runtime streams are required while configuring GB module plugged-in
during active stream. Currently, it is maintained for single stream.
However, this should be maintained for a stream corresponding to each
DAI. Fix this!
Vaibhav Agarwal [Thu, 4 Aug 2016 09:44:35 +0000 (15:14 +0530)]
greybus: audio: Find data connection based on id
Currently we are using dai->name to identify data connection from list
for a module. Now since we are enabling data path based on widget,
dai->name might be invalid by the time driver receives disable request
for a widget. So, use id fetched from AIF widget->sname to identify data
connection for a module.
Vaibhav Agarwal [Thu, 4 Aug 2016 09:44:33 +0000 (15:14 +0530)]
greybus: audio: Use AIF widget to enable path between module & APB
Currently, SPK Amp switch is used to identify when to enable data path
between module and APB. With headset, other switch controls added, it is
not possible to use this switch to control data path. Instead path
should be established based on AIF widget.
Vaibhav Agarwal [Thu, 4 Aug 2016 09:44:32 +0000 (15:14 +0530)]
greybus: audio: Update parameters for gbaudio_module_update API
Earlier, module path was enabled based on module's control switch e.g.
'SPK Amp switch'. Thus widget's name was sufficient to parse and
identify the direction. Now individual modules' path will be enabled
based on AIF widget status. So, it is required to get complete widget
details, say w->type is used to identify direction (playback/capture)
and w->sname is used to identify module's DATA connection used for
communication via greybus.
Vaibhav Agarwal [Thu, 4 Aug 2016 09:44:31 +0000 (15:14 +0530)]
greybus: audio: Update dai_driver table with appropriate fields
Currently, the stream name for the DAI driver is generically set to "GB
Audio Playback" and "GB Audio Capture". This is OK since we use a single
interface on APB1 but that could change in the future. Update the DAI
driver table entries to properly reflect the interface used.
Vaibhav Agarwal [Thu, 4 Aug 2016 09:44:30 +0000 (15:14 +0530)]
greybus: audio: Split helper APIs based on stream direction
Now, module is enabled/disabled based on widget event only and not
during startup/shutdown callbacks. Thus, we needn't compare codec_state
in enable/disable module helper APIs. Also, these can be further
simplified based on stream direction.
Vaibhav Agarwal [Thu, 4 Aug 2016 09:44:29 +0000 (15:14 +0530)]
greybus: audio: Enable audio path based on control switch state only
As per current implementation, audio data is played from each individual
SPK module connected to endo frame. This is not a valid requirement in
case of capture/headset path. So, provide a mechanism to enable
individual module path based on it's control switch state.
For most of the helper functions, goto statement is widely used. It was
originally used with an intent of single exit point for the function
with some cleanup required. This is no more the case. So, simplify code
by avoiding un-necessary gotos.
greybus: arche-platform: Add support for SPI bus sharing for Mihi
In case of Mihi, SPI bus is shared between APB1 and APB2
SPI ROMs, so their FW flashing must be sequential and
arche-platform driver should make sure that they are mutual
exclusive in nature.
So this patch adds certain restrictions to the user of the
arche-platform driver,
- User can no longer flash APB1 and APB2 SPI ROM in parallel
- SPI bus becomes an resource, so user must claim it by moving
respective APB device into FW_FLASHING mode and release it
by exiting FW_FLASHING mode. User can exit FW_FLASHING mode by
switching to any other modes (ACTIVE, OFF, STANDBY).
- If APB1 is in FW_FLASHING mode, APB2 can no longer enter into
FW_FLASHING mode. User will get -EBUSY.
Having said that, while APB1 is into FW_FLASHING mode,
APB2 can independently boot from its own SPI ROM.
Testing Done: Tested by simulating usecase on EVT2.
- Made sure that APB1 and APB2 FW_FLASHING mode is mutual exclusive
in nature. Confirmed that an attempt on second device return -EBUSY.
- Added simulating code, where printed state of dummy gpio for
spi-en and verified that it shows right pin status for both APBs
greybus: arche-platform: Reset SVC & APB only if turned off by SUSPEND_PREPARE
There is possible race condition in arche platform driver for
maintaining of ->state field, when shared with timesync driver.
Assume device booted fine, all connected modules have been enumerated
correctly. As part of suspend-resume operation we have pm_notifier
callback, where we turn off SVC & APB and coldboot on resume.
In the process of resume, all modules gets enumerated again, and
timesync driver does come into picture everytime.
So when timesync driver requests arche-platform to change the state
to TIMESYNC and in the middle of sync operation, if suspend gets
triggered, then execution lands into arche-platform->pm_notifier callback,
leading to race condition in the driver, where it checks for (state != ACTIVE)
in PM_SUSPEND_PREPARE and returns, but in PM_POST_SUSPEND it just simply
coldboots SVC & APB, which would inbalance all resources (including IRQ).
So we need a add check in PM_POST_SUSPEND, to make sure that, we only
coldboot devices if they are in to off state,
i.e. if (state != OFF) then return.
Testing Done: Done regressive suspend/resume testing on EVT2 platform.
Note that, I some time hit issue.
Johan Hovold [Wed, 3 Aug 2016 12:09:34 +0000 (14:09 +0200)]
greybus: es2: add define for ARPC CPort requests
Add dedicated define for ARPC CPort requests instead of using the
default timeout for USB vendor requests.
We still allow responses to take 500 ms to arrive, but note that this
adds on top of the 500ms already allowed for a requests to be
acknowledged. This should probably be tightened up at some point.
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
The 'GB_AUDIO_TYPE_GET_TX_DELAY' and 'GB_AUDIO_TYPE_GET_RX_DELAY'
are no longer a part of the Greybus Audio Device Class Protocol
so remove support for them. The message numbers are not coalesced
to prevent compatibility issues between the AP and the module.
Testing Done: Played music using a speaker module
Signed-off-by: Mark Greer <mgreer@animalcreek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
The 'AUDIO_APBRIDGEA_TYPE_GET_TX_DELAY' and
'AUDIO_APBRIDGEA_TYPE_GET_RX_DELAY' message types have been
removed from the AP <-> APBrigdeA Audio Protocol so remove
them from the code. Do not coalesce the message type numbers
to prevent compatibility issues between the AP and APBridgeA.
Testing Done: Played music using a speaker module
Signed-off-by: Mark Greer <mgreer@animalcreek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
greybus: timesync: Printout strobe count on sync failure
If we failed to synchronize the FrameTime it would be useful to know how
many of the expected strobes arrived, for example a value of 0/5 would
indicate the SVC was completely dead but a value of 4/5 would indicate one
GPIO pulse got lost i.e. the AP was too slow reacting to an interrupt and
completely missed one of the strobe events. In either case the actual
number of strobes is a useful thing to print out.
The guard for initiating a new synchronization operation should allow for
that resync to happen in every single state except for INVALID. This patch
fixes by ensuring the guard does just that. With local testing it was
possible to break a sync to a Module. This hasn't been observed in a buglog
but should be fixed anyway.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Acked-by: David Lin <dtwlin@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
It's possible the AP could miss an incoming SVC timesync pulse i.e. the AP
could have interrupts switched off for long enough that one SVC GPIO strobe
ends up over-lapping another one. TimeSync should be able to deal with this
type of transitory failure by retrying a failed synchronous TimeSync resync
up to 'n' number of times. For this patch 'n' has been set to five, which
is a hand-wavy choice that 'feels' right.
David Lin [Tue, 2 Aug 2016 22:34:46 +0000 (15:34 -0700)]
greybus: interface: delete control device upon enable failure
There is an issue that when an interface failed to be enabled due to
timesync failure, a previously added control device is not deleted as
part of the error clean-up. This causes a leak in the sysfs file when
the interface is disabled. This would eventually cause this particular
interface to be unable to register future control device even after
unipro_reset. See failure logs below:
Johan Hovold [Wed, 27 Jul 2016 14:37:22 +0000 (16:37 +0200)]
greybus: es2: fix arpc active-list corruption
Fix ARPC active-list corruption due to incorrect list-interface usage.
The corruption manifested itself as ARPC timeouts due to expected
responses not being recognised whenever more than one ARPC was active.
This could be seen for example when two interfaces were being runtime
suspended in parallel:
[ 165.739896] usb 1-1.1: invalid arpc response id received: 13
[ 165.794743] greybus 1-5.5: gb_interface_refclk_set - 0
[ 166.241202] usb 1-1.1: failed to execute ARPC: -110
Fortunately the impact of this bug has so far been limited to such
timeouts and error messages due to ARPC currently only being used for
CPort reset in the connection tear-down path.
Reported-by: Mark Greer <mgreer@animalcreek.com> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
The wrong pointer was checked for allocation failures when allocating
the ARPC response buffer, something which would lead to allocation
failures going undetected.
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
David Lin [Mon, 25 Jul 2016 23:29:20 +0000 (16:29 -0700)]
greybus: audio: add runtime pm to enumerated control and DAPM widget
There's an issue that the userspace is not able to control both the
enumerated control and DAPM widget when audio bundle is in the SUSPEND
state. This patch fixes the issue by adding pm_runtime_get/put() calls
for the both controls.
Testing Done:
- Use tinymix to get and put both enumerated control and DAPM widget as
the followings, and observe audio bundle is able to wake up from
suspend.
David Lin [Tue, 26 Jul 2016 23:27:28 +0000 (16:27 -0700)]
greybus: svc_watchdog: Add sysfs file to change the behavior of bite
Currently, AP performs unipro_reset if SVC fails to response to its
ping. While this error recovery is best suited for the end-user
experience, errors in the UniPro network could potentially go unnoticed
by the QA and fishfooders in the development phase of the project. This
patch adds an option to trigger a kernel panic so logs can be collected
for analysis.
Testing Done:
- Reproduce issue and observe kernel panic when
watchdob_control is changed to 'panic'
Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>